[
  {
    "path": ".cirrus.yml",
    "content": "container:\n  image: andronixapp/package-builder:latest\n\n##\n##  When doing release builds (branch 'master'), update Docker image if\n##  required.\n##\ndocker_builder:\n  name: Update docker image\n\n  only_if: $CIRRUS_BRANCH == 'master'\n\n  env:\n    DOCKER_USERNAME: andronixapp\n    DOCKER_PASSWORD: ENCRYPTED[f1e136ddb0b71978bd017089b1ba5101d43e263b5e22d3121055b948890110b8f98208eb26424ffe4bdbd99a7a0502b5]\n\n  script: |\n    bash ./scripts/build/ci/cirrus-ci_dispatcher.sh --update-docker\n\n##\n##  Perform basic check for errors in build.sh package scripts.\n##  If error found, exit with error code to stop build.\n##\ntask:\n  container:\n    cpu: 1\n    memory: 4\n\n  name: Lint packages\n\n  timeout_in: 5m\n\n  depends_on:\n    - Update docker image\n\n  script: |\n    bash scripts/lint-packages.sh\n\n##\n##  Determine changes in the last push, find modified packages and\n##  build them for aarch64/arm/i686/x86_64 architectures.\n##\n##  Built packages are accessible from Cirrus CI web interface.\n##\ntask:\n  container:\n    # Max configuration required by few large packages such as `rust`.\n    cpu: 8\n    memory: 24\n\n  name: Build packages\n\n  # 2 hours is a maximal timeout available for free use.\n  timeout_in: 120m\n\n  depends_on:\n    - Lint packages\n\n  environment:\n    TERMUX_MAKE_PROCESSES: 8\n    matrix:\n      - TERMUX_ARCH: aarch64\n      - TERMUX_ARCH: arm\n      - TERMUX_ARCH: i686\n      - TERMUX_ARCH: x86_64\n\n  # Do not use built-in git client provided by Cirrus as it may\n  # cause problems when determining changed files.\n  clone_script: |\n    if [[ -z \"$CIRRUS_PR\" ]]; then\n      git clone --recursive --branch=\"$CIRRUS_BRANCH\" \"https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git\" \"$CIRRUS_WORKING_DIR\"\n      git reset --hard \"$CIRRUS_CHANGE_IN_REPO\"\n    else\n      git clone --recursive \"https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git\" \"$CIRRUS_WORKING_DIR\"\n      git fetch origin \"pull/$CIRRUS_PR/head:pull/$CIRRUS_PR\"\n      git reset --hard \"$CIRRUS_CHANGE_IN_REPO\"\n    fi\n\n  build_script: |\n    export TERMUX_DEBDIR=\"/tmp/debs-${TERMUX_ARCH}\"\n    ln -s \"$TERMUX_DEBDIR\" debs\n    bash ./scripts/build/ci/cirrus-ci_dispatcher.sh\n\n  aarch64_debs_cache:\n    folder: \"/tmp/debs-aarch64\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-aarch64\"\n\n  arm_debs_cache:\n    folder: \"/tmp/debs-arm\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-arm\"\n\n  i686_debs_cache:\n    folder: \"/tmp/debs-i686\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-i686\"\n\n  x86-64_debs_cache:\n    folder: \"/tmp/debs-x86_64\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-x86_64\"\n\n  output_artifacts:\n    path: \"./debs/*.deb\"\n\n##\n##  When doing release build (branch 'master'), upload built packages\n##  to APT repository on Bintray.\n##\ntask:\n  container:\n    cpu: 1\n    memory: 4\n\n  name: Upload packages to Bintray\n\n  only_if: $CIRRUS_BRANCH == 'master'\n\n  timeout_in: 60m\n\n  depends_on:\n    - Build packages\n\n  environment:\n    BINTRAY_USERNAME: imprakharshukla\n    BINTRAY_API_KEY: ENCRYPTED[6dd62eec639e531a066d198368d73a890d91f28d92652b4b7b4eed40a175c1bb13b43b66e74441c3d4b7e85d2eb3e808]\n    BINTRAY_GPG_SUBJECT: andronixapp\n    BINTRAY_GPG_PASSPHRASE: ENCRYPTED[c766a2569ac7b479de6aba07da6ba146e90d96013cdc8a86d1d68e4d76e9e855c05d93f8727d2838140856ff85ac655a]\n    TERMUX_ANDROID_HOME: /data/data/studio.com.techriz.andronix/files/home\n    TERMUX_PREFIX: /data/data/studio.com.techriz.andronix/files/usr\n\n  # Do not use built-in git client provided by Cirrus as it may\n  # cause problems when determining changed files.\n  clone_script: |\n    if [[ -z \"$CIRRUS_PR\" ]]; then\n      git clone --recursive --branch=\"$CIRRUS_BRANCH\" \"https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git\" \"$CIRRUS_WORKING_DIR\"\n      git reset --hard \"$CIRRUS_CHANGE_IN_REPO\"\n    else\n      git clone --recursive \"https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git\" \"$CIRRUS_WORKING_DIR\"\n      git fetch origin \"pull/$CIRRUS_PR/head:pull/$CIRRUS_PR\"\n      git reset --hard \"$CIRRUS_CHANGE_IN_REPO\"\n    fi\n\n  aarch64_debs_cache:\n    folder: \"./debs\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-aarch64\"\n\n  arm_debs_cache:\n    folder: \"./debs\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-arm\"\n\n  i686_debs_cache:\n    folder: \"./debs\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-i686\"\n\n  x86-64_debs_cache:\n    folder: \"./debs\"\n    fingerprint_script: echo \"${CIRRUS_CHANGE_IN_REPO}-x86_64\"\n\n  script: |\n    bash ./scripts/build/ci/cirrus-ci_dispatcher.sh --upload\n"
  },
  {
    "path": ".github/main.workflow",
    "content": "workflow \"Discord\" {\n  on = \"check_suite\"\n  resolves = \"Discord Webhook\"\n}\n\naction \"Discord Webhook\" {\n  uses = \"docker://cirrusactions/discord:latest\"\n  secrets = [\"WEBHOOK_URL\"]\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "### Vim ###\n[._]*.s[a-w][a-z]\n[._]s[a-w][a-z]\n*.un~\nSession.vim\n.netrwhist\n*~\n/debs/\n### Vagrant ###\nscripts/*.log\nscripts/.vagrant/\nenv.sh\n/scripts/env.sh\nenv.sh\n\nenv2.sh\n\nbootstrap-aarch64.zip\n\nbootstrap-arm.zip\n\nbootstrap-i686.zip\n\nbootstrap-x86_64.zip\n"
  },
  {
    "path": "LICENSE.md",
    "content": "# License for package patches\n\nThe scripts and patches to build each package is licensed under the same\nlicense as the actual package (so the patches and scripts to build bash are\nlicensed under the same license as bash, while the patches and scripts to build\npython are licensed under the same license as python).\n\n# License for the build infrastructure\n\nFor build infrastructure outside the `packages/` folder the license is\n[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n<img src=\"https://github.com/imprakharshukla/termux-packages/blob/master/Assests/github_banner.png\" height=\"715\" width=\"805\" />\n</p>\n\n&nbsp;\n\n&nbsp;\n\n&nbsp;\n\n\n[![build status](https://api.cirrus-ci.com/github/imprakharshukla/termux-packages.svg?branch=master)](https://cirrus-ci.com/andronixapp/termux-packages)\n\nThis project contains all the essential packages and utilities required to build packages for **Termux integrated within Andronix**.\n  <br></br>\n\nFind the packages @ [official Andronix Repository](https://androfile.online)\n  <br></br>\n\n\n> 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).***\n\n  <br></br>\n\nTermux package management quick how-to available on https://github.com/imprakharshukla/termux-packages/wiki.\n\nTo learn about using our build environment, read the [Developer's Wiki](https://github.com/imprakharshukla/termux-packages/wiki).\n\n  \n\n## Project structure\n\n  \n\nThere 2 main branches available:\n\n  \n\n-  [master] - packages for Android 7.0 or higher.\n\n  \n\nDirectories:\n\n  \n\n-  [disabled-packages](disabled-packages/):\n\n  \n\nPackages that cannot be published due to serious issues.\n\n  \n\n-  [ndk-patches](ndk-patches/):\n\n  \n\nOur changes to Android NDK headers.\n\n  \n\n-  [packages](packages/):\n\n  \n\nMain set of packages.\n\n  \n\n-  [sample](sample/):\n\n  \n\nSample structure for creating new packages.\n\n  \n\n-  [scripts](scripts/):\n\n  \n\nSet of utilities and build system scripts.\n\n  \n\n## Contributing\n\n  \n\n### Bug reports\n\nDo 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.**\n\n## Reach us\n  \n**AndroNix communities**  \nTwitter- https://twitter.com/AndronixApp  \nTelegram- https://t.me/AndronixApp\nDiscord- https://discord.gg/jywhBH4 \n\n## Credits \nTermux- https://play.google.com/store/apps/details?id=com.termux  \n"
  },
  {
    "path": "build-all.sh",
    "content": "#!/bin/bash\n# build-all.sh - script to build all packages with a build order specified by buildorder.py\n\nset -e -u -o pipefail\n\nif [ \"$(uname -o)\" = \"Android\" ] || [ -e \"/system/bin/app_process\" ]; then\n\techo \"On-device execution of this script is not supported.\"\n\texit 1\nfi\n\n# Read settings from .termuxrc if existing\ntest -f $HOME/.termuxrc && . $HOME/.termuxrc\n: ${TERMUX_TOPDIR:=\"$HOME/.termux-build\"}\n: ${TERMUX_ARCH:=\"aarch64\"}\n: ${TERMUX_DEBUG:=\"\"}\n: ${TERMUX_INSTALL_DEPS:=\"-s\"}\n# Set TERMUX_INSTALL_DEPS to -s unless set to -i\n\n_show_usage() {\n\techo \"Usage: ./build-all.sh [-a ARCH] [-d] [-i] [-o DIR]\"\n\techo \"Build all packages.\"\n\techo \"  -a The architecture to build for: aarch64(default), arm, i686, x86_64 or all.\"\n\techo \"  -d Build with debug symbols.\"\n\techo \"  -i Build dependencies.\"\n\techo \"  -o Specify deb directory. Default: debs/.\"\n\texit 1\n}\n\nwhile getopts :a:hdio: option; do\ncase \"$option\" in\n\ta) TERMUX_ARCH=\"$OPTARG\";;\n\td) TERMUX_DEBUG='-d';;\n\ti) TERMUX_INSTALL_DEPS='-i';;\n\to) TERMUX_DEBDIR=\"$(realpath -m $OPTARG)\";;\n\th) _show_usage;;\nesac\ndone\nshift $((OPTIND-1))\nif [ \"$#\" -ne 0 ]; then _show_usage; fi\n\nif [[ ! \"$TERMUX_ARCH\" =~ ^(all|aarch64|arm|i686|x86_64)$ ]]; then\n\techo \"ERROR: Invalid arch '$TERMUX_ARCH'\" 1>&2\n\texit 1\nfi\n\nBUILDSCRIPT=$(dirname $0)/build-package.sh\nBUILDALL_DIR=$TERMUX_TOPDIR/_buildall-$TERMUX_ARCH\nBUILDORDER_FILE=$BUILDALL_DIR/buildorder.txt\nBUILDSTATUS_FILE=$BUILDALL_DIR/buildstatus.txt\n\nif [ -e $BUILDORDER_FILE ]; then\n\techo \"Using existing buildorder file: $BUILDORDER_FILE\"\nelse\n\tmkdir -p $BUILDALL_DIR\n\t./scripts/buildorder.py > $BUILDORDER_FILE\nfi\nif [ -e $BUILDSTATUS_FILE ]; then\n\techo \"Continuing build-all from: $BUILDSTATUS_FILE\"\nfi\n\nexec >\t>(tee -a $BUILDALL_DIR/ALL.out)\nexec 2> >(tee -a $BUILDALL_DIR/ALL.err >&2)\ntrap \"echo ERROR: See $BUILDALL_DIR/\\${PKG}.err\" ERR\n\nwhile read PKG PKG_DIR; do\n\t# Check build status (grepping is a bit crude, but it works)\n\tif [ -e $BUILDSTATUS_FILE ] && grep \"^$PKG\\$\" $BUILDSTATUS_FILE >/dev/null; then\n\t\techo \"Skipping $PKG\"\n\t\tcontinue\n\tfi\n\n\techo -n \"Building $PKG... \"\n\tBUILD_START=$(date \"+%s\")\n\tbash -x $BUILDSCRIPT -a $TERMUX_ARCH $TERMUX_DEBUG \\\n\t\t${TERMUX_DEBDIR+-o $TERMUX_DEBDIR} $TERMUX_INSTALL_DEPS $PKG_DIR \\\n\t\t> $BUILDALL_DIR/${PKG}.out 2> $BUILDALL_DIR/${PKG}.err\n\tBUILD_END=$(date \"+%s\")\n\tBUILD_SECONDS=$(( $BUILD_END - $BUILD_START ))\n\techo \"done in $BUILD_SECONDS\"\n\n\t# Update build status\n\techo \"$PKG\" >> $BUILDSTATUS_FILE\ndone<${BUILDORDER_FILE}\n\n# Update build status\nrm -f $BUILDSTATUS_FILE\necho \"Finished\"\n"
  },
  {
    "path": "build-package.sh",
    "content": "#!/bin/bash\n# shellcheck disable=SC1117\n\nset -e -o pipefail -u\n\n: \"${TMPDIR:=/tmp}\"\nexport TMPDIR\n\nif [ \"$(uname -o)\" = \"Android\" ] || [ -e \"/system/bin/app_process\" ]; then\n\tif [ \"$(id -u)\" = \"0\" ]; then\n\t\techo \"On-device execution of this script as root is disabled.\"\n\t\texit 1\n\tfi\n\n\t# This variable tells all parts of build system that build\n\t# is performed on device.\n\texport TERMUX_ON_DEVICE_BUILD=true\nelse\n\texport TERMUX_ON_DEVICE_BUILD=false\nfi\n\ncd \"$(realpath \"$(dirname \"$0\")\")\"\nTERMUX_SCRIPTDIR=$(pwd)\nexport TERMUX_SCRIPTDIR\n\n# Lock file to prevent parallel running in the same environment.\nTERMUX_BUILD_LOCK_FILE=\"${TMPDIR}/.termux-build.lck\"\nif [ ! -e \"$TERMUX_BUILD_LOCK_FILE\" ]; then\n\ttouch \"$TERMUX_BUILD_LOCK_FILE\"\nfi\n\n# Special variable for internal use. It forces script to ignore\n# lock file.\n: \"${TERMUX_BUILD_IGNORE_LOCK:=false}\"\n\n# Utility function to log an error message and exit with an error code.\n# shellcheck source=scripts/build/termux_error_exit.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_error_exit.sh\"\n\n# Utility function to download a resource with an expected checksum.\n# shellcheck source=scripts/build/termux_download.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_download.sh\"\n\n# Utility function for golang-using packages to setup a go toolchain.\n# shellcheck source=scripts/build/setup/termux_setup_golang.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_golang.sh\"\n\n# Utility function for rust-using packages to setup a rust toolchain.\n# shellcheck source=scripts/build/setup/termux_setup_rust.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_rust.sh\"\n\n# Utility function to setup a current ninja build system.\n# shellcheck source=scripts/build/setup/termux_setup_ninja.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_ninja.sh\"\n\n# Utility function to setup a current meson build system.\n# shellcheck source=scripts/build/setup/termux_setup_meson.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_meson.sh\"\n\n# Utility function to setup a current cmake build system\n# shellcheck source=scripts/build/setup/termux_setup_cmake.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_cmake.sh\"\n\n# Utility function to setup protobuf:\n# shellcheck source=scripts/build/setup/termux_setup_protobuf.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/setup/termux_setup_protobuf.sh\"\n\n# Setup variables used by the build. Not to be overridden by packages.\n# shellcheck source=scripts/build/termux_step_setup_variables.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_setup_variables.sh\"\n\n# Save away and restore build setups which may change between builds.\n# shellcheck source=scripts/build/termux_step_handle_buildarch.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_handle_buildarch.sh\"\n\n# Function to get TERMUX_PKG_VERSION from build.sh\n# shellcheck source=scripts/build/termux_extract_dep_info.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_extract_dep_info.sh\"\n\n# Function that downloads a .deb (using the termux_download function)\n# shellcheck source=scripts/build/termux_download_deb.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_download_deb.sh\"\n\n# Script to download InRelease, verify it's signature and then download Packages.xz by hash\n# shellcheck source=scripts/build/termux_get_repo_files.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_get_repo_files.sh\"\n\n# Source the package build script and start building. No to be overridden by packages.\n# shellcheck source=scripts/build/termux_step_start_build.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_start_build.sh\"\n\n# Run just after sourcing $TERMUX_PKG_BUILDER_SCRIPT. May be overridden by packages.\n# shellcheck source=scripts/build/termux_step_extract_package.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_extract_package.sh\"\n\n# Hook for packages to act just after the package has been extracted.\n# Invoked in $TERMUX_PKG_SRCDIR.\ntermux_step_post_extract_package() {\n\treturn\n}\n\n# Optional host build. Not to be overridden by packages.\n# shellcheck source=scripts/build/termux_step_handle_hostbuild.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_handle_hostbuild.sh\"\n\n# Perform a host build. Will be called in $TERMUX_PKG_HOSTBUILD_DIR.\n# After termux_step_post_extract_package() and before termux_step_patch_package()\n# shellcheck source=scripts/build/termux_step_host_build.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_host_build.sh\"\n\n# Setup a standalone Android NDK toolchain. Not to be overridden by packages.\n# shellcheck source=scripts/build/termux_step_setup_toolchain.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_setup_toolchain.sh\"\n\n# Apply all *.patch files for the package. Not to be overridden by packages.\n# shellcheck source=scripts/build/termux_step_patch_package.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_patch_package.sh\"\n\n# Replace autotools build-aux/config.{sub,guess} with ours to add android targets.\n# shellcheck source=scripts/build/termux_step_replace_guess_scripts.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_replace_guess_scripts.sh\"\n\n# For package scripts to override. Called in $TERMUX_PKG_BUILDDIR.\ntermux_step_pre_configure() {\n\treturn\n}\n\n# Setup configure args and run $TERMUX_PKG_SRCDIR/configure. This function is called from termux_step_configure\n# shellcheck source=scripts/build/configure/termux_step_configure_autotools.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure_autotools.sh\"\n\n# Setup configure args and run cmake. This function is called from termux_step_configure\n# shellcheck source=scripts/build/configure/termux_step_configure_cmake.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure_cmake.sh\"\n\n# Setup configure args and run meson. This function is called from termux_step_configure\n# shellcheck source=scripts/build/configure/termux_step_configure_meson.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure_meson.sh\"\n\n# Configure the package\n# shellcheck source=scripts/build/configure/termux_step_configure.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/configure/termux_step_configure.sh\"\n\n# Hook for packages after configure step\ntermux_step_post_configure() {\n\treturn\n}\n\n# Make package, either with ninja or make\n# shellcheck source=scripts/build/termux_step_make.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_make.sh\"\n\n# Make install, either with ninja, make of cargo\n# shellcheck source=scripts/build/termux_step_make_install.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_make_install.sh\"\n\n# Hook function for package scripts to override.\ntermux_step_post_make_install() {\n\treturn\n}\n\n# Link/copy the LICENSE for the package to $TERMUX_PREFIX/share/$TERMUX_PKG_NAME/\n# shellcheck source=scripts/build/termux_step_install_license.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_install_license.sh\"\n\n# Function to cp (through tar) installed files to massage dir\n# shellcheck source=scripts/build/termux_step_extract_into_massagedir.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_extract_into_massagedir.sh\"\n\n# Create all subpackages. Run from termux_step_massage\n# shellcheck source=scripts/build/termux_create_subpackages.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_create_subpackages.sh\"\n\n# Function to run various cleanup/fixes\n# shellcheck source=scripts/build/termux_step_massage.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_massage.sh\"\n\n# Hook for packages after massage step\ntermux_step_post_massage() {\n\treturn\n}\n\n# Create data.tar.gz with files to package. Not to be overridden by package scripts.\n# shellcheck source=scripts/build/termux_step_create_datatar.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_create_datatar.sh\"\n\n# Hook function to create {pre,post}install, {pre,post}rm-scripts and similar\ntermux_step_create_debscripts() {\n\treturn\n}\n\n# Create the build deb file. Not to be overridden by package scripts.\n# shellcheck source=scripts/build/termux_step_create_debfile.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_create_debfile.sh\"\n\n# Finish the build. Not to be overridden by package scripts.\n# shellcheck source=scripts/build/termux_step_finish_build.sh\nsource \"$TERMUX_SCRIPTDIR/scripts/build/termux_step_finish_build.sh\"\n\n################################################################################\n\n# shellcheck source=scripts/properties.sh\n. \"$TERMUX_SCRIPTDIR/scripts/properties.sh\"\n\nif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ]; then\n\t# For on device builds cross compiling is not supported.\n\t# Target architecture must be same as for environment used currently.\n\tTERMUX_ARCH=$(dpkg --print-architecture)\n\texport TERMUX_ARCH\nfi\n\n_show_usage() {\n    echo \"Usage: ./build-package.sh [options] PACKAGE_1 PACKAGE_2 ...\"\n    echo\n    echo \"Build a package by creating a .deb file in the debs/ folder.\"\n    echo\n    echo \"Available options:\"\n    [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ] && echo \"  -a The architecture to build for: aarch64(default), arm, i686, x86_64 or all.\"\n    echo \"  -d Build with debug symbols.\"\n    echo \"  -D Build a disabled package in disabled-packages/.\"\n    echo \"  -f Force build even if package has already been built.\"\n    [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ] && echo \"  -i Download and extract dependencies instead of building them.\"\n    echo \"  -I Download and extract dependencies instead of building them, keep existing /data/data/com.termux files.\"\n    echo \"  -q Quiet build.\"\n    echo \"  -s Skip dependency check.\"\n    echo \"  -o Specify deb directory. Default: debs/.\"\n    exit 1\n}\n\nwhile getopts :a:hdDfiIqso: option; do\n\tcase \"$option\" in\n\t\ta)\n\t\t\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ]; then\n\t\t\t\ttermux_error_exit \"./build-package.sh: option '-a' is not available for on-device builds\"\n\t\t\telse\n\t\t\t\texport TERMUX_ARCH=\"$OPTARG\"\n\t\t\tfi\n\t\t\t;;\n\t\th) _show_usage;;\n\t\td) export TERMUX_DEBUG=true;;\n\t\tD) TERMUX_IS_DISABLED=true;;\n\t\tf) TERMUX_FORCE_BUILD=true;;\n\t\ti)\n\t\t\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ]; then\n\t\t\t\ttermux_error_exit \"./build-package.sh: option '-i' is not available for on-device builds\"\n\t\t\telse\n\t\t\t\texport TERMUX_INSTALL_DEPS=true\n\t\t\tfi\n\t\t\t;;\n\t\tI) export TERMUX_INSTALL_DEPS=true && export TERMUX_NO_CLEAN=true;;\n\t\tq) export TERMUX_QUIET_BUILD=true;;\n\t\ts) export TERMUX_SKIP_DEPCHECK=true;;\n\t\to) TERMUX_DEBDIR=$(realpath -m \"$OPTARG\");;\n\t\t?) termux_error_exit \"./build-package.sh: illegal option -$OPTARG\";;\n\tesac\ndone\nshift $((OPTIND-1))\n\nif [ \"$#\" -lt 1 ]; then _show_usage; fi\nunset -f _show_usage\n\nwhile (($# > 0)); do\n\t# Following commands must be executed under lock to prevent running\n\t# multiple instances of \"./build-package.sh\".\n\t#\n\t# To provide sane environment for each package, builds are done\n\t# in subshell.\n\t(\n\t\tif ! $TERMUX_BUILD_IGNORE_LOCK; then\n\t\t\tflock -n 5 || termux_error_exit \"Another build is already running within same environment.\"\n\t\tfi\n\n\t\t# Handle 'all' arch:\n\t\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ] && [ -n \"${TERMUX_ARCH+x}\" ] && [ \"${TERMUX_ARCH}\" = 'all' ]; then\n\t\t\tfor arch in 'aarch64' 'arm' 'i686' 'x86_64'; do\n\t\t\t\tenv TERMUX_ARCH=\"$arch\" TERMUX_BUILD_IGNORE_LOCK=true ./build-package.sh \\\n\t\t\t\t\t${TERMUX_FORCE_BUILD+-f} ${TERMUX_INSTALL_DEPS+-i} ${TERMUX_IS_DISABLED+-D} \\\n\t\t\t\t\t${TERMUX_DEBUG+-d} ${TERMUX_DEBDIR+-o $TERMUX_DEBDIR} \"$1\"\n\t\t\tdone\n\t\t\texit\n\t\tfi\n\n\t\t# Check the package to build:\n\t\tTERMUX_PKG_NAME=$(basename \"$1\")\n\t\tif [[ $1 == *\"/\"* ]]; then\n\t\t\t# Path to directory which may be outside this repo:\n\t\t\tif [ ! -d \"$1\" ]; then termux_error_exit \"'$1' seems to be a path but is not a directory\"; fi\n\t\t\texport TERMUX_PKG_BUILDER_DIR\n\t\t\tTERMUX_PKG_BUILDER_DIR=$(realpath \"$1\")\n\t\telse\n\t\t\t# Package name:\n\t\t\tif [ -n \"${TERMUX_IS_DISABLED=\"\"}\" ]; then\n\t\t\t\texport TERMUX_PKG_BUILDER_DIR=$TERMUX_SCRIPTDIR/disabled-packages/$TERMUX_PKG_NAME\n\t\t\telse\n\t\t\t\texport TERMUX_PKG_BUILDER_DIR=$TERMUX_SCRIPTDIR/packages/$TERMUX_PKG_NAME\n\t\t\tfi\n\t\tfi\n\t\tTERMUX_PKG_BUILDER_SCRIPT=$TERMUX_PKG_BUILDER_DIR/build.sh\n\t\tif test ! -f \"$TERMUX_PKG_BUILDER_SCRIPT\"; then\n\t\t\ttermux_error_exit \"No build.sh script at package dir $TERMUX_PKG_BUILDER_DIR!\"\n\t\tfi\n\n\t\ttermux_step_setup_variables\n\t\ttermux_step_handle_buildarch\n\t\ttermux_step_start_build\n\t\ttermux_step_extract_package\n\t\tcd \"$TERMUX_PKG_SRCDIR\"\n\t\ttermux_step_post_extract_package\n\t\ttermux_step_handle_hostbuild\n\t\ttermux_step_setup_toolchain\n\t\ttermux_step_patch_package\n\t\ttermux_step_replace_guess_scripts\n\t\tcd \"$TERMUX_PKG_SRCDIR\"\n\t\ttermux_step_pre_configure\n\t\tcd \"$TERMUX_PKG_BUILDDIR\"\n\t\ttermux_step_configure\n\t\tcd \"$TERMUX_PKG_BUILDDIR\"\n\t\ttermux_step_post_configure\n\t\tcd \"$TERMUX_PKG_BUILDDIR\"\n\t\ttermux_step_make\n\t\tcd \"$TERMUX_PKG_BUILDDIR\"\n\t\ttermux_step_make_install\n\t\tcd \"$TERMUX_PKG_BUILDDIR\"\n\t\ttermux_step_post_make_install\n\t\ttermux_step_install_license\n\t\tcd \"$TERMUX_PKG_MASSAGEDIR\"\n\t\ttermux_step_extract_into_massagedir\n\t\tcd \"$TERMUX_PKG_MASSAGEDIR\"\n\t\ttermux_step_massage\n\t\tcd \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"\n\t\ttermux_step_post_massage\n\t\ttermux_step_create_datatar\n\t\ttermux_step_create_debfile\n\t\ttermux_step_finish_build\n\t) 5< \"$TERMUX_BUILD_LOCK_FILE\"\n\n\tshift 1\ndone\n"
  },
  {
    "path": "clean.sh",
    "content": "#!/bin/sh\n# clean.sh - clean everything.\nset -e -u\n\n# Checking if script is running on Android with 2 different methods.\n# Needed for safety to prevent execution of potentially dangerous\n# operations such as 'rm -rf /data/*' on Android device.\nif [ \"$(uname -o)\" = \"Android\" ] || [ -e \"/system/bin/app_process\" ]; then\n\tTERMUX_ON_DEVICE_BUILD=true\nelse\n\tTERMUX_ON_DEVICE_BUILD=false\nfi\n\nif [ \"$(id -u)\" = \"0\" ] && $TERMUX_ON_DEVICE_BUILD; then\n\techo \"On-device execution of this script as root is disabled.\"\n\texit 1\nfi\n\n# Read settings from .termuxrc if existing\ntest -f \"$HOME/.termuxrc\" && . \"$HOME/.termuxrc\"\n: \"${TERMUX_TOPDIR:=\"$HOME/.termux-build\"}\"\n: \"${TMPDIR:=/tmp}\"\nexport TMPDIR\n\n# Lock file. Same as used in build-package.sh.\nTERMUX_BUILD_LOCK_FILE=\"${TMPDIR}/.termux-build.lck\"\nif [ ! -e \"$TERMUX_BUILD_LOCK_FILE\" ]; then\n\ttouch \"$TERMUX_BUILD_LOCK_FILE\"\nfi\n\n{\n\tif ! flock -n 5; then\n\t\techo \"Not cleaning build directory since you have unfinished build running.\"\n\t\texit 1\n\tfi\n\n\tif [ -d \"$TERMUX_TOPDIR\" ]; then\n\t\tchmod +w -R \"$TERMUX_TOPDIR\"\n\tfi\n\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\t# For on-device build cleanup /data shouldn't be erased.\n\t\trm -Rf \"$TERMUX_TOPDIR\"\n\telse\n\t\trm -Rf /data/* \"$TERMUX_TOPDIR\"\n\tfi\n} 5< \"$TERMUX_BUILD_LOCK_FILE\"\n"
  },
  {
    "path": "disabled-packages/abuild/Makefile.patch",
    "content": "diff -u -r ../abuild-3.2.0/Makefile ./Makefile\n--- ../abuild-3.2.0/Makefile\t2018-06-22 07:24:10.000000000 +0000\n+++ ./Makefile\t2018-11-18 01:32:10.950452195 +0000\n@@ -95,7 +95,6 @@\n \tfor i in $(USR_BIN_FILES); do\\\n \t\tinstall -m 755 $$i $(DESTDIR)/$(bindir)/$$i;\\\n \tdone\n-\tchmod 4111 $(DESTDIR)/$(prefix)/bin/abuild-sudo\n \tfor i in adduser addgroup apk; do \\\n \t\tln -fs abuild-sudo $(DESTDIR)/$(bindir)/abuild-$$i; \\\n \tdone\n"
  },
  {
    "path": "disabled-packages/abuild/abuild-fetch.c.patch",
    "content": "diff -uNr abuild-3.4.0/abuild-fetch.c abuild-3.4.0.mod/abuild-fetch.c\n--- abuild-3.4.0/abuild-fetch.c\t2019-06-14 15:13:23.000000000 +0300\n+++ abuild-3.4.0.mod/abuild-fetch.c\t2019-07-21 16:45:34.475241394 +0300\n@@ -189,7 +189,7 @@\n int main(int argc, char *argv[])\n {\n \tint opt;\n-\tchar *destdir = \"/var/cache/distfiles\";\n+\tchar *destdir = \"@TERMUX_PREFIX@/var/cache/distfiles\";\n \n \tprogram = argv[0];\n \twhile ((opt = getopt(argc, argv, \"hd:\")) != -1) {\n"
  },
  {
    "path": "disabled-packages/abuild/abuild-keygen.in.patch",
    "content": "--- abuild-3.2.0/abuild-keygen.in\t2018-06-22 10:24:10.000000000 +0300\n+++ abuild-3.2.0.mod/abuild-keygen.in\t2018-11-18 20:02:12.017576128 +0200\n@@ -56,14 +56,14 @@\n \n \n \tif [ -n \"$install_pubkey\" ]; then\n-\t\tmsg \"Installing $pubkey to /etc/apk/keys...\"\n-\t\tsudo mkdir -p /etc/apk/keys\n-\t\tsudo cp -i \"$pubkey\" /etc/apk/keys/\n+\t\tmsg \"Installing $pubkey to \\$PREFIX/etc/apk/keys...\"\n+\t\tmkdir -p @TERMUX_PREFIX@/etc/apk/keys\n+\t\tcp -i \"$pubkey\" @TERMUX_PREFIX@/etc/apk/keys/\n \telse\n \n \t\tmsg \"\"\n \t\tmsg \"You'll need to install $pubkey into \"\n-\t\tmsg \"/etc/apk/keys to be able to install packages and repositories signed with\"\n+\t\tmsg \"\\$PREFIX/etc/apk/keys to be able to install packages and repositories signed with\"\n \t\tmsg \"$privkey\"\n \tfi\n \n@@ -94,7 +94,7 @@\n \t\tOptions:\n \t\t  -a, --append   Set PACKAGER_PRIVKEY=<generated key> in\n \t\t                 $ABUILD_USERCONF\n-\t\t  -i, --install  Install public key into /etc/apk/keys using sudo\n+\t\t  -i, --install  Install public key into \\$PREFIX/etc/apk/keys\n \t\t  -n             Non-interactive. Use defaults\n \t\t  -q, --quiet\n \t\t  -h, --help     Show this help\n"
  },
  {
    "path": "disabled-packages/abuild/abuild-rmtemp.c.patch",
    "content": "--- abuild-3.2.0/abuild-rmtemp.c\t2018-06-22 10:24:10.000000000 +0300\n+++ abuild-3.2.0.mod/abuild-rmtemp.c\t2018-11-18 19:54:49.254290401 +0200\n@@ -16,7 +16,7 @@\n #include <sys/types.h>\n #include <unistd.h>\n \n-#define PREFIX \"/var/tmp/abuild.\"\n+#define PREFIX \"@TERMUX_PREFIX@/var/tmp/abuild.\"\n \n static void fail() {\n \terrx(1, \"%s\", strerror(errno));\n@@ -29,10 +29,12 @@\n int main(int argc, char **argv) {\n \tif (argc < 2) return 0;\n \n+#ifndef __ANDROID__\n \tif (getuid()) {\n \t\targv[0] = \"-abuild-rmtemp\";\n \t\texecv(\"/usr/bin/abuild-sudo\", argv);\n \t}\n+#endif\n \n \tif (strncmp(argv[1], PREFIX, strlen(PREFIX)) || \\\n \t\tstrchr(argv[1] + strlen(PREFIX), '/'))\n@@ -40,9 +42,12 @@\n \n \tstruct stat s;\n \tif (lstat(argv[1], &s)) fail();\n+\n+#ifndef __ANDROID__\n \tstruct passwd *p = getpwnam(getenv(\"USER\"));\n \tif (!p) errx(1, \"Incorrect user\");\n \tif (s.st_uid != p->pw_uid) errx(1, \"Permission denied\");\n+#endif\n \n \tif (nftw(argv[1], handler, 512, FTW_DEPTH)) fail();\n \n"
  },
  {
    "path": "disabled-packages/abuild/abuild-sign.in.patch",
    "content": "--- abuild-3.2.0/abuild-sign.in\t2018-06-22 10:24:10.000000000 +0300\n+++ abuild-3.2.0.mod/abuild-sign.in\t2018-11-18 20:28:48.283970248 +0200\n@@ -51,7 +51,7 @@\n \t\t  -e, --installed    Check only of there exist a private key for signing\n \t\t  -k, --private KEY  The private key to use for signing\n \t\t  -p, --public KEY   The name of public key. apk add will look for\n-\t\t                     /etc/apk/keys/KEY\n+\t\t                     \\$PREFIX/etc/apk/keys/KEY\n \t\t  -q, --quiet\n \t\t  -h, --help         Show this help\n \n"
  },
  {
    "path": "disabled-packages/abuild/abuild.conf.patch",
    "content": "diff -uNr abuild-3.2.0/abuild.conf abuild-3.2.0.mod/abuild.conf\n--- abuild-3.2.0/abuild.conf\t2018-06-22 10:24:10.000000000 +0300\n+++ abuild-3.2.0.mod/abuild.conf\t2018-11-18 16:42:45.897130881 +0200\n@@ -1,4 +1,4 @@\n-export CFLAGS=\"-Os -fomit-frame-pointer\"\n+export CFLAGS=\"-Os\"\n export CXXFLAGS=\"$CFLAGS\"\n export CPPFLAGS=\"$CFLAGS\"\n export LDFLAGS=\"-Wl,--as-needed\"\n@@ -9,7 +9,7 @@\n # remove line below to disable colors\n USE_COLORS=1\n \n-SRCDEST=/var/cache/distfiles\n+SRCDEST=@TERMUX_PREFIX@/var/cache/distfiles\n \n # uncomment line below to store built packages in other location\n # The package will be stored as $REPODEST/$repo/$pkgname-$pkgver-r$pkgrel.apk\n"
  },
  {
    "path": "disabled-packages/abuild/abuild.in.patch",
    "content": "diff -uNr abuild-3.4.0/abuild.in abuild-3.4.0.mod/abuild.in\n--- abuild-3.4.0/abuild.in\t2019-06-14 15:13:23.000000000 +0300\n+++ abuild-3.4.0.mod/abuild.in\t2019-07-21 16:56:56.898285307 +0300\n@@ -1,4 +1,4 @@\n-#!/bin/ash -e\n+#!/bin/bash -e\n \n # abuild - build apk packages (light version of makepkg)\n # Copyright (c) 2008-2015 Natanael Copa <ncopa@alpinelinux.org>\n@@ -21,11 +21,7 @@\n . \"$datadir/functions.sh\"\n \n # defaults\n-: ${FAKEROOT:=\"fakeroot\"}\n-: ${SUDO_APK:=\"abuild-apk\"}\n : ${APK:=\"apk\"}\n-: ${ADDUSER:=\"abuild-adduser\"}\n-: ${ADDGROUP:=\"abuild-addgroup\"}\n \n apk_opt_wait=\"--wait 30\"\n \n@@ -438,7 +434,7 @@\n \tinitdcheck || return 1\n \tmkdir -p \"$srcdir\"\n \tlocal gunzip=$(command -v pigz || echo gunzip)\n-\t[ $gunzip = \"/usr/bin/pigz\" ] && gunzip=\"$gunzip -d\"\n+\t[ $gunzip = \"@TERMUX_PREFIX@/bin/pigz\" ] && gunzip=\"$gunzip -d\"\n \tfor u in $source; do\n \t\tlocal s\n \t\tif is_remote \"$u\"; then\n@@ -466,7 +462,7 @@\n \t\t\t*.tar.xz)\n \t\t\t\tmsg \"Unpacking $s...\"\n \t\t\t\tlocal threads_opt\n-\t\t\t\tif [ $(readlink -f $(command -v unxz)) != \"/bin/busybox\" ]; then\n+\t\t\t\tif [ $(realpath $(command -v unxz)) != \"@TERMUX_PREFIX@/bin/busybox\" ]; then\n \t\t\t\t\tthreads_opt=\"--threads=0\"\n \t\t\t\tfi\n \t\t\t\tunxz $threads_opt -c \"$s\" | tar -C \"$srcdir\" -x || return 1;;\n@@ -554,26 +550,6 @@\n \treturn 0\n }\n \n-mkusers() {\n-\tlocal i\n-\tfor i in $pkggroups; do\n-\t\tif ! getent group $i >/dev/null; then\n-\t\t\tmsg \"Creating group $i\"\n-\t\t\t$ADDGROUP -S $i || return 1\n-\t\tfi\n-\tdone\n-\tfor i in $pkgusers; do\n-\t\tif ! getent passwd $i >/dev/null; then\n-\t\t\tlocal gopt=\n-\t\t\tmsg \"Creating user $i\"\n-\t\t\tif getent group $i >/dev/null; then\n-\t\t\t\tgopt=\"-G $i\"\n-\t\t\tfi\n-\t\t\t$ADDUSER -S -D -H $gopt $i || return 1\n-\t\tfi\n-\tdone\n-}\n-\n # helper to update config.sub to a recent version\n update_config_sub() {\n \tfind . -name config.sub | (local changed=false; while read f; do\n@@ -687,10 +663,10 @@\n \t\tfind \"$dir\" -name '*.la' -type f -delete\n \tfi\n \n-\t# look for /usr/lib/charset.alias\n-\tif [ -e \"$dir\"/usr/lib/charset.alias ] \\\n+\t# look for @TERMUX_PREFIX@/lib/charset.alias\n+\tif [ -e \"$dir\"/@TERMUX_PREFIX@/lib/charset.alias ] \\\n \t\t\t&& ! options_has \"charset.alias\"; then\n-\t\terror \"Found /usr/lib/charset.alias\"\n+\t\terror \"Found @TERMUX_PREFIX@/lib/charset.alias\"\n \t\treturn 1\n \tfi\n \t# look for /etc/init.d and /etc/conf.d\n@@ -704,22 +680,15 @@\n \t\t\twarning \"Found static archive on ${i##*$dir/} but name doesn't end with -static\"\n \t\tdone\n \tfi\n-\t# look for /usr/share/doc\n-\tif [ -e \"$dir\"/usr/share/doc ] \\\n+\t# look for @TERMUX_PREFIX@/share/doc\n+\tif [ -e \"$dir\"/@TERMUX_PREFIX@/share/doc ] \\\n \t\t\t&& ! is_doc_pkg \"$name\"; then\n-\t\twarning \"Found /usr/share/doc but package name doesn't end with -doc\"\n+\t\twarning \"Found @TERMUX_PREFIX@/share/doc but package name doesn't end with -doc\"\n \tfi\n-\t# look for /usr/share/man\n-\tif [ -e \"$dir\"/usr/share/man ]; then\n+\t# look for @TERMUX_PREFIX@/share/man\n+\tif [ -e \"$dir\"/@TERMUX_PREFIX@/share/man ]; then\n \t\tif ! is_doc_pkg \"$name\"; then\n-\t\t\twarning \"Found /usr/share/man but package name doesn't end with -doc\"\n-\t\tfi\n-\t\t# check for uncompressed man pages\n-\t\ti=$(find \"$dir\"/usr/share/man -name '*.[0-8]' -type f | sed \"s|^$dir|\\t|\")\n-\t\tif [ -n \"$i\" ]; then\n-\t\t\terror \"Found uncompressed man pages:\"\n-\t\t\techo \"$i\"\n-\t\t\treturn 1\n+\t\t\twarning \"Found @TERMUX_PREFIX@/share/man but package name doesn't end with -doc\"\n \t\tfi\n \tfi\n \t# check directory permissions\n@@ -780,9 +749,9 @@\n \t\t\t&& postcheck \"$pkgbasedir/$subpkgname\" \"$subpkgname\" ) || return 1\n \tdone\n \tpostcheck \"$pkgdir\" \"$pkgname\" || return 1\n-\t# post check for /usr/share/locale\n-\tif [ -d \"$pkgdir\"/usr/share/locale ]; then\n-\t\twarning \"Found /usr/share/locale\"\n+\t# post check for @TERMUX_PREFIX@/share/locale\n+\tif [ -d \"$pkgdir\"/@TERMUX_PREFIX@/share/locale ]; then\n+\t\twarning \"Found @TERMUX_PREFIX@/share/locale\"\n \t\twarning2 \"Maybe add \\$pkgname-lang to subpackages?\"\n \tfi\n }\n@@ -792,7 +761,7 @@\n \tinstall_if=\"$pkgname=$pkgver-r$pkgrel lang\"\n \n \tlocal dir\n-\tfor dir in ${langdir:-/usr/share/locale}; do\n+\tfor dir in ${langdir:-@TERMUX_PREFIX@/share/locale}; do\n \t\tmkdir -p \"$subpkgdir\"/${dir%/*}\n \t\tmv \"$pkgdir\"/\"$dir\" \"$subpkgdir\"/\"$dir\" || return 1\n \tdone\n@@ -811,7 +780,7 @@\n \tinstall_if=\"$pkgname=$pkgver-r$pkgrel lang-$lang\"\n \n \tlocal dir\n-\tfor dir in ${langdir:-/usr/share/locale}; do\n+\tfor dir in ${langdir:-@TERMUX_PREFIX@/share/locale}; do\n \t\tmkdir -p \"$subpkgdir\"/$dir\n \t\tmv \"$pkgdir\"/$dir/$lang* \\\n \t\t\"$subpkgdir\"/$dir/ \\\n@@ -866,7 +835,7 @@\n \n check_license() {\n \tlocal ret=0\n-\tlocal license_list=/usr/share/spdx/license.lst\n+\tlocal license_list=@TERMUX_PREFIX@/share/spdx/license.lst\n \tlocal exclude=\"AND OR WITH\"\n \tif options_has \"!spdx\" || ! [ -f \"$license_list\" ]; then\n \t\treturn 0\n@@ -939,10 +908,7 @@\n \tlocal builddate=$(date -u \"+%s\")\n \n \t# Fix package size on several filesystems\n-\tcase \"$(df -PT . | awk 'END {print $2}')\" in\n-\tbtrfs|ecryptfs|zfs)\n-\t\tsync;;\n-\tesac\n+\tsync\n \n \tlocal size=$(du -sk | awk '{print $1 * 1024}')\n \n@@ -955,7 +921,7 @@\n \n \techo \"# Generated by $(basename \"$abuild_path\") $program_version\" >\"$pkginfo\"\n \tif [ -n \"$FAKEROOTKEY\" ]; then\n-\t\techo \"# using $($FAKEROOT -v)\" >> \"$pkginfo\"\n+\t\techo \"# using $(fakeroot -v)\" >> \"$pkginfo\"\n \tfi\n \techo \"# $(date -u)\" >> \"$pkginfo\"\n \tcat >> \"$pkginfo\" <<-EOF\n@@ -975,9 +941,9 @@\n \t\tfor i in $install $triggers; do\n \t\t\tlocal s=${i%=*}\n \t\t\t[ \"$name\" != \"${s%.*}\" ] && continue\n-\t\t\tif head -n 1 \"$startdir/$s\" | grep '^#!/bin/sh' >/dev/null ; then\n-\t\t\t\tmsg \"Script found. /bin/sh added as a dependency for $pkg\"\n-\t\t\t\tdeps=\"$deps /bin/sh\"\n+\t\t\tif head -n 1 \"$startdir/$s\" | grep '^#!@TERMUX_PREFIX@/bin/sh' >/dev/null ; then\n+\t\t\t\tmsg \"Script found. @TERMUX_PREFIX@/bin/sh added as a dependency for $pkg\"\n+\t\t\t\tdeps=\"$deps @TERMUX_PREFIX@/bin/sh\"\n \t\t\t\tbreak\n \t\t\tfi\n \t\tdone\n@@ -1049,8 +1015,8 @@\n \tscanelf --quiet --recursive --rpath \"$dir\" \\\n \t\t| sed -e 's/[[:space:]].*//' -e 's/:/\\n/' | sort -u \\\n \t\t>\"$controldir\"/.rpaths\n-\tif grep -q -x '/usr/lib' \"$controldir\"/.rpaths; then\n-\t\twarning \"Redundant /usr/lib in rpath found\"\n+\tif grep -q -x '@TERMUX_PREFIX@/lib' \"$controldir\"/.rpaths; then\n+\t\twarning \"Redundant @TERMUX_PREFIX@/lib in rpath found\"\n \tfi\n \tif grep '^/home/' \"$controldir\"/.rpaths; then\n \t\terror \"Has /home/... in rpath\"\n@@ -1076,12 +1042,12 @@\n \tlocal dir=\"${subpkgdir:-$pkgdir}\"\n \toptions_has \"!tracedeps\" && return 0\n \tcd \"$dir\" || return 1\n-\tfor i in usr/lib/pkgconfig/*.pc; do\n+\tfor i in ./@TERMUX_PREFIX@/lib/pkgconfig/*.pc; do\n \t\tif ! [ -e \"$i\" ]; then\n \t\t\tcontinue\n \t\tfi\n \t\tlocal f=${i##*/}\n-\t\tlocal v=$(PKG_CONFIG_PATH=\"$dir\"/usr/lib/pkgconfig PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH=1 pkg-config \\\n+\t\tlocal v=$(PKG_CONFIG_PATH=\"$dir\"/@TERMUX_PREFIX@/lib/pkgconfig PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH=1 pkg-config \\\n \t\t\t--modversion ${f%.pc})\n \t\techo \"$pcprefix${f%.pc}=${v:-0}\" >> \"$controldir\"/.provides-pc\n \tdone\n@@ -1176,12 +1142,19 @@\n \treturn 1\n }\n \n-# search rpaths and /usr/lib /lib for given so files\n+# search rpaths and @TERMUX_PREFIX@/lib for given so files\n find_so_files() {\n+\tlocal android_libs\n \tlocal rpaths=$(cat \"$1\")\n \tshift\n+\n+\tcase ${CTARGET_ARCH} in\n+\taarch64|x86_64) android_libs=\"/system/lib64\" ;;\n+\t*) android_libs=\"/system/lib\" ;;\n+\tesac\n+\n \twhile [ $# -gt 0 ]; do\n-\t\treal_so_path \"$1\" /usr/lib /lib $rpaths || return 1\n+\t\treal_so_path \"$1\" @TERMUX_PREFIX@/lib $rpaths $android_libs || return 1\n \t\tshift\n \tdone\n \treturn 0\n@@ -1219,20 +1192,12 @@\n \tesac\n \n \tmsg \"Tracing dependencies...\"\n-\t# add pkgconfig if usr/lib/pkgconfig is found\n-\tif [ -d \"$pkgbasedir\"/$name/usr/lib/pkgconfig ] \\\n+\t# add pkgconfig if @TERMUX_PREFIX@/lib/pkgconfig is found\n+\tif [ -d \"$pkgbasedir\"/$name/@TERMUX_PREFIX@/lib/pkgconfig ] \\\n \t\t\t&& ! grep -q '^depend = pkgconfig' \"$dir\"/.PKGINFO; then\n \t\tautodeps=\"$autodeps pkgconfig\"\n \tfi\n \n-\t# special case for libpthread: we need depend on libgcc\n-\tif [ \"$CLIBC\" = \"uclibc\" ] && [ -f \"$dir\"/.needs-so ] \\\n-\t\t\t&& grep -q -w '^libpthread.so.*' \"$dir\"/.needs-so \\\n-\t\t\t&& ! grep -q -w \"^depend = libgcc\" \"$dir\"/.PKGINFO; then\n-\t\tautodeps=\"$autodeps libgcc\"\n-\t\tmsg \"  added libgcc (due to libpthread)\"\n-\tfi\n-\n \t[ -f \"$dir\"/.needs-so ] && for i in $(cat \"$dir\"/.needs-so); do\n \t\t# first check if its provided by same apkbuild\n \t\tgrep -q -w \"^$sonameprefix$i\" \"$dir\"/.provides-so 2>/dev/null && continue\n@@ -1249,7 +1214,7 @@\n \n \t# find all packages that holds the so files\n \tif [ -f \"$dir\"/.rpaths ]; then\n-\t\tlocal so_files=$(find_so_files \"$dir\"/.rpaths $missing) \\\n+\t\tlocal so_files=$(find_so_files \"$dir\"/.rpaths $missing | grep -v /system/lib) \\\n \t\t\t|| return 1\n \t\tdeppkgs=$($APK $apkroot info --quiet --who-owns $so_files) || return 1\n \tfi\n@@ -1283,7 +1248,7 @@\n \t\t\tautodeps=\"$autodeps pc:$i\"\n \t\telse\n \t\t\twarning \"Could not find any provider for pc:$i\"\n-\t\t\tlocal pcfile=/usr/lib/pkgconfig/\"${i%%[<>=]*}\".pc\n+\t\t\tlocal pcfile=@TERMUX_PREFIX@/lib/pkgconfig/\"${i%%[<>=]*}\".pc\n \t\t\tif [ -e \"$pcfile\" ]; then\n \t\t\t\tlocal owner=$($APK $apkroot info --quiet --who-owns $pcfile)\n \t\t\t\twarning \"${owner:-package providing $pcfile} needs to be rebuilt\"\n@@ -1315,7 +1280,7 @@\n \n find_scanelf_paths() {\n \tlocal datadir=\"$1\"\n-\tlocal paths=\"$datadir/lib:$datadir/usr/lib\" i= rpaths=\n+\tlocal paths=\"$datadir/lib\" i= rpaths=\n \tif [ -n \"$ldpath\" ]; then\n \t\tpaths=\"$paths:$(echo \"${datadir}${ldpath}\" | sed \"s|:|:$datadir|g\")\"\n \tfi\n@@ -1461,7 +1426,7 @@\n \tname=\"$(pkginfo_val pkgname \"$controldir\"/.PKGINFO)\"\n \tdatadir=\"$pkgbasedir\"/$name\n \tfor i in $(sort -u \"$provides_pc\"); do\n-\t\tPKG_CONFIG_PATH=\"$datadir\"/usr/lib/pkgconfig pkg-config \\\n+\t\tPKG_CONFIG_PATH=\"$datadir\"/@TERMUX_PREFIX@/lib/pkgconfig pkg-config \\\n \t\t\t\t--print-requires \\\n \t\t\t\t--print-requires-private ${i%=*} \\\n \t\t\t\t| sed -E 's/\\s*([<>=]+)\\s*/\\1/' \\\n@@ -1555,7 +1520,7 @@\n \t\tlogcmd \"building $repo/$pkgname-$pkgver-r$pkgrel\"\n \t\tlocal _starttime=$(date --utc +%s)\n \t\tmsg \"Building $repo/$pkgname $pkgver-r$pkgrel (using $program $program_version) started $(date -R)\"\n-\t\tfor part in sanitycheck builddeps clean fetch unpack prepare mkusers build \\\n+\t\tfor part in sanitycheck builddeps clean fetch unpack prepare build \\\n \t\t\t\t$_check rootpkg; do\n \t\t\trunpart $part\n \t\tdone\n@@ -1625,14 +1590,14 @@\n \n \tlocal i\n \tfor i in doc man info html sgml licenses gtk-doc ri help; do\n-\t\tif [ -d \"$pkgdir/usr/share/$i\" ]; then\n-\t\t\tmkdir -p \"$subpkgdir/usr/share\"\n-\t\t\tmv \"$pkgdir/usr/share/$i\" \"$subpkgdir/usr/share/\"\n+\t\tif [ -d \"$pkgdir/@TERMUX_PREFIX@/share/$i\" ]; then\n+\t\t\tmkdir -p \"$subpkgdir/@TERMUX_PREFIX@/share\"\n+\t\t\tmv \"$pkgdir/@TERMUX_PREFIX@/share/$i\" \"$subpkgdir/@TERMUX_PREFIX@/share/\"\n \t\tfi\n \tdone\n \n \t# compress man pages\n-\tlocal mandir=\"$subpkgdir\"/usr/share/man\n+\tlocal mandir=\"$subpkgdir\"/@TERMUX_PREFIX@/share/man\n \t[ -d \"$mandir\" ] && find \"$mandir\" -type l \\\n \t\t-a \\( -name \\*.[0-8n] -o -name \\*.[0-8][a-z]* \\) \\\n \t\t-a \\! \\( -name '*.gz' -o -name '*.bz2' -o -name '*.xz' \\) \\\n@@ -1664,10 +1629,10 @@\n \t\t[ $islink -eq 0 ] && $gzip -9 \"$name\"\n \tdone\n \n-\trm -f \"$subpkgdir/usr/share/info/dir\"\n+\trm -f \"$subpkgdir/@TERMUX_PREFIX@/share/info/dir\"\n \n \t# remove if empty, ignore error (not empty)\n-\trmdir \"$pkgdir/usr/share\" \"$pkgdir/usr\" 2>/dev/null || :\n+\trmdir \"$pkgdir/@TERMUX_PREFIX@/share\" \"$pkgdir\" 2>/dev/null || :\n }\n \n doc() {\n@@ -1682,19 +1647,15 @@\n \tscanelf -R \"$pkgdir\" | grep ET_DYN | sed \"s:$pkgdir\\/::g\" | sed \"s:ET_DYN ::g\" | while read f; do\n \t\tlocal ddbg_srcdir=$(dirname \"$pkgdir/$f\")\n \t\tlocal ddbg_srcfile=$(basename \"$pkgdir/$f\")\n-\t\tlocal ddbg_dstdir=$(dirname \"$subpkgdir/usr/lib/debug/$f.debug\")\n-\t\tlocal ddbg_dstfile=$(basename \"$subpkgdir/usr/lib/debug/$f.debug\")\n+\t\tlocal ddbg_dstdir=$(dirname \"$subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug\")\n+\t\tlocal ddbg_dstfile=$(basename \"$subpkgdir/@TERMUX_PREFIX@/lib/debug/$f.debug\")\n \t\tmkdir -p \"$ddbg_dstdir\"\n \n \t\tcd \"$ddbg_srcdir\"\n-\t\tlocal xattr=$(getfattr --match=\"\" --dump \"${ddbg_srcfile}\")\n \t\t${CROSS_COMPILE}objcopy --only-keep-debug \"$ddbg_srcfile\" \"$ddbg_dstfile\"\n \t\t${CROSS_COMPILE}objcopy --add-gnu-debuglink=\"$ddbg_dstfile\" \"$ddbg_srcdir/$ddbg_srcfile\"\n \t\tmv \"$ddbg_dstfile\" \"$ddbg_dstdir\"\n \t\t${CROSS_COMPILE}strip \"$ddbg_srcfile\"\n-\t\tif [ -n \"$xattr\" ]; then\n-\t\t\techo \"$xattr\" | setfattr --restore=-\n-\t\tfi\n \tdone\n \treturn 0\n }\n@@ -1710,14 +1671,14 @@\n \tpkgdesc=\"$pkgdesc (development files)\"\n \n \tcd \"$pkgdir\" || return 0\n-\tlocal libdirs=usr/\n+\tlocal libdirs=./@TERMUX_PREFIX@/lib\n \t[ -d lib/ ] && libdirs=\"lib/ $libdirs\"\n-\tfor i in usr/include usr/lib/pkgconfig usr/share/aclocal\\\n-\t\t\tusr/share/gettext usr/bin/*-config\t\\\n-\t\t\tusr/share/vala/vapi usr/share/gir-[0-9]*\\\n-\t\t\tusr/share/qt*/mkspecs\t\t\t\\\n-\t\t\tusr/lib/qt*/mkspecs\t\t\t\\\n-\t\t\tusr/lib/cmake\t\t\t\t\\\n+\tfor i in ./@TERMUX_PREFIX@/lib/pkgconfig ./@TERMUX_PREFIX@/share/aclocal \\\n+\t\t\t./@TERMUX_PREFIX@/share/gettext ./@TERMUX_PREFIX@/bin/*-config\t\\\n+\t\t\t./@TERMUX_PREFIX@/share/vala/vapi ./@TERMUX_PREFIX@/share/gir-[0-9]* \\\n+\t\t\t./@TERMUX_PREFIX@/share/qt*/mkspecs \\\n+\t\t\t./@TERMUX_PREFIX@/lib/qt*/mkspecs \\\n+\t\t\t./@TERMUX_PREFIX@/lib/cmake \\\n \t\t\t$(find . -name include -type d)\t\\\n \t\t\t$([ -z \"${subpackages##*$pkgname-static*}\" ] && find $libdirs \\\n \t\t\t\t-name '*.a' 2>/dev/null) \\\n@@ -1808,27 +1769,11 @@\n \ttype \"$1\" 2>&1 | head -n 1 | egrep -q \"is a (shell )?function\"\n }\n \n-do_fakeroot() {\n-\tif [ -n \"$FAKEROOT\" ]; then\n-\t\t$FAKEROOT -- \"$@\"\n-\telse\n-\t\t\"$@\"\n-\tfi\n-}\n-\n-# wrap check() with fakeroot\n-check_fakeroot() {\n-\tcd \"$startdir\"\n-\t[ -n \"$FAKEROOT\" ] && msg \"Entering fakeroot...\"\n-\tdo_fakeroot \"$abuild_path\" $forceroot $color_opt $keep_build check\n-}\n-\n # build and package in fakeroot\n rootpkg() {\n \tcd \"$startdir\"\n \trm -rf \"$pkgdir\"\n-\t[ -n \"$FAKEROOT\" ] && msg \"Entering fakeroot...\"\n-\tdo_fakeroot \"$abuild_path\" $forceroot $color_opt $keep_build \\\n+\t\"$abuild_path\" $forceroot $color_opt $keep_build \\\n \t\tpackage \\\n \t\tprepare_subpackages \\\n \t\tprepare_language_packs \\\n@@ -2151,7 +2096,7 @@\n \t\t\t$install_deps $recursive $upgrade $color_opt \\\n \t\t\tabuildindex || return 1\n \tdone\n-\t$SUDO_APK add --upgrade --repository \"$REPODEST/$repo\" \\\n+\t$APK add --upgrade --repository \"$REPODEST/$repo\" \\\n \t\t$apk_opt_wait \\\n \t\t--virtual .makedepends-$pkgname $builddeps \\\n \t\t|| return 1\n@@ -2218,8 +2163,6 @@\n \n \tmsg \"Preparing build chroot...\"\n \n-\tmkusers\n-\n \tBUILD_ROOT=$(mktemp -d /var/tmp/abuild.XXXXXXXXXX)\n \tlocal aportsgit=${APORTSDIR:-${startdir}}\n \n@@ -2260,7 +2203,7 @@\n \t) < \"$repo_template\" > \"$BUILD_ROOT/etc/apk/repositories\"\n \n \tcalcdeps\n-\t$SUDO_APK add --initdb --root \"$BUILD_ROOT\" --update \\\n+\t$APK add --initdb --root \"$BUILD_ROOT\" --update \\\n \t\tabuild alpine-base build-base git $hostdeps $builddeps\n \n \tlocal bwrap_opts=\"\"\n@@ -2307,11 +2250,7 @@\n \t\t[ -e \"$filename\" ] || continue\n \n \t\t[ \"$osabi\" != \"STANDALONE\" ] || continue\n-\t\tlocal XATTR=$(getfattr --match=\"\" --dump \"${filename}\")\n \t\t\"${stripcmd}\" \"${filename}\"\n-\t\tif [ -n \"$XATTR\" ]; then\n-\t\t\techo \"$XATTR\" | setfattr --restore=-\n-\t\tfi\n \tdone\n }\n \n@@ -2401,22 +2340,22 @@\n \n \tlocal _quiet=\"$1\"\n \t[ -z \"$_quiet\" ] && msg \"Installing for build:$builddeps\"\n-\t$SUDO_APK add $_quiet $apk_opt_wait --repository \"$REPODEST/$repo\" \\\n+\t$APK add $_quiet $apk_opt_wait --repository \"$REPODEST/$repo\" \\\n \t\t--virtual .makedepends-$pkgname \\\n \t\t$builddeps \\\n \t\t|| return 1\n \tif [ -n \"$CBUILDROOT\" ]; then\n \t\t[ -z \"$_quiet\" ] && msg \"Installing for host:$hostdeps\"\n-\t\t$SUDO_APK add $_quiet --root \"$CBUILDROOT\" --arch \"$CTARGET_ARCH\" --repository \"$REPODEST/$repo\" $apk_opt_wait \\\n+\t\t$APK add $_quiet --root \"$CBUILDROOT\" --arch \"$CTARGET_ARCH\" --repository \"$REPODEST/$repo\" $apk_opt_wait \\\n \t\t\t--no-scripts --virtual .makedepends-$pkgname $hostdeps || return 1\n \tfi\n }\n \n undeps() {\n \tlocal _quiet=\"$@\"\n-\t$SUDO_APK del $_quiet $apk_opt_wait .makedepends-$pkgname || :\n+\t$APK del $_quiet $apk_opt_wait .makedepends-$pkgname || :\n \tif [ -n \"$CBUILDROOT\" ]; then\n-\t\t$SUDO_APK del $_quiet --root \"$CBUILDROOT\" --arch \"$CTARGET_ARCH\" $apk_opt_wait \\\n+\t\t$APK del $_quiet --root \"$CBUILDROOT\" --arch \"$CTARGET_ARCH\" $apk_opt_wait \\\n \t\t\t--no-scripts .makedepends-$pkgname || :\n \tfi\n }\n@@ -2536,7 +2475,7 @@\n \t\t  package     Install project into $pkgdir\n \t\t  prepare     Apply patches\n \t\t  rootbld     Build package in clean chroot\n-\t\t  rootpkg     Run 'package', the split functions and create apks as fakeroot\n+\t\t  rootpkg     Run 'package', the split functions and create apks\n \t\t  sanitycheck Basic sanity check of APKBUILD\n \t\t  snapshot    Create a \\$giturl or \\$svnurl snapshot and upload to \\$disturl\n \t\t  sourcecheck Check if remote source package exists upstream\n@@ -2618,7 +2557,7 @@\n if [ -z \"$REPODEST\" ]; then\n \twarning \"REPODEST is not set and is now required. Defaulting to ~/packages\"\n \t[ -n \"$PKGDEST\" ] && die \"PKGDEST is no longer supported.\"\n-\tREPODEST=\"~/packages\"\n+\tREPODEST=\"$HOME/packages\"\n fi\n \n # for recursive action\n"
  },
  {
    "path": "disabled-packages/abuild/build.sh",
    "content": "##\n## Since Termux is continuing to use APT as package manager, abuild & apk-tools\n## are disabled because don't have real use-cases currently.\n##\n\n## TODO: restore fakeroot functionality\nTERMUX_PKG_HOMEPAGE=https://github.com/alpinelinux/abuild\nTERMUX_PKG_DESCRIPTION=\"Build script to build Alpine packages\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.4.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/alpinelinux/abuild/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=f6f704e34f9d388a0228b645050dc7db7bf92f15a088835ae2c9b244420b9b61\nTERMUX_PKG_DEPENDS=\"apk-tools, autoconf, automake, bash, clang, curl, libtool, make, openssl-tool, pkg-config, tar, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"sysconfdir=$TERMUX_PREFIX/etc\"\nTERMUX_PKG_CONFFILES=\"etc/abuild.conf\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/abuild-adduser\nbin/abuild-addgroup\nbin/abuild-apk\nbin/abuild-sudo\nbin/buildlab\n\"\n\ntermux_step_post_make_install() {\n    install -Dm600 \"$TERMUX_PKG_SRCDIR/abuild.conf\" \"$TERMUX_PREFIX/etc/abuild.conf\"\n}\n"
  },
  {
    "path": "disabled-packages/abuild/checkapk.in.patch",
    "content": "--- abuild-3.2.0/checkapk.in\t2018-06-22 10:24:10.000000000 +0300\n+++ abuild-3.2.0.mod/checkapk.in\t2018-11-18 20:27:51.357171116 +0200\n@@ -64,7 +64,7 @@\n \t[ -f \"$filepath\" ] || die \"can't find $pkgfile\"\n \n \t# generate a temp repositories file with only the http(s) repos\n-\tgrep -E \"^https?:\" /etc/apk/repositories > $tmpdir/repositories\n+\tgrep -E \"^https?:\" @TERMUX_PREFIX@/etc/apk/repositories > $tmpdir/repositories\n \n \toldpkg=$(apk fetch --repositories-file $tmpdir/repositories --simulate 2>&1 | sed 's/^Downloading //')\n \tif [ \"${oldpkg}\" = \"${pkg}\" ]; then\n"
  },
  {
    "path": "disabled-packages/abuild/functions.sh.in.patch",
    "content": "diff -uNr abuild-3.4.0/functions.sh.in abuild-3.4.0.mod/functions.sh.in\n--- abuild-3.4.0/functions.sh.in\t2019-06-14 15:13:23.000000000 +0300\n+++ abuild-3.4.0.mod/functions.sh.in\t2019-07-21 17:00:19.730135313 +0300\n@@ -5,40 +5,20 @@\n \n arch_to_hostspec() {\n \tcase \"$1\" in\n-\taarch64)\techo \"aarch64-alpine-linux-musl\" ;;\n-\tarmel)\t\techo \"armv5-alpine-linux-musleabi\" ;;\n-\tarmhf)\t\techo \"armv6-alpine-linux-musleabihf\" ;;\n-\tarmv7)\t\techo \"armv7-alpine-linux-musleabihf\" ;;\n-\tmips)           echo \"mips-alpine-linux-musl\" ;;\n-\tmips64)         echo \"mips64-alpine-linux-musl\" ;;\n-\tmipsel)         echo \"mipsel-alpine-linux-musl\" ;;\n-\tmips64el)       echo \"mips64el-alpine-linux-musl\" ;;\n-\tppc)\t\techo \"powerpc-alpine-linux-musl\" ;;\n-\tppc64)\t\techo \"powerpc64-alpine-linux-musl\" ;;\n-\tppc64le)\techo \"powerpc64le-alpine-linux-musl\" ;;\n-\ts390x)\t\techo \"s390x-alpine-linux-musl\" ;;\n-\tx86)\t\techo \"i586-alpine-linux-musl\" ;;\n-\tx86_64)\t\techo \"x86_64-alpine-linux-musl\" ;;\n+\taarch64)    echo \"aarch64-linux-android\" ;;\n+\tarm)        echo \"arm-linux-androideabi\" ;;\n+\ti686)       echo \"i686-linux-android\" ;;\n+\tx86_64)     echo \"x86_64-linux-android\" ;;\n \t*)\t\techo \"unknown\" ;;\n \tesac\n }\n \n hostspec_to_arch() {\n \tcase \"$1\" in\n-\taarch64*-*-*-*)\t\techo \"aarch64\" ;;\n-\tarm*-*-*-*eabi)\t\techo \"armel\" ;;\n-\tarmv6*-*-*-*eabihf)\techo \"armhf\" ;;\n-\tarmv7*-*-*-*eabihf)\techo \"armv7\" ;;\n-\ti[0-9]86-*-*-*)\t\techo \"x86\" ;;\n-\tmips-*-*-*)             echo \"mips\" ;;\n-\tmips64-*-*-*)           echo \"mips64\" ;;\n-\tmipsel-*-*-*)           echo \"mipsel\" ;;\n-\tmips64el-*-*-*)         echo \"mips64el\" ;;\n-\tpowerpc-*-*-*)\t\techo \"ppc\" ;;\n-\tpowerpc64-*-*-*)\techo \"ppc64\" ;;\n-\tpowerpc64le-*-*-*)\techo \"ppc64le\" ;;\n-\ts390x-*-*-*)\t\techo \"s390x\" ;;\n-\tx86_64-*-*-*)\t\techo \"x86_64\" ;;\n+\taarch64-*)  echo \"aarch64\" ;;\n+\tarm-*)      echo \"arm\" ;;\n+\ti686-*)     echo \"i686\" ;;\n+\tx86_64-*)   echo \"x86_64\" ;;\n \t*)\t\t\techo \"unknown\" ;;\n \tesac\n }\n@@ -114,7 +94,7 @@\n \tPACKAGER=${_PACKAGER-$PACKAGER}\n \tUSE_COLORS=${_USE_COLORS-$USE_COLORS}\n \n-\t[ -z \"$CBUILD\" ] && CBUILD=\"$(gcc -dumpmachine)\"\n+\t[ -z \"$CBUILD\" ] && CBUILD=\"$(clang -dumpmachine)\"\n \t[ -z \"$CHOST\" ] && CHOST=\"$CBUILD\"\n \t[ -z \"$CTARGET\" ] && CTARGET=\"$CHOST\"\n \t[ \"$(arch_to_hostspec $CBUILD)\" != \"unknown\" ] && CBUILD=\"$(arch_to_hostspec $CBUILD)\"\n@@ -134,11 +114,71 @@\n \t\t# setup build root\n \t\t[ -z \"$CBUILDROOT\" ] && export CBUILDROOT=\"$HOME/sysroot-$CTARGET_ARCH/\"\n \t\t# prepare pkg-config for cross building\n-\t\t[ -z \"$PKG_CONFIG_PATH\" ] && export PKG_CONFIG_PATH=\"${CBUILDROOT}/usr/lib/pkgconfig/\"\n+\t\t[ -z \"$PKG_CONFIG_PATH\" ] && export PKG_CONFIG_PATH=\"${CBUILDROOT}/lib/pkgconfig/\"\n \t\t[ -z \"$PKG_CONFIG_SYSROOT_DIR\" ] && export PKG_CONFIG_SYSROOT_DIR=\"${CBUILDROOT}\"\n+\n \t\t# libtool bug workaround for extra rpaths\n-\t\t[ -z \"$lt_cv_sys_lib_dlsearch_path_spec\" ] && \\\n-\t\t\texport lt_cv_sys_lib_dlsearch_path_spec=\"${CBUILDROOT}/lib ${CBUILDROOT}/usr/lib /usr/lib /lib /usr/local/lib\"\n+\t\tif [ -z \"$lt_cv_sys_lib_dlsearch_path_spec\" ]; then\n+\t\t\tcase $CTARGET_ARCH in\n+\t\t\taarch64|x86_64) export lt_cv_sys_lib_dlsearch_path_spec=\"${CBUILDROOT}/lib @TERMUX_PREFIX@/lib /system/lib64\" ;;\n+\t\t\t*) export lt_cv_sys_lib_dlsearch_path_spec=\"${CBUILDROOT}/lib @TERMUX_PREFIX@/lib /system/lib\" ;;\n+\t\t\tesac\n+\t\tfi\n+\n+\t\t# Originally set in build-package.sh script in Termux build environment.\n+\t\t# https://github.com/termux/termux-packages/blob/master/build-package.sh\n+\t\texport ac_cv_func_getpwent=no\n+\t\texport ac_cv_func_getpwnam=no\n+\t\texport ac_cv_func_getpwuid=no\n+\t\texport ac_cv_func_sigsetmask=no\n+\t\texport ac_cv_c_bigendian=no\n+\t\texport ac_cv_func_calloc_0_nonnull=yes\n+\t\texport ac_cv_func_calloc_0_nonnull=yes\n+\t\texport ac_cv_func_chown_works=yes\n+\t\texport ac_cv_func_getgroups_works=yes\n+\t\texport ac_cv_func_malloc_0_nonnull=yes\n+\t\texport ac_cv_func_realloc_0_nonnull=yes\n+\t\texport am_cv_func_working_getline=yes\n+\t\texport gl_cv_C_locale_sans_EILSEQ=yes\n+\t\texport gl_cv_func_dup2_works=yes\n+\t\texport gl_cv_func_fcntl_f_dupfd_cloexec=yes\n+\t\texport gl_cv_func_fcntl_f_dupfd_works=yes\n+\t\texport gl_cv_func_fnmatch_posix=yes\n+\t\texport gl_cv_func_getcwd_abort_bug=no\n+\t\texport gl_cv_func_getcwd_null=yes\n+\t\texport gl_cv_func_getcwd_path_max=yes\n+\t\texport gl_cv_func_getcwd_posix_signature=yes\n+\t\texport gl_cv_func_gettimeofday_clobber=no\n+\t\texport gl_cv_func_gettimeofday_posix_signature=yes\n+\t\texport gl_cv_func_link_works=yes\n+\t\texport gl_cv_func_lstat_dereferences_slashed_symlink=yes\n+\t\texport gl_cv_func_malloc_0_nonnull=yes\n+\t\texport gl_cv_func_memchr_works=yes\n+\t\texport gl_cv_func_mkdir_trailing_dot_works=yes\n+\t\texport gl_cv_func_mkdir_trailing_slash_works=yes\n+\t\texport gl_cv_func_mkfifo_works=yes\n+\t\texport gl_cv_func_mknod_works=yes\n+\t\texport gl_cv_func_realpath_works=yes\n+\t\texport gl_cv_func_select_detects_ebadf=yes\n+\t\texport gl_cv_func_snprintf_posix=yes\n+\t\texport gl_cv_func_snprintf_retval_c99=yes\n+\t\texport gl_cv_func_snprintf_truncation_c99=yes\n+\t\texport gl_cv_func_stat_dir_slash=yes\n+\t\texport gl_cv_func_stat_file_slash=yes\n+\t\texport gl_cv_func_strerror_0_works=yes\n+\t\texport gl_cv_func_symlink_works=yes\n+\t\texport gl_cv_func_tzset_clobber=no\n+\t\texport gl_cv_func_unlink_honors_slashes=yes\n+\t\texport gl_cv_func_unlink_honors_slashes=yes\n+\t\texport gl_cv_func_vsnprintf_posix=yes\n+\t\texport gl_cv_func_vsnprintf_zerosize_c99=yes\n+\t\texport gl_cv_func_wcwidth_works=yes\n+\t\texport gl_cv_func_working_getdelim=yes\n+\t\texport gl_cv_func_working_mkstemp=yes\n+\t\texport gl_cv_func_working_mktime=yes\n+\t\texport gl_cv_func_working_strerror=yes\n+\t\texport gl_cv_header_working_fcntl_h=yes\n+\n \t\t# setup cross-compiler\n \t\tif [ -z \"$CROSS_COMPILE\" ]; then\n \t\t\texport CROSS_COMPILE=\"${CHOST}-\"\n@@ -149,8 +189,8 @@\n \t\t\texport HOSTCXXFLAGS=\"$CXXFLAGS\"\n \t\t\texport HOSTCFLAGS=\"$CFLAGS\"\n \t\t\texport HOSTLDFLAGS=\"$LDFLAGS\"\n-\t\t\texport CC=${CROSS_COMPILE}gcc\n-\t\t\texport CXX=${CROSS_COMPILE}g++\n+\t\t\texport CC=${CROSS_COMPILE}clang\n+\t\t\texport CXX=${CROSS_COMPILE}clang++\n \t\t\texport LD=${CROSS_COMPILE}ld\n \t\t\texport CPPFLAGS=\"--sysroot=${CBUILDROOT} $CPPFLAGS\"\n \t\t\texport CXXFLAGS=\"--sysroot=${CBUILDROOT} $CXXFLAGS\"\n"
  },
  {
    "path": "disabled-packages/abuild/sample.APKBUILD.patch",
    "content": "--- abuild-3.2.0/sample.APKBUILD\t2018-06-22 10:24:10.000000000 +0300\n+++ abuild-3.2.0.mod/sample.APKBUILD\t2018-11-19 01:28:10.783277331 +0200\n@@ -27,10 +27,10 @@\n \n build() {\n \tcd \"$builddir\"\n-\t./configure --prefix=/usr \\\n-\t\t--sysconfdir=/etc \\\n-\t\t--mandir=/usr/share/man \\\n-\t\t--infodir=/usr/share/info\n+\t./configure --prefix=$PREFIX \\\n+\t\t--sysconfdir=$PREFIX/etc \\\n+\t\t--mandir=$PREFIX/share/man \\\n+\t\t--infodir=$PREFIX/share/info\n \tmake\n }\n \n"
  },
  {
    "path": "disabled-packages/alsa-lib/alsa-conf-dir.patch",
    "content": "--- ./src/conf/alsa.conf.orig\t2016-12-20 14:43:20.000000000 +0000\n+++ ./src/conf/alsa.conf\t2017-03-06 22:51:47.242150837 +0000\n@@ -15,7 +15,7 @@\n \t\t\t\t\t\"/alsa.conf.d/\"\n \t\t\t\t]\n \t\t\t}\n-\t\t\t\"/etc/asound.conf\"\n+\t\t\t\"@TERMUX_PREFIX@/etc/asound.conf\"\n \t\t\t\"~/.asoundrc\"\n \t\t]\n \t\terrors false\n"
  },
  {
    "path": "disabled-packages/alsa-lib/build.sh",
    "content": "# patches taken from https://github.com/michaelwu/alsa-lib\nTERMUX_PKG_HOMEPAGE=http://www.alsa-project.org\nTERMUX_PKG_VERSION=1.1.3\n# TERMUX_PKG_DEPENDS=\"libandroid-shmem, python2\"\nTERMUX_PKG_DEPENDS=\"libandroid-shmem\"\nTERMUX_PKG_SRCURL=ftp://ftp.alsa-project.org/pub/lib/alsa-lib-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=71282502184c592c1a008e256c22ed0ba5728ca65e05273ceb480c70f515969c\n# TERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-pythonlibs=\\\"-lpython2.7\\\" --with-pythonincludes=-I/$TERMUX_PREFIX/include/python2.7\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-python\"\n\ntermux_step_pre_configure() {\n    #LDFLAGS=\"$LDFLAGS -landroid-shmem\"\n    #_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'\n    #for _file in $_files; do sed -i 's%#include <sys/shm.h>%#include <shmem/shm.h>%' \"$TERMUX_PKG_SRCDIR/$_file\"; done\n    #export ac_cv_header_sys_shm_h='no'\n    CPPFLAGS=\"$CPPFLAGS -DTERMUX_SHMEM_STUBS -DTERMUX_SEMOPS_STUBS\"\n}\n"
  },
  {
    "path": "disabled-packages/alsa-lib/pcm_direct.c.patch",
    "content": "--- ./src/pcm/pcm_direct.c\t2016-08-02 23:18:38.000000000 +0530\n+++ ./src/pcm/pcm_direct.c\t2016-12-02 23:19:30.771819040 +0530\n@@ -44,12 +44,14 @@\n  *\n  */\n  \n+#if !defined(ANDROID) && !defined(__ANDROID__)\n union semun {\n \tint              val;    /* Value for SETVAL */\n \tstruct semid_ds *buf;    /* Buffer for IPC_STAT, IPC_SET */\n \tunsigned short  *array;  /* Array for GETALL, SETALL */\n \tstruct seminfo  *__buf;  /* Buffer for IPC_INFO (Linux specific) */\n };\n+#endif\n  \n /*\n  * FIXME:\n"
  },
  {
    "path": "disabled-packages/alsa-lib/pcm_mmap.c.patch.old",
    "content": "--- ./src/pcm/pcm_mmap.c\t2016-08-02 23:18:38.000000000 +0530\n+++ /home/vishal/AndroidDev/alsa/src/pcm/pcm_mmap.c\t2016-12-03 00:06:36.620336924 +0530\n@@ -344,7 +344,7 @@\n \t\t\ti->addr = ptr;\n \t\t\tbreak;\n \t\tcase SND_PCM_AREA_SHM:\n-#ifdef HAVE_SYS_SHM_H\n+#if 0\n \t\t\tif (i->u.shm.shmid < 0) {\n \t\t\t\tint id;\n \t\t\t\t/* FIXME: safer permission? */\n@@ -474,7 +474,7 @@\n \t\t\terrno = 0;\n \t\t\tbreak;\n \t\tcase SND_PCM_AREA_SHM:\n-#ifdef HAVE_SYS_SHM_H\n+#if 0\n \t\t\tif (i->u.shm.area) {\n \t\t\t\tsnd_shm_area_destroy(i->u.shm.area);\n \t\t\t\ti->u.shm.area = NULL;\n"
  },
  {
    "path": "disabled-packages/alsa-lib/versionsort.patch",
    "content": "diff -ruN ./src/conf.c /home/vishal/AndroidDev/alsa/src/conf.c\n--- ./src/conf.c\t2016-08-02 23:18:38.000000000 +0530\n+++ /home/vishal/AndroidDev/alsa/src/conf.c\t2016-12-02 23:42:04.689785910 +0530\n@@ -3558,7 +3558,7 @@\n \t\t\tint n;\n \n #ifndef DOC_HIDDEN\n-#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun)\n+#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(__ANDROID__) && !defined(ANDROID)\n #define SORTFUNC\tversionsort\n #else\n #define SORTFUNC\talphasort\ndiff -ruN ./src/ucm/parser.c /home/vishal/AndroidDev/alsa/src/ucm/parser.c\n--- ./src/ucm/parser.c\t2016-08-02 23:18:38.000000000 +0530\n+++ /home/vishal/AndroidDev/alsa/src/ucm/parser.c\t2016-12-02 23:42:17.406370931 +0530\n@@ -1274,7 +1274,7 @@\n \t\t\"%s\", env ? env : ALSA_USE_CASE_DIR);\n \tfilename[MAX_FILE-1] = '\\0';\n \n-#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun)\n+#if defined(_GNU_SOURCE) && !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(__ANDROID__) && !defined(ANDROID)\n #define SORTFUNC\tversionsort\n #else\n #define SORTFUNC\talphasort\n"
  },
  {
    "path": "disabled-packages/alsa-plugins/asound.conf",
    "content": "# Use pulseaudio by default\npcm.!default {\n  type pulse\n  fallback \"sysdefault\"\n  hint {\n    show on\n    description \"Default ALSA Output (currently PulseAudio Sound Server)\"\n  }\n}\n\nctl.!default {\n  type pulse\n  fallback \"sysdefault\"\n}\n\n# vim:set ft=alsaconf:\n"
  },
  {
    "path": "disabled-packages/alsa-plugins/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.alsa-project.org\nTERMUX_PKG_VERSION=1.1.1\nTERMUX_PKG_SRCURL=ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=8ea4d1e082c36528a896a2581e5eb62d4dc2683238e353050d0d624e65f901f1\nTERMUX_PKG_DEPENDS=\"alsa-lib, pulseaudio\"\nTERMUX_PKG_EXTRA_MAKE_ARGS='SUBDIRS=pulse'\n\ntermux_step_post_make_install() {\n    cp $TERMUX_PKG_BUILDER_DIR/asound.conf $TERMUX_PREFIX/etc\n}\n"
  },
  {
    "path": "disabled-packages/alsa-utils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.alsa-project.org\nTERMUX_PKG_VERSION=1.1.3\nTERMUX_PKG_SRCURL=ftp://ftp.alsa-project.org/pub/utils/alsa-utils-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=127217a54eea0f9a49700a2f239a2d4f5384aa094d68df04a8eb80132eb6167c\nTERMUX_PKG_DEPENDS=\"alsa-lib, ncurses\"\nTERMUX_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\"\n\ntermux_step_pre_configure() {\n    LDFLAGS+=\" -llog\"\n}\n"
  },
  {
    "path": "disabled-packages/alsa-utils/configure.patch",
    "content": "--- ./configure\t2016-08-02 22:44:23.000000000 +0530\n+++ ../configure\t2016-12-03 23:06:46.641370754 +0530\n@@ -7123,7 +7123,7 @@\n \tLDFLAGS=\"$LDFLAGS $ALSA_LIBS\"\n fi\n \n-ALSA_LIBS=\"$ALSA_LIBS -lasound -lm -ldl -lpthread\"\n+ALSA_LIBS=\"$ALSA_LIBS -lasound -lm -ldl\"\n LIBS=\"$ALSA_LIBS $LIBS\"\n { $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ALSA_LIBS\" >&5\n $as_echo \"$ALSA_LIBS\" >&6; }\n@@ -7741,7 +7741,6 @@\n   $as_echo_n \"(cached) \" >&6\n else\n   ac_check_lib_save_LIBS=$LIBS\n-LIBS=\"-lpthread  $LIBS\"\n cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n /* end confdefs.h.  */\n \n@@ -7776,7 +7775,6 @@\n #define HAVE_LIBPTHREAD 1\n _ACEOF\n \n-  LIBS=\"-lpthread $LIBS\"\n \n else\n   as_fn_error $? \"Error: need PTHREAD library\" \"$LINENO\" 5\n"
  },
  {
    "path": "disabled-packages/alsa-utils/volume_mapping.c.patch",
    "content": "--- ./alsamixer/volume_mapping.c\t2016-08-02 22:39:45.000000000 +0530\n+++ ../volume_mapping.c\t2016-12-03 23:15:26.390744307 +0530\n@@ -37,7 +37,7 @@\n #include <stdbool.h>\n #include \"volume_mapping.h\"\n \n-#ifdef __UCLIBC__\n+#if defined(__UCLIBC__) || defined(__ANDROID__)\n /* 10^x = 10^(log e^x) = (e^x)^log10 = e^(x * log 10) */\n #define exp10(x) (exp((x) * log(10)))\n #endif /* __UCLIBC__ */\n"
  },
  {
    "path": "disabled-packages/ant/ant",
    "content": "#!@TERMUX_PREFIX@/bin/sh\n\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nset -e -u\n\n# Extract launch and ant arguments, (see details below).\nant_exec_args=\nno_config=false\nant_exec_debug=false\nshow_help=false\nfor arg in \"$@\" ; do\n  if [ \"$arg\" = \"--noconfig\" ] ; then\n    no_config=true\n  elif [ \"$arg\" = \"--execdebug\" ] ; then\n    ant_exec_debug=true\n  elif [ my\"$arg\" = my\"--h\"  -o my\"$arg\" = my\"--help\"  ] ; then\n    show_help=true\n    ant_exec_args=\"$ant_exec_args -h\"\n  else\n    if [  my\"$arg\" = my\"-h\"  -o  my\"$arg\" = my\"-help\" ] ; then\n      show_help=true\n    fi\n    ant_exec_args=\"$ant_exec_args \\\"$arg\\\"\"\n  fi\ndone\n\nif [ -z \"$ANT_HOME\" ]; then\n  ANT_HOME=@TERMUX_PREFIX@/share/ant\nfi\n\nif ! $no_config ; then\n  if [ -f \"$HOME/.ant/ant.conf\" ] ; then\n    . $HOME/.ant/ant.conf\n  fi\n  if [ -f \"$HOME/.antrc\" ] ; then\n    . \"$HOME/.antrc\"\n  fi\nfi\n\nANT_LIB=\"${ANT_HOME}/lib\"\n\nif [ -z \"$LOCALCLASSPATH\" ] ; then\n    LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar\nelse\n    LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH\nfi\n\n# Show script help if requested\nif $show_help ; then\n  echo $0 '[script options] [options] [target [target2 [target3] ..]]'\n  echo 'Script Options:'\n  echo '  --help, --h            print this message and ant help'\n  echo '  --noconfig             suppress sourcing of /etc/ant.conf,'\n  echo '                         $HOME/.ant/ant.conf, and $HOME/.antrc'\n  echo '                         configuration files'\n  echo '  --execdebug            print ant exec line generated by this'\n  echo '                         launch script'\n  echo '  '\nfi\n\n# Execute ant using eval/exec to preserve spaces in paths, java options, and ant args\nant_sys_opts=\nant_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\\\"\"\nif $ant_exec_debug ; then\n    echo $ant_exec_command $ant_exec_args\nfi\neval $ant_exec_command \"$ant_exec_args\"\n"
  },
  {
    "path": "disabled-packages/ant/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://ant.apache.org/\nTERMUX_PKG_DESCRIPTION=\"Java based build tool like make\"\nTERMUX_PKG_VERSION=1.9.6\nTERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net//ant/binaries/apache-ant-${TERMUX_PKG_VERSION}-bin.tar.bz2\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/ant/lib\n\n\tfor jar in ant ant-launcher; do\n\t\t$TERMUX_DX \\\n\t\t\t--dex \\\n\t\t\t--output=$TERMUX_PREFIX/share/ant/lib/${jar}.jar \\\n\t\t\tlib/${jar}.jar\n\tdone\n\n\tinstall $TERMUX_PKG_BUILDER_DIR/ant $TERMUX_PREFIX/bin/ant\n\tperl -p -i -e \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PREFIX/bin/ant\n}\n"
  },
  {
    "path": "disabled-packages/apk-tools/Make.rules.patch",
    "content": "diff -u -r ../apk-tools-2.10.1/Make.rules ./Make.rules\n--- ../apk-tools-2.10.1/Make.rules\t2018-09-10 08:04:03.000000000 +0000\n+++ ./Make.rules\t2018-09-10 21:36:27.914805239 +0000\n@@ -64,9 +64,9 @@\n # Utilities and default flags for them.\n \n CROSS_COMPILE\t?=\n-CC\t\t:= $(CROSS_COMPILE)gcc\n-AR\t\t:= $(CROSS_COMPILE)ar\n-LD\t\t:= $(CROSS_COMPILE)ld\n+CC\t\t?= $(CROSS_COMPILE)gcc\n+AR\t\t?= $(CROSS_COMPILE)ar\n+LD\t\t?= $(CROSS_COMPILE)ld\n INSTALL\t\t:= install\n INSTALLDIR\t:= $(INSTALL) -d\n \n"
  },
  {
    "path": "disabled-packages/apk-tools/Makefile.patch",
    "content": "diff -u -r ../apk-tools-2.10.1/Makefile ./Makefile\n--- ../apk-tools-2.10.1/Makefile\t2018-09-10 08:04:03.000000000 +0000\n+++ ./Makefile\t2018-09-10 21:58:19.631911343 +0000\n@@ -10,11 +10,11 @@\n # Default directories\n \n DESTDIR\t\t:=\n-SBINDIR\t\t:= /sbin\n-LIBDIR\t\t:= /lib\n-CONFDIR\t\t:= /etc/apk\n-MANDIR\t\t:= /usr/share/man\n-DOCDIR\t\t:= /usr/share/doc/apk\n+SBINDIR\t\t:= @TERMUX_PREFIX@/bin\n+LIBDIR\t\t:= @TERMUX_PREFIX@/lib\n+CONFDIR\t\t:= @TERMUX_PREFIX@/etc/apk\n+MANDIR\t\t:= @TERMUX_PREFIX@/share/man\n+DOCDIR\t\t:= @TERMUX_PREFIX@/share/doc/apk\n \n export DESTDIR SBINDIR LIBDIR CONFDIR MANDIR DOCDIR\n \n"
  },
  {
    "path": "disabled-packages/apk-tools/build.sh",
    "content": "##\n## Since Termux is continuing to use APT as package manager, abuild & apk-tools\n## are disabled because don't have real use-cases currently.\n##\n\nTERMUX_PKG_HOMEPAGE=https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management\nTERMUX_PKG_DESCRIPTION=\"Alpine Linux package management tools\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.10.4\nTERMUX_PKG_SRCURL=https://github.com/alpinelinux/apk-tools/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=c08aa725a0437a6a83c5364a1a3a468e4aef5d1d09523369074779021397281c\nTERMUX_PKG_DEPENDS=\"openssl, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"LUAAPK=\"\nTERMUX_PKG_CONFFILES=\"etc/apk/repositories\"\n\ntermux_step_post_make_install() {\n    mkdir -p $TERMUX_PREFIX/etc/apk/\n    echo $TERMUX_ARCH > $TERMUX_PREFIX/etc/apk/arch\n\n    echo \"https://termux.net/apk/main\" > $TERMUX_PREFIX/etc/apk/repositories\n}\n\ntermux_step_post_massage() {\n    mkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/etc/apk/keys\"\n    mkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/etc/apk/protected_paths.d\"\n    mkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/apk/db/\"\n    mkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/cache/apk\"\n\n    ln -sfr \\\n\t\"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/cache/apk\" \\\n\t\"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/etc/apk/cache\"\n}\n\ntermux_step_create_debscripts() {\n    {\n\techo \"#!$TERMUX_PREFIX/bin/sh\"\n\techo \"touch $TERMUX_PREFIX/etc/apk/world\"\n    } > ./postinst\n    chmod 755 postinst\n}\n"
  },
  {
    "path": "disabled-packages/apk-tools/libfetch-http.c.patch",
    "content": "diff -uNr apk-tools-2.10.4/libfetch/http.c apk-tools-2.10.4.mod/libfetch/http.c\n--- apk-tools-2.10.4/libfetch/http.c\t2019-06-05 15:34:16.000000000 +0300\n+++ apk-tools-2.10.4.mod/libfetch/http.c\t2019-07-21 16:38:08.300760202 +0300\n@@ -496,14 +496,11 @@\n static int\n http_parse_mtime(const char *p, time_t *mtime)\n {\n-\tchar *locale, *r;\n+\tchar *r;\n \tstruct tm tm;\n \n-\tlocale = strdupa(setlocale(LC_TIME, NULL));\n-\tsetlocale(LC_TIME, \"C\");\n \tr = strptime(p, \"%a, %d %b %Y %H:%M:%S GMT\", &tm);\n-\t/* XXX should add support for date-2 and date-3 */\n-\tsetlocale(LC_TIME, locale);\n+\n \tif (r == NULL)\n \t\treturn (-1);\n \t*mtime = timegm(&tm);\n"
  },
  {
    "path": "disabled-packages/apk-tools/src-apk.c.patch",
    "content": "diff -u -r ../apk-tools-2.10.1/src/apk.c ./src/apk.c\n--- ../apk-tools-2.10.1/src/apk.c\t2018-09-10 08:04:03.000000000 +0000\n+++ ./src/apk.c\t2018-09-10 22:02:50.668809543 +0000\n@@ -486,7 +486,7 @@\n \n \tapk_flags |= APK_PROGRESS;\n \tif (!(apk_flags & APK_SIMULATE) &&\n-\t    access(\"/etc/apk/interactive\", F_OK) == 0)\n+\t    access(\"@TERMUX_PREFIX@/etc/apk/interactive\", F_OK) == 0)\n \t\tapk_flags |= APK_INTERACTIVE;\n }\n \n"
  },
  {
    "path": "disabled-packages/apk-tools/src-archive.c.patch",
    "content": "diff -uNr apk-tools-2.10.3/src/archive.c apk-tools-2.10.3.mod/src/archive.c\n--- apk-tools-2.10.3/src/archive.c\t2018-11-15 15:09:07.000000000 +0200\n+++ apk-tools-2.10.3.mod/src/archive.c\t2018-11-19 17:36:03.835900565 +0200\n@@ -20,6 +20,7 @@\n #include <sysexits.h>\n #include <sys/wait.h>\n #include <sys/stat.h>\n+#include <sys/sysmacros.h>\n #include <sys/xattr.h>\n #include <limits.h>\n #include <stdint.h>\n@@ -441,7 +442,9 @@\n \t\t\t      struct apk_istream *is,\n \t\t\t      apk_progress_cb cb, void *cb_ctx)\n {\n+#ifndef __ANDROID__\n \tstruct apk_xattr *xattr;\n+#endif\n \tconst char *fn = extract_name ?: ae->name;\n \tint fd, r = -1, atflags = 0, ret = 0;\n \n@@ -487,12 +490,14 @@\n \t\treturn ret;\n \t}\n \n+#ifndef __ANDROID__\n \tr = fchownat(atfd, fn, ae->uid, ae->gid, atflags);\n \tif (r < 0) {\n \t\tapk_error(\"Failed to set ownership on %s: %s\",\n \t\t\t  fn, strerror(errno));\n \t\tif (!ret) ret = -errno;\n \t}\n+#endif\n \n \t/* chown resets suid bit so we need set it again */\n \tif (ae->mode & 07000) {\n@@ -506,6 +511,7 @@\n \t}\n \n \t/* extract xattrs */\n+#ifndef __ANDROID__\n \tif (!S_ISLNK(ae->mode) && ae->xattrs && ae->xattrs->num) {\n \t\tr = 0;\n \t\tfd = openat(atfd, fn, O_RDWR);\n@@ -527,6 +533,7 @@\n \t\t\tif (!ret) ret = r;\n \t\t}\n \t}\n+#endif\n \n \tif (!S_ISLNK(ae->mode)) {\n \t\t/* preserve modification time */\n"
  },
  {
    "path": "disabled-packages/apk-tools/src-commit.c.patch",
    "content": "diff -uNr apk-tools-2.10.3/src/commit.c apk-tools-2.10.3.mod/src/commit.c\n--- apk-tools-2.10.3/src/commit.c\t2018-11-15 15:09:07.000000000 +0200\n+++ apk-tools-2.10.3.mod/src/commit.c\t2018-11-19 17:44:44.799596053 +0200\n@@ -19,6 +19,8 @@\n \n #include \"apk_print.h\"\n \n+#include \"termux_prefix.h\"\n+\n static inline int pkg_available(struct apk_database *db, struct apk_package *pkg)\n {\n \tif (pkg->repos & db->available_repos)\n@@ -235,7 +237,7 @@\n \tif (file[0] == '.') return 0;\n \tif ((apk_flags & (APK_NO_SCRIPTS | APK_SIMULATE)) != 0) return 0;\n \n-\tsnprintf(fn, sizeof(fn), \"etc/apk/commit_hooks.d\" \"/%s\", file);\n+\tsnprintf(fn, sizeof(fn), TERMUX_PREFIX_RELATIVE\"etc/apk/commit_hooks.d\" \"/%s\", file);\n \tif ((apk_flags & APK_NO_COMMIT_HOOKS) != 0) {\n \t\tapk_message(\"Skipping: %s %s\", fn, commit_hook_str[hook->type]);\n \t\treturn 0;\n@@ -251,7 +253,7 @@\n static int run_commit_hooks(struct apk_database *db, int type)\n {\n \tstruct apk_commit_hook hook = { .db = db, .type = type };\n-\treturn apk_dir_foreach_file(openat(db->root_fd, \"etc/apk/commit_hooks.d\", O_RDONLY | O_CLOEXEC),\n+\treturn apk_dir_foreach_file(openat(db->root_fd, TERMUX_PREFIX_RELATIVE\"etc/apk/commit_hooks.d\", O_RDONLY | O_CLOEXEC),\n \t\t\t\t    run_commit_hook, &hook);\n }\n \n"
  },
  {
    "path": "disabled-packages/apk-tools/src-database.c.patch",
    "content": "diff -uNr apk-tools-2.10.3/src/database.c apk-tools-2.10.3.mod/src/database.c\n--- apk-tools-2.10.3/src/database.c\t2018-11-15 15:09:07.000000000 +0200\n+++ apk-tools-2.10.3.mod/src/database.c\t2018-11-19 17:45:05.469750983 +0200\n@@ -37,6 +37,8 @@\n #include \"apk_print.h\"\n #include \"apk_openssl.h\"\n \n+#include \"termux_prefix.h\"\n+\n static const apk_spn_match_def apk_spn_repo_separators = {\n \t[4] = (1<<0) /* */,\n \t[7] = (1<<2) /*:*/,\n@@ -54,22 +56,22 @@\n \n static const char * const apkindex_tar_gz = \"APKINDEX.tar.gz\";\n \n-static const char * const apk_static_cache_dir = \"var/cache/apk\";\n+static const char * const apk_static_cache_dir = TERMUX_PREFIX_RELATIVE\"var/cache/apk\";\n \n-static const char * const apk_world_file = \"etc/apk/world\";\n-static const char * const apk_world_file_tmp = \"etc/apk/world.new\";\n-static const char * const apk_arch_file = \"etc/apk/arch\";\n+static const char * const apk_world_file = TERMUX_PREFIX_RELATIVE\"etc/apk/world\";\n+static const char * const apk_world_file_tmp = TERMUX_PREFIX_RELATIVE\"etc/apk/world.new\";\n+static const char * const apk_arch_file = TERMUX_PREFIX_RELATIVE\"etc/apk/arch\";\n \n-static const char * const apk_lock_file = \"lib/apk/db/lock\";\n+static const char * const apk_lock_file = TERMUX_PREFIX_RELATIVE\"lib/apk/db/lock\";\n \n-static const char * const apk_scripts_file = \"lib/apk/db/scripts.tar\";\n-static const char * const apk_scripts_file_tmp = \"lib/apk/db/scripts.tar.new\";\n+static const char * const apk_scripts_file = TERMUX_PREFIX_RELATIVE\"lib/apk/db/scripts.tar\";\n+static const char * const apk_scripts_file_tmp = TERMUX_PREFIX_RELATIVE\"lib/apk/db/scripts.tar.new\";\n \n-static const char * const apk_triggers_file = \"lib/apk/db/triggers\";\n-static const char * const apk_triggers_file_tmp = \"lib/apk/db/triggers.new\";\n+static const char * const apk_triggers_file = TERMUX_PREFIX_RELATIVE\"lib/apk/db/triggers\";\n+static const char * const apk_triggers_file_tmp = TERMUX_PREFIX_RELATIVE\"lib/apk/db/triggers.new\";\n \n-const char * const apk_installed_file = \"lib/apk/db/installed\";\n-static const char * const apk_installed_file_tmp = \"lib/apk/db/installed.new\";\n+const char * const apk_installed_file = TERMUX_PREFIX_RELATIVE\"lib/apk/db/installed\";\n+static const char * const apk_installed_file_tmp = TERMUX_PREFIX_RELATIVE\"lib/apk/db/installed.new\";\n \n static struct apk_db_acl *apk_default_acl_dir, *apk_default_acl_file;\n \n@@ -1332,19 +1334,20 @@\n static int apk_db_create(struct apk_database *db)\n {\n \tint fd;\n-\n-\tmkdirat(db->root_fd, \"tmp\", 01777);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"tmp\", 01777);\n \tmkdirat(db->root_fd, \"dev\", 0755);\n+#ifndef __ANDROID__\n \tmknodat(db->root_fd, \"dev/null\", S_IFCHR | 0666, makedev(1, 3));\n-\tmkdirat(db->root_fd, \"etc\", 0755);\n-\tmkdirat(db->root_fd, \"etc/apk\", 0755);\n-\tmkdirat(db->root_fd, \"lib\", 0755);\n-\tmkdirat(db->root_fd, \"lib/apk\", 0755);\n-\tmkdirat(db->root_fd, \"lib/apk/db\", 0755);\n-\tmkdirat(db->root_fd, \"var\", 0755);\n-\tmkdirat(db->root_fd, \"var/cache\", 0755);\n-\tmkdirat(db->root_fd, \"var/cache/apk\", 0755);\n-\tmkdirat(db->root_fd, \"var/cache/misc\", 0755);\n+#endif\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"etc\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"etc/apk\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"lib\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"lib/apk\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"lib/apk/db\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"var\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"var/cache\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"var/cache/apk\", 0755);\n+\tmkdirat(db->root_fd, TERMUX_PREFIX_RELATIVE\"var/cache/misc\", 0755);\n \n \tfd = openat(db->root_fd, apk_world_file, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0644);\n \tif (fd < 0)\n@@ -1533,7 +1536,7 @@\n \t    !(dbopts->open_flags & APK_OPENF_NO_AUTOUPDATE) &&\n \t    !(apk_flags & APK_NO_NETWORK))\n \t\tdb->autoupdate = 1;\n-\tif (!dbopts->cache_dir) dbopts->cache_dir = \"etc/apk/cache\";\n+\tif (!dbopts->cache_dir) dbopts->cache_dir = TERMUX_PREFIX_RELATIVE\"etc/apk/cache\";\n \n \tapk_db_setup_repositories(db, dbopts->cache_dir);\n \n@@ -1625,7 +1628,7 @@\n \tblob = APK_BLOB_STR(\"+etc\\n\" \"@etc/init.d\\n\" \"!etc/apk\\n\");\n \tapk_blob_for_each_segment(blob, \"\\n\", add_protected_path, db);\n \n-\tapk_dir_foreach_file(openat(db->root_fd, \"etc/apk/protected_paths.d\", O_RDONLY | O_CLOEXEC),\n+\tapk_dir_foreach_file(openat(db->root_fd, TERMUX_PREFIX_RELATIVE\"etc/apk/protected_paths.d\", O_RDONLY | O_CLOEXEC),\n \t\t\t     add_protected_paths_from_file, db);\n \n \t/* figure out where to have the cache */\n@@ -1655,7 +1658,7 @@\n \t}\n \n \tdb->keys_fd = openat(db->root_fd,\n-\t\t\t     dbopts->keys_dir ?: \"etc/apk/keys\",\n+\t\t\t     dbopts->keys_dir ?: TERMUX_PREFIX_RELATIVE\"etc/apk/keys\",\n \t\t\t     O_RDONLY | O_CLOEXEC);\n \n \tif (apk_flags & APK_OVERLAY_FROM_STDIN) {\n@@ -1693,8 +1696,8 @@\n \t\t\tapk_db_add_repository(db, APK_BLOB_STR(repo->url));\n \n \t\tif (dbopts->repositories_file == NULL) {\n-\t\t\tadd_repos_from_file(db, db->root_fd, \"etc/apk/repositories\");\n-\t\t\tapk_dir_foreach_file(openat(db->root_fd, \"etc/apk/repositories.d\", O_RDONLY | O_CLOEXEC),\n+\t\t\tadd_repos_from_file(db, db->root_fd, TERMUX_PREFIX_RELATIVE\"etc/apk/repositories\");\n+\t\t\tapk_dir_foreach_file(openat(db->root_fd, TERMUX_PREFIX_RELATIVE\"etc/apk/repositories.d\", O_RDONLY | O_CLOEXEC),\n \t\t\t\t\t     add_repos_from_file, db);\n \t\t} else {\n \t\t\tadd_repos_from_file(db, db->root_fd, dbopts->repositories_file);\n@@ -1931,7 +1934,7 @@\n \tint status;\n \tpid_t pid;\n \tstatic char * const environment[] = {\n-\t\t\"PATH=/usr/sbin:/usr/bin:/sbin:/bin\",\n+\t\t\"PATH=@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets\",\n \t\tNULL\n \t};\n \n@@ -1968,9 +1971,10 @@\n \tr = fstatat(db->root_fd, dir->name, &st, AT_SYMLINK_NOFOLLOW);\n \tif (r < 0 || (st.st_mode & 07777) != (dir->mode & 07777))\n \t\tfchmodat(db->root_fd, dir->name, dir->mode, 0);\n+#ifndef __ANDROID__\n \tif (r < 0 || st.st_uid != dir->uid || st.st_gid != dir->gid)\n \t\tfchownat(db->root_fd, dir->name, dir->uid, dir->gid, 0);\n-\n+#endif\n \treturn 0;\n }\n \n"
  },
  {
    "path": "disabled-packages/apk-tools/src-io.c.patch",
    "content": "diff -uNr apk-tools-2.10.3/src/io.c apk-tools-2.10.3.mod/src/io.c\n--- apk-tools-2.10.3/src/io.c\t2018-11-15 15:09:07.000000000 +0200\n+++ apk-tools-2.10.3.mod/src/io.c\t2018-11-19 17:36:03.842567276 +0200\n@@ -1012,6 +1012,7 @@\n \t.delete_item = (apk_hash_delete_f) free,\n };\n \n+#ifndef __ANDROID__\n static struct cache_item *resolve_cache_item(struct apk_hash *hash, apk_blob_t name)\n {\n \tstruct cache_item *ci;\n@@ -1032,6 +1033,7 @@\n \n \treturn ci;\n }\n+#endif\n \n void apk_id_cache_init(struct apk_id_cache *idc, int root_fd)\n {\n@@ -1056,6 +1058,9 @@\n \n uid_t apk_resolve_uid(struct apk_id_cache *idc, const char *username, uid_t default_uid)\n {\n+#ifdef __ANDROID__\n+\treturn getuid();\n+#else\n #ifdef HAVE_FGETPWENT_R\n \tchar buf[1024];\n \tstruct passwd pwent;\n@@ -1095,10 +1100,14 @@\n \t\treturn ci->uid;\n \n \treturn default_uid;\n+#endif\n }\n \n uid_t apk_resolve_gid(struct apk_id_cache *idc, const char *groupname, uid_t default_gid)\n {\n+#ifdef __ANDROID__\n+\treturn getgid();\n+#else\n #ifdef HAVE_FGETGRENT_R\n \tchar buf[1024];\n \tstruct group grent;\n@@ -1138,4 +1147,5 @@\n \t\treturn ci->gid;\n \n \treturn default_gid;\n+#endif\n }\n"
  },
  {
    "path": "disabled-packages/apk-tools/src-package.c.patch",
    "content": "diff -uNr apk-tools-2.10.3/src/package.c apk-tools-2.10.3.mod/src/package.c\n--- apk-tools-2.10.3/src/package.c\t2018-11-15 15:09:07.000000000 +0200\n+++ apk-tools-2.10.3.mod/src/package.c\t2018-11-19 17:44:51.566313390 +0200\n@@ -30,6 +30,8 @@\n #include \"apk_database.h\"\n #include \"apk_print.h\"\n \n+#include \"termux_prefix.h\"\n+\n static const apk_spn_match_def apk_spn_dependency_comparer = {\n \t[7] = (1<<4) /*<*/ | (1<<5) /*=*/ | (1<<6) /*<*/,\n \t[15] = (1<<6) /*~*/\n@@ -1008,7 +1010,7 @@\n \targv[0] = (char *) apk_script_types[type];\n \n \t/* Avoid /tmp as it can be mounted noexec */\n-\tsnprintf(fn, sizeof(fn), \"var/cache/misc/\" PKG_VER_FMT \".%s\",\n+\tsnprintf(fn, sizeof(fn), TERMUX_PREFIX_RELATIVE\"var/cache/misc/\" PKG_VER_FMT \".%s\",\n \t\tPKG_VER_PRINTF(pkg),\n \t\tapk_script_types[type]);\n \n@@ -1018,7 +1020,7 @@\n \tapk_message(\"Executing %s\", &fn[15]);\n \tfd = openat(root_fd, fn, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0755);\n \tif (fd < 0) {\n-\t\tmkdirat(root_fd, \"var/cache/misc\", 0755);\n+\t\tmkdirat(root_fd, TERMUX_PREFIX_RELATIVE\"var/cache/misc\", 0755);\n \t\tfd = openat(root_fd, fn, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0755);\n \t\tif (fd < 0) goto err_log;\n \t}\n"
  },
  {
    "path": "disabled-packages/apk-tools/src-termux_prefix.h.patch",
    "content": "diff -uNr apk-tools-2.10.3/src/termux_prefix.h apk-tools-2.10.3.mod/src/termux_prefix.h\n--- apk-tools-2.10.3/src/termux_prefix.h\t1970-01-01 03:00:00.000000000 +0300\n+++ apk-tools-2.10.3.mod/src/termux_prefix.h\t2018-11-19 17:42:52.188760273 +0200\n@@ -0,0 +1,6 @@\n+#ifndef __TERMUX_PREFIX_H\n+#define __TERMUX_PREFIX_H\n+\n+#define TERMUX_PREFIX_RELATIVE \"data/data/com.termux/files/usr/\"\n+\n+#endif\n"
  },
  {
    "path": "disabled-packages/apt-updated/CMakeLists.txt.patch",
    "content": "diff -u -r ../apt-1.6~alpha3/CMakeLists.txt ./CMakeLists.txt\n--- ../apt-1.6~alpha3/CMakeLists.txt\t2017-10-28 17:57:05.000000000 +0200\n+++ ./CMakeLists.txt\t2017-11-02 17:42:28.162838378 +0100\n@@ -33,7 +33,6 @@\n include(GNUInstallDirs)\n include(TestBigEndian)\n find_package(Threads REQUIRED)\n-find_package(LFS REQUIRED)\n find_package(Iconv REQUIRED)\n \n find_package(Perl REQUIRED)\n@@ -44,11 +43,6 @@\n   include_directories(${Intl_INCLUDE_DIRS})\n endif()\n \n-# Add large file support\n-add_compile_options(${LFS_COMPILE_OPTIONS})\n-add_definitions(${LFS_DEFINITIONS})\n-link_libraries(${LFS_LIBRARIES})\n-\n # Set compiler flags\n set(CMAKE_CXX_STANDARD 11)\n set(CMAKE_CXX_STANDARD_REQUIRED ON)\n@@ -69,12 +63,6 @@\n add_optional_compile_options(Wsign-promo)\n add_optional_compile_options(Wundef)\n \n-# apt-ftparchive dependencies\n-find_package(BerkeleyDB REQUIRED)\n-if (BERKELEY_DB_FOUND)\n-  set(HAVE_BDB 1)\n-endif()\n-\n find_package(GnuTLS REQUIRED)\n if (GNUTLS_FOUND)\n   set(HAVE_GNUTLS 1)\n@@ -87,22 +75,12 @@\n endif()\n \n \n-find_package(BZip2 REQUIRED)\n-if (BZIP2_FOUND)\n-  set(HAVE_BZ2 1)\n-endif()\n-\n find_package(LZMA REQUIRED)\n if (LZMA_FOUND)\n   set(HAVE_LZMA 1)\n endif()\n \n \n-find_package(LZ4 REQUIRED)\n-if (LZ4_FOUND)\n-  set(HAVE_LZ4 1)\n-endif()\n-\n find_package(Udev)\n if (UDEV_FOUND)\n   set(HAVE_UDEV 1)\n@@ -184,10 +162,10 @@\n   message(STATUS \"Found dpkg data dir: ${DPKG_DATADIR_CMD}\")\n   set(DPKG_DATADIR \"${DPKG_DATADIR_CMD}\" CACHE PATH \"dpkg data directory\")\n endif()\n-if (NOT DEFINED COMMON_ARCH)\n-  execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH\n-                  OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)\n-endif()\n+# if (NOT DEFINED COMMON_ARCH)\n+#  execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH\n+                  #OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)\n+# endif()\n if (NOT DEFINED ROOT_GROUP)\n   execute_process(COMMAND id -gn root\n                   OUTPUT_VARIABLE ROOT_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE)\n@@ -215,11 +193,8 @@\n add_subdirectory(apt-inst)\n add_subdirectory(cmdline)\n add_subdirectory(completions)\n-add_subdirectory(doc)\n add_subdirectory(dselect)\n-add_subdirectory(ftparchive)\n add_subdirectory(methods)\n-add_subdirectory(test)\n \n if (USE_NLS)\n add_subdirectory(po)\n"
  },
  {
    "path": "disabled-packages/apt-updated/apt-pkg-contrib-fileutl.patch",
    "content": "diff -u -r ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.cc ./apt-pkg/contrib/fileutl.cc\n--- ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.cc\t2017-10-28 17:57:05.000000000 +0200\n+++ ./apt-pkg/contrib/fileutl.cc\t2017-11-02 17:38:43.633482989 +0100\n@@ -37,7 +37,9 @@\n #include <dirent.h>\n #include <errno.h>\n #include <fcntl.h>\n+#ifndef __ANDROID__\n #include <glob.h>\n+#endif\n #include <grp.h>\n #include <pwd.h>\n #include <signal.h>\n@@ -2790,6 +2792,7 @@\n }\n \t\t\t\t\t\t\t\t\t/*}}}*/\n \n+#ifndef __ANDROID__\n // Glob - wrapper around \"glob()\"\t\t\t\t\t/*{{{*/\n std::vector<std::string> Glob(std::string const &pattern, int flags)\n {\n@@ -2815,6 +2818,7 @@\n    globfree(&globbuf);\n    return result;\n }\n+#endif\n \t\t\t\t\t\t\t\t\t/*}}}*/\n static std::string APT_NONNULL(1) GetTempDirEnv(char const * const env)\t/*{{{*/\n {\ndiff -u -r ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.h ./apt-pkg/contrib/fileutl.h\n--- ../apt-1.6~alpha3/apt-pkg/contrib/fileutl.h\t2017-10-28 17:57:05.000000000 +0200\n+++ ./apt-pkg/contrib/fileutl.h\t2017-11-02 17:37:38.518249720 +0100\n@@ -262,7 +262,9 @@\n APT_HIDDEN std::string flNormalize(std::string file);\n \n // simple c++ glob\n+#ifndef __ANDROID__\n std::vector<std::string> Glob(std::string const &pattern, int flags=0);\n+#endif\n \n /** \\brief Popen() implementation that execv() instead of using a shell\n  *\n"
  },
  {
    "path": "disabled-packages/apt-updated/apt-pkg-contrib-srvrec.cc.patch",
    "content": "diff -u -r ../apt-1.1.3/apt-pkg/contrib/srvrec.cc ./apt-pkg/contrib/srvrec.cc\n--- ../apt-1.1.3/apt-pkg/contrib/srvrec.cc\t2015-11-30 03:08:24.000000000 -0500\n+++ ./apt-pkg/contrib/srvrec.cc\t2015-12-03 16:21:54.397715576 -0500\n@@ -40,14 +40,24 @@\n    struct servent *s_ent = nullptr;\n    std::vector<char> buf(1024);\n \n+#ifdef __ANDROID__\n+   s_ent = getservbyport(htons(port), \"tcp\");\n+   if (s_ent == nullptr) return false;\n+#else\n    res = getservbyport_r(htons(port), \"tcp\", &s_ent_buf, buf.data(), buf.size(), &s_ent);\n    if (res != 0 || s_ent == nullptr)\n       return false;\n+#endif\n \n    strprintf(target, \"_%s._tcp.%s\", s_ent->s_name, host.c_str());\n    return GetSrvRecords(target, Result);\n }\n \n+#ifdef __ANDROID__\n+extern \"C\" int __dn_skipname(const unsigned char* comp_dn, const unsigned char* eom);\n+static inline int dn_skipname(const unsigned char* a, const unsigned char* b) { return __dn_skipname(a,b); }\n+#endif\n+\n bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result)\n {\n    unsigned char answer[PACKETSZ];\n"
  },
  {
    "path": "disabled-packages/apt-updated/apt-pkg-contrib-strutl.cc.patch",
    "content": "diff -u -r ../apt-1.4.7/apt-pkg/contrib/strutl.cc ./apt-pkg/contrib/strutl.cc\n--- ../apt-1.4.7/apt-pkg/contrib/strutl.cc\t2017-07-13 23:45:39.000000000 +0200\n+++ ./apt-pkg/contrib/strutl.cc\t2017-07-23 22:58:23.103247428 +0200\n@@ -100,6 +100,7 @@\n }\n }\n \t\t\t\t\t\t\t\t\t/*}}}*/\n+#ifndef __ANDROID__\n // UTF8ToCodeset - Convert some UTF-8 string for some codeset   \t/*{{{*/\n // ---------------------------------------------------------------------\n /* This is handy to use before display some information for enduser  */\n@@ -169,6 +170,7 @@\n \n   return true;\n }\n+#endif\n \t\t\t\t\t\t\t\t\t/*}}}*/\n // strstrip - Remove white space from the front and back of a string\t/*{{{*/\n // ---------------------------------------------------------------------\n"
  },
  {
    "path": "disabled-packages/apt-updated/apt-pkg-deb-debrecords.cc.patch",
    "content": "diff -u -r ../apt-1.6~alpha3/apt-pkg/deb/debrecords.cc ./apt-pkg/deb/debrecords.cc\n--- ../apt-1.6~alpha3/apt-pkg/deb/debrecords.cc\t2017-10-28 17:57:05.000000000 +0200\n+++ ./apt-pkg/deb/debrecords.cc\t2017-11-02 17:40:35.816161798 +0100\n@@ -23,7 +23,9 @@\n #include <sstream>\n #include <string>\n #include <vector>\n+#ifndef __ANDROID__\n #include <langinfo.h>\n+#endif\n #include <string.h>\n \n #include <apti18n.h>\n@@ -151,12 +153,14 @@\n \t orig = Section.FindS(\"Description\");\n    }\n \n+#ifndef __ANDROID__\n    char const * const codeset = nl_langinfo(CODESET);\n    if (strcmp(codeset,\"UTF-8\") != 0) {\n       string dest;\n       UTF8ToCodeset(codeset, orig, &dest);\n       return dest;\n    }\n+#endif\n \n    return orig;\n }\n"
  },
  {
    "path": "disabled-packages/apt-updated/apt-pkg-init-dir.patch",
    "content": "--- ../cache/apt-1.4.7/apt-pkg/init.cc\t2017-07-14 07:45:39.000000000 +1000\n+++ ./apt-pkg/init.cc\t2017-07-19 17:03:07.949752843 +1000\n@@ -51,7 +51,7 @@\n    return vec;\n }\n \n-\n+#ifndef __ANDROID__\n // pkgInitArchTupleMap - Initialize the architecture tuple map\t\t\t\t/*{{{*/\n // ---------------------------------------------------------------------\n /* This initializes */\n@@ -116,7 +116,7 @@\n \n    return true;\n }\n-\t\t\t\t\t\t\t\t\t/*}}}*/\n+#endif\t\t\t\t\t\t\t\t\t/*}}}*/\n \n     \n // pkgInitConfig - Initialize the configuration class\t\t\t/*{{{*/\n@@ -133,6 +133,7 @@\n    Cnf.CndSet(\"APT::Install-Recommends\", true);\n    Cnf.CndSet(\"APT::Install-Suggests\", false);\n    Cnf.CndSet(\"Dir\",\"/\");\n+   Cnf.CndSet(\"Acquire::Languages\", \"none\");\n    \n    // State\n    Cnf.CndSet(\"Dir::State\", STATE_DIR + 1);\n@@ -158,9 +159,9 @@\n    Cnf.CndSet(\"Dir::Etc::trusted\", \"trusted.gpg\");\n    Cnf.CndSet(\"Dir::Etc::trustedparts\",\"trusted.gpg.d\");\n    Cnf.CndSet(\"Dir::Bin::methods\", LIBEXEC_DIR \"/methods\");\n-   Cnf.CndSet(\"Dir::Bin::solvers::\",LIBEXEC_DIR  \"/solvers\");\n-   Cnf.CndSet(\"Dir::Bin::planners::\",LIBEXEC_DIR  \"/planners\");\n-   Cnf.CndSet(\"Dir::Media::MountPath\",\"/media/apt\");\n+   Cnf.CndSet(\"Dir::Bin::solvers::\",LIBEXEC_DIR \"/solvers\");\n+   Cnf.CndSet(\"Dir::Bin::planners::\", LIBEXEC_DIR \"/planners\");\n+   Cnf.CndSet(\"Dir::Media::MountPath\",\"media/apt\");\n \n    // State\n    Cnf.CndSet(\"Dir::Log\", LOG_DIR + 1);\n@@ -283,8 +284,6 @@\n \t return _error->Error(_(\"Unable to determine a suitable packaging system type\"));\n    }\n \n-   if (pkgInitArchTupleMap() == false)\n-      return false;\n    \n    return Sys->Initialize(Cnf);\n }\n"
  },
  {
    "path": "disabled-packages/apt-updated/apt-private-private-download.cc.patch",
    "content": "diff -u -r ../apt-1.2.12/apt-private/private-download.cc ./apt-private/private-download.cc\n--- ../apt-1.2.12/apt-private/private-download.cc\t2016-05-11 10:57:51.000000000 +0200\n+++ ./apt-private/private-download.cc\t2017-07-01 00:31:32.131776100 +0200\n@@ -121,7 +121,6 @@\n \t\t\t\t\t\t\t\t\t/*}}}*/\n bool CheckFreeSpaceBeforeDownload(std::string const &Dir, unsigned long long FetchBytes)/*{{{*/\n {\n-   uint32_t const RAMFS_MAGIC = 0x858458f6;\n    /* Check for enough free space, but only if we are actually going to\n       download */\n    if (_config->FindB(\"APT::Get::Print-URIs\", false) == true ||\n"
  },
  {
    "path": "disabled-packages/apt-updated/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt\nTERMUX_PKG_DESCRIPTION=\"Front-end for the dpkg package manager\"\nTERMUX_PKG_DEPENDS=\"libutil, libcurl, liblzma, dpkg, gpgv, libc++\"\nTERMUX_PKG_VERSION=1.6~alpha3\nTERMUX_PKG_SHA256=2acd561ff04fc3efa4c590139ca60cfdbc93787ea80334f7448ecf466faab119\nTERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DPERL_EXECUTABLE=$(which perl)\n-DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX\n-DCOMMON_ARCH=$TERMUX_ARCH\n-DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg\n-DUSE_NLS=OFF\n-DWITH_DOC=OFF\n\"\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_CONFFILES=\"etc/apt/sources.list\"\nTERMUX_PKG_CONFLICTS=apt-transport-https\nTERMUX_PKG_REPLACES=apt-transport-https\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/apt-cdrom\nbin/apt-extracttemplates\nbin/apt-sortpkgs\netc/apt/apt.conf.d\nlib/apt/apt-helper\nlib/apt/methods/bzip2\nlib/apt/methods/cdrom\nlib/apt/methods/mirror\nlib/apt/methods/rred\nlib/apt/planners/\nlib/apt/solvers/\nlib/dpkg/\nlib/libapt-inst.so\n\"\n\ntermux_step_post_make_install() {\n\tprintf \"# The main termux repository:\\ndeb [arch=all,${TERMUX_ARCH}] https://termux.net stable main\\n\" > $TERMUX_PREFIX/etc/apt/sources.list\n\tcp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/\n\trm /data/data/com.termux/files/usr/include/apt-pkg -r\n}\n"
  },
  {
    "path": "disabled-packages/apt-updated/cmdline-apt-key.in.patch",
    "content": "diff -u -r ../apt-1.4.7/cmdline/apt-key.in ./cmdline/apt-key.in\n--- ../apt-1.4.7/cmdline/apt-key.in\t2017-07-13 23:45:39.000000000 +0200\n+++ ./cmdline/apt-key.in\t2017-07-26 12:18:17.424086422 +0200\n@@ -16,10 +16,7 @@\n aptkey_echo() { echo \"$@\"; }\n \n requires_root() {\n-\tif [ \"$(id -u)\" -ne 0 ]; then\n-\t\tapt_error \"This command can only be used by root.\"\n-\t\texit 1\n-\tfi\n+continue\n }\n \n command_available() {\n@@ -260,7 +257,7 @@\n \tif accessible_file_exists \"$TRUSTEDFILE\"; then\n \t    $ACTION \"$TRUSTEDFILE\" \"$@\"\n \tfi\n-\tlocal TRUSTEDPARTS=\"/etc/apt/trusted.gpg.d\"\n+\tlocal TRUSTEDPARTS=\"@TERMUX_PREFIX@/etc/apt/trusted.gpg.d\"\n \teval \"$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)\"\n \tif [ -d \"$TRUSTEDPARTS\" ]; then\n \t    TRUSTEDPARTS=\"$(readlink -f \"$TRUSTEDPARTS\")\"\n@@ -542,7 +539,7 @@\n done\n \n if [ -z \"$TRUSTEDFILE\" ]; then\n-   TRUSTEDFILE=\"/etc/apt/trusted.gpg\"\n+   TRUSTEDFILE=\"@TERMUX_PREFIX@/etc/apt/trusted.gpg\"\n    eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)\n    eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)\n fi\n@@ -612,7 +609,8 @@\n \t    unset TMPDIR\n \tfi\n     fi\n-    GPGHOMEDIR=\"$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')\"\n+    # Use short options as busybox mktemp does not support long ones:\n+    GPGHOMEDIR=\"$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')\"\n     CURRENTTRAP=\"${CURRENTTRAP} cleanup_gpg_home;\"\n     trap \"${CURRENTTRAP}\" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM\n     if [ -z \"$GPGHOMEDIR\" ]; then\n"
  },
  {
    "path": "disabled-packages/apt-updated/cmndline-no-strchrnul.patch",
    "content": "diff -u -r ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc ./apt-pkg/contrib/cmndline.cc\n--- ../apt-0.9.16.1/apt-pkg/contrib/cmndline.cc\t2014-03-15 17:23:45.000000000 +0100\n+++ ./apt-pkg/contrib/cmndline.cc\t2014-03-25 01:10:30.764711007 +0100\n@@ -27,6 +27,14 @@\n \t\t\t\t\t\t\t\t\t/*}}}*/\n using namespace std;\n \n+#if defined(__ANDROID__)\n+static char* strchrnul(char const* s, int c)\n+{\n+        char const* result = strchr(s, c);\n+        return const_cast<char*>((result == NULL) ? (s + strlen(s)) : result);\n+}\n+#endif\n+\n // CommandLine::CommandLine - Constructor\t\t\t\t/*{{{*/\n // ---------------------------------------------------------------------\n /* */\n"
  },
  {
    "path": "disabled-packages/apt-updated/debsrcrecords.patch",
    "content": "diff -u -r ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc ./apt-pkg/deb/debsrcrecords.cc\n--- ../apt-0.9.16.1/apt-pkg/deb/debsrcrecords.cc\t2014-03-15 17:23:45.000000000 +0100\n+++ ./apt-pkg/deb/debsrcrecords.cc\t2014-03-25 01:23:30.652689687 +0100\n@@ -26,6 +26,14 @@\n #include <string>\n #include <vector>\n \t\t\t\t\t\t\t\t\t/*}}}*/\n+#if defined(__ANDROID__)\n+static char* strchrnul(char const* s, int c)\n+{\n+\tchar const* result = strchr(s, c);\n+\treturn const_cast<char*>((result == NULL) ? (s + strlen(s)) : result);\n+}\n+#endif\n+\n \n using std::max;\n using std::string;\n"
  },
  {
    "path": "disabled-packages/apt-updated/methods-cmakelist.patch",
    "content": "diff -u -r ../apt-1.6~alpha3/methods/CMakeLists.txt ./methods/CMakeLists.txt\n--- ../apt-1.6~alpha3/methods/CMakeLists.txt\t2017-10-28 17:57:05.000000000 +0200\n+++ ./methods/CMakeLists.txt\t2017-11-02 17:45:55.436395981 +0100\n@@ -9,11 +9,8 @@\n add_executable(copy copy.cc)\n add_executable(store store.cc)\n add_executable(gpgv gpgv.cc)\n-add_executable(cdrom cdrom.cc)\n add_executable(http http_main.cc $<TARGET_OBJECTS:httplib> $<TARGET_OBJECTS:connectlib>)\n add_executable(mirror mirror.cc $<TARGET_OBJECTS:httplib> $<TARGET_OBJECTS:connectlib>)\n-add_executable(ftp ftp.cc $<TARGET_OBJECTS:connectlib>)\n-add_executable(rred rred.cc)\n add_executable(rsh rsh.cc)\n \n target_compile_definitions(connectlib PRIVATE ${GNUTLS_DEFINITIONS})\n@@ -22,10 +19,9 @@\n # Additional libraries to link against for networked stuff\n target_link_libraries(http ${GNUTLS_LIBRARIES})\n target_link_libraries(mirror ${RESOLV_LIBRARIES} ${GNUTLS_LIBRARIES})\n-target_link_libraries(ftp ${GNUTLS_LIBRARIES})\n \n # Install the library\n-install(TARGETS file copy store gpgv cdrom http ftp rred rsh mirror\n+install(TARGETS file copy store gpgv http rsh mirror\n         RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)\n \n add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods store)\n"
  },
  {
    "path": "disabled-packages/apt-updated/methods-connect.cc.patch",
    "content": "diff -u -r ../apt-1.6~alpha3/methods/connect.cc ./methods/connect.cc\n--- ../apt-1.6~alpha3/methods/connect.cc\t2017-10-28 17:57:05.000000000 +0200\n+++ ./methods/connect.cc\t2017-11-02 17:47:18.803413361 +0100\n@@ -164,7 +164,7 @@\n \n    // Check the socket for an error condition\n    unsigned int Err;\n-   unsigned int Len = sizeof(Err);\n+   socklen_t Len = sizeof(Err);\n    if (getsockopt(Fd->Fd(), SOL_SOCKET, SO_ERROR, &Err, &Len) != 0)\n       return _error->Errno(\"getsockopt\",_(\"Failed\"));\n    \n@@ -335,7 +335,10 @@\n    if(LastHost != Host || LastPort != Port)\n    {\n       SrvRecords.clear();\n-      if (_config->FindB(\"Acquire::EnableSrvRecords\", true) == true)\n+      /* Disable by default in Termux due to it breaking on (some) HTC\n+         devices (https://github.com/termux/termux-packages/issues/99). */\n+\t\n+\t if (_config->FindB(\"Acquire::EnableSrvRecords\", false) == true)\n       {\n          GetSrvRecords(Host, DefPort, SrvRecords);\n \t // RFC2782 defines that a lonely '.' target is an abort reason\n"
  },
  {
    "path": "disabled-packages/apt-updated/private-output-no-langinfo.patch",
    "content": "diff -u -r ../upstream.git/apt-private/private-output.cc ./apt-private/private-output.cc\n--- ../upstream.git/apt-private/private-output.cc\t2014-06-10 15:24:50.000000000 +0200\n+++ ./apt-private/private-output.cc\t2014-06-15 02:40:10.539223656 +0200\n@@ -20,7 +20,11 @@\n #include <string.h>\n #include <iomanip>\n #include <iostream>\n-#include <langinfo.h>\n+#ifdef __ANDROID__\n+#  include <termios.h>\n+# else\n+#  include <langinfo.h>\n+#endif\n #include <unistd.h>\n #include <signal.h>\n #include <sys/ioctl.h>\n@@ -764,7 +768,7 @@\n    regex_t Pattern;\n    int Res;\n \n-   Res = regcomp(&Pattern, nl_langinfo(YESEXPR),\n+   Res = regcomp(&Pattern, \"^[yY]\",\n                  REG_EXTENDED|REG_ICASE|REG_NOSUB);\n \n    if (Res != 0) {\n"
  },
  {
    "path": "disabled-packages/apt-updated/vendor.patch",
    "content": "diff -u -r ../upstream.git/vendor/ubuntu/apt-vendor.ent ./vendor/ubuntu/apt-vendor.ent\n--- ../upstream.git/vendor/ubuntu/apt-vendor.ent\t2014-04-25 13:39:00.000000000 +0200\n+++ ./vendor/ubuntu/apt-vendor.ent\t2014-06-03 11:53:11.535752314 +0200\n@@ -1,7 +1,7 @@\n <!-- details about the keys used by the distribution -->\n-<!ENTITY keyring-distro \"Ubuntu\">\n-<!ENTITY keyring-package \"<package>ubuntu-keyring</package>\">\n-<!ENTITY keyring-filename \"<filename>/usr/share/keyrings/ubuntu-archive-keyring.gpg</filename>\">\n-<!ENTITY keyring-removed-filename \"<filename>/usr/share/keyrings/ubuntu-archive-removed-keys.gpg</filename>\">\n-<!ENTITY keyring-master-filename \"/usr/share/keyrings/ubuntu-master-keyring.gpg\">\n+<!ENTITY keyring-distro \"Termux\">\n+<!ENTITY keyring-package \"<package>termux-keyring</package>\">\n+<!ENTITY keyring-filename \"<filename>@TERMUX_PREFIX@/share/keyrings/termux-archive-keyring.gpg</filename>\">\n+<!ENTITY keyring-removed-filename \"<filename>@TERMUX_PREFIX@/share/keyrings/termux-archive-removed-keys.gpg</filename>\">\n+<!ENTITY keyring-master-filename \"@TERMUX_PREFIX@/share/keyrings/termux-master-keyring.gpg\">\n <!ENTITY keyring-uri \"http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg\">\n"
  },
  {
    "path": "disabled-packages/cadaver/build.sh",
    "content": "# Status: Does not work with openssl 1.1 or later.\nTERMUX_PKG_HOMEPAGE=http://www.webdav.org/cadaver/\nTERMUX_PKG_DESCRIPTION=\"cadaver is a command-line WebDAV client for Unix\"\nTERMUX_PKG_VERSION=0.23.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://fossies.org/linux/www/old/cadaver-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=123772d7d33f06a76742dba874b1c444423b52ad3a7bbb87559616ec78b9ae5e\nTERMUX_PKG_DEPENDS=\"openssl, libxml2, ncurses, readline\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-libxml2\n--without-gssapi\n--with-ssl=openssl\n\"\n\ntermux_step_pre_configure() {\n    export ac_cv_func_setlocale=no\n}\n"
  },
  {
    "path": "disabled-packages/checkinstall/Makefile.patch",
    "content": "diff -u -r ../checkinstall-1.6.2/Makefile ./Makefile\n--- ../checkinstall-1.6.2/Makefile\t2008-11-11 21:43:53.000000000 -0500\n+++ ./Makefile\t2016-10-28 16:14:22.403691119 -0400\n@@ -1,7 +1,7 @@\n # $Id: Makefile,v 1.6.2.1 2008/11/09 07:48:18 izto Exp $\n \n # Where to install.\n-PREFIX=/usr/local\n+PREFIX?=/usr/local\n BINDIR=$(PREFIX)/sbin\n LCDIR=$(PREFIX)/lib/checkinstall/locale\n CONFDIR=$(PREFIX)/lib/checkinstall\n"
  },
  {
    "path": "disabled-packages/checkinstall/build.sh",
    "content": "# NOTE: Currently segfaults when running.\nTERMUX_PKG_HOMEPAGE=http://checkinstall.izto.org/\nTERMUX_PKG_DESCRIPTION=\"Installation tracker creating a package from a local install\"\nTERMUX_PKG_VERSION=1.6.2\nTERMUX_PKG_SRCURL=http://checkinstall.izto.org/files/source/checkinstall-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"file, make\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/checkinstall/locale/\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -D__off64_t=off64_t\"\n\tCFLAGS+=\" -D_STAT_VER=3\"\n\tCFLAGS+=\" -D_MKNOD_VER=1\"\n\tCFLAGS+=\" -DS_IREAD=S_IRUSR\"\n}\n\ntermux_step_post_make_install() {\n\tmv $TERMUX_PREFIX/lib/checkinstall/checkinstallrc-dist \\\n\t   $TERMUX_PREFIX/lib/checkinstall/checkinstallrc\n}\n"
  },
  {
    "path": "disabled-packages/checkinstall/checkinstall.patch",
    "content": "diff -u -r ../checkinstall-1.6.2/checkinstall ./checkinstall\n--- ../checkinstall-1.6.2/checkinstall\t2009-12-26 14:17:24.000000000 -0500\n+++ ./checkinstall\t2016-10-28 16:32:12.759574819 -0400\n@@ -492,7 +492,7 @@\n ckversion\n echo\n \n-CHECKINSTALLRC=${CHECKINSTALLRC:-${INSTALLDIR}/checkinstallrc}\n+CHECKINSTALLRC=${CHECKINSTALLRC:-${INSTALLDIR}/lib/checkinstall/checkinstallrc}\n if ! [ -f $CHECKINSTALLRC ]; then\n    echog \"The checkinstallrc file was not found at:\\n$CHECKINSTALLRC\"\n    echo\n@@ -974,7 +974,7 @@\n ! [ \"$INSTALL\" ] && INSTALL=0\n \n # The place where we will be storing the temp files\n-! [ \"$BASE_TMP_DIR\" ] && BASE_TMP_DIR=/var/tmp\n+! [ \"$BASE_TMP_DIR\" ] && BASE_TMP_DIR=/data/data/com.termux/files/usr/tmp\n \n # Default RPM FLAGS\n ! [ \"$RPM_FLAGS\" ] && RPM_FLAGS=\" --force --nodeps --replacepkgs \"\n@@ -1249,7 +1249,7 @@\n    # Fix the PowerPC & Amd64 architecture description if we're on Debian\n    \n    if [ \"$CK_DEBIAN\" = \"1\" ] ; then\n-      ARCHITECTURE=`dpkg-architecture -qDEB_HOST_ARCH`\n+      ARCHITECTURE=`dpkg --print-architecture`\n    fi\n fi\n \n@@ -1508,7 +1508,7 @@\n TMP_SCRIPT=${TMP_DIR}/installscript.sh\n \n cat << EOF > $TMP_SCRIPT\n-#!/bin/sh\n+#!@TERMUX_PREFIX@/bin/sh\n \n cd \"$DIRECTORIO_FUENTE\"\n EOF\n@@ -1538,7 +1538,7 @@\n # installwatch excludes itself some directories, but we put them all here,\n # to be explicit.\n #\n-IEXCLUDE=\"${DIRECTORIO_FUENTE},/dev,/proc,/tmp,/var/tmp\"\n+IEXCLUDE=\"${DIRECTORIO_FUENTE},/dev,/proc,/tmp,/var/tmp,/data/data/com.termux/files/usr/tmp\"\n   \n \n # Run the install command, showing the results interactively if we were asked\n"
  },
  {
    "path": "disabled-packages/checkinstall/checkinstallrc-dist.patch",
    "content": "diff -u -r ../checkinstall-1.6.2/checkinstallrc-dist ./checkinstallrc-dist\n--- ../checkinstall-1.6.2/checkinstallrc-dist\t2008-11-11 14:10:34.000000000 -0500\n+++ ./checkinstallrc-dist\t2016-10-28 16:28:56.558529656 -0400\n@@ -16,14 +16,14 @@\n DEBUG=0\n \n # Location of the \"installwatch\" program\n-INSTALLWATCH_PREFIX=\"/usr/local\"\n+INSTALLWATCH_PREFIX=\"/data/data/com.termux/files/usr\"\n INSTALLWATCH=${INSTALLWATCH_PREFIX}/bin/installwatch\n \n # Location of the makepkg program. \"makepak\" is the default, and is \n # included with checkinstall. If you want to use Slackware's native \"makepkg\"\n # then set this to \"makepkg\"\n \n-MAKEPKG=/sbin/makepkg\n+MAKEPKG=/data/data/com.termux/files/usr/bin/makepkg\n \n # makepkg optional flags. These are recommended if running a newer Slackware\n # version: \"-l y -c n\"\n@@ -36,7 +36,7 @@\n SHOW_MAKEPKG=0\n \n # Where will we keep our temp files?\n-BASE_TMP_DIR=/var/tmp   ##  Don't set this to /tmp or / !! \n+BASE_TMP_DIR=@TERMUX_PREFIX@/tmp   ##  Don't set this to /tmp or / !! \n \n # Where to place the installed document files\n DOC_DIR=\"\"\n"
  },
  {
    "path": "disabled-packages/checkinstall/installwatch-Makefile.patch",
    "content": "diff -u -r ../checkinstall-1.6.2/installwatch/Makefile ./installwatch/Makefile\n--- ../checkinstall-1.6.2/installwatch/Makefile\t2008-11-16 11:20:53.000000000 -0500\n+++ ./installwatch/Makefile\t2016-10-28 16:34:12.825762120 -0400\n@@ -4,7 +4,7 @@\n # Well, the only configurable part is the following variable.\n # Make sure the directory you specify exists.\n \n-PREFIX=/usr/local\n+PREFIX?=/usr/local\n \n # End of configurable part\n \n@@ -16,10 +16,10 @@\n all: installwatch.so\n \n installwatch.so: installwatch.o\n-\tld -shared -o installwatch.so installwatch.o -ldl -lc\n+\t$(CC) $(LDFLAGS) -shared -o installwatch.so installwatch.o -ldl -lc -llog\n \n installwatch.o: installwatch.c localdecls.h\n-\tgcc -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=\\\"$(VERSION)\\\" installwatch.c\n+\t$(CC) $(CFLAGS) -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION=\\\"$(VERSION)\\\" installwatch.c\n \n localdecls.h: create-localdecls\n \t./create-localdecls\n"
  },
  {
    "path": "disabled-packages/checkinstall/installwatch.c.patch",
    "content": "diff -u -r ../checkinstall-1.6.2/installwatch/installwatch.c ./installwatch/installwatch.c\n--- ../checkinstall-1.6.2/installwatch/installwatch.c\t2008-11-16 11:20:53.000000000 -0500\n+++ ./installwatch/installwatch.c\t2016-10-28 16:12:42.017221485 -0400\n@@ -2938,13 +2938,8 @@\n \treturn result;\n }\n \n-#if (GLIBC_MINOR <= 4)\n-int readlink(const char *path,char *buf,size_t bufsiz) {\n-\tint result;\n-#else\n ssize_t readlink(const char *path,char *buf,size_t bufsiz) {\n \tssize_t result;\n-#endif\n \tinstw_t instw;\n \tint status;\n \n@@ -3079,7 +3074,7 @@\n \n int scandir(\tconst char *dir,struct dirent ***namelist,\n \t\tint (*select)(const struct dirent *),\n-\t\tint (*compar)(const void *,const void *)\t) {\n+\t\tint (*compar)(const struct dirent**,const struct dirent**)\t) {\n \tint result;\n \n \tif (!libc_handle)\n@@ -3691,7 +3686,7 @@\n \n int scandir64(\tconst char *dir,struct dirent64 ***namelist,\n \t\tint (*select)(const struct dirent64 *),\n-\t\tint (*compar)(const void *,const void *)\t) {\n+\t\tint (*compar)(const struct dirent64**,const struct dirent64**)\t) {\n \tint result;\n \n \tif (!libc_handle)\n"
  },
  {
    "path": "disabled-packages/clisp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.clisp.org/\nTERMUX_PKG_DESCRIPTION=\"GNU CLISP - an ANSI Common Lisp Implementation\"\nTERMUX_PKG_VERSION=2.49\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/clisp/clisp/${TERMUX_PKG_VERSION}/clisp-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"readline, libandroid-support\"\nTERMUX_MAKE_PROCESSES=1\n\ntermux_step_configure() {\n\tcd $TERMUX_PKG_BUILDDIR\n\n\texport XCPPFLAGS=\"$CPPFLAGS\"\n\texport XCFLAGS=\"$CFLAGS\"\n\texport XLDFLAGS=\"$LDFLAGS\"\n\n\tunset CC\n\tunset CPPFLAGS\n\tunset CFLAGS\n\tunset LDFLAGS\n\n\t$TERMUX_PKG_SRCDIR/configure \\\n\t\t--host=$TERMUX_HOST_PLATFORM \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--enable-shared \\\n\t\t--disable-static \\\n\t\t--srcdir=$TERMUX_PKG_SRCDIR \\\n\t\t--ignore-absence-of-libsigsegv \\\n\t\tac_cv_func_select=yes\n}\n"
  },
  {
    "path": "disabled-packages/clisp/src-gllib-stdint.in.h.patch",
    "content": "diff -u -r ../clisp-2.49/src/gllib/stdint.in.h ./src/gllib/stdint.in.h\n--- ../clisp-2.49/src/gllib/stdint.in.h\t2010-05-18 14:38:04.000000000 -0400\n+++ ./src/gllib/stdint.in.h\t2016-02-17 15:35:07.664544781 -0500\n@@ -1,568 +1 @@\n-/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.\n-   Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.\n-   This file is part of gnulib.\n-\n-   This program is free software; you can redistribute it and/or modify\n-   it under the terms of the GNU General Public License as published by\n-   the Free Software Foundation; either version 3, or (at your option)\n-   any later version.\n-\n-   This program is distributed in the hope that it will be useful,\n-   but WITHOUT ANY WARRANTY; without even the implied warranty of\n-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n-   GNU General Public License for more details.\n-\n-   You should have received a copy of the GNU General Public License\n-   along with this program; if not, write to the Free Software Foundation,\n-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */\n-\n-/*\n- * ISO C 99 <stdint.h> for platforms that lack it.\n- * <http://www.opengroup.org/susv3xbd/stdint.h.html>\n- */\n-\n-#ifndef _gl_GL_STDINT_H\n-\n-#if __GNUC__ >= 3\n-@PRAGMA_SYSTEM_HEADER@\n-#endif\n-\n-/* When including a system file that in turn includes <inttypes.h>,\n-   use the system <inttypes.h>, not our substitute.  This avoids\n-   problems with (for example) VMS, whose <sys/bitypes.h> includes\n-   <inttypes.h>.  */\n-#define _gl_GL_JUST_INCLUDE_SYSTEM_INTTYPES_H\n-\n-/* Get those types that are already defined in other system include\n-   files, so that we can \"#define int8_t signed char\" below without\n-   worrying about a later system include file containing a \"typedef\n-   signed char int8_t;\" that will get messed up by our macro.  Our\n-   macros should all be consistent with the system versions, except\n-   for the \"fast\" types and macros, which we recommend against using\n-   in public interfaces due to compiler differences.  */\n-\n-#if @HAVE_STDINT_H@\n-# if defined __sgi && ! defined __c99\n-   /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users\n-      with \"This header file is to be used only for c99 mode compilations\"\n-      diagnostics.  */\n-#  define __STDINT_H__\n-# endif\n-  /* Other systems may have an incomplete or buggy <stdint.h>.\n-     Include it before <inttypes.h>, since any \"#include <stdint.h>\"\n-     in <inttypes.h> would reinclude us, skipping our contents because\n-     _gl_GL_STDINT_H is defined.\n-     The include_next requires a split double-inclusion guard.  */\n-# @INCLUDE_NEXT@ @NEXT_STDINT_H@\n-#endif\n-\n-#if ! defined _gl_GL_STDINT_H && ! defined _gl_GL_JUST_INCLUDE_SYSTEM_STDINT_H\n-#define _gl_GL_STDINT_H\n-\n-/* <sys/types.h> defines some of the stdint.h types as well, on glibc,\n-   IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).\n-   AIX 5.2 <sys/types.h> isn't needed and causes troubles.\n-   MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but\n-   relies on the system <stdint.h> definitions, so include\n-   <sys/types.h> after @NEXT_STDINT_H@.  */\n-#if @HAVE_SYS_TYPES_H@ && ! defined _AIX\n-# include <sys/types.h>\n-#endif\n-\n-/* Get LONG_MIN, LONG_MAX, ULONG_MAX.  */\n-#include <limits.h>\n-\n-#if @HAVE_INTTYPES_H@\n-  /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines\n-     int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.\n-     <inttypes.h> also defines intptr_t and uintptr_t.  */\n-# include <inttypes.h>\n-#elif @HAVE_SYS_INTTYPES_H@\n-  /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and\n-     the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */\n-# include <sys/inttypes.h>\n-#endif\n-\n-#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__\n-  /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines\n-     int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it is\n-     included by <sys/types.h>.  */\n-# include <sys/bitypes.h>\n-#endif\n-\n-#undef _gl_GL_JUST_INCLUDE_SYSTEM_INTTYPES_H\n-\n-/* Minimum and maximum values for a integer type under the usual assumption.\n-   Return an unspecified value if BITS == 0, adding a check to pacify\n-   picky compilers.  */\n-\n-#define _STDINT_MIN(signed, bits, zero) \\\n-  ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))\n-\n-#define _STDINT_MAX(signed, bits, zero) \\\n-  ((signed) \\\n-   ? ~ _STDINT_MIN (signed, bits, zero) \\\n-   : /* The expression for the unsigned case.  The subtraction of (signed) \\\n-        is a nop in the unsigned case and avoids \"signed integer overflow\" \\\n-        warnings in the signed case.  */ \\\n-     ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)\n-\n-/* 7.18.1.1. Exact-width integer types */\n-\n-/* Here we assume a standard architecture where the hardware integer\n-   types have 8, 16, 32, optionally 64 bits.  */\n-\n-#undef int8_t\n-#undef uint8_t\n-typedef signed char gl_int8_t;\n-typedef unsigned char gl_uint8_t;\n-#define int8_t gl_int8_t\n-#define uint8_t gl_uint8_t\n-\n-#undef int16_t\n-#undef uint16_t\n-typedef short int gl_int16_t;\n-typedef unsigned short int gl_uint16_t;\n-#define int16_t gl_int16_t\n-#define uint16_t gl_uint16_t\n-\n-#undef int32_t\n-#undef uint32_t\n-typedef int gl_int32_t;\n-typedef unsigned int gl_uint32_t;\n-#define int32_t gl_int32_t\n-#define uint32_t gl_uint32_t\n-\n-/* Do not undefine int64_t if gnulib is not being used with 64-bit\n-   types, since otherwise it breaks platforms like Tandem/NSK.  */\n-#if LONG_MAX >> 31 >> 31 == 1\n-# undef int64_t\n-typedef long int gl_int64_t;\n-# define int64_t gl_int64_t\n-# define GL_INT64_T\n-#elif defined _MSC_VER\n-# undef int64_t\n-typedef __int64 gl_int64_t;\n-# define int64_t gl_int64_t\n-# define GL_INT64_T\n-#elif @HAVE_LONG_LONG_INT@\n-# undef int64_t\n-typedef long long int gl_int64_t;\n-# define int64_t gl_int64_t\n-# define GL_INT64_T\n-#endif\n-\n-#if ULONG_MAX >> 31 >> 31 >> 1 == 1\n-# undef uint64_t\n-typedef unsigned long int gl_uint64_t;\n-# define uint64_t gl_uint64_t\n-# define GL_UINT64_T\n-#elif defined _MSC_VER\n-# undef uint64_t\n-typedef unsigned __int64 gl_uint64_t;\n-# define uint64_t gl_uint64_t\n-# define GL_UINT64_T\n-#elif @HAVE_UNSIGNED_LONG_LONG_INT@\n-# undef uint64_t\n-typedef unsigned long long int gl_uint64_t;\n-# define uint64_t gl_uint64_t\n-# define GL_UINT64_T\n-#endif\n-\n-/* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */\n-#define _UINT8_T\n-#define _UINT32_T\n-#define _UINT64_T\n-\n-\n-/* 7.18.1.2. Minimum-width integer types */\n-\n-/* Here we assume a standard architecture where the hardware integer\n-   types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types\n-   are the same as the corresponding N_t types.  */\n-\n-#undef int_least8_t\n-#undef uint_least8_t\n-#undef int_least16_t\n-#undef uint_least16_t\n-#undef int_least32_t\n-#undef uint_least32_t\n-#undef int_least64_t\n-#undef uint_least64_t\n-#define int_least8_t int8_t\n-#define uint_least8_t uint8_t\n-#define int_least16_t int16_t\n-#define uint_least16_t uint16_t\n-#define int_least32_t int32_t\n-#define uint_least32_t uint32_t\n-#ifdef GL_INT64_T\n-# define int_least64_t int64_t\n-#endif\n-#ifdef GL_UINT64_T\n-# define uint_least64_t uint64_t\n-#endif\n-\n-/* 7.18.1.3. Fastest minimum-width integer types */\n-\n-/* Note: Other <stdint.h> substitutes may define these types differently.\n-   It is not recommended to use these types in public header files. */\n-\n-/* Here we assume a standard architecture where the hardware integer\n-   types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types\n-   are taken from the same list of types.  Assume that 'long int'\n-   is fast enough for all narrower integers.  */\n-\n-#undef int_fast8_t\n-#undef uint_fast8_t\n-#undef int_fast16_t\n-#undef uint_fast16_t\n-#undef int_fast32_t\n-#undef uint_fast32_t\n-#undef int_fast64_t\n-#undef uint_fast64_t\n-typedef long int gl_int_fast8_t;\n-typedef unsigned long int gl_uint_fast8_t;\n-typedef long int gl_int_fast16_t;\n-typedef unsigned long int gl_uint_fast16_t;\n-typedef long int gl_int_fast32_t;\n-typedef unsigned long int gl_uint_fast32_t;\n-#define int_fast8_t gl_int_fast8_t\n-#define uint_fast8_t gl_uint_fast8_t\n-#define int_fast16_t gl_int_fast16_t\n-#define uint_fast16_t gl_uint_fast16_t\n-#define int_fast32_t gl_int_fast32_t\n-#define uint_fast32_t gl_uint_fast32_t\n-#ifdef GL_INT64_T\n-# define int_fast64_t int64_t\n-#endif\n-#ifdef GL_UINT64_T\n-# define uint_fast64_t uint64_t\n-#endif\n-\n-/* 7.18.1.4. Integer types capable of holding object pointers */\n-\n-#undef intptr_t\n-#undef uintptr_t\n-typedef long int gl_intptr_t;\n-typedef unsigned long int gl_uintptr_t;\n-#define intptr_t gl_intptr_t\n-#define uintptr_t gl_uintptr_t\n-\n-/* 7.18.1.5. Greatest-width integer types */\n-\n-/* Note: These types are compiler dependent. It may be unwise to use them in\n-   public header files. */\n-\n-#undef intmax_t\n-#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1\n-typedef long long int gl_intmax_t;\n-# define intmax_t gl_intmax_t\n-#elif defined GL_INT64_T\n-# define intmax_t int64_t\n-#else\n-typedef long int gl_intmax_t;\n-# define intmax_t gl_intmax_t\n-#endif\n-\n-#undef uintmax_t\n-#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1\n-typedef unsigned long long int gl_uintmax_t;\n-# define uintmax_t gl_uintmax_t\n-#elif defined GL_UINT64_T\n-# define uintmax_t uint64_t\n-#else\n-typedef unsigned long int gl_uintmax_t;\n-# define uintmax_t gl_uintmax_t\n-#endif\n-\n-/* Verify that intmax_t and uintmax_t have the same size.  Too much code\n-   breaks if this is not the case.  If this check fails, the reason is likely\n-   to be found in the autoconf macros.  */\n-typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1];\n-\n-/* 7.18.2. Limits of specified-width integer types */\n-\n-#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS\n-\n-/* 7.18.2.1. Limits of exact-width integer types */\n-\n-/* Here we assume a standard architecture where the hardware integer\n-   types have 8, 16, 32, optionally 64 bits.  */\n-\n-#undef INT8_MIN\n-#undef INT8_MAX\n-#undef UINT8_MAX\n-#define INT8_MIN  (~ INT8_MAX)\n-#define INT8_MAX  127\n-#define UINT8_MAX  255\n-\n-#undef INT16_MIN\n-#undef INT16_MAX\n-#undef UINT16_MAX\n-#define INT16_MIN  (~ INT16_MAX)\n-#define INT16_MAX  32767\n-#define UINT16_MAX  65535\n-\n-#undef INT32_MIN\n-#undef INT32_MAX\n-#undef UINT32_MAX\n-#define INT32_MIN  (~ INT32_MAX)\n-#define INT32_MAX  2147483647\n-#define UINT32_MAX  4294967295U\n-\n-#undef INT64_MIN\n-#undef INT64_MAX\n-#ifdef GL_INT64_T\n-/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0\n-   evaluates the latter incorrectly in preprocessor expressions.  */\n-# define INT64_MIN  (- INTMAX_C (1) << 63)\n-# define INT64_MAX  INTMAX_C (9223372036854775807)\n-#endif\n-\n-#undef UINT64_MAX\n-#ifdef GL_UINT64_T\n-# define UINT64_MAX  UINTMAX_C (18446744073709551615)\n-#endif\n-\n-/* 7.18.2.2. Limits of minimum-width integer types */\n-\n-/* Here we assume a standard architecture where the hardware integer\n-   types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types\n-   are the same as the corresponding N_t types.  */\n-\n-#undef INT_LEAST8_MIN\n-#undef INT_LEAST8_MAX\n-#undef UINT_LEAST8_MAX\n-#define INT_LEAST8_MIN  INT8_MIN\n-#define INT_LEAST8_MAX  INT8_MAX\n-#define UINT_LEAST8_MAX  UINT8_MAX\n-\n-#undef INT_LEAST16_MIN\n-#undef INT_LEAST16_MAX\n-#undef UINT_LEAST16_MAX\n-#define INT_LEAST16_MIN  INT16_MIN\n-#define INT_LEAST16_MAX  INT16_MAX\n-#define UINT_LEAST16_MAX  UINT16_MAX\n-\n-#undef INT_LEAST32_MIN\n-#undef INT_LEAST32_MAX\n-#undef UINT_LEAST32_MAX\n-#define INT_LEAST32_MIN  INT32_MIN\n-#define INT_LEAST32_MAX  INT32_MAX\n-#define UINT_LEAST32_MAX  UINT32_MAX\n-\n-#undef INT_LEAST64_MIN\n-#undef INT_LEAST64_MAX\n-#ifdef GL_INT64_T\n-# define INT_LEAST64_MIN  INT64_MIN\n-# define INT_LEAST64_MAX  INT64_MAX\n-#endif\n-\n-#undef UINT_LEAST64_MAX\n-#ifdef GL_UINT64_T\n-# define UINT_LEAST64_MAX  UINT64_MAX\n-#endif\n-\n-/* 7.18.2.3. Limits of fastest minimum-width integer types */\n-\n-/* Here we assume a standard architecture where the hardware integer\n-   types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types\n-   are taken from the same list of types.  */\n-\n-#undef INT_FAST8_MIN\n-#undef INT_FAST8_MAX\n-#undef UINT_FAST8_MAX\n-#define INT_FAST8_MIN  LONG_MIN\n-#define INT_FAST8_MAX  LONG_MAX\n-#define UINT_FAST8_MAX  ULONG_MAX\n-\n-#undef INT_FAST16_MIN\n-#undef INT_FAST16_MAX\n-#undef UINT_FAST16_MAX\n-#define INT_FAST16_MIN  LONG_MIN\n-#define INT_FAST16_MAX  LONG_MAX\n-#define UINT_FAST16_MAX  ULONG_MAX\n-\n-#undef INT_FAST32_MIN\n-#undef INT_FAST32_MAX\n-#undef UINT_FAST32_MAX\n-#define INT_FAST32_MIN  LONG_MIN\n-#define INT_FAST32_MAX  LONG_MAX\n-#define UINT_FAST32_MAX  ULONG_MAX\n-\n-#undef INT_FAST64_MIN\n-#undef INT_FAST64_MAX\n-#ifdef GL_INT64_T\n-# define INT_FAST64_MIN  INT64_MIN\n-# define INT_FAST64_MAX  INT64_MAX\n-#endif\n-\n-#undef UINT_FAST64_MAX\n-#ifdef GL_UINT64_T\n-# define UINT_FAST64_MAX  UINT64_MAX\n-#endif\n-\n-/* 7.18.2.4. Limits of integer types capable of holding object pointers */\n-\n-#undef INTPTR_MIN\n-#undef INTPTR_MAX\n-#undef UINTPTR_MAX\n-#define INTPTR_MIN  LONG_MIN\n-#define INTPTR_MAX  LONG_MAX\n-#define UINTPTR_MAX  ULONG_MAX\n-\n-/* 7.18.2.5. Limits of greatest-width integer types */\n-\n-#undef INTMAX_MIN\n-#undef INTMAX_MAX\n-#ifdef INT64_MAX\n-# define INTMAX_MIN  INT64_MIN\n-# define INTMAX_MAX  INT64_MAX\n-#else\n-# define INTMAX_MIN  INT32_MIN\n-# define INTMAX_MAX  INT32_MAX\n-#endif\n-\n-#undef UINTMAX_MAX\n-#ifdef UINT64_MAX\n-# define UINTMAX_MAX  UINT64_MAX\n-#else\n-# define UINTMAX_MAX  UINT32_MAX\n-#endif\n-\n-/* 7.18.3. Limits of other integer types */\n-\n-/* ptrdiff_t limits */\n-#undef PTRDIFF_MIN\n-#undef PTRDIFF_MAX\n-#if @APPLE_UNIVERSAL_BUILD@\n-# ifdef _LP64\n-#  define PTRDIFF_MIN  _STDINT_MIN (1, 64, 0l)\n-#  define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)\n-# else\n-#  define PTRDIFF_MIN  _STDINT_MIN (1, 32, 0)\n-#  define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)\n-# endif\n-#else\n-# define PTRDIFF_MIN  \\\n-    _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)\n-# define PTRDIFF_MAX  \\\n-    _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)\n-#endif\n-\n-/* sig_atomic_t limits */\n-#undef SIG_ATOMIC_MIN\n-#undef SIG_ATOMIC_MAX\n-#define SIG_ATOMIC_MIN  \\\n-   _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \\\n-                0@SIG_ATOMIC_T_SUFFIX@)\n-#define SIG_ATOMIC_MAX  \\\n-   _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \\\n-                0@SIG_ATOMIC_T_SUFFIX@)\n-\n-\n-/* size_t limit */\n-#undef SIZE_MAX\n-#if @APPLE_UNIVERSAL_BUILD@\n-# ifdef _LP64\n-#  define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)\n-# else\n-#  define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)\n-# endif\n-#else\n-# define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)\n-#endif\n-\n-/* wchar_t limits */\n-/* Get WCHAR_MIN, WCHAR_MAX.\n-   This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested\n-   includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes\n-   <stdint.h> and assumes its types are already defined.  */\n-#if ! (defined WCHAR_MIN && defined WCHAR_MAX)\n-# define _gl_GL_JUST_INCLUDE_SYSTEM_WCHAR_H\n-# include <wchar.h>\n-# undef _gl_GL_JUST_INCLUDE_SYSTEM_WCHAR_H\n-#endif\n-#undef WCHAR_MIN\n-#undef WCHAR_MAX\n-#define WCHAR_MIN  \\\n-   _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)\n-#define WCHAR_MAX  \\\n-   _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)\n-\n-/* wint_t limits */\n-#undef WINT_MIN\n-#undef WINT_MAX\n-#define WINT_MIN  \\\n-   _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)\n-#define WINT_MAX  \\\n-   _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)\n-\n-#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */\n-\n-/* 7.18.4. Macros for integer constants */\n-\n-#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS\n-\n-/* 7.18.4.1. Macros for minimum-width integer constants */\n-/* According to ISO C 99 Technical Corrigendum 1 */\n-\n-/* Here we assume a standard architecture where the hardware integer\n-   types have 8, 16, 32, optionally 64 bits, and int is 32 bits.  */\n-\n-#undef INT8_C\n-#undef UINT8_C\n-#define INT8_C(x) x\n-#define UINT8_C(x) x\n-\n-#undef INT16_C\n-#undef UINT16_C\n-#define INT16_C(x) x\n-#define UINT16_C(x) x\n-\n-#undef INT32_C\n-#undef UINT32_C\n-#define INT32_C(x) x\n-#define UINT32_C(x) x ## U\n-\n-#undef INT64_C\n-#undef UINT64_C\n-#if LONG_MAX >> 31 >> 31 == 1\n-# define INT64_C(x) x##L\n-#elif defined _MSC_VER\n-# define INT64_C(x) x##i64\n-#elif @HAVE_LONG_LONG_INT@\n-# define INT64_C(x) x##LL\n-#endif\n-#if ULONG_MAX >> 31 >> 31 >> 1 == 1\n-# define UINT64_C(x) x##UL\n-#elif defined _MSC_VER\n-# define UINT64_C(x) x##ui64\n-#elif @HAVE_UNSIGNED_LONG_LONG_INT@\n-# define UINT64_C(x) x##ULL\n-#endif\n-\n-/* 7.18.4.2. Macros for greatest-width integer constants */\n-\n-#undef INTMAX_C\n-#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1\n-# define INTMAX_C(x)   x##LL\n-#elif defined GL_INT64_T\n-# define INTMAX_C(x)   INT64_C(x)\n-#else\n-# define INTMAX_C(x)   x##L\n-#endif\n-\n-#undef UINTMAX_C\n-#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1\n-# define UINTMAX_C(x)  x##ULL\n-#elif defined GL_UINT64_T\n-# define UINTMAX_C(x)  UINT64_C(x)\n-#else\n-# define UINTMAX_C(x)  x##UL\n-#endif\n-\n-#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */\n-\n-#endif /* _gl_GL_STDINT_H */\n-#endif /* !defined _gl_GL_STDINT_H && !defined _gl_GL_JUST_INCLUDE_SYSTEM_STDINT_H */\n+#include_next <stdint.h>\n"
  },
  {
    "path": "disabled-packages/clisp/src-makefile.in.patch",
    "content": "diff -u -r ../clisp-2.49/src/makemake.in ./src/makemake.in\n--- ../clisp-2.49/src/makemake.in\t2010-07-07 11:15:35.000000000 -0400\n+++ ./src/makemake.in\t2016-02-17 15:27:00.420198622 -0500\n@@ -651,9 +651,6 @@\n   # We can cross-compile only with GCC\n   XCC=${COMPILER}  # ${TSYS}-gcc\n   XCPP=\"${XCC} -E\"\n-  XCPPFLAGS=''\n-  XCFLAGS=''\n-  XLDFLAGS=''\n   XCC_GCC=true\n   XCC_NEED_DEEMA=false\n else\n"
  },
  {
    "path": "disabled-packages/crawl/build.sh",
    "content": "# Currently fails at:\n# Makefile:101: recipe for target 'tiledef-dngn.h' failed\n# make[1]: *** [tiledef-dngn.h] Segmentation fault (core dumped)\n\nTERMUX_PKG_HOMEPAGE=https://crawl.develz.org/\nTERMUX_PKG_DESCRIPTION=\"Roguelike adventure through dungeons filled with dangerous monsters\"\nTERMUX_PKG_VERSION=0.17.1\nTERMUX_PKG_SRCURL=https://crawl.develz.org/release/stone_soup-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"V=1\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\texport CROSSHOST=$TERMUX_HOST_PLATFORM\n\tTERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR/source\n}\n"
  },
  {
    "path": "disabled-packages/cups/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.cups.org\nTERMUX_PKG_VERSION=2.2.4\nTERMUX_PKG_DEPENDS=krb5\nTERMUX_PKG_SRCURL=https://github.com/apple/cups/releases/download/v$TERMUX_PKG_VERSION/cups-$TERMUX_PKG_VERSION-source.tar.gz\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_SHA256=596d4db72651c335469ae5f37b0da72ac9f97d73e30838d787065f559dea98cc\nTERMUX_PKG_DEPENDS=\"libandroid-support, libcrypt\"\nTERMUX_PKG_FOLDERNAME=cups-$TERMUX_PKG_VERSION\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-option-checking\n--disable-gssapi\n--with-components=core\n\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS=\"$LDFLAGS -llog -lcrypt\"\n}\n\ntermux_step_post_make_install() {\n\tmv \"$TERMUX_PREFIX\"/lib64/libcups.so* \"$TERMUX_PREFIX\"/lib/\n}\n"
  },
  {
    "path": "disabled-packages/cups/cups-thread.c.patch",
    "content": "--- ./cups/thread.c\t2017-06-30 21:14:38.000000000 +0530\n+++ ../thread.c\t2017-09-24 10:12:11.169628258 +0530\n@@ -18,6 +18,7 @@\n \n #include \"cups-private.h\"\n #include \"thread-private.h\"\n+#include <signal.h>\n \n \n #if defined(HAVE_PTHREAD_H)\n@@ -150,7 +151,7 @@\n void\n _cupsThreadCancel(_cups_thread_t thread)/* I - Thread ID */\n {\n-  pthread_cancel(thread);\n+  pthread_kill(thread, SIGTERM);\n }\n \n \n"
  },
  {
    "path": "disabled-packages/cups/file.c.patch",
    "content": "--- ./cups/file.c\t2016-10-04 01:25:40.000000000 +0530\n+++ ../file.c\t2016-12-11 09:51:21.994431659 +0530\n@@ -39,6 +39,9 @@\n static ssize_t\tcups_read(cups_file_t *fp, char *buf, size_t bytes);\n static ssize_t\tcups_write(cups_file_t *fp, const char *buf, size_t bytes);\n \n+#ifdef __ANDROID__\n+#include \"lockf.cpp\"\n+#endif\n \n #ifndef WIN32\n /*\n"
  },
  {
    "path": "disabled-packages/cups/lockf.cpp.patch",
    "content": "--- /dev/null\t2016-12-11 08:33:21.825618476 +0530\n+++ ./cups/lockf.cpp\t2016-12-11 09:44:20.050966252 +0530\n@@ -0,0 +1,89 @@\n+/*\n+ * Copyright (C) 2016 The Android Open Source Project\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *  * Redistributions of source code must retain the above copyright\n+ *    notice, this list of conditions and the following disclaimer.\n+ *  * Redistributions in binary form must reproduce the above copyright\n+ *    notice, this list of conditions and the following disclaimer in\n+ *    the documentation and/or other materials provided with the\n+ *    distribution.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n+ * SUCH DAMAGE.\n+ */\n+#include <unistd.h>\n+#include <errno.h>\n+#include <fcntl.h>\n+#include <string.h>\n+\n+#ifndef _BITS_LOCKF_H_\n+#define _BITS_LOCKF_H_\n+\n+#include <sys/cdefs.h>\n+\n+#define F_ULOCK 0\n+#define F_LOCK 1\n+#define F_TLOCK 2\n+#define F_TEST 3\n+\n+__BEGIN_DECLS\n+\n+#if defined(__USE_FILE_OFFSET64)\n+int lockf(int, int, off_t) __RENAME(lockf64);\n+#else\n+int lockf(int, int, off_t);\n+#endif\n+int lockf64(int, int, off64_t);\n+\n+__END_DECLS\n+\n+#endif\n+\n+\n+int lockf64(int fd, int cmd, off64_t length) {\n+  // Translate POSIX lockf into fcntl.\n+  struct flock fl;\n+  memset(&fl, 0, sizeof(fl));\n+  fl.l_whence = SEEK_CUR;\n+  fl.l_start = 0;\n+  fl.l_len = length;\n+  if (cmd == F_ULOCK) {\n+    fl.l_type = F_UNLCK;\n+    cmd = F_SETLK64;\n+    return fcntl(fd, F_SETLK64, &fl);\n+  }\n+  if (cmd == F_LOCK) {\n+    fl.l_type = F_WRLCK;\n+    return fcntl(fd, F_SETLKW64, &fl);\n+  }\n+  if (cmd == F_TLOCK) {\n+    fl.l_type = F_WRLCK;\n+    return fcntl(fd, F_SETLK64, &fl);\n+  }\n+  if (cmd == F_TEST) {\n+    fl.l_type = F_RDLCK;\n+    if (fcntl(fd, F_GETLK64, &fl) == -1) return -1;\n+    if (fl.l_type == F_UNLCK || fl.l_pid == getpid()) return 0;\n+    errno = EACCES;\n+    return -1;\n+  }\n+  errno = EINVAL;\n+  return -1;\n+}\n+int lockf(int fd, int cmd, off_t length) {\n+  return lockf64(fd, cmd, length);\n+}\n"
  },
  {
    "path": "disabled-packages/d8/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://r8.googlesource.com/r8\nTERMUX_PKG_DESCRIPTION=\"Dexer that converts java byte code to dex code\"\nTERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\t# Rewrite packages to avoid using com.android.* classes which may clash with\n\t# classes in the Android runtime on devices (see #1801):\n\tlocal JARJAR=$TERMUX_PKG_CACHEDIR/jarjar.jar\n\tlocal RULEFILE=$TERMUX_PKG_TMPDIR/jarjar-rule.txt\n\tlocal REWRITTEN_DX=$TERMUX_PKG_TMPDIR/d8-rewritten.jar\n\ttermux_download \\\n\t\thttp://repo.bodar.com/com/googlecode/jarjar/jarjar/1.4.1/jarjar-1.4.1.jar \\\n\t\t$JARJAR \\\n\t\tc16b1cee296526baae432c382f83d540d4b648dc21923428a66a69ba43b7df9e\n\techo 'rule com.android.** d8.@1' > $RULEFILE\n\tjava -jar $JARJAR process $RULEFILE \\\n\t\t$ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/d8.jar \\\n\t\t$REWRITTEN_DX\n\n\t# Dex the rewritten jar file:\n\tmkdir -p $TERMUX_PREFIX/share/dex\n\t$TERMUX_D8 \\\n\t\t--classpath $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar \\\n\t\t--release \\\n\t\t--min-api 21 \\\n\t\t--output $TERMUX_PREFIX/share/dex/d8.jar \\\n\t\t$REWRITTEN_DX\n\n\tinstall $TERMUX_PKG_BUILDER_DIR/d8 $TERMUX_PREFIX/bin/d8\n\tperl -p -i -e \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PREFIX/bin/d8\n}\n"
  },
  {
    "path": "disabled-packages/d8/d8",
    "content": "#!/bin/sh\n\nexec dalvikvm \\\n\t-Xmx256m \\\n\t-cp @TERMUX_PREFIX@/share/dex/d8.jar \\\n\td8.tools.r8.D8 \\\n\t--classpath $PREFIX/share/java/android.jar \\\n\t$@\n"
  },
  {
    "path": "disabled-packages/deborphan/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/source/sid/deborphan\nTERMUX_PKG_DESCRIPTION=\"Program that can find unused packages\"\nTERMUX_PKG_VERSION=1.7.28.8-0.3\nTERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/d/deborphan/deborphan_$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_MAINTAINER=\"Pierre Rudloff @Rudloff\"\n"
  },
  {
    "path": "disabled-packages/deborphan/configure.patch",
    "content": "diff -u -r ../deborphan/configure ./configure\n--- ../deborphan/configure\t2016-02-21 09:05:27.000000000 -0500\n+++ ./configure\t2016-08-11 05:52:10.144221407 -0400\n@@ -2957,7 +2957,7 @@\n \n \n \n-$as_echo \"#define STATUS_FILE \\\"/var/lib/dpkg/status\\\"\" >>confdefs.h\n+$as_echo \"#define STATUS_FILE \\\"@TERMUX_PREFIX@/var/lib/dpkg/status\\\"\" >>confdefs.h\n \n \n $as_echo \"#define REG_FLAGS REG_ICASE\" >>confdefs.h\n"
  },
  {
    "path": "disabled-packages/deborphan/errno.patch",
    "content": "diff --git a/src/exit.c b/src/exit.c\nindex e76a75e..99cfbdd 100644\n--- a/src/exit.c\n+++ b/src/exit.c\n@@ -21,7 +21,6 @@\n\n #ifdef HAVE_ERRNO_H\n #  include <errno.h>\n-extern int errno;\n #endif\n\n #ifdef ENABLE_NLS\ndiff --git a/src/xalloc.c b/src/xalloc.c\nindex 8c830e7..43cfb64 100644\n--- a/src/xalloc.c\n+++ b/src/xalloc.c\n@@ -22,7 +22,6 @@\n\n #ifdef HAVE_ERRNO_H\n #  include <errno.h>\n-extern int errno;\n #endif\n\n #ifdef STDC_HEADERS\n\n"
  },
  {
    "path": "disabled-packages/deborphan/src-Makefile.in.patch",
    "content": "diff -u -r ../deborphan/src/Makefile.in ./src/Makefile.in\n--- ../deborphan/src/Makefile.in\t2016-02-21 09:05:27.000000000 -0500\n+++ ./src/Makefile.in\t2016-08-11 06:13:53.452865872 -0400\n@@ -213,7 +213,7 @@\n target_alias = @target_alias@\n deborphan_SOURCES = deborphan.c exit.c libdeps.c pkginfo.c xalloc.c string.c keep.c file.c set.c\n KEEPNAME = keep\n-STATEDIR = /var/lib/deborphan\n+STATEDIR = @TERMUX_PREFIX@/var/lib/deborphan\n KEEPFILE = $(STATEDIR)/$(KEEPNAME)\n INCLUDES = -I../include\n all: all-am\n"
  },
  {
    "path": "disabled-packages/deborphan/src-deborphan.c.patch",
    "content": "diff -u -r ../deborphan/src/deborphan.c ./src/deborphan.c\n--- ../deborphan/src/deborphan.c\t2016-02-21 09:05:27.000000000 -0500\n+++ ./src/deborphan.c\t2016-08-11 06:20:43.718666170 -0400\n@@ -562,8 +562,6 @@\n     if (this->install)\n \tcheck_lib_deps(package, this, print_arch_suffixes);\n \n-    free_pkg_regex();\n-\n     fflush(stdout);\n \n     for (i = 0; options[SEARCH] && search_for[i].name; i++) {\n"
  },
  {
    "path": "disabled-packages/deborphan/src-pkginfo.c.patch",
    "content": "diff -u -r ../deborphan/src/pkginfo.c ./src/pkginfo.c\n--- ../deborphan/src/pkginfo.c\t2016-02-21 09:05:27.000000000 -0500\n+++ ./src/pkginfo.c\t2016-08-11 06:10:28.211955162 -0400\n@@ -106,10 +106,16 @@\n     regfree(&re_statushold);\n     regfree(&re_statusconfig);\n     regfree(&re_status);\n-    regfree(&re_namedev);\n-    regfree(&re_gnugrepv);\n-    regfree(&re_descdummy);\n-    regfree(&re_desctransit);\n+    if (options[GUESS]) {\n+        if (!guess_unique(GUESS_SECTION))\n+            regfree(&re_namedev);\n+        if (guess_chk(GUESS_SECTION))\n+            regfree(&re_gnugrepv);\n+        if (guess_chk(GUESS_DUMMY)) {\n+            regfree(&re_descdummy);\n+            regfree(&re_desctransit);\n+        }\n+    }\n }\n \n /* A similar \"hack\" was created by Paul Martin a while ago. It was not\n"
  },
  {
    "path": "disabled-packages/dovecot/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.dovecot.org\nTERMUX_PKG_DESCRIPTION=\"Secure IMAP and POP3 email server\"\nTERMUX_PKG_VERSION=2.2.31\nTERMUX_PKG_SRCURL=https://www.dovecot.org/releases/2.2/dovecot-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=034be40907748128d65088a4f59789b2f99ae7b33a88974eae0b6a68ece376a1\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_DEPENDS=\"openssl, libcrypt\"\n# turning on icu gives undefined reference to __cxa_call_unexpected\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-zlib\n--with-ssl=openssl\n--with-ssldir=$TERMUX_PREFIX/etc/tls\n--without-icu\n--without-shadow\ni_cv_epoll_works=yes\ni_cv_posix_fallocate_works=yes\ni_cv_signed_size_t=no\ni_cv_gmtime_max_time_t=40\ni_cv_signed_time_t=yes\ni_cv_mmap_plays_with_write=yes\ni_cv_fd_passing=yes\ni_cv_c99_vsnprintf=yes\nlib_cv_va_copy=yes\nlib_cv___va_copy=yes\n\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS=\"$LDFLAGS -llog\"\n\n\tfor i in $(find $TERMUX_PKG_SRCDIR/src/director -type f); do sed 's|\\bstruct user\\b|struct usertest|g' -i $i; done\n\n\tif [ \"$TERMUX_ARCH\" == \"aarch64\" ]; then\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\"lib_cv_va_val_copy=yes\"\n\telse\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\"lib_cv_va_val_copy=no\"\n\tfi\n}\n\ntermux_step_post_make_install() {\n\tfor binary in doveadm doveconf; do\n\t\tmv $TERMUX_PREFIX/bin/$binary $TERMUX_PREFIX/libexec/dovecot/$binary\n\t\tcat > $TERMUX_PREFIX/bin/$binary <<HERE\n#!$TERMUX_PREFIX/bin/sh\nexport LD_LIBRARY_PATH=$TERMUX_PREFIX/lib/dovecot:\\$LD_LIBRARY_PATH\nexec $TERMUX_PREFIX/libexec/dovecot/$binary $@\nHERE\n\t\tchmod u+x $TERMUX_PREFIX/bin/$binary\n\tdone\n}\n"
  },
  {
    "path": "disabled-packages/dovecot/configure.patch",
    "content": "--- ./configure\t2017-06-06 19:59:58.000000000 +0530\n+++ ../configure\t2017-06-09 22:41:43.475719606 +0530\n@@ -4464,8 +4464,8 @@\n fi\n \n \n-want_passwd=yes\n-want_passwd_file=yes\n+want_passwd=no\n+want_passwd_file=no\n want_checkpassword=yes\n want_prefetch_userdb=yes\n \n--- ./configure\t2017-06-10 10:57:04.390830105 +0530\n+++ ../configure\t2017-06-10 11:14:06.734990847 +0530\n@@ -26351,12 +26351,6 @@\n \n \n have_rquota=no\n-if test -f /usr/include/rpcsvc/rquota.x && test -n \"$RPCGEN\"; then\n-\n-$as_echo \"#define HAVE_RQUOTA /**/\" >>confdefs.h\n-\n-  have_rquota=yes\n-fi\n  if test \"$have_rquota\" = \"yes\"; then\n   HAVE_RQUOTA_TRUE=\n   HAVE_RQUOTA_FALSE='#'\n"
  },
  {
    "path": "disabled-packages/dovecot/src-lib-connection.h.patch",
    "content": "--- ./src/lib/connection.h\t2016-12-03 22:43:21.000000000 +0530\n+++ ../connection.h\t2017-06-09 22:47:48.138342901 +0530\n@@ -2,6 +2,7 @@\n #define CONNECTION_H\n \n #include \"net.h\"\n+#include <linux/time.h>\n \n struct connection;\n \n"
  },
  {
    "path": "disabled-packages/easy-rsa/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://openvpn.net/easyrsa.html\nTERMUX_PKG_VERSION=3.0.1\nTERMUX_PKG_DEPENDS=\"openssl-tool\"\nTERMUX_PKG_SRCURL=https://github.com/OpenVPN/easy-rsa/releases/download/$TERMUX_PKG_VERSION/EasyRSA-$TERMUX_PKG_VERSION.tgz\nTERMUX_PKG_SHA256=dbdaf5b9444b99e0c5221fd4bcf15384c62380c1b63cea23d42239414d7b2d4e\nTERMUX_PKG_CONFFILES=\"etc/easy-rsa/openssl-1.0.cnf, etc/easy-rsa/vars\"\nTERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas'\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n    install -D -m0755 easyrsa \"${TERMUX_PREFIX}\"/bin/easyrsa\n\n    install -D -m0644 openssl-1.0.cnf \"${TERMUX_PREFIX}\"/etc/easy-rsa/openssl-1.0.cnf\n    install -D -m0644 vars.example \"${TERMUX_PREFIX}\"/etc/easy-rsa/vars\n    install -d -m0755 \"${TERMUX_PREFIX}\"/etc/easy-rsa/x509-types/\n    install -m0644 x509-types/* \"${TERMUX_PREFIX}\"/etc/easy-rsa/x509-types/\n}\n"
  },
  {
    "path": "disabled-packages/ghc/bitcast.patch",
    "content": "From\n\thttps://github.com/erikd/ghc-llvm-next/blob/llvm-3.8/patches/01-bitcast.patch\n\ndiff -u -r ../ghc-8.0.1/compiler/llvmGen/Llvm/PpLlvm.hs ./compiler/llvmGen/Llvm/PpLlvm.hs\n--- ../ghc-8.0.1/compiler/llvmGen/Llvm/PpLlvm.hs\t2016-05-16 13:08:53.000000000 -0400\n+++ ./compiler/llvmGen/Llvm/PpLlvm.hs\t2016-06-23 16:59:36.113778783 -0400\n@@ -73,7 +73,7 @@\n             Nothing -> empty\n \n         rhs = case dat of\n-            Just stat -> ppr stat\n+            Just stat -> pprSpecialStatic stat\n             Nothing   -> ppr (pLower $ getVarType var)\n \n         -- Position of linkage is different for aliases.\ndiff -u -r ../ghc-8.0.1/compiler/llvmGen/Llvm/Types.hs ./compiler/llvmGen/Llvm/Types.hs\n--- ../ghc-8.0.1/compiler/llvmGen/Llvm/Types.hs\t2016-05-16 13:08:53.000000000 -0400\n+++ ./compiler/llvmGen/Llvm/Types.hs\t2016-06-23 17:00:14.569166114 -0400\n@@ -175,6 +175,11 @@\n   ppr (LMSub s1 s2)\n       = pprStaticArith s1 s2 (sLit \"sub\") (sLit \"fsub\") \"LMSub\"\n \n+pprSpecialStatic :: LlvmStatic -> SDoc\n+pprSpecialStatic (LMBitc v t) =\n+    ppr (pLower t) <> text \", bitcast (\" <> ppr v <> text \" to \" <> ppr t <> char ')'\n+pprSpecialStatic stat = ppr stat\n+\n pprStaticArith :: LlvmStatic -> LlvmStatic -> LitString -> LitString -> String -> SDoc\n pprStaticArith s1 s2 int_op float_op op_name =\n   let ty1 = getStatType s1\n"
  },
  {
    "path": "disabled-packages/ghc/build.sh",
    "content": "# See https://ghc.haskell.org/trac/ghc/wiki/Building/CrossCompiling\n#     https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux\n# and\n#     https://github.com/neurocyte/ghc-android\nTERMUX_PKG_HOMEPAGE=https://www.haskell.org/ghc/\nTERMUX_PKG_DESCRIPTION=\"The Glasgow Haskell Compilation system\"\nTERMUX_PKG_VERSION=8.0.1\nTERMUX_PKG_SRCURL=http://downloads.haskell.org/~ghc/${TERMUX_PKG_VERSION}/ghc-${TERMUX_PKG_VERSION}-src.tar.xz\nTERMUX_PKG_BUILD_IN_SRC=true\n# Depend on clang for now until llvm is split into separate package:\nTERMUX_PKG_DEPENDS=\"clang, ncurses\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-iconv-includes=$TERMUX_PREFIX/include -with-iconv-libraries=$TERMUX_PREFIX/lib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --with-curses-includes=$TERMUX_PREFIX/include/ncursesw -with-curses-libraries=$TERMUX_PREFIX/lib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --host=x86_64-unknown-linux --build=x86_64-unknown-linux\"\n\ntermux_step_post_extract_package() {\n\tORIG_CFLAGS=\"$CFLAGS\"\n\tORIG_CPPFLAGS=\"$CPPFLAGS\"\n\tORIG_LDFLAGS=\"$LDFLAGS\"\n\n\tunset AR\n\tunset AS\n\tunset CC\n\texport CFLAGS=\"\"\n\tunset CPP\n\texport CPPFLAGS=\"\"\n\tunset CXXFLAGS\n\tunset CXX\n\texport LDFLAGS=\"\"\n\tunset LD\n\tunset PKG_CONFIG\n\tunset RANLIB\n\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --target=${TERMUX_HOST_PLATFORM}\"\n}\n\ntermux_step_pre_configure() {\n\techo \"INTEGER_LIBRARY = integer-simple\" > mk/build.mk\n\t#echo \"GhcStage2HcOpts = $ORIG_CFLAGS $ORIG_CPPFLAGS $ORIG_LDFLAGS\" >> mk/build.mk\n\n\t# Avoid \"Can't use -fPIC or -dynamic on this platform\":\n\techo \"DYNAMIC_GHC_PROGRAMS = NO\" >> mk/build.mk\n\techo \"GhcLibWays = v\" >> mk/build.mk\n\t# \"Can not build haddock docs when CrossCompiling or Stage1Only\".\n\techo \"HADDOCK_DOCS=NO\" >> mk/build.mk\n}\n"
  },
  {
    "path": "disabled-packages/ghc/compiler-llvmGen-LlvmCodeGen-Ppr.hs.patch",
    "content": "diff -u -r ../ghc-8.0.1/compiler/llvmGen/LlvmCodeGen/Ppr.hs ./compiler/llvmGen/LlvmCodeGen/Ppr.hs\n--- ../ghc-8.0.1/compiler/llvmGen/LlvmCodeGen/Ppr.hs\t2016-05-16 13:08:53.000000000 -0400\n+++ ./compiler/llvmGen/LlvmCodeGen/Ppr.hs\t2016-06-23 17:54:27.073877144 -0400\n@@ -44,12 +44,18 @@\n     Platform { platformArch = ArchX86, platformOS = OSLinux } ->\n         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\\\"\"\n         $+$ text \"target triple = \\\"i386-pc-linux-gnu\\\"\"\n+    Platform { platformArch = ArchX86, platformOS = OSAndroid } ->\n+        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\\\"\"\n+        $+$ text \"target triple = \\\"i386-pc-linux-android\\\"\"\n     Platform { platformArch = ArchX86_64, platformOS = OSDarwin } ->\n         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\\\"\"\n         $+$ text \"target triple = \\\"x86_64-apple-darwin10.0.0\\\"\"\n     Platform { platformArch = ArchX86_64, platformOS = OSLinux } ->\n         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\\\"\"\n         $+$ text \"target triple = \\\"x86_64-linux-gnu\\\"\"\n+    Platform { platformArch = ArchX86_64, platformOS = OSAndroid } ->\n+        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\\\"\"\n+        $+$ text \"target triple = \\\"x86_64-linux-android\\\"\"\n     Platform { platformArch = ArchARM {}, platformOS = OSLinux } ->\n         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\\\"\"\n         $+$ text \"target triple = \\\"armv6-unknown-linux-gnueabihf\\\"\"\n@@ -71,6 +77,9 @@\n     Platform { platformArch = ArchARM64, platformOS = OSLinux } ->\n         text \"target datalayout = \\\"e-m:e-i64:64-i128:128-n32:64-S128\\\"\"\n         $+$ text \"target triple = \\\"aarch64-unknown-linux-gnu\\\"\"\n+    Platform { platformArch = ArchARM64, platformOS = OSAndroid } ->\n+        text \"target datalayout = \\\"e-m:e-i64:64-i128:128-n32:64-S128\\\"\"\n+        $+$ text \"target triple = \\\"aarch64-unknown-linux-android\\\"\"\n     _ ->\n         if platformIsCrossCompiling platform\n             then panic \"LlvmCodeGen.Ppr: Cross compiling without valid target info.\"\n"
  },
  {
    "path": "disabled-packages/ghc/compiler-main-DriverPipeline.hs.patch",
    "content": "diff -u -r ../ghc-8.0.1/compiler/main/DriverPipeline.hs ./compiler/main/DriverPipeline.hs\n--- ../ghc-8.0.1/compiler/main/DriverPipeline.hs\t2016-05-16 13:08:53.000000000 -0400\n+++ ./compiler/main/DriverPipeline.hs\t2016-09-07 03:37:48.321941122 -0400\n@@ -1831,10 +1831,7 @@\n          | WayThreaded `elem` ways dflags =\n             let os = platformOS (targetPlatform dflags)\n             in if os == OSOsf3 then [\"-lpthread\", \"-lexc\"]\n-               else if os `elem` [OSMinGW32, OSFreeBSD, OSOpenBSD,\n-                                  OSNetBSD, OSHaiku, OSQNXNTO, OSiOS, OSDarwin]\n-               then []\n-               else [\"-lpthread\"]\n+               else []\n          | otherwise               = []\n \n     rc_objs <- maybeCreateManifest dflags output_fn\n"
  },
  {
    "path": "disabled-packages/ghc/configure.patch",
    "content": "diff -u -r ../ghc-8.0.1/configure ./configure\n--- ../ghc-8.0.1/configure\t2016-05-17 12:36:51.000000000 -0400\n+++ ./configure\t2016-06-23 16:46:28.690875698 -0400\n@@ -7126,7 +7126,7 @@\n # tools we are looking for. In the past, GHC supported a number of\n # versions of LLVM simultaneously, but that stopped working around\n # 3.5/3.6 release of LLVM.\n-LlvmVersion=3.7\n+LlvmVersion=3.9\n \n sUPPORTED_LLVM_VERSION=$(echo \\($LlvmVersion\\) | sed 's/\\./,/')\n \n"
  },
  {
    "path": "disabled-packages/groff/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.gnu.org/software/groff/\nTERMUX_PKG_DESCRIPTION=\"GNU troff text-formatting program\"\nTERMUX_PKG_VERSION=1.22.3\nTERMUX_PKG_SRCURL=http://ftp.gnu.org/gnu/groff/groff-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-doc=no --without-gs --without-x\"\n"
  },
  {
    "path": "disabled-packages/gst-libav/build.sh",
    "content": "# NOTE: Disabled due to not being ffmpeg 4 compatible.\nTERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"GStreamer libav/ffmpeg wrapper\"\nTERMUX_PKG_VERSION=1.14.1\nTERMUX_PKG_SHA256=eff80a02d2f2fb9f34b67e9a26e9954d3218c7aa18e863f2a47805fa7066029d\nTERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"gst-plugins-base,ffmpeg\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-android_media\n--disable-examples\n--disable-tests\n--with-system-libav\n\"\n"
  },
  {
    "path": "disabled-packages/gst123/build.sh",
    "content": "# Broken - requires gtk\nTERMUX_PKG_HOMEPAGE=http://space.twc.de/~stefan/gst123.php\nTERMUX_PKG_DESCRIPTION=\"GStreamer based command line media player\"\nTERMUX_PKG_VERSION=0.3.4\nTERMUX_PKG_SRCURL=http://space.twc.de/~stefan/gst123/gst123-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"gst-plugins-bad, ncurses\"\n"
  },
  {
    "path": "disabled-packages/guile/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.gnu.org/software/guile/\nTERMUX_PKG_DESCRIPTION=\"GNU extension language and Scheme interpreter\"\nTERMUX_PKG_VERSION=2.0.11\nTERMUX_PKG_SRCURL=ftp://ftp.gnu.org/gnu/guile/guile-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libgmp, libunistring, libffi, libgc\"\n"
  },
  {
    "path": "disabled-packages/javac/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html\nTERMUX_PKG_DESCRIPTION=\"Java programming language compiler from (openjdk)\"\nTERMUX_PKG_VERSION=8u45\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_extract_package() {\n\tmkdir $TERMUX_PKG_SRCDIR\n}\n\ntermux_step_make() {\n\tRAW_JAR=/usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar\n\n\tmkdir -p $TERMUX_PREFIX/share/dex\n\t$TERMUX_DX \\\n\t\t--dex \\\n\t\t--output=$TERMUX_PREFIX/share/dex/tools.jar \\\n\t\t$RAW_JAR\n\n\tinstall $TERMUX_PKG_BUILDER_DIR/javac $TERMUX_PREFIX/bin/javac\n\tperl -p -i -e \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PREFIX/bin/javac\n}\n"
  },
  {
    "path": "disabled-packages/javac/javac",
    "content": "#!/system/bin/sh\n\n# There needs to be a folder at $ANDROID_DATA/dalvik-cache\nexport ANDROID_DATA=@TERMUX_PREFIX@/var/android/\nmkdir -p $ANDROID_DATA/dalvik-cache\n\njarpath=@TERMUX_PREFIX@/share/dex/tools.jar\n# -proc:none to disable annotation processing/compiling\n# -7 for java 1.7 compatibility\ndalvikvm -Xmx256m -cp $jarpath com.sun.tools.javac.Main -proc:none -7 -cp @TERMUX_PREFIX@/share/java/android.jar $@\n"
  },
  {
    "path": "disabled-packages/libfakechroot/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/dex4er/fakechroot/wiki\nTERMUX_PKG_DESCRIPTION=\"Library for creating fake chroots\"\nTERMUX_PKG_VERSION=2.17.2\nTERMUX_PKG_SRCURL=https://github.com/dex4er/fakechroot/archive/${TERMUX_PKG_VERSION}.tar.gz\n"
  },
  {
    "path": "disabled-packages/libffi-updated/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceware.org/libffi/\nTERMUX_PKG_DESCRIPTION=\"Library providing a portable, high level programming interface to various calling conventions\"\nlocal _COMMIT=716bfd83177689e2244c4707bd513003cff92c68\nlocal _DATE=20171105\nTERMUX_PKG_VERSION=3.2.1.$_DATE\nTERMUX_PKG_SHA256=454577ab2d046dbdf5697f71598247fb8d8bf2d378817d5d5b8bc5dceaf822ac\nTERMUX_PKG_SRCURL=https://github.com/libffi/libffi/archive/${_COMMIT}.zip\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-multi-os-directory --enable-symvers=no\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/libffi-${TERMUX_PKG_VERSION}/include\"\n\ntermux_step_pre_configure() {\n\tcd $TERMUX_PKG_SRCDIR\n\t./autogen.sh\n}\n"
  },
  {
    "path": "disabled-packages/libjemalloc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.canonware.com/jemalloc/\nTERMUX_PKG_DESCRIPTION=\"General-purpose scalable concurrent malloc(3) implementation\"\nTERMUX_PKG_VERSION=4.0.0\nTERMUX_PKG_SRCURL=https://github.com/jemalloc/jemalloc/releases/download/${TERMUX_PKG_VERSION}/jemalloc-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_BUILD_IN_SRC=true\n\nCPPFLAGS+=\" -D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1\"\n"
  },
  {
    "path": "disabled-packages/libressl/build.sh",
    "content": "# Status: Termux currently uses openssl. Transitioning to libressl\n#\t  is tempting, but on hold for now to see how widespread\n#\t  the adoption of libressl in Linux distributions is.\nTERMUX_PKG_HOMEPAGE=http://www.libressl.org/\nTERMUX_PKG_DESCRIPTION=\"Library implementing the TLS protocol as well as general purpose cryptography functions\"\nTERMUX_PKG_DEPENDS=\"ca-certificates\"\nTERMUX_PKG_VERSION=2.5.5\nTERMUX_PKG_SHA256=e57f5e3d5842a81fe9351b6e817fcaf0a749ca4ef35a91465edba9e071dce7c4\nTERMUX_PKG_SRCURL=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-openssldir=$TERMUX_PREFIX/etc/tls\"\nTERMUX_PKG_CONFLICTS=\"openssl\"\n# etc/tls/cert.pem is provided by ca-certificates:\nTERMUX_PKG_RM_AFTER_INSTALL=\"etc/tls/cert.pem\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -DNO_SYSLOG\"\n}\n"
  },
  {
    "path": "disabled-packages/lrzsz/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ohse.de/uwe/software/lrzsz.html\nTERMUX_PKG_DESCRIPTION=\"Tools for zmodem/xmodem/ymodem file transfer\"\nTERMUX_PKG_VERSION=0.12.20\nTERMUX_PKG_SRCURL=https://ohse.de/uwe/releases/lrzsz-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-syslog --mandir=$TERMUX_PREFIX/share/man\"\n"
  },
  {
    "path": "disabled-packages/lrzsz/src-Makefile.in.patch",
    "content": "Hard links are not supported on Android 6.0+\n\ndiff -u -r ../lrzsz-0.12.20/src/Makefile.in ./src/Makefile.in\n--- ../lrzsz-0.12.20/src/Makefile.in\t1998-12-30 17:31:46.000000000 +0100\n+++ ./src/Makefile.in\t2017-01-25 01:17:46.135033894 +0100\n@@ -370,16 +370,16 @@\n \n install-exec-local:\n \trm -f $(DESTDIR)/$(bindir)/`echo lsb | sed -e '$(transform)'`\n-\tln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \\\n+\tln -s $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \\\n \t\t$(DESTDIR)/$(bindir)/`echo lsb |sed -e '$(transform)'` \n \trm -f $(bindir)/`echo lsx | sed -e '$(transform)'`\n-\tln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \\\n+\tln -s $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \\\n \t\t$(DESTDIR)/$(bindir)/`echo lsx |sed -e '$(transform)'` \n \trm -f $(bindir)/`echo lrb | sed -e '$(transform)'`\n-\tln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \\\n+\tln -s $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \\\n \t\t$(DESTDIR)/$(bindir)/`echo lrb |sed -e '$(transform)'` \n \trm -f $(bindir)/`echo lrx | sed -e '$(transform)'`\n-\tln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \\\n+\tln -s $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \\\n \t\t$(DESTDIR)/$(bindir)/`echo lrx |sed -e '$(transform)'` \n #\trm -f $(bindir)/`echo lrzszbug | sed -e '$(transform)'`\n #\tln $(bindir)/`echo lrzszbug |sed -e '$(transform)'` \\\n"
  },
  {
    "path": "disabled-packages/man-db/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.nongnu.org/man-db/\nTERMUX_PKG_DESCRIPTION=\"Utilities for examining on-line help files (manual pages)\"\nTERMUX_PKG_VERSION=2.7.5\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://mirror.csclub.uwaterloo.ca/nongnu/man-db/man-db-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_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\"\nTERMUX_PKG_DEPENDS=\"flex, gdbm, groff, less, libandroid-support, libpipeline, lynx\"\n\nexport 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\"\n"
  },
  {
    "path": "disabled-packages/mono/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.mono-project.com/\nTERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas'\n_MONO_VERSION=5.0.0\n_MONO_PATCH=100\nTERMUX_PKG_VERSION=$_MONO_VERSION.$_MONO_PATCH\n# official package is missing support/libm/math_private.h\n#TERMUX_PKG_SRCURL=https://github.com/mono/mono/archive/mono-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SRCURL=https://download.mono-project.com/sources/mono/mono-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=368da3ff9f42592920cd8cf6fa15c6c16558e967144c4d3df873352e5d2bb6df\nTERMUX_PKG_FOLDERNAME=mono-$_MONO_VERSION\n#TERMUX_PKG_EXTRA_CONFIGURE_ARGS='--disable-mcs-build --disable-boehm --with-sigaltstack=no'\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\"--disable-btls --disable-dynamic-btls\" #--with-btls-android-ndk=$ANDROID_NDK\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n#\texport CFLAGS=\"$CFLAGS -mthumb\"\n\tcd \"$TERMUX_PKG_SRCDIR\"\n#\tNOCONFIGURE=1 ./autogen.sh\n#\tcp $TERMUX_PKG_BUILDER_DIR/{complex,math_private}.h $TERMUX_PKG_SRCDIR/support/libm/\n\texport ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN\n}\n\n"
  },
  {
    "path": "disabled-packages/mono/complex.h",
    "content": "/*-\n * Copyright (c) 2001-2011 The FreeBSD Project.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $FreeBSD$\n */\n\n#ifndef _COMPLEX_H\n#define\t_COMPLEX_H\n\n#include <sys/cdefs.h>\n\n#ifdef __GNUC__\n#if __STDC_VERSION__ < 199901\n#define\t_Complex\t__complex__\n#endif\n#define\t_Complex_I\t((float _Complex)1.0i)\n#endif\n\n#ifdef __generic\n_Static_assert(__generic(_Complex_I, float _Complex, 1, 0),\n    \"_Complex_I must be of type float _Complex\");\n#endif\n\n#define\tcomplex\t\t_Complex\n#define\tI\t\t_Complex_I\n\n#if __ISO_C_VISIBLE >= 2011\n#ifdef __clang__\n#define\tCMPLX(x, y)\t((double complex){ x, y })\n#define\tCMPLXF(x, y)\t((float complex){ x, y })\n#define\tCMPLXL(x, y)\t((long double complex){ x, y })\n#elif __GNUC_PREREQ__(4, 7)\n#define\tCMPLX(x, y)\t__builtin_complex((double)(x), (double)(y))\n#define\tCMPLXF(x, y)\t__builtin_complex((float)(x), (float)(y))\n#define\tCMPLXL(x, y)\t__builtin_complex((long double)(x), (long double)(y))\n#endif\n#endif /* __ISO_C_VISIBLE >= 2011 */\n\n__BEGIN_DECLS\n#pragma GCC visibility push(default)\n\ndouble\t\tcabs(double complex);\nfloat\t\tcabsf(float complex);\nlong double\tcabsl(long double complex);\ndouble complex\tcacos(double complex);\nfloat complex\tcacosf(float complex);\ndouble complex\tcacosh(double complex);\nfloat complex\tcacoshf(float complex);\ndouble\t\tcarg(double complex);\nfloat\t\tcargf(float complex);\nlong double\tcargl(long double complex);\ndouble complex\tcasin(double complex);\nfloat complex\tcasinf(float complex);\ndouble complex\tcasinh(double complex);\nfloat complex\tcasinhf(float complex);\ndouble complex\tcatan(double complex);\nfloat complex\tcatanf(float complex);\ndouble complex\tcatanh(double complex);\nfloat complex\tcatanhf(float complex);\ndouble complex\tccos(double complex);\nfloat complex\tccosf(float complex);\ndouble complex\tccosh(double complex);\nfloat complex\tccoshf(float complex);\ndouble complex\tcexp(double complex);\nfloat complex\tcexpf(float complex);\ndouble\t\tcimag(double complex) __pure2;\nfloat\t\tcimagf(float complex) __pure2;\nlong double\tcimagl(long double complex) __pure2;\ndouble complex\tconj(double complex) __pure2;\nfloat complex\tconjf(float complex) __pure2;\nlong double complex\n\t\tconjl(long double complex) __pure2;\nfloat complex\tcprojf(float complex) __pure2;\ndouble complex\tcproj(double complex) __pure2;\nlong double complex\n\t\tcprojl(long double complex) __pure2;\ndouble\t\tcreal(double complex) __pure2;\nfloat\t\tcrealf(float complex) __pure2;\nlong double\tcreall(long double complex) __pure2;\ndouble complex\tcsin(double complex);\nfloat complex\tcsinf(float complex);\ndouble complex\tcsinh(double complex);\nfloat complex\tcsinhf(float complex);\ndouble complex\tcsqrt(double complex);\nfloat complex\tcsqrtf(float complex);\nlong double complex\n\t\tcsqrtl(long double complex);\ndouble complex\tctan(double complex);\nfloat complex\tctanf(float complex);\ndouble complex\tctanh(double complex);\nfloat complex\tctanhf(float complex);\n\n#pragma GCC visibility pop\n__END_DECLS\n\n#endif /* _COMPLEX_H */"
  },
  {
    "path": "disabled-packages/mono/math_private.h",
    "content": "/*\n * ====================================================\n * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\n *\n * Developed at SunPro, a Sun Microsystems, Inc. business.\n * Permission to use, copy, modify, and distribute this\n * software is freely granted, provided that this notice\n * is preserved.\n * ====================================================\n */\n\n/*\n * from: @(#)fdlibm.h 5.1 93/09/24\n * $FreeBSD$\n */\n\n#ifndef _MATH_PRIVATE_H_\n#define\t_MATH_PRIVATE_H_\n\n#include <sys/types.h>\n#include <machine/endian.h>\n\n/*\n * The original fdlibm code used statements like:\n *\tn0 = ((*(int*)&one)>>29)^1;\t\t* index of high word *\n *\tix0 = *(n0+(int*)&x);\t\t\t* high word of x *\n *\tix1 = *((1-n0)+(int*)&x);\t\t* low word of x *\n * to dig two 32 bit words out of the 64 bit IEEE floating point\n * value.  That is non-ANSI, and, moreover, the gcc instruction\n * scheduler gets it wrong.  We instead use the following macros.\n * Unlike the original code, we determine the endianness at compile\n * time, not at run time; I don't see much benefit to selecting\n * endianness at run time.\n */\n\n/*\n * A union which permits us to convert between a double and two 32 bit\n * ints.\n */\n\n#ifdef __arm__\n#if defined(__VFP_FP__) || defined(__ARM_EABI__)\n#define\tIEEE_WORD_ORDER\tBYTE_ORDER\n#else\n#define\tIEEE_WORD_ORDER\tBIG_ENDIAN\n#endif\n#else /* __arm__ */\n#define\tIEEE_WORD_ORDER\tBYTE_ORDER\n#endif\n\n#if IEEE_WORD_ORDER == BIG_ENDIAN\n\ntypedef union\n{\n  double value;\n  struct\n  {\n    u_int32_t msw;\n    u_int32_t lsw;\n  } parts;\n  struct\n  {\n    u_int64_t w;\n  } xparts;\n} ieee_double_shape_type;\n\n#endif\n\n#if IEEE_WORD_ORDER == LITTLE_ENDIAN\n\ntypedef union\n{\n  double value;\n  struct\n  {\n    u_int32_t lsw;\n    u_int32_t msw;\n  } parts;\n  struct\n  {\n    u_int64_t w;\n  } xparts;\n} ieee_double_shape_type;\n\n#endif\n\n/* Get two 32 bit ints from a double.  */\n\n#define EXTRACT_WORDS(ix0,ix1,d)\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type ew_u;\t\t\t\t\t\\\n  ew_u.value = (d);\t\t\t\t\t\t\\\n  (ix0) = ew_u.parts.msw;\t\t\t\t\t\\\n  (ix1) = ew_u.parts.lsw;\t\t\t\t\t\\\n} while (0)\n\n/* Get a 64-bit int from a double. */\n#define EXTRACT_WORD64(ix,d)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type ew_u;\t\t\t\t\t\\\n  ew_u.value = (d);\t\t\t\t\t\t\\\n  (ix) = ew_u.xparts.w;\t\t\t\t\t\t\\\n} while (0)\n\n/* Get the more significant 32 bit int from a double.  */\n\n#define GET_HIGH_WORD(i,d)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type gh_u;\t\t\t\t\t\\\n  gh_u.value = (d);\t\t\t\t\t\t\\\n  (i) = gh_u.parts.msw;\t\t\t\t\t\t\\\n} while (0)\n\n/* Get the less significant 32 bit int from a double.  */\n\n#define GET_LOW_WORD(i,d)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type gl_u;\t\t\t\t\t\\\n  gl_u.value = (d);\t\t\t\t\t\t\\\n  (i) = gl_u.parts.lsw;\t\t\t\t\t\t\\\n} while (0)\n\n/* Set a double from two 32 bit ints.  */\n\n#define INSERT_WORDS(d,ix0,ix1)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type iw_u;\t\t\t\t\t\\\n  iw_u.parts.msw = (ix0);\t\t\t\t\t\\\n  iw_u.parts.lsw = (ix1);\t\t\t\t\t\\\n  (d) = iw_u.value;\t\t\t\t\t\t\\\n} while (0)\n\n/* Set a double from a 64-bit int. */\n#define INSERT_WORD64(d,ix)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type iw_u;\t\t\t\t\t\\\n  iw_u.xparts.w = (ix);\t\t\t\t\t\t\\\n  (d) = iw_u.value;\t\t\t\t\t\t\\\n} while (0)\n\n/* Set the more significant 32 bits of a double from an int.  */\n\n#define SET_HIGH_WORD(d,v)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type sh_u;\t\t\t\t\t\\\n  sh_u.value = (d);\t\t\t\t\t\t\\\n  sh_u.parts.msw = (v);\t\t\t\t\t\t\\\n  (d) = sh_u.value;\t\t\t\t\t\t\\\n} while (0)\n\n/* Set the less significant 32 bits of a double from an int.  */\n\n#define SET_LOW_WORD(d,v)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_double_shape_type sl_u;\t\t\t\t\t\\\n  sl_u.value = (d);\t\t\t\t\t\t\\\n  sl_u.parts.lsw = (v);\t\t\t\t\t\t\\\n  (d) = sl_u.value;\t\t\t\t\t\t\\\n} while (0)\n\n/*\n * A union which permits us to convert between a float and a 32 bit\n * int.\n */\n\ntypedef union\n{\n  float value;\n  /* FIXME: Assumes 32 bit int.  */\n  unsigned int word;\n} ieee_float_shape_type;\n\n/* Get a 32 bit int from a float.  */\n\n#define GET_FLOAT_WORD(i,d)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_float_shape_type gf_u;\t\t\t\t\t\\\n  gf_u.value = (d);\t\t\t\t\t\t\\\n  (i) = gf_u.word;\t\t\t\t\t\t\\\n} while (0)\n\n/* Set a float from a 32 bit int.  */\n\n#define SET_FLOAT_WORD(d,i)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  ieee_float_shape_type sf_u;\t\t\t\t\t\\\n  sf_u.word = (i);\t\t\t\t\t\t\\\n  (d) = sf_u.value;\t\t\t\t\t\t\\\n} while (0)\n\n/*\n * Get expsign and mantissa as 16 bit and 64 bit ints from an 80 bit long\n * double.\n */\n\n#define\tEXTRACT_LDBL80_WORDS(ix0,ix1,d)\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  union IEEEl2bits ew_u;\t\t\t\t\t\\\n  ew_u.e = (d);\t\t\t\t\t\t\t\\\n  (ix0) = ew_u.xbits.expsign;\t\t\t\t\t\\\n  (ix1) = ew_u.xbits.man;\t\t\t\t\t\\\n} while (0)\n\n/*\n * Get expsign and mantissa as one 16 bit and two 64 bit ints from a 128 bit\n * long double.\n */\n\n#define\tEXTRACT_LDBL128_WORDS(ix0,ix1,ix2,d)\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  union IEEEl2bits ew_u;\t\t\t\t\t\\\n  ew_u.e = (d);\t\t\t\t\t\t\t\\\n  (ix0) = ew_u.xbits.expsign;\t\t\t\t\t\\\n  (ix1) = ew_u.xbits.manh;\t\t\t\t\t\\\n  (ix2) = ew_u.xbits.manl;\t\t\t\t\t\\\n} while (0)\n\n/* Get expsign as a 16 bit int from a long double.  */\n\n#define\tGET_LDBL_EXPSIGN(i,d)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  union IEEEl2bits ge_u;\t\t\t\t\t\\\n  ge_u.e = (d);\t\t\t\t\t\t\t\\\n  (i) = ge_u.xbits.expsign;\t\t\t\t\t\\\n} while (0)\n\n/*\n * Set an 80 bit long double from a 16 bit int expsign and a 64 bit int\n * mantissa.\n */\n\n#define\tINSERT_LDBL80_WORDS(d,ix0,ix1)\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  union IEEEl2bits iw_u;\t\t\t\t\t\\\n  iw_u.xbits.expsign = (ix0);\t\t\t\t\t\\\n  iw_u.xbits.man = (ix1);\t\t\t\t\t\\\n  (d) = iw_u.e;\t\t\t\t\t\t\t\\\n} while (0)\n\n/*\n * Set a 128 bit long double from a 16 bit int expsign and two 64 bit ints\n * comprising the mantissa.\n */\n\n#define\tINSERT_LDBL128_WORDS(d,ix0,ix1,ix2)\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  union IEEEl2bits iw_u;\t\t\t\t\t\\\n  iw_u.xbits.expsign = (ix0);\t\t\t\t\t\\\n  iw_u.xbits.manh = (ix1);\t\t\t\t\t\\\n  iw_u.xbits.manl = (ix2);\t\t\t\t\t\\\n  (d) = iw_u.e;\t\t\t\t\t\t\t\\\n} while (0)\n\n/* Set expsign of a long double from a 16 bit int.  */\n\n#define\tSET_LDBL_EXPSIGN(d,v)\t\t\t\t\t\\\ndo {\t\t\t\t\t\t\t\t\\\n  union IEEEl2bits se_u;\t\t\t\t\t\\\n  se_u.e = (d);\t\t\t\t\t\t\t\\\n  se_u.xbits.expsign = (v);\t\t\t\t\t\\\n  (d) = se_u.e;\t\t\t\t\t\t\t\\\n} while (0)\n\n#ifdef __i386__\n/* Long double constants are broken on i386. */\n#define\tLD80C(m, ex, v) {\t\t\t\t\t\t\\\n\t.xbits.man = __CONCAT(m, ULL),\t\t\t\t\t\\\n\t.xbits.expsign = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0),\t\\\n}\n#else\n/* The above works on non-i386 too, but we use this to check v. */\n#define\tLD80C(m, ex, v)\t{ .e = (v), }\n#endif\n\n#ifdef FLT_EVAL_METHOD\n/*\n * Attempt to get strict C99 semantics for assignment with non-C99 compilers.\n */\n#if FLT_EVAL_METHOD == 0 || __GNUC__ == 0\n#define\tSTRICT_ASSIGN(type, lval, rval)\t((lval) = (rval))\n#else\n#define\tSTRICT_ASSIGN(type, lval, rval) do {\t\\\n\tvolatile type __lval;\t\t\t\\\n\t\t\t\t\t\t\\\n\tif (sizeof(type) >= sizeof(long double))\t\\\n\t\t(lval) = (rval);\t\t\\\n\telse {\t\t\t\t\t\\\n\t\t__lval = (rval);\t\t\\\n\t\t(lval) = __lval;\t\t\\\n\t}\t\t\t\t\t\\\n} while (0)\n#endif\n#endif /* FLT_EVAL_METHOD */\n\n/* Support switching the mode to FP_PE if necessary. */\n#if defined(__i386__) && !defined(NO_FPSETPREC)\n#define\tENTERI()\t\t\t\t\\\n\tlong double __retval;\t\t\t\\\n\tfp_prec_t __oprec;\t\t\t\\\n\t\t\t\t\t\t\\\n\tif ((__oprec = fpgetprec()) != FP_PE)\t\\\n\t\tfpsetprec(FP_PE)\n#define\tRETURNI(x) do {\t\t\t\t\\\n\t__retval = (x);\t\t\t\t\\\n\tif (__oprec != FP_PE)\t\t\t\\\n\t\tfpsetprec(__oprec);\t\t\\\n\tRETURNF(__retval);\t\t\t\\\n} while (0)\n#else\n#define\tENTERI(x)\n#define\tRETURNI(x)\tRETURNF(x)\n#endif\n\n/* Default return statement if hack*_t() is not used. */\n#define      RETURNF(v)      return (v)\n\n/*\n * 2sum gives the same result as 2sumF without requiring |a| >= |b| or\n * a == 0, but is slower.\n */\n#define\t_2sum(a, b) do {\t\\\n\t__typeof(a) __s, __w;\t\\\n\t\t\t\t\\\n\t__w = (a) + (b);\t\\\n\t__s = __w - (a);\t\\\n\t(b) = ((a) - (__w - __s)) + ((b) - __s); \\\n\t(a) = __w;\t\t\\\n} while (0)\n\n/*\n * 2sumF algorithm.\n *\n * \"Normalize\" the terms in the infinite-precision expression a + b for\n * the sum of 2 floating point values so that b is as small as possible\n * relative to 'a'.  (The resulting 'a' is the value of the expression in\n * the same precision as 'a' and the resulting b is the rounding error.)\n * |a| must be >= |b| or 0, b's type must be no larger than 'a's type, and\n * exponent overflow or underflow must not occur.  This uses a Theorem of\n * Dekker (1971).  See Knuth (1981) 4.2.2 Theorem C.  The name \"TwoSum\"\n * is apparently due to Skewchuk (1997).\n *\n * For this to always work, assignment of a + b to 'a' must not retain any\n * extra precision in a + b.  This is required by C standards but broken\n * in many compilers.  The brokenness cannot be worked around using\n * STRICT_ASSIGN() like we do elsewhere, since the efficiency of this\n * algorithm would be destroyed by non-null strict assignments.  (The\n * compilers are correct to be broken -- the efficiency of all floating\n * point code calculations would be destroyed similarly if they forced the\n * conversions.)\n *\n * Fortunately, a case that works well can usually be arranged by building\n * any extra precision into the type of 'a' -- 'a' should have type float_t,\n * double_t or long double.  b's type should be no larger than 'a's type.\n * Callers should use these types with scopes as large as possible, to\n * reduce their own extra-precision and efficiciency problems.  In\n * particular, they shouldn't convert back and forth just to call here.\n */\n#ifdef DEBUG\n#define\t_2sumF(a, b) do {\t\t\t\t\\\n\t__typeof(a) __w;\t\t\t\t\\\n\tvolatile __typeof(a) __ia, __ib, __r, __vw;\t\\\n\t\t\t\t\t\t\t\\\n\t__ia = (a);\t\t\t\t\t\\\n\t__ib = (b);\t\t\t\t\t\\\n\tassert(__ia == 0 || fabsl(__ia) >= fabsl(__ib));\t\\\n\t\t\t\t\t\t\t\\\n\t__w = (a) + (b);\t\t\t\t\\\n\t(b) = ((a) - __w) + (b);\t\t\t\\\n\t(a) = __w;\t\t\t\t\t\\\n\t\t\t\t\t\t\t\\\n\t/* The next 2 assertions are weak if (a) is already long double. */ \\\n\tassert((long double)__ia + __ib == (long double)(a) + (b));\t\\\n\t__vw = __ia + __ib;\t\t\t\t\\\n\t__r = __ia - __vw;\t\t\t\t\\\n\t__r += __ib;\t\t\t\t\t\\\n\tassert(__vw == (a) && __r == (b));\t\t\\\n} while (0)\n#else /* !DEBUG */\n#define\t_2sumF(a, b) do {\t\\\n\t__typeof(a) __w;\t\\\n\t\t\t\t\\\n\t__w = (a) + (b);\t\\\n\t(b) = ((a) - __w) + (b); \\\n\t(a) = __w;\t\t\\\n} while (0)\n#endif /* DEBUG */\n\n/*\n * Set x += c, where x is represented in extra precision as a + b.\n * x must be sufficiently normalized and sufficiently larger than c,\n * and the result is then sufficiently normalized.\n *\n * The details of ordering are that |a| must be >= |c| (so that (a, c)\n * can be normalized without extra work to swap 'a' with c).  The details of\n * the normalization are that b must be small relative to the normalized 'a'.\n * Normalization of (a, c) makes the normalized c tiny relative to the\n * normalized a, so b remains small relative to 'a' in the result.  However,\n * b need not ever be tiny relative to 'a'.  For example, b might be about\n * 2**20 times smaller than 'a' to give about 20 extra bits of precision.\n * That is usually enough, and adding c (which by normalization is about\n * 2**53 times smaller than a) cannot change b significantly.  However,\n * cancellation of 'a' with c in normalization of (a, c) may reduce 'a'\n * significantly relative to b.  The caller must ensure that significant\n * cancellation doesn't occur, either by having c of the same sign as 'a',\n * or by having |c| a few percent smaller than |a|.  Pre-normalization of\n * (a, b) may help.\n *\n * This is is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2\n * exercise 19).  We gain considerable efficiency by requiring the terms to\n * be sufficiently normalized and sufficiently increasing.\n */\n#define\t_3sumF(a, b, c) do {\t\\\n\t__typeof(a) __tmp;\t\\\n\t\t\t\t\\\n\t__tmp = (c);\t\t\\\n\t_2sumF(__tmp, (a));\t\\\n\t(b) += (a);\t\t\\\n\t(a) = __tmp;\t\t\\\n} while (0)\n\n/*\n * Common routine to process the arguments to nan(), nanf(), and nanl().\n */\nvoid _scan_nan(uint32_t *__words, int __num_words, const char *__s);\n\n#ifdef _COMPLEX_H\n\n/*\n * C99 specifies that complex numbers have the same representation as\n * an array of two elements, where the first element is the real part\n * and the second element is the imaginary part.\n */\ntypedef union {\n\tfloat complex f;\n\tfloat a[2];\n} float_complex;\ntypedef union {\n\tdouble complex f;\n\tdouble a[2];\n} double_complex;\ntypedef union {\n\tlong double complex f;\n\tlong double a[2];\n} long_double_complex;\n#define\tREALPART(z)\t((z).a[0])\n#define\tIMAGPART(z)\t((z).a[1])\n\n/*\n * Inline functions that can be used to construct complex values.\n *\n * The C99 standard intends x+I*y to be used for this, but x+I*y is\n * currently unusable in general since gcc introduces many overflow,\n * underflow, sign and efficiency bugs by rewriting I*y as\n * (0.0+I)*(y+0.0*I) and laboriously computing the full complex product.\n * In particular, I*Inf is corrupted to NaN+I*Inf, and I*-0 is corrupted\n * to -0.0+I*0.0.\n */\nstatic __inline float complex\ncpackf(float x, float y)\n{\n\tfloat_complex z;\n\n\tREALPART(z) = x;\n\tIMAGPART(z) = y;\n\treturn (z.f);\n}\n\nstatic __inline double complex\ncpack(double x, double y)\n{\n\tdouble_complex z;\n\n\tREALPART(z) = x;\n\tIMAGPART(z) = y;\n\treturn (z.f);\n}\n\nstatic __inline long double complex\ncpackl(long double x, long double y)\n{\n\tlong_double_complex z;\n\n\tREALPART(z) = x;\n\tIMAGPART(z) = y;\n\treturn (z.f);\n}\n#endif /* _COMPLEX_H */\n \n#ifdef __GNUCLIKE_ASM\n\n/* Asm versions of some functions. */\n\n#ifdef __amd64__\nstatic __inline int\nirint(double x)\n{\n\tint n;\n\n\tasm(\"cvtsd2si %1,%0\" : \"=r\" (n) : \"x\" (x));\n\treturn (n);\n}\n#define\tHAVE_EFFICIENT_IRINT\n#endif\n\n#ifdef __i386__\nstatic __inline int\nirint(double x)\n{\n\tint n;\n\n\tasm(\"fistl %0\" : \"=m\" (n) : \"t\" (x));\n\treturn (n);\n}\n#define\tHAVE_EFFICIENT_IRINT\n#endif\n\n#if defined(__amd64__) || defined(__i386__)\nstatic __inline int\nirintl(long double x)\n{\n\tint n;\n\n\tasm(\"fistl %0\" : \"=m\" (n) : \"t\" (x));\n\treturn (n);\n}\n#define\tHAVE_EFFICIENT_IRINTL\n#endif\n\n#endif /* __GNUCLIKE_ASM */\n\n#ifdef DEBUG\n#if defined(__amd64__) || defined(__i386__)\n#define\tbreakpoint()\tasm(\"int $3\")\n#else\n#include <signal.h>\n\n#define\tbreakpoint()\traise(SIGTRAP)\n#endif\n#endif\n\n/* Write a pari script to test things externally. */\n#ifdef DOPRINT\n#include <stdio.h>\n\n#ifndef DOPRINT_SWIZZLE\n#define\tDOPRINT_SWIZZLE\t\t0\n#endif\n\n#ifdef DOPRINT_LD80\n\n#define\tDOPRINT_START(xp) do {\t\t\t\t\t\t\\\n\tuint64_t __lx;\t\t\t\t\t\t\t\\\n\tuint16_t __hx;\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\t/* Hack to give more-problematic args. */\t\t\t\\\n\tEXTRACT_LDBL80_WORDS(__hx, __lx, *xp);\t\t\t\t\\\n\t__lx ^= DOPRINT_SWIZZLE;\t\t\t\t\t\\\n\tINSERT_LDBL80_WORDS(*xp, __hx, __lx);\t\t\t\t\\\n\tprintf(\"x = %.21Lg; \", (long double)*xp);\t\t\t\\\n} while (0)\n#define\tDOPRINT_END1(v)\t\t\t\t\t\t\t\\\n\tprintf(\"y = %.21Lg; z = 0; show(x, y, z);\\n\", (long double)(v))\n#define\tDOPRINT_END2(hi, lo)\t\t\t\t\t\t\\\n\tprintf(\"y = %.21Lg; z = %.21Lg; show(x, y, z);\\n\",\t\t\\\n\t    (long double)(hi), (long double)(lo))\n\n#elif defined(DOPRINT_D64)\n\n#define\tDOPRINT_START(xp) do {\t\t\t\t\t\t\\\n\tuint32_t __hx, __lx;\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\tEXTRACT_WORDS(__hx, __lx, *xp);\t\t\t\t\t\\\n\t__lx ^= DOPRINT_SWIZZLE;\t\t\t\t\t\\\n\tINSERT_WORDS(*xp, __hx, __lx);\t\t\t\t\t\\\n\tprintf(\"x = %.21Lg; \", (long double)*xp);\t\t\t\\\n} while (0)\n#define\tDOPRINT_END1(v)\t\t\t\t\t\t\t\\\n\tprintf(\"y = %.21Lg; z = 0; show(x, y, z);\\n\", (long double)(v))\n#define\tDOPRINT_END2(hi, lo)\t\t\t\t\t\t\\\n\tprintf(\"y = %.21Lg; z = %.21Lg; show(x, y, z);\\n\",\t\t\\\n\t    (long double)(hi), (long double)(lo))\n\n#elif defined(DOPRINT_F32)\n\n#define\tDOPRINT_START(xp) do {\t\t\t\t\t\t\\\n\tuint32_t __hx;\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\tGET_FLOAT_WORD(__hx, *xp);\t\t\t\t\t\\\n\t__hx ^= DOPRINT_SWIZZLE;\t\t\t\t\t\\\n\tSET_FLOAT_WORD(*xp, __hx);\t\t\t\t\t\\\n\tprintf(\"x = %.21Lg; \", (long double)*xp);\t\t\t\\\n} while (0)\n#define\tDOPRINT_END1(v)\t\t\t\t\t\t\t\\\n\tprintf(\"y = %.21Lg; z = 0; show(x, y, z);\\n\", (long double)(v))\n#define\tDOPRINT_END2(hi, lo)\t\t\t\t\t\t\\\n\tprintf(\"y = %.21Lg; z = %.21Lg; show(x, y, z);\\n\",\t\t\\\n\t    (long double)(hi), (long double)(lo))\n\n#else /* !DOPRINT_LD80 && !DOPRINT_D64 (LD128 only) */\n\n#ifndef DOPRINT_SWIZZLE_HIGH\n#define\tDOPRINT_SWIZZLE_HIGH\t0\n#endif\n\n#define\tDOPRINT_START(xp) do {\t\t\t\t\t\t\\\n\tuint64_t __lx, __llx;\t\t\t\t\t\t\\\n\tuint16_t __hx;\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\t\t\t\\\n\tEXTRACT_LDBL128_WORDS(__hx, __lx, __llx, *xp);\t\t\t\\\n\t__llx ^= DOPRINT_SWIZZLE;\t\t\t\t\t\\\n\t__lx ^= DOPRINT_SWIZZLE_HIGH;\t\t\t\t\t\\\n\tINSERT_LDBL128_WORDS(*xp, __hx, __lx, __llx);\t\t\t\\\n\tprintf(\"x = %.36Lg; \", (long double)*xp);\t\t\t\t\t\\\n} while (0)\n#define\tDOPRINT_END1(v)\t\t\t\t\t\t\t\\\n\tprintf(\"y = %.36Lg; z = 0; show(x, y, z);\\n\", (long double)(v))\n#define\tDOPRINT_END2(hi, lo)\t\t\t\t\t\t\\\n\tprintf(\"y = %.36Lg; z = %.36Lg; show(x, y, z);\\n\",\t\t\\\n\t    (long double)(hi), (long double)(lo))\n\n#endif /* DOPRINT_LD80 */\n\n#else /* !DOPRINT */\n#define\tDOPRINT_START(xp)\n#define\tDOPRINT_END1(v)\n#define\tDOPRINT_END2(hi, lo)\n#endif /* DOPRINT */\n\n#define\tRETURNP(x) do {\t\t\t\\\n\tDOPRINT_END1(x);\t\t\\\n\tRETURNF(x);\t\t\t\\\n} while (0)\n#define\tRETURNPI(x) do {\t\t\\\n\tDOPRINT_END1(x);\t\t\\\n\tRETURNI(x);\t\t\t\\\n} while (0)\n#define\tRETURN2P(x, y) do {\t\t\\\n\tDOPRINT_END2((x), (y));\t\t\\\n\tRETURNF((x) + (y));\t\t\\\n} while (0)\n#define\tRETURN2PI(x, y) do {\t\t\\\n\tDOPRINT_END2((x), (y));\t\t\\\n\tRETURNI((x) + (y));\t\t\\\n} while (0)\n#ifdef STRUCT_RETURN\n#define\tRETURNSP(rp) do {\t\t\\\n\tif (!(rp)->lo_set)\t\t\\\n\t\tRETURNP((rp)->hi);\t\\\n\tRETURN2P((rp)->hi, (rp)->lo);\t\\\n} while (0)\n#define\tRETURNSPI(rp) do {\t\t\\\n\tif (!(rp)->lo_set)\t\t\\\n\t\tRETURNPI((rp)->hi);\t\\\n\tRETURN2PI((rp)->hi, (rp)->lo);\t\\\n} while (0)\n#endif\n#define\tSUM2P(x, y) ({\t\t\t\\\n\tconst __typeof (x) __x = (x);\t\\\n\tconst __typeof (y) __y = (y);\t\\\n\t\t\t\t\t\\\n\tDOPRINT_END2(__x, __y);\t\t\\\n\t__x + __y;\t\t\t\\\n})\n\n/*\n * ieee style elementary functions\n *\n * We rename functions here to improve other sources' diffability\n * against fdlibm.\n */\n#define\t__ieee754_sqrt\tsqrt\n#define\t__ieee754_acos\tacos\n#define\t__ieee754_acosh\tacosh\n#define\t__ieee754_log\tlog\n#define\t__ieee754_log2\tlog2\n#define\t__ieee754_atanh\tatanh\n#define\t__ieee754_asin\tasin\n#define\t__ieee754_atan2\tatan2\n#define\t__ieee754_exp\texp\n#define\t__ieee754_cosh\tcosh\n#define\t__ieee754_fmod\tfmod\n#define\t__ieee754_pow\tpow\n#define\t__ieee754_lgamma lgamma\n#define\t__ieee754_gamma\tgamma\n#define\t__ieee754_lgamma_r lgamma_r\n#define\t__ieee754_gamma_r gamma_r\n#define\t__ieee754_log10\tlog10\n#define\t__ieee754_sinh\tsinh\n#define\t__ieee754_hypot\thypot\n#define\t__ieee754_j0\tj0\n#define\t__ieee754_j1\tj1\n#define\t__ieee754_y0\ty0\n#define\t__ieee754_y1\ty1\n#define\t__ieee754_jn\tjn\n#define\t__ieee754_yn\tyn\n#define\t__ieee754_remainder remainder\n#define\t__ieee754_scalb\tscalb\n#define\t__ieee754_sqrtf\tsqrtf\n#define\t__ieee754_acosf\tacosf\n#define\t__ieee754_acoshf acoshf\n#define\t__ieee754_logf\tlogf\n#define\t__ieee754_atanhf atanhf\n#define\t__ieee754_asinf\tasinf\n#define\t__ieee754_atan2f atan2f\n#define\t__ieee754_expf\texpf\n#define\t__ieee754_coshf\tcoshf\n#define\t__ieee754_fmodf\tfmodf\n#define\t__ieee754_powf\tpowf\n#define\t__ieee754_lgammaf lgammaf\n#define\t__ieee754_gammaf gammaf\n#define\t__ieee754_lgammaf_r lgammaf_r\n#define\t__ieee754_gammaf_r gammaf_r\n#define\t__ieee754_log10f log10f\n#define\t__ieee754_log2f log2f\n#define\t__ieee754_sinhf\tsinhf\n#define\t__ieee754_hypotf hypotf\n#define\t__ieee754_j0f\tj0f\n#define\t__ieee754_j1f\tj1f\n#define\t__ieee754_y0f\ty0f\n#define\t__ieee754_y1f\ty1f\n#define\t__ieee754_jnf\tjnf\n#define\t__ieee754_ynf\tynf\n#define\t__ieee754_remainderf remainderf\n#define\t__ieee754_scalbf scalbf\n\n/* fdlibm kernel function */\nint\t__kernel_rem_pio2(double*,double*,int,int,int);\n\n/* double precision kernel functions */\n#ifndef INLINE_REM_PIO2\nint\t__ieee754_rem_pio2(double,double*);\n#endif\ndouble\t__kernel_sin(double,double,int);\ndouble\t__kernel_cos(double,double);\ndouble\t__kernel_tan(double,double,int);\ndouble\t__ldexp_exp(double,int);\n#ifdef _COMPLEX_H\ndouble complex __ldexp_cexp(double complex,int);\n#endif\n\n/* float precision kernel functions */\n#ifndef INLINE_REM_PIO2F\nint\t__ieee754_rem_pio2f(float,double*);\n#endif\n#ifndef INLINE_KERNEL_SINDF\nfloat\t__kernel_sindf(double);\n#endif\n#ifndef INLINE_KERNEL_COSDF\nfloat\t__kernel_cosdf(double);\n#endif\n#ifndef INLINE_KERNEL_TANDF\nfloat\t__kernel_tandf(double,int);\n#endif\nfloat\t__ldexp_expf(float,int);\n#ifdef _COMPLEX_H\nfloat complex __ldexp_cexpf(float complex,int);\n#endif\n\n/* long double precision kernel functions */\nlong double __kernel_sinl(long double, long double, int);\nlong double __kernel_cosl(long double, long double);\nlong double __kernel_tanl(long double, long double, int);\n\n#endif /* !_MATH_PRIVATE_H_ */"
  },
  {
    "path": "disabled-packages/mono/tkill.patch",
    "content": "--- ./libgc/pthread_stop_world.c\t2017-01-03 15:49:34.000000000 +0530\n+++ ../pthread_stop_world.c\t2017-01-05 18:54:28.314868754 +0530\n@@ -379,11 +379,7 @@\n \t      GC_printf1(\"Sending suspend signal to 0x%lx\\n\", p -> id);\n \t    #endif\n \n-#ifndef PLATFORM_ANDROID\n         result = pthread_kill(p -> id, SIG_SUSPEND);\n-#else\n-        result = android_thread_kill(p -> kernel_id, SIG_SUSPEND);\n-#endif\n \t    switch(result) {\n                 case ESRCH:\n                     /* Not really there anymore.  Possible? */\n--- ./mono/utils/mono-threads-posix.c\t2017-01-03 15:49:38.000000000 +0530\n+++ ../mono-threads-posix.c\t2017-01-05 18:57:48.313245586 +0530\n@@ -21,10 +21,6 @@\n \n #include <errno.h>\n \n-#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)\n-#define USE_TKILL_ON_ANDROID 1\n-#endif\n-\n #ifdef USE_TKILL_ON_ANDROID\n extern int tkill (pid_t tid, int signal);\n #endif\n"
  },
  {
    "path": "disabled-packages/ocaml/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ocaml.org\nTERMUX_PKG_DESCRIPTION=\"Programming language supporting functional, imperative and object-oriented styles\"\nTERMUX_PKG_VERSION=4.02.3\nTERMUX_PKG_SRCURL=http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.3.tar.xz\nTERMUX_PKG_DEPENDS=\"pcre, openssl, libuuid\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\t./configure -prefix $TERMUX_PREFIX -mandir $TERMUX_PREFIX/share/man/man1 -cc \"$CC $CFLAGS $CPPFLAGS $LDFLAGS\" \\\n\t\t-host $TERMUX_HOST_PLATFORM\n}\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://openjdk.java.net\nTERMUX_PKG_DESCRIPTION=\"OpenJDK 9 Java Runtime Environment (prerelease)\"\n_jbuild=181\n_hg_tag=\"jdk-9+${_jbuild}\"\n_jvm_dir=\"lib/jvm/openjdk-9\"\nTERMUX_PKG_VERSION=\"9.2017.8.20\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_HOMEPAGE=http://openjdk.java.net/projects/jdk9\nTERMUX_PKG_DEPENDS=\"freetype, libpng, ca-certificates-java\"\nTERMUX_PKG_CONFFILES=\"$_jvm_dir/lib/jvm.cfg\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-aot\n--disable-hotspot-gtest\n--disable-option-checking\n--disable-warnings-as-errors\n--enable-headless-only\n--with-freetype=$TERMUX_PREFIX\n--with-libpng=system\n--with-zlib=system\n--with-jdk-variant=normal\n--with-jvm-variants=server\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"$_jvm_dir/demo $_jvm_dir/sample\"\n_cups_ver=2.2.4\n\nchangesets=('e5455438db96'\n\t'5666eba44ac6'\n\t'8076a7391ba0'\n\t'17bb8a98d5e3'\n\t'a1d64f45f9d5'\n\t'364631d8ff2e'\n\t'65bfdabaab9c'\n\t'17cc754c8936')\n\nsha256sums=('c759faa5bff4b3d7bcf87dce57e9d1a39600ef67ec68f96d6d12d07b1bf773ce'\n\t'34518bf8b27aa893f834f8f81293ac0e04a210ee4f2e11bb2c89331f87912d96'\n\t'3b649e34e2a1c8758c6311931d201a38432088ccb86a720afb1cb99fe193537f'\n\t'bb330b8b516178304dc11c755994db20eccc696ae5c2a16b04a4a67b20b33b79'\n\t'a213ebc4bf896c55855761891932a19f42ad5276d3fd155cfb604b27f4866d9d'\n\t'0bc1953e9f23d59dafc415a7a37ff2da23cf8782e0532e253a6d7d63aa0ea954'\n\t'739a5d275db4a2a81cf3c3ca17a78212b8c47092e5c10888b79e9599dd9dcc2d'\n\t'fbc9b49a7f0fa1723e369d91068d51a11de40e931f281a3ed9650484b437cc7f'\n\t'596d4db72651c335469ae5f37b0da72ac9f97d73e30838d787065f559dea98cc')\n\nreponames=(dev corba hotspot jdk jaxws jaxp langtools nashorn cups)\n\n_url_src=http://hg.openjdk.java.net/mobile/dev\n\nTERMUX_PKG_SRCURL=$_url_src/archive/${changesets[0]}.tar.bz2\nTERMUX_PKG_SHA256=${sha256sums[0]}\n\ntermux_step_post_extract_package() {\n\tcd \"$TERMUX_PKG_TMPDIR\"\n\t# download and extract repo archives\n\tfor index in {1..7}; do\n\t\tlocal sum=${sha256sums[index]}\n\t\tlocal repo=${reponames[index]}\n\t\tlocal change=${changesets[index]}\n\t\tlocal file=$TERMUX_PKG_CACHEDIR/$repo-$change.tar.bz2\n\t\tlocal url=${_url_src}/$repo/archive/$change.tar.bz2\n\n\t\ttermux_download $url $file $sum\n\t\ttar xf $file -C $TERMUX_PKG_SRCDIR\n\t\tmv $TERMUX_PKG_SRCDIR/$repo-$change $TERMUX_PKG_SRCDIR/$repo\n\tdone\n\n\t# setup cups source dir\n\tfile=$TERMUX_PKG_CACHEDIR/cups-$_cups_ver-source.tar.gz\n\turl=\"https://github.com/apple/cups/releases/download/v$_cups_ver/$(basename $file)\"\n\ttermux_download $url $file ${sha256sums[8]}\n\ttar xf $file -C $TERMUX_PKG_SRCDIR\n}\n\n# override this step to since openjdk provides its own customized guess scripts\ntermux_step_replace_guess_scripts() {\n\treturn\n}\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --with-cups-include=$TERMUX_PKG_SRCDIR/cups-$_cups_ver\"\n\n\tln -sf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/libc.so $TERMUX_PKG_TMPDIR/libpthread.so\n\n\tcat > \"$TERMUX_STANDALONE_TOOLCHAIN/devkit.info\" <<HERE\nDEVKIT_NAME=\"Android ${TERMUX_ARCH^^}\"\nDEVKIT_TOOLCHAIN_PATH=\"\\$DEVKIT_ROOT/$TERMUX_HOST_PLATFORM/bin\"\nDEVKIT_SYSROOT=\"\\$DEVKIT_ROOT/sysroot\"\nHERE\n\n\texport ANDROID_DEVKIT=$TERMUX_STANDALONE_TOOLCHAIN\n\n\tif [ -n \"$TERMUX_DEBUG\" ]; then TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --with-debug-level=slowdebug\"; fi\n\tBUILD_TRIPLE=$TERMUX_ARCH-linux-gnu\n\ttest \"$TERMUX_ARCH\" == \"arm\" && BUILD_TRIPLE+=\"eabi\"\n\n\tJVM_FEATURES=\"compiler1,compiler2,jvmti,fprof,vm-structs,jni-check,services,management,all-gcs,nmt,cds\"\n\t# enable features specific to some arches\n\tif [ \"$TERMUX_ARCH\" == \"aarch64\" ] || [ \"$TERMUX_ARCH\" == \"x86_64\" ]; then JVM_FEATURES+=\",jvmci,graal\"; fi\n\n\t# remove sa_proc support\n\trm $TERMUX_PKG_SRCDIR/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk\n}\ntermux_step_configure() {\n\tif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\tln -sf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib64/libc.so $TERMUX_PKG_TMPDIR/libpthread.so\n\telse\n\tln -sf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/libc.so $TERMUX_PKG_TMPDIR/libpthread.so\n\tfi\n\tARM64=\"\"\n\tif [ $TERMUX_ARCH = aarch64 ]; then\n\t\t    export  ARM64=\" --with-cpu-port=arm64\"\n\tfi\n\n\tbash $TERMUX_PKG_SRCDIR/configure \\\n\t\t$ARM64 \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--openjdk-target=$BUILD_TRIPLE \\\n\t\t--libexecdir=$TERMUX_PREFIX/libexec \\\n\t\t--with-devkit=$ANDROID_DEVKIT \\\n\t\t--with-extra-cflags=\"$CPPFLAGS $CFLAGS\" \\\n\t\t--with-extra-cxxflags=\"$CPPFLAGS $CXXFLAGS\" \\\n\t\t--with-extra-ldflags=\"-L$TERMUX_PKG_TMPDIR  $LDFLAGS -ldl\" \\\n\t\t--with-jvm-features=\"$JVM_FEATURES\" \\\n\t\t$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\n}\n\ntermux_step_make() {\n\tmake JOBS=$TERMUX_MAKE_PROCESSES images\n}\n\ntermux_step_post_make_install() {\n\t# move jvm install dir\n\tmkdir -p $TERMUX_PREFIX/lib/jvm\n\trm -rf \"$TERMUX_PREFIX/lib/jvm/openjdk-9\"\n\tmv $TERMUX_PREFIX/jvm/openjdk-9-internal $TERMUX_PREFIX/$_jvm_dir\n\n\t# place src.zip in standard location mimicking ubuntu\n\tmv $TERMUX_PREFIX/$_jvm_dir/lib/src.zip $TERMUX_PREFIX/$_jvm_dir/src.zip\n\n\t# create shell wrappers for binaries\n\tfor binary in $TERMUX_PREFIX/$_jvm_dir/bin/*; do\n\t\tbinary=$(basename $binary)\n\t\trm -f $TERMUX_PREFIX/bin/$binary\n\t\techo \"export JAVA_HOME=\\$PREFIX/$_jvm_dir\" > $TERMUX_PREFIX/bin/$binary\n\t\techo \"export LD_LIBRARY_PATH=\\$LD_LIBRARY_PATH:\\$JAVA_HOME/lib:\\$JAVA_HOME/lib/jli\" >> $TERMUX_PREFIX/bin/$binary\n\t\techo \"exec \\$JAVA_HOME/bin/$binary \\\"\\$@\\\"\" >> $TERMUX_PREFIX/bin/$binary\n\t\tchmod u+x $TERMUX_PREFIX/bin/$binary\n\tdone\n\n\t# use cacerts provided by ca-certificates-java\n\tln -sf \"$TERMUX_PREFIX/$_jvm_dir/lib/security/jssecacerts\" \"$TERMUX_PREFIX/$_jvm_dir/lib/security/cacerts\"\n}\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/build_ldflags.patch",
    "content": "--- ./common/autoconf/generated-configure.sh\t2017-05-14 10:01:38.475911076 +0530\n+++ ../generated-configure.sh\t2017-05-14 10:08:25.204273780 +0530\n@@ -47809,8 +47809,8 @@\n     # Assume the C compiler is the assembler\n     BUILD_AS=\"$BUILD_CC -c\"\n     # Just like for the target compiler, use the compiler as linker\n-    BUILD_LD=\"$BUILD_CC\"\n-    BUILD_LDCXX=\"$BUILD_CXX\"\n+    BUILD_LD=\"$BUILD_CC -ldl -lpthread\"\n+    BUILD_LDCXX=\"$BUILD_CXX -ldl -lpthread\"\n \n     PATH=\"$OLDPATH\"\n \n--- ./common/autoconf/generated-configure.sh\t2017-05-14 10:50:10.292197720 +0530\n+++ ../generated-configure.sh\t2017-05-14 10:53:21.857704488 +0530\n@@ -37441,8 +37441,8 @@\n     LDCXX=\"$LD\"\n   else\n     # All other toolchains use the compiler to link.\n-    LD=\"$CC\"\n-    LDCXX=\"$CXX\"\n+    LD=\"$CC -llog\"\n+    LDCXX=\"$CXX -llog\"\n   fi\n \n   # FIXME: it should be CXXLD, according to standard (cf CXXCPP)\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/elfFile.hpp.patch",
    "content": "--- ./hotspot/src/share/vm/utilities/elfFile.hpp\t2017-05-12 23:47:58.000000000 +0530\n+++ ../elfFile.hpp\t2017-05-14 12:27:21.069572447 +0530\n@@ -50,7 +50,7 @@\n typedef Elf64_Phdr      Elf_Phdr;\n typedef Elf64_Sym       Elf_Sym;\n \n-#if !defined(_ALLBSD_SOURCE) || defined(__APPLE__)\n+#if (!defined(_ALLBSD_SOURCE) || defined(__APPLE__)) && !defined(__ANDROID__)\n #define ELF_ST_TYPE ELF64_ST_TYPE\n #endif\n \n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/generated-configure.sh.patch",
    "content": "--- ./common/autoconf/generated-configure.sh    2017-04-01 23:19:09.508381398 +0530\n+++ ../generated-configure.sh   2017-04-02 17:35:37.210373866 +0530\n@@ -53412,14 +53412,7 @@\n\n\n   # Check if X11 is needed\n-  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\n-    # No X11 support on windows or macosx\n     NEEDS_LIB_X11=false\n-  else\n-    # All other instances need X11, even if building headless only, libawt still\n-    # needs X11 headers.\n-    NEEDS_LIB_X11=true\n-  fi\n\n   # Check if cups is needed\n   if test \"x$OPENJDK_TARGET_OS\" = xwindows; then\n@@ -53435,11 +53428,7 @@\n   fi\n\n   # Check if alsa is needed\n-  if test \"x$OPENJDK_TARGET_OS\" = xlinux; then\n-    NEEDS_LIB_ALSA=true\n-  else\n     NEEDS_LIB_ALSA=false\n-  fi\n\n   # Check if ffi is needed\n   if   [[ \" $JVM_VARIANTS \" =~ \" zero \" ]]   ||   [[ \" $JVM_VARIANTS \" =~ \" zeroshark \" ]]  ; then\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/getgr_r.patch",
    "content": "--- ./jdk/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c\t2017-03-02 21:55:47.000000000 +0530\n+++ ../UnixNativeDispatcher.c\t2017-03-03 21:37:02.370375158 +0530\n@@ -168,40 +168,6 @@\n #endif\n static fdopendir_func* my_fdopendir_func = NULL;\n \n-#ifdef __ANDROID__\n-/*\n- * TODO: Android lacks support for the methods listed below.  In it's place are\n- * alternatives that use existing Android functionality, but lack reentrant\n- * support.  Determine if the following are the most suitable alternatives.\n- *\n- */\n-int getgrgid_r(gid_t gid, struct group* grp, char* buf, size_t buflen, struct group** result)\n-{\n-  *result = NULL;\n-  errno = 0;\n-  grp = getgrgid(gid);\n-  if (grp == NULL) {\n-        return errno;\n-  }\n-  // buf not used by caller (see below)\n-  *result = grp;\n-  return 0;\n-}\n-\n-int getgrnam_r(const char *name, struct group* grp, char* buf, size_t buflen, struct group** result)\n-{\n-  *result = NULL;\n-  errno = 0;\n-  grp = getgrnam(name);\n-  if (grp == NULL) {\n-        return errno;\n-  }\n-  // buf not used by caller (see below)\n-  *result = grp;\n-  return 0;\n-}\n-#endif\n-\n /**\n  * fstatat missing from glibc on Linux. Temporary workaround\n  * for x86/x64.\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/hotspot-jvm_home.patch",
    "content": "shoutout to @its-pointless (live_the_dream)\n--- ./hotspot/src/share/vm/runtime/os.cpp\t2017-03-30 20:45:45.000000000 +0530\n+++ ../os.cpp\t2017-03-31 11:04:17.097618021 +0530\n@@ -74,7 +74,7 @@\n int               os::_processor_count    = 0;\n int               os::_initial_active_processor_count = 0;\n size_t            os::_page_sizes[os::page_sizes_max];\n-const char *      os::_java_home = NULL;\n+const char *      os::_java_home = \"@TERMUX_PREFIX@/lib/jvm/openjdk-9\";\n \n #ifndef PRODUCT\n julong os::num_mallocs = 0;         // # of calls to malloc/realloc\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/jdk-java_home.patch",
    "content": "--- ./jdk/src/java.base/unix/native/libjli/java_md_solinux.c\t2017-03-30 20:45:48.000000000 +0530\n+++ ../java_md_solinux.c\t2017-03-31 09:15:07.979651293 +0530\n@@ -163,7 +163,7 @@\n  */\n \n #ifdef __ANDROID__\n-static char * __java_home = NULL;\n+static char * __java_home = \"@TERMUX_PREFIX@/lib/jvm/openjdk-9\";\n #endif\n \n void SetJavaHome(char *arg) {\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/libpthread.patch",
    "content": "--- ./jdk/make/lib/Awt2dLibraries.gmk\t2017-03-30 20:45:48.000000000 +0530\n+++ ../Awt2dLibraries.gmk\t2017-04-02 18:36:12.582240305 +0530\n@@ -145,7 +145,7 @@\n   LIBAWT_DIRS += $(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/utility\n endif\n \n-ifneq ($(filter $(OPENJDK_TARGET_OS), solaris linux macosx aix), )\n+ifneq ($(filter $(OPENJDK_TARGET_OS), solaris macosx aix), )\n   LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c\n endif\n \n@@ -212,7 +212,7 @@\n   LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/java.desktop/windows/native/libawt/windows/awt.rc\n endif\n \n-ifeq ($(OPENJDK_TARGET_OS), android)\n+ifeq ($(OPENJDK_TARGET_OS), linux)\n   LIBAWT_EXFILES += \\\n       java2d/loops/TransformHelper.c \\\n       java2d/loops/ScaledBlit.c \\\n@@ -347,10 +347,10 @@\n       endif\n     endif\n \n-    LIBAWT_XAWT_LIBS := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc\n+    LIBAWT_XAWT_LIBS := $(LIBM) $(LIBDL) -ljava -ljvm -lc\n \n     ifeq ($(OPENJDK_TARGET_OS), linux)\n-      LIBAWT_XAWT_LIBS += -lpthread\n+      LIBAWT_XAWT_LIBS += -lc\n     endif\n \n     ifeq ($(TOOLCHAIN_TYPE), gcc)\n@@ -669,7 +669,7 @@\n       X11TextRenderer.c \\\n       fontpath.c \\\n       lcdglyph.c\n-else ifeq ($(OPENJDK_TARGET_OS), android)\n+else ifeq ($(OPENJDK_TARGET_OS), linux)\n     LIBFONTMANAGER_EXCLUDE_FILES += X11TextRenderer.c\n else\n   LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \\\n@@ -939,7 +939,7 @@\n     LIBSPLASHSCREEN_LDFLAGS := -delayload:user32.dll\n     LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib\n   else\n-    LIBSPLASHSCREEN_LIBS += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread -ldl\n+    LIBSPLASHSCREEN_LIBS += $(LIBM) -lc -ldl\n   endif\n \n   $(eval $(call SetupNativeCompilation,BUILD_LIBSPLASHSCREEN, \\\n--- ./jdk/make/lib/Lib-java.desktop.gmk\t2017-03-30 20:45:48.000000000 +0530\n+++ ../Lib-java.desktop.gmk\t2017-04-02 19:01:58.000696690 +0530\n@@ -31,7 +31,7 @@\n \n include LibosxLibraries.gmk\n include PlatformLibraries.gmk\n-ifeq (,$(filter $(OPENJDK_TARGET_OS), android ios))\n+ifeq (,$(filter $(OPENJDK_TARGET_OS), android ios linux))\n   include Awt2dLibraries.gmk\n endif\n include SoundLibraries.gmk\n--- ./jdk/make/lib/SoundLibraries.gmk\t2017-03-30 20:45:48.000000000 +0530\n+++ ../SoundLibraries.gmk\t2017-04-02 19:14:25.382032835 +0530\n@@ -69,16 +69,11 @@\n   LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)\n endif # OPENJDK_TARGET_OS windows\n \n-ifeq ($(OPENJDK_TARGET_OS), linux)\n-  EXTRA_SOUND_JNI_LIBS += jsoundalsa\n-  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX\n-endif # OPENJDK_TARGET_OS linux\n-\n ifeq ($(OPENJDK_TARGET_OS), aix)\n   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX\n endif # OPENJDK_TARGET_OS aix\n \n-ifeq ($(OPENJDK_TARGET_OS), android)\n+ifeq ($(OPENJDK_TARGET_OS), linux)\n   LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX\n endif\n \n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/openjdk-9-jdk-headless.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"$_jvm_dir/bin/idlj bin/idlj\n$_jvm_dir/bin/jar bin/jar\n$_jvm_dir/bin/jarsigner bin/jarsigner\n$_jvm_dir/bin/javac bin/javac\n$_jvm_dir/bin/javadoc bin/javadoc\n$_jvm_dir/bin/javah bin/javah\n$_jvm_dir/bin/javap bin/javap\n$_jvm_dir/bin/jcmd bin/jcmd\n$_jvm_dir/bin/jdb bin/jdb\n$_jvm_dir/bin/jdeprscan bin/jdeprscan\n$_jvm_dir/bin/jdeps bin/jdeps\n$_jvm_dir/bin/jhsdb bin/jhsdb\n$_jvm_dir/bin/jimage bin/jimage\n$_jvm_dir/bin/jinfo bin/jinfo\n$_jvm_dir/bin/jlink bin/jlink\n$_jvm_dir/bin/jmap bin/jmap\n$_jvm_dir/bin/jmod bin/jmod\n$_jvm_dir/bin/jps bin/jps\n$_jvm_dir/bin/jrunscript bin/jrunscript\n$_jvm_dir/bin/jshell bin/jshell\n$_jvm_dir/bin/jstack bin/jstack\n$_jvm_dir/bin/jstat bin/jstat\n$_jvm_dir/bin/jstatd bin/jstatd\n$_jvm_dir/bin/policytool bin/policytool\n$_jvm_dir/bin/rmic bin/rmic\n$_jvm_dir/bin/schemagen bin/schemagen\n$_jvm_dir/bin/serialver bin/serialver\n$_jvm_dir/bin/wsgen bin/wsgen\n$_jvm_dir/bin/wsimport bin/wsimport\n$_jvm_dir/bin/xjc bin/xjc\n$_jvm_dir/include\"\nTERMUX_SUBPKG_DEPENDS=\"openjdk-9-jre-headless\"\nTERMUX_SUBPKG_DESCRIPTION=\"OpenJDK Development Kit (JDK) (headless)\"\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/openjdk-9-source.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"$_jvm_dir/src.zip\"\nTERMUX_SUBPKG_DEPENDS=\"openjdk-9-jre-headless\"\nTERMUX_SUBPKG_DESCRIPTION=\"OpenJDK Development Kit (JDK) source files\"\nTERMUX_SUBPKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/osName.patch",
    "content": "thanks @fornwall for finding this\n--- ./jdk/src/java.base/unix/classes/java/lang/ProcessImpl.java\t2017-03-30 20:45:48.000000000 +0530\n+++ ../ProcessImpl.java\t2017-04-01 23:04:39.565293249 +0530\n@@ -157,7 +157,7 @@\n         static Platform get() {\n             String osName = GetPropertyAction.privilegedGetProperty(\"os.name\");\n \n-            if (osName.equals(\"Linux\")) { return LINUX; }\n+            if (osName.equals(\"Linux\") || osName.equals(\"Android\")) { return LINUX; }\n             if (osName.contains(\"OS X\")) { return BSD; }\n             if (osName.equals(\"SunOS\")) { return SOLARIS; }\n             if (osName.equals(\"AIX\")) { return AIX; }\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/os_linux_aarch64.cpp.patch",
    "content": "--- ./hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp\t2017-05-12 23:47:58.000000000 +0530\n+++ ../os_linux_aarch64.cpp\t2017-05-14 21:36:49.672414253 +0530\n@@ -77,7 +77,9 @@\n # include <pwd.h>\n # include <poll.h>\n # include <ucontext.h>\n+# ifndef __ANDROID__\n # include <fpu_control.h>\n+# endif\n \n #ifdef BUILTIN_SIM\n #define REG_SP REG_RSP\n"
  },
  {
    "path": "disabled-packages/openjdk-9-jre-headless/sendfile64.patch",
    "content": "--- ./jdk/src/java.base/unix/native/libnio/ch/FileChannelImpl.c\t2017-05-12 23:48:01.000000000 +0530\n+++ ../FileChannelImpl.c\t2017-05-14 22:51:02.292589382 +0530\n@@ -41,8 +41,6 @@\n #include <sys/sendfile.h>\n #ifdef __ANDROID__\n #define mmap64 mmap\n-#include <sys/syscall.h>\n-#define sendfile64(a,b,c,d) syscall(__NR_sendfile64, a, b, c, d);\n #endif\n #elif defined(_AIX)\n #include <sys/socket.h>\n"
  },
  {
    "path": "disabled-packages/openvpn/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://openvpn.net\nTERMUX_PKG_DESCRIPTION=\"An easy-to-use, robust, and highly configurable VPN (Virtual Private Network)\"\nTERMUX_PKG_VERSION=2.4.2\nTERMUX_PKG_DEPENDS=\"openssl, liblzo, net-tools\"\nTERMUX_PKG_SRCURL=https://swupdate.openvpn.net/community/releases/openvpn-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=df5c4f384b7df6b08a2f6fa8a84b9fd382baf59c2cef1836f82e2a7f62f1bff9\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-plugin-auth-pam\n--disable-systemd\n--disable-debug\n--enable-iproute2\n--enable-small\n--enable-x509-alt-username\nac_cv_func_getpwnam=yes\nac_cv_func_getpass=yes\nIFCONFIG=$TERMUX_PREFIX/bin/ifconfig\nROUTE=$TERMUX_PREFIX/bin/route\nIPROUTE=$TERMUX_PREFIX/bin/ip\nNETSTAT=$TERMUX_PREFIX/bin/netstat\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\n\ntermux_step_pre_configure() {\n    # need to provide getpass, else you \"can't get console input\"\n    cp \"$TERMUX_PKG_BUILDER_DIR/netbsd_getpass.c\" \"$TERMUX_PKG_SRCDIR/src/openvpn/\"\n\n#    CFLAGS=\"$CFLAGS -DTARGET_ANDROID\"\n    LDFLAGS=\"$LDFLAGS -llog \"\n}\n\ntermux_step_post_make_install() {\n    # helper script\n    install -m700 \"$TERMUX_PKG_BUILDER_DIR/termux-openvpn\" \"$TERMUX_PREFIX/bin/\"\n    # Install examples\n    install -d -m755 \"$TERMUX_PREFIX/share/openvpn/examples\"\n    cp \"$TERMUX_PKG_SRCDIR\"/sample/sample-config-files/* \"$TERMUX_PREFIX/share/openvpn/examples\"\n}\n"
  },
  {
    "path": "disabled-packages/openvpn/configure.ac.patch.old",
    "content": "--- ./configure.ac      2016-12-26 11:51:00.000000000 +0000\n+++ ../configure.ac     2016-12-28 04:59:50.936948102 +0000\n@@ -311,6 +311,10 @@\n \n AC_DEFINE_UNQUOTED([TARGET_ALIAS], [\"${host}\"], [A string representing our host])\n case \"$host\" in\n+\t*-*-android*)\n+\t\tAC_DEFINE([TARGET_ANDROID], [1], [Are we running on Android?])\n+\t\tAC_DEFINE_UNQUOTED([TARGET_PREFIX], [\"G\"], [Target prefix])\n+\t\t;;\n \t*-*-linux*)\n \t\tAC_DEFINE([TARGET_LINUX], [1], [Are we running on Linux?])\n \t\tAC_DEFINE_UNQUOTED([TARGET_PREFIX], [\"L\"], [Target prefix])\n"
  },
  {
    "path": "disabled-packages/openvpn/netbsd_getpass.c",
    "content": "/*\t$NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $\t*/\n/*\n * Copyright (c) 1988, 1993\n *\tThe Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n#if 0\n#include <sys/cdefs.h>\n#if defined(LIBC_SCCS) && !defined(lint)\n#if 0\nstatic char sccsid[] = \"@(#)getpass.c\t8.1 (Berkeley) 6/4/93\";\n#else\n__RCSID(\"$NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $\");\n#endif\n#endif /* LIBC_SCCS and not lint */\n#include \"namespace.h\"\n#endif\n#include <assert.h>\n#include <paths.h>\n#include <pwd.h>\n#include <signal.h>\n#include <stdio.h>\n#include <termios.h>\n#include <unistd.h>\n#if 0\n#ifdef __weak_alias\n__weak_alias(getpass,_getpass)\n#endif\n#endif\nchar *\ngetpass(prompt)\n\tconst char *prompt;\n{\n\tstruct termios term;\n\tint ch;\n\tchar *p;\n\tFILE *fp, *outfp;\n\tint echo;\n\tstatic char buf[_PASSWORD_LEN + 1];\n\tsigset_t oset, nset;\n#if 0\n\t_DIAGASSERT(prompt != NULL);\n#endif\n\t/*\n\t * read and write to /dev/tty if possible; else read from\n\t * stdin and write to stderr.\n\t */\n\tif ((outfp = fp = fopen(_PATH_TTY, \"w+\")) == NULL) {\n\t\toutfp = stderr;\n\t\tfp = stdin;\n\t}\n\t/*\n\t * note - blocking signals isn't necessarily the\n\t * right thing, but we leave it for now.\n\t */\n\tsigemptyset(&nset);\n\tsigaddset(&nset, SIGINT);\n\tsigaddset(&nset, SIGTSTP);\n\t(void)sigprocmask(SIG_BLOCK, &nset, &oset);\n\t(void)tcgetattr(fileno(fp), &term);\n\tif ((echo = (term.c_lflag & ECHO)) != 0) {\n\t\tterm.c_lflag &= ~ECHO;\n\t\t(void)tcsetattr(fileno(fp), TCSAFLUSH /*|TCSASOFT*/, &term);\n\t}\n\tif (prompt != NULL)\n\t\t(void)fputs(prompt, outfp);\n\trewind(outfp);\t\t\t/* implied flush */\n\tfor (p = buf; (ch = getc(fp)) != EOF && ch != '\\n';)\n\t\tif (p < buf + _PASSWORD_LEN)\n\t\t\t*p++ = ch;\n\t*p = '\\0';\n\t(void)write(fileno(outfp), \"\\n\", 1);\n\tif (echo) {\n\t\tterm.c_lflag |= ECHO;\n\t\t(void)tcsetattr(fileno(fp), TCSAFLUSH/*|TCSASOFT*/, &term);\n\t}\n\t(void)sigprocmask(SIG_SETMASK, &oset, NULL);\n\tif (fp != stdin)\n\t\t(void)fclose(fp);\n\treturn(buf);\n}\n"
  },
  {
    "path": "disabled-packages/openvpn/src-openvpn-console_builtin.c.patch",
    "content": "--- ./src/openvpn/console_builtin.c     2016-12-26 11:51:00.000000000 +0000\n+++ ../console_builtin.c        2016-12-28 04:05:41.310830107 +0000\n@@ -140,6 +140,7 @@\n \n \n #ifdef HAVE_GETPASS\n+#include \"netbsd_getpass.c\"\n \n /**\n  * Open the current console TTY for read/write operations\n"
  },
  {
    "path": "disabled-packages/openvpn/src-openvpn-tun.c.patch",
    "content": "--- ./src/openvpn/tun.c 2016-12-26 11:51:00.000000000 +0000\n+++ ../tun.c    2016-12-28 04:11:52.786734486 +0000\n@@ -1939,7 +1939,7 @@\n         const char *node = dev_node;\n         if (!node)\n         {\n-            node = \"/dev/net/tun\";\n+            node = \"/dev/tun\";\n         }\n \n         /*\n"
  },
  {
    "path": "disabled-packages/openvpn/termux-openvpn",
    "content": "#!/data/data/com.termux/files/usr/bin/sh\nsu -c \"export LD_LIBRARY_PATH=$PREFIX/lib; export TMPDIR=$PREFIX/tmp; $PREFIX/bin/openvpn $@\"\n"
  },
  {
    "path": "disabled-packages/pacman/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.archlinux.org/pacman/\nTERMUX_PKG_DESCRIPTION=\"A library-based package manager with dependency support\"\nTERMUX_PKG_MAINTAINER=\"Francisco Demartino @franciscod\"\n# HEAVILY adapted from archlinux PKGBUILD\npkgname=pacman\npkgver=4.2.1\nTERMUX_PKG_VERSION=$pkgver\n#FIXME: asciidoc, fakechroot/fakeroot\nTERMUX_PKG_DEPENDS=\"bash, glib, libarchive, curl, gpgme, python2, libandroid-glob, libandroid-support\"\nTERMUX_PKG_SRCURL=\"https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--prefix=$TERMUX_PREFIX --sysconfdir=$TERMUX_PREFIX/etc\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --localstatedir=$TERMUX_PREFIX/var --enable-doc \"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --with-scriptlet-shell=/usr/bin/bash\"\n\ntermux_step_pre_configure() {\n  LDFLAGS+=\"$LDFLAGS -llog -landroid-glob\"\n}\n\ntermux_step_make() {\n  make\n  make -C contrib\n  # make -C \"$pkgname-$pkgver\" check\n}\n\ntermux_step_make_install() {\n\n  make install\n  make -C contrib install\n\n  # install Arch specific stuff\n  install -dm755 \"$TERMUX_PREFIX/etc\"\n  install -m644 \"$TERMUX_PKG_BUILDER_DIR/pacman.conf\" \"$TERMUX_PREFIX/etc/pacman.conf\"\n\n  case $TERMUX_ARCH in\n    i686)\n      mycarch=\"i686\"\n      mychost=\"i686-pc-linux-gnu\"\n      myflags=\"-march=i686\"\n      ;;\n    arm)\n      mycarch=\"arm\"\n      mychost=\"arm-unknown-linux-gnu\"\n      myflags=\"-march=arm\"\n      ;;\n  esac\n\n  # set things correctly in the default conf file\n  install -m644 \"$TERMUX_PKG_BUILDER_DIR/makepkg.conf\" \"$TERMUX_PREFIX/etc\"\n  sed -i \"$TERMUX_PREFIX/etc/makepkg.conf\" \\\n    -e \"s|@CARCH[@]|$mycarch|g\" \\\n    -e \"s|@CHOST[@]|$mychost|g\" \\\n    -e \"s|@CARCHFLAGS[@]|$myflags|g\"\n\n  # FIXME bash_completion\n  # # put bash_completion in the right location\n  # install -dm755 \"$TERMUX_PREFIX/share/bash-completion/completions\"\n  # mv \"$TERMUX_PREFIX/etc/bash_completion.d/pacman\" \"$TERMUX_PREFIX/share/bash-completion/completions\"\n  # rmdir \"$TERMUX_PREFIX/etc/bash_completion.d\"\n\n  # for f in makepkg pacman-key; do\n  #   ln -s pacman \"$TERMUX_PREFIX/share/bash-completion/completions/$f\"\n  # done\n\n  install -Dm644 contrib/PKGBUILD.vim \"$TERMUX_PREFIX/share/vim/vimfiles/syntax/PKGBUILD.vim\"\n}\n"
  },
  {
    "path": "disabled-packages/pacman/ensure-matching-database-and-package-version.patch",
    "content": "From deac9731884a83ad91eab9f27b288f406f56c87b Mon Sep 17 00:00:00 2001\nFrom: Levente Polyak <anthraxx@archlinux.org>\nDate: Sat, 18 Jul 2015 17:58:23 +0200\nSubject: [PATCH] ensure matching database and package version\n\nWhile loading each package ensure that the internal version matches the\nexpected database version to avoid the possibility to circumvent the\nversion check.\nThis issue can be used by an attacker to trick the software into\ninstalling an older version. The behavior can be  exploited by a\nman-in-the-middle attack through specially crafted  database tarball\ncontaining a higher version, yet actually delivering an  older and\nvulnerable version, which was previously shipped.\n\nSigned-off-by: Levente Polyak <anthraxx@archlinux.org>\nSigned-off-by: Remi Gacogne <rgacogne@archlinux.org>\nSigned-off-by: Allan McRae <allan@archlinux.org>\n---\n lib/libalpm/sync.c | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)\n\ndiff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c\nindex 888ae15..e843b07 100644\n--- a/lib/libalpm/sync.c\n+++ b/lib/libalpm/sync.c\n@@ -1212,6 +1212,7 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,\n \tEVENT(handle, &event);\n \n \tfor(i = handle->trans->add; i; i = i->next, current++) {\n+\t\tint error = 0;\n \t\talpm_pkg_t *spkg = i->data;\n \t\tchar *filepath;\n \t\tint percent = (int)(((double)current_bytes / total_bytes) * 100);\n@@ -1232,6 +1233,23 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,\n \t\t\t\tspkg->name);\n \t\talpm_pkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1);\n \t\tif(!pkgfile) {\n+\t\t\t_alpm_log(handle, ALPM_LOG_DEBUG, \"failed to load pkgfile internal\\n\");\n+\t\t\terror = 1;\n+\t\t} else {\n+\t\t\tif(strcmp(spkg->name, pkgfile->name) != 0) {\n+\t\t\t\t_alpm_log(handle, ALPM_LOG_DEBUG,\n+\t\t\t\t\t\t\"internal package name mismatch, expected: '%s', actual: '%s'\\n\",\n+\t\t\t\t\t\tspkg->name, pkgfile->name);\n+\t\t\t\terror = 1;\n+\t\t\t}\n+\t\t\tif(strcmp(spkg->version, pkgfile->version) != 0) {\n+\t\t\t\t_alpm_log(handle, ALPM_LOG_DEBUG,\n+\t\t\t\t\t\t\"internal package version mismatch, expected: '%s', actual: '%s'\\n\",\n+\t\t\t\t\t\tspkg->version, pkgfile->version);\n+\t\t\t\terror = 1;\n+\t\t\t}\n+\t\t}\n+\t\tif(error != 0) {\n \t\t\terrors++;\n \t\t\t*data = alpm_list_add(*data, strdup(spkg->filename));\n \t\t\tfree(filepath);\n-- \n2.4.6\n\n"
  },
  {
    "path": "disabled-packages/pacman/makepkg.conf",
    "content": "#\n# /etc/makepkg.conf\n#\n\n#########################################################################\n# SOURCE ACQUISITION\n#########################################################################\n#\n#-- The download utilities that makepkg should use to acquire sources\n#  Format: 'protocol::agent'\nDLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'\n          'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'\n          'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'\n          'rsync::/usr/bin/rsync --no-motd -z %u %o'\n          'scp::/usr/bin/scp -C %u %o')\n\n# Other common tools:\n# /usr/bin/snarf\n# /usr/bin/lftpget -c\n# /usr/bin/wget\n\n#-- The package required by makepkg to download VCS sources\n#  Format: 'protocol::package'\nVCSCLIENTS=('bzr::bzr'\n            'git::git'\n            'hg::mercurial'\n            'svn::subversion')\n\n#########################################################################\n# ARCHITECTURE, COMPILE FLAGS\n#########################################################################\n#\nCARCH=\"@CARCH@\"\nCHOST=\"@CHOST@\"\n\n#-- Compiler and Linker Flags\n# -march (or -mcpu) builds exclusively for an architecture\n# -mtune optimizes for an architecture, but builds for whole processor family\nCPPFLAGS=\"-D_FORTIFY_SOURCE=2\"\nCFLAGS=\"@CARCHFLAGS@ -mtune=generic -O2 -pipe -fstack-protector-strong\"\nCXXFLAGS=\"@CARCHFLAGS@ -mtune=generic -O2 -pipe -fstack-protector-strong\"\nLDFLAGS=\"-Wl,-O1,--sort-common,--as-needed,-z,relro\"\n#-- Make Flags: change this for DistCC/SMP systems\n#MAKEFLAGS=\"-j2\"\n#-- Debugging flags\nDEBUG_CFLAGS=\"-g -fvar-tracking-assignments\"\nDEBUG_CXXFLAGS=\"-g -fvar-tracking-assignments\"\n\n#########################################################################\n# BUILD ENVIRONMENT\n#########################################################################\n#\n# Defaults: BUILDENV=(!distcc color !ccache check !sign)\n#  A negated environment option will do the opposite of the comments below.\n#\n#-- distcc:   Use the Distributed C/C++/ObjC compiler\n#-- color:    Colorize output messages\n#-- ccache:   Use ccache to cache compilation\n#-- check:    Run the check() function if present in the PKGBUILD\n#-- sign:     Generate PGP signature file\n#\nBUILDENV=(!distcc color !ccache check !sign)\n#\n#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,\n#-- specify a space-delimited list of hosts running in the DistCC cluster.\n#DISTCC_HOSTS=\"\"\n#\n#-- Specify a directory for package building.\n#BUILDDIR=/tmp/makepkg\n\n#########################################################################\n# GLOBAL PACKAGE OPTIONS\n#   These are default values for the options=() settings\n#########################################################################\n#\n# Default: OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !upx !debug)\n#  A negated option will do the opposite of the comments below.\n#\n#-- strip:      Strip symbols from binaries/libraries\n#-- docs:       Save doc directories specified by DOC_DIRS\n#-- libtool:    Leave libtool (.la) files in packages\n#-- staticlibs: Leave static library (.a) files in packages\n#-- emptydirs:  Leave empty directories in packages\n#-- zipman:     Compress manual (man and info) pages in MAN_DIRS with gzip\n#-- purge:      Remove files specified by PURGE_TARGETS\n#-- upx:        Compress binary executable files using UPX\n#-- debug:      Add debugging flags as specified in DEBUG_* variables\n#\nOPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !upx !debug)\n\n#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512\nINTEGRITY_CHECK=(md5)\n#-- Options to be used when stripping binaries. See `man strip' for details.\nSTRIP_BINARIES=\"--strip-all\"\n#-- Options to be used when stripping shared libraries. See `man strip' for details.\nSTRIP_SHARED=\"--strip-unneeded\"\n#-- Options to be used when stripping static libraries. See `man strip' for details.\nSTRIP_STATIC=\"--strip-debug\"\n#-- Manual (man and info) directories to compress (if zipman is specified)\nMAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})\n#-- Doc directories to remove (if !docs is specified)\nDOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})\n#-- Files to be removed from all packages (if purge is specified)\nPURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)\n\n#########################################################################\n# PACKAGE OUTPUT\n#########################################################################\n#\n# Default: put built package and cached source in build directory\n#\n#-- Destination: specify a fixed directory where all packages will be placed\n#PKGDEST=/home/packages\n#-- Source cache: specify a fixed directory where source files will be cached\n#SRCDEST=/home/sources\n#-- Source packages: specify a fixed directory where all src packages will be placed\n#SRCPKGDEST=/home/srcpackages\n#-- Log files: specify a fixed directory where all log files will be placed\n#LOGDEST=/home/makepkglogs\n#-- Packager: name/email of the person or organization building packages\n#PACKAGER=\"John Doe <john@doe.com>\"\n#-- Specify a key to use for package signing\n#GPGKEY=\"\"\n\n#########################################################################\n# COMPRESSION DEFAULTS\n#########################################################################\n#\nCOMPRESSGZ=(gzip -c -f -n)\nCOMPRESSBZ2=(bzip2 -c -f)\nCOMPRESSXZ=(xz -c -z -)\nCOMPRESSLRZ=(lrzip -q)\nCOMPRESSLZO=(lzop -q)\nCOMPRESSZ=(compress -c -f)\n\n#########################################################################\n# EXTENSION DEFAULTS\n#########################################################################\n#\n# WARNING: Do NOT modify these variables unless you know what you are\n#          doing.\n#\nPKGEXT='.pkg.tar.xz'\nSRCEXT='.src.tar.gz'\n\n# vim: set ft=sh ts=2 sw=2 et:\n"
  },
  {
    "path": "disabled-packages/pacman/pacman.conf",
    "content": "#\n# /etc/pacman.conf\n#\n# See the pacman.conf(5) manpage for option and repository directives\n\n#\n# GENERAL OPTIONS\n#\n[options]\n# The following paths are commented out with their default values listed.\n# If you wish to use different paths, uncomment and update the paths.\n#RootDir     = /\n#DBPath      = /var/lib/pacman/\n#CacheDir    = /var/cache/pacman/pkg/\n#LogFile     = /var/log/pacman.log\n#GPGDir      = /etc/pacman.d/gnupg/\nHoldPkg     = pacman glibc\n#XferCommand = /usr/bin/curl -C - -f %u > %o\n#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u\n#CleanMethod = KeepInstalled\n#UseDelta    = 0.7\nArchitecture = auto\n\n# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup\n#IgnorePkg   =\n#IgnoreGroup =\n\n#NoUpgrade   =\n#NoExtract   =\n\n# Misc options\n#UseSyslog\n#Color\n#TotalDownload\nCheckSpace\n#VerbosePkgLists\n\n# By default, pacman accepts packages signed by keys that its local keyring\n# trusts (see pacman-key and its man page), as well as unsigned packages.\nSigLevel    = Required DatabaseOptional\nLocalFileSigLevel = Optional\n#RemoteFileSigLevel = Required\n\n# NOTE: You must run `pacman-key --init` before first using pacman; the local\n# keyring can then be populated with the keys of all official Arch Linux\n# packagers with `pacman-key --populate archlinux`.\n\n#\n# REPOSITORIES\n#   - can be defined here or included from another file\n#   - pacman will search repositories in the order defined here\n#   - local/custom mirrors can be added here or in separate files\n#   - repositories listed first will take precedence when packages\n#     have identical names, regardless of version number\n#   - URLs will have $repo replaced by the name of the current repo\n#   - URLs will have $arch replaced by the name of the architecture\n#\n# Repository entries are of the format:\n#       [repo-name]\n#       Server = ServerName\n#       Include = IncludePath\n#\n# The header [repo-name] is crucial - it must be present and\n# uncommented to enable the repo.\n#\n\n# The testing repositories are disabled by default. To enable, uncomment the\n# repo name header and Include lines. You can add preferred servers immediately\n# after the header, and they will be used before the default mirrors.\n\n#[testing]\n#Include = /etc/pacman.d/mirrorlist\n\n[core]\nInclude = /etc/pacman.d/mirrorlist\n\n[extra]\nInclude = /etc/pacman.d/mirrorlist\n\n#[community-testing]\n#Include = /etc/pacman.d/mirrorlist\n\n[community]\nInclude = /etc/pacman.d/mirrorlist\n\n# An example of a custom package repository.  See the pacman manpage for\n# tips on creating your own repositories.\n#[custom]\n#SigLevel = Optional TrustAll\n#Server = file:///home/custompkgs\n"
  },
  {
    "path": "disabled-packages/pacman/pacman.patch",
    "content": "--- ./src/pacman/pacman.c\t2015-12-23 19:50:37.093132801 -0300\n+++ ./src/pacman/pacman.c\t2015-12-23 23:30:17.986469980 -0300\n@@ -1128,7 +1128,8 @@\n \t\t\t} while(c != EOF);\n\n \t\t\tfree(line);\n-\t\t\tif(!freopen(ctermid(NULL), \"r\", stdin)) {\n+\t\t\t//if(!freopen(ctermid(NULL), \"r\", stdin)) {\n+\t\t\tif(!freopen(\"/dev/tty\", \"r\", stdin)) { // HACK termux doesn't have ctermid()\n \t\t\t\tpm_printf(ALPM_LOG_ERROR, _(\"failed to reopen stdin for reading: (%s)\\n\"),\n \t\t\t\t\t\tstrerror(errno));\n \t\t\t}\n"
  },
  {
    "path": "disabled-packages/pkgconf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://pkgconf.org\nTERMUX_PKG_DESCRIPTION=\"Program which helps to configure compiler and linker flags for development frameworks\"\nTERMUX_PKG_VERSION=1.5.3\nTERMUX_PKG_SHA256=45b76f5037379b1e24b788379c74f31fc4f060b272a08bdda9e558c120e9f3b6\nTERMUX_PKG_SRCURL=https://github.com/pkgconf/pkgconf/archive/pkgconf-$TERMUX_PKG_VERSION.tar.gz\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "disabled-packages/premake/build-gmake.unix-Premake4.make.patch",
    "content": "diff -u -r ../premake-4.4-beta5/build/gmake.unix/Premake4.make ./build/gmake.unix/Premake4.make\n--- ../premake-4.4-beta5/build/gmake.unix/Premake4.make\t2013-11-26 10:41:34.000000000 -0500\n+++ ./build/gmake.unix/Premake4.make\t2015-11-03 09:39:25.024912553 -0500\n@@ -7,10 +7,6 @@\n   SILENT = @\n endif\n \n-CC = gcc\n-CXX = g++\n-AR = ar\n-\n ifndef RESCOMP\n   ifdef WINDRES\n     RESCOMP = $(WINDRES)\n"
  },
  {
    "path": "disabled-packages/premake/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://premake.github.io/\nTERMUX_PKG_DESCRIPTION=\"Build script generator\"\nTERMUX_PKG_VERSION=4.4-beta5\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/premake/Premake/4.4/premake-${TERMUX_PKG_VERSION}-src.zip\n# TERMUX_PKG_DEPENDS=\"pcre, openssl, libuuid\"\n# TERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-ssl=openssl\"\n\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR/build/gmake.unix\n}\n"
  },
  {
    "path": "disabled-packages/sbcl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.sbcl.org/\nTERMUX_PKG_DESCRIPTION=\"Steel Bank Common Lisp\"\nTERMUX_PKG_VERSION=1.3.9\nTERMUX_PKG_SRCURL=http://prdownloads.sourceforge.net/sbcl/sbcl-${TERMUX_PKG_VERSION}-source.tar.bz2\n\ntermux_step_pre_configure() {\n\tlocal SBCL_HOST_TARFILE=$TERMUX_PKG_CACHEDIR/sbcl-host-${TERMUX_PKG_VERSION}.tar.bz2\n\tif [ ! -f $SBCL_HOST_TARFILE ]; then\n\t\tcurl -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\n\t\tcd $TERMUX_PKG_TMPDIR\n\t\ttar xf $SBCL_HOST_TARFILE\n\t\tcd sbcl-${TERMUX_PKG_VERSION}-x86-64-linux\n\t\tINSTALL_ROOT=$TERMUX_PKG_CACHEDIR/sbcl-host sh install.sh\n\tfi\n\texport PATH=$PATH:$TERMUX_PKG_CACHEDIR/sbcl-host/bin\n\texport SBCL_HOME=$TERMUX_PKG_CACHEDIR/sbcl-host/lib/sbcl\n}\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\tsh make.sh --prefix=$TERMUX_PREFIX\n}\n"
  },
  {
    "path": "disabled-packages/sbcl/make-config.sh.patch",
    "content": "diff -u -r ../sbcl-1.3.4/make-config.sh ./make-config.sh\n--- ../sbcl-1.3.4/make-config.sh\t2016-03-31 03:28:36.000000000 -0400\n+++ ./make-config.sh\t2016-04-10 16:43:40.651905145 -0400\n@@ -754,8 +754,9 @@\n # cross-compilers!\n #\n # FIXME: integrate to grovel-features, mayhaps\n-$GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime\n-tools-for-build/determine-endianness >> $ltf\n+# $GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime\n+# tools-for-build/determine-endianness >> $ltf\n+echo \" :little-endian\" >> $ltf # Termux patch.\n \n export sbcl_os sbcl_arch\n sh tools-for-build/grovel-features.sh >> $ltf\n"
  },
  {
    "path": "disabled-packages/sslscan/Makefile.patch",
    "content": "diff --git a/Makefile b/Makefile\nindex 24e6a36..74c2647 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1,7 +1,5 @@\n # set gcc as default if CC is not set\n-ifndef $(CC)\n-  CC=gcc\n-endif\n+CC?=gcc\n\n GIT_VERSION = $(shell git describe --tags --always --dirty=-wip)\n\n@@ -14,7 +12,7 @@ endif\n OS := $(shell uname)\n\n SRCS      = sslscan.c\n-PREFIX    = /usr\n+PREFIX    ?= /usr\n BINDIR    = $(PREFIX)/bin\n MANDIR    = $(PREFIX)/share/man\n MAN1DIR   = $(MANDIR)/man1\n"
  },
  {
    "path": "disabled-packages/sslscan/build.sh",
    "content": "# Status: Does not work with openssl 1.1 or later.\nTERMUX_PKG_HOMEPAGE=https://github.com/rbsec/sslscan\nTERMUX_PKG_DESCRIPTION=\"Fast SSL scanner\"\nTERMUX_PKG_VERSION=1.11.11\nTERMUX_PKG_SRCURL=https://github.com/rbsec/sslscan/archive/${TERMUX_PKG_VERSION}-rbsec.tar.gz\nTERMUX_PKG_SHA256=93fbe1570073dfb2898a546759836ea4df5054e3a8f6d2e3da468eddac8b1764\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_MAINTAINER=\"Pierre Rudloff @Rudloff\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -D__USE_GNU=1\"\n}\n"
  },
  {
    "path": "disabled-packages/sslscan/sslscan.c.patch",
    "content": "diff -u -r ../sslscan-1.11.7-rbsec/sslscan.c ./sslscan.c\n--- ../sslscan-1.11.7-rbsec/sslscan.c\t2016-06-13 08:42:11.000000000 -0400\n+++ ./sslscan.c\t2016-09-05 16:51:08.751161131 -0400\n@@ -65,6 +65,7 @@\n   #endif\n #else\n   #include <netdb.h>\n+  #include <netinet/in.h>\n   #include <sys/socket.h>\n   #include <sys/select.h>\n #endif\n@@ -794,11 +795,11 @@\n                             }\n                         }\n                         else\n-#endif\n                         {\n                             printf(\"%sOpenSSL version does not support compression%s\\n\", COL_RED, RESET);\n                             printf(\"%sRebuild with zlib1g-dev package for zlib support%s\\n\\n\", COL_RED, RESET);\n                         }\n+#endif\n \n                         // Disconnect SSL over socket\n                         SSL_shutdown(ssl);\n@@ -3762,10 +3763,6 @@\n         case mode_multiple:\n             printf(\"Version: %s%s%s\\n%s\\n%s\\n\", COL_GREEN, VERSION, RESET,\n                     SSLeay_version(SSLEAY_VERSION), RESET);\n-#ifdef OPENSSL_NO_SSL2\n-            printf(\"%sOpenSSL version does not support SSLv2%s\\n\", COL_RED, RESET);\n-            printf(\"%sSSLv2 ciphers will not be detected%s\\n\\n\", COL_RED, RESET);\n-#endif\n #ifdef OPENSSL_NO_SSL3\n             printf(\"%sOpenSSL version does not support SSLv3%s\\n\", COL_RED, RESET);\n             printf(\"%sSSLv3 ciphers will not be detected%s\\n\", COL_RED, RESET);\n"
  },
  {
    "path": "disabled-packages/tf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://tinyfugue.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Flexible, screen-oriented MUD client\"\nTERMUX_PKG_VERSION=5.0~beta8\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/tinyfugue/tinyfugue/5.0%20beta%208/tf-50b8.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n# TERMUX_PKG_DEPENDS=\"pcre, openssl, libuuid\"\n# TERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-ssl=openssl --disable-iri\"\n"
  },
  {
    "path": "disabled-packages/toybox/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://landley.net/toybox/\nTERMUX_PKG_DESCRIPTION=\"Common Linux command line utilities\"\nTERMUX_PKG_VERSION=0.7.3\nTERMUX_PKG_SRCURL=http://landley.net/toybox/downloads/toybox-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e6469b508224e0d2e4564dda05c4bb47aef5c28bf29d6c983bcdc6e3a0cd29d6\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\tmake defconfig\n}\n"
  },
  {
    "path": "disabled-packages/unnethack/build.sh",
    "content": "# Crashes with \"Dungeon description not valid\"\nTERMUX_PKG_HOMEPAGE=http://sourceforge.net/apps/trac/unnethack\nTERMUX_PKG_DESCRIPTION=\"Dungeon crawling game, fork of NetHack\"\nTERMUX_PKG_VERSION=5.1.0\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/unnethack/unnethack/${TERMUX_PKG_VERSION}/unnethack-${TERMUX_PKG_VERSION}-20131208.tar.gz\n# --with-owner=$USER to avoid unnethack trying to use a \"games\" user, --with-groups to avoid \"bin\" group\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-owner=$USER --with-group=$(groups | cut -d ' ' -f 1)\"\nTERMUX_PKG_DEPENDS=\"gsl, ncurses\"\n\n# unnethack builds util/{makedefs,lev_comp,dgn_comp} binaries which are later used during the build.\n# we first build these host tools in $TERMUX_PKG_TMPDIR/host-build and copy them into the ordinary\n# cross compile tree after configure, bumping their modification time so that they do not get rebuilt.\n\nCFLAGS=\"$CFLAGS $CPPFLAGS $LDFLAGS\"\nexport LFLAGS=\"$LDFLAGS\"\nLD=\"$CC\"\n\ntermux_step_pre_configure() {\n\t# Create a host build for the makedefs binary\n\tmkdir $TERMUX_PKG_TMPDIR/host-build\n\tcd $TERMUX_PKG_TMPDIR/host-build\n\tORIG_CC=$CC; export CC=gcc\n\tORIG_CFLAGS=$CFLAGS; export CFLAGS=\"\"\n\tORIG_CPPFLAGS=$CPPFLAGS; export CPPFLAGS=\"\"\n\tORIG_CXXFLAGS=$CXXFLAGS; export CXXFLAGS=\"\"\n\tORIG_LDFLAGS=$LDFLAGS; export LDFLAGS=\"\"\n\tORIG_LFLAGS=$LFLAGS; export LFLAGS=\"\"\n\t$TERMUX_PKG_SRCDIR/configure --with-owner=$USER\n\tmake\n\tmake spec_levs\n\tmake dungeon\n\tset +e\n\tmake dlb\n\tset -e\n\texport CC=$ORIG_CC\n\texport CFLAGS=$ORIG_CFLAGS\n\texport CPPFLAGS=$ORIG_CPPFLAGS\n\texport CXXFLAGS=$ORIG_CXXFLAGS\n\texport LDFLAGS=$ORIG_LDFLAGS\n\texport LFLAGS=$ORIG_LFLAGS\n}\n\ntermux_step_post_configure() {\n\t# Use the host built makedefs\n\tcp $TERMUX_PKG_TMPDIR/host-build/util/makedefs $TERMUX_PKG_BUILDDIR/util/makedefs\n\tcp $TERMUX_PKG_TMPDIR/host-build/util/lev_comp $TERMUX_PKG_BUILDDIR/util/lev_comp\n\tcp $TERMUX_PKG_TMPDIR/host-build/util/dgn_comp $TERMUX_PKG_BUILDDIR/util/dgn_comp\n\tcp $TERMUX_PKG_TMPDIR/host-build/util/dlb $TERMUX_PKG_BUILDDIR/util/dlb\n\t# Update timestamp so the binary does not get rebuilt\n\ttouch -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\n}\n\ntermux_step_post_make_install() {\n\t# Add directory which must exist:\n\tmkdir -p $TERMUX_PREFIX/var/unnethack/level\n\techo \"This directory stores locks\" > $TERMUX_PREFIX/var/unnethack/level/README\n}\n"
  },
  {
    "path": "disabled-packages/unnethack/dat_town_wildcard.patch",
    "content": "diff -u -r ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.dat ./sys/autoconf/Makefile.dat\n--- ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.dat\t2013-12-08 16:00:26.000000000 +0100\n+++ ./sys/autoconf/Makefile.dat\t2014-02-14 16:29:56.000000000 +0100\n@@ -293,7 +293,7 @@\n \tadvcal.des moria.des \\\n \tbigroom.des blkmar.des castle.des \\\n \tdragons.des \\\n-\tendgame.des gehennom.des heck.des knox.des town-?.des \\\n+\tendgame.des gehennom.des heck.des knox.des town-1.des town-2.des \\\n \tmedusa.des \\\n \tmines.des nymph.des oracle.des \\\n \tsheol.des \\\n@@ -312,7 +312,8 @@\n \t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/knox.des\n \t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/medusa.des\n \t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/nymph.des\n-\t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/town-?.des\n+\t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/town-1.des\n+\t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/town-2.des\n \t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/moria.des\n \t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/mines.des\n \t../util/lev_comp $(LEVCOMP_FLAGS) $(srcdir)/oracle.des\n"
  },
  {
    "path": "disabled-packages/unnethack/dont_delete_makedefs.patch",
    "content": "The build machine makedefs binary is built before cross compiling, and must not be removed afterwards.\n\ndiff -u -r ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.src ./sys/autoconf/Makefile.src\n--- ../unnethack-5.1.0-20131208/sys/autoconf/Makefile.src\t2013-12-08 16:00:26.000000000 +0100\n+++ ./sys/autoconf/Makefile.src\t2014-02-14 16:22:56.000000000 +0100\n@@ -358,11 +358,9 @@\n # below in the 'make depend' output.\n monst.o:\n \t$(CC) $(CFLAGS) -c $(srcdir)/monst.c\n-\t@rm -f $(MAKEDEFS)\n \n objects.o:\n \t$(CC) $(CFLAGS) -c $(srcdir)/objects.c\n-\t@rm -f $(MAKEDEFS)\n \n # Qt windowport meta-object-compiler output\n qt_kde0.moc: ../include/qt_kde0.h\n"
  },
  {
    "path": "generate-bootstraps.sh",
    "content": "#!/bin/bash\n##\n##  Script for generating bootstrap archives.\n##\n\nset -e\n\nBOOTSTRAP_TMPDIR=$(mktemp -d \"${TMPDIR:-/tmp}/bootstrap-tmp.XXXXXXXX\")\ntrap 'rm -rf $BOOTSTRAP_TMPDIR' EXIT\n\n# By default, bootstrap archives will be built for all architectures\n# supported by Termux application.\n# Override with option '--architectures'.\nTERMUX_ARCHITECTURES=(\"aarch64\" \"arm\" \"i686\" \"x86_64\")\n\n# Can be changed by using '--repository' option.\nREPO_BASE_URL=\"https://dl.bintray.com/termux/termux-packages-24\"\n\n# Can be changed by using '--prefix' option.\nTERMUX_PREFIX=\"/data/data/com.termux/files/usr\"\n\n# A list of non-essential packages. By default it is empty, but can\n# be filled with option '--add'.\ndeclare -a ADDITIONAL_PACKAGES\n\n# Check for some important utilities that may not be available for\n# some reason.\nfor cmd in ar awk curl grep gzip find sed tar xargs xz zip; do\n\tif [ -z \"$(command -v $cmd)\" ]; then\n\t\techo \"[!] Utility '$cmd' is not available in PATH.\"\n\t\texit 1\n\tfi\ndone\n\n# Download package lists from remote repository.\n# Actually, there 2 lists are downloaded: one architecture-independent and one\n# for architecture specified as '$1' argument.\nread_package_list() {\n\tlocal architecture\n\tfor architecture in all \"$1\"; do\n\t\tif [ ! -e \"${BOOTSTRAP_TMPDIR}/packages.${architecture}\" ]; then\n\t\t\techo \"[*] Downloading package list for architecture '${architecture}'...\"\n\t\t\tcurl \\\n\t\t\t\t--fail \\\n\t\t\t\t--location \\\n\t\t\t\t--output \"${BOOTSTRAP_TMPDIR}/packages.${architecture}\" \\\n\t\t\t\t\"${REPO_BASE_URL}/dists/stable/main/binary-${architecture}/Packages\"\n\t\t\techo >> \"${BOOTSTRAP_TMPDIR}/packages.${architecture}\"\n\t\tfi\n\n\t\techo \"[*] Reading package list for '${architecture}'...\"\n\t\twhile read -r -d $'\\xFF' package; do\n\t\t\tif [ -n \"$package\" ]; then\n\t\t\t\tlocal package_name\n\t\t\t\tpackage_name=$(echo \"$package\" | grep -i \"^Package:\" | awk '{ print $2 }')\n\n\t\t\t\tif [ -z \"${PACKAGE_METADATA[\"$package_name\"]}\" ]; then\n\t\t\t\t\tPACKAGE_METADATA[\"$package_name\"]=\"$package\"\n\t\t\t\telse\n\t\t\t\t\tlocal prev_package_ver cur_package_ver\n\t\t\t\t\tcur_package_ver=$(echo \"$package\" | grep -i \"^Version:\" | awk '{ print $2 }')\n\t\t\t\t\tprev_package_ver=$(echo \"${PACKAGE_METADATA[\"$package_name\"]}\" | grep -i \"^Version:\" | awk '{ print $2 }')\n\n\t\t\t\t\t# If package has multiple versions, make sure that our metadata\n\t\t\t\t\t# contains the latest one.\n\t\t\t\t\tif [ \"$(echo -e \"${prev_package_ver}\\n${cur_package_ver}\" | sort -rV | head -n1)\" = \"${cur_package_ver}\" ]; then\n\t\t\t\t\t\tPACKAGE_METADATA[\"$package_name\"]=\"$package\"\n\t\t\t\t\tfi\n\t\t\t\tfi\n\t\t\tfi\n\t\tdone < <(sed -e \"s/^$/\\xFF/g\" \"${BOOTSTRAP_TMPDIR}/packages.${architecture}\")\n\tdone\n}\n\n# Download specified package, its depenencies and then extract *.deb files to\n# the bootstrap root.\npull_package() {\n\tlocal package_name=$1\n\tlocal package_tmpdir=\"${BOOTSTRAP_PKGDIR}/${package_name}\"\n\tmkdir -p \"$package_tmpdir\"\n\n\tlocal package_url\n\tpackage_url=\"$REPO_BASE_URL/$(echo \"${PACKAGE_METADATA[${package_name}]}\" | grep -i \"^Filename:\" | awk '{ print $2 }')\"\n\tif [ \"${package_url}\" = \"$REPO_BASE_URL\" ] || [ \"${package_url}\" = \"${REPO_BASE_URL}/\" ]; then\n\t\techo \"[!] Failed to determine URL for package '$package_name'.\"\n\t\texit 1\n\tfi\n\n\tlocal package_dependencies\n\tpackage_dependencies=$(\n\t\twhile read -r token; do\n\t\t\techo \"$token\" | cut -d'|' -f1 | sed -E 's@\\(.*\\)@@'\n\t\tdone < <(echo \"${PACKAGE_METADATA[${package_name}]}\" | grep -i \"^Depends:\" | sed -E 's@^[Dd]epends:@@' | tr ',' '\\n')\n\t)\n\n\t# Recursively handle dependencies.\n\tif [ -n \"$package_dependencies\" ]; then\n\t\tlocal dep\n\t\tfor dep in $package_dependencies; do\n\t\t\tif [ ! -e \"${BOOTSTRAP_PKGDIR}/${dep}\" ]; then\n\t\t\t\tpull_package \"$dep\"\n\t\t\tfi\n\t\tdone\n\t\tunset dep\n\tfi\n\n\tif [ ! -e \"$package_tmpdir/package.deb\" ]; then\n\t\techo \"[*] Downloading '$package_name'...\"\n\t\tcurl --fail --location --output \"$package_tmpdir/package.deb\" \"$package_url\"\n\n\t\techo \"[*] Extracting '$package_name'...\"\n\t\t(cd \"$package_tmpdir\"\n\t\t\tar x package.deb\n\n\t\t\t# data.tar may have extension different from .xz\n\t\t\tif [ -f \"./data.tar.xz\" ]; then\n\t\t\t\tdata_archive=\"data.tar.xz\"\n\t\t\telif [ -f \"./data.tar.gz\" ]; then\n\t\t\t\tdata_archive=\"data.tar.gz\"\n\t\t\telse\n\t\t\t\techo \"No data.tar.* found in '$package_name'.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\t# Do same for control.tar.\n\t\t\tif [ -f \"./control.tar.xz\" ]; then\n\t\t\t\tcontrol_archive=\"control.tar.xz\"\n\t\t\telif [ -f \"./control.tar.gz\" ]; then\n\t\t\t\tcontrol_archive=\"control.tar.gz\"\n\t\t\telse\n\t\t\t\techo \"No control.tar.* found in '$package_name'.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\t# Extract files.\n\t\t\ttar xf \"$data_archive\" -C \"$BOOTSTRAP_ROOTFS\"\n\t\t\ttar tf \"$data_archive\" > \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info/${package_name}.list\"\n\n\t\t\t# Generate checksums (md5).\n\t\t\ttar xf \"$data_archive\"\n\t\t\tfind data -type f -print0 | xargs -0 -r md5sum | sed 's@^\\.$@@g' > \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info/${package_name}.md5sums\"\n\n\t\t\t# Extract metadata.\n\t\t\ttar xf \"$control_archive\"\n\t\t\t{\n\t\t\t\tcat control\n\t\t\t\techo \"Status: install ok installed\"\n\t\t\t\techo\n\t\t\t} >> \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/status\"\n\n\t\t\t# Additional data: conffiles & scripts\n\t\t\tfor file in conffiles postinst postrm preinst prerm; do\n\t\t\t\tif [ -f \"${PWD}/${file}\" ]; then\n\t\t\t\t\tcp \"$file\" \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info/${package_name}.${file}\"\n\t\t\t\tfi\n\t\t\tdone\n\t\t)\n\tfi\n}\n\n# Final stage: generate bootstrap archive and place it to current\n# working directory.\n# Information about symlinks is stored in file SYMLINKS.txt.\ncreate_bootstrap_archive() {\n\techo \"[*] Creating 'bootstrap-${1}.zip'...\"\n\t(cd \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}\"\n\t\t# Do not store symlinks in bootstrap archive.\n\t\t# Instead, put all information to SYMLINKS.txt\n\t\twhile read -r -d '' link; do\n\t\t\techo \"$(readlink \"$link\")←${link}\" >> SYMLINKS.txt\n\t\t\trm -f \"$link\"\n\t\tdone < <(find . -type l -print0)\n\n\t\tzip -r9 \"${BOOTSTRAP_TMPDIR}/bootstrap-${1}.zip\" ./*\n\t)\n\n\tmv -f \"${BOOTSTRAP_TMPDIR}/bootstrap-${1}.zip\" ./\n\techo \"[*] Finished successfully (${1}).\"\n}\n\nshow_usage() {\n\techo\n\techo \"Usage: generate-bootstraps.sh [options]\"\n\techo\n\techo \"Generate bootstrap archives for Termux application.\"\n\techo\n\techo \"Options:\"\n\techo\n\techo \" -h, --help                  Show this help.\"\n\techo\n\techo \" -a, --add PKG_LIST          Specify one or more additional packages\"\n\techo \"                             to include into bootstrap archive.\"\n\techo \"                             Multiple packages should be passed as\"\n\techo \"                             comma-separated list.\"\n\techo\n\techo \" --architectures ARCH_LIST   Override default list of architectures\"\n\techo \"                             for which bootstrap archives will be\"\n\techo \"                             created.\"\n\techo \"                             Multiple architectures should be passed\"\n\techo \"                             as comma-separated list.\"\n\techo\n\techo \" -p, --prefix PATH           Specify rootfs prefix absolute path.\"\n\techo \"                             Should be exactly same as in packages\"\n\techo \"                             in the remote repository.\"\n\techo\n\techo \" -r, --repository URL        Specify URL for APT repository from\"\n\techo \"                             which packages will be downloaded.\"\n\techo\n\techo \"Architectures: ${TERMUX_ARCHITECTURES[*]}\"\n\techo \"Repository URL: ${REPO_BASE_URL}\"\n\techo \"Prefix: ${TERMUX_PREFIX}\"\n\techo\n}\n\nwhile (($# > 0)); do\n\tcase \"$1\" in\n\t\t-h|--help)\n\t\t\tshow_usage\n\t\t\texit 0\n\t\t\t;;\n\t\t-a|--add)\n\t\t\tif [ $# -gt 1 ] && [ -n \"$2\" ] && [[ $2 != -* ]]; then\n\t\t\t\tfor pkg in $(echo \"$2\" | tr ',' ' '); do\n\t\t\t\t\tADDITIONAL_PACKAGES+=(\"$pkg\")\n\t\t\t\tdone\n\t\t\t\tunset pkg\n\t\t\t\tshift 1\n\t\t\telse\n\t\t\t\techo \"[!] Option '--add' requires an argument.\"\n\t\t\t\tshow_usage\n\t\t\t\texit 1\n\t\t\tfi\n\t\t\t;;\n\t\t--architectures)\n\t\t\tif [ $# -gt 1 ] && [ -n \"$2\" ] && [[ $2 != -* ]]; then\n\t\t\t\tTERMUX_ARCHITECTURES=()\n\t\t\t\tfor arch in $(echo \"$2\" | tr ',' ' '); do\n\t\t\t\t\tTERMUX_ARCHITECTURES+=(\"$arch\")\n\t\t\t\tdone\n\t\t\t\tunset arch\n\t\t\t\tshift 1\n\t\t\telse\n\t\t\t\techo \"[!] Option '--architectures' requires an argument.\"\n\t\t\t\tshow_usage\n\t\t\t\texit 1\n\t\t\tfi\n\t\t\t;;\n\t\t-p|--prefix)\n\t\t\tif [ $# -gt 1 ] && [ -n \"$2\" ] && [[ $2 != -* ]]; then\n\t\t\t\tTERMUX_PREFIX=\"$2\"\n\t\t\t\tshift 1\n\t\t\telse\n\t\t\t\techo \"[!] Option '--prefix' requires an argument.\"\n\t\t\t\tshow_usage\n\t\t\t\texit 1\n\t\t\tfi\n\t\t\t;;\n\t\t-r|--repository)\n\t\t\tif [ $# -gt 1 ] && [ -n \"$2\" ] && [[ $2 != -* ]]; then\n\t\t\t\tREPO_BASE_URL=\"$2\"\n\t\t\t\tshift 1\n\t\t\telse\n\t\t\t\techo \"[!] Option '--repository' requires an argument.\"\n\t\t\t\tshow_usage\n\t\t\t\texit 1\n\t\t\tfi\n\t\t\t;;\n\t\t*)\n\t\t\techo \"[!] Got unknown option '$1'\"\n\t\t\tshow_usage\n\t\t\texit 1\n\t\t\t;;\n\tesac\n\tshift 1\ndone\n\nfor package_arch in \"${TERMUX_ARCHITECTURES[@]}\"; do\n\tBOOTSTRAP_ROOTFS=\"$BOOTSTRAP_TMPDIR/rootfs-${package_arch}\"\n\tBOOTSTRAP_PKGDIR=\"$BOOTSTRAP_TMPDIR/packages-${package_arch}\"\n\n\t# Create initial directories for $TERMUX_PREFIX\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/etc/apt/apt.conf.d\"\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/etc/apt/preferences.d\"\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/tmp\"\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/cache/apt/archives/partial\"\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/info\"\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/triggers\"\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/updates\"\n\tmkdir -p \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/log/apt\"\n\ttouch \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/available\"\n\ttouch \"${BOOTSTRAP_ROOTFS}/${TERMUX_PREFIX}/var/lib/dpkg/status\"\n\n\t# Read package metadata.\n\tunset PACKAGE_METADATA\n\tdeclare -A PACKAGE_METADATA\n\tread_package_list \"$package_arch\"\n\n\t# Package manager.\n\tpull_package apt\n\tpull_package game-repo\n\tpull_package science-repo\n\n\t# Core utilities.\n\tpull_package bash\n\tpull_package bzip2\n\tpull_package command-not-found\n\tpull_package coreutils\n\tpull_package curl\n\tpull_package dash\n\tpull_package diffutils\n\tpull_package findutils\n\tpull_package gawk\n\tpull_package grep\n\tpull_package gzip\n\tpull_package less\n\tpull_package procps\n\tpull_package psmisc\n\tpull_package sed\n\tpull_package tar\n\tpull_package termux-exec\n\tpull_package termux-tools\n\tpull_package xz-utils\n\n\t# Additional.\n\tpull_package busybox\n\tpull_package ed\n\tpull_package dos2unix\n\tpull_package inetutils\n\tpull_package net-tools\n\tpull_package patch\n\tpull_package unzip\n\tpull_package util-linux\n\n\n\t# Handle additional packages.\n\tfor add_pkg in \"${ADDITIONAL_PACKAGES[@]}\"; do\n\t\tpull_package \"$add_pkg\"\n\tdone\n\tunset add_pkg\n\n\t# Create bootstrap archive.\n\tcreate_bootstrap_archive \"$package_arch\"\ndone\n"
  },
  {
    "path": "ndk-patches/asm-generic-termbits.h.patch",
    "content": "diff -u -r /home/builder/lib/android-ndk/sysroot/usr/include/asm-generic/termbits.h ./usr/include/asm-generic/termbits.h\n--- /home/builder/lib/android-ndk/sysroot/usr/include/asm-generic/termbits.h\t2018-09-10 17:37:50.000000000 +0000\n+++ ./usr/include/asm-generic/termbits.h\t2019-01-16 04:54:01.117253378 +0000\n@@ -190,5 +190,6 @@\n #define TCIOFLUSH 2\n #define TCSANOW 0\n #define TCSADRAIN 1\n-#define TCSAFLUSH 2\n+/* TCSAFLUSH is patched to be TCSANOW in Termux to work around Android SELinux rule */\n+#define TCSAFLUSH 0\n #endif\n"
  },
  {
    "path": "ndk-patches/bits-struct_file.h.patch",
    "content": "--- ./usr/include/bits/struct_file.h.orig\t2019-06-10 09:40:35.872857650 +1000\n+++ ./usr/include/bits/struct_file.h\t2019-06-10 09:55:10.890308649 +1000\n@@ -31,14 +31,79 @@\n #include <sys/cdefs.h>\n \n __BEGIN_DECLS\n+#if defined(__LP64__)\n+struct __sbuf {\n+\tunsigned char* _base;\n+\tsize_t _size;\n+};\n+#else\n+struct __sbuf {\n+\tunsigned char *_base;\n+\tint     _size;\n+};\n+#endif                               \n+#if defined(__LP64__)\n+typedef int64_t _struct_file_off_t;\n+#else\n+typedef __kernel_off_t _struct_file_off_t;\n+#endif\n+                                       \n \n /** The opaque structure implementing `FILE`. Do not make any assumptions about its content. */\n struct __sFILE {\n+\tunsigned char *_p;      /* current position in (some) buffer */\n+\tint     _r;             /* read space left for getc() */\n+\tint     _w;             /* write space left for putc() */\n #if defined(__LP64__)\n-  char __private[152];\n+\tint     _flags;         /* flags, below; this FILE is free if 0 */  \n+\tint     _file;          /* fileno, if Unix descriptor, else -1 */ \n #else\n-  char __private[84];\n+\tshort   _flags;         /* flags, below; this FILE is free if 0 */\n+\tshort   _file;          /* fileno, if Unix descriptor, else -1 */\n #endif\n-} __attribute__((aligned(sizeof(void*))));\n+\tstruct  __sbuf _bf;     /* the buffer (at least 1 byte, if !NULL) */\n+        int     _lbfsize;       /* 0 or -_bf._size, for inline putc */\n+\t\n+       /* operations */\n+       void    *_cookie;       /* cookie passed to io functions */\n+\tint     (*_close)(void *);\n+\tint     (*_read)(void *, char *, int);\n+\t_struct_file_off_t      (*_seek)(void *, _struct_file_off_t, int);\n+\tint     (*_write)(void *, const char *, int);\n+\t\n+\t/* extension data, to avoid further ABI breakage */\n+\tstruct  __sbuf _ext;\n+\t/* data for long sequences of ungetc() */\n+\tunsigned char *_up;     /* saved _p when _p is doing ungetc data */\n+\tint     _ur;            /* saved _r when _r is counting ungetc data */\n+\t\n+\t/* tricks to meet minimum requirements even when malloc() fails */\n+\tunsigned char _ubuf[3]; /* guarantee an ungetc() buffer */\n+\tunsigned char _nbuf[1]; /* guarantee a getc() buffer */\n+\t\n+\t/* separate buffer for fgetln() when line crosses buffer boundary */\n+\tstruct  __sbuf _lb;     /* buffer for fgetln() */\n+\t\n+\t/* Unix stdio files get aligned to block boundaries on fseek() */\n+\tint     _blksize;       /* stat.st_blksize (may be != _bf._size) */\n+\t_struct_file_off_t      _offset;        /* current lseek offset */\n+};\n+#define __SLBF  0x0001          /* line buffered */\n+#define __SNBF  0x0002          /* unbuffered */\n+#define __SRD   0x0004          /* OK to read */\n+#define __SWR   0x0008          /* OK to write */\n+\t/* RD and WR are never simultaneously asserted */\n+#define __SRW   0x0010          /* open for reading & writing */\n+#define __SEOF  0x0020          /* found EOF */\n+#define __SERR  0x0040          /* found error */\n+#define __SMBF  0x0080          /* _buf is from malloc */\n+#define __SAPP  0x0100          /* fdopen()ed in append mode */\n+#define __SSTR  0x0200          /* this is an sprintf/snprintf string */\n+#define __SOPT  0x0400          /* do fseek() optimization */\n+#define __SNPT  0x0800          /* do not do fseek() optimization */\n+#define __SOFF  0x1000          /* set iff _offset is in fact correct */\n+#define __SMOD  0x2000          /* true => fgetln modified _p text */\n+#define __SALC  0x4000          /* allocate string space dynamically */\n+#define __SIGN  0x8000          /* ignore this file in _fwalk */\n \n __END_DECLS\n"
  },
  {
    "path": "ndk-patches/grp.h.patch",
    "content": "diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/grp.h ./usr/include/grp.h\n--- /home/fornwall/lib/android-ndk/sysroot/usr/include/grp.h\t2017-11-09 09:57:12.000000000 +0100\n+++ ./usr/include/grp.h\t2017-11-15 11:43:43.065533963 +0100\n@@ -52,18 +52,11 @@\n \n /* Note: Android has thousands and thousands of ids to iterate through. */\n \n-#if __ANDROID_API__ >= 26\n-struct group* getgrent(void) __INTRODUCED_IN(26);\n-\n-void setgrent(void) __INTRODUCED_IN(26);\n-void endgrent(void) __INTRODUCED_IN(26);\n-#endif /* __ANDROID_API__ >= 26 */\n-\n-\n-#if __ANDROID_API__ >= 24\n-int getgrgid_r(gid_t __gid, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);\n-int getgrnam_r(const char* __name, struct group* __group, char* __buf, size_t __n, struct group** __result) __INTRODUCED_IN(24);\n-#endif /* __ANDROID_API__ >= 24 */\n+static struct group* getgrent(void) { return 0; }\n+static void setgrent(void) {}\n+static void endgrent(void) {}\n+static int getgrgid_r(gid_t gid, struct group * grp, char * buf, size_t buflen, struct group ** result) { *result = 0; return 0; }\n+static int  getgrnam_r(const char * name, struct group * grp, char * buf, size_t buflen, struct group ** result) { *result = 0; return 0; }\n \n int getgrouplist(const char* __user, gid_t __group, gid_t* __groups, int* __group_count);\n int initgroups(const char* __user, gid_t __group);\n"
  },
  {
    "path": "ndk-patches/ifaddrs.h",
    "content": "/*\n * Copyright (c) 1995, 1999\n *\tBerkeley Software Design, Inc.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n *\tBSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp\n */\n/*\nCopyright (c) 2013, Kenneth MacKay\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef\t_IFADDRS_H_\n#define\t_IFADDRS_H_\n\nstruct ifaddrs {\n\tstruct ifaddrs  *ifa_next;\n\tchar\t\t*ifa_name;\n\tunsigned int\t ifa_flags;\n\tstruct sockaddr\t*ifa_addr;\n\tstruct sockaddr\t*ifa_netmask;\n\tstruct sockaddr\t*ifa_dstaddr;\n\tvoid\t\t*ifa_data;\n};\n\n/*\n * This may have been defined in <net/if.h>.  Note that if <net/if.h> is\n * to be included it must be included before this header file.\n */\n#ifndef\tifa_broadaddr\n#define\tifa_broadaddr\tifa_dstaddr\t/* broadcast address interface */\n#endif\n\n#include <sys/cdefs.h>\n\n__BEGIN_DECLS\nstatic int getifaddrs(struct ifaddrs **ifap);\nstatic void freeifaddrs(struct ifaddrs *ifa);\n__END_DECLS\n\n\n#include <string.h>\n#include <stdlib.h>\n#include <stddef.h>\n#include <errno.h>\n#include <unistd.h>\n#include <sys/socket.h>\n#include <netpacket/packet.h>\n#include <net/if_arp.h>\n#include <netinet/in.h>\n#include <linux/netlink.h>\n#include <linux/rtnetlink.h>\n\ntypedef struct NetlinkList {\n    struct NetlinkList *m_next;\n    struct nlmsghdr *m_data;\n    unsigned int m_size;\n} NetlinkList;\n\nstatic int netlink_socket(void)\n{\n    int l_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);\n    if (l_socket < 0) return -1;\n\n    struct sockaddr_nl l_addr;\n    memset(&l_addr, 0, sizeof(l_addr));\n    l_addr.nl_family = AF_NETLINK;\n    if(bind(l_socket, (struct sockaddr *)&l_addr, sizeof(l_addr)) < 0) {\n        close(l_socket);\n        return -1;\n    }\n\n    return l_socket;\n}\n\nstatic int netlink_send(int p_socket, int p_request)\n{\n    struct {\n        struct nlmsghdr m_hdr;\n        struct rtgenmsg m_msg;\n    } l_data;\n\n    memset(&l_data, 0, sizeof(l_data));\n\n    l_data.m_hdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg));\n    l_data.m_hdr.nlmsg_type = p_request;\n    l_data.m_hdr.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;\n    l_data.m_hdr.nlmsg_pid = 0;\n    l_data.m_hdr.nlmsg_seq = p_socket;\n    l_data.m_msg.rtgen_family = AF_UNSPEC;\n\n    struct sockaddr_nl l_addr;\n    memset(&l_addr, 0, sizeof(l_addr));\n    l_addr.nl_family = AF_NETLINK;\n    return (sendto(p_socket, &l_data.m_hdr, l_data.m_hdr.nlmsg_len, 0, (struct sockaddr *)&l_addr, sizeof(l_addr)));\n}\n\nstatic int netlink_recv(int p_socket, void *p_buffer, size_t p_len)\n{\n    struct msghdr l_msg;\n    struct iovec l_iov = { p_buffer, p_len };\n    struct sockaddr_nl l_addr;\n\n    for (;;) {\n        l_msg.msg_name = (void *)&l_addr;\n        l_msg.msg_namelen = sizeof(l_addr);\n        l_msg.msg_iov = &l_iov;\n        l_msg.msg_iovlen = 1;\n        l_msg.msg_control = NULL;\n        l_msg.msg_controllen = 0;\n        l_msg.msg_flags = 0;\n        int l_result = recvmsg(p_socket, &l_msg, 0);\n\n        if (l_result < 0) {\n            if (errno == EINTR) {\n                continue;\n            }\n            return -2;\n        }\n\n        if (l_msg.msg_flags & MSG_TRUNC) {\n            /* Buffer was too small. */\n            return -1;\n        }\n        return l_result;\n    }\n}\n\nstatic struct nlmsghdr *getNetlinkResponse(int p_socket, int *p_size, int *p_done)\n{\n    size_t l_size = 4096;\n    void *l_buffer = NULL;\n\n    for(;;) {\n        free(l_buffer);\n        l_buffer = malloc(l_size);\n        if (l_buffer == NULL) return NULL;\n\n        int l_read = netlink_recv(p_socket, l_buffer, l_size);\n        *p_size = l_read;\n        if (l_read == -2) {\n            free(l_buffer);\n            return NULL;\n        }\n        if (l_read >= 0) {\n            pid_t l_pid = getpid();\n            struct nlmsghdr *l_hdr;\n            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)) {\n                if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) continue;\n\n                if(l_hdr->nlmsg_type == NLMSG_DONE) {\n                    *p_done = 1;\n                    break;\n                }\n\n                if(l_hdr->nlmsg_type == NLMSG_ERROR) {\n                    free(l_buffer);\n                    return NULL;\n                }\n            }\n            return (struct nlmsghdr*)l_buffer;\n        }\n\n        l_size *= 2;\n    }\n}\n\nstatic NetlinkList *newListItem(struct nlmsghdr *p_data, unsigned int p_size)\n{\n    NetlinkList *l_item = (NetlinkList*)malloc(sizeof(NetlinkList));\n    if (l_item == NULL) return NULL;\n\n    l_item->m_next = NULL;\n    l_item->m_data = p_data;\n    l_item->m_size = p_size;\n    return l_item;\n}\n\nstatic void freeResultList(NetlinkList *p_list)\n{\n    NetlinkList *l_cur;\n    while (p_list) {\n        l_cur = p_list;\n        p_list = p_list->m_next;\n        free(l_cur->m_data);\n        free(l_cur);\n    }\n}\n\nstatic NetlinkList *getResultList(int p_socket, int p_request)\n{\n    if (netlink_send(p_socket, p_request) < 0) return NULL;\n\n    NetlinkList *l_list = NULL;\n    NetlinkList *l_end = NULL;\n    int l_size;\n    int l_done = 0;\n    while (!l_done) {\n        struct nlmsghdr *l_hdr = getNetlinkResponse(p_socket, &l_size, &l_done);\n        if (!l_hdr) {\n            freeResultList(l_list);\n            return NULL;\n        }\n\n        NetlinkList *l_item = newListItem(l_hdr, l_size);\n        if (!l_item) {\n            freeResultList(l_list);\n            return NULL;\n        }\n        if (!l_list) {\n            l_list = l_item;\n        } else {\n            l_end->m_next = l_item;\n        }\n        l_end = l_item;\n    }\n    return l_list;\n}\n\nstatic size_t maxSize(size_t a, size_t b)\n{\n    return (a > b ? a : b);\n}\n\nstatic size_t calcAddrLen(sa_family_t p_family, int p_dataSize)\n{\n    switch (p_family) {\n        case AF_INET:\n            return sizeof(struct sockaddr_in);\n        case AF_INET6:\n            return sizeof(struct sockaddr_in6);\n        case AF_PACKET:\n            return maxSize(sizeof(struct sockaddr_ll), offsetof(struct sockaddr_ll, sll_addr) + p_dataSize);\n        default:\n            return maxSize(sizeof(struct sockaddr), offsetof(struct sockaddr, sa_data) + p_dataSize);\n    }\n}\n\nstatic void makeSockaddr(sa_family_t p_family, struct sockaddr *p_dest, void *p_data, size_t p_size)\n{\n    switch (p_family) {\n        case AF_INET:\n            memcpy(&((struct sockaddr_in*)p_dest)->sin_addr, p_data, p_size);\n            break;\n        case AF_INET6:\n            memcpy(&((struct sockaddr_in6*)p_dest)->sin6_addr, p_data, p_size);\n            break;\n        case AF_PACKET:\n            memcpy(((struct sockaddr_ll*)p_dest)->sll_addr, p_data, p_size);\n            ((struct sockaddr_ll*)p_dest)->sll_halen = p_size;\n            break;\n        default:\n            memcpy(p_dest->sa_data, p_data, p_size);\n            break;\n    }\n    p_dest->sa_family = p_family;\n}\n\nstatic void addToEnd(struct ifaddrs **p_resultList, struct ifaddrs *p_entry)\n{\n    if (!*p_resultList) {\n        *p_resultList = p_entry;\n    } else {\n        struct ifaddrs *l_cur = *p_resultList;\n        while(l_cur->ifa_next) {\n            l_cur = l_cur->ifa_next;\n        }\n        l_cur->ifa_next = p_entry;\n    }\n}\n\nstatic int interpretLink(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList)\n{\n    struct ifinfomsg *l_info = (struct ifinfomsg *)NLMSG_DATA(p_hdr);\n\n    size_t l_nameSize = 0;\n    size_t l_addrSize = 0;\n    size_t l_dataSize = 0;\n\n    size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));\n    struct rtattr *l_rta;\n    for (l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) {\n        void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n        switch (l_rta->rta_type) {\n            case IFLA_ADDRESS:\n            case IFLA_BROADCAST:\n                l_addrSize += NLMSG_ALIGN(calcAddrLen(AF_PACKET, l_rtaDataSize));\n                break;\n            case IFLA_IFNAME:\n                l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);\n                break;\n            case IFLA_STATS:\n                l_dataSize += NLMSG_ALIGN(l_rtaSize);\n                break;\n            default:\n                break;\n        }\n    }\n\n    struct ifaddrs *l_entry = (struct ifaddrs*)malloc(sizeof(struct ifaddrs) + sizeof(int) + l_nameSize + l_addrSize + l_dataSize);\n    if (l_entry == NULL) return -1;\n    memset(l_entry, 0, sizeof(struct ifaddrs));\n    l_entry->ifa_name = (char*)\"\";\n\n    char *l_index = ((char *)l_entry) + sizeof(struct ifaddrs);\n    char *l_name = l_index + sizeof(int);\n    char *l_addr = l_name + l_nameSize;\n    char *l_data = l_addr + l_addrSize;\n\n    /* Save the interface index so we can look it up when handling the addresses. */\n    memcpy(l_index, &l_info->ifi_index, sizeof(int));\n\n    l_entry->ifa_flags = l_info->ifi_flags;\n\n    l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg));\n    for (l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) {\n        void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n        switch (l_rta->rta_type) {\n            case IFLA_ADDRESS:\n            case IFLA_BROADCAST:\n            {\n                size_t l_addrLen = calcAddrLen(AF_PACKET, l_rtaDataSize);\n                makeSockaddr(AF_PACKET, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);\n                ((struct sockaddr_ll *)l_addr)->sll_ifindex = l_info->ifi_index;\n                ((struct sockaddr_ll *)l_addr)->sll_hatype = l_info->ifi_type;\n                if (l_rta->rta_type == IFLA_ADDRESS) {\n                    l_entry->ifa_addr = (struct sockaddr *)l_addr;\n                } else {\n                    l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;\n                }\n                l_addr += NLMSG_ALIGN(l_addrLen);\n                break;\n            }\n            case IFLA_IFNAME:\n                strncpy(l_name, (char*)l_rtaData, l_rtaDataSize);\n                l_name[l_rtaDataSize] = '\\0';\n                l_entry->ifa_name = l_name;\n                break;\n            case IFLA_STATS:\n                memcpy(l_data, l_rtaData, l_rtaDataSize);\n                l_entry->ifa_data = l_data;\n                break;\n            default:\n                break;\n        }\n    }\n\n    addToEnd(p_resultList, l_entry);\n    return 0;\n}\n\nstatic struct ifaddrs *findInterface(int p_index, struct ifaddrs **p_links, int p_numLinks)\n{\n    int l_num = 0;\n    struct ifaddrs *l_cur = *p_links;\n    while (l_cur && l_num < p_numLinks) {\n        char *l_indexPtr = ((char *)l_cur) + sizeof(struct ifaddrs);\n        int l_index;\n        memcpy(&l_index, l_indexPtr, sizeof(int));\n        if(l_index == p_index) return l_cur;\n\n        l_cur = l_cur->ifa_next;\n        ++l_num;\n    }\n    return NULL;\n}\n\nstatic int interpretAddr(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList, int p_numLinks)\n{\n    struct ifaddrmsg *l_info = (struct ifaddrmsg *)NLMSG_DATA(p_hdr);\n    struct ifaddrs *l_interface = findInterface(l_info->ifa_index, p_resultList, p_numLinks);\n\n    if (l_info->ifa_family == AF_PACKET) return 0;\n\n    size_t l_nameSize = 0;\n    size_t l_addrSize = 0;\n    int l_addedNetmask = 0;\n\n    size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));\n    struct rtattr *l_rta;\n    for (l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) {\n        void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n\n        switch (l_rta->rta_type) {\n            case IFA_ADDRESS:\n            case IFA_LOCAL:\n                if ((l_info->ifa_family == AF_INET || l_info->ifa_family == AF_INET6) && !l_addedNetmask) {\n                    /* Make room for netmask. */\n                    l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));\n                    l_addedNetmask = 1;\n                }\n            case IFA_BROADCAST:\n                l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize));\n                break;\n            case IFA_LABEL:\n                l_nameSize += NLMSG_ALIGN(l_rtaSize + 1);\n                break;\n            default:\n                break;\n        }\n    }\n\n    struct ifaddrs *l_entry = (struct ifaddrs*)malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize);\n    if (l_entry == NULL) return -1;\n    memset(l_entry, 0, sizeof(struct ifaddrs));\n    l_entry->ifa_name = (l_interface ? l_interface->ifa_name : (char*)\"\");\n\n    char *l_name = ((char *)l_entry) + sizeof(struct ifaddrs);\n    char *l_addr = l_name + l_nameSize;\n\n    l_entry->ifa_flags = l_info->ifa_flags;\n    if (l_interface) {\n        l_entry->ifa_flags |= l_interface->ifa_flags;\n    }\n\n    l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg));\n    for (l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) {\n        void *l_rtaData = RTA_DATA(l_rta);\n        size_t l_rtaDataSize = RTA_PAYLOAD(l_rta);\n        switch (l_rta->rta_type) {\n            case IFA_ADDRESS:\n            case IFA_BROADCAST:\n            case IFA_LOCAL:\n            {\n                size_t l_addrLen = calcAddrLen(l_info->ifa_family, l_rtaDataSize);\n                makeSockaddr(l_info->ifa_family, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize);\n                if (l_info->ifa_family == AF_INET6) {\n                    if (IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)l_rtaData) || IN6_IS_ADDR_MC_LINKLOCAL((struct in6_addr *)l_rtaData)) {\n                        ((struct sockaddr_in6 *)l_addr)->sin6_scope_id = l_info->ifa_index;\n                    }\n                }\n\n                if (l_rta->rta_type == IFA_ADDRESS) {\n                    /* Apparently in a point-to-point network IFA_ADDRESS contains\n                       the dest address and IFA_LOCAL contains the local address. */\n                    if(l_entry->ifa_addr) {\n                        l_entry->ifa_dstaddr = (struct sockaddr *)l_addr;\n                    } else {\n                        l_entry->ifa_addr = (struct sockaddr *)l_addr;\n                    }\n                } else if (l_rta->rta_type == IFA_LOCAL) {\n                    if(l_entry->ifa_addr) {\n                        l_entry->ifa_dstaddr = l_entry->ifa_addr;\n                    }\n                    l_entry->ifa_addr = (struct sockaddr *)l_addr;\n                } else {\n                    l_entry->ifa_broadaddr = (struct sockaddr *)l_addr;\n                }\n                l_addr += NLMSG_ALIGN(l_addrLen);\n                break;\n            }\n            case IFA_LABEL:\n                strncpy(l_name, (char*)l_rtaData, l_rtaDataSize);\n                l_name[l_rtaDataSize] = '\\0';\n                l_entry->ifa_name = l_name;\n                break;\n            default:\n                break;\n        }\n    }\n\n    if (l_entry->ifa_addr && (l_entry->ifa_addr->sa_family == AF_INET || l_entry->ifa_addr->sa_family == AF_INET6)) {\n        unsigned l_maxPrefix = (l_entry->ifa_addr->sa_family == AF_INET ? 32 : 128);\n        unsigned l_prefix = (l_info->ifa_prefixlen > l_maxPrefix ? l_maxPrefix : l_info->ifa_prefixlen);\n        char l_mask[16] = {0};\n        unsigned i;\n        for (i=0; i<(l_prefix/8); ++i) {\n            l_mask[i] = 0xff;\n        }\n        if (l_prefix % 8) {\n            l_mask[i] = 0xff << (8 - (l_prefix % 8));\n        }\n\n        makeSockaddr(l_entry->ifa_addr->sa_family, (struct sockaddr *)l_addr, l_mask, l_maxPrefix / 8);\n        l_entry->ifa_netmask = (struct sockaddr *)l_addr;\n    }\n\n    addToEnd(p_resultList, l_entry);\n    return 0;\n}\n\nstatic int interpretLinks(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList)\n{\n    int l_numLinks = 0;\n    pid_t l_pid = getpid();\n    for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next) {\n        unsigned int l_nlsize = p_netlinkList->m_size;\n        struct nlmsghdr *l_hdr;\n        for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize))\n        {\n            if ((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) continue;\n\n            if (l_hdr->nlmsg_type == NLMSG_DONE) break;\n\n            if (l_hdr->nlmsg_type == RTM_NEWLINK) {\n                if(interpretLink(l_hdr, p_resultList) == -1) return -1;\n                ++l_numLinks;\n            }\n        }\n    }\n    return l_numLinks;\n}\n\nstatic int interpretAddrs(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList, int p_numLinks)\n{\n    pid_t l_pid = getpid();\n    for (; p_netlinkList; p_netlinkList = p_netlinkList->m_next) {\n        unsigned int l_nlsize = p_netlinkList->m_size;\n        struct nlmsghdr *l_hdr;\n        for (l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize)) {\n            if ((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) continue;\n\n            if (l_hdr->nlmsg_type == NLMSG_DONE) break;\n\n            if (l_hdr->nlmsg_type == RTM_NEWADDR) {\n                if (interpretAddr(l_hdr, p_resultList, p_numLinks) == -1) return -1;\n            }\n        }\n    }\n    return 0;\n}\n\nstatic int getifaddrs(struct ifaddrs **ifap)\n{\n    if (!ifap) return -1;\n    *ifap = NULL;\n\n    int l_socket = netlink_socket();\n    if (l_socket < 0) {\n        return -1;\n    }\n\n    NetlinkList *l_linkResults = getResultList(l_socket, RTM_GETLINK);\n    if (!l_linkResults) {\n        close(l_socket);\n        return -1;\n    }\n\n    NetlinkList *l_addrResults = getResultList(l_socket, RTM_GETADDR);\n    if (!l_addrResults) {\n        close(l_socket);\n        freeResultList(l_linkResults);\n        return -1;\n    }\n\n    int l_result = 0;\n    int l_numLinks = interpretLinks(l_socket, l_linkResults, ifap);\n    if (l_numLinks == -1 || interpretAddrs(l_socket, l_addrResults, ifap, l_numLinks) == -1) {\n        l_result = -1;\n    }\n\n    freeResultList(l_linkResults);\n    freeResultList(l_addrResults);\n    close(l_socket);\n    return l_result;\n}\n\nstatic void freeifaddrs(struct ifaddrs *ifa)\n{\n    struct ifaddrs *l_cur;\n    while (ifa) {\n        l_cur = ifa;\n        ifa = ifa->ifa_next;\n        free(l_cur);\n    }\n}\n\n#endif\n"
  },
  {
    "path": "ndk-patches/langinfo.h",
    "content": "/*\n * Copyright (C) 2013 The Android Open Source Project\n * Copyright (C) 2016 The Android Open Source Project\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n#ifndef _LANGINFO_H\n#define _LANGINFO_H\n\n// __LP64__\n\n#include <nl_types.h>\n#include <xlocale.h>\n#include <locale.h>\n\n#define _NL_ITEM(category,index)  (((category) << 10) | (index))\n\n#define _NL_ITEM_CATEGORY(nl)  ((nl) >> 10)\n#define _NL_ITEM_INDEX(nl)     ((nl) & 0x3ff)\n\n#define CODESET 1\n#define D_T_FMT 2\n#define D_FMT 3\n#define T_FMT 4\n#define T_FMT_AMPM 5\n#define AM_STR 6\n#define PM_STR 7\n#define DAY_1 8\n#define DAY_2 9\n#define DAY_3 10\n#define DAY_4 11\n#define DAY_5 12\n#define DAY_6 13\n#define DAY_7 14\n#define ABDAY_1 15\n#define ABDAY_2 16\n#define ABDAY_3 17\n#define ABDAY_4 18\n#define ABDAY_5 19\n#define ABDAY_6 20\n#define ABDAY_7 21\n#define MON_1 22\n#define MON_2 23\n#define MON_3 24\n#define MON_4 25\n#define MON_5 26\n#define MON_6 27\n#define MON_7 28\n#define MON_8 29\n#define MON_9 30\n#define MON_10 31\n#define MON_11 32\n#define MON_12 33\n#define ABMON_1 34\n#define ABMON_2 35\n#define ABMON_3 36\n#define ABMON_4 37\n#define ABMON_5 38\n#define ABMON_6 39\n#define ABMON_7 40\n#define ABMON_8 41\n#define ABMON_9 42\n#define ABMON_10 43\n#define ABMON_11 44\n#define ABMON_12 45\n#define ERA 46\n#define ERA_D_FMT 47\n#define ERA_D_T_FMT 48\n#define ERA_T_FMT 49\n#define ALT_DIGITS 50\n#define RADIXCHAR 51\n#define THOUSEP 52\n#define YESEXPR 53\n#define NOEXPR 54\n#define CRNCYSTR 55\n#define INT_CURRENCY_SYMBOL 55\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstatic char *nl_langinfo_l(nl_item item, locale_t loc)\n{\n\tstatic const char c_time[] =\n\t\t\"Sun\\0\" \"Mon\\0\" \"Tue\\0\" \"Wed\\0\" \"Thu\\0\" \"Fri\\0\" \"Sat\\0\"\n\t\t\"Sunday\\0\" \"Monday\\0\" \"Tuesday\\0\" \"Wednesday\\0\"\n\t\t\"Thursday\\0\" \"Friday\\0\" \"Saturday\\0\"\n\t\t\"Jan\\0\" \"Feb\\0\" \"Mar\\0\" \"Apr\\0\" \"May\\0\" \"Jun\\0\"\n\t\t\"Jul\\0\" \"Aug\\0\" \"Sep\\0\" \"Oct\\0\" \"Nov\\0\" \"Dec\\0\"\n\t\t\"January\\0\"   \"February\\0\" \"March\\0\"    \"April\\0\"\n\t\t\"May\\0\"       \"June\\0\"     \"July\\0\"     \"August\\0\"\n\t\t\"September\\0\" \"October\\0\"  \"November\\0\" \"December\\0\"\n\t\t\"AM\\0\" \"PM\\0\"\n\t\t\"%a %b %e %T %Y\\0\"\n\t\t\"%m/%d/%y\\0\"\n\t\t\"%H:%M:%S\\0\"\n\t\t\"%I:%M:%S %p\\0\"\n\t\t\"\\0\"\n\t\t\"%m/%d/%y\\0\"\n\t\t\"0123456789\"\n\t\t\"%a %b %e %T %Y\\0\"\n\t\t\"%H:%M:%S\";\n\tstatic const char c_messages[] = \"^[yY]\\0\" \"^[nN]\";\n\tstatic const char c_numeric[] = \".\\0\" \"\";\n\tstatic const char c_zero[] = \"UTF-8\\0\" \"UTF-8\\0\"\n\t\t\"%F %T %z\\0\" \"%F\\0\" \"%T\\0\" \"%I:%M:%S %p\\0\"\n\t\t\"AM\\0\" \"PM\\0\"\n\t\t\"Sunday\\0\" \"Monday\\0\" \"Tuesday\\0\" \"Wednesday\\0\"\n\t\t\"Thursday\\0\" \"Friday\\0\"\t\"Saturday\\0\"\n\t\t\"Sun\\0\"\t\"Mon\\0\"\t\"Tue\\0\"\t\"Wed\\0\"\t\"Thu\\0\"\t\"Fri\\0\"\t\"Sat\\0\"\n\t\t\"January\\0\" \"February\\0\" \"March\\0\"\n\t\t\"April\\0\" \"May\\0\" \"June\\0\"\n\t\t\"July\\0\" \"August\\0\" \"September\\0\"\n\t\t\"October\\0\" \"November\\0\" \"December\\0\"\n\t\t\"Jan\\0\"\t\"Feb\\0\"\t\"Mar\\0\"\t\"Apr\\0\"\t\"May\\0\"\t\"Jun\\0\"\n\t\t\"Jul\\0\"\t\"Aug\\0\"\t\"Sep\\0\"\t\"Oct\\0\"\t\"Nov\\0\"\t\"Dec\\0\"\n\t\t\"\\0\" \"\\0\" \"\\0\" \"\\0\" \"\\0\" \".\\0\" \"\\0\"\n\t\t\"^[yY]\\0\" \"^[nN]\\0\" \"\\0\";\n\n\tint cat = item >> 16;\n\tint idx = item & 65535;\n\tconst char *str;\n\n\tif (item == CODESET) return \"UTF-8\";\n\n\tswitch (cat) {\n\tcase 0:\n\t\tif (idx > 55) return NULL;\n\t\tstr = c_zero;\n\t\tbreak;\n\tcase LC_NUMERIC:\n\t\tif (idx > 1) return NULL;\n\t\tstr = c_numeric;\n\t\tbreak;\n\tcase LC_TIME:\n\t\tif (idx > 0x31) return NULL;\n\t\tstr = c_time;\n\t\tbreak;\n\tcase LC_MONETARY:\n\t\tif (idx > 0) return NULL;\n\t\tstr = \"\";\n\t\tbreak;\n\tcase LC_MESSAGES:\n\t\tif (idx > 1) return NULL;\n\t\tstr = c_messages;\n\t\tbreak;\n\tdefault:\n\t\treturn NULL;\n\t}\n\n\tfor (; idx; idx--, str++) for (; *str; str++);\n\treturn (char *)str;\n}\n\nstatic char *nl_langinfo(nl_item item)\n{\n\treturn nl_langinfo_l(item, 0);\n}\n\n#ifdef __cplusplus\n}  // extern \"C\"\n#endif\n\n#endif  /* _LANGINFO_H */\n\n"
  },
  {
    "path": "ndk-patches/langinfo.h.patch",
    "content": "diff -N -a -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/langinfo.h ./usr/include/langinfo.h\n--- /home/fornwall/lib/android-ndk/sysroot/usr/include/langinfo.h\t2017-11-09 09:57:12.000000000 +0100\n+++ ./usr/include/langinfo.h\t1970-01-01 01:00:00.000000000 +0100\n@@ -1,104 +0,0 @@\n-/*\n- * Copyright (C) 2016 The Android Open Source Project\n- * All rights reserved.\n- *\n- * Redistribution and use in source and binary forms, with or without\n- * modification, are permitted provided that the following conditions\n- * are met:\n- *  * Redistributions of source code must retain the above copyright\n- *    notice, this list of conditions and the following disclaimer.\n- *  * Redistributions in binary form must reproduce the above copyright\n- *    notice, this list of conditions and the following disclaimer in\n- *    the documentation and/or other materials provided with the\n- *    distribution.\n- *\n- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n- * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n- * SUCH DAMAGE.\n- */\n-\n-#ifndef _LANGINFO_H_\n-#define _LANGINFO_H_\n-\n-#include <sys/cdefs.h>\n-\n-#include <nl_types.h>\n-#include <xlocale.h>\n-\n-__BEGIN_DECLS\n-\n-#define CODESET 1\n-#define D_T_FMT 2\n-#define D_FMT 3\n-#define T_FMT 4\n-#define T_FMT_AMPM 5\n-#define AM_STR 6\n-#define PM_STR 7\n-#define DAY_1 8\n-#define DAY_2 9\n-#define DAY_3 10\n-#define DAY_4 11\n-#define DAY_5 12\n-#define DAY_6 13\n-#define DAY_7 14\n-#define ABDAY_1 15\n-#define ABDAY_2 16\n-#define ABDAY_3 17\n-#define ABDAY_4 18\n-#define ABDAY_5 19\n-#define ABDAY_6 20\n-#define ABDAY_7 21\n-#define MON_1 22\n-#define MON_2 23\n-#define MON_3 24\n-#define MON_4 25\n-#define MON_5 26\n-#define MON_6 27\n-#define MON_7 28\n-#define MON_8 29\n-#define MON_9 30\n-#define MON_10 31\n-#define MON_11 32\n-#define MON_12 33\n-#define ABMON_1 34\n-#define ABMON_2 35\n-#define ABMON_3 36\n-#define ABMON_4 37\n-#define ABMON_5 38\n-#define ABMON_6 39\n-#define ABMON_7 40\n-#define ABMON_8 41\n-#define ABMON_9 42\n-#define ABMON_10 43\n-#define ABMON_11 44\n-#define ABMON_12 45\n-#define ERA 46\n-#define ERA_D_FMT 47\n-#define ERA_D_T_FMT 48\n-#define ERA_T_FMT 49\n-#define ALT_DIGITS 50\n-#define RADIXCHAR 51\n-#define THOUSEP 52\n-#define YESEXPR 53\n-#define NOEXPR 54\n-#define CRNCYSTR 55\n-\n-\n-#if __ANDROID_API__ >= 26\n-char* nl_langinfo(nl_item __item) __INTRODUCED_IN(26);\n-char* nl_langinfo_l(nl_item __item, locale_t __l) __INTRODUCED_IN(26);\n-#endif /* __ANDROID_API__ >= 26 */\n-\n-\n-__END_DECLS\n-\n-#endif\n"
  },
  {
    "path": "ndk-patches/libintl.h",
    "content": "#ifndef _LIBINTL_H\n#define _LIBINTL_H\n\n#include <errno.h>\n#include <string.h>\n\nstatic __inline__ char* gettext(const char* msgid)\n{ return (char*) msgid; }\n\nstatic __inline__ char* dgettext(const char* domainname, const char* msgid)\n{ return (char*) msgid; }\n\nstatic __inline__ char* dcgettext(const char* domainname, const char* msgid, int category)\n{ return (char*) msgid; }\n\nstatic __inline__ char* ngettext(const char* msgid1, const char* msgid2, unsigned long int n)\n{ return (char *) ((n == 1) ? msgid1 : msgid2); }\n\nstatic __inline__ char* dngettext(const char* domainname, const char* msgid1, const char* msgid2, unsigned long int n)\n{ return (char *) ((n == 1) ? msgid1 : msgid2); }\n\nstatic __inline__ char* dcngettext(const char* domainname, const char* msgid1, const char* msgid2, unsigned long int n, int category)\n{ return (char *) ((n == 1) ? msgid1 : msgid2); }\n\nstatic __inline__ char* textdomain(const char* domainname)\n{\n\tstatic const char default_str[] = \"messages\";\n\tif (domainname && *domainname && strcmp(domainname, default_str)) {\n\t\terrno = EINVAL;\n\t\treturn NULL;\n\t}\n\treturn (char*) default_str;\n}\n\nstatic __inline__ char* bindtextdomain(const char* domainname, const char* dirname)\n{\n\tstatic const char dir[] = \"/\";\n\tif (!domainname || !*domainname || (dirname && ((dirname[0] != '/') || dirname[1]))) {\n\t\terrno = EINVAL;\n\t\treturn NULL;\n\t}\n\treturn (char*) dir;\n}\n\nstatic __inline__ char* bind_textdomain_codeset(const char* domainname, const char* codeset)\n{\n\tif (!domainname || !*domainname || (codeset && strcasecmp(codeset, \"UTF-8\"))) {\n\t\terrno = EINVAL;\n\t}\n\treturn NULL;\n}\n\n#endif\n"
  },
  {
    "path": "ndk-patches/linux-fcntl.h.patch",
    "content": "diff -uNr sysroot.orig/usr/include/linux/fcntl.h sysroot/usr/include/linux/fcntl.h\n--- sysroot.orig/usr/include/linux/fcntl.h\t2019-02-12 16:12:24.000000000 +0000\n+++ sysroot/usr/include/linux/fcntl.h\t2019-03-20 13:22:32.823142545 +0000\n@@ -50,6 +50,12 @@\n #define DN_ATTRIB 0x00000020\n #define DN_MULTISHOT 0x80000000\n #define AT_FDCWD - 100\n+/* Termux patch: This flag is not supported on Android 6.0+, and should not\n+   be needed since there are not setuid binaries. Define AT_EACCESS to 0 to\n+   avoid packages defining their own AT_EACCESS (which e.g. coreutil does)\n+   since that will only result in errors. See:\n+   https://android.googlesource.com/platform/bionic/+/3577825%5E!/      */\n+#define AT_EACCESS 0\n #define AT_SYMLINK_NOFOLLOW 0x100\n #define AT_REMOVEDIR 0x200\n #define AT_SYMLINK_FOLLOW 0x400\n"
  },
  {
    "path": "ndk-patches/paths.h.patch",
    "content": "--- ./usr/include/paths.h.orig\t2019-06-10 00:10:55.544212642 +0000\n+++ ./usr/include/paths.h\t2019-06-10 00:16:51.514412646 +0000\n@@ -38,16 +38,14 @@\n \n #include <sys/cdefs.h>\n \n-#ifndef _PATH_BSHELL\n /** Path to the default system shell. Historically the 'B' was to specify the Bourne shell. */\n-#define _PATH_BSHELL \"/system/bin/sh\"\n-#endif\n+#define        _PATH_BSHELL    \"@TERMUX_PREFIX@/bin/sh\"\n \n /** Path to the system console. */\n #define _PATH_CONSOLE \"/dev/console\"\n \n /** Default shell search path. */\n-#define _PATH_DEFPATH \"/sbin:/system/sbin:/product/bin:/apex/com.android.runtime/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin\"\n+#define        _PATH_DEFPATH   \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets\"\n \n /** Path to the directory containing device files. */\n #define _PATH_DEV \"/dev/\"\n@@ -63,3 +61,9 @@\n \n /** Path to the calling process' tty. */\n #define _PATH_TTY \"/dev/tty\"\n+#define        _PATH_STDPATH   _PATH_DEFPATH\n+#define        _PATH_TMP       \"@TERMUX_PREFIX@/tmp/\"\n+#define        _PATH_VARDB     \"@TERMUX_PREFIX@/var/db/\"\n+#define        _PATH_VARRUN    \"@TERMUX_PREFIX@/var/run/\"\n+#define        _PATH_VARTMP    \"@TERMUX_PREFIX@/var/tmp/\"\n+\n"
  },
  {
    "path": "ndk-patches/pwd.h.patch",
    "content": "diff -uNr sysroot.orig/usr/include/pwd.h sysroot/usr/include/pwd.h\n--- sysroot.orig/usr/include/pwd.h\t2019-02-12 16:12:24.000000000 +0000\n+++ sysroot/usr/include/pwd.h\t2019-03-20 13:26:24.283060011 +0000\n@@ -89,13 +89,58 @@\n struct passwd* getpwent(void) __INTRODUCED_IN(26);\n \n void setpwent(void) __INTRODUCED_IN(26);\n-void endpwent(void) __INTRODUCED_IN(26);\n #endif /* __ANDROID_API__ >= 26 */\n \n \n int getpwnam_r(const char* __name, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12);\n int getpwuid_r(uid_t __uid, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12);\n \n+int access(const char* __path, int __mode);\n+\n+static void android_setup_pwd(struct passwd* pw) {\n+\tchar const* result = \"@TERMUX_PREFIX@/bin/login\";\n+\tif (result == NULL || access(result, /*X_OK*/1) == -1) {\n+\t\tpw->pw_shell = \"@TERMUX_PREFIX@/bin/bash\";\n+\t} else {\n+\t\tpw->pw_shell = (char*) result;\n+\t}\n+\tpw->pw_dir = \"@TERMUX_HOME@\";\n+\tpw->pw_passwd = \"*\";\n+#ifdef __LP64__\n+\tpw->pw_gecos = \"\"; /* Avoid NULL field. */\n+#endif\n+}\n+\n+static struct passwd* android_polyfill_getpwuid(uid_t t) {\n+       struct passwd* pw = getpwuid(t);\n+       if (pw == NULL) return NULL;\n+       android_setup_pwd(pw);\n+       return pw;\n+}\n+\n+static struct passwd* android_polyfill_getpwnam(const char* name) {\n+       struct passwd* pw = getpwnam(name);\n+       if (pw == NULL) return NULL;\n+       android_setup_pwd(pw);\n+       return pw;\n+}\n+\n+static int android_polyfill_getpwuid_r(uid_t uid,\n+                                       struct passwd *pwd,\n+                                       char *buffer,\n+                                       size_t bufsize,\n+                                       struct passwd **result) {\n+       int ret = getpwuid_r(uid, pwd, buffer, bufsize, result);\n+       if (ret != 0) return ret;\n+       android_setup_pwd(pwd);\n+       return 0;\n+}\n+\n+#define getpwnam android_polyfill_getpwnam\n+#define getpwuid android_polyfill_getpwuid\n+#define getpwuid_r android_polyfill_getpwuid_r\n+static void endpwent(void) { /* Do nothing. */ }\n+\n __END_DECLS\n \n #endif\n"
  },
  {
    "path": "ndk-patches/stdio.h.patch",
    "content": "diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/stdio.h ./usr/include/stdio.h\n--- /home/fornwall/lib/android-ndk/sysroot/usr/include/stdio.h  2017-11-09 09:57:12.000000000 +0100\n+++ ./usr/include/stdio.h   2017-11-15 11:57:58.567432093 +0100\n@@ -44,11 +44,12 @@\n #include <stdarg.h>\n #include <stddef.h>\n \n+#include <string.h>            /* For strcpy(3) used by ctermid() */\n+#include <asm/fcntl.h>         /* For O_RDWR and other O_* constants */\n+\n #include <bits/seek_constants.h>\n \n-#if __ANDROID_API__ < __ANDROID_API_N__\n #include <bits/struct_file.h>\n-#endif\n \n __BEGIN_DECLS\n \n@@ -165,7 +166,7 @@\n     __printflike(2, 0) __warnattr_strict(\"vsprintf is often misused; please use vsnprintf\");\n char* tmpnam(char* __s)\n     __warnattr(\"tempnam is unsafe, use mkstemp or tmpfile instead\");\n-#define P_tmpdir \"/tmp/\" /* deprecated */\n+#define P_tmpdir \"@TERMUX_PREFIX@/tmp/\" /* deprecated */\n char* tempnam(const char* __dir, const char* __prefix)\n     __warnattr(\"tempnam is unsafe, use mkstemp or tmpfile instead\");\n \n@@ -241,8 +242,6 @@\n FILE* freopen64(const char* __path, const char* __mode, FILE* __fp) __INTRODUCED_IN(24);\n #endif /* __ANDROID_API__ >= 24 */\n \n-FILE* tmpfile(void);\n-\n #if __ANDROID_API__ >= 24\n FILE* tmpfile64(void) __INTRODUCED_IN(24);\n #endif /* __ANDROID_API__ >= 24 */\n@@ -256,10 +255,15 @@\n \n #define L_ctermid 1024 /* size for ctermid() */\n \n-#if __ANDROID_API__ >= 26\n-char* ctermid(char* __buf) __INTRODUCED_IN(26);\n-#endif /* __ANDROID_API__ >= 26 */\n+/* Needed by gnulibs freading(). */\n+#define __sferror(p)    (((p)->_flags & __SERR) != 0)\n \n+/* Used by perl, fish, and others. */\n+static __inline__ char* ctermid(char* s) {\n+\tif (s == 0) return (char*) \"/dev/tty\";\n+\tstrcpy(s, \"/dev/tty\");\n+\treturn s;\n+}\n \n FILE* fdopen(int __fd, const char* __mode);\n int fileno(FILE* __fp);\n@@ -328,6 +332,29 @@\n #include <bits/fortify/stdio.h>\n #endif\n \n+int open(const char*, int, ...);\n+extern pid_t getpid();\n+extern int unlink(const char*);\n+void free(void* p);\n+uint32_t arc4random(void);\n+static __inline__ FILE* tmpfile() {\n+\tint p = getpid();\n+\tchar* path;\n+\tint i;\n+\tfor (i = 0; i < 100; i++) {\n+\t\tunsigned int r = arc4random();\n+\t\tif (asprintf(&path, \"@TERMUX_PREFIX@/tmp/tmpfile.%d-%u\", p, r) == -1) return NULL;\n+\t\tint fd = open(path, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE, 0600);\n+\t\tfree(path);\n+\t\tif (fd >= 0) {\n+\t\t\tFILE* result = fdopen(fd, \"w+\");\n+\t\t\tunlink(path);\n+\t\t\treturn result;\n+\t\t}\n+\t}\n+\treturn NULL;\n+}\n+\n __END_DECLS\n \n #endif\n"
  },
  {
    "path": "ndk-patches/stdlib.h.patch",
    "content": "diff -uNr sysroot.orig/usr/include/stdlib.h sysroot/usr/include/stdlib.h\n--- sysroot.orig/usr/include/stdlib.h\t2019-02-12 16:12:24.000000000 +0000\n+++ sysroot/usr/include/stdlib.h\t2019-03-20 13:23:48.870108924 +0000\n@@ -33,6 +33,7 @@\n #include <bits/wait.h>\n #include <malloc.h>\n #include <stddef.h>\n+#include <stdint.h>\n #include <sys/cdefs.h>\n #include <xlocale.h>\n \n@@ -211,8 +212,7 @@\n size_t wcstombs(char* __dst, const wchar_t* __src, size_t __n);\n \n #if __ANDROID_API__ >= __ANDROID_API_L__\n-size_t __ctype_get_mb_cur_max(void) __INTRODUCED_IN(21);\n-#define MB_CUR_MAX __ctype_get_mb_cur_max()\n+#define MB_CUR_MAX 4\n #else\n /*\n  * Pre-L we didn't have any locale support and so we were always the POSIX\n"
  },
  {
    "path": "ndk-patches/sys-cdefs.h.patch",
    "content": "diff -uNr sysroot.orig/usr/include/sys/cdefs.h sysroot/usr/include/sys/cdefs.h\n--- sysroot.orig/usr/include/sys/cdefs.h\t2019-02-12 16:12:24.000000000 +0000\n+++ sysroot/usr/include/sys/cdefs.h\t2019-03-20 13:27:29.977876824 +0000\n@@ -206,7 +206,11 @@\n  * _FILE_OFFSET_BITS 64 support.\n  * See https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md\n  */\n-#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64\n+/* Using _FILE_OFFSET_BITS=64 does not work well on Android\n+ * and can cause problems when mixing libraries, which is why\n+ * Termux hides away this unless TERMUX_EXPOSE_FILE_OFFSET64\n+ * is defined. */\n+#if !defined(__LP64__) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64 && defined(TERMUX_EXPOSE_FILE_OFFSET64)\n #  define __USE_FILE_OFFSET64 1\n /*\n  * Note that __RENAME_IF_FILE_OFFSET64 is only valid if the off_t and off64_t\n@@ -336,3 +340,6 @@\n \n #include <android/versioning.h>\n #include <android/api-level.h>\n+\n+#define __TERMUX__ 1\n+#define __TERMUX_PREFIX__ \"@TERMUX_PREFIX@\"\n"
  },
  {
    "path": "ndk-patches/sys-wait.h.patch",
    "content": "diff -uNr sysroot.orig/usr/include/sys/wait.h sysroot/usr/include/sys/wait.h\n--- sysroot.orig/usr/include/sys/wait.h\t2019-02-12 16:12:24.000000000 +0000\n+++ sysroot/usr/include/sys/wait.h\t2019-03-20 13:28:06.689331544 +0000\n@@ -46,6 +46,9 @@\n // Implemented as a static inline before 18.\n #endif\n \n+/* Termux addition: Add wait3() declaration used by busybox. Available in libc for 32-bit only. */\n+static pid_t wait3(int* status, int options, struct rusage* rusage) { return wait4(-1, status, options, rusage); }\n+\n /* Posix states that idtype_t should be an enumeration type, but\n  * the kernel headers define P_ALL, P_PID and P_PGID as constant macros\n  * instead.\n"
  },
  {
    "path": "ndk-patches/syslog.patch",
    "content": "diff -uNr sysroot.orig/usr/include/syslog.h sysroot/usr/include/syslog.h\n--- sysroot.orig/usr/include/syslog.h\t2019-02-12 16:12:24.000000000 +0000\n+++ sysroot/usr/include/syslog.h\t2019-03-20 13:19:44.315965728 +0000\n@@ -32,6 +32,8 @@\n #include <stdio.h>\n #include <sys/cdefs.h>\n #include <stdarg.h>\n+#include <android/log.h> /* for __android_log_vprint() */\n+#include <unistd.h> /* for getpid() */\n \n __BEGIN_DECLS\n \n@@ -92,6 +94,64 @@\n void syslog(int __priority, const char* __fmt, ...) __printflike(2, 3);\n void vsyslog(int __priority, const char* __fmt, va_list __args) __printflike(2, 0);\n \n+extern /*const*/ char* __progname;\n+static __inline__ void android_polyfill_openlog(const char* a, int b, int c) {\n+\t(void) a;\n+\t(void) b;\n+\t(void) c;\n+}\n+static __inline__ void android_polyfill_closelog() {}\n+\n+static __inline__ void android_polyfill_vsyslog(int syslog_priority, char const* format, va_list ap)\n+{\n+\tandroid_LogPriority a = ANDROID_LOG_ERROR;\n+\tswitch (syslog_priority) {\n+\t\tcase LOG_WARNING: a = ANDROID_LOG_WARN; break;\n+\t\tcase LOG_NOTICE\t: a = ANDROID_LOG_INFO; break;\n+\t\tcase LOG_INFO: a = ANDROID_LOG_INFO; break;\n+\t\tcase LOG_DEBUG: a = ANDROID_LOG_DEBUG; break;\n+\t}\n+\tchar* syslog_text;\n+\tif (vasprintf(&syslog_text, format, ap) == -1) {\n+       \t__android_log_vprint(a, \"syslog\", format, ap);\n+\t\treturn;\n+\t}\n+\t__android_log_print(a, \"syslog\", \"%s - %s\", __progname, syslog_text);\n+\tfree(syslog_text);\n+}\n+\n+static __inline__ void android_polyfill_syslog(int priority, const char* format, ...)\n+{\n+\tva_list myargs;\n+\tva_start(myargs, format);\n+\tandroid_polyfill_vsyslog(priority, format, myargs);\n+\tva_end(myargs);\n+}\n+\n+static __inline__ void android_polyfill_syslog_r(int syslog_priority, void* d, const char* format, ...)\n+{\n+\t(void) d;\n+\tva_list myargs;\n+\tva_start(myargs, format);\n+\tandroid_polyfill_vsyslog(syslog_priority, format, myargs);\n+\tva_end(myargs);\n+}\n+\n+static __inline__ void android_polyfill_vsyslog_r(int syslog_priority, void* d, const char* fmt, va_list ap)\n+{\n+\t(void) d;\n+\tandroid_polyfill_vsyslog(syslog_priority, fmt, ap);\n+}\n+\n+#define openlog android_polyfill_openlog\n+#define closelog android_polyfill_closelog\n+\n+#define syslog android_polyfill_syslog\n+#define syslog_r android_polyfill_syslog_r\n+\n+#define vsyslog android_polyfill_vsyslog\n+#define vsyslog_r android_polyfill_vsyslog_r\n+\n __END_DECLS\n \n #endif /* _SYSLOG_H */\n"
  },
  {
    "path": "ndk-patches/unistd.h.patch",
    "content": "--- sysroot/usr/include/unistd.h\t2018-04-30 19:24:22.000000000 +0000\n+++ usr/include/unistd.h\t2018-08-16 10:42:51.158596753 +0000\n@@ -302,6 +302,74 @@\n #include <bits/fortify/unistd.h>\n #endif\n \n+#if !defined GETPASS_H && !defined getpass && !defined HAVE_GETPASS && !defined HAS_GETPASS && !defined NO_INLINE_GETPASS\n+#define GETPASS_H 1\n+#define HAVE_GETPASS 1\n+#define HAS_GETPASS 1\n+#define PASSWORDLEN 512\n+\n+static __inline__ char* getpass(const char* prompt) {\n+    // termios struct as in asm-generic/termbits.h\n+    struct _termios {\n+        unsigned int c_iflag;              /* input mode flags */\n+        unsigned int c_oflag;              /* output mode flags */\n+        unsigned int c_cflag;              /* control mode flags */\n+        unsigned int c_lflag;              /* local mode flags */\n+        unsigned char c_line;              /* line discipline */\n+        unsigned char c_cc[19/* NCCS */];  /* control characters */\n+    };\n+\n+    struct _termios term_old, term_new;\n+    static char password[513] = { 0 }; /* 512 1-byte charactes and '0' */\n+    int len = 0, tty_changed = 0;\n+\n+    // print prompt\n+    while (*prompt) {\n+        write(1, prompt, 1);\n+        prompt++;\n+    }\n+\n+    // try to disable echoing on terminal\n+    if (ioctl(0, 0x5401 /* TCGETS */, &term_old) == 0) {\n+        term_new = term_old;\n+        term_new.c_lflag &= ~0000010;/* ~ECHO */\n+\n+        if (ioctl(0, 0x5402+0 /* TCSETS+TCSANOW */, &term_new) == 0) {\n+            tty_changed = 1;\n+        } else {\n+            tty_changed = 0;\n+        }\n+    }\n+\n+    // read password\n+    char chr;\n+    while (read(0, &chr, sizeof(char)) > 0) {\n+        if (chr == '\\r' || chr == '\\n' || chr == 0) {\n+            break;\n+        }\n+\n+        if (len == sizeof(password)-1) {\n+            // we should consume all entered characters even\n+            // if maximal input length reached\n+            continue;\n+        } else {\n+            password[len++] = chr;\n+        }\n+    }\n+    password[len] = 0;\n+\n+    // restore terminal to previous state if needed\n+    if (tty_changed) {\n+        ioctl(0, 0x5402+0 /* TCSETS+TCSANOW */, &term_old);\n+    }\n+\n+    // force new line\n+    write(1, \"\\n\", 1);\n+\n+    return password;\n+}\n+#endif\n+\n __END_DECLS\n \n #endif\n"
  },
  {
    "path": "packages/aapt/aapt-Main.cpp.patch.txt",
    "content": "diff -u -r ../../src-pristine/aapt/Main.cpp ./Main.cpp\n--- ../../src-pristine/aapt/Main.cpp\t2016-10-07 15:12:44.322248606 -0400\n+++ ./Main.cpp\t2016-10-07 15:18:50.708065085 -0400\n@@ -268,6 +268,9 @@\n     /* default to compression */\n     bundle.setCompressionMethod(ZipEntry::kCompressDeflated);\n \n+    // Convenience when using aapt in termux.\n+    bundle.addPackageInclude(\"@TERMUX_PREFIX@/share/aapt/android.jar\");\n+\n     if (argc < 2) {\n         wantUsage = true;\n         goto bail;\n"
  },
  {
    "path": "packages/aapt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://elinux.org/Android_aapt\nTERMUX_PKG_DESCRIPTION=\"Android Asset Packaging Tool\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\n_TAG_VERSION=7.1.2\n_TAG_REVISION=33\nTERMUX_PKG_VERSION=${_TAG_VERSION}.${_TAG_REVISION}\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"libc++, libexpat, libpng, libzopfli, zlib\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_make_install() {\n\t# FIXME: We would like to enable checksums when downloading\n\t# tar files, but they change each time as the tar metadata\n\t# differs: https://github.com/google/gitiles/issues/84\n\n\tlocal _TAGNAME=${_TAG_VERSION}_r${_TAG_REVISION}\n\n\tSYSTEM_CORE_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/system_core_include_${_TAGNAME}.tar.gz\n\ttest ! -f $SYSTEM_CORE_INCLUDE_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/include.tar.gz\" \\\n\t\t$SYSTEM_CORE_INCLUDE_TARFILE \\\n\t\tSKIP_CHECKSUM\n\n\tANDROIDFW_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/androidfw_include_${_TAGNAME}.tar.gz\n\ttest ! -f $ANDROIDFW_INCLUDE_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/frameworks/base/+archive/android-$_TAGNAME/include/androidfw.tar.gz\" \\\n\t\t$ANDROIDFW_INCLUDE_TARFILE \\\n\t\tSKIP_CHECKSUM\n\n\tANDROID_BASE_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/android_base_include_${_TAGNAME}.tar.gz\n\ttest ! -f $ANDROID_BASE_INCLUDE_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/base/include/android-base.tar.gz\" \\\n\t\t$ANDROID_BASE_INCLUDE_TARFILE \\\n\t\tSKIP_CHECKSUM\n\n\tlocal AOSP_INCLUDE_DIR=$TERMUX_PREFIX/include/aosp\n\tmkdir -p $AOSP_INCLUDE_DIR\n\tcd $AOSP_INCLUDE_DIR\n\trm -Rf *\n\ttar xf $SYSTEM_CORE_INCLUDE_TARFILE\n\tmkdir -p androidfw\n\tcd androidfw\n\ttar xf $ANDROIDFW_INCLUDE_TARFILE\n\tcd ..\n\tmkdir -p android-base\n\tcd android-base\n\ttar xf $ANDROID_BASE_INCLUDE_TARFILE\n\tcd ../log\n\tpatch -p0 < $TERMUX_PKG_BUILDER_DIR/log.h.patch.txt\n\n\tCXXFLAGS+=\" -fPIC\"\n\n\t# Build libcutils:\n\tmkdir -p $TERMUX_PKG_SRCDIR/{libcutils,androidfw}\n\tcd $TERMUX_PKG_SRCDIR/libcutils\n\tLIBCUTILS_TARFILE=$TERMUX_PKG_CACHEDIR/libcutils_${_TAGNAME}.tar.gz\n\ttest ! -f $LIBCUTILS_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libcutils.tar.gz\" \\\n\t\t$LIBCUTILS_TARFILE \\\n\t\tSKIP_CHECKSUM\n\ttar xf $LIBCUTILS_TARFILE\n\tpatch -p0 < $TERMUX_PKG_BUILDER_DIR/libcutils-patch.txt\n\t$CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets.o sockets.cpp\n\t$CXX $CXXFLAGS -isystem $AOSP_INCLUDE_DIR -c -o sockets_unix.o sockets_unix.cpp\n\tsed -i 's%include <sys/_system_properties.h>%include <sys/system_properties.h>%' properties.c\n\t# From Android.mk:\n\tlibcutils_common_sources=\"\\\n\t\tconfig_utils.c \\\n\t\tfs_config.c \\\n\t\tcanned_fs_config.c \\\n\t\thashmap.c \\\n\t\tiosched_policy.c \\\n\t\tload_file.c \\\n\t\tnative_handle.c \\\n\t\topen_memstream.c \\\n\t\tprocess_name.c \\\n\t\trecord_stream.c \\\n\t\tsched_policy.c \\\n\t\tsockets.o \\\n\t\tstrdup16to8.c \\\n\t\tstrdup8to16.c \\\n\t\tstrlcpy.c \\\n\t\tthreads.c\"\n\tlibcutils_nonwindows_sources=\"\\\n\t\tfs.c \\\n\t\tmultiuser.c \\\n\t\tsocket_inaddr_any_server_unix.c \\\n\t\tsocket_local_client_unix.c \\\n\t\tsocket_local_server_unix.c \\\n\t\tsocket_loopback_client_unix.c \\\n\t\tsocket_loopback_server_unix.c \\\n\t\tsocket_network_client_unix.c \\\n\t\tsockets_unix.o \\\n\t\tstr_parms.c\"\n\t# -D_FORTIFY_SOURCE=2 makes debug build fail with:\n\t# In file included from process_name.c:29:\n\t# /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:116:45: error: expected identifier\n\t# __errordecl(__property_get_too_small_error, \"property_get() called with too small of a buffer\");\n\t#\t\t\t\t\t\t^\n\t# /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:119:5: error: static declaration of 'property_get' follows non-static declaration\n\t# int property_get(const char *key, char *value, const char *default_value) {\n\t#\t^\n\t# /data/data/com.termux/files/usr/include/aosp/cutils/properties.h:46:5: note: previous declaration is here\n\t# int property_get(const char *key, char *value, const char *default_value);\n\t$CC ${CFLAGS/-D_FORTIFY_SOURCE=2/} \\\n\t\t$LDFLAGS \\\n\t\t-Dchar16_t=uint16_t \\\n\t\t-std=c11 \\\n\t\t-isystem $AOSP_INCLUDE_DIR \\\n\t\t$libcutils_common_sources \\\n\t\t$libcutils_nonwindows_sources \\\n\t\ttrace-host.c \\\n\t\tproperties.c \\\n\t\t-llog \\\n\t\t-shared \\\n\t\t-o $TERMUX_PREFIX/lib/libandroid-cutils.so\n\n\n\n\t# Build libutil:\n\tlocal LIBUTILS_TARFILE=$TERMUX_PKG_CACHEDIR/libutils_${_TAGNAME}.tar.gz\n\ttest ! -f $LIBUTILS_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libutils.tar.gz\" \\\n\t\t$LIBUTILS_TARFILE \\\n\t\tSKIP_CHECKSUM\n\n\tlocal SAFE_IOP_TARFILE=$TERMUX_PKG_CACHEDIR/safe_iop.tar.gz\n\ttest ! -f $SAFE_IOP_TARFILE && termux_download \\\n\t\thttps://android.googlesource.com/platform/external/safe-iop/+archive/cd76f998688d145235de78ecd5b340d0eac9239d.tar.gz \\\n\t\t$SAFE_IOP_TARFILE \\\n\t\tSKIP_CHECKSUM\n\tlocal SAFE_IOP_DIR=$TERMUX_PKG_TMPDIR/safe-iop\n\tmkdir -p $SAFE_IOP_DIR\n\tcd $SAFE_IOP_DIR\n\ttar xf $SAFE_IOP_TARFILE\n\tmv src/safe_iop.c src/safe_iop.cpp\n\n\tmkdir $TERMUX_PKG_SRCDIR/libutils\n\tcd $TERMUX_PKG_SRCDIR/libutils\n\ttar xf $LIBUTILS_TARFILE\n\t# From Android.mk:\n\t#CallStack.cpp \\\n\t#SystemClock.cpp \\\n\tcommonSources=\"\\\n\t\tFileMap.cpp \\\n\t\tJenkinsHash.cpp \\\n\t\tLinearTransform.cpp \\\n\t\tLog.cpp \\\n\t\tNativeHandle.cpp \\\n\t\tPrinter.cpp \\\n\t\tPropertyMap.cpp \\\n\t\tRefBase.cpp \\\n\t\tSharedBuffer.cpp \\\n\t\tStatic.cpp \\\n\t\tStopWatch.cpp \\\n\t\tString8.cpp \\\n\t\tString16.cpp \\\n\t\tThreads.cpp \\\n\t\tTimers.cpp \\\n\t\tTokenizer.cpp \\\n\t\tUnicode.cpp \\\n\t\tVectorImpl.cpp \\\n\t\tmisc.cpp\"\n\t$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \\\n\t\t-std=c++11 \\\n\t\t'-DALOG_ASSERT(a,...)=' \\\n\t\t-Dtypeof=decltype \\\n\t\t-isystem $TERMUX_PREFIX/include/aosp \\\n\t\t-isystem $SAFE_IOP_DIR/include \\\n\t\t$SAFE_IOP_DIR/src/safe_iop.cpp \\\n\t\t$commonSources \\\n\t\t-landroid-cutils \\\n\t\t-llog \\\n\t\t-shared \\\n\t\t-o $TERMUX_PREFIX/lib/libandroid-utils.so\n\n\n\n\t# Build libbase:\n\tlocal LIBBASE_TARFILE=$TERMUX_PKG_CACHEDIR/libbase_${_TAGNAME}.tar.gz\n\ttest ! -f $LIBBASE_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/system/core/+archive/android-${_TAGNAME}/base.tar.gz\" \\\n\t\t$LIBBASE_TARFILE \\\n\t\tSKIP_CHECKSUM\n\tmkdir -p $TERMUX_PKG_SRCDIR/libbase\n\tcd $TERMUX_PKG_SRCDIR/libbase\n\ttar xf $LIBBASE_TARFILE\n\trm -Rf $TERMUX_PREFIX/include/aosp/android-base\n\tmv include/android-base $TERMUX_PREFIX/include/aosp\n\tpatch -p1 < $TERMUX_PKG_BUILDER_DIR/libbase-patch.txt\n\t#logging.cpp \\\n\tlibbase_src_files=\"\\\n\t\tfile.cpp \\\n\t\tparsenetaddress.cpp \\\n\t\tstringprintf.cpp \\\n\t\tstrings.cpp \\\n\t\ttest_utils.cpp\"\n\tlibbase_linux_src_files=\"\\\n\t\terrors_unix.cpp\"\n\t# __USE_BSD for DEFFILEMODE to be defined by <sys/stat.h>.\n\t$CXX $CXXFLAGS $CPPFLAGS \\\n\t\t$LDFLAGS \\\n\t\t-std=c++11 \\\n\t\t-include memory \\\n\t\t-D__USE_BSD \\\n\t\t-isystem $AOSP_INCLUDE_DIR \\\n\t\t$libbase_src_files $libbase_linux_src_files \\\n\t\t-llog \\\n\t\t-shared \\\n\t\t-o $TERMUX_PREFIX/lib/libandroid-base.so\n\n\n\t# Build libziparchive:\n\tLIBZIPARCHIVE_TARFILE=$TERMUX_PKG_CACHEDIR/libziparchive_${_TAGNAME}.tar.gz\n\ttest ! -f $LIBZIPARCHIVE_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/system/core/+archive/android-$_TAGNAME/libziparchive.tar.gz\" \\\n\t\t$LIBZIPARCHIVE_TARFILE \\\n\t\tSKIP_CHECKSUM\n\tmkdir -p $TERMUX_PKG_SRCDIR/libziparchive\n\tcd $TERMUX_PKG_SRCDIR/libziparchive\n\ttar xf $LIBZIPARCHIVE_TARFILE\n\tlibziparchive_source_files=\"\\\n\t\tzip_archive.cc \\\n\t\tzip_archive_stream_entry.cc \\\n\t\tzip_writer.cc\"\n\tpatch -p0 < $TERMUX_PKG_BUILDER_DIR/libziparchive.patch.txt\n\t$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -std=c++11 \\\n\t\t-DZLIB_CONST \\\n\t\t-isystem $AOSP_INCLUDE_DIR \\\n\t\t$libziparchive_source_files \\\n\t\t-landroid-base \\\n\t\t-landroid-utils \\\n\t\t-lz \\\n\t\t-llog \\\n\t\t-shared \\\n\t\t-o $TERMUX_PREFIX/lib/libandroid-ziparchive.so\n\n\n\n\t# Build libandroidfw:\n\tANDROIDFW_TARFILE=$TERMUX_PKG_CACHEDIR/androidfw_${_TAGNAME}.tar.gz\n\ttest ! -f $ANDROIDFW_TARFILE && termux_download \\\n\t\thttps://android.googlesource.com/platform/frameworks/base/+archive/android-$_TAGNAME/libs/androidfw.tar.gz \\\n\t\t$ANDROIDFW_TARFILE \\\n\t\tSKIP_CHECKSUM\n\tmkdir -p $TERMUX_PKG_SRCDIR/androidfw\n\tcd $TERMUX_PKG_SRCDIR/androidfw\n\ttar xf $ANDROIDFW_TARFILE\n\tcommonSources=\"\\\n\t\tAsset.cpp \\\n\t\tAssetDir.cpp \\\n\t\tAssetManager.cpp \\\n\t\tLocaleData.cpp \\\n\t\tmisc.cpp \\\n\t\tObbFile.cpp \\\n\t\tResourceTypes.cpp \\\n\t\tStreamingZipInflater.cpp \\\n\t\tTypeWrappers.cpp \\\n\t\tZipFileRO.cpp \\\n\t\tZipUtils.cpp\"\n\tsed -i 's%#include <binder/TextOutput.h>%%' ResourceTypes.cpp\n\t$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -isystem $AOSP_INCLUDE_DIR \\\n\t\t-std=c++11 \\\n\t\t-include memory \\\n\t\t$commonSources \\\n\t\t-landroid-cutils \\\n\t\t-landroid-utils \\\n\t\t-landroid-ziparchive \\\n\t\t-llog \\\n\t\t-lz \\\n\t\t-shared \\\n\t\t-o $TERMUX_PREFIX/lib/libandroid-fw.so\n\n\t# Build aapt:\n\tAAPT_TARFILE=$TERMUX_PKG_CACHEDIR/aapt_${_TAGNAME}.tar.gz\n\ttest ! -f $AAPT_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/frameworks/base/+archive/android-$_TAGNAME/tools/aapt.tar.gz\" \\\n\t\t$AAPT_TARFILE \\\n\t\tSKIP_CHECKSUM\n\tmkdir $TERMUX_PKG_SRCDIR/aapt\n\tcd $TERMUX_PKG_SRCDIR/aapt\n\ttar xf $AAPT_TARFILE\n\tsed \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PKG_BUILDER_DIR/aapt-Main.cpp.patch.txt | patch -p1\n\t$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \\\n\t\t-std=c++11 \\\n\t\t-include memory \\\n\t\t-DANDROID_SMP=1 \\\n\t\t-DNDEBUG=1 \\\n\t\t-DHAVE_ENDIAN_H=1 -DHAVE_POSIX_FILEMAP=1 -DHAVE_OFF64_T=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_PTHREADS=1 \\\n\t\t-isystem $AOSP_INCLUDE_DIR \\\n\t\t*.cpp \\\n\t\t-landroid-cutils -landroid-utils -landroid-fw -landroid-ziparchive \\\n\t\t-llog \\\n\t\t-lm -lz -lpng -lexpat \\\n\t\t-pie \\\n\t\t-o $TERMUX_PREFIX/bin/aapt\n\n\n\n\t# Build zipalign:\n\tZIPALIGN_TARFILE=$TERMUX_PKG_CACHEDIR/zipalign_${_TAGNAME}.tar.gz\n\ttest ! -f $ZIPALIGN_TARFILE && termux_download \\\n\t\t\"https://android.googlesource.com/platform/build.git/+archive/android-$_TAGNAME/tools/zipalign.tar.gz\" \\\n\t\t$ZIPALIGN_TARFILE \\\n\t\tSKIP_CHECKSUM\n\tmkdir $TERMUX_PKG_SRCDIR/zipalign\n\tcd $TERMUX_PKG_SRCDIR/zipalign\n\ttar xf $ZIPALIGN_TARFILE\n\t$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS \\\n\t\t-isystem $AOSP_INCLUDE_DIR \\\n\t\t-std=c++11 \\\n\t\tZipAlign.cpp ZipEntry.cpp ZipFile.cpp \\\n\t\t-landroid-cutils -landroid-utils -landroid-fw \\\n\t\t-lm -lz -llog \\\n\t\t-lzopfli \\\n\t\t-pie \\\n\t\t-o $TERMUX_PREFIX/bin/zipalign\n\n\n\t# Remove this one for now:\n\trm -Rf $AOSP_INCLUDE_DIR\n\n\t# Create an android.jar with AndroidManifest.xml and resources.arsc:\n\tcd $TERMUX_PKG_TMPDIR\n\trm -rf android-jar\n\tmkdir android-jar\n\tcd android-jar\n\tcp $ANDROID_HOME/platforms/android-28/android.jar .\n\tunzip -q android.jar\n\tmkdir -p $TERMUX_PREFIX/share/aapt\n\tjar cfM $TERMUX_PREFIX/share/aapt/android.jar AndroidManifest.xml resources.arsc\n}\n"
  },
  {
    "path": "packages/aapt/libbase-patch.txt",
    "content": "diff -u -r ../../libbase/logging.cpp ./logging.cpp\n--- ../../libbase/logging.cpp\t2016-09-01 11:56:01.000000000 -0400\n+++ ./logging.cpp\t2016-09-01 12:17:04.405086704 -0400\n@@ -46,7 +46,6 @@\n \n // Headers for LogMessage::LogLine.\n #ifdef __ANDROID__\n-#include <android/set_abort_message.h>\n #include \"cutils/log.h\"\n #else\n #include <sys/types.h>\n@@ -398,9 +397,6 @@\n \n   // Abort if necessary.\n   if (data_->GetSeverity() == FATAL) {\n-#ifdef __ANDROID__\n-    android_set_abort_message(msg.c_str());\n-#endif\n     abort();\n   }\n }\n"
  },
  {
    "path": "packages/aapt/libcutils-patch.txt",
    "content": "https://android.googlesource.com/platform/system/core/+/84421d8475ca8262a914b3875ed110fc6187ee74\n\nAdd ioprio values directly.\n\nThe ioprio.h header is not a uapi header, so remove it's use and\nadd the two values that this code needs to use.\n\nBug: 30072483\nChange-Id: I5c8b6f40bd60a43f50ac26792f96d2fa3f6db020\n\ndiff -u -r ../libcutils-orig/iosched_policy.c ./iosched_policy.c\n--- ../libcutils-orig/iosched_policy.c\t2017-06-28 13:45:36.296011839 +0200\n+++ ./iosched_policy.c\t2017-06-28 13:45:47.307888245 +0200\n@@ -24,7 +24,8 @@\n #include <cutils/iosched_policy.h>\n \n #if defined(__ANDROID__)\n-#include <linux/ioprio.h>\n+#define IOPRIO_WHO_PROCESS (1)\n+#define IOPRIO_CLASS_SHIFT (13)\n #include <sys/syscall.h>\n #define __android_unused\n #else\n"
  },
  {
    "path": "packages/aapt/libziparchive.patch.txt",
    "content": "Remove reference to __android_log_error_write which does not exist\non Android 5. See:\n\n  https://github.com/termux/termux-packages/issues/1306\n\ndiff -u -r ../../pristine-src/libziparchive/zip_archive.cc ./zip_archive.cc\n--- ../../pristine-src/libziparchive/zip_archive.cc\t2017-08-23 21:25:26.492287975 +0200\n+++ ./zip_archive.cc\t2017-08-23 21:31:15.904280978 +0200\n@@ -272,11 +272,6 @@\n   if (static_cast<off64_t>(eocd->cd_start_offset) + eocd->cd_size > eocd_offset) {\n     ALOGW(\"Zip: bad offsets (dir %\" PRIu32 \", size %\" PRIu32 \", eocd %\" PRId64 \")\",\n         eocd->cd_start_offset, eocd->cd_size, static_cast<int64_t>(eocd_offset));\n-#if defined(__ANDROID__)\n-    if (eocd->cd_start_offset + eocd->cd_size <= eocd_offset) {\n-      android_errorWriteLog(0x534e4554, \"31251826\");\n-    }\n-#endif\n     return kInvalidOffset;\n   }\n   if (eocd->num_records == 0) {\n@@ -388,9 +383,6 @@\n   for (uint16_t i = 0; i < num_entries; i++) {\n     if (ptr > cd_end - sizeof(CentralDirectoryRecord)) {\n       ALOGW(\"Zip: ran off the end (at %\" PRIu16 \")\", i);\n-#if defined(__ANDROID__)\n-      android_errorWriteLog(0x534e4554, \"36392138\");\n-#endif\n       return -1;\n     }\n \n"
  },
  {
    "path": "packages/aapt/log.h.patch.txt",
    "content": "--- log-orig.h\t2017-03-04 02:11:04.589477520 +0100\n+++ log.h\t2017-03-04 02:11:54.556875283 +0100\n@@ -217,7 +217,7 @@\n  */\n #ifndef SLOGV\n #define __SLOGV(...) \\\n-    ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))\n+    ((void)__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))\n #if LOG_NDEBUG\n #define SLOGV(...) do { if (0) { __SLOGV(__VA_ARGS__); } } while (0)\n #else\n@@ -231,7 +231,7 @@\n #else\n #define SLOGV_IF(cond, ...) \\\n     ( (__predict_false(cond)) \\\n-    ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \\\n+    ? ((void)__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \\\n     : (void)0 )\n #endif\n #endif\n@@ -241,13 +241,13 @@\n  */\n #ifndef SLOGD\n #define SLOGD(...) \\\n-    ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))\n+    ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))\n #endif\n \n #ifndef SLOGD_IF\n #define SLOGD_IF(cond, ...) \\\n     ( (__predict_false(cond)) \\\n-    ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \\\n+    ? ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \\\n     : (void)0 )\n #endif\n \n@@ -256,13 +256,13 @@\n  */\n #ifndef SLOGI\n #define SLOGI(...) \\\n-    ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))\n+    ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))\n #endif\n \n #ifndef SLOGI_IF\n #define SLOGI_IF(cond, ...) \\\n     ( (__predict_false(cond)) \\\n-    ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \\\n+    ? ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \\\n     : (void)0 )\n #endif\n \n@@ -271,13 +271,13 @@\n  */\n #ifndef SLOGW\n #define SLOGW(...) \\\n-    ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))\n+    ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))\n #endif\n \n #ifndef SLOGW_IF\n #define SLOGW_IF(cond, ...) \\\n     ( (__predict_false(cond)) \\\n-    ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \\\n+    ? ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \\\n     : (void)0 )\n #endif\n \n@@ -286,13 +286,13 @@\n  */\n #ifndef SLOGE\n #define SLOGE(...) \\\n-    ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))\n+    ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))\n #endif\n \n #ifndef SLOGE_IF\n #define SLOGE_IF(cond, ...) \\\n     ( (__predict_false(cond)) \\\n-    ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \\\n+    ? ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \\\n     : (void)0 )\n #endif\n \n"
  },
  {
    "path": "packages/abduco/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.brain-dump.org/projects/abduco/\nTERMUX_PKG_DESCRIPTION=\"Clean and simple terminal session manager\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_VERSION=0.6\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://www.brain-dump.org/projects/abduco/abduco-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=c90909e13fa95770b5afc3b59f311b3d3d2fdfae23f9569fa4f96a3e192a35f4\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"dvtm\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $CPPFLAGS\"\n}\n"
  },
  {
    "path": "packages/abook/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://abook.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Abook is a text-based addressbook program designed to use with mutt mail client\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.6.1\nTERMUX_PKG_SHA256=f0a90df8694fb34685ecdd45d97db28b88046c15c95e7b0700596028bd8bc0f9\nTERMUX_PKG_SRCURL=http://abook.sourceforge.net/devel/abook-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses, readline\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=$TERMUX_PREFIX/share/man\"\n\ntermux_step_pre_configure() {\n\taclocal\n\tautomake --add-missing\n\tautoreconf\n}\n"
  },
  {
    "path": "packages/abook/database.h.patch",
    "content": "diff -u -r ../abook-0.6.0pre2/database.h ./database.h\n--- ../abook-0.6.0pre2/database.h\t2006-09-04 21:24:18.000000000 +0200\n+++ ./database.h\t2017-01-15 21:47:00.441932233 +0100\n@@ -60,7 +60,7 @@\n /*\n  * Field operations\n  */\n-inline int field_id(int i);\n+int field_id(int i);\n abook_field *find_standard_field(char *key, int do_declare);\n abook_field *real_find_field(char *key, abook_field_list *list, int *nb);\n #define find_field(key, list)\t\treal_find_field(key, list, NULL)\n"
  },
  {
    "path": "packages/abook/filter.c.patch",
    "content": "diff -u -r ../abook-0.6.0pre2/filter.c ./filter.c\n--- ../abook-0.6.0pre2/filter.c\t2006-09-06 01:26:10.000000000 -0400\n+++ ./filter.c\t2016-08-09 15:02:24.050415314 -0400\n@@ -146,6 +146,9 @@\n get_real_name()\n {\n \tchar *username = getenv(\"USER\");\n+#ifdef __ANDROID__\n+\treturn xstrdup(username);\n+#else\n \tstruct passwd *pwent;\n \tint rtn;\n \tchar *tmp;\n@@ -161,6 +164,7 @@\n \t\treturn xstrdup(username);\n \t} else\n \t\treturn tmp;\n+#endif\n }\n \n /*\n"
  },
  {
    "path": "packages/ack-grep/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://beyondgrep.com/\nTERMUX_PKG_DESCRIPTION=\"Tool like grep optimized for programmers\"\nTERMUX_PKG_LICENSE=\"Artistic-License-2.0\"\nTERMUX_PKG_VERSION=3.2.0\nTERMUX_PKG_SRCURL=https://beyondgrep.com/ack-v${TERMUX_PKG_VERSION}\nTERMUX_PKG_SHA256=dee06c35c2f432ceedf6b0dad6d393c946d49d51af4e1e031be13445a0e6ce55\nTERMUX_PKG_DEPENDS=\"perl\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\ttermux_download \\\n\t\t$TERMUX_PKG_SRCURL \\\n\t\t$TERMUX_PREFIX/bin/ack \\\n\t\t$TERMUX_PKG_SHA256\n\ttouch $TERMUX_PREFIX/bin/ack\n\tchmod +x $TERMUX_PREFIX/bin/ack\n}\n"
  },
  {
    "path": "packages/acr/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/radare/acr\nTERMUX_PKG_DESCRIPTION=\"A fully compatible autoconf replacement\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.7.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/radare/acr/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=93571bc141b53f838fb40f6e53f958c56b6abf7520d151874e8707db7cb9c4c6\nTERMUX_PKG_DEPENDS=\"dash\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/acr/no_dev-stderr.patch",
    "content": "diff -uNr acr-1.7.2/doc/developers/string-mode acr-1.7.2.mod/doc/developers/string-mode\n--- acr-1.7.2/doc/developers/string-mode\t2019-02-19 06:32:31.000000000 +0200\n+++ acr-1.7.2.mod/doc/developers/string-mode\t2019-10-29 02:54:47.891089384 +0200\n@@ -20,7 +20,7 @@\n \twait_string_mode\n \n \t# do whatever i want with the string\n-\techo \"My string is: ${STRING}\" >/dev/stderr\n+\techo \"My string is: ${STRING}\" >/proc/self/fd/2\n \n \tleave_string_mode\n ;;\ndiff -uNr acr-1.7.2/src/acr acr-1.7.2.mod/src/acr\n--- acr-1.7.2/src/acr\t2019-02-19 06:32:31.000000000 +0200\n+++ acr-1.7.2.mod/src/acr\t2019-10-29 02:55:12.247853031 +0200\n@@ -93,7 +93,7 @@\n \t\tbreak;\n \t\t;;\n \t\"-D\"|\"--dist\")\n-\t\techo \"[1/4] Parsing configure.acr.\" >/dev/stderr\n+\t\techo \"[1/4] Parsing configure.acr.\" >/proc/self/fd/2\n \t\tPBAR=1\n \t\tMAKEDIST=1\n \t\tNOPE=1\n@@ -140,7 +140,7 @@\n done\n \n #if [ \"`echo ${ACRFILE}|cut -c 1`\" = \"-\" ]; then\n-#\techo \"error: unknown flag '${ACRFILE}'.\" > /dev/stderr\n+#\techo \"error: unknown flag '${ACRFILE}'.\" > /proc/self/fd/2\n #\texit 1\n #fi\n \n@@ -151,7 +151,7 @@\n fi\n \n if [ ! -f \"${ACRFILE}\" ]; then\n-\techo \"error: file ${ACRFILE} not found\" > /dev/stderr\n+\techo \"error: file ${ACRFILE} not found\" > /proc/self/fd/2\n \texit 1\n fi\n \ndiff -uNr acr-1.7.2/src/acr-cat acr-1.7.2.mod/src/acr-cat\n--- acr-1.7.2/src/acr-cat\t2019-02-19 06:32:31.000000000 +0200\n+++ acr-1.7.2.mod/src/acr-cat\t2019-10-29 02:55:54.901355928 +0200\n@@ -47,18 +47,18 @@\n fi\n \n if [ ! -f \"$1\" ]; then\n-\techo \"error: target file '$1' does not exist.\" > /dev/stderr\n+\techo \"error: target file '$1' does not exist.\" > /proc/self/fd/2\n \texit 1\n fi\n \n if [ ! -x \"$1\" ]; then\n-\techo \"error: target file '$1' is not executable.\" > /dev/stderr\n+\techo \"error: target file '$1' is not executable.\" > /proc/self/fd/2\n \texit 1\n fi\n \n VERSION=\"`./${1} --version 2>/dev/null`\"\n if [ -z \"`echo ${VERSION} | grep ACR`\" ]; then\n-\techo \"error: this is not an acr generated configure script.\" > /dev/stderr\n+\techo \"error: this is not an acr generated configure script.\" > /proc/self/fd/2\n \texit 1\n fi\n \ndiff -uNr acr-1.7.2/src/amr acr-1.7.2.mod/src/amr\n--- acr-1.7.2/src/amr\t2019-02-19 06:32:31.000000000 +0200\n+++ acr-1.7.2.mod/src/amr\t2019-10-29 02:55:36.927951184 +0200\n@@ -114,7 +114,7 @@\n \t\t[ \"$A\" = \"$FILE\" ] && return\n \tdone\n \n-\techo \"CInclude ${FILE} not found\" > /dev/stderr\n+\techo \"CInclude ${FILE} not found\" > /proc/self/fd/2\n \texit 1\n }\n \n@@ -124,7 +124,7 @@\n \t\t[ \"$A\" = \"$FILE\" ] && return\n \tdone\n \n-\techo \"CSource ${FILE} not found\" > /dev/stderr\n+\techo \"CSource ${FILE} not found\" > /proc/self/fd/2\n \texit 1\n }\n \n@@ -212,7 +212,7 @@\n \n parse_configure_amr() {\n FILE=$1\n-echo \"Parsing ${FILE}...\" >/dev/stderr\n+echo \"Parsing ${FILE}...\" >/proc/self/fd/2\n CONFIGURE_AMR=\"`cat ${FILE} 2>/dev/null`\"\n for A in $CONFIGURE_AMR ; do\n \t# TODO: Support for oneline commands and /* */\n@@ -268,7 +268,7 @@\n \t\t\teval \"${CDEPS_VAR}=\\\"\\$${CDEPS_VAR} ${A}\\\"\"\n \t\t\t;;\n \t\t*|0)\n-\t\t\techo \"Invalid keyword '$A'\" > /dev/stderr\n+\t\t\techo \"Invalid keyword '$A'\" > /proc/self/fd/2\n \t\t\texit 1\n \t\t\t;;\n \t\tesac\n"
  },
  {
    "path": "packages/algernon/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://algernon.roboticoverlords.org/\nTERMUX_PKG_DESCRIPTION=\"Small self-contained web server with Lua, Markdown, QUIC, Redis and PostgreSQL support\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.12.5\nTERMUX_PKG_SRCURL=https://github.com/xyproto/algernon/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=b7fe682748e060c404aff5cbcbeca83feb9afb25de15c91a14c1fe78485b423b\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/github.com/xyproto\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/xyproto/algernon\n\n\tcd \"$GOPATH\"/src/github.com/xyproto/algernon\n\n\t# Needed to deal with following error on v1.12.5:\n\t#  verifying github.com/lucas-clemente/quic-go@v0.12.0: checksum mismatch\n\trm -f go.sum\n\n\tgo build\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/src/github.com/xyproto/algernon/algernon \\\n\t\t\"$TERMUX_PREFIX\"/bin/\n\n\t# Offline samples may be useful to get started with Algernon.\n\trm -rf \"$TERMUX_PREFIX\"/share/doc/algernon\n\tmkdir -p \"$TERMUX_PREFIX\"/share/doc/algernon\n\tcp -a \"$GOPATH\"/src/github.com/xyproto/algernon/samples \\\n\t\t\"$TERMUX_PREFIX\"/share/doc/algernon/\n}\n"
  },
  {
    "path": "packages/algernon/fix-hardcoded-paths.patch",
    "content": "diff -uNr algernon-1.12.3/engine/config.go algernon-1.12.3.mod/engine/config.go\n--- algernon-1.12.3/engine/config.go\t2019-02-19 17:14:55.000000000 +0200\n+++ algernon-1.12.3.mod/engine/config.go\t2019-02-25 19:41:17.564347427 +0200\n@@ -273,16 +273,16 @@\n \t\tdefaultLimitString: strconv.Itoa(10),\n \n \t\t// Default Bolt database file, for some operating systems\n-\t\tdefaultBoltFilename: \"/tmp/algernon.db\",\n+\t\tdefaultBoltFilename: \"@TERMUX_PREFIX@/tmp/algernon.db\",\n \n \t\t// Default log file, for some operating systems\n-\t\tdefaultLogFile: \"/tmp/algernon.log\",\n+\t\tdefaultLogFile: \"@TERMUX_PREFIX@/var/log/algernon.log\",\n \n \t\t// Default filename for a Lua script that provides data to a template\n \t\tdefaultLuaDataFilename: \"data.lua\",\n \n \t\t// List of configuration filenames to check\n-\t\tserverConfigurationFilenames: []string{\"/etc/algernon/serverconf.lua\", \"/etc/algernon/server.lua\"},\n+\t\tserverConfigurationFilenames: []string{\"@TERMUX_PREFIX@/etc/algernon/serverconf.lua\", \"@TERMUX_PREFIX@/etc/algernon/server.lua\"},\n \n \t\t// Compression speed over compactness\n \t\tcacheCompressionSpeed: true,\ndiff -uNr algernon-1.12.3/engine/flags.go algernon-1.12.3.mod/engine/flags.go\n--- algernon-1.12.3/engine/flags.go\t2019-02-19 17:14:55.000000000 +0200\n+++ algernon-1.12.3.mod/engine/flags.go\t2019-02-25 19:42:16.171195391 +0200\n@@ -300,9 +300,9 @@\n \tswitch {\n \tcase ac.productionMode:\n \t\t// Use system directories\n-\t\tac.serverDirOrFilename = \"/srv/algernon\"\n-\t\tac.serverCert = \"/etc/algernon/cert.pem\"\n-\t\tac.serverKey = \"/etc/algernon/key.pem\"\n+\t\tac.serverDirOrFilename = \"@TERMUX_PREFIX@/var/lib/algernon\"\n+\t\tac.serverCert = \"@TERMUX_PREFIX@/etc/algernon/cert.pem\"\n+\t\tac.serverKey = \"@TERMUX_PREFIX@/etc/algernon/key.pem\"\n \t\tac.cacheMode = cachemode.Production\n \t\tac.serverMode = true\n \tcase ac.devMode:\ndiff -uNr algernon-1.12.3/engine/mime.go algernon-1.12.3.mod/engine/mime.go\n--- algernon-1.12.3/engine/mime.go\t2019-02-19 17:14:55.000000000 +0200\n+++ algernon-1.12.3.mod/engine/mime.go\t2019-02-25 19:42:57.227988150 +0200\n@@ -6,5 +6,5 @@\n \n func (ac *Config) initializeMime() {\n \t// Read in the mimetype information from the system. Set UTF-8 when setting Content-Type.\n-\tac.mimereader = mime.New(\"/etc/mime.types\", true)\n+\tac.mimereader = mime.New(\"@TERMUX_PREFIX@/etc/mime.types\", true)\n }\ndiff -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\n--- algernon-1.12.3/vendor/github.com/go-sql-driver/mysql/dsn.go\t2019-02-19 17:14:55.000000000 +0200\n+++ algernon-1.12.3.mod/vendor/github.com/go-sql-driver/mysql/dsn.go\t2019-02-25 20:31:01.069051948 +0200\n@@ -88,7 +88,7 @@\n \t\tcase \"tcp\":\n \t\t\tcfg.Addr = \"127.0.0.1:3306\"\n \t\tcase \"unix\":\n-\t\t\tcfg.Addr = \"/tmp/mysql.sock\"\n+\t\t\tcfg.Addr = \"@TERMUX_PREFIX@/tmp/mysql.sock\"\n \t\tdefault:\n \t\t\treturn errors.New(\"default addr for network '\" + cfg.Net + \"' unknown\")\n \t\t}\ndiff -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\n--- algernon-1.12.3/vendor/github.com/xyproto/gopher-lua/utils.go\t2019-02-19 17:14:55.000000000 +0200\n+++ algernon-1.12.3.mod/vendor/github.com/xyproto/gopher-lua/utils.go\t2019-02-25 20:30:26.585626361 +0200\n@@ -156,7 +156,7 @@\n }\n \n func popenArgs(arg string) (string, []string) {\n-\tcmd := \"/bin/sh\"\n+\tcmd := \"@TERMUX_PREFIX@/bin/sh\"\n \targs := []string{\"-c\"}\n \tif LuaOS == \"windows\" {\n \t\tcmd = \"C:\\\\Windows\\\\system32\\\\cmd.exe\"\n"
  },
  {
    "path": "packages/alpine/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://repo.or.cz/alpine.git\nTERMUX_PKG_DESCRIPTION=\"Fast, easy to use email client\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=2.21.99999\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/alpine-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=229de9f673430190055207f8980205186ed6f73873f1ae6e1467d9d78e0f9dec\nTERMUX_PKG_DEPENDS=\"libcrypt, ncurses, openssl-tool\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-debug\n--with-c-client-target=lnx\n--without-krb5\n--without-ldap\n--without-pthread\n--without-tcl\n--with-system-pinerc=${TERMUX_PREFIX}/etc/pine.conf\n--with-passfile=$TERMUX_ANDROID_HOME/.pine-passfile\n\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\texport TCC=$CC\n\texport TRANLIB=$RANLIB\n\texport SPELLPROG=${TERMUX_PREFIX}/bin/hunspell\n\texport alpine_SSLVERSION=old\n\texport TPATH=$PATH\n\n\texport LIBS=\"-lcrypt -llog\"\n\n\t# To get S_IREAD and friends:\n\tCPPFLAGS+=\" -D__USE_BSD\"\n\n\tcp $TERMUX_PKG_BUILDER_DIR/pine.conf $TERMUX_PREFIX/etc/pine.conf\n\n\ttouch $TERMUX_PKG_SRCDIR/imap/lnxok\n}\n\ntermux_step_post_configure() {\n\tcd pith\n\t$CC_FOR_BUILD help_c_gen.c -o help_c_gen\n\t$CC_FOR_BUILD help_h_gen.c -o help_h_gen\n\ttouch -d \"next hour\" help_c_gen help_h_gen\n}\ntermux_step_create_debscripts() {\n\n\techo \"#!$TERMUX_PREFIX/bin/sh\" >> postinst\n\techo \"if [ ! -e $TERMUX_ANDROID_HOME/.alpine-smime/.pwd/MasterPassword.crt ] && [ ! -e $HOME/.alpine-smime/.pwd/MasterPassword.key ]; then\" >> postinst\n\techo \"echo 'warning making a passwordless masterpasword file'\" >> postinst\n\techo \"mkdir -p \\$HOME/.alpine-smime/public \\$HOME/.alpine-smime/.pwd \\$HOME/.alpine-smime/private \\$HOME/.alpine-smime/ca\" >> postinst\n\techo \"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\n\techo \"touch \\$HOME/.pine-passfile\" >> postinst\n\techo \"fi\" >> postinst\n}\n\n"
  },
  {
    "path": "packages/alpine/configure.patch",
    "content": "diff -u -r ../alpine-2.21/configure ./configure\n--- ../alpine-2.21/configure\t2017-02-06 00:06:22.491217965 +0000\n+++ ./configure\t2017-06-14 23:28:28.132302332 +0000\n@@ -17646,6 +17646,14 @@\n \n     fi\n     ;;\n+  *-*-*-android*)\n+    alpine_SSLDIR=\"@TERMUX_PREFIX@/etc/tls\"\n+    alpine_SSLCERTS=\"$alpine_SSLDIR/certs\"\n+    alpine_SSLKEYS=\"$alpine_SSLDIR/private\"\n+    alpine_SSLINCLUDE=\"@TERMUX_PREFIX@/include/openssl\"\n+    alpine_SSLLIB=\"@TERMUX_PREFIX@/lib\"\n+    alpine_path_delim=\"/\"\n+\t ;;\n   *-apple-darwin*)\n     systype=\"OSX\"\n     alpine_path_delim=\"/\"\n"
  },
  {
    "path": "packages/alpine/env_unix.c.patch",
    "content": "diff --git a/imap/src/osdep/unix/env_unix.c b/imap/src/osdep/unix/env_unix.c\nindex 89e5092..f5a734e 100644\n--- a/imap/src/osdep/unix/env_unix.c\n+++ b/imap/src/osdep/unix/env_unix.c\n@@ -123,7 +123,7 @@ static char *lockpgm = LOCKPGM;\n  * systems.\n  */\n \n-static const char *tmpdir = \"/tmp\";\n+static const char *tmpdir = \"@TERMUX_PREFIX@/tmp\";\n \n /* Do not change shlock_mode.  Doing so can cause mailbox corruption and\n  * denial of service.  It also defeats the entire purpose of the shared\n"
  },
  {
    "path": "packages/alpine/fdstring.c.patch",
    "content": "--- ../fdstring.c\t2016-12-10 08:02:12.555352750 +0000\n+++ ./imap/src/osdep/unix/fdstring.c\t2016-12-10 08:24:29.096929788 +0000\n@@ -25,7 +25,7 @@\n  * Date:\t15 April 1997\n  * Last Edited:\t4 April 2007\n  */\n-\n+#define L_SET SEEK_SET\n #include \"mail.h\"\n #include \"osdep.h\"\n #include \"misc.h\"\n"
  },
  {
    "path": "packages/alpine/imap-src-osdep-unix-Makefile.patch",
    "content": "--- ../cache/alpine-2.20/imap/src/osdep/unix/Makefile\t2015-01-12 05:12:25.505178442 +0000\n+++ ./imap/src/osdep/unix/Makefile\t2016-12-11 07:08:54.821695452 +0000\n@@ -131,13 +131,8 @@\n \n \n # Commands possibly overriden by the individual port\n-\n-ARRC=ar rc\n-CC=cc\n LN=ln -s\n-RANLIB=ranlib\n-\n-\n+AARC=\"ar rc\"\n # Standard distribution build parameters\n \n DEFAULTAUTHENTICATORS=ext md5 pla log\n@@ -513,8 +508,10 @@\n \t SPOOLDIR=/var/spool \\\n \t ACTIVEFILE=/var/lib/news/active \\\n \t RSHPATH=/usr/bin/rsh \\\n-\t BASECFLAGS=\"$(GCCCFLAGS)\"\n-\n+\t CC=$(TCC) \\\n+ \t BASECFLAGS=\"$(GCCCFLAGS)\" \\\n+\tRANLIB=\"$(TRANLIB)\"\n+                                  \n lyn:\t# LynxOS\n \t$(BUILD) `$(CAT) SPECIALS` OS=$@ \\\n \t CRXTYPE=nfs \\\n@@ -869,8 +866,13 @@\n all:\t$(ARCHIVE)\n \n $(ARCHIVE): $(BINARIES)\n-\tsh -c '$(RM) $(ARCHIVE) || true'\n+\trm -rf client-a\n+\t { echo -n 'ar rc '; cat ARCHIVE; } >ARCHIVE.new\n+\trm ARCHIVE\n+\tmv ARCHIVE.new ARCHIVE\n+\tchmod +x ARCHIVE\n \t@$(CAT) ./ARCHIVE\n+\t\n \t@$(SH) ./ARCHIVE\n \n .c.o:\n"
  },
  {
    "path": "packages/alpine/imapmkf.patch",
    "content": "--- ../cache/alpine-2.20/imap/Makefile\t2015-01-12 05:12:25.521178518 +0000\n+++ ./imap/Makefile\t2016-12-11 06:43:56.986805502 +0000\n@@ -457,7 +457,7 @@\n # Linux shadow password support doesn't build on traditional systems, but most\n # Linux systems are shadow these days.\n \n-lnx:\tlnxnul an\n+lnx:\tlnxok an \n \t$(BUILD) BUILDTYPE=$@\n \n lnxnul:\n"
  },
  {
    "path": "packages/alpine/mlockmake.patch",
    "content": "--- ../cache/alpine-2.21/imap/src/mlock/Makefile\t2017-02-06 00:06:22.515218494 +0000\n+++ ./imap/src/mlock/Makefile\t2017-07-08 09:25:17.637293516 +0000\n@@ -36,7 +36,7 @@\n all:\tmlock\n \n mlock:\tmlock.o\n-\t$(CC) $(CFLAGS) -o mlock mlock.o\n+\t$(CC) $(CFLAGS) -o mlock mlock.o -llog\n \n install: mlock\n \tchgrp mail mlock\n"
  },
  {
    "path": "packages/alpine/mtest.c.patch",
    "content": "--- ../cache/alpine-2.21/imap/src/mtest/mtest.c\t2017-02-06 00:06:22.499218141 +0000\n+++ ./imap/src/mtest/mtest.c\t2017-04-25 11:05:20.133809205 +0000\n@@ -97,7 +97,7 @@\n   }\n #endif\n   curusr = cpystr (((s = myusername ()) && *s) ? s : \"somebody\");\n-#if UNIXLIKE\n+#if UNIXLIKE && !defined __ANDROID__\n   {\n     char *suffix;\n     struct passwd *pwd = getpwnam (curusr);\n"
  },
  {
    "path": "packages/alpine/os_lnx.c.patch",
    "content": "diff -uNr alpine-2.21/imap/src/osdep/unix/os_lnx.c alpine-2.21.mod/imap/src/osdep/unix/os_lnx.c\n--- alpine-2.21/imap/src/osdep/unix/os_lnx.c\t2017-02-06 02:06:22.499218141 +0200\n+++ alpine-2.21.mod/imap/src/osdep/unix/os_lnx.c\t2018-07-03 21:08:21.624860068 +0300\n@@ -35,7 +35,6 @@\n #include <netdb.h>\n #include <ctype.h>\n #include <errno.h>\n-extern int errno;\t\t/* just in case */\n #include <pwd.h>\n #include \"misc.h\"\n \n@@ -50,3 +49,7 @@\n #include \"tz_sv4.c\"\n #include \"flocklnx.c\"\n #include \"utime.c\"\n+long gethostid (void)\n+{\n+return 0xdeadface;\n+}\n"
  },
  {
    "path": "packages/alpine/os_lnx.h.patch",
    "content": "--- ../cache/alpine-2.20/imap/src/osdep/unix/os_lnx.h\t2015-01-12 05:12:25.505178442 +0000\n+++ ./imap/src/osdep/unix/os_lnx.h\t2016-12-10 23:21:20.644163814 +0000\n@@ -48,13 +48,13 @@\n #include <syslog.h>\n #include <sys/file.h>\n \n-\n /* Linux gets this wrong */\n \n #define setpgrp setpgid\n \n #define direct dirent\n-\n+#define L_SET SEEK_SET\n+#define FNDELAY O_NDELAY \n #define flock safe_flock\n \n #define utime portable_utime\n"
  },
  {
    "path": "packages/alpine/pine.conf",
    "content": "#\n# Alpine configuration file\n#\n# This file sets the configuration options used by Alpine and PC-Alpine. These\n# options are usually set from within Alpine or PC-Alpine. There may be a\n# system-wide configuration file which sets the defaults for some of the\n# variables. On Unix, run alpine -conf to see how system defaults have been set.\n# For variables that accept multiple values, list elements are separated by\n# commas. A line beginning with a space or tab is considered to be a\n# continuation of the previous line. For a variable to be unset its value must\n# be blank. To set a variable to the empty string its value should be \"\".\n# You can override system defaults by setting a variable to the empty string.\n# Lines beginning with \"#\" are comments, and ignored by Alpine.\n\n# Over-rides your full name from Unix password file. Required for PC-Alpine.\npersonal-name=\n\n# Sets domain part of From: and local addresses in outgoing mail.\nuser-domain=\n\n# List of SMTP servers for sending mail. If blank: Unix Alpine uses sendmail.\nsmtp-server=\n\n# NNTP server for posting news. Also sets news-collections for news reading.\nnntp-server=\n\n# Path of (local or remote) INBOX, e.g. ={mail.somewhere.edu}inbox\n# Normal Unix default is the local INBOX (usually /usr/spool/mail/$USER).\ninbox-path=\n\n# List of folder pairs; the first indicates a folder to archive, and the\n# second indicates the folder read messages in the first should\n# be moved to.\nincoming-archive-folders=\n\n# List of folders, assumed to be in first folder collection,\n# offered for pruning each month.  For example: mumble\npruned-folders=\n\n# Over-rides default path for sent-mail folder, e.g. =old-mail (using first\n# folder collection dir) or ={host2}sent-mail or =\"\" (to suppress saving).\n# Default: sent-mail (Unix) or SENTMAIL.MTX (PC) in default folder collection.\ndefault-fcc=\n\n# Over-rides default path for saved-msg folder, e.g. =saved-messages (using 1st\n# folder collection dir) or ={host2}saved-mail or =\"\" (to suppress saving).\n# Default: saved-messages (Unix) or SAVEMAIL.MTX (PC) in default collection.\ndefault-saved-msg-folder=\n\n# Over-rides default path for postponed messages folder, e.g. =pm (which uses\n# first folder collection dir) or ={host4}pm (using home dir on host4).\n# Default: postponed-msgs (Unix) or POSTPOND.MTX (PC) in default fldr coltn.\npostponed-folder=\n\n# If set, specifies where already-read messages will be moved upon quitting.\nread-message-folder=\n\n# If set, specifies where form letters should be stored.\nform-letter-folder=\n\n# If set, specifies where trash is moved to in Web Alpine.\ntrash-folder=\n\n# Contains the actual signature contents as opposed to the signature filename.\n# If defined, this overrides the signature-file. Default is undefined.\nliteral-signature=\n\n# Over-rides default path for signature file. Default is ~/.signature\nsignature-file=\n\n# List of features; see Alpine's Setup/options menu for the current set.\n# e.g. feature-list= select-without-confirm, signature-at-bottom\n# Default condition for all of the features is no-.\nfeature-list=\n\n# Alpine executes these keys upon startup (e.g. to view msg 13: i,j,1,3,CR,v)\ninitial-keystroke-list=\n\n# Only show these headers (by default) when composing messages\ndefault-composer-hdrs=\n\n# Add these customized headers (and possible default values) when composing\ncustomized-hdrs=\n\n# When viewing messages, include this list of headers\nviewer-hdrs=\n\n# When viewing messages, number of blank spaces between left display edge and text\nviewer-margin-left=\n\n# When viewing messages, number of blank spaces between right display edge and text\nviewer-margin-right=\n\n# When viewing messages, number of lines of quote displayed before suppressing\nquote-suppression-threshold=\n\n# Determines default folder name for Saves...\n# Choices: default-folder, by-sender, by-from, by-recipient, last-folder-used.\n# Default: \"default-folder\", i.e. \"saved-messages\" (Unix) or \"SAVEMAIL\" (PC).\nsaved-msg-name-rule=\n\n# Determines default name for Fcc...\n# Choices: default-fcc, by-recipient, last-fcc-used.\n# Default: \"default-fcc\" (see also \"default-fcc=\" variable.)\nfcc-name-rule=\n\n# Sets presentation order of messages in Index. Choices:\n# Subject, From, Arrival, Date, Size, To, Cc, OrderedSubj, Score, and Thread.\n# Order may be reversed by appending /Reverse. Default: \"Arrival\".\nsort-key=\n\n# Sets presentation order of address book entries. Choices: dont-sort,\n# fullname-with-lists-last, fullname, nickname-with-lists-last, nickname\n# Default: \"fullname-with-lists-last\".\naddrbook-sort-rule=\n\n# Sets presentation order of folder list entries. Choices: alphabetical,\n# alpha-with-dirs-last, alpha-with-dirs-first.\n# Default: \"alpha-with-directories-last\".\nfolder-sort-rule=\n\n# Sets the default folder and collection offered at the Goto Command's prompt.\ngoto-default-rule=\n\n# Sets message which cursor begins on. Choices: first-unseen, first-recent,\n# first-important, first-important-or-unseen, first-important-or-recent,\n# first, last. Default: \"first-unseen\".\nincoming-startup-rule=\n\n# Allows a default answer for the prune folder questions. Choices: yes-ask,\n# yes-no, no-ask, no-no, ask-ask, ask-no. Default: \"ask-ask\".\npruning-rule=\n\n# Controls behavior when reopening an already open folder.\nfolder-reopen-rule=\n\n# Style that MESSAGE INDEX is displayed in when threading.\nthreading-display-style=\n\n# Style of THREAD INDEX or default MESSAGE INDEX when threading.\nthreading-index-style=\n\n# When threading, character used to indicate collapsed messages underneath.\nthreading-indicator-character=\n\n# When threading, character used to indicate expanded messages underneath.\nthreading-expanded-character=\n\n# When threading, character used to indicate this is the last reply\n# to the parent of this message.\nthreading-lastreply-character=\n\n# Reflects capabilities of the display you have.\n# If unset, the default is taken from your locale. That is usually the right\n# thing to use. Typical alternatives include UTF-8, ISO-8859-x, and EUC-JP\n# (where x is a number between 1 and 9).\ndisplay-character-set=\n\n# Reflects capabilities of the keyboard you have.\n# If unset, the default is to use the same value\n# used for the display-character-set.\nkeyboard-character-set=\n\n# Defaults to UTF-8. This is used for outgoing messages.\n# It is usually correct to leave this unset.\nposting-character-set=\n\n# Defaults to nothing, which is equivalent to US-ASCII. This is used for\n# unlabeled incoming messages. It is ok to leave this unset but if you receive\n# unlabeled mail that is usually in some known character set, set that here.\nunknown-character-set=\n\n# Specifies the program invoked by ^_ in the Composer,\n# or the \"enable-alternate-editor-implicitly\" feature.\neditor=\n\n# Specifies the program invoked by ^T in the Composer.\nspeller=\n\n# Specifies the column of the screen where the composer should wrap.\ncomposer-wrap-column=\n\n# Specifies the string to insert when replying to a message.\nreply-indent-string=\n\n# Specifies the introduction to insert when replying to a message.\nreply-leadin=\n\n# Specifies the string to replace quotes with when viewing a message.\nquote-replace-string=\n\n# When these characters appear in the middle of a word in the composer\n# the forward word function will stop at the first text following (as happens\n# with SPACE characters by default)\ncomposer-word-separators=\n\n# Specifies the string to use when sending a  message with no to or cc.\nempty-header-message=\n\n# Program to view images (e.g. GIF or TIFF attachments).\nimage-viewer=\n\n# If \"user-domain\" not set, strips hostname in FROM address. (Unix only)\nuse-only-domain-name=\n\n# This variable takes a list of programs that message text is piped into\n# after MIME decoding, prior to display.\ndisplay-filters=\n\n# This defines a program that message text is piped into before MIME\n# encoding, prior to sending\nsending-filters=\n\n# A list of alternate addresses the user is known by\nalt-addresses=\n\n# A list of keywords for use in categorizing messages\nkeywords=\n\n# Characters which surround keywords in SUBJKEY token.\n# Default is \"{\" \"} \"\nkeyword-surrounding-chars=\n\n# Characters between subject and opening text in SUBJECTTEXT token.\n# Default is \" - \"\nopening-text-separator-chars=\n\n# This is a list of formats for address books.  Each entry in the list is made\n# up of space-delimited tokens telling which fields are displayed and in\n# which order.  See help text\naddressbook-formats=\n\n# This gives a format for displaying the index.  It is made\n# up of space-delimited tokens telling which fields are displayed and in\n# which order.  See help text\nindex-format=\n\n# The number of lines of overlap when scrolling through message text\nviewer-overlap=\n\n# Number of lines from top and bottom of screen where single\n# line scrolling occurs.\nscroll-margin=\n\n# The number of seconds to sleep after writing a status message\nstatus-message-delay=\n\n# Number of times per-second to update busy cue messages\nbusy-cue-rate=\n\n# UNIX ONLY (except MAC OSX): When an attachment is opened, this variable controls the number\n#of seconds to wait between checks if the user has ended viewing the attachment.\n#minimun value: 60 seconds, maximum value: 600 seconds (10 minutes). Default: 60 seconds\nmailcap-check-interval=\n\n# The approximate number of seconds between checks for new mail\nmail-check-interval=\n\n# The approximate number of seconds between checks for new mail in folders\n# other than the current folder and inbox.\n# Default is same as mail-check-interval\nmail-check-interval-noncurrent=\n\n# The minimum number of seconds between checks for new mail in a Mail Drop.\n# This is always effectively at least as large as the mail-check-interval\nmaildrop-check-minimum=\n\n# For newsgroups accessed using NNTP, only messages numbered in the range\n# lastmsg-range+1 to lastmsg will be considered\nnntp-range=\n\n# Full path and name of NEWSRC file\nnewsrc-path=\n\n# Path and filename of news configuration's active file.\n# The default is typically \"/usr/lib/news/active\".\nnews-active-file-path=\n\n# Directory containing system's news data.\n# The default is typically \"/usr/spool/news\"\nnews-spool-directory=\n\n# Path and filename of the program used to upload text from your terminal\n# emulator's into Alpine's composer.\nupload-command=\n\n# Text sent to terminal emulator prior to invoking the program defined by\n# the upload-command variable.\n# Note: _FILE_ will be replaced with the temporary file used in the upload.\nupload-command-prefix=\n\n# Path and filename of the program used to download text via your terminal\n# emulator from Alpine's export and save commands.\ndownload-command=\n\n# Text sent to terminal emulator prior to invoking the program defined by\n# the download-command variable.\n# Note: _FILE_ will be replaced with the temporary file used in the download.\ndownload-command-prefix=\n\n# Sets the search path for the mailcap configuration file.\n# NOTE: colon delimited under UNIX, semi-colon delimited under DOS/Windows/OS2.\nmailcap-search-path=\n\n# Sets the search path for the mimetypes configuration file.\n# NOTE: colon delimited under UNIX, semi-colon delimited under DOS/Windows/OS2.\nmimetype-search-path=\n\n# List of programs to open Internet URLs (e.g. http or ftp references).\nurl-viewers=\n\n# The maximum number of non-stayopen remote connections that Alpine will use\nmax-remote-connections=\n\n# A list of folders that should be left open once opened (INBOX is implicit)\nstay-open-folders=\n\n# Sets the time in seconds that Alpine will attempt to open a network\n# connection when checking for new unseen messages in an incoming folder.\n#  The default is 5.\nincoming-check-timeout=\n\n# Sets the approximate number of seconds between checks for unseen messages\n# in incoming folders. The default is 180.\nincoming-check-interval=\n\n# Sets the approximate number of seconds between checks for unseen messages\n# for other than local or IMAP folders. The default is 180.\nincoming-check-interval-secondary=\n\n# List of incoming folders to check for unseen messages. The default if left\n# blank is to check all incoming folders.\nincoming-check-list=\n\n# Specifies the number of dead letter files to keep when canceling.\ndead-letter-files=\n\n# Sets the filename for the newmail fifo (named pipe). Unix only.\nnewmail-fifo-path=\n\n# Sets the width for the NewMail screen.\nnewmail-window-width=\n\n# List of incoming msg folders besides INBOX, e.g. ={host2}inbox, {host3}inbox\n# Syntax: optnl-label {optnl-imap-host-name}folder-path\nincoming-folders=\n\n# List of directories where saved-message folders may be. First one is\n# the default for Saves. Example: Main {host1}mail/[], Desktop mail\\[]\n# Syntax: optnl-label {optnl-imap-hostname}optnl-directory-path[]\nfolder-collections=\n\n# List, only needed if nntp-server not set, or news is on a different host\n# than used for NNTP posting. Examples: News *[] or News *{host3/nntp}[]\n# Syntax: optnl-label *{news-host/protocol}[]\nnews-collections=\n\n# List of file or path names for personal addressbook(s).\n# Default: ~/.addressbook (Unix) or \\PINE\\ADDRBOOK (PC)\n# Syntax: optnl-label path-name\naddress-book=\n\n# List of file or path names for global/shared addressbook(s).\n# Default: none\n# Syntax: optnl-label path-name\nglobal-address-book=\n\n# Set by Alpine; controls beginning-of-month sent-mail pruning.\nlast-time-prune-questioned=117.4\n\n# Set by Alpine; controls display of \"new version\" message.\nlast-version-used=6.20\n\n# This names the path to an alternative program, and any necessary arguments,\n# to be used in posting mail messages.  Example:\n#                    /usr/lib/sendmail -oem -t -oi\n# or,\n#                    /usr/local/bin/sendit.sh\n# The latter a script found in Alpine distribution's contrib/util directory.\n# NOTE: The program MUST read the message to be posted on standard input,\n#       AND operate in the style of sendmail's \"-t\" option.\nsendmail-path=\n\n# This names the root of the tree to which the user is restricted when reading\n# and writing folders and files.  For example, on Unix ~/work confines the\n# user to the subtree beginning with their work subdirectory.\n# (Note: this alone is not sufficient for preventing access.  You will also\n# need to restrict shell access and so on, see Alpine Technical Notes.)\n# Default: not set (so no restriction)\noperating-dir=\n\n# If no user input for this many hours, Alpine will exit if in an idle loop\n# waiting for a new command.  If set to zero (the default), then there will\n# be no timeout.\nuser-input-timeout=\n\n# Sets the time in seconds that Alpine will attempt to open a network\n# connection.  The default is 30, the minimum is 5, and the maximum is\n# system defined (typically 75).\ntcp-open-timeout=\n\n# Network read warning timeout. The default is 15, the minimum is 5, and the\n# maximum is 1000.\ntcp-read-warning-timeout=\n\n# Network write warning timeout. The default is 0 (unset), the minimum\n# is 5 (if not 0), and the maximum is 1000.\ntcp-write-warning-timeout=\n\n# If this much time has elapsed at the time of a tcp read or write\n# timeout, Alpine will ask if you want to break the connection.\n# Default is 60 seconds, minimum is 5, maximum is 1000.\ntcp-query-timeout=\n\n# Sets the format of the command used to open a UNIX remote\n# shell connection.  The default is \"%s %s -l %s exec /etc/r%sd\"\n# NOTE: the 4 (four) \"%s\" entries MUST exist in the provided command\n# where the first is for the command's path, the second is for the\n# host to connect to, the third is for the user to connect as, and the\n# fourth is for the connection method (typically \"imap\")\nrsh-command=\n\n# Sets the name of the command used to open a UNIX remote shell connection.\n# The default is typically /usr/ucb/rsh.\nrsh-path=\n\n# Sets the time in seconds that Alpine will attempt to open a UNIX remote\n# shell connection.  The default is 15, min is 5, and max is unlimited.\n# Zero disables rsh altogether.\nrsh-open-timeout=\n\n# Sets the format of the command used to open a UNIX secure\n# shell connection.  The default is \"%s %s -l %s exec /etc/r%sd\"\n# NOTE: the 4 (four) \"%s\" entries MUST exist in the provided command\n# where the first is for the command's path, the second is for the\n# host to connect to, the third is for the user to connect as, and the\n# fourth is for the connection method (typically \"imap\")\nssh-command=\n\n# Sets the name of the command used to open a UNIX secure shell connection.\n# Typically this is /usr/bin/ssh.\nssh-path=\n\n# Sets the time in seconds that Alpine will attempt to open a UNIX secure\n# shell connection.  The default is 15, min is 5, and max is unlimited.\n# Zero disables ssh altogether.\nssh-open-timeout=\n\n# Sets the version number Alpine will use as a threshold for offering\n# its new version message on startup.\nnew-version-threshold=\n\n# List of mail drivers to disable.\ndisable-these-drivers=\n\n# List of SASL authenticators to disable.\ndisable-these-authenticators=\n\n# Set by Alpine; contains data for caching remote address books.\nremote-abook-metafile=\n\n# How many extra copies of remote address book should be kept. Default: 3\nremote-abook-history=\n\n# Minimum number of minutes between checks for remote address book changes.\n# 0 means never check except when opening a remote address book.\n# -1 means never check. Default: 5\nremote-abook-validity=\n\n# Your default printer selection\nprinter=\n\n# List of special print commands\npersonal-print-command=\n\n# Which category default print command is in\npersonal-print-category=\n\n# Patterns and their actions are stored here.\npatterns-roles=\n\n# Patterns and their actions are stored here.\npatterns-filters2=\n\n# Patterns and their actions are stored here.\npatterns-scores2=\n\n# Patterns and their actions are stored here.\npatterns-indexcolors=\n\n# Patterns and their actions are stored here.\npatterns-other=\n\n# Patterns and their actions are stored here.\npatterns-search=\n\n# Controls display of color\ncolor-style=force-xterm-256color\n\n# Controls display of color for current index line\ncurrent-indexline-style=flip-colors\n\n# Controls display of color for the titlebar at top of screen\ntitlebar-color-style=\n\n# Choose: black, blue, green, cyan, red, magenta, yellow, or white.\nnormal-foreground-color=\nnormal-background-color=\nreverse-foreground-color=\nreverse-background-color=\ntitle-foreground-color=\ntitle-background-color=\ntitle-closed-foreground-color=\ntitle-closed-background-color=\nfolder-foreground-color=\nfolder-background-color=\ndirectory-foreground-color=\ndirectory-background-color=\nfolder-list-text-foreground-color=\nfolder-list-text-background-color=\nstatus-foreground-color=\nstatus-background-color=\nkeylabel-foreground-color=\nkeylabel-background-color=\nkeyname-foreground-color=\nkeyname-background-color=\nselectable-item-foreground-color=\nselectable-item-background-color=\nmeta-message-foreground-color=\nmeta-message-background-color=\nquote1-foreground-color=\nquote1-background-color=\nquote2-foreground-color=\nquote2-background-color=\nquote3-foreground-color=\nquote3-background-color=\nincoming-unseen-foreground-color=\nincoming-unseen-background-color=\nsignature-foreground-color=\nsignature-background-color=\nprompt-foreground-color=\nprompt-background-color=\nheader-general-foreground-color=\nheader-general-background-color=\nindex-to-me-foreground-color=\nindex-to-me-background-color=\nindex-important-foreground-color=\nindex-important-background-color=\nindex-deleted-foreground-color=\nindex-deleted-background-color=\nindex-answered-foreground-color=\nindex-answered-background-color=\nindex-new-foreground-color=\nindex-new-background-color=\nindex-recent-foreground-color=\nindex-recent-background-color=\nindex-forward-foreground-color=\nindex-forward-background-color=\nindex-unseen-foreground-color=\nindex-unseen-background-color=\nindex-highpriority-foreground-color=\nindex-highpriority-background-color=\nindex-lowpriority-foreground-color=\nindex-lowpriority-background-color=\nindex-arrow-foreground-color=\nindex-arrow-background-color=\nindex-subject-foreground-color=\nindex-subject-background-color=\nindex-from-foreground-color=\nindex-from-background-color=\nindex-opening-foreground-color=\nindex-opening-background-color=\n\n# Colors in which tokens will be displayed in the index screen\nindex-token-colors=\n\n# When viewing messages, these are the header colors\nviewer-hdr-colors=\n\n# Colors used to display keywords in the index\nkeyword-colors=\n\n# RSS News feed\nrss-news=\n\n# RSS Weather feed\nrss-weather=\n\n# Web Alpine index table row height\nwp-indexheight=\n\n# Web Alpine number of index lines in table\nwp-indexlines=\n\n# Web Alpine aggregate operations tab state\nwp-aggstate=\n\n# Web Alpine various aspects of cross-session state\nwp-state=\n\n# Web Alpine preferred width for message display in characters\nwp-columns=\n\n# Public certificates are kept in files in this directory. The files should\n# contain certificates in PEM format. The name of each file should look\n# like <emailaddress>.crt. The default directory is .alpine-smime/public.\nsmime-public-cert-directory=\n\n# If this option is set then public certificates are kept in a single container\n# \"file\" similar to a remote configuration file instead of in the\n# smime-publiccert-directory. The value can be a remote or local folder\n# specification like for a non-standard pinerc value. The default\n# is that it is not set.\nsmime-public-cert-container=\n\n# Private keys are kept in files in this directory. The files are in PEM format.\n# The name of a file should look like <emailaddress>.key.\n# The default directory is .alpine-smime/private.\nsmime-private-key-directory=\n\n# If this option is set then private keys are kept in a single container\n# \"file\" similar to a remote configuration file instead of in the\n# private-key-directory. The value can be a remote or local folder\n# specification like for a non-standard pinerc value. The default\n# is that it is not set.\nsmime-private-key-container=\n\n# Certificate Authority certificates (in addition to the normal CACerts for the\n# system) are kept in files in this directory. The files are in PEM format.\n# Filenames should end with .crt. The default directory is .alpine-smime/ca.\nsmime-cacert-directory=\n\n# If this option is set then CAcerts are kept in a single container\n# \"file\" similar to a remote configuration file instead of in the\n# ca-cert-directory. The value can be a remote or local folder\n# specification like for a non-standard pinerc value. The default\n# is that it is not set.\nsmime-cacert-container=\n\n# LDAP servers for looking up addresses.\nldap-servers=\n"
  },
  {
    "path": "packages/alpine/pw_stuff.c.patch",
    "content": "--- ../cache/alpine-2.20/pith/osdep/pw_stuff.c\t2015-01-12 05:12:25.588178837 +0000\n+++ ./pith/osdep/pw_stuff.c\t2016-12-11 21:24:31.283700286 +0000\n@@ -103,12 +103,6 @@\n \tlen = strlen(fname_to_utf8(unix_pwd->pw_name));\n \tui->login = (char *) malloc((len+1) * sizeof(char));\n \tsnprintf(ui->login, len+1, \"%s\", fname_to_utf8(unix_pwd->pw_name));\n-\n-\tif((s = gcos_name(unix_pwd->pw_gecos, unix_pwd->pw_name)) != NULL){\n-\t    len = strlen(fname_to_utf8(s));\n-\t    ui->fullname = (char *) malloc((len+1) * sizeof(char));\n-\t    snprintf(ui->fullname, len+1, \"%s\", fname_to_utf8(s));\n-\t}\n     }\n \n #else  /* _WINDOWS */\n@@ -190,12 +184,6 @@\n     if(pw != NULL){\n \tchar   *gn, *s = NULL;\n \tsize_t  l;\n-\n-\tif((gn = gcos_name(pw->pw_gecos, name)) != NULL\n-\t   && (s = (char *) malloc(l  = ((strlen(gn) + 1) * sizeof(char)))) != NULL)\n-\t  snprintf(s, l, \"%s\", gn);\n-\n-\treturn(s);\n     }\n     else\n       return((char *) NULL);\n"
  },
  {
    "path": "packages/antiword/Makefile.Linux.patch",
    "content": "diff -uNr antiword-0.37/Makefile.Linux antiword-0.37.mod/Makefile.Linux\n--- antiword-0.37/Makefile.Linux\t2005-10-29 20:13:15.000000000 +0300\n+++ antiword-0.37.mod/Makefile.Linux\t2019-02-25 22:05:02.764208927 +0200\n@@ -2,8 +2,8 @@\n # Makefile for antiword (Linux version)\n #\n\n-CC\t= gcc\n-LD\t= gcc\n+CC\t?= gcc\n+LD\t= $(CC)\n\n INSTALL\t\t= cp -f\n INSTALL_PROGRAM\t= $(INSTALL)\n@@ -12,12 +12,11 @@\n # must be equal to DEBUG or NDEBUG\n DB\t= NDEBUG\n # Optimization: -O<n> or debugging: -g\n-OPT\t= -O2\n+OPT\t=\n\n LDLIBS\t=\n\n-CFLAGS\t= -Wall -pedantic $(OPT) -D$(DB)\n-LDFLAGS\t=\n+CFLAGS\t+= -Wall -pedantic $(OPT) -D$(DB)\n\n OBJS\t=\\\n \tmain_u.o asc85enc.o blocklist.o chartrans.o datalist.o depot.o\\\n@@ -36,8 +36,8 @@\n LOCAL_INSTALL_DIR = $(HOME)/bin\n LOCAL_RESOURCES_DIR = $(HOME)/.antiword\n\n-GLOBAL_INSTALL_DIR = /usr/local/bin\n-GLOBAL_RESOURCES_DIR = /usr/share/antiword\n+GLOBAL_INSTALL_DIR = @TERMUX_PREFIX@/bin\n+GLOBAL_RESOURCES_DIR = @TERMUX_PREFIX@/share/antiword\n\n all:\t\t$(PROGS)\n\n"
  },
  {
    "path": "packages/antiword/antiword.h.patch",
    "content": "diff -uNr antiword-0.37/antiword.h antiword-0.37.mod/antiword.h\n--- antiword-0.37/antiword.h\t2005-07-06 20:46:22.000000000 +0300\n+++ antiword-0.37.mod/antiword.h\t2019-03-05 19:51:12.173846939 +0200\n@@ -204,7 +204,7 @@\n #define ANTIWORD_DIR\t\t\"antiword\"\n #define FONTNAMES_FILE\t\t\"fontname.txt\"\n #elif defined(__vms)\n-#define GLOBAL_ANTIWORD_DIR\t\"/usr/share/antiword\"\n+#define GLOBAL_ANTIWORD_DIR\t\"@TERMUX_PREFIX@/share/antiword\"\n #define ANTIWORD_DIR\t\t\"antiword\"\n #define FONTNAMES_FILE\t\t\"fontnames\"\n #elif defined(__BEOS__)\n@@ -224,7 +224,7 @@\n #define ANTIWORD_DIR\t\t\".antiword\"\n #define FONTNAMES_FILE\t\t\"fontnames\"\n #else\t/* All others */\n-#define GLOBAL_ANTIWORD_DIR\t\"/usr/share/antiword\"\n+#define GLOBAL_ANTIWORD_DIR\t\"@TERMUX_PREFIX@/share/antiword\"\n #define ANTIWORD_DIR\t\t\".antiword\"\n #define FONTNAMES_FILE\t\t\"fontnames\"\n #endif /* __dos */\n"
  },
  {
    "path": "packages/antiword/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.winfield.demon.nl/\nTERMUX_PKG_DESCRIPTION=\"A free MS Word reader\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.37\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://www.winfield.demon.nl/linux/antiword-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=8e2c000fcbc6d641b0e6ff95e13c846da3ff31097801e86702124a206888f5ac\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_MAKE_INSTALL_TARGET=\"global_install\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/kantiword\"\n"
  },
  {
    "path": "packages/apache2/Termux.layout",
    "content": "\n# Termux layout\n<Layout Termux>\n    prefix:\n    exec_prefix:   ${prefix}\n    bindir:        ${exec_prefix}/bin\n    sbindir:       ${exec_prefix}/bin\n    libdir:        ${exec_prefix}/lib\n    libexecdir:    ${exec_prefix}/libexec/apache2\n    mandir:        ${exec_prefix}/share/man\n    sysconfdir:    ${prefix}/etc/apache2\n    datadir:       ${exec_prefix}/share/apache2\n    iconsdir:      ${datadir}/icons\n    htdocsdir:     ${prefix}/share/apache2/default-site/htdocs\n    manualdir:     ${htdocsdir}/manual\n    cgidir:        ${prefix}/lib/cgi-bin\n    includedir:    ${exec_prefix}/include/apache2\n    localstatedir: ${prefix}/var/lock/apache2\n    runtimedir:    ${prefix}/var/run/apache2\n    logfiledir:    ${prefix}/var/log/apache2\n    proxycachedir: ${prefix}/var/cache/apache2/proxy\n    infodir:       ${exec_prefix}/share/info\n    installbuilddir: ${prefix}/share/apache2/build\n    errordir:      ${datadir}/error\n</Layout>\n"
  },
  {
    "path": "packages/apache2/build-instdso.sh.patch",
    "content": "diff -u -r ../httpd-2.4.38/build/instdso.sh ./build/instdso.sh\n--- ../httpd-2.4.38/build/instdso.sh\t2011-03-04 18:58:38.000000000 +0000\n+++ ./build/instdso.sh\t2019-03-17 23:43:43.407027928 +0000\n@@ -59,6 +59,12 @@\n esac\n \n CMD=\"$SH_LIBTOOL --mode=install $INSTALL_CMD $DSOARCHIVE $TARGETDIR/\"\n+# Prefixing with bash below simplifies cross compiling setup where\n+# $SH_LIBTOOL may have wrong shebang:\n+case \"$SH_LIBTOOL\" in\n+  bash*) ;;\n+  *) CMD=\"bash $CMD\" ;;\n+esac\n echo $CMD\n $CMD || exit $?\n \n"
  },
  {
    "path": "packages/apache2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://httpd.apache.org\nTERMUX_PKG_DESCRIPTION=\"Apache Web Server\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=2.4.41\nTERMUX_PKG_SHA256=133d48298fe5315ae9366a0ec66282fa4040efa5d566174481077ade7d18ea40\nTERMUX_PKG_SRCURL=https://www.apache.org/dist/httpd/httpd-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_DEPENDS=\"apr, apr-util, pcre, openssl, libcrypt, libandroid-support, libnghttp2, libexpat, libuuid, zlib\"\nTERMUX_PKG_BREAKS=\"apache2-dev\"\nTERMUX_PKG_REPLACES=\"apache2-dev\"\nTERMUX_PKG_CONFFILES=\"\netc/apache2/httpd.conf\netc/apache2/extra/httpd-autoindex.conf\netc/apache2/extra/httpd-dav.conf\netc/apache2/extra/httpd-default.conf\netc/apache2/extra/httpd-info.conf\netc/apache2/extra/httpd-languages.conf\netc/apache2/extra/httpd-manual.conf\netc/apache2/extra/httpd-mpm.conf\netc/apache2/extra/httpd-multilang-errordoc.conf\netc/apache2/extra/httpd-ssl.conf\netc/apache2/extra/httpd-userdir.conf\netc/apache2/extra/httpd-vhosts.conf\netc/apache2/extra/proxy-html.conf\netc/apache2/mime.types\netc/apache2/magic\n\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\n# providing manual paths to libs because it picks up host libs on some systems\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-apr=$TERMUX_PREFIX\n--with-apr-util=$TERMUX_PREFIX\n--with-pcre=$TERMUX_PREFIX\n--enable-suexec\n--enable-layout=Termux\n--enable-so\n--enable-authnz-fcgi\n--enable-cache\n--enable-disk-cache\n--enable-mem-cache\n--enable-file-cache\n--enable-ssl\n--with-ssl\n--enable-deflate\n--enable-cgi\n--enable-cgid\n--enable-proxy\n--enable-proxy-connect\n--enable-proxy-http\n--enable-proxy-ftp\n--enable-dbd\n--enable-imagemap\n--enable-ident\n--enable-cern-meta\n--enable-http2\n--enable-mpms-shared=all\n--enable-modules=all\n--enable-mods-shared=all\n--disable-brotli\n--disable-lua\n--disable-mods-static\n--disable-md\n--with-port=8080\n--with-sslport=8443\n--enable-unixd\n--without-libxml2\n--libexecdir=$TERMUX_PREFIX/libexec/apache2\nac_cv_func_getpwnam=yes\nac_cv_have_threadsafe_pollset=no\n\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/apache2/manual etc/apache2/original share/man/man8/suexec.8 libexec/httpd.exp\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"-s\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# remove old files\n\trm -rf \"$TERMUX_PREFIX\"/{libexec,share,etc}/apache2\n\trm -rf \"$TERMUX_PREFIX\"/lib/cgi-bin\n\n\tif [ $TERMUX_ARCH_BITS -eq 32 ]; then\n\t\texport ap_cv_void_ptr_lt_long=4\n\telse\n\t\texport ap_cv_void_ptr_lt_long=8\n\tfi\n\n\tLDFLAGS=\"$LDFLAGS -llog -lapr-1 -laprutil-1\"\n\n\t# use custom layout\n\tcat $TERMUX_PKG_BUILDER_DIR/Termux.layout > $TERMUX_PKG_SRCDIR/config.layout\n}\n\ntermux_step_post_configure() {\n\t# thanks to @JetBalsa\n\tgcc -O2 -DCROSS_COMPILE $TERMUX_PKG_SRCDIR/server/gen_test_char.c -o $TERMUX_PKG_BUILDDIR/server/gen_test_char\n\ttouch -d \"1 hour\" $TERMUX_PKG_BUILDDIR/server/gen_test_char\n}\n\ntermux_step_post_make_install() {\n\tsed -e \"s#/$TERMUX_PREFIX/libexec/apache2/#modules/#\" \\\n\t\t-e 's|#\\(LoadModule negotiation_module \\)|\\1|' \\\n\t\t-e 's|#\\(LoadModule include_module \\)|\\1|' \\\n\t\t-e 's|#\\(LoadModule userdir_module \\)|\\1|' \\\n\t\t-e 's|#\\(LoadModule slotmem_shm_module \\)|\\1|' \\\n\t\t-e 's|#\\(Include extra/httpd-multilang-errordoc.conf\\)|\\1|' \\\n\t\t-e 's|#\\(Include extra/httpd-autoindex.conf\\)|\\1|' \\\n\t\t-e 's|#\\(Include extra/httpd-languages.conf\\)|\\1|' \\\n\t\t-e 's|#\\(Include extra/httpd-userdir.conf\\)|\\1|' \\\n\t\t-e 's|#\\(Include extra/httpd-default.conf\\)|\\1|' \\\n\t\t-e 's|#\\(Include extra/httpd-mpm.conf\\)|\\1|' \\\n\t\t-e 's|User daemon|#User daemon|' \\\n\t\t-e 's|Group daemon|#Group daemon|' \\\n\t\t-i \"$TERMUX_PREFIX/etc/apache2/httpd.conf\"\n}\n\ntermux_step_post_massage() {\n\t# sometimes it creates a $TERMUX_PREFIX/bin/sh -> /bin/sh\n\trm ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/bin/sh || true\n\n\tmkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/run/apache2\n\tmkdir -p ${TERMUX_PKG_MASSAGEDIR}${TERMUX_PREFIX}/var/log/apache2\n}\n"
  },
  {
    "path": "packages/apache2/configure.patch",
    "content": "diff -u -r ../httpd-2.4.38/configure ./configure\n--- ../httpd-2.4.38/configure\t2019-01-17 18:46:19.000000000 +0000\n+++ ./configure\t2019-03-17 23:05:48.786527661 +0000\n@@ -6401,7 +6401,7 @@\n           LTFLAGS='--silent'\n       fi\n       my_libtool=`$apr_config --apr-libtool`\n-      LIBTOOL=\"$my_libtool \\$(LTFLAGS)\"\n+      LIBTOOL=\"bash $my_libtool \\$(LTFLAGS)\"\n-      libtoolversion=`$my_libtool --version`\n+      libtoolversion=`bash $my_libtool --version`\n       case $libtoolversion in\n           *1.[45]* | *[2-9].[0-9]*)\n"
  },
  {
    "path": "packages/apg/Makefile.patch",
    "content": "diff -uNr apg-2.3.0b/Makefile apg-2.3.0b.mod/Makefile\n--- apg-2.3.0b/Makefile\t2003-08-07 18:40:39.000000000 +0300\n+++ apg-2.3.0b.mod/Makefile\t2019-05-20 02:04:28.641201031 +0300\n@@ -1,19 +1,19 @@\n ##################################################################\n # Directories\n # Install dirs\n-INSTALL_PREFIX = /usr/local\n+INSTALL_PREFIX = @TERMUX_PREFIX@\n \n # Full default path is /usr/local/bin\n APG_BIN_DIR = /bin\n \n # Full default path is /usr/local/man/man1\n-APG_MAN_DIR = /man/man1\n+APG_MAN_DIR = /share/man/man1\n \n # Full default path is /usr/local/sbin\n-APGD_BIN_DIR = /sbin\n+APGD_BIN_DIR = $(APG_BIN_DIR)\n \n # Full default path is /usr/local/man/man8\n-APGD_MAN_DIR = /man/man8\n+APGD_MAN_DIR = /share/man/man8\n \n # You should not edit 2 lines below\n APGBFM_CLIBS = -lm\n@@ -35,7 +35,7 @@\n #         This works on MacOS X\n #\n STANDALONE_OPTIONS += -DAPG_USE_CRYPT\n-APG_CLIBS += -lcrypt\n+APG_CLIBS += -L@TERMUX_PREFIX@/lib -lcrypt\n \n ##################################################################\n # Support for cracklib\n@@ -60,12 +60,12 @@\n ##################################################################\n # You can modify CC variable if you have compiler other than GCC\n # But the code was designed and tested with GCC\n-CC = gcc\n+CC ?= gcc\n \n ##################################################################\n # Compilation flags\n # You should comment the line below for AIX+native cc\n-CFLAGS = -Wall\n+CFLAGS = -Wall -I@TERMUX_PREFIX@/include -Wl,-rpath=@TERMUX_PREFIX@/lib -Wl,--enable-new-dtags\n \n ####################################################################\n # If you plan to install APG daemon you should look at lines below #\n"
  },
  {
    "path": "packages/apg/build.sh",
    "content": "## Note: APG project seems dead. Official homepage & src urls\n## disappeared.\n\nTERMUX_PKG_HOMEPAGE=http://www.adel.nursat.kz/apg/index.shtml\nTERMUX_PKG_DESCRIPTION=\"Automated Password Generator\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.3.0b\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/apg-2.3.0b.tar.gz\nTERMUX_PKG_SHA256=d1e52029709e2d7f9cb99bedce3e02ee7a63cff7b8e2b4c2bc55b3dc03c28b92\nTERMUX_PKG_DEPENDS=\"libcrypt\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_extract_package() {\n\t# Fix permissions.\n\tfind \"$TERMUX_PKG_SRCDIR\" -type d -exec chmod 700 \"{}\" \\;\n\tfind \"$TERMUX_PKG_SRCDIR\" -type f -executable -exec chmod 700 \"{}\" \\;\n\tfind \"$TERMUX_PKG_SRCDIR\" -type f ! -executable -exec chmod 600 \"{}\" \\;\n}\n"
  },
  {
    "path": "packages/apg/install-sh.patch",
    "content": "diff -uNr apg-2.2.3/install-sh apg-2.2.3.mod/install-sh\n--- apg-2.2.3/install-sh\t2003-08-07 18:40:30.000000000 +0300\n+++ apg-2.2.3.mod/install-sh\t2019-01-28 21:07:56.823960998 +0200\n@@ -35,9 +35,9 @@\n mvprog=\"${MVPROG-mv}\"\n cpprog=\"${CPPROG-cp}\"\n chmodprog=\"${CHMODPROG-chmod}\"\n-chownprog=\"${CHOWNPROG-chown}\"\n-chgrpprog=\"${CHGRPPROG-chgrp}\"\n-stripprog=\"${STRIPPROG-strip}\"\n+chownprog=\"${CHOWNPROG-true}\"\n+chgrpprog=\"${CHGRPPROG-true}\"\n+stripprog=\"${STRIPPROG-true}\"\n rmprog=\"${RMPROG-rm}\"\n mkdirprog=\"${MKDIRPROG-mkdir}\"\n \n"
  },
  {
    "path": "packages/apksigner/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/fornwall/apksigner\nTERMUX_PKG_DESCRIPTION=\"APK signing tool\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.7\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=340560c4f75af3501f037452bcf184fa48fd18bc877a4cce9a51a3fa047b4b38\nTERMUX_PKG_SRCURL=https://github.com/fornwall/apksigner/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make() {\n\tmkdir -p $TERMUX_PREFIX/share/{dex,man/man1}\n\n\tcp apksigner.1 $TERMUX_PREFIX/share/man/man1/\n\n\tGRADLE_OPTS=\" -Dorg.gradle.daemon=false\" ./gradlew\n\t$TERMUX_D8 \\\n\t\t--classpath $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar \\\n\t\t--release \\\n\t\t--min-api $TERMUX_PKG_API_LEVEL \\\n\t\t--output $TERMUX_PKG_TMPDIR \\\n\t\t./build/libs/src-all.jar\n\n\tcd $TERMUX_PKG_TMPDIR\n\tjar cf apksigner.jar classes.dex\n\tmv apksigner.jar $TERMUX_PREFIX/share/dex/apksigner.jar\n\n\techo '#!/bin/sh' > $TERMUX_PREFIX/bin/apksigner\n\techo \"dalvikvm -cp $TERMUX_PREFIX/share/dex/apksigner.jar net.fornwall.apksigner.Main \\$@\" >> $TERMUX_PREFIX/bin/apksigner\n\tchmod +x $TERMUX_PREFIX/bin/apksigner\n}\n"
  },
  {
    "path": "packages/apr/Makefile.in.patch",
    "content": "diff -u -r ../apr-1.5.2/Makefile.in ./Makefile.in\n--- ../apr-1.5.2/Makefile.in\t2014-04-25 06:51:11.000000000 -0400\n+++ ./Makefile.in\t2015-05-03 19:04:44.159616097 -0400\n@@ -134,8 +134,9 @@\n \t$(APR_MKDIR) tools\n \t$(LT_COMPILE)\n \n-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)\n-\t$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)\n+tools/gen_test_char@EXEEXT@: tools/gen_test_char.c\n+\t$(CC_FOR_BUILD) -DCROSS_COMPILE -o $@ $<\n+\n \n include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@\n \t$(APR_MKDIR) include/private\n"
  },
  {
    "path": "packages/apr/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://apr.apache.org/\nTERMUX_PKG_DESCRIPTION=\"Apache Portable Runtime Library\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.7.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net/apr/apr-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea\nTERMUX_PKG_DEPENDS=\"libuuid\"\nTERMUX_PKG_BREAKS=\"apr-dev\"\nTERMUX_PKG_REPLACES=\"apr-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n# \"ac_cv_search_crypt=\" to avoid needlessly linking to libcrypt.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-installbuilddir=$TERMUX_PREFIX/share/apr-1/build\nac_cv_func_getrandom=no\nac_cv_have_decl_SYS_getrandom=no\nac_cv_file__dev_zero=yes\nac_cv_func_setpgrp_void=yes\napr_cv_process_shared_works=no\napr_cv_tcp_nodelay_with_cork=yes\nac_cv_sizeof_struct_iovec=$(( TERMUX_ARCH_BITS==32 ? 8 : 16 ))\nac_cv_search_crypt=\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/apr.exp\"\n\ntermux_step_post_make_install() {\n\tsed -i \"s%NM=\\\".*%NM=\\\"${TERMUX_HOST_PLATFORM}-nm -B\\\"%g\" $TERMUX_PREFIX/share/apr-1/build/libtool\n}\n"
  },
  {
    "path": "packages/apr-util/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://apr.apache.org/\nTERMUX_PKG_DESCRIPTION=\"Apache Portable Runtime Utility Library\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.6.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b\nTERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net/apr/apr-util-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"apr, libcrypt, libexpat, libiconv, libuuid\"\nTERMUX_PKG_BREAKS=\"apr-util-dev\"\nTERMUX_PKG_REPLACES=\"apr-util-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_pq_PQsendQueryPrepared=no\n--with-apr=$TERMUX_PREFIX\n--without-sqlite3\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/aprutil.exp\"\n"
  },
  {
    "path": "packages/apt/0000-cmake-fix.patch",
    "content": "diff -uNr apt-1.4.9/apt-pkg/CMakeLists.txt apt-1.4.9.mod/apt-pkg/CMakeLists.txt\n--- apt-1.4.9/apt-pkg/CMakeLists.txt\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/CMakeLists.txt\t2019-11-12 22:32:19.117227283 +0200\n@@ -48,13 +48,12 @@\n )\n \n target_link_libraries(apt-pkg\n-                      PRIVATE -lutil ${CMAKE_DL_LIBS} ${RESOLV_LIBRARIES}\n+                      PRIVATE ${CMAKE_DL_LIBS} ${RESOLV_LIBRARIES}\n                              ${CMAKE_THREAD_LIBS_INIT}\n                              ${ZLIB_LIBRARIES}\n                              ${BZIP2_LIBRARIES}\n                              ${LZMA_LIBRARIES}\n                              ${LZ4_LIBRARIES}\n-                             ${ICONV_LIBRARIES}\n )\n set_target_properties(apt-pkg PROPERTIES VERSION ${MAJOR}.${MINOR})\n set_target_properties(apt-pkg PROPERTIES SOVERSION ${MAJOR})\ndiff -uNr apt-1.4.9/CMakeLists.txt apt-1.4.9.mod/CMakeLists.txt\n--- apt-1.4.9/CMakeLists.txt\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/CMakeLists.txt\t2019-11-12 22:32:24.393914821 +0200\n@@ -4,6 +4,7 @@\n # set minimum version\n project(apt)\n cmake_minimum_required(VERSION 3.4.0)\n+include(CheckSymbolExists)\n # Generic header locations\n include_directories(${PROJECT_BINARY_DIR}/include)\n \n@@ -33,7 +34,6 @@\n include(GNUInstallDirs)\n include(TestBigEndian)\n find_package(Threads)\n-find_package(LFS REQUIRED)\n find_package(Iconv REQUIRED)\n \n find_package(Perl REQUIRED)\n@@ -44,11 +44,6 @@\n   include_directories(${Intl_INCLUDE_DIRS})\n endif()\n \n-# Add large file support\n-add_compile_options(${LFS_COMPILE_OPTIONS})\n-add_definitions(${LFS_DEFINITIONS})\n-link_libraries(${LFS_LIBRARIES})\n-\n # Set compiler flags\n set(CMAKE_CXX_STANDARD 11)\n set(CMAKE_CXX_STANDARD_REQUIRED ON)\n@@ -89,21 +77,12 @@\n endif()\n \n \n-find_package(BZip2)\n-if (BZIP2_FOUND)\n-  set(HAVE_BZ2 1)\n-endif()\n-\n find_package(LZMA)\n if (LZMA_FOUND)\n   set(HAVE_LZMA 1)\n endif()\n \n \n-find_package(LZ4)\n-if (LZ4_FOUND)\n-  set(HAVE_LZ4 1)\n-endif()\n \n # Mount()ing and stat()ing and friends\n check_symbol_exists(statfs sys/vfs.h HAVE_VFS_H)\n@@ -180,10 +159,10 @@\n   message(STATUS \"Found dpkg data dir: ${DPKG_DATADIR_CMD}\")\n   set(DPKG_DATADIR \"${DPKG_DATADIR_CMD}\" CACHE PATH \"dpkg data directory\")\n endif()\n-if (NOT DEFINED COMMON_ARCH)\n-  execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH\n-                  OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)\n-endif()\n+# if (NOT DEFINED COMMON_ARCH)\n+#  execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH\n+                  #OUTPUT_VARIABLE COMMON_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)\n+# endif()\n if (NOT DEFINED ROOT_GROUP)\n   execute_process(COMMAND id -gn root\n                   OUTPUT_VARIABLE ROOT_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE)\n@@ -211,11 +190,8 @@\n add_subdirectory(apt-inst)\n add_subdirectory(cmdline)\n add_subdirectory(completions)\n-add_subdirectory(doc)\n add_subdirectory(dselect)\n-add_subdirectory(ftparchive)\n add_subdirectory(methods)\n-add_subdirectory(test)\n \n if (USE_NLS)\n add_subdirectory(po)\ndiff -uNr apt-1.4.9/methods/CMakeLists.txt apt-1.4.9.mod/methods/CMakeLists.txt\n--- apt-1.4.9/methods/CMakeLists.txt\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/methods/CMakeLists.txt\t2019-11-12 22:32:30.553939187 +0200\n@@ -7,7 +7,7 @@\n add_executable(http http.cc http_main.cc rfc2553emu.cc connect.cc basehttp.cc)\n add_executable(mirror mirror.cc http.cc rfc2553emu.cc connect.cc basehttp.cc)\n add_executable(https https.cc basehttp.cc)\n-add_executable(ftp ftp.cc rfc2553emu.cc connect.cc)\n+# add_executable(ftp ftp.cc rfc2553emu.cc connect.cc)\n add_executable(rred rred.cc)\n add_executable(rsh rsh.cc)\n \n@@ -23,12 +23,12 @@\n target_link_libraries(http apt-pkg)\n target_link_libraries(mirror apt-pkg ${RESOLV_LIBRARIES})\n target_link_libraries(https apt-pkg ${CURL_LIBRARIES})\n-target_link_libraries(ftp apt-pkg)\n+#target_link_libraries(ftp apt-pkg)\n target_link_libraries(rred apt-pkg)\n target_link_libraries(rsh apt-pkg)\n \n # Install the library\n-install(TARGETS file copy store gpgv cdrom http https ftp rred rsh mirror\n+install(TARGETS file copy store gpgv cdrom http https rred rsh mirror\n         RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/apt/methods)\n \n add_slaves(${CMAKE_INSTALL_LIBEXECDIR}/apt/methods store gzip lzma bzip2 xz)\n"
  },
  {
    "path": "packages/apt/0001-hardcoded-paths-fix.patch",
    "content": "diff -uNr apt-1.4.9/apt-pkg/aptconfiguration.cc apt-1.4.9.mod/apt-pkg/aptconfiguration.cc\n--- apt-1.4.9/apt-pkg/aptconfiguration.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/aptconfiguration.cc\t2019-11-12 22:10:28.531994919 +0200\n@@ -35,10 +35,10 @@\n // setDefaultConfigurationForCompressors\t\t\t\t/*{{{*/\n static void setDefaultConfigurationForCompressors() {\n \t// Set default application paths to check for optional compression types\n-\t_config->CndSet(\"Dir::Bin::gzip\", \"/bin/gzip\");\n-\t_config->CndSet(\"Dir::Bin::bzip2\", \"/bin/bzip2\");\n-\t_config->CndSet(\"Dir::Bin::xz\", \"/usr/bin/xz\");\n-\t_config->CndSet(\"Dir::Bin::lz4\", \"/usr/bin/lz4\");\n+\t_config->CndSet(\"Dir::Bin::gzip\", \"@TERMUX_PREFIX@/bin/gzip\");\n+\t_config->CndSet(\"Dir::Bin::bzip2\", \"@TERMUX_PREFIX@/bin/bzip2\");\n+\t_config->CndSet(\"Dir::Bin::xz\", \"@TERMUX_PREFIX@/bin/xz\");\n+\t_config->CndSet(\"Dir::Bin::lz4\", \"@TERMUX_PREFIX@/bin/lz4\");\n \tif (FileExists(_config->Find(\"Dir::Bin::xz\")) == true) {\n \t\t_config->Set(\"Dir::Bin::lzma\", _config->Find(\"Dir::Bin::xz\"));\n \t\t_config->Set(\"APT::Compressor::lzma::Binary\", \"xz\");\n@@ -51,7 +51,7 @@\n \t\t\t_config->Set(\"APT::Compressor::lzma::UncompressArg::\", \"-d\");\n \t\t}\n \t} else {\n-\t\t_config->CndSet(\"Dir::Bin::lzma\", \"/usr/bin/lzma\");\n+\t\t_config->CndSet(\"Dir::Bin::lzma\", \"@TERMUX_PREFIX@/bin/lzma\");\n \t\tif (_config->Exists(\"APT::Compressor::lzma::CompressArg\") == false) {\n \t\t\t_config->Set(\"APT::Compressor::lzma::CompressArg::\", \"--suffix=\");\n \t\t\t_config->Set(\"APT::Compressor::lzma::CompressArg::\", \"-6\");\ndiff -uNr apt-1.4.9/apt-pkg/contrib/cdromutl.cc apt-1.4.9.mod/apt-pkg/contrib/cdromutl.cc\n--- apt-1.4.9/apt-pkg/contrib/cdromutl.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/contrib/cdromutl.cc\t2019-11-12 22:10:38.788703372 +0200\n@@ -268,7 +268,7 @@\n string FindMountPointForDevice(const char *devnode)\n {\n    // this is the order that mount uses as well\n-   std::vector<std::string> const mounts = _config->FindVector(\"Dir::state::MountPoints\", \"/etc/mtab,/proc/mount\");\n+   std::vector<std::string> const mounts = _config->FindVector(\"Dir::state::MountPoints\", \"@TERMUX_PREFIX@/etc/mtab,/proc/mount\");\n \n    for (std::vector<std::string>::const_iterator m = mounts.begin(); m != mounts.end(); ++m)\n       if (FileExists(*m) == true)\ndiff -uNr apt-1.4.9/apt-pkg/contrib/fileutl.cc apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc\n--- apt-1.4.9/apt-pkg/contrib/fileutl.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc\t2019-11-12 22:12:25.625803839 +0200\n@@ -106,7 +106,7 @@\n             _exit(100);\n       }\n \n-      if (chdir(\"/tmp/\") != 0)\n+      if (chdir(\"@TERMUX_PREFIX@/tmp/\") != 0)\n \t _exit(100);\n \t \n       unsigned int Count = 1;\n@@ -2790,10 +2790,10 @@\n    struct stat st;\n    if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set\n \t stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory\n-      tmpdir = \"/tmp\";\n+      tmpdir = \"@TERMUX_PREFIX@/tmp\";\n    else if (geteuid() != 0 && // root can do everything anyway\n \t faccessat(AT_FDCWD, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS) != 0) // current user has rwx access to directory\n-      tmpdir = \"/tmp\";\n+      tmpdir = \"@TERMUX_PREFIX@/tmp\";\n \n    return string(tmpdir);\n }\n@@ -3064,7 +3064,7 @@\n       setenv(\"LOGNAME\", pw->pw_name, 1);\n       auto const shell = flNotDir(pw->pw_shell);\n       if (shell == \"false\" || shell == \"nologin\")\n-\t setenv(\"SHELL\", \"/bin/sh\", 1);\n+\t setenv(\"SHELL\", \"@TERMUX_PREFIX@/bin/sh\", 1);\n       else\n \t setenv(\"SHELL\", pw->pw_shell, 1);\n       auto const apt_setenv_tmp = [](char const * const env) {\ndiff -uNr apt-1.4.9/apt-pkg/deb/dpkgpm.cc apt-1.4.9.mod/apt-pkg/deb/dpkgpm.cc\n--- apt-1.4.9/apt-pkg/deb/dpkgpm.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/deb/dpkgpm.cc\t2019-11-12 22:18:36.777295457 +0200\n@@ -179,7 +179,7 @@\n    so we use the binary from util-linux */\n static bool ionice(int PID)\n {\n-   if (!FileExists(\"/usr/bin/ionice\"))\n+   if (!FileExists(\"@TERMUX_PREFIX@/bin/ionice\"))\n       return false;\n    pid_t Process = ExecFork();\n    if (Process == 0)\n@@ -187,7 +187,7 @@\n       char buf[32];\n       snprintf(buf, sizeof(buf), \"-p%d\", PID);\n       const char *Args[4];\n-      Args[0] = \"/usr/bin/ionice\";\n+      Args[0] = \"@TERMUX_PREFIX@/bin/ionice\";\n       Args[1] = \"-c3\";\n       Args[2] = buf;\n       Args[3] = 0;\n@@ -483,7 +483,7 @@\n \n \t debSystem::DpkgChrootDirectory();\n \t const char *Args[4];\n-\t Args[0] = \"/bin/sh\";\n+\t Args[0] = \"@TERMUX_PREFIX@/bin/sh\";\n \t Args[1] = \"-c\";\n \t Args[2] = Opts->Value.c_str();\n \t Args[3] = 0;\n@@ -2403,11 +2403,13 @@\n       fprintf(report, \" %s: %s\\n\", pkgname.c_str(), opstr);\n    }\n \n+// Android doesn't allow to use dmesg without root.\n+#ifndef __ANDROID__\n    // attach dmesg log (to learn about segfaults)\n-   if (FileExists(\"/bin/dmesg\"))\n+   if (FileExists(\"@TERMUX_PREFIX@/bin/dmesg\"))\n    {\n       fprintf(report, \"Dmesg:\\n\");\n-      FILE *log = popen(\"/bin/dmesg\",\"r\");\n+      FILE *log = popen(\"@TERMUX_PREFIX@/bin/dmesg\",\"r\");\n       if(log != NULL)\n       {\n \t char buf[1024];\n@@ -2416,13 +2418,13 @@\n \t pclose(log);\n       }\n    }\n+#endif\n \n-   // attach df -l log (to learn about filesystem status)\n-   if (FileExists(\"/bin/df\"))\n+   // attach df log (to learn about filesystem status)\n+   if (FileExists(\"@TERMUX_PREFIX@/bin/df\"))\n    {\n-\n       fprintf(report, \"Df:\\n\");\n-      FILE *log = popen(\"/bin/df -l\",\"r\");\n+      FILE *log = popen(\"@TERMUX_PREFIX@/bin/df\",\"r\");\n       if(log != NULL)\n       {\n \t char buf[1024];\ndiff -uNr apt-1.4.9/cmdline/apt-key.in apt-1.4.9.mod/cmdline/apt-key.in\n--- apt-1.4.9/cmdline/apt-key.in\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/cmdline/apt-key.in\t2019-11-12 22:27:00.015963736 +0200\n@@ -260,7 +260,7 @@\n \tif accessible_file_exists \"$TRUSTEDFILE\"; then\n \t    $ACTION \"$TRUSTEDFILE\" \"$@\"\n \tfi\n-\tlocal TRUSTEDPARTS=\"/etc/apt/trusted.gpg.d\"\n+\tlocal TRUSTEDPARTS=\"@TERMUX_PREFIX@/etc/apt/trusted.gpg.d\"\n \teval \"$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)\"\n \tif [ -d \"$TRUSTEDPARTS\" ]; then\n \t    TRUSTEDPARTS=\"$(readlink -f \"$TRUSTEDPARTS\")\"\n@@ -439,7 +439,7 @@\n \tmerge_all_trusted_keyrings_into_pubring\n \tFORCED_KEYRING=\"${GPGHOMEDIR}/forcedkeyid.gpg\"\n \tTRUSTEDFILE=\"${FORCED_KEYRING}\"\n-\techo \"#!/bin/sh\n+\techo \"#!@TERMUX_PREFIX@/bin/sh\n exec sh '($(escape_shell \"${GPG}\")' --keyring '$(escape_shell \"${TRUSTEDFILE}\")' \\\"\\$@\\\"\" > \"${GPGHOMEDIR}/gpg.1.sh\"\n \tGPG=\"${GPGHOMEDIR}/gpg.1.sh\"\n \t# ignore error as this \"just\" means we haven't found the forced keyid and the keyring will be empty\n@@ -451,13 +451,13 @@\n \telse\n \t   touch \"${GPGHOMEDIR}/pubring.gpg\" \"${GPGHOMEDIR}/pubring.orig.gpg\"\n \tfi\n-\techo \"#!/bin/sh\n+\techo \"#!@TERMUX_PREFIX@/bin/sh\n exec sh '$(escape_shell \"${GPG}\")' --keyring '$(escape_shell \"${GPGHOMEDIR}/pubring.gpg\")' \\\"\\$@\\\"\" > \"${GPGHOMEDIR}/gpg.1.sh\"\n \tGPG=\"${GPGHOMEDIR}/gpg.1.sh\"\n     else\n \tTRUSTEDFILE=\"$(dearmor_filename \"$FORCED_KEYRING\")\"\n \tcreate_new_keyring \"$TRUSTEDFILE\"\n-\techo \"#!/bin/sh\n+\techo \"#!@TERMUX_PREFIX@/bin/sh\n exec sh '$(escape_shell \"${GPG}\")' --keyring '$(escape_shell \"${TRUSTEDFILE}\")' \\\"\\$@\\\"\" > \"${GPGHOMEDIR}/gpg.1.sh\"\n \tGPG=\"${GPGHOMEDIR}/gpg.1.sh\"\n     fi\n@@ -542,7 +542,7 @@\n done\n \n if [ -z \"$TRUSTEDFILE\" ]; then\n-   TRUSTEDFILE=\"/etc/apt/trusted.gpg\"\n+   TRUSTEDFILE=\"@TERMUX_PREFIX@/etc/apt/trusted.gpg\"\n    eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)\n    eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)\n fi\n@@ -612,7 +612,7 @@\n \t    unset TMPDIR\n \tfi\n     fi\n-    GPGHOMEDIR=\"$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')\"\n+    GPGHOMEDIR=\"$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')\"\n     CURRENTTRAP=\"${CURRENTTRAP} cleanup_gpg_home;\"\n     trap \"${CURRENTTRAP}\" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM\n     if [ -z \"$GPGHOMEDIR\" ]; then\n@@ -654,7 +654,7 @@\n     create_gpg_home\n \n     # now tell gpg that it shouldn't try to maintain this trustdb file\n-    echo \"#!/bin/sh\n+    echo \"#!@TERMUX_PREFIX@/bin/sh\n exec '$(escape_shell \"${GPG_EXE}\")' --ignore-time-conflict --no-options --no-default-keyring \\\\\n --homedir '$(escape_shell \"${GPGHOMEDIR}\")' --no-auto-check-trustdb --trust-model always \\\"\\$@\\\"\" > \"${GPGHOMEDIR}/gpg.0.sh\"\n     GPG_SH=\"${GPGHOMEDIR}/gpg.0.sh\"\n"
  },
  {
    "path": "packages/apt/0002-glob.patch",
    "content": "diff -uNr apt-1.4.9/apt-pkg/contrib/fileutl.cc apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc\n--- apt-1.4.9/apt-pkg/contrib/fileutl.cc\t2019-11-12 22:12:25.625803839 +0200\n+++ apt-1.4.9.mod/apt-pkg/contrib/fileutl.cc\t2019-11-12 22:36:46.021615823 +0200\n@@ -46,7 +46,9 @@\n #include <dirent.h>\n #include <signal.h>\n #include <errno.h>\n+#ifndef __ANDROID__\n #include <glob.h>\n+#endif\n #include <pwd.h>\n #include <grp.h>\n \n@@ -2752,6 +2754,7 @@\n }\n \t\t\t\t\t\t\t\t\t/*}}}*/\n \n+#ifndef __ANDROID__\n // Glob - wrapper around \"glob()\"\t\t\t\t\t/*{{{*/\n std::vector<std::string> Glob(std::string const &pattern, int flags)\n {\n@@ -2777,6 +2780,7 @@\n    globfree(&globbuf);\n    return result;\n }\n+#endif\n \t\t\t\t\t\t\t\t\t/*}}}*/\n static std::string APT_NONNULL(1) GetTempDirEnv(char const * const env)\t/*{{{*/\n {\ndiff -uNr apt-1.4.9/apt-pkg/contrib/fileutl.h apt-1.4.9.mod/apt-pkg/contrib/fileutl.h\n--- apt-1.4.9/apt-pkg/contrib/fileutl.h\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/contrib/fileutl.h\t2019-11-12 22:36:46.021615823 +0200\n@@ -239,7 +239,9 @@\n APT_HIDDEN std::string flNormalize(std::string file);\n \n // simple c++ glob\n+#ifndef __ANDROID__\n std::vector<std::string> Glob(std::string const &pattern, int flags=0);\n+#endif\n \n /** \\brief Popen() implementation that execv() instead of using a shell\n  *\n"
  },
  {
    "path": "packages/apt/0003-langinfo-and-codeset.patch",
    "content": "diff -uNr apt-1.4.9/apt-pkg/contrib/strutl.cc apt-1.4.9.mod/apt-pkg/contrib/strutl.cc\n--- apt-1.4.9/apt-pkg/contrib/strutl.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/contrib/strutl.cc\t2019-11-12 22:39:32.592335551 +0200\n@@ -100,6 +100,7 @@\n }\n }\n \t\t\t\t\t\t\t\t\t/*}}}*/\n+#ifndef __ANDROID__\n // UTF8ToCodeset - Convert some UTF-8 string for some codeset   \t/*{{{*/\n // ---------------------------------------------------------------------\n /* This is handy to use before display some information for enduser  */\n@@ -169,6 +170,7 @@\n \n   return true;\n }\n+#endif\n \t\t\t\t\t\t\t\t\t/*}}}*/\n // strstrip - Remove white space from the front and back of a string\t/*{{{*/\n // ---------------------------------------------------------------------\ndiff -uNr apt-1.4.9/apt-pkg/deb/debrecords.cc apt-1.4.9.mod/apt-pkg/deb/debrecords.cc\n--- apt-1.4.9/apt-pkg/deb/debrecords.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/deb/debrecords.cc\t2019-11-12 22:39:37.975693094 +0200\n@@ -25,7 +25,9 @@\n #include <sstream>\n #include <string>\n #include <vector>\n+#ifndef __ANDROID__\n #include <langinfo.h>\n+#endif\n \n #include <apti18n.h>\n \t\t\t\t\t\t\t\t\t/*}}}*/\n@@ -152,12 +154,14 @@\n \t orig = Section.FindS(\"Description\");\n    }\n \n+#ifndef __ANDROID__\n    char const * const codeset = nl_langinfo(CODESET);\n    if (strcmp(codeset,\"UTF-8\") != 0) {\n       string dest;\n       UTF8ToCodeset(codeset, orig, &dest);\n       return dest;\n    }\n+#endif\n \n    return orig;\n }\ndiff -uNr apt-1.4.9/apt-private/private-output.cc apt-1.4.9.mod/apt-private/private-output.cc\n--- apt-1.4.9/apt-private/private-output.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-private/private-output.cc\t2019-11-12 22:39:43.812385978 +0200\n@@ -20,7 +20,11 @@\n #include <string.h>\n #include <iomanip>\n #include <iostream>\n-#include <langinfo.h>\n+#ifdef __ANDROID__\n+#  include <termios.h>\n+# else\n+#  include <langinfo.h>\n+#endif\n #include <unistd.h>\n #include <signal.h>\n #include <sys/ioctl.h>\n@@ -717,7 +721,7 @@\n    regex_t Pattern;\n    int Res;\n \n-   Res = regcomp(&Pattern, nl_langinfo(YESEXPR),\n+   Res = regcomp(&Pattern, \"^[yY]\",\n                  REG_EXTENDED|REG_ICASE|REG_NOSUB);\n \n    if (Res != 0) {\n"
  },
  {
    "path": "packages/apt/0004-srv-records.patch",
    "content": "diff -uNr apt-1.4.9/apt-pkg/contrib/srvrec.cc apt-1.4.9.mod/apt-pkg/contrib/srvrec.cc\n--- apt-1.4.9/apt-pkg/contrib/srvrec.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/contrib/srvrec.cc\t2019-11-12 22:41:25.142836445 +0200\n@@ -40,14 +40,24 @@\n    struct servent *s_ent = nullptr;\n    std::vector<char> buf(1024);\n \n+#ifdef __ANDROID__\n+   s_ent = getservbyport(htons(port), \"tcp\");\n+   if (s_ent == nullptr) return false;\n+#else\n    res = getservbyport_r(htons(port), \"tcp\", &s_ent_buf, buf.data(), buf.size(), &s_ent);\n    if (res != 0 || s_ent == nullptr)\n       return false;\n+#endif\n \n    strprintf(target, \"_%s._tcp.%s\", s_ent->s_name, host.c_str());\n    return GetSrvRecords(target, Result);\n }\n \n+#ifdef __ANDROID__\n+extern \"C\" int __dn_skipname(const unsigned char* comp_dn, const unsigned char* eom);\n+static inline int dn_skipname(const unsigned char* a, const unsigned char* b) { return __dn_skipname(a,b); }\n+#endif\n+\n bool GetSrvRecords(std::string name, std::vector<SrvRec> &Result)\n {\n    unsigned char answer[PACKETSZ];\ndiff -uNr apt-1.4.9/methods/connect.cc apt-1.4.9.mod/methods/connect.cc\n--- apt-1.4.9/methods/connect.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/methods/connect.cc\t2019-11-12 22:41:29.396188505 +0200\n@@ -129,7 +129,7 @@\n \n    // Check the socket for an error condition\n    unsigned int Err;\n-   unsigned int Len = sizeof(Err);\n+   socklen_t Len = sizeof(Err);\n    if (getsockopt(Fd,SOL_SOCKET,SO_ERROR,&Err,&Len) != 0)\n       return _error->Errno(\"getsockopt\",_(\"Failed\"));\n    \n@@ -301,7 +301,10 @@\n    if(LastHost != Host || LastPort != Port)\n    {\n       SrvRecords.clear();\n-      if (_config->FindB(\"Acquire::EnableSrvRecords\", true) == true)\n+      /* Disable by default in Termux due to it breaking on (some) HTC\n+         devices (https://github.com/termux/termux-packages/issues/99). */\n+\t\n+\t if (_config->FindB(\"Acquire::EnableSrvRecords\", false) == true)\n       {\n          GetSrvRecords(Host, DefPort, SrvRecords);\n \t // RFC2782 defines that a lonely '.' target is an abort reason\n"
  },
  {
    "path": "packages/apt/0005-http2-fix.patch",
    "content": "diff -uNr apt-1.4.9/methods/basehttp.cc apt-1.4.9.mod/methods/basehttp.cc\n--- apt-1.4.9/methods/basehttp.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/methods/basehttp.cc\t2019-11-12 22:43:18.109996205 +0200\n@@ -90,7 +90,12 @@\n       // Evil servers return no version\n       if (Line[4] == '/')\n       {\n-\t int const elements = sscanf(Line.c_str(),\"HTTP/%3u.%3u %3u%359[^\\n]\",&Major,&Minor,&Result,Code);\n+\t int elements = sscanf(Line.c_str(),\"HTTP/%3u %3u[^\\n]\",&Major,&Result);\n+\t if (elements == 2 && Major == 2) {\n+\t     Minor = 0;\n+\t     Code[0] = '\\0';\n+\t } else {\n+\t elements = sscanf(Line.c_str(),\"HTTP/%3u.%3u %3u%359[^\\n]\",&Major,&Minor,&Result,Code);\n \t if (elements == 3)\n \t {\n \t    Code[0] = '\\0';\n@@ -99,6 +104,7 @@\n \t }\n \t else if (elements != 4)\n \t    return _error->Error(_(\"The HTTP server sent an invalid reply header\"));\n+\t }\n       }\n       else\n       {\n"
  },
  {
    "path": "packages/apt/0006-apt-key-nonroot.patch",
    "content": "diff -uNr apt-1.4.9/cmdline/apt-key.in apt-1.4.9.mod/cmdline/apt-key.in\n--- apt-1.4.9/cmdline/apt-key.in\t2019-11-12 22:27:00.015963736 +0200\n+++ apt-1.4.9.mod/cmdline/apt-key.in\t2019-11-12 22:46:00.284024293 +0200\n@@ -16,10 +16,7 @@\n aptkey_echo() { echo \"$@\"; }\n \n requires_root() {\n-\tif [ \"$(id -u)\" -ne 0 ]; then\n-\t\tapt_error \"This command can only be used by root.\"\n-\t\texit 1\n-\tfi\n+\t:\n }\n \n command_available() {\n"
  },
  {
    "path": "packages/apt/0007-termux-apt-vendor.patch",
    "content": "diff -uNr apt-1.4.9/vendor/ubuntu/apt-vendor.ent apt-1.4.9.mod/vendor/ubuntu/apt-vendor.ent\n--- apt-1.4.9/vendor/ubuntu/apt-vendor.ent\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/vendor/ubuntu/apt-vendor.ent\t2019-11-12 22:53:10.802486744 +0200\n@@ -1,9 +1,9 @@\n <!-- details about the keys used by the distribution -->\n-<!ENTITY keyring-distro \"Ubuntu\">\n-<!ENTITY keyring-package \"<package>ubuntu-keyring</package>\">\n-<!ENTITY keyring-filename \"<filename>/usr/share/keyrings/ubuntu-archive-keyring.gpg</filename>\">\n-<!ENTITY keyring-removed-filename \"<filename>/usr/share/keyrings/ubuntu-archive-removed-keys.gpg</filename>\">\n-<!ENTITY keyring-master-filename \"/usr/share/keyrings/ubuntu-master-keyring.gpg\">\n+<!ENTITY keyring-distro \"Termux\">\n+<!ENTITY keyring-package \"<package>termux-keyring</package>\">\n+<!ENTITY keyring-filename \"<filename>@TERMUX_PREFIX@/share/keyrings/termux-archive-keyring.gpg</filename>\">\n+<!ENTITY keyring-removed-filename \"<filename>@TERMUX_PREFIX@/share/keyrings/termux-archive-removed-keys.gpg</filename>\">\n+<!ENTITY keyring-master-filename \"@TERMUX_PREFIX@/share/keyrings/termux-master-keyring.gpg\">\n <!ENTITY keyring-uri \"http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg\">\n \n <!ENTITY sourceslist-list-format \"deb http://us.archive.ubuntu.com/ubuntu &ubuntu-codename; main restricted\n"
  },
  {
    "path": "packages/apt/0008-apt-init.patch",
    "content": "diff -uNr apt-1.4.9/apt-pkg/init.cc apt-1.4.9.mod/apt-pkg/init.cc\n--- apt-1.4.9/apt-pkg/init.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-pkg/init.cc\t2019-11-12 22:55:03.409615793 +0200\n@@ -51,7 +51,7 @@\n    return vec;\n }\n \n-\n+#ifndef __ANDROID__\n // pkgInitArchTupleMap - Initialize the architecture tuple map\t\t\t\t/*{{{*/\n // ---------------------------------------------------------------------\n /* This initializes */\n@@ -116,7 +116,7 @@\n \n    return true;\n }\n-\t\t\t\t\t\t\t\t\t/*}}}*/\n+#endif\t\t\t\t\t\t\t\t\t/*}}}*/\n \n     \n // pkgInitConfig - Initialize the configuration class\t\t\t/*{{{*/\n@@ -133,6 +133,7 @@\n    Cnf.CndSet(\"APT::Install-Recommends\", true);\n    Cnf.CndSet(\"APT::Install-Suggests\", false);\n    Cnf.CndSet(\"Dir\",\"/\");\n+   Cnf.CndSet(\"Acquire::Languages\", \"none\");\n    \n    // State\n    Cnf.CndSet(\"Dir::State\", STATE_DIR + 1);\n@@ -158,9 +159,9 @@\n    Cnf.CndSet(\"Dir::Etc::trusted\", \"trusted.gpg\");\n    Cnf.CndSet(\"Dir::Etc::trustedparts\",\"trusted.gpg.d\");\n    Cnf.CndSet(\"Dir::Bin::methods\", LIBEXEC_DIR \"/methods\");\n-   Cnf.CndSet(\"Dir::Bin::solvers::\",LIBEXEC_DIR  \"/solvers\");\n-   Cnf.CndSet(\"Dir::Bin::planners::\",LIBEXEC_DIR  \"/planners\");\n-   Cnf.CndSet(\"Dir::Media::MountPath\",\"/media/apt\");\n+   Cnf.CndSet(\"Dir::Bin::solvers::\",LIBEXEC_DIR \"/solvers\");\n+   Cnf.CndSet(\"Dir::Bin::planners::\", LIBEXEC_DIR \"/planners\");\n+   Cnf.CndSet(\"Dir::Media::MountPath\",\"media/apt\");\n \n    // State\n    Cnf.CndSet(\"Dir::Log\", LOG_DIR + 1);\n@@ -283,8 +284,6 @@\n \t return _error->Error(_(\"Unable to determine a suitable packaging system type\"));\n    }\n \n-   if (pkgInitArchTupleMap() == false)\n-      return false;\n    \n    return Sys->Initialize(Cnf);\n }\n"
  },
  {
    "path": "packages/apt/0009-fix-macro-redefinition.patch",
    "content": "diff -uNr apt-1.4.9/apt-private/private-download.cc apt-1.4.9.mod/apt-private/private-download.cc\n--- apt-1.4.9/apt-private/private-download.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/apt-private/private-download.cc\t2019-11-13 14:22:40.305931068 +0200\n@@ -127,7 +127,6 @@\n \t\t\t\t\t\t\t\t\t/*}}}*/\n bool CheckFreeSpaceBeforeDownload(std::string const &Dir, unsigned long long FetchBytes)/*{{{*/\n {\n-   uint32_t const RAMFS_MAGIC = 0x858458f6;\n    /* Check for enough free space, but only if we are actually going to\n       download */\n    if (_config->FindB(\"APT::Get::Print-URIs\", false) == true ||\n"
  },
  {
    "path": "packages/apt/0010-prevent-usage-as-root.patch",
    "content": "diff -uNr apt-1.4.9/cmdline/apt.cc apt-1.4.9.mod/cmdline/apt.cc\n--- apt-1.4.9/cmdline/apt.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/cmdline/apt.cc\t2019-11-13 14:55:50.954692940 +0200\n@@ -97,6 +97,12 @@\n \t\t\t\t\t\t\t\t\t/*}}}*/\n int main(int argc, const char *argv[])\t\t\t\t\t/*{{{*/\n {\n+   if (getuid() == 0) {\n+      std::cout << \"You should not use command 'apt' as root.\" << std::endl;\n+      std::cout << \"This is dangerous as may damage your Termux installation and data.\" << std::endl;\n+      return 1;\n+   }\n+\n    CommandLine CmdL;\n    auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);\n \ndiff -uNr apt-1.4.9/cmdline/apt-get.cc apt-1.4.9.mod/cmdline/apt-get.cc\n--- apt-1.4.9/cmdline/apt-get.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/cmdline/apt-get.cc\t2019-11-13 14:55:50.954692940 +0200\n@@ -432,6 +432,12 @@\n \t\t\t\t\t\t\t\t\t/*}}}*/\n int main(int argc,const char *argv[])\t\t\t\t\t/*{{{*/\n {\n+   if (getuid() == 0) {\n+      std::cout << \"You should not use command 'apt-get' as root.\" << std::endl;\n+      std::cout << \"This is dangerous as may damage your Termux installation and data.\" << std::endl;\n+      return 1;\n+   }\n+\n    // Parse the command line and initialize the package library\n    CommandLine CmdL;\n    auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_GET, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);\ndiff -uNr apt-1.4.9/cmdline/apt-key.in apt-1.4.9.mod/cmdline/apt-key.in\n--- apt-1.4.9/cmdline/apt-key.in\t2019-11-13 14:55:25.431240010 +0200\n+++ apt-1.4.9.mod/cmdline/apt-key.in\t2019-11-13 15:04:25.853655116 +0200\n@@ -15,8 +15,11 @@\n \n aptkey_echo() { echo \"$@\"; }\n \n-requires_root() {\n-\t:\n+assert_no_root() {\n+\tif [ \"$(id -u)\" = \"0\" ]; then\n+\t\tapt_error \"Refusing to run 'apt-key' as root to prevent damage to your Termux installation.\"\n+\t\texit 1\n+\tfi\n }\n \n command_available() {\n@@ -510,7 +513,6 @@\n \t create_new_keyring() { if [ ! -r \"$FORCED_KEYRING\" ]; then TRUSTEDFILE='/dev/null'; FORCED_KEYRING=\"$TRUSTEDFILE\"; fi; }\n \t ;;\n       --fakeroot)\n-\t requires_root() { true; }\n \t ;;\n       --quiet)\n \t aptkey_echo() { true; }\n@@ -706,7 +708,7 @@\n case \"$command\" in\n     add)\n \twarn_on_script_usage\n-\trequires_root\n+\tassert_no_root\n \tsetup_merged_keyring\n \taptkey_execute \"$GPG\" --quiet --batch --import \"$@\"\n \tmerge_back_changes\n@@ -714,19 +716,19 @@\n         ;;\n     del|rm|remove)\n \t# no script warning here as removing 'add' usage needs 'del' for cleanup\n-\trequires_root\n+\tassert_no_root\n \tforeach_keyring_do 'remove_key_from_keyring' \"$@\"\n \taptkey_echo \"OK\"\n         ;;\n     update)\n \twarn_on_script_usage\n-\trequires_root\n+\tassert_no_root\n \tsetup_merged_keyring\n \tupdate\n \tmerge_back_changes\n \t;;\n     net-update)\n-\trequires_root\n+\tassert_no_root\n \tsetup_merged_keyring\n \tnet_update\n \tmerge_back_changes\ndiff -uNr apt-1.4.9/cmdline/apt-mark.cc apt-1.4.9.mod/cmdline/apt-mark.cc\n--- apt-1.4.9/cmdline/apt-mark.cc\t2019-01-18 12:42:07.000000000 +0200\n+++ apt-1.4.9.mod/cmdline/apt-mark.cc\t2019-11-13 14:55:50.958026289 +0200\n@@ -316,6 +316,12 @@\n \t\t\t\t\t\t\t\t\t/*}}}*/\n int main(int argc,const char *argv[])\t\t\t\t\t/*{{{*/\n {\n+   if (getuid() == 0) {\n+      std::cout << \"You should not use command 'apt-mark' as root.\" << std::endl;\n+      std::cout << \"This is dangerous as may damage your Termux installation and data.\" << std::endl;\n+      return 1;\n+   }\n+\n    CommandLine CmdL;\n    auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_MARK, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);\n \n"
  },
  {
    "path": "packages/apt/apt-ftparchive.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"apt-ftparchive is the command line tool that generates the index files that APT uses to access a distribution source\"\nTERMUX_SUBPKG_DEPENDS=\"libdb\"\nTERMUX_SUBPKG_INCLUDE=\"\nbin/apt-ftparchive\n\"\n"
  },
  {
    "path": "packages/apt/apt-transport-tor.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"\nlib/apt/methods/tor\nlib/apt/methods/tor+http\nlib/apt/methods/tor+https\n\"\n\nTERMUX_SUBPKG_DESCRIPTION=\"APT transport for anonymous package downloads via Tor\"\nTERMUX_SUBPKG_DEPENDS=\"tor\"\nTERMUX_SUBPKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/apt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt\nTERMUX_PKG_DESCRIPTION=\"Front-end for the dpkg package manager\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.4.9\nTERMUX_PKG_REVISION=24\nTERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=d4d65e7c84da86f3e6dcc933bba46a08db429c9d933b667c864f5c0e880bac0d\n# apt-key requires utilities from coreutils, findutils, gpgv, grep, sed.\nTERMUX_PKG_DEPENDS=\"coreutils, dpkg, findutils, gpgv, grep, libc++, libcurl, liblzma, sed, termux-licenses, zlib\"\nTERMUX_PKG_CONFLICTS=\"apt-transport-https, libapt-pkg\"\nTERMUX_PKG_REPLACES=\"apt-transport-https, libapt-pkg\"\nTERMUX_PKG_RECOMMENDS=\"game-repo, science-repo\"\nTERMUX_PKG_SUGGESTS=\"gnupg, unstable-repo, x11-repo\"\nTERMUX_PKG_ESSENTIAL=true\n\nTERMUX_PKG_CONFFILES=\"\netc/apt/sources.list\netc/apt/trusted.gpg\n\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DPERL_EXECUTABLE=$(which perl)\n-DCMAKE_INSTALL_FULL_LOCALSTATEDIR=$TERMUX_PREFIX\n-DCOMMON_ARCH=$TERMUX_ARCH\n-DDPKG_DATADIR=$TERMUX_PREFIX/share/dpkg\n-DUSE_NLS=OFF\n-DWITH_DOC=OFF\n\"\n\n# ubuntu uses instead $PREFIX/lib instead of $PREFIX/libexec to\n# \"Work around bug in GNUInstallDirs\" (from apt 1.4.8 CMakeLists.txt).\n# Archlinux uses $PREFIX/libexec though, so let's force libexec->lib to\n# get same build result on ubuntu and archlinux.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\"-DCMAKE_INSTALL_LIBEXECDIR=lib\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/apt-cdrom\nbin/apt-extracttemplates\nbin/apt-sortpkgs\netc/apt/apt.conf.d\nlib/apt/methods/bzip2\nlib/apt/methods/cdrom\nlib/apt/methods/mirror\nlib/apt/methods/rred\nlib/apt/planners/\nlib/apt/solvers/\nlib/dpkg/\n\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_post_make_install() {\n\tprintf \"# The main termux repository:\\ndeb https://dl.bintray.com/andronixapp/termux-packages-24 stable main\\n\" > $TERMUX_PREFIX/etc/apt/sources.list\n\tcp $TERMUX_PKG_BUILDER_DIR/trusted.gpg $TERMUX_PREFIX/etc/apt/\n\n\t# apt-transport-tor\n\tln -sfr $TERMUX_PREFIX/lib/apt/methods/http $TERMUX_PREFIX/lib/apt/methods/tor\n\tln -sfr $TERMUX_PREFIX/lib/apt/methods/http $TERMUX_PREFIX/lib/apt/methods/tor+http\n\tln -sfr $TERMUX_PREFIX/lib/apt/methods/https $TERMUX_PREFIX/lib/apt/methods/tor+https\n\n\t# man pages\n\tmkdir -p $TERMUX_PREFIX/share/man/\n\tcp -Rf $TERMUX_PKG_BUILDER_DIR/man/* $TERMUX_PREFIX/share/man/\n}\n"
  },
  {
    "path": "packages/apt/man/man5/apt.conf.5",
    "content": "'\\\" t\n.\\\"     Title: apt.conf\n.\\\"    Author: Jason Gunthorpe\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 25\\ \\&November\\ \\&2016\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\\&.CONF\" \"5\" \"25\\ \\&November\\ \\&2016\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt.conf \\- Configuration file for APT\n.SH \"DESCRIPTION\"\n.PP\n/etc/apt/apt\\&.conf\nis 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\\&.\n.PP\nWhen an APT tool starts up it will read the configuration files in the following order:\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04' 1.\\h'+01'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \"  1.\" 4.2\n.\\}\nthe file specified by the\n\\fBAPT_CONFIG\\fR\nenvironment variable (if any)\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04' 2.\\h'+01'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \"  2.\" 4.2\n.\\}\nall files in\nDir::Etc::Parts\nin 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\nDir::Ignore\\-Files\\-Silently\nconfiguration list \\- in which case it will be silently ignored\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04' 3.\\h'+01'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \"  3.\" 4.2\n.\\}\nthe main configuration file specified by\nDir::Etc::main\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04' 4.\\h'+01'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \"  4.\" 4.2\n.\\}\nall options set in the binary specific configuration subtree are moved into the root of the tree\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04' 5.\\h'+01'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \"  5.\" 4.2\n.\\}\nthe command line options are applied to override the configuration directives or to load even more configuration files\\&.\n.RE\n.SH \"SYNTAX\"\n.PP\nThe configuration file is organized in a tree with options organized into functional groups\\&. Option specification is given with a double colon notation; for instance\nAPT::Get::Assume\\-Yes\nis an option within the APT tool group, for the Get tool\\&. Options do not inherit from their parent groups\\&.\n.PP\nSyntactically the configuration language is modeled after what the ISC tools such as bind and dhcp use\\&. Lines starting with\n//\nare treated as comments (ignored), as well as all text between\n/*\nand\n*/, just like C/C++ comments\\&. Each line is of the form\nAPT::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:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\n   \nAPT {\n  Get {\n    Assume\\-Yes \"true\";\n    Fix\\-Broken \"true\";\n  };\n};\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nwith 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\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\n   \nDPkg::Pre\\-Install\\-Pkgs {\"/usr/sbin/dpkg\\-preconfigure \\-\\-apt\";};\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nIn general the sample configuration file\n/usr/share/doc/apt/examples/configure\\-index\\&.gz\nis a good guide for how it should look\\&.\n.PP\nCase is not significant in names of configuration items, so in the previous example you could use\ndpkg::pre\\-install\\-pkgs\\&.\n.PP\nNames for the configuration items are optional if a list is defined as can be seen in the\nDPkg::Pre\\-Install\\-Pkgs\nexample 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\\&.\n.PP\nTwo special commands are defined:\n#include\n(which is deprecated and not supported by alternative implementations) and\n#clear\\&.\n#include\nwill include the given file, unless the filename ends in a slash, in which case the whole directory is included\\&.\n#clear\nis 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\\&.)\n.PP\nThe\n#clear\ncommand is the only way to delete a list or a complete scope\\&. Reopening a scope (or using the syntax described below with an appended\n::) will\n\\fInot\\fR\noverride previously written entries\\&. Options can only be overridden by addressing a new value to them \\- lists and scopes can\\*(Aqt be overridden, only cleared\\&.\n.PP\nAll 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\nfor instance) followed by an equals sign then the new value of the option\\&. To append a new element to a list, add a trailing\n::\nto the name of the list\\&. (As you might suspect, the scope syntax can\\*(Aqt be used on the command line\\&.)\n.PP\nNote that appending items to a list using\n::\nonly works for one item per line, and that you should not use it in combination with the scope syntax (which adds\n::\nimplicitly)\\&. 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\n\\fIwrong\\fR\nsyntax 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\\&.\n.SH \"THE APT GROUP\"\n.PP\nThis group of options controls general APT behavior as well as holding the options for all of the tools\\&.\n.PP\n\\fBArchitecture\\fR\n.RS 4\nSystem Architecture; sets the architecture to use when fetching files and parsing package lists\\&. The internal default is the architecture apt was compiled for\\&.\n.RE\n.PP\n\\fBArchitectures\\fR\n.RS 4\nAll Architectures the system supports\\&. For instance, CPUs implementing the\namd64\n(also called\nx86\\-64) instruction set are also able to execute binaries compiled for the\ni386\n(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\n\\fBdpkg \\-\\-add\\-architecture\\fR\\&.\n.RE\n.PP\n\\fBCompressor\\fR\n.RS 4\nThis 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\n\\&.reversed\nfile extension which it will pass to the command\n\\fBrev\\fR\nwithout additional commandline parameters for compression and uncompression:\n.sp .if n \\{\\ .RS 4 .\\} .nf APT::Compressor::rev { Name \"rev\"; Extension \"\\&.reversed\"; Binary \"rev\"; CompressArg {}; UncompressArg {}; Cost \"10\"; }; .fi .if n \\{\\ .RE .\\}\n.RE\n.PP\n\\fBBuild\\-Profiles\\fR\n.RS 4\nList of all build profiles enabled for build\\-dependency resolution, without the \"profile\\&.\" namespace prefix\\&. By default this list is empty\\&. The\n\\fBDEB_BUILD_PROFILES\\fR\nas used by\n\\fBdpkg-buildpackage\\fR(1)\noverrides the list notation\\&.\n.RE\n.PP\n\\fBDefault\\-Release\\fR\n.RS 4\nDefault 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\n\\fBapt_preferences\\fR(5)\\&.\n.RE\n.PP\n\\fBIgnore\\-Hold\\fR\n.RS 4\nIgnore held packages; this global option causes the problem resolver to ignore held packages in its decision making\\&.\n.RE\n.PP\n\\fBClean\\-Installed\\fR\n.RS 4\nDefaults 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\\&.\n.RE\n.PP\n\\fBImmediate\\-Configure\\fR\n.RS 4\nDefaults 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\n\\fBdpkg\\fR(1)\ncall\\&. 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\n\\fBdpkg\\fR(1)\ncall 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\\&.\n.sp\nThe 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\\&.\n.sp\nBefore a big operation like\ndist\\-upgrade\nis run with this option disabled you should try to explicitly\ninstall\nthe 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\\&.\n.RE\n.PP\n\\fBForce\\-LoopBreak\\fR\n.RS 4\nNever enable this option unless you\n\\fIreally\\fR\nknow 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\\&.\n\\fISuch a loop should never exist and is a grave bug\\fR\\&. This option will work if the essential packages are not\n\\fBtar\\fR,\n\\fBgzip\\fR,\n\\fBlibc\\fR,\n\\fBdpkg\\fR,\n\\fBdash\\fR\nor anything that those packages depend on\\&.\n.RE\n.PP\n\\fBCache\\-Start\\fR, \\fBCache\\-Grow\\fR, \\fBCache\\-Limit\\fR\n.RS 4\nAPT uses since version 0\\&.7\\&.26 a resizable memory mapped cache file to store the available information\\&.\nCache\\-Start\nacts 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\\&.\nCache\\-Grow\ndefines in bytes with the default of 1048576 (~1 MB) how much the cache size will be increased in the event the space defined by\nCache\\-Start\nis 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\nCache\\-Limit\\&. The default of\nCache\\-Limit\nis 0 which stands for no limit\\&. If\nCache\\-Grow\nis set to 0 the automatic growth of the cache is disabled\\&.\n.RE\n.PP\n\\fBBuild\\-Essential\\fR\n.RS 4\nDefines which packages are considered essential build dependencies\\&.\n.RE\n.PP\n\\fBGet\\fR\n.RS 4\nThe Get subsection controls the\n\\fBapt-get\\fR(8)\ntool; please see its documentation for more information about the options here\\&.\n.RE\n.PP\n\\fBCache\\fR\n.RS 4\nThe Cache subsection controls the\n\\fBapt-cache\\fR(8)\ntool; please see its documentation for more information about the options here\\&.\n.RE\n.PP\n\\fBCDROM\\fR\n.RS 4\nThe CDROM subsection controls the\n\\fBapt-cdrom\\fR(8)\ntool; please see its documentation for more information about the options here\\&.\n.RE\n.SH \"THE ACQUIRE GROUP\"\n.PP\nThe\nAcquire\ngroup of options controls the download of packages as well as the various \"acquire methods\" responsible for the download itself (see also\n\\fBsources.list\\fR(5))\\&.\n.PP\n\\fBCheck\\-Valid\\-Until\\fR\n.RS 4\nSecurity 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\nValid\\-Until\nheader, but if they don\\*(Aqt or a stricter value is desired the\nMax\\-ValidTime\noption below can be used\\&. The\n\\fBCheck\\-Valid\\-Until\\fR\noption of\n\\fBsources.list\\fR(5)\nentries should be preferred to disable the check selectively instead of using this global override\\&.\n.RE\n.PP\n\\fBMax\\-ValidTime\\fR\n.RS 4\nMaximum time (in seconds) after its creation (as indicated by the\nDate\nheader) that the\nRelease\nfile should be considered valid\\&. If the Release file itself includes a\nValid\\-Until\nheader the earlier date of the two is used as the expiration date\\&. The default value is\n0\nwhich 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\n\\fBsources.list\\fR(5)\nentries by using the\n\\fBValid\\-Until\\-Max\\fR\noption there\\&.\n.RE\n.PP\n\\fBMin\\-ValidTime\\fR\n.RS 4\nMinimum time (in seconds) after its creation (as indicated by the\nDate\nheader) that the\nRelease\nfile should be considered valid\\&. Use this if you need to use a seldom updated (local) mirror of a more frequently updated archive with a\nValid\\-Until\nheader 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\n\\fBsources.list\\fR(5)\nentries by using the\n\\fBValid\\-Until\\-Min\\fR\noption there\\&.\n.RE\n.PP\n\\fBPDiffs\\fR\n.RS 4\nTry to download deltas called\nPDiffs\nfor indexes (like\nPackages\nfiles) instead of downloading whole ones\\&. True by default\\&. Preferably, this can be set for specific\n\\fBsources.list\\fR(5)\nentries or index files by using the\n\\fBPDiffs\\fR\noption there\\&.\n.sp\nTwo sub\\-options to limit the use of PDiffs are also available:\nFileLimit\ncan be used to specify a maximum number of PDiff files should be downloaded to update a file\\&.\nSizeLimit\non 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\\&.\n.RE\n.PP\n\\fBBy\\-Hash\\fR\n.RS 4\nTry 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\n\\fBsources.list\\fR(5)\nentries or index files by using the\n\\fBBy\\-Hash\\fR\noption there\\&.\n.RE\n.PP\n\\fBQueue\\-Mode\\fR\n.RS 4\nQueuing mode;\nQueue\\-Mode\ncan be one of\nhost\nor\naccess\nwhich determines how APT parallelizes outgoing connections\\&.\nhost\nmeans that one connection per target host will be opened,\naccess\nmeans that one connection per URI type will be opened\\&.\n.RE\n.PP\n\\fBRetries\\fR\n.RS 4\nNumber of retries to perform\\&. If this is non\\-zero APT will retry failed files the given number of times\\&.\n.RE\n.PP\n\\fBSource\\-Symlinks\\fR\n.RS 4\nUse symlinks for source archives\\&. If set to true then source archives will be symlinked when possible instead of copying\\&. True is the default\\&.\n.RE\n.PP\n\\fBhttp\\fR\n.RS 4\nhttp::Proxy\nsets the default proxy to use for HTTP URIs\\&. It is in the standard form of\nhttp://[[user][:pass]@]host[:port]/\\&. Per host proxies can also be specified by using the form\nhttp::Proxy::<host>\nwith the special keyword\nDIRECT\nmeaning to use no proxies\\&. If no one of the above settings is specified,\n\\fBhttp_proxy\\fR\nenvironment variable will be used\\&.\n.sp\nThree settings are provided for cache control with HTTP/1\\&.1 compliant proxy caches\\&.\nNo\\-Cache\ntells the proxy not to use its cached response under any circumstances\\&.\nMax\\-Age\nsets the allowed maximum age (in seconds) of an index file in the cache of the proxy\\&.\nNo\\-Store\nspecifies 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\\&.\n.sp\nThe option\ntimeout\nsets the timeout timer used by the method; this value applies to the connection as well as the data timeout\\&.\n.sp\nThe setting\nAcquire::http::Pipeline\\-Depth\ncan 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\\&.\n.sp\nAcquire::http::AllowRedirect\ncontrols whether APT will follow redirects, which is enabled by default\\&.\n.sp\nThe used bandwidth can be limited with\nAcquire::http::Dl\\-Limit\nwhich 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\\&.\n.sp\nAcquire::http::User\\-Agent\ncan 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\\&.\n.sp\nAcquire::http::Proxy\\-Auto\\-Detect\ncan 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\nhttp://proxy:port/\nor the word\nDIRECT\nif 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\nAcquire::http::Proxy::\\fIHOST\\fR\\&. See the\n\\fBsquid-deb-proxy-client\\fR(1)\npackage for an example implementation that uses avahi\\&. This option takes precedence over the legacy option name\nProxyAutoDetect\\&.\n.RE\n.PP\n\\fBhttps\\fR\n.RS 4\nThe\nCache\\-control,\nTimeout,\nAllowRedirect,\nDl\\-Limit\nand\nproxy\noptions work for HTTPS URIs in the same way as for the\nhttp\nmethod, and default to the same values if they are not explicitly set\\&. The\nPipeline\\-Depth\noption is not yet supported\\&.\n.sp\nCaInfo\nsuboption specifies place of file that holds info about trusted certificates\\&.\n<host>::CaInfo\nis the corresponding per\\-host option\\&.\nVerify\\-Peer\nboolean suboption determines whether or not the server\\*(Aqs host certificate should be verified against trusted certificates\\&.\n<host>::Verify\\-Peer\nis the corresponding per\\-host option\\&.\nVerify\\-Host\nboolean suboption determines whether or not the server\\*(Aqs hostname should be verified\\&.\n<host>::Verify\\-Host\nis the corresponding per\\-host option\\&.\nSslCert\ndetermines what certificate to use for client authentication\\&.\n<host>::SslCert\nis the corresponding per\\-host option\\&.\nSslKey\ndetermines what private key to use for client authentication\\&.\n<host>::SslKey\nis the corresponding per\\-host option\\&.\nSslForceVersion\noverrides default SSL version to use\\&. It can contain either of the strings \\*(AqTLSv1\\*(Aq or \\*(AqSSLv3\\*(Aq\\&.\n<host>::SslForceVersion\nis the corresponding per\\-host option\\&.\n.RE\n.PP\n\\fBftp\\fR\n.RS 4\nftp::Proxy\nsets the default proxy to use for FTP URIs\\&. It is in the standard form of\nftp://[[user][:pass]@]host[:port]/\\&. Per host proxies can also be specified by using the form\nftp::Proxy::<host>\nwith the special keyword\nDIRECT\nmeaning to use no proxies\\&. If no one of the above settings is specified,\n\\fBftp_proxy\\fR\nenvironment variable will be used\\&. To use an FTP proxy you will have to set the\nftp::ProxyLogin\nscript in the configuration file\\&. This entry specifies the commands to send to tell the proxy server what to connect to\\&. Please see\n/usr/share/doc/apt/examples/configure\\-index\\&.gz\nfor an example of how to do this\\&. The substitution variables representing the corresponding URI component are\n$(PROXY_USER),\n$(PROXY_PASS),\n$(SITE_USER),\n$(SITE_PASS),\n$(SITE)\nand\n$(SITE_PORT)\\&.\n.sp\nThe option\ntimeout\nsets the timeout timer used by the method; this value applies to the connection as well as the data timeout\\&.\n.sp\nSeveral 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)\\&.\n.sp\nIt is possible to proxy FTP over HTTP by setting the\n\\fBftp_proxy\\fR\nenvironment 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\\&.\n.sp\nThe setting\nForceExtended\ncontrols the use of RFC2428\nEPSV\nand\nEPRT\ncommands\\&. 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\\&.\n.RE\n.PP\n\\fBcdrom\\fR\n.RS 4\nFor URIs using the\ncdrom\nmethod, the only configurable option is the mount point,\ncdrom::Mount, which must be the mount point for the CD\\-ROM (or DVD, or whatever) drive as specified in\n/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\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\n/cdrom/::Mount \"foo\";\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nwithin the\ncdrom\nblock\\&. It is important to have the trailing slash\\&. Unmount commands can be specified using UMount\\&.\n.RE\n.PP\n\\fBgpgv\\fR\n.RS 4\nFor GPGV URIs the only configurable option is\ngpgv::Options, which passes additional parameters to gpgv\\&.\n.RE\n.PP\n\\fBCompressionTypes\\fR\n.RS 4\nList of compression types which are understood by the acquire methods\\&. Files like\nPackages\ncan be available in various compression formats\\&. By default the acquire methods can decompress and recompress many common formats like\n\\fBxz\\fR\nand\n\\fBgzip\\fR; with this scope the supported formats can be queried, modified as well as support for more formats added (see also\n\\fBAPT::Compressor\\fR)\\&. The syntax for this is:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nAcquire::CompressionTypes::\\fIFileExtension\\fR \"\\fIMethodname\\fR\";\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nAlso, the\nOrder\nsubgroup 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\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nAcquire::CompressionTypes::Order:: \"gz\";\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\ncan be used to prefer\n\\fBgzip\\fR\ncompressed files over all other compression formats\\&. If\n\\fBxz\\fR\nshould be preferred over\n\\fBgzip\\fR\nand\n\\fBbzip2\\fR\nthe configure setting should look like this:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nAcquire::CompressionTypes::Order { \"xz\"; \"gz\"; };\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nIt is not needed to add\nbz2\nto the list explicitly as it will be added automatically\\&.\n.sp\nNote that the\nDir::Bin::\\fIMethodname\\fR\nwill 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\nbzip2\nmethod (the inbuilt) setting is:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nDir::Bin::bzip2 \"/bin/bzip2\";\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nNote 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\\&.\n.sp\nThe special type\nuncompressed\ncan 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\\&.\n.RE\n.PP\n\\fBGzipIndexes\\fR\n.RS 4\nWhen downloading\ngzip\ncompressed 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\\&.\n.RE\n.PP\n\\fBLanguages\\fR\n.RS 4\nThe Languages subsection controls which\nTranslation\nfiles 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\nTranslation\nfiles for every language \\- the long language codes are especially rare\\&.\n.sp\nThe 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\nLC_MESSAGES\nenvironment variable\\&. It will also ensure that these codes are not included twice in the list\\&. If\nLC_MESSAGES\nis set to \"C\" only the\nTranslation\\-en\nfile (if available) will be used\\&. To force APT to use no Translation file use the setting\nAcquire::Languages=none\\&. \"none\" is another special meaning code which will stop the search for a suitable\nTranslation\nfile\\&. 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\")\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nAcquire::Languages { \"environment\"; \"de\"; \"en\"; \"none\"; \"fr\"; };\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nNote: 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\n/var/lib/apt/lists/\nwill be added to the end of the list (after an implicit \"none\")\\&.\n.RE\n.PP\n\\fBForceIPv4\\fR\n.RS 4\nWhen downloading, force to use only the IPv4 protocol\\&.\n.RE\n.PP\n\\fBForceIPv6\\fR\n.RS 4\nWhen downloading, force to use only the IPv6 protocol\\&.\n.RE\n.PP\n\\fBMaxReleaseFileSize\\fR\n.RS 4\nThe maximum file size of Release/Release\\&.gpg/InRelease files\\&. The default is 10MB\\&.\n.RE\n.PP\n\\fBEnableSrvRecords\\fR\n.RS 4\nThis 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\"\\&.\n.RE\n.PP\n\\fBAllowInsecureRepositories\\fR\n.RS 4\nAllow 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\n\\fBapt-secure\\fR(8)\\&.\n.RE\n.PP\n\\fBAllowWeakRepositories\\fR\n.RS 4\nAllow 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\n\\fBapt-secure\\fR(8)\\&.\n.RE\n.PP\n\\fBAllowDowngradeToInsecureRepositories\\fR\n.RS 4\nAllow 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\nfalse\\&. Concept, implications as well as alternatives are detailed in\n\\fBapt-secure\\fR(8)\\&.\n.RE\n.PP\n\\fBChangelogs::URI\\fR scope\n.RS 4\nAcquiring 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\nAcquire::Changelogs::URI::Label::\\fILABEL\\fR\nor\nAcquire::Changelogs::URI::Origin::\\fIORIGIN\\fR\noption exists and if so this value is taken\\&. The value in the Release file can be overridden with\nAcquire::Changelogs::URI::Override::Label::\\fILABEL\\fR\nor\nAcquire::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\n@CHANGEPATH@\\&. The value for it is: 1\\&. if the package is from a component (e\\&.g\\&.\nmain) 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\\&.\n.RE\n.SH \"BINARY SPECIFIC CONFIGURATION\"\n.PP\nEspecially with the introduction of the\n\\fBapt\\fR\nbinary 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\n\\fBAPT::Get::Show\\-Versions\\fR\neffect\n\\fBapt\\-get\\fR\nas well as\n\\fBapt\\fR\\&.\n.PP\nSetting an option for a specific binary only can be achieved by setting the option inside the\n\\fBBinary::\\fR\\fB\\fIspecific\\-binary\\fR\\fR\nscope\\&. Setting the option\n\\fBAPT::Get::Show\\-Versions\\fR\nfor the\n\\fBapt\\fR\nonly can e\\&.g\\&. by done by setting\n\\fBBinary::apt::APT::Get::Show\\-Versions\\fR\ninstead\\&.\n.PP\nNote 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\\&.\n.SH \"DIRECTORIES\"\n.PP\nThe\nDir::State\nsection has directories that pertain to local state information\\&.\nlists\nis the directory to place downloaded package lists in and\nstatus\nis the name of the\n\\fBdpkg\\fR(1)\nstatus file\\&.\npreferences\nis the name of the APT\npreferences\nfile\\&.\nDir::State\ncontains the default directory to prefix on all sub\\-items if they do not start with\n/\nor\n\\&./\\&.\n.PP\nDir::Cache\ncontains locations pertaining to local cache information, such as the two package caches\nsrcpkgcache\nand\npkgcache\nas well as the location to place downloaded archives,\nDir::Cache::archives\\&. Generation of caches can be turned off by setting\npkgcache\nor\nsrcpkgcache\nto\n\"\"\\&. This will slow down startup but save disk space\\&. It is probably preferable to turn off the pkgcache rather than the srcpkgcache\\&. Like\nDir::State\nthe default directory is contained in\nDir::Cache\n.PP\nDir::Etc\ncontains the location of configuration files,\nsourcelist\ngives the location of the sourcelist and\nmain\nis the default configuration file (setting has no effect, unless it is done from the config file specified by\n\\fBAPT_CONFIG\\fR)\\&.\n.PP\nThe\nDir::Parts\nsetting reads in all the config fragments in lexical order from the directory specified\\&. After this is done then the main config file is loaded\\&.\n.PP\nBinary programs are pointed to by\nDir::Bin\\&.\nDir::Bin::Methods\nspecifies the location of the method handlers and\ngzip,\nbzip2,\nlzma,\ndpkg,\napt\\-get\ndpkg\\-source\ndpkg\\-buildpackage\nand\napt\\-cache\nspecify the location of the respective programs\\&.\n.PP\nThe configuration item\nRootDir\nhas a special meaning\\&. If set, all paths will be relative to\nRootDir,\n\\fIeven paths that are specified absolutely\\fR\\&. So, for instance, if\nRootDir\nis set to\n/tmp/staging\nand\nDir::State::status\nis set to\n/var/lib/dpkg/status, then the status file will be looked up in\n/tmp/staging/var/lib/dpkg/status\\&. If you want to prefix only relative paths, set\nDir\ninstead\\&.\n.PP\nThe\nIgnore\\-Files\\-Silently\nlist 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\n\\&.disabled,\n~,\n\\&.bak\nor\n\\&.dpkg\\-[a\\-z]+\nis silently ignored\\&. As seen in the last default value these patterns can use regular expression syntax\\&.\n.SH \"APT IN DSELECT\"\n.PP\nWhen APT is used as a\n\\fBdselect\\fR(1)\nmethod several configuration directives control the default behavior\\&. These are in the\nDSelect\nsection\\&.\n.PP\n\\fBClean\\fR\n.RS 4\nCache Clean mode; this value may be one of\nalways,\nprompt,\nauto,\npre\\-auto\nand\nnever\\&.\nalways\nand\nprompt\nwill remove all packages from the cache after upgrading,\nprompt\n(the default) does so conditionally\\&.\nauto\nremoves only those packages which are no longer downloadable (replaced with a new version for instance)\\&.\npre\\-auto\nperforms this action before downloading new packages\\&.\n.RE\n.PP\n\\fBoptions\\fR\n.RS 4\nThe contents of this variable are passed to\n\\fBapt-get\\fR(8)\nas command line options when it is run for the install phase\\&.\n.RE\n.PP\n\\fBUpdateoptions\\fR\n.RS 4\nThe contents of this variable are passed to\n\\fBapt-get\\fR(8)\nas command line options when it is run for the update phase\\&.\n.RE\n.PP\n\\fBPromptAfterUpdate\\fR\n.RS 4\nIf true the [U]pdate operation in\n\\fBdselect\\fR(1)\nwill always prompt to continue\\&. The default is to prompt only on error\\&.\n.RE\n.SH \"HOW APT CALLS DPKG(1)\"\n.PP\nSeveral configuration directives control how APT invokes\n\\fBdpkg\\fR(1)\\&. These are in the\nDPkg\nsection\\&.\n.PP\n\\fBoptions\\fR\n.RS 4\nThis is a list of options to pass to\n\\fBdpkg\\fR(1)\\&. The options must be specified using the list notation and each list item is passed as a single argument to\n\\fBdpkg\\fR(1)\\&.\n.RE\n.PP\n\\fBPre\\-Invoke\\fR, \\fBPost\\-Invoke\\fR\n.RS 4\nThis is a list of shell commands to run before/after invoking\n\\fBdpkg\\fR(1)\\&. Like\noptions\nthis must be specified in list notation\\&. The commands are invoked in order using\n/bin/sh; should any fail APT will abort\\&.\n.RE\n.PP\n\\fBPre\\-Install\\-Pkgs\\fR\n.RS 4\nThis is a list of shell commands to run before invoking\n\\fBdpkg\\fR(1)\\&. Like\noptions\nthis must be specified in list notation\\&. The commands are invoked in order using\n/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\\&.\n.sp\nVersion 2 of this protocol sends more information through the requested file descriptor: a line with the text\nVERSION 2, the APT configuration space, and a list of package actions with filename and version information\\&.\n.sp\nEach configuration directive line has the form\nkey=value\\&. Special characters (equal signs, newlines, nonprintable characters, quotation marks, and percent signs in\nkey\nand newlines, nonprintable characters, and percent signs in\nvalue) are %\\-encoded\\&. Lists are represented by multiple\nkey::=value\nlines with the same key\\&. The configuration section ends with a blank line\\&.\n.sp\nPackage 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\n\\- < 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\\&.\n.sp\nIn 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\\&.\n.sp\nThe version of the protocol to be used for the command\n\\fIcmd\\fR\ncan be chosen by setting\nDPkg::Tools::options::\\fIcmd\\fR::Version\naccordingly, 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\\&.\n.sp\nThe file descriptor to be used to send the information can be requested with\nDPkg::Tools::options::\\fIcmd\\fR::InfoFD\nwhich defaults to\n0\nfor standard input and is available since version 0\\&.9\\&.11\\&. Support for the option can be detected by looking for the environment variable\n\\fBAPT_HOOK_INFO_FD\\fR\nwhich contains the number of the used file descriptor as a confirmation\\&.\n.RE\n.PP\n\\fBRun\\-Directory\\fR\n.RS 4\nAPT chdirs to this directory before invoking\n\\fBdpkg\\fR(1), the default is\n/\\&.\n.RE\n.PP\n\\fBBuild\\-options\\fR\n.RS 4\nThese options are passed to\n\\fBdpkg-buildpackage\\fR(1)\nwhen compiling packages; the default is to disable signing and produce all binaries\\&.\n.RE\n.PP\n\\fBDPkg::ConfigurePending\\fR\n.RS 4\nIf this option is set APT will call\n\\fBdpkg \\-\\-configure \\-\\-pending\\fR\nto let\n\\fBdpkg\\fR(1)\nhandle 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\\&.\n.RE\n.SH \"PERIODIC AND ARCHIVES OPTIONS\"\n.PP\nAPT::Periodic\nand\nAPT::Archives\ngroups of options configure behavior of apt periodic updates, which is done by the\n/usr/lib/apt/apt\\&.systemd\\&.daily\nscript\\&. See the top of this script for the brief documentation of these options\\&.\n.SH \"DEBUG OPTIONS\"\n.PP\nEnabling options in the\nDebug::\nsection will cause debugging information to be sent to the standard error stream of the program utilizing the\napt\nlibraries, or enable special program modes that are primarily useful for debugging the behavior of\napt\\&. Most of these options are not interesting to a normal user, but a few may be:\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nDebug::pkgProblemResolver\nenables output about the decisions made by\ndist\\-upgrade, upgrade, install, remove, purge\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nDebug::NoLocking\ndisables all file locking\\&. This can be used to run some operations (for instance,\napt\\-get \\-s install) as a non\\-root user\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nDebug::pkgDPkgPM\nprints out the actual command line each time that\napt\ninvokes\n\\fBdpkg\\fR(1)\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nDebug::IdentCdrom\ndisables the inclusion of statfs data in CD\\-ROM IDs\\&.\n.RE\n.PP\nA full list of debugging options to apt follows\\&.\n.PP\n\\fBDebug::Acquire::cdrom\\fR\n.RS 4\nPrint information related to accessing\ncdrom://\nsources\\&.\n.RE\n.PP\n\\fBDebug::Acquire::ftp\\fR\n.RS 4\nPrint information related to downloading packages using FTP\\&.\n.RE\n.PP\n\\fBDebug::Acquire::http\\fR\n.RS 4\nPrint information related to downloading packages using HTTP\\&.\n.RE\n.PP\n\\fBDebug::Acquire::https\\fR\n.RS 4\nPrint information related to downloading packages using HTTPS\\&.\n.RE\n.PP\n\\fBDebug::Acquire::gpgv\\fR\n.RS 4\nPrint information related to verifying cryptographic signatures using\ngpg\\&.\n.RE\n.PP\n\\fBDebug::aptcdrom\\fR\n.RS 4\nOutput information about the process of accessing collections of packages stored on CD\\-ROMs\\&.\n.RE\n.PP\n\\fBDebug::BuildDeps\\fR\n.RS 4\nDescribes the process of resolving build\\-dependencies in\n\\fBapt-get\\fR(8)\\&.\n.RE\n.PP\n\\fBDebug::Hashes\\fR\n.RS 4\nOutput each cryptographic hash that is generated by the\napt\nlibraries\\&.\n.RE\n.PP\n\\fBDebug::IdentCDROM\\fR\n.RS 4\nDo not include information from\nstatfs, namely the number of used and free blocks on the CD\\-ROM filesystem, when generating an ID for a CD\\-ROM\\&.\n.RE\n.PP\n\\fBDebug::NoLocking\\fR\n.RS 4\nDisable all file locking\\&. For instance, this will allow two instances of\n\\(lqapt\\-get update\\(rq\nto run at the same time\\&.\n.RE\n.PP\n\\fBDebug::pkgAcquire\\fR\n.RS 4\nLog when items are added to or removed from the global download queue\\&.\n.RE\n.PP\n\\fBDebug::pkgAcquire::Auth\\fR\n.RS 4\nOutput status messages and errors related to verifying checksums and cryptographic signatures of downloaded files\\&.\n.RE\n.PP\n\\fBDebug::pkgAcquire::Diffs\\fR\n.RS 4\nOutput information about downloading and applying package index list diffs, and errors relating to package index list diffs\\&.\n.RE\n.PP\n\\fBDebug::pkgAcquire::RRed\\fR\n.RS 4\nOutput information related to patching apt package lists when downloading index diffs instead of full indices\\&.\n.RE\n.PP\n\\fBDebug::pkgAcquire::Worker\\fR\n.RS 4\nLog all interactions with the sub\\-processes that actually perform downloads\\&.\n.RE\n.PP\n\\fBDebug::pkgAutoRemove\\fR\n.RS 4\nLog events related to the automatically\\-installed status of packages and to the removal of unused packages\\&.\n.RE\n.PP\n\\fBDebug::pkgDepCache::AutoInstall\\fR\n.RS 4\nGenerate debug messages describing which packages are being automatically installed to resolve dependencies\\&. This corresponds to the initial auto\\-install pass performed in, e\\&.g\\&.,\napt\\-get install, and not to the full\napt\ndependency resolver; see\nDebug::pkgProblemResolver\nfor that\\&.\n.RE\n.PP\n\\fBDebug::pkgDepCache::Marker\\fR\n.RS 4\nGenerate 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\nMarkKeep,\nMarkDelete\nor\nMarkInstall\nfollowed by\npackage\\-name <a\\&.b\\&.c \\-> d\\&.e\\&.f | x\\&.y\\&.z> (section)\nwhere\na\\&.b\\&.c\nis the current version of the package,\nd\\&.e\\&.f\nis the version considered for installation and\nx\\&.y\\&.z\nis 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\\&.\nsection\nis the name of the section the package appears in\\&.\n.RE\n.PP\n\\fBDebug::pkgDPkgPM\\fR\n.RS 4\nWhen invoking\n\\fBdpkg\\fR(1), output the precise command line with which it is being invoked, with arguments separated by a single space character\\&.\n.RE\n.PP\n\\fBDebug::pkgDPkgProgressReporting\\fR\n.RS 4\nOutput all the data received from\n\\fBdpkg\\fR(1)\non the status file descriptor and any errors encountered while parsing it\\&.\n.RE\n.PP\n\\fBDebug::pkgOrderList\\fR\n.RS 4\nGenerate a trace of the algorithm that decides the order in which\napt\nshould pass packages to\n\\fBdpkg\\fR(1)\\&.\n.RE\n.PP\n\\fBDebug::pkgPackageManager\\fR\n.RS 4\nOutput status messages tracing the steps performed when invoking\n\\fBdpkg\\fR(1)\\&.\n.RE\n.PP\n\\fBDebug::pkgPolicy\\fR\n.RS 4\nOutput the priority of each package list on startup\\&.\n.RE\n.PP\n\\fBDebug::pkgProblemResolver\\fR\n.RS 4\nTrace the execution of the dependency resolver (this applies only to what happens when a complex dependency problem is encountered)\\&.\n.RE\n.PP\n\\fBDebug::pkgProblemResolver::ShowScores\\fR\n.RS 4\nDisplay 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\nDebug::pkgDepCache::Marker\n.RE\n.PP\n\\fBDebug::sourceList\\fR\n.RS 4\nPrint information about the vendors read from\n/etc/apt/vendors\\&.list\\&.\n.RE\n.PP\n\\fBDebug::RunScripts\\fR\n.RS 4\nDisplay the external commands that are called by apt hooks\\&. This includes e\\&.g\\&. the config options\nDPkg::{Pre,Post}\\-Invoke\nor\nAPT::Update::{Pre,Post}\\-Invoke\\&.\n.RE\n.SH \"EXAMPLES\"\n.PP\n/usr/share/doc/apt/examples/configure\\-index\\&.gz\nis a configuration file showing example values for all possible options\\&.\n.SH \"FILES\"\n.PP\n/etc/apt/apt\\&.conf\n.RS 4\nAPT configuration file\\&. Configuration Item:\nDir::Etc::Main\\&.\n.RE\n.PP\n/etc/apt/apt\\&.conf\\&.d/\n.RS 4\nAPT configuration file fragments\\&. Configuration Item:\nDir::Etc::Parts\\&.\n.RE\n.SH \"SEE ALSO\"\n.PP\n\\fBapt-cache\\fR(8),\n\\fBapt-config\\fR(8),\n\\fBapt_preferences\\fR(5)\\&.\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBJason Gunthorpe\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.PP\n\\fBDaniel Burrows\\fR <\\&dburrows@debian\\&.org\\&>\n.RS 4\nInitial documentation of Debug::*\\&.\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man5/apt_preferences.5",
    "content": "'\\\" t\n.\\\"     Title: apt_preferences\n.\\\"    Author: APT team\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 15\\ \\&August\\ \\&2015\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT_PREFERENCES\" \"5\" \"15\\ \\&August\\ \\&2015\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt_preferences \\- Preference control file for APT\n.SH \"DESCRIPTION\"\n.PP\nThe APT preferences file\n/etc/apt/preferences\nand the fragment files in the\n/etc/apt/preferences\\&.d/\nfolder can be used to control which versions of packages will be selected for installation\\&.\n.PP\nSeveral versions of a package may be available for installation when the\n\\fBsources.list\\fR(5)\nfile contains references to more than one distribution (for example,\nstable\nand\ntesting)\\&. APT assigns a priority to each version that is available\\&. Subject to dependency constraints,\n\\fBapt\\-get\\fR\nselects 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\\&.\n.PP\nSeveral instances of the same version of a package may be available when the\n\\fBsources.list\\fR(5)\nfile contains references to more than one source\\&. In this case\n\\fBapt\\-get\\fR\ndownloads the instance listed earliest in the\n\\fBsources.list\\fR(5)\nfile\\&. The APT preferences do not affect the choice of instance, only the choice of version\\&.\n.PP\nPreferences 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\\&.\n.PP\nNote that the files in the\n/etc/apt/preferences\\&.d\ndirectory 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\nDir::Ignore\\-Files\\-Silently\nconfiguration list \\- in which case it will be silently ignored\\&.\n.SS \"APT\\*(Aqs Default Priority Assignments\"\n.PP\nIf 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\n\\fBapt\\-get\\fR\ncommand line or in the APT configuration file\n/etc/apt/apt\\&.conf\\&. Note that this has precedence over any general priority you set in the\n/etc/apt/preferences\nfile described later, but not over specifically pinned packages\\&. For example,\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\n\\fBapt\\-get install \\-t testing \\fR\\fB\\fIsome\\-package\\fR\\fR\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nAPT::Default\\-Release \"stable\";\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nIf the target release has been specified then APT uses the following algorithm to set the priorities of the versions of a package\\&. Assign:\n.PP\npriority 1\n.RS 4\nto the versions coming from archives which in their\nRelease\nfiles are marked as \"NotAutomatic: yes\" but\n\\fInot\\fR\nas \"ButAutomaticUpgrades: yes\" like the Debian\nexperimental\narchive\\&.\n.RE\n.PP\npriority 100\n.RS 4\nto the version that is already installed (if any) and to the versions coming from archives which in their\nRelease\nfiles are marked as \"NotAutomatic: yes\" and \"ButAutomaticUpgrades: yes\" like the Debian backports archive since\nsqueeze\\-backports\\&.\n.RE\n.PP\npriority 500\n.RS 4\nto the versions that do not belong to the target release\\&.\n.RE\n.PP\npriority 990\n.RS 4\nto the versions that belong to the target release\\&.\n.RE\nThe highest of those priorities whose description matches the version is assigned to the version\\&.\n.PP\nIf 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\nRelease\nfiles are marked as \"NotAutomatic: yes\" \\- these versions get the priority 1 or priority 100 if it is additionally marked as \"ButAutomaticUpgrades: yes\"\\&.\n.PP\nAPT then applies the following rules, listed in order of precedence, to determine which version of a package to install\\&.\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nNever 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\\&.)\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nInstall the highest priority version\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nIf two or more versions have the same priority, install the most recent one (that is, the one with the higher version number)\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nIf two or more versions have the same priority and version number but either the packages differ in some of their metadata or the\n\\-\\-reinstall\noption is given, install the uninstalled one\\&.\n.RE\n.PP\nIn 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\n\\fBsources.list\\fR(5)\nfile (priority 500 or 990)\\&. Then the package will be upgraded when\n\\fBapt\\-get install \\fR\\fB\\fIsome\\-package\\fR\\fR\nor\n\\fBapt\\-get upgrade\\fR\nis executed\\&.\n.PP\nMore rarely, the installed version of a package is\n\\fImore\\fR\nrecent than any of the other available versions\\&. The package will not be downgraded when\n\\fBapt\\-get install \\fR\\fB\\fIsome\\-package\\fR\\fR\nor\n\\fBapt\\-get upgrade\\fR\nis executed\\&.\n.PP\nSometimes 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\n\\fBapt\\-get install \\fR\\fB\\fIsome\\-package\\fR\\fR\nor\n\\fBapt\\-get upgrade\\fR\nis executed, because at least\n\\fIone\\fR\nof the available versions has a higher priority than the installed version\\&.\n.SS \"The Effect of APT Preferences\"\n.PP\nThe 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\\&.\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nThe 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\nperl\npackage whose version number begins with \"5\\&.20\"\\&. Multiple packages can be separated by spaces\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: perl\nPin: version 5\\&.20*\nPin\\-Priority: 1001\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nThe 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\nRelease\nfile) or to all of the package versions coming from a particular Internet site, as identified by the site\\*(Aqs fully qualified domain name\\&.\n.sp\nThis 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\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: *\nPin: origin \"\"\nPin\\-Priority: 999\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nA 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\"\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: *\nPin: origin \"ftp\\&.de\\&.debian\\&.org\"\nPin\\-Priority: 999\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nThis should\n\\fInot\\fR\nbe confused with the Origin of a distribution as specified in a\nRelease\nfile\\&. What follows the \"Origin:\" tag in a\nRelease\nfile is not an Internet address but an author or vendor name, such as \"Debian\" or \"Ximian\"\\&.\n.sp\nThe following record assigns a low priority to all package versions belonging to any distribution whose Archive name is \"unstable\"\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: *\nPin: release a=unstable\nPin\\-Priority: 50\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nThe following record assigns a high priority to all package versions belonging to any distribution whose Codename is \"buster\"\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: *\nPin: release n=buster\nPin\\-Priority: 900\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nThe 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\"\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: *\nPin: release a=stable, v=9\nPin\\-Priority: 500\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.sp\nThe 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\\&.\n.SS \"Regular expressions and glob(7) syntax\"\n.PP\nAPT also supports pinning by\n\\fBglob\\fR(7)\nexpressions, 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\n\\fBglob\\fR(7)\\-like expression) or contains the word kde (as a POSIX extended regular expression surrounded by slashes)\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: gnome* /kde/\nPin: release a=experimental\nPin\\-Priority: 500\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nThe 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\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: *\nPin: release n=xenial*\nPin\\-Priority: 990\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nIf a regular expression occurs in a\nPackage\nfield, 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\n\\fBglob\\fR(7)\nexpression in itself\\&.\n.SS \"How APT Interprets Priorities\"\n.PP\nPriorities (P) assigned in the APT preferences file must be positive or negative integers\\&. They are interpreted as follows (roughly speaking):\n.PP\nP >= 1000\n.RS 4\ncauses a version to be installed even if this constitutes a downgrade of the package\n.RE\n.PP\n990 <= P < 1000\n.RS 4\ncauses a version to be installed even if it does not come from the target release, unless the installed version is more recent\n.RE\n.PP\n500 <= P < 990\n.RS 4\ncauses a version to be installed unless there is a version available belonging to the target release or the installed version is more recent\n.RE\n.PP\n100 <= P < 500\n.RS 4\ncauses a version to be installed unless there is a version available belonging to some other distribution or the installed version is more recent\n.RE\n.PP\n0 < P < 100\n.RS 4\ncauses a version to be installed only if there is no installed version of the package\n.RE\n.PP\nP < 0\n.RS 4\nprevents the version from being installed\n.RE\n.PP\nP = 0\n.RS 4\nhas undefined behaviour, do not use it\\&.\n.RE\n.PP\nThe 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\\&.\n.PP\nFor example, suppose the APT preferences file contains the three records presented earlier:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: perl\nPin: version 5\\&.20*\nPin\\-Priority: 1001\n\nPackage: *\nPin: origin \"\"\nPin\\-Priority: 999\n\nPackage: *\nPin: release unstable\nPin\\-Priority: 50\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nThen:\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nThe most recent available version of the\nperl\npackage will be installed, so long as that version\\*(Aqs version number begins with \"5\\&.20\"\\&. If\n\\fIany\\fR\n5\\&.20* version of\nperl\nis available and the installed version is 5\\&.24*, then\nperl\nwill be downgraded\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nA version of any package other than\nperl\nthat is available from the local system has priority over other versions, even versions belonging to the target release\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nA version of a package whose origin is not the local system but some other site listed in\n\\fBsources.list\\fR(5)\nand which belongs to an\nunstable\ndistribution is only installed if it is selected for installation and no version of the package is already installed\\&.\n.RE\n.sp\n.SS \"Determination of Package Version and Distribution Properties\"\n.PP\nThe locations listed in the\n\\fBsources.list\\fR(5)\nfile should provide\nPackages\nand\nRelease\nfiles to describe the packages available at that location\\&.\n.PP\nThe\nPackages\nfile is normally found in the directory\n\\&.\\&.\\&./dists/\\fIdist\\-name\\fR/\\fIcomponent\\fR/\\fIarch\\fR: for example,\n\\&.\\&.\\&./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:\n.PP\nthe Package: line\n.RS 4\ngives the package name\n.RE\n.PP\nthe Version: line\n.RS 4\ngives the version number for the named package\n.RE\n.PP\nThe\nRelease\nfile is normally found in the directory\n\\&.\\&.\\&./dists/\\fIdist\\-name\\fR: for example,\n\\&.\\&.\\&./dists/stable/Release, or\n\\&.\\&.\\&./dists/stretch/Release\\&. It consists of a single multi\\-line record which applies to\n\\fIall\\fR\nof the packages in the directory tree below its parent\\&. Unlike the\nPackages\nfile, nearly all of the lines in a\nRelease\nfile are relevant for setting APT priorities:\n.PP\nthe Archive: or Suite: line\n.RS 4\nnames 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\nRelease\nfile are in a\nstable\narchive\\&. Specifying this value in the APT preferences file would require the line:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPin: release a=stable\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.PP\nthe Codename: line\n.RS 4\nnames 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\nRelease\nfile belong to a version named\nbuster\\&. Specifying this value in the APT preferences file would require the line:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPin: release n=buster\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.PP\nthe Version: line\n.RS 4\nnames 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\ntesting\nand\nunstable\ndistributions because they have not been released yet\\&. Specifying this in the APT preferences file would require one of the following lines\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPin: release v=9\nPin: release a=stable, v=9\nPin: release 9\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.PP\nthe Component: line\n.RS 4\nnames the licensing component associated with the packages in the directory tree of the\nRelease\nfile\\&. For example, the line \"Component: main\" specifies that all the packages in the directory tree are from the\nmain\ncomponent, 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:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPin: release c=main\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.PP\nthe Origin: line\n.RS 4\nnames the originator of the packages in the directory tree of the\nRelease\nfile\\&. Most commonly, this is\nDebian\\&. Specifying this origin in the APT preferences file would require the line:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPin: release o=Debian\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.PP\nthe Label: line\n.RS 4\nnames the label of the packages in the directory tree of the\nRelease\nfile\\&. Most commonly, this is\nDebian\\&. Specifying this label in the APT preferences file would require the line:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPin: release l=Debian\n.fi\n.if n \\{\\\n.RE\n.\\}\n.RE\n.PP\nAll of the\nPackages\nand\nRelease\nfiles retrieved from locations listed in the\n\\fBsources.list\\fR(5)\nfile are stored in the directory\n/var/lib/apt/lists, or in the file named by the variable\nDir::State::Lists\nin the\napt\\&.conf\nfile\\&. For example, the file\ndebian\\&.lcs\\&.mit\\&.edu_debian_dists_unstable_contrib_binary\\-i386_Release\ncontains the\nRelease\nfile retrieved from the site\ndebian\\&.lcs\\&.mit\\&.edu\nfor\nbinary\\-i386\narchitecture files from the\ncontrib\ncomponent of the\nunstable\ndistribution\\&.\n.SS \"Optional Lines in an APT Preferences Record\"\n.PP\nEach record in the APT preferences file can optionally begin with one or more lines beginning with the word\nExplanation:\\&. This provides a place for comments\\&.\n.SH \"EXAMPLES\"\n.SS \"Tracking Stable\"\n.PP\nThe following APT preferences file will cause APT to assign a priority higher than the default (500) to all package versions belonging to a\nstable\ndistribution and a prohibitively low priority to package versions belonging to other\nDebian\ndistributions\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nExplanation: Uninstall or do not install any Debian\\-originated\nExplanation: package versions other than those in the stable distro\nPackage: *\nPin: release a=stable\nPin\\-Priority: 900\n\nPackage: *\nPin: release o=Debian\nPin\\-Priority: \\-10\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nWith a suitable\n\\fBsources.list\\fR(5)\nfile and the above preferences file, any of the following commands will cause APT to upgrade to the latest\nstable\nversion(s)\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\napt\\-get install \\fIpackage\\-name\\fR\napt\\-get upgrade\napt\\-get dist\\-upgrade\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nThe following command will cause APT to upgrade the specified package to the latest version from the\ntesting\ndistribution; the package will not be upgraded again unless this command is given again\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\napt\\-get install \\fIpackage\\fR/testing\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.SS \"Tracking Testing or Unstable\"\n.PP\nThe following APT preferences file will cause APT to assign a high priority to package versions from the\ntesting\ndistribution, a lower priority to package versions from the\nunstable\ndistribution, and a prohibitively low priority to package versions from other\nDebian\ndistributions\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: *\nPin: release a=testing\nPin\\-Priority: 900\n\nPackage: *\nPin: release a=unstable\nPin\\-Priority: 800\n\nPackage: *\nPin: release o=Debian\nPin\\-Priority: \\-10\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nWith a suitable\n\\fBsources.list\\fR(5)\nfile and the above preferences file, any of the following commands will cause APT to upgrade to the latest\ntesting\nversion(s)\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\napt\\-get install \\fIpackage\\-name\\fR\napt\\-get upgrade\napt\\-get dist\\-upgrade\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nThe following command will cause APT to upgrade the specified package to the latest version from the\nunstable\ndistribution\\&. Thereafter,\n\\fBapt\\-get upgrade\\fR\nwill upgrade the package to the most recent\ntesting\nversion if that is more recent than the installed version, otherwise, to the most recent\nunstable\nversion if that is more recent than the installed version\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\napt\\-get install \\fIpackage\\fR/unstable\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.SS \"Tracking the evolution of a codename release\"\n.PP\nThe 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\nDebian\ndistributions, codenames and archives\\&. Note that with this APT preference APT will follow the migration of a release from the archive\ntesting\nto\nstable\nand later\noldstable\\&. If you want to follow for example the progress in\ntesting\nnotwithstanding the codename changes you should use the example configurations above\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nExplanation: Uninstall or do not install any Debian\\-originated package versions\nExplanation: other than those in the distribution codenamed with buster or sid\nPackage: *\nPin: release n=buster\nPin\\-Priority: 900\n\nExplanation: Debian unstable is always codenamed with sid\nPackage: *\nPin: release n=sid\nPin\\-Priority: 800\n\nPackage: *\nPin: release o=Debian\nPin\\-Priority: \\-10\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nWith a suitable\n\\fBsources.list\\fR(5)\nfile 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\nbuster\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\napt\\-get install \\fIpackage\\-name\\fR\napt\\-get upgrade\napt\\-get dist\\-upgrade\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nThe following command will cause APT to upgrade the specified package to the latest version from the\nsid\ndistribution\\&. Thereafter,\n\\fBapt\\-get upgrade\\fR\nwill upgrade the package to the most recent\nbuster\nversion if that is more recent than the installed version, otherwise, to the most recent\nsid\nversion if that is more recent than the installed version\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\napt\\-get install \\fIpackage\\fR/sid\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.SH \"FILES\"\n.PP\n/etc/apt/preferences\n.RS 4\nVersion 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:\nDir::Etc::Preferences\\&.\n.RE\n.PP\n/etc/apt/preferences\\&.d/\n.RS 4\nFile fragments for the version preferences\\&. Configuration Item:\nDir::Etc::PreferencesParts\\&.\n.RE\n.SH \"SEE ALSO\"\n.PP\n\\fBapt-get\\fR(8)\n\\fBapt-cache\\fR(8)\n\\fBapt.conf\\fR(5)\n\\fBsources.list\\fR(5)\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHOR\"\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man5/sources.list.5",
    "content": "'\\\" t\n.\\\"     Title: sources.list\n.\\\"    Author: Jason Gunthorpe\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 25\\ \\&November\\ \\&2016\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"SOURCES\\&.LIST\" \"5\" \"25\\ \\&November\\ \\&2016\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\nsources.list \\- List of configured APT data sources\n.SH \"DESCRIPTION\"\n.PP\nThe source list\n/etc/apt/sources\\&.list\nand the files contained in\n/etc/apt/sources\\&.list\\&.d/\nare 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\n\\fBapt\\-get update\\fR\n(or by an equivalent command from another APT front\\-end)\\&.\n.SH \"SOURCES\\&.LIST\\&.D\"\n.PP\nThe\n/etc/apt/sources\\&.list\\&.d\ndirectory 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\n\\&.list\nor\n\\&.sources\ndepending 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\nDir::Ignore\\-Files\\-Silently\nconfiguration list \\- in which case it will be silently ignored\\&.\n.SH \"ONE\\-LINE\\-STYLE FORMAT\"\n.PP\nFiles in this format have the extension\n\\&.list\\&. Each line specifying a source starts with a type (e\\&.g\\&.\ndeb\\-src) followed by options and arguments for this type\\&. Individual entries cannot be continued onto a following line\\&. Empty lines are ignored, and a\n#\ncharacter 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\n\\-=\nand\n+=\nas separators, which instead of replacing the default with the given value(s) modify the default value(s) to remove or include the given values\\&.\n.PP\nThis 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\\&.\n.SH \"DEB822\\-STYLE FORMAT\"\n.PP\nFiles in this format have the extension\n\\&.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\ndebian/control\nfile in a Debian source package\\&. Individual entries are separated by an empty line; additional empty lines are ignored, and a\n#\ncharacter 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\nArchitectures\nalso have\nArchitectures\\-Add\nand\nArchitectures\\-Remove\nto modify the default value rather than replacing it\\&.\n.PP\nThis 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\\&.\n.SH \"THE DEB AND DEB\\-SRC TYPES: GENERAL FORMAT\"\n.PP\nThe\ndeb\ntype references a typical two\\-level Debian archive,\ndistribution/component\\&. The\ndistribution\nis generally a suite name like\nstable\nor\ntesting\nor a codename like\nstretch\nor\nbuster\nwhile component is one of\nmain,\ncontrib\nor\nnon\\-free\\&. The\ndeb\\-src\ntype references a Debian distribution\\*(Aqs source code in the same form as the\ndeb\ntype\\&. A\ndeb\\-src\nline is required to fetch source indexes\\&.\n.PP\nThe format for two one\\-line\\-style entries using the\ndeb\nand\ndeb\\-src\ntypes is:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb [ option1=value1 option2=value2 ] uri suite [component1] [component2] [\\&.\\&.\\&.]\ndeb\\-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [\\&.\\&.\\&.]\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nAlternatively the equivalent entry in deb822 style looks like this:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\n     Types: deb deb\\-src\n     URIs: uri\n     Suites: suite\n     Components: [component1] [component2] [\\&.\\&.\\&.]\n     option1: value1\n     option2: value2\n   \n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nThe URI for the\ndeb\ntype must specify the base of the Debian distribution, from which APT will find the information it needs\\&.\nsuite\ncan specify an exact path, in which case the components must be omitted and\nsuite\nmust 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\nsuite\ndoes not specify an exact path, at least one\ncomponent\nmust be present\\&.\n.PP\nsuite\nmay also contain a variable,\n$(ARCH)\nwhich expands to the Debian architecture (such as\namd64\nor\narmel) used on the system\\&. This permits architecture\\-independent\nsources\\&.list\nfiles to be used\\&. In general this is only of interest when specifying an exact path;\nAPT\nwill automatically generate a URI with the current architecture otherwise\\&.\n.PP\nEspecially 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\\&.\n.PP\nIt 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)\\&.\n.PP\nAs an example, the sources for your distribution could look like this in one\\-line\\-style format:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb http://deb\\&.debian\\&.org/debian stretch main contrib non\\-free\ndeb http://security\\&.debian\\&.org stretch/updates main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\nor like this in deb822 style format:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: http://deb\\&.debian\\&.org/debian\nSuites: stretch\nComponents: main contrib non\\-free\n\nTypes: deb\nURIs: http://security\\&.debian\\&.org\nSuites: stretch/updates\nComponents: main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.SH \"THE DEB AND DEB\\-SRC TYPES: OPTIONS\"\n.PP\nEach 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\\&.\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBArchitectures\\fR\n(\\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\n\\fBAPT::Architectures\\fR\nconfig option\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBLanguages\\fR\n(\\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\n\\fBAcquire::Languages\\fR\nconfig option\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBTargets\\fR\n(\\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\n\\fBAcquire::IndexTargets\\fR\nconfiguration scope (targets are specified by their name in the\nCreated\\-By\nfield)\\&. Additionally, targets can be enabled or disabled by using the\nIdentifier\nfield as an option with a boolean value instead of using this multivalue option\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBPDiffs\\fR\n(\\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\n\\fBAcquire::IndexTargets\\fR\nscope, which itself defaults to the value of configuration option\n\\fBAcquire::PDiffs\\fR\nwhich defaults to\nyes\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBBy\\-Hash\\fR\n(\\fBby\\-hash\\fR) can have the value\nyes,\nno\nor\nforce\nand 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\nyes\nor\nno\nvalue activates/disables the use of this feature if this source indicates support for it, while\nforce\nwill 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\n\\fBAcquire::IndexTargets\\fR\nscope, which itself defaults to the value of configuration option\n\\fBAcquire::By\\-Hash\\fR\nwhich defaults to\nyes\\&.\n.RE\n.sp\nFurthermore, there are options which if set affect\n\\fIall\\fR\nsources 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\\&.\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBAllow\\-Insecure\\fR\n(\\fBallow\\-insecure\\fR),\n\\fBAllow\\-Weak\\fR\n(\\fBallow\\-weak\\fR) and\n\\fBAllow\\-Downgrade\\-To\\-Insecure\\fR\n(\\fBallow\\-downgrade\\-to\\-insecure\\fR) are boolean values which all default to\nno\\&. If set to\nyes\nthey circumvent parts of\n\\fBapt-secure\\fR(8)\nand should therefore not be used lightly!\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBTrusted\\fR\n(\\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\nyes\ntells APT always to consider this source as trusted, even if it doesn\\*(Aqt pass authentication checks\\&. It disables parts of\n\\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\nno\ndoes 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\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBSigned\\-By\\fR\n(\\fBsigned\\-by\\fR) is either an absolute path to a keyring file (has to be accessible and readable for the\n_apt\nuser, so ensure everyone has read\\-permissions on the file) or one or more fingerprints of keys either in the\ntrusted\\&.gpg\nkeyring or in the keyrings in the\ntrusted\\&.gpg\\&.d/\ndirectory (see\n\\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\n\\fBapt-secure\\fR(8)\nverification of this repository\\&. Defaults to the value of the option with the same name if set in the previously acquired\nRelease\nfile\\&. Otherwise all keys in the trusted keyrings are considered valid signers for this repository\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBCheck\\-Valid\\-Until\\fR\n(\\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\nno\\&. Defaults to the value of configuration option\n\\fBAcquire::Check\\-Valid\\-Until\\fR\nwhich itself defaults to\nyes\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fBValid\\-Until\\-Min\\fR\n(\\fBvalid\\-until\\-min\\fR) and\n\\fBValid\\-Until\\-Max\\fR\n(\\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\n\\fBAcquire::Min\\-ValidTime\\fR\nand\n\\fBAcquire::Max\\-ValidTime\\fR\nwhich are both unset by default\\&.\n.RE\n.sp\n.SH \"URI SPECIFICATION\"\n.PP\nThe currently recognized URI types are:\n.PP\n\\fBfile\\fR\n.RS 4\nThe 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\\&.\n.RE\n.PP\n\\fBcdrom\\fR\n.RS 4\nThe cdrom scheme allows APT to use a local CD\\-ROM drive with media swapping\\&. Use the\n\\fBapt-cdrom\\fR(8)\nprogram to create cdrom entries in the source list\\&.\n.RE\n.PP\n\\fBhttp\\fR\n.RS 4\nThe http scheme specifies an HTTP server for the archive\\&. If an environment variable\n\\fBhttp_proxy\\fR\nis set with the format http://server:port/, the proxy server specified in\n\\fBhttp_proxy\\fR\nwill 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\\&.\n.RE\n.PP\n\\fBftp\\fR\n.RS 4\nThe ftp scheme specifies an FTP server for the archive\\&. APT\\*(Aqs FTP behavior is highly configurable; for more information see the\n\\fBapt.conf\\fR(5)\nmanual page\\&. Please note that an FTP proxy can be specified by using the\n\\fBftp_proxy\\fR\nenvironment variable\\&. It is possible to specify an HTTP proxy (HTTP proxy servers often understand FTP URLs) using this environment variable and\n\\fIonly\\fR\nthis environment variable\\&. Proxies using HTTP specified in the configuration file will be ignored\\&.\n.RE\n.PP\n\\fBcopy\\fR\n.RS 4\nThe 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\\&.\n.RE\n.PP\n\\fBrsh\\fR, \\fBssh\\fR\n.RS 4\nThe 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\n\\fBfind\\fR\nand\n\\fBdd\\fR\ncommands are used to perform the file transfers from the remote host\\&.\n.RE\n.PP\nadding more recognizable URI types\n.RS 4\nAPT can be extended with more methods shipped in other optional packages, which should follow the naming scheme\napt\\-transport\\-\\fImethod\\fR\\&. For instance, the APT team also maintains the package\napt\\-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\n\\fBapt-transport-debtorrent\\fR(1)\\&.\n.RE\n.SH \"EXAMPLES\"\n.PP\nUses the archive stored locally (or NFS mounted) at /home/apt/debian for stable/main, stable/contrib, and stable/non\\-free\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb file:/home/apt/debian stable main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: file:/home/apt/debian\nSuites: stable\nComponents: main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nAs above, except this uses the unstable (development) distribution\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb file:/home/apt/debian unstable main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: file:/home/apt/debian\nSuites: unstable\nComponents: main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nSources specification for the above\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb\\-src file:/home/apt/debian unstable main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\\-src\nURIs: file:/home/apt/debian\nSuites: unstable\nComponents: main contrib non\\-free\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nThe first line gets package information for the architectures in\nAPT::Architectures\nwhile the second always retrieves\namd64\nand\narmel\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb http://deb\\&.debian\\&.org/debian stretch main\ndeb [ arch=amd64,armel ] http://deb\\&.debian\\&.org/debian stretch main\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: http://deb\\&.debian\\&.org/debian\nSuites: stretch\nComponents: main\n\nTypes: deb\nURIs: http://deb\\&.debian\\&.org/debian\nSuites: stretch\nComponents: main\nArchitectures: amd64 armel\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nUses HTTP to access the archive at archive\\&.debian\\&.org, and uses only the hamm/main area\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb http://archive\\&.debian\\&.org/debian\\-archive hamm main\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: http://archive\\&.debian\\&.org/debian\\-archive\nSuites: hamm\nComponents: main\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nUses FTP to access the archive at ftp\\&.debian\\&.org, under the debian directory, and uses only the stretch/contrib area\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb ftp://ftp\\&.debian\\&.org/debian stretch contrib\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: ftp://ftp\\&.debian\\&.org/debian\nSuites: stretch\nComponents: contrib\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nUses 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\nsources\\&.list\na single FTP session will be used for both resource lines\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb ftp://ftp\\&.debian\\&.org/debian unstable contrib\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: ftp://ftp\\&.debian\\&.org/debian\nSuites: unstable\nComponents: contrib\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nUses HTTP to access the archive at ftp\\&.tlh\\&.debian\\&.org, under the universe directory, and uses only files found under\nunstable/binary\\-i386\non i386 machines,\nunstable/binary\\-amd64\non 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]\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb http://ftp\\&.tlh\\&.debian\\&.org/universe unstable/binary\\-$(ARCH)/\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb\nURIs: http://ftp\\&.tlh\\&.debian\\&.org/universe\nSuites: unstable/binary\\-$(ARCH)/\n.fi\n.if n \\{\\\n.RE\n.\\}\n.PP\nUses HTTP to get binary packages as well as sources from the stable, testing and unstable suites and the components main and contrib\\&.\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\ndeb http://deb\\&.debian\\&.org/debian stable main contrib\ndeb\\-src http://deb\\&.debian\\&.org/debian stable main contrib\ndeb http://deb\\&.debian\\&.org/debian testing main contrib\ndeb\\-src http://deb\\&.debian\\&.org/debian testing main contrib\ndeb http://deb\\&.debian\\&.org/debian unstable main contrib\ndeb\\-src http://deb\\&.debian\\&.org/debian unstable main contrib\n.fi\n.if n \\{\\\n.RE\n.\\}\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nTypes: deb deb\\-src\nURIs: http://deb\\&.debian\\&.org/debian\nSuites: stable testing unstable\nComponents: main contrib\n.fi\n.if n \\{\\\n.RE\n.\\}\n.SH \"SEE ALSO\"\n.PP\n\\fBapt-get\\fR(8),\n\\fBapt.conf\\fR(5),\n/usr/share/doc/apt\\-doc/acquire\\-additional\\-files\\&.txt\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBJason Gunthorpe\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man8/apt-cache.8",
    "content": "'\\\" t\n.\\\"     Title: apt-cache\n.\\\"    Author: Jason Gunthorpe\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 25\\ \\&November\\ \\&2016\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\\-CACHE\" \"8\" \"25\\ \\&November\\ \\&2016\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt-cache \\- query the APT cache\n.SH \"SYNOPSIS\"\n.HP \\w'\\fBapt\\-cache\\fR\\ 'u\n\\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}}\n.SH \"DESCRIPTION\"\n.PP\n\\fBapt\\-cache\\fR\nperforms a variety of operations on APT\\*(Aqs package cache\\&.\n\\fBapt\\-cache\\fR\ndoes 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\\&.\n\\fBapt\\-get\\fR, so that it can be outdated if the last update is too long ago, but in exchange\n\\fBapt\\-cache\\fR\nworks independently of the availability of the configured sources (e\\&.g\\&. offline)\\&.\n.PP\nUnless the\n\\fB\\-h\\fR, or\n\\fB\\-\\-help\\fR\noption is given, one of the commands below must be present\\&.\n.PP\n\\fBgencaches\\fR\n.RS 4\ngencaches\ncreates APT\\*(Aqs package cache\\&. This is done implicitly by all commands needing this cache if it is missing or outdated\\&.\n.RE\n.PP\n\\fBshowpkg\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\nshowpkg\ndisplays 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,\n\\fBapt\\-cache showpkg libreadline2\\fR\nwould produce output similar to the following:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nPackage: libreadline2\nVersions: 2\\&.1\\-12(/var/state/apt/lists/foo_Packages),\nReverse Depends: \n  libreadlineg2,libreadline2\n  libreadline2\\-altdev,libreadline2\nDependencies:\n2\\&.1\\-12 \\- libc5 (2 5\\&.4\\&.0\\-0) ncurses3\\&.0 (0 (null))\nProvides:\n2\\&.1\\-12 \\- \nReverse Provides: \n.fi\n.if n \\{\\\n.RE\n.\\}\nThus 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\\&.\n.RE\n.PP\n\\fBstats\\fR\n.RS 4\nstats\ndisplays some statistics about the cache\\&. No further arguments are expected\\&. Statistics reported are:\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nTotal package names\nis the number of package names found in the cache\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nNormal packages\nis 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\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nPure virtual packages\nis 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\"\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nSingle virtual packages\nis 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\"\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nMixed virtual packages\nis 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\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nMissing\nis 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\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nTotal distinct\nversions 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\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nTotal dependencies\nis the number of dependency relationships claimed by all of the packages in the cache\\&.\n.RE\n.sp\n.RE\n.PP\n\\fBshowsrc\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\nshowsrc\ndisplays 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\n\\fB\\-\\-only\\-source\\fR\nto display only source package names\\&.\n.RE\n.PP\n\\fBdump\\fR\n.RS 4\ndump\nshows a short listing of every package in the cache\\&. It is primarily for debugging\\&.\n.RE\n.PP\n\\fBdumpavail\\fR\n.RS 4\ndumpavail\nprints out an available list to stdout\\&. This is suitable for use with\n\\fBdpkg\\fR(1)\nand is used by the\n\\fBdselect\\fR(1)\nmethod\\&.\n.RE\n.PP\n\\fBunmet\\fR\n.RS 4\nunmet\ndisplays a summary of all unmet dependencies in the package cache\\&.\n.RE\n.PP\n\\fBshow\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\nshow\nperforms a function similar to\n\\fBdpkg \\-\\-print\\-avail\\fR; it displays the package records for the named packages\\&.\n.RE\n.PP\n\\fBsearch\\fR \\fB\\fIregex\\fR\\fR\\fB\\&...\\fR\n.RS 4\nsearch\nperforms a full text search on all available package lists for the POSIX regex pattern given, see\n\\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\n\\fB\\-\\-full\\fR\nis given then output identical to\nshow\nis produced for each matched package, and if\n\\fB\\-\\-names\\-only\\fR\nis given then the long description is not searched, only the package name and provided packages are\\&.\n.sp\nSeparate arguments can be used to specify multiple search patterns that are and\\*(Aqed together\\&.\n.RE\n.PP\n\\fBdepends\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\ndepends\nshows a listing of each dependency a package has and all the possible other packages that can fulfill that dependency\\&.\n.RE\n.PP\n\\fBrdepends\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\nrdepends\nshows a listing of each reverse dependency a package has\\&.\n.RE\n.PP\n\\fBpkgnames\\fR [\\fIprefix\\fR]\n.RS 4\nThis 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\n\\fB\\-\\-generate\\fR\noption\\&.\n.sp\nNote 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\\&.\n.RE\n.PP\n\\fBdotty\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\ndotty\ntakes a list of packages on the command line and generates output suitable for use by dotty from the\n\\m[blue]\\fBGraphViz\\fR\\m[]\\&\\s-2\\u[1]\\d\\s+2\npackage\\&. 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\nAPT::Cache::GivenOnly\noption\\&.\n.sp\nThe 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\\&.\n.sp\nCaution, dotty cannot graph larger sets of packages\\&.\n.RE\n.PP\n\\fBxvcg\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\nThe same as\ndotty, only for xvcg from the\n\\m[blue]\\fBVCG tool\\fR\\m[]\\&\\s-2\\u[2]\\d\\s+2\\&.\n.RE\n.PP\n\\fBpolicy\\fR [\\fIpkg\\fR\\&...]\n.RS 4\npolicy\nis 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\\&.\n.RE\n.PP\n\\fBmadison\\fR \\fB\\fIpkg\\fR\\fR\\fB\\&...\\fR\n.RS 4\napt\\-cache\\*(Aqs\nmadison\ncommand attempts to mimic the output format and a subset of the functionality of the Debian archive management tool,\nmadison\\&. It displays available versions of a package in a tabular format\\&. Unlike the original\nmadison, it can only display information for the architecture for which APT has retrieved package lists (APT::Architecture)\\&.\n.RE\n.SH \"OPTIONS\"\n.PP\nAll 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\n\\fB\\-f\\-\\fR,\\fB\\-\\-no\\-f\\fR,\n\\fB\\-f=no\\fR\nor several other variations\\&.\n.PP\n\\fB\\-p\\fR, \\fB\\-\\-pkg\\-cache\\fR\n.RS 4\nSelect the file to store the package cache\\&. The package cache is the primary cache used by all operations\\&. Configuration Item:\nDir::Cache::pkgcache\\&.\n.RE\n.PP\n\\fB\\-s\\fR, \\fB\\-\\-src\\-cache\\fR\n.RS 4\nSelect the file to store the source cache\\&. The source is used only by\ngencaches\nand 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:\nDir::Cache::srcpkgcache\\&.\n.RE\n.PP\n\\fB\\-q\\fR, \\fB\\-\\-quiet\\fR\n.RS 4\nQuiet; 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\n\\fB\\-q=#\\fR\nto set the quietness level, overriding the configuration file\\&. Configuration Item:\nquiet\\&.\n.RE\n.PP\n\\fB\\-i\\fR, \\fB\\-\\-important\\fR\n.RS 4\nPrint only important dependencies; for use with\nunmet\nand\ndepends\\&. Causes only Depends and Pre\\-Depends relations to be printed\\&. Configuration Item:\nAPT::Cache::Important\\&.\n.RE\n.PP\n\\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\n.RS 4\nPer default the\n\\fBdepends\\fR\nand\n\\fBrdepends\\fR\nprint all dependencies\\&. This can be tweaked with these flags which will omit the specified dependency type\\&. Configuration Item:\nAPT::Cache::Show\\fIDependencyType\\fR\ne\\&.g\\&.\nAPT::Cache::ShowRecommends\\&.\n.RE\n.PP\n\\fB\\-\\-implicit\\fR\n.RS 4\nPer default\n\\fBdepends\\fR\nand\n\\fBrdepends\\fR\nprint only dependencies explicitly expressed in the metadata\\&. With this flag it will also show dependencies implicitly added based on the encountered data\\&. A\nConflicts: foo\ne\\&.g\\&. expresses implicitly that this package also conflicts with the package foo from any other architecture\\&. Configuration Item:\nAPT::Cache::ShowImplicit\\&.\n.RE\n.PP\n\\fB\\-f\\fR, \\fB\\-\\-full\\fR\n.RS 4\nPrint full package records when searching\\&. Configuration Item:\nAPT::Cache::ShowFull\\&.\n.RE\n.PP\n\\fB\\-a\\fR, \\fB\\-\\-all\\-versions\\fR\n.RS 4\nPrint full records for all available versions\\&. This is the default; to turn it off, use\n\\fB\\-\\-no\\-all\\-versions\\fR\\&. If\n\\fB\\-\\-no\\-all\\-versions\\fR\nis specified, only the candidate version will be displayed (the one which would be selected for installation)\\&. This option is only applicable to the\nshow\ncommand\\&. Configuration Item:\nAPT::Cache::AllVersions\\&.\n.RE\n.PP\n\\fB\\-g\\fR, \\fB\\-\\-generate\\fR\n.RS 4\nPerform automatic package cache regeneration, rather than use the cache as it is\\&. This is the default; to turn it off, use\n\\fB\\-\\-no\\-generate\\fR\\&. Configuration Item:\nAPT::Cache::Generate\\&.\n.RE\n.PP\n\\fB\\-\\-names\\-only\\fR, \\fB\\-n\\fR\n.RS 4\nOnly search on the package and provided package names, not the long descriptions\\&. Configuration Item:\nAPT::Cache::NamesOnly\\&.\n.RE\n.PP\n\\fB\\-\\-all\\-names\\fR\n.RS 4\nMake\npkgnames\nprint all names, including virtual packages and missing dependencies\\&. Configuration Item:\nAPT::Cache::AllNames\\&.\n.RE\n.PP\n\\fB\\-\\-recurse\\fR\n.RS 4\nMake\ndepends\nand\nrdepends\nrecursive so that all packages mentioned are printed once\\&. Configuration Item:\nAPT::Cache::RecurseDepends\\&.\n.RE\n.PP\n\\fB\\-\\-installed\\fR\n.RS 4\nLimit the output of\ndepends\nand\nrdepends\nto packages which are currently installed\\&. Configuration Item:\nAPT::Cache::Installed\\&.\n.RE\n.PP\n\\fB\\-\\-with\\-source\\fR \\fB\\fIfilename\\fR\\fR\n.RS 4\nAdds the given file as a source for metadata\\&. Can be repeated to add multiple files\\&. Supported are currently\n*\\&.deb,\n*\\&.dsc,\n*\\&.changes,\nSources\nand\nPackages\nfiles as well as source package directories\\&. Files are matched based on their name only, not their content!\n.sp\nSources\nand\nPackages\ncan 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\n.sp\nNote that these sources are treated as trusted (see\n\\fBapt-secure\\fR(8))\\&. Configuration Item:\nAPT::Sources::With\\&.\n.RE\n.PP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\n.RS 4\nShow a short usage summary\\&.\n.RE\n.PP\n\\fB\\-v\\fR, \\fB\\-\\-version\\fR\n.RS 4\nShow the program version\\&.\n.RE\n.PP\n\\fB\\-c\\fR, \\fB\\-\\-config\\-file\\fR\n.RS 4\nConfiguration 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\n\\fBAPT_CONFIG\\fR\nenvironment variable\\&. See\n\\fBapt.conf\\fR(5)\nfor syntax information\\&.\n.RE\n.PP\n\\fB\\-o\\fR, \\fB\\-\\-option\\fR\n.RS 4\nSet a Configuration Option; This will set an arbitrary configuration option\\&. The syntax is\n\\fB\\-o Foo::Bar=bar\\fR\\&.\n\\fB\\-o\\fR\nand\n\\fB\\-\\-option\\fR\ncan be used multiple times to set different options\\&.\n.RE\n.SH \"FILES\"\n.PP\n/etc/apt/sources\\&.list\n.RS 4\nLocations to fetch packages from\\&. Configuration Item:\nDir::Etc::SourceList\\&.\n.RE\n.PP\n/etc/apt/sources\\&.list\\&.d/\n.RS 4\nFile fragments for locations to fetch packages from\\&. Configuration Item:\nDir::Etc::SourceParts\\&.\n.RE\n.PP\n/var/lib/apt/lists/\n.RS 4\nStorage area for state information for each package resource specified in\n\\fBsources.list\\fR(5)\nConfiguration Item:\nDir::State::Lists\\&.\n.RE\n.PP\n/var/lib/apt/lists/partial/\n.RS 4\nStorage area for state information in transit\\&. Configuration Item:\nDir::State::Lists\n(partial\nwill be implicitly appended)\n.RE\n.SH \"SEE ALSO\"\n.PP\n\\fBapt.conf\\fR(5),\n\\fBsources.list\\fR(5),\n\\fBapt-get\\fR(8)\n.SH \"DIAGNOSTICS\"\n.PP\n\\fBapt\\-cache\\fR\nreturns zero on normal operation, decimal 100 on error\\&.\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBJason Gunthorpe\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nGraphViz\n.RS 4\n\\%http://www.research.att.com/sw/tools/graphviz/\n.RE\n.IP \" 2.\" 4\nVCG tool\n.RS 4\n\\%http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html\n.RE\n.IP \" 3.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man8/apt-config.8",
    "content": "'\\\" t\n.\\\"     Title: apt-config\n.\\\"    Author: Jason Gunthorpe\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 30\\ \\&November\\ \\&2013\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\\-CONFIG\" \"8\" \"30\\ \\&November\\ \\&2013\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt-config \\- APT Configuration Query program\n.SH \"SYNOPSIS\"\n.HP \\w'\\fBapt\\-config\\fR\\ 'u\n\\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}}\n.SH \"DESCRIPTION\"\n.PP\n\\fBapt\\-config\\fR\nis an internal program used by various portions of the APT suite to provide consistent configurability\\&. It accesses the main configuration file\n/etc/apt/apt\\&.conf\nin a manner that is easy to use for scripted applications\\&.\n.PP\nUnless the\n\\fB\\-h\\fR, or\n\\fB\\-\\-help\\fR\noption is given, one of the commands below must be present\\&.\n.PP\n\\fBshell\\fR\n.RS 4\nshell 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:\n.sp\n.if n \\{\\\n.RS 4\n.\\}\n.nf\nOPTS=\"\\-f\"\nRES=`apt\\-config shell OPTS MyApp::options`\neval $RES\n.fi\n.if n \\{\\\n.RE\n.\\}\nThis will set the shell environment variable $OPTS to the value of MyApp::options with a default of\n\\fB\\-f\\fR\\&.\n.sp\nThe 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\\&.\n.RE\n.PP\n\\fBdump\\fR\n.RS 4\nJust show the contents of the configuration space\\&.\n.RE\n.SH \"OPTIONS\"\n.PP\nAll 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\n\\fB\\-f\\-\\fR,\\fB\\-\\-no\\-f\\fR,\n\\fB\\-f=no\\fR\nor several other variations\\&.\n.PP\n\\fB\\-\\-empty\\fR\n.RS 4\nInclude options which have an empty value\\&. This is the default, so use \\-\\-no\\-empty to remove them from the output\\&.\n.RE\n.PP\n\\fB\\-\\-format \\*(Aq\\fR\\fB\\fI%f \"%v\";%n\\fR\\fR\\fB\\*(Aq\\fR\n.RS 4\nDefines 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 %%\\&.\n.RE\n.PP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\n.RS 4\nShow a short usage summary\\&.\n.RE\n.PP\n\\fB\\-v\\fR, \\fB\\-\\-version\\fR\n.RS 4\nShow the program version\\&.\n.RE\n.PP\n\\fB\\-c\\fR, \\fB\\-\\-config\\-file\\fR\n.RS 4\nConfiguration 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\n\\fBAPT_CONFIG\\fR\nenvironment variable\\&. See\n\\fBapt.conf\\fR(5)\nfor syntax information\\&.\n.RE\n.PP\n\\fB\\-o\\fR, \\fB\\-\\-option\\fR\n.RS 4\nSet a Configuration Option; This will set an arbitrary configuration option\\&. The syntax is\n\\fB\\-o Foo::Bar=bar\\fR\\&.\n\\fB\\-o\\fR\nand\n\\fB\\-\\-option\\fR\ncan be used multiple times to set different options\\&.\n.RE\n.SH \"SEE ALSO\"\n.PP\n\\fBapt.conf\\fR(5)\n.SH \"DIAGNOSTICS\"\n.PP\n\\fBapt\\-config\\fR\nreturns zero on normal operation, decimal 100 on error\\&.\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBJason Gunthorpe\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man8/apt-get.8",
    "content": "'\\\" t\n.\\\"     Title: apt-get\n.\\\"    Author: Jason Gunthorpe\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 22\\ \\&February\\ \\&2017\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\\-GET\" \"8\" \"22\\ \\&February\\ \\&2017\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt-get \\- APT package handling utility \\-\\- command\\-line interface\n.SH \"SYNOPSIS\"\n.HP \\w'\\fBapt\\-get\\fR\\ 'u\n\\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}}\n.SH \"DESCRIPTION\"\n.PP\n\\fBapt\\-get\\fR\nis 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\n\\fBaptitude\\fR(8),\n\\fBsynaptic\\fR(8)\nand\n\\fBwajig\\fR(1)\\&.\n.PP\nUnless the\n\\fB\\-h\\fR, or\n\\fB\\-\\-help\\fR\noption is given, one of the commands below must be present\\&.\n.PP\n\\fBupdate\\fR\n.RS 4\nupdate\nis used to resynchronize the package index files from their sources\\&. The indexes of available packages are fetched from the location(s) specified in\n/etc/apt/sources\\&.list\\&. For example, when using a Debian archive, this command retrieves and scans the\nPackages\\&.gz\nfiles, so that information about new and updated packages is available\\&. An\nupdate\nshould always be performed before an\nupgrade\nor\ndist\\-upgrade\\&. Please be aware that the overall progress meter will be incorrect as the size of the package files cannot be known in advance\\&.\n.RE\n.PP\n\\fBupgrade\\fR\n.RS 4\nupgrade\nis used to install the newest versions of all packages currently installed on the system from the sources enumerated in\n/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\nupdate\nmust be performed first so that\n\\fBapt\\-get\\fR\nknows that new versions of packages are available\\&.\n.RE\n.PP\n\\fBdist\\-upgrade\\fR\n.RS 4\ndist\\-upgrade\nin addition to performing the function of\nupgrade, also intelligently handles changing dependencies with new versions of packages;\n\\fBapt\\-get\\fR\nhas 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\ndist\\-upgrade\ncommand may therefore remove some packages\\&. The\n/etc/apt/sources\\&.list\nfile contains a list of locations from which to retrieve desired package files\\&. See also\n\\fBapt_preferences\\fR(5)\nfor a mechanism for overriding the general settings for individual packages\\&.\n.RE\n.PP\n\\fBdselect\\-upgrade\\fR\n.RS 4\ndselect\\-upgrade\nis used in conjunction with the traditional Debian packaging front\\-end,\n\\fBdselect\\fR(1)\\&.\ndselect\\-upgrade\nfollows the changes made by\n\\fBdselect\\fR(1)\nto the\nStatus\nfield of available packages, and performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages)\\&.\n.RE\n.PP\n\\fBinstall\\fR\n.RS 4\ninstall\nis 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,\napt\\-utils\nwould be the argument provided, not\napt\\-utils_1\\&.4\\&.9_amd64\\&.deb)\\&. All packages required by the package(s) specified for installation will also be retrieved and installed\\&. The\n/etc/apt/sources\\&.list\nfile 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\\&.\n.sp\nA 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)\\&.\n.sp\nBoth of the version selection mechanisms can downgrade packages and must be used with care\\&.\n.sp\nThis 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\\&.\n.sp\nFinally, the\n\\fBapt_preferences\\fR(5)\nmechanism allows you to create an alternative installation policy for individual packages\\&.\n.sp\nIf 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\\&.\n.RE\n.PP\n\\fBremove\\fR\n.RS 4\nremove\nis identical to\ninstall\nexcept 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\\&.\n.RE\n.PP\n\\fBpurge\\fR\n.RS 4\npurge\nis identical to\nremove\nexcept that packages are removed and purged (any configuration files are deleted too)\\&.\n.RE\n.PP\n\\fBsource\\fR\n.RS 4\nsource\ncauses\n\\fBapt\\-get\\fR\nto 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\nAPT::Default\\-Release, the\n\\fB\\-t\\fR\noption or per package with the\npkg/release\nsyntax, if possible\\&.\n.sp\nSource packages are tracked separately from binary packages via\ndeb\\-src\nlines in the\n\\fBsources.list\\fR(5)\nfile\\&. 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\\&.\n.sp\nIf the\n\\fB\\-\\-compile\\fR\noption is specified then the package will be compiled to a binary \\&.deb using\n\\fBdpkg\\-buildpackage\\fR\nfor the architecture as defined by the\n\\fB\\-\\-host\\-architecture\\fR\noption\\&. If\n\\fB\\-\\-download\\-only\\fR\nis specified then the source package will not be unpacked\\&.\n.sp\nA 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\nAPT::Get::Only\\-Source\noption\\&.\n.sp\nNote that source packages are not installed and tracked in the\n\\fBdpkg\\fR\ndatabase like binary packages; they are simply downloaded to the current directory, like source tarballs\\&.\n.RE\n.PP\n\\fBbuild\\-dep\\fR\n.RS 4\nbuild\\-dep\ncauses 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\n\\fB\\-\\-host\\-architecture\\fR\noption instead\\&.\n.RE\n.PP\n\\fBcheck\\fR\n.RS 4\ncheck\nis a diagnostic tool; it updates the package cache and checks for broken dependencies\\&.\n.RE\n.PP\n\\fBdownload\\fR\n.RS 4\ndownload\nwill download the given binary package into the current directory\\&.\n.RE\n.PP\n\\fBclean\\fR\n.RS 4\nclean\nclears out the local repository of retrieved package files\\&. It removes everything but the lock file from\n/var/cache/apt/archives/\nand\n/var/cache/apt/archives/partial/\\&.\n.RE\n.PP\n\\fBautoclean\\fR (and the \\fBauto\\-clean\\fR alias since 1\\&.1)\n.RS 4\nLike\nclean,\nautoclean\nclears 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\nAPT::Clean\\-Installed\nwill prevent installed packages from being erased if it is set to off\\&.\n.RE\n.PP\n\\fBautoremove\\fR (and the \\fBauto\\-remove\\fR alias since 1\\&.1)\n.RS 4\nautoremove\nis used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed\\&.\n.RE\n.PP\n\\fBchangelog\\fR\n.RS 4\nchangelog\ntries to download the changelog of a package and displays it through\n\\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\n\\fBinstall\\fR\ncommand\\&.\n.RE\n.PP\n\\fBindextargets\\fR\n.RS 4\nDisplays by default a deb822 formatted listing of information about all data files (aka index targets)\n\\fBapt\\-get update\\fR\nwould download\\&. Supports a\n\\fB\\-\\-format\\fR\noption 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\n/usr/share/doc/apt\\-doc/acquire\\-additional\\-files\\&.txt\nshipped by the\napt\\-doc\npackage\\&.\n.RE\n.SH \"OPTIONS\"\n.PP\nAll 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\n\\fB\\-f\\-\\fR,\\fB\\-\\-no\\-f\\fR,\n\\fB\\-f=no\\fR\nor several other variations\\&.\n.PP\n\\fB\\-\\-no\\-install\\-recommends\\fR\n.RS 4\nDo not consider recommended packages as a dependency for installing\\&. Configuration Item:\nAPT::Install\\-Recommends\\&.\n.RE\n.PP\n\\fB\\-\\-install\\-suggests\\fR\n.RS 4\nConsider suggested packages as a dependency for installing\\&. Configuration Item:\nAPT::Install\\-Suggests\\&.\n.RE\n.PP\n\\fB\\-d\\fR, \\fB\\-\\-download\\-only\\fR\n.RS 4\nDownload only; package files are only retrieved, not unpacked or installed\\&. Configuration Item:\nAPT::Get::Download\\-Only\\&.\n.RE\n.PP\n\\fB\\-f\\fR, \\fB\\-\\-fix\\-broken\\fR\n.RS 4\nFix; 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\n\\fBdpkg \\-\\-remove\\fR\nto eliminate some of the offending packages)\\&. Use of this option together with\n\\fB\\-m\\fR\nmay produce an error in some situations\\&. Configuration Item:\nAPT::Get::Fix\\-Broken\\&.\n.RE\n.PP\n\\fB\\-m\\fR, \\fB\\-\\-ignore\\-missing\\fR, \\fB\\-\\-fix\\-missing\\fR\n.RS 4\nIgnore 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\n\\fB\\-f\\fR\nmay 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:\nAPT::Get::Fix\\-Missing\\&.\n.RE\n.PP\n\\fB\\-\\-no\\-download\\fR\n.RS 4\nDisables downloading of packages\\&. This is best used with\n\\fB\\-\\-ignore\\-missing\\fR\nto force APT to use only the \\&.debs it has already downloaded\\&. Configuration Item:\nAPT::Get::Download\\&.\n.RE\n.PP\n\\fB\\-q\\fR, \\fB\\-\\-quiet\\fR\n.RS 4\nQuiet; 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\n\\fB\\-q=#\\fR\nto set the quiet level, overriding the configuration file\\&. Note that quiet level 2 implies\n\\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:\nquiet\\&.\n.RE\n.PP\n\\fB\\-s\\fR, \\fB\\-\\-simulate\\fR, \\fB\\-\\-just\\-print\\fR, \\fB\\-\\-dry\\-run\\fR, \\fB\\-\\-recon\\fR, \\fB\\-\\-no\\-act\\fR\n.RS 4\nNo 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\n\\fBapt\\-get\\fR\nis 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:\nAPT::Get::Simulate\\&.\n.sp\nSimulated runs print out a series of lines, each representing a\n\\fBdpkg\\fR\noperation: configure (Conf), remove (Remv) or unpack (Inst)\\&. Square brackets indicate broken packages, and empty square brackets indicate breaks that are of no consequence (rare)\\&.\n.RE\n.PP\n\\fB\\-y\\fR, \\fB\\-\\-yes\\fR, \\fB\\-\\-assume\\-yes\\fR\n.RS 4\nAutomatic 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\napt\\-get\nwill abort\\&. Configuration Item:\nAPT::Get::Assume\\-Yes\\&.\n.RE\n.PP\n\\fB\\-\\-assume\\-no\\fR\n.RS 4\nAutomatic \"no\" to all prompts\\&. Configuration Item:\nAPT::Get::Assume\\-No\\&.\n.RE\n.PP\n\\fB\\-\\-no\\-show\\-upgraded\\fR\n.RS 4\nDo not show a list of all packages that are to be upgraded\\&. Configuration Item:\nAPT::Get::Show\\-Upgraded\\&.\n.RE\n.PP\n\\fB\\-V\\fR, \\fB\\-\\-verbose\\-versions\\fR\n.RS 4\nShow full versions for upgraded and installed packages\\&. Configuration Item:\nAPT::Get::Show\\-Versions\\&.\n.RE\n.PP\n\\fB\\-a\\fR, \\fB\\-\\-host\\-architecture\\fR\n.RS 4\nThis option controls the architecture packages are built for by\n\\fBapt\\-get source \\-\\-compile\\fR\nand 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\nAPT::Architecture)\\&. Configuration Item:\nAPT::Get::Host\\-Architecture\\&.\n.RE\n.PP\n\\fB\\-P\\fR, \\fB\\-\\-build\\-profiles\\fR\n.RS 4\nThis option controls the activated build profiles for which a source package is built by\n\\fBapt\\-get source \\-\\-compile\\fR\nand 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:\nAPT::Build\\-Profiles\\&.\n.RE\n.PP\n\\fB\\-b\\fR, \\fB\\-\\-compile\\fR, \\fB\\-\\-build\\fR\n.RS 4\nCompile source packages after downloading them\\&. Configuration Item:\nAPT::Get::Compile\\&.\n.RE\n.PP\n\\fB\\-\\-ignore\\-hold\\fR\n.RS 4\nIgnore package holds; this causes\n\\fBapt\\-get\\fR\nto ignore a hold placed on a package\\&. This may be useful in conjunction with\ndist\\-upgrade\nto override a large number of undesired holds\\&. Configuration Item:\nAPT::Ignore\\-Hold\\&.\n.RE\n.PP\n\\fB\\-\\-with\\-new\\-pkgs\\fR\n.RS 4\nAllow installing new packages when used in conjunction with\nupgrade\\&. This is useful if the update of a installed package requires new dependencies to be installed\\&. Instead of holding the package back\nupgrade\nwill upgrade the package and install the new dependencies\\&. Note that\nupgrade\nwith this option will never remove packages, only allow adding new ones\\&. Configuration Item:\nAPT::Get::Upgrade\\-Allow\\-New\\&.\n.RE\n.PP\n\\fB\\-\\-no\\-upgrade\\fR\n.RS 4\nDo not upgrade packages; when used in conjunction with\ninstall,\nno\\-upgrade\nwill prevent packages on the command line from being upgraded if they are already installed\\&. Configuration Item:\nAPT::Get::Upgrade\\&.\n.RE\n.PP\n\\fB\\-\\-only\\-upgrade\\fR\n.RS 4\nDo not install new packages; when used in conjunction with\ninstall,\nonly\\-upgrade\nwill install upgrades for already installed packages only and ignore requests to install new packages\\&. Configuration Item:\nAPT::Get::Only\\-Upgrade\\&.\n.RE\n.PP\n\\fB\\-\\-allow\\-downgrades\\fR\n.RS 4\nThis 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:\nAPT::Get::allow\\-downgrades\\&. Introduced in APT 1\\&.1\\&.\n.RE\n.PP\n\\fB\\-\\-allow\\-remove\\-essential\\fR\n.RS 4\nForce 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:\nAPT::Get::allow\\-remove\\-essential\\&. Introduced in APT 1\\&.1\\&.\n.RE\n.PP\n\\fB\\-\\-allow\\-change\\-held\\-packages\\fR\n.RS 4\nForce 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:\nAPT::Get::allow\\-change\\-held\\-packages\\&. Introduced in APT 1\\&.1\\&.\n.RE\n.PP\n\\fB\\-\\-force\\-yes\\fR\n.RS 4\nForce 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\nforce\\-yes\ncan potentially destroy your system! Configuration Item:\nAPT::Get::force\\-yes\\&. This is deprecated and replaced by\n\\fB\\-\\-allow\\-downgrades\\fR,\n\\fB\\-\\-allow\\-remove\\-essential\\fR,\n\\fB\\-\\-allow\\-change\\-held\\-packages\\fR\nin 1\\&.1\\&.\n.RE\n.PP\n\\fB\\-\\-print\\-uris\\fR\n.RS 4\nInstead 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\nsource\nand\nupdate\ncommands\\&. When used with the\nupdate\ncommand the MD5 and size are not included, and it is up to the user to decompress any compressed files\\&. Configuration Item:\nAPT::Get::Print\\-URIs\\&.\n.RE\n.PP\n\\fB\\-\\-purge\\fR\n.RS 4\nUse purge instead of remove for anything that would be removed\\&. An asterisk (\"*\") will be displayed next to packages which are scheduled to be purged\\&.\n\\fBremove \\-\\-purge\\fR\nis equivalent to the\n\\fBpurge\\fR\ncommand\\&. Configuration Item:\nAPT::Get::Purge\\&.\n.RE\n.PP\n\\fB\\-\\-reinstall\\fR\n.RS 4\nRe\\-install packages that are already installed and at the newest version\\&. Configuration Item:\nAPT::Get::ReInstall\\&.\n.RE\n.PP\n\\fB\\-\\-list\\-cleanup\\fR\n.RS 4\nThis option is on by default; use\n\\-\\-no\\-list\\-cleanup\nto turn it off\\&. When it is on,\n\\fBapt\\-get\\fR\nwill automatically manage the contents of\n/var/lib/apt/lists\nto ensure that obsolete files are erased\\&. The only reason to turn it off is if you frequently change your sources list\\&. Configuration Item:\nAPT::Get::List\\-Cleanup\\&.\n.RE\n.PP\n\\fB\\-t\\fR, \\fB\\-\\-target\\-release\\fR, \\fB\\-\\-default\\-release\\fR\n.RS 4\nThis 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\n/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\n\\fB\\-t \\*(Aq2\\&.1*\\*(Aq\\fR,\n\\fB\\-t unstable\\fR\nor\n\\fB\\-t sid\\fR\\&. Configuration Item:\nAPT::Default\\-Release; see also the\n\\fBapt_preferences\\fR(5)\nmanual page\\&.\n.RE\n.PP\n\\fB\\-\\-trivial\\-only\\fR\n.RS 4\nOnly perform operations that are \\*(Aqtrivial\\*(Aq\\&. Logically this can be considered related to\n\\fB\\-\\-assume\\-yes\\fR; where\n\\fB\\-\\-assume\\-yes\\fR\nwill answer yes to any prompt,\n\\fB\\-\\-trivial\\-only\\fR\nwill answer no\\&. Configuration Item:\nAPT::Get::Trivial\\-Only\\&.\n.RE\n.PP\n\\fB\\-\\-no\\-remove\\fR\n.RS 4\nIf any packages are to be removed apt\\-get immediately aborts without prompting\\&. Configuration Item:\nAPT::Get::Remove\\&.\n.RE\n.PP\n\\fB\\-\\-auto\\-remove\\fR, \\fB\\-\\-autoremove\\fR\n.RS 4\nIf the command is either\ninstall\nor\nremove, then this option acts like running the\nautoremove\ncommand, removing unused dependency packages\\&. Configuration Item:\nAPT::Get::AutomaticRemove\\&.\n.RE\n.PP\n\\fB\\-\\-only\\-source\\fR\n.RS 4\nOnly has meaning for the\nsource\nand\nbuild\\-dep\ncommands\\&. 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:\nAPT::Get::Only\\-Source\\&.\n.RE\n.PP\n\\fB\\-\\-diff\\-only\\fR, \\fB\\-\\-dsc\\-only\\fR, \\fB\\-\\-tar\\-only\\fR\n.RS 4\nDownload only the diff, dsc, or tar file of a source archive\\&. Configuration Item:\nAPT::Get::Diff\\-Only,\nAPT::Get::Dsc\\-Only, and\nAPT::Get::Tar\\-Only\\&.\n.RE\n.PP\n\\fB\\-\\-arch\\-only\\fR\n.RS 4\nOnly process architecture\\-dependent build\\-dependencies\\&. Configuration Item:\nAPT::Get::Arch\\-Only\\&.\n.RE\n.PP\n\\fB\\-\\-indep\\-only\\fR\n.RS 4\nOnly process architecture\\-independent build\\-dependencies\\&. Configuration Item:\nAPT::Get::Indep\\-Only\\&.\n.RE\n.PP\n\\fB\\-\\-allow\\-unauthenticated\\fR\n.RS 4\nIgnore 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\n\\fBTrusted\\fR\noption for\n\\fBsources.list\\fR(5)\nentries should usually be preferred over this global override\\&. Configuration Item:\nAPT::Get::AllowUnauthenticated\\&.\n.RE\n.PP\n\\fB\\-\\-no\\-allow\\-insecure\\-repositories\\fR\n.RS 4\nForbid 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\n\\fBapt-secure\\fR(8)\nfor details on the concept and the implications\\&. Configuration Item:\nAcquire::AllowInsecureRepositories\\&.\n.RE\n.PP\n\\fB\\-\\-show\\-progress\\fR\n.RS 4\nShow 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:\nDpkg::Progress\nand\nDpkg::Progress\\-Fancy\\&.\n.RE\n.PP\n\\fB\\-\\-with\\-source\\fR \\fB\\fIfilename\\fR\\fR\n.RS 4\nAdds the given file as a source for metadata\\&. Can be repeated to add multiple files\\&. See\n\\fB\\-\\-with\\-source\\fR\ndescription in\n\\fBapt-cache\\fR(8)\nfor further details\\&.\n.RE\n.PP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\n.RS 4\nShow a short usage summary\\&.\n.RE\n.PP\n\\fB\\-v\\fR, \\fB\\-\\-version\\fR\n.RS 4\nShow the program version\\&.\n.RE\n.PP\n\\fB\\-c\\fR, \\fB\\-\\-config\\-file\\fR\n.RS 4\nConfiguration 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\n\\fBAPT_CONFIG\\fR\nenvironment variable\\&. See\n\\fBapt.conf\\fR(5)\nfor syntax information\\&.\n.RE\n.PP\n\\fB\\-o\\fR, \\fB\\-\\-option\\fR\n.RS 4\nSet a Configuration Option; This will set an arbitrary configuration option\\&. The syntax is\n\\fB\\-o Foo::Bar=bar\\fR\\&.\n\\fB\\-o\\fR\nand\n\\fB\\-\\-option\\fR\ncan be used multiple times to set different options\\&.\n.RE\n.SH \"FILES\"\n.PP\n/etc/apt/sources\\&.list\n.RS 4\nLocations to fetch packages from\\&. Configuration Item:\nDir::Etc::SourceList\\&.\n.RE\n.PP\n/etc/apt/sources\\&.list\\&.d/\n.RS 4\nFile fragments for locations to fetch packages from\\&. Configuration Item:\nDir::Etc::SourceParts\\&.\n.RE\n.PP\n/etc/apt/apt\\&.conf\n.RS 4\nAPT configuration file\\&. Configuration Item:\nDir::Etc::Main\\&.\n.RE\n.PP\n/etc/apt/apt\\&.conf\\&.d/\n.RS 4\nAPT configuration file fragments\\&. Configuration Item:\nDir::Etc::Parts\\&.\n.RE\n.PP\n/etc/apt/preferences\n.RS 4\nVersion 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:\nDir::Etc::Preferences\\&.\n.RE\n.PP\n/etc/apt/preferences\\&.d/\n.RS 4\nFile fragments for the version preferences\\&. Configuration Item:\nDir::Etc::PreferencesParts\\&.\n.RE\n.PP\n/var/cache/apt/archives/\n.RS 4\nStorage area for retrieved package files\\&. Configuration Item:\nDir::Cache::Archives\\&.\n.RE\n.PP\n/var/cache/apt/archives/partial/\n.RS 4\nStorage area for package files in transit\\&. Configuration Item:\nDir::Cache::Archives\n(partial\nwill be implicitly appended)\n.RE\n.PP\n/var/lib/apt/lists/\n.RS 4\nStorage area for state information for each package resource specified in\n\\fBsources.list\\fR(5)\nConfiguration Item:\nDir::State::Lists\\&.\n.RE\n.PP\n/var/lib/apt/lists/partial/\n.RS 4\nStorage area for state information in transit\\&. Configuration Item:\nDir::State::Lists\n(partial\nwill be implicitly appended)\n.RE\n.SH \"SEE ALSO\"\n.PP\n\\fBapt-cache\\fR(8),\n\\fBapt-cdrom\\fR(8),\n\\fBdpkg\\fR(1),\n\\fBsources.list\\fR(5),\n\\fBapt.conf\\fR(5),\n\\fBapt-config\\fR(8),\n\\fBapt-secure\\fR(8), The APT User\\*(Aqs guide in /usr/share/doc/apt\\-doc/,\n\\fBapt_preferences\\fR(5), the APT Howto\\&.\n.SH \"DIAGNOSTICS\"\n.PP\n\\fBapt\\-get\\fR\nreturns zero on normal operation, decimal 100 on error\\&.\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBJason Gunthorpe\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man8/apt-key.8",
    "content": "'\\\" t\n.\\\"     Title: apt-key\n.\\\"    Author: Jason Gunthorpe\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 25\\ \\&November\\ \\&2016\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\\-KEY\" \"8\" \"25\\ \\&November\\ \\&2016\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt-key \\- APT key management utility\n.SH \"SYNOPSIS\"\n.HP \\w'\\fBapt\\-key\\fR\\ 'u\n\\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}}\n.SH \"DESCRIPTION\"\n.PP\n\\fBapt\\-key\\fR\nis 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\\&.\n.PP\nNote that if usage of\n\\fBapt\\-key\\fR\nis desired the additional installation of the GNU Privacy Guard suite (packaged in\ngnupg) 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\\&.\n\\fBapt\\-key\\fR\nwill try to detect such usage and generates warnings on stderr in these cases\\&.\n.SH \"SUPPORTED KEYRING FILES\"\n.PP\napt\\-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\n\\fBgpg\\fR(1)\nversions as default for keyring files\\&. Binary keyring files intended to be used with any apt version should therefore always be created with\n\\fBgpg \\-\\-export\\fR\\&.\n.PP\nAlternatively, 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\n\\fBgpg \\-\\-armor \\-\\-export\\fR\\&.\n.SH \"COMMANDS\"\n.PP\n\\fBadd\\fR \\fB\\fIfilename\\fR\\fR\n.RS 4\nAdd a new key to the list of trusted keys\\&. The key is read from the filename given with the parameter\n\\fIfilename\\fR\nor if the filename is\n\\-\nfrom standard input\\&.\n.sp\nIt is critical that keys added manually via\n\\fBapt\\-key\\fR\nare verified to belong to the owner of the repositories they claim to be for otherwise the\n\\fBapt-secure\\fR(8)\ninfrastructure is completely undermined\\&.\n.sp\n\\fINote\\fR: Instead of using this command a keyring should be placed directly in the\n/etc/apt/trusted\\&.gpg\\&.d/\ndirectory with a descriptive name and either \"gpg\" or \"asc\" as file extension\\&.\n.RE\n.PP\n\\fBdel\\fR \\fB\\fIkeyid\\fR\\fR\n.RS 4\nRemove a key from the list of trusted keys\\&.\n.RE\n.PP\n\\fBexport\\fR \\fB\\fIkeyid\\fR\\fR\n.RS 4\nOutput the key\n\\fIkeyid\\fR\nto standard output\\&.\n.RE\n.PP\n\\fBexportall\\fR\n.RS 4\nOutput all trusted keys to standard output\\&.\n.RE\n.PP\n\\fBlist\\fR, \\fBfinger\\fR\n.RS 4\nList trusted keys with fingerprints\\&.\n.RE\n.PP\n\\fBadv\\fR\n.RS 4\nPass advanced options to gpg\\&. With\n\\fBadv \\-\\-recv\\-key\\fR\nyou can e\\&.g\\&. download key from keyservers directly into the trusted set of keys\\&. Note that there are\n\\fIno\\fR\nchecks performed, so it is easy to completely undermine the\n\\fBapt-secure\\fR(8)\ninfrastructure if used without care\\&.\n.RE\n.PP\n\\fBupdate\\fR (deprecated)\n.RS 4\nUpdate 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\narchive\\-keyring\npackage of your distribution, e\\&.g\\&. the\ndebian\\-archive\\-keyring\npackage in Debian\\&.\n.sp\nNote that a distribution does not need to and in fact should not use this command any longer and instead ship keyring files in the\n/etc/apt/trusted\\&.gpg\\&.d/\ndirectory directly as this avoids a dependency on\ngnupg\nand it is easier to manage keys by simply adding and removing files for maintainers and users alike\\&.\n.RE\n.PP\n\\fBnet\\-update\\fR\n.RS 4\nPerform an update working similarly to the\n\\fBupdate\\fR\ncommand above, but get the archive keyring from a URI instead and validate it against a master key\\&. This requires an installed\n\\fBwget\\fR(1)\nand 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\n\\fBupdate\\fR\ninstead, but Ubuntu\\*(Aqs APT does\\&.\n.RE\n.SH \"OPTIONS\"\n.PP\nNote that options need to be defined before the commands described in the previous section\\&.\n.PP\n\\fB\\-\\-keyring\\fR \\fB\\fIfilename\\fR\\fR\n.RS 4\nWith 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\ntrusted\\&.gpg\nfile as well as on all parts in the\ntrusted\\&.gpg\\&.d\ndirectory, though\ntrusted\\&.gpg\nis the primary keyring which means that e\\&.g\\&. new keys are added to this one\\&.\n.RE\n.SH \"FILES\"\n.PP\n/etc/apt/trusted\\&.gpg\n.RS 4\nKeyring of local trusted keys, new keys will be added here\\&. Configuration Item:\nDir::Etc::Trusted\\&.\n.RE\n.PP\n/etc/apt/trusted\\&.gpg\\&.d/\n.RS 4\nFile fragments for the trusted keys, additional keyrings can be stored here (by other packages or the administrator)\\&. Configuration Item\nDir::Etc::TrustedParts\\&.\n.RE\n.SH \"SEE ALSO\"\n.PP\n\\fBapt-get\\fR(8),\n\\fBapt-secure\\fR(8)\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHOR\"\n.PP\nAPT was written by the APT team\n<apt@packages\\&.debian\\&.org>\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBJason Gunthorpe\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man8/apt-mark.8",
    "content": "'\\\" t\n.\\\"     Title: apt-mark\n.\\\"    Author: Mike O\\*(AqConnor\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 25\\ \\&September\\ \\&2015\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\\-MARK\" \"8\" \"25\\ \\&September\\ \\&2015\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt-mark \\- show, set and unset various settings for a package\n.SH \"SYNOPSIS\"\n.HP \\w'\\fBapt\\-mark\\fR\\ 'u\n\\fBapt\\-mark\\fR {\\fB\\-f=\\fR\\fB\\fIfilename\\fR\\fR | {auto\\ |\\ manual}\\ \\fIpkg\\fR...  | {showauto\\ |\\ showmanual}\\ [\\fIpkg\\fR...] } | {\\-v\\ |\\ \\-\\-version} | {\\-h\\ |\\ \\-\\-help} \n.HP \\w'\\fBapt\\-mark\\fR\\ 'u\n\\fBapt\\-mark\\fR {hold\\ |\\ unhold\\ |\\ install\\ |\\ remove\\ |\\ purge}\\ \\fIpkg\\fR...  | {showhold\\ |\\ showinstall\\ |\\ showremove\\ |\\ showpurge}\\ [\\fIpkg\\fR...]  \n.SH \"DESCRIPTION\"\n.PP\n\\fBapt\\-mark\\fR\ncan 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\n\\fBdpkg\\fR\nselections such as hold, install, deinstall and purge which are respected e\\&.g\\&. by\n\\fBapt\\-get dselect\\-upgrade\\fR\nor\n\\fBaptitude\\fR\\&.\n.SH \"AUTOMATICALLY AND MANUALLY INSTALLED PACKAGES\"\n.PP\nWhen 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\\&.\n\\fBapt\\-get\\fR\nor\n\\fBaptitude\\fR\nwill at least suggest removing them\\&.\n.PP\n\\fBauto\\fR\n.RS 4\nauto\nis 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\\&.\n.RE\n.PP\n\\fBmanual\\fR\n.RS 4\nmanual\nis 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\\&.\n.RE\n.PP\n\\fBshowauto\\fR\n.RS 4\nshowauto\nis 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\\&.\n.RE\n.PP\n\\fBshowmanual\\fR\n.RS 4\nshowmanual\ncan be used in the same way as\nshowauto\nexcept that it will print a list of manually installed packages instead\\&.\n.RE\n.SS \"Options\"\n.PP\n\\fB\\-f=\\fR\\fB\\fIfilename\\fR\\fR, \\fB\\-\\-file=\\fR\\fB\\fIfilename\\fR\\fR\n.RS 4\nRead/Write package stats from the filename given with the parameter\n\\fIfilename\\fR\ninstead of from the default location, which is\nextended_status\nin the directory defined by the Configuration Item:\nDir::State\\&.\n.RE\n.SH \"PREVENT CHANGES FOR A PACKAGE\"\n.PP\n\\fBhold\\fR\n.RS 4\nhold\nis used to mark a package as held back, which will prevent the package from being automatically installed, upgraded or removed\\&.\n.RE\n.PP\n\\fBunhold\\fR\n.RS 4\nunhold\nis used to cancel a previously set hold on a package to allow all actions again\\&.\n.RE\n.PP\n\\fBshowhold\\fR\n.RS 4\nshowhold\nis used to print a list of packages on hold in the same way as for the other show commands\\&.\n.RE\n.SH \"SCHEDULE PACKAGES FOR INSTALL, REMOVE AND PURGE\"\n.PP\nSome front\\-ends like\n\\fBapt\\-get dselect\\-upgrade\\fR\ncan be used to apply previously scheduled changes to the install state of packages\\&. Such changes can be scheduled with the\n\\fBinstall\\fR,\n\\fBremove\\fR\n(also known as\n\\fBdeinstall\\fR) and\n\\fBpurge\\fR\ncommands\\&. Packages with a specific selection can be displayed with\n\\fBshowinstall\\fR,\n\\fBshowremove\\fR\nand\n\\fBshowpurge\\fR\nrespectively\\&. More information about these so called dpkg selections can be found in\n\\fBdpkg\\fR(1)\\&.\n.SH \"OPTIONS\"\n.PP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\n.RS 4\nShow a short usage summary\\&.\n.RE\n.PP\n\\fB\\-v\\fR, \\fB\\-\\-version\\fR\n.RS 4\nShow the program version\\&.\n.RE\n.PP\n\\fB\\-c\\fR, \\fB\\-\\-config\\-file\\fR\n.RS 4\nConfiguration 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\n\\fBAPT_CONFIG\\fR\nenvironment variable\\&. See\n\\fBapt.conf\\fR(5)\nfor syntax information\\&.\n.RE\n.PP\n\\fB\\-o\\fR, \\fB\\-\\-option\\fR\n.RS 4\nSet a Configuration Option; This will set an arbitrary configuration option\\&. The syntax is\n\\fB\\-o Foo::Bar=bar\\fR\\&.\n\\fB\\-o\\fR\nand\n\\fB\\-\\-option\\fR\ncan be used multiple times to set different options\\&.\n.RE\n.SH \"FILES\"\n.PP\n/var/lib/apt/extended_states\n.RS 4\nStatus list of auto\\-installed packages\\&. Configuration Item:\nDir::State::extended_states\\&.\n.RE\n.SH \"SEE ALSO\"\n.PP\n\\fBapt-get\\fR(8),\\fBaptitude\\fR(8),\\fBapt.conf\\fR(5)\n.SH \"DIAGNOSTICS\"\n.PP\n\\fBapt\\-mark\\fR\nreturns zero on normal operation, non\\-zero on error\\&.\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBMike O\\*(AqConnor\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man8/apt-secure.8",
    "content": "'\\\" t\n.\\\"     Title: apt-secure\n.\\\"    Author: Jason Gunthorpe\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 06\\ \\&August\\ \\&2016\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\\-SECURE\" \"8\" \"06\\ \\&August\\ \\&2016\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt-secure \\- Archive authentication support for APT\n.SH \"DESCRIPTION\"\n.PP\nStarting with version 0\\&.6,\n\\fBAPT\\fR\ncontains 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\n\\fBAPT\\fR\nrequires repositories to provide recent authentication information for unimpeded usage of the repository\\&.\n.PP\nIf 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\n\\fBupdate\\fR\noperations and even if forced to download front\\-ends like\n\\fBapt-get\\fR(8)\nwill require explicit confirmation if an installation request includes a package from such an unauthenticated archive\\&.\n.PP\nAs a temporary exception\n\\fBapt-get\\fR(8)\n(not\n\\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\n\\fBBinary::apt\\-get::Acquire::AllowInsecureRepositories\\fR\nto\nfalse\nor\n\\fB\\-\\-no\\-allow\\-insecure\\-repositories\\fR\non the command line\\&.\n.PP\nYou can force all APT clients to raise only warnings by setting the configuration option\n\\fBAcquire::AllowInsecureRepositories\\fR\nto\ntrue\\&. Individual repositories can also be allowed to be insecure via the\n\\fBsources.list\\fR(5)\noption\nallow\\-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\n\\fBTrusted\\fR\noption available to disable even the warnings, but be sure to understand the implications as detailed in\n\\fBsources.list\\fR(5)\\&.\n.PP\nA repository which previously was authenticated but would loose this state in an\n\\fBupdate\\fR\noperation 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\n\\fBAcquire::AllowDowngradeToInsecureRepositories\\fR\nto\ntrue\nor for Individual repositories with the\n\\fBsources.list\\fR(5)\noption\nallow\\-downgrade\\-to\\-insecure=yes\\&.\n.PP\nNote: All APT\\-based package management front\\-ends like\n\\fBapt-get\\fR(8),\n\\fBaptitude\\fR(8)\nand\n\\fBsynaptic\\fR(8)\nsupport this authentication feature, so this manpage uses\nAPT\nto refer to them all for simplicity only\\&.\n.SH \"TRUSTED REPOSITORIES\"\n.PP\nThe chain of trust from an APT archive to the end user is made up of several steps\\&.\n\\fBapt\\-secure\\fR\nis 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\\&.\n.PP\napt\\-secure does not review signatures at a package level\\&. If you require tools to do this you should look at\n\\fBdebsig\\-verify\\fR\nand\n\\fBdebsign\\fR\n(provided in the debsig\\-verify and devscripts packages respectively)\\&.\n.PP\nThe 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\\&.\n.PP\nOnce 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\ndebian\\-archive\\-keyring\npackage\\&.\n.PP\nEnd 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\\&.\n.PP\nNotice that this is distinct from checking signatures on a per package basis\\&. It is designed to prevent two possible attacks:\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nNetwork \"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)\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\nMirror 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\\&.\n.RE\n.PP\nHowever, 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\\&.\n.SH \"USER CONFIGURATION\"\n.PP\n\\fBapt\\-key\\fR\nis 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\n\\fBSigned\\-By\\fR\nin\n\\fBsources.list\\fR(5)\\&.\n.PP\nNote that a default installation already contains all keys to securely acquire packages from the default repositories, so fiddling with\n\\fBapt\\-key\\fR\nis only needed if third\\-party repositories are added\\&.\n.PP\nIn 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\n\\fBapt\\-key\\fR\nand then run\n\\fBapt\\-get update\\fR\nso that apt can download and verify the\nInRelease\nor\nRelease\\&.gpg\nfiles from the archives you have configured\\&.\n.SH \"ARCHIVE CONFIGURATION\"\n.PP\nIf you want to provide archive signatures in an archive under your maintenance you have to:\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fICreate a toplevel Release file\\fR, if it does not exist already\\&. You can do this by running\n\\fBapt\\-ftparchive release\\fR\n(provided in apt\\-utils)\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\fISign it\\fR\\&. You can do this by running\n\\fBgpg \\-\\-clearsign \\-o InRelease Release\\fR\nand\n\\fBgpg \\-abs \\-o Release\\&.gpg Release\\fR\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\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\ndebian\\-archive\\-keyring\nto be able to distribute updates and key transitions automatically later\\&.\n.RE\n.sp\n.RS 4\n.ie n \\{\\\n\\h'-04'\\(bu\\h'+03'\\c\n.\\}\n.el \\{\\\n.sp -1\n.IP \\(bu 2.3\n.\\}\n\\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\\&.\n.RE\n.PP\nWhenever the contents of the archive change (new packages are added or removed) the archive maintainer has to follow the first two steps outlined above\\&.\n.SH \"SEE ALSO\"\n.PP\n\\fBapt.conf\\fR(5),\n\\fBapt-get\\fR(8),\n\\fBsources.list\\fR(5),\n\\fBapt-key\\fR(8),\n\\fBapt-ftparchive\\fR(1),\n\\fBdebsign\\fR(1),\n\\fBdebsig-verify\\fR(1),\n\\fBgpg\\fR(1)\n.PP\nFor more background information you might want to review the\n\\m[blue]\\fBDebian Security Infrastructure\\fR\\m[]\\&\\s-2\\u[1]\\d\\s+2\nchapter of the Securing Debian Manual (also available in the harden\\-doc package) and the\n\\m[blue]\\fBStrong Distribution HOWTO\\fR\\m[]\\&\\s-2\\u[2]\\d\\s+2\nby V\\&. Alex Brennen\\&.\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHOR\"\n.PP\nAPT was written by the APT team\n<apt@packages\\&.debian\\&.org>\\&.\n.SH \"MANPAGE AUTHORS\"\n.PP\nThis man\\-page is based on the work of Javier Fernández\\-Sanguino Peña, Isaac Jones, Colin Walters, Florian Weimer and Michael Vogt\\&.\n.SH \"AUTHORS\"\n.PP\n\\fBJason Gunthorpe\\fR\n.RS 4\n.RE\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nDebian Security Infrastructure\n.RS 4\n\\%https://www.debian.org/doc/manuals/securing-debian-howto/ch7\n.RE\n.IP \" 2.\" 4\nStrong Distribution HOWTO\n.RS 4\n\\%http://www.cryptnet.net/fdp/crypto/strong_distro.html\n.RE\n.IP \" 3.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/apt/man/man8/apt.8",
    "content": "'\\\" t\n.\\\"     Title: apt\n.\\\"    Author: APT team\n.\\\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>\n.\\\"      Date: 20\\ \\&October\\ \\&2015\n.\\\"    Manual: APT\n.\\\"    Source: APT 1.4.9\n.\\\"  Language: English\n.\\\"\n.TH \"APT\" \"8\" \"20\\ \\&October\\ \\&2015\" \"APT 1.4.9\" \"APT\"\n.\\\" -----------------------------------------------------------------\n.\\\" * Define some portability stuff\n.\\\" -----------------------------------------------------------------\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.\\\" http://bugs.debian.org/507673\n.\\\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html\n.\\\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\" -----------------------------------------------------------------\n.\\\" * set default formatting\n.\\\" -----------------------------------------------------------------\n.\\\" disable hyphenation\n.nh\n.\\\" disable justification (adjust text to left margin only)\n.ad l\n.\\\" -----------------------------------------------------------------\n.\\\" * MAIN CONTENT STARTS HERE *\n.\\\" -----------------------------------------------------------------\n.SH \"NAME\"\napt \\- command\\-line interface\n.SH \"SYNOPSIS\"\n.HP \\w'\\fBapt\\fR\\ 'u\n\\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}}\n.SH \"DESCRIPTION\"\n.PP\n\\fBapt\\fR\nprovides 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\n\\fBapt-get\\fR(8)\nand\n\\fBapt-cache\\fR(8)\\&.\n.PP\nMuch like\n\\fBapt\\fR\nitself, 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\\&.\n.PP\n\\fBupdate\\fR (\\fBapt-get\\fR(8))\n.RS 4\n\\fBupdate\\fR\nis 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\\&.\n.RE\n.PP\n\\fBupgrade\\fR (\\fBapt-get\\fR(8))\n.RS 4\n\\fBupgrade\\fR\nis used to install available upgrades of all packages currently installed on the system from the sources configured via\n\\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\\&.\n.RE\n.PP\n\\fBfull\\-upgrade\\fR (\\fBapt-get\\fR(8))\n.RS 4\nfull\\-upgrade\nperforms the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole\\&.\n.RE\n.PP\n\\fBinstall\\fR, \\fBremove\\fR, \\fBpurge\\fR (\\fBapt-get\\fR(8))\n.RS 4\nPerforms the requested action on one or more packages specified via\n\\fBregex\\fR(7),\n\\fBglob\\fR(7)\nor 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\\&.\n.sp\nA 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\\&.\n.sp\nRemoving 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\n\\fBpurge\\fR\neven on already removed packages\\&. Note that this does not affect any data or configuration stored in your home directory\\&.\n.RE\n.PP\n\\fBautoremove\\fR (\\fBapt-get\\fR(8))\n.RS 4\nautoremove\nis 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\\&.\n.sp\nYou 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\n\\fBapt-mark\\fR(8)\\&. Packages which you have installed explicitly via\n\\fBinstall\\fR\nare also never proposed for automatic removal\\&.\n.RE\n.PP\n\\fBsearch\\fR (\\fBapt-cache\\fR(8))\n.RS 4\n\\fBsearch\\fR\ncan be used to search for the given\n\\fBregex\\fR(7)\nterm(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\n\\fBapt-file\\fR(1)\\&.\n.RE\n.PP\n\\fBshow\\fR (\\fBapt-cache\\fR(8))\n.RS 4\nShow 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\n\\fBapt\\fR(8)\nto remove a package or while searching for new packages to install\\&.\n.RE\n.PP\n\\fBlist\\fR (work\\-in\\-progress)\n.RS 4\n\\fBlist\\fR\nis somewhat similar to\n\\fBdpkg\\-query \\-\\-list\\fR\nin that it can display a list of packages satisfying certain criteria\\&. It supports\n\\fBglob\\fR(7)\npatterns 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\\&.\n.RE\n.PP\n\\fBedit\\-sources\\fR (work\\-in\\-progress)\n.RS 4\nedit\\-sources\nlets you edit your\n\\fBsources.list\\fR(5)\nfiles in your preferred texteditor while also providing basic sanity checks\\&.\n.RE\n.SH \"SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS\"\n.PP\nThe\n\\fBapt\\fR(8)\ncommandline 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\\&.\n.PP\nAll features of\n\\fBapt\\fR(8)\nare available in dedicated APT tools like\n\\fBapt-get\\fR(8)\nand\n\\fBapt-cache\\fR(8)\nas well\\&.\n\\fBapt\\fR(8)\njust changes the default value of some options (see\n\\fBapt.conf\\fR(5)\nand 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\\&.\n.SH \"SEE ALSO\"\n.PP\n\\fBapt-get\\fR(8),\n\\fBapt-cache\\fR(8),\n\\fBsources.list\\fR(5),\n\\fBapt.conf\\fR(5),\n\\fBapt-config\\fR(8), The APT User\\*(Aqs guide in /usr/share/doc/apt\\-doc/,\n\\fBapt_preferences\\fR(5), the APT Howto\\&.\n.SH \"DIAGNOSTICS\"\n.PP\n\\fBapt\\fR\nreturns zero on normal operation, decimal 100 on error\\&.\n.SH \"BUGS\"\n.PP\n\\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\n/usr/share/doc/debian/bug\\-reporting\\&.txt\nor the\n\\fBreportbug\\fR(1)\ncommand\\&.\n.SH \"AUTHOR\"\n.PP\n\\fBAPT team\\fR\n.RS 4\n.RE\n.SH \"NOTES\"\n.IP \" 1.\" 4\nAPT bug page\n.RS 4\n\\%http://bugs.debian.org/src:apt\n.RE\n"
  },
  {
    "path": "packages/aptly/Makefile.patch",
    "content": "diff -uNr aptly-1.4.0/Makefile aptly-1.4.0.mod/Makefile\n--- aptly-1.4.0/Makefile\t2019-07-06 16:03:14.000000000 +0300\n+++ aptly-1.4.0.mod/Makefile\t2019-07-23 00:58:29.206419471 +0300\n@@ -4,7 +4,7 @@\n else\n \tTAG=\"$(shell git describe --tags)\"\n endif\n-VERSION=$(shell echo $(TAG) | sed 's@^v@@' | sed 's@-@+@g')\n+VERSION ?= $(shell echo $(TAG) | sed 's@^v@@' | sed 's@-@+@g')\n PACKAGES=context database deb files gpg http query swift s3 utils\n PYTHON?=python\n TESTS?=\n"
  },
  {
    "path": "packages/aptly/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.aptly.info\nTERMUX_PKG_DESCRIPTION=\"A Swiss Army knife for Debian repository management.\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.4.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/aptly-dev/aptly/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=4172d54613139f6c34d5a17396adc9675d7ed002e517db8381731d105351fbe5\n\ntermux_step_make() {\n\ttermux_setup_golang\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\n\tmkdir -p \"$GOPATH\"/src/github.com/aptly-dev/\n\tcp -a \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/aptly-dev/aptly\n\tcd \"$GOPATH\"/src/github.com/aptly-dev/aptly\n\n\tmake install VERSION=$TERMUX_PKG_VERSION\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/bin/${GOOS}_${GOARCH}/aptly \\\n\t\t\"$TERMUX_PREFIX\"/bin/aptly\n\n\tinstall -Dm600 \\\n\t\t\"$TERMUX_PKG_SRCDIR\"/man/aptly.1 \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/aptly.1\n}\n"
  },
  {
    "path": "packages/argp/argp-fmtstream.h.patch",
    "content": "--- ./argp-fmtstream.h.orig\t2003-12-11 09:37:05.000000000 +0100\n+++ ./argp-fmtstream.h\t2011-08-12 11:56:43.000000000 +0200\n@@ -192,7 +192,7 @@\n extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);\n extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);\n \f\n-#ifdef __OPTIMIZE__\n+#if defined(__OPTIMIZE__) && !defined(__clang__)\n /* Inline versions of above routines.  */\n \n #if !_LIBC\n"
  },
  {
    "path": "packages/argp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.lysator.liu.se/~nisse/misc/\nTERMUX_PKG_DESCRIPTION=\"Standalone version of arguments parsing functions from GLIBC\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be\nTERMUX_PKG_SRCURL=https://www.lysator.liu.se/~nisse/misc/argp-standalone-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_NO_STATICSPLIT=true\n\ntermux_step_post_make_install() {\n\tcp libargp.a $TERMUX_PREFIX/lib\n\tcp $TERMUX_PKG_SRCDIR/argp.h $TERMUX_PREFIX/include\n}\n"
  },
  {
    "path": "packages/aria2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://aria2.github.io\nTERMUX_PKG_DESCRIPTION=\"Download utility supporting HTTP/HTTPS, FTP, BitTorrent and Metalink\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.35.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/aria2/aria2/releases/download/release-${TERMUX_PKG_VERSION}/aria2-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=1e2b7fd08d6af228856e51c07173cfcf987528f1ac97e04c5af4a47642617dfd\nTERMUX_PKG_DEPENDS=\"libc++, c-ares, openssl, libxml2, zlib\"\n# sqlite3 is only used for loading cookies from firefox or chrome:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-openssl\n--without-gnutls\n--without-libuv\n--without-sqlite3\n--without-libssh2\nac_cv_func_basename=yes\nac_cv_func_getaddrinfo=yes\nac_cv_func_gettimeofday=yes\nac_cv_func_sleep=yes\nac_cv_func_usleep=yes\nac_cv_search_getaddrinfo=no\n\"\n\ntermux_step_pre_configure() {\n\tif [ \"$TERMUX_ARCH\" = \"arm\" ]; then\n\t\tCXXFLAGS=\"${CFLAGS/-Oz/-Os}\"\n\tfi\n}\n"
  },
  {
    "path": "packages/arj/001_arches_align.patch",
    "content": "Description: Correct build failure on ia64 due to unaligned memory access.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2008-06-16\n\nIndex: b/arj_proc.c\n===================================================================\n--- a/arj_proc.c\t2005-06-21 22:53:12.000000000 +0300\n+++ b/arj_proc.c\t2008-06-16 08:25:28.000000000 +0300\n@@ -2898,7 +2898,7 @@ char *ltrim(char *str)\n }\n #endif\n \n-#if defined(WORDS_BIGENDIAN)&&!defined(ARJDISP)&&!defined(REGISTER)\n+#if (defined(WORDS_BIGENDIAN) || defined(ALIGN_POINTERS)) && !defined(ARJDISP) && !defined(REGISTER)\n /* Model-independent routine to get 2 bytes from far RAM */\n \n unsigned int mget_word(char FAR *p)\nIndex: b/arj_proc.h\n===================================================================\n--- a/arj_proc.h\t2004-01-25 12:39:30.000000000 +0200\n+++ b/arj_proc.h\t2008-06-16 08:25:28.000000000 +0300\n@@ -12,7 +12,7 @@\n \n #define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF)\n #define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c)\n-#ifndef WORDS_BIGENDIAN\n+#if !defined(ALIGN_POINTERS) && !defined(WORDS_BIGENDIAN)\n #define mget_word(p) (*(unsigned short *)(p)&0xFFFF)\n #define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w))\n #define mget_dword(p) (*(unsigned long *)(p))\n@@ -60,7 +60,7 @@ void pack_mem(struct mempack *mempack);\n void unpack_mem(struct mempack *mempack);\n void strip_lf(char *str);\n char *ltrim(char *str);\n-#ifdef WORDS_BIGENDIAN\n+#if defined(ALIGN_POINTERS) || defined(WORDS_BIGENDIAN)\n unsigned int mget_word(char FAR *p);\n unsigned long mget_dword(char FAR *p);\n void mput_word(unsigned int w, char FAR *p);\n"
  },
  {
    "path": "packages/arj/002_no_remove_static_const.patch",
    "content": "Description: Set the static const intergrity_identifier variable as volatile\n instead of building the file with -O0 to avoid the compiler optimizing it\n away, so that we can use standard flags everywhere.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2013-05-10\n\n---\n integr.c |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n--- a/integr.c\n+++ b/integr.c\n@@ -5,7 +5,7 @@\n  *\n  */\n \n-static const char intergrity_identifier[] = {\n+static volatile const char intergrity_identifier[] = {\n \t0xB0, 0x03, 0xB0, 0x02, 0xB0, 0x03,\n \t0xB0, 0x04, 0xB0, 0x05,\n \t0x90, 0x90, 0x90, 0x90,\n"
  },
  {
    "path": "packages/arj/003_64_bit_clean.patch",
    "content": "Description: Make code 64-bit clean.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/339815\nForwarded: no\nLast-Update: 2005-11-24\n\nIndex: b/arj_arcv.c\n===================================================================\n--- a/arj_arcv.c\t2005-06-21 22:53:12.000000000 +0300\n+++ b/arj_arcv.c\t2008-06-16 08:25:43.000000000 +0300\n@@ -59,27 +59,27 @@ static char idxid_fault[]=\"?\";\n #define setup_hput(ptr) (tmp_hptr=(ptr))\n \n #define hget_byte() (*(tmp_hptr++)&0xFF)\n-#define hput_byte(c) (*(tmp_hptr++)=(char) (c))\n+#define hput_byte(c) (*(tmp_hptr++)=(uint8_t) (c))\n \n /* Reads two bytes from the header, incrementing the pointer */\n \n-static unsigned int hget_word()\n+static uint16_t hget_word()\n {\n- unsigned int result;\n+ uint16_t result;\n \n  result=mget_word(tmp_hptr);\n- tmp_hptr+=sizeof(short);\n+ tmp_hptr+=sizeof(uint16_t);\n  return result;\n }\n \n /* Reads four bytes from the header, incrementing the pointer */\n \n-static unsigned long hget_longword()\n+static uint32_t hget_longword()\n {\n- unsigned long result;\n+ uint32_t result;\n \n  result=mget_dword(tmp_hptr);\n- tmp_hptr+=sizeof(unsigned long);\n+ tmp_hptr+=sizeof(uint32_t);\n  return result;\n }\n \n@@ -87,18 +87,18 @@ static unsigned long hget_longword()\n \n /* Writes two bytes to the header, incrementing the pointer */\n \n-static void hput_word(unsigned int w)\n+static void hput_word(uint16_t w)\n {\n  mput_word(w,tmp_hptr); \n- tmp_hptr+=sizeof(unsigned short);\n+ tmp_hptr+=sizeof(uint16_t);\n }\n \n /* Writes four bytes to the header, incrementing the pointer */\n \n-static void hput_longword(unsigned long l)\n+static void hput_longword(uint32_t l)\n {\n  mput_dword(l,tmp_hptr);\n- tmp_hptr+=sizeof(unsigned long);\n+ tmp_hptr+=sizeof(uint32_t);\n }\n \n /* Calculates and stores the basic header size */\nIndex: b/arj_proc.c\n===================================================================\n--- a/arj_proc.c\t2008-06-16 08:25:28.000000000 +0300\n+++ b/arj_proc.c\t2008-06-16 08:25:43.000000000 +0300\n@@ -585,7 +585,7 @@ int search_for_extension(char *name, cha\n /* Returns the exact amount of data that could be safely written to the\n    destination volume */\n \n-unsigned long get_volfree(unsigned int increment)\n+unsigned long get_volfree(unsigned long increment)\n {\n  unsigned long pvol;\n  unsigned int arjsec_overhead;\n@@ -605,7 +605,7 @@ unsigned long get_volfree(unsigned int i\n  remain=volume_limit-ftell(aostream)-pvol-(long)arjsec_overhead-\n         (long)out_bytes-(long)cpos-(long)ext_voldata-\n         MULTIVOLUME_RESERVE-t_volume_offset;\n- return((unsigned long)min(remain, (unsigned long)increment));\n+ return((unsigned long)min(remain, increment));\n }\n \n /* Performs various checks when multivolume data is packed to predict an\n@@ -2466,14 +2466,14 @@ static int get_str_from_jq()\n     *tsptr='\\0';\n   endptr=tsptr;\n   tsptr=sptr;\n-  while((unsigned int)tsptr<(unsigned int)endptr&&patterns<SEARCH_STR_MAX)\n+  while((intptr_t)tsptr<(intptr_t)endptr&&patterns<SEARCH_STR_MAX)\n   {\n    while(*tsptr=='\\0')\n     tsptr++;\n-   if((unsigned int)tsptr<(unsigned int)endptr)\n+   if((intptr_t)tsptr<(intptr_t)endptr)\n    {\n     search_str[patterns++]=tsptr;\n-    while(*tsptr!='\\0'&&(unsigned int)tsptr<(unsigned int)endptr)\n+    while(*tsptr!='\\0'&&(intptr_t)tsptr<(intptr_t)endptr)\n      tsptr++;\n    }\n   }\n@@ -2901,9 +2901,9 @@ char *ltrim(char *str)\n #if (defined(WORDS_BIGENDIAN) || defined(ALIGN_POINTERS)) && !defined(ARJDISP) && !defined(REGISTER)\n /* Model-independent routine to get 2 bytes from far RAM */\n \n-unsigned int mget_word(char FAR *p)\n+uint16_t mget_word(char FAR *p)\n {\n- unsigned int b0, b1;\n+ uint16_t b0, b1;\n \n  b0=mget_byte(p);\n  b1=mget_byte(p+1);\n@@ -2912,9 +2912,9 @@ unsigned int mget_word(char FAR *p)\n \n /* Model-independent routine to get 4 bytes from far RAM */\n \n-unsigned long mget_dword(char FAR *p)\n+uint32_t mget_dword(char FAR *p)\n {\n- unsigned long w0, w1;\n+ uint32_t w0, w1;\n \n  w0=mget_word(p);\n  w1=mget_word(p+2);\n@@ -2923,7 +2923,7 @@ unsigned long mget_dword(char FAR *p)\n \n /* Model-independent routine to store 2 bytes in far RAM */\n \n-void mput_word(unsigned int w, char FAR *p)\n+void mput_word(uint16_t w, char FAR *p)\n {\n  mput_byte(w&0xFF, p);\n  mput_byte(w>>8  , p+1);\n@@ -2931,7 +2931,7 @@ void mput_word(unsigned int w, char FAR \n \n /* Model-independent routine to store 4 bytes in far RAM */\n \n-void mput_dword(unsigned long d, char FAR *p)\n+void mput_dword(uint32_t d, char FAR *p)\n {\n  mput_word(d&0xFFFF, p);\n  mput_word(d>>16   , p+2);\nIndex: b/arj_proc.h\n===================================================================\n--- a/arj_proc.h\t2008-06-16 08:25:28.000000000 +0300\n+++ b/arj_proc.h\t2008-06-16 08:25:43.000000000 +0300\n@@ -8,15 +8,17 @@\n #ifndef ARJ_PROC_INCLUDED\n #define ARJ_PROC_INCLUDED\n \n+#include <stdint.h>\n+\n /* Helper macros */\n \n-#define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF)\n-#define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c)\n+#define mget_byte(p) (*(uint8_t FAR *)(p)&0xFF)\n+#define mput_byte(c, p) *(uint8_t FAR *)(p)=(uint8_t)(c)\n #if !defined(ALIGN_POINTERS) && !defined(WORDS_BIGENDIAN)\n-#define mget_word(p) (*(unsigned short *)(p)&0xFFFF)\n-#define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w))\n-#define mget_dword(p) (*(unsigned long *)(p))\n-#define mput_dword(w,p) (*(unsigned long *)(p)=(unsigned long)(w))\n+#define mget_word(p) (*(uint16_t *)(p)&0xFFFF)\n+#define mput_word(w,p) (*(uint16_t *)(p)=(uint16_t)(w))\n+#define mget_dword(p) (*(uint32_t *)(p))\n+#define mput_dword(w,p) (*(uint32_t *)(p)=(uint32_t)(w))\n #endif\n \n /* Prototypes */\n@@ -31,7 +33,7 @@ void copy_bytes(unsigned long nbytes);\n int translate_path(char *name);\n void restart_proc(char *dest);\n int search_for_extension(char *name, char *ext_list);\n-unsigned long get_volfree(unsigned int increment);\n+unsigned long get_volfree(unsigned long increment);\n unsigned int check_multivolume(unsigned int increment);\n void store();\n void hollow_encode();\n@@ -61,10 +63,10 @@ void unpack_mem(struct mempack *mempack)\n void strip_lf(char *str);\n char *ltrim(char *str);\n #if defined(ALIGN_POINTERS) || defined(WORDS_BIGENDIAN)\n-unsigned int mget_word(char FAR *p);\n-unsigned long mget_dword(char FAR *p);\n-void mput_word(unsigned int w, char FAR *p);\n-void mput_dword(unsigned long d, char FAR *p);\n+uint16_t mget_word(char FAR *p);\n+uint32_t mget_dword(char FAR *p);\n+void mput_word(uint16_t w, char FAR *p);\n+void mput_dword(uint32_t d, char FAR *p);\n #endif\n \n #endif\n"
  },
  {
    "path": "packages/arj/004_parallel_build.patch",
    "content": "Description: Fix upstream build sysstem to support parallel builds.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2007-12-05\n\n---\n gnu/makefile.in |   74 +++++++++++++++++++++++++++++++++-----------------------\n 1 file changed, 44 insertions(+), 30 deletions(-)\n\n--- a/gnu/makefile.in\n+++ b/gnu/makefile.in\n@@ -159,13 +159,15 @@ $(SFXSTUB_DIR)/%.o: $(SRC_DIR)/%.c\n # Main dependency tree\n #\n \n-.PHONY: timestamp prepare cleanup package help\n+.PHONY: timestamp msg-headers depends prepare clean package help\n \n ifdef COMMERCIAL\n MAKE_KEY=$(TOOLS_DIR)/make_key$x\n endif\n \n all:\tprepare timestamp\n+\t$(MAKE) msg-headers\n+\t$(MAKE) depends\n \t$(MAKE) do-all\n \n do-all:\t\\\n@@ -175,8 +177,28 @@ do-all:\t\\\n \t$(REGISTER_DIR)/$(REGISTER)$x \\\n \t$(ARJDISP_DIR)/arjdisp$x \\\n \t$(TOOLS_DIR)/packager$x \\\n-        $(MAKE_KEY) \\\n-\tdispose\n+\t$(MAKE_KEY)\n+\n+MSG_ID := \\\n+\tmsg_crp msg_stb msg_sfv msg_sfx msg_sfj msg_arj msg_rej msg_reg msg_adi\n+MSG_HEADERS := $(patsubst %,$(BASEDIR)/%.h,$(MSG_ID))\n+\n+msg-headers: $(MSG_HEADERS)\n+\n+.deps:\n+\tmkdir -p $@\n+\n+.deps/%.d: %.c .deps\n+\t$(CC) $(CPPFLAGS) $(COPT) $< -MM > $@\n+\n+SOURCES = $(wildcard *.c)\n+DEPS = $(addprefix .deps/,$(SOURCES:.c=.d))\n+\n+ifeq ($(sort $(DEPS)),$(sort $(wildcard .deps/*.d)))\n+include $(DEPS)\n+endif\n+\n+depends: $(DEPS)\n \n #\n # Update timestamp file\n@@ -186,12 +208,6 @@ timestamp: $(TOOLS_DIR)/today$x\n \t$(TOOLS_DIR)/today$x $(LOCALE) $(BASEDIR)\n \n #\n-# Final cleanup\n-#\n-\n-dispose:\n-\n-#\n # The tools\n #\n \n@@ -255,7 +271,7 @@ $(ARJCRYPT_DIR)/arjcrypt$d: $(ARJCRYPT_O\n \t$(CC) $(ALL_CFLAGS) $(DLL_FLAGS) -o $@ $(ARJCRYPT_OBJS) $(ARJCRYPT_DEF) $(LIBS)\n \t$(TOOLS_DIR)/postproc $@\n \n-$(BASEDIR)/nmsg_crp.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/nmsg_crp.c $(BASEDIR)/msg_crp.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_crp $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -269,7 +285,7 @@ $(SFXSTUB_DIR)/sfxstub$x: $(SFXSTUB_OBJS\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SFXSTUB_OBJS) $(LIBS)\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n-$(BASEDIR)/nmsg_stb.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/nmsg_stb.c $(BASEDIR)/msg_stb.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_stb $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -287,7 +303,8 @@ $(ARJSFXV_DIR)/arjsfxv$x: $(ARJSFXV_OBJS\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXV_OBJS) $(LIBS) $(DYN_LIBS)\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n-$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c \\\n+$(BASEDIR)/msg_sfv.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfv $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -304,7 +321,8 @@ $(ARJSFX_DIR)/arjsfx$x: $(ARJSFX_OBJS) $\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFX_OBJS) $(LIBS)\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n-$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c \\\n+$(BASEDIR)/msg_sfx.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfx $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -319,7 +337,8 @@ $(ARJSFXJR_DIR)/arjsfxjr$x: $(ARJSFXJR_O\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXJR_OBJS) $(LIBS)\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n-$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c \\\n+$(BASEDIR)/msg_sfj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_sfj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -354,7 +373,8 @@ $(ARJ_DIR)/arj$x: $(ARJ_OBJS) \\\n \t$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(BASEDIR)/help.arj\n \t$(TOOLS_DIR)/postproc $@\n \n-$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/fmsg_arj.c $(BASEDIR)/imsg_arj.c $(BASEDIR)/nmsg_arj.c \\\n+$(BASEDIR)/msg_arj.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_arj $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -372,7 +392,8 @@ $(REARJ_DIR)/rearj$x: $(REARJ_OBJS) \\\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REARJ_OBJS) $(LIBS)\n \t$(TOOLS_DIR)/postproc $@\n \n-$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c \\\n+$(BASEDIR)/msg_rej.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_rej $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -388,7 +409,8 @@ $(REGISTER_DIR)/$(REGISTER)$x: $(REGISTE\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REGISTER_OBJS) $(LIBS)\n \t$(TOOLS_DIR)/postproc $@ -sfx\n \n-$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c \\\n+$(BASEDIR)/msg_reg.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_reg $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -402,7 +424,8 @@ ARJDISP_OBJS = $(patsubst %,$(ARJDISP_DI\n $(ARJDISP_DIR)/arjdisp$x: $(ARJDISP_OBJS)\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJDISP_OBJS) $(LIBS)\n \n-$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n+$(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c \\\n+$(BASEDIR)/msg_adi.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n \t$(TOOLS_DIR)/msgbind $(RESFILE) msg_adi $(OS_ID) $(PACKAGE) $(LOCALE) $(BASEDIR)\n \n #\n@@ -427,18 +450,9 @@ prepare:\n #\n \n clean:\n-\t-rm -f $(BASEDIR)/*\n-\t-rm -f $(TOOLS_DIR)/*\n-\t-rm -f $(ARJCRYPT_DIR)/*\n-\t-rm -f $(SFXSTUB_DIR)/*\n-\t-rm -f $(ARJSFXV_DIR)/*\n-\t-rm -f $(ARJSFX_DIR)/*\n-\t-rm -f $(ARJSFXJR_DIR)/*\n-\t-rm -f $(ARJ_DIR)/*\n-\t-rm -f $(REARJ_DIR)/*\n-\t-rm -f $(REGISTER_DIR)/*\n-\t-rm -f $(ARJDISP_DIR)/*\n-\t-rm -f arj.core\n+\trm -rf .deps\n+\trm -rf $(BASEDIR)\n+\trm -f arj.core\n \n #\n # Local installation\n"
  },
  {
    "path": "packages/arj/005_use_system_strnlen.patch",
    "content": "Description: Detect and conditionally use system strnlen function.\n This fixes build failures when the system has eglibc 2.10.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/546475\nForwarded: no\nLast-Update: 2009-09-13\n\n---\n fardata.c        |    2 ++\n gnu/config.h.in  |    1 +\n gnu/configure.in |    4 +++-\n 3 files changed, 6 insertions(+), 1 deletion(-)\n\n--- a/fardata.c\n+++ b/fardata.c\n@@ -190,6 +190,7 @@ int msg_sprintf(char *str, FMSG *fmt, ..\n \n /* Length-limited strlen() */\n \n+#ifndef HAVE_STRNLEN\n static int strnlen(const char FAR *s, int count)\n {\n  const char FAR *sc;\n@@ -198,6 +199,7 @@ static int strnlen(const char FAR *s, in\n   ;\n  return(sc-s);\n }\n+#endif\n \n /* Hex representation of digits */\n \n--- a/gnu/config.h.in\n+++ b/gnu/config.h.in\n@@ -8,6 +8,7 @@\n #undef HAVE_FCLOSEALL\n #undef HAVE_SETPRIORITY\n #undef HAVE_STRCASECMP\n+#undef HAVE_STRNLEN\n #undef HAVE_STRUPR\n #undef HAVE_STRLWR\n #undef USE_COLORS\n--- a/gnu/configure.in\n+++ b/gnu/configure.in\n@@ -35,7 +35,9 @@ AC_FUNC_MEMCMP\n AC_FUNC_SETVBUF_REVERSED\n AC_TYPE_SIGNAL\n AC_FUNC_VPRINTF\n-AC_CHECK_FUNCS([getcwd min max mkdir mkdtemp rmdir fcloseall strcasecmp setpriority strdup strerror strstr strupr strlwr strtol strtoul])\n+AC_CHECK_FUNCS([getcwd min max mkdir mkdtemp rmdir fcloseall \\\n+                strcasecmp setpriority strdup strerror strstr strnlen \\\n+                strupr strlwr strtol strtoul])\n \n dnl Platform-specific tuning\n PROG_EXT=\n"
  },
  {
    "path": "packages/arj/006_use_safe_strcpy.patch",
    "content": "Description: Use a safe strcpy for overlapping strings, among others\n fixes a build problem with a mangled generated .c file by msgbind\n (thus FTBFS), and CRC errors at run-time.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/590354\nForwarded: no\nLast-Update: 2010-07-26\n\n---\n arj.c      |    2 +-\n arjdata.c  |    9 +--------\n ea_mgr.c   |    2 +-\n misc.h     |    4 ++++\n msgbind.c  |    2 +-\n packager.c |    2 +-\n 6 files changed, 9 insertions(+), 12 deletions(-)\n\n--- a/arjdata.c\n+++ b/arjdata.c\n@@ -204,13 +204,6 @@ void date_fmt(char *dest)\n  #endif\n }\n \n-/* A safe strcpy() */\n-\n-static void safe_strcpy(char *dest, char *src)\n-{\n- memmove(dest, src, strlen(src)+1);\n-}\n-\n /* Context substitution routine */\n \n char *expand_tags(char *str, int limit)\n@@ -232,7 +225,7 @@ char *expand_tags(char *str, int limit)\n   {\n    if(*(p+1)==TAG_CHAR)\n    {\n-    strcpy(p, p+1);\n+    safe_strcpy(p, p+1);\n     p++;\n    }\n    else if(*(p+1)==TAG_SPECIAL_BEGIN&&(et=strchr(p+3, TAG_SPECIAL_END))!=NULL)\n--- a/arj.c\n+++ b/arj.c\n@@ -1169,7 +1169,7 @@ int main(int argc, char *argv[])\n      if(strlen(tmp_ptr)<=121)\n       tmp_ptr[0]='\\0';\n      else if(tmp_ptr[120]==' ')\n-      strcpy(tmp_ptr, tmp_ptr+121);\n+      safe_strcpy(tmp_ptr, tmp_ptr+121);\n     }\n     if(cmd==ARJ_CMD_ORDER&&strpbrk(tmp_ptr, wildcard_pattern)!=NULL)\n      error(M_ORDER_WILDCARD);\n--- a/ea_mgr.c\n+++ b/ea_mgr.c\n@@ -696,7 +696,7 @@ int resolve_longname(char *dest, char *n\n     tmp_name[st_len]='\\0';\n     if(tmp_name[0]==0xFD&&tmp_name[1]==0xFF)\n     {\n-     strcpy(tmp_name, (char *)tmp_name+4);\n+     safe_strcpy(tmp_name, (char *)tmp_name+4);\n      st_len-=4;\n     }\n     if(st_len==0||st_len+entry>=FILENAME_MAX)\n--- a/msgbind.c\n+++ b/msgbind.c\n@@ -578,7 +578,7 @@ int main(int argc, char **argv)\n    }\n    strcat(pool[tpool].data, msgname);\n    strcat(pool[tpool].data, \", \");\n-   strcpy(msg_buffer, msg_buffer+1);\n+   safe_strcpy(msg_buffer, msg_buffer+1);\n    buf_len=strlen(msg_buffer);\n    msg_buffer[--buf_len]='\\0';\n    patch_string(msg_buffer);\n--- a/packager.c\n+++ b/packager.c\n@@ -347,7 +347,7 @@ int main(int argc, char **argv)\n  expand_tags(buf, sizeof(buf)-1);\n  if((p=strchr(buf, '.'))!=NULL)\n  {\n-  strcpy(p, p+1);\n+  safe_strcpy(p, p+1);\n   if((p=strchr(buf, '.'))!=NULL)\n    *p='\\0';\n  }\n--- a/misc.h\n+++ b/misc.h\n@@ -11,6 +11,10 @@\n #include \"arjtypes.h\"\n #include \"filelist.h\"\n \n+/* A safe strcpy() */\n+\n+#define safe_strcpy(dest, src) memmove(dest, src, strlen(src)+1);\n+\n /* ASCIIZ string copy macro */\n \n #define strcpyn(dest, src, n)      \\\n"
  },
  {
    "path": "packages/arj/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://arj.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Open-source version of arj archiver\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.10.22\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/arj/arj-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=589e4c9bccc8669e7b6d8d6fcd64e01f6a2c21fe10aad56a83304ecc3b96a7db\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t(cd ./gnu && autoconf -f -i)\n\n\t# Hack for executing configure script in\n\t# non-standard directory.\n\t{\n\t\techo \"#!/bin/sh\"\n\t\techo \"cd ./gnu\"\n\t\techo \"\\$(dirname \\$0)/gnu/configure \\\"\\$@\\\"\"\n\t} > ./configure\n\tchmod +x ./configure\n}\n\n# ARJ appends archive of its help to its end. Unfortunately stripping and\n# ELF cleaning remove it. So redo this addition and correct the\n# ARJ self-checksum.\ntermux_step_post_massage() {\n\tlocal build_subdir\n\n\tif [ \"$TERMUX_ARCH\" = \"arm\" ]; then\n\t\tbuild_subdir=\"linux-androideabi\"\n\telse\n\t\tbuild_subdir=\"linux-android\"\n\tfi\n\n\t\"$TERMUX_PKG_SRCDIR/$build_subdir\"/en/rs/tools/join \\\n\t\tbin/arj \\\n\t\t\"$TERMUX_PKG_SRCDIR/$build_subdir\"/en/rs/help.arj\n\t\"$TERMUX_PKG_SRCDIR/$build_subdir\"/en/rs/tools/postproc \\\n\t\tbin/arj\n}\n"
  },
  {
    "path": "packages/arj/doc_refer_robert_k_jung.patch",
    "content": "Description: Refer to original author Robert K. Jung in the manual page.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/456275\nForwarded: no\nLast-Update: 2008-06-16\n\nIndex: b/resource/en/arj.1\n===================================================================\n--- a/resource/en/arj.1\t2005-06-21 21:27:20.000000000 +0300\n+++ b/resource/en/arj.1\t2008-06-16 08:25:47.000000000 +0300\n@@ -21,6 +21,9 @@ arj \\- Archiver for .arj files\n .IR archive [ .arj ]\n .RI [ \"base directory\" ]\n .RI [ \"!list name\" | \"path name\" | \"wildcard name\" ]\n+.SH DESCRIPTION\n+\\fIarj\\fP is a compression and file archiving utility. It was invented by\n+Robert K. Jung. \\fIARJ\\fP stands for \\fIA\\fPrchived by \\fIR\\fPobert \\fIJ\\fPung.\n .SH COMMANDS\n .TP\n .B ac\n"
  },
  {
    "path": "packages/arj/gnu_build_fix.patch",
    "content": "Description: Fix build failure on GNU/Hurd due to missing -ldl, by\n adding “gnu*” to the configure case handling libdl linking.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2011-02-28\n\n---\n gnu/configure.in |    7 +------\n 1 file changed, 1 insertion(+), 6 deletions(-)\n\n--- a/gnu/configure.in\n+++ b/gnu/configure.in\n@@ -49,16 +49,11 @@ OS_DEF=\"-D_UNIX\"\n DLL_CFLAGS=\"-fPIC\"\n \n case $host_os in\n-linux*)\n+gnu*|linux*|k*bsd*)\n \tAC_DEFINE(ELF_EXECUTABLES, 1, [Define if executables use ELF format])\n         DYN_LIBS=\"-ldl\"\n         LD_STRIP=\"gnu/stripgcc.lnk\"\n \t;;\n-k*bsd*)\n-\tAC_DEFINE(ELF_EXECUTABLES)\n-\tDYN_LIBS=\"-ldl\"\n-\tLD_STRIP=\"gnu/stripgcc.lnk\"\n-\t;;\n *bsd*)\n \tAC_DEFINE(ELF_EXECUTABLES)\n         DLL_FLAGS=\"-shared -export-dynamic\"\n"
  },
  {
    "path": "packages/arj/gnu_build_flags.patch",
    "content": "Description: Fix upstream build system to honour CPPFLAGS and LDFLAGS.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2013-05-09\n\n---\n gnu/makefile.in |    9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\n--- a/gnu/makefile.in\n+++ b/gnu/makefile.in\n@@ -56,7 +56,7 @@ DEBUG_SM = r\n ADD_LDFLAGS = -s @LD_STRIP@\n endif\n \n-ALL_CFLAGS += $(CFLAGS)\n+ALL_CFLAGS += @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS)\n \n # Build Installation paths\n \n@@ -80,11 +80,11 @@ SFXSTUB_DIR = $(BASEDIR)/sfxstub\n # Definitions for compiling submodules\n \n LDFLAGS = @LDFLAGS@ $(ADD_LDFLAGS)\n-DLL_FLAGS = @DLL_FLAGS@ $(ADD_LDFLAGS)\n+DLL_FLAGS = @DLL_FLAGS@ $(LDFLAGS)\n DLL_CFLAGS = @DLL_CFLAGS@\n REQUIRES_DEF = @REQUIRES_DEF@\n \n-COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) @CFLAGS@ $(ALL_CFLAGS)\n+COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) $(ALL_CFLAGS)\n STD_COPT = -DARJUTIL $(COPT)\n ARJ_COPT = -DSFL=4 $(COPT)\n ARJSFXV_COPT = -DSFL=3 $(COPT)\n@@ -189,7 +190,7 @@ msg-headers: $(MSG_HEADERS)\n \tmkdir -p $@\n \n .deps/%.d: %.c .deps\n-\t$(CC) $(CPPFLAGS) $(COPT) $< -MM > $@\n+\t$(CC) $(COPT) $< -MM > $@\n \n SOURCES = $(wildcard *.c)\n DEPS = $(addprefix .deps/,$(SOURCES:.c=.d))\n"
  },
  {
    "path": "packages/arj/gnu_build_pie.patch",
    "content": "Description: Support PIE build option.\n We always pass -shared and -fPIC after all user defined flags, so that these\n will override any possibly passed -fPIE option.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2016-06-03\n\n---\n gnu/configure.in |    2 ++\n gnu/makefile.in  |    4 ++--\n 2 files changed, 4 insertions(+), 2 deletions(-)\n\n--- a/gnu/makefile.in\n+++ b/gnu/makefile.in\n@@ -85,7 +85,7 @@ SFXSTUB_DIR = $(BASEDIR)/sfxstub\n # Definitions for compiling submodules\n \n LDFLAGS = @LDFLAGS@ $(ADD_LDFLAGS)\n-DLL_FLAGS = @DLL_FLAGS@ $(LDFLAGS)\n+DLL_FLAGS = $(LDFLAGS) @DLL_FLAGS@\n DLL_CFLAGS = @DLL_CFLAGS@\n REQUIRES_DEF = @REQUIRES_DEF@\n \n@@ -98,7 +98,7 @@ ARJSFXJR_COPT = -DSFL=1 $(COPT)\n REARJ_COPT = -DREARJ $(COPT)\n REGISTER_COPT = -DREGISTER $(COPT)\n ARJDISP_COPT = -DARJDISP $(COPT)\n-ARJCRYPT_COPT = $(DLL_CFLAGS) $(COPT)\n+ARJCRYPT_COPT = $(COPT) $(DLL_CFLAGS)\n SFXSTUB_COPT = -DSFXSTUB $(COPT)\n \n # Linkage\n--- a/gnu/configure.in\n+++ b/gnu/configure.in\n@@ -52,6 +52,8 @@ case $host_os in\n gnu*|linux*|k*bsd*)\n \tAC_DEFINE(ELF_EXECUTABLES, 1, [Define if executables use ELF format])\n         DYN_LIBS=\"-ldl\"\n+\tDLL_FLAGS=\"-shared -fPIC\"\n+\tDLL_CFLAGS=\"-fPIC\"\n         LD_STRIP=\"gnu/stripgcc.lnk\"\n \t;;\n *bsd*)\n"
  },
  {
    "path": "packages/arj/gnu_build_strip.patch",
    "content": "Description: Support nostrip build option.\n By changing the upstrem build system to optionally strip the binaries\n after the linking stage and before their preprocessing.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/436473\nForwarded: no\nLast-Update: 2013-05-10\n\n---\n gnu/makefile.in |   18 ++++++++++++++++--\n 1 file changed, 16 insertions(+), 2 deletions(-)\n\n--- a/gnu/makefile.in\n+++ b/gnu/makefile.in\n@@ -50,10 +50,15 @@ endif\n \n ifdef DEBUG\n DEBUG_SM = d\n-ALL_CFLAGS += -g -DDEBUG\n+ALL_CFLAGS += -DDEBUG\n else\n DEBUG_SM = r\n-ADD_LDFLAGS = -s @LD_STRIP@\n+endif\n+\n+ifdef BUILD_STRIP\n+STRIP = strip --strip-unneeded --remove-section=.comment --remove-section=.note\n+else\n+STRIP = :\n endif\n \n ALL_CFLAGS += @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS)\n@@ -269,6 +274,7 @@ ARJCRYPT_OBJS = $(patsubst %,$(ARJCRYPT_\n \n $(ARJCRYPT_DIR)/arjcrypt$d: $(ARJCRYPT_OBJS) $(TOOLS_DIR)/postproc$x\n \t$(CC) $(ALL_CFLAGS) $(DLL_FLAGS) -o $@ $(ARJCRYPT_OBJS) $(ARJCRYPT_DEF) $(LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/postproc $@\n \n $(BASEDIR)/nmsg_crp.c $(BASEDIR)/msg_crp.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n@@ -283,6 +289,7 @@ SFXSTUB_OBJS = $(patsubst %,$(SFXSTUB_DI\n \n $(SFXSTUB_DIR)/sfxstub$x: $(SFXSTUB_OBJS) $(TOOLS_DIR)/postproc$x\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(SFXSTUB_OBJS) $(LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n $(BASEDIR)/nmsg_stb.c $(BASEDIR)/msg_stb.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n@@ -301,6 +308,7 @@ ARJSFXV_OBJS = $(patsubst %,$(ARJSFXV_DI\n \n $(ARJSFXV_DIR)/arjsfxv$x: $(ARJSFXV_OBJS) $(TOOLS_DIR)/postproc$x\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXV_OBJS) $(LIBS) $(DYN_LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n $(BASEDIR)/fmsg_sfv.c $(BASEDIR)/imsg_sfv.c $(BASEDIR)/nmsg_sfv.c \\\n@@ -319,6 +327,7 @@ ARJSFX_OBJS = $(patsubst %,$(ARJSFX_DIR)\n \n $(ARJSFX_DIR)/arjsfx$x: $(ARJSFX_OBJS) $(TOOLS_DIR)/postproc$x\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFX_OBJS) $(LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n $(BASEDIR)/fmsg_sfx.c $(BASEDIR)/imsg_sfx.c $(BASEDIR)/nmsg_sfx.c \\\n@@ -335,6 +344,7 @@ ARJSFXJR_OBJS = $(patsubst %,$(ARJSFXJR_\n \n $(ARJSFXJR_DIR)/arjsfxjr$x: $(ARJSFXJR_OBJS) $(TOOLS_DIR)/postproc$x\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJSFXJR_OBJS) $(LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/postproc$x $@ -sfx\n \n $(BASEDIR)/fmsg_sfj.c $(BASEDIR)/imsg_sfj.c $(BASEDIR)/nmsg_sfj.c \\\n@@ -364,6 +374,7 @@ $(ARJ_DIR)/arj$x: $(ARJ_OBJS) \\\n \t\t  $(ARJSFX_DIR)/arjsfx$x \\\n \t\t  $(ARJSFXJR_DIR)/arjsfxjr$x\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJ_OBJS) $(LIBS) $(DYN_LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFXJR_DIR)/arjsfxjr$x\n \t$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFX_DIR)/arjsfx$x\n \t$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFXV_DIR)/arjsfxv$x\n@@ -390,6 +401,7 @@ REARJ_OBJS = $(patsubst %,$(REARJ_DIR)/%\n $(REARJ_DIR)/rearj$x: $(REARJ_OBJS) \\\n \t\t      $(TOOLS_DIR)/postproc$x\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REARJ_OBJS) $(LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/postproc $@\n \n $(BASEDIR)/fmsg_rej.c $(BASEDIR)/imsg_rej.c $(BASEDIR)/nmsg_rej.c \\\n@@ -407,6 +419,7 @@ REGISTER_OBJS = $(patsubst %,$(REGISTER_\n $(REGISTER_DIR)/$(REGISTER)$x: $(REGISTER_OBJS) \\\n \t\t            $(TOOLS_DIR)/postproc$x\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(REGISTER_OBJS) $(LIBS)\n+\t$(STRIP) $@\n \t$(TOOLS_DIR)/postproc $@ -sfx\n \n $(BASEDIR)/fmsg_reg.c $(BASEDIR)/imsg_reg.c $(BASEDIR)/nmsg_reg.c \\\n@@ -423,6 +436,7 @@ ARJDISP_OBJS = $(patsubst %,$(ARJDISP_DI\n \n $(ARJDISP_DIR)/arjdisp$x: $(ARJDISP_OBJS)\n \t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(ARJDISP_OBJS) $(LIBS)\n+\t$(STRIP) $@\n \n $(BASEDIR)/fmsg_adi.c $(BASEDIR)/imsg_adi.c $(BASEDIR)/nmsg_adi.c \\\n $(BASEDIR)/msg_adi.h: $(TOOLS_DIR)/msgbind$x $(RESFILE)\n"
  },
  {
    "path": "packages/arj/hurd_no_fcntl_getlk.patch",
    "content": "Description: Fix build failure on GNU/Hurd, by handling unimplemented\n fcntl(F_GETLK). The Hurd does not implement yet fcntl(F_GETLK) and\n returns ENOSYS, handle this as a non-fatal error.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2013-05-10\n\n---\n environ.c |    3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\n--- a/environ.c\n+++ b/environ.c\n@@ -1775,7 +1775,8 @@ int file_test_access(char *name)\n   memset(&flk, 0, sizeof(flk));\n   rc=fcntl(handle, F_GETLK, &flk);\n   close(handle);\n-  return(((rc==-1&&errno!=EINVAL)||(rc!=1&&flk.l_type==F_RDLCK))?-1:0);\n+  return(((rc==-1&&errno!=EINVAL&&errno!=ENOSYS)||\n+          (rc!=1&&flk.l_type==F_RDLCK))?-1:0);\n  #endif\n }\n #endif\n"
  },
  {
    "path": "packages/arj/integr.patch",
    "content": "Declare arj_integrity_identifier as global.\n\nWithout this it's not added to resulting binary\nand we need it.\n\n--- src-orig/integr.c\t2017-09-08 21:45:38.422802558 +0200\n+++ src/integr.c\t2017-09-08 22:25:22.853785365 +0200\n@@ -5,7 +5,7 @@\n  *\n  */\n \n-static volatile const char intergrity_identifier[] = {\n+volatile const char arj_intergrity_identifier[] = {\n \t0xB0, 0x03, 0xB0, 0x02, 0xB0, 0x03,\n \t0xB0, 0x04, 0xB0, 0x05,\n \t0x90, 0x90, 0x90, 0x90,\n"
  },
  {
    "path": "packages/arj/mode.patch",
    "content": "Fix mode consts.\n\nUse modern consts present on modern Android.\n\n--- src-orig/arjsfxjr.c\t2017-09-08 21:45:38.418802563 +0200\n+++ src/arjsfxjr.c\t2017-09-08 22:12:14.130184907 +0200\n@@ -520,7 +520,7 @@\n    }\n   }\n   create_subdir_tree(filename);\n-  if(file_type!=ARJT_DIR&&(atstream=open(filename, O_CREAT|O_TRUNC|O_BINARY|O_RDWR, S_IREAD|S_IWRITE))<0)\n+  if(file_type!=ARJT_DIR&&(atstream=open(filename, O_CREAT|O_TRUNC|O_BINARY|O_RDWR, S_IRUSR|S_IWUSR))<0)\n   {\n    skip_file(M_CANTOPEN_F);\n    errors++;\n"
  },
  {
    "path": "packages/arj/out-of-bounds-read.patch",
    "content": "Description: Fix out-of-bounds read\n We need to handle possible overflows, by using an int instead of a short,\n and terminating if after computing the index it is out-of-bounds.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/783948\nForwarded: no\nLast-Update: 2015-07-01\n\n---\n\n--- arj-3.10.22.orig/decode.c\n+++ arj-3.10.22/decode.c\n@@ -416,10 +416,10 @@ static void NEAR decode_end()\n \n void decode(int action)\n {\n- short i;\n- short r;\n- short c;\n- static short j;\n+ int i;\n+ int r;\n+ int c;\n+ static int j;\n \n  #if SFX_LEVEL>=ARJSFXV\n  if(!setjmp(decode_proc))\n@@ -450,9 +450,12 @@ void decode(int action)\n    {\n     j=c-(UCHAR_MAX+1-THRESHOLD);\n     count-=(unsigned long)j;\n-    i=r-decode_p()-1;\n+    int P = decode_p();\n+    i=r-P-1;\n     if(i<0)\n      i+=DICSIZ;\n+    if(i<0)\n+      goto termination;\n     if(r>i&&r<DICSIZ-MAXMATCH-1)\n     {\n      while(--j>=0)\n"
  },
  {
    "path": "packages/arj/security-afl.patch",
    "content": "Description: Fix buffer overflow causing an invalid pointer free().\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/774015\nForwarded: no\nLast-Update: 2015-02-26\n\n---\n decode.c |    6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\n--- a/decode.c\n+++ b/decode.c\n@@ -255,7 +255,7 @@ void read_pt_len(int nn, int nbit, int i\n    if(i==i_special)\n    {\n     c=getbits(2);\n-    while(--c>=0)\n+    while(--c>=0&&i<nn)\n      pt_len[i++]=0;\n    }\n   }\n@@ -314,10 +314,10 @@ void read_c_len()\n      c=getbits(CBIT);\n      c+=20;\n     }\n-    while(--c>=0)\n+    while(--c>=0&&i<NC)\n      c_len[i++]=0;\n    }\n-   else\n+   else if (i<NC)\n     c_len[i++]=(unsigned char)(c-2);\n   }\n   while(i<NC)\n"
  },
  {
    "path": "packages/arj/security-traversal-dir.patch",
    "content": "Description: Fix absolute path traversals.\n Catch multiple leading slashes when checking for absolute path traversals.\n .\n Fixes CVE-2015-0557.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/774435\nForwarded: no\nLast-Update: 2015-02-26\n\n---\n environ.c |    3 +++\n 1 file changed, 3 insertions(+)\n\n--- a/environ.c\n+++ b/environ.c\n@@ -1087,6 +1087,8 @@ static char *validate_path(char *name)\n   if(action!=VALIDATE_DRIVESPEC)\n   {\n #endif\n+   while (name[0]!='\\0'&&\n+          (name[0]=='.'||name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX)) {\n    if(name[0]=='.')\n    {\n     if(name[1]=='.'&&(name[2]==PATHSEP_DEFAULT||name[2]==PATHSEP_UNIX))\n@@ -1096,6 +1098,7 @@ static char *validate_path(char *name)\n    }\n    if(name[0]==PATHSEP_DEFAULT||name[0]==PATHSEP_UNIX)\n     name++;                             /* \"\\\\\" - revert to root */\n+   }\n #if SFX_LEVEL>=ARJSFXV\n   }\n  }\n"
  },
  {
    "path": "packages/arj/security-traversal-symlink.patch",
    "content": "Description: Fix symlink directory traversal.\n Do not allow symlinks that traverse the current directoru, nor absolute\n symlinks.\n .\n Fixes CVE-2015-0556.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nBug-Debian: https://bugs.debian.org/774434\nForwarded: no\nLast-Update: 2015-03-28\n\n---\n uxspec.c |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 54 insertions(+)\n\n--- a/uxspec.c\n+++ b/uxspec.c\n@@ -120,6 +120,58 @@ int query_uxspecial(char FAR **dest, cha\n }\n #endif\n \n+#if TARGET==UNIX\n+static int is_link_traversal(const char *name)\n+{\n+  enum {\n+    STATE_NONE,\n+    STATE_DOTS,\n+    STATE_NAME,\n+  } state = STATE_NONE;\n+  int ndir = 0;\n+  int dots = 0;\n+\n+  while(*name) {\n+    int c = *name++;\n+\n+    if (c == '/')\n+    {\n+      if ((state == STATE_DOTS) && (dots == 2))\n+        ndir--;\n+      if (ndir < 0)\n+        return 1;\n+      if ((state == STATE_DOTS && dots == 1) && ndir == 0)\n+        return 1;\n+      if (state == STATE_NONE && ndir == 0)\n+        return 1;\n+      if ((state == STATE_DOTS) && (dots > 2))\n+        ndir++;\n+      state = STATE_NONE;\n+      dots = 0;\n+    }\n+    else if (c == '.')\n+    {\n+      if (state == STATE_NONE)\n+        state = STATE_DOTS;\n+      dots++;\n+    }\n+    else\n+    {\n+      if (state == STATE_NONE)\n+        ndir++;\n+      state = STATE_NAME;\n+    }\n+  }\n+\n+  if ((state == STATE_DOTS) && (dots == 2))\n+    ndir--;\n+  if ((state == STATE_DOTS) && (dots > 2))\n+    ndir++;\n+\n+  return ndir < 0;\n+}\n+#endif\n+\n /* Restores the UNIX special file data */\n \n int set_uxspecial(char FAR *storage, char *name)\n@@ -156,6 +208,8 @@ int set_uxspecial(char FAR *storage, cha\n      l=sizeof(tmp_name)-1;\n     far_memmove((char FAR *)tmp_name, dptr, l);\n     tmp_name[l]='\\0';\n+    if (is_link_traversal(tmp_name))\n+      return(UXSPEC_RC_ERROR);\n     rc=(id==UXSB_HLNK)?link(tmp_name, name):symlink(tmp_name, name);\n     if(!rc)\n      return(0);\n"
  },
  {
    "path": "packages/arj/security_format.patch",
    "content": "Description: Fix format security errors.\nAuthor: Guillem Jover <guillem@debian.org>\nOrigin: vendor\nForwarded: no\nLast-Update: 2013-05-09\n\n---\n arj_arcv.c |   12 ++++++------\n arj_user.c |    8 ++++----\n arjdisp.c  |   58 ++++++++++++++++++++++++++++------------------------------\n arjsfx.c   |    2 +-\n fardata.c  |   10 +++++-----\n rearj.c    |    2 +-\n register.c |    2 +-\n 7 files changed, 46 insertions(+), 48 deletions(-)\n\n--- a/fardata.c\n+++ b/fardata.c\n@@ -52,7 +52,7 @@ int error_proc(FMSG *errmsg, ...)\n   /* Check if the message could have a standard error code */\n   if(errno!=0&&is_std_error(errmsg))\n   {\n-   msg_cprintf(0, lf);\n+   msg_cprintf(0, \"\\n\");\n    error_report();\n   }\n  #endif\n@@ -379,10 +379,10 @@ static void flush_cbuf(int ccode, char *\n     {\n      #if SFX_LEVEL>=ARJSFXV\n       fprintf(new_stdout, strform, n_text);\n-      fprintf(new_stdout, lf);\n+      fprintf(new_stdout, \"\\n\");\n      #else\n       printf(strform, n_text);\n-      printf(lf);\n+      printf(\"\\n\");\n      #endif\n     }\n     else\n@@ -393,13 +393,13 @@ static void flush_cbuf(int ccode, char *\n      #ifdef NEED_CRLF\n       scr_out(\"\\r\");\n      #endif\n-     scr_out(lf);\n+     scr_out(\"\\n\");\n     }\n     if(!no_colors)\n      textcolor(color_table[ccode&H_COLORMASK].color);\n    #else\n     printf(strform, n_text);\n-    printf(lf);\n+    printf(\"\\n\");\n    #endif\n    n_text=t_text+1;\n    #if SFX_LEVEL>=ARJ\n--- a/arj_user.c\n+++ b/arj_user.c\n@@ -1059,7 +1059,7 @@ static void finish_processing(int cmd)\n      if(recover_file(tmp_archive_name, nullstr, tmp_tmp_filename, protected, eof_pos))\n      {\n       msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name);\n-      printf(lf);\n+      printf(\"\\n\");\n      }\n      else\n      {\n@@ -1294,7 +1294,7 @@ static void finish_processing(int cmd)\n    if(recover_file(archive_name, nullstr, nullstr, protected, eof_pos))\n    {\n     msg_cprintf(H_HL, M_CANT_FIND_DAMAGE, archive_name);\n-    printf(lf);\n+    printf(\"\\n\");\n    }\n    else\n    {\n@@ -1327,7 +1327,7 @@ static void finish_processing(int cmd)\n     msg_cprintf(0, M_CHAPTERS_ON);\n    else if(chapter_mode==CHAP_REMOVE)\n     msg_cprintf(0, M_CHAPTERS_OFF);\n-   msg_cprintf(0, strform, lf);\n+   msg_cprintf(0, strform, \"\\n\");\n   }\n   if(cmd==ARJ_CMD_COPY&&protfile_option&&!arjprot_tail)\n    msg_cprintf(0, M_ARJPROT_DISABLED);\n@@ -2303,7 +2303,7 @@ void process_archive()\n   timestamp_to_str(timetext, &ftime_stamp);\n   msg_cprintf(H_HL|H_NFMT, M_ARCHIVE_CREATED, timetext);\n   if(show_ansi_comments)\n-   printf(cmt_ptr);\n+   fputs(cmt_ptr, stdout);\n   else\n    display_comment(cmt_ptr);\n   /* The sfx_setup() occurs here */\n--- a/arj_arcv.c\n+++ b/arj_arcv.c\n@@ -913,13 +913,13 @@ int supply_comment(char *cmtname, char *\n     else\n     {\n      strcat(tmp_comment, tmp_cmtline);\n-     strcat(tmp_comment, lf);\n+     strcat(tmp_comment, \"\\n\");\n     }\n    }\n    else\n    {\n     strcat(tmp_comment, tmp_cmtline);\n-    strcat(tmp_comment, lf);\n+    strcat(tmp_comment, \"\\n\");\n    }\n   }\n  }\n@@ -1846,7 +1846,7 @@ int pack_file(int is_update, int is_repl\n    raw_eh=eh_lookup(eh, UXSPECIAL_ID)->raw;\n    uxspecial_stats(raw_eh, UXSTATS_SHORT);\n   }\n-  msg_cprintf(0, lf);\n+  msg_cprintf(0, \"\\n\");\n  }\n  if(err_id==0&&user_wants_fail)\n  {\n@@ -2523,9 +2523,9 @@ int unpack_validation()\n    {\n     msg_cprintf(0, (FMSG *)strform, misc_buf);\n     if(search_mode==SEARCH_DEFAULT)\n-     msg_cprintf(0, (FMSG *)lf);\n+     msg_cprintf(0, \"\\n\");\n     if(search_mode==SEARCH_BRIEF)\n-     msg_cprintf(0, (FMSG *)cr);\n+     msg_cprintf(0, \"\\r\");\n    }\n    for(pattern=0; pattern<SEARCH_STR_MAX; search_occurences[pattern++]=0);\n    reserve_size=0;\n@@ -3652,7 +3652,7 @@ void archive_cleanup()\n  {\n   if(msg_fprintf(idxstream, M_TESTING, archive_name)<0)\n    error(M_DISK_FULL);\n-  if(fprintf(idxstream, lf)<0)\n+  if(fprintf(idxstream, \"\\n\")<0)\n    error(M_DISK_FULL);\n  }\n  cmd_verb=ARJ_CMD_TEST;\n--- a/arjsfx.c\n+++ b/arjsfx.c\n@@ -214,7 +214,7 @@ static void final_cleanup(void)\n   freopen(dev_con, m_w, stdout);\n  #if SFX_LEVEL>=ARJSFXV\n   if(ferror(stdout))\n-   msg_fprintf(stderr, M_DISK_FULL);\n+   msg_fprintf(stderr, \"Can't write file. Disk full?\");\n   if(debug_enabled&&strchr(debug_opt, 't')!=NULL)\n   {\n    ticks=get_ticks()-ticks;\n--- a/rearj.c\n+++ b/rearj.c\n@@ -935,7 +935,7 @@ static int convert_archive(char *name)\n  msg_cprintf(H_HL|H_NFMT, M_OLD_SIZE, old_fsize);\n  msg_cprintf(H_HL|H_NFMT, M_NEW_SIZE, new_fsize);\n  msg_cprintf(H_HL|H_NFMT, M_SAVINGS_SIZE, gain);\n- printf(lf);\n+ printf(\"\\n\");\n  total_old_fsize+=old_fsize;\n  total_new_fsize+=new_fsize;\n  total_files++;\n--- a/register.c\n+++ b/register.c\n@@ -205,7 +205,7 @@ int main(int argc, char **argv)\n  char reg_source[200];\n  int i;\n \n- printf(M_REGISTER_BANNER);\n+ fputs(M_REGISTER_BANNER, stdout);\n  integrity_pattern[0]--;\n  build_crc32_table();\n  if(argc!=2)\n--- a/arjdisp.c\n+++ b/arjdisp.c\n@@ -20,8 +20,6 @@ static long bytes;\n static long compsize;\n static char cmd_verb;\n static char msg_lf[]=\"\\n\";\n-char strform[]=\"%s\";                    /* Export it for scrnio.c, too\n-                                           (a byte saved is a byte gained) */\n \n /* Pseudographical controls */\n \n@@ -54,19 +52,19 @@ static void show_init_scrn()\n  textcolor(7);\n  clrscr();\n  gotoxy(2, 2);\n- scrprintf(win_top);\n+ fputs(win_top, stdout);\n  for(i=3; i<24; i++)\n  {\n-  gotoxy(2, i); scrprintf(win_border);\n-  gotoxy(79, i); scrprintf(win_border);\n+  gotoxy(2, i); fputs(win_border, stdout);\n+  gotoxy(79, i); fputs(win_border, stdout);\n  }\n- gotoxy(2, 24); scrprintf(win_bottom);\n+ gotoxy(2, 24); fputs(win_bottom, stdout);\n  gotoxy(10, 5);\n- scrprintf(M_ARJDISP_COPYRIGHT);\n+ fputs(M_ARJDISP_COPYRIGHT, stdout);\n  gotoxy(10, 6);\n- scrprintf(M_ARJDISP_DISTRIBUTION);\n+ fputs(M_ARJDISP_DISTRIBUTION, stdout);\n  gotoxy(10, 7);\n- scrprintf(M_ARJDISP_LICENSE);\n+ fputs(M_ARJDISP_LICENSE, stdout);\n  gotoxy(16, 10);\n  scrprintf(M_PROCESSING_ARCHIVE, archive_name);\n  t=strtok(M_ARJDISP_INFO, msg_lf);\n@@ -74,11 +72,11 @@ static void show_init_scrn()\n  while(t!=NULL&&i<=23)\n  {\n   gotoxy(10, i++);\n-  scrprintf(strform, t);\n+  scrprintf(\"%s\", t);\n   t=strtok(NULL, msg_lf);\n  }\n  gotoxy(16, 20);\n- scrprintf(M_PRESS_ANY_KEY);\n+ fputs(M_PRESS_ANY_KEY, stdout);\n  uni_getch();\n  gotoxy(1, 24);\n }\n@@ -96,19 +94,19 @@ static void show_proc_scrn()\n  {\n   clrscr();\n   gotoxy(2, 2);\n-  scrprintf(win_top);\n+  fputs(win_top, stdout);\n   for(i=3; i<24; i++)\n   {\n-   gotoxy(2, i); scrprintf(win_border);\n-   gotoxy(79, i); scrprintf(win_border);\n+   gotoxy(2, i); fputs(win_border, stdout);\n+   gotoxy(79, i); fputs(win_border, stdout);\n   }\n-  gotoxy(2, 24); scrprintf(win_bottom);\n+  gotoxy(2, 24); fputs(win_bottom, stdout);\n   gotoxy(10, 5);\n-  scrprintf(M_ARJDISP_COPYRIGHT);\n+  fputs(M_ARJDISP_COPYRIGHT, stdout);\n   gotoxy(10, 6);\n-  scrprintf(M_ARJDISP_DISTRIBUTION);\n+  fputs(M_ARJDISP_DISTRIBUTION, stdout);\n   gotoxy(10, 7);\n-  scrprintf(M_ARJDISP_LICENSE);\n+  fputs(M_ARJDISP_LICENSE, stdout);\n   gotoxy(16, 10);\n   scrprintf(M_PROCESSING_ARCHIVE, archive_name);\n   gotoxy(16, 12);\n@@ -132,13 +130,13 @@ static void show_proc_scrn()\n     break;\n   }\n   gotoxy(15, 14);\n-  scrprintf(ind_top);\n+  fputs(ind_top, stdout);\n   gotoxy(15, 15);\n-  scrprintf(ind_middle);\n+  fputs(ind_middle, stdout);\n   gotoxy(15, 16);\n-  scrprintf(ind_bottom);\n+  fputs(ind_bottom, stdout);\n   gotoxy(16, 18);\n-  scrprintf(M_ARJDISP_CTR_START);\n+  fputs(M_ARJDISP_CTR_START, stdout);\n  }\n  else\n  {\n@@ -146,7 +144,7 @@ static void show_proc_scrn()\n   gotoxy(16, 15);\n   memset(progress, indo, i);\n   progress[i]='\\0';\n-  scrprintf(progress);\n+  fputs(progress, stdout);\n   gotoxy(16, 18);\n   scrprintf(M_ARJDISP_CTR, calc_percentage(bytes, uncompsize)/10);\n  }\n@@ -165,19 +163,19 @@ static void show_ending_scrn()\n  textcolor(7);\n  clrscr();\n  gotoxy(2, 2);\n- scrprintf(win_top);\n+ fputs(win_top, stdout);\n  for(i=3; i<24; i++)\n  {\n-  gotoxy(2, i); scrprintf(win_border);\n-  gotoxy(79, i); scrprintf(win_border);\n+  gotoxy(2, i); fputs(win_border, stdout);\n+  gotoxy(79, i); fputs(win_border, stdout);\n  }\n- gotoxy(2, 24); scrprintf(win_bottom);\n+ gotoxy(2, 24); fputs(win_bottom, stdout);\n  gotoxy(10, 5);\n- scrprintf(M_ARJDISP_COPYRIGHT);\n+ fputs(M_ARJDISP_COPYRIGHT, stdout);\n  gotoxy(10, 6);\n- scrprintf(M_ARJDISP_DISTRIBUTION);\n+ fputs(M_ARJDISP_DISTRIBUTION, stdout);\n  gotoxy(10, 7);\n- scrprintf(M_ARJDISP_LICENSE);\n+ fputs(M_ARJDISP_LICENSE, stdout);\n  gotoxy(16, 10);\n  scrprintf(M_FINISHED_PROCESSING, archive_name);\n  gotoxy(1, 24);\n"
  },
  {
    "path": "packages/arj/self_integrity_64bit.patch",
    "content": "Description: Fix arj self-integrity check on 64-bit systems\nAuthor: B Watson <yalhcru@gmail.com>\nOrigin: other, http://slackbuilds.org/cgit/slackbuilds/tree/system/arj/patches/SBo_integrity_64bit.patch\nForwarded: no\nReviewed-By: Guillem Jover <guillem@debian.org>\nLast-Update: 2014-08-06\n\ndiff -Naur arj-3.10.22/arj_proc.c arj-3.10.22.patched/arj_proc.c\n--- arj-3.10.22/arj_proc.c\t2005-06-21 15:53:12.000000000 -0400\n+++ arj-3.10.22.patched/arj_proc.c\t2014-08-06 04:11:35.000000000 -0400\n@@ -7,6 +7,7 @@\n  *\n  */\n \n+#include <stdint.h>\n #include \"arj.h\"\n \n DEBUGHDR(__FILE__)                      /* Debug information block */\n@@ -929,9 +930,9 @@\n  #endif\n  fclose(stream);\n  #if SFX_LEVEL>=ARJSFXV\n-  return(crc32term==st_crc&&fsize==st_fsize);\n+  return((uint32_t)crc32term==(uint32_t)st_crc&&(uint32_t)fsize==(uint32_t)st_fsize);\n  #else\n-  if(crc32term==st_crc&&fsize==st_fsize)\n+  if((uint32_t)crc32term==(uint32_t)st_crc&&(uint32_t)fsize==(uint32_t)st_fsize)\n    msg_cprintf(0, M_INTEGRITY_OK);\n   else\n    pause_error(M_INTEGRITY_VIOLATED);\ndiff -Naur arj-3.10.22/postproc.c arj-3.10.22.patched/postproc.c\n--- arj-3.10.22/postproc.c\t2003-06-22 07:12:28.000000000 -0400\n+++ arj-3.10.22.patched/postproc.c\t2014-08-06 03:22:16.000000000 -0400\n@@ -6,6 +6,7 @@\n  *\n  */\n \n+#include <stdint.h>\n #include \"arj.h\"\n \n /* Operations */\n@@ -37,8 +38,9 @@\n \n static char buf[PROC_BLOCK_SIZE];\n \n-static void _fput_dword(const unsigned long l, FILE *stream)\n+static void _fput_dword(const unsigned long w, FILE *stream)\n {\n+ uint32_t l = (uint32_t)w;\n #ifdef WORDS_BIGENDIAN\n  fputc(l    ,stream);\n  fputc(l>>8 ,stream);\n"
  },
  {
    "path": "packages/arj/z_cross_compile.patch",
    "content": "Make arj cross-compileable.\n\narj assumes that build and host are the same.\nFix those assumptions.\n\ndiff '--exclude=config.status' '--exclude=configure' '--exclude=*autom4te*' '--exclude=config.log' '--exclude=*~' -ur src-orig/gnu/configure.in src/gnu/configure.in\n--- src-orig/gnu/configure.in\t2017-09-08 21:45:38.474802486 +0200\n+++ src/gnu/configure.in\t2017-09-08 23:09:57.990014311 +0200\n@@ -15,11 +15,15 @@\n AC_CONFIG_HEADER([../c_defs.h:config.h.in])\n \n dnl Checks for the canonical system name\n+AC_CANONICAL_BUILD\n AC_CANONICAL_HOST\n \n dnl Checks for programs.\n AC_PROG_CC\n \n+AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc clang])\n+test -z \"$BUILD_CC\" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])\n+\n dnl Checks for header files.\n AC_HEADER_STDC\n AC_CHECK_HEADERS([fcntl.h limits.h malloc.h])\n@@ -196,6 +200,7 @@\n AC_SUBST(LD_STRIP)\n AC_SUBST(REGISTER)\n AC_SUBST(TOLERANT_FNMATCH)\n+AC_SUBST(BUILD_CC)\n \n AC_CONFIG_FILES([../GNUmakefile:makefile.in])\n AC_OUTPUT\ndiff '--exclude=config.status' '--exclude=configure' '--exclude=*autom4te*' '--exclude=config.log' '--exclude=*~' -ur src-orig/gnu/makefile.in src/gnu/makefile.in\n--- src-orig/gnu/makefile.in\t2017-09-08 21:45:38.474802486 +0200\n+++ src/gnu/makefile.in\t2017-09-08 23:17:01.790798189 +0200\n@@ -14,6 +14,8 @@\n LIBS = @LIBS@\n REGISTER = @REGISTER@\n \n+BUILD_CC = @BUILD_CC@\n+\n # Programs\n \n INSTALL = @INSTALL@\n@@ -40,17 +42,21 @@\n \n ALL_CFLAGS = -DLOCALE=LANG_$(LOCALE) -DLOCALE_DESC=\"\\\"$(LOCALE)\\\"\" \\\n \t     -DPKGLIBDIR=\"\\\"$(pkglibdir)\\\"\" @OS_DEF@\n+BUILD_ALL_CFLAGS = -DLOCALE=LANG_$(LOCALE) -DLOCALE_DESC=\"\\\"$(LOCALE)\\\"\" \\\n+\t     -DPKGLIBDIR=\"\\\"$(pkglibdir)\\\"\" @OS_DEF@\n \n ifndef COMMERCIAL\n PACKAGE = s\n else\n PACKAGE = c\n ALL_CFLAGS += -DCOMMERCIAL\n+BUILD_ALL_CFLAGS += -DCOMMERCIAL\n endif\n \n ifdef DEBUG\n DEBUG_SM = d\n ALL_CFLAGS += -DDEBUG\n+BUILD_ALL_CFLAGS += -DDEBUG\n else\n DEBUG_SM = r\n endif\n@@ -62,6 +68,7 @@\n endif\n \n ALL_CFLAGS += @CPPFLAGS@ $(CPPFLAGS) @CFLAGS@ $(CFLAGS)\n+BUILD_ALL_CFLAGS += $(BUILD_CPPFLAGS) $(BUILD_CFLAGS)\n \n # Build Installation paths\n \n@@ -73,6 +80,7 @@\n \n TOOLS_DIR = $(BASEDIR)/tools\n ARJ_DIR = $(BASEDIR)/arj\n+BUILD_ARJ_DIR = $(BASEDIR)/build-arj\n ARJSFXV_DIR = $(BASEDIR)/arjsfxv\n ARJSFX_DIR = $(BASEDIR)/arjsfx\n ARJSFXJR_DIR = $(BASEDIR)/arjsfxjr\n@@ -90,8 +98,10 @@\n REQUIRES_DEF = @REQUIRES_DEF@\n \n COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) $(ALL_CFLAGS)\n-STD_COPT = -DARJUTIL $(COPT)\n+BUILD_COPT = -c -I@OUT_DIR@ -I$(BASEDIR) -I$(SRC_DIR) $(BUILD_ALL_CFLAGS)\n+BUILD_STD_COPT = -DARJUTIL $(BUILD_COPT)\n ARJ_COPT = -DSFL=4 $(COPT)\n+BUILD_ARJ_COPT = -DSFL=4 $(BUILD_COPT)\n ARJSFXV_COPT = -DSFL=3 $(COPT)\n ARJSFX_COPT = -DSFL=2 $(COPT)\n ARJSFXJR_COPT = -DSFL=1 $(COPT)\n@@ -106,6 +116,9 @@\n $(ARJ_DIR)/%.o: $(BASEDIR)/%.c\n \t$(CC) $(COPT) -o$@ $<\n \n+$(BUILD_ARJ_DIR)/%.o: $(BASEDIR)/%.c\n+\t$(BUILD_CC) -DDISABLE_ARJCRYPT=1 $(BUILD_COPT) -o$@ $<\n+\n $(ARJSFX_DIR)/%.o: $(BASEDIR)/%.c\n \t$(CC) $(COPT) -o$@ $<\n \n@@ -131,11 +144,14 @@\n \t$(CC) $(COPT) -o$@ $<\n \n $(TOOLS_DIR)/%.o: $(SRC_DIR)/%.c\n-\t$(CC) $(STD_COPT) -o$@ $<\n+\t$(BUILD_CC) $(BUILD_STD_COPT) -o$@ $<\n \n $(ARJ_DIR)/%.o: $(SRC_DIR)/%.c\n \t$(CC) $(ARJ_COPT) -o$@ $<\n \n+$(BUILD_ARJ_DIR)/%.o: $(SRC_DIR)/%.c\n+\t$(BUILD_CC) $(BUILD_ARJ_COPT)  -DDISABLE_ARJCRYPT=1 -o$@ $<\n+\n $(ARJSFXV_DIR)/%.o: $(SRC_DIR)/%.c\n \t$(CC) $(ARJSFXV_COPT) -o$@ $<\n \n@@ -235,22 +251,22 @@\n \t\tfilemode.o packager.o arjdata.o)\n \n $(TOOLS_DIR)/msgbind$x: $(MSGBIND_OBJS)\n-\t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(MSGBIND_OBJS) $(LIBS)\n+\t$(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(MSGBIND_OBJS) $(LIBS)\n \n $(TOOLS_DIR)/today$x: $(TODAY_OBJS)\n-\t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(TODAY_OBJS) $(LIBS)\n+\t$(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(TODAY_OBJS) $(LIBS)\n \n $(TOOLS_DIR)/make_key$x: $(MAKE_KEY_OBJS)\n-\t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(MAKE_KEY_OBJS) $(LIBS)\n+\t$(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(MAKE_KEY_OBJS) $(LIBS)\n \n $(TOOLS_DIR)/postproc$x: $(POSTPROC_OBJS)\n-\t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(POSTPROC_OBJS) $(LIBS)\n+\t$(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(POSTPROC_OBJS) $(LIBS)\n \n $(TOOLS_DIR)/join$x: $(JOIN_OBJS)\n-\t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JOIN_OBJS) $(LIBS)\n+\t$(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(JOIN_OBJS) $(LIBS)\n \n $(TOOLS_DIR)/packager$x: $(PACKAGER_OBJS)\n-\t$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(PACKAGER_OBJS) $(LIBS)\n+\t$(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(PACKAGER_OBJS) $(LIBS)\n \n # This rule tells that timestamping badly needs date_sig.c (it may bail out\n # otherwise when the timestamps are being created for the first time)\n@@ -355,17 +371,22 @@\n # ARJ itself\n #\n \n-ARJ_OBJS = $(patsubst %,$(ARJ_DIR)/%, \\\n-\t   filemode.o date_sig.o fmsg_arj.o imsg_arj.o \\\n+ARJ_OBJS_BASE= filemode.o date_sig.o fmsg_arj.o imsg_arj.o \\\n \t   nmsg_arj.o integr.o file_reg.o decode.o encode.o \\\n \t   arj.o enc_gwy.o fardata.o arj_user.o arj_arcv.o \\\n \t   arj_file.o crc32.o misc.o debug.o arj_proc.o \\\n \t   environ.o ea_mgr.o uxspec.o ext_hdr.o arjtypes.o exe_sear.o chk_fmsg.o \\\n \t   filelist.o arjsec_h.o arjsec_l.o garble.o scrnio.o ansi.o \\\n \t   crc16tab.o recovery.o gost.o gost40.o gost_t.o \\\n-\t   externs.o)\n+\t   externs.o\n+\n+ARJ_OBJS = $(patsubst %,$(ARJ_DIR)/%, $(ARJ_OBJS_BASE) )\n+BUILD_ARJ_OBJS = $(patsubst %,$(BUILD_ARJ_DIR)/%, $(ARJ_OBJS_BASE) )\n+\n+$(BUILD_ARJ_DIR)/arj$x: $(BUILD_ARJ_OBJS)\n+\t$(BUILD_CC) $(BUILD_ALL_CFLAGS) $(BUILD_LDFLAGS) -ldl -o $@ $(BUILD_ARJ_OBJS)\n \n-$(ARJ_DIR)/arj$x: $(ARJ_OBJS) \\\n+$(ARJ_DIR)/arj$x: $(ARJ_OBJS) $(BUILD_ARJ_DIR)/arj$x \\\n \t\t  $(RES_DIR)/$(LOCALE)/arjl.txt $(RES_DIR)/$(LOCALE)/arjs.txt \\\n \t\t  $(TOOLS_DIR)/join$x \\\n \t\t  $(TOOLS_DIR)/postproc$x \\\n@@ -380,7 +401,7 @@\n \t$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(ARJSFXV_DIR)/arjsfxv$x\n \t$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(SFXSTUB_DIR)/sfxstub$x\n \trm -f $(BASEDIR)/help.arj\n-\t$(ARJ_DIR)/arj$x a $(BASEDIR)/help.arj -+ -t1f -2e -e -jm -jh65535 -jt $(RES_DIR)/$(LOCALE)/arj?.txt\n+\t$(BUILD_ARJ_DIR)/arj$x a $(BASEDIR)/help.arj -+ -t1f -2e -e -jm -jh65535 -jt $(RES_DIR)/$(LOCALE)/arj?.txt\n \t$(TOOLS_DIR)/join $(ARJ_DIR)/arj$x $(BASEDIR)/help.arj\n \t$(TOOLS_DIR)/postproc $@\n \n@@ -455,6 +476,7 @@\n \t-mkdir -p $(ARJSFX_DIR)\n \t-mkdir -p $(ARJSFXJR_DIR)\n \t-mkdir -p $(ARJ_DIR)\n+\t-mkdir -p $(BUILD_ARJ_DIR)\n \t-mkdir -p $(REARJ_DIR)\n \t-mkdir -p $(REGISTER_DIR)\n \t-mkdir -p $(ARJDISP_DIR)\n--- src-orig/garble.c\t2004-02-21 23:53:34.000000000 +0100\n+++ src/garble.c\t2017-10-05 15:30:09.416517680 +0200\n@@ -90,6 +90,7 @@\n #if TARGET==OS2||TARGET==WIN32||TARGET==UNIX\n static void remove_arjcrypt()\n {\n+#ifndef DISABLE_ARJCRYPT\n  if(arjcrypt_loaded)\n  {\n   #if TARGET==OS2\n@@ -100,6 +101,7 @@\n    dlclose(arjcrypt_hmod);\n   #endif\n  }\n+#endif\n  arjcrypt_loaded=0;\n }\n #endif\n@@ -109,6 +109,10 @@\n \n static int arjcrypt_init(char *name)\n {\n+#ifdef DISABLE_ARJCRYPT\n+  fputs(\"arjcrypt is disabled\", new_stdout);\n+  error(M_ARJCRYPT_ERROR);\n+#else\n  FILE *stream;\n  int arjcrypt_size;                     /* Size of ARJCRYPT module */\n  char *tmp_cryptmem;                    /* Temporary storage for ARJCRYPT */\n@@ -186,6 +190,7 @@\n   if((arjcrypt_entry=dlsym(arjcrypt_hmod, \"entry\"))==NULL)\n    error(M_NO_ARJCRYPT_ENTRY);\n  #endif\n+#endif\n  return(0);\n }\n \n"
  },
  {
    "path": "packages/asciidoc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://asciidoc.org\nTERMUX_PKG_DESCRIPTION=\"Text document format for short documents, articles, books and UNIX man pages.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=8.6.10\nTERMUX_PKG_SRCURL=https://github.com/asciidoc/asciidoc/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=9e52f8578d891beaef25730a92a6e723596ddbd07bfe0d2a56486fcf63a0b983\nTERMUX_PKG_DEPENDS=\"docbook-xsl, python2, xsltproc\"\nTERMUX_PKG_SUGGESTS=\"lynx, w3m\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tsed -i -e 's#python a2x.py#python2 a2x.py#' Makefile.in\n\tautoreconf -vfi\n}\n\ntermux_step_post_make_install() {\n\tmake docs\n\tinstall -Dm644 asciidocapi.py \\\n\t\t$TERMUX_PREFIX/lib/python2.7/site-packages/asciidocapi.py\n}\n"
  },
  {
    "path": "packages/asciinema/asciinema-__main__.py.patch",
    "content": "diff -u -r ../asciinema-2.0.2/asciinema/__main__.py ./asciinema/__main__.py\n--- ../asciinema-2.0.2/asciinema/__main__.py\t2019-01-12 18:58:29.000000000 +0000\n+++ ./asciinema/__main__.py\t2019-01-16 21:07:50.834574609 +0000\n@@ -50,10 +50,6 @@\n \n \n def main():\n-    if locale.nl_langinfo(locale.CODESET).upper() not in ['US-ASCII', 'UTF-8']:\n-        print(\"asciinema needs an ASCII or UTF-8 character encoding to run. Check the output of `locale` command.\")\n-        sys.exit(1)\n-\n     try:\n         cfg = config.load()\n     except config.ConfigError as e:\n"
  },
  {
    "path": "packages/asciinema/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://asciinema.org/\nTERMUX_PKG_DESCRIPTION=\"Record and share your terminal sessions, the right way\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.0.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=2578a1b5611e5375771ef6582a6533ef8d40cdbed1ba1c87786fd23af625ab68\nTERMUX_PKG_SRCURL=https://github.com/asciinema/asciinema/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_HAS_DEBUG=false\n# ncurses-utils for tput which asciinema uses:\nTERMUX_PKG_DEPENDS=\"python, ncurses-utils\"\n\ntermux_step_make() {\n\treturn\n}\n\ntermux_step_make_install() {\n\texport PYTHONPATH=$TERMUX_PREFIX/lib/python3.8/site-packages/\n\tpython3.8 setup.py install --prefix=$TERMUX_PREFIX --force\n}\n\ntermux_step_post_massage() {\n\tfind . -path '*/__pycache__*' -delete\n}\n"
  },
  {
    "path": "packages/assimp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://assimp.sourceforge.net/index.html\nTERMUX_PKG_DESCRIPTION=\"Library to import various well-known 3D model formats in an uniform manner\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=5.0.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/assimp/assimp/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=b0110a91650d6bb4000e3d5c2185bf77b0ff0a2e7a284bc2c4af81b33988b63c\nTERMUX_PKG_DEPENDS=\"boost, zlib\"\nTERMUX_PKG_BREAKS=\"assimp-dev\"\nTERMUX_PKG_REPLACES=\"assimp-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DASSIMP_BUILD_SAMPLES=OFF\"\n"
  },
  {
    "path": "packages/assimp/test-CMakeLists.txt.patch",
    "content": "diff -uNr assimp-4.1.0/test/CMakeLists.txt assimp-4.1.0.mod/test/CMakeLists.txt\n--- assimp-4.1.0/test/CMakeLists.txt\t2017-12-11 15:22:45.000000000 +0200\n+++ assimp-4.1.0.mod/test/CMakeLists.txt\t2019-07-01 22:47:01.990765003 +0300\n@@ -174,7 +174,7 @@\n IF( WIN32 )\n     SET( platform_libs )\n ELSE( WIN32 )\n-    SET( platform_libs pthread )\n+    SET( platform_libs )\n ENDIF( WIN32 )\n \n IF( WIN32 )\n"
  },
  {
    "path": "packages/atomicparsley/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://bitbucket.org/wez/atomicparsley\nTERMUX_PKG_DESCRIPTION=\"Read, parse and set metadata of MPEG-4 and 3gp files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.9.6\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://bitbucket.org/wez/atomicparsley/get/${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=e28d46728be86219e6ce48695ea637d831ca0170ca6bdac99810996a8291ee50\nTERMUX_PKG_DEPENDS=\"libc++, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_func_lroundf=yes\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n\n\t# Avoid the configure script from using g++ for linking:\n\texport OBJCXX=$CXX\n}\n"
  },
  {
    "path": "packages/attr/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://savannah.nongnu.org/projects/attr/\nTERMUX_PKG_DESCRIPTION=\"Utilities for manipulating filesystem extended attributes\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.4.48\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://download.savannah.gnu.org/releases/attr/attr-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=5ead72b358ec709ed00bbf7a9eaef1654baad937c001c044fe8b74c57f5324e7\nTERMUX_PKG_BREAKS=\"attr-dev\"\nTERMUX_PKG_REPLACES=\"attr-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-gettext=no\"\n# TERMUX_PKG_MAKE_INSTALL_TARGET=\"install install-lib\"\n# attr.5 man page is in linux-man-pages:\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/man/man5/attr.5\"\n"
  },
  {
    "path": "packages/attr/tools-attr.c.patch",
    "content": "diff -u -r ../attr-2.4.48/tools/attr.c ./tools/attr.c\n--- ../attr-2.4.48/tools/attr.c\t2018-01-21 05:00:44.000000000 +0000\n+++ ./tools/attr.c\t2018-06-26 03:18:34.271455876 +0000\n@@ -28,6 +28,7 @@\n #include <errno.h>\n #include <string.h>\n #include <locale.h>\n+#include <libgen.h> /* for basename(3) */\n \n #include <attr/attributes.h>\n \n"
  },
  {
    "path": "packages/attr/walk_tree.c.patch",
    "content": "diff -u -r ../attr-2.4.47/libmisc/walk_tree.c ./libmisc/walk_tree.c\n--- ../attr-2.4.47/libmisc/walk_tree.c\t2013-05-19 00:53:54.000000000 -0400\n+++ ./libmisc/walk_tree.c\t2015-12-13 14:47:30.178955536 -0500\n@@ -122,7 +122,11 @@\n close_another_dir:\n \t\t\t/* Close the topmost directory handle still open. */\n \t\t\tclosed = closed->prev;\n+#ifdef __ANDROID__\n+\t\t\tclosed->pos = -1;\n+#else\n \t\t\tclosed->pos = telldir(closed->stream);\n+#endif\n \t\t\tclosedir(closed->stream);\n \t\t\tclosed->stream = NULL;\n \t\t\tnum_dir_handles++;\n@@ -188,7 +192,9 @@\n \t\t\t\tif (!dir.stream)\n \t\t\t\t\treturn err + func(path, NULL, flags |\n \t\t\t\t\t\t    WALK_TREE_FAILED, arg);\n+#ifndef __ANDROID__\n \t\t\t\tseekdir(dir.stream, dir.pos);\n+#endif\n \n \t\t\t\tclosed = closed->next;\n \t\t\t\tnum_dir_handles--;\n"
  },
  {
    "path": "packages/autoconf/General.pm.patch",
    "content": "diff -u -r ../autoconf-2.69/lib/Autom4te/General.pm ./lib/Autom4te/General.pm\n--- ../autoconf-2.69/lib/Autom4te/General.pm\t2012-04-24 16:44:15.000000000 -0400\n+++ ./lib/Autom4te/General.pm\t2015-05-17 16:11:45.492445577 -0400\n@@ -300,7 +300,7 @@\n sub mktmpdir ($)\n {\n   my ($signature) = @_;\n-  my $TMPDIR = $ENV{'TMPDIR'} || '/tmp';\n+  my $TMPDIR = $ENV{'TMPDIR'} || '@TERMUX_PREFIX@/tmp';\n   my $quoted_tmpdir = shell_quote ($TMPDIR);\n \n   # If mktemp supports dirs, use it.\n"
  },
  {
    "path": "packages/autoconf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/autoconf/autoconf.html\nTERMUX_PKG_DESCRIPTION=\"Creator of shell scripts to configure source code packages\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.69\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/autoconf/autoconf-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684\nTERMUX_PKG_DEPENDS=\"m4, make, perl\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_post_extract_package() {\n\tperl -p -i -e \"s|/bin/sh|$TERMUX_PREFIX/bin/sh|\" lib/*/*.m4\n}\n\ntermux_step_post_massage() {\n\tperl -p -i -e \"s|/usr/bin/m4|$TERMUX_PREFIX/bin/m4|\" bin/*\n\tperl -p -i -e \"s|CONFIG_SHELL-/bin/sh|CONFIG_SHELL-$TERMUX_PREFIX/bin/sh|\" bin/autoconf\n}\n"
  },
  {
    "path": "packages/automake/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/automake/\nTERMUX_PKG_DESCRIPTION=\"Tool for automatically generating Makefile.in files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.16.1\nTERMUX_PKG_SHA256=5d05bb38a23fd3312b10aea93840feec685bdf4a41146e78882848165d3ae921\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/automake/automake-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"autoconf\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/autossh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.harding.motd.ca/autossh/\nTERMUX_PKG_DESCRIPTION=\"Automatically restart SSH sessions and tunnels\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.4g\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=83766463763364a1be56d6bf1a75b40a59302586645bf0c4fa885188cf01ebfc\nTERMUX_PKG_SRCURL=https://fossies.org/linux/privat/autossh-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"openssh | dropbear\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=$TERMUX_PREFIX/share/man ac_cv_path_ssh=$TERMUX_PREFIX/bin/ssh\"\n\ntermux_step_pre_configure() {\n\t# For syslog logging:\n\texport LIBS=\"-llog\"\n}\n"
  },
  {
    "path": "packages/axel/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/axel-download-accelerator/axel\nTERMUX_PKG_DESCRIPTION=\"light command line download accelerator\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"lokesh @hax4us\"\nTERMUX_PKG_VERSION=2.17.6\nTERMUX_PKG_SRCURL=https://github.com/axel-download-accelerator/axel/releases/download/v${TERMUX_PKG_VERSION}/axel-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=15be4803789d8a3b0aa7ea9629a21ea56ff46ea5d8b484004a00826d4ffcbd00\nTERMUX_PKG_DEPENDS=\"openssl\"\n"
  },
  {
    "path": "packages/babl/babl-meson.build.patch",
    "content": "diff -u -r ../babl-0.1.70/babl/meson.build ./babl/meson.build\n--- ../babl-0.1.70/babl/meson.build\t2019-08-02 16:16:52.000000000 +0000\n+++ ./babl/meson.build\t2019-08-08 09:55:50.648892290 +0000\n@@ -128,7 +128,7 @@\n   c_args: babl_c_args,\n   link_whole: [ babl_base, ],\n   link_args: [ babl_link_args, ],\n-  dependencies: [ math, thread, dl, lcms, ],\n+  dependencies: [ math, thread, dl, lcms, log, ],\n   link_depends: [ version_script_target, ],\n   version: so_version,\n   install: true,\n"
  },
  {
    "path": "packages/babl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://gegl.org/babl/\nTERMUX_PKG_DESCRIPTION=\"Dynamic pixel format translation library\"\nTERMUX_PKG_LICENSE=\"LGPL-3.0\"\nTERMUX_PKG_VERSION=0.1.72\nTERMUX_PKG_SRCURL=https://download.gimp.org/pub/babl/0.1/babl-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=64e111097b1fa22f6c9bf044e341a9cd9ee1372c5acfa0b452e7a86fb37c6a42\nTERMUX_PKG_DEPENDS=\"littlecms\"\nTERMUX_PKG_BREAKS=\"babl-dev\"\nTERMUX_PKG_REPLACES=\"babl-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-Denable-gir=false\"\n"
  },
  {
    "path": "packages/babl/tests-meson.build.patch",
    "content": "diff -u -r ../babl-0.1.70/tests/meson.build ./tests/meson.build\n--- ../babl-0.1.70/tests/meson.build\t2019-08-02 16:16:52.000000000 +0000\n+++ ./tests/meson.build\t2019-08-08 09:58:14.015259147 +0000\n@@ -41,7 +41,7 @@\n     test_name + '.c',\n     include_directories: [ rootInclude, bablInclude, ],\n     link_with: [ babl, ],\n-    dependencies: [ thread, ],\n+    dependencies: [ thread, log, ],\n     export_dynamic: true,\n     install: false,\n   )\n"
  },
  {
    "path": "packages/babl/tools-meson.build.patch",
    "content": "diff -u -r ../babl-0.1.70/tools/meson.build ./tools/meson.build\n--- ../babl-0.1.70/tools/meson.build\t2019-08-02 16:16:52.000000000 +0000\n+++ ./tools/meson.build\t2019-08-08 09:59:07.362648769 +0000\n@@ -17,7 +17,7 @@\n     tool_name + '.c',\n     include_directories: [ rootInclude, bablInclude, ],\n     link_with: [ babl, ],\n-    dependencies: [ math, thread, ],\n+    dependencies: [ math, thread, log, ],\n     install: false,\n   )\n \n"
  },
  {
    "path": "packages/barcode/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/barcode/\nTERMUX_PKG_DESCRIPTION=\"Tool to convert text strings to printed bars\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.99\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=http://mirrors.kernel.org/gnu/barcode/barcode-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=e87ecf6421573e17ce35879db8328617795258650831affd025fba42f155cdc6\nTERMUX_PKG_BUILD_DEPENDS=\"gettext\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -I$TERMUX_PREFIX/share/gettext\"\n}\n"
  },
  {
    "path": "packages/bash/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/bash/\nTERMUX_PKG_DESCRIPTION=\"A sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh)\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\n_MAIN_VERSION=5.0\n_PATCH_VERSION=11\nTERMUX_PKG_VERSION=${_MAIN_VERSION}.${_PATCH_VERSION}\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/bash/bash-${_MAIN_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b4a80f2ac66170b2913efbfb9f2594f1f76c7b1afd11f799e22035d63077fb4d\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv, ncurses, readline (>= 8.0), termux-tools\"\nTERMUX_PKG_RECOMMENDS=\"command-not-found\"\nTERMUX_PKG_BREAKS=\"bash-dev\"\nTERMUX_PKG_REPLACES=\"bash-dev\"\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-multibyte --without-bash-malloc --with-installed-readline\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" bash_cv_job_control_missing=present\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" bash_cv_sys_siglist=yes\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" bash_cv_func_sigsetjmp=present\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" bash_cv_unusable_rtsigs=no\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_mbsnrtowcs=no\"\n# Use bash_cv_dev_fd=whacky to use /proc/self/fd instead of /dev/fd.\n# After making this change process substitution such as in 'cat <(ls)' works.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" bash_cv_dev_fd=whacky\"\n# Bash assumes that getcwd is broken and provides a wrapper which\n# does not work when not all parent directories up to root are\n# accessible, which they are not under Android (/data). See\n# - http://permalink.gmane.org/gmane.linux.embedded.yocto.general/25204\n# - https://github.com/termux/termux-app/issues/200\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" bash_cv_getcwd_malloc=yes\"\n\nTERMUX_PKG_CONFFILES=\"etc/bash.bashrc etc/profile\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/man/man1/bashbug.1 bin/bashbug\"\n\ntermux_step_pre_configure() {\n\tdeclare -A PATCH_CHECKSUMS\n\n\tPATCH_CHECKSUMS[001]=f2fe9e1f0faddf14ab9bfa88d450a75e5d028fedafad23b88716bd657c737289\n\tPATCH_CHECKSUMS[002]=87e87d3542e598799adb3e7e01c8165bc743e136a400ed0de015845f7ff68707\n\tPATCH_CHECKSUMS[003]=4eebcdc37b13793a232c5f2f498a5fcbf7da0ecb3da2059391c096db620ec85b\n\tPATCH_CHECKSUMS[004]=14447ad832add8ecfafdce5384badd933697b559c4688d6b9e3d36ff36c62f08\n\tPATCH_CHECKSUMS[005]=5bf54dd9bd2c211d2bfb34a49e2c741f2ed5e338767e9ce9f4d41254bf9f8276\n\tPATCH_CHECKSUMS[006]=d68529a6ff201b6ff5915318ab12fc16b8a0ebb77fda3308303fcc1e13398420\n\tPATCH_CHECKSUMS[007]=17b41e7ee3673d8887dd25992417a398677533ab8827938aa41fad70df19af9b\n\tPATCH_CHECKSUMS[008]=eec64588622a82a5029b2776e218a75a3640bef4953f09d6ee1f4199670ad7e3\n\tPATCH_CHECKSUMS[009]=ed3ca21767303fc3de93934aa524c2e920787c506b601cc40a4897d4b094d903\n\tPATCH_CHECKSUMS[010]=d6fbc325f0b5dc54ddbe8ee43020bced8bd589ddffea59d128db14b2e52a8a11\n\tPATCH_CHECKSUMS[011]=2c4de332b91eaf797abbbd6c79709690b5cbd48b12e8dfe748096dbd7bf474ea\n\n\tfor PATCH_NUM in $(seq -f '%03g' ${_PATCH_VERSION}); do\n\t\tPATCHFILE=$TERMUX_PKG_CACHEDIR/bash_patch_${PATCH_NUM}.patch\n\t\ttermux_download \\\n\t\t\t\"https://mirrors.kernel.org/gnu/bash/bash-${_MAIN_VERSION}-patches/bash${_MAIN_VERSION/./}-$PATCH_NUM\" \\\n\t\t\t$PATCHFILE \\\n\t\t\t${PATCH_CHECKSUMS[$PATCH_NUM]}\n\t\tpatch -p0 -i $PATCHFILE\n\tdone\n\tunset PATCH_CHECKSUMS PATCHFILE PATCH_NUM\n}\n\ntermux_step_post_make_install() {\n\tsed -e \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|\" \\\n\t\t-e \"s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|\" \\\n\t\t$TERMUX_PKG_BUILDER_DIR/etc-profile > $TERMUX_PREFIX/etc/profile\n\n\t# /etc/bash.bashrc - System-wide .bashrc file for interactive shells. (config-top.h in bash source, patched to enable):\n\tsed -e \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|\" \\\n\t\t-e \"s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|\" \\\n\t\t$TERMUX_PKG_BUILDER_DIR/etc-bash.bashrc > $TERMUX_PREFIX/etc/bash.bashrc\n}\n"
  },
  {
    "path": "packages/bash/config-top.h.patch",
    "content": "diff -uNr bash-5.0/config-top.h bash-5.0.mod/config-top.h\n--- bash-5.0/config-top.h\t2018-10-12 22:35:23.000000000 +0300\n+++ bash-5.0.mod/config-top.h\t2019-02-20 14:15:53.266802311 +0200\n@@ -63,7 +63,7 @@\n /* The default value of the PATH variable. */\n #ifndef DEFAULT_PATH_VALUE\n #define DEFAULT_PATH_VALUE \\\n-  \"/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.\"\n+  \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:.\"\n #endif\n \n /* If you want to unconditionally set a value for PATH in every restricted\n@@ -74,7 +74,7 @@\n    the Posix.2 confstr () function, or CS_PATH define are not present. */\n #ifndef STANDARD_UTILS_PATH\n #define STANDARD_UTILS_PATH \\\n-  \"/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc\"\n+  \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets\"\n #endif\n \n /* Default primary and secondary prompt strings. */\n@@ -91,7 +91,7 @@\n #define DEFAULT_BASHRC \"~/.bashrc\"\n \n /* System-wide .bashrc file for interactive shells. */\n-/* #define SYS_BASHRC \"/etc/bash.bashrc\" */\n+#define SYS_BASHRC \"@TERMUX_PREFIX@/etc/bash.bashrc\"\n \n /* System-wide .bash_logout for login shells. */\n /* #define SYS_BASH_LOGOUT \"/etc/bash.bash_logout\" */\n"
  },
  {
    "path": "packages/bash/error.c.patch",
    "content": "diff -uNr bash-5.0/error.c bash-5.0.mod/error.c\n--- bash-5.0/error.c\t2018-10-08 22:16:07.000000000 +0300\n+++ bash-5.0.mod/error.c\t2019-02-20 14:19:39.265261705 +0200\n@@ -430,7 +430,7 @@\n   static FILE *tracefp = (FILE *)NULL;\n \n   if (tracefp == NULL)\n-    tracefp = fopen(\"/tmp/bash-trace.log\", \"a+\");\n+    tracefp = fopen(\"@TERMUX_PREFIX@/tmp/bash-trace.log\", \"a+\");\n \n   if (tracefp == NULL)\n     tracefp = stderr;\n"
  },
  {
    "path": "packages/bash/etc-bash.bashrc",
    "content": "if [ -x @TERMUX_PREFIX@/libexec/termux/command-not-found ]; then\n\tcommand_not_found_handle() {\n\t\t@TERMUX_PREFIX@/libexec/termux/command-not-found \"$1\"\n\t}\nfi\n\nPS1='\\$ '\n"
  },
  {
    "path": "packages/bash/etc-profile",
    "content": "for i in @TERMUX_PREFIX@/etc/profile.d/*.sh; do\n\tif [ -r $i ]; then\n\t\t. $i\n\tfi\ndone\nunset i\n\n# Source etc/bash.bashrc and ~/.bashrc also for interactive bash login shells:\nif [ \"$BASH\" ]; then\n        if [[ \"$-\" == *\"i\"* ]]; then\n                if [ -r @TERMUX_PREFIX@/etc/bash.bashrc ]; then\n                        . @TERMUX_PREFIX@/etc/bash.bashrc\n                fi\n                if [ -r @TERMUX_HOME@/.bashrc ]; then\n                        . @TERMUX_HOME@/.bashrc\n                fi\n        fi\nfi\n"
  },
  {
    "path": "packages/bash/lib-malloc-stats.c.patch",
    "content": "diff -uNr bash-5.0/lib/malloc/stats.c bash-5.0.mod/lib/malloc/stats.c\n--- bash-5.0/lib/malloc/stats.c\t2018-06-19 22:24:52.000000000 +0300\n+++ bash-5.0.mod/lib/malloc/stats.c\t2019-02-20 14:17:52.094412438 +0200\n@@ -142,7 +142,7 @@\n   _print_malloc_stats (s, fp);\n }\n \n-#define TRACEROOT \"/var/tmp/maltrace/stats.\"\n+#define TRACEROOT \"@TERMUX_PREFIX@/var/tmp/maltrace/stats.\"\n \n void\n trace_malloc_stats (s, fn)\n"
  },
  {
    "path": "packages/bash/lib-malloc-table.c.patch",
    "content": "diff -uNr bash-5.0/lib/malloc/table.c bash-5.0.mod/lib/malloc/table.c\n--- bash-5.0/lib/malloc/table.c\t2016-01-15 15:47:26.000000000 +0200\n+++ bash-5.0.mod/lib/malloc/table.c\t2019-02-20 14:18:05.854521552 +0200\n@@ -390,7 +390,7 @@\n   _location_dump_table (stderr);\n }\n \n-#define LOCROOT \"/var/tmp/maltrace/locations.\"\n+#define LOCROOT \"@TERMUX_PREFIX@/var/tmp/maltrace/locations.\"\n \n void\n mlocation_write_table ()\n"
  },
  {
    "path": "packages/bash/lib-malloc-trace.c.patch",
    "content": "diff -uNr bash-5.0/lib/malloc/trace.c bash-5.0.mod/lib/malloc/trace.c\n--- bash-5.0/lib/malloc/trace.c\t2016-01-15 15:48:23.000000000 +0200\n+++ bash-5.0.mod/lib/malloc/trace.c\t2019-02-20 14:17:59.184468664 +0200\n@@ -108,7 +108,7 @@\n #endif\n }\n \n-#define TRACEROOT \"/var/tmp/maltrace/trace.\"\n+#define TRACEROOT \"@TERMUX_PREFIX@/var/tmp/maltrace/trace.\"\n \n void\n malloc_set_tracefn (s, fn)\n"
  },
  {
    "path": "packages/bash/lib-readline-complete.c.patch",
    "content": "diff -uNr bash-5.0/lib/readline/complete.c bash-5.0.mod/lib/readline/complete.c\n--- bash-5.0/lib/readline/complete.c\t2017-07-05 02:43:20.000000000 +0300\n+++ bash-5.0.mod/lib/readline/complete.c\t2019-02-20 14:15:49.683440481 +0200\n@@ -2231,7 +2231,7 @@\n char *\n rl_username_completion_function (const char *text, int state)\n {\n-#if defined (__WIN32__) || defined (__OPENNT)\n+#if defined (__WIN32__) || defined (__OPENNT) || defined (__ANDROID__)\n   return (char *)NULL;\n #else /* !__WIN32__ && !__OPENNT) */\n   static char *username = (char *)NULL;\n"
  },
  {
    "path": "packages/bash/lib-readline-rlconf.h.patch",
    "content": "diff -uNr bash-5.0/lib/readline/rlconf.h bash-5.0.mod/lib/readline/rlconf.h\n--- bash-5.0/lib/readline/rlconf.h\t2017-02-21 17:25:30.000000000 +0200\n+++ bash-5.0.mod/lib/readline/rlconf.h\t2019-02-20 14:16:17.230326111 +0200\n@@ -43,7 +43,7 @@\n #define DEFAULT_INPUTRC \"~/.inputrc\"\n \n /* The ultimate last-ditch filename for an init file -- system-wide. */\n-#define SYS_INPUTRC \"/etc/inputrc\"\n+#define SYS_INPUTRC \"@TERMUX_PREFIX@/etc/inputrc\"\n \n /* If defined, expand tabs to spaces. */\n #define DISPLAY_TABS\n"
  },
  {
    "path": "packages/bash/lib-readline-util.c.patch",
    "content": "diff -uNr bash-5.0/lib/readline/util.c bash-5.0.mod/lib/readline/util.c\n--- bash-5.0/lib/readline/util.c\t2017-06-15 23:27:17.000000000 +0300\n+++ bash-5.0.mod/lib/readline/util.c\t2019-02-20 14:18:24.271334221 +0200\n@@ -506,7 +506,7 @@\n   if (x == 0)\n     x = \".\";\n #else\n-  x = \"/var/tmp\";\n+  x = \"@TERMUX_PREFIX@/var/tmp\";\n #endif\n   snprintf (fnbuf, sizeof (fnbuf), \"%s/rltrace.%ld\", x, (long)getpid());\n   unlink(fnbuf);\n"
  },
  {
    "path": "packages/bash/lib-sh-tmpfile.c.patch",
    "content": "diff -uNr bash-5.0/lib/sh/tmpfile.c bash-5.0.mod/lib/sh/tmpfile.c\n--- bash-5.0/lib/sh/tmpfile.c\t2016-08-11 18:05:58.000000000 +0300\n+++ bash-5.0.mod/lib/sh/tmpfile.c\t2019-02-20 14:17:08.270731426 +0200\n@@ -74,15 +74,11 @@\n     return sys_tmpdir;\n #endif\n \n-  sys_tmpdir = \"/tmp\";\n+  sys_tmpdir = \"@TERMUX_PREFIX@/tmp\";\n   if (file_iswdir (sys_tmpdir))\n     return sys_tmpdir;\n \n-  sys_tmpdir = \"/var/tmp\";\n-  if (file_iswdir (sys_tmpdir))\n-    return sys_tmpdir;\n-\n-  sys_tmpdir = \"/usr/tmp\";\n+  sys_tmpdir = \"@TERMUX_PREFIX@/var/tmp\";\n   if (file_iswdir (sys_tmpdir))\n     return sys_tmpdir;\n \n"
  },
  {
    "path": "packages/bash/pathnames.h.in.patch",
    "content": "diff -uNr bash-5.0/pathnames.h.in bash-5.0.mod/pathnames.h.in\n--- bash-5.0/pathnames.h.in\t2009-01-04 21:32:40.000000000 +0200\n+++ bash-5.0.mod/pathnames.h.in\t2019-02-20 14:15:56.880164371 +0200\n@@ -22,10 +22,10 @@\n #define _PATHNAMES_H_\n \n /* The default file for hostname completion. */\n-#define DEFAULT_HOSTS_FILE \"/etc/hosts\"\n+#define DEFAULT_HOSTS_FILE \"@TERMUX_PREFIX@/etc/hosts\"\n \n /* The default login shell startup file. */\n-#define SYS_PROFILE \"/etc/profile\"\n+#define SYS_PROFILE \"@TERMUX_PREFIX@/etc/profile\"\n \n /* The default location of the bash debugger initialization/startup file. */\n #define DEBUGGER_START_FILE\t\"@DEBUGGER_START_FILE@\"\n"
  },
  {
    "path": "packages/bash/shell.c.patch",
    "content": "diff -uNr bash-5.0/shell.c bash-5.0.mod/shell.c\n--- bash-5.0/shell.c\t2018-12-06 18:28:21.000000000 +0200\n+++ bash-5.0.mod/shell.c\t2019-02-20 14:19:29.808520144 +0200\n@@ -339,12 +339,12 @@\n {\n   struct stat sb;\n \n-  if (stat (\"/tmp\", &sb) < 0)\n-    internal_warning (_(\"could not find /tmp, please create!\"));\n+  if (stat (\"@TERMUX_PREFIX@/tmp\", &sb) < 0)\n+    internal_warning (_(\"could not find @TERMUX_PREFIX@/tmp, please create!\"));\n   else\n     {\n       if (S_ISDIR (sb.st_mode) == 0)\n-\tinternal_warning (_(\"/tmp must be a valid directory name\"));\n+\tinternal_warning (_(\"@TERMUX_PREFIX@/tmp must be a valid directory name\"));\n     }\n }\n #endif /* __CYGWIN__ */\n"
  },
  {
    "path": "packages/bash-completion/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/scop/bash-completion\nTERMUX_PKG_DESCRIPTION=\"Programmable completion for the bash shell\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.10\nTERMUX_PKG_SHA256=123c17998e34b937ce57bb1b111cd817bc369309e9a8047c0bcf06ead4a3ec92\nTERMUX_PKG_SRCURL=https://github.com/scop/bash-completion/releases/download/${TERMUX_PKG_VERSION}/bash-completion-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"bash\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/bash-completion/completions-man.patch",
    "content": "diff -uNr bash-completion-2.9/completions/man bash-completion-2.9.mod/completions/man\n--- bash-completion-2.9/completions/man\t2019-04-27 11:54:49.000000000 +0300\n+++ bash-completion-2.9.mod/completions/man\t2019-05-02 15:36:06.454990217 +0300\n@@ -51,8 +51,7 @@\n         return\n     fi\n \n-    local manpath=$(manpath 2>/dev/null || command man -w 2>/dev/null)\n-    [[ -z $manpath ]] && manpath=\"/usr/share/man:/usr/local/share/man\"\n+    local manpath=\"@TERMUX_PREFIX@/share/man\"\n \n     # determine manual section to search\n     local sect\n"
  },
  {
    "path": "packages/bat/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/bat\nTERMUX_PKG_DESCRIPTION=\"A cat(1) clone with wings\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.12.1\nTERMUX_PKG_SHA256=1dd184ddc9e5228ba94d19afc0b8b440bfc1819fef8133fe331e2c0ec9e3f8e2\nTERMUX_PKG_SRCURL=https://github.com/sharkdp/bat/archive/v$TERMUX_PKG_VERSION.tar.gz\n# bat calls less with '--RAW-CONTROL-CHARS' which busybox less does not support:\nTERMUX_PKG_DEPENDS=\"less, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS=\"$CFLAGS $CPPFLAGS\"\n\n\t# See https://github.com/nagisa/rust_libloading/issues/54\n\texport CC_x86_64_unknown_linux_gnu=gcc\n\texport CFLAGS_x86_64_unknown_linux_gnu=\"\"\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/doc/bat.1 $TERMUX_PREFIX/share/man/man1/\n}\n"
  },
  {
    "path": "packages/bc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/bc/\nTERMUX_PKG_DESCRIPTION=\"Arbitrary precision numeric processing language\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.07.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/bc/bc-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a\nTERMUX_PKG_DEPENDS=\"readline,flex\"\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--infodir=$TERMUX_PREFIX/share/info\n--mandir=$TERMUX_PREFIX/share/man\n--with-readline\n\"\n\ntermux_step_pre_configure() {\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/bc/libmath.h \\\n\t   $TERMUX_PKG_SRCDIR/bc/libmath.h\n\ttouch -d \"next hour\" $TERMUX_PKG_SRCDIR/bc/libmath.h\n}\n"
  },
  {
    "path": "packages/beanshell/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/beanshell/beanshell\nTERMUX_PKG_DESCRIPTION=\"Small, free, embeddable, source level Java interpreter with object based scripting language features written in Java\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.0b6\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/beanshell/beanshell/releases/download/$TERMUX_PKG_VERSION/bsh-$TERMUX_PKG_VERSION.jar\nTERMUX_PKG_SHA256=a17955976070c0573235ee662f2794a78082758b61accffce8d3f8aedcd91047\nTERMUX_PKG_DEPENDS=\"dash, termux-tools\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\ttermux_download \\\n\t\t\"$TERMUX_PKG_SRCURL\" \\\n\t\t\"$TERMUX_PKG_CACHEDIR/bsh-$TERMUX_PKG_VERSION.jar\" \\\n\t\t\"$TERMUX_PKG_SHA256\"\n}\n\ntermux_step_make() {\n\t\"$ANDROID_HOME/build-tools/${TERMUX_ANDROID_BUILD_TOOLS_VERSION}/dx\" \\\n\t\t--dex --output=beanshell.jar \"$TERMUX_PKG_CACHEDIR/bsh-$TERMUX_PKG_VERSION.jar\"\n}\n\ntermux_step_make_install() {\n\tinstall -Dm600 beanshell.jar \"$TERMUX_PREFIX/share/dex/beanshell.jar\"\n\n\t{\n\t\techo \"#!$TERMUX_PREFIX/bin/sh\"\n\t\techo \"dalvikvm -cp $TERMUX_PREFIX/share/dex/beanshell.jar bsh.Interpreter \\\"\\$@\\\"\"\n\t} > \"$TERMUX_PREFIX\"/bin/beanshell\n\n\tchmod 700 \"$TERMUX_PREFIX\"/bin/beanshell\n\tln -sfr \"$TERMUX_PREFIX\"/bin/beanshell \"$TERMUX_PREFIX\"/bin/bsh\n}\n"
  },
  {
    "path": "packages/binutils/binutils-gold.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ld.gold bin/gold\"\nTERMUX_SUBPKG_DESCRIPTION=\"gold linker\"\n"
  },
  {
    "path": "packages/binutils/binutils.patch",
    "content": "diff -u -r ../binutils-2.24/bfd/archive.c ./bfd/archive.c\n--- ../binutils-2.24/bfd/archive.c\t2013-11-04 16:33:37.000000000 +0100\n+++ ./bfd/archive.c\t2014-01-01 14:44:49.000000000 +0100\n@@ -1880,7 +1880,8 @@\n     {\n       /* Assume we just \"made\" the member, and fake it.  */\n       struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream;\n-      time (&status.st_mtime);\n+      /* termux diff: explicit cast */\n+      time ((time_t*) &status.st_mtime);\n       status.st_uid = getuid ();\n       status.st_gid = getgid ();\n       status.st_mode = 0644;\n"
  },
  {
    "path": "packages/binutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/binutils/\nTERMUX_PKG_DESCRIPTION=\"Collection of binary tools, the main ones being ld, the GNU linker, and as, the GNU assembler\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.33.1\nTERMUX_PKG_SHA256=98aba5f673280451a09df3a8d8eddb3aa0c505ac183f1e2f9d00c67aa04c6f7d\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/binutils/binutils-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libc++, zlib\"\nTERMUX_PKG_BREAKS=\"binutils-dev\"\nTERMUX_PKG_REPLACES=\"binutils-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-gold --enable-plugins --disable-werror --with-system-zlib --enable-new-dtags\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"tooldir=$TERMUX_PREFIX\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/man/man1/windmc.1 share/man/man1/windres.1 bin/ld.bfd\"\nTERMUX_PKG_NO_STATICSPLIT=true\nTERMUX_PKG_HAS_DEBUG=false\n# Debug build fails with:\n# ~/termux-build/binutils/src/binutils/readelf.c:19060:81: error: in call to 'fread', size * count is too large for the given buffer\n#     if (fread (ehdr32.e_type, sizeof (ehdr32) - EI_NIDENT, 1, filedata->handle) != 1)\n#                                                                               ^\n# ~/termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/bits/fortify/stdio.h:107:9: note: from 'diagnose_if' attribute on 'fread':\n#        __clang_error_if(__bos(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE && size * count > __bos(buf),\n#        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n# ~/termux-build/_cache/19b-aarch64-24-v5/bin/../sysroot/usr/include/sys/cdefs.h:163:52: note: expanded from macro '__clang_error_if'\n# #define __clang_error_if(cond, msg) __attribute__((diagnose_if(cond, msg, \"error\")))\n#                                                    ^           ~~~~\n\n# Avoid linking against libfl.so from flex if available:\nexport LEXLIB=\n\ntermux_step_pre_configure() {\n\texport CPPFLAGS=\"$CPPFLAGS -Wno-c++11-narrowing\"\n\n\tif [ $TERMUX_ARCH_BITS = 32 ]; then\n\t\texport LIB_PATH=\"${TERMUX_PREFIX}/lib:/system/lib\"\n\telse\n\t\texport LIB_PATH=\"${TERMUX_PREFIX}/lib:/system/lib64\"\n\tfi\n}\n\ntermux_step_post_make_install() {\n\tcp $TERMUX_PKG_BUILDER_DIR/ldd $TERMUX_PREFIX/bin/ldd\n\tcd $TERMUX_PREFIX/bin\n\t# Setup symlinks as these are used when building, so used by\n\t# system setup in e.g. python, perl and libtool:\n\tfor b in ar ld nm objdump ranlib readelf strip; do\n\t\tln -s -f $b $TERMUX_HOST_PLATFORM-$b\n\tdone\n\tln -sf ld.gold gold\n}\n"
  },
  {
    "path": "packages/binutils/dirsearch.cc.patch",
    "content": "--- ../cache/binutils-2.30/gold/dirsearch.cc\t2018-01-13 13:31:16.000000000 +0000\n+++ ./gold/dirsearch.cc\t2018-07-04 01:41:01.695893401 +0000\n@@ -69,7 +69,7 @@\n     {\n       // We ignore directories which do not exist or are actually file\n       // names.\n-      if (errno != ENOENT && errno != ENOTDIR)\n+      if (errno != ENOENT && errno != ENOTDIR && errno != EACCES )\n \tgold::gold_error(_(\"%s: can not read directory: %s\"),\n \t\t\t this->dirname_, strerror(errno));\n       return;\n"
  },
  {
    "path": "packages/binutils/ld-emultempl-elf32.em.patch",
    "content": "diff -u -r ../binutils-2.26/ld/emultempl/elf32.em ./ld/emultempl/elf32.em\n--- ../binutils-2.26/ld/emultempl/elf32.em\t2015-11-13 03:27:42.000000000 -0500\n+++ ./ld/emultempl/elf32.em\t2016-01-28 10:20:11.534910516 -0500\n@@ -115,8 +115,13 @@\n static void\n gld${EMULATION_NAME}_after_parse (void)\n {\n+#ifndef __ANDROID__\n+  /* The Android linker does not support DF_1_PIE:\n+     'unsupported flags DT_FLAGS_1=0x8000000'\n+     from linker.cpp (see \"case DT_FLAGS_1\" there. */\n   if (bfd_link_pie (&link_info))\n     link_info.flags_1 |= (bfd_vma) DF_1_PIE;\n+#endif\n \n   after_parse_default ();\n }\n"
  },
  {
    "path": "packages/binutils/ldd",
    "content": "#!/bin/sh\n\nobjdump -p $@ | grep NEEDED | cut -d ' ' -f 18\n"
  },
  {
    "path": "packages/binutils/native_lib_dirs.patch32",
    "content": "diff -r -u ../binutils-2.24/ld/configure.tgt ./ld/configure.tgt\n--- ../binutils-2.24/ld/configure.tgt\t2013-11-26 12:37:33.000000000 +0100\n+++ ./ld/configure.tgt\t2014-02-12 18:06:26.000000000 +0100\n@@ -769,7 +769,7 @@\n \n esac\n \n-NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'\n+NATIVE_LIB_DIRS='/system/lib'\n case \"${target}\" in\n \n *-*-dragonfly*)\n"
  },
  {
    "path": "packages/binutils/native_lib_dirs.patch64",
    "content": "diff -r -u ../binutils-2.24/ld/configure.tgt ./ld/configure.tgt\n--- ../binutils-2.24/ld/configure.tgt\t2013-11-26 12:37:33.000000000 +0100\n+++ ./ld/configure.tgt\t2014-02-12 18:06:26.000000000 +0100\n@@ -769,7 +769,7 @@\n \n esac\n \n-NATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib'\n+NATIVE_LIB_DIRS='/system/lib64'\n case \"${target}\" in\n \n *-*-dragonfly*)\n"
  },
  {
    "path": "packages/binutils/options.cc.patch32",
    "content": "--- ../cache/binutils-2.30/gold/options.cc\t2018-01-13 13:31:16.000000000 +0000\n+++ ./gold/options.cc\t2018-03-11 23:17:59.326121534 +0000\n@@ -1227,8 +1227,8 @@\n \t       || this->user_set_sysroot()\n \t       || *TARGET_SYSTEM_ROOT != '\\0')\n \t{\n-\t  this->add_to_library_path_with_sysroot(\"/lib\");\n-\t  this->add_to_library_path_with_sysroot(\"/usr/lib\");\n+\t  this->add_to_library_path_with_sysroot(\"@TERMUX_PREFIX@/lib\");\n+\t  this->add_to_library_path_with_sysroot(\"/system/lib\");\n \t}\n       else\n \tthis->add_to_library_path_with_sysroot(TOOLLIBDIR);\n"
  },
  {
    "path": "packages/binutils/options.cc.patch64",
    "content": "--- ../cache/binutils-2.30/gold/options.cc\t2018-01-13 13:31:16.000000000 +0000\n+++ ./gold/options.cc\t2018-03-11 23:20:26.295331766 +0000\n@@ -1227,8 +1227,8 @@\n \t       || this->user_set_sysroot()\n \t       || *TARGET_SYSTEM_ROOT != '\\0')\n \t{\n-\t  this->add_to_library_path_with_sysroot(\"/lib\");\n-\t  this->add_to_library_path_with_sysroot(\"/usr/lib\");\n+\t  this->add_to_library_path_with_sysroot(\"@TERMUX_PREFIX@/lib\");\n+\t  this->add_to_library_path_with_sysroot(\"/system/lib64\");\n \t}\n       else\n \tthis->add_to_library_path_with_sysroot(TOOLLIBDIR);\n"
  },
  {
    "path": "packages/bison/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/bison/\nTERMUX_PKG_DESCRIPTION=\"General-purpose parser generator\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=3.4.2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/bison/bison-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=27d05534699735dc69e86add5b808d6cb35900ad3fd63fa82e3eb644336abfa0\nTERMUX_PKG_DEPENDS=\"m4\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nM4=m4\nac_cv_header_spawn_h=no\n\"\n"
  },
  {
    "path": "packages/bitcoin/0001-android-patches.patch",
    "content": "diff --git i/depends/hosts/default.mk w/depends/hosts/default.mk\nindex 144e5f88b..4d3c527de 100644\n--- i/depends/hosts/default.mk\n+++ w/depends/hosts/default.mk\n@@ -2,8 +2,8 @@ ifneq ($(host),$(build))\n host_toolchain:=$(host)-\n endif\n \n-default_host_CC = $(host_toolchain)gcc\n-default_host_CXX = $(host_toolchain)g++\n+default_host_CC = $(CC)\n+default_host_CXX = $(CXX)\n default_host_AR = $(host_toolchain)ar\n default_host_RANLIB = $(host_toolchain)ranlib\n default_host_STRIP = $(host_toolchain)strip\ndiff --git i/depends/hosts/linux.mk w/depends/hosts/linux.mk\nindex b13a0f1ad..838db8537 100644\n--- i/depends/hosts/linux.mk\n+++ w/depends/hosts/linux.mk\n@@ -10,19 +10,19 @@ linux_debug_CXXFLAGS=$(linux_debug_CFLAGS)\n linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC\n \n ifeq (86,$(findstring 86,$(build_arch)))\n-i686_linux_CC=gcc -m32\n-i686_linux_CXX=g++ -m32\n-i686_linux_AR=ar\n-i686_linux_RANLIB=ranlib\n-i686_linux_NM=nm\n-i686_linux_STRIP=strip\n+i686_linux_CC=$(default_host_CC) -m32\n+i686_linux_CXX=$(default_host_CXX) -m32\n+i686_linux_AR=$(default_host_AR)\n+i686_linux_RANLIB=$(default_host_RANLIB)\n+i686_linux_NM=$(default_host_NM)\n+i686_linux_STRIP=$(default_host_STRIP)\n \n-x86_64_linux_CC=gcc -m64\n-x86_64_linux_CXX=g++ -m64\n-x86_64_linux_AR=ar\n-x86_64_linux_RANLIB=ranlib\n-x86_64_linux_NM=nm\n-x86_64_linux_STRIP=strip\n+x86_64_linux_CC=$(default_host_CC) -m64\n+x86_64_linux_CXX=$(default_host_CXX) -m64\n+x86_64_linux_AR=$(default_host_AR)\n+x86_64_linux_RANLIB=$(default_host_RANLIB)\n+x86_64_linux_NM=$(default_host_NM)\n+x86_64_linux_STRIP=$(default_host_STRIP)\n else\n i686_linux_CC=$(default_host_CC) -m32\n i686_linux_CXX=$(default_host_CXX) -m32\n"
  },
  {
    "path": "packages/bitcoin/build-aux-m4-ax_boost_thread.m4.patch",
    "content": "diff -u -r ../bitcoin-0.19.0.1/build-aux/m4/ax_boost_thread.m4 ./build-aux/m4/ax_boost_thread.m4\n--- ../bitcoin-0.19.0.1/build-aux/m4/ax_boost_thread.m4\t2019-11-18 09:46:57.000000000 +0000\n+++ ./build-aux/m4/ax_boost_thread.m4\t2019-11-27 23:27:32.657357728 +0000\n@@ -149,7 +149,7 @@\n                         break;\n                         ;;\n                     * )\n-                        BOOST_THREAD_LIB=\"$BOOST_THREAD_LIB -lpthread\"\n+                        BOOST_THREAD_LIB=\"$BOOST_THREAD_LIB\"\n                         break;\n                         ;;\n                 esac\n"
  },
  {
    "path": "packages/bitcoin/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://bitcoincore.org/\nTERMUX_PKG_DESCRIPTION=\"Bitcoin Core\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.19.0.1\nTERMUX_PKG_SRCURL=https://github.com/bitcoin/bitcoin/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=1a72f583f7448b3808d84ed7f8d8eb224f44b51291fee774bb9cecbd4fcbaec7\nTERMUX_PKG_DEPENDS=\"boost, libevent, libzmq, miniupnpc, openssl\"\nTERMUX_PKG_CONFFILES=\"var/service/bitcoind/run var/service/bitcoind/log/run\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-tests\n--with-daemon\n--with-boost-chrono=boost_chrono\n--with-boost-filesystem=boost_filesystem\n--with-boost-system=boost_system\n--with-boost-thread=boost_thread\n--with-gui=no\n--with-miniupnpc\n--without-libs\n\"\n\ntermux_step_pre_configure() {\n\tlocal db_version=4.8.30\n\tlocal db_install_dir=$TERMUX_PKG_BUILDDIR/db-install\n\tlocal db_build_dir=$TERMUX_PKG_BUILDDIR/db-build\n\n\ttermux_download https://download.oracle.com/berkeley-db/db-${db_version}.tar.gz \\\n\t\t$TERMUX_PKG_CACHEDIR/db-${db_version}.tar.gz \\\n\t\te0491a07cdb21fb9aa82773bbbedaeb7639cbd0e7f96147ab46141e0045db72a\n\n\ttar xf $TERMUX_PKG_CACHEDIR/db-${db_version}.tar.gz\n\n\tcd $TERMUX_PKG_BUILDDIR/db-${db_version}\n\tsed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' \\\n\t\tdbinc/atomic.h\n\tsed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c \\\n\t\tmp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c\n\ttermux_step_replace_guess_scripts\n\n\tmkdir -p ${db_build_dir}\n\tcd ${db_build_dir}\n\t../db-${db_version}/dist/configure \\\n\t\t--host=$TERMUX_HOST_PLATFORM --prefix=${db_install_dir} \\\n\t\t--disable-shared --enable-static --enable-hash --enable-smallbuild \\\n\t\t--enable-compat185 --enable-cxx db_cv_atomic=gcc-builtin\n\tmake -j $TERMUX_MAKE_PROCESSES\n\tmake install_lib install_include\n\tcd $TERMUX_PKG_BUILDDIR\n\n\texport BDB_CFLAGS=\"-I${db_install_dir}/include -DHAVE_CXX_STDHEADERS=1\"\n\texport BDB_LIBS=\"-L${db_install_dir}/lib -ldb_cxx\"\n\n    ./autogen.sh\n}\n\ntermux_step_post_make_install() {\n    mkdir -p $TERMUX_PREFIX/var/service\n    cd $TERMUX_PREFIX/var/service\n    mkdir -p bitcoind/log\n    echo \"#!$TERMUX_PREFIX/bin/sh\" > bitcoind/run\n    echo 'exec bitcoind 2>&1' >> bitcoind/run\n    chmod +x bitcoind/run\n    touch bitcoind/down\n\n    ln -sf $TERMUX_PREFIX/share/termux-services/svlogger bitcoind/log/run\n}\n"
  },
  {
    "path": "packages/blogc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://blogc.rgm.io/\nTERMUX_PKG_DESCRIPTION=\"A blog compiler\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_MAINTAINER=\"Rafael Martins @rafaelmartins\"\nTERMUX_PKG_VERSION=0.18.0\nTERMUX_PKG_SHA256=c414625ee67b9b8e48bcc22b9f2463bf44368db4802200d798d55d7e176a1675\nTERMUX_PKG_SRCURL=https://github.com/blogc/blogc/releases/download/v$TERMUX_PKG_VERSION/blogc-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-git-receiver --enable-make --enable-runserver --disable-tests --disable-valgrind\"\n"
  },
  {
    "path": "packages/blogc/termux-prefix.patch",
    "content": "diff --git a/src/blogc-make/atom.c b/src/blogc-make/atom.c\nindex d5f5387..5154bb9 100644\n--- a/src/blogc-make/atom.c\n+++ b/src/blogc-make/atom.c\n@@ -55,7 +55,7 @@ bm_atom_deploy(bm_settings_t *settings, bc_error_t **err)\n         return NULL;\n \n     // this is not really portable\n-    char fname[] = \"/tmp/blogc-make_XXXXXX\";\n+    char fname[] = \"@TERMUX_PREFIX@/tmp/blogc-make_XXXXXX\";\n     int fd;\n     if (-1 == (fd = mkstemp(fname))) {\n         *err = bc_error_new_printf(BLOGC_MAKE_ERROR_ATOM,\ndiff --git a/src/blogc-make/exec.c b/src/blogc-make/exec.c\nindex db20cae..86e8d25 100644\n--- a/src/blogc-make/exec.c\n+++ b/src/blogc-make/exec.c\n@@ -116,7 +116,7 @@ bm_exec_command(const char *cmd, const char *input, char **output,\n         dup2(fd_err[1], STDERR_FILENO);\n \n         char *const argv[] = {\n-            \"/bin/sh\",\n+            \"@TERMUX_PREFIX@/bin/sh\",\n             \"-c\",\n             (char*) cmd,\n             NULL,\n"
  },
  {
    "path": "packages/bmon/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/tgraf/bmon\nTERMUX_PKG_DESCRIPTION=\"Bandwidth monitor and rate estimator\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=4.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/tgraf/bmon/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=d5e503ff6b116c681ebf4d10e238604dde836dceb9c0008eb92416a96c87ca40\nTERMUX_PKG_DEPENDS=\"libconfuse, libnl, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/bmon/config.h.patch",
    "content": "--- ../../build/bmon/cache/bmon-4.0/include/bmon/config.h\t2016-12-13 11:56:40.000000000 +0100\n+++ ./include/bmon/config.h\t2017-02-09 00:29:18.177571494 +0100\n@@ -46,11 +46,6 @@\n #include <syslog.h>\n #include <sys/wait.h>\n #include <dirent.h>\n-#ifdef SYS_BSD\n-# include <float.h>\n-#else\n-# include <values.h>\n-#endif\n \n #if TIME_WITH_SYS_TIME\n # include <sys/time.h>\n"
  },
  {
    "path": "packages/boost/bootstrap.sh.patch",
    "content": "diff --git a/bootstrap.sh b/bootstrap.sh\nindex c6f3423..52c08e6 100755\n--- a/bootstrap.sh\n+++ b/bootstrap.sh\n@@ -30,7 +30,7 @@ if test \"x$ECHO\" = x; then\n fi\n \n # Internal flags\n-flag_no_python=\n+flag_no_python=yes\n flag_icu=\n flag_show_libraries=\n \n"
  },
  {
    "path": "packages/boost/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://boost.org\nTERMUX_PKG_DESCRIPTION=\"Free peer-reviewed portable C++ source libraries\"\nTERMUX_PKG_LICENSE=\"BSL-1.0\"\nTERMUX_PKG_VERSION=1.71.0\nTERMUX_PKG_SRCURL=https://dl.bintray.com/boostorg/release/$TERMUX_PKG_VERSION/source/boost_${TERMUX_PKG_VERSION//./_}.tar.bz2\nTERMUX_PKG_SHA256=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"libc++, libbz2, libiconv, liblzma, zlib\"\nTERMUX_PKG_BUILD_DEPENDS=\"python\"\nTERMUX_PKG_BREAKS=\"libboost-python (<= 1.65.1-2), boost-dev\"\nTERMUX_PKG_REPLACES=\"libboost-python (<= 1.65.1-2), boost-dev\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_make_install() {\n\tCXXFLAGS+=\" -std=c++14\"\n\n\trm $TERMUX_PREFIX/lib/libboost* -f\n\trm $TERMUX_PREFIX/include/boost -rf\n\n\tCC= CXX= LDFLAGS= CXXFLAGS= ./bootstrap.sh\n\techo \"using clang : $TERMUX_ARCH : $CXX : <linkflags>-L$TERMUX_PREFIX/lib ; \" >> project-config.jam\n\techo \"using python : 3.8 : $TERMUX_PREFIX/bin/python3 : $TERMUX_PREFIX/include/python3.8 : $TERMUX_PREFIX/lib ;\" >> project-config.jam\n\n\tif [ \"$TERMUX_ARCH\" = arm ] || [ \"$TERMUX_ARCH\" = aarch64 ]; then\n\t\tBOOSTARCH=arm\n\t\tBOOSTABI=aapcs\n\telif [ \"$TERMUX_ARCH\" = i686 ] || [ \"$TERMUX_ARCH\" = x86_64 ]; then\n\t\tBOOSTARCH=x86\n\t\tBOOSTABI=sysv\n\tfi\n\n\tif [ \"$TERMUX_ARCH\" = x86_64 ] || [ \"$TERMUX_ARCH\" = aarch64 ]; then\n\t\tBOOSTAM=64\n\telif [ \"$TERMUX_ARCH\" = i686 ] || [ \"$TERMUX_ARCH\" = arm ]; then\n\t\tBOOSTAM=32\n\tfi\n\n\t./b2 target-os=android -j${TERMUX_MAKE_PROCESSES} \\\n\t\tinclude=$TERMUX_PREFIX/include \\\n\t\ttoolset=clang-$TERMUX_ARCH \\\n\t\t--prefix=\"$TERMUX_PREFIX\"  \\\n\t\t-q \\\n\t\t--without-stacktrace \\\n\t\t--without-log \\\n\t\t--disable-icu \\\n\t\t-sNO_ZSTD=1 \\\n\t\tcxxflags=\"$CXXFLAGS\" \\\n\t\tlinkflags=\"$LDFLAGS\" \\\n\t\tarchitecture=\"$BOOSTARCH\" \\\n\t\tabi=\"$BOOSTABI\" \\\n\t\taddress-model=\"$BOOSTAM\" \\\n\t\tboost.locale.icu=off \\\n\t\tbinary-format=elf \\\n\t\tlink=shared \\\n\t\tthreading=multi \\\n\t\tinstall\n}\n"
  },
  {
    "path": "packages/boost/python.jam.patch",
    "content": "diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam\nindex 273b28a..3de7f40 100644\n--- a/tools/build/src/tools/python.jam\n+++ b/tools/build/src/tools/python.jam\n@@ -651,7 +651,7 @@ local rule system-library-dependencies ( target-os )\n \n         case aix : return  <library>pthread <library>dl ;\n \n-        case * : return  <library>pthread <library>dl\n+        case * : return  <library>dl\n             <toolset>gcc:<library>util <toolset-intel:platform>linux:<library>util ;\n     }\n }\n"
  },
  {
    "path": "packages/boost/tools-build-src-tools-common.jam.patch",
    "content": "diff -u -r ../boost_1_70_0/tools/build/src/tools/common.jam ./tools/build/src/tools/common.jam\n--- ../boost_1_70_0/tools/build/src/tools/common.jam\t2019-04-09 19:36:57.000000000 +0000\n+++ ./tools/build/src/tools/common.jam\t2019-05-05 22:41:59.313215785 +0000\n@@ -980,10 +980,11 @@\n     }\n \n     # Ditto, from Clang 4\n-    if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ]\n-    {\n-        version = $(version[1]) ;\n-    }\n+    # See https://github.com/boostorg/build/issues/385\n+    #if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ]\n+    #{\n+    #    version = $(version[1]) ;\n+    #}\n \n     # On intel, version is not added, because it does not matter and it is the\n     # version of vc used as backend that matters. Ideally, we should encode the\n"
  },
  {
    "path": "packages/brotli/CMakeLists.txt.patch",
    "content": "diff -u -r ../brotli-1.0.4/CMakeLists.txt ./CMakeLists.txt\n--- ../brotli-1.0.4/CMakeLists.txt\t2018-03-29 08:37:07.000000000 +0000\n+++ ./CMakeLists.txt\t2018-05-27 12:33:42.384489726 +0000\n@@ -183,7 +183,7 @@\n \n # Build the brotli executable\n add_executable(brotli ${BROTLI_CLI_C})\n-target_link_libraries(brotli ${BROTLI_LIBRARIES_STATIC})\n+target_link_libraries(brotli ${BROTLI_LIBRARIES})\n \n # Installation\n if(NOT BROTLI_BUNDLED_MODE)\n"
  },
  {
    "path": "packages/brotli/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/brotli\nTERMUX_PKG_DESCRIPTION=\"lossless compression algorithm and format (command line utility)\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.0.7\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=4c61bfb0faca87219ea587326c467b95acb25555b53d1a421ffa3c8a9296ee2c\nTERMUX_PKG_BREAKS=\"brotli-dev\"\nTERMUX_PKG_REPLACES=\"brotli-dev\"\nTERMUX_PKG_SRCURL=https://github.com/google/brotli/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_FORCE_CMAKE=true\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/man/man{1,3}\n\tcp $TERMUX_PKG_SRCDIR/docs/brotli.1 $TERMUX_PREFIX/share/man/man1/\n\tcp $TERMUX_PKG_SRCDIR/docs/*.3 $TERMUX_PREFIX/share/man/man3/\n}\n"
  },
  {
    "path": "packages/build-essential/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-packages\nTERMUX_PKG_DESCRIPTION=\"A metapackage that installs essential development tools\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_METAPACKAGE=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\n#\n# Common utilities for various build systems:\n#\n#   autoconf, automake, bison, clang, cmake, flex, gperf, libtool, m4, make, ninja, pkg-config, util-linux\n#\n# These packages replace busybox's applets:\n#\n#   bc, bzip2, coreutils, diffutils, ed, findutils, gawk, grep, gzip, lzip, lzop, patch, procps, psmisc, sed, tar, xz-utils\n#\n\nTERMUX_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\"\n\n# Other packages that may be interesting.\nTERMUX_PKG_SUGGESTS=\"git, golang, nodejs, patchelf, proot, python, python2, ruby, rust, subversion\"\n"
  },
  {
    "path": "packages/busybox/0000-use-clang.patch",
    "content": "diff -uNr busybox-1.31.1/Makefile busybox-1.31.1.mod/Makefile\n--- busybox-1.31.1/Makefile\t2019-10-25 11:44:52.000000000 +0300\n+++ busybox-1.31.1.mod/Makefile\t2019-11-11 22:19:06.004778909 +0200\n@@ -289,7 +289,7 @@\n # Make variables (CC, etc...)\n \n AS\t\t= $(CROSS_COMPILE)as\n-CC\t\t= $(CROSS_COMPILE)gcc\n+CC\t\t= $(CROSS_COMPILE)clang\n LD\t\t= $(CC) -nostdlib\n CPP\t\t= $(CC) -E\n AR\t\t= $(CROSS_COMPILE)ar\n"
  },
  {
    "path": "packages/busybox/0001-clang-fix.patch",
    "content": "diff -uNr busybox-1.31.1/libbb/lineedit.c busybox-1.31.1.mod/libbb/lineedit.c\n--- busybox-1.31.1/libbb/lineedit.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/libbb/lineedit.c\t2019-11-12 12:54:35.000425941 +0200\n@@ -2337,6 +2337,7 @@\n  * (in both cases the cursor remains on the input line, '\\n' is not printed)\n  * >0 length of input string, including terminating '\\n'\n  */\n+#pragma clang optimize off\n int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *command, int maxsize)\n {\n \tint len, n;\ndiff -uNr busybox-1.31.1/miscutils/bc.c busybox-1.31.1.mod/miscutils/bc.c\n--- busybox-1.31.1/miscutils/bc.c\t2019-10-21 17:54:40.000000000 +0300\n+++ busybox-1.31.1.mod/miscutils/bc.c\t2019-11-12 12:48:49.419098420 +0200\n@@ -7435,6 +7435,7 @@\n }\n \n #if ENABLE_BC\n+#pragma clang optimize off\n int bc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n int bc_main(int argc UNUSED_PARAM, char **argv)\n {\n@@ -7454,6 +7455,7 @@\n #endif\n \n #if ENABLE_DC\n+#pragma clang optimize off\n int dc_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n int dc_main(int argc UNUSED_PARAM, char **argv)\n {\ndiff -uNr busybox-1.31.1/miscutils/less.c busybox-1.31.1.mod/miscutils/less.c\n--- busybox-1.31.1/miscutils/less.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/miscutils/less.c\t2019-11-12 03:30:59.054944977 +0200\n@@ -1803,6 +1803,7 @@\n }\n #endif\n \n+#pragma clang optimize off\n int less_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n int less_main(int argc, char **argv)\n {\ndiff -uNr busybox-1.31.1/networking/ftpd.c busybox-1.31.1.mod/networking/ftpd.c\n--- busybox-1.31.1/networking/ftpd.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/networking/ftpd.c\t2019-11-12 04:05:11.739983958 +0200\n@@ -1169,6 +1169,7 @@\n \tOPT_w = (1 << (BIT_A + 3)) * ENABLE_FEATURE_FTPD_WRITE,\n };\n \n+#pragma clang optimize off\n int ftpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n int ftpd_main(int argc UNUSED_PARAM, char **argv)\n {\ndiff -uNr busybox-1.31.1/networking/httpd.c busybox-1.31.1.mod/networking/httpd.c\n--- busybox-1.31.1/networking/httpd.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/networking/httpd.c\t2019-11-12 03:30:08.104709323 +0200\n@@ -2663,7 +2663,7 @@\n \tOPT_VERBOSE     = 1 << p_opt_verbose,\n };\n \n-\n+#pragma clang optimize off\n int httpd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n int httpd_main(int argc UNUSED_PARAM, char **argv)\n {\ndiff -uNr busybox-1.31.1/procps/nmeter.c busybox-1.31.1.mod/procps/nmeter.c\n--- busybox-1.31.1/procps/nmeter.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/procps/nmeter.c\t2019-11-12 12:59:16.564931184 +0200\n@@ -821,6 +821,7 @@\n \tinit_cr\n };\n \n+#pragma clang optimize off\n int nmeter_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n int nmeter_main(int argc UNUSED_PARAM, char **argv)\n {\ndiff -uNr busybox-1.31.1/runit/svlogd.c busybox-1.31.1.mod/runit/svlogd.c\n--- busybox-1.31.1/runit/svlogd.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/runit/svlogd.c\t2019-11-12 03:28:11.214155815 +0200\n@@ -1034,6 +1034,7 @@\n \t}\n }\n \n+#pragma clang optimize off\n int svlogd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n int svlogd_main(int argc, char **argv)\n {\ndiff -uNr busybox-1.31.1/shell/ash.c busybox-1.31.1.mod/shell/ash.c\n--- busybox-1.31.1/shell/ash.c\t2019-10-21 17:54:40.000000000 +0300\n+++ busybox-1.31.1.mod/shell/ash.c\t2019-11-12 03:24:39.613095056 +0200\n@@ -14278,6 +14278,7 @@\n  * exception occurs.  When an exception occurs the variable \"state\"\n  * is used to figure out how far we had gotten.\n  */\n+#pragma clang optimize off\n int ash_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;\n #if NUM_SCRIPTS > 0\n int ash_main(int argc, char **argv)\n"
  },
  {
    "path": "packages/busybox/0002-hardcoded-paths-fix.patch",
    "content": "diff -uNr busybox-1.31.1/coreutils/mktemp.c busybox-1.31.1.mod/coreutils/mktemp.c\n--- busybox-1.31.1/coreutils/mktemp.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/coreutils/mktemp.c\t2019-11-11 21:46:00.848464330 +0200\n@@ -50,7 +50,7 @@\n //usage:     \"\\n\t-p DIR\tUse DIR as a base directory (implies -t)\"\n //usage:     \"\\n\t-u\tDo not create anything; print a name\"\n //usage:     \"\\n\"\n-//usage:     \"\\nBase directory is: -p DIR, else $TMPDIR, else /tmp\"\n+//usage:     \"\\nBase directory is: -p DIR, else $TMPDIR, else @TERMUX_PREFIX@/tmp\"\n //usage:\n //usage:#define mktemp_example_usage\n //usage:       \"$ mktemp /tmp/temp.XXXXXX\\n\"\n@@ -76,7 +76,7 @@\n \n \tpath = getenv(\"TMPDIR\");\n \tif (!path || path[0] == '\\0')\n-\t\tpath = \"/tmp\";\n+\t\tpath = \"@TERMUX_PREFIX@/tmp\";\n \n \topts = getopt32(argv, \"^\" \"dqtp:u\" \"\\0\" \"?1\"/*1 arg max*/, &path);\n \ndiff -uNr busybox-1.31.1/editors/diff.c busybox-1.31.1.mod/editors/diff.c\n--- busybox-1.31.1/editors/diff.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/editors/diff.c\t2019-11-11 21:46:33.625316185 +0200\n@@ -730,7 +730,7 @@\n \t\t * When we meet non-seekable file, we must make a temp copy.\n \t\t */\n \t\tif (lseek(fd, 0, SEEK_SET) == -1 && errno == ESPIPE) {\n-\t\t\tchar name[] = \"/tmp/difXXXXXX\";\n+\t\t\tchar name[] = \"@TERMUX_PREFIX@/tmp/difXXXXXX\";\n \t\t\tint fd_tmp = xmkstemp(name);\n \n \t\t\tunlink(name);\ndiff -uNr busybox-1.31.1/include/libbb.h busybox-1.31.1.mod/include/libbb.h\n--- busybox-1.31.1/include/libbb.h\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/include/libbb.h\t2019-11-11 21:55:22.141411848 +0200\n@@ -2126,12 +2126,12 @@\n  * use bb_default_login_shell and following defines.\n  * If you change LIBBB_DEFAULT_LOGIN_SHELL,\n  * don't forget to change increment constant. */\n-#define LIBBB_DEFAULT_LOGIN_SHELL  \"-/bin/sh\"\n+#define LIBBB_DEFAULT_LOGIN_SHELL  \"-@TERMUX_PREFIX@/bin/sh\"\n extern const char bb_default_login_shell[] ALIGN1;\n-/* \"/bin/sh\" */\n+/* \"@TERMUX_PREFIX@/bin/sh\" */\n #define DEFAULT_SHELL              (bb_default_login_shell+1)\n /* \"sh\" */\n-#define DEFAULT_SHELL_SHORT_NAME   (bb_default_login_shell+6)\n+#define DEFAULT_SHELL_SHORT_NAME   (bb_default_login_shell+1+sizeof(\"@TERMUX_PREFIX@/bin\"))\n \n /* The following devices are the same on all systems.  */\n #define CURRENT_TTY \"/dev/tty\"\ndiff -uNr busybox-1.31.1/networking/telnetd.c busybox-1.31.1.mod/networking/telnetd.c\n--- busybox-1.31.1/networking/telnetd.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/networking/telnetd.c\t2019-11-11 22:00:22.799539737 +0200\n@@ -99,7 +99,7 @@\n //usage:       \"Handle incoming telnet connections\"\n //usage:\tIF_NOT_FEATURE_TELNETD_STANDALONE(\" via inetd\") \"\\n\"\n //usage:     \"\\n\t-l LOGIN\tExec LOGIN on connect\"\n-//usage:     \"\\n\t-f ISSUE_FILE\tDisplay ISSUE_FILE instead of /etc/issue\"\n+//usage:     \"\\n\t-f ISSUE_FILE\tDisplay ISSUE_FILE instead of @TERMUX_PREFIX@/etc/issue.net\"\n //usage:     \"\\n\t-K\t\tClose connection as soon as login exits\"\n //usage:     \"\\n\t\t\t(normally wait until all programs close slave pty)\"\n //usage:\tIF_FEATURE_TELNETD_STANDALONE(\n@@ -160,7 +160,7 @@\n #define INIT_G() do { \\\n \tsetup_common_bufsiz(); \\\n \tG.loginpath = \"/bin/login\"; \\\n-\tG.issuefile = \"/etc/issue.net\"; \\\n+\tG.issuefile = \"@TERMUX_PREFIX@/etc/issue.net\"; \\\n } while (0)\n \n \ndiff -uNr busybox-1.31.1/util-linux/setarch.c busybox-1.31.1.mod/util-linux/setarch.c\n--- busybox-1.31.1/util-linux/setarch.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/util-linux/setarch.c\t2019-11-11 21:56:31.521753610 +0200\n@@ -98,7 +98,7 @@\n \n \targv += optind;\n \tif (!argv[0])\n-\t\t(--argv)[0] = (char*)\"/bin/sh\";\n+\t\t(--argv)[0] = (char*)\"@TERMUX_PREFIX@/bin/sh\";\n \n \t/* Try to execute the program */\n \tBB_EXECVP_or_die(argv);\n"
  },
  {
    "path": "packages/busybox/0003-strchrnul-fix.patch",
    "content": "diff -uNr busybox-1.31.1/include/platform.h busybox-1.31.1.mod/include/platform.h\n--- busybox-1.31.1/include/platform.h\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/include/platform.h\t2019-11-12 02:43:11.833640516 +0200\n@@ -526,7 +526,9 @@\n #  undef HAVE_STPCPY\n # endif\n # undef HAVE_MEMPCPY\n-# undef HAVE_STRCHRNUL\n+# if __ANDROID_API__ < 24\n+#  undef HAVE_STRCHRNUL\n+# endif\n # undef HAVE_STRVERSCMP\n # undef HAVE_UNLOCKED_LINE_OPS\n # undef HAVE_NET_ETHERNET_H\n"
  },
  {
    "path": "packages/busybox/0004-missing-syscalls.patch",
    "content": "diff -uNr busybox-1.31.1/libbb/missing_syscalls.c busybox-1.31.1.mod/libbb/missing_syscalls.c\n--- busybox-1.31.1/libbb/missing_syscalls.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/libbb/missing_syscalls.c\t2019-11-11 22:56:16.433805825 +0200\n@@ -10,10 +10,13 @@\n #if defined(ANDROID) || defined(__ANDROID__)\n /*# include <linux/timex.h> - for struct timex, but may collide with <time.h> */\n # include <sys/syscall.h>\n+\n+#if __ANDROID_API__ < 17\n pid_t getsid(pid_t pid)\n {\n \treturn syscall(__NR_getsid, pid);\n }\n+#endif\n \n int stime(const time_t *t)\n {\n@@ -23,16 +26,20 @@\n \treturn settimeofday(&tv, NULL);\n }\n \n+#if __ANDROID_API__ < 23\n int sethostname(const char *name, size_t len)\n {\n \treturn syscall(__NR_sethostname, name, len);\n }\n+#endif\n \n+#if __ANDROID_API__ < 24\n struct timex;\n int adjtimex(struct timex *buf)\n {\n \treturn syscall(__NR_adjtimex, buf);\n }\n+#endif\n \n int pivot_root(const char *new_root, const char *put_old)\n {\n"
  },
  {
    "path": "packages/busybox/0005-no-change-identity.patch",
    "content": "diff -uNr busybox-1.31.1/libbb/change_identity.c busybox-1.31.1.mod/libbb/change_identity.c\n--- busybox-1.31.1/libbb/change_identity.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/libbb/change_identity.c\t2019-11-11 22:12:18.976233196 +0200\n@@ -32,6 +32,9 @@\n /* Become the user and group(s) specified by PW.  */\n void FAST_FUNC change_identity(const struct passwd *pw)\n {\n+#ifdef __ANDROID__\n+\treturn;\n+#endif\n \tint res;\n \n \tres = initgroups(pw->pw_name, pw->pw_gid);\n"
  },
  {
    "path": "packages/busybox/0006-no-crypt.h.patch",
    "content": "diff -uNr busybox-1.31.1/libbb/pw_encrypt.c busybox-1.31.1.mod/libbb/pw_encrypt.c\n--- busybox-1.31.1/libbb/pw_encrypt.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/libbb/pw_encrypt.c\t2019-11-11 22:16:44.990795793 +0200\n@@ -6,7 +6,10 @@\n  *\n  * Licensed under GPLv2 or later, see file LICENSE in this source tree.\n  */\n-#include <crypt.h>\n+#if !ENABLE_USE_BB_CRYPT\n+# include <crypt.h>\n+#endif\n+\n #include \"libbb.h\"\n \n /* static const uint8_t ascii64[] ALIGN1 =\n"
  },
  {
    "path": "packages/busybox/0007-miscutils-crond.patch",
    "content": "diff -uNr busybox-1.31.1/miscutils/crond.c busybox-1.31.1.mod/miscutils/crond.c\n--- busybox-1.31.1/miscutils/crond.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/miscutils/crond.c\t2019-11-11 22:04:10.820622087 +0200\n@@ -435,7 +435,7 @@\n \n \tmaxLines = (strcmp(fileName, \"root\") == 0) ? 65535 : MAXLINES;\n \n-\tif (fstat(fileno(parser->fp), &sbuf) == 0 && sbuf.st_uid == DAEMON_UID) {\n+\tif (fstat(fileno(parser->fp), &sbuf) == 0) {\n \t\tCronFile *file = xzalloc(sizeof(CronFile));\n \t\tCronLine **pline;\n \t\tint n;\n@@ -655,6 +655,9 @@\n \n static void set_env_vars(struct passwd *pas, const char *shell)\n {\n+#ifdef __ANDROID__\n+\treturn;\n+#endif\n \t/* POSIX requires crond to set up at least HOME, LOGNAME, PATH, SHELL.\n \t * We assume crond inherited suitable PATH.\n \t */\n"
  },
  {
    "path": "packages/busybox/0008-miscutils-crontab.patch",
    "content": "diff -uNr busybox-1.31.1/miscutils/crontab.c busybox-1.31.1.mod/miscutils/crontab.c\n--- busybox-1.31.1/miscutils/crontab.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/miscutils/crontab.c\t2019-11-11 22:08:19.115118798 +0200\n@@ -53,10 +53,12 @@\n \n \t/* CHILD - change user and run editor */\n \t/* initgroups, setgid, setuid */\n+#ifndef __ANDROID__\n \tchange_identity(pas);\n \tsetup_environment(pas->pw_shell,\n \t\t\tSETUP_ENV_CHANGEENV | SETUP_ENV_TO_TMP,\n \t\t\tpas);\n+#endif\n \tptr = getenv(\"VISUAL\");\n \tif (!ptr) {\n \t\tptr = getenv(\"EDITOR\");\n@@ -167,7 +169,8 @@\n \t\t}\n \t\tclose_on_exec_on(src_fd); /* don't want editor to see this fd */\n \t\tedit_file(pas, tmp_fname);\n-\t\t/* fall through */\n+\t\txrename(tmp_fname, pas->pw_name);\n+\t\tbreak;\n \n \tcase 0: /* Replace (no -l, -e, or -r were given) */\n \t\tnew_fname = xasprintf(\"%s.new\", pas->pw_name);\n"
  },
  {
    "path": "packages/busybox/0009-networking-ftpd-no-chroot.patch",
    "content": "diff -uNr busybox-1.31.1/networking/ftpd.c busybox-1.31.1.mod/networking/ftpd.c\n--- busybox-1.31.1/networking/ftpd.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/networking/ftpd.c\t2019-11-11 22:26:50.216912741 +0200\n@@ -1301,8 +1301,11 @@\n \t\tG.root_fd = xopen(\"/\", O_RDONLY | O_DIRECTORY);\n \t\tclose_on_exec_on(G.root_fd);\n #endif\n+#ifndef __ANDROID__\n+\t\t/* Do not try chroot() on Android because it may trigger seccomp. */\n \t\tif (chroot(basedir) == 0)\n \t\t\tbasedir = \"/\";\n+#endif\n #if !BB_MMU\n \t\telse {\n \t\t\tclose(G.root_fd);\n"
  },
  {
    "path": "packages/busybox/0010-networking-httpd-default-port.patch",
    "content": "diff -uNr busybox-1.31.1/networking/httpd.c busybox-1.31.1.mod/networking/httpd.c\n--- busybox-1.31.1/networking/httpd.c\t2019-11-11 21:31:58.406733857 +0200\n+++ busybox-1.31.1.mod/networking/httpd.c\t2019-11-11 22:29:16.534250966 +0200\n@@ -232,7 +232,7 @@\n //usage:     \"\\n\t-i\t\tInetd mode\"\n //usage:     \"\\n\t-f\t\tDon't daemonize\"\n //usage:     \"\\n\t-v[v]\t\tVerbose\"\n-//usage:     \"\\n\t-p [IP:]PORT\tBind to IP:PORT (default *:80)\"\n+//usage:     \"\\n\t-p [IP:]PORT\tBind to IP:PORT (default *:8080)\"\n //usage:\tIF_FEATURE_HTTPD_SETUID(\n //usage:     \"\\n\t-u USER[:GRP]\tSet uid/gid after binding to port\")\n //usage:\tIF_FEATURE_HTTPD_BASIC_AUTH(\n@@ -488,7 +488,7 @@\n \tasm volatile(\"\":::\"memory\"); \\\n \tIF_FEATURE_HTTPD_BASIC_AUTH(g_realm = \"Web Server Authentication\";) \\\n \tIF_FEATURE_HTTPD_RANGES(range_start = -1;) \\\n-\tbind_addr_or_port = \"80\"; \\\n+\tbind_addr_or_port = \"8080\"; \\\n \tindex_page = index_html; \\\n \tfile_size = -1; \\\n } while (0)\n@@ -1004,7 +1004,7 @@\n \tif (!errno && n && n <= 0xffff)\n \t\tn = create_and_bind_stream_or_die(NULL, n);\n \telse\n-\t\tn = create_and_bind_stream_or_die(bind_addr_or_port, 80);\n+\t\tn = create_and_bind_stream_or_die(bind_addr_or_port, 8080);\n \txlisten(n, 9);\n \treturn n;\n }\n@@ -2209,7 +2209,7 @@\n \t\tif (proxy_entry) {\n \t\t\tif (verbose > 1)\n \t\t\t\tbb_error_msg(\"proxy:%s\", urlcopy);\n-\t\t\tlsa = host2sockaddr(proxy_entry->host_port, 80);\n+\t\t\tlsa = host2sockaddr(proxy_entry->host_port, 8080);\n \t\t\tif (!lsa)\n \t\t\t\tsend_headers_and_exit(HTTP_INTERNAL_SERVER_ERROR);\n \t\t\tproxy_fd = socket(lsa->u.sa.sa_family, SOCK_STREAM, 0);\n"
  },
  {
    "path": "packages/busybox/0011-networking-telnetd-default-port.patch",
    "content": "diff -uNr busybox-1.31.1/networking/telnetd.c busybox-1.31.1.mod/networking/telnetd.c\n--- busybox-1.31.1/networking/telnetd.c\t2019-11-11 22:00:22.799539737 +0200\n+++ busybox-1.31.1.mod/networking/telnetd.c\t2019-11-11 22:32:02.268344626 +0200\n@@ -707,7 +707,7 @@\n \t} else {\n \t\tmaster_fd = 0;\n \t\tif (!(opt & OPT_WAIT)) {\n-\t\t\tunsigned portnbr = 23;\n+\t\t\tunsigned portnbr = 8023;\n \t\t\tif (opt & OPT_PORT)\n \t\t\t\tportnbr = xatou16(opt_portnbr);\n \t\t\tmaster_fd = create_and_bind_stream_or_die(opt_bindaddr, portnbr);\n"
  },
  {
    "path": "packages/busybox/0012-networking-tftp-no-chroot.patch",
    "content": "diff -uNr busybox-1.31.1/networking/tftp.c busybox-1.31.1.mod/networking/tftp.c\n--- busybox-1.31.1/networking/tftp.c\t2019-06-10 13:50:53.000000000 +0300\n+++ busybox-1.31.1.mod/networking/tftp.c\t2019-11-11 22:36:27.592894669 +0200\n@@ -907,7 +907,12 @@\n \t\tG.pw = xgetpwnam(user_opt);\n \t}\n \tif (argv[0]) {\n+#ifdef __ANDROID__\n+\t\t// chroot may trigger seccomp and is allowed only for root anyway.\n+\t\txchdir(argv[0]);\n+#else\n \t\txchroot(argv[0]);\n+#endif\n \t}\n \n \tresult = recv_from_to(STDIN_FILENO,\n"
  },
  {
    "path": "packages/busybox/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://busybox.net/\nTERMUX_PKG_DESCRIPTION=\"Tiny versions of many common UNIX utilities into a single small executable\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.31.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=d0f940a72f648943c1f2211e0e3117387c31d765137d92bd8284a3fb9752a998\nTERMUX_PKG_BUILD_IN_SRC=true\n# We replace env in the old coreutils package:\nTERMUX_PKG_CONFLICTS=\"coreutils (<< 8.25-4)\"\nTERMUX_PKG_CONFFILES=\"var/service/telnetd/run var/service/telnetd/log/run var/service/ftpd/run var/service/ftpd/log/run\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_configure() {\n\t# Prevent spamming logs with useless warnings to make them more readable.\n\tCFLAGS+=\" -Wno-ignored-optimization-argument -Wno-unused-command-line-argument\"\n\n\tsed -e \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g\" \\\n\t\t-e \"s|@TERMUX_SYSROOT@|$TERMUX_STANDALONE_TOOLCHAIN/sysroot|g\" \\\n\t\t-e \"s|@TERMUX_HOST_PLATFORM@|${TERMUX_HOST_PLATFORM}|g\" \\\n\t\t-e \"s|@TERMUX_CFLAGS@|$CFLAGS|g\" \\\n\t\t-e \"s|@TERMUX_LDFLAGS@|$LDFLAGS|g\" \\\n\t\t-e \"s|@TERMUX_LDLIBS@|log|g\" \\\n\t\t$TERMUX_PKG_BUILDER_DIR/busybox.config > .config\n\n\tunset CFLAGS LDFLAGS\n\tmake oldconfig\n}\n\ntermux_step_post_make_install() {\n\tif $TERMUX_DEBUG; then\n\t\tinstall -Dm700 busybox_unstripped $PREFIX/bin/busybox\n\tfi\n\n\t# Utilities diff, mv, rm, rmdir are necessary to assist with package upgrading\n\t# after https://github.com/termux/termux-packages/issues/4070.\n\t#\n\t# Other utilities (like crond/crontab) are useful but not available\n\t# as standalone package in Termux.\n\t#\n\t# Few notes:\n\t#\n\t#  * runsv, runsvdir, sv - for things like in https://github.com/termux/termux-packages/pull/3460.\n\t#  * tcpsvd - required for ftpd applet.\n\t#  * vi - replaced by vim, but it still good to have basic text editor in bootstrap.\n\t#  * which - replaced by debianutils, but still good to have in bootstrap.\n\t#\n\trm -Rf $TERMUX_PREFIX/bin/applets\n\tmkdir -p $TERMUX_PREFIX/bin/applets\n\tcd $TERMUX_PREFIX/bin/applets\n\tfor f in crond crontab diff ftpd ftpget ftpput hostname inotifyd \\\n\t\tiostat lsof lsusb mpstat mv nmeter rm rmdir runsv runsvdir \\\n\t\tsendmail start-stop-daemon sv svlogd tcpsvd uptime usleep \\\n\t\tvi which; do\n\t\tln -s ../busybox $f\n\tdone\n\tunset f\n\n\t# Install busybox man page\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/docs/busybox.1 $TERMUX_PREFIX/share/man/man1\n\n\t# Needed for 'crontab -e' to work out of the box:\n\tlocal _CRONTABS=$TERMUX_PREFIX/var/spool/cron/crontabs\n\tmkdir -p $_CRONTABS\n\techo \"Used by the busybox crontab and crond tools\" > $_CRONTABS/README.termux\n\n\t# Setup some services\n\tmkdir -p $TERMUX_PREFIX/var/service\n\tcd $TERMUX_PREFIX/var/service\n\tmkdir -p ftpd/log telnetd/log\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > ftpd/run\n\techo 'exec busybox tcpsvd -vE 0.0.0.0 8021 ftpd /data/data/com.termux/files/home' >> ftpd/run\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > telnetd/run\n\techo 'exec busybox telnetd -F' >> telnetd/run\n\tchmod +x */run\n\ttouch telnetd/down ftpd/down\n\tln -sf $PREFIX/share/termux-services/svlogger telnetd/log/run\n\tln -sf $PREFIX/share/termux-services/svlogger ftpd/log/run\n}\n\n"
  },
  {
    "path": "packages/busybox/busybox.config",
    "content": "#\n# Automatically generated make config: don't edit\n# Busybox version: 1.31.1\n# Mon Nov 11 21:25:37 2019\n#\nCONFIG_HAVE_DOT_CONFIG=y\n\n#\n# Settings\n#\nCONFIG_DESKTOP=y\n# CONFIG_EXTRA_COMPAT is not set\n# CONFIG_FEDORA_COMPAT is not set\n# CONFIG_INCLUDE_SUSv2 is not set\nCONFIG_LONG_OPTS=y\nCONFIG_SHOW_USAGE=y\nCONFIG_FEATURE_VERBOSE_USAGE=y\nCONFIG_FEATURE_COMPRESS_USAGE=y\n# CONFIG_LFS is not set\n# CONFIG_PAM is not set\nCONFIG_FEATURE_DEVPTS=y\n# CONFIG_FEATURE_UTMP is not set\n# CONFIG_FEATURE_WTMP is not set\n# CONFIG_FEATURE_PIDFILE is not set\nCONFIG_PID_FILE_PATH=\"\"\nCONFIG_BUSYBOX=y\nCONFIG_FEATURE_SHOW_SCRIPT=y\nCONFIG_FEATURE_INSTALLER=y\nCONFIG_INSTALL_NO_USR=y\n# CONFIG_FEATURE_SUID is not set\n# CONFIG_FEATURE_SUID_CONFIG is not set\n# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set\n# CONFIG_FEATURE_PREFER_APPLETS is not set\nCONFIG_BUSYBOX_EXEC_PATH=\"/proc/self/exe\"\n# CONFIG_SELINUX is not set\n# CONFIG_FEATURE_CLEAN_UP is not set\n# CONFIG_FEATURE_SYSLOG_INFO is not set\nCONFIG_FEATURE_SYSLOG=y\nCONFIG_PLATFORM_LINUX=y\n\n#\n# Build Options\n#\n# CONFIG_STATIC is not set\nCONFIG_PIE=y\n# CONFIG_NOMMU is not set\n# CONFIG_BUILD_LIBBUSYBOX is not set\n# CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set\n# CONFIG_FEATURE_INDIVIDUAL is not set\n# CONFIG_FEATURE_SHARED_BUSYBOX is not set\nCONFIG_CROSS_COMPILER_PREFIX=\"@TERMUX_HOST_PLATFORM@-\"\nCONFIG_SYSROOT=\"@TERMUX_SYSROOT@\"\nCONFIG_EXTRA_CFLAGS=\"@TERMUX_CFLAGS@\"\nCONFIG_EXTRA_LDFLAGS=\"@TERMUX_LDFLAGS@\"\nCONFIG_EXTRA_LDLIBS=\"@TERMUX_LDLIBS@\"\n# CONFIG_USE_PORTABLE_CODE is not set\n# CONFIG_STACK_OPTIMIZATION_386 is not set\n\n#\n# Installation Options (\"make install\" behavior)\n#\n# CONFIG_INSTALL_APPLET_SYMLINKS is not set\n# CONFIG_INSTALL_APPLET_HARDLINKS is not set\n# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set\nCONFIG_INSTALL_APPLET_DONT=y\n# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set\n# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set\n# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set\nCONFIG_PREFIX=\"@TERMUX_PREFIX@\"\n\n#\n# Debugging Options\n#\n# CONFIG_DEBUG is not set\n# CONFIG_DEBUG_PESSIMIZE is not set\n# CONFIG_DEBUG_SANITIZE is not set\n# CONFIG_UNIT_TEST is not set\n# CONFIG_WERROR is not set\nCONFIG_NO_DEBUG_LIB=y\n# CONFIG_DMALLOC is not set\n# CONFIG_EFENCE is not set\n\n#\n# Library Tuning\n#\n# CONFIG_FEATURE_USE_BSS_TAIL is not set\nCONFIG_FLOAT_DURATION=y\n# CONFIG_FEATURE_RTMINMAX is not set\n# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set\nCONFIG_FEATURE_BUFFERS_USE_MALLOC=y\n# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set\n# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set\nCONFIG_PASSWORD_MINLEN=6\nCONFIG_MD5_SMALL=1\nCONFIG_SHA3_SMALL=1\n# CONFIG_FEATURE_FAST_TOP is not set\n# CONFIG_FEATURE_ETC_NETWORKS is not set\n# CONFIG_FEATURE_ETC_SERVICES is not set\nCONFIG_FEATURE_EDITING=y\nCONFIG_FEATURE_EDITING_MAX_LEN=1024\nCONFIG_FEATURE_EDITING_VI=y\nCONFIG_FEATURE_EDITING_HISTORY=255\nCONFIG_FEATURE_EDITING_SAVEHISTORY=y\nCONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y\nCONFIG_FEATURE_REVERSE_SEARCH=y\nCONFIG_FEATURE_TAB_COMPLETION=y\n# CONFIG_FEATURE_USERNAME_COMPLETION is not set\nCONFIG_FEATURE_EDITING_FANCY_PROMPT=y\nCONFIG_FEATURE_EDITING_WINCH=y\nCONFIG_FEATURE_EDITING_ASK_TERMINAL=y\n# CONFIG_LOCALE_SUPPORT is not set\nCONFIG_UNICODE_SUPPORT=y\n# CONFIG_UNICODE_USING_LOCALE is not set\n# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set\nCONFIG_SUBST_WCHAR=63\nCONFIG_LAST_SUPPORTED_WCHAR=0\n# CONFIG_UNICODE_COMBINING_WCHARS is not set\nCONFIG_UNICODE_WIDE_WCHARS=y\n# CONFIG_UNICODE_BIDI_SUPPORT is not set\n# CONFIG_UNICODE_NEUTRAL_TABLE is not set\n# CONFIG_UNICODE_PRESERVE_BROKEN is not set\nCONFIG_FEATURE_NON_POSIX_CP=y\nCONFIG_FEATURE_VERBOSE_CP_MESSAGE=y\nCONFIG_FEATURE_USE_SENDFILE=y\nCONFIG_FEATURE_COPYBUF_KB=4\n# CONFIG_FEATURE_SKIP_ROOTFS is not set\n# CONFIG_MONOTONIC_SYSCALL is not set\n# CONFIG_IOCTL_HEX2STR_ERROR is not set\n# CONFIG_FEATURE_HWIB is not set\n\n#\n# Applets\n#\n\n#\n# Archival Utilities\n#\nCONFIG_FEATURE_SEAMLESS_XZ=y\nCONFIG_FEATURE_SEAMLESS_LZMA=y\nCONFIG_FEATURE_SEAMLESS_BZ2=y\nCONFIG_FEATURE_SEAMLESS_GZ=y\nCONFIG_FEATURE_SEAMLESS_Z=y\nCONFIG_AR=y\nCONFIG_FEATURE_AR_LONG_FILENAMES=y\nCONFIG_FEATURE_AR_CREATE=y\nCONFIG_UNCOMPRESS=y\nCONFIG_GUNZIP=y\nCONFIG_ZCAT=y\nCONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y\nCONFIG_BUNZIP2=y\nCONFIG_BZCAT=y\nCONFIG_UNLZMA=y\nCONFIG_LZCAT=y\nCONFIG_LZMA=y\nCONFIG_UNXZ=y\nCONFIG_XZCAT=y\nCONFIG_XZ=y\nCONFIG_BZIP2=y\nCONFIG_BZIP2_SMALL=0\nCONFIG_FEATURE_BZIP2_DECOMPRESS=y\nCONFIG_CPIO=y\nCONFIG_FEATURE_CPIO_O=y\nCONFIG_FEATURE_CPIO_P=y\n# CONFIG_DPKG is not set\n# CONFIG_DPKG_DEB is not set\nCONFIG_GZIP=y\nCONFIG_FEATURE_GZIP_LONG_OPTIONS=y\nCONFIG_GZIP_FAST=0\nCONFIG_FEATURE_GZIP_LEVELS=y\nCONFIG_FEATURE_GZIP_DECOMPRESS=y\nCONFIG_LZOP=y\nCONFIG_UNLZOP=y\nCONFIG_LZOPCAT=y\nCONFIG_LZOP_COMPR_HIGH=y\n# CONFIG_RPM is not set\n# CONFIG_RPM2CPIO is not set\nCONFIG_TAR=y\nCONFIG_FEATURE_TAR_LONG_OPTIONS=y\nCONFIG_FEATURE_TAR_CREATE=y\nCONFIG_FEATURE_TAR_AUTODETECT=y\nCONFIG_FEATURE_TAR_FROM=y\nCONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y\nCONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y\nCONFIG_FEATURE_TAR_GNU_EXTENSIONS=y\nCONFIG_FEATURE_TAR_TO_COMMAND=y\nCONFIG_FEATURE_TAR_UNAME_GNAME=y\nCONFIG_FEATURE_TAR_NOPRESERVE_TIME=y\n# CONFIG_FEATURE_TAR_SELINUX is not set\nCONFIG_UNZIP=y\nCONFIG_FEATURE_UNZIP_CDF=y\nCONFIG_FEATURE_UNZIP_BZIP2=y\nCONFIG_FEATURE_UNZIP_LZMA=y\nCONFIG_FEATURE_UNZIP_XZ=y\nCONFIG_FEATURE_LZMA_FAST=y\n\n#\n# Coreutils\n#\nCONFIG_BASENAME=y\nCONFIG_CAT=y\nCONFIG_FEATURE_CATN=y\nCONFIG_FEATURE_CATV=y\nCONFIG_CHGRP=y\nCONFIG_CHMOD=y\nCONFIG_CHOWN=y\nCONFIG_FEATURE_CHOWN_LONG_OPTIONS=y\nCONFIG_CHROOT=y\nCONFIG_CKSUM=y\nCONFIG_COMM=y\nCONFIG_CP=y\nCONFIG_FEATURE_CP_LONG_OPTIONS=y\nCONFIG_FEATURE_CP_REFLINK=y\nCONFIG_CUT=y\nCONFIG_DATE=y\nCONFIG_FEATURE_DATE_ISOFMT=y\n# CONFIG_FEATURE_DATE_NANO is not set\nCONFIG_FEATURE_DATE_COMPAT=y\nCONFIG_DD=y\nCONFIG_FEATURE_DD_SIGNAL_HANDLING=y\nCONFIG_FEATURE_DD_THIRD_STATUS_LINE=y\nCONFIG_FEATURE_DD_IBS_OBS=y\nCONFIG_FEATURE_DD_STATUS=y\n# CONFIG_DF is not set\n# CONFIG_FEATURE_DF_FANCY is not set\nCONFIG_DIRNAME=y\nCONFIG_DOS2UNIX=y\nCONFIG_UNIX2DOS=y\nCONFIG_DU=y\nCONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y\nCONFIG_ECHO=y\nCONFIG_FEATURE_FANCY_ECHO=y\nCONFIG_ENV=y\nCONFIG_EXPAND=y\nCONFIG_UNEXPAND=y\nCONFIG_EXPR=y\nCONFIG_EXPR_MATH_SUPPORT_64=y\nCONFIG_FACTOR=y\nCONFIG_FALSE=y\nCONFIG_FOLD=y\nCONFIG_HEAD=y\nCONFIG_FEATURE_FANCY_HEAD=y\n# CONFIG_HOSTID is not set\nCONFIG_ID=y\nCONFIG_GROUPS=y\nCONFIG_INSTALL=y\nCONFIG_FEATURE_INSTALL_LONG_OPTIONS=y\nCONFIG_LINK=y\nCONFIG_LN=y\n# CONFIG_LOGNAME is not set\nCONFIG_LS=y\nCONFIG_FEATURE_LS_FILETYPES=y\nCONFIG_FEATURE_LS_FOLLOWLINKS=y\nCONFIG_FEATURE_LS_RECURSIVE=y\nCONFIG_FEATURE_LS_WIDTH=y\nCONFIG_FEATURE_LS_SORTFILES=y\nCONFIG_FEATURE_LS_TIMESTAMPS=y\nCONFIG_FEATURE_LS_USERNAME=y\nCONFIG_FEATURE_LS_COLOR=y\nCONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y\nCONFIG_MD5SUM=y\nCONFIG_SHA1SUM=y\nCONFIG_SHA256SUM=y\nCONFIG_SHA512SUM=y\nCONFIG_SHA3SUM=y\n\n#\n# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum\n#\nCONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y\nCONFIG_MKDIR=y\nCONFIG_MKFIFO=y\nCONFIG_MKNOD=y\nCONFIG_MKTEMP=y\nCONFIG_MV=y\nCONFIG_NICE=y\nCONFIG_NL=y\nCONFIG_NOHUP=y\nCONFIG_NPROC=y\nCONFIG_OD=y\nCONFIG_PASTE=y\nCONFIG_PRINTENV=y\nCONFIG_PRINTF=y\nCONFIG_PWD=y\nCONFIG_READLINK=y\nCONFIG_FEATURE_READLINK_FOLLOW=y\nCONFIG_REALPATH=y\nCONFIG_RM=y\nCONFIG_RMDIR=y\nCONFIG_SEQ=y\nCONFIG_SHRED=y\nCONFIG_SHUF=y\nCONFIG_SLEEP=y\nCONFIG_FEATURE_FANCY_SLEEP=y\nCONFIG_SORT=y\nCONFIG_FEATURE_SORT_BIG=y\n# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set\nCONFIG_SPLIT=y\nCONFIG_FEATURE_SPLIT_FANCY=y\nCONFIG_STAT=y\nCONFIG_FEATURE_STAT_FORMAT=y\nCONFIG_FEATURE_STAT_FILESYSTEM=y\nCONFIG_STTY=y\nCONFIG_SUM=y\nCONFIG_SYNC=y\n# CONFIG_FEATURE_SYNC_FANCY is not set\nCONFIG_FSYNC=y\nCONFIG_TAC=y\nCONFIG_TAIL=y\nCONFIG_FEATURE_FANCY_TAIL=y\nCONFIG_TEE=y\nCONFIG_FEATURE_TEE_USE_BLOCK_IO=y\nCONFIG_TEST=y\nCONFIG_TEST1=y\nCONFIG_TEST2=y\nCONFIG_FEATURE_TEST_64=y\nCONFIG_TIMEOUT=y\nCONFIG_TOUCH=y\n# CONFIG_FEATURE_TOUCH_NODEREF is not set\nCONFIG_FEATURE_TOUCH_SUSV3=y\nCONFIG_TR=y\nCONFIG_FEATURE_TR_CLASSES=y\nCONFIG_FEATURE_TR_EQUIV=y\nCONFIG_TRUE=y\nCONFIG_TRUNCATE=y\nCONFIG_TTY=y\nCONFIG_UNAME=y\nCONFIG_UNAME_OSNAME=\"Android\"\nCONFIG_BB_ARCH=y\nCONFIG_UNIQ=y\nCONFIG_UNLINK=y\nCONFIG_USLEEP=y\nCONFIG_UUDECODE=y\nCONFIG_BASE64=y\nCONFIG_UUENCODE=y\nCONFIG_WC=y\nCONFIG_FEATURE_WC_LARGE=y\nCONFIG_WHOAMI=y\n# CONFIG_WHO is not set\n# CONFIG_W is not set\n# CONFIG_USERS is not set\nCONFIG_YES=y\n\n#\n# Common options\n#\nCONFIG_FEATURE_VERBOSE=y\n\n#\n# Common options for cp and mv\n#\nCONFIG_FEATURE_PRESERVE_HARDLINKS=y\n\n#\n# Common options for df, du, ls\n#\nCONFIG_FEATURE_HUMAN_READABLE=y\n\n#\n# Console Utilities\n#\n# CONFIG_CHVT is not set\nCONFIG_CLEAR=y\n# CONFIG_DEALLOCVT is not set\n# CONFIG_DUMPKMAP is not set\n# CONFIG_FGCONSOLE is not set\n# CONFIG_KBD_MODE is not set\n# CONFIG_LOADFONT is not set\n# CONFIG_SETFONT is not set\n# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set\nCONFIG_DEFAULT_SETFONT_DIR=\"\"\n# CONFIG_FEATURE_LOADFONT_PSF2 is not set\n# CONFIG_FEATURE_LOADFONT_RAW is not set\n# CONFIG_LOADKMAP is not set\n# CONFIG_OPENVT is not set\nCONFIG_RESET=y\nCONFIG_RESIZE=y\nCONFIG_FEATURE_RESIZE_PRINT=y\n# CONFIG_SETCONSOLE is not set\n# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set\n# CONFIG_SETKEYCODES is not set\n# CONFIG_SETLOGCONS is not set\n# CONFIG_SHOWKEY is not set\n\n#\n# Debian Utilities\n#\nCONFIG_PIPE_PROGRESS=y\nCONFIG_RUN_PARTS=y\nCONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y\nCONFIG_FEATURE_RUN_PARTS_FANCY=y\nCONFIG_START_STOP_DAEMON=y\nCONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y\nCONFIG_FEATURE_START_STOP_DAEMON_FANCY=y\nCONFIG_WHICH=y\n\n#\n# klibc-utils\n#\n# CONFIG_MINIPS is not set\n# CONFIG_NUKE is not set\n# CONFIG_RESUME is not set\n# CONFIG_RUN_INIT is not set\n\n#\n# Editors\n#\nCONFIG_AWK=y\nCONFIG_FEATURE_AWK_LIBM=y\nCONFIG_FEATURE_AWK_GNU_EXTENSIONS=y\nCONFIG_CMP=y\nCONFIG_DIFF=y\nCONFIG_FEATURE_DIFF_LONG_OPTIONS=y\nCONFIG_FEATURE_DIFF_DIR=y\nCONFIG_ED=y\nCONFIG_PATCH=y\nCONFIG_SED=y\nCONFIG_VI=y\nCONFIG_FEATURE_VI_MAX_LEN=4096\nCONFIG_FEATURE_VI_8BIT=y\nCONFIG_FEATURE_VI_COLON=y\nCONFIG_FEATURE_VI_YANKMARK=y\nCONFIG_FEATURE_VI_SEARCH=y\n# CONFIG_FEATURE_VI_REGEX_SEARCH is not set\nCONFIG_FEATURE_VI_USE_SIGNALS=y\nCONFIG_FEATURE_VI_DOT_CMD=y\nCONFIG_FEATURE_VI_READONLY=y\nCONFIG_FEATURE_VI_SETOPTS=y\nCONFIG_FEATURE_VI_SET=y\nCONFIG_FEATURE_VI_WIN_RESIZE=y\nCONFIG_FEATURE_VI_ASK_TERMINAL=y\nCONFIG_FEATURE_VI_UNDO=y\nCONFIG_FEATURE_VI_UNDO_QUEUE=y\nCONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256\nCONFIG_FEATURE_ALLOW_EXEC=y\n\n#\n# Finding Utilities\n#\nCONFIG_FIND=y\nCONFIG_FEATURE_FIND_PRINT0=y\nCONFIG_FEATURE_FIND_MTIME=y\nCONFIG_FEATURE_FIND_MMIN=y\nCONFIG_FEATURE_FIND_PERM=y\nCONFIG_FEATURE_FIND_TYPE=y\nCONFIG_FEATURE_FIND_EXECUTABLE=y\nCONFIG_FEATURE_FIND_XDEV=y\nCONFIG_FEATURE_FIND_MAXDEPTH=y\nCONFIG_FEATURE_FIND_NEWER=y\nCONFIG_FEATURE_FIND_INUM=y\nCONFIG_FEATURE_FIND_EXEC=y\nCONFIG_FEATURE_FIND_EXEC_PLUS=y\nCONFIG_FEATURE_FIND_USER=y\nCONFIG_FEATURE_FIND_GROUP=y\nCONFIG_FEATURE_FIND_NOT=y\nCONFIG_FEATURE_FIND_DEPTH=y\nCONFIG_FEATURE_FIND_PAREN=y\nCONFIG_FEATURE_FIND_SIZE=y\nCONFIG_FEATURE_FIND_PRUNE=y\nCONFIG_FEATURE_FIND_QUIT=y\nCONFIG_FEATURE_FIND_DELETE=y\nCONFIG_FEATURE_FIND_PATH=y\nCONFIG_FEATURE_FIND_REGEX=y\n# CONFIG_FEATURE_FIND_CONTEXT is not set\nCONFIG_FEATURE_FIND_LINKS=y\nCONFIG_GREP=y\nCONFIG_EGREP=y\nCONFIG_FGREP=y\nCONFIG_FEATURE_GREP_CONTEXT=y\nCONFIG_XARGS=y\nCONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y\nCONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y\nCONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y\nCONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y\nCONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y\nCONFIG_FEATURE_XARGS_SUPPORT_PARALLEL=y\nCONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y\n\n#\n# Init Utilities\n#\n# CONFIG_BOOTCHARTD is not set\n# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set\n# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set\n# CONFIG_HALT is not set\n# CONFIG_POWEROFF is not set\n# CONFIG_REBOOT is not set\n# CONFIG_FEATURE_WAIT_FOR_INIT is not set\n# CONFIG_FEATURE_CALL_TELINIT is not set\nCONFIG_TELINIT_PATH=\"\"\n# CONFIG_INIT is not set\n# CONFIG_LINUXRC is not set\n# CONFIG_FEATURE_USE_INITTAB is not set\n# CONFIG_FEATURE_KILL_REMOVED is not set\nCONFIG_FEATURE_KILL_DELAY=0\n# CONFIG_FEATURE_INIT_SCTTY is not set\n# CONFIG_FEATURE_INIT_SYSLOG is not set\n# CONFIG_FEATURE_INIT_QUIET is not set\n# CONFIG_FEATURE_INIT_COREDUMPS is not set\nCONFIG_INIT_TERMINAL_TYPE=\"\"\n# CONFIG_FEATURE_INIT_MODIFY_CMDLINE is not set\n\n#\n# Login/Password Management Utilities\n#\n# CONFIG_FEATURE_SHADOWPASSWDS is not set\n# CONFIG_USE_BB_PWD_GRP is not set\n# CONFIG_USE_BB_SHADOW is not set\nCONFIG_USE_BB_CRYPT=y\n# CONFIG_USE_BB_CRYPT_SHA is not set\n# CONFIG_ADDGROUP is not set\n# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set\n# CONFIG_ADD_SHELL is not set\n# CONFIG_REMOVE_SHELL is not set\n# CONFIG_ADDUSER is not set\n# CONFIG_FEATURE_CHECK_NAMES is not set\nCONFIG_LAST_ID=0\nCONFIG_FIRST_SYSTEM_ID=0\nCONFIG_LAST_SYSTEM_ID=0\n# CONFIG_CHPASSWD is not set\nCONFIG_FEATURE_DEFAULT_PASSWD_ALGO=\"\"\n# CONFIG_CRYPTPW is not set\n# CONFIG_MKPASSWD is not set\n# CONFIG_DELUSER is not set\n# CONFIG_DELGROUP is not set\n# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set\n# CONFIG_GETTY is not set\n# CONFIG_LOGIN is not set\n# CONFIG_LOGIN_SESSION_AS_CHILD is not set\n# CONFIG_LOGIN_SCRIPTS is not set\n# CONFIG_FEATURE_NOLOGIN is not set\n# CONFIG_FEATURE_SECURETTY is not set\n# CONFIG_PASSWD is not set\n# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set\n# CONFIG_SU is not set\n# CONFIG_FEATURE_SU_SYSLOG is not set\n# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set\n# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set\n# CONFIG_SULOGIN is not set\n# CONFIG_VLOCK is not set\n\n#\n# Linux Ext2 FS Progs\n#\nCONFIG_CHATTR=y\n# CONFIG_FSCK is not set\nCONFIG_LSATTR=y\nCONFIG_TUNE2FS=y\n\n#\n# Linux Module Utilities\n#\n# CONFIG_MODPROBE_SMALL is not set\n# CONFIG_DEPMOD is not set\n# CONFIG_INSMOD is not set\n# CONFIG_LSMOD is not set\n# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set\n# CONFIG_MODINFO is not set\n# CONFIG_MODPROBE is not set\n# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set\n# CONFIG_RMMOD is not set\n\n#\n# Options common to multiple modutils\n#\n# CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS is not set\n# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set\n# CONFIG_FEATURE_2_4_MODULES is not set\n# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set\n# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set\n# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set\n# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set\n# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set\n# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set\n# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set\n# CONFIG_FEATURE_MODUTILS_ALIAS is not set\n# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set\nCONFIG_DEFAULT_MODULES_DIR=\"\"\nCONFIG_DEFAULT_DEPMOD_FILE=\"\"\n\n#\n# Linux System Utilities\n#\n# CONFIG_ACPID is not set\n# CONFIG_FEATURE_ACPID_COMPAT is not set\nCONFIG_BLKDISCARD=y\nCONFIG_BLKID=y\nCONFIG_FEATURE_BLKID_TYPE=y\nCONFIG_BLOCKDEV=y\nCONFIG_CAL=y\nCONFIG_CHRT=y\nCONFIG_DMESG=y\nCONFIG_FEATURE_DMESG_PRETTY=y\n# CONFIG_EJECT is not set\n# CONFIG_FEATURE_EJECT_SCSI is not set\nCONFIG_FALLOCATE=y\n# CONFIG_FATATTR is not set\n# CONFIG_FBSET is not set\n# CONFIG_FEATURE_FBSET_FANCY is not set\n# CONFIG_FEATURE_FBSET_READMODE is not set\n# CONFIG_FDFORMAT is not set\nCONFIG_FDISK=y\nCONFIG_FDISK_SUPPORT_LARGE_DISKS=y\nCONFIG_FEATURE_FDISK_WRITABLE=y\nCONFIG_FEATURE_AIX_LABEL=y\nCONFIG_FEATURE_SGI_LABEL=y\nCONFIG_FEATURE_SUN_LABEL=y\nCONFIG_FEATURE_OSF_LABEL=y\nCONFIG_FEATURE_GPT_LABEL=y\nCONFIG_FEATURE_FDISK_ADVANCED=y\nCONFIG_FINDFS=y\nCONFIG_FLOCK=y\n# CONFIG_FDFLUSH is not set\n# CONFIG_FREERAMDISK is not set\n# CONFIG_FSCK_MINIX is not set\n# CONFIG_FSFREEZE is not set\nCONFIG_FSTRIM=y\nCONFIG_GETOPT=y\nCONFIG_FEATURE_GETOPT_LONG=y\nCONFIG_HEXDUMP=y\nCONFIG_FEATURE_HEXDUMP_REVERSE=y\nCONFIG_HD=y\nCONFIG_XXD=y\nCONFIG_HWCLOCK=y\n# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set\nCONFIG_IONICE=y\n# CONFIG_IPCRM is not set\n# CONFIG_IPCS is not set\n# CONFIG_LAST is not set\n# CONFIG_FEATURE_LAST_FANCY is not set\nCONFIG_LOSETUP=y\nCONFIG_LSPCI=y\nCONFIG_LSUSB=y\n# CONFIG_MDEV is not set\n# CONFIG_FEATURE_MDEV_CONF is not set\n# CONFIG_FEATURE_MDEV_RENAME is not set\n# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set\n# CONFIG_FEATURE_MDEV_EXEC is not set\n# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set\n# CONFIG_FEATURE_MDEV_DAEMON is not set\n# CONFIG_MESG is not set\n# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set\nCONFIG_MKE2FS=y\nCONFIG_MKFS_EXT2=y\n# CONFIG_MKFS_MINIX is not set\n# CONFIG_FEATURE_MINIX2 is not set\n# CONFIG_MKFS_REISER is not set\nCONFIG_MKDOSFS=y\nCONFIG_MKFS_VFAT=y\nCONFIG_MKSWAP=y\nCONFIG_FEATURE_MKSWAP_UUID=y\nCONFIG_MORE=y\nCONFIG_MOUNT=y\nCONFIG_FEATURE_MOUNT_FAKE=y\nCONFIG_FEATURE_MOUNT_VERBOSE=y\nCONFIG_FEATURE_MOUNT_HELPERS=y\nCONFIG_FEATURE_MOUNT_LABEL=y\n# CONFIG_FEATURE_MOUNT_NFS is not set\nCONFIG_FEATURE_MOUNT_CIFS=y\nCONFIG_FEATURE_MOUNT_FLAGS=y\n# CONFIG_FEATURE_MOUNT_FSTAB is not set\n# CONFIG_FEATURE_MOUNT_OTHERTAB is not set\nCONFIG_MOUNTPOINT=y\n# CONFIG_NOLOGIN is not set\n# CONFIG_NOLOGIN_DEPENDENCIES is not set\nCONFIG_NSENTER=y\nCONFIG_PIVOT_ROOT=y\nCONFIG_RDATE=y\n# CONFIG_RDEV is not set\n# CONFIG_READPROFILE is not set\nCONFIG_RENICE=y\nCONFIG_REV=y\n# CONFIG_RTCWAKE is not set\nCONFIG_SCRIPT=y\nCONFIG_SCRIPTREPLAY=y\nCONFIG_SETARCH=y\nCONFIG_LINUX32=y\nCONFIG_LINUX64=y\n# CONFIG_SETPRIV is not set\n# CONFIG_FEATURE_SETPRIV_DUMP is not set\n# CONFIG_FEATURE_SETPRIV_CAPABILITIES is not set\n# CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES is not set\nCONFIG_SETSID=y\n# CONFIG_SWAPON is not set\n# CONFIG_FEATURE_SWAPON_DISCARD is not set\n# CONFIG_FEATURE_SWAPON_PRI is not set\n# CONFIG_SWAPOFF is not set\n# CONFIG_FEATURE_SWAPONOFF_LABEL is not set\nCONFIG_SWITCH_ROOT=y\n# CONFIG_TASKSET is not set\n# CONFIG_FEATURE_TASKSET_FANCY is not set\n# CONFIG_UEVENT is not set\nCONFIG_UMOUNT=y\n# CONFIG_FEATURE_UMOUNT_ALL is not set\nCONFIG_UNSHARE=y\n# CONFIG_WALL is not set\n\n#\n# Common options for mount/umount\n#\nCONFIG_FEATURE_MOUNT_LOOP=y\nCONFIG_FEATURE_MOUNT_LOOP_CREATE=y\n# CONFIG_FEATURE_MTAB_SUPPORT is not set\nCONFIG_VOLUMEID=y\n\n#\n# Filesystem/Volume identification\n#\nCONFIG_FEATURE_VOLUMEID_BCACHE=y\nCONFIG_FEATURE_VOLUMEID_BTRFS=y\nCONFIG_FEATURE_VOLUMEID_CRAMFS=y\nCONFIG_FEATURE_VOLUMEID_EXFAT=y\nCONFIG_FEATURE_VOLUMEID_EXT=y\nCONFIG_FEATURE_VOLUMEID_F2FS=y\nCONFIG_FEATURE_VOLUMEID_FAT=y\nCONFIG_FEATURE_VOLUMEID_HFS=y\nCONFIG_FEATURE_VOLUMEID_ISO9660=y\nCONFIG_FEATURE_VOLUMEID_JFS=y\nCONFIG_FEATURE_VOLUMEID_LFS=y\nCONFIG_FEATURE_VOLUMEID_LINUXRAID=y\nCONFIG_FEATURE_VOLUMEID_LINUXSWAP=y\nCONFIG_FEATURE_VOLUMEID_LUKS=y\nCONFIG_FEATURE_VOLUMEID_MINIX=y\nCONFIG_FEATURE_VOLUMEID_NILFS=y\nCONFIG_FEATURE_VOLUMEID_NTFS=y\nCONFIG_FEATURE_VOLUMEID_OCFS2=y\nCONFIG_FEATURE_VOLUMEID_REISERFS=y\nCONFIG_FEATURE_VOLUMEID_ROMFS=y\nCONFIG_FEATURE_VOLUMEID_SQUASHFS=y\nCONFIG_FEATURE_VOLUMEID_SYSV=y\nCONFIG_FEATURE_VOLUMEID_UBIFS=y\nCONFIG_FEATURE_VOLUMEID_UDF=y\nCONFIG_FEATURE_VOLUMEID_XFS=y\n\n#\n# Miscellaneous Utilities\n#\n# CONFIG_ADJTIMEX is not set\nCONFIG_BBCONFIG=y\nCONFIG_FEATURE_COMPRESS_BBCONFIG=y\nCONFIG_BC=y\nCONFIG_DC=y\nCONFIG_FEATURE_DC_BIG=y\n# CONFIG_FEATURE_DC_LIBM is not set\nCONFIG_FEATURE_BC_INTERACTIVE=y\nCONFIG_FEATURE_BC_LONG_OPTIONS=y\n# CONFIG_BEEP is not set\nCONFIG_FEATURE_BEEP_FREQ=0\nCONFIG_FEATURE_BEEP_LENGTH_MS=0\n# CONFIG_CHAT is not set\n# CONFIG_FEATURE_CHAT_NOFAIL is not set\n# CONFIG_FEATURE_CHAT_TTY_HIFI is not set\n# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set\n# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set\n# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set\n# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set\n# CONFIG_FEATURE_CHAT_CLR_ABORT is not set\n# CONFIG_CONSPY is not set\nCONFIG_CROND=y\nCONFIG_FEATURE_CROND_D=y\nCONFIG_FEATURE_CROND_CALL_SENDMAIL=y\nCONFIG_FEATURE_CROND_SPECIAL_TIMES=y\nCONFIG_FEATURE_CROND_DIR=\"@TERMUX_PREFIX@/var/spool/cron\"\nCONFIG_CRONTAB=y\n# CONFIG_DEVFSD is not set\n# CONFIG_DEVFSD_MODLOAD is not set\n# CONFIG_DEVFSD_FG_NP is not set\n# CONFIG_DEVFSD_VERBOSE is not set\n# CONFIG_FEATURE_DEVFS is not set\n# CONFIG_DEVMEM is not set\n# CONFIG_FBSPLASH is not set\n# CONFIG_FLASHCP is not set\n# CONFIG_FLASH_ERASEALL is not set\n# CONFIG_FLASH_LOCK is not set\n# CONFIG_FLASH_UNLOCK is not set\n# CONFIG_HDPARM is not set\n# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set\n# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set\n# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set\n# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set\n# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set\n# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set\nCONFIG_HEXEDIT=y\n# CONFIG_I2CGET is not set\n# CONFIG_I2CSET is not set\n# CONFIG_I2CDUMP is not set\n# CONFIG_I2CDETECT is not set\n# CONFIG_I2CTRANSFER is not set\nCONFIG_INOTIFYD=y\nCONFIG_LESS=y\nCONFIG_FEATURE_LESS_MAXLINES=9999999\nCONFIG_FEATURE_LESS_BRACKETS=y\nCONFIG_FEATURE_LESS_FLAGS=y\nCONFIG_FEATURE_LESS_TRUNCATE=y\nCONFIG_FEATURE_LESS_MARKS=y\nCONFIG_FEATURE_LESS_REGEXP=y\nCONFIG_FEATURE_LESS_WINCH=y\nCONFIG_FEATURE_LESS_ASK_TERMINAL=y\nCONFIG_FEATURE_LESS_DASHCMD=y\nCONFIG_FEATURE_LESS_LINENUMS=y\nCONFIG_FEATURE_LESS_RAW=y\nCONFIG_FEATURE_LESS_ENV=y\nCONFIG_LSSCSI=y\n# CONFIG_MAKEDEVS is not set\n# CONFIG_FEATURE_MAKEDEVS_LEAF is not set\n# CONFIG_FEATURE_MAKEDEVS_TABLE is not set\n# CONFIG_MAN is not set\n# CONFIG_MICROCOM is not set\n# CONFIG_MT is not set\n# CONFIG_NANDWRITE is not set\n# CONFIG_NANDDUMP is not set\n# CONFIG_PARTPROBE is not set\n# CONFIG_RAIDAUTORUN is not set\n# CONFIG_READAHEAD is not set\nCONFIG_RFKILL=y\n# CONFIG_RUNLEVEL is not set\nCONFIG_RX=y\n# CONFIG_SETFATTR is not set\n# CONFIG_SETSERIAL is not set\nCONFIG_STRINGS=y\nCONFIG_TIME=y\n# CONFIG_TS is not set\nCONFIG_TTYSIZE=y\n# CONFIG_UBIRENAME is not set\n# CONFIG_UBIATTACH is not set\n# CONFIG_UBIDETACH is not set\n# CONFIG_UBIMKVOL is not set\n# CONFIG_UBIRMVOL is not set\n# CONFIG_UBIRSVOL is not set\n# CONFIG_UBIUPDATEVOL is not set\n# CONFIG_VOLNAME is not set\n# CONFIG_WATCHDOG is not set\n\n#\n# Networking Utilities\n#\n# CONFIG_FEATURE_IPV6 is not set\nCONFIG_FEATURE_UNIX_LOCAL=y\n# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set\nCONFIG_VERBOSE_RESOLUTION_ERRORS=y\n# CONFIG_FEATURE_TLS_SHA1 is not set\nCONFIG_ARP=y\nCONFIG_ARPING=y\nCONFIG_BRCTL=y\nCONFIG_FEATURE_BRCTL_FANCY=y\nCONFIG_FEATURE_BRCTL_SHOW=y\n# CONFIG_DNSD is not set\n# CONFIG_ETHER_WAKE is not set\nCONFIG_FTPD=y\nCONFIG_FEATURE_FTPD_WRITE=y\nCONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y\n# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set\nCONFIG_FTPGET=y\nCONFIG_FTPPUT=y\nCONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y\nCONFIG_HOSTNAME=y\nCONFIG_DNSDOMAINNAME=y\nCONFIG_HTTPD=y\nCONFIG_FEATURE_HTTPD_RANGES=y\n# CONFIG_FEATURE_HTTPD_SETUID is not set\nCONFIG_FEATURE_HTTPD_BASIC_AUTH=y\n# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set\nCONFIG_FEATURE_HTTPD_CGI=y\nCONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y\nCONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y\nCONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y\nCONFIG_FEATURE_HTTPD_ERROR_PAGES=y\nCONFIG_FEATURE_HTTPD_PROXY=y\nCONFIG_FEATURE_HTTPD_GZIP=y\nCONFIG_IFCONFIG=y\nCONFIG_FEATURE_IFCONFIG_STATUS=y\n# CONFIG_FEATURE_IFCONFIG_SLIP is not set\nCONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y\nCONFIG_FEATURE_IFCONFIG_HW=y\nCONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y\n# CONFIG_IFENSLAVE is not set\n# CONFIG_IFPLUGD is not set\n# CONFIG_IFUP is not set\n# CONFIG_IFDOWN is not set\nCONFIG_IFUPDOWN_IFSTATE_PATH=\"\"\n# CONFIG_FEATURE_IFUPDOWN_IP is not set\n# CONFIG_FEATURE_IFUPDOWN_IPV4 is not set\n# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set\n# CONFIG_FEATURE_IFUPDOWN_MAPPING is not set\n# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set\n# CONFIG_INETD is not set\n# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set\n# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set\n# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set\n# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set\n# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set\n# CONFIG_FEATURE_INETD_RPC is not set\nCONFIG_IP=y\nCONFIG_IPADDR=y\nCONFIG_IPLINK=y\nCONFIG_IPROUTE=y\nCONFIG_IPTUNNEL=y\nCONFIG_IPRULE=y\nCONFIG_IPNEIGH=y\nCONFIG_FEATURE_IP_ADDRESS=y\nCONFIG_FEATURE_IP_LINK=y\nCONFIG_FEATURE_IP_ROUTE=y\nCONFIG_FEATURE_IP_ROUTE_DIR=\"@TERMUX_PREFIX@/etc/iproute2\"\nCONFIG_FEATURE_IP_TUNNEL=y\nCONFIG_FEATURE_IP_RULE=y\nCONFIG_FEATURE_IP_NEIGH=y\n# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set\nCONFIG_IPCALC=y\nCONFIG_FEATURE_IPCALC_LONG_OPTIONS=y\nCONFIG_FEATURE_IPCALC_FANCY=y\n# CONFIG_FAKEIDENTD is not set\n# CONFIG_NAMEIF is not set\n# CONFIG_FEATURE_NAMEIF_EXTENDED is not set\n# CONFIG_NBDCLIENT is not set\nCONFIG_NC=y\nCONFIG_NETCAT=y\nCONFIG_NC_SERVER=y\nCONFIG_NC_EXTRA=y\nCONFIG_NC_110_COMPAT=y\nCONFIG_NETSTAT=y\nCONFIG_FEATURE_NETSTAT_WIDE=y\nCONFIG_FEATURE_NETSTAT_PRG=y\n# CONFIG_NSLOOKUP is not set\n# CONFIG_FEATURE_NSLOOKUP_BIG is not set\n# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set\n# CONFIG_NTPD is not set\n# CONFIG_FEATURE_NTPD_SERVER is not set\n# CONFIG_FEATURE_NTPD_CONF is not set\n# CONFIG_FEATURE_NTP_AUTH is not set\nCONFIG_PING=y\n# CONFIG_PING6 is not set\nCONFIG_FEATURE_FANCY_PING=y\nCONFIG_PSCAN=y\nCONFIG_ROUTE=y\n# CONFIG_SLATTACH is not set\n# CONFIG_SSL_CLIENT is not set\nCONFIG_TC=y\nCONFIG_FEATURE_TC_INGRESS=y\nCONFIG_TCPSVD=y\nCONFIG_UDPSVD=y\nCONFIG_TELNET=y\nCONFIG_FEATURE_TELNET_TTYPE=y\nCONFIG_FEATURE_TELNET_AUTOLOGIN=y\nCONFIG_FEATURE_TELNET_WIDTH=y\nCONFIG_TELNETD=y\nCONFIG_FEATURE_TELNETD_STANDALONE=y\n# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set\nCONFIG_TFTP=y\nCONFIG_FEATURE_TFTP_PROGRESS_BAR=y\n# CONFIG_FEATURE_TFTP_HPA_COMPAT is not set\nCONFIG_TFTPD=y\nCONFIG_FEATURE_TFTP_GET=y\nCONFIG_FEATURE_TFTP_PUT=y\nCONFIG_FEATURE_TFTP_BLOCKSIZE=y\n# CONFIG_TFTP_DEBUG is not set\n# CONFIG_TLS is not set\nCONFIG_TRACEROUTE=y\n# CONFIG_TRACEROUTE6 is not set\nCONFIG_FEATURE_TRACEROUTE_VERBOSE=y\nCONFIG_FEATURE_TRACEROUTE_USE_ICMP=y\nCONFIG_TUNCTL=y\nCONFIG_FEATURE_TUNCTL_UG=y\nCONFIG_VCONFIG=y\nCONFIG_WGET=y\nCONFIG_FEATURE_WGET_LONG_OPTIONS=y\nCONFIG_FEATURE_WGET_STATUSBAR=y\nCONFIG_FEATURE_WGET_AUTHENTICATION=y\nCONFIG_FEATURE_WGET_TIMEOUT=y\n# CONFIG_FEATURE_WGET_HTTPS is not set\n# CONFIG_FEATURE_WGET_OPENSSL is not set\nCONFIG_WHOIS=y\n# CONFIG_ZCIP is not set\n# CONFIG_UDHCPD is not set\n# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set\n# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set\nCONFIG_DHCPD_LEASES_FILE=\"\"\n# CONFIG_DUMPLEASES is not set\n# CONFIG_DHCPRELAY is not set\n# CONFIG_UDHCPC is not set\n# CONFIG_FEATURE_UDHCPC_ARPING is not set\n# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set\nCONFIG_UDHCPC_DEFAULT_SCRIPT=\"\"\n# CONFIG_UDHCPC6 is not set\n# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set\n# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set\n# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set\n# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set\n# CONFIG_FEATURE_UDHCP_PORT is not set\nCONFIG_UDHCP_DEBUG=0\nCONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0\n# CONFIG_FEATURE_UDHCP_RFC3397 is not set\n# CONFIG_FEATURE_UDHCP_8021Q is not set\nCONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=\"\"\n\n#\n# Print Utilities\n#\n# CONFIG_LPD is not set\n# CONFIG_LPR is not set\n# CONFIG_LPQ is not set\n\n#\n# Mail Utilities\n#\nCONFIG_MAKEMIME=y\nCONFIG_POPMAILDIR=y\nCONFIG_FEATURE_POPMAILDIR_DELIVERY=y\nCONFIG_REFORMIME=y\nCONFIG_FEATURE_REFORMIME_COMPAT=y\nCONFIG_SENDMAIL=y\nCONFIG_FEATURE_MIME_CHARSET=\"us-ascii\"\n\n#\n# Process Utilities\n#\nCONFIG_FREE=y\nCONFIG_FUSER=y\nCONFIG_IOSTAT=y\nCONFIG_KILL=y\nCONFIG_KILLALL=y\nCONFIG_KILLALL5=y\nCONFIG_LSOF=y\nCONFIG_MPSTAT=y\nCONFIG_NMETER=y\nCONFIG_PGREP=y\nCONFIG_PKILL=y\nCONFIG_PIDOF=y\nCONFIG_FEATURE_PIDOF_SINGLE=y\nCONFIG_FEATURE_PIDOF_OMIT=y\nCONFIG_PMAP=y\n# CONFIG_POWERTOP is not set\n# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set\nCONFIG_PS=y\n# CONFIG_FEATURE_PS_WIDE is not set\n# CONFIG_FEATURE_PS_LONG is not set\nCONFIG_FEATURE_PS_TIME=y\n# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set\nCONFIG_FEATURE_PS_ADDITIONAL_COLUMNS=y\nCONFIG_PSTREE=y\nCONFIG_PWDX=y\nCONFIG_SMEMCAP=y\nCONFIG_BB_SYSCTL=y\nCONFIG_TOP=y\nCONFIG_FEATURE_TOP_INTERACTIVE=y\nCONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y\nCONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y\nCONFIG_FEATURE_TOP_SMP_CPU=y\nCONFIG_FEATURE_TOP_DECIMALS=y\nCONFIG_FEATURE_TOP_SMP_PROCESS=y\nCONFIG_FEATURE_TOPMEM=y\nCONFIG_UPTIME=y\n# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set\nCONFIG_WATCH=y\nCONFIG_FEATURE_SHOW_THREADS=y\n\n#\n# Runit Utilities\n#\nCONFIG_CHPST=y\nCONFIG_SETUIDGID=y\n# CONFIG_ENVUIDGID is not set\nCONFIG_ENVDIR=y\nCONFIG_SOFTLIMIT=y\nCONFIG_RUNSV=y\nCONFIG_RUNSVDIR=y\n# CONFIG_FEATURE_RUNSVDIR_LOG is not set\nCONFIG_SV=y\nCONFIG_SV_DEFAULT_SERVICE_DIR=\"@TERMUX_PREFIX@/var/service\"\n# CONFIG_SVC is not set\n# CONFIG_SVOK is not set\nCONFIG_SVLOGD=y\n# CONFIG_CHCON is not set\n# CONFIG_GETENFORCE is not set\n# CONFIG_GETSEBOOL is not set\n# CONFIG_LOAD_POLICY is not set\n# CONFIG_MATCHPATHCON is not set\n# CONFIG_RUNCON is not set\n# CONFIG_SELINUXENABLED is not set\n# CONFIG_SESTATUS is not set\n# CONFIG_SETENFORCE is not set\n# CONFIG_SETFILES is not set\n# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set\n# CONFIG_RESTORECON is not set\n# CONFIG_SETSEBOOL is not set\n\n#\n# Shells\n#\nCONFIG_SH_IS_ASH=y\n# CONFIG_SH_IS_HUSH is not set\n# CONFIG_SH_IS_NONE is not set\n# CONFIG_BASH_IS_ASH is not set\n# CONFIG_BASH_IS_HUSH is not set\nCONFIG_BASH_IS_NONE=y\nCONFIG_ASH=y\nCONFIG_ASH_OPTIMIZE_FOR_SIZE=y\nCONFIG_ASH_INTERNAL_GLOB=y\nCONFIG_ASH_BASH_COMPAT=y\n# CONFIG_ASH_BASH_SOURCE_CURDIR is not set\nCONFIG_ASH_BASH_NOT_FOUND_HOOK=y\nCONFIG_ASH_JOB_CONTROL=y\nCONFIG_ASH_ALIAS=y\nCONFIG_ASH_RANDOM_SUPPORT=y\nCONFIG_ASH_EXPAND_PRMT=y\nCONFIG_ASH_IDLE_TIMEOUT=y\nCONFIG_ASH_MAIL=y\nCONFIG_ASH_ECHO=y\nCONFIG_ASH_PRINTF=y\nCONFIG_ASH_TEST=y\nCONFIG_ASH_HELP=y\nCONFIG_ASH_GETOPTS=y\nCONFIG_ASH_CMDCMD=y\n# CONFIG_CTTYHACK is not set\n# CONFIG_HUSH is not set\n# CONFIG_HUSH_BASH_COMPAT is not set\n# CONFIG_HUSH_BRACE_EXPANSION is not set\n# CONFIG_HUSH_LINENO_VAR is not set\n# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set\n# CONFIG_HUSH_INTERACTIVE is not set\n# CONFIG_HUSH_SAVEHISTORY is not set\n# CONFIG_HUSH_JOB is not set\n# CONFIG_HUSH_TICK is not set\n# CONFIG_HUSH_IF is not set\n# CONFIG_HUSH_LOOPS is not set\n# CONFIG_HUSH_CASE is not set\n# CONFIG_HUSH_FUNCTIONS is not set\n# CONFIG_HUSH_LOCAL is not set\n# CONFIG_HUSH_RANDOM_SUPPORT is not set\n# CONFIG_HUSH_MODE_X is not set\n# CONFIG_HUSH_ECHO is not set\n# CONFIG_HUSH_PRINTF is not set\n# CONFIG_HUSH_TEST is not set\n# CONFIG_HUSH_HELP is not set\n# CONFIG_HUSH_EXPORT is not set\n# CONFIG_HUSH_EXPORT_N is not set\n# CONFIG_HUSH_READONLY is not set\n# CONFIG_HUSH_KILL is not set\n# CONFIG_HUSH_WAIT is not set\n# CONFIG_HUSH_COMMAND is not set\n# CONFIG_HUSH_TRAP is not set\n# CONFIG_HUSH_TYPE is not set\n# CONFIG_HUSH_TIMES is not set\n# CONFIG_HUSH_READ is not set\n# CONFIG_HUSH_SET is not set\n# CONFIG_HUSH_UNSET is not set\n# CONFIG_HUSH_ULIMIT is not set\n# CONFIG_HUSH_UMASK is not set\n# CONFIG_HUSH_GETOPTS is not set\n# CONFIG_HUSH_MEMLEAK is not set\n\n#\n# Options common to all shells\n#\nCONFIG_FEATURE_SH_MATH=y\nCONFIG_FEATURE_SH_MATH_64=y\n# CONFIG_FEATURE_SH_MATH_BASE is not set\nCONFIG_FEATURE_SH_EXTRA_QUIET=y\n# CONFIG_FEATURE_SH_STANDALONE is not set\n# CONFIG_FEATURE_SH_NOFORK is not set\nCONFIG_FEATURE_SH_READ_FRAC=y\nCONFIG_FEATURE_SH_HISTFILESIZE=y\n# CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set\n\n#\n# System Logging Utilities\n#\n# CONFIG_KLOGD is not set\n# CONFIG_FEATURE_KLOGD_KLOGCTL is not set\n# CONFIG_LOGGER is not set\n# CONFIG_LOGREAD is not set\n# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set\n# CONFIG_SYSLOGD is not set\n# CONFIG_FEATURE_ROTATE_LOGFILE is not set\n# CONFIG_FEATURE_REMOTE_LOG is not set\n# CONFIG_FEATURE_SYSLOGD_DUP is not set\n# CONFIG_FEATURE_SYSLOGD_CFG is not set\nCONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0\n# CONFIG_FEATURE_IPC_SYSLOG is not set\nCONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0\n# CONFIG_FEATURE_KMSG_SYSLOG is not set\n"
  },
  {
    "path": "packages/bvi/Makefile.in.patch",
    "content": "--- bvi-1.4.0/Makefile.in\t2014-10-01 11:59:36.000000000 -0700\n+++ src/Makefile.in\t2017-02-19 00:34:01.662869384 -0800\n@@ -72,8 +72,8 @@\n \t@$(INSTALL_DATA) bmore.help $(helpdir)\n \t@if [ -f $(bindir)/bview ]; then rm $(bindir)/bview; fi\n \t@if [ -f $(bindir)/bvedit ]; then rm $(bindir)/bvedit; fi\n-\t@ln $(bindir)/bvi $(bindir)/bview\n-\t@ln $(bindir)/bvi $(bindir)/bvedit\n+\t@ln -s $(bindir)/bvi $(bindir)/bview\n+\t@ln -s $(bindir)/bvi $(bindir)/bvedit\n \n installdirs:\n \t$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(helpdir) $(man1dir)\n"
  },
  {
    "path": "packages/bvi/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://bvi.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Binary file editor based on vi\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_VERSION=1.4.1\nTERMUX_PKG_SRCURL=http://sourceforge.net/projects/bvi/files/bvi/${TERMUX_PKG_VERSION}/bvi-${TERMUX_PKG_VERSION}.src.tar.gz\nTERMUX_PKG_SHA256=3035255ca79e0464567d255baa5544f7794e2b7eb791dcc60cc339cf1aa01e28\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_lib_ncursesw6_addnwstr=yes\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/applications share/pixmaps\"\n"
  },
  {
    "path": "packages/bvi/column_number_bugfix.patch",
    "content": "--- bvi-1.4.0/bvi.c\t2014-10-07 13:09:45.000000000 -0700\n+++ src/bvi.c\t2017-02-19 00:35:24.587363303 -0800\n@@ -729,7 +729,6 @@\n \tchar\t*arg;\n {\n \toff_t\tval;\n-\textern int errno;\n \tchar\t*poi;\n \n \terrno = 0;\n--- bvi-1.4.0/set.c\t2014-09-30 05:00:53.000000000 -0700\n+++ src/set.c\t2017-02-19 00:36:08.927600541 -0800\n@@ -135,7 +135,7 @@\n \t\t\t\t\tif (((COLS - AnzAdd - 1) / 4) >= P(P_CM)) {\n \t\t\t\t\t\tAnzahl = P(P_CM);\n \t\t\t\t\t} else {\n-\t\t\t\t\t\tAnzahl = P(P_CM) = ((COLS - AnzAdd - 1) / 4);\n+\t\t\t\t\t\tAnzahl = P(P_CM) = ((COLS - AnzAdd - 1) / 16) * 4;\n \t\t\t\t\t}\n \t\t\t\t    maxx = Anzahl * 4 + AnzAdd + 1;\n \t\t\t\t    Anzahl3 = Anzahl * 3;\n"
  },
  {
    "path": "packages/bvi/comm.c.patch",
    "content": "diff -u -r ../bvi-1.4.0/comm.c ./comm.c\n--- ../bvi-1.4.0/comm.c\t2014-01-29 14:54:53.000000000 +0000\n+++ ./comm.c\t2017-07-07 07:11:55.310380582 +0000\n@@ -84,10 +84,10 @@\n extern\tchar\t*name;\t\t\t/* actual filename */\n extern\tchar\t**files;\t\t/* used for \"next\" and \"rewind\" */\n extern\tint\t\tnumfiles, curfile;\n-extern\tint\t\terrno;\n \n static\tchar\toldbuf[CMDSZ];\t\t/** for :!! command **/\n \n+int save_chk(char* fname, char* start, char* end, int flags);\n \n /*\n  * docmdline() - handle a colon command\n"
  },
  {
    "path": "packages/byobu/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://byobu.co/\nTERMUX_PKG_DESCRIPTION=\"Byobu is a GPLv3 open source text-based window manager and terminal multiplexer\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=5.130\nTERMUX_PKG_SRCURL=https://launchpad.net/byobu/trunk/${TERMUX_PKG_VERSION}/+download/byobu_${TERMUX_PKG_VERSION}.orig.tar.gz\nTERMUX_PKG_SHA256=47e414161dda124287b9ec1cf94acc716b49e7428c6ec7efeed181f477e17461\nTERMUX_PKG_DEPENDS=\"gawk, tmux\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/byobu/usr-bin-byobu.in.patch",
    "content": "diff -u -r ../byobu-5.122/usr/bin/byobu.in ./usr/bin/byobu.in\n--- ../byobu-5.122/usr/bin/byobu.in\t2017-08-09 23:53:48.000000000 +0200\n+++ ./usr/bin/byobu.in\t2017-09-20 01:31:55.576848354 +0200\n@@ -46,7 +46,7 @@\n \t\t. \"$HOME/.byoburc\"\n \tfi\n fi\n-export BYOBU_CHARMAP=$(locale charmap)\n+export BYOBU_CHARMAP=UTF-8\n [ -r \"$HOME/.byoburc\" ] && . \"$HOME/.byoburc\"\n [ -z \"${BYOBU_PREFIX}\" ] && export BYOBU_PREFIX=\"@prefix@\" || export BYOBU_PREFIX\n . \"${BYOBU_PREFIX}/lib/${PKG}/include/common\"\n"
  },
  {
    "path": "packages/c-ares/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://c-ares.haxx.se\nTERMUX_PKG_DESCRIPTION=\"Library for asynchronous DNS requests (including name resolves)\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.15.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/c-ares/c-ares/archive/cares-${TERMUX_PKG_VERSION//./_}.tar.gz\nTERMUX_PKG_SHA256=7deb7872cbd876c29036d5f37e30c4cbc3cc068d59d8b749ef85bb0736649f04\nTERMUX_PKG_BREAKS=\"c-ares-dev\"\nTERMUX_PKG_REPLACES=\"c-ares-dev\"\n# Build with cmake to install cmake/c-ares/*.cmake files:\nTERMUX_PKG_FORCE_CMAKE=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/\"\n"
  },
  {
    "path": "packages/c-ares/disable-ares-android.patch",
    "content": "diff -u -r ../c-ares-cares-1_15_0/ares_android.c ./ares_android.c\n--- ../c-ares-cares-1_15_0/ares_android.c\t2018-10-23 13:49:22.000000000 +0000\n+++ ./ares_android.c\t2018-11-01 02:26:38.968483738 +0000\n@@ -12,7 +12,7 @@\n  * this software for any purpose.  It is provided \"as is\"\n  * without express or implied warranty.\n  */\n-#if defined(ANDROID) || defined(__ANDROID__)\n+#if defined(__DISABLED_IN_TERMUX__)\n \n #include <jni.h>\n \ndiff -u -r ../c-ares-cares-1_15_0/ares_init.c ./ares_init.c\n--- ../c-ares-cares-1_15_0/ares_init.c\t2018-10-23 13:49:22.000000000 +0000\n+++ ./ares_init.c\t2018-11-01 02:29:03.106824681 +0000\n@@ -44,7 +44,6 @@\n \n #if defined(ANDROID) || defined(__ANDROID__)\n #include <sys/system_properties.h>\n-#include \"ares_android.h\"\n /* From the Bionic sources */\n #define DNS_PROP_NAME_PREFIX  \"net.dns\"\n #define MAX_DNS_PROPERTIES    8\n@@ -1549,35 +1548,6 @@\n   char *domains;\n   size_t num_servers;\n \n-  /* Use the Android connectivity manager to get a list\n-   * of DNS servers. As of Android 8 (Oreo) net.dns#\n-   * system properties are no longer available. Google claims this\n-   * improves privacy. Apps now need the ACCESS_NETWORK_STATE\n-   * permission and must use the ConnectivityManager which\n-   * is Java only. */\n-  dns_servers = ares_get_android_server_list(MAX_DNS_PROPERTIES, &num_servers);\n-  if (dns_servers != NULL)\n-  {\n-    for (i = 0; i < num_servers; i++)\n-    {\n-      status = config_nameserver(&servers, &nservers, dns_servers[i]);\n-      if (status != ARES_SUCCESS)\n-        break;\n-      status = ARES_EOF;\n-    }\n-    for (i = 0; i < num_servers; i++)\n-    {\n-      ares_free(dns_servers[i]);\n-    }\n-    ares_free(dns_servers);\n-  }\n-  if (channel->ndomains == -1)\n-  {\n-    domains = ares_get_android_search_domains_list();\n-    set_search(channel, domains);\n-    ares_free(domains);\n-  }\n-\n #  ifdef HAVE___SYSTEM_PROPERTY_GET\n   /* Old way using the system property still in place as\n    * a fallback. Older android versions can still use this.\ndiff -u -r ../c-ares-cares-1_15_0/ares_library_init.c ./ares_library_init.c\n--- ../c-ares-cares-1_15_0/ares_library_init.c\t2018-10-23 13:49:22.000000000 +0000\n+++ ./ares_library_init.c\t2018-11-01 02:26:38.972483691 +0000\n@@ -30,10 +30,6 @@\n fpGetBestRoute2_t ares_fpGetBestRoute2 = ZERO_NULL;\n #endif\n \n-#if defined(ANDROID) || defined(__ANDROID__)\n-#include \"ares_android.h\"\n-#endif\n-\n /* library-private global vars with source visibility restricted to this file */\n \n static unsigned int ares_initialized;\n@@ -174,10 +170,6 @@\n   if (ares_init_flags & ARES_LIB_INIT_WIN32)\n     ares_win32_cleanup();\n \n-#if defined(ANDROID) || defined(__ANDROID__)\n-  ares_library_cleanup_android();\n-#endif\n-\n   ares_init_flags = ARES_LIB_INIT_NONE;\n   ares_malloc = malloc;\n   ares_realloc = realloc;\n"
  },
  {
    "path": "packages/c-ares/fix-path-etc-hosts.patch",
    "content": "diff -uNr c-ares-1.13.0/ares_private.h c-ares-1.13.0.mod/ares_private.h\n--- c-ares-1.13.0/ares_private.h\t2017-06-16 15:53:03.000000000 +0300\n+++ c-ares-1.13.0.mod/ares_private.h\t2017-09-12 11:24:17.332992105 +0300\n@@ -84,7 +84,7 @@\n #ifdef ETC_INET\n #define PATH_HOSTS              \"/etc/inet/hosts\"\n #else\n-#define PATH_HOSTS              \"/etc/hosts\"\n+#define PATH_HOSTS              \"@TERMUX_PREFIX@/etc/hosts\"\n #endif\n \n #endif\n"
  },
  {
    "path": "packages/c-toxcore/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://tox.chat\nTERMUX_PKG_DESCRIPTION=\"Backend library for the Tox protocol\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.2.10\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=5ccc4ecd79b95c367efe8341b06bf2a81f853032e6fcd7cb2bc0ad0ef7419d40\nTERMUX_PKG_SRCURL=https://github.com/TokTok/toxcore/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libsodium\"\nTERMUX_PKG_BREAKS=\"c-toxcore-dev\"\nTERMUX_PKG_REPLACES=\"c-toxcore-dev\"\n#TERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DCMAKE_INSTALL_PREFIX=${TERMUX_PREFIX}\n-DCMAKE_INSTALL_LIBDIR=${TERMUX_PREFIX}/lib\n-DBOOTSTRAP_DAEMON=off\n-DDHT_BOOTSTRAP=off\n-DBUILD_TOXAV=off\n-DBUILD_AV_TEST=off\n\"\n"
  },
  {
    "path": "packages/ca-certificates/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://curl.haxx.se/docs/caextract.html\nTERMUX_PKG_DESCRIPTION=\"Common CA certificates\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=20200101\nTERMUX_PKG_SRCURL=https://curl.haxx.se/ca/cacert.pem\n# If the checksum has changed, it may be time to update the package version:\nTERMUX_PKG_SHA256=adf770dfd574a0d6026bfaa270cb6879b063957177a991d453ff1d302c02081f\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tlocal CERTDIR=$TERMUX_PREFIX/etc/tls\n\tlocal CERTFILE=$CERTDIR/cert.pem\n\n\tmkdir -p $CERTDIR\n\n\ttermux_download $TERMUX_PKG_SRCURL \\\n\t\t$CERTFILE \\\n\t\t$TERMUX_PKG_SHA256\n\ttouch $CERTFILE\n\n\t# Build java keystore which is split out into a ca-certificates-java subpackage:\n\tlocal KEYUTIL_JAR=$TERMUX_PKG_CACHEDIR/keyutil-0.4.0.jar\n\ttermux_download \\\n\t\thttps://github.com/use-sparingly/keyutil/releases/download/0.4.0/keyutil-0.4.0.jar \\\n\t\t$KEYUTIL_JAR \\\n\t\t18f1d2c82839d84949b1ad015343c509e81ef678c24db6112acc6c0761314610\n\n\tlocal JAVA_KEYSTORE_DIR=$PREFIX/lib/jvm/openjdk-9/lib/security\n\tmkdir -p $JAVA_KEYSTORE_DIR\n\n\tjava -jar $KEYUTIL_JAR \\\n\t\t--import \\\n\t\t--new-keystore $JAVA_KEYSTORE_DIR/jssecacerts \\\n\t\t--password changeit \\\n\t\t--force-new-overwrite \\\n\t\t--import-pem-file $CERTFILE\n}\n"
  },
  {
    "path": "packages/ca-certificates/ca-certificates-java.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/jvm\"\nTERMUX_SUBPKG_DESCRIPTION=\"Common CA certificates (java keystore format)\"\nTERMUX_SUBPKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/cabextract/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.cabextract.org.uk/\nTERMUX_PKG_DESCRIPTION=\"A program to extract Microsoft cabinet (.CAB) files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.9.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://cabextract.org.uk/cabextract-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=afc253673c8ef316b4d5c29cc4aa8445844bee14afffbe092ee9469405851ca7\n"
  },
  {
    "path": "packages/caddy/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://caddyserver.com/\nTERMUX_PKG_DESCRIPTION=\"Fast, cross-platform HTTP/2 web server\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.0.4\nTERMUX_PKG_SRCURL=https://github.com/mholt/caddy/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=bf81245d2b347c89a8e8aa358a224b722d55cb6e1c266bbdffbe6acc54d130a5\n\ntermux_step_make() {\n\ttermux_setup_golang\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\n\tmkdir -p $GOPATH/src/github.com/mholt/\n\tcp -a $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/mholt/caddy\n\n\tcd $GOPATH/src/github.com/mholt/caddy/caddy\n\texport GO111MODULE=on\n\tgo build\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 $GOPATH/src/github.com/mholt/caddy/caddy/caddy \\\n\t\t$TERMUX_PREFIX/bin/caddy\n}\n"
  },
  {
    "path": "packages/calcurse/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://calcurse.org/\nTERMUX_PKG_DESCRIPTION=\"calcurse is a calendar and scheduling application for the command line\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=4.5.1\nTERMUX_PKG_SRCURL=https://calcurse.org/files/calcurse-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=5336576824cba7d40eee0b33213992b4304368972ef556a930f3965e9068f331\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses\"\n\ntermux_step_pre_configure() {\n\texport ac_cv_lib_pthread_pthread_create=yes\n}\n"
  },
  {
    "path": "packages/calcurse/io.c.patch",
    "content": "diff -u -r ../calcurse-4.4.0/src/io.c ./src/io.c\n--- ../calcurse-4.4.0/src/io.c\t2019-02-04 20:44:04.000000000 +0000\n+++ ./src/io.c\t2019-03-01 20:49:16.393057747 +0000\n@@ -1399,7 +1399,6 @@\n \tEXIT_IF(delay < 0, _(\"Invalid delay\"));\n \tchar *mesg = _(\"Periodic save: data files have changed. Save cancelled.\");\n \n-\tpthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);\n \tfor (;;) {\n \t\tsleep(delay * MININSEC);\n \t\tpthread_mutex_lock(&io_periodic_save_mutex);\n@@ -1424,8 +1423,7 @@\n \n \t/* Lock the mutex to avoid cancelling the thread during saving. */\n \tpthread_mutex_lock(&io_periodic_save_mutex);\n-\tpthread_cancel(io_t_psave);\n-\tpthread_join(io_t_psave, NULL);\n+\tpthread_kill(io_t_psave, 0);\n \tpthread_mutex_unlock(&io_periodic_save_mutex);\n \tio_t_psave = pthread_self();\n }\n"
  },
  {
    "path": "packages/calcurse/src-notify.c.patch",
    "content": "diff -u -r ../calcurse-4.4.0/src/notify.c ./src/notify.c\n--- ../calcurse-4.4.0/src/notify.c\t2019-01-18 22:38:58.000000000 +0000\n+++ ./src/notify.c\t2019-03-01 20:45:55.019585998 +0000\n@@ -196,8 +196,7 @@\n \tif (pthread_equal(notify_t_main, pthread_self()))\n \t\treturn;\n \n-\tpthread_cancel(notify_t_main);\n-\tpthread_join(notify_t_main, NULL);\n+\tpthread_kill(notify_t_main, 0);\n \tnotify_t_main = pthread_self();\n }\n \n"
  },
  {
    "path": "packages/calcurse/src-ui-calendar.c.patch",
    "content": "diff -u -r ../calcurse-4.4.0/src/ui-calendar.c ./src/ui-calendar.c\n--- ../calcurse-4.4.0/src/ui-calendar.c\t2019-01-18 22:38:58.000000000 +0000\n+++ ./src/ui-calendar.c\t2019-03-01 20:47:58.622033795 +0000\n@@ -123,8 +123,7 @@\n \tif (pthread_equal(ui_calendar_t_date, pthread_self()))\n \t\treturn;\n \n-\tpthread_cancel(ui_calendar_t_date);\n-\tpthread_join(ui_calendar_t_date, NULL);\n+\tpthread_kill(ui_calendar_t_date, 0);\n \tui_calendar_t_date = pthread_self();\n }\n \n"
  },
  {
    "path": "packages/capstone/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.capstone-engine.org/\nTERMUX_PKG_DESCRIPTION=\"Lightweight multi-platform, multi-architecture disassembly framework\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=4.0.1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/aquynh/capstone/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=79bbea8dbe466bd7d051e037db5961fdb34f67c9fac5c3471dd105cfb1e05dc7\nTERMUX_PKG_BREAKS=\"capstone-dev\"\nTERMUX_PKG_REPLACES=\"capstone-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DINSTALL_LIB_DIR=$TERMUX_PREFIX/lib\"\n"
  },
  {
    "path": "packages/cava/Makefile.am.patch",
    "content": "diff -uNr cava-0.6.1/Makefile.am cava-0.6.1.mod/Makefile.am\n--- cava-0.6.1/Makefile.am\t2018-05-03 19:07:33.000000000 +0300\n+++ cava-0.6.1.mod/Makefile.am\t2019-08-16 13:48:27.945938729 +0300\n@@ -11,7 +11,7 @@\n bin_PROGRAMS = cava\n cava_SOURCES = cava.c\n cava_LDADD = -liniparser\n-cava_LDFLAGS = -L/usr/local/lib -Wl,-rpath /usr/local/lib\n+cava_LDFLAGS =\n cava_CPPFLAGS = -DPACKAGE=\\\"$(PACKAGE)\\\" -DVERSION=\\\"$(VERSION)\\\" \\\n            -D_POSIX_SOURCE -D _POSIX_C_SOURCE=200809L\n cava_CFLAGS = -std=c99 -Wall -Wextra -Wno-unused-result -Wno-maybe-uninitialized \n"
  },
  {
    "path": "packages/cava/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/karlstav/cava\nTERMUX_PKG_DESCRIPTION=\"Console-based Audio Visualizer. Works with MPD and Pulseaudio\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_VERSION=0.6.1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=98b880e7e704ed457863f379f31b488e06076bb34a5de02825096969b916a78d\nTERMUX_PKG_SRCURL=https://github.com/karlstav/cava/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"ncurses,fftw,pulseaudio\"\nTERMUX_PKG_BUILD_DEPENDS=\"libtool\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/cava/config.c.patch",
    "content": "diff --git a/config.c b/config.c\nindex 1da11cd..2e9ddd8 100644\n--- a/config.c\n+++ b/config.c\n@@ -396,7 +396,7 @@ if (strcmp(inputMethod, \"alsa\") == 0) {\n }\n if (strcmp(inputMethod, \"fifo\") == 0) {\n \tp->im = 2;\n-\tp->audio_source = (char *)iniparser_getstring(ini, \"input:source\", \"/tmp/mpd.fifo\");\n+\tp->audio_source = (char *)iniparser_getstring(ini, \"input:source\", \"@TERMUX_PREFIX@/tmp/mpd.fifo\");\n }\n if (strcmp(inputMethod, \"pulse\") == 0) {\n \tp->im = 3;\n"
  },
  {
    "path": "packages/cava/configure.ac.patch",
    "content": "diff --git a/configure.ac b/configure.ac\nindex 6e3c291..c9d706e 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -31,9 +31,9 @@ dnl ######################\n \n AC_CHECK_HEADERS([pthread.h],\n \tAC_CHECK_LIB(pthread, pthread_create, LIBS=\"$LIBS -lpthread\",\n-\t\tAC_MSG_ERROR([pthread.h found but there is no pthread library to make use of])\n+\t\tAC_MSG_NOTICE([pthread.h found but there is no pthread library to make use of])\n \t),\n-\tAC_MSG_ERROR([no pthread.h header header file found])\n+\tAC_MSG_NOTICE([no pthread.h header header file found])\n )\n \n \n@@ -152,7 +152,7 @@ AS_IF([test \"x$enable_legacy_iniparser\" = \"xyes\"], [\n dnl ############################\n dnl Set font directory\n dnl ############################\n-DEFAULT_FONT_DIR=\"/usr/share/consolefonts\"\n+DEFAULT_FONT_DIR=\"@TERMUX_PREFIX@/share/consolefonts\"\n AC_ARG_VAR(FONT_DIR, [Directory where the font will be installed.])\n if test -z \"$FONT_DIR\" ; then\n   FONT_DIR=\"$DEFAULT_FONT_DIR\"\n"
  },
  {
    "path": "packages/cboard/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://benkibbey.wordpress.com/cboard/\nTERMUX_PKG_DESCRIPTION=\"PGN browser, editor and chess engine frontend\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.7.5\nTERMUX_PKG_SHA256=dd748039f3531653e1573577cd814741524e1b16e16e3a841ef512e5150da6a0\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/c-board/${TERMUX_PKG_VERSION}/cboard-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"libandroid-support,libandroid-glob,gnuchess, ncurses, ncurses-ui-libs\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -DLINE_MAX=_POSIX2_LINE_MAX\"\n\tLDFLAGS+=\" -landroid-glob\"\n\n\tif $TERMUX_DEBUG; then\n\t\t# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:\n\t\t# /home/builder/.termux-build/cboard/src/libchess/pgn.c:2235:33: error: 'umask' called with invalid mode\n\t\t# mode = umask(600);\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n"
  },
  {
    "path": "packages/cboard/configure.patch",
    "content": "diff -uNr cboard-0.7.5/configure cboard-0.7.5.mod/configure\n--- cboard-0.7.5/configure\t2018-09-27 17:48:24.000000000 +0300\n+++ cboard-0.7.5.mod/configure\t2019-08-16 14:05:44.294565834 +0300\n@@ -12194,13 +12194,8 @@\n \n { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for Unix98 pty support\" >&5\n $as_echo_n \"checking for Unix98 pty support... \" >&6; }\n-if test -c \"/dev/ptmx\"; then\n-    have_ptmx=yes\n-else\n-    have_ptmx=no\n-fi\n-\n-ptmx_works=no\n+have_ptmx=yes\n+ptmx_works=yes\n \n if test \"x$have_ptmx\" = \"xyes\"; then\n     ac_ext=c\n@@ -12210,40 +12205,7 @@\n ac_compiler_gnu=$ac_cv_c_compiler_gnu\n \n     if test \"$cross_compiling\" = yes; then :\n-  { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n-$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\n-as_fn_error $? \"cannot run test program while cross compiling\n-See \\`config.log' for more details\" \"$LINENO\" 5; }\n-else\n-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n-/* end confdefs.h.  */\n-\\\n-\t\t   #include <stdio.h>\n-\t\t   #include <sys/types.h>\n-\t\t   #include <sys/stat.h>\n-\t\t   #include <fcntl.h>\n-\n-\t\t   int main()\n-\t\t   {\n-\t\t       int fd;\n-\n-\t\t       if ((fd = open(\"/dev/ptmx\", O_RDWR)) == -1)\n-\t\t           exit(1);\n-\n-\t\t       if (ptsname(fd) == NULL)\n-\t\t           exit(1);\n-\n-\t\t       exit(0);\n-\t\t   }\n-\n-_ACEOF\n-if ac_fn_c_try_run \"$LINENO\"; then :\n   ptmx_works=yes\n-else\n-  ptmx_works=no\n-fi\n-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n-  conftest.$ac_objext conftest.beam conftest.$ac_ext\n fi\n \n \n"
  },
  {
    "path": "packages/cboard/libchess-pgn.c.patch",
    "content": "diff -u -r ../cboard-0.7.5/libchess/pgn.c ./libchess/pgn.c\n--- ../cboard-0.7.5/libchess/pgn.c\t2018-09-17 15:58:48.000000000 +0000\n+++ ./libchess/pgn.c\t2018-12-19 00:16:27.204984323 +0000\n@@ -883,7 +883,6 @@\n   time_t now;\n   char tbuf[11] = { 0 };\n   struct tm *tp;\n-  struct passwd *pw = getpwuid (getuid ());\n   char host[64] = { 0 };\n \n   time (&now);\n@@ -904,7 +903,7 @@\n   if (pgn_tag_add (&g->tag, (char *) \"Round\", (char *) \"-\") != E_PGN_OK)\n     warn (\"pgn_tag_add()\");\n \n-  if (pgn_tag_add (&g->tag, (char *) \"White\", pw->pw_gecos) != E_PGN_OK)\n+  if (pgn_tag_add (&g->tag, (char *) \"White\", (char *) \"You\") != E_PGN_OK)\n     warn (\"pgn_tag_add()\");\n \n   if (pgn_tag_add (&g->tag, (char *) \"Black\", (char *) \"?\") != E_PGN_OK)\n"
  },
  {
    "path": "packages/ccache/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ccache.samba.org\nTERMUX_PKG_DESCRIPTION=\"Compiler cache for fast recompilation of C/C++ code\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=3.7.6\nTERMUX_PKG_SRCURL=https://github.com/ccache/ccache/releases/download/v$TERMUX_PKG_VERSION/ccache-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=73e2633ac9bca387b5a39c72a8f85634670c4091dab639228c433898163c86c0\nTERMUX_PKG_DEPENDS=\"zlib\"\n"
  },
  {
    "path": "packages/ccnet/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/haiwen/ccnet\nTERMUX_PKG_DESCRIPTION=\"Ccnet is a framework for writing networked applications in C\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=6.1.8\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/haiwen/ccnet/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b55636bf95232dc1db70d3604d0bebb7c3d730292d15b9b6c5b951307eb69762\nTERMUX_PKG_DEPENDS=\"libuuid, libevent, libsearpc, libsqlite, openssl\"\nTERMUX_PKG_BREAKS=\"ccnet-dev\"\nTERMUX_PKG_REPLACES=\"ccnet-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n\ntermux_step_post_configure() {\n\t# the package has trouble to prepare some headers\n\tcd $TERMUX_PKG_SRCDIR/lib\n\tpython $TERMUX_PREFIX/bin/searpc-codegen.py ../lib/rpc_table.py\n}\n"
  },
  {
    "path": "packages/ccnet/configure.ac.patch",
    "content": "--- ../ccnet/configure.ac\t2018-04-26 19:00:41.309901710 +0200\n+++ ./configure.ac\t2018-04-28 10:50:43.956523129 +0200\n@@ -76,7 +76,7 @@\n   fi\n fi\n \n-AC_CHECK_LIB(pthread, pthread_create, [echo \"found library pthread\"], AC_MSG_ERROR([*** Unable to find pthread library]), )\n+#AC_CHECK_LIB(pthread, pthread_create, [echo \"found library pthread\"], AC_MSG_ERROR([*** Unable to find pthread library]), )\n AC_CHECK_LIB(sqlite3, sqlite3_open,[echo \"found library sqlite3\"] , AC_MSG_ERROR([*** Unable to find sqlite3 library]), )\n AC_CHECK_LIB(crypto, SHA1_Init, [echo \"found library crypto\"], AC_MSG_ERROR([*** Unable to find openssl crypto library]), )\n \n@@ -98,6 +98,7 @@\n   PTHREAD_LIBS=-lpthread\n fi\n \n+PTHREAD_LIBS=\n AC_SUBST(PTHREAD_CFLAGS)\n AC_SUBST(PTHREAD_LIBS)\n \n@@ -153,6 +154,8 @@\n   LIB_DIRWATCH=\n fi\n \n+LIB_RESOLV=\"\"\n+\n AC_SUBST(LIB_WS32)\n AC_SUBST(LIB_GDI32)\n AC_SUBST(LIB_RT)\n"
  },
  {
    "path": "packages/ccrypt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://ccrypt.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Secure encryption and decryption of files and streams utility\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.11\nTERMUX_PKG_SHA256=b19c47500a96ee5fbd820f704c912f6efcc42b638c0a6aa7a4e3dc0a6b51a44f\nTERMUX_PKG_SRCURL=http://ccrypt.sourceforge.net/download/$TERMUX_PKG_VERSION/ccrypt-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libcrypt\"\n"
  },
  {
    "path": "packages/cgdb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://cgdb.github.io/\nTERMUX_PKG_DESCRIPTION=\"A lightweight curses (terminal-based) interface to the GNU Debugger (GDB)\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.7.1\nTERMUX_PKG_SRCURL=https://cgdb.me/files/cgdb-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=bb723be58ec68cb59a598b8e24a31d10ef31e0e9c277a4de07b2f457fe7de198\nTERMUX_PKG_DEPENDS=\"libc++, ncurses, readline, gdb\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_ncursesw6_addnwstr=yes ac_cv_file__dev_ptmx=yes\nac_cv_func_setpgrp_void=true ac_cv_rl_version=7\nac_cv_file__proc_self_status=yes\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/applications share/pixmaps\"\n"
  },
  {
    "path": "packages/cgdb/cgdb.cpp.patch",
    "content": "--- ../cache/cgdb-0.7.0/cgdb/cgdb.cpp\t2017-03-10 16:44:18.000000000 +0000\n+++ ./cgdb/cgdb.cpp\t2018-10-10 05:05:23.164961985 +0000\n@@ -1523,10 +1523,10 @@\n \n     /* Shut down debugger */\n     tgdb_shutdown(tgdb);\n-\n+#if !defined(__ANDROID__)\n     if (tty_set_attributes(STDIN_FILENO, &term_attributes) == -1)\n         clog_error(CLOG_CGDB, \"tty_reset error\");\n-\n+#endif\n     /* Close our logfiles */\n     tgdb_close_logfiles();\n \n@@ -1577,10 +1577,10 @@\n     masterfd = pty_pair_get_masterfd(pty_pair);\n     if (masterfd == -1)\n         return -1;\n-\n+#if !defined(__ANDROID__)\n     if (tty_off_xon_xoff(slavefd) == -1)\n-        return -1;\n-\n+      return -1;\n+#endif\n     /* The 16 is because I don't know how many char's the directory separator \n      * is going to be, I expect it to be 1, but who knows. */\n     length = strlen(cgdb_home_dir) + strlen(readline_history_filename) + 16;\n@@ -1768,12 +1768,12 @@\n         clog_error(CLOG_CGDB, \"Unable to init readline\");\n         cgdb_cleanup_and_exit(-1);\n     }\n-\n+#if !defined(__ANDROID__)\n     if (tty_cbreak(STDIN_FILENO, &term_attributes) == -1) {\n         clog_error(CLOG_CGDB, \"tty_cbreak error\");\n         cgdb_cleanup_and_exit(-1);\n     }\n-\n+#endif\n     if (init_kui() == -1) {\n         clog_error(CLOG_CGDB, \"init_kui error\");\n         cgdb_cleanup_and_exit(-1);\n"
  },
  {
    "path": "packages/chromaprint/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://acoustid.org/chromaprint\nTERMUX_PKG_DESCRIPTION=\"C library for generating audio fingerprints used by AcoustID\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1, MIT\"\nTERMUX_PKG_VERSION=1.4.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/acoustid/chromaprint/releases/download/v${TERMUX_PKG_VERSION}/chromaprint-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=ea18608b76fb88e0203b7d3e1833fb125ce9bb61efe22c6e169a50c52c457f82\nTERMUX_PKG_DEPENDS=ffmpeg\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DCMAKE_BUILD_TYPE=Release -DBUILD_TOOLS=ON -DBUILD_SHARED_LIBS=ON\"\ntermux_step_post_make_install() {\n  ln -sf \"${TERMUX_PREFIX}/lib/libchromaprint.so\" \"${TERMUX_PREFIX}/lib/libchromaprint.so.${TERMUX_PKG_VERSION:0:1}\"\n  ln -sf \"${TERMUX_PREFIX}/lib/libchromaprint.so\" \"${TERMUX_PREFIX}/lib/libchromaprint.so.${TERMUX_PKG_VERSION}\"\n}\n"
  },
  {
    "path": "packages/clamav/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.clamav.net/\nTERMUX_PKG_DESCRIPTION=\"Anti-virus toolkit for Unix\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.102.1\nTERMUX_PKG_SRCURL=https://www.clamav.net/downloads/production/clamav-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=0dbda8d0d990d068732966f13049d112a26dce62145d234383467c1d877dedd6\nTERMUX_PKG_DEPENDS=\"json-c, libandroid-support, libbz2, libc++, libcurl, libltdl, liblzma, libxml2, openssl, pcre2, zlib\"\nTERMUX_PKG_BREAKS=\"clamav-dev\"\nTERMUX_PKG_REPLACES=\"clamav-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--sysconfdir=$TERMUX_PREFIX/etc/clamav\n--with-libcurl=$TERMUX_PREFIX\n--with-pcre=$TERMUX_PREFIX\n--with-libjson=$TERMUX_PREFIX\n--with-openssl=$TERMUX_PREFIX\n--with-xml=$TERMUX_PREFIX\n--with-zlib=$TERMUX_PREFIX\n--disable-clamonacc\n--disable-llvm\n--disable-dns\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nshare/man/man5/clamav-milter.conf.5\nshare/man/man8/clamav-milter.8\"\n\nTERMUX_PKG_CONFFILES=\"\netc/clamav/clamd.conf\netc/clamav/freshclam.conf\"\n\ntermux_step_pre_configure() {\n\texport OBJC=$CC\n\tLDFLAGS+=\" -llog\"\n}\n\ntermux_step_post_make_install() {\n\tfor conf in clamd.conf freshclam.conf; do\n\t\tsed \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|\" \\\n\t\t\t\"$TERMUX_PKG_BUILDER_DIR\"/$conf.in \\\n\t\t\t> \"$TERMUX_PREFIX\"/etc/clamav/$conf\n\tdone\n\tunset conf\n}\n\ntermux_step_post_massage() {\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"/var/lib/clamav\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"/var/log/clamav\n}\n"
  },
  {
    "path": "packages/clamav/clamd.conf.in",
    "content": "##\n## Please read the clamd.conf(5) manual for more information about\n## available options.\n##\n\n## Server configuration.\nLocalSocket @TERMUX_PREFIX@/var/run/clamd.sock\nLocalSocketMode 600\nPidFile @TERMUX_PREFIX@/var/run/clamd.pid\nTemporaryDirectory @TERMUX_PREFIX@/tmp\nDatabaseDirectory @TERMUX_PREFIX@/var/lib/clamav\n\n## Scanner configuration.\nExcludePath ^/proc/\nExcludePath ^/sys/\nFollowDirectorySymlinks no\nFollowFileSymlinks yes\nCrossFilesystems no\nExtendedDetectionInfo yes\nAllowAllMatchScan yes\nAlertOLE2Macros yes\nDetectPUA yes\nIncludePUA Packed\nIncludePUA RAT\nIncludePUA Spy\nMaxScanSize 128M\nMaxFileSize 128M\nBytecode yes\n\n## Logging.\nLogSyslog no\nLogVerbose no\nLogFile @TERMUX_PREFIX@/var/log/clamav/clamd.log\nLogTime yes\nLogRotate yes\n"
  },
  {
    "path": "packages/clamav/configure.patch",
    "content": "diff -uNr clamav-0.102.0/configure clamav-0.102.0.mod/configure\n--- clamav-0.102.0/configure\t2019-10-01 20:24:08.000000000 +0300\n+++ clamav-0.102.0.mod/configure\t2019-11-02 23:32:29.043631184 +0200\n@@ -26711,7 +26711,7 @@\n \n     have_fanotify=\"no\"\n     if test \"$have_pthreads\" = \"yes\"; then\n-\tTHREAD_LIBS=\"-lpthread\"\n+\tTHREAD_LIBS=\"\"\n \tTH_SAFE=\"-thread-safe\"\n \tif test \"$want_fanotify\" = \"yes\"; then\n \t    ac_fn_c_check_header_mongrel \"$LINENO\" \"sys/fanotify.h\" \"ac_cv_header_sys_fanotify_h\" \"$ac_includes_default\"\n"
  },
  {
    "path": "packages/clamav/fix-hardcoded-paths.patch",
    "content": "diff -uNr clamav-0.102.0/clamd/others.c clamav-0.102.0.mod/clamd/others.c\n--- clamav-0.102.0/clamd/others.c\t2019-10-01 20:24:08.000000000 +0300\n+++ clamav-0.102.0.mod/clamd/others.c\t2019-11-02 23:33:45.510545519 +0200\n@@ -159,7 +159,7 @@\n     /* We can only call async-signal-safe functions after fork(). */\n     pid = fork();\n     if (pid == 0) { /* child */\n-        exit(execle(\"/bin/sh\", \"sh\", \"-c\", buffer_cmd, NULL, env));\n+        exit(execle(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", buffer_cmd, NULL, env));\n     } else if (pid > 0) { /* parent */\n         pthread_mutex_unlock(&virusaction_lock);\n         while (waitpid(pid, NULL, 0) == -1 && errno == EINTR) continue;\ndiff -uNr clamav-0.102.0/libclamav/others_common.c clamav-0.102.0.mod/libclamav/others_common.c\n--- clamav-0.102.0/libclamav/others_common.c\t2019-10-01 20:24:09.000000000 +0300\n+++ clamav-0.102.0.mod/libclamav/others_common.c\t2019-11-02 23:33:19.087126614 +0200\n@@ -460,7 +460,7 @@\n #ifdef _WIN32\n #define P_tmpdir \"C:\\\\\"\n #else\n-#define P_tmpdir \"/tmp\"\n+#define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n #endif /* _WIN32 */\n #endif /* P_tmpdir */\n \ndiff -uNr clamav-0.102.0/shared/optparser.c clamav-0.102.0.mod/shared/optparser.c\n--- clamav-0.102.0/shared/optparser.c\t2019-10-01 20:24:09.000000000 +0300\n+++ clamav-0.102.0.mod/shared/optparser.c\t2019-11-02 23:40:11.705398185 +0200\n@@ -192,7 +192,7 @@\n \n     {\"PreludeAnalyzerName\", \"prelude-analyzer-name\", 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, \"Name of the analyzer as seen in prewikka\", \"\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n     {\"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\"},\n \n@@ -212,17 +212,17 @@\n \n     {\"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\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n     {\"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\"},\n \n     {\"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\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n     {\"LocalSocketGroup\", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_CLAMD, \"Sets the group ownership on the unix socket.\", \"virusgroup\"},\n \n@@ -271,7 +271,7 @@\n \n     {\"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\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n     {\"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\"},\n \n@@ -447,7 +447,7 @@\n     /* Freshclam-only entries */\n \n     /* FIXME: drop this entry and use LogFile */\n-    {\"UpdateLogFile\", \"log\", 'l', CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_FRESHCLAM, \"Save all reports to a log file.\", \"/var/log/freshclam.log\"},\n+    {\"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\"},\n \n     {\"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},\n \n@@ -530,7 +530,7 @@\n \n     {\"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\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n     {\"MilterSocketGroup\", NULL, 0, CLOPT_TYPE_STRING, NULL, -1, NULL, 0, OPT_MILTER, \"Define the group ownership for the (unix) milter socket.\", \"virusgroup\"},\n \n@@ -554,7 +554,7 @@\n \n     {\"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\"},\n \n-    {\"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\"},\n+    {\"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\"},\n \n     {\"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)$\"},\n \n"
  },
  {
    "path": "packages/clamav/freshclam.conf.in",
    "content": "# Path to the database directory.\nDatabaseDirectory @TERMUX_PREFIX@/var/lib/clamav\n\n# database.clamav.net is now the primary domain name to be used world-wide.\n# Now that CloudFlare is being used as our Content Delivery Network (CDN), \n# this one domain name works world-wide to direct freshclam to the closest \n# geographic endpoint.\nDatabaseMirror database.clamav.net\n"
  },
  {
    "path": "packages/clamav/no-lutimes.patch",
    "content": "diff -uNr clamav-0.101.1/libclamunrar/os.hpp clamav-0.101.1.mod/libclamunrar/os.hpp\n--- clamav-0.101.1/libclamunrar/os.hpp\t2018-12-19 22:48:30.000000000 +0200\n+++ clamav-0.101.1.mod/libclamunrar/os.hpp\t2019-01-28 16:34:22.808817627 +0200\n@@ -167,7 +167,9 @@\n \n #if defined(__linux) || defined(__FreeBSD__)\n #include <sys/time.h>\n-#define USE_LUTIMES\n+#ifdef __ANDROID__\n+#undef USE_LUTIMES\n+#endif\n #endif\n \n #define ENABLE_ACCESS\n"
  },
  {
    "path": "packages/cmake/Modules-CMakeDetermineSystem.cmake.patch",
    "content": "diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake\nindex dc208c600..f3ec4da2d 100644\n--- a/Modules/CMakeDetermineSystem.cmake\n+++ b/Modules/CMakeDetermineSystem.cmake\n@@ -43,7 +43,7 @@ if(CMAKE_HOST_UNIX)\n     else()\n       exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)\n     endif()\n-    if(CMAKE_HOST_SYSTEM_NAME MATCHES \"Linux|CYGWIN.*|Darwin|^GNU$\")\n+    if(CMAKE_HOST_SYSTEM_NAME MATCHES \"Linux|CYGWIN.*|Darwin|^GNU$|Android\")\n       exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR\n         RETURN_VALUE val)\n       if(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Darwin\" AND\n"
  },
  {
    "path": "packages/cmake/Modules-Platform-Android-Clang.cmake.patch",
    "content": "diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake\nindex 9ed1e01f9..6443512ee 100644\n--- a/Modules/Platform/Android-Clang.cmake\n+++ b/Modules/Platform/Android-Clang.cmake\n@@ -24,6 +24,12 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1)\n   return()\n endif()\n \n+if(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Android\")\n+  macro(__android_compiler_clang lang)\n+  endmacro()\n+  return()\n+endif()\n+\n include(Platform/Android-Common)\n \n # The NDK toolchain configuration files at:\n"
  },
  {
    "path": "packages/cmake/Modules-Platform-Android-Determine-Compiler.cmake.patch",
    "content": "diff --git a/Modules/Platform/Android/Determine-Compiler.cmake b/Modules/Platform/Android/Determine-Compiler.cmake\nindex a03ebcc29..34d527741 100644\n--- a/Modules/Platform/Android/Determine-Compiler.cmake\n+++ b/Modules/Platform/Android/Determine-Compiler.cmake\n@@ -31,6 +31,14 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Linux\")\n   set(_ANDROID_HOST_EXT \"\")\n elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Windows\")\n   set(_ANDROID_HOST_EXT \".exe\")\n+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Android\")\n+  macro(__android_determine_compiler lang)\n+  # Do nothing\n+  endmacro()\n+  if(NOT CMAKE_CXX_COMPILER_NAMES)\n+    set(CMAKE_CXX_COMPILER_NAMES c++)\n+  endif()\n+  return()\n else()\n   message(FATAL_ERROR \"Android: Builds hosted on '${CMAKE_HOST_SYSTEM_NAME}' not supported.\")\n endif()\n"
  },
  {
    "path": "packages/cmake/Modules-Platform-Android-Determine.cmake.patch",
    "content": "diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake\nindex bb42eedde..0e8229d5e 100644\n--- a/Modules/Platform/Android-Determine.cmake\n+++ b/Modules/Platform/Android-Determine.cmake\n@@ -18,6 +18,10 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1)\n   return()\n endif()\n \n+if(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Android\")\n+  return()\n+endif()\n+\n cmake_policy(PUSH)\n cmake_policy(SET CMP0057 NEW) # if IN_LIST\n \n"
  },
  {
    "path": "packages/cmake/Modules-Platform-Android-Initialize.cmake.patch",
    "content": "diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake\nindex a434f90ea..407ed3358 100644\n--- a/Modules/Platform/Android-Initialize.cmake\n+++ b/Modules/Platform/Android-Initialize.cmake\n@@ -17,6 +17,10 @@ if(CMAKE_SYSTEM_VERSION EQUAL 1)\n   return()\n endif()\n \n+if(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Android\")\n+  return()\n+endif()\n+\n if(NOT CMAKE_SYSROOT)\n   if(CMAKE_ANDROID_NDK)\n     set(CMAKE_SYSROOT \"${CMAKE_ANDROID_NDK}/platforms/android-${CMAKE_SYSTEM_VERSION}/arch-${CMAKE_ANDROID_ARCH}\")\n"
  },
  {
    "path": "packages/cmake/Modules-Platform-Android.cmake.patch",
    "content": "diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake\nindex f08f84176..9e719df39 100644\n--- a/Modules/Platform/Android.cmake\n+++ b/Modules/Platform/Android.cmake\n@@ -2,6 +2,10 @@ include(Platform/Linux)\n \n set(ANDROID 1)\n \n+if(CMAKE_HOST_SYSTEM_NAME STREQUAL \"Android\")\n+  return()\n+endif()\n+\n # Conventionally Android does not use versioned soname\n # But in modern versions it is acceptable\n if(NOT DEFINED CMAKE_PLATFORM_NO_VERSIONED_SONAME)\n"
  },
  {
    "path": "packages/cmake/Source-CMakeLists.txt.patch",
    "content": "diff -u -r ../cmake-3.15.2/Source/CMakeLists.txt ./Source/CMakeLists.txt\n--- ../cmake-3.15.2/Source/CMakeLists.txt\t2019-08-07 16:58:29.000000000 +0000\n+++ ./Source/CMakeLists.txt\t2019-08-21 10:42:07.237355685 +0000\n@@ -759,7 +759,7 @@\n \n # GHS support\n # Works only for windows and linux\n-if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL \"Linux\")\n+if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL \"Linux\" OR CMAKE_SYSTEM_NAME STREQUAL \"Android\")\n   set(SRCS ${SRCS}\n       cmGlobalGhsMultiGenerator.cxx\n       cmGlobalGhsMultiGenerator.h\n"
  },
  {
    "path": "packages/cmake/Source-cmExecProgramCommand.cxx.patch",
    "content": "diff -u -r ../cmake-3.15.2/Source/cmExecProgramCommand.cxx ./Source/cmExecProgramCommand.cxx\n--- ../cmake-3.15.2/Source/cmExecProgramCommand.cxx\t2019-08-07 16:58:29.000000000 +0000\n+++ ./Source/cmExecProgramCommand.cxx\t2019-08-18 20:05:17.156753010 +0000\n@@ -205,7 +205,7 @@\n   }\n   fflush(stdout);\n   fflush(stderr);\n-  const char* cmd[] = { \"/bin/sh\", \"-c\", command.c_str(), nullptr };\n+  const char* cmd[] = { \"@TERMUX_PREFIX@/bin/sh\", \"-c\", command.c_str(), nullptr };\n   cmsysProcess_SetCommand(cp, cmd);\n #endif\n \n"
  },
  {
    "path": "packages/cmake/Source-cmLocalUnixMakefileGenerator3.cxx.patch",
    "content": "diff -u -r ../cmake-3.2.2/Source/cmLocalUnixMakefileGenerator3.cxx ./Source/cmLocalUnixMakefileGenerator3.cxx\n--- ../cmake-3.2.2/Source/cmLocalUnixMakefileGenerator3.cxx\t2015-04-13 13:09:00.000000000 -0400\n+++ ./Source/cmLocalUnixMakefileGenerator3.cxx\t2015-05-24 16:04:48.182697757 -0400\n@@ -743,7 +743,7 @@\n #if !defined(__VMS)\n       makefileStream\n         << \"# The shell in which to execute make rules.\\n\"\n-        << \"SHELL = /bin/sh\\n\"\n+        << \"SHELL = @TERMUX_PREFIX@/bin/sh\\n\"\n         << \"\\n\";\n #endif\n     }\n"
  },
  {
    "path": "packages/cmake/Source-cmStateSnapshot.cxx.patch",
    "content": "diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx\nindex 63bec710b..19286c50e 100644\n--- a/Source/cmStateSnapshot.cxx\n+++ b/Source/cmStateSnapshot.cxx\n@@ -316,11 +316,15 @@ void cmStateSnapshot::SetDefaultDefinitions()\n   this->SetDefinition(\"UNIX\", \"1\");\n   this->SetDefinition(\"CMAKE_HOST_UNIX\", \"1\");\n \n+#if defined(__ANDROID__)\n+    this->SetDefinition(\"CMAKE_HOST_SYSTEM_NAME\", \"Android\");\n+#else\n   struct utsname uts_name;\n   if (uname(&uts_name) >= 0) {\n     this->SetDefinition(\"CMAKE_HOST_SYSTEM_NAME\", uts_name.sysname);\n   }\n #endif\n+#endif\n #if defined(__CYGWIN__)\n   std::string legacy;\n   if (cmSystemTools::GetEnv(\"CMAKE_LEGACY_CYGWIN_WIN32\", legacy) &&\n"
  },
  {
    "path": "packages/cmake/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://cmake.org/\nTERMUX_PKG_DESCRIPTION=\"Family of tools designed to build, test and package software\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=3.15.5\nTERMUX_PKG_SRCURL=https://www.cmake.org/files/v${TERMUX_PKG_VERSION:0:4}/cmake-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=fbdd7cef15c0ced06bb13024bfda0ecc0dedbcaaaa6b8a5d368c75255243beb4\nTERMUX_PKG_DEPENDS=\"libarchive, libc++, libcurl, libexpat, jsoncpp, libuv, rhash, make, clang, zlib\"\nTERMUX_PKG_FORCE_CMAKE=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DKWSYS_LFS_WORKS=ON -DBUILD_CursesDialog=ON\"\n"
  },
  {
    "path": "packages/cmake/cmake-curses-gui.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ccmake\"\nTERMUX_SUBPKG_DESCRIPTION=\"Curses based user interface for CMake (ccmake)\"\nTERMUX_SUBPKG_DEPENDS=\"ncurses-ui-libs\"\n"
  },
  {
    "path": "packages/cmark/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/github/cmark\nTERMUX_PKG_DESCRIPTION=\"CommonMark parsing and rendering program\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=0.29.0.gfm.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=6a94aeaa59a583fadcbf28de81dea8641b3f56d935dda5b2447a3c8df6c95fea\nTERMUX_PKG_BREAKS=\"cmark-dev\"\nTERMUX_PKG_REPLACES=\"cmark-dev\"\nTERMUX_PKG_SRCURL=https://github.com/github/cmark/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DCMAKE_INSTALL_LIBDIR=$TERMUX_PREFIX/lib\"\n\ntermux_step_post_make_install() {\n    cd $TERMUX_PREFIX/bin\n    ln -f -s cmark-gfm cmark\n\n    cd $TERMUX_PREFIX/share/man/man1\n    ln -f -s cmark-gfm.1 cmark.1\n}\n"
  },
  {
    "path": "packages/cmatrix/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/abishekvashok/cmatrix\nTERMUX_PKG_DESCRIPTION=\"Command producing a Matrix-style animation\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.0\nTERMUX_PKG_SHA256=ad93ba39acd383696ab6a9ebbed1259ecf2d3cf9f49d6b97038c66f80749e99a\nTERMUX_PKG_SRCURL=https://github.com/abishekvashok/cmatrix/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=$TERMUX_PREFIX/share/man\"\nTERMUX_PKG_DEPENDS=\"ncurses\"\n\ntermux_step_pre_configure() {\n\tautoreconf -i\n\n\texport ac_cv_file__usr_lib_kbd_consolefonts=no\n\texport ac_cv_file__usr_share_consolefonts=no\n\texport ac_cv_file__usr_lib_X11_fonts_misc=no\n\texport ac_cv_file__usr_X11R6_lib_X11_fonts_misc=no\n}\n"
  },
  {
    "path": "packages/cmus/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://cmus.github.io/\nTERMUX_PKG_DESCRIPTION=\"Small, fast and powerful console music player\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.8.0\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv, ncurses, pulseaudio, ffmpeg, libmad, opusfile, libflac, libvorbis\"\nTERMUX_PKG_SRCURL=https://github.com/cmus/cmus/archive/2748d40bb670558b523d5b47b4af442e82c7ffd2.tar.gz\nTERMUX_PKG_SHA256=37b5a1889a97cdfd319880bc5925c179119330163315dc3f408145c66d352f6b\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tLD=$CC\n\texport CUE_LIBS=\" -lm\"\n\texport CONFIG_OSS=n\n}\n\ntermux_step_configure() {\n\t./configure prefix=$TERMUX_PREFIX\n}\n"
  },
  {
    "path": "packages/cmus/checks.patch",
    "content": "--- ./scripts/checks.sh.orig\t2015-07-13 10:00:56.000000000 +0000\n+++ ./scripts/checks.sh\t2017-03-08 01:07:20.393468934 +0000\n@@ -450,8 +450,8 @@\n \t\t__exe=`tmp_file prog`\n \t\techo \"$1\" > $__src || exit 1\n \t\tshift\n-\t\t__cmd=\"$CC $__src -o $__exe $CFLAGS $LDFLAGS $@\"\n-\t\t$CC $__src -o $__exe $CFLAGS $LDFLAGS \"$@\" 2>/dev/null\n+\t\t__cmd=\"$CC $__src -o $__exe $CFLAGS $CPPFLAGS $LDFLAGS $@\"\n+\t\t$CC $__src -o $__exe $CFLAGS $CPPFLAGS $LDFLAGS \"$@\" 2>/dev/null\n \t\t;;\n \tcxx)\n \t\t__src=`tmp_file prog.cc`\n"
  },
  {
    "path": "packages/cmus/configure.patch",
    "content": "--- ./configure.orig\t2015-07-13 10:00:56.000000000 +0000\n+++ ./configure\t2017-03-07 21:29:44.492136734 +0000\n@@ -117,7 +117,7 @@\n \tmsg_checking \"for working ncurses setup\"\n \tfor flag in \"\" \"-I/usr/include/ncurses\" \"-I/usr/include/ncursesw\"\n \tdo\n-\t\tif try_compile_link \"$ncurses_code\" $flag $NCURSES_LIBS\n+\t\tif try_compile_link \"$ncurses_code\" $NCURSES_CFLAGS $flag $NCURSES_LIBS\n \t\tthen\n \t\t\tNCURSES_CFLAGS=\"$NCURSES_CFLAGS $flag\"\n \t\t\tmsg_result yes\n"
  },
  {
    "path": "packages/cmusfm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/Arkq/cmusfm\nTERMUX_PKG_DESCRIPTION=\"Last.fm standalone scrobbler for the cmus music player\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.3.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/Arkq/cmusfm/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=9d9fa7df01c3dd7eecd72656e61494acc3b0111c07ddb18be0ad233110833b63\nTERMUX_PKG_DEPENDS=libcurl\n\ntermux_step_pre_configure() {\n  autoreconf --install\n}\n"
  },
  {
    "path": "packages/codecrypt/autogen.sh.patch",
    "content": "diff -uNr codecrypt-1.8/autogen.sh codecrypt-1.8.mod/autogen.sh\n--- codecrypt-1.8/autogen.sh\t2017-10-31 22:42:06.000000000 +0200\n+++ codecrypt-1.8.mod/autogen.sh\t2019-04-25 01:43:13.982529470 +0300\n@@ -3,10 +3,10 @@\n # simple autogen script that generates basic layout for autotools.\n \n NAME=\"ccr\"\n-COMMON_CPPFLAGS=\"-I/usr/local/include\"\n+COMMON_CPPFLAGS=\"\"\n COMMON_CFLAGS=\"-Wall\"\n COMMON_CXXFLAGS=\"${COMMON_CFLAGS} -std=c++11\"\n-COMMON_LDFLAGS=\"-L/usr/local/lib\"\n+COMMON_LDFLAGS=\"\"\n COMMON_LDADD=\"\"\n \n OUT=Makefile.am\n"
  },
  {
    "path": "packages/codecrypt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://e-x-a.org/codecrypt/\nTERMUX_PKG_DESCRIPTION=\"The post-quantum cryptography tool\"\nTERMUX_PKG_LICENSE=\"LGPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.8\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=https://github.com/exaexa/codecrypt/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=25f11bc361b4f8aca7245698334b5715b7d594d708a75e8cdb2aa732dc46eb96\nTERMUX_PKG_DEPENDS=\"cryptopp, fftw, libgmp\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-cryptopp\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n\texport LIBS=\"-lm\"\n\texport CRYPTOPP_CFLAGS=\"-I$TERMUX_PREFIX/include\"\n\texport CRYPTOPP_LIBS=\"-L$TERMUX_PREFIX/lib -lcryptopp\"\n}\n"
  },
  {
    "path": "packages/codecrypt/getpass.patch",
    "content": "diff -uNr codecrypt-1.8/src/pwrng.cpp codecrypt-1.8.mod/src/pwrng.cpp\n--- codecrypt-1.8/src/pwrng.cpp\t2017-10-31 22:42:06.000000000 +0200\n+++ codecrypt-1.8.mod/src/pwrng.cpp\t2019-04-24 22:56:36.290265068 +0300\n@@ -23,38 +23,17 @@\n #include \"iohelpers.h\"\n #include <stdlib.h>\n \n-#if (HAVE_READPASSPHRASE == 1)\n-#include <readpassphrase.h>\n-#elif (HAVE_BSDREADPASSPHRASE == 1)\n-#include <bsd/readpassphrase.h>\n-#else\n-#warning \"Falling back to getpass(3), which is marked obsolete!\"\n-/* If you see this, you might as well want to take the readpassphrase()\n- * implementation from e.g. openssh's openbsd-compat and put it here. */\n #include <unistd.h>\n-#endif\n \n #define MAX_PW_LEN 1024 //like if someone enjoyed typing that.\n \n+\n static bool read_password (const std::string&prompt, std::string&pw)\n {\n-#if (HAVE_READPASSPHRASE == 1 || HAVE_BSDREADPASSPHRASE==1)\n-\t/* readpassphrase reads at most bufsiz-1 bytes and gets the terminating\n-\t * zero just right */\n-\tstd::vector<char> pwbuf;\n-\tpwbuf.resize (MAX_PW_LEN, 0);\n-\tif (!readpassphrase (prompt.c_str(), pwbuf.data(), MAX_PW_LEN,\n-\t                     RPP_REQUIRE_TTY))\n-\t\treturn false;\n-\n-\tpw = pwbuf.data();\n-\treturn true;\n-#else\n \tchar* pass = getpass (prompt.c_str());\n \tif (!pass) return false;\n \tpw = pass;\n \treturn true;\n-#endif\n }\n \n bool pw_rng::seed_from_user_password (const std::string&reason,\n"
  },
  {
    "path": "packages/colordiff/Makefile.patch",
    "content": "diff -u -r ../colordiff-1.0.18/Makefile ./Makefile\n--- ../colordiff-1.0.18/Makefile\t2016-11-12 13:12:14.000000000 +0100\n+++ ./Makefile\t2017-06-06 22:31:52.645026869 +0200\n@@ -37,8 +37,6 @@\n \t  install -d ${DESTDIR}${ETC_DIR}; \\\n \tfi\n \tcp colordiffrc ${DESTDIR}${ETC_DIR}/colordiffrc\n-\t-chown root.root ${DESTDIR}${ETC_DIR}/colordiffrc\n-\tchmod 644 ${DESTDIR}${ETC_DIR}/colordiffrc\n \n .PHONY: uninstall\n uninstall:\n"
  },
  {
    "path": "packages/colordiff/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.colordiff.org/\nTERMUX_PKG_DESCRIPTION=\"Tool to colorize 'diff' output\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_VERSION=1.0.18\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://www.colordiff.org/colordiff-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=29cfecd8854d6e19c96182ee13706b84622d7b256077df19fbd6a5452c30d6e0\nTERMUX_PKG_DEPENDS=\"perl\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make() {\n\t# Skip the 'make' invocation as it only tries to\n\t# rebuild the documentation.\n\tcontinue\n}\n\ntermux_step_post_configure() {\n\texport INSTALL_DIR=${PREFIX}/bin\n\texport MAN_DIR=${PREFIX}/share/man/man1\n\texport ETC_DIR=${PREFIX}/etc\n}\n"
  },
  {
    "path": "packages/command-not-found/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/command-not-found\nTERMUX_PKG_DESCRIPTION=\"Suggest installation of packages in interactive shell sessions\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.42\nTERMUX_PKG_SRCURL=https://github.com/termux/command-not-found/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=eb3b5c23bb574f7e4c5c78d9e97fb54af2fbe98a589efe6eb629287089e5efc2\n"
  },
  {
    "path": "packages/coreutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/coreutils/\nTERMUX_PKG_DESCRIPTION=\"Basic file, shell and text manipulation utilities from the GNU project\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=8.31\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/coreutils/coreutils-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=ff7a9c918edce6b4f4b2725e3f9b37b0c4d193531cac49a48b56c4d0d3a9e9fd\nTERMUX_PKG_DEPENDS=\"libandroid-support, libgmp, libiconv\"\nTERMUX_PKG_BREAKS=\"chroot, busybox (<< 1.30.1-4)\"\nTERMUX_PKG_REPLACES=\"chroot, busybox (<< 1.30.1-4)\"\nTERMUX_PKG_ESSENTIAL=true\n\n# pinky has no usage on Android.\n# df does not work either, let system binary prevail.\n# $PREFIX/bin/env is provided by busybox for shebangs to work directly.\n# users and who doesn't work and does not make much sense for Termux.\n# uptime is provided by procps.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\ngl_cv_host_operating_system=Android\nac_cv_func_getpass=yes\n--disable-xattr\n--enable-no-install-program=pinky,df,users,who,uptime\n--enable-single-binary=symlinks\n--with-gmp\n\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -DDEFAULT_TMPDIR=\\\\\\\"$TERMUX_PREFIX/tmp\\\\\\\"\"\n\tCPPFLAGS+=\" -D__USE_FORTIFY_LEVEL=0\"\n\n\t# On device build is unsupported as it removes utility 'ln' (and maybe\n\t# something else) in the installation process.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n"
  },
  {
    "path": "packages/coreutils/configure.patch",
    "content": "diff -u -r ../coreutils-8.31/configure ./configure\n--- ../coreutils-8.31/configure\t2019-03-10 23:35:43.000000000 +0000\n+++ ./configure\t2019-04-18 14:08:40.316645642 +0000\n@@ -43326,7 +43326,7 @@\n \n \n   # Determine how to get the list of mounted file systems.\n-  ac_list_mounted_fs=\n+  ac_list_mounted_fs=found\n \n   # If the getmntent function is available but not in the standard library,\n   # make sure LIBS contains the appropriate -l option.\n"
  },
  {
    "path": "packages/coreutils/fix-paths.patch",
    "content": "diff -uNr coreutils-8.30/lib/getusershell.c coreutils-8.30.mod/lib/getusershell.c\n--- coreutils-8.30/lib/getusershell.c\t2018-05-14 07:20:31.000000000 +0300\n+++ coreutils-8.30.mod/lib/getusershell.c\t2019-03-01 20:16:36.731319198 +0200\n@@ -56,7 +56,7 @@\n static char const* const default_shells[] =\n {\n   ADDITIONAL_DEFAULT_SHELLS\n-  \"/bin/sh\", \"/bin/csh\", \"/usr/bin/sh\", \"/usr/bin/csh\", NULL\n+  \"@TERMUX_PREFIX@/bin/sh\", \"@TERMUX_PREFIX@/bin/bash\", \"@TERMUX_PREFIX@/bin/ash\", \"@TERMUX_PREFIX@/bin/csh\", NULL\n };\n \n /* Index of the next shell in 'default_shells' to return.\ndiff -uNr coreutils-8.30/lib/tempname.c coreutils-8.30.mod/lib/tempname.c\n--- coreutils-8.30/lib/tempname.c\t2018-05-14 07:22:38.000000000 +0300\n+++ coreutils-8.30.mod/lib/tempname.c\t2019-03-01 20:14:04.073892964 +0200\n@@ -33,7 +33,7 @@\n \n #include <stdio.h>\n #ifndef P_tmpdir\n-# define P_tmpdir \"/tmp\"\n+# define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n #endif\n #ifndef TMP_MAX\n # define TMP_MAX 238328\n@@ -149,8 +149,8 @@\n     {\n       if (direxists (P_tmpdir))\n         dir = P_tmpdir;\n-      else if (strcmp (P_tmpdir, \"/tmp\") != 0 && direxists (\"/tmp\"))\n-        dir = \"/tmp\";\n+      else if (strcmp (P_tmpdir, \"@TERMUX_PREFIX@/tmp\") != 0 && direxists (\"@TERMUX_PREFIX@/tmp\"))\n+        dir = \"@TERMUX_PREFIX@/tmp\";\n       else\n         {\n           __set_errno (ENOENT);\ndiff -uNr coreutils-8.30/src/mktemp.c coreutils-8.30.mod/src/mktemp.c\n--- coreutils-8.30/src/mktemp.c\t2018-05-14 07:20:24.000000000 +0300\n+++ coreutils-8.30.mod/src/mktemp.c\t2019-03-01 20:12:37.923442265 +0200\n@@ -270,7 +270,7 @@\n           else if (dest_dir_arg && *dest_dir_arg)\n             dest_dir = dest_dir_arg;\n           else\n-            dest_dir = \"/tmp\";\n+            dest_dir = \"@TERMUX_PREFIX@/tmp\";\n \n           if (last_component (template) != template)\n             die (EXIT_FAILURE, 0,\n@@ -284,7 +284,7 @@\n           else\n             {\n               char *env = getenv (\"TMPDIR\");\n-              dest_dir = (env && *env ? env : \"/tmp\");\n+              dest_dir = (env && *env ? env : \"@TERMUX_PREFIX@/tmp\");\n             }\n           if (IS_ABSOLUTE_FILE_NAME (template))\n             die (EXIT_FAILURE, 0,\ndiff -uNr coreutils-8.30/src/sort.c coreutils-8.30.mod/src/sort.c\n--- coreutils-8.30/src/sort.c\t2018-05-14 07:20:24.000000000 +0300\n+++ coreutils-8.30.mod/src/sort.c\t2019-03-01 20:13:40.883773368 +0200\n@@ -105,7 +105,7 @@\n #endif\n \n #ifndef DEFAULT_TMPDIR\n-# define DEFAULT_TMPDIR \"/tmp\"\n+# define DEFAULT_TMPDIR \"@TERMUX_PREFIX@/tmp\"\n #endif\n \n /* Maximum number of lines to merge every time a NODE is taken from\ndiff -uNr coreutils-8.30/src/split.c coreutils-8.30.mod/src/split.c\n--- coreutils-8.30/src/split.c\t2018-05-14 07:20:24.000000000 +0300\n+++ coreutils-8.30.mod/src/split.c\t2019-03-01 20:15:52.004434545 +0200\n@@ -481,7 +481,7 @@\n       pid_t child_pid;\n       char const *shell_prog = getenv (\"SHELL\");\n       if (shell_prog == NULL)\n-        shell_prog = \"/bin/sh\";\n+        shell_prog = \"@TERMUX_PREFIX@/bin/sh\";\n       if (setenv (\"FILE\", name, 1) != 0)\n         die (EXIT_FAILURE, errno,\n              _(\"failed to set FILE environment variable\"));\ndiff -uNr coreutils-8.30/src/tac.c coreutils-8.30.mod/src/tac.c\n--- coreutils-8.30/src/tac.c\t2018-05-14 07:20:24.000000000 +0300\n+++ coreutils-8.30.mod/src/tac.c\t2019-03-01 20:13:29.470380749 +0200\n@@ -67,7 +67,7 @@\n \n \n #ifndef DEFAULT_TMPDIR\n-# define DEFAULT_TMPDIR \"/tmp\"\n+# define DEFAULT_TMPDIR \"@TERMUX_PREFIX@/tmp\"\n #endif\n \n /* The number of bytes per atomic read. */\n"
  },
  {
    "path": "packages/coreutils/nohup.c.patch",
    "content": "Fix\n\terror: call to '__umask_invalid_mode' declared with\n\tattribute error: umask called with invalid mode\non android-21\n\ndiff -u -r ../coreutils-8.23/src/nohup.c ./src/nohup.c\n--- ../coreutils-8.23/src/nohup.c\t2014-07-11 07:00:07.000000000 -0400\n+++ ./src/nohup.c\t2014-12-14 15:22:47.939242789 -0500\n@@ -141,7 +141,7 @@\n       char const *file = \"nohup.out\";\n       int flags = O_CREAT | O_WRONLY | O_APPEND;\n       mode_t mode = S_IRUSR | S_IWUSR;\n-      mode_t umask_value = umask (~mode);\n+      mode_t umask_value = umask (0777 & ~mode);\n       out_fd = (redirecting_stdout\n                 ? fd_reopen (STDOUT_FILENO, file, flags, mode)\n                 : open (file, flags, mode));\n"
  },
  {
    "path": "packages/coreutils/pwd.c.patch",
    "content": "diff -u -r ../coreutils-8.23/src/pwd.c ./src/pwd.c\n--- ../coreutils-8.23/src/pwd.c\t2014-07-13 18:09:52.000000000 -0400\n+++ ./src/pwd.c\t2015-05-17 19:58:20.692454980 -0400\n@@ -366,7 +366,7 @@\n   if (optind < argc)\n     error (0, 0, _(\"ignoring non-option arguments\"));\n \n-  if (logical)\n+  if (true) /* Termux: Always try logical, to avoid permission denied on /data/data */\n     {\n       wd = logical_getcwd ();\n       if (wd)\n"
  },
  {
    "path": "packages/coreutils/src-ls.c.patch",
    "content": "diff -u -r ../coreutils-8.26/src/ls.c ./src/ls.c\n--- ../coreutils-8.26/src/ls.c\t2016-11-22 15:04:32.000000000 -0500\n+++ ./src/ls.c\t2016-11-30 20:27:28.910732105 -0500\n@@ -1749,6 +1749,9 @@\n       }\n   }\n \n+  /* Termux patch: Default to colors if terminal. The --color option may override this. */\n+  print_with_color = isatty(STDOUT_FILENO);\n+\n   while (true)\n     {\n       int oi = -1;\n"
  },
  {
    "path": "packages/coreutils/tests/tails-c-flag.sh",
    "content": "# https://github.com/termux/termux-app/issues/232\nset -e -u\n\nRESULT=$(echo -n 123456 | tail -c 3)\nif [ \"$RESULT\" != 456 ]; then\n\techo \"Test failed - expectd 456, got $RESULT\"\n\texit 1\nfi\n"
  },
  {
    "path": "packages/corkscrew/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://wiki.linuxquestions.org/wiki/Corkscrew\nTERMUX_PKG_DESCRIPTION=\"A tool for tunneling SSH through HTTP proxies\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_DEPENDS=\"openssh\"\nTERMUX_PKG_VERSION=2.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/corkscrew-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=0d0fcbb41cba4a81c4ab494459472086f377f9edb78a2e2238ed19b58956b0be\n\ntermux_step_post_make_install() {\n\t# Corkscrew does not distribute a man page, use one from debian:\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_BUILDER_DIR/corkscrew.1 $TERMUX_PREFIX/share/man/man1\n}\n"
  },
  {
    "path": "packages/corkscrew/corkscrew.1",
    "content": ".\\\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)\n.\\\"\n.\\\" Standard preamble:\n.\\\" ========================================================================\n.de Sp \\\" Vertical space (when we can't use .PP)\n.if t .sp .5v\n.if n .sp\n..\n.de Vb \\\" Begin verbatim text\n.ft CW\n.nf\n.ne \\\\$1\n..\n.de Ve \\\" End verbatim text\n.ft R\n.fi\n..\n.\\\" Set up some character translations and predefined strings.  \\*(-- will\n.\\\" give an unbreakable dash, \\*(PI will give pi, \\*(L\" will give a left\n.\\\" double quote, and \\*(R\" will give a right double quote.  \\*(C+ will\n.\\\" give a nicer C++.  Capital omega is used to do unbreakable dashes and\n.\\\" therefore won't be available.  \\*(C` and \\*(C' expand to `' in nroff,\n.\\\" nothing in troff, for use with C<>.\n.tr \\(*W-\n.ds C+ C\\v'-.1v'\\h'-1p'\\s-2+\\h'-1p'+\\s0\\v'.1v'\\h'-1p'\n.ie n \\{\\\n.    ds -- \\(*W-\n.    ds PI pi\n.    if (\\n(.H=4u)&(1m=24u) .ds -- \\(*W\\h'-12u'\\(*W\\h'-12u'-\\\" diablo 10 pitch\n.    if (\\n(.H=4u)&(1m=20u) .ds -- \\(*W\\h'-12u'\\(*W\\h'-8u'-\\\"  diablo 12 pitch\n.    ds L\" \"\"\n.    ds R\" \"\"\n.    ds C` \"\"\n.    ds C' \"\"\n'br\\}\n.el\\{\\\n.    ds -- \\|\\(em\\|\n.    ds PI \\(*p\n.    ds L\" ``\n.    ds R\" ''\n'br\\}\n.\\\"\n.\\\" Escape single quotes in literal strings from groff's Unicode transform.\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\"\n.\\\" If the F register is turned on, we'll generate index entries on stderr for\n.\\\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index\n.\\\" entries marked with X<> in POD.  Of course, you'll have to process the\n.\\\" output yourself in some meaningful fashion.\n.ie \\nF \\{\\\n.    de IX\n.    tm Index:\\\\$1\\t\\\\n%\\t\"\\\\$2\"\n..\n.    nr % 0\n.    rr F\n.\\}\n.el \\{\\\n.    de IX\n..\n.\\}\n.\\\" ========================================================================\n.\\\"\n.IX Title \"corkscrew 1\"\n.TH corkscrew 1 \"2013-05-23\" \"corkscrew\" \"Networking\"\n.\\\" For nroff, turn off justification.  Always turn off hyphenation; it makes\n.\\\" way too many mistakes in technical documents.\n.if n .ad l\n.nh\n.SH \"NAME\"\ncorkscrew \\- Tunnel TCP connections through HTTP proxies\n.SH \"SYNOPSIS\"\n.IX Header \"SYNOPSIS\"\n.Vb 1\n\\&  corkscrew  PROXY PROXYPORT TARGETHOST TARGETPORT [AUTH_FILE]\n.Ve\n.SH \"DESCRIPTION\"\n.IX Header \"DESCRIPTION\"\ncorkscrew is a simple tool to tunnel \\s-1TCP\\s0 connections through an \\s-1HTTP\\s0\nproxy supporting the \\s-1CONNECT\\s0 method. It reads stdin and writes to std\\-\nout during the connection, just like netcat. It can be used for\ninstance to connect to an \\s-1SSH\\s0 server running on a remote 443 port\nthrough a strict \\s-1HTTPS\\s0 proxy.\n.IP \"\\s-1PROXY\\s0\" 4\n.IX Item \"PROXY\"\nThe name of the host running the \\s-1HTTP\\s0 proxy.\n.IP \"\\s-1PROXYPORT\\s0\" 4\n.IX Item \"PROXYPORT\"\nThe port on which to connect on the proxy.\n.IP \"\\s-1TARGET\\s0\" 4\n.IX Item \"TARGET\"\nThe host to reach through the proxy.\n.IP \"\\s-1TARGETPORT\\s0\" 4\n.IX Item \"TARGETPORT\"\nThe port to connect to on the target host.\n.IP \"\\s-1AUTH_\\s0 \\s-1FILE\\s0\" 4\n.IX Item \"AUTH_ FILE\"\nThe  auth  file is made of one single line containing your username and\npassword in the form\n.Sp\n.Vb 1\n\\&    username:password\n.Ve\n.SH \"OPTIONS\"\n.IX Header \"OPTIONS\"\nNone.\n.SH \"EXAMPLES\"\n.IX Header \"EXAMPLES\"\nThe common usage of corkscrew is to put the following line in\n~/.ssh/ssh_config:\n.PP\n.Vb 1\n\\&        ProxyCommand corkscrew proxy proxyport %h %p [<path to auth_file>]\n.Ve\n.PP\nThis will let the ssh connection go through the proxy with the help of\ncorkscrew.\n.SH \"ENVIRONMENT\"\n.IX Header \"ENVIRONMENT\"\nNone.\n.SH \"FILES\"\n.IX Header \"FILES\"\nNone.\n.SH \"SEE ALSO\"\n.IX Header \"SEE ALSO\"\n\\&\\fIssh_config\\fR\\|(5)\n.SH \"AUTHORS\"\n.IX Header \"AUTHORS\"\nProgram was written by Pat Padgett <agroman@agroman.net>.\n.PP\nThis manual page was written by Laurent Fousse <laurent@komite.net> for\nthe Debian \\s-1GNU\\s0 system (but may be used by others). Updated by Jari\nAalto <jari.aalto@cante.net>. Released under license \\s-1GNU\\s0 \\s-1GPL\\s0 version 2\nor (at your option) any later version. For more information about\nlicense, visit <http://www.gnu.org/copyleft/gpl.html>.\n"
  },
  {
    "path": "packages/cowsay/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://en.wikipedia.org/wiki/Cowsay\nTERMUX_PKG_DESCRIPTION=\"Program which generates ASCII pictures of a cow with a message\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.04\nTERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/c/cowsay/cowsay_3.03+dfsg1.orig.tar.gz\nTERMUX_PKG_SHA256=10bae895d9afb2d720d2211db58f396352b00fe1386c369ca3608cbf6497b839\nTERMUX_PKG_DEPENDS=\"perl\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\tsh install.sh\n}\n"
  },
  {
    "path": "packages/cowsay/install.sh.patch",
    "content": "Only in .: install.pl\ndiff -u -r ../cowsay-3.03+dfsg1/install.sh ./install.sh\n--- ../cowsay-3.03+dfsg1/install.sh\t1999-11-01 15:19:21.000000000 -0500\n+++ ./install.sh\t2016-04-14 21:14:44.715683710 -0400\n@@ -14,55 +14,8 @@\n \n filelist='cows'\n \n-cat <<DOG\n-===================\n-cowsay Installation\n-===================\n-\n-Searching for useful perl executables...\n-DOG\n-\n-backdoor=$1\n-\n-pathdirs=`echo $PATH | tr : \" \"`\n-for p in $pathdirs; do\n-\tset $p/perl $p/perl5*\n-\twhile [ ! -z \"$1\" ]; do\n-\t\tif [ -x \"$1\" ]; then\n-\t\t\techo Found perl in $1\n-\t\t\tperls=\"$perls $1\"\n-\t\tfi\n-\t\tshift\n-\tdone\n-done\n-for perl in $perls; do\n-\tif $perl -MText::Wrap -e0 >/dev/null 2>&1; then\n-\t\techo Found a good perl in $perl\n-\t\tgoodperls=\"$goodperls $perl\"\n-\tfi\n-done\n-echo The following perl executables will run cowsay:\n-echo $goodperls\n-echo I recommend the latest stable perl you can find.\n-set $goodperls\n-if [ -z \"$1\" ]; then\n-\techo Ack!  You do not have Perl 5 installed correctly!\n-\techo Get thee to CPAN!\n-\texit 1\n-fi\n-usethisperl=$1\n-echo I will be using $1 because I know it will work.\n-\n-echo Now I need an installation prefix.  I will use /usr/local unless\n-printf \"you give me a better idea here: \"\n-if [ -n \"$backdoor\" ]; then\n-\tprefix=$backdoor\n-\tprintf \"%s (specified on command line)\\n\" $prefix\n-else\n-\tread prefix\n-fi\n-\n-PREFIX=${prefix:-/usr/local}\n+usethisperl=@TERMUX_PREFIX@/bin/perl\n+PREFIX=@TERMUX_PREFIX@\n \n echo Okay, time to install this puppy.\n \n@@ -70,13 +23,13 @@\n echo s,%PREFIX%,$PREFIX,\\; >> install.pl\n set -x\n mkdir -p $PREFIX/bin || (mkdir $PREFIX; mkdir $PREFIX/bin)\n-$usethisperl -p install.pl cowsay > $PREFIX/bin/cowsay\n+perl -p install.pl cowsay > $PREFIX/bin/cowsay\n chmod a+x $PREFIX/bin/cowsay\n ln -s cowsay $PREFIX/bin/cowthink\n-mkdir -p $PREFIX/man/man1 || ($mkdir $PREFIX; mkdir $PREFIX/man; mkdir $PREFIX/man/man1)\n-$usethisperl -p install.pl cowsay.1 > $PREFIX/man/man1/cowsay.1\n-chmod a+r $PREFIX/man/man1/cowsay.1\n-ln -s cowsay.1 $PREFIX/man/man1/cowthink.1\n+mkdir -p $PREFIX/share/man/man1\n+perl -p install.pl cowsay.1 > $PREFIX/share/man/man1/cowsay.1\n+chmod a+r $PREFIX/share/man/man1/cowsay.1\n+(cd $PREFIX/share/man/man1; ln -f -s cowsay.1 cowthink.1 )\n mkdir -p $PREFIX/share/cows || (mkdir $PREFIX; mkdir $PREFIX/share; mkdir $PREFIX/share/cows)\n tar -cf - $filelist | (cd $PREFIX/share && tar -xvf -)\n set +x\n"
  },
  {
    "path": "packages/cpio/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/cpio/\nTERMUX_PKG_DESCRIPTION=\"CPIO implementation from the GNU project\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.12\nTERMUX_PKG_SHA256=70998c5816ace8407c8b101c9ba1ffd3ebbecba1f5031046893307580ec1296e\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/cpio/cpio-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_DEPENDS=\"tar\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-rmt=$TERMUX_PREFIX/libexec/rmt\"\n\n"
  },
  {
    "path": "packages/cppi/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/cppi/\nTERMUX_PKG_DESCRIPTION=\"Indents C preprocessor directives to reflect their nesting, among other regularizations\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.18\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/cppi/cppi-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=12a505b98863f6c5cf1f749f9080be3b42b3eac5a35b59630e67bea7241364ca\n"
  },
  {
    "path": "packages/crunch/Makefile.patch",
    "content": "diff -uNr crunch-3.6/Makefile crunch-3.6.mod/Makefile\n--- crunch-3.6/Makefile\t2014-05-03 20:04:11.000000000 +0300\n+++ crunch-3.6.mod/Makefile\t2019-01-31 00:31:33.642061600 +0200\n@@ -28,7 +28,7 @@\n # General variables\n PACKAGE\t    = crunch\n VERSION\t    = 3.6\n-PREFIX\t    = /usr\n+PREFIX\t    ?= /usr\n DISTDIR\t    = $(PACKAGE)-$(VERSION)\n DISTFILES   = crunch.c crunch.1 charset.lst\n BINDIR\t    = $(PREFIX)/bin\n@@ -37,8 +37,8 @@\n DOCDIR\t    = $(PREFIX)/share/doc/$(PACKAGE)\n MANDIR\t    = $(PREFIX)/share/man/man1\n \n-INSTALL\t    = sudo $(shell which install)\n-CC\t    = $(shell which gcc)\n+INSTALL\t    = $(shell which install)\n+CC\t    ?= $(shell which gcc)\n LIBFLAGS    = -lm\n THREADFLAGS = -pthread\n OPTFLAGS    = -g -o0\n@@ -56,7 +56,7 @@\n  LFS=\"\"  \n else\n #non-mac as you were \n-  INSTALL_OPTIONS = -g root -o root\n+  INSTALL_OPTIONS =\n endif\n \n # Default target\n"
  },
  {
    "path": "packages/crunch/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/crunch-wordlist\nTERMUX_PKG_DESCRIPTION=\"Highly customizable wordlist generator\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.6\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/crunch-wordlist/crunch-wordlist/crunch-${TERMUX_PKG_VERSION}.tgz\nTERMUX_PKG_SHA256=6a8f6c3c7410cc1930e6854d1dadc6691bfef138760509b33722ff2de133fe55\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/cryptopp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.cryptopp.com/\nTERMUX_PKG_DESCRIPTION=\"A free C++ class library of cryptographic schemes\"\nTERMUX_PKG_LICENSE=\"BSL-1.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=8.2.0\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://www.cryptopp.com/cryptopp${TERMUX_PKG_VERSION//./}.zip\nTERMUX_PKG_SHA256=03f0e2242e11b9d19b28d0ec5a3fa8ed5cc7b27640e6bed365744f593e858058\nTERMUX_PKG_BREAKS=\"cryptopp-dev\"\nTERMUX_PKG_REPLACES=\"cryptopp-dev\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/\nshare/cryptopp/\n\"\n\ntermux_step_extract_package() {\n\tmkdir -p $TERMUX_PKG_CACHEDIR\n\ttermux_download $TERMUX_PKG_SRCURL $TERMUX_PKG_CACHEDIR/cryptopp.zip \\\n\t\t$TERMUX_PKG_SHA256\n\n\tmkdir -p $TERMUX_PKG_SRCDIR\n\tcd $TERMUX_PKG_SRCDIR\n\tunzip $TERMUX_PKG_CACHEDIR/cryptopp.zip\n}\n\ntermux_step_make() {\n\tCXXFLAGS+=\" -fPIC -DCRYPTOPP_DISABLE_ASM\"\n\tmake -j $TERMUX_MAKE_PROCESSES dynamic libcryptopp.pc CC=$CC CXX=$CXX\n}\n\ntermux_step_make_install() {\n\tmake install-lib PREFIX=$TERMUX_PREFIX\n}\n"
  },
  {
    "path": "packages/cryptopp/cpu.cpp.patch",
    "content": "diff -uNr cryptopp/cpu.cpp cryptopp.mod/cpu.cpp\n--- cryptopp/cpu.cpp\t2019-04-28 23:36:50.000000000 +0000\n+++ cryptopp.mod/cpu.cpp\t2019-05-10 14:47:58.091890446 +0000\n@@ -47,7 +47,7 @@\n // \"$ANDROID_NDK_ROOT/sources/android/cpufeatures\".\r\n // setenv-android.sh will copy the header and source file\r\n // into PWD and the makefile will build it in place.\r\n-#if defined(__ANDROID__)\r\n+#if 0\r\n # include \"cpu-features.h\"\r\n #endif\r\n \r\n@@ -548,264 +548,64 @@\n \r\n inline bool CPU_QueryARMv7()\r\n {\r\n-#if defined(__aarch32__) || defined(__aarch64__)\r\n-\t// ARMv7 or above\r\n+#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__)\r\n \treturn true;\r\n-#elif defined(__ANDROID__) && defined(__arm__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__arm__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_ARMv7) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__arm__)\r\n-\t// Apple hardware is ARMv7 or above.\r\n-\treturn true;\r\n-#endif\r\n+#else\r\n \treturn false;\r\n+#endif\r\n }\r\n \r\n inline bool CPU_QueryNEON()\r\n {\r\n-#if defined(__ANDROID__) && defined(__aarch64__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_ASIMD) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__arm__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_ASIMD) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_ASIMD) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__arm__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_ARM_NEON) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__)\r\n-\t// Core feature set for Aarch32 and Aarch64.\r\n+#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__)\r\n \treturn true;\r\n-#endif\r\n+#else\r\n \treturn false;\r\n+#endif\r\n }\r\n \r\n inline bool CPU_QueryCRC32()\r\n {\r\n-#if defined(__ANDROID__) && defined(__aarch64__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_CRC32) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_CRC32) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_CRC32) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_CRC32) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__)\r\n-\t// No compiler support. CRC intrinsics result in a failed compiled.\r\n-\treturn false;\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QueryPMULL()\r\n {\r\n-#if defined(__ANDROID__) && defined(__aarch64__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_PMULL) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_PMULL) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_PMULL) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_PMULL) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__)\r\n-\t// No compiler support. PMULL intrinsics result in a failed compiled.\r\n-\treturn false;\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QueryAES()\r\n {\r\n-#if defined(__ANDROID__) && defined(__aarch64__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_AES) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_AES) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_AES) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__)\r\n-\tunsigned int device, version;\r\n-\tGetAppleMachineInfo(device, version);\r\n-\treturn IsAppleMachineARMv8(device, version);\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QuerySHA1()\r\n {\r\n-#if defined(__ANDROID__) && defined(__aarch64__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA1) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA1) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_SHA1) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_SHA1) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__)\r\n-\tunsigned int device, version;\r\n-\tGetAppleMachineInfo(device, version);\r\n-\treturn IsAppleMachineARMv8(device, version);\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QuerySHA2()\r\n {\r\n-#if defined(__ANDROID__) && defined(__aarch64__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA2) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__)\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA2) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_SHA2) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_SHA2) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__)\r\n-\tunsigned int device, version;\r\n-\tGetAppleMachineInfo(device, version);\r\n-\treturn IsAppleMachineARMv8(device, version);\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QuerySHA512()\r\n {\r\n-// Some ARMv8.4 features are disabled at the moment\r\n-#if defined(__ANDROID__) && defined(__aarch64__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA512) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA512) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_SHA512) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_SHA512) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__) && 0\r\n-\tunsigned int device, version;\r\n-\tGetAppleMachineInfo(device, version);\r\n-\treturn IsAppleMachineARMv84(device, version);\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QuerySHA3()\r\n {\r\n-// Some ARMv8.4 features are disabled at the moment\r\n-#if defined(__ANDROID__) && defined(__aarch64__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA3) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA3) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_SHA3) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_SHA3) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__) && 0\r\n-\tunsigned int device, version;\r\n-\tGetAppleMachineInfo(device, version);\r\n-\treturn IsAppleMachineARMv84(device, version);\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QuerySM3()\r\n {\r\n-// Some ARMv8.4 features are disabled at the moment\r\n-#if defined(__ANDROID__) && defined(__aarch64__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM3) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM3) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_SM3) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_SM3) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__) && 0\r\n-\tunsigned int device, version;\r\n-\tGetAppleMachineInfo(device, version);\r\n-\treturn IsAppleMachineARMv84(device, version);\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n inline bool CPU_QuerySM4()\r\n {\r\n-// Some ARMv8.4 features are disabled at the moment\r\n-#if defined(__ANDROID__) && defined(__aarch64__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM4) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__ANDROID__) && defined(__aarch32__) && 0\r\n-\tif (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&\r\n-\t\t((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM4) != 0))\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch64__)\r\n-\tif ((getauxval(AT_HWCAP) & HWCAP_SM4) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__linux__) && defined(__aarch32__)\r\n-\tif ((getauxval(AT_HWCAP2) & HWCAP2_SM4) != 0)\r\n-\t\treturn true;\r\n-#elif defined(__APPLE__) && defined(__aarch64__) && 0\r\n-\tunsigned int device, version;\r\n-\tGetAppleMachineInfo(device, version);\r\n-\treturn IsAppleMachineARMv84(device, version);\r\n-#endif\r\n \treturn false;\r\n }\r\n \r\n"
  },
  {
    "path": "packages/cryptopp/fix-lib-symlinks.patch",
    "content": "diff -uNr cryptopp/GNUmakefile cryptopp.mod/GNUmakefile\n--- cryptopp/GNUmakefile\t2019-04-29 02:36:50.000000000 +0300\n+++ cryptopp.mod/GNUmakefile\t2019-09-15 22:24:49.562595722 +0300\n@@ -1256,7 +1256,7 @@\n \t$(CHMOD) 0755 $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)\n ifeq ($(HAS_SOLIB_VERSION),1)\n \t-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so\n-\t$(LDCONF) $(DESTDIR)$(LIBDIR)\n+\t-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX)\n endif\n endif\n ifneq ($(wildcard libcryptopp.pc),)\n"
  },
  {
    "path": "packages/cscope/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://cscope.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"A developers tool for browsing program code\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=15.9\nTERMUX_PKG_SHA256=c5505ae075a871a9cd8d9801859b0ff1c09782075df281c72c23e72115d9f159\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/cscope-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nhw_cv_func_snprintf_c99=yes\nhw_cv_func_vsnprintf_c99=yes\n--with-ncurses=$TERMUX_PREFIX\n\"\n\ntermux_step_pre_configure() {\n\texport LEXLIB=\"\"\n}\n"
  },
  {
    "path": "packages/cscope/errno.patch",
    "content": "--- src/src/snprintf.c\t2009-04-10 13:39:23.000000000 +0000\n+++ patches/snprintf.c\t2017-05-19 07:45:08.926751318 +0000\n@@ -522,7 +522,9 @@\n static UINTMAX_T myround(LDOUBLE);\n static LDOUBLE mypow10(int);\n \n+#ifndef __ANDROID__\n extern int errno;\n+#endif\n \n int\n rpl_vsnprintf(char *str, size_t size, const char *format, va_list args)\n"
  },
  {
    "path": "packages/cscope/src-main.c.patch",
    "content": "diff -u -r ../cscope-15.8b/src/main.c ./src/main.c\n--- ../cscope-15.8b/src/main.c\t2014-11-20 22:12:54.000000000 +0100\n+++ ./src/main.c\t2017-05-22 14:30:00.303282400 +0200\n@@ -62,9 +62,9 @@\n #define HOME\t\"/\"\t/* no $HOME --> use root directory */\n #define\tSHELL\t\"sh\"\n #define LINEFLAG \"+%s\"\t/* default: used by vi and emacs */\n-#define TMPDIR\t\"/tmp\"\n+#define TMPDIR\t\"@TERMUX_PREFIX@/tmp\"\n #ifndef DFLT_INCDIR\n-#define DFLT_INCDIR \"/usr/include\"\n+#define DFLT_INCDIR \"@TERMUX_PREFIX@/include\"\n #endif\n \n static char const rcsid[] = \"$Id: main.c,v 1.57 2014/11/20 21:12:54 broeker Exp $\";\n"
  },
  {
    "path": "packages/ctags/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ctags.io/\nTERMUX_PKG_DESCRIPTION=\"Universal ctags: Source code index builder\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.0.20190412\nTERMUX_PKG_REVISION=1\nlocal _COMMIT=61cc66cfc796e707cfb13c5fed493af280378c75\nTERMUX_PKG_SHA256=479abda4686fafd11cae40f646c2b692cc0209783d233b2534b339b838af9acc\nTERMUX_PKG_SRCURL=https://github.com/universal-ctags/ctags/archive/${_COMMIT}.zip\nTERMUX_PKG_DEPENDS=\"libiconv\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-tmpdir=$TERMUX_PREFIX/tmp\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_HOSTBUILD=true\n\ntermux_step_post_extract_package() {\n\texport regcomp_works=yes\n\t./autogen.sh\n}\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/packcc $TERMUX_PKG_BUILDDIR/\n\ttouch -d \"next hour\" $TERMUX_PKG_BUILDDIR/packcc\n}\n"
  },
  {
    "path": "packages/ctags/configure.ac.patch",
    "content": "diff -u -r ../ctags-61cc66cfc796e707cfb13c5fed493af280378c75/configure.ac ./configure.ac\n--- ../ctags-61cc66cfc796e707cfb13c5fed493af280378c75/configure.ac\t2019-04-12 19:56:22.000000000 +0000\n+++ ./configure.ac\t2019-04-13 07:08:50.478780864 +0000\n@@ -7,7 +7,14 @@\n #\tProcess this file with autoconf to produce a configure script.\n \n AC_PREREQ([2.59])\n-AC_INIT([universal-ctags],[0.0.0])\n+# Avoid identifying as\n+#   Universal Ctags 0.0.0, Copyright (C) 2015 Universal Ctags Team\n+#   Universal Ctags is derived from Exuberant Ctags.\n+#   Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert\n+# since that causes at least vim-easytags to identify the ctags\n+# version as 0.0.0, see\n+# https://github.com/xolox/vim-easytags/blob/master/autoload/xolox/easytags.vim\n+AC_INIT([universal-ctags],[5.8])\n AM_INIT_AUTOMAKE([foreign subdir-objects tar-ustar])\n AM_SILENT_RULES([yes])\n AC_CONFIG_HEADERS([config.h])\n@@ -409,7 +416,7 @@\n \tsprintf(buffer, \"%zu\", i);\n \treturn !(buffer[0] == '9' && buffer[1] == '9' && buffer[2] == '9');\n }\n-]])],[have_zu_formatter=yes],[have_zu_formatter=no])\n+]])],[have_zu_formatter=yes],[have_zu_formatter=no], [have_zu_formatter=yes])\n AC_MSG_RESULT($have_zu_formatter)\n \n if test x$have_zu_formatter != xyes; then\n@@ -594,16 +601,7 @@\n \n AH_TEMPLATE([HAVE_LIBXML],\n \t[Define this value if libxml is available.])\n-dnl About the condition of version\n-dnl see https://mail.gnome.org/archives/xml/2010-February/msg00008.html\n-AS_IF([test \"x$enable_xml\" != \"xno\"], [\n-\tPKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= 2.7.7],\n-\t\t\t       [have_libxml=yes\n-\t\t\t       AC_DEFINE(HAVE_LIBXML)],\n-\t\t\t       [AS_IF([test \"x$enable_xml\" = \"xyes\"], [\n-\t\t\t           AC_MSG_ERROR([libxml2 not found])])])\n-])\n-AM_CONDITIONAL(HAVE_LIBXML, test \"x$have_libxml\" = xyes)\n+AM_CONDITIONAL(HAVE_LIBXML, [test true = false])\n \n AC_ARG_ENABLE([json],\n \t[AS_HELP_STRING([--disable-json],\n"
  },
  {
    "path": "packages/cvs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.nongnu.org/cvs/\nTERMUX_PKG_DESCRIPTION=\"Concurrent Versions System\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=\"1.12.13+real-26\"\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=0eda91f5e8091b676c90b2a171f24f9293acb552f4e4f77b590ae8d92a547256\nTERMUX_PKG_SRCURL=\"https://dl.bintray.com/termux/upstream/cvs-$TERMUX_PKG_VERSION.tar.xz\"\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\ncvs_cv_func_printf_ptr=yes\nac_cv_header_syslog_h=no\n--disable-server\n--with-external-zlib\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/cvsbug share/man/man8/cvsbug.8\"\n"
  },
  {
    "path": "packages/cvs/src-log.c.patch",
    "content": "diff -u -r ../cvs-1.12.13+real-26/src/log.c ./src/log.c\n--- ../cvs-1.12.13+real-26/src/log.c\t2018-06-26 04:32:38.051089628 +0200\n+++ ./src/log.c\t2018-06-26 04:42:11.865303837 +0200\n@@ -1790,12 +1790,14 @@\n \tint buftag = 'M';\n \tstatic char has_logm = 0;\n \n+#ifdef SERVER_SUPPORT\n \tif (server_active) {\n \t\tif (!has_logm)\n \t\t\thas_logm = supported_response(\"LOGM\") ? 1 : 2;\n \t\tif (has_logm == 1)\n \t\t\tbuftag = CVS_OUTPUT_EX_LOGM;\n \t}\n+#endif\n \n \tcvs_output_ex(str, len, buftag);\n \tif (/*len > 0 &&*/ str[len - 1] != '\\n')\n"
  },
  {
    "path": "packages/daemonize/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://software.clapper.org/daemonize/\nTERMUX_PKG_DESCRIPTION=\"Run a command as a Unix daemon\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.7.8\nTERMUX_PKG_SHA256=20c4fc9925371d1ddf1b57947f8fb93e2036eb9ccc3b43a1e3678ea8471c4c60\nTERMUX_PKG_SRCURL=https://github.com/bmc/daemonize/archive/release-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_func_setpgrp_void=yes\"\n"
  },
  {
    "path": "packages/daemonize/daemonize.c.patch",
    "content": "diff -u -r ../daemonize-release-1.7.7/daemonize.c ./daemonize.c\n--- ../daemonize-release-1.7.7/daemonize.c\t2015-12-11 23:54:43.000000000 +0100\n+++ ./daemonize.c\t2017-07-07 00:33:39.931635851 +0200\n@@ -24,6 +24,7 @@\n #include <fcntl.h>\n #include <sys/stat.h>\n #include <sys/file.h>\n+#include <grp.h> /* For initgroups(3). */\n #include \"config.h\"\n #include \"version.h\"\n \n@@ -38,7 +39,10 @@\n static bool         be_verbose = FALSE;\n static const char  *user       = NULL;\n static char       **cmd        = NULL;\n-static const char  *cwd        = \"/\";\n+/* Termux patch: Use a readable directory for e.g. runsvdir to work,\n+   as / is not readable starting from Android 7:\n+   https://github.com/termux/termux-packages/issues/614 */\n+static const char  *cwd        = \"@TERMUX_PREFIX@\";\n static int          null_fd    = -1;\n static int          out_fd     = -1;\n static int          err_fd     = -1;\n"
  },
  {
    "path": "packages/darkhttpd/Makefile.patch",
    "content": "diff --git a/Makefile b/Makefile\nindex 7059a14..b09a8a7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -7,6 +7,9 @@ all: darkhttpd\n darkhttpd: darkhttpd.c\n \t$(CC) $(CFLAGS) $(LIBS) darkhttpd.c -o $@\n \n+install: all\n+\tinstall darkhttpd \"$(DESTDIR)$(PREFIX)/bin/darkhttpd\"\n+\n clean:\n \trm -f darkhttpd core darkhttpd.core\n \n"
  },
  {
    "path": "packages/darkhttpd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://unix4lyfe.org/darkhttpd\nTERMUX_PKG_DESCRIPTION=\"A simple webserver, implemented in a single .c file.\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.12\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_MAINTAINER=\"David Paskevic @casept\"\nTERMUX_PKG_SRCURL=https://fossies.org/linux/www/darkhttpd-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=2652bc7e3dab35fcb64453616771016017a135e4b263ef73a36d29662593d472\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $LDFLAGS\"\n}\n"
  },
  {
    "path": "packages/dart/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.dartlang.org/\nTERMUX_PKG_DESCRIPTION=\"Dart is a general-purpose programming language\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.4.1\nTERMUX_PKG_BUILD_IN_SRC=true\n\n# Dart uses tar and gzip to extract downloaded packages.\n# Busybox-based versions of such utilities cause issues so\n# complete ones should be used.\nTERMUX_PKG_DEPENDS=\"gzip, tar\"\n\ntermux_step_extract_package() {\n\tmkdir -p $TERMUX_PKG_SRCDIR\n\tcd $TERMUX_PKG_SRCDIR\n\n\tgit clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git\n\texport PATH=\"$(pwd)/depot_tools:${PATH}\"\n\n\tfetch dart\n\n\tcd sdk\n\tgit checkout $TERMUX_PKG_VERSION\n\tcd ../\n\n\techo \"target_os = ['android']\" >> .gclient\n\tgclient sync -D --force --reset\n}\n\ntermux_step_make() {\n\tcd sdk\n\n\tlocal DEST_CPU\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tDEST_CPU=\"arm\"\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tDEST_CPU=\"ia32\"\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\tDEST_CPU=\"arm64\"\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\tDEST_CPU=\"x64\"\n\telse\n\t\ttermux_error_exit \"Unsupported arch '$TERMUX_ARCH'\"\n\tfi\n\n\trm -f ./out/*/args.gn\n\tDART_MAKE_PLATFORM_SDK=true python2 ./tools/build.py --mode release --arch=$DEST_CPU --os=android create_sdk\n}\n\ntermux_step_make_install() {\n\tcd sdk\n\n\tlocal DEST_CPU\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tDEST_CPU=\"ARM\"\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tDEST_CPU=\"IA32\"\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\tDEST_CPU=\"ARM64\"\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\tDEST_CPU=\"X64\"\n\telse\n\t\ttermux_error_exit \"Unsupported arch '$TERMUX_ARCH'\"\n\tfi\n\n\tchmod +x ./out/ReleaseAndroid${DEST_CPU}/dart-sdk/bin/*\n\tcp -r ./out/ReleaseAndroid${DEST_CPU}/dart-sdk ${TERMUX_PREFIX}/lib\n\n\tfor file in ${TERMUX_PREFIX}/lib/dart-sdk/bin/*; do\n\t\tif [[ -f \"$file\" ]]; then\n\t\t\techo -e \"#!${TERMUX_PREFIX}/bin/sh\\nexec $file  \\\"\\$@\\\"\" > ${TERMUX_PREFIX}/bin/$(basename $file)\n\t\t\tchmod +x ${TERMUX_PREFIX}/bin/$(basename $file)\n\t\tfi\n\tdone\n}\n\ntermux_step_post_make_install() {\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/dart-pub-bin.sh \\\n\t\t$TERMUX_PREFIX/etc/profile.d/dart-pub-bin.sh\n}\n"
  },
  {
    "path": "packages/dart/dart-pub-bin.sh",
    "content": "# Executables installed with 'pub global activate' are available\n# in directory $HOME/.pub-cache/bin.\nexport PATH=\"$HOME/.pub-cache/bin:$PATH\"\n"
  },
  {
    "path": "packages/dart/fix-shell-path.patch",
    "content": "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\n--- src/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart\t2019-05-22 18:59:58.264004304 +0000\n+++ src.mod/sdk/pkg/front_end/lib/src/api_prototype/terminal_color_support.dart\t2019-05-22 19:21:02.019682122 +0000\n@@ -55,7 +55,7 @@\n \n   // Check if stdin is a terminal (TTY).\n   ProcessResult result =\n-      Process.runSync(\"/bin/sh\", [\"-c\", \"tty > /dev/null 2> /dev/null\"]);\n+      Process.runSync(\"@TERMUX_PREFIX@/bin/sh\", [\"-c\", \"tty > /dev/null 2> /dev/null\"]);\n \n   if (result.exitCode != 0) {\n     if (debug) {\n@@ -67,7 +67,7 @@\n   // The `-S` option of `tput` allows us to query multiple capabilities at\n   // once.\n   result = Process.runSync(\n-      \"/bin/sh\", [\"-c\", \"printf '%s' '$TERMINAL_CAPABILITIES' | tput -S\"]);\n+      \"@TERMUX_PREFIX@/bin/sh\", [\"-c\", \"printf '%s' '$TERMINAL_CAPABILITIES' | tput -S\"]);\n \n   if (result.exitCode != 0) {\n     if (debug) {\ndiff -uNr src/sdk/pkg/front_end/lib/src/fasta/colors.dart src.mod/sdk/pkg/front_end/lib/src/fasta/colors.dart\n--- src/sdk/pkg/front_end/lib/src/fasta/colors.dart\t2019-05-22 18:59:58.267004322 +0000\n+++ src.mod/sdk/pkg/front_end/lib/src/fasta/colors.dart\t2019-05-22 19:19:14.722850300 +0000\n@@ -154,7 +154,7 @@\n   // The `-S` option of `tput` allows us to query multiple capabilities at\n   // once.\n   ProcessResult result = Process.runSync(\n-      \"/bin/sh\", [\"-c\", \"printf '%s' '$TERMINAL_CAPABILITIES' | tput -S\"]);\n+      \"@TERMUX_PREFIX@/bin/sh\", [\"-c\", \"printf '%s' '$TERMINAL_CAPABILITIES' | tput -S\"]);\n \n   if (result.exitCode != 0) {\n     if (context.options.verbose) {\ndiff -uNr src/sdk/runtime/bin/process_patch.dart src.mod/sdk/runtime/bin/process_patch.dart\n--- src/sdk/runtime/bin/process_patch.dart\t2019-05-22 18:59:58.641006510 +0000\n+++ src.mod/sdk/runtime/bin/process_patch.dart\t2019-05-22 19:15:52.594173281 +0000\n@@ -321,7 +321,7 @@\n     if (Platform.isWindows) {\n       return 'cmd.exe';\n     }\n-    return '/bin/sh';\n+    return '@TERMUX_PREFIX@/bin/sh';\n   }\n \n   static List<String> _getShellArguments(\n"
  },
  {
    "path": "packages/dart/sdk-runtime-bin-directory_android.cc.patch",
    "content": "--- ./sdk/runtime/bin/directory_android.cc\t2019-06-14 00:27:54.559512261 +0530\n+++ ./sdk/runtime/bin/directory_android.cc\t2019-06-14 00:32:21.470848945 +0530\n@@ -429,7 +429,7 @@\n   // TODO(4413): In the long run, when running in an application we should\n   // probably use the appropriate directory from the Android API,\n   // probably what File.createTempFile uses.\n-  const char* kAndroidTempDir = \"/data/local/tmp\";\n+  const char* kAndroidTempDir = \"@TERMUX_PREFIX@/tmp\";\n   struct stat st;\n   if (stat(kAndroidTempDir, &st) != 0) {\n     mkdir(kAndroidTempDir, 0777);\n--- ./sdk/runtime/vm/os_android.cc\t2019-06-14 23:47:25.713639563 +0530\n+++ ./sdk/runtime/vm/os_android.cc\t2019-06-14 23:47:19.743694949 +0530\n@@ -42,7 +42,7 @@\n       return;\n     }\n     intptr_t pid = getpid();\n-    char* filename = OS::SCreate(NULL, \"/tmp/perf-%\" Pd \".map\", pid);\n+    char* filename = OS::SCreate(NULL, \"@TERMUX_PREFIX@/tmp/perf-%\" Pd \".map\", pid);\n     out_file_ = (*file_open)(filename, true);\n     free(filename);\n   }\n"
  },
  {
    "path": "packages/dash/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://gondor.apana.org.au/~herbert/dash/\nTERMUX_PKG_DESCRIPTION=\"Small POSIX-compliant implementation of /bin/sh\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.5.10.2\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://gondor.apana.org.au/~herbert/dash/files/dash-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=3c663919dc5c66ec991da14c7cf7e0be8ad00f3db73986a987c118862b5f6071\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-static\"\n\ntermux_step_post_make_install() {\n\t# Symlink sh -> dash\n\tln -sfr $TERMUX_PREFIX/bin/{dash,sh}\n\tln -sfr $TERMUX_PREFIX/share/man/man1/{dash,sh}.1\n}\n"
  },
  {
    "path": "packages/dash/etc-profile.patch",
    "content": "diff --git a/src/main.c b/src/main.c\nindex fcd3e7d..39b6e70 100644\n--- a/src/main.c\n+++ b/src/main.c\n@@ -146,7 +146,7 @@ main(int argc, char **argv)\n \tlogin = procargs(argc, argv);\n \tif (login) {\n \t\tstate = 1;\n-\t\tread_profile(\"/etc/profile\");\n+\t\tread_profile(\"@TERMUX_PREFIX@/etc/profile\");\n state1:\n \t\tstate = 2;\n \t\tread_profile(\"$HOME/.profile\");\n"
  },
  {
    "path": "packages/dash/mktokens.patch",
    "content": "On-device build support.\n\ndiff -uNr dash-0.5.10.2/src/mktokens dash-0.5.10.2.mod/src/mktokens\n--- dash-0.5.10.2/src/mktokens\t2014-09-28 11:19:32.000000000 +0300\n+++ dash-0.5.10.2.mod/src/mktokens\t2019-08-16 03:05:06.422193420 +0300\n@@ -37,7 +37,7 @@\n # token marks the end of a list.  The third column is the name to print in\n # error messages.\n \n-cat > /tmp/ka$$ <<\\!\n+cat > ${TMPDIR:-/tmp}/ka$$ <<\\!\n TEOF\t1\tend of file\n TNL\t0\tnewline\n TSEMI\t0\t\";\"\n@@ -68,28 +68,28 @@\n TBEGIN\t0\t\"{\"\n TEND\t1\t\"}\"\n !\n-nl=`wc -l /tmp/ka$$`\n+nl=`wc -l ${TMPDIR:-/tmp}/ka$$`\n exec > token.h\n-awk '{print \"#define \" $1 \" \" NR-1}' /tmp/ka$$\n+awk '{print \"#define \" $1 \" \" NR-1}' ${TMPDIR:-/tmp}/ka$$\n \n exec > token_vars.h\n \n echo '\n /* Array indicating which tokens mark the end of a list */\n static const char tokendlist[] = {'\n-awk '{print \"\\t\" $2 \",\"}' /tmp/ka$$\n+awk '{print \"\\t\" $2 \",\"}' ${TMPDIR:-/tmp}/ka$$\n echo '};\n \n static const char *const tokname[] = {'\n sed -e 's/\"/\\\\\"/g' \\\n     -e 's/[^\t ]*[\t ][\t ]*[^\t ]*[\t ][\t ]*\\(.*\\)/\t\"\\1\",/' \\\n-    /tmp/ka$$\n+    ${TMPDIR:-/tmp}/ka$$\n echo '};\n '\n-sed 's/\"//g' /tmp/ka$$ | awk '\n-/TNOT/{print \"#define KWDOFFSET \" NR-1; print \"\"; \n+sed 's/\"//g' ${TMPDIR:-/tmp}/ka$$ | awk '\n+/TNOT/{print \"#define KWDOFFSET \" NR-1; print \"\";\n       print \"static const char *const parsekwd[] = {\"}\n /TNOT/,/neverfound/{if (last) print \"\t\\\"\" last \"\\\",\"; last = $3}\n END{print \"\t\\\"\" last \"\\\"\\n};\"}'\n \n-rm /tmp/ka$$\n+rm ${TMPDIR:-/tmp}/ka$$\n"
  },
  {
    "path": "packages/dash/src-var.c.patch",
    "content": "diff -uNr dash-0.5.10.2/src/var.c dash-0.5.10.2.mod/src/var.c\n--- dash-0.5.10.2/src/var.c\t2018-05-17 14:10:58.000000000 +0300\n+++ dash-0.5.10.2.mod/src/var.c\t2018-06-21 10:46:49.260059837 +0300\n@@ -74,7 +74,7 @@\n MKINIT struct localvar_list *localvar_stack;\n \n const char defpathvar[] =\n-\t\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\";\n+\t\"PATH=@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets\";\n #ifdef IFS_BROKEN\n const char defifsvar[] = \"IFS= \\t\\n\";\n #else\n"
  },
  {
    "path": "packages/dasm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://dasm-dillon.sourceforge.io/\nTERMUX_PKG_DESCRIPTION=\"Macro assembler with support for several 8-bit microprocessors\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.20.11\nTERMUX_PKG_SHA256=c69bbe192159dcf75677ca13bba65c3318dc443f2df45fccd3c060b2e092c7f5\nTERMUX_PKG_SRCURL=https://github.com/dasm-assembler/dasm/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n  cp $TERMUX_PKG_SRCDIR/bin/* $TERMUX_PREFIX/bin/\n}\n"
  },
  {
    "path": "packages/datamash/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/datamash/\nTERMUX_PKG_DESCRIPTION=\"GNU datamash performs basic numeric,textual and statistical operations\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.5\nTERMUX_PKG_SHA256=226249d5fe54024f96404798778f45963a3041714229d4225cd5d9acdaba21ad\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/datamash/datamash-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tif $TERMUX_DEBUG; then\n\t\t# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:\n\t\t# /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'\n\t\t# return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap);\n\t\t#                                                 ^\n\t\t# lib/cdefs.h:123:48: note: expanded from macro '__bos'\n\t\t# #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)\n\t\t#                                                ^\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n"
  },
  {
    "path": "packages/dcraw/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.cybercom.net/~dcoffin/dcraw/\nTERMUX_PKG_DESCRIPTION=\"Raw digital camera images decoding utility\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=9.28.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=2890c3da2642cd44c5f3bfed2c9b2c1db83da5cec09cc17e0fa72e17541fb4b9\n#TERMUX_PKG_SRCURL=http://www.cybercom.net/~dcoffin/dcraw/archive/dcraw-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SRCURL=https://mirrors.dotsrc.org/pub/mirrors/exherbo/dcraw-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"littlecms, libjasper, libjpeg-turbo\"\n\ntermux_step_make_install() {\n\t# See the \"install\" script for flags:\n\t$CC $CFLAGS $CPPFLAGS $LDFLAGS dcraw.c $TERMUX_PKG_BUILDER_DIR/swab.c -lm -ljasper -ljpeg -llcms2 -o $TERMUX_PREFIX/bin/dcraw\n\tchmod +w dcraw.1 # Add missing write permission\n\tcp dcraw.1 $TERMUX_PREFIX/share/man/man1/\n}\n"
  },
  {
    "path": "packages/dcraw/swab.c",
    "content": "/* Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\n#include <unistd.h>\n\nvoid\nswab (const void *bfrom, void *bto, ssize_t n)\n{\n\tconst char *from = (const char *) bfrom;\n\tchar *to = (char *) bto;\n\n\tn &= ~((ssize_t) 1);\n\twhile (n > 1)\n\t{\n\t\tconst char b0 = from[--n], b1 = from[--n];\n\t\tto[n] = b0;\n\t\tto[n + 1] = b1;\n\t}\n}\n"
  },
  {
    "path": "packages/ddrescue/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/ddrescue/\nTERMUX_PKG_DESCRIPTION=\"GNU data recovery tool\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.24\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/ddrescue/ddrescue-${TERMUX_PKG_VERSION}.tar.lz\nTERMUX_PKG_SHA256=4b5d3feede70e3657ca6b3c7844f23131851cbb6af0cecc9721500f7d7021087\nTERMUX_PKG_DEPENDS=\"libc++\"\n"
  },
  {
    "path": "packages/ddrescue/fix-configure.patch",
    "content": "diff -u -r ../ddrescue-1.23/configure ./configure\n--- ../ddrescue-1.23/configure\t2018-02-13 12:54:43.000000000 +0000\n+++ ./configure\t2018-02-18 21:07:51.862861331 +0000\n@@ -15,23 +15,15 @@\n LC_ALL=C\n export LC_ALL\n srcdir=\n-prefix=/usr/local\n+prefix?=/usr/local\n exec_prefix='$(prefix)'\n bindir='$(exec_prefix)/bin'\n datarootdir='$(prefix)/share'\n infodir='$(datarootdir)/info'\n mandir='$(datarootdir)/man'\n-CXX=g++\n+CXX?=g++\n CPPFLAGS=\n-CXXFLAGS='-Wall -W -O2'\n-LDFLAGS=\n-\n-# checking whether we are using GNU C++.\n-/bin/sh -c \"${CXX} --version\" > /dev/null 2>&1 ||\n-\t{\n-\tCXX=c++\n-\tCXXFLAGS=-O2\n-\t}\n+CXXFLAGS?='-Wall -W -O2'\n \n # Loop over all args\n args=\n"
  },
  {
    "path": "packages/debianutils/add-shell.patch",
    "content": "diff -u -r ../debianutils-4.4/add-shell ./add-shell\n--- ../debianutils-4.4/add-shell\t2013-07-28 03:30:26.000000000 +0200\n+++ ./add-shell\t2014-05-30 16:07:00.000000000 +0200\n@@ -6,7 +6,7 @@\n \texit 1\n fi\n \n-file=/etc/shells\n+file=@TERMUX_PREFIX@/etc/shells\n # I want this to be GUARANTEED to be on the same filesystem as $file\n tmpfile=${file}.tmp\n \n"
  },
  {
    "path": "packages/debianutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/debianutils\nTERMUX_PKG_DESCRIPTION=\"Small utilities which are used primarily by the installation scripts of Debian packages\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.9.1\nTERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/d/debianutils/debianutils_${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=af826685d9c56abfa873e84cd392539cd363cb0ba04a09d21187377e1b764091\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/installkernel share/man/man8/installkernel.8\"\n"
  },
  {
    "path": "packages/debianutils/remove-shell.patch",
    "content": "diff -u -r ../debianutils-4.4/remove-shell ./remove-shell\n--- ../debianutils-4.4/remove-shell\t2013-07-28 03:30:26.000000000 +0200\n+++ ./remove-shell\t2014-05-30 16:38:24.000000000 +0200\n@@ -6,7 +6,7 @@\n \texit 1\n fi\n \n-file=/etc/shells\n+file=@TERMUX_PREFIX@/etc/shells\n # I want this to be GUARANTEED to be on the same filesystem as $file\n tmpfile=${file}.tmp\n otmpfile=${file}.tmp2\n"
  },
  {
    "path": "packages/debootstrap/Makefile.patch",
    "content": "diff -uNr debootstrap-1.0.106/Makefile debootstrap-1.0.106.mod/Makefile\n--- debootstrap-1.0.106/Makefile\t2018-07-05 11:48:22.000000000 +0300\n+++ debootstrap-1.0.106.mod/Makefile\t2018-07-10 15:33:41.289906934 +0300\n@@ -5,14 +5,12 @@\n \n clean:\n \n-DSDIR=$(DESTDIR)/usr/share/debootstrap\n+DSDIR=$(DESTDIR)$(PREFIX)/share/debootstrap\n install:\n \tmkdir -p $(DSDIR)/scripts\n-\tmkdir -p $(DESTDIR)/usr/sbin\n \n \tcp -a scripts/* $(DSDIR)/scripts/\n-\tinstall -o root -g root -m 0644 functions $(DSDIR)/\n+\tinstall -m 0644 functions $(DSDIR)/\n \n-\tsed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap\n-\tchown root:root $(DESTDIR)/usr/sbin/debootstrap\n-\tchmod 0755 $(DESTDIR)/usr/sbin/debootstrap\n+\tsed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)$(PREFIX)/bin/debootstrap\n+\tchmod 0755 $(DESTDIR)$(PREFIX)/bin/debootstrap\n"
  },
  {
    "path": "packages/debootstrap/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://wiki.debian.org/Debootstrap\nTERMUX_PKG_DESCRIPTION=\"Bootstrap a basic Debian system\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Pierre Rudloff @Rudloff\"\nTERMUX_PKG_VERSION=1.0.116\nTERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/d/debootstrap/debootstrap_${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=cb33272d8f21b5cb8b26e9cc29be9d4627786ee53c5b7ec478973aa4273cf019\nTERMUX_PKG_DEPENDS=\"wget, proot, perl\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_post_make_install() {\n    mkdir -p ${TERMUX_PREFIX}/share/man/man8/\n    install ${TERMUX_PKG_SRCDIR}/debootstrap.8 ${TERMUX_PREFIX}/share/man/man8/\n}\n"
  },
  {
    "path": "packages/debootstrap/debootstrap.patch",
    "content": "diff -u -r ../debootstrap-1.0.108/debootstrap ./debootstrap\n--- ../debootstrap-1.0.108/debootstrap\t2018-08-12 08:58:37.000000000 +0000\n+++ ./debootstrap\t2018-08-27 19:44:25.479843110 +0000\n@@ -3,7 +3,7 @@\n \n VERSION='@VERSION@'\n \n-unset TMP TEMP TMPDIR || true\n+unset LD_PRELOAD TMP TEMP TMPDIR || true\n \n # might not be exported if we're running from init=/bin/sh or similar\n export PATH\n@@ -14,7 +14,7 @@\n \tif [ -x /debootstrap/debootstrap ]; then\n \t\tDEBOOTSTRAP_DIR=/debootstrap\n \telse\n-\t\tDEBOOTSTRAP_DIR=/usr/share/debootstrap\n+\t\tDEBOOTSTRAP_DIR=$PREFIX/share/debootstrap\n \tfi\n fi\n \n@@ -500,14 +500,31 @@\n \n if in_path dpkg && \\\n      dpkg --print-architecture >/dev/null 2>&1; then\n-\tHOST_ARCH=$(/usr/bin/dpkg --print-architecture)\n+\tHOST_ARCH=$($PREFIX/bin/dpkg --print-architecture)\n elif in_path udpkg && \\\n      udpkg --print-architecture >/dev/null 2>&1; then\n-\tHOST_ARCH=$(/usr/bin/udpkg --print-architecture)\n+\tHOST_ARCH=$($PREFIX/bin/udpkg --print-architecture)\n elif [ -e \"$DEBOOTSTRAP_DIR/arch\" ]; then\n \tHOST_ARCH=$(cat \"$DEBOOTSTRAP_DIR/arch\")\n fi\n HOST_OS=\"$HOST_ARCH\"\n+\n+# Translate Termux arch names to those of Debian:\n+case $HOST_ARCH in\n+\tarm)\n+\t\tHOST_ARCH=armel\n+\t\t;;\n+\taarch64)\n+\t\tHOST_ARCH=arm64\n+\t\t;;\n+\ti686)\n+\t\tHOST_ARCH=i386\n+\t\t;;\n+\tx86_64)\n+\t\tHOST_ARCH=amd64\n+\t\t;;\n+esac\n+\n # basic host OS guessing for non-Debian systems\n if [ -z \"$HOST_OS\" ]; then\n \tcase $(uname) in\n@@ -544,12 +561,8 @@\n if [ \"$TARGET\" = \"/\" ]; then\n \tCHROOT_CMD=\"\"\n else\n-\tCHROOT_CMD=\"chroot \\\"$TARGET\\\"\"\n-fi\n-\n-# fakeroot cannot check /proc/1/environ\n-if [ \"$HOST_OS\" = Linux ] && ! doing_variant fakechroot && [ \"$CONTAINER\" = \"lxc-libvirt\" ]; then\n-       CHROOT_CMD=\"unshare --net $CHROOT_CMD\"\n+\tPATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin\n+\tCHROOT_CMD=\"proot -w /home -b /dev -b /proc --link2symlink -0 -r $TARGET\"\n fi\n \n if [ -z \"$SHA_SIZE\" ]; then\n@@ -563,16 +576,6 @@\n \n export ARCH SUITE TARGET CHROOT_CMD SHA_SIZE DEBOOTSTRAP_CHECKSUM_FIELD\n \n-if am_doing_phase first_stage second_stage; then\n-\tif in_path id && [ \"$(id -u)\" -ne 0 ]; then\n-\t\terror 1 NEEDROOT \"debootstrap can only run as root\"\n-\tfi\n-\t# Ensure that we can create working devices and executables on the target.\n-\tif ! check_sane_mount \"$TARGET\"; then\n-\t\terror 1 NOEXEC \"Cannot install into target '$TARGET' mounted with noexec or nodev\"\n-\tfi\n-fi\n-\n if [ ! -e \"$SCRIPT\" ]; then\n \terror 1 NOSCRIPT \"No such script: %s\" \"$SCRIPT\"\n fi\n"
  },
  {
    "path": "packages/debootstrap/fix-keyring-paths.patch",
    "content": "diff -uNr debootstrap/scripts/aequorea debootstrap.mod/scripts/aequorea\n--- debootstrap/scripts/aequorea\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/aequorea\t2019-01-19 00:01:31.279213294 +0200\n@@ -2,7 +2,7 @@\n download_style apt\n finddebs_style from-indices\n variants - buildd fakechroot minbase\n-keyring /usr/share/keyrings/tanglu-archive-keyring.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/tanglu-archive-keyring.gpg\n default_mirror http://archive.tanglu.org/tanglu\n \n if doing_variant fakechroot; then\ndiff -uNr debootstrap/scripts/etch debootstrap.mod/scripts/etch\n--- debootstrap/scripts/etch\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/etch\t2019-01-19 00:01:37.295931992 +0200\n@@ -3,7 +3,7 @@\n finddebs_style from-indices\n variants - buildd fakechroot minbase\n default_mirror http://archive.debian.org/debian\n-keyring /usr/share/keyrings/debian-archive-removed-keys.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg\n force_md5\n \n # include common settings\ndiff -uNr debootstrap/scripts/gutsy debootstrap.mod/scripts/gutsy\n--- debootstrap/scripts/gutsy\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/gutsy\t2019-01-19 00:01:43.295983852 +0200\n@@ -27,7 +27,7 @@\n download_style apt\n finddebs_style from-indices\n variants - buildd fakechroot minbase\n-keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/ubuntu-archive-keyring.gpg\n \n if doing_variant fakechroot; then\n \ttest \"$FAKECHROOT\" = \"true\" || error 1 FAKECHROOTREQ \"This variant requires fakechroot environment to be started\"\ndiff -uNr debootstrap/scripts/kali debootstrap.mod/scripts/kali\n--- debootstrap/scripts/kali\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/kali\t2019-01-19 00:01:47.792689365 +0200\n@@ -2,7 +2,7 @@\n download_style apt\n finddebs_style from-indices\n variants - buildd fakechroot minbase\n-keyring /usr/share/keyrings/kali-archive-keyring.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/kali-archive-keyring.gpg\n default_mirror http://http.kali.org/kali\n \n # include common settings\ndiff -uNr debootstrap/scripts/potato debootstrap.mod/scripts/potato\n--- debootstrap/scripts/potato\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/potato\t2019-01-19 00:01:52.366062187 +0200\n@@ -1,7 +1,7 @@\n mirror_style release\n download_style apt var-state\n default_mirror http://archive.debian.org/debian\n-keyring /usr/share/keyrings/debian-archive-removed-keys.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg\n force_md5\n \n LIBC=libc6\ndiff -uNr debootstrap/scripts/sarge debootstrap.mod/scripts/sarge\n--- debootstrap/scripts/sarge\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/sarge\t2019-01-19 00:01:56.512764645 +0200\n@@ -1,7 +1,7 @@\n mirror_style release\n download_style apt\n default_mirror http://archive.debian.org/debian\n-keyring /usr/share/keyrings/debian-archive-removed-keys.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg\n force_md5\n \n LIBC=libc6\ndiff -uNr debootstrap/scripts/sid debootstrap.mod/scripts/sid\n--- debootstrap/scripts/sid\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/sid\t2019-01-19 00:02:00.832801917 +0200\n@@ -2,7 +2,7 @@\n download_style apt\n finddebs_style from-indices\n variants - buildd fakechroot minbase\n-keyring /usr/share/keyrings/debian-archive-keyring.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-keyring.gpg\n \n # include common settings\n if [ -e \"$DEBOOTSTRAP_DIR/scripts/debian-common\" ]; then\ndiff -uNr debootstrap/scripts/woody debootstrap.mod/scripts/woody\n--- debootstrap/scripts/woody\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/woody\t2019-01-19 00:02:06.079513823 +0200\n@@ -1,7 +1,7 @@\n mirror_style release\n download_style apt\n default_mirror http://archive.debian.org/debian\n-keyring /usr/share/keyrings/debian-archive-removed-keys.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg\n force_md5\n \n LIBC=libc6\ndiff -uNr debootstrap/scripts/woody.buildd debootstrap.mod/scripts/woody.buildd\n--- debootstrap/scripts/woody.buildd\t2018-11-20 20:55:53.000000000 +0200\n+++ debootstrap.mod/scripts/woody.buildd\t2019-01-19 00:02:24.623006862 +0200\n@@ -1,7 +1,7 @@\n mirror_style release\n download_style apt\n default_mirror http://archive.debian.org/debian\n-keyring /usr/share/keyrings/debian-archive-removed-keys.gpg\n+keyring @TERMUX_PREFIX@/share/keyrings/debian-archive-removed-keys.gpg\n force_md5\n \n LIBC=libc6\n"
  },
  {
    "path": "packages/debootstrap/functions.patch",
    "content": "diff -u -r ../debootstrap-1.0.108/functions ./functions\n--- ../debootstrap-1.0.108/functions\t2018-08-12 08:58:37.000000000 +0000\n+++ ./functions\t2018-08-27 19:32:04.844265965 +0000\n@@ -230,17 +230,7 @@\n }\n \n detect_container () {\n-\tif [ \"$container\" = lxc ]; then\n-\t\tCONTAINER=\"lxc\"\n-\telif grep -qs container=lxc-libvirt /proc/1/environ; then\n-\t\tCONTAINER=\"lxc-libvirt\"\n-\telif grep -qs ^systemd-nspawn$ /run/systemd/container || [ \"$container\" = \"systemd-nspawn\" ]; then\n-\t\tCONTAINER=\"systemd-nspawn\"\n-\telif grep -qs '[[:space:]]/docker/.*/sys/fs/cgroup' /proc/1/mountinfo; then\n-\t\tCONTAINER=\"docker\"\n-\telse\n-\t\tCONTAINER=\"\"\n-\tfi\n+\tCONTAINER=\"\"\n }\n \n ########################################################## variant handling\n@@ -945,7 +935,7 @@\n extract_dpkg_deb_data () {\n \tlocal pkg=\"$1\"\n \n-\tdpkg-deb --fsys-tarfile \"$pkg\" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST \"Tried to extract package, but file already exists. Exit...\"\n+\tdpkg-deb --fsys-tarfile \"$pkg\" | proot --link2symlink tar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST \"Tried to extract package, but file already exists. Exit...\"\n }\n \n # Raw .deb extractors\n@@ -985,7 +975,7 @@\n \tesac\n \n \tif in_path \"$cat_cmd\"; then\n-\t\tar -p \"$pkg\" \"$tarball\" | \"$cat_cmd\" | tar $EXTRACT_DEB_TAR_OPTIONS -xf -\n+\t\tar -p \"$pkg\" \"$tarball\" | \"$cat_cmd\" | proot --link2symlink tar $EXTRACT_DEB_TAR_OPTIONS -xf -\n \telse\n \t\terror 1 UNPACKCMDUNVL \"Extracting %s requires the %s command, which is not available\" \"$pkg\" \"$cat_cmd\"\n \tfi\n@@ -1041,7 +1031,7 @@\n ); }\n \n in_target_nofail () {\n-\tif ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval \"$CHROOT_CMD \\\"\\$@\\\"\" 2>/dev/null; then\n+\tif ! PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD \"$@\" 2>/dev/null; then\n \t\ttrue\n \tfi\n \treturn 0\n@@ -1053,7 +1043,7 @@\n \tmsg=\"$2\"\n \targ=\"$3\"\n \tshift; shift; shift\n-\tif ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval \"$CHROOT_CMD \\\"\\$@\\\"\"; then\n+\tif ! PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD \"$@\"; then\n \t\twarning \"$code\" \"$msg\" \"$arg\"\n \t\t# Try to point user at actual failing package.\n \t\tmsg=\"See %s for details\"\n@@ -1209,7 +1199,6 @@\n \t\t\treturn 0\n \t\tfi\n \n-\t\tsetup_devices_simple\n \t\t;;\n \tesac\n }\n"
  },
  {
    "path": "packages/debootstrap/scripts-debian-common.patch",
    "content": "diff -uNr debootstrap-1.0.106/scripts/debian-common debootstrap-1.0.106.mod/scripts/debian-common\n--- debootstrap-1.0.106/scripts/debian-common\t2018-07-05 11:48:22.000000000 +0300\n+++ debootstrap-1.0.106.mod/scripts/debian-common\t2018-07-10 15:33:41.289906934 +0300\n@@ -60,7 +60,7 @@\n \tsetup_etc\n \tif [ ! -e \"$TARGET/etc/fstab\" ]; then\n \t\techo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > \"$TARGET/etc/fstab\"\n-\t\tchown 0:0 \"$TARGET/etc/fstab\"; chmod 644 \"$TARGET/etc/fstab\"\n+\t\tchmod 644 \"$TARGET/etc/fstab\"\n \tfi\n \n \tsetup_devices\n@@ -102,7 +102,6 @@\n \t}\n \n \tif ! doing_variant fakechroot; then\n-\t\tsetup_proc\n \t\tin_target /sbin/ldconfig\n \tfi\n \n@@ -172,6 +171,20 @@\n echo \\\"Warning: Fake start-stop-daemon called, doing nothing\\\"\" > \"$TARGET/sbin/start-stop-daemon\"\n \tchmod 755 \"$TARGET/sbin/start-stop-daemon\"\n \n+\t# Replace problematic binaries with a stub\n+\techo \"\" > \"$TARGET/bin/chown\"\n+\techo \"\" > \"$TARGET/usr/sbin/groupadd\"\n+\techo \"\" > \"$TARGET/usr/sbin/groupdel\"\n+\techo \"\" > \"$TARGET/usr/sbin/groupmod\"\n+\techo \"\" > \"$TARGET/usr/sbin/useradd\"\n+\techo \"\" > \"$TARGET/usr/sbin/userdel\"\n+\techo \"\" > \"$TARGET/usr/sbin/usermod\"\n+\techo \"\" > \"$TARGET/usr/bin/chage\"\n+\techo \"\" > \"$TARGET/usr/bin/chfn\"\n+\techo \"\" > \"$TARGET/usr/bin/dpkg-statoverride\"\n+\n+\techo \"nameserver 8.8.8.8\\nnameserver 8.8.4.4\" > \"$TARGET/etc/resolv.conf\"\n+\n \tsetup_dselect_method apt\n \n \tsmallyes '' |\n"
  },
  {
    "path": "packages/deutex/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/Doom-Utils/deutex/\nTERMUX_PKG_DESCRIPTION=\"WAD composer for Doom, Heretic, Hexen, and Strife\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=5.2.1\nTERMUX_PKG_SRCURL=https://github.com/Doom-Utils/deutex/releases/download/v$TERMUX_PKG_VERSION/deutex-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=d61c0d5b1fce3f8271c2358d35b41f70a08da662e387edb8a03ca1deb156831f\nTERMUX_PKG_DEPENDS=\"libpng, zlib\"\n"
  },
  {
    "path": "packages/dialog/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://invisible-island.net/dialog/\nTERMUX_PKG_DESCRIPTION=\"Application used in shell scripts which displays text user interface widgets\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_VERSION=\"1.3-20191110\"\nTERMUX_PKG_SRCURL=https://invisible-mirror.net/archives/dialog/dialog-$TERMUX_PKG_VERSION.tgz\nTERMUX_PKG_SHA256=d92a7d0910404c02c908e3ce774ac652edc822f45c6536c7d72fafa10e1d0e63\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-ncursesw --enable-widec --with-pkg-config\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Put a temporary link for libtinfo.so\n\tln -s -f $TERMUX_PREFIX/lib/libncursesw.so $TERMUX_PREFIX/lib/libtinfo.so\n}\n\ntermux_step_post_make_install() {\n\trm $TERMUX_PREFIX/lib/libtinfo.so\n\tcd $TERMUX_PREFIX/bin\n\tln -f -s dialog whiptail\n}\n"
  },
  {
    "path": "packages/dialog/configure.patch",
    "content": "diff -u -r ../dialog-1.3-20170509/configure ./configure\n--- ../dialog-1.3-20170509/configure\t2017-05-09 23:27:22.000000000 +0000\n+++ ./configure\t2017-07-07 07:23:30.678552568 +0000\n@@ -11650,7 +11650,7 @@\n int\n main (void)\n {\n-initscr(); tgoto(\"?\", 0,0)\n+initscr();\n   ;\n   return 0;\n }\n@@ -13449,7 +13449,7 @@\n int\n main (void)\n {\n-initscr(); tgoto(\"?\", 0,0)\n+initscr();\n   ;\n   return 0;\n }\n"
  },
  {
    "path": "packages/dictd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://sourceforge.net/projects/dict/\nTERMUX_PKG_DESCRIPTION=\"Online dictionary client and server\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.12.1\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/dict/dictd/dictd-${TERMUX_PKG_VERSION}/dictd-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=a237f6ecdc854ab10de5145ed42eaa2d9b6d51ffdc495f7daee59b05cc363656\nTERMUX_PKG_DEPENDS=\"libmaa, zlib\"\n"
  },
  {
    "path": "packages/dictd/dictd.patch",
    "content": "diff -u -r ../dictd-1.12.1.orig/Makefile.in ./Makefile.in\n--- ../dictd-1.12.1.orig/Makefile.in\t2011-03-07 02:52:54.000000000 +0900\n+++ ./Makefile.in\t2018-02-08 18:50:15.790039388 +0900\n@@ -123,7 +123,7 @@\n \n %: %.o\n \t$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -static \\\n-\t\t$^ $(OBJS) $(LDFLAGS) -lz ${LIBS}\n+\t\t$(^:.o=.lo) $(OBJS) $(LDFLAGS) -lz ${LIBS}\n \n include $(srcdir)/deps\n \ndiff -u -r ../dictd-1.12.1.orig/dictd.c ./dictd.c\n--- ../dictd-1.12.1.orig/dictd.c\t2011-01-10 01:53:27.000000000 +0900\n+++ ./dictd.c\t2018-02-08 18:50:19.980039386 +0900\n@@ -75,7 +75,7 @@\n const char         *logFile     = NULL;\n int logFile_set; /* 1 if set by command line option */\n \n-const char *pidFile     = \"/var/run/dictd.pid\";\n+const char *pidFile     = \"@TERMUX_PREFIX@/var/run/dictd.pid\";\n int pidFile_set; /* 1 if set by command line option */\n \n const char         *daemon_service     = DICT_DEFAULT_SERVICE;\nOnly in .: dictd.patch\ndiff -u -r ../dictd-1.12.1.orig/net.c ./net.c\n--- ../dictd-1.12.1.orig/net.c\t2010-08-22 02:55:40.000000000 +0900\n+++ ./net.c\t2018-02-08 18:50:22.640039385 +0900\n@@ -65,7 +65,9 @@\n {\n    struct hostent     *hostEntry;\n    struct servent     *serviceEntry;\n+   /*\n    struct protoent    *protocolEntry;\n+   */\n    struct sockaddr_in ssin;\n    int                s;\n    int                hosts = 0;\n@@ -79,8 +81,10 @@\n    } else if (!(ssin.sin_port = htons(atoi(service))))\n       return NET_NOSERVICE;\n \n+   /*\n    if (!(protocolEntry = getprotobyname(\"tcp\")))\n       return NET_NOPROTOCOL;\n+   */\n    \n    if ((hostEntry = gethostbyname(host))) {\n       ++hosts;\n@@ -92,7 +96,7 @@\n \t memcpy( &ssin.sin_addr.s_addr, *current, hostEntry->h_length );\n \t PRINTF(DBG_VERBOSE,\n \t\t(\"Trying %s (%s)\\n\",host,inet_ntoa(ssin.sin_addr)));\n-\t if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)\n+\t if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)\n \t    err_fatal_errno( __func__, \"Can't open socket on port %d\\n\",\n \t\t\t     ntohs(ssin.sin_port) );      \n \t if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0)\n@@ -100,7 +104,7 @@\n \t close(s);\n       }\n    } else {\n-      if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)\n+      if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)\n \t err_fatal_errno( __func__, \"Can't open socket on port %d\\n\",\n \t\t\t  ntohs(ssin.sin_port) );\n       if (connect(s, (struct sockaddr *)&ssin, sizeof(ssin)) >= 0)\n@@ -117,7 +121,9 @@\n    int queueLength)\n {\n    struct servent     *serviceEntry;\n+   /*\n    struct protoent    *protocolEntry;\n+   */\n    struct sockaddr_in ssin;\n    int                s;\n    const int          one = 1;\n@@ -131,10 +137,12 @@\n    } else if (!(ssin.sin_port = htons(atoi(service))))\n       err_fatal( __func__, \"Can't get \\\"%s\\\" service entry\\n\", service );\n \n+   /*\n    if (!(protocolEntry = getprotobyname(\"tcp\")))\n       err_fatal( __func__, \"Can't get \\\"tcp\\\" protocol entry\\n\" );\n+   */\n    \n-   if ((s = socket(PF_INET, SOCK_STREAM, protocolEntry->p_proto)) < 0)\n+   if ((s = socket(PF_INET, SOCK_STREAM, 6)) < 0)\n       err_fatal_errno( __func__, \"Can't open socket on port %d\\n\",\n \t\t       ntohs(ssin.sin_port) );\n \ndiff -u -r ../dictd-1.12.1.orig/parse.c ./parse.c\n--- ../dictd-1.12.1.orig/parse.c\t2008-12-08 01:50:05.000000000 +0900\n+++ ./parse.c\t2018-02-08 18:52:46.640039330 +0900\n@@ -90,10 +90,9 @@\n    char              *buffer;\n    const char        **pt;\n    static const char *cpp = NULL;\n-   static const char *cpps[] = { \"/lib/cpp\",\n-                                 \"/usr/lib/cpp\",\n-                                 \"/usr/ccs/lib/cpp\",\t/* Solaris */\n-                                 \"/usr/lang/cpp\",\n+   static const char *cpps[] = { \"@TERMUX_PREFIX@/lib/cpp\",\n+                                 \"@TERMUX_PREFIX@/ccs/lib/cpp\",\t/* Solaris */\n+                                 \"@TERMUX_PREFIX@/lang/cpp\",\n                                  0 };\n    static const char *extra_options = \"\";\n    FILE              *tmp;\n"
  },
  {
    "path": "packages/diffutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/diffutils/\nTERMUX_PKG_DESCRIPTION=\"Programs (cmp, diff, diff3 and sdiff) related to finding differences between files\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=3.7\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/diffutils/diffutils-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=b3a7a6221c3dc916085f0d205abf6b8e1ba443d4dd965118da364a1dc1cb3a26\nTERMUX_PKG_DEPENDS=\"libiconv\"\nTERMUX_PKG_ESSENTIAL=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_path_PR_PROGRAM=${TERMUX_PREFIX}/bin/pr\"\n\ntermux_step_pre_configure() {\n\tif $TERMUX_DEBUG; then\n\t\t# When doing debug build, -D_FORTIFY_SOURCE=2 gives an\n\t\t# error: use of undeclared identifier '__USE_FORTIFY_LEVEL'\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n"
  },
  {
    "path": "packages/direnv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/direnv/direnv\nTERMUX_PKG_DESCRIPTION=\"Environment switcher for shell\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.20.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/direnv/direnv/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=dd54393661602bb989ee880f14c41f7a7b47a153777999509127459edae52e47\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\ttermux_setup_golang\n\tmake\n}\n\ntermux_step_make_install() {\n\tmake install DESTDIR=$TERMUX_PREFIX\n}\n"
  },
  {
    "path": "packages/direvent/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org.ua/software/direvent/\nTERMUX_PKG_DESCRIPTION=\"Monitor of events in file system directories\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=5.2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/direvent/direvent-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=239822cdda9ecbbbc41a69181b34505b2d3badd4df5367e765a0ceb002883b55\nTERMUX_PKG_DEPENDS=\"libandroid-glob\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-landroid-glob -llog\"\n}\n"
  },
  {
    "path": "packages/direvent/preproc.c.patch",
    "content": "\"The getdtablesize functions has been deprecated by Posix and has been   \n removed from Android's LB64 ABI. Replace calls to it with the modern\n equivalent sysconf(_SC_OPEN_MAX).\"\n\n- https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/AXhZapYuHi8\n\ndiff -u -r ../direvent-5.0/grecs/src/preproc.c ./grecs/src/preproc.c\n--- ../direvent-5.0/grecs/src/preproc.c\t2013-12-17 16:32:57.000000000 -0500\n+++ ./grecs/src/preproc.c\t2016-01-03 08:46:26.663047361 -0500\n@@ -679,7 +679,7 @@\n \t\t}\n \n \t\t/* Close unneeded descripitors */\n-\t\tfor (i = getdtablesize(); i > 2; i--)\n+\t\tfor (i = sysconf(_SC_OPEN_MAX); i > 2; i--)\n \t\t\tclose(i);\n \n \t\tif (!grecs_log_to_stderr) {\n"
  },
  {
    "path": "packages/diskus/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/diskus\nTERMUX_PKG_DESCRIPTION=\"A minimal, fast alternative to 'du -sh'\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.6.0\nTERMUX_PKG_SRCURL=https://github.com/sharkdp/diskus/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=661687edefa3218833677660a38ccd4e2a3c45c4a66055c5bfa4667358b97500\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/dnsutils/bin-delv-delv.c.patch",
    "content": "diff -u -r ../bind-9.10.3/bin/delv/delv.c ./bin/delv/delv.c\n--- ../bind-9.10.3/bin/delv/delv.c\t2015-09-08 22:23:40.000000000 -0400\n+++ ./bin/delv/delv.c\t2015-09-18 09:20:21.037363830 -0400\n@@ -869,7 +869,7 @@\n \tif (result != ISC_R_SUCCESS)\n \t\tfatal(\"Couldn't parse port number\");\n \n-\tresult = irs_resconf_load(mctx, \"/etc/resolv.conf\", &resconf);\n+\tresult = irs_resconf_load(mctx, RESOLV_CONF, &resconf);\n \tif (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) {\n \t\tdelv_log(ISC_LOG_ERROR, \"irs_resconf_load: %s\",\n \t\t\t  isc_result_totext(result));\n"
  },
  {
    "path": "packages/dnsutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.isc.org/downloads/bind/\nTERMUX_PKG_DESCRIPTION=\"Clients provided with BIND\"\nTERMUX_PKG_LICENSE=\"MPL-2.0\"\nTERMUX_PKG_VERSION=9.14.8\nTERMUX_PKG_SRCURL=\"ftp://ftp.isc.org/isc/bind9/${TERMUX_PKG_VERSION}/bind-${TERMUX_PKG_VERSION}.tar.gz\"\nTERMUX_PKG_SHA256=e545aa75ced6695a9bf4b591606ef00260fb3c055c2865b299cfe0fe6eeea076\nTERMUX_PKG_DEPENDS=\"openssl, readline, resolv-conf, zlib\"\nTERMUX_PKG_BREAKS=\"dnsutils-dev\"\nTERMUX_PKG_REPLACES=\"dnsutils-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-linux-caps\n--without-python\n--with-ecdsa=no\n--with-gost=no\n--with-gssapi=no\n--with-libjson=no\n--with-libtool\n--with-libxml2=no\n--with-openssl=$TERMUX_PREFIX\n--with-randomdev=/dev/random\n--with-readline=-lreadline\n--with-eddsa=no\n\"\n\ntermux_step_pre_configure() {\n\texport BUILD_AR=ar\n\texport BUILD_CC=gcc\n\texport BUILD_CFLAGS=\n\texport BUILD_CPPFLAGS=\n\texport BUILD_LDFLAGS=\n\texport BUILD_RANLIB=\n\n\t_RESOLV_CONF=$TERMUX_PREFIX/etc/resolv.conf\n\tCFLAGS+=\" $CPPFLAGS -DRESOLV_CONF=\\\\\\\"$_RESOLV_CONF\\\\\\\"\"\n\tLDFLAGS+=\" -llog\"\n}\n\ntermux_step_make() {\n\tmake -C lib/isc\n\tmake -C lib/dns\n\tmake -C lib/ns\n\tmake -C lib/isccc\n\tmake -C lib/isccfg\n\tmake -C lib/bind9\n\tmake -C lib/irs\n\tmake -C bin/dig\n\tmake -C bin/delv\n\tmake -C bin/nsupdate\n}\n\ntermux_step_make_install() {\n\tmake -C lib/isc install\n\tmake -C lib/dns install\n\tmake -C lib/ns install\n\tmake -C lib/isccc install\n\tmake -C lib/isccfg install\n\tmake -C lib/bind9 install\n\tmake -C lib/irs install\n\tmake -C bin/dig install\n\tmake -C bin/delv install\n\tmake -C bin/nsupdate install\n}\n"
  },
  {
    "path": "packages/dnsutils/lib-irs-context.c.patch",
    "content": "diff -uNr bind-9.13.6/lib/irs/context.c bind-9.13.6.mod/lib/irs/context.c\n--- bind-9.13.6/lib/irs/context.c\t2019-02-07 01:44:09.000000000 +0200\n+++ bind-9.13.6.mod/lib/irs/context.c\t2019-03-02 02:39:12.188552664 +0200\n@@ -42,7 +42,7 @@\n \n #ifndef DNS_CONF\n /*% location of dns.conf */\n-#define DNS_CONF \"/etc/dns.conf\"\n+#define DNS_CONF \"@TERMUX_PREFIX@/etc/dns.conf\"\n #endif\n \n static bool thread_key_initialized = false;\n"
  },
  {
    "path": "packages/dnsutils/lib-isc-pthreads-thread.c.patch",
    "content": "diff -u -r ../bind-9.13.4/lib/isc/pthreads/thread.c ./lib/isc/pthreads/thread.c\n--- ../bind-9.13.4/lib/isc/pthreads/thread.c\t2018-11-22 00:20:34.000000000 +0000\n+++ ./lib/isc/pthreads/thread.c\t2018-11-26 22:56:50.905945958 +0000\n@@ -73,7 +73,9 @@\n \n void\n isc_thread_setconcurrency(unsigned int level) {\n+#ifndef __ANDROID__\n \t(void)pthread_setconcurrency(level);\n+#endif\n }\n \n void\n"
  },
  {
    "path": "packages/docbook-xml/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.oasis-open.org/docbook/\nTERMUX_PKG_DESCRIPTION=\"A widely used XML scheme for writing documentation and help\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=4.5\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_DEPENDS=\"libxml2-utils\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_extract_package() {\n\tmkdir -p $TERMUX_PKG_SRCDIR\n\tcd $TERMUX_PKG_SRCDIR\n\n\ttermux_download \"https://docbook.org/xml/4.1.2/docbkx412.zip\" \\\n\t\t$TERMUX_PKG_CACHEDIR/docbkx412.zip \\\n\t\t30f0644064e0ea71751438251940b1431f46acada814a062870f486c772e7772\n\n\ttermux_download \"https://docbook.org/xml/4.2/docbook-xml-4.2.zip\" \\\n\t\t$TERMUX_PKG_CACHEDIR/docbook-xml-4.2.zip \\\n\t\tacc4601e4f97a196076b7e64b368d9248b07c7abf26b34a02cca40eeebe60fa2\n\n\ttermux_download \"https://docbook.org/xml/4.3/docbook-xml-4.3.zip\" \\\n\t\t$TERMUX_PKG_CACHEDIR/docbook-xml-4.3.zip \\\n\t\t23068a94ea6fd484b004c5a73ec36a66aa47ea8f0d6b62cc1695931f5c143464\n\n\ttermux_download \"https://docbook.org/xml/4.4/docbook-xml-4.4.zip\" \\\n\t\t$TERMUX_PKG_CACHEDIR/docbook-xml-4.4.zip \\\n\t\t02f159eb88c4254d95e831c51c144b1863b216d909b5ff45743a1ce6f5273090\n\n\ttermux_download \"https://docbook.org/xml/4.5/docbook-xml-4.5.zip\" \\\n\t\t$TERMUX_PKG_CACHEDIR/docbook-xml-4.5.zip \\\n\t\t4e4e037a2b83c98c6c94818390d4bdd3f6e10f6ec62dd79188594e26190dc7b4\n\n\tunzip -d docbook-xml-4.1.2 $TERMUX_PKG_CACHEDIR/docbkx412.zip\n\n\tlocal ver\n\tfor ver in 4.{2..5}; do\n\t\tunzip -d docbook-xml-${ver} $TERMUX_PKG_CACHEDIR/docbook-xml-${ver}.zip\n\tdone\n}\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/xml\n\txmlcatalog --noout --create \"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\n\tlocal ver\n\tfor ver in 4.1.2 4.{2..5}; do\n\t\tpushd docbook-xml-$ver\n\t\tmkdir -p \"$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver\"\n\t\tcp -dr docbook.cat *.dtd ent/ *.mod \\\n\t\t\t\"$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver\"\n\t\tpopd\n\n\t\txml=\n\t\tcase $ver in\n\t\t\t4.1.2) xml=' XML' ;;&\n\t\t\t*)\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//DTD DocBook XML V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/docbookx.dtd\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//DTD DocBook$xml CALS Table Model V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/calstblx.dtd\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//DTD XML Exchange Table Model 19990315//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/soextblx.dtd\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//ELEMENTS DocBook$xml Information Pool V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/dbpoolx.mod\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//ELEMENTS DocBook$xml Document Hierarchy V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/dbhierx.mod\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//ENTITIES DocBook$xml Additional General Entities V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/dbgenent.mod\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//ENTITIES DocBook$xml Notations V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/dbnotnx.mod\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//ENTITIES DocBook$xml Character Entities V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/dbcentx.mod\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t;;&\n\t\t\t4.[45])\n\t\t\t\txmlcatalog --noout --add \"public\" \\\n\t\t\t\t\t\"-//OASIS//ELEMENTS DocBook XML HTML Tables V$ver//EN\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver/htmltblx.mod\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t;;&\n\t\t\t*)\n\t\t\t\txmlcatalog --noout --add \"rewriteSystem\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t\txmlcatalog --noout --add \"rewriteURI\" \\\n\t\t\t\t\t\"http://www.oasis-open.org/docbook/xml/$ver\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/share/xml/docbook/xml-dtd-$ver\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/docbook-xml\"\n\t\t\t;;&\n\t\tesac\n\tdone\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ]; then\n\t\tif [ ! -e \"$TERMUX_PREFIX/etc/xml/catalog\" ]; then\n\t\t\txmlcatalog --noout --create \"$TERMUX_PREFIX/etc/xml/catalog\"\n\t\telse\n\t\t\txmlcatalog --noout --del \"file://$TERMUX_PREFIX/etc/xml/docbook-xml\" \\\n\t\t\t\t$TERMUX_PREFIX/etc/xml/catalog\n\t\tfi\n\t\txmlcatalog --noout --add \"delegatePublic\" \\\n\t\t\t\"-//OASIS//ENTITIES DocBook XML\" \\\n\t\t\t\"file://$TERMUX_PREFIX/etc/xml/docbook-xml\" \\\n\t\t\t$TERMUX_PREFIX/etc/xml/catalog\n\t\txmlcatalog --noout --add \"delegatePublic\" \\\n\t\t\t\"-//OASIS//DTD DocBook XML\" \\\n\t\t\t\"file://$TERMUX_PREFIX/etc/xml/docbook-xml\" \\\n\t\t\t$TERMUX_PREFIX/etc/xml/catalog\n\t\txmlcatalog --noout --add \"delegateSystem\" \\\n\t\t\t\"http://www.oasis-open.org/docbook/\" \\\n\t\t\t\"file://$TERMUX_PREFIX/etc/xml/docbook-xml\" \\\n\t\t\t$TERMUX_PREFIX/etc/xml/catalog\n\t\txmlcatalog --noout --add \"delegateURI\" \\\n\t\t\t\"http://www.oasis-open.org/docbook/\" \\\n\t\t\t\"file://$TERMUX_PREFIX/etc/xml/docbook-xml\" \\\n\t\t\t$TERMUX_PREFIX/etc/xml/catalog\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"remove\" ]; then\n\t\txmlcatalog --noout --del \"file://$TERMUX_PREFIX/etc/xml/docbook-xml\" \\\n\t\t\t$TERMUX_PREFIX/etc/xml/catalog\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/docbook-xsl/765567_non-recursive_string_subst.patch",
    "content": "Description: use EXSLT \"replace\" function when available\n A recursive implementation  of string.subst is problematic,\n long strings with many matches will cause stack overflows.\nAuthor: Peter De Wachter <pdewacht@gmail.com>\nBug-Debian: https://bugs.debian.org/750593\n\n--- docbook-xsl-1.78.1+dfsg.orig/docbook-xsl/lib/lib.xsl\n+++ docbook-xsl-1.78.1+dfsg/docbook-xsl/lib/lib.xsl\n@@ -6,7 +6,11 @@\n \n      This module implements DTD-independent functions\n \n-     ******************************************************************** --><xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n+     ******************************************************************** -->\n+<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n+                xmlns:str=\"http://exslt.org/strings\"\n+                exclude-result-prefixes=\"str\"\n+                version=\"1.0\">\n \n <xsl:template name=\"dot.count\">\n   <!-- Returns the number of \".\" characters in a string -->\n@@ -52,6 +56,9 @@\n   <xsl:param name=\"replacement\"/>\n \n   <xsl:choose>\n+    <xsl:when test=\"function-available('str:replace')\">\n+      <xsl:value-of select=\"str:replace($string, string($target), string($replacement))\"/>\n+    </xsl:when>\n     <xsl:when test=\"contains($string, $target)\">\n       <xsl:variable name=\"rest\">\n         <xsl:call-template name=\"string.subst\">\n\n"
  },
  {
    "path": "packages/docbook-xsl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://docbook.org/\nTERMUX_PKG_DESCRIPTION=\"XML stylesheets for Docbook-xml transformations\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.79.2\nTERMUX_PKG_DEPENDS=\"docbook-xml, libxml2-utils, xsltproc\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_extract_package() {\n\tmkdir -p $TERMUX_PKG_SRCDIR\n\n\tcd $TERMUX_PKG_SRCDIR\n\n\ttermux_download \"https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F${TERMUX_PKG_VERSION}/docbook-xsl-$TERMUX_PKG_VERSION.tar.gz\" \\\n\t\t$TERMUX_PKG_CACHEDIR/docbook-xsl-$TERMUX_PKG_VERSION.tar.gz \\\n\t\t966188d7c05fc76eaca115a55893e643dd01a3486f6368733c9ad974fcee7a26\n\n\ttar xf $TERMUX_PKG_CACHEDIR/docbook-xsl-$TERMUX_PKG_VERSION.tar.gz\n\n\ttermux_download \"https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F${TERMUX_PKG_VERSION}/docbook-xsl-nons-$TERMUX_PKG_VERSION.tar.gz\" \\\n\t\t$TERMUX_PKG_CACHEDIR/docbook-xsl-nons-$TERMUX_PKG_VERSION.tar.gz \\\n\t\tf89425b44e48aad24319a2f0d38e0cb6059fdc7dbaf31787c8346c748175ca8e\n\n\ttar xf $TERMUX_PKG_CACHEDIR/docbook-xsl-nons-$TERMUX_PKG_VERSION.tar.gz\n}\n\ntermux_step_patch_package() {\n\tcd $TERMUX_PKG_SRCDIR/docbook-xsl-$TERMUX_PKG_VERSION\n\tpatch -Np2 -i $TERMUX_PKG_BUILDER_DIR/765567_non-recursive_string_subst.patch\n\n\tcd $TERMUX_PKG_SRCDIR/docbook-xsl-nons-$TERMUX_PKG_VERSION\n\tpatch -Np2 -i $TERMUX_PKG_BUILDER_DIR/765567_non-recursive_string_subst.patch\n}\n\ntermux_step_make_install() {\n\tlocal pkgroot ns dir\n\n\tfor ns in -nons ''; do\n\t\tpkgroot=\"$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-${TERMUX_PKG_VERSION}${ns}\"\n\t\tdir=docbook-xsl${ns}-${TERMUX_PKG_VERSION}\n\n\t\tinstall -Dt \"$pkgroot\" -m600 $dir/VERSION{,.xsl}\n\n\t\t(\n\t\t\tshopt -s nullglob  # ignore missing files\n\t\t\tfor fn in assembly common eclipse epub epub3 fo highlighting html \\\n\t\t\t\thtmlhelp javahelp lib manpages params profiling roundtrip template \\\n\t\t\t\twebsite xhtml xhtml-1_1 xhtml5\n\t\t\tdo\n\t\t\t\tinstall -Dt \"${pkgroot}/${fn}\" -m600 ${dir}/${fn}/*.{xml,xsl,dtd,ent}\n\t\t\tdone\n\t\t)\n\tdone\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ]; then\n\t\tif [ ! -e \"$TERMUX_PREFIX/etc/xml/catalog\" ]; then\n\t\t\txmlcatalog --noout --create \"$TERMUX_PREFIX/etc/xml/catalog\"\n\t\telse\n\t\t\txmlcatalog --noout --del \"$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION\" \\\n\t\t\t\t\"$TERMUX_PREFIX/etc/xml/catalog\"\n\t\tfi\n\n\t\tfor ver in $TERMUX_PKG_VERSION current; do\n\t\t\tfor x in rewriteSystem rewriteURI; do\n\t\t\t\txmlcatalog --noout --add \\$x http://cdn.docbook.org/release/xsl/\\$ver \\\n\t\t\t\t\t\"$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/catalog\"\n\n\t\t\t\txmlcatalog --noout --add \\$x http://docbook.sourceforge.net/release/xsl-ns/\\$ver \\\n\t\t\t\t\t\"$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/catalog\"\n\n\t\t\t\txmlcatalog --noout --add \\$x http://docbook.sourceforge.net/release/xsl/\\$ver \\\n\t\t\t\t\t\"$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-${TERMUX_PKG_VERSION}-nons\" \\\n\t\t\t\t\t\"$TERMUX_PREFIX/etc/xml/catalog\"\n\t\t\tdone\n\t\tdone\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"remove\" ]; then\n\t\txmlcatalog --noout --del \"$TERMUX_PREFIX/share/xml/docbook/xsl-stylesheets-$TERMUX_PKG_VERSION\" \\\n\t\t\t\"$TERMUX_PREFIX/etc/xml/catalog\"\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/dos2unix/Makefile.patch",
    "content": "diff -u -r ../dos2unix-7.4.1/Makefile ./Makefile\n--- ../dos2unix-7.4.1/Makefile\t2019-09-24 18:57:34.000000000 +0000\n+++ ./Makefile\t2019-10-06 09:21:39.309020574 +0000\n@@ -50,7 +50,7 @@\n UNIX2MAC        = unix2mac\n \n # Native Language Support (NLS)\n-ENABLE_NLS      = 1\n+# ENABLE_NLS      = 1\n # Large File Support (LFS)\n LFS             = 1\n # DEBUG=1 adds the -g option to CFLAGS, for adding debug symbols.\n@@ -70,7 +70,7 @@\n LINK            = ln -sf\n LINK_MAN        = $(LINK)\n \n-prefix          = /usr\n+prefix          = @TERMUX_PREFIX@\n exec_prefix     = $(prefix)\n bindir          = $(exec_prefix)/bin\n datarootdir     = $(prefix)/share\n@@ -357,8 +357,6 @@\n         EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64\n endif\n \n-LDFLAGS_USER    =\n-LDFLAGS = $(RPM_LD_FLAGS) $(LDFLAGS_EXTRA) $(LDFLAGS_USER)\n LIBS    = $(LIBS_EXTRA)\n \n DEFS_USER       =\n"
  },
  {
    "path": "packages/dos2unix/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://waterlan.home.xs4all.nl/dos2unix.html\nTERMUX_PKG_DESCRIPTION=\"Converts between DOS and Unix text files\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=7.4.1\nTERMUX_PKG_SRCURL=http://waterlan.home.xs4all.nl/dos2unix/dos2unix-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=1cd58a60b03ed28fa39046102a185c5e88c4f7665e1e0417c25de7f8b9f78623\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"libandroid-support\""
  },
  {
    "path": "packages/double-conversion/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/double-conversion\nTERMUX_PKG_DESCRIPTION=\"Binary-decimal and decimal-binary routines for IEEE doubles\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=3.1.5\nTERMUX_PKG_SRCURL=https://github.com/google/double-conversion/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=a63ecb93182134ba4293fd5f22d6e08ca417caafa244afaa751cbfddf6415b13\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DBUILD_SHARED_LIBS=ON\"\n"
  },
  {
    "path": "packages/doxygen/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.doxygen.org\nTERMUX_PKG_DESCRIPTION=\"A documentation system for C++, C, Java, IDL and PHP\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"lokesh @hax4us\"\nTERMUX_PKG_VERSION=1.8.16\nTERMUX_PKG_SRCURL=https://github.com/doxygen/doxygen/archive/Release_${TERMUX_PKG_VERSION//./_}.tar.gz\nTERMUX_PKG_SHA256=75b18117f88ca1930ab74c05f6712690a26dd4fdcfc9d7d5324be43160645fb4\nTERMUX_PKG_DEPENDS=\"libc++, libiconv\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBISON_EXECUTABLE=$(which bison)\n-DCMAKE_BUILD_TYPE=Release\n-DFLEX_EXECUTABLE=$(which flex)\n-DPYTHON_EXECUTABLE=$(which python3)\n-Dbuild_parse=yes\n-Dbuild_xmlparser=yes\n\"\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/doc/doxygen.1 $TERMUX_PREFIX/share/man/man1\n}\n"
  },
  {
    "path": "packages/doxygen/doxyparse.cpp.patch",
    "content": "diff -uNr doxygen-Release_1_8_16/addon/doxyparse/doxyparse.cpp doxygen-Release_1_8_16.mod/addon/doxyparse/doxyparse.cpp\n--- doxygen-Release_1_8_16/addon/doxyparse/doxyparse.cpp\t2019-08-08 16:36:52.000000000 +0300\n+++ doxygen-Release_1_8_16.mod/addon/doxyparse/doxyparse.cpp\t2019-08-11 20:18:30.675734491 +0300\n@@ -284,7 +284,7 @@\n       Argument * argument = iterator.toFirst();\n       if(argument != NULL) {\n         temp = argumentData(argument);\n-// TODO: This is a workaround; better not include \"void\" in argList, in the first place. \n+// TODO: This is a workaround; better not include \"void\" in argList, in the first place.\n           if(temp != \"void\") {\n               printNumberOfArguments(argList->count());\n           }\n@@ -452,7 +452,7 @@\n #else\n   unsigned int pid = (uint)GetCurrentProcessId();\n #endif\n-  tmpdir << \"/tmp/doxyparse-\" << pid;\n+  tmpdir << \"@TERMUX_PREFIX@/tmp/doxyparse-\" << pid;\n   Config_getString(OUTPUT_DIRECTORY)= tmpdir.str().c_str();\n   // enable HTML (fake) output to omit warning about missing output format\n   Config_getBool(GENERATE_HTML)=TRUE;\n"
  },
  {
    "path": "packages/dpkg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/dpkg\nTERMUX_PKG_DESCRIPTION=\"Debian package management system\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.19.7\nTERMUX_PKG_REVISION=9\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/debian/pool/main/d/dpkg/dpkg_${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=4c27fededf620c0aa522fff1a48577ba08144445341257502e7730f2b1a296e8\n# with the extract.c.patch we remove the -p and --warning=no-timestamp tar options so we can use busybox tar\nTERMUX_PKG_DEPENDS=\"bzip2, coreutils, diffutils, gzip, less, libbz2, liblzma, tar, xz-utils, zlib\"\nTERMUX_PKG_BREAKS=\"dpkg-dev\"\nTERMUX_PKG_REPLACES=\"dpkg-dev\"\nTERMUX_PKG_ESSENTIAL=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_selinux_setexecfilecon=no\n--disable-dselect\n--disable-largefile\n--disable-shared\n--disable-start-stop-daemon\ndpkg_cv_c99_snprintf=yes\nHAVE_SETEXECFILECON_FALSE=#\n--host=${TERMUX_ARCH}-linux\n--without-selinux\n\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/dpkg-architecture\nbin/dpkg-buildflags\nbin/dpkg-buildpackage\nbin/dpkg-checkbuilddeps\nbin/dpkg-distaddfile\nbin/dpkg-genbuildinfo\nbin/dpkg-genchanges\nbin/dpkg-gencontrol\nbin/dpkg-gensymbols\nbin/dpkg-maintscript-helper\nbin/dpkg-mergechangelogs\nbin/dpkg-name\nbin/dpkg-parsechangelog\nbin/dpkg-scanpackages\nbin/dpkg-scansources\nbin/dpkg-shlibdeps\nbin/dpkg-source\nbin/dpkg-statoverride\nbin/dpkg-vendor\ninclude\nlib\nshare/dpkg\nshare/man/man1/dpkg-architecture.1\nshare/man/man1/dpkg-buildflags.1\nshare/man/man1/dpkg-buildpackage.1\nshare/man/man1/dpkg-checkbuilddeps.1\nshare/man/man1/dpkg-distaddfile.1\nshare/man/man1/dpkg-genbuildinfo.1\nshare/man/man1/dpkg-genchanges.1\nshare/man/man1/dpkg-gencontrol.1\nshare/man/man1/dpkg-gensymbols.1\nshare/man/man1/dpkg-maintscript-helper.1\nshare/man/man1/dpkg-mergechangelogs.1\nshare/man/man1/dpkg-name.1\nshare/man/man1/dpkg-parsechangelog.1\nshare/man/man1/dpkg-scanpackages.1\nshare/man/man1/dpkg-scansources.1\nshare/man/man1/dpkg-shlibdeps.1\nshare/man/man1/dpkg-source.1\nshare/man/man1/dpkg-statoverride.1\nshare/man/man1/dpkg-vendor.1\nshare/man/man3\nshare/man/man5\nshare/perl5\nshare/polkit-1\n\"\n\ntermux_step_pre_configure() {\n\texport TAR=tar # To make sure dpkg tries to use \"tar\" instead of e.g. \"gnutar\" (which happens when building on OS X)\n\tperl -p -i -e \"s/TERMUX_ARCH/$TERMUX_ARCH/\" $TERMUX_PKG_SRCDIR/configure\n}\n\ntermux_step_post_massage() {\n\tmkdir -p \"${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/alternatives\"\n\tmkdir -p \"${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/info\"\n\tmkdir -p \"${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/triggers\"\n\tmkdir -p \"${TERMUX_PKG_MASSAGEDIR}/${TERMUX_PREFIX}/var/lib/dpkg/updates\"\n}\n"
  },
  {
    "path": "packages/dpkg/configure.patch",
    "content": "diff -u -r ../dpkg-1.18.15/configure ./configure\n--- ../dpkg-1.18.15/configure\t2016-11-15 21:28:05.000000000 -0500\n+++ ./configure\t2016-11-26 10:44:53.214082696 -0500\n@@ -25749,7 +25749,7 @@\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: checking dpkg cpu type\" >&5\n $as_echo_n \"checking dpkg cpu type... \" >&6; }\n \n-      cpu_type=$(PERL=$PERL $srcdir/run-script scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH_CPU 2>/dev/null)\n+      cpu_type=TERMUX_ARCH\n \n   if test \"x$cpu_type\" = \"x\"; then :\n \n@@ -25800,7 +25800,7 @@\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: checking dpkg architecture name\" >&5\n $as_echo_n \"checking dpkg architecture name... \" >&6; }\n \n-      dpkg_arch=$(PERL=$PERL $srcdir/run-script scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH 2>/dev/null)\n+      dpkg_arch=TERMUX_ARCH\n \n   if test \"x$dpkg_arch\" = \"x\"; then :\n \n"
  },
  {
    "path": "packages/dpkg/dbmodify_dont_require_root.patch",
    "content": "diff -u -r ../dpkg-1.17.6/lib/dpkg/dbmodify.c ./lib/dpkg/dbmodify.c\n--- ../dpkg-1.17.6/lib/dpkg/dbmodify.c\t2013-12-14 06:36:07.000000000 +0100\n+++ ./lib/dpkg/dbmodify.c\t2014-02-25 18:12:15.000000000 +0100\n@@ -253,8 +253,10 @@\n   switch (readwritereq) {\n   case msdbrw_needsuperuser:\n   case msdbrw_needsuperuserlockonly:\n+#ifndef __ANDROID__\n     if (getuid() || geteuid())\n       ohshit(_(\"requested operation requires superuser privilege\"));\n+#endif\n     /* Fall through. */\n   case msdbrw_write: case msdbrw_writeifposs:\n     if (access(dpkg_db_get_dir(), W_OK)) {\n"
  },
  {
    "path": "packages/dpkg/extract.c.patch",
    "content": "Remove tar options not supported by busybox tar.\n\ndiff -u -r ../dpkg-1.17.10/dpkg-deb/extract.c ./dpkg-deb/extract.c\n--- ../dpkg-1.17.10/dpkg-deb/extract.c\t2014-06-04 02:02:54.000000000 +0200\n+++ ./dpkg-deb/extract.c\t2014-07-01 16:40:02.785848137 +0200\n@@ -327,14 +327,20 @@\n       else\n         internerr(\"unknown or missing tar action '%d'\", taroption);\n \n+#ifndef __ANDROID__\n+      /* busybox tar does not support this */\n       if (taroption & DPKG_TAR_PERMS)\n         command_add_arg(&cmd, \"-p\");\n+#endif\n       if (taroption & DPKG_TAR_NOMTIME)\n         command_add_arg(&cmd, \"-m\");\n \n       command_add_arg(&cmd, \"-f\");\n       command_add_arg(&cmd, \"-\");\n+#ifndef __ANDROID__\n+      /* busybox tar does not support this */\n       command_add_arg(&cmd, \"--warning=no-timestamp\");\n+#endif\n \n       m_dup2(p2[0],0);\n       close(p2[0]);\n"
  },
  {
    "path": "packages/dpkg/lib-dpkg-atomic-file.c.patch",
    "content": "diff -u -r ../dpkg-1.18.2/lib/dpkg/atomic-file.c ./lib/dpkg/atomic-file.c\n--- ../dpkg-1.18.2/lib/dpkg/atomic-file.c\t2015-07-12 22:38:47.000000000 -0400\n+++ ./lib/dpkg/atomic-file.c\t2015-08-25 18:06:51.689715379 -0400\n@@ -90,8 +90,14 @@\n \n \tif (unlink(name_old) && errno != ENOENT)\n \t\tohshite(_(\"error removing old backup file '%s'\"), name_old);\n-\tif (link(file->name, name_old) && errno != ENOENT)\n-\t\tohshite(_(\"error creating new backup file '%s'\"), name_old);\n+#ifdef __ANDROID__\n+\t/* Termux: Use rename(2) since Android does not support hardlinks. */\n+\tif (rename(file->name, name_old) && errno != ENOENT) {\n+#else\n+\tif (link(file->name, name_old) && errno != ENOENT) {\n+#endif\n+\t\tohshite(_(\"error creating new backup file '%s'\"), name_old);\n+\t}\n \n \tfree(name_old);\n }\n"
  },
  {
    "path": "packages/dpkg/lib-dpkg-dpkg.h.patch",
    "content": "diff -u -r ../dpkg-1.18.4/lib/dpkg/dpkg.h ./lib/dpkg/dpkg.h\n--- ../dpkg-1.18.4/lib/dpkg/dpkg.h\t2015-12-12 15:49:24.000000000 -0500\n+++ ./lib/dpkg/dpkg.h\t2016-03-03 17:30:57.812372682 -0500\n@@ -92,7 +92,7 @@\n #define MAXUPDATES         250\n \n #define DEFAULTSHELL        \"sh\"\n-#define DEFAULTPAGER        \"pager\"\n+#define DEFAULTPAGER        \"less\"\n \n #define MD5HASHLEN           32\n #define MAXTRIGDIRECTIVE     256\n"
  },
  {
    "path": "packages/dpkg/lib-dpkg-path-remove.c.patch",
    "content": "Handle EROFS.  This is since path_remove_tree() will be called with\n       '/data.dpkg-tmp'\n       '/data/data.dpkg-tmp'\n       '/data/data/com.termux.dpkg-tmp'\n       '/data/data/com.termux/files.dpkg-tmp'\n       '/data/data/com.termux/files/usr.dpkg-tmp'\nand the first call will get a EROFS, read-only file system error.\n\ndiff -u -r ../dpkg-1.18.2/lib/dpkg/path-remove.c ./lib/dpkg/path-remove.c\n--- ../dpkg-1.18.2/lib/dpkg/path-remove.c\t2015-07-30 00:39:24.000000000 -0400\n+++ ./lib/dpkg/path-remove.c\t2015-08-25 18:04:31.391421421 -0400\n@@ -126,7 +126,7 @@\n \tdebug(dbg_eachfile, \"%s '%s'\", __func__, pathname);\n \tif (!rmdir(pathname))\n \t\treturn; /* Deleted it OK, it was a directory. */\n-\tif (errno == ENOENT || errno == ELOOP)\n+\tif (errno == ENOENT || errno == ELOOP || errno == EROFS)\n \t\treturn;\n \tif (errno == ENOTDIR) {\n \t\t/* Either it's a file, or one of the path components is. If\n"
  },
  {
    "path": "packages/dpkg/lib-dpkg-triglib.c.patch",
    "content": "diff -u -r ../dpkg-1.18.2/lib/dpkg/triglib.c ./lib/dpkg/triglib.c\n--- ../dpkg-1.18.2/lib/dpkg/triglib.c\t2015-07-12 22:38:47.000000000 -0400\n+++ ./lib/dpkg/triglib.c\t2015-08-25 17:54:10.350853590 -0400\n@@ -787,10 +787,13 @@\n \t\t\tif (errno != EEXIST)\n \t\t\t\tohshite(_(\"unable to create triggers state\"\n \t\t\t\t          \" directory '%.250s'\"), triggersdir);\n-\t\t} else if (chown(triggersdir, 0, 0)) {\n+\t\t}\n+#ifndef __ANDROID__\n+\t\telse if (chown(triggersdir, 0, 0)) {\n \t\t\tohshite(_(\"unable to set ownership of triggers state\"\n \t\t\t          \" directory '%.250s'\"), triggersdir);\n \t\t}\n+#endif\n \t\tur = trigdef_update_start(tduf);\n \t}\n \tswitch (ur) {\n"
  },
  {
    "path": "packages/dpkg/src-archives.c.patch",
    "content": "diff -u -r ../dpkg-1.19.2/src/archives.c ./src/archives.c\n--- ../dpkg-1.19.2/src/archives.c\t2018-10-08 09:43:48.000000000 +0000\n+++ ./src/archives.c\t2018-11-11 02:17:28.534503365 +0000\n@@ -389,9 +389,11 @@\n             namenode->statoverride->uid,\n             namenode->statoverride->gid,\n             namenode->statoverride->mode);\n+#ifndef __ANDROID__\n     rc = fchown(fd, st->uid, st->gid);\n     if (forcible_nonroot_error(rc))\n       ohshite(_(\"error setting ownership of '%.255s'\"), te->name);\n+#endif\n     rc = fchmod(fd, st->mode & ~S_IFMT);\n     if (forcible_nonroot_error(rc))\n       ohshite(_(\"error setting permissions of '%.255s'\"), te->name);\n@@ -506,13 +508,17 @@\n     return; /* Already handled using the file descriptor. */\n \n   if (te->type == TAR_FILETYPE_SYMLINK) {\n+#ifndef __ANDROID__\n     rc = lchown(path, st->uid, st->gid);\n     if (forcible_nonroot_error(rc))\n       ohshite(_(\"error setting ownership of symlink '%.255s'\"), path);\n+#endif\n   } else {\n+#ifndef __ANDROID__\n     rc = chown(path, st->uid, st->gid);\n     if (forcible_nonroot_error(rc))\n       ohshite(_(\"error setting ownership of '%.255s'\"), path);\n+#endif\n     rc = chmod(path, st->mode & ~S_IFMT);\n     if (forcible_nonroot_error(rc))\n       ohshite(_(\"error setting permissions of '%.255s'\"), path);\n@@ -552,9 +558,11 @@\n     else if (linksize > stab->st_size)\n       ohshit(_(\"symbolic link '%.250s' size has changed from %jd to %zd\"),\n              fn_old, (intmax_t)stab->st_size, linksize);\n+#ifndef __ANDROID__\n     else if (linksize < stab->st_size)\n       warning(_(\"symbolic link '%.250s' size has changed from %jd to %zd\"),\n              fn_old, (intmax_t)stab->st_size, linksize);\n+#endif\n     linkname[linksize] = '\\0';\n     if (strcmp(linkname, te->linkname) == 0) {\n       free(linkname);\n@@ -1041,20 +1049,29 @@\n       else if (r > stab.st_size)\n         ohshit(_(\"symbolic link '%.250s' size has changed from %jd to %zd\"),\n                fnamevb.buf, (intmax_t)stab.st_size, r);\n+#ifndef __ANDROID__\n       else if (r < stab.st_size)\n         warning(_(\"symbolic link '%.250s' size has changed from %jd to %zd\"),\n                fnamevb.buf, (intmax_t)stab.st_size, r);\n+#endif\n       varbuf_trunc(&symlinkfn, r);\n       varbuf_end_str(&symlinkfn);\n       if (symlink(symlinkfn.buf,fnametmpvb.buf))\n         ohshite(_(\"unable to make backup symlink for '%.255s'\"), ti->name);\n+#ifndef __ANDROID__\n       rc = lchown(fnametmpvb.buf, stab.st_uid, stab.st_gid);\n       if (forcible_nonroot_error(rc))\n         ohshite(_(\"unable to chown backup symlink for '%.255s'\"), ti->name);\n+#endif\n       tarobject_set_se_context(fnamevb.buf, fnametmpvb.buf, stab.st_mode);\n     } else {\n       debug(dbg_eachfiledetail, \"tarobject nondirectory, 'link' backup\");\n+#ifdef __ANDROID__\n+      /* Android does not support hardlinks. */\n+      if (rename(fnamevb.buf,fnametmpvb.buf))\n+#else\n       if (link(fnamevb.buf,fnametmpvb.buf))\n+#endif\n         ohshite(_(\"unable to make backup link of '%.255s' before installing new version\"),\n                 ti->name);\n     }\n"
  },
  {
    "path": "packages/dpkg/src-configure.c.patch",
    "content": "diff -u -r ../dpkg-1.18.15/src/configure.c ./src/configure.c\n--- ../dpkg-1.18.15/src/configure.c\t2016-11-11 22:18:40.000000000 -0500\n+++ ./src/configure.c\t2016-12-03 16:32:43.719508056 -0500\n@@ -497,8 +497,10 @@\n \t\t\t        pkg_name(pkg, pnaw_nonambig), cdr2.buf,\n \t\t\t        strerror(errno));\n \t\tif (!(what & CFOF_USER_DEL))\n-\t\t\tif (link(cdr.buf, cdr2.buf))\n-\t\t\t\twarning(_(\"%s: failed to link '%.250s' to '%.250s': %s\"),\n+\t\t\t/** Termux modification: Use rename(2) instead of link(2), to avoid hard\n+\t\t\t    links which does not work on Android 6.0 or later. */\n+\t\t\tif (rename(cdr.buf, cdr2.buf))\n+\t\t\t\twarning(_(\"%s: failed to rename '%.250s' to '%.250s': %s\"),\n \t\t\t\t        pkg_name(pkg, pnaw_nonambig), cdr.buf,\n \t\t\t\t        cdr2.buf, strerror(errno));\n \t\t/* Fall through. */\n"
  },
  {
    "path": "packages/dpkg/src-help.c.patch",
    "content": "diff -u -r ../dpkg-1.19.2/src/help.c ./src/help.c\n--- ../dpkg-1.19.2/src/help.c\t2018-10-07 22:07:52.000000000 +0000\n+++ ./src/help.c\t2018-11-11 02:13:05.133548711 +0000\n@@ -127,8 +127,10 @@\n     \"update_dyld_shared_cache\",\n #elif defined(__GLIBC__) || defined(__UCLIBC__) || \\\n       defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)\n+#ifndef __ANDROID__\n     \"ldconfig\",\n #endif\n+#endif\n #if BUILD_START_STOP_DAEMON\n     \"start-stop-daemon\",\n #endif\n"
  },
  {
    "path": "packages/dpkg/src-statcmd.c.patch",
    "content": "diff -u -r ../dpkg-1.18.2/src/statcmd.c ./src/statcmd.c\n--- ../dpkg-1.18.2/src/statcmd.c\t2015-07-12 22:38:47.000000000 -0400\n+++ ./src/statcmd.c\t2015-08-25 18:07:59.388890175 -0400\n@@ -161,8 +161,10 @@\n static void\n statdb_node_apply(const char *filename, struct file_stat *filestat)\n {\n+#ifndef __ANDROID__\n \tif (chown(filename, filestat->uid, filestat->gid) < 0)\n \t\tohshite(_(\"error setting ownership of '%.255s'\"), filename);\n+#endif\n \tif (chmod(filename, filestat->mode & ~S_IFMT))\n \t\tohshite(_(\"error setting permissions of '%.255s'\"), filename);\n \n"
  },
  {
    "path": "packages/dropbear/Makefile.in.patch",
    "content": "diff -uNr dropbear-2018.76/Makefile.in dropbear-2018.76.mod/Makefile.in\n--- dropbear-2018.76/Makefile.in\t2018-02-27 16:25:10.000000000 +0200\n+++ dropbear-2018.76.mod/Makefile.in\t2018-04-21 14:05:03.923792282 +0300\n@@ -9,7 +9,7 @@\n # dbclient functionality, and includes the progress-bar functionality in scp.\n \n ifndef PROGRAMS\n-\tPROGRAMS=dropbear dbclient dropbearkey dropbearconvert\n+\tPROGRAMS=dropbear dbclient dropbearkey dropbearconvert scp\n endif\n \n STATIC_LTC=libtomcrypt/libtomcrypt.a\n"
  },
  {
    "path": "packages/dropbear/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://matt.ucc.asn.au/dropbear/dropbear.html\nTERMUX_PKG_DESCRIPTION=\"Small SSH server and client\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2019.78\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=525965971272270995364a0eb01f35180d793182e63dd0b0c3eb0292291644a4\nTERMUX_PKG_SRCURL=https://matt.ucc.asn.au/dropbear/releases/dropbear-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"termux-auth, zlib\"\nTERMUX_PKG_CONFLICTS=\"openssh\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-syslog --disable-utmp --disable-utmpx --disable-wtmp --disable-static\"\n# Avoid linking to libcrypt for server password authentication:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_lib_crypt_crypt=no\"\n# build a multi-call binary & enable progress info in 'scp'\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"MULTI=1 SCPPROGRESS=1\"\n\ntermux_step_pre_configure() {\n    export LIBS=\"-ltermux-auth\"\n}\n\ntermux_step_post_make_install() {\n    ln -sf \"dropbearmulti\" \"${TERMUX_PREFIX}/bin/ssh\"\n}\n\ntermux_step_create_debscripts() {\n    {\n\techo \"#!$TERMUX_PREFIX/bin/sh\"\n\techo \"mkdir -p $TERMUX_PREFIX/etc/dropbear\"\n\techo \"for a in rsa dss ecdsa; do\"\n\techo \"\t  KEYFILE=$TERMUX_PREFIX/etc/dropbear/dropbear_\\${a}_host_key\"\n\techo \"\t  test ! -f \\$KEYFILE && dropbearkey -t \\$a -f \\$KEYFILE\"\n\techo \"done\"\n\techo \"exit 0\"\n    } > postinst\n    chmod 0755 postinst\n}\n"
  },
  {
    "path": "packages/dropbear/common-session.c.patch",
    "content": "diff -u -r ../dropbear-2019.77/common-session.c ./common-session.c\n--- ../dropbear-2019.77/common-session.c\t2019-03-23 13:46:29.000000000 +0000\n+++ ./common-session.c\t2019-03-24 22:46:36.558021934 +0000\n@@ -68,16 +68,6 @@\n \t/* Sets it to lowdelay */\n \tupdate_channel_prio();\n \n-#if !DROPBEAR_SVR_MULTIUSER\n-\t/* A sanity check to prevent an accidental configuration option\n-\t   leaving multiuser systems exposed */\n-\terrno = 0;\n-\tgetuid();\n-\tif (errno != ENOSYS) {\n-\t\tdropbear_exit(\"Non-multiuser Dropbear requires a non-multiuser kernel\");\n-\t}\n-#endif\n-\n \tnow = monotonic_now();\n \tses.connect_time = now;\n \tses.last_packet_time_keepalive_recv = now;\n@@ -600,7 +590,7 @@\n const char* get_user_shell() {\n \t/* an empty shell should be interpreted as \"/bin/sh\" */\n \tif (ses.authstate.pw_shell[0] == '\\0') {\n-\t\treturn \"/bin/sh\";\n+\t\treturn \"@TERMUX_PREFIX@/bin/sh\";\n \t} else {\n \t\treturn ses.authstate.pw_shell;\n \t}\n"
  },
  {
    "path": "packages/dropbear/compat.c.patch",
    "content": "diff -uNr dropbear-2018.76/compat.c dropbear-2018.76.mod/compat.c\n--- dropbear-2018.76/compat.c\t2018-02-27 16:25:10.000000000 +0200\n+++ dropbear-2018.76.mod/compat.c\t2018-04-21 13:47:36.443738351 +0300\n@@ -232,7 +232,7 @@\n \n static char **initshells() {\n \t/* don't touch this list. */\n-\tstatic const char *okshells[] = { \"/bin/sh\", \"/bin/csh\", NULL };\n+\tstatic const char *okshells[] = { \"@TERMUX_PREFIX@/bin/sh\", \"@TERMUX_PREFIX@/bin/csh\", NULL };\n \tregister char **sp, *cp;\n \tregister FILE *fp;\n \tstruct stat statb;\n@@ -244,7 +244,7 @@\n \tif (strings != NULL)\n \t\tfree(strings);\n \tstrings = NULL;\n-\tif ((fp = fopen(\"/etc/shells\", \"rc\")) == NULL)\n+\tif ((fp = fopen(\"@TERMUX_PREFIX@/etc/shells\", \"rc\")) == NULL)\n \t\treturn (char **) okshells;\n \tif (fstat(fileno(fp), &statb) == -1) {\n \t\t(void)fclose(fp);\n"
  },
  {
    "path": "packages/dropbear/default_options.h.patch",
    "content": "diff -u -r ../dropbear-2019.77/default_options.h ./default_options.h\n--- ../dropbear-2019.77/default_options.h\t2019-03-23 13:46:29.000000000 +0000\n+++ ./default_options.h\t2019-03-24 22:37:39.284638278 +0000\n@@ -13,15 +13,15 @@\n \n IMPORTANT: Some options will require \"make clean\" after changes */\n \n-#define DROPBEAR_DEFPORT \"22\"\n+#define DROPBEAR_DEFPORT \"8022\"\n \n /* Listen on all interfaces */\n #define DROPBEAR_DEFADDRESS \"\"\n \n /* Default hostkey paths - these can be specified on the command line */\n-#define DSS_PRIV_FILENAME \"/etc/dropbear/dropbear_dss_host_key\"\n-#define RSA_PRIV_FILENAME \"/etc/dropbear/dropbear_rsa_host_key\"\n-#define ECDSA_PRIV_FILENAME \"/etc/dropbear/dropbear_ecdsa_host_key\"\n+#define DSS_PRIV_FILENAME \"@TERMUX_PREFIX@/etc/dropbear/dropbear_dss_host_key\"\n+#define RSA_PRIV_FILENAME \"@TERMUX_PREFIX@/etc/dropbear/dropbear_rsa_host_key\"\n+#define ECDSA_PRIV_FILENAME \"@TERMUX_PREFIX@/etc/dropbear/dropbear_ecdsa_host_key\"\n \n /* Set NON_INETD_MODE if you require daemon functionality (ie Dropbear listens\n  * on chosen ports and keeps accepting connections. This is the default.\n@@ -44,7 +44,7 @@\n  * several kB in binary size however will make the symmetrical ciphers and hashes\n  * slower, perhaps by 50%. Recommended for small systems that aren't doing\n  * much traffic. */\n-#define DROPBEAR_SMALL_CODE 1\n+#undef DROPBEAR_SMALL_CODE\n \n /* Enable X11 Forwarding - server only */\n #define DROPBEAR_X11FWD 1\n@@ -175,7 +175,7 @@\n \n /* Whether to print the message of the day (MOTD). */\n #define DO_MOTD 0\n-#define MOTD_FILENAME \"/etc/motd\"\n+#define MOTD_FILENAME \"@TERMUX_PREFIX@/etc/motd\"\n \n /* Authentication Types - at least one required.\n    RFC Draft requires pubkey auth, and recommends password */\n@@ -199,7 +199,7 @@\n /* Set this to 0 if your system does not have multiple user support.\n    (Linux kernel CONFIG_MULTIUSER option)\n    The resulting binary will not run on a normal system. */\n-#define DROPBEAR_SVR_MULTIUSER 1\n+#define DROPBEAR_SVR_MULTIUSER 0\n \n /* Client authentication options */\n #define DROPBEAR_CLI_PASSWORD_AUTH 1\n@@ -227,7 +227,7 @@\n \n /* Set this to use PRNGD or EGD instead of /dev/urandom */\n #define DROPBEAR_USE_PRNGD 0\n-#define DROPBEAR_PRNGD_SOCKET \"/var/run/dropbear-rng\"\n+#define DROPBEAR_PRNGD_SOCKET \"@TERMUX_PREFIX@/var/run/dropbear-rng\"\n \n /* Specify the number of clients we will allow to be connected but\n  * not yet authenticated. After this limit, connections are rejected */\n@@ -244,22 +244,22 @@\n \n /* The default file to store the daemon's process ID, for shutdown\n    scripts etc. This can be overridden with the -P flag */\n-#define DROPBEAR_PIDFILE \"/var/run/dropbear.pid\"\n+#define DROPBEAR_PIDFILE \"@TERMUX_PREFIX@/var/run/dropbear.pid\"\n \n /* The command to invoke for xauth when using X11 forwarding.\n  * \"-q\" for quiet */\n-#define XAUTH_COMMAND \"/usr/bin/xauth -q\"\n+#define XAUTH_COMMAND \"@TERMUX_PREFIX@/bin/xauth -q\"\n \n \n /* if you want to enable running an sftp server (such as the one included with\n  * OpenSSH), set the path below and set DROPBEAR_SFTPSERVER. \n  * The sftp-server program is not provided by Dropbear itself */\n #define DROPBEAR_SFTPSERVER 1\n-#define SFTPSERVER_PATH \"/usr/libexec/sftp-server\"\n+#define SFTPSERVER_PATH \"@TERMUX_PREFIX@/libexec/sftp-server\"\n \n /* This is used by the scp binary when used as a client binary. If you're\n  * not using the Dropbear client, you'll need to change it */\n-#define DROPBEAR_PATH_SSH_PROGRAM \"/usr/bin/dbclient\"\n+#define DROPBEAR_PATH_SSH_PROGRAM \"@TERMUX_PREFIX@/bin/dbclient\"\n \n /* Whether to log commands executed by a client. This only logs the \n  * (single) command sent to the server, not what a user did in a \n@@ -295,6 +295,6 @@\n #define DEFAULT_IDLE_TIMEOUT 0\n \n /* The default path. This will often get replaced by the shell */\n-#define DEFAULT_PATH \"/usr/bin:/bin\"\n+#define DEFAULT_PATH \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets\"\n \n #endif /* DROPBEAR_DEFAULT_OPTIONS_H_ */\n"
  },
  {
    "path": "packages/dropbear/gensignkey.c.patch",
    "content": "diff -uNr dropbear-2018.76/gensignkey.c dropbear-2018.76.mod/gensignkey.c\n--- dropbear-2018.76/gensignkey.c\t2018-02-27 16:25:10.000000000 +0200\n+++ dropbear-2018.76.mod/gensignkey.c\t2018-04-21 13:45:22.973731479 +0300\n@@ -140,6 +140,16 @@\n \t\tgoto out;\n \t}\n \n+#ifdef __ANDROID__\n+\t/* Hard links are not possible and renam. */\n+\tif (skip_exist && access(filename, F_OK) == 0) {\n+\t\t/* Ok. */\n+\t} else if (rename(fn_temp, filename) < 0) {\n+\t\tdropbear_log(LOG_ERR, \"Failed moving key file to %s: %s\", filename,\n+\t\t\tstrerror(errno));\n+\t\tret = DROPBEAR_FAILURE;\n+\t}\n+#else\n \tif (link(fn_temp, filename) < 0) {\n \t\t/* If generating keys on connection (skipexist) it's OK to get EEXIST \n \t\t- we probably just lost a race with another connection to generate the key */\n@@ -151,6 +161,7 @@\n \t\t\tgoto out;\n \t\t}\n \t}\n+#endif\n \n out:\n \tif (buf) {\n"
  },
  {
    "path": "packages/dropbear/sshpty.c.patch",
    "content": "diff -uNr dropbear-2018.76/sshpty.c dropbear-2018.76.mod/sshpty.c\n--- dropbear-2018.76/sshpty.c\t2018-02-27 16:25:12.000000000 +0200\n+++ dropbear-2018.76.mod/sshpty.c\t2018-04-21 13:45:06.703730641 +0300\n@@ -22,6 +22,10 @@\n #include \"errno.h\"\n #include \"sshpty.h\"\n \n+#ifdef __ANDROID__\n+# define USE_DEV_PTMX 1\n+#endif\n+\n /* Pty allocated with _getpty gets broken if we do I_PUSH:es to it. */\n #if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY)\n #undef HAVE_DEV_PTMX\n@@ -380,6 +384,7 @@\n \t\t\t\ttty_name, strerror(errno));\n \t}\n \n+\t/*\n \tif (st.st_uid != pw->pw_uid || st.st_gid != gid) {\n \t\tif (chown(tty_name, pw->pw_uid, gid) < 0) {\n \t\t\tif (errno == EROFS &&\n@@ -409,4 +414,5 @@\n \t\t\t}\n \t\t}\n \t}\n+\t*/\n }\n"
  },
  {
    "path": "packages/dropbear/svr-agentfwd.c.patch",
    "content": "diff -uNr dropbear-2018.76/svr-agentfwd.c dropbear-2018.76.mod/svr-agentfwd.c\n--- dropbear-2018.76/svr-agentfwd.c\t2018-02-27 16:25:12.000000000 +0200\n+++ dropbear-2018.76.mod/svr-agentfwd.c\t2018-04-21 13:46:57.660403020 +0300\n@@ -41,7 +41,7 @@\n #include \"listener.h\"\n #include \"auth.h\"\n \n-#define AGENTDIRPREFIX \"/tmp/dropbear-\"\n+#define AGENTDIRPREFIX \"@TERMUX_PREFIX@/tmp/dropbear-\"\n \n static int send_msg_channel_open_agent(int fd);\n static int bindagent(int fd, struct ChanSess * chansess);\n"
  },
  {
    "path": "packages/dropbear/svr-auth.c.patch",
    "content": "diff -uNr dropbear-2018.76/svr-auth.c dropbear-2018.76.mod/svr-auth.c\n--- dropbear-2018.76/svr-auth.c\t2018-02-27 16:25:12.000000000 +0200\n+++ dropbear-2018.76.mod/svr-auth.c\t2018-04-21 13:48:35.083741369 +0300\n@@ -93,6 +93,9 @@\n \t}\n \n \tusername = buf_getstring(ses.payload, &userlen);\n+\tm_free(username);\n+\tusername = getlogin();\n+\tuserlen = strlen(username);\n \tservicename = buf_getstring(ses.payload, &servicelen);\n \tmethodname = buf_getstring(ses.payload, &methodlen);\n \n@@ -102,7 +105,6 @@\n \t\t\t\t\tSSH_SERVICE_CONNECTION_LEN) != 0)) {\n \t\t\n \t\t/* TODO - disconnect here */\n-\t\tm_free(username);\n \t\tm_free(servicename);\n \t\tm_free(methodname);\n \t\tdropbear_exit(\"unknown service in auth\");\n@@ -192,7 +194,6 @@\n \n out:\n \n-\tm_free(username);\n \tm_free(servicename);\n \tm_free(methodname);\n }\n@@ -320,9 +321,10 @@\n \tusershell = ses.authstate.pw_shell;\n \tif (usershell[0] == '\\0') {\n \t\t/* empty shell in /etc/passwd means /bin/sh according to passwd(5) */\n-\t\tusershell = \"/bin/sh\";\n+\t\tusershell = \"@TERMUX_PREFIX@/bin/sh\";\n \t}\n \n+   goto goodshell;\n \t/* check the shell is valid. If /etc/shells doesn't exist, getusershell()\n \t * should return some standard shells like \"/bin/sh\" and \"/bin/csh\" (this\n \t * is platform-specific) */\n@@ -343,7 +345,7 @@\n \treturn DROPBEAR_FAILURE;\n \t\n goodshell:\n-\tendusershell();\n+\t//endusershell();\n \tTRACE((\"matching shell\"))\n \n \tTRACE((\"uid = %d\", ses.authstate.pw_uid))\n"
  },
  {
    "path": "packages/dropbear/svr-authpasswd.c.patch",
    "content": "diff -u -r ../dropbear-2019.77/svr-authpasswd.c ./svr-authpasswd.c\n--- ../dropbear-2019.77/svr-authpasswd.c\t2019-03-23 13:46:29.000000000 +0000\n+++ ./svr-authpasswd.c\t2019-03-24 22:40:59.586161245 +0000\n@@ -33,28 +33,13 @@\n \n #if DROPBEAR_SVR_PASSWORD_AUTH\n \n-/* not constant time when strings are differing lengths. \n- string content isn't leaked, and crypt hashes are predictable length. */\n-static int constant_time_strcmp(const char* a, const char* b) {\n-\tsize_t la = strlen(a);\n-\tsize_t lb = strlen(b);\n-\n-\tif (la != lb) {\n-\t\treturn 1;\n-\t}\n-\n-\treturn constant_time_memcmp(a, b, la);\n-}\n+#include <termux-auth.h>\n \n /* Process a password auth request, sending success or failure messages as\n  * appropriate */\n void svr_auth_password(int valid_user) {\n-\t\n-\tchar * passwdcrypt = NULL; /* the crypt from /etc/passwd or /etc/shadow */\n-\tchar * testcrypt = NULL; /* crypt generated from the user's password sent */\n-\tchar * password = NULL;\n-\tunsigned int passwordlen;\n-\tunsigned int changepw;\n+\tchar *password;\n+\tunsigned int changepw, passwordlen;\n \n \t/* check if client wants to change password */\n \tchangepw = buf_getbool(ses.payload);\n@@ -65,47 +50,9 @@\n \t}\n \n \tpassword = buf_getstring(ses.payload, &passwordlen);\n-\tif (valid_user && passwordlen <= DROPBEAR_MAX_PASSWORD_LEN) {\n-\t\t/* the first bytes of passwdcrypt are the salt */\n-\t\tpasswdcrypt = ses.authstate.pw_passwd;\n-\t\ttestcrypt = crypt(password, passwdcrypt);\n-\t}\n-\tm_burn(password, passwordlen);\n-\tm_free(password);\n-\n-\t/* After we have got the payload contents we can exit if the username\n-\tis invalid. Invalid users have already been logged. */\n-\tif (!valid_user) {\n-\t\tsend_msg_userauth_failure(0, 1);\n-\t\treturn;\n-\t}\n-\n-\tif (passwordlen > DROPBEAR_MAX_PASSWORD_LEN) {\n-\t\tdropbear_log(LOG_WARNING,\n-\t\t\t\t\"Too-long password attempt for '%s' from %s\",\n-\t\t\t\tses.authstate.pw_name,\n-\t\t\t\tsvr_ses.addrstring);\n-\t\tsend_msg_userauth_failure(0, 1);\n-\t\treturn;\n-\t}\n-\n-\tif (testcrypt == NULL) {\n-\t\t/* crypt() with an invalid salt like \"!!\" */\n-\t\tdropbear_log(LOG_WARNING, \"User account '%s' is locked\",\n-\t\t\t\tses.authstate.pw_name);\n-\t\tsend_msg_userauth_failure(0, 1);\n-\t\treturn;\n-\t}\n-\n-\t/* check for empty password */\n-\tif (passwdcrypt[0] == '\\0') {\n-\t\tdropbear_log(LOG_WARNING, \"User '%s' has blank password, rejected\",\n-\t\t\t\tses.authstate.pw_name);\n-\t\tsend_msg_userauth_failure(0, 1);\n-\t\treturn;\n-\t}\n \n-\tif (constant_time_strcmp(testcrypt, passwdcrypt) == 0) {\n+\t/* check if password is valid */\n+\tif (termux_auth(ses.authstate.pw_name, password)) {\n \t\t/* successful authentication */\n \t\tdropbear_log(LOG_NOTICE, \n \t\t\t\t\"Password auth succeeded for '%s' from %s\",\n"
  },
  {
    "path": "packages/dropbear/svr-chansession.c.patch",
    "content": "diff -uNr dropbear-2018.76/svr-chansession.c dropbear-2018.76.mod/svr-chansession.c\n--- dropbear-2018.76/svr-chansession.c\t2018-02-27 16:25:12.000000000 +0200\n+++ dropbear-2018.76.mod/svr-chansession.c\t2018-04-21 13:45:06.707063974 +0300\n@@ -919,6 +919,8 @@\n #endif\n \n \t/* clear environment */\n+\t/* termux: do not clear environment on android */\n+#ifndef __ANDROID__\n \t/* if we're debugging using valgrind etc, we need to keep the LD_PRELOAD\n \t * etc. This is hazardous, so should only be used for debugging. */\n #ifndef DEBUG_VALGRIND\n@@ -931,6 +933,7 @@\n \t}\n #endif /* HAVE_CLEARENV */\n #endif /* DEBUG_VALGRIND */\n+#endif /* __ANDROID__ */\n \n \t/* We can only change uid/gid as root ... */\n \tif (getuid() == 0) {\n@@ -956,12 +959,14 @@\n \t\t}\n \t}\n \n+\t/* termux: do not modify environment since we did not clean it */\n+#ifndef __ANDROID__\n \t/* set env vars */\n \taddnewvar(\"USER\", ses.authstate.pw_name);\n \taddnewvar(\"LOGNAME\", ses.authstate.pw_name);\n \taddnewvar(\"HOME\", ses.authstate.pw_dir);\n \taddnewvar(\"SHELL\", get_user_shell());\n-\taddnewvar(\"PATH\", DEFAULT_PATH);\n+#endif /* __ANDROID__ */\n \tif (chansess->term != NULL) {\n \t\taddnewvar(\"TERM\", chansess->term);\n \t}\n"
  },
  {
    "path": "packages/dropbear/sysoptions.h.patch",
    "content": "diff -uNr dropbear-2018.76/sysoptions.h dropbear-2018.76.mod/sysoptions.h\n--- dropbear-2018.76/sysoptions.h\t2018-02-27 16:25:12.000000000 +0200\n+++ dropbear-2018.76.mod/sysoptions.h\t2018-10-21 13:49:10.558094478 +0300\n@@ -71,7 +71,7 @@\n \n #define _PATH_TTY \"/dev/tty\"\n \n-#define _PATH_CP \"/bin/cp\"\n+#define _PATH_CP \"@TERMUX_PREFIX@/bin/cp\"\n \n #define DROPBEAR_ESCAPE_CHAR '~'\n \n@@ -233,10 +233,6 @@\n #error \"DROPBEAR_SVR_PATM_AUTH requires PAM headers. Perhaps ./configure --enable-pam ?\"\n #endif\n \n-#if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT\n-\t#error \"DROPBEAR_SVR_PASSWORD_AUTH requires `crypt()'.\"\n-#endif\n-\n #if !(DROPBEAR_SVR_PASSWORD_AUTH || DROPBEAR_SVR_PAM_AUTH || DROPBEAR_SVR_PUBKEY_AUTH)\n \t#error \"At least one server authentication type must be enabled. DROPBEAR_SVR_PUBKEY_AUTH and DROPBEAR_SVR_PASSWORD_AUTH are recommended.\"\n #endif\n"
  },
  {
    "path": "packages/dtc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://git.kernel.org/pub/scm/utils/dtc/dtc\nTERMUX_PKG_DESCRIPTION=\"Device Tree Compiler\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.5.1\nTERMUX_PKG_SRCURL=https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/dtc-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=45f9885f890c5feab8110a721410970deb8f83987d0125f1a2703bc8ec140e33\nTERMUX_PKG_BREAKS=\"dtc-dev\"\nTERMUX_PKG_REPLACES=\"dtc-dev\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"PREFIX=$TERMUX_PREFIX\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/dte/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE='https://craigbarnes.gitlab.io/dte/'\nTERMUX_PKG_DESCRIPTION='A small, configurable console text editor'\nTERMUX_PKG_LICENSE='GPL-2.0'\nTERMUX_PKG_VERSION=1.9.1\nTERMUX_PKG_SRCURL=\"https://craigbarnes.gitlab.io/dist/dte/dte-${TERMUX_PKG_VERSION}.tar.gz\"\nTERMUX_PKG_SHA256='80d2732269a308b5e1126ecc16c28cda032864f625a95184821a73c054f81a2d'\nTERMUX_PKG_DEPENDS=\"libandroid-support, libandroid-glob, libiconv, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n    make \\\n        -j$TERMUX_MAKE_PROCESSES V=1 \\\n        LDLIBS='-landroid-support -landroid-glob -liconv -lcurses'\n}\n\ntermux_step_make_install() {\n    make install V=1 prefix=\"$TERMUX_PREFIX\"\n}\n"
  },
  {
    "path": "packages/duc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://duc.zevv.nl/\nTERMUX_PKG_DESCRIPTION=\"High-performance disk usage analyzer\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.4.4\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=https://github.com/zevv/duc/releases/download/$TERMUX_PKG_VERSION/duc-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=f4e7483dbeca4e26b003548f9f850b84ce8859bba90da89c55a7a147636ba922\nTERMUX_PKG_DEPENDS=\"leveldb, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-x11\n--with-db-backend=leveldb\n--disable-cairo\"\n"
  },
  {
    "path": "packages/duc/cmd-ls.c.patch",
    "content": "diff -uNr duc-1.4.4/src/duc/cmd-ls.c duc-1.4.4.mod/src/duc/cmd-ls.c\n--- duc-1.4.4/src/duc/cmd-ls.c\t2018-09-08 22:27:41.000000000 +0300\n+++ duc-1.4.4.mod/src/duc/cmd-ls.c\t2019-02-05 21:37:24.412100024 +0200\n@@ -221,6 +221,7 @@\n \tduc_dir *dir = duc_dir_open(duc, path);\n \tif(dir == NULL) {\n \t\tduc_log(duc, DUC_LOG_FTL, \"%s\", duc_strerror(duc));\n+\t\treturn;\n \t}\n \n \tif(opt_directory) {\n"
  },
  {
    "path": "packages/dvtm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/martanne/dvtm\nTERMUX_PKG_DESCRIPTION=\"Terminal tiling window manager\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.15\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/martanne/dvtm/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=496eada13d8abaa8d772279746f78b0c6fed11b560599490f3e70ebc21197bf0\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"ncurses\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $CPPFLAGS\"\n}\n"
  },
  {
    "path": "packages/dvtm/fix-fifo-path.patch",
    "content": "diff -uNr dvtm-0.15/dvtm-status dvtm-0.15.mod/dvtm-status\n--- dvtm-0.15/dvtm-status\t2016-01-09 13:40:12.000000000 +0200\n+++ dvtm-0.15.mod/dvtm-status\t2017-09-09 21:28:15.370807282 +0300\n@@ -1,6 +1,6 @@\n #!/bin/sh\n \n-FIFO=\"/tmp/dvtm-status.$$\"\n+FIFO=\"@TERMUX_PREFIX@/tmp/dvtm-status.$$\"\n \n [ -p \"$FIFO\" ] || mkfifo -m 600 \"$FIFO\" || exit 1\n \n"
  },
  {
    "path": "packages/dvtm/vt.c.patch",
    "content": "diff -u -r ../dvtm-0.15/vt.c ./vt.c\n--- ../dvtm-0.15/vt.c\t2016-01-09 06:40:56.000000000 -0500\n+++ ./vt.c\t2016-01-21 08:09:47.457953606 -0500\n@@ -21,7 +21,9 @@\n #include <ctype.h>\n #include <errno.h>\n #include <fcntl.h>\n+#ifndef __ANDROID__\n #include <langinfo.h>\n+#endif\n #include <limits.h>\n #include <signal.h>\n #include <stdio.h>\n@@ -1309,10 +1311,14 @@\n \n static void is_utf8_locale(void)\n {\n+#ifdef __ANDROID__\n+\tis_utf8 = true;\n+#else\n \tconst char *cset = nl_langinfo(CODESET);\n \tif (!cset)\n \t\tcset = \"ANSI_X3.4-1968\";\n \tis_utf8 = !strcmp(cset, \"UTF-8\");\n+#endif\n }\n \n static wchar_t get_vt100_graphic(char c)\n"
  },
  {
    "path": "packages/dx/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://developer.android.com/tools/help/index.html\nTERMUX_PKG_DESCRIPTION=\"Command which takes in class files and reformulates them for usage on Android\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\t# Rewrite packages to avoid using com.android.* classes which may clash with\n\t# classes in the Android runtime on devices (see #1801):\n\tlocal JARJAR=$TERMUX_PKG_CACHEDIR/jarjar.jar\n\tlocal RULEFILE=$TERMUX_PKG_TMPDIR/jarjar-rule.txt\n\tlocal REWRITTEN_DX=$TERMUX_PKG_TMPDIR/dx-rewritten.jar\n\ttermux_download \\\n\t\thttp://central.maven.org/maven2/com/googlecode/jarjar/jarjar/1.3/jarjar-1.3.jar \\\n\t\t$JARJAR \\\n\t\t4225c8ee1bf3079c4b07c76fe03c3e28809a22204db6249c9417efa4f804b3a7\n\techo 'rule com.android.** dx.@1' > $RULEFILE\n\tjava -jar $JARJAR process $RULEFILE \\\n\t\t$ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/dx.jar \\\n\t\t$REWRITTEN_DX\n\n\t# Dex the rewritten jar file:\n\tmkdir -p $TERMUX_PREFIX/share/dex\n\t$TERMUX_D8 \\\n\t\t--release \\\n\t\t--min-api $TERMUX_PKG_API_LEVEL \\\n\t\t--output $TERMUX_PKG_TMPDIR \\\n\t\t$REWRITTEN_DX\n\n\tcd $TERMUX_PKG_TMPDIR\n\tjar cf dx.jar classes.dex\n\tmv dx.jar $TERMUX_PREFIX/share/dex/dx.jar\n\n\tinstall $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx\n\tperl -p -i -e \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PREFIX/bin/dx\n}\n"
  },
  {
    "path": "packages/dx/dx",
    "content": "#!/bin/sh\n\nexec dalvikvm \\\n\t-Xmx256m \\\n\t-cp @TERMUX_PREFIX@/share/dex/dx.jar \\\n\tdx.dx.command.Main $@\n"
  },
  {
    "path": "packages/e2fsprogs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://e2fsprogs.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"EXT 2/3/4 filesystem utilities\"\nTERMUX_PKG_LICENSE=\"GPL-2.0, LGPL-2.0, MIT\"\nTERMUX_PKG_LICENSE_FILE=\"NOTICE\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.45.4\nTERMUX_PKG_SRCURL=https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v$TERMUX_PKG_VERSION/e2fsprogs-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=65faf6b590ca1da97440d6446bd11de9e0914b42553740ba5d9d2a796fa0dc02\nTERMUX_PKG_CONFFILES=\"etc/mke2fs.conf\"\nTERMUX_PKG_NO_STATICSPLIT=true\n\n## util-linux provides libblkid\nTERMUX_PKG_DEPENDS=\"libuuid, util-linux\"\nTERMUX_PKG_BREAKS=\"e2fsprogs-dev\"\nTERMUX_PKG_REPLACES=\"e2fsprogs-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--sbindir=${TERMUX_PREFIX}/bin\n--enable-symlink-install\n--enable-relative-symlinks\n--disable-defrag\n--disable-e2initrd-helper\n--disable-libuuid\n--disable-libblkid\n--disable-uuidd\"\n\n# Remove com_err.h to avoid conflicting with krb5-dev:\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/compile_et\nbin/mk_cmds\ninclude/com_err.h\nshare/et\nshare/ss\nshare/man/man1/compile_et.1\nshare/man/man1/mk_cmds.1\"\n\ntermux_step_make_install() {\n\tmake install install-libs\n\tinstall -Dm600 \\\n\t\t\"$TERMUX_PKG_SRCDIR\"/misc/mke2fs.conf.in \\\n\t\t\"$TERMUX_PREFIX\"/etc/mke2fs.conf\n}\n"
  },
  {
    "path": "packages/e2fsprogs/clang-compat.patch",
    "content": "diff -uNr e2fsprogs-1.45.1/debugfs/set_fields.c e2fsprogs-1.45.1.mod/debugfs/set_fields.c\n--- e2fsprogs-1.45.1/debugfs/set_fields.c\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/debugfs/set_fields.c\t2019-05-21 14:52:33.637119261 +0300\n@@ -296,9 +296,11 @@\n \t{ \"checksum\", &set_mmp.mmp_checksum, NULL, 4, parse_uint },\n \t{ 0, 0, 0, 0 }\n };\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n \n #ifdef UNITTEST\n \ndiff -uNr e2fsprogs-1.45.1/e2fsck/problem.c e2fsprogs-1.45.1.mod/e2fsck/problem.c\n--- e2fsprogs-1.45.1/e2fsck/problem.c\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/e2fsck/problem.c\t2019-05-21 14:52:33.640119278 +0300\n@@ -102,10 +102,12 @@\n \t\"\",\t\t\t/* 21 */\n };\n \n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wmissing-field-initializers\"\n #endif\n+#endif\n \n static struct e2fsck_problem problem_table[] = {\n \n@@ -2107,9 +2109,11 @@\n \t{ PR_LATCH_OPTIMIZE_EXT, PR_1E_OPTIMIZE_EXT_HEADER, PR_1E_OPTIMIZE_EXT_END, 0 },\n \t{ -1, 0, 0, 0 },\n };\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n \n static struct e2fsck_problem *find_problem(problem_t code)\n {\ndiff -uNr e2fsprogs-1.45.1/lib/ext2fs/ext4_acl.h e2fsprogs-1.45.1.mod/lib/ext2fs/ext4_acl.h\n--- e2fsprogs-1.45.1/lib/ext2fs/ext4_acl.h\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/lib/ext2fs/ext4_acl.h\t2019-05-21 14:52:33.641119283 +0300\n@@ -50,13 +50,17 @@\n \n typedef struct {\n         __le32                  a_version;\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wpedantic\"\n #endif\n+#endif\n         posix_acl_xattr_entry   a_entries[0];\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n } posix_acl_xattr_header;\n \ndiff -uNr e2fsprogs-1.45.1/lib/ext2fs/fiemap.h e2fsprogs-1.45.1.mod/lib/ext2fs/fiemap.h\n--- e2fsprogs-1.45.1/lib/ext2fs/fiemap.h\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/lib/ext2fs/fiemap.h\t2019-05-21 14:52:33.641119283 +0300\n@@ -31,14 +31,18 @@\n \t__u32 fm_mapped_extents;/* number of extents that were mapped (out) */\n \t__u32 fm_extent_count;  /* size of fm_extents array (in) */\n \t__u32 fm_reserved;\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wpedantic\"\n #endif\n+#endif\n \tstruct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n };\n \n #if defined(__linux__) && !defined(FS_IOC_FIEMAP)\ndiff -uNr e2fsprogs-1.45.1/lib/ext2fs/hashmap.c e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.c\n--- e2fsprogs-1.45.1/lib/ext2fs/hashmap.c\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.c\t2019-05-21 14:55:42.819113922 +0300\n@@ -7,14 +7,18 @@\n \tvoid(*free)(void*);\n \tstruct ext2fs_hashmap_entry *first;\n \tstruct ext2fs_hashmap_entry *last;\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wpedantic\"\n #endif\n+#endif\n \tstruct ext2fs_hashmap_entry *entries[0];\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n };\n \n uint32_t ext2fs_djb2_hash(const void *str, size_t size)\ndiff -uNr e2fsprogs-1.45.1/lib/ext2fs/hashmap.h e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.h\n--- e2fsprogs-1.45.1/lib/ext2fs/hashmap.h\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/lib/ext2fs/hashmap.h\t2019-05-21 14:53:28.371429925 +0300\n@@ -4,6 +4,7 @@\n # include <stdlib.h>\n # include <stdint.h>\n \n+#ifndef __ANDROID__\n #ifndef __GNUC_PREREQ\n #if defined(__GNUC__) && defined(__GNUC_MINOR__)\n #define __GNUC_PREREQ(maj, min) \\\n@@ -12,6 +13,7 @@\n #define __GNUC_PREREQ(maj, min) 0\n #endif\n #endif\n+#endif\n \n struct ext2fs_hashmap;\n \ndiff -uNr e2fsprogs-1.45.1/lib/ext2fs/mmp.c e2fsprogs-1.45.1.mod/lib/ext2fs/mmp.c\n--- e2fsprogs-1.45.1/lib/ext2fs/mmp.c\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/lib/ext2fs/mmp.c\t2019-05-21 14:52:33.641119283 +0300\n@@ -34,12 +34,14 @@\n #define O_DIRECT 0\n #endif\n \n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic push\n #ifndef CONFIG_MMP\n #pragma GCC diagnostic ignored \"-Wunused-parameter\"\n #endif\n #endif\n+#endif\n \n errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf)\n {\n@@ -467,6 +469,8 @@\n \treturn EXT2_ET_OP_NOT_SUPPORTED;\n #endif\n }\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic pop\n #endif\n+#endif\ndiff -uNr e2fsprogs-1.45.1/lib/ext2fs/unix_io.c e2fsprogs-1.45.1.mod/lib/ext2fs/unix_io.c\n--- e2fsprogs-1.45.1/lib/ext2fs/unix_io.c\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/lib/ext2fs/unix_io.c\t2019-05-21 14:52:33.642119289 +0300\n@@ -1152,10 +1152,12 @@\n }\n \n /* parameters might not be used if OS doesn't support zeroout */\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wunused-parameter\"\n #endif\n+#endif\n static errcode_t unix_zeroout(io_channel channel, unsigned long long block,\n \t\t\t      unsigned long long count)\n {\n@@ -1204,9 +1206,11 @@\n unimplemented:\n \treturn EXT2_ET_UNIMPLEMENTED;\n }\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n \n static struct struct_io_manager struct_unix_manager = {\n \t.magic\t\t= EXT2_ET_MAGIC_IO_MANAGER,\ndiff -uNr e2fsprogs-1.45.1/misc/filefrag.c e2fsprogs-1.45.1.mod/misc/filefrag.c\n--- e2fsprogs-1.45.1/misc/filefrag.c\t2019-05-13 04:23:53.000000000 +0300\n+++ e2fsprogs-1.45.1.mod/misc/filefrag.c\t2019-05-21 14:52:33.642119289 +0300\n@@ -537,10 +537,12 @@\n \t\t\t\tchar *end;\n \t\t\t\tblocksize = strtoul(optarg, &end, 0);\n \t\t\t\tif (end) {\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (7, 0)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wimplicit-fallthrough\"\n #endif\n+#endif\n \t\t\t\t\tswitch (end[0]) {\n \t\t\t\t\tcase 'g':\n \t\t\t\t\tcase 'G':\n@@ -557,9 +559,11 @@\n \t\t\t\t\tdefault:\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (7, 0)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n \t\t\t\t}\n \t\t\t} else { /* Allow -b without argument for compat. Remove\n \t\t\t\t  * this eventually so \"-b {blocksize}\" works */\n"
  },
  {
    "path": "packages/e2fsprogs/doc-Makefile.in.patch",
    "content": "diff -uNr e2fsprogs-1.44.4/doc/Makefile.in e2fsprogs-1.44.4.mod/doc/Makefile.in\n--- e2fsprogs-1.44.4/doc/Makefile.in\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/doc/Makefile.in\t2018-09-22 15:22:14.779251149 +0300\n@@ -17,7 +17,7 @@\n HTML=makeinfo --html --no-split\n PS2PDF=ps2pdf\n \n-all:: libext2fs.info libext2fs.dvi libext2fs.html\n+all:: libext2fs.info\n \n install-doc-libs: libext2fs.info libext2fs.dvi\n \t$(Q) $(RM) -rf $(DESTDIR)$(infodir)/libext2fs.info*\n"
  },
  {
    "path": "packages/e2fsprogs/fix-hardcoded-paths.patch",
    "content": "diff -uNr e2fsprogs-1.44.4/debugfs/debugfs.c e2fsprogs-1.44.4.mod/debugfs/debugfs.c\n--- e2fsprogs-1.44.4/debugfs/debugfs.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/debugfs/debugfs.c\t2018-09-22 15:22:14.775917803 +0300\n@@ -87,7 +87,7 @@\n \t */\n \ttdb_dir = ss_safe_getenv(\"E2FSPROGS_UNDO_DIR\");\n \tif (!tdb_dir)\n-\t\ttdb_dir = \"/var/lib/e2fsprogs\";\n+\t\ttdb_dir = \"@TERMUX_PREFIX@/var/lib/e2fsprogs\";\n \n \tif (!strcmp(tdb_dir, \"none\") || (tdb_dir[0] == 0) ||\n \t    access(tdb_dir, W_OK))\ndiff -uNr e2fsprogs-1.44.4/debugfs/util.c e2fsprogs-1.44.4.mod/debugfs/util.c\n--- e2fsprogs-1.44.4/debugfs/util.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/debugfs/util.c\t2018-09-22 15:22:14.779251149 +0300\n@@ -61,7 +61,7 @@\n }\n \n static const char *pager_search_list[] = { \"pager\", \"more\", \"less\", 0 };\n-static const char *pager_dir_list[] = { \"/usr/bin\", \"/bin\", 0 };\n+static const char *pager_dir_list[] = { \"@TERMUX_PREFIX@/bin\", \"@TERMUX_PREFIX@/bin/applets\", 0 };\n \n static const char *find_pager(char *buf)\n {\ndiff -uNr e2fsprogs-1.44.4/e2fsck/e2fsck.h e2fsprogs-1.44.4.mod/e2fsck/e2fsck.h\n--- e2fsprogs-1.44.4/e2fsck/e2fsck.h\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/e2fsck/e2fsck.h\t2018-09-22 15:22:14.779251149 +0300\n@@ -53,7 +53,7 @@\n #define NLS_CAT_NAME \"e2fsprogs\"\n #endif\n #ifndef LOCALEDIR\n-#define LOCALEDIR \"/usr/share/locale\"\n+#define LOCALEDIR \"@TERMUX_PREFIX@/share/locale\"\n #endif\n #else\n #define _(a) (a)\ndiff -uNr e2fsprogs-1.44.4/e2fsck/unix.c e2fsprogs-1.44.4.mod/e2fsck/unix.c\n--- e2fsprogs-1.44.4/e2fsck/unix.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/e2fsck/unix.c\t2018-09-22 15:22:14.782584494 +0300\n@@ -601,7 +601,7 @@\n \treturn 0;\n }\n \n-#define PATH_SET \"PATH=/sbin\"\n+#define PATH_SET \"PATH=@TERMUX_PREFIX@/bin\"\n \n /*\n  * Make sure 0,1,2 file descriptors are open, so that we don't open\n@@ -1306,7 +1306,7 @@\n \ttdb_dir = getenv(\"E2FSPROGS_UNDO_DIR\");\n \tif (!tdb_dir) {\n \t\tprofile_get_string(ctx->profile, \"defaults\",\n-\t\t\t\t   \"undo_dir\", 0, \"/var/lib/e2fsprogs\",\n+\t\t\t\t   \"undo_dir\", 0, \"@TERMUX_PREFIX@/var/lib/e2fsprogs\",\n \t\t\t\t   &tdb_dir);\n \t\tfree_tdb_dir = 1;\n \t}\ndiff -uNr e2fsprogs-1.44.4/ext2ed/init.c e2fsprogs-1.44.4.mod/ext2ed/init.c\n--- e2fsprogs-1.44.4/ext2ed/init.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/ext2ed/init.c\t2018-09-22 15:22:14.789251186 +0300\n@@ -613,8 +613,8 @@\n \n \tmounted=0;\n \n-\tif ( (fp=fopen (\"/etc/mtab\",\"rt\"))==NULL) {\n-\t\twprintw (command_win,\"Error - Failed to open /etc/mtab. Assuming filesystem is mounted.\\n\");\n+\tif ( (fp=fopen (\"@TERMUX_PREFIX@/etc/mtab\",\"rt\"))==NULL) {\n+\t\twprintw (command_win,\"Error - Failed to open @TERMUX_PREFIX@/etc/mtab. Assuming filesystem is mounted.\\n\");\n \t\trefresh_command_win ();mounted=1;return;\n \t};\n \ndiff -uNr e2fsprogs-1.44.4/lib/blkid/blkidP.h e2fsprogs-1.44.4.mod/lib/blkid/blkidP.h\n--- e2fsprogs-1.44.4/lib/blkid/blkidP.h\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/lib/blkid/blkidP.h\t2018-09-22 15:22:14.795917878 +0300\n@@ -110,7 +110,7 @@\n extern char *blkid_strdup(const char *s);\n extern char *blkid_strndup(const char *s, const int length);\n \n-#define BLKID_CACHE_FILE \"/etc/blkid.tab\"\n+#define BLKID_CACHE_FILE \"@TERMUX_PREFIX@/etc/blkid.tab\"\n \n #define BLKID_ERR_IO\t 5\n #define BLKID_ERR_PROC\t 9\ndiff -uNr e2fsprogs-1.44.4/lib/support/nls-enable.h e2fsprogs-1.44.4.mod/lib/support/nls-enable.h\n--- e2fsprogs-1.44.4/lib/support/nls-enable.h\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/lib/support/nls-enable.h\t2018-09-22 15:22:14.799251223 +0300\n@@ -12,7 +12,7 @@\n #define NLS_CAT_NAME \"e2fsprogs\"\n #endif\n #ifndef LOCALEDIR\n-#define LOCALEDIR \"/usr/share/locale\"\n+#define LOCALEDIR \"@TERMUX_PREFIX@/share/locale\"\n #endif\n #else\n #define _(a) (a)\ndiff -uNr e2fsprogs-1.44.4/lib/uuid/gen_uuid.c e2fsprogs-1.44.4.mod/lib/uuid/gen_uuid.c\n--- e2fsprogs-1.44.4/lib/uuid/gen_uuid.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/lib/uuid/gen_uuid.c\t2018-09-22 15:27:30.643742706 +0300\n@@ -325,7 +325,7 @@\n \n \tif (state_fd == -2) {\n \t\tsave_umask = umask(0);\n-\t\tstate_fd = open(\"/var/lib/libuuid/clock.txt\",\n+\t\tstate_fd = open(\"@TERMUX_PREFIX@/var/lib/libuuid/clock.txt\",\n \t\t\t\tO_RDWR|O_CREAT, 0660);\n \t\t(void) umask(save_umask);\n \t\tif (state_fd >= 0) {\n@@ -484,12 +484,14 @@\n }\n #endif /* defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */\n \n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic push\n #if !defined(USE_UUIDD) || !defined(HAVE_SYS_UN_H)\n #pragma GCC diagnostic ignored \"-Wunused-parameter\"\n #endif\n #endif\n+#endif\n /*\n  * Try using the uuidd daemon to generate the UUID\n  *\n@@ -572,9 +574,11 @@\n #endif\n \treturn -1;\n }\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 6)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n \n void uuid__generate_time(uuid_t out, int *num)\n {\ndiff -uNr e2fsprogs-1.44.4/lib/uuid/uuidd.h e2fsprogs-1.44.4.mod/lib/uuid/uuidd.h\n--- e2fsprogs-1.44.4/lib/uuid/uuidd.h\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/lib/uuid/uuidd.h\t2018-09-22 15:22:14.802584569 +0300\n@@ -35,10 +35,10 @@\n #ifndef _UUID_UUIDD_H\n #define _UUID_UUIDD_H\n \n-#define UUIDD_DIR\t\t\"/var/lib/libuuid\"\n+#define UUIDD_DIR\t\t\"@TERMUX_PREFIX@/var/lib/libuuid\"\n #define UUIDD_SOCKET_PATH\tUUIDD_DIR \"/request\"\n #define UUIDD_PIDFILE_PATH\tUUIDD_DIR \"/uuidd.pid\"\n-#define UUIDD_PATH\t\t\"/usr/sbin/uuidd\"\n+#define UUIDD_PATH\t\t\"@TERMUX_PREFIX@/bin/uuidd\"\n \n #define UUIDD_OP_GETPID\t\t\t0\n #define UUIDD_OP_GET_MAXOP\t\t1\ndiff -uNr e2fsprogs-1.44.4/misc/badblocks.c e2fsprogs-1.44.4.mod/misc/badblocks.c\n--- e2fsprogs-1.44.4/misc/badblocks.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/badblocks.c\t2018-09-22 15:22:14.802584569 +0300\n@@ -1007,7 +1007,7 @@\n \t\tfprintf(stderr, _(\"%s is mounted; \"), device_name);\n \t\tif (force) {\n \t\t\tfputs(_(\"badblocks forced anyway.  \"\n-\t\t\t\t\"Hope /etc/mtab is incorrect.\\n\"), stderr);\n+\t\t\t\t\"Hope @TERMUX_PREFIX@/etc/mtab is incorrect.\\n\"), stderr);\n \t\t\treturn;\n \t\t}\n \tabort_badblocks:\ndiff -uNr e2fsprogs-1.44.4/misc/blkid.c e2fsprogs-1.44.4.mod/misc/blkid.c\n--- e2fsprogs-1.44.4/misc/blkid.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/blkid.c\t2018-09-22 15:22:14.805917914 +0300\n@@ -53,7 +53,7 @@\n \tfprintf(out,\n \t\t\"usage:\\t%s [-c <file>] [-ghlLv] [-o format] \"\n \t\t\"[-s <tag>] [-t <token>]\\n    [-w <file>] [dev ...]\\n\"\n-\t\t\"\\t-c\\tcache file (default: /etc/blkid.tab, /dev/null = none)\\n\"\n+\t\t\"\\t-c\\tcache file (default: @TERMUX_PREFIX@/etc/blkid.tab, /dev/null = none)\\n\"\n \t\t\"\\t-h\\tprint this usage message and exit\\n\"\n \t\t\"\\t-g\\tgarbage collect the blkid cache\\n\"\n \t\t\"\\t-s\\tshow specified tag(s) (default show all tags)\\n\"\ndiff -uNr e2fsprogs-1.44.4/misc/e2undo.c e2fsprogs-1.44.4.mod/misc/e2undo.c\n--- e2fsprogs-1.44.4/misc/e2undo.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/e2undo.c\t2018-09-22 15:28:19.140584897 +0300\n@@ -81,14 +81,18 @@\n \t__le32 magic;\t\t/* KEYBLOCK_MAGIC number */\n \t__le32 crc;\t\t/* block checksum */\n \t__le64 reserved;\t/* zero */\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wpedantic\"\n #endif\n+#endif\n \tstruct undo_key keys[0];\t/* keys, which come immediately after */\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n };\n \n struct undo_key_info {\n@@ -246,7 +250,7 @@\n \t */\n \ttdb_dir = getenv(\"E2FSPROGS_UNDO_DIR\");\n \tif (!tdb_dir)\n-\t\ttdb_dir = \"/var/lib/e2fsprogs\";\n+\t\ttdb_dir = \"@TERMUX_PREFIX@/var/lib/e2fsprogs\";\n \n \tif (!strcmp(tdb_dir, \"none\") || (tdb_dir[0] == 0) ||\n \t    access(tdb_dir, W_OK))\ndiff -uNr e2fsprogs-1.44.4/misc/e4crypt.c e2fsprogs-1.44.4.mod/misc/e4crypt.c\n--- e2fsprogs-1.44.4/misc/e4crypt.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/e4crypt.c\t2018-09-22 15:22:14.812584606 +0300\n@@ -613,7 +613,7 @@\n \n static void get_default_salts(void)\n {\n-\tFILE\t*f = setmntent(\"/etc/mtab\", \"r\");\n+\tFILE\t*f = setmntent(\"@TERMUX_PREFIX@/etc/mtab\", \"r\");\n \tstruct mntent *mnt;\n \n \twhile (f && ((mnt = getmntent(f)) != NULL)) {\ndiff -uNr e2fsprogs-1.44.4/misc/e4defrag.c e2fsprogs-1.44.4.mod/misc/e4defrag.c\n--- e2fsprogs-1.44.4/misc/e4defrag.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/e4defrag.c\t2018-09-22 15:22:14.812584606 +0300\n@@ -223,7 +223,7 @@\n \n \tfp = setmntent(mtab, \"r\");\n \tif (fp == NULL) {\n-\t\tperror(\"Couldn't access /etc/mtab\");\n+\t\tperror(\"Couldn't access @TERMUX_PREFIX@/etc/mtab\");\n \t\treturn -1;\n \t}\n \n@@ -290,7 +290,7 @@\n \n \tfp = setmntent(mtab, \"r\");\n \tif (fp == NULL) {\n-\t\tperror(\"Couldn't access /etc/mtab\");\n+\t\tperror(\"Couldn't access @TERMUX_PREFIX@/etc/mtab\");\n \t\treturn -1;\n \t}\n \ndiff -uNr e2fsprogs-1.44.4/misc/fsck.c e2fsprogs-1.44.4.mod/misc/fsck.c\n--- e2fsprogs-1.44.4/misc/fsck.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/fsck.c\t2018-09-22 15:22:14.815917952 +0300\n@@ -64,7 +64,7 @@\n #include \"blkid/blkid.h\"\n \n #ifndef _PATH_MNTTAB\n-#define\t_PATH_MNTTAB\t\"/etc/fstab\"\n+#define\t_PATH_MNTTAB\t\"@TERMUX_PREFIX@/etc/fstab\"\n #endif\n \n static const char *ignored_types[] = {\n@@ -120,7 +120,7 @@\n static char *fstype = NULL;\n static struct fs_info *filesys_info = NULL, *filesys_last = NULL;\n static struct fsck_instance *instance_list;\n-static const char *fsck_prefix_path = \"/sbin:/sbin/fs.d:/sbin/fs:/etc/fs:/etc\";\n+static const char *fsck_prefix_path = \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets\";\n static char *fsck_path = 0;\n static blkid_cache cache = NULL;\n \n@@ -367,9 +367,9 @@\n \tif (old_fstab && filesys_info) {\n \t\tfputs(\"\\007\\007\\007\", stderr);\n \t\tfputs(_(\n-\t\t\"WARNING: Your /etc/fstab does not contain the fsck passno\\n\"\n+\t\t\"WARNING: Your @TERMUX_PREFIX@/etc/fstab does not contain the fsck passno\\n\"\n \t\t\"\tfield.  I will kludge around things for you, but you\\n\"\n-\t\t\"\tshould fix your /etc/fstab file as soon as you can.\\n\\n\"), stderr);\n+\t\t\"\tshould fix your @TERMUX_PREFIX@/etc/fstab file as soon as you can.\\n\\n\"), stderr);\n \n \t\tfor (fs = filesys_info; fs; fs = fs->next) {\n \t\t\tfs->passno = 1;\n@@ -888,7 +888,7 @@\n \t */\n \tif (opt_in_list(\"bind\", fs->opts)) {\n \t\tfprintf(stderr,\n-\t\t\t_(\"%s: skipping bad line in /etc/fstab: bind mount with nonzero fsck pass number\\n\"),\n+\t\t\t_(\"%s: skipping bad line in @TERMUX_PREFIX@/etc/fstab: bind mount with nonzero fsck pass number\\n\"),\n \t\t\tfs->mountpt);\n \t\treturn 1;\n \t}\ndiff -uNr e2fsprogs-1.44.4/misc/fuse2fs.c e2fsprogs-1.44.4.mod/misc/fuse2fs.c\n--- e2fsprogs-1.44.4/misc/fuse2fs.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/fuse2fs.c\t2018-09-22 15:28:50.517364876 +0300\n@@ -52,7 +52,7 @@\n #define NLS_CAT_NAME \"e2fsprogs\"\n #endif\n #ifndef LOCALEDIR\n-#define LOCALEDIR \"/usr/share/locale\"\n+#define LOCALEDIR \"@TERMUX_PREFIX@/share/locale\"\n #endif\n #else\n #define _(a) (a)\n@@ -118,14 +118,18 @@\n \n typedef struct {\n \tu_int32_t\ta_version;\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wpedantic\"\n #endif\n+#endif\n \tacl_ea_entry\ta_entries[0];\n+#ifndef __ANDROID__\n #if __GNUC_PREREQ (4, 8)\n #pragma GCC diagnostic pop\n #endif\n+#endif\n } acl_ea_header;\n \n static inline size_t acl_ea_size(int count)\ndiff -uNr e2fsprogs-1.44.4/misc/ismounted.c e2fsprogs-1.44.4.mod/misc/ismounted.c\n--- e2fsprogs-1.44.4/misc/ismounted.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/ismounted.c\t2018-09-22 15:22:14.822584643 +0300\n@@ -197,7 +197,7 @@\n \tif (mount_flags)\n \t\treturn 1;\n #endif /* __linux__ */\n-\tretval = check_mntent_file(\"/etc/mtab\", file, &mount_flags);\n+\tretval = check_mntent_file(\"@TERMUX_PREFIX@/etc/mtab\", file, &mount_flags);\n \tif (retval)\n \t\treturn 0;\n \treturn (mount_flags);\ndiff -uNr e2fsprogs-1.44.4/misc/mke2fs.c e2fsprogs-1.44.4.mod/misc/mke2fs.c\n--- e2fsprogs-1.44.4/misc/mke2fs.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/mke2fs.c\t2018-09-22 15:22:14.825917989 +0300\n@@ -781,7 +781,7 @@\n \treturn 1;\n }\n \n-#define PATH_SET \"PATH=/sbin\"\n+#define PATH_SET \"PATH=@TERMUX_PREFIX@/bin\"\n \n static void parse_extended_opts(struct ext2_super_block *param,\n \t\t\t\tconst char *opts)\n@@ -2623,7 +2623,7 @@\n \ttdb_dir = getenv(\"E2FSPROGS_UNDO_DIR\");\n \tif (!tdb_dir) {\n \t\tprofile_get_string(profile, \"defaults\",\n-\t\t\t\t   \"undo_dir\", 0, \"/var/lib/e2fsprogs\",\n+\t\t\t\t   \"undo_dir\", 0, \"@TERMUX_PREFIX@/var/lib/e2fsprogs\",\n \t\t\t\t   &tdb_dir);\n \t\tfree_tdb_dir = 1;\n \t}\ndiff -uNr e2fsprogs-1.44.4/misc/tune2fs.c e2fsprogs-1.44.4.mod/misc/tune2fs.c\n--- e2fsprogs-1.44.4/misc/tune2fs.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/tune2fs.c\t2018-09-22 15:22:14.829251334 +0300\n@@ -2764,7 +2764,7 @@\n \t */\n \ttdb_dir = getenv(\"E2FSPROGS_UNDO_DIR\");\n \tif (!tdb_dir)\n-\t\ttdb_dir = \"/var/lib/e2fsprogs\";\n+\t\ttdb_dir = \"@TERMUX_PREFIX@/var/lib/e2fsprogs\";\n \n \tif (!strcmp(tdb_dir, \"none\") || (tdb_dir[0] == 0) ||\n \t    access(tdb_dir, W_OK))\ndiff -uNr e2fsprogs-1.44.4/misc/util.c e2fsprogs-1.44.4.mod/misc/util.c\n--- e2fsprogs-1.44.4/misc/util.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/util.c\t2018-09-22 15:22:14.832584681 +0300\n@@ -130,7 +130,7 @@\n \tif (mount_flags & EXT2_MF_MOUNTED) {\n \t\tfprintf(stderr, _(\"%s is mounted; \"), device);\n \t\tif (force >= 2) {\n-\t\t\tfputs(_(\"mke2fs forced anyway.  Hope /etc/mtab is \"\n+\t\t\tfputs(_(\"mke2fs forced anyway.  Hope @TERMUX_PREFIX@/etc/mtab is \"\n \t\t\t\t\"incorrect.\\n\"), stderr);\n \t\t\treturn;\n \t\t}\ndiff -uNr e2fsprogs-1.44.4/resize/main.c e2fsprogs-1.44.4.mod/resize/main.c\n--- e2fsprogs-1.44.4/resize/main.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/resize/main.c\t2018-09-22 15:22:14.842584717 +0300\n@@ -198,7 +198,7 @@\n \t */\n \ttdb_dir = getenv(\"E2FSPROGS_UNDO_DIR\");\n \tif (!tdb_dir)\n-\t\ttdb_dir = \"/var/lib/e2fsprogs\";\n+\t\ttdb_dir = \"@TERMUX_PREFIX@/var/lib/e2fsprogs\";\n \n \tif (!strcmp(tdb_dir, \"none\") || (tdb_dir[0] == 0) ||\n \t    access(tdb_dir, W_OK))\ndiff -uNr e2fsprogs-1.44.4/resize/resize2fs.h e2fsprogs-1.44.4.mod/resize/resize2fs.h\n--- e2fsprogs-1.44.4/resize/resize2fs.h\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/resize/resize2fs.h\t2018-09-22 15:22:14.842584717 +0300\n@@ -51,7 +51,7 @@\n #define NLS_CAT_NAME \"e2fsprogs\"\n #endif\n #ifndef LOCALEDIR\n-#define LOCALEDIR \"/usr/share/locale\"\n+#define LOCALEDIR \"@TERMUX_PREFIX@/share/locale\"\n #endif\n #else\n #define _(a) (a)\ndiff -uNr e2fsprogs-1.44.4/util/android_config.h e2fsprogs-1.44.4.mod/util/android_config.h\n--- e2fsprogs-1.44.4/util/android_config.h\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/util/android_config.h\t2018-09-22 15:22:14.845918064 +0300\n@@ -2,7 +2,7 @@\n #define HAVE_MALLOC_H 1\n #endif\n \n-#define ROOT_SYSCONFDIR \"/etc\"\n+#define ROOT_SYSCONFDIR \"@TERMUX_PREFIX@/etc\"\n \n #define ENABLE_LIBSPARSE 1\n \n"
  },
  {
    "path": "packages/e2fsprogs/fsmap.h.patch",
    "content": "diff -uNr e2fsprogs-1.44.4/misc/fsmap.h e2fsprogs-1.44.4.mod/misc/fsmap.h\n--- e2fsprogs-1.44.4/misc/fsmap.h\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/misc/fsmap.h\t2018-09-22 15:22:14.819251297 +0300\n@@ -84,6 +84,26 @@\n #define FMR_OWN_METADATA\tFMR_OWNER(0, 3) /* metadata */\n \n #define FS_IOC_GETFSMAP\t\t_IOWR('X', 59, struct fsmap_head)\n+#else\n+\n+#ifdef __ANDROID__\n+/* Size of an fsmap_head with room for nr records. */\n+static inline size_t\n+fsmap_sizeof(\n+\tunsigned int\tnr)\n+{\n+\treturn sizeof(struct fsmap_head) + nr * sizeof(struct fsmap);\n+}\n+\n+/* Start the next fsmap query at the end of the current query results. */\n+static inline void\n+fsmap_advance(\n+\tstruct fsmap_head\t*head)\n+{\n+\thead->fmh_keys[0] = head->fmh_recs[head->fmh_entries - 1];\n+}\n+#endif\n+\n #endif /* FS_IOC_GETFSMAP */\n \n #endif\n"
  },
  {
    "path": "packages/e2fsprogs/hasmntopt.patch",
    "content": "diff -uNr e2fsprogs-1.44.4/lib/ext2fs/ismounted.c e2fsprogs-1.44.4.mod/lib/ext2fs/ismounted.c\n--- e2fsprogs-1.44.4/lib/ext2fs/ismounted.c\t2018-08-19 05:26:58.000000000 +0300\n+++ e2fsprogs-1.44.4.mod/lib/ext2fs/ismounted.c\t2018-09-22 15:22:14.795917878 +0300\n@@ -57,6 +57,26 @@\n #include \"ext2fs.h\"\n #include \"ext2fsP.h\"\n \n+char *hasmntopt(const struct mntent *mnt, const char *opt)\n+{\n+\tchar *cp = mnt->mnt_opts;\n+\tint\tlen = strlen(opt);\n+\n+\tif (!mnt->mnt_opts)\n+\t\treturn 0;\n+\n+\twhile (1) {\n+\t\tif (!(cp = strstr(cp, opt)))\n+\t\t\tbreak;\n+\t\tif ((cp == mnt->mnt_opts || cp[-1]==',') &&\n+\t\t    (cp[len] == 0 || cp[len] == ',' || cp[len] == '='))\n+\t\t\treturn cp;\n+\t\tcp += (len + 1);\n+\t}\n+\n+\treturn 0;\n+}\n+\n #ifdef HAVE_SETMNTENT\n /*\n  * Check to see if a regular file is mounted.\n@@ -234,7 +254,7 @@\n \terrcode_t\tretval;\n \n #ifdef DEBUG\n-\tretval = check_mntent_file(\"/tmp/mtab\", file, mount_flags,\n+\tretval = check_mntent_file(\"@TERMUX_PREFIX@/tmp/mtab\", file, mount_flags,\n \t\t\t\t   mtpt, mtlen);\n \tif (retval == 0)\n \t\treturn 0;\n"
  },
  {
    "path": "packages/ecj/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.eclipse.org/jdt/core/\nTERMUX_PKG_DESCRIPTION=\"Eclipse Compiler for Java\"\nTERMUX_PKG_LICENSE=\"EPL-2.0\"\nTERMUX_PKG_VERSION=4.12\nlocal _date=201906051800\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://archive.eclipse.org/eclipse/downloads/drops${TERMUX_PKG_VERSION:0:1}/R-$TERMUX_PKG_VERSION-$_date/ecj-$TERMUX_PKG_VERSION.jar\nTERMUX_PKG_SHA256=69dad18a1fcacd342a7d44c5abf74f50e7529975553a24c64bce0b29b86af497\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_CONFLICTS=\"ecj4.6\"\n\ntermux_step_extract_package() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tmkdir $TERMUX_PKG_SRCDIR\n}\n\ntermux_step_make() {\n\tlocal RAW_JAR=$TERMUX_PKG_CACHEDIR/ecj-${TERMUX_PKG_VERSION}.jar\n\ttermux_download $TERMUX_PKG_SRCURL \\\n\t\t$RAW_JAR \\\n\t\t$TERMUX_PKG_SHA256\n\n\tmkdir -p $TERMUX_PREFIX/share/{dex,java}\n\t$TERMUX_D8 \\\n\t\t--classpath $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar \\\n\t\t--release \\\n\t\t--min-api $TERMUX_PKG_API_LEVEL \\\n\t\t--output $TERMUX_PKG_TMPDIR \\\n\t\t$RAW_JAR\n\n\t# Package classes.dex into jar:\n\tcd $TERMUX_PKG_TMPDIR\n\tjar cf ecj.jar classes.dex\n\t# Add needed properties file to jar file:\n\tjar xf $RAW_JAR org/eclipse/jdt/internal/compiler/batch/messages.properties\n\tjar uf ecj.jar\torg/eclipse/jdt/internal/compiler/batch/messages.properties\n\tjar xf $RAW_JAR org/eclipse/jdt/internal/compiler/problem/messages.properties\n\tjar uf ecj.jar\torg/eclipse/jdt/internal/compiler/problem/messages.properties\n\tjar xf $RAW_JAR org/eclipse/jdt/internal/compiler/messages.properties\n\tjar uf ecj.jar\torg/eclipse/jdt/internal/compiler/messages.properties\n\tjar xf $RAW_JAR org/eclipse/jdt/internal/compiler/parser/readableNames.props\n\tjar uf ecj.jar\torg/eclipse/jdt/internal/compiler/parser/readableNames.props\n\tfor i in $(seq 1 24); do\n\t\tjar xf $RAW_JAR org/eclipse/jdt/internal/compiler/parser/parser$i.rsc\n\t\tjar uf ecj.jar\torg/eclipse/jdt/internal/compiler/parser/parser$i.rsc\n\tdone\n\t# Move into place:\n\tmv ecj.jar $TERMUX_PREFIX/share/dex/ecj.jar\n\n\trm -rf android-jar\n\tmkdir android-jar\n\tcd android-jar\n\n\t# We need the android classes for JDT to compile against.\n\tcp $ANDROID_HOME/platforms/android-28/android.jar .\n\tunzip -q android.jar\n\trm -Rf android.jar resources.arsc res assets\n\tjar cfM android.jar .\n\n\tcp $TERMUX_PKG_TMPDIR/android-jar/android.jar $TERMUX_PREFIX/share/java/android.jar\n\n\t# Bundle in an android.jar from an older API also, for those who want to\n\t# build apps that run on older Android versions.\n\trm -Rf ./*\n\tcp $ANDROID_HOME/platforms/android-$TERMUX_PKG_API_LEVEL/android.jar android.jar\n\tunzip -q android.jar\n\trm -Rf android.jar resources.arsc res assets\n\tjar cfM android-$TERMUX_PKG_API_LEVEL.jar .\n\tcp $TERMUX_PKG_TMPDIR/android-jar/android-$TERMUX_PKG_API_LEVEL.jar $TERMUX_PREFIX/share/java/\n\n\trm -Rf $TERMUX_PREFIX/bin/javac\n\tinstall $TERMUX_PKG_BUILDER_DIR/ecj $TERMUX_PREFIX/bin/ecj\n\tperl -p -i -e \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PREFIX/bin/ecj\n\tinstall $TERMUX_PKG_BUILDER_DIR/ecj-$TERMUX_PKG_API_LEVEL $TERMUX_PREFIX/bin/ecj-$TERMUX_PKG_API_LEVEL\n\tperl -p -i -e \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PREFIX/bin/ecj-$TERMUX_PKG_API_LEVEL\n}\n"
  },
  {
    "path": "packages/ecj/ecj",
    "content": "#!/bin/sh\n\n# -proc:none to disable annotation processing.\n# -7 for java 1.7 compatibility.\ndalvikvm -Xmx256m \\\n         -cp @TERMUX_PREFIX@/share/dex/ecj.jar \\\n         org.eclipse.jdt.internal.compiler.batch.Main \\\n         -proc:none \\\n         -7 \\\n         -cp @TERMUX_PREFIX@/share/java/android.jar \\\n         \"$@\"\n"
  },
  {
    "path": "packages/ecj/ecj-24",
    "content": "#!/bin/sh\n\n# -proc:none to disable annotation processing.\n# -7 for java 1.7 compatibility.\ndalvikvm -Xmx256m \\\n         -cp @TERMUX_PREFIX@/share/dex/ecj.jar \\\n         org.eclipse.jdt.internal.compiler.batch.Main \\\n         -proc:none \\\n         -7 \\\n         -cp @TERMUX_PREFIX@/share/java/android-24.jar \\\n         \"$@\"\n"
  },
  {
    "path": "packages/ed/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/ed/\nTERMUX_PKG_DESCRIPTION=\"Classic UNIX line editor\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_VERSION=1.15\nTERMUX_PKG_SHA256=ad4489c0ad7a108c514262da28e6c2a426946fb408a3977ef1ed34308bdfd174\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/ed/ed-${TERMUX_PKG_VERSION}.tar.lz\n"
  },
  {
    "path": "packages/ed/configure.patch",
    "content": "diff --git a/configure b/configure\nindex 50f3cad..31256c2 100755\n--- a/configure\n+++ b/configure\n@@ -21,10 +21,10 @@ datarootdir='$(prefix)/share'\n infodir='$(datarootdir)/info'\n mandir='$(datarootdir)/man'\n program_prefix=\n-CC=gcc\n-CPPFLAGS=\n-CFLAGS='-Wall -W -O2'\n-LDFLAGS=\n+CC?=gcc\n+CPPFLAGS?=\n+CFLAGS?='-Wall -W -O2'\n+LDFLAGS?=\n \n # checking whether we are using GNU C.\n ${CC} --version > /dev/null 2>&1\n"
  },
  {
    "path": "packages/elinks/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://elinks.or.cz\nTERMUX_PKG_DESCRIPTION=\"Full-Featured Text WWW Browser\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\n_COMMIT=f86be659718c0cd0a67f88b42f07044c23d0d028\nTERMUX_PKG_VERSION=0.13.GIT\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/xeffyr/elinks/archive/${_COMMIT}.zip\nTERMUX_PKG_SHA256=3e65aaabcc4f6b2418643cf965786c00e3f196330f3e7863ca83f9e546d5e609\nTERMUX_PKG_DEPENDS=\"libexpat, libiconv, libidn, openssl, libbz2, zlib\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-256-colors\n--enable-true-color\n--mandir=$TERMUX_PREFIX/share/man\n--with-openssl\n--without-brotli\n--without-gc\n\"\n\nTERMUX_MAKE_PROCESSES=1\n\ntermux_step_pre_configure() {\n    ./autogen.sh\n}\n"
  },
  {
    "path": "packages/elinks/elinks-fix-paths.patch",
    "content": "diff --git a/contrib/proxy/gen.c b/contrib/proxy/gen.c\nindex 6e7807ab..8b5b2b1a 100644\n--- a/contrib/proxy/gen.c\n+++ b/contrib/proxy/gen.c\n@@ -5,7 +5,7 @@\n #include <unistd.h>\n \n struct stat st;\n-char *file = \"/tmp/log\";\n+char *file = \"@TERMUX_PREFIX@/tmp/log\";\n unsigned char *data;\n int counter = 0;\n \n@@ -17,7 +17,7 @@ struct {\n } tab[100000]; /* should be enough */\n \n unsigned char header[] =\n-\"#!/usr/bin/env python\\n\"\n+\"#!@TERMUX_PREFIX@/bin/env python\\n\"\n \"import BaseHTTPServer\\n\\n\";\n \n unsigned char footer[] =\ndiff --git a/src/network/socket.c b/src/network/socket.c\nindex 3426b681..480d7378 100644\n--- a/src/network/socket.c\n+++ b/src/network/socket.c\n@@ -83,7 +83,7 @@ static INIT_LIST_OF(struct socket_weak_ref, socket_weak_refs);\n /* To enable logging of tranfers, for debugging purposes. */\n #if 0\n \n-#define DEBUG_TRANSFER_LOGFILE \"/tmp/log\"\n+#define DEBUG_TRANSFER_LOGFILE \"@TERMUX_PREFIX@/tmp/log\"\n \n static void\n debug_transfer_log(unsigned char *data, int len)\ndiff --git a/src/osdep/unix/sysinfo.h b/src/osdep/unix/sysinfo.h\nindex 7b4ef587..d2653d87 100644\n--- a/src/osdep/unix/sysinfo.h\n+++ b/src/osdep/unix/sysinfo.h\n@@ -6,7 +6,7 @@\n \n #define SYSTEM_NAME\t\"Unix\"\n #define SYSTEM_STR\t\"unix\"\n-#define DEFAULT_SHELL\t\"/bin/sh\"\n+#define DEFAULT_SHELL\t\"@TERMUX_PREFIX@/bin/sh\"\n #define GETSHELL\tgetenv(\"SHELL\")\n \n static inline int dir_sep(char x) { return x == '/'; }\ndiff --git a/src/protocol/file/mailcap.c b/src/protocol/file/mailcap.c\nindex 24b47025..06eff352 100644\n--- a/src/protocol/file/mailcap.c\n+++ b/src/protocol/file/mailcap.c\n@@ -110,7 +110,7 @@ mailcap_protocol_handler(struct connection *conn)\n \t\t/* We implicitly chain stderr to ELinks' stderr. */\n \t\tclose_all_non_term_fd();\n \n-\t\tif (execl(\"/bin/sh\", \"/bin/sh\", \"-c\", script, (char *) NULL)) {\n+\t\tif (execl(\"@TERMUX_PREFIX@/bin/sh\", \"@TERMUX_PREFIX@/bin/sh\", \"-c\", script, (char *) NULL)) {\n \t\t\t_exit(3);\n \t\t}\n \ndiff --git a/src/session/download.c b/src/session/download.c\nindex 000bbe97..538f1715 100644\n--- a/src/session/download.c\n+++ b/src/session/download.c\n@@ -373,7 +373,7 @@ exec_mailcap_command(void *data)\n \t\t\t\tadd_to_string(&string, \"mailcap:\");\n \t\t\t\tadd_to_string(&string, exec_mailcap->command);\n \t\t\t\tif (exec_mailcap->file) {\n-\t\t\t\t\tadd_to_string(&string, \" && /bin/rm -f \");\n+\t\t\t\t\tadd_to_string(&string, \" && @TERMUX_PREFIX@/bin/rm -f \");\n \t\t\t\t\tadd_to_string(&string, exec_mailcap->file);\n \t\t\t\t}\n \n@@ -1067,7 +1067,7 @@ subst_file(unsigned char *prog, unsigned char *file)\n \t\tstruct string s;\n \n \t\tif (init_string(&s)) {\n-\t\t\tadd_to_string(&s, \"/bin/cat \");\n+\t\t\tadd_to_string(&s, \"@TERMUX_PREFIX@/bin/cat \");\n \t\t\tadd_shell_quoted_to_string(&s, file, strlen(file));\n \t\t\tadd_to_string(&s, \" | \");\n \t\t\tadd_string_to_string(&s, &name);\ndiff --git a/src/setup.h b/src/setup.h\nindex 572610f5..5b69de99 100644\n--- a/src/setup.h\n+++ b/src/setup.h\n@@ -83,11 +83,11 @@\n \n /* Default mime settings */\n #define DEFAULT_MIME_TYPE\t\t\"application/octet-stream\"\n-#define DEFAULT_PAGER_PATH\t\t\"/usr/bin/pager\"\n-#define DEFAULT_LESS_PATH\t\t\"/usr/bin/less\"\n-#define DEFAULT_MORE_PATH\t\t\"/usr/bin/more\"\n-#define DEFAULT_MAILCAP_PATH\t\t\"~/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap:/usr/share/mailcap:/usr/share/misc/mailcap\"\n-#define DEFAULT_MIMETYPES_PATH\t\t\"~/.mime.types:/etc/mime.types:/usr/etc/mime.types:/usr/local/etc/mime.types:/usr/share/mime.types:/usr/share/misc/mime.types\"\n+#define DEFAULT_PAGER_PATH\t\t\"@TERMUX_PREFIX@/bin/pager\"\n+#define DEFAULT_LESS_PATH\t\t\"@TERMUX_PREFIX@/bin/less\"\n+#define DEFAULT_MORE_PATH\t\t\"@TERMUX_PREFIX@/bin/more\"\n+#define DEFAULT_MAILCAP_PATH\t\t\"~/.mailcap:@TERMUX_PREFIX@/etc/mailcap:@TERMUX_PREFIX@/share/mailcap\"\n+#define DEFAULT_MIMETYPES_PATH\t\t\"~/.mime.types:@TERMUX_PREFIX@/etc/mime.types:@TERMUX_PREFIX@/share/mime.types\"\n \n /* Default external commands (see osdep/newwin.c and/or system-specific osdep/\n  * files) */\ndiff --git a/src/util/file.c b/src/util/file.c\nindex 90882eed..cae9052e 100644\n--- a/src/util/file.c\n+++ b/src/util/file.c\n@@ -186,7 +186,7 @@ get_tempdir_filename(unsigned char *name)\n \tif (!tmpdir || !*tmpdir) tmpdir = getenv(\"TMP\");\n \tif (!tmpdir || !*tmpdir) tmpdir = getenv(\"TEMPDIR\");\n \tif (!tmpdir || !*tmpdir) tmpdir = getenv(\"TEMP\");\n-\tif (!tmpdir || !*tmpdir) tmpdir = \"/tmp\";\n+\tif (!tmpdir || !*tmpdir) tmpdir = \"@TERMUX_PREFIX@/tmp\";\n \n \treturn straconcat(tmpdir, \"/\", name, (unsigned char *) NULL);\n }\n"
  },
  {
    "path": "packages/elixir/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://elixir-lang.org/\nTERMUX_PKG_DESCRIPTION=\"Elixir is a dynamic, functional language designed for building scalable and maintainable applications\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.9.4\nTERMUX_PKG_SRCURL=https://github.com/elixir-lang/elixir/releases/download/v${TERMUX_PKG_VERSION}/Precompiled.zip\nTERMUX_PKG_SHA256=8cdc158084405a1f867076d55f58351cf75f4e9a21fa36d9fd8a13021e8cd6fc\nTERMUX_PKG_DEPENDS=\"dash, erlang\"\nTERMUX_PKG_SUGGESTS=\"clang, make\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_extract_package() {\n\ttermux_download \"$TERMUX_PKG_SRCURL\" \"$TERMUX_PKG_CACHEDIR\"/prebuilt.zip \\\n\t\t\"$TERMUX_PKG_SHA256\"\n\n\t# Unpack directly to $PREFIX/opt/elixir.\n\tmkdir -p \"$TERMUX_PREFIX\"/opt\n\trm -rf \"$TERMUX_PREFIX\"/opt/elixir\n\tunzip -d \"$TERMUX_PREFIX\"/opt/elixir \"$TERMUX_PKG_CACHEDIR\"/prebuilt.zip\n\n\t# Create src directory to avoid build-package.sh errors.\n\tmkdir -p \"$TERMUX_PKG_SRCDIR\"\n}\n\ntermux_step_make_install() {\n\t# Remove unneeded files.\n\t(cd \"$TERMUX_PREFIX\"/opt/elixir/man; rm -f common elixir.1.in iex.1.in)\n\n\t# Put manpages to standard location.\n\tfor page in elixir.1 elixirc.1 iex.1 mix.1; do\n\t\tinstall -Dm600 \"$TERMUX_PREFIX/opt/elixir/man/$page\" \\\n\t\t\t\"$TERMUX_PREFIX/share/man/man1/$page\"\n\tdone\n\tunset page\n\trm -rf \"$TERMUX_PREFIX\"/opt/elixir/man\n\n\t# Symlink startup scripts to $PREFIX/bin.\n\tfor file in elixir elixirc iex mix; do\n\t\tln -sfr \"$TERMUX_PREFIX/opt/elixir/bin/$file\" \\\n\t\t\t\"$TERMUX_PREFIX/bin/$file\"\n\tdone\n\tunset file\n}\n"
  },
  {
    "path": "packages/emacs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/emacs/\nTERMUX_PKG_DESCRIPTION=\"Extensible, customizable text editor-and more\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=26.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/emacs/emacs-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=4d90e6751ad8967822c6e092db07466b9d383ef1653feb2f95c93e7de66d3485\nTERMUX_PKG_DEPENDS=\"ncurses, gnutls, libxml2\"\nTERMUX_PKG_BREAKS=\"emacs-dev\"\nTERMUX_PKG_REPLACES=\"emacs-dev\"\nTERMUX_PKG_CONFFILES=\"var/service/emacsd/run var/service/emacsd/log/run\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-autodepend\n--with-gif=no\n--with-gnutls\n--with-jpeg=no\n--without-gconf\n--without-gsettings\n--without-lcms2\n--without-x\n--with-png=no\n--with-tiff=no\n--with-xml2\n--with-xpm=no\n--without-dbus\n\"\n# Ensure use of system malloc:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" emacs_cv_sanitize_address=yes\"\n# Prevent configure from adding -nopie:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" emacs_cv_prog_cc_no_pie=no\"\n# Prevent linking against libelf:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_lib_elf_elf_begin=no\"\n# implemented using dup3(), which fails if oldfd == newfd\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" gl_cv_func_dup2_works=no\"\n# disable setrlimit function to make termux-am work from within emacs\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_setrlimit=no\"\nTERMUX_PKG_HOSTBUILD=true\n\n# Remove some irrelevant files:\nTERMUX_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.*\"\n\n# Remove ctags from the emacs package to prevent conflicting with\n# the Universal Ctags from the 'ctags' package (the bin/etags\n# program still remain in the emacs package):\nTERMUX_PKG_RM_AFTER_INSTALL+=\" bin/ctags share/man/man1/ctags.1 share/man/man1/ctags.1.gz\"\n\ntermux_step_post_extract_package() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# XXX: We have to start with new host build each time\n\t#      to avoid build error when cross compiling.\n\trm -Rf $TERMUX_PKG_HOSTBUILD_DIR\n\n\t# Termux only use info pages for emacs. Remove the info directory\n\t# to get a clean Info directory file dir.\n\trm -Rf $TERMUX_PREFIX/share/info\n\n\t# We cannot run a dumped emacs on Android 5.0+ due to the pie requirement.\n\t# Also, the native emacs we build (bootstrap-emacs) cannot used dumps when\n\t# building inside docker: https://github.com/docker/docker/issues/22801\n\texport CANNOT_DUMP=yes\n}\n\ntermux_step_host_build() {\n\t# Build a bootstrap-emacs binary to be used in termux_step_post_configure.\n\tlocal NATIVE_PREFIX=$TERMUX_PKG_TMPDIR/emacs-native\n\tmkdir -p $NATIVE_PREFIX/share/emacs/$TERMUX_PKG_VERSION\n\tln -s $TERMUX_PKG_SRCDIR/lisp $NATIVE_PREFIX/share/emacs/$TERMUX_PKG_VERSION/lisp\n\n\t$TERMUX_PKG_SRCDIR/configure --prefix=$NATIVE_PREFIX --without-all --with-x-toolkit=no\n\tmake -j $TERMUX_MAKE_PROCESSES\n}\n\ntermux_step_post_configure() {\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/src/bootstrap-emacs $TERMUX_PKG_BUILDDIR/src/bootstrap-emacs\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/lib-src/make-docfile $TERMUX_PKG_BUILDDIR/lib-src/make-docfile\n\t# Update timestamps so that the binaries does not get rebuilt:\n\ttouch -d \"next hour\" $TERMUX_PKG_BUILDDIR/src/bootstrap-emacs $TERMUX_PKG_BUILDDIR/lib-src/make-docfile\n}\n\ntermux_step_post_make_install() {\n\tcp $TERMUX_PKG_BUILDER_DIR/site-init.el $TERMUX_PREFIX/share/emacs/${TERMUX_PKG_VERSION}/lisp/emacs-lisp/\n\n\t# Setup emacs --daemon service script\n\tmkdir -p $TERMUX_PREFIX/var/service\n\tcd $TERMUX_PREFIX/var/service\n\tmkdir -p emacsd/log\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > emacsd/run\n\techo 'exec emacs --fg-daemon 2>&1' >> emacsd/run\n\tchmod +x emacsd/run\n\ttouch emacsd/down\n\n\tln -sf $TERMUX_PREFIX/share/termux-services/svlogger emacsd/log/run\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/emacs 40\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/emacs\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/emacs/lib-src-emacsclient.c.patch",
    "content": "--- ../emacsclient.c.orig\t2019-08-29 20:08:48.840624090 +0200\n+++ ./lib-src/emacsclient.c\t2019-08-29 20:13:37.425382182 +0200\n@@ -1289,11 +1289,12 @@\n               }\n             else\n #endif\n-              tmpdir = \"/tmp\";\n+              tmpdir = \"@TERMUX_PREFIX@/tmp\";\n           }\n+\t/* Use $PREFIX/var/run instead of $TMPDIR in termux. */\n \tsocket_name_storage =\n-\t  xmalloc (strlen (tmpdir) + strlen (server_name) + EXTRA_SPACE);\n-\tchar *z = stpcpy (socket_name_storage, tmpdir);\n+\t  xmalloc (strlen (\"@TERMUX_PREFIX@/var/run\") + strlen (server_name) + EXTRA_SPACE);\n+\tchar *z = stpcpy (socket_name_storage, \"@TERMUX_PREFIX@/var/run\");\n \tz += sprintf (z, \"/emacs%ld/\", uid);\n \tstrcpy (z, server_name);\n \tlocal_socket_name = socket_name_storage;\n"
  },
  {
    "path": "packages/emacs/lisp-cus-start.el.patch.beforehostbuild",
    "content": "diff -u -r ../emacs-25.0.92/lisp/cus-start.el ./lisp/cus-start.el\n--- ../emacs-25.0.92/lisp/cus-start.el\t2016-03-02 05:21:42.000000000 -0500\n+++ ./lisp/cus-start.el\t2016-04-06 18:16:00.007272810 -0400\n@@ -277,7 +277,7 @@\n \t\t\t  \"/tmp\"))\n \t\t     (t\n \t\t      (or (getenv \"TMPDIR\") (getenv \"TMP\") (getenv \"TEMP\")\n-\t\t\t  \"/tmp\"))))\n+\t\t\t  \"@TERMUX_PREFIX@/tmp\"))))\n \t      :initialize custom-initialize-delay)\n \t     ;; fns.c\n \t     (use-dialog-box menu boolean \"21.1\")\n"
  },
  {
    "path": "packages/emacs/lisp-loadup.el-2.patch.beforehostbuild",
    "content": "diff -u -r ../emacs-25.0.92/lisp/loadup.el ./lisp/loadup.el\n--- ../emacs-25.0.92/lisp/loadup.el\t2016-09-06 09:49:51.838175278 +0300\n+++ ./lisp/loadup.el\t2016-09-06 09:57:18.694585441 +0300\n@@ -378,7 +378,11 @@\n       (message \"Warning: Change in load-path due to site-init will be \\\n lost after dumping\")))\n \n-(setq current-load-list nil)\n+;; On an emacs that runs undumped, i.e. Android, this causes bogus \n+;; entries to appear in load-history. Commenting this out causes an entry\n+;; for loadup.el with a bogus filename to appear instead, but since it\n+;; neither provides nor requires anything, it appears to be safe.\n+;;(setq current-load-list nil)\n ;; Avoid storing references to build directory in the binary.\n (setq custom-current-group-alist nil)\n \n"
  },
  {
    "path": "packages/emacs/lisp-net-tramp.el.patch.beforehostbuild",
    "content": "diff -u -r ../emacs-26.1/lisp/net/tramp.el ./lisp/net/tramp.el\n--- ../emacs-26.1/lisp/net/tramp.el\t2018-04-23 14:17:48.000000000 +0000\n+++ ./lisp/net/tramp.el\t2018-05-29 09:26:34.017326913 +0000\n@@ -127,7 +127,7 @@\n   :require 'tramp)\n \n (defcustom tramp-encoding-shell\n-  (or (tramp-compat-funcall 'w32-shell-name) \"/bin/sh\")\n+  (or (tramp-compat-funcall 'w32-shell-name) \"@TERMUX_PREFIX@/bin/sh\")\n   \"Use this program for encoding and decoding commands on the local host.\n This shell is used to execute the encoding and decoding command on the\n local host, so if you want to use `~' in those commands, you should\n"
  },
  {
    "path": "packages/emacs/lisp-server.el.patch.beforehostbuild",
    "content": "diff -u -r ../emacs-25.0.92/lisp/server.el ./lisp/server.el\n--- ../emacs-25.0.92/lisp/server.el\t2016-03-02 05:21:42.000000000 -0500\n+++ ./lisp/server.el\t2016-04-06 17:34:48.134354070 -0400\n@@ -267,7 +267,7 @@\n ;; does not read the init file.\n (defvar server-socket-dir\n   (and (featurep 'make-network-process '(:family local))\n-       (format \"%s/emacs%d\" (or (getenv \"TMPDIR\") \"/tmp\") (user-uid)))\n+       (format \"%s/emacs%d\" \"@TERMUX_PREFIX@/var/run\" (user-uid)))\n   \"The directory in which to place the server socket.\n If local sockets are not supported, this is nil.\")\n \n"
  },
  {
    "path": "packages/emacs/lisp-subr.el.patch.beforehostbuild",
    "content": "diff -u -r ../emacs-25.0.92/lisp/subr.el ./lisp/subr.el\n--- ../emacs-25.0.92/lisp/subr.el\t2016-03-02 05:21:42.000000000 -0500\n+++ ./lisp/subr.el\t2016-03-25 22:03:57.240066240 -0400\n@@ -2975,7 +2975,7 @@\n   (declare (advertised-calling-convention (name buffer command) \"23.1\"))\n   (start-file-process\n    name buffer\n-   (if (file-remote-p default-directory) \"/bin/sh\" shell-file-name)\n+   (if (file-remote-p default-directory) \"@TERMUX_PREFIX@/bin/sh\" shell-file-name)\n    (if (file-remote-p default-directory) \"-c\" shell-command-switch)\n    (mapconcat 'identity args \" \")))\n \n@@ -3019,7 +3019,7 @@\n   (declare (advertised-calling-convention\n             (command &optional infile buffer display) \"24.5\"))\n   (process-file\n-   (if (file-remote-p default-directory) \"/bin/sh\" shell-file-name)\n+   (if (file-remote-p default-directory) \"@TERMUX_PREFIX@/bin/sh\" shell-file-name)\n    infile buffer display\n    (if (file-remote-p default-directory) \"-c\" shell-command-switch)\n    (mapconcat 'identity (cons command args) \" \")))\n"
  },
  {
    "path": "packages/emacs/lisp-term.el.patch.beforehostbuild",
    "content": "diff -u -r ../emacs-26.1/lisp/term.el ./lisp/term.el\n--- ../emacs-26.1/lisp/term.el\t2018-05-25 08:53:30.000000000 +0000\n+++ ./lisp/term.el\t2018-05-29 09:28:08.472262228 +0000\n@@ -1552,7 +1552,7 @@\n \t;; do the decoding by hand on the parts that are made of chars.\n \t(coding-system-for-read 'binary))\n     (apply 'start-process name buffer\n-\t   \"/bin/sh\" \"-c\"\n+\t   \"@TERMUX_PREFIX@/bin/sh\" \"-c\"\n \t   (format \"stty -nl echo rows %d columns %d sane 2>/dev/null;\\\n if [ $1 = .. ]; then shift; fi; exec \\\"$@\\\"\"\n \t\t   term-height term-width)\n"
  },
  {
    "path": "packages/emacs/lisp-textmodes-ispell.el.patch.beforehostbuild",
    "content": "diff -u -r ../emacs-26.2/lisp/textmodes/ispell.el ./lisp/textmodes/ispell.el\n--- ../emacs-26.2/lisp/textmodes/ispell.el\t2019-02-20 13:44:42.000000000 +0000\n+++ ./lisp/textmodes/ispell.el\t2019-04-14 18:15:07.894909566 +0000\n@@ -215,14 +215,14 @@\n   :group 'ispell)\n \n (defcustom ispell-alternate-dictionary\n-  (cond ((file-readable-p \"/usr/dict/web2\") \"/usr/dict/web2\")\n-\t((file-readable-p \"/usr/share/dict/web2\") \"/usr/share/dict/web2\")\n-\t((file-readable-p \"/usr/dict/words\") \"/usr/dict/words\")\n-\t((file-readable-p \"/usr/lib/dict/words\") \"/usr/lib/dict/words\")\n-\t((file-readable-p \"/usr/share/dict/words\") \"/usr/share/dict/words\")\n-\t((file-readable-p \"/usr/share/lib/dict/words\")\n-\t \"/usr/share/lib/dict/words\")\n-\t((file-readable-p \"/sys/dict\") \"/sys/dict\"))\n+  (cond ((file-readable-p \"@TERMUX_PREFIX@/dict/web2\") \"/usr/dict/web2\")\n+\t((file-readable-p \"@TERMUX_PREFIX@/share/dict/web2\") \"/usr/share/dict/web2\")\n+\t((file-readable-p \"@TERMUX_PREFIX@/dict/words\") \"/usr/dict/words\")\n+\t((file-readable-p \"@TERMUX_PREFIX@/lib/dict/words\") \"/usr/lib/dict/words\")\n+\t((file-readable-p \"@TERMUX_PREFIX@/share/dict/words\") \"/usr/share/dict/words\")\n+\t((file-readable-p \"@TERMUX_PREFIX@/share/lib/dict/words\")\n+\t \"@TERMUX_PREFIX@/share/lib/dict/words\")\n+\t((file-readable-p \"@TERMUX_PREFIX@/sys/dict\") \"@TERMUX_PREFIX@/sys/dict\"))\n   \"Alternate plain word-list dictionary for spelling help.\"\n   :type '(choice file (const :tag \"None\" nil))\n   :group 'ispell)\n@@ -266,9 +266,7 @@\n   :group 'ispell)\n \n (defcustom ispell-look-command\n-  (cond ((file-exists-p \"/bin/look\") \"/bin/look\")\n-\t((file-exists-p \"/usr/local/bin/look\") \"/usr/local/bin/look\")\n-\t((file-exists-p \"/usr/bin/look\") \"/usr/bin/look\")\n+  (cond ((file-exists-p \"@TERMUX_PREFIX@/bin/look\") \"@TERMUX_PREFIX@/bin/look\")\n \t(t \"look\"))\n   \"Name of the look command for search processes.\n This must be an absolute file name.\"\n"
  },
  {
    "path": "packages/emacs/no_user_fullname.patch",
    "content": "diff -u -r ../emacs-24.3/src/editfns.c ./src/editfns.c\n--- ../emacs-24.3/src/editfns.c\t2013-01-01 21:37:17.000000000 +0100\n+++ ./src/editfns.c\t2014-02-19 03:21:55.000000000 +0100\n@@ -1304,7 +1304,7 @@\n   if (!pw)\n     return Qnil;\n \n-  p = USER_FULL_NAME;\n+  p = \"unknown\";\n   /* Chop off everything after the first comma. */\n   q = strchr (p, ',');\n   full = make_string (p, q ? q - p : strlen (p));\n"
  },
  {
    "path": "packages/emacs/site-init.el",
    "content": "; Enable terminal mouse events:\n(xterm-mouse-mode 1)\n(global-set-key [mouse-4] 'scroll-down-line)\n(global-set-key [mouse-5] 'scroll-up-line)\n"
  },
  {
    "path": "packages/emacs/src-callproc.c.patch",
    "content": "diff -u -r ../emacs-25.0.92/src/callproc.c ./src/callproc.c\n--- ../emacs-25.0.92/src/callproc.c\t2016-03-02 05:21:43.000000000 -0500\n+++ ./src/callproc.c\t2016-03-25 22:02:38.977310920 -0400\n@@ -1619,7 +1619,7 @@\n     dir_warning (\"arch-independent data dir\", Vdata_directory);\n \n   sh = getenv (\"SHELL\");\n-  Vshell_file_name = build_string (sh ? sh : \"/bin/sh\");\n+  Vshell_file_name = build_string (sh ? sh : \"@TERMUX_PREFIX@/bin/sh\");\n \n #ifdef DOS_NT\n   Vshared_game_score_directory = Qnil;\n"
  },
  {
    "path": "packages/emacs/src-filelock.c.patch",
    "content": "diff -u -r ../emacs-25.2/src/filelock.c ./src/filelock.c\n--- ../emacs-25.2/src/filelock.c\t2017-02-03 11:25:45.000000000 +0100\n+++ ./src/filelock.c\t2017-06-30 23:36:35.331596590 +0200\n@@ -126,14 +126,14 @@\n static time_t boot_time;\n static bool boot_time_initialized;\n \n-#ifdef BOOT_TIME\n+#if defined(BOOT_TIME) && !defined(__ANDROID__)\n static void get_boot_time_1 (const char *, bool);\n #endif\n \n static time_t\n get_boot_time (void)\n {\n-#if defined (BOOT_TIME)\n+#if defined (BOOT_TIME) && !defined(__ANDROID__)\n   int counter;\n #endif\n \n@@ -169,7 +169,7 @@\n \t}\n     }\n \n-#if defined (BOOT_TIME)\n+#if defined (BOOT_TIME) && !defined(__ANDROID__)\n #ifndef CANNOT_DUMP\n   /* The utmp routines maintain static state.\n      Don't touch that state unless we are initialized,\n@@ -237,7 +237,7 @@\n #endif\n }\n \n-#ifdef BOOT_TIME\n+#if defined(BOOT_TIME) && !defined(__ANDROID__)\n /* Try to get the boot time from wtmp file FILENAME.\n    This succeeds if that file contains a reboot record.\n \n"
  },
  {
    "path": "packages/emacs/src-keyboard.c.patch",
    "content": "https://github.com/emacs-mirror/emacs/commit/18b235941109ab9e7a405cbe950886c97e897e11\n\ndiff --git a/src/keyboard.c b/src/keyboard.c\nindex 57757cf2112..f32b1560133 100644\n--- a/src/keyboard.c\n+++ b/src/keyboard.c\n@@ -8916,7 +8916,6 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,\n   ptrdiff_t keys_start;\n \n   Lisp_Object current_binding = Qnil;\n-  Lisp_Object first_event = Qnil;\n \n   /* Index of the first key that has no binding.\n      It is useless to try fkey.start larger than that.  */\n@@ -9026,6 +9025,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,\n \n   starting_buffer = current_buffer;\n   first_unbound = bufsize + 1;\n+  Lisp_Object first_event = mock_input > 0 ? keybuf[0] : Qnil;\n \n   /* Build our list of keymaps.\n      If we recognize a function key and replace its escape sequence in\n"
  },
  {
    "path": "packages/erlang/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.erlang.org/\nTERMUX_PKG_DESCRIPTION=\"General-purpose concurrent functional programming language\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=22.0.7\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/erlang/otp/archive/OTP-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=04c090b55ec4a01778e7e1a5b7fdf54012548ca72737965b7aa8c4d7878c92bc\nTERMUX_PKG_DEPENDS=\"openssl, ncurses, zlib\"\nTERMUX_PKG_NO_STATICSPLIT=true\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-javac --with-ssl=${TERMUX_PREFIX} --with-termcap\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"noboot\"\n\ntermux_step_post_extract_package() {\n\t# We need a host build every time:\n\trm -Rf \"$TERMUX_PKG_HOSTBUILD_DIR\"\n\t./otp_build autoconf\n}\n\ntermux_step_host_build() {\n\tcd $TERMUX_PKG_SRCDIR\n\t./configure --enable-bootstrap-only\n\tmake -j \"$TERMUX_MAKE_PROCESSES\"\n}\n\ntermux_step_pre_configure() {\n\t(cd erts && autoreconf)\n\n\t# liblog is needed for syslog usage:\n\tLDFLAGS+=\" -llog\"\n\t# Put binaries built in termux_step_host_build at start of PATH:\n\tcp bin/*/* $TERMUX_PKG_SRCDIR/bootstrap/bin\n\texport PATH=\"$TERMUX_PKG_SRCDIR/bootstrap/bin:$PATH\"\n}\n"
  },
  {
    "path": "packages/erlang/erts-emulator-Makefile.in.patch",
    "content": "Based on the below change, updated for erlang 21:\n\nFrom 85a3e5b4f65e5284e59dcdd90e92ea7d50ef6907 Mon Sep 17 00:00:00 2001\nFrom: Romain Naour <romain.naour@openwide.fr>\nDate: Sun, 8 Feb 2015 17:23:13 +0100\nSubject: [PATCH] erts/emulator: reorder inclued headers paths\n\nIf the Perl Compatible Regular Expressions is installed on the\nhost and the path to the headers is added to the CFLAGS, the\npcre.h from the host is used instead of the one provided by\nerlang.\n\nErlang use an old version of this file which is incompatible\nwith the upstream one.\n\nMove INCLUDES before CFLAGS to use pcre.h from erlang.\n\nhttp://autobuild.buildroot.net/results/cbd/cbd8b54eef535f19d7d400fd269af1b3571d6143/build-end.log\n\nSigned-off-by: Romain Naour <romain.naour@openwide.fr>\n---\n erts/emulator/Makefile.in | 4 ++--\n  1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff -u -r ../otp-OTP-21.0.1/erts/emulator/Makefile.in ./erts/emulator/Makefile.in\n--- ../otp-OTP-21.0.1/erts/emulator/Makefile.in\t2018-06-25 13:19:47.000000000 +0200\n+++ ./erts/emulator/Makefile.in\t2018-07-01 18:06:51.931989663 +0200\n@@ -712,7 +712,7 @@\n # Usually the same as the default rule, but certain platforms (e.g. win32) mix\n # different compilers\n $(OBJDIR)/beam_emu.o: beam/beam_emu.c\n-\t$(V_EMU_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@\n+\t$(V_EMU_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@\n \n $(OBJDIR)/beam_emu.S: beam/beam_emu.c\n \t$(V_EMU_CC) -S -fverbose-asm $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@\n@@ -765,7 +765,7 @@\n # General targets\n #\n $(OBJDIR)/%.o: beam/%.c\n-\t$(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@\n+\t$(V_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@\n \n $(OBJDIR)/%.o: $(TARGET)/%.c\n \t$(V_CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@\n"
  },
  {
    "path": "packages/erlang/prefix.patch",
    "content": "diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl\nindex 29a26674ba..e6ab453a70 100644\n--- a/lib/kernel/src/os.erl\n+++ b/lib/kernel/src/os.erl\n@@ -294,7 +294,7 @@ mk_cmd({win32,Wtype}, Cmd) ->\n mk_cmd(_,Cmd) ->\n     %% Have to send command in like this in order to make sh commands like\n     %% cd and ulimit available\n-    {\"/bin/sh -s unix:cmd\", [out],\n+    {\"@TERMUX_PREFIX@/bin/sh -s unix:cmd\", [out],\n      %% We insert a new line after the command, in case the command\n      %% contains a comment character.\n      %%\n"
  },
  {
    "path": "packages/espeak/Makefile.patch",
    "content": "diff -u -r ../espeak-ng-1.49.1/Makefile.am ./Makefile.am\n--- ../espeak-ng-1.49.1/Makefile.am\t2017-01-21 21:57:13.000000000 +0100\n+++ ./Makefile.am\t2017-02-01 00:30:07.810286033 +0100\n@@ -121,7 +121,7 @@\n \n lib_LTLIBRARIES += src/libespeak-ng.la\n \n-src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lpthread -lm \\\n+src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lm \\\n \t${PCAUDIOLIB_LIBS}\n \n src_libespeak_ng_la_CFLAGS = -Isrc/include -Isrc/include/compat \\\ndiff -u -r ../espeak-ng-1.49.1/Makefile.in ./Makefile.in\n--- ../espeak-ng-1.49.1/Makefile.in\t2017-01-21 21:57:17.000000000 +0100\n+++ ./Makefile.in\t2017-02-01 00:30:24.202085646 +0100\n@@ -472,7 +472,7 @@\n \tsrc/include/espeak-ng/espeak_ng.h \\\n \tsrc/include/espeak-ng/speak_lib.h\n \n-src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lpthread -lm \\\n+src_libespeak_ng_la_LDFLAGS = -version-info $(SHARED_VERSION) -lm \\\n \t${PCAUDIOLIB_LIBS}\n \n src_libespeak_ng_la_CFLAGS = -Isrc/include -Isrc/include/compat -fPIC \\\n"
  },
  {
    "path": "packages/espeak/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/espeak-ng/espeak-ng\nTERMUX_PKG_DESCRIPTION=\"Compact software speech synthesizer\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\n# Use eSpeak NG as the original eSpeak project is dead.\n# See https://github.com/espeak-ng/espeak-ng/issues/180\n# about cross compilation of espeak-ng.\nTERMUX_PKG_VERSION=1.50\nTERMUX_PKG_SRCURL=https://github.com/espeak-ng/espeak-ng/releases/download/$TERMUX_PKG_VERSION/espeak-ng-$TERMUX_PKG_VERSION.tgz\nTERMUX_PKG_SHA256=80ee6cd06fcd61888951ab49362b400e80dd1fac352a8b1131d90cfe8a210edb\nTERMUX_PKG_BREAKS=\"espeak-dev\"\nTERMUX_PKG_REPLACES=\"espeak-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/*ng-test*\"\n# --without-async due to that using pthread_cancel().\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-async\"\n\ntermux_step_post_extract_package() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t./autogen.sh\n}\n\ntermux_step_host_build() {\n\tcp -Rf $TERMUX_PKG_SRCDIR/* .\n\tunset MAKEFLAGS\n\t./configure --prefix=$TERMUX_PREFIX\n\tmake -j$TERMUX_MAKE_PROCESSES src/{e,}speak-ng\n\n\t# Man pages require the ronn ruby program.\n\t#make src/espeak-ng.1\n\t#cp src/espeak-ng.1 $TERMUX_PREFIX/share/man/man1\n\t#(cd $TERMUX_PREFIX/share/man/man1 && ln -s -f espeak-ng.1 espeak.1)\n\n\tmake install\n}\n\ntermux_step_pre_configure() {\n\t# Oz flag causes problems. See https://github.com/termux/termux-packages/issues/1680:\n\tCFLAGS=${CFLAGS/Oz/Os}\n}\n\ntermux_step_make() {\n\t# Prevent caching of host build:\n\trm -Rf $TERMUX_PKG_HOSTBUILD_DIR\n\tmake -j$TERMUX_MAKE_PROCESSES src/{e,}speak-ng\n}\n\ntermux_step_make_install() {\n\trm $TERMUX_PREFIX/bin/{e,}speak{,-ng}\n\tcp src/.libs/espeak-ng $TERMUX_PREFIX/bin/espeak\n\tcp src/.libs/libespeak-ng.so $TERMUX_PREFIX/lib/libespeak-ng.so.1.1.49\n}\n"
  },
  {
    "path": "packages/espeak/compat-stdint.h.patch",
    "content": "diff -u -r ../espeak-ng-1.49.1/src/include/compat/stdint.h ./src/include/compat/stdint.h\n--- ../espeak-ng-1.49.1/src/include/compat/stdint.h\t2017-01-21 21:57:13.000000000 +0100\n+++ ./src/include/compat/stdint.h\t2017-02-01 00:28:46.687277703 +0100\n@@ -19,6 +19,8 @@\n #ifndef STDINT_H_COMPAT_SHIM\n #define STDINT_H_COMPAT_SHIM\n \n+#include \"config.h\"\n+\n #ifdef _MSC_VER\n \n #if _MSC_VER >= 1600 // Visual C++ 10 (Visual Studio 2010) and above...\n"
  },
  {
    "path": "packages/exa/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://the.exa.website\nTERMUX_PKG_DESCRIPTION=\"A modern replacement for ls\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.9.0\nTERMUX_PKG_SRCURL=https://github.com/ogham/exa/archive/058b4a57bdb1e25cbdacc0fbd1eefc09bc5f1e95.zip\nTERMUX_PKG_SHA256=9931ad1c593096e69a1f0f7615e3857b1d422b7e74f63408385c663aeb2c12db\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--no-default-features --features default\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\trm $TERMUX_PKG_SRCDIR/Makefile\n\ttermux_setup_rust\n\n\tCFLAGS=\"$CFLAGS $CPPFLAGS\"\n\tcargo update\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/contrib/man/exa.1 $TERMUX_PREFIX/share/man/man1/\n}\n"
  },
  {
    "path": "packages/exa/src-output-table.rs.patch",
    "content": "diff -u -r ../exa-57e4c08411f59e7db91fa7d8127fbd412667ea32/src/output/table.rs ./src/output/table.rs\n--- ../exa-57e4c08411f59e7db91fa7d8127fbd412667ea32/src/output/table.rs\t2018-10-14 15:21:13.000000000 +0000\n+++ ./src/output/table.rs\t2018-10-18 03:48:04.171402732 +0000\n@@ -246,6 +246,9 @@\n     }\n \n     pub fn load_all() -> Self {\n+        #[cfg(target_os = \"android\")]\n+        let tz = None;\n+        #[cfg(not(target_os = \"android\"))]\n         let tz = match determine_time_zone() {\n             Ok(t) => Some(t),\n             Err(ref e) => {\n"
  },
  {
    "path": "packages/exiftool/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.sno.phy.queensu.ca/~phil/exiftool/index.html\nTERMUX_PKG_DESCRIPTION=\"Utility for reading, writing and editing meta information in a wide variety of files.\"\nTERMUX_PKG_LICENSE=\"Artistic-License-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=11.78\nTERMUX_PKG_SRCURL=\"https://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-$TERMUX_PKG_VERSION.tar.gz\"\nTERMUX_PKG_SHA256=3c59931c617f892f8a18e8b57a3ce2eea49dbcce0cdc6d0a2713f1e8dff743a9\nTERMUX_PKG_DEPENDS=\"perl\"\n\ntermux_step_make_install() {\n\t# Change this after package 'perl' was upgraded.\n\tlocal current_perl_version=5.30.0\n\n\tinstall -Dm700 \"$TERMUX_PKG_SRCDIR\"/exiftool \"$TERMUX_PREFIX\"/bin/exiftool\n\tfind \"$TERMUX_PKG_SRCDIR\"/lib -name \"*.pod\" -delete\n\tmkdir -p \"$TERMUX_PREFIX/lib/perl5/site_perl/${current_perl_version}\"\n\trm -rf \"$TERMUX_PREFIX/lib/perl5/site_perl/${current_perl_version}\"/{Image,File}\n\tcp -a \"$TERMUX_PKG_SRCDIR\"/lib/{Image,File} \"$TERMUX_PREFIX/lib/perl5/site_perl/${current_perl_version}/\"\n}\n"
  },
  {
    "path": "packages/exiv2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://exiv2.org/\nTERMUX_PKG_DESCRIPTION=\"Exif, Iptc and XMP metadata manipulation library and tools\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.27.2\nTERMUX_PKG_SRCURL=https://github.com/Exiv2/exiv2/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3dbcaf01fbc5b98d42f091d1ff0d4b6cd9750dc724de3d9c0d113948570b2934\nTERMUX_PKG_DEPENDS=\"libandroid-support, libc++, libexpat, zlib\"\nTERMUX_PKG_BREAKS=\"exiv2-dev\"\nTERMUX_PKG_REPLACES=\"exiv2-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DEXIV2_ENABLE_VIDEO=ON\n-DEXIV2_ENABLE_BUILD_SAMPLES=OFF\"\n"
  },
  {
    "path": "packages/exiv2/exiv2json.cpp.patch",
    "content": "--- ../exiv2json.cpp.orig\t2019-05-31 21:32:41.319959442 +0200\n+++ ./samples/exiv2json.cpp\t2019-05-31 21:33:11.399959231 +0200\n@@ -236,7 +236,7 @@\n {\r\n     Jzon::Object& fs = (Jzon::Object&) nfs;\r\n     fs.Add(\"path\",path);\r\n-    char resolved_path[2000]; // PATH_MAX];\r\n+    char resolved_path[PATH_MAX];\r\n     fs.Add(\"realpath\",realpath(path,resolved_path));\r\n \r\n     struct stat buf;\r\n"
  },
  {
    "path": "packages/expect/Makefile.in.patch",
    "content": "diff -u -r ../expect5.45.3/Makefile.in ./Makefile.in\n--- ../expect5.45.3/Makefile.in\t2010-09-30 19:14:07.000000000 +0200\n+++ ./Makefile.in\t2017-11-22 13:59:45.609495604 +0100\n@@ -32,16 +32,14 @@\n # SCRIPTS is a target. If this is a problem, just comment out the\n # SCRIPTS target itself.\n \n-SCRIPTS = timed-run timed-read ftp-rfc autopasswd lpunlock weather \\\n-\tpassmass rftp kibitz rlogin-cwd xpstat tkpasswd dislocate xkibitz \\\n-\ttknewsbiff unbuffer mkpasswd cryptdir decryptdir autoexpect \\\n-\tmultixterm\n+SCRIPTS = timed-run timed-read \\\n+\tunbuffer autoexpect\n \n # A couple of the scripts have man pages of their own.\n # You can delete these too if you don't want'em.\n \n-SCRIPTS_MANPAGES = kibitz dislocate xkibitz tknewsbiff unbuffer mkpasswd \\\n-\tpassmass cryptdir decryptdir autoexpect multixterm\n+SCRIPTS_MANPAGES = unbuffer \\\n+\tautoexpect\n \n \n # allow us to handle null list gracefully, \"end_of_list\" should not exist\n@@ -380,7 +378,7 @@\n \tcp $(DIST_ROOT)/$(PKG_DIR).tar.gz $(top_builddir)\n \n $(SCRIPTS):\n-\t$(TCLSH) $(srcdir)/fixline1 $(SHORT_BINDIR) < $(srcdir)/example/$@ > $@\n+\tcp $(srcdir)/example/$@ $@\n \n ## We cannot use TCL_LIBS below (after TCL_LIB_SPEC) because its\n ## expansion references the contents of LIBS, which contains linker\n"
  },
  {
    "path": "packages/expect/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://core.tcl.tk/expect/index\nTERMUX_PKG_DESCRIPTION=\"Tool for automating interactive terminal applications\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_VERSION=5.45.4\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=49a7da83b0bdd9f46d04a04deec19c7767bb9a323e40c4781f89caf760b92c34\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/expect/Expect/${TERMUX_PKG_VERSION}/expect${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"tcl\"\nTERMUX_PKG_BREAKS=\"expect-dev\"\nTERMUX_PKG_REPLACES=\"expect-dev\"\n\ntermux_step_pre_configure() {\n\tautoconf\n}\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PREFIX/lib\n\tln -f -s expect${TERMUX_PKG_VERSION}/libexpect${TERMUX_PKG_VERSION}.so .\n}\n"
  },
  {
    "path": "packages/expect/configure.in.patch",
    "content": "diff -u -r ../expect5.45/configure.in ./configure.in\n--- ../expect5.45/configure.in\t2010-08-27 17:51:53.000000000 -0400\n+++ ./configure.in\t2016-04-18 00:23:36.618635535 -0400\n@@ -347,11 +347,7 @@\n fi\n \n AC_MSG_CHECKING([stty to use])\n-if test -r /usr/local/bin/stty ; then\n-  STTY_BIN=/usr/local/bin/stty\n-else\n-  STTY_BIN=/bin/stty\n-fi\n+STTY_BIN=@TERMUX_PREFIX@/bin/stty\n AC_MSG_RESULT($STTY_BIN)\n \n AC_MSG_CHECKING([if stty reads stdout])\n@@ -481,7 +477,7 @@\n ,\n \tAC_MSG_RESULT(no)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+\tAC_MSG_RESULT(no)\n )\n \n AC_MSG_CHECKING([if any value exists for WNOHANG])\n@@ -506,7 +502,8 @@\n \tAC_MSG_RESULT(no)\n \tAC_DEFINE(WNOHANG_BACKUP_VALUE, 1)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+\tAC_MSG_RESULT(yes)\n+\tAC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, 1)\n )\n \n #\n@@ -574,7 +571,8 @@\n \tAC_DEFINE(REARM_SIG)\n ,\n \tAC_MSG_RESULT(no)\n-, AC_MSG_WARN([Expect can't be cross compiled])\n+,\n+\tAC_MSG_RESULT(no)\n )\n \n # HPUX7 has trouble with the big cat so split it\n@@ -725,7 +723,7 @@\n ,\n         AC_MSG_RESULT(no)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+        AC_MSG_RESULT(no)\n )\n \n # mach systems have include files for unimplemented features\n@@ -749,7 +747,7 @@\n ,\n         AC_MSG_RESULT(no)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+        AC_MSG_RESULT(no)\n )\n \n   # now check for the new style ttys (not yet posix)\n@@ -771,7 +769,9 @@\n   ,\n         AC_MSG_RESULT(no)\n   ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+        AC_DEFINE(HAVE_TERMIOS)\n+        PTY_TYPE=termios\n+        AC_MSG_RESULT(yes)\n   )\n fi\n \n@@ -794,7 +794,8 @@\n ,\n \tAC_MSG_RESULT(no)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+\tAC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)\n+\tAC_MSG_RESULT(yes)\n )\n \n AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])\n@@ -816,7 +817,8 @@\n ,\n \tAC_MSG_RESULT(no)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+\tAC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)\n+\tAC_MSG_RESULT(yes)\n )\n \n # finally check for Cray style ttys\n@@ -837,7 +839,7 @@\n ,\n \tAC_MSG_RESULT(no)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+\tAC_MSG_RESULT(no)\n )\n \n #\n@@ -869,7 +871,9 @@\n AC_HAVE_FUNCS(getpty)\n \n # following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2\n-AC_FUNC_SETPGRP\n+cat >>confdefs.h <<\\_ACEOF\n+#define SETPGRP_VOID 1\n+_ACEOF\n \n #\n # check for timezones\n@@ -889,7 +893,7 @@\n \tAC_MSG_RESULT(yes),\n \tAC_MSG_RESULT(no)\n ,\n-\tAC_MSG_ERROR([Expect can't be cross compiled])\n+\tAC_MSG_RESULT(no)\n )\n \n \n"
  },
  {
    "path": "packages/fakeroot/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://packages.debian.org/fakeroot\nTERMUX_PKG_DESCRIPTION=\"Tool for simulating superuser privileges (with tcp ipc)\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.24\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://deb.debian.org/debian/pool/main/f/fakeroot/fakeroot_${TERMUX_PKG_VERSION}.orig.tar.gz\nTERMUX_PKG_SHA256=2e045b3160370b8ab4d44d1f8d267e5d1d555f1bb522d650e7167b09477266ed\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-ipc=tcp\"\nTERMUX_PKG_BUILD_DEPENDS=\"libcap\"\n\ntermux_step_post_make_install() {\n\tln -sfr \"${TERMUX_PREFIX}/lib/libfakeroot-0.so\" \"${TERMUX_PREFIX}/lib/libfakeroot.so\"\n}\n\ntermux_step_create_debscripts() {\n\t{\n\t\techo \"#!$TERMUX_PREFIX/bin/sh\"\n\t\techo \"echo\"\n\t\techo \"echo Fakeroot does not give you any real root permissions. Utility is primarily intended to be used for development purposes.\"\n\t\techo \"echo More info about usage at https://wiki.debian.org/FakeRoot.\"\n\t\techo \"echo\"\n\t\techo \"echo Programs requiring real root permissions will not run under fakeroot. Do not post bug reports about this.\"\n\t\techo \"echo\"\n\t} > ./postinst\n}\n"
  },
  {
    "path": "packages/fakeroot/fakeroot-1.23_faked.c.patch",
    "content": "diff -uNr fakeroot-1.23/faked.c fakeroot-1.23.mod/faked.c\n--- fakeroot-1.23/faked.c\t2018-07-01 22:01:34.000000000 +0300\n+++ fakeroot-1.23.mod/faked.c\t2018-10-01 17:31:45.172555748 +0300\n@@ -1487,7 +1487,7 @@\n     /* literally copied from the linux klogd code, go to background */\n     if ((pid=fork()) == 0){\n       int fl;\n-      int num_fds = getdtablesize();\n+      int num_fds = sysconf(_SC_OPEN_MAX);\n \n       fflush(stdout);\n \n"
  },
  {
    "path": "packages/fakeroot/fakeroot-1.23_libfakeroot.c.patch",
    "content": "diff -uNr fakeroot-1.23/libfakeroot.c fakeroot-1.23.mod/libfakeroot.c\n--- fakeroot-1.23/libfakeroot.c\t2018-07-01 22:01:34.000000000 +0300\n+++ fakeroot-1.23.mod/libfakeroot.c\t2018-10-01 17:31:45.175889099 +0300\n@@ -81,12 +81,14 @@\n #define SEND_STAT64(a,b,c) send_stat64(a,b,c)\n #define SEND_GET_STAT(a,b) send_get_stat(a,b)\n #define SEND_GET_STAT64(a,b) send_get_stat64(a,b)\n+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b,c)\n #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b,c)\n #else\n #define SEND_STAT(a,b,c) send_stat(a,b)\n #define SEND_STAT64(a,b,c) send_stat64(a,b)\n #define SEND_GET_STAT(a,b) send_get_stat(a)\n #define SEND_GET_STAT64(a,b) send_get_stat64(a)\n+#define SEND_GET_XATTR(a,b,c) send_get_xattr(a,b)\n #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b)\n #endif\n \n"
  },
  {
    "path": "packages/fakeroot/fakeroot-1.23_scripts_fakeroot.in.patch",
    "content": "diff -uNr fakeroot-1.23/scripts/fakeroot.in fakeroot-1.23.mod/scripts/fakeroot.in\n--- fakeroot-1.23/scripts/fakeroot.in\t2018-07-01 22:01:34.000000000 +0300\n+++ fakeroot-1.23.mod/scripts/fakeroot.in\t2018-10-01 17:32:47.566222406 +0300\n@@ -145,8 +145,8 @@\n if [ \"$WAITINTRAP\" -eq 0 ]; then\n   trap \"kill -s @signal@ $PID\" EXIT INT\n else\n-  @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\n-  @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\n+  @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\n+  @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\n fi\n \n if test -z \"$FAKEROOTKEY\" || test -z \"$PID\"; then\n@@ -168,8 +168,8 @@\n export FAKEROOT_FD_BASE\n \n if test -z \"$*\"; then\n-  @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@=\"$PATHS\" @LDEXTRAVAR@ @LDPRELOADVAR@=\"$LIB\" ${SHELL:-/bin/sh}\n-  @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@=\"$LIB\" ${SHELL:-/bin/sh}\n+  @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@=\"$PATHS\" @LDEXTRAVAR@ @LDPRELOADVAR@=\"$LIB\" ${SHELL:-@TERMUX_PREFIX@/bin/sh}\n+  @MACOSX_TRUE@FAKEROOTKEY=$FAKEROOTKEY @LDEXTRAVAR@ @LDPRELOADVAR@=\"$LIB\" ${SHELL:-@TERMUX_PREFIX@/bin/sh}\n   RESULT=$?\n else\n   @MACOSX_FALSE@FAKEROOTKEY=$FAKEROOTKEY @LDLIBPATHVAR@=\"$PATHS\" @LDEXTRAVAR@ @LDPRELOADVAR@=\"$LIB\" \"$@\"\n"
  },
  {
    "path": "packages/fasd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/clvv/fasd\nTERMUX_PKG_DESCRIPTION=\"To fastly access files and folders\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.0.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/clvv/fasd/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=88efdfbbed8df408699a14fa6c567450bf86480f5ff3dde42d0b3e1dee731f65\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/fastmod/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/facebookincubator/fastmod\nTERMUX_PKG_DESCRIPTION=\"Regex-based code refactoring utility\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.3.0\nTERMUX_PKG_SRCURL=https://github.com/facebookincubator/fastmod/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=95925c73d06f6bd9ea9a6ca66c847e9722fe7bff5c8c3ee9a3245a37f630dfc0\nTERMUX_PKG_BUILD_IN_SRC=true"
  },
  {
    "path": "packages/fastmod/vi-as-default-editor.patch",
    "content": "diff -uNr fastmod-0.2.6/src/main.rs fastmod-0.2.6.mod/src/main.rs\n--- fastmod-0.2.6/src/main.rs\t2019-07-25 02:38:07.000000000 +0300\n+++ fastmod-0.2.6.mod/src/main.rs\t2019-09-26 17:24:36.272089773 +0300\n@@ -80,7 +80,7 @@\n }\n \n fn run_editor(path: &Path, start_line: usize) -> Result<()> {\n-    let editor = env::var(\"EDITOR\").unwrap_or_else(|_| String::from(\"vim\"));\n+    let editor = env::var(\"EDITOR\").unwrap_or_else(|_| String::from(\"vi\"));\n     let args: Vec<&str> = editor.split(' ').collect();\n     let mut editor_cmd = {\n         let mut cmd = Command::new(args[0])"
  },
  {
    "path": "packages/fbless/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://pybookreader.narod.ru/misc.html\nTERMUX_PKG_DESCRIPTION=\"Console FictionBook reader\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.2.3\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://deb.debian.org/debian/pool/main/f/fbless/fbless_${TERMUX_PKG_VERSION}.orig.tar.gz\nTERMUX_PKG_SHA256=68ae914d141da913ed6ff1805a1739346c33756b64a9407c14e95e278452c362\nTERMUX_PKG_DEPENDS=\"ncurses, python2\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\texport PYTHONPATH=\"$TERMUX_PREFIX/lib/python2.7/site-packages/\"\n\tpython2.7 setup.py install --prefix=\"$TERMUX_PREFIX\" --force\n}\n"
  },
  {
    "path": "packages/fcgi/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.fastcgi.com/\nTERMUX_PKG_DESCRIPTION=\"A language independent, high performant extension to CGI\"\nTERMUX_PKG_LICENSE=\"custom\"\nTERMUX_PKG_LICENSE_FILE=\"LICENSE.TERMS\"\nTERMUX_PKG_VERSION=2.4.2\nTERMUX_PKG_SRCURL=https://github.com/FastCGI-Archives/fcgi2/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=1fe83501edfc3a7ec96bb1e69db3fd5ea1730135bd73ab152186fd0b437013bc\nTERMUX_PKG_BREAKS=\"fcgi-dev\"\nTERMUX_PKG_REPLACES=\"fcgi-dev\"\n\ntermux_step_pre_configure() {\n\tlibtoolize --automake --copy --force\n\taclocal\n\tautoheader\n\tautomake --add-missing --force-missing --copy\n\tautoconf\n\texport LIBS=\"-lm\"\n}\n"
  },
  {
    "path": "packages/fcgiwrap/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://nginx.localdomain.pl/wiki/FcgiWrap\nTERMUX_PKG_DESCRIPTION=\"A simple server for running CGI applications over FastCGI\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.1.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/gnosek/fcgiwrap/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=4c7de0db2634c38297d5fcef61ab4a3e21856dd7247d49c33d9b19542bd1c61f\nTERMUX_PKG_DEPENDS=\"fcgi\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=/share/man\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -Wno-error=implicit-fallthrough\"\n\tautoreconf -i\n}"
  },
  {
    "path": "packages/fcgiwrap/fix-kill-parameters.patch",
    "content": "From dc0c3b14f0d7bb014a9a4c6c17eb55a123496365 Mon Sep 17 00:00:00 2001\nFrom: \"D.pz\" <xpz91@126.me>\nDate: Mon, 28 Aug 2017 23:54:08 +0800\nSubject: [PATCH] 1.fix: kill() parameter sequence wrong\n\n---\n fcgiwrap.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/fcgiwrap.c b/fcgiwrap.c\nindex b44d8aa..bfd9a90 100644\n--- a/fcgiwrap.c\n+++ b/fcgiwrap.c\n@@ -205,7 +205,7 @@ static void fcgi_finish(struct fcgi_context *fc, const char* msg)\n \tif (fc->fd_stderr >= 0) close(fc->fd_stderr);\n \n \tif (fc->cgi_pid)\n-\t\tkill(SIGTERM, fc->cgi_pid);\n+\t\tkill(fc->cgi_pid, SIGTERM);\n }\n \n static const char * fcgi_pass_fd(struct fcgi_context *fc, int *fdp, FCGI_FILE *ffp, char *buf, size_t bufsize)\n"
  },
  {
    "path": "packages/fd/Cargo.toml.patch",
    "content": "diff -u -r ../fd-7.4.0/Cargo.toml ./Cargo.toml\n--- ../fd-7.4.0/Cargo.toml\t2019-09-15 17:29:15.000000000 +0000\n+++ ./Cargo.toml\t2019-09-17 19:37:35.384516258 +0000\n@@ -52,9 +52,6 @@\n [target.'cfg(all(unix, not(target_os = \"redox\")))'.dependencies]\n libc = \"0.2\"\n \n-[target.'cfg(all(not(windows), not(target_env = \"musl\")))'.dependencies]\n-jemallocator = \"0.3.0\"\n-\n [dev-dependencies]\n diff = \"0.1\"\n tempdir = \"0.3\"\n"
  },
  {
    "path": "packages/fd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/fd\nTERMUX_PKG_DESCRIPTION=\"Simple, fast and user-friendly alternative to find\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=7.4.0\nTERMUX_PKG_SHA256=33570ba65e7f8b438746cb92bb9bc4a6030b482a0d50db37c830c4e315877537\nTERMUX_PKG_SRCURL=https://github.com/sharkdp/fd/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_make_install() {\n\tmkdir -p  $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/doc/fd.1 $TERMUX_PREFIX/share/man/man1/fd.1\n}\n"
  },
  {
    "path": "packages/fd/src-main.rs.patch",
    "content": "diff -u -r ../fd-7.4.0/src/main.rs ./src/main.rs\n--- ../fd-7.4.0/src/main.rs\t2019-09-15 17:29:15.000000000 +0000\n+++ ./src/main.rs\t2019-09-17 19:37:47.620364849 +0000\n@@ -35,11 +35,6 @@\n     pattern_has_uppercase_char, transform_args_with_exec, FileTypes,\n };\n \n-// We use jemalloc for performance reasons, see https://github.com/sharkdp/fd/pull/481\n-#[cfg(all(not(windows), not(target_env = \"musl\")))]\n-#[global_allocator]\n-static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;\n-\n fn main() {\n     let checked_args = transform_args_with_exec(env::args_os());\n     let matches = app::build_app().get_matches_from(checked_args);\n"
  },
  {
    "path": "packages/fdupes/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/adrianlopezroche/fdupes\nTERMUX_PKG_DESCRIPTION=\"Duplicates file detector\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.6.1\nTERMUX_PKG_SRCURL=https://github.com/adrianlopezroche/fdupes/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=9d6b6fdb0b8419815b4df3bdfd0aebc135b8276c90bbbe78ebe6af0b88ba49ea\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n    sed -i \"s,PREFIX = /usr/local,PREFIX = ${TERMUX_PREFIX},\" \"$TERMUX_PKG_SRCDIR/Makefile\"\n}\n\n"
  },
  {
    "path": "packages/ffmpeg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ffmpeg.org\nTERMUX_PKG_DESCRIPTION=\"Tools and libraries to manipulate a wide range of multimedia formats and protocols\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\n# NOTE: mpv has to be rebuilt and version bumped after updating ffmpeg.\nTERMUX_PKG_VERSION=4.2.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://www.ffmpeg.org/releases/ffmpeg-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=cec7c87e9b60d174509e263ac4011b522385fd0775292e1670ecc1180c9bb6d4\nTERMUX_PKG_DEPENDS=\"libass, libbz2, libdav1d, libiconv, libsoxr, libx264, libx265, xvidcore, libvorbis, libmp3lame, libopus, libvpx, libgnutls, libandroid-glob, freetype, zlib, liblzma\"\nTERMUX_PKG_CONFLICTS=\"libav\"\nTERMUX_PKG_BREAKS=\"ffmpeg-dev\"\nTERMUX_PKG_REPLACES=\"ffmpeg-dev\"\n\ntermux_step_configure() {\n\tcd $TERMUX_PKG_BUILDDIR\n\n\texport ASFLAGS=\"-no-integrated-as\"\n\n\tlocal _EXTRA_CONFIGURE_FLAGS=\"\"\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\t_ARCH=\"armeabi-v7a\"\n\t\t_EXTRA_CONFIGURE_FLAGS=\"--enable-neon\"\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\t_ARCH=\"x86\"\n\t\t# Specify --disable-asm to prevent text relocations on i686,\n\t\t# see https://trac.ffmpeg.org/ticket/4928\n\t\t_EXTRA_CONFIGURE_FLAGS=\"--disable-asm\"\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\t_ARCH=\"x86_64\"\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\t_ARCH=$TERMUX_ARCH\n\t\t_EXTRA_CONFIGURE_FLAGS=\"--enable-neon\"\n\telse\n\t\ttermux_error_exit \"Unsupported arch: $TERMUX_ARCH\"\n\tfi\n\n\t$TERMUX_PKG_SRCDIR/configure \\\n\t\t--arch=${_ARCH} \\\n\t\t--as=$AS \\\n\t\t--cc=$CC \\\n\t\t--cxx=$CXX \\\n\t\t--cross-prefix=${TERMUX_HOST_PLATFORM}- \\\n\t\t--disable-indevs \\\n\t\t--disable-outdevs \\\n\t\t--enable-indev=lavfi \\\n\t\t--disable-static \\\n\t\t--disable-symver \\\n\t\t--enable-cross-compile \\\n\t\t--enable-gnutls \\\n\t\t--enable-gpl \\\n\t\t--enable-libass \\\n\t\t--enable-libdav1d \\\n\t\t--enable-libmp3lame \\\n\t\t--enable-libfreetype \\\n\t\t--enable-libvorbis \\\n\t\t--enable-libopus \\\n\t\t--enable-libx264 \\\n\t\t--enable-libx265 \\\n\t\t--enable-libxvid \\\n\t\t--enable-libvpx \\\n\t\t--enable-shared \\\n\t\t--enable-libsoxr \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--target-os=android \\\n\t\t--extra-libs=\"-landroid-glob\" \\\n\t\t$_EXTRA_CONFIGURE_FLAGS\n}\n\n"
  },
  {
    "path": "packages/ffmpeg/libavutil-file_open.c.patch",
    "content": "diff -uNr ffmpeg-4.1.1/libavutil/file_open.c ffmpeg-4.1.1.mod/libavutil/file_open.c\n--- ffmpeg-4.1.1/libavutil/file_open.c\t2019-02-09 22:56:02.000000000 +0200\n+++ ffmpeg-4.1.1.mod/libavutil/file_open.c\t2019-03-02 01:54:58.775236751 +0200\n@@ -119,7 +119,7 @@\n #undef free\n     free(ptr);\n #else\n-    size_t len = strlen(prefix) + 12; /* room for \"/tmp/\" and \"XXXXXX\\0\" */\n+    size_t len = strlen(prefix) + strlen(\"@TERMUX_PREFIX@/tmp/\") + 7; /* room for \"@TERMUX_PREFIX@/tmp/\" and \"XXXXXX\\0\" */\n     *filename  = av_malloc(len);\n #endif\n     /* -----common section-----*/\n@@ -136,7 +136,7 @@\n #   endif\n     fd = open(*filename, O_RDWR | O_BINARY | O_CREAT | O_EXCL, 0600);\n #else\n-    snprintf(*filename, len, \"/tmp/%sXXXXXX\", prefix);\n+    snprintf(*filename, len, \"@TERMUX_PREFIX@/tmp/%sXXXXXX\", prefix);\n     fd = mkstemp(*filename);\n #if defined(_WIN32) || defined (__ANDROID__)\n     if (fd < 0) {\n"
  },
  {
    "path": "packages/ffsend/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gitlab.com/timvisee/ffsend\nTERMUX_PKG_DESCRIPTION=\"A fully featured Firefox Send client\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.2.57\nTERMUX_PKG_SRCURL=https://gitlab.com/timvisee/ffsend/-/archive/v$TERMUX_PKG_VERSION/ffsend-v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=2bae90e4801495b5f366c0696f61cc70aa6c7ce8e6a8aa1e22dfb456c384e9e3\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--no-default-features --features send2,send3,history,archive,qrcode,urlshorten,infer-command\"\n"
  },
  {
    "path": "packages/fftw/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.fftw.org/\nTERMUX_PKG_DESCRIPTION=\"Library for computing the Discrete Fourier Transform (DFT) in one or more dimensions\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.3.8\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303\nTERMUX_PKG_BREAKS=\"fftw-dev\"\nTERMUX_PKG_REPLACES=\"fftw-dev\"\nTERMUX_PKG_SRCURL=http://www.fftw.org/fftw-${TERMUX_PKG_VERSION}.tar.gz\n# ac_cv_func_clock_gettime=no avoids having clock_gettime(CLOCK_SGI_CYCLE, &t)\n# being used. It's not supported on Android but fails at runtime and, fftw\n# does not check the return value so gets bogus values.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-threads ac_cv_func_clock_gettime=no\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"include/fftw*.f*\"\n\ntermux_step_post_make_install() {\n\tlocal COMMON_ARGS=\"$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\"\n\tlocal feature\n\tfor feature in float long-double; do\n\t\tmake clean\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"$COMMON_ARGS --enable-$feature\"\n\t\trm -Rf $TERMUX_PKG_TMPDIR/config-scripts\n\t\ttermux_step_configure\n\t\tmake -j $TERMUX_MAKE_PROCESSES install\n\tdone\n}\n"
  },
  {
    "path": "packages/fftw/fix-wisdom_dir.patch",
    "content": "diff -uNr fftw-3.3.6-pl1/api/import-system-wisdom.c fftw-3.3.6-pl1.mod/api/import-system-wisdom.c\n--- fftw-3.3.6-pl1/api/import-system-wisdom.c\t2017-01-15 14:03:24.000000000 +0200\n+++ fftw-3.3.6-pl1.mod/api/import-system-wisdom.c\t2017-09-12 11:20:08.432992283 +0300\n@@ -32,7 +32,7 @@\n #if defined(__DJGPP__)\n #  define WISDOM_DIR \"/dev/env/DJDIR/etc/fftw/\"\n #else\n-#  define WISDOM_DIR \"/etc/fftw/\"\n+#  define WISDOM_DIR \"@TERMUX_PREFIX@/etc/fftw/\"\n #endif\n \n int X(import_system_wisdom)(void)\n"
  },
  {
    "path": "packages/figlet/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.figlet.org/\nTERMUX_PKG_DESCRIPTION=\"Program for making large letters out of ordinary text\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=2.2.5\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=bf88c40fd0f077dab2712f54f8d39ac952e4e9f2e1882f1195be9e5e4257417d\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tLD=$CC\n}\n"
  },
  {
    "path": "packages/figlet/figlet.c.patch",
    "content": "diff -u -r ../figlet-2.2.5/figlet.c ./figlet.c\n--- ../figlet-2.2.5/figlet.c\t2012-06-01 14:51:09.000000000 +0200\n+++ ./figlet.c\t2014-08-02 09:58:04.931697896 +0200\n@@ -69,6 +69,7 @@\n #ifdef unix\n #include <unistd.h>\n #include <sys/ioctl.h> /* Needed for get_columns */\n+#include <termios.h> /* Needed for struct winsize */\n #endif\n \n #ifdef TLF_FONTS\n"
  },
  {
    "path": "packages/figlet/makefile.patch",
    "content": "diff -u -r ../figlet-2.2.5/Makefile ./Makefile\n--- ../figlet-2.2.5/Makefile\t2012-06-01 14:51:09.000000000 +0200\n+++ ./Makefile\t2014-08-03 02:25:17.846078638 +0200\n@@ -18,24 +18,18 @@\n # for changing this is if sh is not in the same place.\n SHELL = /bin/sh\n \n-# The C compiler and linker to use\n-CC\t= gcc\n-CFLAGS\t= -g -O2 -Wall\n-LD\t= gcc\n-LDFLAGS =\n-\n # Feature flags:\n #   define TLF_FONTS to use TOIlet TLF fonts\n XCFLAGS\t= -DTLF_FONTS\n \n # Where to install files\n-prefix\t= /usr/local\n+prefix\t= @TERMUX_PREFIX@\n \n # Where the executables should be put\n BINDIR\t= $(prefix)/bin\n \n # Where the man page should be put\n-MANDIR\t= $(prefix)/man\n+MANDIR\t= $(prefix)/share/man\n \n # Where figlet will search first for fonts (the \".flf\" files).\n DEFAULTFONTDIR = $(prefix)/share/figlet\n"
  },
  {
    "path": "packages/file/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://darwinsys.com/file/\nTERMUX_PKG_DESCRIPTION=\"Command-line tool that tells you in words what kind of data a file contains\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=5.37\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=ftp://ftp.astron.com/pub/file/file-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e9c13967f7dd339a3c241b7710ba093560b9a33013491318e88e6b8b57bae07f\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_BREAKS=\"file-dev\"\nTERMUX_PKG_REPLACES=\"file-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_func_mmap_fixed_mapped=yes\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"FILE_COMPILE=$TERMUX_PKG_HOSTBUILD_DIR/src/file\"\nTERMUX_PKG_HOSTBUILD=true\n"
  },
  {
    "path": "packages/file/fix-paths.patch",
    "content": "diff -uNr file-5.35/src/compress.c file-5.35.mod/src/compress.c\n--- file-5.35/src/compress.c\t2018-10-15 19:29:16.000000000 +0300\n+++ file-5.35.mod/src/compress.c\t2019-03-02 01:49:14.754069208 +0200\n@@ -410,7 +410,7 @@\n \tssize_t r;\n \tint tfd;\n \n-\t(void)strlcpy(buf, \"/tmp/file.XXXXXX\", sizeof buf);\n+\t(void)strlcpy(buf, \"@TERMUX_PREFIX@/tmp/file.XXXXXX\", sizeof buf);\n #ifndef HAVE_MKSTEMP\n \t{\n \t\tchar *ptr = mktemp(buf);\ndiff -uNr file-5.35/src/file.h file-5.35.mod/src/file.h\n--- file-5.35/src/file.h\t2018-10-15 19:29:16.000000000 +0300\n+++ file-5.35.mod/src/file.h\t2019-03-02 01:49:41.984157713 +0200\n@@ -79,7 +79,7 @@\n #define ENABLE_CONDITIONALS\n \n #ifndef MAGIC\n-#define MAGIC \"/etc/magic\"\n+#define MAGIC \"@TERMUX_PREFIX@/etc/magic\"\n #endif\n \n #if defined(__EMX__) || defined (WIN32)\n"
  },
  {
    "path": "packages/finch/arpa/nameser.h",
    "content": "/*\t$NetBSD: nameser.h,v 1.19 2005/12/26 19:01:47 perry Exp $\t*/\n\n/*\n * Copyright (c) 1983, 1989, 1993\n *    The Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/*\n * Copyright (c) 2004 by Internet Systems Consortium, Inc. (\"ISC\")\n * Copyright (c) 1996-1999 by Internet Software Consortium.\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND ISC DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\n *\tId: nameser.h,v 1.2.2.4.4.1 2004/03/09 08:33:30 marka Exp\n */\n\n/*\n * This version of this file is derived from Android 2.3 \"Gingerbread\",\n * which contains uncredited changes by Android/Google developers.  It has\n * been modified in 2011 for use in the Android build of Mozilla Firefox by\n * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>,\n * and Steve Workman <sjhworkman@gmail.com>).\n * These changes are offered under the same license as the original NetBSD\n * file, whose copyright and license are unchanged above.\n */\n\n#ifndef _ARPA_NAMESER_H_\n#define _ARPA_NAMESER_H_\n\n#define BIND_4_COMPAT\n\n#include <sys/types.h>\n#include <sys/cdefs.h>\n\n/*\n * Revision information.  This is the release date in YYYYMMDD format.\n * It can change every day so the right thing to do with it is use it\n * in preprocessor commands such as \"#if (__NAMESER > 19931104)\".  Do not\n * compare for equality; rather, use it to determine whether your libbind.a\n * contains a new enough lib/nameser/ to support the feature you need.\n */\n\n#define __NAMESER\t19991006\t/* New interface version stamp. */\n\n/*\n * Define constants based on RFC 883, RFC 1034, RFC 1035\n */\n#define NS_PACKETSZ\t512\t/* default UDP packet size */\n#define NS_MAXDNAME\t1025\t/* maximum domain name */\n#define NS_MAXMSG\t65535\t/* maximum message size */\n#define NS_MAXCDNAME\t255\t/* maximum compressed domain name */\n#define NS_MAXLABEL\t63\t/* maximum length of domain label */\n#define NS_HFIXEDSZ\t12\t/* #/bytes of fixed data in header */\n#define NS_QFIXEDSZ\t4\t/* #/bytes of fixed data in query */\n#define NS_RRFIXEDSZ\t10\t/* #/bytes of fixed data in r record */\n#define NS_INT32SZ\t4\t/* #/bytes of data in a uint32_t */\n#define NS_INT16SZ\t2\t/* #/bytes of data in a uint16_t */\n#define NS_INT8SZ\t1\t/* #/bytes of data in a uint8_t */\n#define NS_INADDRSZ\t4\t/* IPv4 T_A */\n#define NS_IN6ADDRSZ\t16\t/* IPv6 T_AAAA */\n#define NS_CMPRSFLGS\t0xc0\t/* Flag bits indicating name compression. */\n#define NS_DEFAULTPORT\t53\t/* For both TCP and UDP. */\n\n/*\n * These can be expanded with synonyms, just keep ns_parse.c:ns_parserecord()\n * in synch with it.\n */\ntypedef enum __ns_sect {\n\tns_s_qd = 0,\t\t/* Query: Question. */\n\tns_s_zn = 0,\t\t/* Update: Zone. */\n\tns_s_an = 1,\t\t/* Query: Answer. */\n\tns_s_pr = 1,\t\t/* Update: Prerequisites. */\n\tns_s_ns = 2,\t\t/* Query: Name servers. */\n\tns_s_ud = 2,\t\t/* Update: Update. */\n\tns_s_ar = 3,\t\t/* Query|Update: Additional records. */\n\tns_s_max = 4\n} ns_sect;\n\n/*\n * This is a message handle.  It is caller allocated and has no dynamic data.\n * This structure is intended to be opaque to all but ns_parse.c, thus the\n * leading _'s on the member names.  Use the accessor functions, not the _'s.\n */\ntypedef struct __ns_msg {\n\tconst u_char\t*_msg, *_eom;\n\tuint16_t\t_id, _flags, _counts[ns_s_max];\n\tconst u_char\t*_sections[ns_s_max];\n\tns_sect\t\t_sect;\n\tint\t\t_rrnum;\n\tconst u_char\t*_msg_ptr;\n} ns_msg;\n\n/* Private data structure - do not use from outside library. */\nstruct _ns_flagdata {  int mask, shift;  };\nextern const struct _ns_flagdata _ns_flagdata[];\n\n/* Accessor macros - this is part of the public interface. */\n\n#define ns_msg_id(handle) ((handle)._id + 0)\n#define ns_msg_base(handle) ((handle)._msg + 0)\n#define ns_msg_end(handle) ((handle)._eom + 0)\n#define ns_msg_size(handle) ((size_t)((handle)._eom - (handle)._msg))\n#define ns_msg_count(handle, section) ((handle)._counts[section] + 0)\n\n/*\n * This is a parsed record.  It is caller allocated and has no dynamic data.\n */\ntypedef\tstruct __ns_rr {\n\tchar\t\tname[NS_MAXDNAME];\n\tuint16_t\ttype;\n\tuint16_t\trr_class;\n\tuint32_t\tttl;\n\tuint16_t\trdlength;\n\tconst u_char *\trdata;\n} ns_rr;\n\n/* Accessor macros - this is part of the public interface. */\n#define ns_rr_name(rr)\t(((rr).name[0] != '\\0') ? (rr).name : \".\")\n#define ns_rr_type(rr)\t((ns_type)((rr).type + 0))\n#define ns_rr_class(rr)\t((ns_class)((rr).rr_class + 0))\n#define ns_rr_ttl(rr)\t((u_long)(rr).ttl + 0)\n#define ns_rr_rdlen(rr)\t((size_t)(rr).rdlength + 0)\n#define ns_rr_rdata(rr)\t((rr).rdata + 0)\n\n/*\n * These don't have to be in the same order as in the packet flags word,\n * and they can even overlap in some cases, but they will need to be kept\n * in synch with ns_parse.c:ns_flagdata[].\n */\ntypedef enum __ns_flag {\n\tns_f_qr,\t\t/* Question/Response. */\n\tns_f_opcode,\t\t/* Operation code. */\n\tns_f_aa,\t\t/* Authoritative Answer. */\n\tns_f_tc,\t\t/* Truncation occurred. */\n\tns_f_rd,\t\t/* Recursion Desired. */\n\tns_f_ra,\t\t/* Recursion Available. */\n\tns_f_z,\t\t\t/* MBZ. */\n\tns_f_ad,\t\t/* Authentic Data (DNSSEC). */\n\tns_f_cd,\t\t/* Checking Disabled (DNSSEC). */\n\tns_f_rcode,\t\t/* Response code. */\n\tns_f_max\n} ns_flag;\n\n/*\n * Currently defined opcodes.\n */\ntypedef enum __ns_opcode {\n\tns_o_query = 0,\t\t/* Standard query. */\n\tns_o_iquery = 1,\t/* Inverse query (deprecated/unsupported). */\n\tns_o_status = 2,\t/* Name server status query (unsupported). */\n\t\t\t\t/* Opcode 3 is undefined/reserved. */\n\tns_o_notify = 4,\t/* Zone change notification. */\n\tns_o_update = 5,\t/* Zone update message. */\n\tns_o_max = 6\n} ns_opcode;\n\n/*\n * Currently defined response codes.\n */\ntypedef\tenum __ns_rcode {\n\tns_r_noerror = 0,\t/* No error occurred. */\n\tns_r_formerr = 1,\t/* Format error. */\n\tns_r_servfail = 2,\t/* Server failure. */\n\tns_r_nxdomain = 3,\t/* Name error. */\n\tns_r_notimpl = 4,\t/* Unimplemented. */\n\tns_r_refused = 5,\t/* Operation refused. */\n\t/* these are for BIND_UPDATE */\n\tns_r_yxdomain = 6,\t/* Name exists */\n\tns_r_yxrrset = 7,\t/* RRset exists */\n\tns_r_nxrrset = 8,\t/* RRset does not exist */\n\tns_r_notauth = 9,\t/* Not authoritative for zone */\n\tns_r_notzone = 10,\t/* Zone of record different from zone section */\n\tns_r_max = 11,\n\t/* The following are EDNS extended rcodes */\n\tns_r_badvers = 16,\n\t/* The following are TSIG errors */\n\tns_r_badsig = 16,\n\tns_r_badkey = 17,\n\tns_r_badtime = 18\n} ns_rcode;\n\n/* BIND_UPDATE */\ntypedef enum __ns_update_operation {\n\tns_uop_delete = 0,\n\tns_uop_add = 1,\n\tns_uop_max = 2\n} ns_update_operation;\n\n/*\n * This structure is used for TSIG authenticated messages\n */\nstruct ns_tsig_key {\n        char name[NS_MAXDNAME], alg[NS_MAXDNAME];\n        unsigned char *data;\n        int len;\n};\ntypedef struct ns_tsig_key ns_tsig_key;\n\n/*\n * This structure is used for TSIG authenticated TCP messages\n */\nstruct ns_tcp_tsig_state {\n\tint counter;\n\tstruct dst_key *key;\n\tvoid *ctx;\n\tunsigned char sig[NS_PACKETSZ];\n\tint siglen;\n};\ntypedef struct ns_tcp_tsig_state ns_tcp_tsig_state;\n\n#define NS_TSIG_FUDGE 300\n#define NS_TSIG_TCP_COUNT 100\n#define NS_TSIG_ALG_HMAC_MD5 \"HMAC-MD5.SIG-ALG.REG.INT\"\n\n#define NS_TSIG_ERROR_NO_TSIG -10\n#define NS_TSIG_ERROR_NO_SPACE -11\n#define NS_TSIG_ERROR_FORMERR -12\n\n/*\n * Currently defined type values for resources and queries.\n */\ntypedef enum __ns_type {\n\tns_t_invalid = 0,\t/* Cookie. */\n\tns_t_a = 1,\t\t/* Host address. */\n\tns_t_ns = 2,\t\t/* Authoritative server. */\n\tns_t_md = 3,\t\t/* Mail destination. */\n\tns_t_mf = 4,\t\t/* Mail forwarder. */\n\tns_t_cname = 5,\t\t/* Canonical name. */\n\tns_t_soa = 6,\t\t/* Start of authority zone. */\n\tns_t_mb = 7,\t\t/* Mailbox domain name. */\n\tns_t_mg = 8,\t\t/* Mail group member. */\n\tns_t_mr = 9,\t\t/* Mail rename name. */\n\tns_t_null = 10,\t\t/* Null resource record. */\n\tns_t_wks = 11,\t\t/* Well known service. */\n\tns_t_ptr = 12,\t\t/* Domain name pointer. */\n\tns_t_hinfo = 13,\t/* Host information. */\n\tns_t_minfo = 14,\t/* Mailbox information. */\n\tns_t_mx = 15,\t\t/* Mail routing information. */\n\tns_t_txt = 16,\t\t/* Text strings. */\n\tns_t_rp = 17,\t\t/* Responsible person. */\n\tns_t_afsdb = 18,\t/* AFS cell database. */\n\tns_t_x25 = 19,\t\t/* X_25 calling address. */\n\tns_t_isdn = 20,\t\t/* ISDN calling address. */\n\tns_t_rt = 21,\t\t/* Router. */\n\tns_t_nsap = 22,\t\t/* NSAP address. */\n\tns_t_nsap_ptr = 23,\t/* Reverse NSAP lookup (deprecated). */\n\tns_t_sig = 24,\t\t/* Security signature. */\n\tns_t_key = 25,\t\t/* Security key. */\n\tns_t_px = 26,\t\t/* X.400 mail mapping. */\n\tns_t_gpos = 27,\t\t/* Geographical position (withdrawn). */\n\tns_t_aaaa = 28,\t\t/* Ip6 Address. */\n\tns_t_loc = 29,\t\t/* Location Information. */\n\tns_t_nxt = 30,\t\t/* Next domain (security). */\n\tns_t_eid = 31,\t\t/* Endpoint identifier. */\n\tns_t_nimloc = 32,\t/* Nimrod Locator. */\n\tns_t_srv = 33,\t\t/* Server Selection. */\n\tns_t_atma = 34,\t\t/* ATM Address */\n\tns_t_naptr = 35,\t/* Naming Authority PoinTeR */\n\tns_t_kx = 36,\t\t/* Key Exchange */\n\tns_t_cert = 37,\t\t/* Certification record */\n\tns_t_a6 = 38,\t\t/* IPv6 address (deprecates AAAA) */\n\tns_t_dname = 39,\t/* Non-terminal DNAME (for IPv6) */\n\tns_t_sink = 40,\t\t/* Kitchen sink (experimentatl) */\n\tns_t_opt = 41,\t\t/* EDNS0 option (meta-RR) */\n\tns_t_apl = 42,\t\t/* Address prefix list (RFC 3123) */\n\tns_t_tkey = 249,\t/* Transaction key */\n\tns_t_tsig = 250,\t/* Transaction signature. */\n\tns_t_ixfr = 251,\t/* Incremental zone transfer. */\n\tns_t_axfr = 252,\t/* Transfer zone of authority. */\n\tns_t_mailb = 253,\t/* Transfer mailbox records. */\n\tns_t_maila = 254,\t/* Transfer mail agent records. */\n\tns_t_any = 255,\t\t/* Wildcard match. */\n\tns_t_zxfr = 256,\t/* BIND-specific, nonstandard. */\n\tns_t_max = 65536\n} ns_type;\n\n/* Exclusively a QTYPE? (not also an RTYPE) */\n#define\tns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || \\\n\t\t      (t) == ns_t_mailb || (t) == ns_t_maila)\n/* Some kind of meta-RR? (not a QTYPE, but also not an RTYPE) */\n#define\tns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)\n/* Exclusively an RTYPE? (not also a QTYPE or a meta-RR) */\n#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))\n#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)\n#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || \\\n\t\t       (t) == ns_t_zxfr)\n\n/*\n * Values for class field\n */\ntypedef enum __ns_class {\n\tns_c_invalid = 0,\t/* Cookie. */\n\tns_c_in = 1,\t\t/* Internet. */\n\tns_c_2 = 2,\t\t/* unallocated/unsupported. */\n\tns_c_chaos = 3,\t\t/* MIT Chaos-net. */\n\tns_c_hs = 4,\t\t/* MIT Hesiod. */\n\t/* Query class values which do not appear in resource records */\n\tns_c_none = 254,\t/* for prereq. sections in update requests */\n\tns_c_any = 255,\t\t/* Wildcard match. */\n\tns_c_max = 65536\n} ns_class;\n\n/* DNSSEC constants. */\n\ntypedef enum __ns_key_types {\n\tns_kt_rsa = 1,\t\t/* key type RSA/MD5 */\n\tns_kt_dh  = 2,\t\t/* Diffie Hellman */\n\tns_kt_dsa = 3,\t\t/* Digital Signature Standard (MANDATORY) */\n\tns_kt_private = 254\t/* Private key type starts with OID */\n} ns_key_types;\n\ntypedef enum __ns_cert_types {\n\tcert_t_pkix = 1,\t/* PKIX (X.509v3) */\n\tcert_t_spki = 2,\t/* SPKI */\n\tcert_t_pgp  = 3,\t/* PGP */\n\tcert_t_url  = 253,\t/* URL private type */\n\tcert_t_oid  = 254\t/* OID private type */\n} ns_cert_types;\n\n/* Flags field of the KEY RR rdata. */\n#define\tNS_KEY_TYPEMASK\t\t0xC000\t/* Mask for \"type\" bits */\n#define\tNS_KEY_TYPE_AUTH_CONF\t0x0000\t/* Key usable for both */\n#define\tNS_KEY_TYPE_CONF_ONLY\t0x8000\t/* Key usable for confidentiality */\n#define\tNS_KEY_TYPE_AUTH_ONLY\t0x4000\t/* Key usable for authentication */\n#define\tNS_KEY_TYPE_NO_KEY\t0xC000\t/* No key usable for either; no key */\n/* The type bits can also be interpreted independently, as single bits: */\n#define\tNS_KEY_NO_AUTH\t\t0x8000\t/* Key unusable for authentication */\n#define\tNS_KEY_NO_CONF\t\t0x4000\t/* Key unusable for confidentiality */\n#define\tNS_KEY_RESERVED2\t0x2000\t/* Security is *mandatory* if bit=0 */\n#define\tNS_KEY_EXTENDED_FLAGS\t0x1000\t/* reserved - must be zero */\n#define\tNS_KEY_RESERVED4\t0x0800  /* reserved - must be zero */\n#define\tNS_KEY_RESERVED5\t0x0400  /* reserved - must be zero */\n#define\tNS_KEY_NAME_TYPE\t0x0300\t/* these bits determine the type */\n#define\tNS_KEY_NAME_USER\t0x0000\t/* key is assoc. with user */\n#define\tNS_KEY_NAME_ENTITY\t0x0200\t/* key is assoc. with entity eg host */\n#define\tNS_KEY_NAME_ZONE\t0x0100\t/* key is zone key */\n#define\tNS_KEY_NAME_RESERVED\t0x0300\t/* reserved meaning */\n#define\tNS_KEY_RESERVED8\t0x0080  /* reserved - must be zero */\n#define\tNS_KEY_RESERVED9\t0x0040  /* reserved - must be zero */\n#define\tNS_KEY_RESERVED10\t0x0020  /* reserved - must be zero */\n#define\tNS_KEY_RESERVED11\t0x0010  /* reserved - must be zero */\n#define\tNS_KEY_SIGNATORYMASK\t0x000F\t/* key can sign RR's of same name */\n#define\tNS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | \\\n\t\t\t\t  NS_KEY_RESERVED4 | \\\n\t\t\t\t  NS_KEY_RESERVED5 | \\\n\t\t\t\t  NS_KEY_RESERVED8 | \\\n\t\t\t\t  NS_KEY_RESERVED9 | \\\n\t\t\t\t  NS_KEY_RESERVED10 | \\\n\t\t\t\t  NS_KEY_RESERVED11 )\n#define NS_KEY_RESERVED_BITMASK2 0xFFFF /* no bits defined here */\n\n/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */\n#define\tNS_ALG_MD5RSA\t\t1\t/* MD5 with RSA */\n#define\tNS_ALG_DH               2\t/* Diffie Hellman KEY */\n#define\tNS_ALG_DSA              3\t/* DSA KEY */\n#define\tNS_ALG_DSS              NS_ALG_DSA\n#define\tNS_ALG_EXPIRE_ONLY\t253\t/* No alg, no security */\n#define\tNS_ALG_PRIVATE_OID\t254\t/* Key begins with OID giving alg */\n\n/* Protocol values  */\n/* value 0 is reserved */\n#define NS_KEY_PROT_TLS         1\n#define NS_KEY_PROT_EMAIL       2\n#define NS_KEY_PROT_DNSSEC      3\n#define NS_KEY_PROT_IPSEC       4\n#define NS_KEY_PROT_ANY\t\t255\n\n/* Signatures */\n#define\tNS_MD5RSA_MIN_BITS\t 512\t/* Size of a mod or exp in bits */\n#define\tNS_MD5RSA_MAX_BITS\t4096\n\t/* Total of binary mod and exp */\n#define\tNS_MD5RSA_MAX_BYTES\t((NS_MD5RSA_MAX_BITS+7/8)*2+3)\n\t/* Max length of text sig block */\n#define\tNS_MD5RSA_MAX_BASE64\t(((NS_MD5RSA_MAX_BYTES+2)/3)*4)\n#define NS_MD5RSA_MIN_SIZE\t((NS_MD5RSA_MIN_BITS+7)/8)\n#define NS_MD5RSA_MAX_SIZE\t((NS_MD5RSA_MAX_BITS+7)/8)\n\n#define NS_DSA_SIG_SIZE         41\n#define NS_DSA_MIN_SIZE         213\n#define NS_DSA_MAX_BYTES        405\n\n/* Offsets into SIG record rdata to find various values */\n#define\tNS_SIG_TYPE\t0\t/* Type flags */\n#define\tNS_SIG_ALG\t2\t/* Algorithm */\n#define\tNS_SIG_LABELS\t3\t/* How many labels in name */\n#define\tNS_SIG_OTTL\t4\t/* Original TTL */\n#define\tNS_SIG_EXPIR\t8\t/* Expiration time */\n#define\tNS_SIG_SIGNED\t12\t/* Signature time */\n#define\tNS_SIG_FOOT\t16\t/* Key footprint */\n#define\tNS_SIG_SIGNER\t18\t/* Domain name of who signed it */\n\n/* How RR types are represented as bit-flags in NXT records */\n#define\tNS_NXT_BITS 8\n#define\tNS_NXT_BIT_SET(  n,p) (p[(n)/NS_NXT_BITS] |=  (0x80>>((n)%NS_NXT_BITS)))\n#define\tNS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))\n#define\tNS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] &   (0x80>>((n)%NS_NXT_BITS)))\n#define NS_NXT_MAX 127\n\n/*\n * EDNS0 extended flags, host order.\n */\n#define NS_OPT_DNSSEC_OK\t0x8000U\n\n/*\n * Inline versions of get/put short/long.  Pointer is advanced.\n */\n#define NS_GET16(s, cp) do { \\\n\tconst u_char *t_cp = (const u_char *)(cp); \\\n\t(s) = ((uint16_t)t_cp[0] << 8) \\\n\t    | ((uint16_t)t_cp[1]) \\\n\t    ; \\\n\t(cp) += NS_INT16SZ; \\\n} while (/*CONSTCOND*/0)\n\n#define NS_GET32(l, cp) do { \\\n\tconst u_char *t_cp = (const u_char *)(cp); \\\n\t(l) = ((uint32_t)t_cp[0] << 24) \\\n\t    | ((uint32_t)t_cp[1] << 16) \\\n\t    | ((uint32_t)t_cp[2] << 8) \\\n\t    | ((uint32_t)t_cp[3]) \\\n\t    ; \\\n\t(cp) += NS_INT32SZ; \\\n} while (/*CONSTCOND*/0)\n\n#define NS_PUT16(s, cp) do { \\\n\tuint32_t t_s = (uint32_t)(s); \\\n\tu_char *t_cp = (u_char *)(cp); \\\n\t*t_cp++ = t_s >> 8; \\\n\t*t_cp   = t_s; \\\n\t(cp) += NS_INT16SZ; \\\n} while (/*CONSTCOND*/0)\n\n#define NS_PUT32(l, cp) do { \\\n\tuint32_t t_l = (uint32_t)(l); \\\n\tu_char *t_cp = (u_char *)(cp); \\\n\t*t_cp++ = t_l >> 24; \\\n\t*t_cp++ = t_l >> 16; \\\n\t*t_cp++ = t_l >> 8; \\\n\t*t_cp   = t_l; \\\n\t(cp) += NS_INT32SZ; \\\n} while (/*CONSTCOND*/0)\n\n/*\n * ANSI C identifier hiding for bind's lib/nameser.\n */\n#define\tns_msg_getflag\t\t__ns_msg_getflag\n#define ns_get16\t\t__ns_get16\n#define ns_get32\t\t__ns_get32\n#define ns_put16\t\t__ns_put16\n#define ns_put32\t\t__ns_put32\n#define ns_initparse\t\t__ns_initparse\n#define ns_skiprr\t\t__ns_skiprr\n#define ns_parserr\t\t__ns_parserr\n#define\tns_sprintrr\t\t__ns_sprintrr\n#define\tns_sprintrrf\t\t__ns_sprintrrf\n#define\tns_format_ttl\t\t__ns_format_ttl\n#define\tns_parse_ttl\t\t__ns_parse_ttl\n#define ns_datetosecs\t\t__ns_datetosecs\n#define\tns_name_ntol\t\t__ns_name_ntol\n#define\tns_name_ntop\t\t__ns_name_ntop\n#define\tns_name_pton\t\t__ns_name_pton\n#define\tns_name_unpack\t\t__ns_name_unpack\n#define\tns_name_pack\t\t__ns_name_pack\n#define\tns_name_compress\t__ns_name_compress\n#define\tns_name_uncompress\t__ns_name_uncompress\n#define\tns_name_skip\t\t__ns_name_skip\n#define\tns_name_rollback\t__ns_name_rollback\n#define\tns_sign\t\t\t__ns_sign\n#define\tns_sign2\t\t__ns_sign2\n#define\tns_sign_tcp\t\t__ns_sign_tcp\n#define\tns_sign_tcp2\t\t__ns_sign_tcp2\n#define\tns_sign_tcp_init\t__ns_sign_tcp_init\n#define ns_find_tsig\t\t__ns_find_tsig\n#define\tns_verify\t\t__ns_verify\n#define\tns_verify_tcp\t\t__ns_verify_tcp\n#define\tns_verify_tcp_init\t__ns_verify_tcp_init\n#define\tns_samedomain\t\t__ns_samedomain\n#define\tns_subdomain\t\t__ns_subdomain\n#define\tns_makecanon\t\t__ns_makecanon\n#define\tns_samename\t\t__ns_samename\n\n__BEGIN_DECLS\nint\t\tns_msg_getflag(ns_msg, int);\nuint16_t\tns_get16(const u_char *);\nuint32_t\tns_get32(const u_char *);\nvoid\t\tns_put16(uint16_t, u_char *);\nvoid\t\tns_put32(uint32_t, u_char *);\nint\t\tns_initparse(const u_char *, int, ns_msg *);\nint\t\tns_skiprr(const u_char *, const u_char *, ns_sect, int);\nint\t\tns_parserr(ns_msg *, ns_sect, int, ns_rr *);\nint\t\tns_sprintrr(const ns_msg *, const ns_rr *,\n\t\t\t\t const char *, const char *, char *, size_t);\nint\t\tns_sprintrrf(const u_char *, size_t, const char *,\n\t\t\t\t  ns_class, ns_type, u_long, const u_char *,\n\t\t\t\t  size_t, const char *, const char *,\n\t\t\t\t  char *, size_t);\nint\t\tns_format_ttl(u_long, char *, size_t);\nint\t\tns_parse_ttl(const char *, u_long *);\nuint32_t\tns_datetosecs(const char *cp, int *errp);\nint\t\tns_name_ntol(const u_char *, u_char *, size_t);\nint\t\tns_name_ntop(const u_char *, char *, size_t);\nint\t\tns_name_pton(const char *, u_char *, size_t);\nint\t\tns_name_unpack(const u_char *, const u_char *,\n\t\t\t\t    const u_char *, u_char *, size_t);\nint\t\tns_name_pack(const u_char *, u_char *, int,\n\t\t\t\t  const u_char **, const u_char **);\nint\t\tns_name_uncompress(const u_char *, const u_char *,\n\t\t\t\t\tconst u_char *, char *, size_t);\nint\t\tns_name_compress(const char *, u_char *, size_t,\n\t\t\t\t      const u_char **, const u_char **);\nint\t\tns_name_skip(const u_char **, const u_char *);\nvoid\t\tns_name_rollback(const u_char *, const u_char **,\n\t\t\t\t      const u_char **);\nint\t\tns_sign(u_char *, int *, int, int, void *,\n\t\t\t     const u_char *, int, u_char *, int *, time_t);\nint\t\tns_sign2(u_char *, int *, int, int, void *,\n\t\t\t      const u_char *, int, u_char *, int *, time_t,\n\t\t\t      u_char **, u_char **);\nint\t\tns_sign_tcp(u_char *, int *, int, int,\n\t\t\t\t ns_tcp_tsig_state *, int);\nint\t\tns_sign_tcp2(u_char *, int *, int, int,\n\t\t\t\t  ns_tcp_tsig_state *, int,\n\t\t\t\t  u_char **, u_char **);\nint\t\tns_sign_tcp_init(void *, const u_char *, int,\n\t\t\t\t\tns_tcp_tsig_state *);\nu_char\t\t*ns_find_tsig(u_char *, u_char *);\nint\t\tns_verify(u_char *, int *, void *,\n\t\t\t       const u_char *, int, u_char *, int *,\n\t\t\t       time_t *, int);\nint\t\tns_verify_tcp(u_char *, int *, ns_tcp_tsig_state *, int);\nint\t\tns_verify_tcp_init(void *, const u_char *, int,\n\t\t\t\t\tns_tcp_tsig_state *);\nint\t\tns_samedomain(const char *, const char *);\nint\t\tns_subdomain(const char *, const char *);\nint\t\tns_makecanon(const char *, char *, size_t);\nint\t\tns_samename(const char *, const char *);\n__END_DECLS\n\n#ifdef BIND_4_COMPAT\n#include <arpa/nameser_compat.h>\n#endif\n\n#if 0\n#  include <logd.h>\n#  define  XLOG(...)   \\\n    __libc_android_log_print(ANDROID_LOG_DEBUG,\"libc\",__VA_ARGS__)\n#else\n#define  XLOG(...)   do {} while (0)\n#endif\n\n#endif /* !_ARPA_NAMESER_H_ */\n"
  },
  {
    "path": "packages/finch/arpa/nameser_compat.h",
    "content": "/*\t$NetBSD: nameser_compat.h,v 1.1.1.2 2004/11/07 01:28:27 christos Exp $\t*/\n\n/* Copyright (c) 1983, 1989\n *    The Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n * \tThis product includes software developed by the University of\n * \tCalifornia, Berkeley and its contributors.\n * 4. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/*\n *      from nameser.h\t8.1 (Berkeley) 6/2/93\n *\tId: nameser_compat.h,v 1.1.2.3.4.2 2004/07/01 04:43:41 marka Exp\n */\n\n/*\n * This version of this file is derived from Android 2.3 \"Gingerbread\",\n * which contains uncredited changes by Android/Google developers.  It has\n * been modified in 2011 for use in the Android build of Mozilla Firefox by\n * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>,\n * and Steve Workman <sjhworkman@gmail.com>).\n * These changes are offered under the same license as the original NetBSD\n * file, whose copyright and license are unchanged above.\n */\n\n#ifndef _ARPA_NAMESER_COMPAT_\n#define\t_ARPA_NAMESER_COMPAT_\n\n#define\t__BIND\t\t19950621\t/* (DEAD) interface version stamp. */\n\n#include <endian.h>\n\n#ifndef BYTE_ORDER\n#if (BSD >= 199103)\n# include <machine/endian.h>\n#else\n#ifdef __linux\n# include <endian.h>\n#else\n#define\tLITTLE_ENDIAN\t1234\t/* least-significant byte first (vax, pc) */\n#define\tBIG_ENDIAN\t4321\t/* most-significant byte first (IBM, net) */\n#define\tPDP_ENDIAN\t3412\t/* LSB first in word, MSW first in long (pdp)*/\n\n#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \\\n    defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \\\n    defined(__alpha__) || defined(__alpha) || \\\n    (defined(__Lynx__) && defined(__x86__))\n#define BYTE_ORDER\tLITTLE_ENDIAN\n#endif\n\n#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \\\n    defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \\\n    defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\\\n    defined(apollo) || defined(__convex__) || defined(_CRAY) || \\\n    defined(__hppa) || defined(__hp9000) || \\\n    defined(__hp9000s300) || defined(__hp9000s700) || \\\n    defined(__hp3000s900) || defined(__hpux) || defined(MPE) || \\\n    defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc) ||  \\\n    (defined(__Lynx__) && \\\n     (defined(__68k__) || defined(__sparc__) || defined(__powerpc__)))\n#define BYTE_ORDER\tBIG_ENDIAN\n#endif\n#endif /* __linux */\n#endif /* BSD */\n#endif /* BYTE_ORDER */\n\n#if !defined(BYTE_ORDER) || \\\n    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \\\n    BYTE_ORDER != PDP_ENDIAN)\n\t/* you must determine what the correct bit order is for\n\t * your compiler - the next line is an intentional error\n\t * which will force your compiles to bomb until you fix\n\t * the above macros.\n\t */\n  #error \"Undefined or invalid BYTE_ORDER\";\n#endif\n\n/*\n * Structure for query header.  The order of the fields is machine- and\n * compiler-dependent, depending on the byte/bit order and the layout\n * of bit fields.  We use bit fields only in int variables, as this\n * is all ANSI requires.  This requires a somewhat confusing rearrangement.\n */\n\ntypedef struct {\n\tunsigned\tid :16;\t\t/* query identification number */\n#if BYTE_ORDER == BIG_ENDIAN\n\t\t\t/* fields in third byte */\n\tunsigned\tqr: 1;\t\t/* response flag */\n\tunsigned\topcode: 4;\t/* purpose of message */\n\tunsigned\taa: 1;\t\t/* authoritive answer */\n\tunsigned\ttc: 1;\t\t/* truncated message */\n\tunsigned\trd: 1;\t\t/* recursion desired */\n\t\t\t/* fields in fourth byte */\n\tunsigned\tra: 1;\t\t/* recursion available */\n\tunsigned\tunused :1;\t/* unused bits (MBZ as of 4.9.3a3) */\n\tunsigned\tad: 1;\t\t/* authentic data from named */\n\tunsigned\tcd: 1;\t\t/* checking disabled by resolver */\n\tunsigned\trcode :4;\t/* response code */\n#endif\n#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN\n\t\t\t/* fields in third byte */\n\tunsigned\trd :1;\t\t/* recursion desired */\n\tunsigned\ttc :1;\t\t/* truncated message */\n\tunsigned\taa :1;\t\t/* authoritive answer */\n\tunsigned\topcode :4;\t/* purpose of message */\n\tunsigned\tqr :1;\t\t/* response flag */\n\t\t\t/* fields in fourth byte */\n\tunsigned\trcode :4;\t/* response code */\n\tunsigned\tcd: 1;\t\t/* checking disabled by resolver */\n\tunsigned\tad: 1;\t\t/* authentic data from named */\n\tunsigned\tunused :1;\t/* unused bits (MBZ as of 4.9.3a3) */\n\tunsigned\tra :1;\t\t/* recursion available */\n#endif\n\t\t\t/* remaining bytes */\n\tunsigned\tqdcount :16;\t/* number of question entries */\n\tunsigned\tancount :16;\t/* number of answer entries */\n\tunsigned\tnscount :16;\t/* number of authority entries */\n\tunsigned\tarcount :16;\t/* number of resource entries */\n} HEADER;\n\n#define PACKETSZ\tNS_PACKETSZ\n#define MAXDNAME\tNS_MAXDNAME\n#define MAXCDNAME\tNS_MAXCDNAME\n#define MAXLABEL\tNS_MAXLABEL\n#define\tHFIXEDSZ\tNS_HFIXEDSZ\n#define QFIXEDSZ\tNS_QFIXEDSZ\n#define RRFIXEDSZ\tNS_RRFIXEDSZ\n#define\tINT32SZ\t\tNS_INT32SZ\n#define\tINT16SZ\t\tNS_INT16SZ\n#define\tINT8SZ\t\tNS_INT8SZ\n#define\tINADDRSZ\tNS_INADDRSZ\n#define\tIN6ADDRSZ\tNS_IN6ADDRSZ\n#define\tINDIR_MASK\tNS_CMPRSFLGS\n#define NAMESERVER_PORT\tNS_DEFAULTPORT\n\n#define S_ZONE\t\tns_s_zn\n#define S_PREREQ\tns_s_pr\n#define S_UPDATE\tns_s_ud\n#define S_ADDT\t\tns_s_ar\n\n#define QUERY\t\tns_o_query\n#define IQUERY\t\tns_o_iquery\n#define STATUS\t\tns_o_status\n#define\tNS_NOTIFY_OP\tns_o_notify\n#define\tNS_UPDATE_OP\tns_o_update\n\n#define NOERROR\t\tns_r_noerror\n#define FORMERR\t\tns_r_formerr\n#define SERVFAIL\tns_r_servfail\n#define NXDOMAIN\tns_r_nxdomain\n#define NOTIMP\t\tns_r_notimpl\n#define REFUSED\t\tns_r_refused\n#define YXDOMAIN\tns_r_yxdomain\n#define YXRRSET\t\tns_r_yxrrset\n#define NXRRSET\t\tns_r_nxrrset\n#define NOTAUTH\t\tns_r_notauth\n#define NOTZONE\t\tns_r_notzone\n/*#define BADSIG\t\tns_r_badsig*/\n/*#define BADKEY\t\tns_r_badkey*/\n/*#define BADTIME\t\tns_r_badtime*/\n\n\n#define DELETE\t\tns_uop_delete\n#define ADD\t\tns_uop_add\n\n#define T_A\t\tns_t_a\n#define T_NS\t\tns_t_ns\n#define T_MD\t\tns_t_md\n#define T_MF\t\tns_t_mf\n#define T_CNAME\t\tns_t_cname\n#define T_SOA\t\tns_t_soa\n#define T_MB\t\tns_t_mb\n#define T_MG\t\tns_t_mg\n#define T_MR\t\tns_t_mr\n#define T_NULL\t\tns_t_null\n#define T_WKS\t\tns_t_wks\n#define T_PTR\t\tns_t_ptr\n#define T_HINFO\t\tns_t_hinfo\n#define T_MINFO\t\tns_t_minfo\n#define T_MX\t\tns_t_mx\n#define T_TXT\t\tns_t_txt\n#define\tT_RP\t\tns_t_rp\n#define T_AFSDB\t\tns_t_afsdb\n#define T_X25\t\tns_t_x25\n#define T_ISDN\t\tns_t_isdn\n#define T_RT\t\tns_t_rt\n#define T_NSAP\t\tns_t_nsap\n#define T_NSAP_PTR\tns_t_nsap_ptr\n#define\tT_SIG\t\tns_t_sig\n#define\tT_KEY\t\tns_t_key\n#define\tT_PX\t\tns_t_px\n#define\tT_GPOS\t\tns_t_gpos\n#define\tT_AAAA\t\tns_t_aaaa\n#define\tT_LOC\t\tns_t_loc\n#define\tT_NXT\t\tns_t_nxt\n#define\tT_EID\t\tns_t_eid\n#define\tT_NIMLOC\tns_t_nimloc\n#define\tT_SRV\t\tns_t_srv\n#define T_ATMA\t\tns_t_atma\n#define T_NAPTR\t\tns_t_naptr\n#define T_A6\t\tns_t_a6\n#define\tT_TSIG\t\tns_t_tsig\n#define\tT_IXFR\t\tns_t_ixfr\n#define T_AXFR\t\tns_t_axfr\n#define T_MAILB\t\tns_t_mailb\n#define T_MAILA\t\tns_t_maila\n#define T_ANY\t\tns_t_any\n\n#define C_IN\t\tns_c_in\n#define C_CHAOS\t\tns_c_chaos\n#define C_HS\t\tns_c_hs\n/* BIND_UPDATE */\n#define C_NONE\t\tns_c_none\n#define C_ANY\t\tns_c_any\n\n#define\tGETSHORT\t\tNS_GET16\n#define\tGETLONG\t\t\tNS_GET32\n#define\tPUTSHORT\t\tNS_PUT16\n#define\tPUTLONG\t\t\tNS_PUT32\n\n#endif /* _ARPA_NAMESER_COMPAT_ */\n"
  },
  {
    "path": "packages/finch/bonjour-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/bonjour/Makefile.in ./libpurple/protocols/bonjour/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/bonjour/Makefile.in\t2015-12-31 18:19:51.000000000 -0500\n+++ ./libpurple/protocols/bonjour/Makefile.in\t2016-05-05 04:28:23.297133517 -0400\n@@ -592,7 +592,7 @@\n \t}\n \n libbonjour.la: $(libbonjour_la_OBJECTS) $(libbonjour_la_DEPENDENCIES) $(EXTRA_libbonjour_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libbonjour_la_LINK) $(am_libbonjour_la_rpath) $(libbonjour_la_OBJECTS) $(libbonjour_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libbonjour_la_LINK) $(am_libbonjour_la_rpath) $(libbonjour_la_OBJECTS) $(libbonjour_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://pidgin.im/\nTERMUX_PKG_DESCRIPTION=\"Text-based multi-protocol instant messaging client\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.13.0\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=2747150c6f711146bddd333c496870bfd55058bab22ffb7e4eb784018ec46d8f\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/pidgin/Pidgin/${TERMUX_PKG_VERSION}/pidgin-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"libiconv, libgnutls, libxml2, ncurses-ui-libs, glib\"\nTERMUX_PKG_BREAKS=\"finch-dev\"\nTERMUX_PKG_REPLACES=\"finch-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-gtkui\n--disable-gstreamer\n--disable-vv\n--disable-idn\n--disable-meanwhile\n--disable-avahi\n--disable-dbus\n--disable-perl\n--disable-tcl\n--without-zephyr\n--with-ncurses-headers=$TERMUX_PREFIX/include\n--without-python\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/sounds/purple lib/purple-2/libmsn.so\"\n\ntermux_step_pre_configure() {\n\t# For arpa:\n\tCFLAGS+=\" -isystem $TERMUX_PKG_BUILDER_DIR\"\n}\n\ntermux_step_post_configure() {\n\t# Hack to compile first version of libpurple-ciphers.la\n\tcp $TERMUX_PREFIX/lib/libxml2.so $TERMUX_PREFIX/lib/libpurple.so\n\n\tcd $TERMUX_PKG_BUILDDIR/libpurple/ciphers\n\tmake libpurple-ciphers.la\n\tcd ..\n\tmake libpurple.la\n\n\t# Put a more proper version in lib:\n\tcp .libs/libpurple.so $TERMUX_PREFIX/lib/\n\n\tmake clean\n}\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PREFIX/lib\n\tfor lib in jabber oscar; do\n\t\tln -f -s purple-2/lib${lib}.so .\n\tdone\n}\n"
  },
  {
    "path": "packages/finch/configure.patch",
    "content": "diff -u -r ../pidgin-2.10.11/configure ./configure\n--- ../pidgin-2.10.11/configure\t2014-11-23 11:42:00.000000000 -0500\n+++ ./configure\t2014-12-28 16:09:30.872081387 -0500\n@@ -19876,7 +19876,6 @@\n \t\t\t\"-Wcast-align\" \\\n \t\t\t\"-Wdeclaration-after-statement\" \\\n \t\t\t\"-Wendif-labels\" \\\n-\t\t\t\"-Werror-implicit-function-declaration\" \\\n \t\t\t\"-Wextra -Wno-unused-parameter\" \\\n \t\t\t\"-Wformat-security\" \\\n \t\t\t\t\"-Werror=format-security\" \\\n"
  },
  {
    "path": "packages/finch/dont-build-nullclient-example.patch",
    "content": "diff -u -r ../pidgin-2.10.9/libpurple/example/Makefile.in ./libpurple/example/Makefile.in\n--- ../pidgin-2.10.9/libpurple/example/Makefile.in\t2014-02-02 22:30:21.000000000 +0100\n+++ ./libpurple/example/Makefile.in\t2014-03-09 22:35:03.000000000 +0100\n@@ -51,7 +51,6 @@\n POST_UNINSTALL = :\n build_triplet = @build@\n host_triplet = @host@\n-noinst_PROGRAMS = nullclient$(EXEEXT)\n subdir = libpurple/example\n DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in\n ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n"
  },
  {
    "path": "packages/finch/gg-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/gg/Makefile.in ./libpurple/protocols/gg/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/gg/Makefile.in\t2015-12-31 18:19:51.000000000 -0500\n+++ ./libpurple/protocols/gg/Makefile.in\t2016-05-05 04:29:27.412205753 -0400\n@@ -697,7 +697,7 @@\n \t}\n \n libgg.la: $(libgg_la_OBJECTS) $(libgg_la_DEPENDENCIES) $(EXTRA_libgg_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libgg_la_LINK) $(am_libgg_la_rpath) $(libgg_la_OBJECTS) $(libgg_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libgg_la_LINK) $(am_libgg_la_rpath) $(libgg_la_OBJECTS) $(libgg_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/irc-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.11/libpurple/protocols/irc/Makefile.in ./libpurple/protocols/irc/Makefile.in\n--- ../pidgin-2.10.11/libpurple/protocols/irc/Makefile.in\t2014-11-23 11:41:59.000000000 -0500\n+++ ./libpurple/protocols/irc/Makefile.in\t2015-12-17 18:48:54.684544173 -0500\n@@ -564,7 +564,7 @@\n \t}\n \n libirc.la: $(libirc_la_OBJECTS) $(libirc_la_DEPENDENCIES) $(EXTRA_libirc_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libirc_la_LINK) $(am_libirc_la_rpath) $(libirc_la_OBJECTS) $(libirc_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libirc_la_LINK) $(am_libirc_la_rpath) $(libirc_la_OBJECTS) $(libirc_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/jabber-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/jabber/Makefile.in ./libpurple/protocols/jabber/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/jabber/Makefile.in\t2015-12-31 18:19:52.000000000 -0500\n+++ ./libpurple/protocols/jabber/Makefile.in\t2016-05-05 04:17:05.462969023 -0400\n@@ -649,10 +649,10 @@\n \t}\n \n libjabber.la: $(libjabber_la_OBJECTS) $(libjabber_la_DEPENDENCIES) $(EXTRA_libjabber_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libjabber_la_LINK) $(am_libjabber_la_rpath) $(libjabber_la_OBJECTS) $(libjabber_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libjabber_la_LINK) $(am_libjabber_la_rpath) $(libjabber_la_OBJECTS) $(libjabber_la_LIBADD) $(LIBS) -lpurple\n \n libxmpp.la: $(libxmpp_la_OBJECTS) $(libxmpp_la_DEPENDENCIES) $(EXTRA_libxmpp_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libxmpp_la_LINK) $(am_libxmpp_la_rpath) $(libxmpp_la_OBJECTS) $(libxmpp_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libxmpp_la_LINK) $(am_libxmpp_la_rpath) $(libxmpp_la_OBJECTS) $(libxmpp_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/libgnt-gntmain.c.patch",
    "content": "diff -u -r ../pidgin-2.10.12/finch/libgnt/gntmain.c ./finch/libgnt/gntmain.c\n--- ../pidgin-2.10.12/finch/libgnt/gntmain.c\t2015-12-31 18:19:40.000000000 -0500\n+++ ./finch/libgnt/gntmain.c\t2016-05-05 04:09:16.281843580 -0400\n@@ -493,7 +493,8 @@\n \trefresh();\n \n #ifdef ALL_MOUSE_EVENTS\n-\tif ((mouse_enabled = gnt_style_get_bool(GNT_STYLE_MOUSE, FALSE)))\n+       /* Termux modification: Enable mouse events by default. */\n+\tif ((mouse_enabled = gnt_style_get_bool(GNT_STYLE_MOUSE, TRUE)))\n \t\tmousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL);\n #endif\n \n"
  },
  {
    "path": "packages/finch/oscar-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/oscar/Makefile.in ./libpurple/protocols/oscar/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/oscar/Makefile.in\t2015-12-31 18:19:52.000000000 -0500\n+++ ./libpurple/protocols/oscar/Makefile.in\t2016-05-05 04:27:46.529665679 -0400\n@@ -652,13 +652,13 @@\n \t}\n \n libaim.la: $(libaim_la_OBJECTS) $(libaim_la_DEPENDENCIES) $(EXTRA_libaim_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libaim_la_LINK) $(am_libaim_la_rpath) $(libaim_la_OBJECTS) $(libaim_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libaim_la_LINK) $(am_libaim_la_rpath) $(libaim_la_OBJECTS) $(libaim_la_LIBADD) $(LIBS) -lpurple\n \n libicq.la: $(libicq_la_OBJECTS) $(libicq_la_DEPENDENCIES) $(EXTRA_libicq_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libicq_la_LINK) $(am_libicq_la_rpath) $(libicq_la_OBJECTS) $(libicq_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libicq_la_LINK) $(am_libicq_la_rpath) $(libicq_la_OBJECTS) $(libicq_la_LIBADD) $(LIBS) -lpurple\n \n liboscar.la: $(liboscar_la_OBJECTS) $(liboscar_la_DEPENDENCIES) $(EXTRA_liboscar_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(liboscar_la_LINK) $(am_liboscar_la_rpath) $(liboscar_la_OBJECTS) $(liboscar_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(liboscar_la_LINK) $(am_liboscar_la_rpath) $(liboscar_la_OBJECTS) $(liboscar_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/sametime-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/sametime/Makefile.in ./libpurple/protocols/sametime/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/sametime/Makefile.in\t2015-12-31 18:19:52.000000000 -0500\n+++ ./libpurple/protocols/sametime/Makefile.in\t2016-05-05 04:55:56.307866256 -0400\n@@ -565,7 +565,7 @@\n \t}\n \n libsametime.la: $(libsametime_la_OBJECTS) $(libsametime_la_DEPENDENCIES) $(EXTRA_libsametime_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libsametime_la_LINK) $(am_libsametime_la_rpath) $(libsametime_la_OBJECTS) $(libsametime_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libsametime_la_LINK) $(am_libsametime_la_rpath) $(libsametime_la_OBJECTS) $(libsametime_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/silc-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/silc/Makefile.in ./libpurple/protocols/silc/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/silc/Makefile.in\t2015-12-31 18:19:52.000000000 -0500\n+++ ./libpurple/protocols/silc/Makefile.in\t2016-05-05 04:56:33.511264315 -0400\n@@ -582,7 +582,7 @@\n \t}\n \n libsilcpurple.la: $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_DEPENDENCIES) $(EXTRA_libsilcpurple_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/silc10-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/silc10/Makefile.in ./libpurple/protocols/silc10/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/silc10/Makefile.in\t2015-12-31 18:19:52.000000000 -0500\n+++ ./libpurple/protocols/silc10/Makefile.in\t2016-05-05 04:57:07.446716791 -0400\n@@ -571,7 +571,7 @@\n \t}\n \n libsilcpurple.la: $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_DEPENDENCIES) $(EXTRA_libsilcpurple_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libsilcpurple_la_LINK) $(am_libsilcpurple_la_rpath) $(libsilcpurple_la_OBJECTS) $(libsilcpurple_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/simple-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/protocols/simple/Makefile.in ./libpurple/protocols/simple/Makefile.in\n--- ../pidgin-2.10.12/libpurple/protocols/simple/Makefile.in\t2015-12-31 18:19:52.000000000 -0500\n+++ ./libpurple/protocols/simple/Makefile.in\t2016-05-05 04:58:18.813569692 -0400\n@@ -565,7 +565,7 @@\n \t}\n \n libsimple.la: $(libsimple_la_OBJECTS) $(libsimple_la_DEPENDENCIES) $(EXTRA_libsimple_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(libsimple_la_LINK) $(am_libsimple_la_rpath) $(libsimple_la_OBJECTS) $(libsimple_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(libsimple_la_LINK) $(am_libsimple_la_rpath) $(libsimple_la_OBJECTS) $(libsimple_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/finch/ssl-makefile.patch",
    "content": "diff -u -r ../pidgin-2.10.12/libpurple/plugins/ssl/Makefile.in ./libpurple/plugins/ssl/Makefile.in\n--- ../pidgin-2.10.12/libpurple/plugins/ssl/Makefile.in\t2015-12-31 18:19:51.000000000 -0500\n+++ ./libpurple/plugins/ssl/Makefile.in\t2016-05-06 05:14:11.266023479 -0400\n@@ -632,13 +632,13 @@\n \t$(AM_V_CCLD)$(nss_prefs_la_LINK) $(am_nss_prefs_la_rpath) $(nss_prefs_la_OBJECTS) $(nss_prefs_la_LIBADD) $(LIBS)\n \n ssl-gnutls.la: $(ssl_gnutls_la_OBJECTS) $(ssl_gnutls_la_DEPENDENCIES) $(EXTRA_ssl_gnutls_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(ssl_gnutls_la_LINK) $(am_ssl_gnutls_la_rpath) $(ssl_gnutls_la_OBJECTS) $(ssl_gnutls_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(ssl_gnutls_la_LINK) $(am_ssl_gnutls_la_rpath) $(ssl_gnutls_la_OBJECTS) $(ssl_gnutls_la_LIBADD) $(LIBS) -lpurple\n \n ssl-nss.la: $(ssl_nss_la_OBJECTS) $(ssl_nss_la_DEPENDENCIES) $(EXTRA_ssl_nss_la_DEPENDENCIES) \n \t$(AM_V_CCLD)$(ssl_nss_la_LINK) $(am_ssl_nss_la_rpath) $(ssl_nss_la_OBJECTS) $(ssl_nss_la_LIBADD) $(LIBS)\n \n ssl.la: $(ssl_la_OBJECTS) $(ssl_la_DEPENDENCIES) $(EXTRA_ssl_la_DEPENDENCIES) \n-\t$(AM_V_CCLD)$(ssl_la_LINK) $(am_ssl_la_rpath) $(ssl_la_OBJECTS) $(ssl_la_LIBADD) $(LIBS)\n+\t$(AM_V_CCLD)$(ssl_la_LINK) $(am_ssl_la_rpath) $(ssl_la_OBJECTS) $(ssl_la_LIBADD) $(LIBS) -lpurple\n \n mostlyclean-compile:\n \t-rm -f *.$(OBJEXT)\n"
  },
  {
    "path": "packages/findutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/findutils/\nTERMUX_PKG_DESCRIPTION=\"Utilities to find files meeting specified criteria and perform various actions on the files which are found\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=4.7.0\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/findutils/findutils-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=c5fefbdf9858f7e4feb86f036e1247a54c79fc2d8e4b7064d5aaa1f47dfa789a\nTERMUX_PKG_DEPENDS=\"libandroid-support\"\nTERMUX_PKG_ESSENTIAL=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\ngl_cv_func_fflush_stdin=yes\nSORT_SUPPORTS_Z=yes\nSORT=$TERMUX_PREFIX/bin/applets/sort\n\"\n\n# Remove locale and updatedb which in Termux is provided by mlocate:\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/locate\nbin/updatedb\nshare/man/man1/locate.1\nshare/man/man1/updatedb.1\nshare/man/man5/locatedb.5\n\"\n\ntermux_step_pre_configure() {\n\t# This is needed for find to implement support for the\n\t# -fstype parameter by parsing /proc/self/mountinfo:\n\tCPPFLAGS+=\" -DMOUNTED_GETMNTENT1=1\"\n}\n"
  },
  {
    "path": "packages/findutils/configure.patch",
    "content": "diff -uNr findutils-4.6.0/configure findutils-4.6.0.mod/configure\n--- findutils-4.6.0/configure\t2015-12-28 23:31:23.000000000 +0200\n+++ findutils-4.6.0.mod/configure\t2019-08-16 17:21:04.358640627 +0300\n@@ -15945,7 +15945,7 @@\n           if test -n \"$LIBMULTITHREAD\" || test -n \"$LTLIBMULTITHREAD\"; then\n             if case \"$gl_cv_have_weak\" in *yes) true;; *) false;; esac; then\n \n-$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n+#$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n \n               LIBTHREAD=\n               LTLIBTHREAD=\n"
  },
  {
    "path": "packages/findutils/find-parser.c.patch",
    "content": "diff -u -r ../findutils-4.7.0/find/parser.c ./find/parser.c\n--- ../findutils-4.7.0/find/parser.c\t2019-08-29 19:10:57.000000000 +0000\n+++ ./find/parser.c\t2019-09-08 08:27:46.805564375 +0000\n@@ -69,10 +69,10 @@\n \n \n #ifndef HAVE_ENDGRENT\n-# define endgrent ()\n+# define endgrent()\n #endif\n #ifndef HAVE_ENDPWENT\n-# define endpwent ()\n+# define endpwent()\n #endif\n \n static bool parse_accesscheck   (const struct parser_table*, char *argv[], int *arg_ptr);\n"
  },
  {
    "path": "packages/findutils/gl-lib-mountlist.c.patch",
    "content": "diff -u -r ../findutils-4.6.0/gl/lib/mountlist.c ./gl/lib/mountlist.c\n--- ../findutils-4.6.0/gl/lib/mountlist.c\t2015-12-24 17:41:44.000000000 +0100\n+++ ./gl/lib/mountlist.c\t2017-06-26 14:11:45.311482879 +0200\n@@ -33,6 +33,10 @@\n \n #include <unistd.h>\n \n+#ifdef __ANDROID__\n+# include <sys/sysmacros.h> /* makedev() macro */\n+#endif\n+\n #if HAVE_SYS_PARAM_H\n # include <sys/param.h>\n #endif\n"
  },
  {
    "path": "packages/fish/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://fishshell.com/\nTERMUX_PKG_DESCRIPTION=\"Shell geared towards interactive use\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.0.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/fish-shell/fish-shell/releases/download/$TERMUX_PKG_VERSION/fish-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=14728ccc6b8e053d01526ebbd0822ca4eb0235e6487e832ec1d0d22f1395430e\n# fish calls 'tput' from ncurses-utils, at least when cancelling (Ctrl+C) a command line.\n# man is needed since fish calls apropos during command completion.\nTERMUX_PKG_DEPENDS=\"libc++, ncurses, libandroid-support, ncurses-utils, man, bc, pcre2\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_file__proc_self_stat=yes\nac_cv_func_wcstod_l=no\n--without-included-pcre2\n\"\n\ntermux_step_pre_configure() {\n\tCXXFLAGS+=\" $CPPFLAGS\"\n}\n\ntermux_step_post_make_install() {\n\tcat >> $TERMUX_PREFIX/etc/fish/config.fish <<HERE\n\nfunction __fish_command_not_found_handler --on-event fish_command_not_found\n\t$TERMUX_PREFIX/libexec/termux/command-not-found \\$argv[1]\nend\nHERE\n}\n"
  },
  {
    "path": "packages/fish/create_manpage_completions.py.patch",
    "content": "diff -u -r ../fish-3.0.0/share/tools/create_manpage_completions.py ./share/tools/create_manpage_completions.py\n--- ../fish-3.0.0/share/tools/create_manpage_completions.py\t2018-12-28 13:01:03.000000000 +0000\n+++ ./share/tools/create_manpage_completions.py\t2018-12-28 22:54:12.034220150 +0000\n@@ -865,29 +865,7 @@\n     if os.getenv(\"MANPATH\"):\n         parent_paths = os.getenv(\"MANPATH\").strip().split(':')\n     else:\n-        # Some systems have manpath, others have `man --path` (like Haiku).\n-        for prog in [['manpath'], ['man', '--path']]:\n-            try:\n-                proc = subprocess.Popen(prog, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n-            except OSError: # Command does not exist, keep trying\n-                continue\n-            break # Command exists, use it.\n-        manpath, err_data = proc.communicate()\n-        parent_paths = manpath.decode().strip().split(':')\n-    if (not parent_paths) or (proc and proc.returncode > 0):\n-        # HACK: Use some fallbacks in case we can't get anything else.\n-        # `mandoc` does not provide `manpath` or `man --path` and $MANPATH might not be set.\n-        # The alternative is reading its config file (/etc/man.conf)\n-        if os.path.isfile('/etc/man.conf'):\n-            data = open('/etc/man.conf', 'r')\n-            for line in data:\n-                if ('manpath' in line or 'MANPATH' in line):\n-                    p = line.split(' ')[1]\n-                    p = p.split()[0]\n-                    parent_paths.append(p)\n-        if (not parent_paths):\n-            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\")\n-        parent_paths = [\"/usr/share/man\", \"/usr/local/share/man\"]\n+        parent_paths = [\"@TERMUX_PREFIX@/share/man\"]\n     result = []\n     for parent_path in parent_paths:\n         for section in ['man1', 'man6', 'man8']:\n"
  },
  {
    "path": "packages/fish/share-functions-__fish_print_help.fish.patch",
    "content": "diff -u -r ../fish-3.0.0/share/functions/__fish_print_help.fish ./share/functions/__fish_print_help.fish\n--- ../fish-3.0.0/share/functions/__fish_print_help.fish\t2018-12-28 13:01:03.000000000 +0000\n+++ ./share/functions/__fish_print_help.fish\t2018-12-28 22:55:42.761223014 +0000\n@@ -22,7 +22,7 @@\n         set mfish -mfish\n     end\n     if test -e \"$__fish_data_dir/man/man1/$item.1\"\n-        set help (nroff -c -man $mfish -t $rLL \"$__fish_data_dir/man/man1/$item.1\" 2>/dev/null)\n+        set help (mandoc \"$__fish_datadir/man/man1/$item.1\" ^/dev/null)\n     else if test -e \"$__fish_data_dir/man/man1/$item.1.gz\"\n         set help (gunzip -c \"$__fish_data_dir/man/man1/$item.1.gz\" 2>/dev/null | nroff -c -man $mfish -t $rLL 2>/dev/null)\n     end\n@@ -80,6 +80,6 @@\n                         # skip it\n                 end\n         end\n-    end | ul # post-process with `ul`, to interpret the old-style grotty escapes\n+    end\n     echo # print a trailing blank line\n end\n"
  },
  {
    "path": "packages/fish/src-env.cpp.patch",
    "content": "diff -u -r ../fish-3.0.1/src/env.cpp ./src/env.cpp\n--- ../fish-3.0.1/src/env.cpp\t2019-02-11 12:13:15.000000000 +0000\n+++ ./src/env.cpp\t2019-02-13 22:19:56.975817836 +0000\n@@ -1663,7 +1663,7 @@\n         auto pwuid = getpwuid(geteuid());\n         const char *uname = pwuid ? pwuid->pw_name : NULL;\n         // /tmp/fish.user\n-        std::string tmpdir = \"/tmp/fish.\";\n+        std::string tmpdir = \"@TERMUX_PREFIX@/tmp/fish.\";\n         if (uname) {\n             tmpdir.append(uname);\n         }\n"
  },
  {
    "path": "packages/fish/src-fish.cpp.patch",
    "content": "diff -u -r ../fish-2.4.0/src/fish.cpp ./src/fish.cpp\n--- ../fish-2.4.0/src/fish.cpp\t2016-11-07 22:20:54.000000000 -0500\n+++ ./src/fish.cpp\t2016-12-29 02:39:05.173696719 -0500\n@@ -421,6 +421,8 @@\n }\n \n int main(int argc, char **argv) {\n+    // Termux patch: Setup TMPDIR for use by fish functions such as funced and psub.\n+    if (getenv(\"TMPDIR\") == NULL) putenv(\"TMPDIR=@TERMUX_PREFIX@/tmp\");\n     int res = 1;\n     int my_optind = 0;\n \n"
  },
  {
    "path": "packages/fish/src-wutil.cpp.patch",
    "content": "diff -u -r ../fish-2.6.0/src/wutil.cpp ./src/wutil.cpp\n--- ../fish-2.6.0/src/wutil.cpp\t2017-06-03 14:45:13.000000000 +0200\n+++ ./src/wutil.cpp\t2017-07-13 22:31:47.791569324 +0200\n@@ -290,7 +290,7 @@\n // have to grub through sys_nerr and sys_errlist directly On GNU toolchain, this will produce a\n // deprecation warning from the linker (!!), which appears impossible to suppress!\n const char *safe_strerror(int err) {\n-#if defined(__UCLIBC__)\n+#if defined(__UCLIBC__) || defined(__ANDROID__)\n     // uClibc does not have sys_errlist, however, its strerror is believed to be async-safe.\n     // See issue #808.\n     return strerror(err);\n"
  },
  {
    "path": "packages/flex/Makefile.in.patch",
    "content": "diff -u -r ../flex-2.6.4/Makefile.in ./Makefile.in\n--- ../flex-2.6.4/Makefile.in\t2017-05-06 16:49:09.000000000 +0200\n+++ ./Makefile.in\t2018-04-29 23:46:48.128733975 +0200\n@@ -453,7 +453,6 @@\n \tdoc \\\n \texamples \\\n \tpo \\\n-\ttests \\\n \ttools\n \n all: all-recursive\n"
  },
  {
    "path": "packages/flex/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/westes/flex\nTERMUX_PKG_DESCRIPTION=\"Fast lexical analyser generator\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=2.6.4\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/westes/flex/releases/download/v${TERMUX_PKG_VERSION}/flex-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995\nTERMUX_PKG_DEPENDS=\"m4\"\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\"ac_cv_path_M4=$TERMUX_PREFIX/bin/m4\"\nTERMUX_PKG_CONFLICTS=\"flex-dev\"\nTERMUX_PKG_REPLACES=\"flex-dev\"\n\n# Work around https://github.com/westes/flex/issues/241 when building\n# under ubuntu 17.10:\nTERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS=\"CFLAGS=-D_GNU_SOURCE=1\"\n\ntermux_step_pre_configure() {\n\tmkdir -p $TERMUX_PKG_BUILDDIR/src/\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/src/stage1flex $TERMUX_PKG_BUILDDIR/src/stage1flex\n\ttouch -d \"next hour\" $TERMUX_PKG_BUILDDIR/src/stage1flex\n}\n"
  },
  {
    "path": "packages/fontconfig/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/fontconfig/\nTERMUX_PKG_DESCRIPTION=\"Library for configuring and customizing font access\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.13.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SHA256=f655dd2a986d7aa97e052261b36aa67b0a64989496361eca8d604e6414006741\nTERMUX_PKG_SRCURL=https://www.freedesktop.org/software/fontconfig/release/fontconfig-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"freetype, libxml2, libpng, libuuid, zlib\"\nTERMUX_PKG_BREAKS=\"fontconfig-dev\"\nTERMUX_PKG_REPLACES=\"fontconfig-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-libxml2\n--enable-iconv=no\n--disable-docs\n--with-default-fonts=/system/fonts\n--with-add-fonts=$TERMUX_PREFIX/share/fonts\n\"\n"
  },
  {
    "path": "packages/fontconfig/fcatomic.c.patch",
    "content": "diff -uNr fontconfig-2.13.1/src/fcatomic.c fontconfig-2.13.1.mod/src/fcatomic.c\n--- fontconfig-2.13.1/src/fcatomic.c\t2018-03-15 10:44:44.000000000 +0200\n+++ fontconfig-2.13.1.mod/src/fcatomic.c\t2018-10-03 02:20:37.073426762 +0300\n@@ -130,15 +130,12 @@\n \tunlink ((char *) atomic->tmp);\n \treturn FcFalse;\n     }\n-    ret = link ((char *) atomic->tmp, (char *) atomic->lck);\n-    if (ret < 0 && (errno == EPERM || errno == ENOTSUP || errno == EACCES))\n-    {\n+\n \t/* the filesystem where atomic->lck points to may not supports\n \t * the hard link. so better try to fallback\n \t */\n \tret = mkdir ((char *) atomic->lck, 0600);\n \tno_link = FcTrue;\n-    }\n     (void) unlink ((char *) atomic->tmp);\n #else\n     ret = mkdir ((char *) atomic->lck, 0600);\n"
  },
  {
    "path": "packages/fontconfig/fontconfig-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin\"\nTERMUX_SUBPKG_DESCRIPTION=\"Fontconfig binaries\"\nTERMUX_SUBPKG_DEPENDS=\"libpng\"\n"
  },
  {
    "path": "packages/fortune/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.fefe.de/fortune/\nTERMUX_PKG_DESCRIPTION=\"Revealer of fortunes\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_VERSION=1.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://dl.fefe.de/fortune-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=cbb246a500366db39ce035632eb4954e09f1e03b28f2c4688864bfa8661b236a\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\t$CC $CFLAGS $LDFLAGS fortune.c -o $TERMUX_PREFIX/bin/fortune\n\tmkdir -p $TERMUX_PREFIX/share/man/man6\n\tcp debian/fortune.6 $TERMUX_PREFIX/share/man/man6/\n\n\tlocal TARFILE=$TERMUX_PKG_CACHEDIR/f.tar.gz\n\ttermux_download \\\n\t\thttp://http.debian.net/debian/pool/main/f/fortune-mod/fortune-mod_1.99.1.orig.tar.gz \\\n\t\t$TARFILE \\\n\t\tfc51aee1f73c936c885f4e0f8b6b48f4f68103e3896eaddc6a45d2b71e14eace\n\n\tcd $TERMUX_PKG_TMPDIR\n\tmkdir datfiles\n\tcd datfiles\n\n\ttar xf $TARFILE\n\tcd fortune-mod-1.99.1/datfiles\n\n\trm -Rf html off Makefile\n\tmkdir -p $TERMUX_PREFIX/share/games/fortunes\n\tcp * $TERMUX_PREFIX/share/games/fortunes\n}\n"
  },
  {
    "path": "packages/fortune/fortune.c.patch",
    "content": "diff -u -r ../fortune-1.2/fortune.c ./fortune.c\n--- ../fortune-1.2/fortune.c\t2008-02-15 08:20:30.000000000 -0500\n+++ ./fortune.c\t2016-04-12 04:08:49.426592095 -0400\n@@ -51,7 +51,7 @@\n #endif\n \n #define VERSION \"1.0\"\n-#define FORTUNEDIR \"/usr/share/games/fortunes\"\n+#define FORTUNEDIR \"@TERMUX_PREFIX@/share/games/fortunes\"\n \n struct option const long_options[] =\n {\n"
  },
  {
    "path": "packages/fossil/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.fossil-scm.org\nTERMUX_PKG_DESCRIPTION=\"DSCM with built-in wiki, http interface and server, tickets database\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=2.9\nTERMUX_PKG_SRCURL=https://www.fossil-scm.org/index.html/uv/fossil-src-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=1cb2ada92d43e3e7e008fe77f5e743d301c7ea34d4c36c42f255f873e73d8b4f\nTERMUX_PKG_DEPENDS=\"libsqlite, openssl, zlib\"\n\ntermux_step_pre_configure() {\n\t# Avoid mixup of flags between cross compilation\n\t# and native build.\n\tCC=\"$CC $CPPFLAGS $CFLAGS $LDFLAGS\"\n\tunset CFLAGS LDFLAGS\n}\n\ntermux_step_configure() {\n\t$TERMUX_PKG_SRCDIR/configure \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--host=$TERMUX_HOST_PLATFORM \\\n\t\t--json \\\n\t\t--disable-internal-sqlite \\\n\t\t--with-openssl=$TERMUX_PREFIX \\\n\t\t--with-zlib=$TERMUX_PREFIX\n}\n\n"
  },
  {
    "path": "packages/fossil/src-main.c.patch",
    "content": "diff -u -r ../fossil-2.6/src/main.c ./src/main.c\n--- ../fossil-2.6/src/main.c\t2018-05-04 12:56:42.000000000 +0000\n+++ ./src/main.c\t2018-09-12 06:03:45.920702759 +0000\n@@ -300,7 +300,7 @@\n   */\n   db_unsave_encryption_key();\n #endif\n-#if defined(_WIN32) || defined(__BIONIC__)\n+#if defined(_WIN32)\n   /*\n   ** Free the secure getpass() buffer now.\n   */\n"
  },
  {
    "path": "packages/fossil/src-popen.c.patch",
    "content": "Index: src/popen.c\n==================================================================\n--- a/src/popen.c\n+++ b/src/popen.c\n@@ -189,11 +189,11 @@\n     close(1);\n     fd = dup(pin[1]);\n     if( fd!=1 ) nErr++;\n     close(pin[0]);\n     close(pin[1]);\n-    execl(\"/bin/sh\", \"/bin/sh\", \"-c\", zCmd, (char*)0);\n+    execl(\"@TERMUX_PREFIX@/bin/sh\", \"@TERMUX_PREFIX@/bin/sh\", \"-c\", zCmd, (char*)0);\n     return 1;\n   }else{\n     /* This is the parent process */\n     close(pin[1]);\n     *pfdIn = pin[0];\n\n"
  },
  {
    "path": "packages/fossil/src-user.c.patch",
    "content": "diff -u -r ../fossil-2.6/src/user.c ./src/user.c\n--- ../fossil-2.6/src/user.c\t2018-05-04 12:56:42.000000000 +0000\n+++ ./src/user.c\t2018-09-12 06:01:49.062037139 +0000\n@@ -40,7 +40,7 @@\n   blob_append(pBlob, z, -1);\n }\n \n-#if defined(_WIN32) || defined(__BIONIC__)\n+#if defined(_WIN32)\n #ifdef _WIN32\n #include <conio.h>\n #endif\n"
  },
  {
    "path": "packages/freetype/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.freetype.org\nTERMUX_PKG_DESCRIPTION=\"Software font engine capable of producing high-quality output\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.10.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=16dbfa488a21fe827dc27eaf708f42f7aa3bb997d745d31a19781628c36ba26f\nTERMUX_PKG_SRCURL=https://download.savannah.gnu.org/releases/freetype/freetype-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_DEPENDS=\"libbz2, libpng, zlib\"\nTERMUX_PKG_BREAKS=\"freetype-dev\"\nTERMUX_PKG_REPLACES=\"freetype-dev\"\n# Use with-harfbuzz=no to avoid circular dependency between freetype and harfbuzz:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-harfbuzz=no\"\n# not install these files anymore so install them manually.\ntermux_step_post_make_install() {\n\tinstall -Dm700 freetype-config $TERMUX_PREFIX/bin/freetype-config\n\tinstall -Dm600 ../src/docs/freetype-config.1 $TERMUX_PREFIX/share/man/man1/freetype-config.1\n}\n\n"
  },
  {
    "path": "packages/fribidi/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/fribidi/fribidi/\nTERMUX_PKG_DESCRIPTION=\"Implementation of the Unicode Bidirectional Algorithm\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.0.7\nTERMUX_PKG_SRCURL=https://github.com/fribidi/fribidi/releases/download/v$TERMUX_PKG_VERSION/fribidi-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=5ab5f21e9f2fc57b4b40f8ea8f14dba78a5cc46d9cf94bc5e00a58e6886a935d\nTERMUX_PKG_DEPENDS=\"glib\"\nTERMUX_PKG_BREAKS=\"fribidi-dev\"\nTERMUX_PKG_REPLACES=\"fribidi-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-docs\"\n"
  },
  {
    "path": "packages/frobtads/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.tads.org/frobtads.htm\nTERMUX_PKG_DESCRIPTION=\"TADS is a free authoring system for writing your own Interactive Fiction\"\nTERMUX_PKG_LICENSE=\"non-free\"\nTERMUX_PKG_VERSION=1.2.4\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/realnc/frobtads/releases/download/$TERMUX_PKG_VERSION/frobtads-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=705be5849293844f499a85280e793941b0eacb362b90d49d85ae8308e4c5b63c\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/frobtads/tads3/doc share/frobtads/tads3/lib/webuires\"\nTERMUX_PKG_DEPENDS=\"libc++, ncurses, libcurl\"\nTERMUX_PKG_LICENSE_FILE=\"doc/COPYING\"\n"
  },
  {
    "path": "packages/frobtads/no_asprintf.patch",
    "content": "diff -u -r ../frobtads-1.2.3/src/osfrobtads.h ./src/osfrobtads.h\n--- ../frobtads-1.2.3/src/osfrobtads.h\t2013-05-17 21:46:51.000000000 +0200\n+++ ./src/osfrobtads.h\t2014-02-24 17:38:59.000000000 +0100\n@@ -428,8 +428,10 @@\n  * that aren't available on all Unix variants.  Eventually these will\n  * need to be replaced with more thorough versions that encompass\n  * other Unix variants. */\n+#ifndef __ANDROID__\n int asprintf(char **strp, const char *fmt, ...);\n int vasprintf(char **strp, const char *fmt, va_list ap);\n+#endif\n #define os_asprintf asprintf\n #define os_vasprintf vasprintf\n \n"
  },
  {
    "path": "packages/fsmon/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/nowsecure/fsmon\nTERMUX_PKG_DESCRIPTION=\"Filesystem monitor with fanotify and inotify backends\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.5\nTERMUX_PKG_SRCURL=https://github.com/nowsecure/fsmon/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=37ea1c83297976f5c7058637a328150dea57743d5eb55ebfc3a8075d262d67c2\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake FANOTIFY_CFLAGS=\"-DHAVE_FANOTIFY=1 -DHAVE_SYS_FANOTIFY=0\"\n}\n"
  },
  {
    "path": "packages/fwknop/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.cipherdyne.org/fwknop/\nTERMUX_PKG_DESCRIPTION=\"fwknop: Single Packet Authorization > Port Knocking\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.6.10\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=f6c09bec97ed8e474a98ae14f9f53e1bcdda33393f20667b6af3fb6bb894ca77\nTERMUX_PKG_SRCURL=https://www.cipherdyne.org/fwknop/download/fwknop-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"gpgme\"\nTERMUX_PKG_BREAKS=\"fwknop-dev\"\nTERMUX_PKG_REPLACES=\"fwknop-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-server\n--with-gpgme\n--with-gpg=$TERMUX_PREFIX/bin/gpg2\n\"\n"
  },
  {
    "path": "packages/fzf/bin-fzf-tmux.patch",
    "content": "diff -u -r ../fzf-0.11.1/bin/fzf-tmux ./bin/fzf-tmux\n--- ../fzf-0.11.1/bin/fzf-tmux\t2015-11-30 10:39:45.000000000 -0500\n+++ ./bin/fzf-tmux\t2016-01-10 19:11:38.223664557 -0500\n@@ -1,4 +1,4 @@\n-#!/usr/bin/env bash\n+#!/usr/bin/bash\n # fzf-tmux: starts fzf in a tmux pane\n # usage: fzf-tmux [-u|-d [HEIGHT[%]]] [-l|-r [WIDTH[%]]] [--] [FZF OPTIONS]\n \n@@ -91,10 +91,10 @@\n \n # Clean up named pipes on exit\n id=$RANDOM\n-argsf=\"${TMPDIR:-/tmp}/fzf-args-$id\"\n-fifo1=\"${TMPDIR:-/tmp}/fzf-fifo1-$id\"\n-fifo2=\"${TMPDIR:-/tmp}/fzf-fifo2-$id\"\n-fifo3=\"${TMPDIR:-/tmp}/fzf-fifo3-$id\"\n+argsf=\"${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-args-$id\"\n+fifo1=\"${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-fifo1-$id\"\n+fifo2=\"${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-fifo2-$id\"\n+fifo3=\"${TMPDIR:-@TERMUX_PREFIX@/tmp}/fzf-fifo3-$id\"\n cleanup() {\n   rm -f $argsf $fifo1 $fifo2 $fifo3\n }\n"
  },
  {
    "path": "packages/fzf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/junegunn/fzf\nTERMUX_PKG_DESCRIPTION=\"Command-line fuzzy finder\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.19.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/junegunn/fzf/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=4d7ee0b621287e64ed450d187e5022d906aa378c5390d8c7c1f843417d2f3422\n\n# Depend on findutils as fzf uses the -fstype option, which busybox\n# find does not support, when invoking find:\nTERMUX_PKG_DEPENDS=\"bash, findutils\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\n\tmkdir -p $GOPATH/src/github.com/junegunn\n\tmv $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/junegunn/fzf\n\tTERMUX_PKG_SRCDIR=$GOPATH/src/github.com/junegunn/fzf\n\n\tcd $GOPATH/src/github.com/junegunn/fzf\n\tgo get -d -v github.com/junegunn/fzf\n\tgo build\n}\n\ntermux_step_make_install() {\n\tcd $GOPATH/src/github.com/junegunn/fzf\n\n\tinstall -Dm700 fzf $TERMUX_PREFIX/bin/fzf\n\n\t# Install fzf-tmux, a bash script for launching fzf in a tmux pane:\n\tinstall -Dm700 $TERMUX_PKG_SRCDIR/bin/fzf-tmux $TERMUX_PREFIX/bin/fzf-tmux\n\n\t# Install the fzf.1 man page:\n\tmkdir -p $TERMUX_PREFIX/share/man/man1/\n\tcp $TERMUX_PKG_SRCDIR/man/man1/fzf.1 $TERMUX_PREFIX/share/man/man1/\n\n\t# Install bash completion script:\n\tmkdir -p $TERMUX_PREFIX/share/bash-completion/completions/\n\tcp $TERMUX_PKG_SRCDIR/shell/completion.bash $TERMUX_PREFIX/share/bash-completion/completions/fzf\n\n\t# Install the rest of the shell scripts:\n\tmkdir -p $TERMUX_PREFIX/share/fzf\n\tcp $TERMUX_PKG_SRCDIR/shell/* $TERMUX_PREFIX/share/fzf/\n\n\t# Install the nvim plugin:\n\tmkdir -p $TERMUX_PREFIX/share/nvim/runtime/plugin\n\tcp $TERMUX_PKG_SRCDIR/plugin/fzf.vim $TERMUX_PREFIX/share/nvim/runtime/plugin/\n}\n"
  },
  {
    "path": "packages/game-repo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/game-packages\nTERMUX_PKG_DESCRIPTION=\"Package repository containing games for termux\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=1.1\nTERMUX_PKG_DEPENDS=\"termux-keyring\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/apt/sources.list.d\n\techo \"deb https://dl.bintray.com/grimler/game-packages-24 games stable\" > $TERMUX_PREFIX/etc/apt/sources.list.d/game.list\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"echo Downloading updated package list ...\" >> postinst\n\techo \"apt update\" >> postinst\n\techo \"exit 0\" >> postinst\n}\n"
  },
  {
    "path": "packages/gawk/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gawk/\nTERMUX_PKG_DESCRIPTION=\"Programming language designed for text processing\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=5.0.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gawk/gawk-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=8e4e86f04ed789648b66f757329743a0d6dfb5294c3b91b756a474f1ce05a794\nTERMUX_PKG_DEPENDS=\"libandroid-support, libgmp, libmpfr, readline\"\nTERMUX_PKG_BREAKS=\"gawk-dev\"\nTERMUX_PKG_REPLACES=\"gawk-dev\"\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/gawk-* bin/igawk share/man/man1/igawk.1\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Remove old symlink to force a fresh timestamp:\n\trm -f $TERMUX_PREFIX/bin/awk\n\n\t# http://cross-lfs.org/view/CLFS-2.1.0/ppc64-64/temp-system/gawk.html\n\tcp -v extension/Makefile.in{,.orig}\n\tsed -e 's/check-recursive all-recursive: check-for-shared-lib-support/check-recursive all-recursive:/' extension/Makefile.in.orig > extension/Makefile.in\n}\n"
  },
  {
    "path": "packages/gawk/io.c.patch",
    "content": "diff -u -r ../gawk-4.2.1/io.c ./io.c\n--- ../gawk-4.2.1/io.c\t2018-02-19 17:55:00.000000000 +0000\n+++ ./io.c\t2018-02-27 11:12:19.067766916 +0000\n@@ -2025,7 +2025,7 @@\n \n \t\tset_sigpipe_to_default();\n \n-\t\texecl(\"/bin/sh\", \"sh\", \"-c\", command, NULL);\n+\t\texecl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", command, NULL);\n \t\t_exit(errno == ENOENT ? 127 : 126);\n \n \tcase -1:\n@@ -2077,7 +2077,7 @@\n \n \t\tsignal(SIGPIPE, SIG_DFL);\n \n-\t\texecl(\"/bin/sh\", \"sh\", \"-c\", command, NULL);\n+\t\texecl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", command, NULL);\n \t\t_exit(errno == ENOENT ? 127 : 126);\n \n \tcase -1:\n@@ -2364,7 +2364,7 @@\n \n \t/* stderr does NOT get dup'ed onto child's stdout */\n #ifdef __EMX__\n-\tpid = spawnl(P_NOWAIT, \"/bin/sh\", \"sh\", \"-c\", str, NULL);\n+\tpid = spawnl(P_NOWAIT, \"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", str, NULL);\n #else  /* __MINGW32__ */\n \tpid = spawnl(P_NOWAIT, getenv(\"ComSpec\"), \"cmd.exe\", \"/c\",\n \t\t     qcmd = quote_cmd(str), NULL);\n@@ -2422,7 +2422,7 @@\n \t\t\tfatal(_(\"close of pipe failed (%s)\"), strerror(errno));\n \t\t/* stderr does NOT get dup'ed onto child's stdout */\n \t\tset_sigpipe_to_default();\n-\t\texecl(\"/bin/sh\", \"sh\", \"-c\", str, NULL);\n+\t\texecl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", str, NULL);\n \t\t_exit(errno == ENOENT ? 127 : 126);\n \t}\n #endif /* NOT __EMX__, NOT __MINGW32__ */\n@@ -2634,7 +2634,7 @@\n \tos_close_on_exec(save_stdout, cmd, \"pipe\", \"from\"); /* saved stdout of the parent process */\n \n #ifdef __EMX__\n-\tpid = spawnl(P_NOWAIT, \"/bin/sh\", \"sh\", \"-c\", cmd, NULL);\n+\tpid = spawnl(P_NOWAIT, \"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", cmd, NULL);\n #else  /* __MINGW32__ */\n \tpid = spawnl(P_NOWAIT, getenv(\"ComSpec\"), \"cmd.exe\", \"/c\",\n \t\t     qcmd = quote_cmd(cmd), NULL);\n@@ -2659,7 +2659,7 @@\n \t\tif (close(p[0]) == -1 || close(p[1]) == -1)\n \t\t\tfatal(_(\"close of pipe failed (%s)\"), strerror(errno));\n \t\tset_sigpipe_to_default();\n-\t\texecl(\"/bin/sh\", \"sh\", \"-c\", cmd, NULL);\n+\t\texecl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", cmd, NULL);\n \t\t_exit(errno == ENOENT ? 127 : 126);\n \t}\n #endif /* NOT __EMX__, NOT __MINGW32__ */\n"
  },
  {
    "path": "packages/gawk/main.c.patch",
    "content": "diff -u -r ../gawk-4.2.1/main.c ./main.c\n--- ../gawk-4.2.1/main.c\t2018-02-23 08:44:11.000000000 +0000\n+++ ./main.c\t2018-10-28 21:59:28.583118833 +0000\n@@ -246,10 +246,12 @@\n \tif ((cp = getenv(\"GAWK_LOCALE_DIR\")) != NULL)\n \t\tlocale_dir = cp;\n \n-#if defined(F_GETFL) && defined(O_APPEND)\n+#if defined(F_GETFL) && defined(O_APPEND) && !defined(__ANDROID__)\n \t// 1/2018: This is needed on modern BSD systems so that the\n \t// inplace tests pass. I think it's a bug in those kernels\n \t// but let's just work around it anyway.\n+\t// Do not do this for Android as it interferes with SELinux,\n+\t// see https://github.com/termux/termux-packages/issues/2979\n \tint flags = fcntl(fileno(stderr), F_GETFL, NULL);\n \tif (flags >= 0 && (flags & O_APPEND) == 0) {\n \t\tflags |= O_APPEND;\n"
  },
  {
    "path": "packages/gawk/no_pw_gecos.patch",
    "content": "diff -u -r ../gawk-4.1.0/awklib/eg/lib/pwcat.c ./awklib/eg/lib/pwcat.c\n--- ../gawk-4.1.0/awklib/eg/lib/pwcat.c\t2013-05-09 15:05:20.000000000 +0200\n+++ ./awklib/eg/lib/pwcat.c\t2014-02-05 23:33:08.000000000 +0100\n@@ -23,6 +23,7 @@\n int\n main(int argc, char **argv)\n {\n+#ifndef __ANDROID__\n     struct passwd *p;\n \n     while ((p = getpwent()) != NULL)\n@@ -37,5 +38,6 @@\n #endif\n \n     endpwent();\n+#endif\n     return 0;\n }\n"
  },
  {
    "path": "packages/gawk/stack_index.patch",
    "content": "diff -u -r ../gawk-4.1.0/extension/stack.c ./extension/stack.c\n--- ../gawk-4.1.0/extension/stack.c\t2013-05-02 21:51:30.000000000 +0200\n+++ ./extension/stack.c\t2014-02-12 16:54:08.000000000 +0100\n@@ -31,14 +31,14 @@\n \n static size_t size;\n static void **stack;\n-static int index = -1;\n+static int stack_index = -1;\n \n /* stack_empty --- return true if stack is empty */\n \n int\n stack_empty()\n {\n-\treturn index < 0;\n+\treturn stack_index < 0;\n }\n \n /* stack_top --- return top object on the stack */\n@@ -49,7 +49,7 @@\n \tif (stack_empty() || stack == NULL)\n \t\treturn NULL;\n \n-\treturn stack[index];\n+\treturn stack[stack_index];\n }\n \n /* stack_pop --- pop top object and return it */\n@@ -60,7 +60,7 @@\n \tif (stack_empty() || stack == NULL)\n \t\treturn NULL;\n \n-\treturn stack[index--];\n+\treturn stack[stack_index--];\n }\n \n /* stack_push --- push an object onto the stack */\n@@ -75,7 +75,7 @@\n \t\tif (stack == NULL)\n \t\t\treturn 0;\n \t\tsize = INITIAL_STACK;\n-\t} else if (index + 1 >= size) {\n+\t} else if (stack_index + 1 >= size) {\n \t\tif (new_size < size)\n \t\t\treturn 0;\n \t\tnew_stack = realloc(stack, new_size * sizeof(void *));\n@@ -85,6 +85,6 @@\n \t\tstack = new_stack;\n \t}\n \n-\tstack[++index] = object;\n+\tstack[++stack_index] = object;\n \treturn 1;\n }\n"
  },
  {
    "path": "packages/gbt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/jtyr/gbt\nTERMUX_PKG_DESCRIPTION=\"Highly configurable prompt builder for Bash and ZSH written in Go\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.0.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/jtyr/gbt/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b324695dc432e8e22bc257f7a6ec576f482ec418fb9c9a8301f47bfdf7766998\n_COMMIT=29dc3dac6c06518073a8e879d2b6ec65291ddab2\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\n\ttermux_setup_golang\n\n\texport GOPATH=$HOME/go\n\tmkdir -p $GOPATH/{bin,pkg,src/github.com/jtyr}\n\tln -fs $TERMUX_PKG_SRCDIR $GOPATH/src/github.com/jtyr/gbt\n\n\tgo 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\n\n\tmkdir -p $TERMUX_PREFIX/{doc/gbt,share/gbt}\n\tcp -r $TERMUX_PKG_SRCDIR/{sources,themes} $TERMUX_PREFIX/share/gbt/\n\tcp -r $TERMUX_PKG_SRCDIR/{LICENSE,README.md} $TERMUX_PREFIX/doc/gbt/\n}\n"
  },
  {
    "path": "packages/gcal/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gcal/\nTERMUX_PKG_DESCRIPTION=\"Program for calculating and printing calendars\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=91b56c40b93eee9bda27ec63e95a6316d848e3ee047b5880ed71e5e8e60f61ab\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gcal/gcal-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_header_spawn_h=no\n\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_post_make_install() {\n\t# XXX: share/info/dir is currently included in emacs.\n\t# We should probably make texinfo regenerate that file\n\t# just as the man package does with the man database.\n\trm -f $TERMUX_PREFIX/share/info/dir\n}\n"
  },
  {
    "path": "packages/gdb/archive_c_st_mtime.patch",
    "content": "diff -u -r ../gdb-7.6.2/bfd/archive.c ./bfd/archive.c\n--- ../gdb-7.6.2/bfd/archive.c\t2013-12-08 05:33:13.000000000 +0100\n+++ ./bfd/archive.c\t2014-01-07 16:43:01.858311352 +0100\n@@ -1880,7 +1880,7 @@\n     {\n       /* Assume we just \"made\" the member, and fake it.  */\n       struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream;\n-      time (&status.st_mtime);\n+      time ((time_t*) &status.st_mtime);\n       status.st_uid = getuid ();\n       status.st_gid = getgid ();\n       status.st_mode = 0644;\n"
  },
  {
    "path": "packages/gdb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gdb/\nTERMUX_PKG_DESCRIPTION=\"The standard GNU Debugger that runs on many Unix-like systems and works for many programming languages\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=8.3.1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gdb/gdb-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4\nTERMUX_PKG_DEPENDS=\"libc++, liblzma, libexpat, readline, ncurses, libmpfr, zlib\"\nTERMUX_PKG_BREAKS=\"gdb-dev\"\nTERMUX_PKG_REPLACES=\"gdb-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-system-readline\n--with-curses\nac_cv_func_getpwent=no\nac_cv_func_getpwnam=no\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gdb/python share/gdb/syscalls share/gdb/system-gdbinit\"\nTERMUX_PKG_MAKE_INSTALL_TARGET=\"-C gdb install\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t# Fix \"undefined reference to 'rpl_gettimeofday'\" when building:\n\texport gl_cv_func_gettimeofday_clobber=no\n\texport gl_cv_func_gettimeofday_posix_signature=yes\n\texport gl_cv_func_realpath_works=yes\n\texport gl_cv_func_lstat_dereferences_slashed_symlink=yes\n\texport gl_cv_func_memchr_works=yes\n\texport gl_cv_func_stat_file_slash=yes\n\texport gl_cv_func_frexp_no_libm=no\n\texport gl_cv_func_strerror_0_works=yes\n\texport gl_cv_func_working_strerror=yes\n\texport gl_cv_func_getcwd_path_max=yes\n}\n"
  },
  {
    "path": "packages/gdb/fix-tmp_prefix.patch",
    "content": "diff -uNr gdb-8.0.1/gdb/compile/compile.c gdb-8.0.1.mod/gdb/compile/compile.c\n--- gdb-8.0.1/gdb/compile/compile.c\t2017-09-07 17:28:11.000000000 +0300\n+++ gdb-8.0.1.mod/gdb/compile/compile.c\t2017-09-14 13:21:59.592863458 +0300\n@@ -44,7 +44,7 @@\n \n /* Initial filename for temporary files.  */\n \n-#define TMP_PREFIX \"/tmp/gdbobj-\"\n+#define TMP_PREFIX \"@TERMUX_PREFIX@/tmp/gdbobj-\"\n \n /* Hold \"compile\" commands.  */\n \n"
  },
  {
    "path": "packages/gdb/gdb-amd64-linux-nat.c.patch",
    "content": "diff -u -r ../gdb-7.11.1/gdb/amd64-linux-nat.c ./gdb/amd64-linux-nat.c\n--- ../gdb-7.11.1/gdb/amd64-linux-nat.c\t2016-02-09 22:19:39.000000000 -0500\n+++ ./gdb/amd64-linux-nat.c\t2016-06-17 17:06:35.515474250 -0400\n@@ -272,8 +272,10 @@\n #endif\n       /* FIXME: ezannoni-2003-07-09 see comment above about include\n \t file order.  We could be getting bogus values for these two.  */\n+#ifndef __ANDROID__\n       gdb_assert (FS < ELF_NGREG);\n       gdb_assert (GS < ELF_NGREG);\n+#endif\n       switch (idx)\n \t{\n \tcase FS:\n"
  },
  {
    "path": "packages/gdb/gdb-cli-cli-cmds.c.patch",
    "content": "diff -u -r ../gdb-8.3/gdb/cli/cli-cmds.c ./gdb/cli/cli-cmds.c\n--- ../gdb-8.3/gdb/cli/cli-cmds.c\t2019-05-11 18:19:02.000000000 +0000\n+++ ./gdb/cli/cli-cmds.c\t2019-05-11 22:43:31.962874247 +0000\n@@ -851,7 +851,7 @@\n     }\n \n   if ((editor = getenv (\"EDITOR\")) == NULL)\n-    editor = \"/bin/ex\";\n+    editor = \"@TERMUX_PREFIX@/bin/applets/vi\";\n \n   fn = symtab_to_fullname (sal.symtab);\n \n"
  },
  {
    "path": "packages/gdb/gdb-common-job-control.c.patch",
    "content": "diff -u -r ../gdb-8.1/gdb/common/job-control.c ./gdb/common/job-control.c\n--- ../gdb-8.1/gdb/common/job-control.c\t2018-01-05 05:07:23.000000000 +0100\n+++ ./gdb/common/job-control.c\t2018-02-01 21:19:44.732858138 +0100\n@@ -45,10 +45,7 @@\n   if (job_control)\n     {\n #ifdef HAVE_SETPGID\n-      /* The call setpgid (0, 0) is supposed to work and mean the same\n-         thing as this, but on Ultrix 4.2A it fails with EPERM (and\n-         setpgid (getpid (), getpid ()) succeeds).  */\n-      retval = setpgid (getpid (), getpid ());\n+      retval = setpgid (0, 0);\n #else\n #ifdef HAVE_SETPGRP\n #ifdef SETPGRP_VOID\n"
  },
  {
    "path": "packages/gdb/gdb-common-pathstuff.c.patch",
    "content": "diff -u -r ../gdb-8.3/gdb/common/pathstuff.c ./gdb/common/pathstuff.c\n--- ../gdb-8.3/gdb/common/pathstuff.c\t2019-02-27 04:51:50.000000000 +0000\n+++ ./gdb/common/pathstuff.c\t2019-05-11 22:45:37.765420769 +0000\n@@ -262,7 +262,7 @@\n   if (tmp != nullptr)\n     return tmp;\n \n-  return \"/tmp\";\n+  return \"@TERMUX_PREFIX@/tmp\";\n #endif\n }\n \n@@ -273,7 +273,7 @@\n {\n   const char *ret = getenv (\"SHELL\");\n   if (ret == NULL)\n-    ret = \"/bin/sh\";\n+    ret = \"@TERMUX_PREFIX@/bin/bash\";\n \n   return ret;\n }\n"
  },
  {
    "path": "packages/gdb/gdb-common-signals-state-save-restore.c.patch",
    "content": "diff -u -r ../gdb-8.1/gdb/common/signals-state-save-restore.c ./gdb/common/signals-state-save-restore.c\n--- ../gdb-8.1/gdb/common/signals-state-save-restore.c\t2018-01-31 03:58:50.000000000 +0100\n+++ ./gdb/common/signals-state-save-restore.c\t2018-02-01 21:38:47.791540495 +0100\n@@ -69,6 +69,7 @@\n \t  && oldact->sa_handler != SIG_DFL\n \t  && oldact->sa_handler != SIG_IGN)\n \t{\n+#ifndef __ANDROID__\n \t  found_preinstalled = true;\n \n \t  /* Use raw fprintf here because we're being called in early\n@@ -78,6 +79,7 @@\n \t\t   _(\"warning: Found custom handler for signal \"\n \t\t     \"%d (%s) preinstalled.\\n\"), i,\n \t\t   strsignal (i));\n+#endif\n \t}\n     }\n \n"
  },
  {
    "path": "packages/gdb/gdb-gdbserver-configure.patch",
    "content": "diff -u -r ../gdb-7.11/gdb/gdbserver/configure ./gdb/gdbserver/configure\n--- ../gdb-7.11/gdb/gdbserver/configure\t2016-02-09 22:19:39.000000000 -0500\n+++ ./gdb/gdbserver/configure\t2016-03-10 10:17:40.111988028 -0500\n@@ -6735,17 +6735,6 @@\n \n \n case \"${target}\" in\n-  *-android*)\n-    # Starting with NDK version 9, <elf.h> actually includes definitions\n-    # of Elf32_auxv_t and Elf64_auxv_t. But sadly, <elf.h> includes\n-    # <sys/exec_elf.h> which defines some of the ELF types incorrectly,\n-    # leading to conflicts with the defintions from <linux/elf.h>.\n-    # This makes it impossible for us to include both <elf.h> and\n-    # <linux/elf.h>, which means that, in practice, we do not have\n-    # access to Elf32_auxv_t and Elf64_auxv_t on this platform.\n-    # Therefore, do not try to auto-detect availability, as it would\n-    # get it wrong on this platform.\n-    ;;\n   *)\n     ac_fn_c_check_type \"$LINENO\" \"Elf32_auxv_t\" \"ac_cv_type_Elf32_auxv_t\" \"#include <elf.h>\n \n"
  },
  {
    "path": "packages/gdb/gdb-gnulib-import-string.in.h.patch",
    "content": "diff -u -r ../gdb-8.1/gdb/gnulib/import/string.in.h ./gdb/gnulib/import/string.in.h\n--- ../gdb-8.1/gdb/gnulib/import/string.in.h\t2017-06-04 17:51:26.000000000 +0200\n+++ ./gdb/gnulib/import/string.in.h\t2018-02-01 22:09:38.398023253 +0100\n@@ -183,9 +183,8 @@\n #if @GNULIB_MEMPCPY@\n # if ! @HAVE_MEMPCPY@\n _GL_FUNCDECL_SYS (mempcpy, void *,\n-                  (void *restrict __dest, void const *restrict __src,\n-                   size_t __n)\n-                  _GL_ARG_NONNULL ((1, 2)));\n+                  (void * __dest, void const * __src,\n+                   size_t __n));\n # endif\n _GL_CXXALIAS_SYS (mempcpy, void *,\n                   (void *restrict __dest, void const *restrict __src,\n"
  },
  {
    "path": "packages/gdb/gdb-ser-pipe.c.patch",
    "content": "diff -u -r ../gdb-8.1/gdb/ser-pipe.c ./gdb/ser-pipe.c\n--- ../gdb-8.1/gdb/ser-pipe.c\t2018-01-05 04:07:23.000000000 +0000\n+++ ./gdb/ser-pipe.c\t2018-01-31 22:21:26.902931647 +0000\n@@ -122,7 +122,7 @@\n \t}\n \n       close_most_fds ();\n-      execl (\"/bin/sh\", \"sh\", \"-c\", name, (char *) 0);\n+      execl (\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", name, (char *) 0);\n       _exit (127);\n     }\n \n"
  },
  {
    "path": "packages/gdb/gdb-solib.c.patch",
    "content": "diff -u -r ../gdb-7.10.1/gdb/solib.c ./gdb/solib.c\n--- ../gdb-7.10.1/gdb/solib.c\t2015-12-05 10:16:45.000000000 -0500\n+++ ./gdb/solib.c\t2016-02-07 17:29:11.431584611 -0500\n@@ -1703,6 +1703,16 @@\n   add_alias_cmd (\"solib-absolute-prefix\", \"sysroot\", class_support, 0,\n \t\t &showlist);\n \n+#ifdef __ANDROID__\n+  /* Termux modification to find system shared libraries. */\n+  solib_search_path =\n+# ifdef __LP64__\n+    \"/system/lib64:/system/vendor/lib64\";\n+# else\n+    \"/system/lib:/system/vendor/lib\";\n+# endif\n+#endif\n+\n   add_setshow_optional_filename_cmd (\"solib-search-path\", class_support,\n \t\t\t\t     &solib_search_path, _(\"\\\n Set the search path for loading non-absolute shared library symbol files.\"),\n"
  },
  {
    "path": "packages/gdb/gregset.h.patch",
    "content": "diff -u -r ../gdb-7.8.1/gdb/gregset.h ./gdb/gregset.h\n--- ../gdb-7.8.1/gdb/gregset.h\t2014-06-11 12:34:41.000000000 -0400\n+++ ./gdb/gregset.h\t2014-12-22 07:09:39.011700414 -0500\n@@ -23,13 +23,7 @@\n #include <sys/procfs.h>\n #endif\n \n-#ifndef GDB_GREGSET_T\n-#define GDB_GREGSET_T gregset_t\n-#endif\n-\n-#ifndef GDB_FPREGSET_T\n-#define GDB_FPREGSET_T fpregset_t\n-#endif\n+#include \"nm.h\"\n \n typedef GDB_GREGSET_T gdb_gregset_t;\n typedef GDB_FPREGSET_T gdb_fpregset_t;\n"
  },
  {
    "path": "packages/gdb/linux_thread_db_no_th_unique.patch",
    "content": "diff -u -r ../gdb-7.6.2/gdb/linux-thread-db.c ./gdb/linux-thread-db.c\n--- ../gdb-7.6.2/gdb/linux-thread-db.c\t2013-12-08 05:33:13.000000000 +0100\n+++ ./gdb/linux-thread-db.c\t2014-01-07 16:43:01.866311352 +0100\n@@ -447,9 +447,6 @@\n   struct thread_db_info *info;\n   struct thread_get_info_inout io = {0};\n \n-  /* Just in case td_ta_map_lwp2thr doesn't initialize it completely.  */\n-  th.th_unique = 0;\n-\n   /* This ptid comes from linux-nat.c, which should always fill in the\n      LWP.  */\n   gdb_assert (GET_LWP (ptid) != 0);\n"
  },
  {
    "path": "packages/gdb/readline-histlib.h.patch.debug",
    "content": "--- ./readline/histlib.h\t2017-06-04 15:51:27.000000000 +0000\n+++ ../histlib.h\t2018-03-21 15:09:37.286670845 +0000\n@@ -52,7 +52,7 @@\n \n #ifndef member\n #  ifndef strchr\n-extern char *strchr ();\n+extern char __attribute__((overloadable)) *strchr ();\n #  endif\n #define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)\n #endif\n"
  },
  {
    "path": "packages/gdb/readline.patch",
    "content": "diff -u -r ../gdb-7.6.2/readline/complete.c ./readline/complete.c\n--- ../gdb-7.6.2/readline/complete.c\t2013-12-08 05:11:52.000000000 +0100\n+++ ./readline/complete.c\t2014-01-07 16:43:59.170309785 +0100\n@@ -2026,7 +2026,7 @@\n      const char *text;\n      int state;\n {\n-#if defined (__WIN32__) || defined (__OPENNT)\n+#if defined (__WIN32__) || defined (__OPENNT) || defined (__ANDROID__)\n   return (char *)NULL;\n #else /* !__WIN32__ && !__OPENNT) */\n   static char *username = (char *)NULL;\n"
  },
  {
    "path": "packages/gdbm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org.ua/software/gdbm/\nTERMUX_PKG_DESCRIPTION=\"Library of database functions that use extensible hashing\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.18.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc\nTERMUX_PKG_BREAKS=\"gdbm-dev\"\nTERMUX_PKG_REPLACES=\"gdbm-dev\"\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gdbm/gdbm-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-readline --enable-libgdbm-compat\"\n"
  },
  {
    "path": "packages/gdbm/termios_h.patch",
    "content": "diff -r -u ../gdbm-1.10.90/src/gdbmtool.c ./src/gdbmtool.c\n--- ../gdbm-1.10.90/src/gdbmtool.c\t2013-05-16 22:22:16.000000000 +0200\n+++ ./src/gdbmtool.c\t2014-02-04 03:38:54.000000000 +0100\n@@ -24,9 +24,7 @@\n #include <signal.h>\n #include <pwd.h>\n #include <sys/ioctl.h>\n-#ifdef HAVE_SYS_TERMIOS_H\n-# include <sys/termios.h>\n-#endif\n+#include <termios.h>\n #include <stdarg.h>\n #ifdef HAVE_LOCALE_H\n # include <locale.h>\n"
  },
  {
    "path": "packages/gdk-pixbuf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://developer.gnome.org/gdk-pixbuf/\nTERMUX_PKG_DESCRIPTION=\"Library for image loading and manipulation\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_VERSION=2.40.0\nTERMUX_PKG_SRCURL=ftp://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/${TERMUX_PKG_VERSION:0:4}/gdk-pixbuf-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=1582595099537ca8ff3b99c6804350b4c058bb8ad67411bbaae024ee7cead4e6\nTERMUX_PKG_DEPENDS=\"glib, libpng, libtiff, libjpeg-turbo\"\nTERMUX_PKG_BREAKS=\"gdk-pixbuf-dev\"\nTERMUX_PKG_REPLACES=\"gdk-pixbuf-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-Dgio_sniffing=false\n-Dgir=false\n-Dx11=false\n\"\n"
  },
  {
    "path": "packages/gegl/6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8.patch",
    "content": "From 6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8 Mon Sep 17 00:00:00 2001\nFrom: Christoph Reiter <reiter.christoph@gmail.com>\nDate: Sun, 27 Oct 2019 14:10:08 +0100\nSubject: [PATCH] meson: fix cpu detection\n\nUse host_machine.cpu_family() instead of cpu(). Only the former\nprovides a stable/defined set of values.\n\nAlso don't error out on some arches for no good reason.\n\nThis fixes the build on 32bit Windows.\n---\n meson.build | 12 +++++-------\n 1 file changed, 5 insertions(+), 7 deletions(-)\n\ndiff --git a/meson.build b/meson.build\nindex af133a0f1..540498921 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -73,23 +73,21 @@ if os_osx and cc.get_id() != 'clang'\n endif\n \n \n-host_cpu = host_machine.cpu()\n-if   host_cpu.startswith('i') and host_cpu.endswith('86')\n+host_cpu_family = host_machine.cpu_family()\n+if   host_cpu_family == 'x86'\n   have_x86 = true\n   config.set10('ARCH_X86',    true)\n-elif host_cpu == 'x86_64'\n+elif host_cpu_family == 'x86_64'\n   have_x86 = true\n   config.set10('ARCH_X86',    true)\n   config.set10('ARCH_X86_64', true)\n-elif host_cpu == 'ppc' or host_cpu == 'powerpc'\n+elif host_cpu_family == 'ppc'\n   have_ppc = true\n   config.set10('ARCH_PPC',    true)\n-elif host_cpu == 'ppc64' or host_cpu == 'powerpc64'\n+elif host_cpu_family == 'ppc64'\n   have_ppc = true\n   config.set10('ARCH_PPC',    true)\n   config.set10('ARCH_PPC64',  true)\n-else\n-  error('Unknown host architecture')\n endif\n \n ################################################################################\n"
  },
  {
    "path": "packages/gegl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://gegl.org/\nTERMUX_PKG_DESCRIPTION=\"Data flow based image processing framework\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.4.18\nTERMUX_PKG_SRCURL=https://download.gimp.org/pub/gegl/${TERMUX_PKG_VERSION:0:3}/gegl-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=c946dfb45beb7fe0fb95b89a25395b449eda2b205ba3e8a1ffb1ef992d9eca64\nTERMUX_PKG_DEPENDS=\"libandroid-support, libc++, ffmpeg, babl, json-glib, libjpeg-turbo, libpng, libjasper, littlecms, libtiff, librsvg, zlib\"\nTERMUX_PKG_BREAKS=\"gegl-dev\"\nTERMUX_PKG_REPLACES=\"gegl-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-Dintrospection=false\"\n"
  },
  {
    "path": "packages/geoip2-database/build.sh",
    "content": "\nTERMUX_PKG_HOMEPAGE=https://dev.maxmind.com/geoip/geoip2/geolite2/\nTERMUX_PKG_DESCRIPTION=\"GeoLite2 IP geolocation databases compiled by MaxMind\"\nTERMUX_PKG_LICENSE=\"CC0-1.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\n# MaxMind removed databases from public access:\n# https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/\n# Reusing files from the our last build (2019.12.21).\nTERMUX_PKG_VERSION=20191221\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://dl.bintray.com/xeffyr/sources/geoip2-database/geolite2-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=7afd73d90325d4a8aa3707c0c4a34f89a4b469fe43b4f3a3d69da23884af1e70\n\ntermux_step_make_install() {\n\tinstall -Dm600 \\\n\t\t-t \"$TERMUX_PREFIX\"/share/GeoIP/ \\\n\t\t\"${TERMUX_PKG_SRCDIR}\"/GeoLite2-{ASN,Country,City}.mmdb\n}"
  },
  {
    "path": "packages/getconf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/getconf\nTERMUX_PKG_DESCRIPTION=\"Utility to print configuration values\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=0.5\nTERMUX_PKG_SHA256=8192701051d2a2bf8d1ae7b1c0922c3f1d4a039b9ad99496636b0122667d595c\nTERMUX_PKG_SRCURL=https://github.com/termux/getconf/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/geth/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://geth.ethereum.org/\nTERMUX_PKG_DESCRIPTION=\"Go implementation of the Ethereum protocol\"\nTERMUX_PKG_LICENSE=\"LGPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.9.6\nTERMUX_PKG_SRCURL=https://github.com/ethereum/go-ethereum/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3000f787735ee302088d17d406eafc2ec26eaffc083d876b2fa07ec7dfbb94f9\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/github.com/ethereum\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/ethereum/go-ethereum\n\n\tcd \"$GOPATH\"/src/github.com/ethereum/go-ethereum\n\tfor applet in geth abigen bootnode ethkey evm rlpdump puppeth; do\n\t\t(cd ./cmd/\"$applet\" && go build -v)\n\tdone\n\tunset applet\n}\n\ntermux_step_make_install() {\n\tfor applet in geth abigen bootnode ethkey evm rlpdump puppeth; do\n\t\tinstall -Dm700 \\\n\t\t\t\"$TERMUX_PKG_SRCDIR/cmd/$applet/$applet\" \\\n\t\t\t\"$TERMUX_PREFIX\"/bin/\n\tdone\n\tunset applet\n}\n"
  },
  {
    "path": "packages/geth/fix-names-conflict.patch",
    "content": "--- go-ethereum-1.8.23/vendor/github.com/karalabe/usb/hidapi/libusb/hid.c\t2019-02-20 10:48:12.000000000 +0200\n+++ go-ethereum-1.8.23.mod/vendor/github.com/karalabe/usb/hidapi/libusb/hid.c\t2019-04-10 12:56:56.087538378 +0300\n@@ -60,9 +60,9 @@\n     pthread_cond_t cond;\n     int count;\n     int trip_count;\n-} pthread_barrier_t;\n+} _pthread_barrier_t;\n\n-static int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)\n+static int _pthread_barrier_init(_pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)\n {\n \tif(count == 0) {\n \t\terrno = EINVAL;\n@@ -82,14 +82,14 @@\n \treturn 0;\n }\n\n-static int pthread_barrier_destroy(pthread_barrier_t *barrier)\n+static int _pthread_barrier_destroy(_pthread_barrier_t *barrier)\n {\n \tpthread_cond_destroy(&barrier->cond);\n \tpthread_mutex_destroy(&barrier->mutex);\n \treturn 0;\n }\n\n-static int pthread_barrier_wait(pthread_barrier_t *barrier)\n+static int _pthread_barrier_wait(_pthread_barrier_t *barrier)\n {\n \tpthread_mutex_lock(&barrier->mutex);\n \t++(barrier->count);\n@@ -164,7 +164,7 @@\n \tpthread_t thread;\n \tpthread_mutex_t mutex; /* Protects input_reports */\n \tpthread_cond_t condition;\n-\tpthread_barrier_t barrier; /* Ensures correct startup sequence */\n+\t_pthread_barrier_t barrier; /* Ensures correct startup sequence */\n \tint shutdown_thread;\n \tint cancelled;\n \tstruct libusb_transfer *transfer;\n@@ -185,7 +185,7 @@\n\n \tpthread_mutex_init(&dev->mutex, NULL);\n \tpthread_cond_init(&dev->condition, NULL);\n-\tpthread_barrier_init(&dev->barrier, NULL, 2);\n+\t_pthread_barrier_init(&dev->barrier, NULL, 2);\n\n \treturn dev;\n }\n@@ -193,7 +193,7 @@\n static void free_hid_device(hid_device *dev)\n {\n \t/* Clean up the thread objects */\n-\tpthread_barrier_destroy(&dev->barrier);\n+\t_pthread_barrier_destroy(&dev->barrier);\n \tpthread_cond_destroy(&dev->condition);\n \tpthread_mutex_destroy(&dev->mutex);\n\n@@ -817,7 +817,7 @@\n \tlibusb_submit_transfer(dev->transfer);\n\n \t/* Notify the main thread that the read thread is up and running. */\n-\tpthread_barrier_wait(&dev->barrier);\n+\t_pthread_barrier_wait(&dev->barrier);\n\n \t/* Handle all the events. */\n \twhile (!dev->shutdown_thread) {\n@@ -973,7 +973,7 @@\n \t\t\t\t\t\tpthread_create(&dev->thread, NULL, read_thread, dev);\n\n \t\t\t\t\t\t/* Wait here for the read thread to be initialized. */\n-\t\t\t\t\t\tpthread_barrier_wait(&dev->barrier);\n+\t\t\t\t\t\t_pthread_barrier_wait(&dev->barrier);\n\n \t\t\t\t\t}\n \t\t\t\t\tfree(dev_path);\n"
  },
  {
    "path": "packages/geth/geth-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Additional utilities for Geth (like abigen, bootnode, evm, puppeth)\"\n\nTERMUX_SUBPKG_INCLUDE=\"\nbin/abigen\nbin/bootnode\nbin/ethkey\nbin/evm\nbin/rlpdump\nbin/swarm\nbin/puppeth\"\n"
  },
  {
    "path": "packages/getmail/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://pyropus.ca/software/getmail/\nTERMUX_PKG_DESCRIPTION=\"fetchmail replacement relatively easy to configure\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=5.14\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/getmail-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=f3a99fe74564237d12ca8d4582e113c067c9205b5ab640f72b4e8447606a99c1\nTERMUX_PKG_DEPENDS=\"python2\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tpython2 setup.py install --prefix=$TERMUX_PREFIX --force\n}\n\ntermux_step_post_massage() {\n\tfind . -path '*.pyc' -delete\n}\n"
  },
  {
    "path": "packages/getmail/utilities.py.patch",
    "content": "diff -u -r ../getmail-5.1/getmailcore/utilities.py ./getmailcore/utilities.py\n--- ../getmail-5.1/getmailcore/utilities.py\t2017-07-16 05:26:01.000000000 +0200\n+++ ./getmailcore/utilities.py\t2017-07-26 13:36:30.196152312 +0200\n@@ -47,6 +47,7 @@\n import sys\n import tempfile\n import errno\n+import shutil\n try:\n     import subprocess\n except ImportError, o:\n@@ -340,7 +341,7 @@\n \n     # Move message file from Maildir/tmp to Maildir/new\n     try:\n-        os.link(fname_tmp, fname_new)\n+        shutil.copy2(fname_tmp, fname_new)\n         os.unlink(fname_tmp)\n \n     except OSError:\n"
  },
  {
    "path": "packages/gettext/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gettext/\nTERMUX_PKG_DESCRIPTION=\"GNU Internationalization utilities\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.20.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gettext/gettext-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=53f02fbbec9e798b0faaf7c73272f83608e835c6288dd58be6c9bb54624a3800\nTERMUX_PKG_DEPENDS=\"libc++, libiconv, pcre, liblzma, libxml2, libcroco, ncurses, libunistring, zlib\"\nTERMUX_PKG_BREAKS=\"gettext-dev\"\nTERMUX_PKG_REPLACES=\"gettext-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tautoreconf\n}\n"
  },
  {
    "path": "packages/gettext/gnulib-libmakefile.am.patch",
    "content": "diff -uNr gettext-0.20.1/gettext-tools/gnulib-lib/Makefile.am gettext-0.20.1.mod/gettext-tools/gnulib-lib/Makefile.am\n--- gettext-0.20.1/gettext-tools/gnulib-lib/Makefile.am\t2019-04-11 12:22:44.000000000 +0300\n+++ gettext-0.20.1.mod/gettext-tools/gnulib-lib/Makefile.am\t2019-05-21 15:02:52.740488355 +0300\n@@ -73,10 +73,11 @@\n RELOCATABLE_LIBRARY_PATH = $(libdir)\n \n # Linking with C++ libraries is needed _only_ on mingw and Cygwin.\n+# .. termux edit because i can't be bothered fixing it properly.\n if !WOE32DLL\n libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \\\n \t$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \\\n-\t$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(libgettextlib_la_LDFLAGS) $(LDFLAGS) \\\n+\t$(CCLD) $(AM_CFLAGS) $(CFLAGS) -lcroco-0.6 -lglib-2.0 -landroid-support -lpcre -lxml2 -lz -llzma -lm -lncurses -lunistring -liconv $(LDFLAGS) \\\n \t-o $@\n else\n libgettextlib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \\\n"
  },
  {
    "path": "packages/gettext/msginit.c.patch",
    "content": "diff -uNr gettext-0.20.1/gettext-tools/src/msginit.c gettext-0.20.1.mod/gettext-tools/src/msginit.c\n--- gettext-0.20.1/gettext-tools/src/msginit.c\t2019-05-12 00:11:31.000000000 +0300\n+++ gettext-0.20.1.mod/gettext-tools/src/msginit.c\t2019-05-21 15:05:49.363213216 +0300\n@@ -1136,6 +1136,7 @@\n static const char *\n get_user_fullname ()\n {\n+#ifndef __ANDROID__\n #if HAVE_PWD_H\n   struct passwd *pwd;\n \n@@ -1159,7 +1160,7 @@\n       return result;\n     }\n #endif\n-\n+#endif\n   return NULL;\n }\n \n"
  },
  {
    "path": "packages/gflags/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/gflags/gflags\nTERMUX_PKG_DESCRIPTION=\"A C++ library that implements commandline flags processing\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.2.2\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://github.com/gflags/gflags/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"gflags-dev\"\nTERMUX_PKG_REPLACES=\"gflags-dev\"\nTERMUX_PKG_FORCE_CMAKE=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBUILD_SHARED_LIBS=ON\n-DBUILD_STATIC_LIBS=ON\n-DBUILD_gflags_LIBS=ON\n-DINSTALL_HEADERS=ON\n\"\n\ntermux_step_post_make_install() {\n\t#Any old packages using the library name of libgflags\n\tln -sfr \"$TERMUX_PREFIX\"/lib/pkgconfig/gflags.pc \\\n\t\t\"$TERMUX_PREFIX\"/lib/pkgconfig/libgflags.pc\n}\n"
  },
  {
    "path": "packages/ghostscript/arch-aarch64.h",
    "content": "/* Parameters derived from machine and compiler architecture. */\n/* This file is generated mechanically by genarch.c. */\n\n\t /* ---------------- Scalar alignments ---------------- */\n\n#define ARCH_ALIGN_SHORT_MOD 2\n#define ARCH_ALIGN_INT_MOD 4\n#define ARCH_ALIGN_LONG_MOD 8\n#define ARCH_ALIGN_PTR_MOD 8\n#define ARCH_ALIGN_FLOAT_MOD 4\n#define ARCH_ALIGN_DOUBLE_MOD 8\n\n\t /* ---------------- Scalar sizes ---------------- */\n\n#define ARCH_LOG2_SIZEOF_CHAR 0\n#define ARCH_LOG2_SIZEOF_SHORT 1\n#define ARCH_LOG2_SIZEOF_INT 2\n#define ARCH_LOG2_SIZEOF_LONG 3\n#define ARCH_LOG2_SIZEOF_LONG_LONG 3\n#define ARCH_SIZEOF_GX_COLOR_INDEX 8\n#define ARCH_SIZEOF_PTR 8\n#define ARCH_SIZEOF_FLOAT 4\n#define ARCH_SIZEOF_DOUBLE 8\n#define ARCH_FLOAT_MANTISSA_BITS 24\n#define ARCH_DOUBLE_MANTISSA_BITS 53\n\n\t /* ---------------- Unsigned max values ---------------- */\n\n#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)\n#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)\n#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)\n#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)\n\n\t /* ---------------- Miscellaneous ---------------- */\n\n#define ARCH_IS_BIG_ENDIAN 0\n#define ARCH_PTRS_ARE_SIGNED 0\n#define ARCH_FLOATS_ARE_IEEE 1\n#define ARCH_ARITH_RSHIFT 2\n#define ARCH_DIV_NEG_POS_TRUNCATES 1\n"
  },
  {
    "path": "packages/ghostscript/arch-arm.h",
    "content": "/* Parameters derived from machine and compiler architecture. */\n/* This file is generated mechanically by genarch.c. */\n\n\t /* ---------------- Scalar alignments ---------------- */\n\n#define ARCH_ALIGN_SHORT_MOD 2\n#define ARCH_ALIGN_INT_MOD 4\n#define ARCH_ALIGN_LONG_MOD 4\n#define ARCH_ALIGN_PTR_MOD 4\n#define ARCH_ALIGN_FLOAT_MOD 4\n#define ARCH_ALIGN_DOUBLE_MOD 8\n\n\t /* ---------------- Scalar sizes ---------------- */\n\n#define ARCH_LOG2_SIZEOF_CHAR 0\n#define ARCH_LOG2_SIZEOF_SHORT 1\n#define ARCH_LOG2_SIZEOF_INT 2\n#define ARCH_LOG2_SIZEOF_LONG 2\n#define ARCH_LOG2_SIZEOF_LONG_LONG 3\n#define ARCH_SIZEOF_GX_COLOR_INDEX 8\n#define ARCH_SIZEOF_PTR 4\n#define ARCH_SIZEOF_FLOAT 4\n#define ARCH_SIZEOF_DOUBLE 8\n#define ARCH_FLOAT_MANTISSA_BITS 24\n#define ARCH_DOUBLE_MANTISSA_BITS 53\n\n\t /* ---------------- Unsigned max values ---------------- */\n\n#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)\n#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)\n#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)\n#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)\n\n\t /* ---------------- Miscellaneous ---------------- */\n\n#define ARCH_IS_BIG_ENDIAN 0\n#define ARCH_PTRS_ARE_SIGNED 0\n#define ARCH_FLOATS_ARE_IEEE 1\n#define ARCH_ARITH_RSHIFT 2\n#define ARCH_DIV_NEG_POS_TRUNCATES 1\n"
  },
  {
    "path": "packages/ghostscript/arch-i686.h",
    "content": "/* Parameters derived from machine and compiler architecture. */\n/* This file is generated mechanically by genarch.c. */\n\n\t /* ---------------- Scalar alignments ---------------- */\n\n#define ARCH_ALIGN_SHORT_MOD 2\n#define ARCH_ALIGN_INT_MOD 4\n#define ARCH_ALIGN_LONG_MOD 4\n#define ARCH_ALIGN_PTR_MOD 4\n#define ARCH_ALIGN_FLOAT_MOD 4\n#define ARCH_ALIGN_DOUBLE_MOD 4\n\n\t /* ---------------- Scalar sizes ---------------- */\n\n#define ARCH_LOG2_SIZEOF_CHAR 0\n#define ARCH_LOG2_SIZEOF_SHORT 1\n#define ARCH_LOG2_SIZEOF_INT 2\n#define ARCH_LOG2_SIZEOF_LONG 2\n#define ARCH_LOG2_SIZEOF_LONG_LONG 3\n#define ARCH_SIZEOF_GX_COLOR_INDEX 8\n#define ARCH_SIZEOF_PTR 4\n#define ARCH_SIZEOF_FLOAT 4\n#define ARCH_SIZEOF_DOUBLE 8\n#define ARCH_FLOAT_MANTISSA_BITS 24\n#define ARCH_DOUBLE_MANTISSA_BITS 53\n\n\t /* ---------------- Unsigned max values ---------------- */\n\n#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)\n#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)\n#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)\n#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)\n\n\t /* ---------------- Miscellaneous ---------------- */\n\n#define ARCH_IS_BIG_ENDIAN 0\n#define ARCH_PTRS_ARE_SIGNED 0\n#define ARCH_FLOATS_ARE_IEEE 1\n#define ARCH_ARITH_RSHIFT 2\n#define ARCH_DIV_NEG_POS_TRUNCATES 1\n"
  },
  {
    "path": "packages/ghostscript/arch-x86_64.h",
    "content": "/* Parameters derived from machine and compiler architecture. */\n/* This file is generated mechanically by genarch.c. */\n\n\t /* ---------------- Scalar alignments ---------------- */\n\n#define ARCH_ALIGN_SHORT_MOD 2\n#define ARCH_ALIGN_INT_MOD 4\n#define ARCH_ALIGN_LONG_MOD 8\n#define ARCH_ALIGN_PTR_MOD 8\n#define ARCH_ALIGN_FLOAT_MOD 4\n#define ARCH_ALIGN_DOUBLE_MOD 8\n\n\t /* ---------------- Scalar sizes ---------------- */\n\n#define ARCH_LOG2_SIZEOF_CHAR 0\n#define ARCH_LOG2_SIZEOF_SHORT 1\n#define ARCH_LOG2_SIZEOF_INT 2\n#define ARCH_LOG2_SIZEOF_LONG 3\n#define ARCH_LOG2_SIZEOF_LONG_LONG 3\n#define ARCH_SIZEOF_GX_COLOR_INDEX 8\n#define ARCH_SIZEOF_PTR 8\n#define ARCH_SIZEOF_FLOAT 4\n#define ARCH_SIZEOF_DOUBLE 8\n#define ARCH_FLOAT_MANTISSA_BITS 24\n#define ARCH_DOUBLE_MANTISSA_BITS 53\n\n\t /* ---------------- Unsigned max values ---------------- */\n\n#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)\n#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)\n#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)\n#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)\n\n\t /* ---------------- Miscellaneous ---------------- */\n\n#define ARCH_IS_BIG_ENDIAN 0\n#define ARCH_PTRS_ARE_SIGNED 0\n#define ARCH_FLOATS_ARE_IEEE 1\n#define ARCH_ARITH_RSHIFT 2\n#define ARCH_DIV_NEG_POS_TRUNCATES 1\n"
  },
  {
    "path": "packages/ghostscript/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.ghostscript.com/\nTERMUX_PKG_DESCRIPTION=\"Interpreter for the PostScript language and for PDF\"\nTERMUX_PKG_LICENSE=\"AGPL-V3\"\nTERMUX_PKG_VERSION=9.50\nTERMUX_PKG_SHA256=dd94c5a06c03c58b47b929d03260f491d4807eaf5be83abd283278927b11c9ee\nTERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${TERMUX_PKG_VERSION//.}/ghostpdl-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv, libtiff, libjpeg-turbo, libpng, libexpat, freetype, fontconfig, libidn, littlecms, openjpeg\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_lcms2__cmsCreateMutex=yes\nCCAUX=gcc\n--build=$TERMUX_BUILD_TUPLE\n--enable-little-endian\n--with-arch_h=$TERMUX_PKG_BUILDER_DIR/arch-${TERMUX_ARCH}.h\n--without-pcl\n--without-x\n--with-system-libtiff\n\"\n\ntermux_step_post_extract_package() {\n\trm -rdf $TERMUX_PKG_SRCDIR/{jpeg,libpng,expat,jasper,freetype,lcms2,tiff,openjpeg}\n}\n\ntermux_step_pre_configure() {\n\t# Use `make -j1` otherwise build may fail with error\n\t# about missing 'arch.h'.\n\tTERMUX_MAKE_PROCESSES=1\n}\n"
  },
  {
    "path": "packages/ghostscript/configure.patch",
    "content": "--- ./configure\t2017-03-16 10:12:59.000000000 +0000\n+++ ./configure\t2017-03-18 15:14:30.363309054 +0000\n@@ -3772,7 +3772,7 @@\n   echo $AUXFLAGS_MAK_LINE06 >> $AUXFLAGS_MAK.in\n   echo $AUXFLAGS_MAK_LINE07 >> $AUXFLAGS_MAK.in\n \n-  ../$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=\"\"\n+  $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=\"\"\n   status=$?\n   cp config.log ../configaux.log\n   if test $status -eq 0 ; then\n"
  },
  {
    "path": "packages/ghostscript/gserrors.h.patch",
    "content": "--- ./base/gserrors.h\t2017-03-16 09:20:11.000000000 +0000\n+++ ./base/gserrors.h\t2017-03-18 21:02:46.586737629 +0000\n@@ -148,14 +148,13 @@\n  *\n  */\n \n-#ifndef __printflike\n+/* Redefine cdefs.h's __printflike function: */\n #if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7\n #define __printflike(fmtarg, firstvararg) \\\n     __attribute__((__format__ (__printf__, fmtarg, firstvararg)))\n #else\n #define __printflike(fmtarg, firstvararg)\n #endif\n-#endif\n \n const char *gs_errstr(int code);\n \n"
  },
  {
    "path": "packages/giflib/Makefile.patch",
    "content": "diff -u -r ../giflib-5.1.9/Makefile ./Makefile\n--- ../giflib-5.1.9/Makefile\t2019-03-28 18:57:23.000000000 +0000\n+++ ./Makefile\t2019-03-29 22:55:30.125971028 +0000\n@@ -14,7 +14,7 @@\n TAR = tar\n INSTALL = install\n \n-PREFIX = /usr/local\n+PREFIX ?= /usr/local\n BINDIR = $(PREFIX)/bin\n INCDIR = $(PREFIX)/include\n LIBDIR = $(PREFIX)/lib\n"
  },
  {
    "path": "packages/giflib/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/giflib/\nTERMUX_PKG_DESCRIPTION=\"A library for reading and writing gif images\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=5.2.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=31da5562f44c5f15d63340a09a4fd62b48c45620cd302f77a6d9acf0077879bd\nTERMUX_PKG_BREAKS=\"giflib-dev\"\nTERMUX_PKG_REPLACES=\"giflib-dev\"\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/giflib-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/giflib/giflib-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"A set of utilities that comes with giflib package\"\nTERMUX_SUBPKG_CONFLICTS=\"giflib (<< 5.1.4-4)\"\n\nTERMUX_SUBPKG_INCLUDE=\"\nbin/\nshare/man/\"\n"
  },
  {
    "path": "packages/gifsicle/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.lcdf.org/gifsicle/\nTERMUX_PKG_DESCRIPTION=\"Tool for creating, editing, and getting information about GIF images and animations\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.92\nTERMUX_PKG_SHA256=5ab556c01d65fddf980749e3ccf50b7fd40de738b6df679999294cc5fabfce65\nTERMUX_PKG_SRCURL=https://www.lcdf.org/gifsicle/gifsicle-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-gifview\"\n"
  },
  {
    "path": "packages/git/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://git-scm.com/\nTERMUX_PKG_DESCRIPTION=\"Fast, scalable, distributed revision control system\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.24.0\nTERMUX_PKG_SRCURL=https://www.kernel.org/pub/software/scm/git/git-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=9f71d61973626d8b28c4cdf8e2484b4bf13870ed643fed982d68b2cfd754371b\n# less is required as a pager for git log, and the busybox less does not handle used escape sequences.\nTERMUX_PKG_DEPENDS=\"libcurl, libiconv, less, openssl, pcre2, zlib\"\n\n## This requires a working $TERMUX_PREFIX/bin/sh on the host building:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_fread_reads_directories=yes\nac_cv_header_libintl_h=no\nac_cv_snprintf_returns_bogus=no\n--with-curl\n--without-tcltk\n--with-shell=$TERMUX_PREFIX/bin/sh\n\"\n# expat is only used by git-http-push for remote lock management over DAV, so disable:\n# NO_INSTALL_HARDLINKS to use symlinks instead of hardlinks (which does not work on Android M):\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"\nNO_NSEC=1\nNO_GETTEXT=1\nNO_EXPAT=1\nNO_INSTALL_HARDLINKS=1\nPERL_PATH=$TERMUX_PREFIX/bin/perl\nUSE_LIBPCRE2=1\n\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\n# Things to remove to save space:\n#  bin/git-cvsserver - server emulating CVS\n#  bin/git-shell - restricted login shell for Git-only SSH access\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/git-cvsserver\nbin/git-shell\nlibexec/git-core/git-shell\nlibexec/git-core/git-cvsserver\nshare/man/man1/git-cvsserver.1\nshare/man/man1/git-shell.1\n\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Setup perl so that the build process can execute it:\n\trm -f $TERMUX_PREFIX/bin/perl\n\tln -s $(which perl) $TERMUX_PREFIX/bin/perl\n\n\t# Force fresh perl files (otherwise files from earlier builds\n\t# remains without bumped modification times, so are not picked\n\t# up by the package):\n\trm -Rf $TERMUX_PREFIX/share/git-perl\n\n\t# Fixes build if utfcpp is installed:\n\tCPPFLAGS=\"-I$TERMUX_PKG_SRCDIR $CPPFLAGS\"\n}\n\ntermux_step_make() {\n\tmake -j $TERMUX_MAKE_PROCESSES $TERMUX_PKG_EXTRA_MAKE_ARGS\n\tmake -j $TERMUX_MAKE_PROCESSES -C contrib/subtree $TERMUX_PKG_EXTRA_MAKE_ARGS\n}\n\ntermux_step_make_install() {\n\tmake $TERMUX_PKG_EXTRA_MAKE_ARGS install\n\tmake -C contrib/subtree $TERMUX_PKG_EXTRA_MAKE_ARGS install\n\n\t# Installing man requires asciidoc and xmlto, so git uses separate make targets for man pages\n\tmake -j $TERMUX_MAKE_PROCESSES install-man\n\tmake -j $TERMUX_MAKE_PROCESSES -C contrib/subtree install-man\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/bash_completion.d/\n\tcp $TERMUX_PKG_SRCDIR/contrib/completion/git-completion.bash \\\n\t   $TERMUX_PKG_SRCDIR/contrib/completion/git-prompt.sh \\\n\t   $TERMUX_PREFIX/etc/bash_completion.d/\n\n\t# Remove the build machine perl setup in termux_step_pre_configure to avoid it being packaged:\n\trm $TERMUX_PREFIX/bin/perl\n\n\t# Remove clutter:\n\trm -Rf $TERMUX_PREFIX/lib/*-linux*/perl\n\n\t# Remove duplicated binaries in bin/ with symlink to the one in libexec/git-core:\n\t(cd $TERMUX_PREFIX/bin; ln -s -f ../libexec/git-core/git git)\n\t(cd $TERMUX_PREFIX/bin; ln -s -f ../libexec/git-core/git-upload-pack git-upload-pack)\n}\n\ntermux_step_post_massage() {\n\tif [ ! -f libexec/git-core/git-remote-https ]; then\n\t\ttermux_error_exit \"Git built without https support\"\n\tfi\n}\n"
  },
  {
    "path": "packages/git/config.c.patch",
    "content": "diff -u -r ../git-2.19.0/config.c ./config.c\n--- ../git-2.19.0/config.c\t2018-09-10 18:39:13.000000000 +0000\n+++ ./config.c\t2018-09-11 21:16:14.404718876 +0000\n@@ -77,6 +77,25 @@\n static int pack_compression_seen;\n static int zlib_compression_seen;\n \n+/*\n+ * Protecting the project-specific git configuration file (.git/config) is\n+ * not possible on a shared file system on Android, which on an unpatched\n+ * git causes operations such as clone to fail with an error message.\n+ *\n+ * For the Termux git package we introduce a warning about the configuration\n+ * file being unprotected, but proceed in order to allow git repositories\n+ * to be cloned to shared storage accessible to other apps.\n+ */\n+static void termux_warn_once_about_lockfile()\n+{\n+\tstatic int already_warned;\n+\tif (!already_warned) {\n+\t\twarning(\"Cannot protect .git/config on this file system\"\n+\t\t\t\t\" - do not store sensitive information here.\");\n+\t\talready_warned = 1;\n+\t}\n+}\n+\n static int config_file_fgetc(struct config_source *conf)\n {\n \treturn getc_unlocked(conf->u.file);\n@@ -2792,9 +2811,13 @@\n \t\tin_fd = -1;\n \n \t\tif (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) {\n+#ifdef __ANDROID__\n+\t\t\ttermux_warn_once_about_lockfile();\n+#else\n \t\t\terror_errno(_(\"chmod on %s failed\"), get_lock_file_path(&lock));\n \t\t\tret = CONFIG_NO_WRITE;\n \t\t\tgoto out_free;\n+#endif\n \t\t}\n \n \t\tif (store.seen_nr == 0) {\n@@ -3030,9 +3053,13 @@\n \t}\n \n \tif (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) {\n+#ifdef __ANDROID__\n+\t\ttermux_warn_once_about_lockfile();\n+#else\n \t\tret = error_errno(_(\"chmod on %s failed\"),\n \t\t\t\t  get_lock_file_path(&lock));\n \t\tgoto out;\n+#endif\n \t}\n \n \twhile (fgets(buf, sizeof(buf), config_file)) {\n"
  },
  {
    "path": "packages/git/config.mak.uname.patch",
    "content": "Set uname_S to Linux instead of detecting build machine.\nAndroid does not support -lrt.\n\ndiff -u -r ../git-2.10.0/config.mak.uname ./config.mak.uname\n--- ../git-2.10.0/config.mak.uname\t2016-09-02 21:59:09.000000000 -0400\n+++ ./config.mak.uname\t2016-09-03 17:27:41.964893344 -0400\n@@ -1,6 +1,6 @@\n # Platform specific Makefile tweaks based on uname detection\n \n-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n+uname_S := Linux\n uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')\n uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')\n uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')\n@@ -36,8 +36,6 @@\n \tHAVE_DEV_TTY = YesPlease\n \tHAVE_CLOCK_GETTIME = YesPlease\n \tHAVE_CLOCK_MONOTONIC = YesPlease\n-\t# -lrt is needed for clock_gettime on glibc <= 2.16\n-\tNEEDS_LIBRT = YesPlease\n \tHAVE_GETDELIM = YesPlease\n \tSANE_TEXT_GREP=-a\n endif\n"
  },
  {
    "path": "packages/git/disable_daemon_syslog.patch",
    "content": "diff -u -r ../git-2.17.0/daemon.c ./daemon.c\n--- ../git-2.17.0/daemon.c\t2018-04-02 19:44:04.000000000 +0200\n+++ ./daemon.c\t2018-04-03 23:10:19.566140810 +0200\n@@ -82,9 +82,11 @@\n {\n \tswitch (log_destination) {\n \tcase LOG_DESTINATION_SYSLOG: {\n+\t\t/*\n \t\tchar buf[1024];\n \t\tvsnprintf(buf, sizeof(buf), err, params);\n \t\tsyslog(priority, \"%s\", buf);\n+\t\t*/\n \t\tbreak;\n \t}\n \tcase LOG_DESTINATION_STDERR:\n@@ -1432,7 +1434,9 @@\n \t}\n \n \tif (log_destination == LOG_DESTINATION_SYSLOG) {\n+\t\t/*\n \t\topenlog(\"git-daemon\", LOG_PID, LOG_DAEMON);\n+\t\t*/\n \t\tset_die_routine(daemon_die);\n \t} else\n \t\t/* avoid splitting a message in the middle */\n"
  },
  {
    "path": "packages/git/git.patch",
    "content": "Fix ST_CTIME_NSEC and ST_MTIME_NSEC macros on Android.\n\ndiff -u -r ../git-1.8.5.3/git-compat-util.h ./git-compat-util.h\n--- ../git-1.8.5.3/git-compat-util.h    2014-01-14 18:10:09.000000000 +0100\n+++ ./git-compat-util.h 2014-01-22 13:07:19.000000000 +0100\n@@ -657,6 +657,10 @@\n # define FORCE_DIR_SET_GID 0\n #endif\n\n+#ifdef __ANDROID__\n+#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctime_nsec))\n+#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtime_nsec))\n+#else\n #ifdef NO_NSEC\n #undef USE_NSEC\n #define ST_CTIME_NSEC(st) 0\n@@ -670,6 +674,7 @@\n #define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))\n #endif\n #endif\n+#endif\n\n #ifdef UNRELIABLE_FSTAT\n #define fstat_is_reliable() 0\n\n"
  },
  {
    "path": "packages/git/help.c.patch",
    "content": "diff -u -r ../git-2.9.3/help.c ./help.c\n--- ../git-2.9.3/help.c\t2016-08-12 15:38:45.000000000 -0400\n+++ ./help.c\t2016-08-23 06:15:57.698156213 -0400\n@@ -307,7 +307,7 @@\n \n static const char bad_interpreter_advice[] =\n \tN_(\"'%s' appears to be a git command, but we were not\\n\"\n-\t\"able to execute it. Maybe git-%s is broken?\");\n+\t\"able to execute it. Maybe you need to 'pkg install perl'?\");\n \n const char *help_unknown_cmd(const char *cmd)\n {\n@@ -339,7 +339,7 @@\n \t\t * it's a bad interpreter in the #! line.\n \t\t */\n \t\tif (!strcmp(candidate, cmd))\n-\t\t\tdie(_(bad_interpreter_advice), cmd, cmd);\n+\t\t\tdie(_(bad_interpreter_advice), cmd);\n \n \t\t/* Does the candidate appear in common_cmds list? */\n \t\twhile (n < ARRAY_SIZE(common_cmds) &&\n"
  },
  {
    "path": "packages/git/run-command.c.patch",
    "content": "diff -u -r ../git-2.18.0/run-command.c ./run-command.c\n--- ../git-2.18.0/run-command.c\t2018-06-21 17:18:50.000000000 +0000\n+++ ./run-command.c\t2018-06-23 21:33:38.289465325 +0000\n@@ -490,8 +490,10 @@\n #else\n \tCHECK_BUG(pthread_sigmask(SIG_SETMASK, &all, &as->old),\n \t\t\"blocking all signals\");\n+# ifndef __ANDROID__\n \tCHECK_BUG(pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &as->cs),\n \t\t\"disabling cancellation\");\n+# endif\n #endif\n }\n \n@@ -501,8 +503,10 @@\n \tif (sigprocmask(SIG_SETMASK, &as->old, NULL))\n \t\tdie_errno(\"sigprocmask\");\n #else\n+# ifndef __ANDROID__\n \tCHECK_BUG(pthread_setcancelstate(as->cs, NULL),\n \t\t\"re-enabling cancellation\");\n+# endif\n \tCHECK_BUG(pthread_sigmask(SIG_SETMASK, &as->old, NULL),\n \t\t\"restoring signal mask\");\n #endif\n"
  },
  {
    "path": "packages/git/tempfile.c.patch",
    "content": "diff -u -r ../git-2.8.1/tempfile.c ./tempfile.c\n--- ../git-2.8.1/tempfile.c\t2016-04-03 15:07:18.000000000 -0400\n+++ ./tempfile.c\t2016-04-28 07:22:47.339509915 -0400\n@@ -170,7 +170,7 @@\n \n \ttmpdir = getenv(\"TMPDIR\");\n \tif (!tmpdir)\n-\t\ttmpdir = \"/tmp\";\n+\t\ttmpdir = \"@TERMUX_PREFIX@/tmp\";\n \n \tstrbuf_addf(&tempfile->filename, \"%s/%s\", tmpdir, template);\n \ttempfile->fd = git_mkstemps_mode(tempfile->filename.buf, suffixlen, mode);\n"
  },
  {
    "path": "packages/git-crypt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.agwa.name/projects/git-crypt/\nTERMUX_PKG_DESCRIPTION=\"Enables transparent encryption and decryption of files for a git repository\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"@jottr\"\nTERMUX_PKG_VERSION=0.6.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/AGWA/git-crypt/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=777c0c7aadbbc758b69aff1339ca61697011ef7b92f1d1ee9518a8ee7702bb78\nTERMUX_PKG_DEPENDS=\"git, libc++, openssl\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\" -DCMAKE_BUILD_TYPE=Release -Dbuild_parse=yes -Dbuild_xmlparser=yes\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"make ENABLE_MAN=yes\"\n\ntermux_step_make() {\n\tcd $TERMUX_PKG_SRCDIR\n\tmake\n}\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\tmake install\n}\n"
  },
  {
    "path": "packages/git-lfs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://git-lfs.github.com/\nTERMUX_PKG_DESCRIPTION=\"Git extension for versioning large files\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.9.1\nTERMUX_PKG_SRCURL=https://github.com/git-lfs/git-lfs/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=f5a444f00e30b663ae32b34ebee82356ec2af62a8d6eafceaa4f18bfa9b6e600\n\ntermux_step_make() {\n\ttermux_setup_golang\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\n\tmkdir -p \"$GOPATH\"/github.com/git-lfs\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/github.com/git-lfs/git-lfs\n\n\tcd \"$GOPATH\"/github.com/git-lfs/git-lfs\n\t! $TERMUX_ON_DEVICE_BUILD && GOOS=linux GOARCH=amd64 CC=gcc LD=gcc go generate github.com/git-lfs/git-lfs/commands\n\tgo build git-lfs.go\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/github.com/git-lfs/git-lfs/git-lfs \\\n\t\t\"$TERMUX_PREFIX\"/bin/git-lfs\n}\n\ntermux_step_post_make_install() {\n\t## Remove read-only files generated in build process.\n\tchmod -R 700 \"$TERMUX_PKG_BUILDDIR\"/pkg\n\trm -rf \"$TERMUX_PKG_BUILDDIR\"/pkg\n}\n"
  },
  {
    "path": "packages/gitea/app.ini",
    "content": "; Either \"dev\", \"prod\" or \"test\", default is \"dev\"\nRUN_MODE = prod\n\n[repository]\nROOT = @TERMUX_PREFIX@/var/gitea\n\n[database]\nDB_TYPE=sqlite3\nPATH=@TERMUX_PREFIX@/var/gitea/gitea.db\n\n[log]\nROOT_PATH=@TERMUX_PREFIX@/var/log/gitea\nMODE=file\nLEVEL=Info\n\n; Update mirrors\n[cron.update_mirrors]\nSCHEDULE = @every 120m\n"
  },
  {
    "path": "packages/gitea/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gitea.io\nTERMUX_PKG_DESCRIPTION=\"Git with a cup of tea, painless self-hosted git service\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.10.0\nTERMUX_PKG_SRCURL=https://github.com/go-gitea/gitea/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=a45044ef8242f5cd0d0d914c9ef1d5f97483bd6985c27efef6d99dbdf38f759d\nTERMUX_PKG_DEPENDS=\"dash, git\"\n\ntermux_step_make() {\n\techo 'replace github.com/go-macaron/cors v0.0.0-20190309005821-6fd6a9bfe14e9 => github.com/go-macaron/cors 6fd6a9bfe14e' >> $TERMUX_PKG_SRCDIR/go.mod\n\n\ttermux_setup_golang\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\n\tmkdir -p \"$GOPATH\"/src/code.gitea.io\n\tcp -a \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/code.gitea.io/gitea\n\tcd \"$GOPATH\"/src/code.gitea.io/gitea\n\n\t# go-bindata shoudn't be cross-compiled\n\tGOOS=linux GOARCH=amd64 go get -u github.com/jteeuwen/go-bindata/...\n\texport PATH=\"$PATH:$GOPATH/bin\"\n\n\tCGO_ENABLED=0 CGO_LDFLAGS=\"\" CGO_CFLAGS=\"\" GOOS=linux GOARCH=amd64 make generate\n\t#CGO_ENABLED=0 CGO_LDFLAGS=\"\" CGO_CFLAGS=\"\" LDFLAGS=\"\" TAGS=\"bindata sqlite\" make all\n\tLDFLAGS=\"\" TAGS=\"bindata sqlite\" make all\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/src/code.gitea.io/gitea/gitea \\\n\t\t\"$TERMUX_PREFIX\"/bin/gitea\n\n\tmkdir -p \"$TERMUX_PREFIX\"/etc/gitea\n\tsed \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" \\\n\t\t\"$TERMUX_PKG_BUILDER_DIR\"/app.ini > \"$TERMUX_PREFIX\"/etc/gitea/app.ini\n\n\tsed \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" \\\n\t\t\"$TERMUX_PKG_BUILDER_DIR\"/gitea-service.sh > \"$TERMUX_PREFIX\"/bin/gitea-service.sh\n\tchmod 700 ${TERMUX_PREFIX}/bin/gitea-service.sh\n}\n\ntermux_step_post_massage() {\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"/var/gitea\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"/var/log/gitea\n}\n"
  },
  {
    "path": "packages/gitea/gitea-service.sh",
    "content": "#!/bin/sh\nexport GITEA_WORK_DIR=@TERMUX_PREFIX@/var/gitea\nexec @TERMUX_PREFIX@/bin/gitea web -c @TERMUX_PREFIX@/etc/gitea/app.ini\n"
  },
  {
    "path": "packages/gkermit/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.columbia.edu/kermit/gkermit.html\nTERMUX_PKG_DESCRIPTION=\"Simple, Portable, Free File Transfer Software for UNIX\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.00\nTERMUX_PKG_SRCURL=ftp://kermit.columbia.edu/kermit/archives/gku${TERMUX_PKG_VERSION/./}.tar.gz\nTERMUX_PKG_SHA256=3dbe63291277c4795255343b48b860777fb0a160163d7e1d30b1ee68585593eb\nTERMUX_PKG_DEPENDS=\"libandroid-support\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_MAKE_PROCESSES=1\n\ntermux_step_post_extract_package() {\n        filename=$(basename \"$TERMUX_PKG_SRCURL\")\n        local file=\"$TERMUX_PKG_CACHEDIR/$filename\"\n        tar xf \"$file\" -C \"$TERMUX_PKG_SRCDIR\"\n}\n"
  },
  {
    "path": "packages/gkermit/makefile.patch",
    "content": "--- ../gkermit/makefile\t1999-12-26 22:28:38.000000000 +0200\n+++ ./makefile\t2017-12-16 13:45:36.154185777 +0200\n@@ -29,16 +29,16 @@\n \n # Sample installation values - change or override as needed.\n \n-BINDIR = /usr/local/bin\n-MANDIR = /usr/man/manl\n-TEXTDIR = /usr/local/doc\n-INFODIR = /usr/local/info\n-MANEXT = l\n+BINDIR = $(prefix)/bin\n+MANDIR = $(prefix)/share/man/man1\n+TEXTDIR = $(prefix)/doc\n+INFODIR = $(prefix)/info\n+MANEXT = 1\n \n # Default compiler and flags\n \n-CC=cc\n-CFLAGS= -DPOSIX -O $(KFLAGS)\n+GWART_CC = cc\n+CFLAGS= -DPOSIX -O $(KFLAGS) -DERRNO_H\n \n # Object files\n \n@@ -49,10 +49,10 @@\n all:\t\tgwart gkermit\n \n gwart.o:\tgwart.c\n-\t\t$(CC) $(CFLAGS) -c gwart.c\n+\t\t$(GWART_CC) $(CFLAGS) -c gwart.c\n \n gwart:\t\tgwart.o\n-\t\t$(CC) -o gwart gwart.o\n+\t\t$(GWART_CC) -o gwart gwart.o\n \n .c.o:\n \t\t$(CC) $(CFLAGS) -c $<\n@@ -67,7 +67,8 @@\n gcmdline.o:\tgcmdline.c gkermit.h\n \n gkermit:\tgproto.o gkermit.o gunixio.o gcmdline.o\n-\t\t$(CC) -o gkermit $(OBJECTS)\n+\t\t$(CC) -o gkermit -v -landroid-support \\\n+\t\t-L$(prefix)/lib -fPIE -pie $(OBJECTS)\n \n bsd:\t\tgwart\n \t\t$(MAKE) \"CC=$(CC)\" \"CFLAGS=-DBSD -O $(KFLAGS)\" gkermit\n@@ -118,6 +119,13 @@\n \t\t@cp README $(TEXTDIR)/gkermit.txt\n \t\t@chmod 644 $(TEXTDIR)/gkermit.txt\n \t\t@ls -lg $(TEXTDIR)/gkermit.txt\n+\t\t@if test -d $(MANDIR); then \\\n+\t\t    echo \"$(MANDIR) exists...\" ; \\\n+\t\telse \\\n+\t\t    echo \"Creating $(MANDIR)/...\" ; \\\n+\t\t    mkdir -p $(MANDIR) ; \\\n+\t\t    chmod 755 $(MANDIR) ; \\\n+\t\tfi\n \t\t@echo Installing man page in $(MANDIR)/gkermit.$(MANEXT)...\n \t\t@cp gkermit.nr $(MANDIR)/gkermit.$(MANEXT)\n \t\t@chmod 644 $(MANDIR)/gkermit.$(MANEXT)\n"
  },
  {
    "path": "packages/glib/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://developer.gnome.org/glib/\nTERMUX_PKG_DESCRIPTION=\"Library providing core building blocks for libraries and applications written in C\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_VERSION=2.62.3\nTERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/gnome/sources/glib/${TERMUX_PKG_VERSION:0:4}/glib-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=4400adc9f0d3ffcfe8e84225210370ce3f9853afb81812ddadb685325aa655c4\n# libandroid-support to get langinfo.h in include path.\nTERMUX_PKG_DEPENDS=\"libffi, libiconv, pcre, libandroid-support, zlib\"\nTERMUX_PKG_BREAKS=\"glib-dev\"\nTERMUX_PKG_REPLACES=\"glib-dev\"\nTERMUX_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\"\n# Needed by pkg-config for glib-2.0:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-Dlibmount=false\n-Diconv=external\n\"\n\ntermux_step_pre_configure() {\n\t# glib checks for __BIONIC__ instead of __ANDROID__:\n\tCFLAGS+=\" -D__BIONIC__=1\"\n}\n"
  },
  {
    "path": "packages/glib/fix-hardcoded-paths.patch",
    "content": "diff -uNr glib-2.58.3/gio/gdbusaddress.c glib-2.58.3.mod/gio/gdbusaddress.c\n--- glib-2.58.3/gio/gdbusaddress.c\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/gio/gdbusaddress.c\t2019-03-02 02:08:55.324976201 +0200\n@@ -1628,7 +1628,7 @@\n       ret = g_strdup (g_getenv (\"DBUS_SYSTEM_BUS_ADDRESS\"));\n       if (ret == NULL)\n         {\n-          ret = g_strdup (\"unix:path=/var/run/dbus/system_bus_socket\");\n+          ret = g_strdup (\"unix:path=@TERMUX_PREFIX@/var/run/dbus/system_bus_socket\");\n         }\n       break;\n \ndiff -uNr glib-2.58.3/gio/gdbusprivate.c glib-2.58.3.mod/gio/gdbusprivate.c\n--- glib-2.58.3/gio/gdbusprivate.c\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/gio/gdbusprivate.c\t2019-03-02 02:08:55.328309547 +0200\n@@ -2098,17 +2098,17 @@\n   /* TODO: use PACKAGE_LOCALSTATEDIR ? */\n   ret = NULL;\n   first_error = NULL;\n-  if (!g_file_get_contents (\"/var/lib/dbus/machine-id\",\n+  if (!g_file_get_contents (\"@TERMUX_PREFIX@/var/lib/dbus/machine-id\",\n                             &ret,\n                             NULL,\n                             &first_error) &&\n-      !g_file_get_contents (\"/etc/machine-id\",\n+      !g_file_get_contents (\"@TERMUX_PREFIX@/etc/machine-id\",\n                             &ret,\n                             NULL,\n                             NULL))\n     {\n       g_propagate_prefixed_error (error, first_error,\n-                                  _(\"Unable to load /var/lib/dbus/machine-id or /etc/machine-id: \"));\n+                                  _(\"Unable to load @TERMUX_PREFIX@/var/lib/dbus/machine-id or @TERMUX_PREFIX@/etc/machine-id: \"));\n     }\n   else\n     {\ndiff -uNr glib-2.58.3/gio/gnetworking.h.in glib-2.58.3.mod/gio/gnetworking.h.in\n--- glib-2.58.3/gio/gnetworking.h.in\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/gio/gnetworking.h.in\t2019-03-02 02:08:55.331642893 +0200\n@@ -55,7 +55,7 @@\n #endif\n \n #ifndef _PATH_RESCONF\n-#define _PATH_RESCONF \"/etc/resolv.conf\"\n+#define _PATH_RESCONF \"@TERMUX_PREFIX@/etc/resolv.conf\"\n #endif\n \n #ifndef CMSG_LEN\ndiff -uNr glib-2.58.3/gio/gunixmounts.c glib-2.58.3.mod/gio/gunixmounts.c\n--- glib-2.58.3/gio/gunixmounts.c\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/gio/gunixmounts.c\t2019-03-02 02:08:55.331642893 +0200\n@@ -539,7 +539,7 @@\n   return _PATH_MOUNTED;\n # endif\n #else\n-  return \"/etc/mtab\";\n+  return \"@TERMUX_PREFIX@/etc/mtab\";\n #endif\n }\n \n@@ -666,7 +666,7 @@\n   mountinfo_path = _PATH_MOUNTED;\n # endif\n #else\n-  mountinfo_path = \"/etc/mtab\";\n+  mountinfo_path = \"@TERMUX_PREFIX@/etc/mtab\";\n #endif\n \n   return mountinfo_path;\n@@ -960,7 +960,7 @@\n #elif defined(VFSTAB)\n   return VFSTAB;\n #else\n-  return \"/etc/fstab\";\n+  return \"@TERMUX_PREFIX@/etc/fstab\";\n #endif\n #endif\n }\n@@ -2955,7 +2955,7 @@\n           /* see if device with similar major:minor as /dev/root is mention\n            * in /etc/mtab (it usually is) \n            */\n-          f = fopen (\"/etc/mtab\", \"r\");\n+          f = fopen (\"@TERMUX_PREFIX@/etc/mtab\", \"r\");\n           if (f != NULL) \n             {\n \t      struct mntent *entp;\ndiff -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\n--- glib-2.58.3/gio/tests/org.gtk.test.gschema.override.orig\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.override.orig\t1970-01-01 03:00:00.000000000 +0300\n@@ -1,2 +0,0 @@\n-[org.gtk.test.per-desktop:GNOME-Classic]\n-desktop = \"GNOME Classic\"\ndiff -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\n--- glib-2.58.3/gio/tests/org.gtk.test.gschema.xml.orig\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.xml.orig\t1970-01-01 03:00:00.000000000 +0300\n@@ -1,222 +0,0 @@\n-<schemalist>\n-\n-  <schema id=\"org.gtk.test\" path=\"/tests/\" gettext-domain=\"test\">\n-    <key name=\"greeting\" type=\"s\">\n-      <default l10n=\"messages\">\"Hello, earthlings\"</default>\n-      <summary>A greeting</summary>\n-      <description>\n-         Greeting of the invading martians\n-      </description>\n-    </key>\n-    <key name=\"farewell\" type=\"s\">\n-      <default l10n=\"messages\">\"So long\"</default>\n-    </key>\n-\n-    <child name='basic-types' schema='org.gtk.test.basic-types'/>\n-    <child name='complex-types' schema='org.gtk.test.complex-types'/>\n-    <child name='localized' schema='org.gtk.test.localized'/>\n-  </schema>\n-\n-  <schema id=\"org.gtk.test.no-path\">\n-    <key name=\"test-boolean\" type=\"b\">\n-      <default>true</default>\n-    </key>\n-  </schema>\n-\n-  <schema id=\"org.gtk.test.basic-types\" path=\"/tests/basic-types/\">\n-    <key name=\"test-boolean\" type=\"b\">\n-      <default>true</default>\n-    </key>\n-    <key name=\"test-byte\" type=\"y\">\n-      <default>25</default>\n-    </key>\n-    <key name=\"test-int16\" type=\"n\">\n-      <default>-1234</default>\n-    </key>\n-    <key name=\"test-uint16\" type=\"q\">\n-      <default>1234</default>\n-    </key>\n-    <key name=\"test-int32\" type=\"i\">\n-      <default>-123456</default>\n-    </key>\n-    <key name=\"test-uint32\" type=\"u\">\n-      <default>123456</default>\n-    </key>\n-    <key name=\"test-int64\" type=\"x\">\n-      <default>-123456789</default>\n-    </key>\n-    <key name=\"test-uint64\" type=\"t\">\n-      <default>123456789</default>\n-    </key>\n-    <key name=\"test-double\" type=\"d\">\n-      <default>123.456</default>\n-    </key>\n-    <key name=\"test-string\" type=\"s\">\n-      <default>\"a string, it seems\"</default>\n-    </key>\n-    <key name=\"test-objectpath\" type=\"o\">\n-      <default>\"/a/object/path\"</default>\n-    </key>\n-  </schema>\n-\n-  <schema id=\"org.gtk.test.complex-types\" path=\"/tests/complex-types/\">\n-    <key name=\"test-tuple\" type=\"(s(ii))\">\n-      <default>(\"one\",(2,3))</default>\n-    </key>\n-    <key name=\"test-array\" type=\"ai\">\n-      <default>[0,1,2,3,4,5]</default>\n-    </key>\n-    <key name=\"test-dict\" type=\"a{sau}\">\n-      <default>\n-      {\n-        \"AC\": [0,0, 0,0,0,0,0,0],\n-        \"IV\": [0,0, 0,0,0,0,0,0]\n-      }\n-      </default>\n-    </key>\n-  </schema>\n-\n-  <schema id=\"org.gtk.test.localized\" path=\"/tests/localized/\" gettext-domain=\"test\">\n-    <key name=\"error-message\" type=\"s\">\n-      <default l10n=\"messages\">\"Unnamed\"</default>\n-    </key>\n-    <key name=\"backspace\" type=\"s\">\n-      <default l10n=\"messages\" context=\"keyboard label\">\"BackSpace\"</default>\n-    </key>\n-  </schema>\n-\n-  <schema id=\"org.gtk.test.binding\" path=\"/tests/binding/\">\n-    <key name=\"bool\" type=\"b\">\n-      <default>false</default>\n-    </key>\n-    <key name=\"anti-bool\" type=\"b\">\n-      <default>false</default>\n-    </key>\n-    <key name=\"byte\" type=\"y\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"int16\" type=\"n\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"uint16\" type=\"q\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"int\" type=\"i\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"uint\" type=\"u\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"int64\" type=\"x\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"uint64\" type=\"t\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"double\" type=\"d\">\n-      <default>0</default>\n-    </key>\n-    <key name=\"string\" type=\"s\">\n-      <default>\"\"</default>\n-    </key>\n-    <key name=\"chararray\" type=\"ay\">\n-      <default>[48, 49]</default>\n-    </key>\n-    <key name=\"strv\" type=\"as\">\n-      <default>[]</default>\n-    </key>\n-    <key name=\"enum\" enum=\"org.gtk.test.TestEnum\">\n-      <default>'foo'</default>\n-    </key>\n-    <key name=\"flags\" flags=\"org.gtk.test.TestFlags\">\n-      <default>['mourning', 'laughing']</default>\n-    </key>\n-    <key name=\"range\" type='u'>\n-      <default>33</default>\n-      <range min=\"2\" max=\"44\"/>\n-    </key>\n-  </schema>\n-\n-  <schema id='org.gtk.test.enums' path='/tests/enums/'>\n-    <key name='test' enum='org.gtk.test.TestEnum'>\n-      <default>'bar'</default>\n-      <aliases>\n-        <alias value='qux' target='quux'/>\n-      </aliases>\n-    </key>\n-    <key name='f-test' flags='org.gtk.test.TestFlags'>\n-      <default>[]</default>\n-      <aliases>\n-        <alias value='speaking' target='talking'/>\n-      </aliases>\n-    </key>\n-  </schema>\n-\n-  <schema id='org.gtk.test.enums.direct' path='/tests/enums/'>\n-    <key name='f-test' type='as'>\n-      <default>[]</default>\n-    </key>\n-    <key name='test' type='s'>\n-      <default>'bar'</default>\n-    </key>\n-  </schema>\n-\n-  <schema id='org.gtk.test.range' path='/tests/range/'>\n-    <key name='val' type='i'>\n-      <default>33</default>\n-      <range min='2' max='44'/>\n-    </key>\n-  </schema>\n-\n-  <schema id='org.gtk.test.range.direct' path='/tests/range/'>\n-    <key name='val' type='i'>\n-      <default>33</default>\n-    </key>\n-  </schema>\n-\n-  <schema id='org.gtk.test.mapped' path='/tests/mapped/'>\n-    <key name='val' type='i'>\n-      <default>0</default>\n-    </key>\n-  </schema>\n-\n-  <schema id=\"org.gtk.test.descriptions\" path=\"/a/\">\n-    <key name='a' type='i'>\n-      <summary>\n-        a paragraph.\n-\n-        with some whitespace.\n-         \n-        because not everyone has a great editor.\n-\n-       \t  \n-\n-\n-        lots of space is            as one.    \n-      </summary>\n-      <default>0</default>\n-    </key>\n-  </schema>\n-\n-  <schema id='org.gtk.test.extends.base'>\n-    <key name='int32' type='i'>\n-      <default>0</default>\n-    </key>\n-    <key name='string' type='s'>\n-      <default>''</default>\n-    </key>\n-  </schema>\n-  <schema id='org.gtk.test.extends.extended' extends='org.gtk.test.extends.base'>\n-    <override name=\"int32\">42</override>\n-    <key name='another-int32' type='i'>\n-      <default>0</default>\n-    </key>\n-  </schema>\n-\n-  <schema id=\"org.gtk.test.per-desktop\" path=\"/tests/per-desktop/\">\n-    <key name=\"desktop\" type=\"s\">\n-      <default>\"GNOME\"</default>\n-    </key>\n-  </schema>\n-\n-</schemalist>\ndiff -uNr glib-2.58.3/gio/xdgmime/xdgmime.c glib-2.58.3.mod/gio/xdgmime/xdgmime.c\n--- glib-2.58.3/gio/xdgmime/xdgmime.c\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/gio/xdgmime/xdgmime.c\t2019-03-02 02:08:55.334976238 +0200\n@@ -255,7 +255,7 @@\n \n   xdg_data_dirs = getenv (\"XDG_DATA_DIRS\");\n   if (xdg_data_dirs == NULL)\n-    xdg_data_dirs = \"/usr/local/share/:/usr/share/\";\n+    xdg_data_dirs = \"@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/share/\";\n \n   ptr = xdg_data_dirs;\n \ndiff -uNr glib-2.58.3/glib/gcharset.c glib-2.58.3.mod/glib/gcharset.c\n--- glib-2.58.3/glib/gcharset.c\t2019-01-21 15:38:50.000000000 +0200\n+++ glib-2.58.3.mod/glib/gcharset.c\t2019-03-02 02:08:55.334976238 +0200\n@@ -298,7 +298,7 @@\n   if (g_once_init_enter (&alias_table))\n     {\n       GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal);\n-      read_aliases (\"/usr/share/locale/locale.alias\", table);\n+      read_aliases (\"@TERMUX_PREFIX@/share/locale/locale.alias\", table);\n       g_once_init_leave (&alias_table, table);\n     }\n \n"
  },
  {
    "path": "packages/glib/glib-bin.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"share/bash-completion/ share/man/man1/ bin/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Programs for the GLib library\"\n"
  },
  {
    "path": "packages/glib/glib-gspawn.c.patch",
    "content": "diff -u -r ../glib-2.58.1/glib/gspawn.c ./glib/gspawn.c\n--- ../glib-2.58.1/glib/gspawn.c\t2018-09-21 14:23:53.000000000 +0000\n+++ ./glib/gspawn.c\t2018-10-07 18:17:08.394012273 +0000\n@@ -2020,7 +2022,7 @@\n \n     new_argv = g_new0 (gchar*, argc + 2); /* /bin/sh and NULL */\n     \n-    new_argv[0] = (char *) \"/bin/sh\";\n+    new_argv[0] = (char *) \"@TERMUX_PREFIX@/bin/sh\";\n     new_argv[1] = (char *) file;\n     while (argc > 0)\n       {\n@@ -2099,7 +2101,7 @@\n            * what to search if PATH is unset. POSIX may, dunno.\n            */\n           \n-          path = \"/bin:/usr/bin:.\";\n+          path = \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:.\";\n \t}\n \n       len = strlen (file) + 1;\n"
  },
  {
    "path": "packages/glib/glib-gtimezone.c.patch",
    "content": "diff -u -r ../glib-2.58.1/glib/gtimezone.c ./glib/gtimezone.c\n--- ../glib-2.58.1/glib/gtimezone.c\t2018-09-21 14:23:53.000000000 +0000\n+++ ./glib/gtimezone.c\t2018-10-07 18:37:37.275489744 +0000\n@@ -43,6 +43,10 @@\n #include <windows.h>\n #endif\n \n+#ifdef __ANDROID__\n+#include <sys/system_properties.h>\n+#endif\n+\n /**\n  * SECTION:timezone\n  * @title: GTimeZone\n@@ -399,7 +403,136 @@\n   gtz->transitions = NULL;\n }\n \n-#ifdef G_OS_UNIX\n+#ifdef __ANDROID__\n+/* Android uses a 'persist.sys.timezone' system property for the\n+ * current timezone instead of a /etc/localtime file:\n+ * https://android.googlesource.com/platform/ndk/+/android-2.2_r1/docs/system/libc/OVERVIEW.TXT#67\n+ *\n+ * There are no files under /usr/share/zoneinfo - instead a single\n+ * /system/usr/share/zoneinfo/tzdata file is used which contains all\n+ * files compiled together with the following tool:\n+ * https://android.googlesource.com/platform/system/timezone/+/master/zone_compactor/main/java/ZoneCompactor.java\n+ */\n+static GBytes *\n+zone_info_android (const gchar  *identifier,\n+                   gchar       **out_identifier)\n+{\n+  char sys_timezone[PROP_VALUE_MAX];\n+  GMappedFile *file;\n+  gchar *tzdata;\n+  gsize tzdata_length;\n+  const gsize index_entry_size = 52;\n+  gint32 header_index_offset, header_data_offset;\n+  gint32 entry_count, current_index;\n+  char* entry_name;\n+  gint32 entry_offset, entry_length;\n+  guint32 entry_name_start, entry_name_end;\n+  guint32 zoneinfo_start, zoneinfo_end;\n+  GBytes *zoneinfo;\n+  GError *error = NULL;\n+\n+  if (identifier == NULL)\n+    {\n+      if (__system_property_get (\"persist.sys.timezone\", sys_timezone) < 1)\n+        {\n+          g_warning (\"__system_property_get(\\\"persist.sys.timezone\\\") failed\");\n+          return NULL;\n+        }\n+      identifier = sys_timezone;\n+    }\n+\n+  file = g_mapped_file_new (\"/system/usr/share/zoneinfo/tzdata\", FALSE, &error);\n+  if (file == NULL)\n+    {\n+      g_warning (\"Failed mapping tzdata file: %s\", error->message);\n+      g_error_free (error);\n+      return NULL;\n+    }\n+\n+  tzdata = g_mapped_file_get_contents (file);\n+  tzdata_length = g_mapped_file_get_length (file);\n+  if (tzdata == NULL || tzdata_length < 24)\n+    {\n+      g_warning (\"Too small tzdata file\");\n+      goto error;\n+    }\n+\n+  header_index_offset = gint32_from_be (*((gint32_be*) (tzdata + 12)));\n+  header_data_offset = gint32_from_be (*((gint32_be*) (tzdata + 16)));\n+\n+  if (header_index_offset < 0 || header_data_offset < 0 || header_data_offset < index_entry_size)\n+    {\n+      g_warning (\"Invalid tzdata content\");\n+      goto error;\n+    }\n+\n+  entry_count = (header_data_offset - header_index_offset) / index_entry_size;\n+  if (entry_count < 1)\n+    {\n+      g_warning (\"No index entry found\");\n+      goto error;\n+    }\n+\n+  current_index = 0;\n+  while (current_index < entry_count)\n+    {\n+      if (!g_uint_checked_mul (&entry_name_start, current_index, index_entry_size) ||\n+          !g_uint_checked_add (&entry_name_start, entry_name_start, header_index_offset) ||\n+          !g_uint_checked_add (&entry_name_end, entry_name_start, 40))\n+        {\n+          g_warning (\"Overflow when computing entry name offset\");\n+          goto error;\n+        }\n+\n+      entry_name = tzdata + entry_name_start;\n+\n+      /* The name should be null terminated within the 40 chars. */\n+      if (memchr (entry_name, 0, 40) == NULL)\n+        {\n+          g_warning (\"Invalid index entry\");\n+          goto error;\n+        }\n+\n+      if (strcmp (entry_name, identifier) == 0)\n+        {\n+          entry_offset = gint32_from_be (*(gint32_be*) (entry_name + 40));\n+          entry_length = gint32_from_be (*(gint32_be*) (entry_name + 44));\n+          if (entry_length == 0 || entry_length > 65536)\n+            {\n+              /* Use a reasonable but arbitrary max length of an entry. */\n+              g_warning (\"Invalid zoneinfo entry length\");\n+              goto error;\n+            }\n+\n+          if (!g_uint_checked_add (&zoneinfo_start, header_data_offset, entry_offset) ||\n+              !g_uint_checked_add (&zoneinfo_end, zoneinfo_start, entry_length) ||\n+              zoneinfo_end > tzdata_length)\n+            {\n+              g_warning (\"Too large zoneinfo entry length\");\n+              goto error;\n+            }\n+\n+          zoneinfo = g_bytes_new_with_free_func (tzdata + zoneinfo_start,\n+                                                 entry_length,\n+                                                 (GDestroyNotify)g_mapped_file_unref,\n+                                                 g_mapped_file_ref (file));\n+          g_mapped_file_unref (file);\n+\n+          if (out_identifier != NULL)\n+              *out_identifier = g_strdup (identifier);\n+\n+          return zoneinfo;\n+        }\n+      current_index++;\n+    }\n+\n+error:\n+  g_mapped_file_unref (file);\n+  return NULL;\n+}\n+\n+#elif defined(G_OS_UNIX)\n+\n static GBytes*\n zone_info_unix (const gchar  *identifier,\n                 gchar       **out_identifier)\n@@ -506,6 +641,10 @@\n   return zoneinfo;\n }\n \n+#endif\n+\n+#ifdef G_OS_UNIX\n+\n static void\n init_zone_from_iana_info (GTimeZone *gtz,\n                           GBytes    *zoneinfo,\n@@ -1483,7 +1622,11 @@\n   if (tz->t_info == NULL)\n     {\n #ifdef G_OS_UNIX\n+# ifdef __ANDROID__\n+      GBytes *zoneinfo = zone_info_android (identifier, &resolved_identifier);\n+# else\n       GBytes *zoneinfo = zone_info_unix (identifier, &resolved_identifier);\n+# endif\n       if (zoneinfo != NULL)\n         {\n           init_zone_from_iana_info (tz, zoneinfo, g_steal_pointer (&resolved_identifier));\n"
  },
  {
    "path": "packages/glib/glib-gutils.c.patch",
    "content": "diff -u -r ../glib-2.60.2/glib/gutils.c ./glib/gutils.c\n--- ../glib-2.60.2/glib/gutils.c\t2019-05-03 13:43:28.000000000 +0000\n+++ ./glib/gutils.c\t2019-05-11 19:59:12.830415366 +0000\n@@ -378,7 +378,7 @@\n        * what to search if PATH is unset. POSIX may, dunno.\n        */\n       \n-      path = \"/bin:/usr/bin:.\";\n+      path = \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:.\";\n     }\n #else\n   n = GetModuleFileNameW (NULL, wfilename, MAXPATHLEN);\n@@ -958,7 +958,7 @@\n       if (tmp == NULL || *tmp == '\\0')\n         {\n           g_free (tmp);\n-          tmp = g_strdup (\"/tmp\");\n+          tmp = g_strdup (\"@TERMUX_PREFIX@/tmp\");\n         }\n #endif /* !G_OS_WIN32 */\n \n@@ -2080,7 +2080,7 @@\n    */\n #ifndef G_OS_WIN32\n   if (!data_dirs || !data_dirs[0])\n-    data_dirs = \"/usr/local/share/:/usr/share/\";\n+    data_dirs = \"@TERMUX_PREFIX@/share/\";\n \n   data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);\n #else\n@@ -2174,7 +2174,7 @@\n     }\n #else\n   if (!conf_dirs || !conf_dirs[0])\n-    conf_dirs = \"/etc/xdg\";\n+    conf_dirs = \"@TERMUX_PREFIX@/etc/xdg\";\n \n   conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0);\n #endif\n"
  },
  {
    "path": "packages/glib/meson.build.patch",
    "content": "diff -u -r ../glib-2.60.2/meson.build ./meson.build\n--- ../glib-2.60.2/meson.build\t2019-05-03 13:43:28.000000000 +0000\n+++ ./meson.build\t2019-05-11 20:10:26.054269305 +0000\n@@ -360,7 +360,6 @@\n     # https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.\n     '-Wno-pedantic',\n     '-Werror=declaration-after-statement',\n-    '-Werror=format=2',\n     '-Werror=implicit-function-declaration',\n     '-Werror=init-self',\n     '-Werror=missing-include-dirs',\n--- ./meson.build.orig\t2019-06-11 00:18:20.480045589 +0000\n+++ ./meson.build\t2019-06-11 00:19:34.408583457 +0000\n@@ -1780,23 +1780,8 @@\n   endif\n endif\n \n-# First check in libc, fallback to libintl, and as last chance build\n-# proxy-libintl subproject.\n-# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible\n-# implementations. This could be extended if issues are found in some platforms.\n-if cc.has_function('ngettext')\n   libintl = []\n   have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')\n-else\n-  libintl = cc.find_library('intl', required : false)\n-  if not libintl.found()\n-    libintl = subproject('proxy-libintl').get_variable('intl_dep')\n-    have_bind_textdomain_codeset = true  # proxy-libintl supports it\n-  else\n-    have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset',\n-                                                   dependencies : libintl)\n-  endif\n-endif\n \n glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset)\n \n"
  },
  {
    "path": "packages/global/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/global/\nTERMUX_PKG_DESCRIPTION=\"Source code search and browse tools\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=6.6.3\nTERMUX_PKG_SHA256=cbee98ef6c1b064bc5b062d14a6d94dca67289e8374860817057db7688bc651c\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/global/global-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_posix1_2008_realpath=yes\n--with-posix-sort=$TERMUX_PREFIX/bin/sort\n--with-ncurses=$TERMUX_PREFIX\n\"\n# coreutils provides the posix sort executable:\nTERMUX_PKG_DEPENDS=\"coreutils, ncurses, libltdl\"\n"
  },
  {
    "path": "packages/global/echo-path.patch",
    "content": "diff -uNr global-6.6.1.orig/globash/globash.in global-6.6.1/globash/globash.in\n--- global-6.6.1.orig/globash/globash.in\t2017-12-16 07:19:15.000000000 +0200\n+++ global-6.6.1/globash/globash.in\t2017-12-19 18:37:51.034558917 +0200\n@@ -36,7 +36,7 @@\n # Use /bin/echo, because in some systems, built-in echo of /bin/sh\n # does not accept -n option.\n #\n-ECHO='/bin/echo'\n+ECHO='@TERMUX_PREFIX@/bin/echo'\n #\n # global command name\n #\n"
  },
  {
    "path": "packages/global/libutil-makepath.c.patch",
    "content": "diff -u -r ../global-6.5.2/libutil/makepath.c ./libutil/makepath.c\n--- ../global-6.5.2/libutil/makepath.c\t2015-12-16 00:02:48.000000000 -0500\n+++ ./libutil/makepath.c\t2015-12-25 21:36:31.333892462 -0500\n@@ -122,6 +122,9 @@\n \t\t * ~/dir/...\n \t\t */\n \t\tif (*++file == '/') {\n+#ifdef __ANDROID__\n+\t\t\treturn makepath(\"@TERMUX_HOME@\", file, NULL);\n+#else\n \t\t\tuid_t uid;\n \t\t\tfile++;\n \t\t\tuid = getuid();\n@@ -129,11 +132,15 @@\n \t\t\t\tif (pw->pw_uid == uid)\n \t\t\t\t\tbreak;\n \t\t\t}\n+#endif\n \t\t}\n \t\t/*\n \t\t * ~user/dir/...\n \t\t */\n \t\telse {\n+#ifdef __ANDROID__\n+\t\t\tpw = NULL;\n+#else\n \t\t\tconst char *name = strmake(file, \"/\");\n \t\t\tfile = locatestring(file, \"/\", MATCH_FIRST);\n \t\t\tif (file != NULL)\n@@ -144,12 +151,15 @@\n \t\t\t\tif (!strcmp(pw->pw_name, name))\n \t\t\t\t\tbreak;\n \t\t\t}\n+#endif\n \t\t}\n \t\tif (errno)\n \t\t\tdie(\"cannot open passwd file. (errno = %d)\", errno);\n \t\tif (pw == NULL)\n \t\t\tdie(\"home directory not found.\");\n+#ifndef __ANDROID__\n \t\tendpwent();\n+#endif\n \t\treturn makepath(pw->pw_dir, file, NULL);\n \t/*\n \t * absolute path\n"
  },
  {
    "path": "packages/gmic/CImg.h.patch",
    "content": "diff -uNr gmic-2.6.7/src/CImg.h gmic-2.6.7.mod/src/CImg.h\n--- gmic-2.6.7/src/CImg.h\t2019-06-28 09:56:12.000000000 +0300\n+++ gmic-2.6.7.mod/src/CImg.h\t2019-06-29 18:45:02.595895578 +0300\n@@ -60774,8 +60774,8 @@\n         _cimg_test_temporary_path(\"D:\\\\Temp\");\n         _cimg_test_temporary_path(\"D:\");\n #else\n-        _cimg_test_temporary_path(\"/tmp\");\n-        _cimg_test_temporary_path(\"/var/tmp\");\n+        _cimg_test_temporary_path(\"@TERMUX_PREFIX@/tmp\");\n+        _cimg_test_temporary_path(\"@TERMUX_PREFIX@/var/tmp\");\n #endif\n         if (!path_found) {\n           *s_path = 0;\n"
  },
  {
    "path": "packages/gmic/Makefile.patch",
    "content": "diff -u -r ../gmic-2.7.4/src/Makefile ./src/Makefile\n--- ../gmic-2.7.4/src/Makefile\t2019-10-10 06:24:59.000000000 +0000\n+++ ./src/Makefile\t2019-10-23 07:19:39.327118798 +0000\n@@ -202,7 +202,7 @@\n # Enable multi-threading support.\n PARALLEL_CFLAGS = -Dgmic_is_parallel\n ifneq ($(OS),Windows)\n-PARALLEL_LIBS = -lpthread\n+#PARALLEL_LIBS = -lpthread\n endif\n \n # Enable parallelization in CImg, using OpenMP.\n@@ -342,8 +342,8 @@\n GMIC_CLI_CFLAGS = $(MANDATORY_CFLAGS) $(ABORT_CFLAGS) $(PARALLEL_CFLAGS) $(EIGEN_CFLAGS) $(FFTW_CFLAGS) $(CURL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(TIFF_CFLAGS)\n GMIC_CLI_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(EIGEN_LIBS) $(FFTW_LIBS) $(CURL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(TIFF_LIBS)\n ifeq ($(OS),Unix) # Unix.\n-GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) # $(MAGICK_CFLAGS)\n-GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS)\n+#GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) # $(MAGICK_CFLAGS)\n+#GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS)\n else\n ifeq ($(OS),Darwin) # MacOSX.\n GMIC_CLI_CFLAGS += $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS)\n@@ -356,7 +356,7 @@\n \n cli:\n \t$(MAKE) \"CFLAGS+=$(GMIC_CLI_CFLAGS) $(OPT_CFLAGS)\" \"LIBS+=$(GMIC_CLI_LIBS)\" _cli\n-\t$(STRIP) gmic$(EXE)\n+\t$(STRIP) gmic$(EXE) gmic-gm$(EXE)\n \n debug:\n \t$(MAKE) \"CFLAGS+=$(GMIC_CLI_CFLAGS) $(DEBUG_CFLAGS)\" \"LIBS+=$(GMIC_CLI_LIBS)\" _cli\n@@ -364,6 +364,8 @@\n _cli: gmic.cpp gmic.h gmic_stdlib.h CImg.h\n \t$(CXX) -o gmic_cli.o -c gmic.cpp $(CFLAGS)\n \t$(CXX) -o gmic gmic_cli.cpp gmic_cli.o $(CFLAGS) $(LIBS)\n+\t$(CXX) -o gmic_cli_gm.o -c gmic.cpp $(CFLAGS) $(MAGICK_CFLAGS)\n+\t$(CXX) -o gmic-gm gmic_cli.cpp gmic_cli_gm.o $(CFLAGS) $(MAGICK_CFLAGS) $(LIBS) $(MAGICK_LIBS)\n \n # CLI (static)\n #-------------\n"
  },
  {
    "path": "packages/gmic/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gmic.eu\nTERMUX_PKG_DESCRIPTION=\"Full-featured framework for image processing\"\nTERMUX_PKG_LICENSE=\"CeCILL-2.1\"\nTERMUX_PKG_VERSION=2.7.5\nTERMUX_PKG_SRCURL=https://gmic.eu/files/source/gmic_$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=a6854264c8ab4e7df33e19fe98314b6abcf663060e9baa18731f163eaabc1401\nTERMUX_PKG_DEPENDS=\"libc++, libcurl, fftw, libpng, libjpeg-turbo, libtiff, zlib\"\nTERMUX_PKG_BUILD_DEPENDS=\"graphicsmagick\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\treturn 0;\n}\n\ntermux_step_make() {\n\tcd src/\n\tmake USR=\"$TERMUX_PREFIX\" STRIP=\"$STRIP\" \\\n\t     CFLAGS=\"$CXXFLAGS\" LIBS=\"$LDFLAGS\" cli\n}\n\ntermux_step_make_install() {\n\tcp src/gmic $TERMUX_PREFIX/bin/\n\tcp src/gmic-gm $TERMUX_PREFIX/bin/\n\tcp man/gmic.1.gz $TERMUX_PREFIX/share/man/man1/\n\tcp man/gmic.1.gz $TERMUX_PREFIX/share/man/man1/gmic-gm.1.gz\n}\n\n"
  },
  {
    "path": "packages/gmic/gmic-gm.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/gmic-gm share/man/man1/gmic-gm.1.gz\"\nTERMUX_SUBPKG_DESCRIPTION=\"Full-featured framework for image processing (GraphicsMagick variant)\"\nTERMUX_SUBPKG_DEPENDS=\"graphicsmagick\"\nTERMUX_SUBPKG_DEPEND_ON_PARENT=deps\n"
  },
  {
    "path": "packages/gnuchess/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/chess/\nTERMUX_PKG_DESCRIPTION=\"Chess-playing program\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=6.2.5\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/chess/gnuchess-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=9a99e963355706cab32099d140b698eda9de164ebce40a5420b1b9772dd04802\nTERMUX_PKG_DEPENDS=\"libc++, ncurses, readline\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/gnuchessu bin/gnuchessx\"\n"
  },
  {
    "path": "packages/gnuchess/components.cc.patch",
    "content": "diff -uNr gnuchess-6.2.5/src/components.cc gnuchess-6.2.5.mod/src/components.cc\n--- gnuchess-6.2.5/src/components.cc\t2017-06-11 18:17:14.000000000 +0300\n+++ gnuchess-6.2.5.mod/src/components.cc\t2018-11-09 14:17:10.952608702 +0200\n@@ -171,6 +171,6 @@\n \n void TerminateInput()\n {\n-  pthread_cancel( input_thread );\n+  pthread_kill( input_thread, 0 );\n   pthread_join( input_thread, NULL );\n }\n"
  },
  {
    "path": "packages/gnuchess/main.cc.patch",
    "content": "diff -u -r ../gnuchess-6.2.1/src/main.cc ./src/main.cc\n--- ../gnuchess-6.2.1/src/main.cc\t2015-01-04 05:10:41.000000000 -0500\n+++ ./src/main.cc\t2015-01-05 20:40:16.816570715 -0500\n@@ -237,8 +237,8 @@\n   char opt_addbook[MAXSTR+1] = \"\";\n   char *endptr;\n \n-  /*disable graphic output by default */\n-  graphicmodeoutput = 0;\n+  /*enable graphic output by default */\n+  graphicmodeoutput = 1;\n \n \n   progname = argv[0]; /* Save in global for cmd_usage */\n"
  },
  {
    "path": "packages/gnuit/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gnuit/\nTERMUX_PKG_DESCRIPTION=\"gnuit - GNU Interactive Tools\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=4.9.5\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gnuit/gnuit-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=6b6e96db13bafa5ad35c735b2277699d4244088c709a3e134fb1a3e8c8a8557c\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-transition\"\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses\"\n\ntermux_step_post_massage() {\n\tcd $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/share/gnuit\n\tln -s gnuitrc.xterm-color gnuitrc.xterm-256color\n\tln -s gnuitrc.screen gnuitrc.screen-color\n\tln -s gnuitrc.screen gnuitrc.screen-256color\n}\n"
  },
  {
    "path": "packages/gnuit/system.c.patch",
    "content": "--- ../cache/gnuit-4.9.5/src/system.c\t2009-02-18 02:31:26.000000000 +0000\n+++ ./src/system.c\t2017-05-31 02:32:44.499460109 +0000\n@@ -162,7 +162,7 @@\n \t\tclose(0);\n \t}\n \n-\texecle(\"/bin/sh\", \"sh\", \"-c\", command, (char *)NULL, environ);\n+\texecle(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", command, (char *)NULL, environ);\n \n \t/* Make sure we exit if exec() fails.  Call _exit() instead of\n \t   exit() to avoid flushing file descriptors twice (in the\n"
  },
  {
    "path": "packages/gnuit/tilde.c-history.c.patch.debug",
    "content": "--- ./src/tilde.c\t2009-02-18 02:31:26.000000000 +0000\n+++ ../tilde.c\t2018-03-17 21:38:36.637958669 +0000\n@@ -47,7 +47,7 @@\n \n #if !defined (savestring)\n #  ifndef strcpy\n-extern char *strcpy ();\n+extern char __attribute__((overloadable)) *strcpy ();\n #  endif\n #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))\n #endif /* !savestring */\n--- ./src/history.c\t2009-02-18 02:31:26.000000000 +0000\n+++ ../history.c\t2018-03-17 21:38:21.789964199 +0000\n@@ -61,7 +61,7 @@\n \n #ifndef savestring\n #  ifndef strcpy\n-extern char *strcpy ();\n+extern char __attribute__((overloadable)) *strcpy ();\n #  endif\n #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))\n #endif\n@@ -80,7 +80,7 @@\n \n #ifndef member\n #  ifndef strchr\n-extern char *strchr ();\n+extern char __attribute__((overloadable)) *strchr ();\n #  endif\n #define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)\n #endif\n"
  },
  {
    "path": "packages/gnupg/agent-agent.h.patch",
    "content": "diff -u -r ../gnupg-2.1.6/agent/agent.h ./agent/agent.h\n--- ../gnupg-2.1.6/agent/agent.h\t2015-06-30 16:26:08.000000000 -0400\n+++ ./agent/agent.h\t2015-07-06 08:39:31.806515184 -0400\n@@ -310,7 +310,7 @@\n   agent_Lunderscore (ctrl_t ctrl, const char *string)           \\\n   {                                                             \\\n     return ctrl? i18n_localegettext (ctrl->lc_messages, string) \\\n-      /*     */: gettext (string);                              \\\n+      /*     */: string;                              \\\n   }\n \n \n"
  },
  {
    "path": "packages/gnupg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/\nTERMUX_PKG_DESCRIPTION=\"Implementation of the OpenPGP standard for encrypting and signing data and communication\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.2.18\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=30d37ce2ca55b2b9b61480b2a175a3b22066ab41cd3f84688448919b566dec0a\nTERMUX_PKG_DEPENDS=\"libassuan, libbz2, libgcrypt, libgnutls, libgpg-error, libksba, libnpth, libsqlite, readline, pinentry, resolv-conf, zlib\"\nTERMUX_PKG_CONFLICTS=\"gnupg2 (<< 2.2.9-1), dirmngr (<< 2.2.17-1)\"\nTERMUX_PKG_REPLACES=\"gnupg2 (<< 2.2.9-1), dirmngr (<< 2.2.17-1)\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-ldap\n--enable-sqlite\n--enable-tofu\n\"\n# Remove non-english help files and man pages shipped with the gnupg (1) package:\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gnupg/help.*.txt share/man/man1/gpg-zip.1 share/man/man7/gnupg.7\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -Ddn_skipname=__dn_skipname\"\n}\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PREFIX/bin\n\tln -sf gpg gpg2\n}\n"
  },
  {
    "path": "packages/gnupg/common-dotlock.c.patch",
    "content": "Android does not support hardlinks so no need to try or nag.\n\ndiff -u -r ../gnupg-2.2.9/common/dotlock.c ./common/dotlock.c\n--- ../gnupg-2.2.9/common/dotlock.c\t2017-08-28 10:22:54.000000000 +0000\n+++ ./common/dotlock.c\t2018-08-05 21:40:02.699642490 +0000\n@@ -605,6 +605,9 @@\n static int\n use_hardlinks_p (const char *tname)\n {\n+#ifdef __ANDROID__\n+  return 1;\n+#else\n   char *lname;\n   struct stat sb;\n   unsigned int nlink;\n@@ -633,6 +636,7 @@\n   unlink (lname);\n   xfree (lname);\n   return res;\n+#endif\n }\n #endif /*HAVE_POSIX_SYSTEM */\n \n@@ -758,8 +762,10 @@\n     }\n   strcpy (stpcpy (h->lockname, file_to_lock), EXTSEP_S \"lock\");\n   UNLOCK_all_lockfiles ();\n+#ifndef __ANDROID__\n   if (h->use_o_excl)\n     my_debug_1 (\"locking for '%s' done via O_EXCL\\n\", h->lockname);\n+#endif\n \n   return h;\n \n"
  },
  {
    "path": "packages/gnupg/configure.patch",
    "content": "diff -u -r ../gnupg-2.1.14/configure ./configure\n--- ../gnupg-2.1.14/configure\t2016-07-14 10:03:06.000000000 -0400\n+++ ./configure\t2016-07-14 19:20:04.539115863 -0400\n@@ -14729,13 +14729,6 @@\n done\n \n \n-if test \"$have_android_system\" = yes; then\n-   # On Android ttyname is a stub but prints an error message.\n-\n-$as_echo \"#define HAVE_BROKEN_TTYNAME 1\" >>confdefs.h\n-\n-fi\n-\n ac_fn_c_check_type \"$LINENO\" \"struct sigaction\" \"ac_cv_type_struct_sigaction\" \"#include <signal.h>\n \"\n if test \"x$ac_cv_type_struct_sigaction\" = xyes; then :\n"
  },
  {
    "path": "packages/gnupg/fix-paths.patch",
    "content": "diff -uNr gnupg-2.2.13/dirmngr/certcache.c gnupg-2.2.13.mod/dirmngr/certcache.c\n--- gnupg-2.2.13/dirmngr/certcache.c\t2018-04-25 13:38:04.000000000 +0300\n+++ gnupg-2.2.13.mod/dirmngr/certcache.c\t2019-03-02 01:32:08.653821497 +0200\n@@ -674,11 +674,8 @@\n #ifdef DEFAULT_TRUST_STORE_FILE\n     { DEFAULT_TRUST_STORE_FILE }\n #else\n-    { \"/etc/ssl/ca-bundle.pem\" },\n-    { \"/etc/ssl/certs/ca-certificates.crt\" },\n-    { \"/etc/pki/tls/cert.pem\" },\n-    { \"/usr/local/share/certs/ca-root-nss.crt\" },\n-    { \"/etc/ssl/cert.pem\" }\n+    { \"@TERMUX_PREFIX@/etc/tls/cert.pem\" },\n+    { \"@TERMUX_PREFIX@/etc/ssl/cert.pem\" }\n #endif /*!DEFAULT_TRUST_STORE_FILE*/\n   };\n   int idx;\ndiff -uNr gnupg-2.2.13/dirmngr/dns.c gnupg-2.2.13.mod/dirmngr/dns.c\n--- gnupg-2.2.13/dirmngr/dns.c\t2018-12-18 09:26:53.000000000 +0200\n+++ gnupg-2.2.13.mod/dirmngr/dns.c\t2019-03-02 01:33:24.937449148 +0200\n@@ -5112,7 +5112,7 @@\n \tif (!(hosts = dns_hosts_open(&error)))\n \t\tgoto error;\n \n-\tif ((error = dns_hosts_loadpath(hosts, \"/etc/hosts\")))\n+\tif ((error = dns_hosts_loadpath(hosts, \"@TERMUX_PREFIX@/etc/hosts\")))\n \t\tgoto error;\n \n \treturn hosts;\n@@ -5428,7 +5428,7 @@\n \tif (!(resconf = dns_resconf_open(&error)))\n \t\tgoto error;\n \n-\tif ((error = dns_resconf_loadpath(resconf, \"/etc/resolv.conf\"))) {\n+\tif ((error = dns_resconf_loadpath(resconf, \"@TERMUX_PREFIX@/etc/resolv.conf\"))) {\n \t\t/*\n \t\t * NOTE: Both the glibc and BIND9 resolvers ignore a missing\n \t\t * /etc/resolv.conf, defaulting to a nameserver of\n@@ -5440,7 +5440,7 @@\n \t\t\tgoto error;\n \t}\n \n-\tif ((error = dns_nssconf_loadpath(resconf, \"/etc/nsswitch.conf\"))) {\n+\tif ((error = dns_nssconf_loadpath(resconf, \"@TERMUX_PREFIX@/etc/nsswitch.conf\"))) {\n \t\tif (error != ENOENT)\n \t\t\tgoto error;\n \t}\n@@ -10436,7 +10436,7 @@\n \t\tpanic(\"dns_resconf_open: %s\", dns_strerror(error));\n \n \tif (!MAIN.resconf.count)\n-\t\tMAIN.resconf.path[MAIN.resconf.count++]\t= \"/etc/resolv.conf\";\n+\t\tMAIN.resconf.path[MAIN.resconf.count++]\t= \"@TERMUX_PREFIX@/etc/resolv.conf\";\n \n \tfor (i = 0; i < MAIN.resconf.count; i++) {\n \t\tpath\t= MAIN.resconf.path[i];\n@@ -10485,11 +10485,11 @@\n \t\treturn *hosts;\n \n \tif (!MAIN.hosts.count) {\n-\t\tMAIN.hosts.path[MAIN.hosts.count++]\t= \"/etc/hosts\";\n+\t\tMAIN.hosts.path[MAIN.hosts.count++]\t= \"@TERMUX_PREFIX@/etc/hosts\";\n \n \t\t/* Explicitly test dns_hosts_local() */\n \t\tif (!(*hosts = dns_hosts_local(&error)))\n-\t\t\tpanic(\"%s: %s\", \"/etc/hosts\", dns_strerror(error));\n+\t\t\tpanic(\"%s: %s\", \"@TERMUX_PREFIX@/etc/hosts\", dns_strerror(error));\n \n \t\treturn *hosts;\n \t}\ndiff -uNr gnupg-2.2.13/dirmngr/dns-stuff.c gnupg-2.2.13.mod/dirmngr/dns-stuff.c\n--- gnupg-2.2.13/dirmngr/dns-stuff.c\t2018-07-03 12:54:26.000000000 +0300\n+++ gnupg-2.2.13.mod/dirmngr/dns-stuff.c\t2019-03-02 01:32:38.027267980 +0200\n@@ -114,7 +114,7 @@\n #define DEFAULT_TIMEOUT 30\n \n \n-#define RESOLV_CONF_NAME \"/etc/resolv.conf\"\n+#define RESOLV_CONF_NAME \"@TERMUX_PREFIX@/etc/resolv.conf\"\n \n /* Two flags to enable verbose and debug mode.  */\n static int opt_verbose;\n@@ -602,7 +602,7 @@\n     derr = dns_hosts_loadpath (ld.hosts, hosts_path);\n     xfree (hosts_path);\n #else\n-    derr = dns_hosts_loadpath (ld.hosts, \"/etc/hosts\");\n+    derr = dns_hosts_loadpath (ld.hosts, \"@TERMUX_PREFIX@/etc/hosts\");\n #endif\n     if (derr)\n       {\ndiff -uNr gnupg-2.2.13/dirmngr/ks-engine-ldap.c gnupg-2.2.13.mod/dirmngr/ks-engine-ldap.c\n--- gnupg-2.2.13/dirmngr/ks-engine-ldap.c\t2018-10-25 18:37:53.000000000 +0300\n+++ gnupg-2.2.13.mod/dirmngr/ks-engine-ldap.c\t2019-03-02 01:32:08.667154882 +0200\n@@ -1947,9 +1947,9 @@\n \n   if (dump_modlist)\n     {\n-      dump = es_fopen(\"/tmp/modlist.txt\", \"w\");\n+      dump = es_fopen(\"@TERMUX_PREFIX@/tmp/modlist.txt\", \"w\");\n       if (! dump)\n-\tlog_error (\"Failed to open /tmp/modlist.txt: %s\\n\",\n+\tlog_error (\"Failed to open @TERMUX_PREFIX@/tmp/modlist.txt: %s\\n\",\n \t\t   strerror (errno));\n \n       if (dump)\ndiff -uNr gnupg-2.2.13/g10/exec.c gnupg-2.2.13.mod/g10/exec.c\n--- gnupg-2.2.13/g10/exec.c\t2017-08-28 13:22:54.000000000 +0300\n+++ gnupg-2.2.13.mod/g10/exec.c\t2019-03-02 01:32:08.667154882 +0200\n@@ -180,7 +180,7 @@\n \t      tmp=\"<Wimp$ScrapDir>.GnuPG\";\n \t      mkdir(tmp,0700); /* Error checks occur later on */\n #else\n-\t      tmp=\"/tmp\";\n+\t      tmp=\"@TERMUX_PREFIX@/tmp\";\n #endif\n \t    }\n \t}\n@@ -383,7 +383,7 @@\n \t  char *shell=getenv(\"SHELL\");\n \n \t  if(shell==NULL)\n-\t    shell=\"/bin/sh\";\n+\t    shell=\"@TERMUX_PREFIX@/bin/sh\";\n \n \t  /* I'm the child */\n \ndiff -uNr gnupg-2.2.13/g13/be-encfs.c gnupg-2.2.13.mod/g13/be-encfs.c\n--- gnupg-2.2.13/g13/be-encfs.c\t2017-08-28 13:22:54.000000000 +0300\n+++ gnupg-2.2.13.mod/g13/be-encfs.c\t2019-03-02 01:32:08.670488228 +0200\n@@ -410,7 +410,7 @@\n   if (err)\n     goto leave;\n \n-  mountpoint = xtrystrdup (\"/tmp/.#g13_XXXXXX\");\n+  mountpoint = xtrystrdup (\"@TERMUX_PREFIX@/tmp/.#g13_XXXXXX\");\n   if (!mountpoint)\n     {\n       err = gpg_error_from_syserror ();\n@@ -420,7 +420,7 @@\n     {\n       err = gpg_error_from_syserror ();\n       log_error (_(\"can't create directory '%s': %s\\n\"),\n-                 \"/tmp/.#g13_XXXXXX\", gpg_strerror (err));\n+                 \"@TERMUX_PREFIX@/tmp/.#g13_XXXXXX\", gpg_strerror (err));\n       goto leave;\n     }\n \ndiff -uNr gnupg-2.2.13/g13/mount.c gnupg-2.2.13.mod/g13/mount.c\n--- gnupg-2.2.13/g13/mount.c\t2017-08-28 13:22:54.000000000 +0300\n+++ gnupg-2.2.13.mod/g13/mount.c\t2019-03-02 01:32:08.670488228 +0200\n@@ -82,14 +82,14 @@\n \n   if (!mountpoint)\n     {\n-      mountpoint_buffer = xtrystrdup (\"/tmp/g13-XXXXXX\");\n+      mountpoint_buffer = xtrystrdup (\"@TERMUX_PREFIX@/tmp/g13-XXXXXX\");\n       if (!mountpoint_buffer)\n         return gpg_error_from_syserror ();\n       if (!gnupg_mkdtemp (mountpoint_buffer))\n         {\n           err = gpg_error_from_syserror ();\n           log_error (_(\"can't create directory '%s': %s\\n\"),\n-                     \"/tmp/g13-XXXXXX\", gpg_strerror (err));\n+                     \"@TERMUX_PREFIX@/tmp/g13-XXXXXX\", gpg_strerror (err));\n           xfree (mountpoint_buffer);\n           return err;\n         }\ndiff -uNr gnupg-2.2.13/scd/scdaemon.c gnupg-2.2.13.mod/scd/scdaemon.c\n--- gnupg-2.2.13/scd/scdaemon.c\t2018-03-21 20:43:33.000000000 +0200\n+++ gnupg-2.2.13.mod/scd/scdaemon.c\t2019-03-02 01:32:08.670488228 +0200\n@@ -766,10 +766,10 @@\n          write. */\n       if (allow_coredump)\n         {\n-          if (chdir(\"/tmp\"))\n-            log_debug (\"chdir to '/tmp' failed: %s\\n\", strerror (errno));\n+          if (chdir(\"@TERMUX_PREFIX@/tmp\"))\n+            log_debug (\"chdir to '@TERMUX_PREFIX@/tmp' failed: %s\\n\", strerror (errno));\n           else\n-            log_debug (\"changed working directory to '/tmp'\\n\");\n+            log_debug (\"changed working directory to '@TERMUX_PREFIX@/tmp'\\n\");\n         }\n \n       /* In multi server mode we need to listen on an additional\ndiff -uNr gnupg-2.2.13/tests/gpgscm/ffi.c gnupg-2.2.13.mod/tests/gpgscm/ffi.c\n--- gnupg-2.2.13/tests/gpgscm/ffi.c\t2017-08-28 13:22:54.000000000 +0300\n+++ gnupg-2.2.13.mod/tests/gpgscm/ffi.c\t2019-03-02 01:32:08.673821575 +0200\n@@ -355,7 +355,7 @@\n     FFI_RETURN_STRING (sc, \"/temp\");\n   FFI_RETURN_STRING (sc, buffer);\n #else\n-  FFI_RETURN_STRING (sc, \"/tmp\");\n+  FFI_RETURN_STRING (sc, \"@TERMUX_PREFIX@/tmp\");\n #endif\n }\n \ndiff -uNr gnupg-2.2.13/tools/addgnupghome gnupg-2.2.13.mod/tools/addgnupghome\n--- gnupg-2.2.13/tools/addgnupghome\t2018-12-11 09:44:33.000000000 +0200\n+++ gnupg-2.2.13.mod/tools/addgnupghome\t2019-03-02 01:32:08.673821575 +0200\n@@ -70,10 +70,10 @@\n         return\n     fi\n     for f in $filelist; do\n-        if [ -d /etc/skel/.gnupg/$f ]; then\n+        if [ -d @TERMUX_PREFIX@/etc/skel/.gnupg/$f ]; then\n             mkdir $f\n         else\n-            cp /etc/skel/.gnupg/$f $f\n+            cp @TERMUX_PREFIX@/etc/skel/.gnupg/$f $f\n         fi\n         if ! chown $user $f ; then\n             error \"error changing ownership of \\`$f'\"\n@@ -102,11 +102,11 @@\n     info \"please note that only users from /etc/passwd are checked\"\n fi\n \n-if [ ! -d /etc/skel/.gnupg ]; then\n-    error \"skeleton directory \\`/etc/skel/.gnupg' does not exist\"\n+if [ ! -d @TERMUX_PREFIX@/etc/skel/.gnupg ]; then\n+    error \"skeleton directory \\`@TERMUX_PREFIX@/etc/skel/.gnupg' does not exist\"\n     exit 1\n fi\n-cd \"/etc/skel/.gnupg\" || (error \"error cd-ing to \\`/etc/skel/.gnupg'\"; exit 1)\n+cd \"@TERMUX_PREFIX@/etc/skel/.gnupg\" || (error \"error cd-ing to \\`@TERMUX_PREFIX@/etc/skel/.gnupg'\"; exit 1)\n filelist=$(find . \\( -type f -o -type d \\) '!' -name '*~' '!' -name . -print)\n \n \ndiff -uNr gnupg-2.2.13/tools/symcryptrun.c gnupg-2.2.13.mod/tools/symcryptrun.c\n--- gnupg-2.2.13/tools/symcryptrun.c\t2017-08-28 13:22:54.000000000 +0300\n+++ gnupg-2.2.13.mod/tools/symcryptrun.c\t2019-03-02 01:32:08.673821575 +0200\n@@ -319,7 +319,7 @@\n \n   p = getenv (\"TMPDIR\");\n   if (!p || !*p)\n-    p = \"/tmp\";\n+    p = \"@TERMUX_PREFIX@/tmp\";\n   if (p[strlen (p) - 1] == '/')\n     name = xstrconcat (p, \"gpg-XXXXXX\", NULL);\n   else\n"
  },
  {
    "path": "packages/gnupg/gpgv.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/gpgv share/man/man1/gpgv.1.gz\"\nTERMUX_SUBPKG_DESCRIPTION=\"GNU privacy guard - signature verification tool\"\nTERMUX_SUBPKG_DEPENDS=\"libbz2, libgcrypt, libgpg-error, zlib\"\nTERMUX_SUBPKG_DEPEND_ON_PARENT=no\n"
  },
  {
    "path": "packages/gnuplot/Makefile.patch",
    "content": "diff -u -r ../gnuplot-5.2.0/Makefile.in ./Makefile.in\n--- ../gnuplot-5.2.0/Makefile.in\t2017-09-03 03:44:09.000000000 +0000\n+++ ./Makefile.in\t2017-10-14 20:54:05.459305245 +0000\n@@ -344,7 +344,7 @@\n top_builddir = @top_builddir@\n top_srcdir = @top_srcdir@\n AUTOMAKE_OPTIONS = foreign\n-SUBDIRS = config m4 term src docs man demo tutorial share\n+SUBDIRS = config m4 term src man tutorial share\n EXTRA_DIST = BUGS Copyright FAQ.pdf GNUmakefile INSTALL INSTALL.gnu \\\n Makefile.maint PATCHLEVEL PGPKEYS README RELEASE_NOTES \\\n VERSION configure.vms win\n"
  },
  {
    "path": "packages/gnuplot/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://gnuplot.info/\nTERMUX_PKG_DESCRIPTION=\"Command-line driven graphing utility\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=5.2.8\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/gnuplot/gnuplot/${TERMUX_PKG_VERSION}/gnuplot-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=60a6764ccf404a1668c140f11cc1f699290ab70daa1151bb58fed6139a28ac37\nTERMUX_PKG_DEPENDS=\"libandroid-support, libc++, libiconv, readline, pango, libgd, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-x --with-lua=no --with-bitmap-terminals\"\nTERMUX_PKG_HOSTBUILD=true\n\ntermux_step_host_build() {\n\t\"$TERMUX_PKG_SRCDIR/configure\"\n\tmake -C docs/ gnuplot.gih\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/gnuplot/5.2/\n\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/docs/gnuplot.gih \\\n\t   $TERMUX_PREFIX/share/gnuplot/5.2/gnuplot.gih\n}\n"
  },
  {
    "path": "packages/gnuplot/plot.c.patch",
    "content": "--- ./src/plot.c.orig\t2019-02-08 21:42:42.500914619 +0000\n+++ ./src/plot.c\t2019-02-08 21:43:56.702190583 +0000\n@@ -281,7 +281,7 @@\n #endif\n /* make sure that we really have revoked root access, this might happen if\n    gnuplot is compiled without vga support but is installed suid by mistake */\n-#ifdef __linux__\n+#if defined(__linux__) && !defined(__ANDROID__)\n     if (setuid(getuid()) != 0) {\n \tfprintf(stderr,\"gnuplot: refusing to run at elevated privilege\\n\");\n \texit(EXIT_FAILURE);\n"
  },
  {
    "path": "packages/gnuplot/src-command.c.patch",
    "content": "For WEXITSTATUS macro.\n\ndiff -u -r ../gnuplot-5.2.0/src/command.c ./src/command.c\n--- ../gnuplot-5.2.0/src/command.c\t2017-08-30 18:48:26.000000000 +0000\n+++ ./src/command.c\t2017-10-14 20:56:13.905856980 +0000\n@@ -138,6 +138,7 @@\n int vms_ktid;\t\t\t/* key table id, for translating keystrokes */\n #endif /* VMS */\n \n+#include <sys/wait.h>\n \n /* static prototypes */\n static void command __PROTO((void));\n"
  },
  {
    "path": "packages/go-findimagedupes/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gitlab.com/opennota/findimagedupes\nTERMUX_PKG_DESCRIPTION=\"Find visually similar or duplicate images\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.20190114\nTERMUX_PKG_REVISION=8\n_COMMIT=237ed2ef4bbb91c79eee0f5ee84a1adad9c014ff\nTERMUX_PKG_SRCURL=https://gitlab.com/opennota/findimagedupes/-/archive/${_COMMIT}/findimagedupes-${_COMMIT}.tar.gz\nTERMUX_PKG_SHA256=7eb4fbab38c8c1965dafd1d0fddbfac58ba6e1a3d52cd1220df488a0a338abb0\nTERMUX_PKG_DEPENDS=\"file, libjpeg-turbo, libpng, libtiff\"\nTERMUX_PKG_CONFLICTS=\"findimagedupes\"\nTERMUX_PKG_REPLACES=\"findimagedupes\"\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\texport CGO_CFLAGS=\"$CFLAGS $CPPFLAGS -I$TERMUX_PREFIX/include/libpng16 -D__GLIBC__\"\n\texport CGO_CXXFLAGS=\"$CXXFLAGS $CPPFLAGS -I$TERMUX_PREFIX/include/libpng16 -D__GLIBC__\"\n\texport CGO_LDFLAGS=\"$LDFLAGS\"\n\n\tmkdir -p \"$GOPATH\"/src/gitlab.com/opennota\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/gitlab.com/opennota/findimagedupes\n\n\tcd \"$GOPATH\"/src/gitlab.com/opennota/findimagedupes\n\n\tgo build .\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/src/gitlab.com/opennota/findimagedupes/findimagedupes \\\n\t\t\"$TERMUX_PREFIX\"/bin/findimagedupes\n}\n"
  },
  {
    "path": "packages/goaccess/Makefile.in.patch",
    "content": "diff -uNr goaccess-1.3/Makefile.in goaccess-1.3.mod/Makefile.in\n--- goaccess-1.3/Makefile.in\t2018-11-23 07:35:59.000000000 +0200\n+++ goaccess-1.3.mod/Makefile.in\t2019-02-01 01:28:46.579671652 +0200\n@@ -531,10 +531,9 @@\n src/$(DEPDIR)/$(am__dirstamp):\n \t@$(MKDIR_P) src/$(DEPDIR)\n \t@: > src/$(DEPDIR)/$(am__dirstamp)\n-src/bin2c.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)\n-bin2c$(EXEEXT): $(bin2c_OBJECTS) $(bin2c_DEPENDENCIES) $(EXTRA_bin2c_DEPENDENCIES) \n+bin2c$(EXEEXT): $(bin2c_SOURCES)\n \t@rm -f bin2c$(EXEEXT)\n-\t$(LINK) $(bin2c_OBJECTS) $(bin2c_LDADD) $(LIBS)\n+\tgcc $(bin2c_SOURCES) $(bin2c_LDADD) $(LIBS) -o bin2c\n src/base64.$(OBJEXT): src/$(am__dirstamp) \\\n \tsrc/$(DEPDIR)/$(am__dirstamp)\n src/browsers.$(OBJEXT): src/$(am__dirstamp) \\\n"
  },
  {
    "path": "packages/goaccess/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://goaccess.io\nTERMUX_PKG_DESCRIPTION=\"An open source real-time web log analyzer and interactive viewer\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.3\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://tar.goaccess.io/goaccess-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=8c775c5c24bf85a933fd6f1249004847342d6542aa533e4ec02aaf7be41d7b9b\nTERMUX_PKG_DEPENDS=\"ncurses, openssl\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-utf8\n--with-openssl\"\n"
  },
  {
    "path": "packages/goaccess/configure.patch",
    "content": "diff -uNr goaccess-1.3/configure goaccess-1.3.mod/configure\n--- goaccess-1.3/configure\t2018-11-23 07:35:57.000000000 +0200\n+++ goaccess-1.3.mod/configure\t2019-02-01 01:24:41.379926604 +0200\n@@ -6431,56 +6431,6 @@\n fi\n \n \n-# pthread\n-{ $as_echo \"$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread\" >&5\n-$as_echo_n \"checking for pthread_create in -lpthread... \" >&6; }\n-if ${ac_cv_lib_pthread_pthread_create+:} false; then :\n-  $as_echo_n \"(cached) \" >&6\n-else\n-  ac_check_lib_save_LIBS=$LIBS\n-LIBS=\"-lpthread  $LIBS\"\n-cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n-/* end confdefs.h.  */\n-\n-/* Override any GCC internal prototype to avoid an error.\n-   Use char because int might match the return type of a GCC\n-   builtin and then its argument prototype would still apply.  */\n-#ifdef __cplusplus\n-extern \"C\"\n-#endif\n-char pthread_create ();\n-int\n-main ()\n-{\n-return pthread_create ();\n-  ;\n-  return 0;\n-}\n-_ACEOF\n-if ac_fn_c_try_link \"$LINENO\"; then :\n-  ac_cv_lib_pthread_pthread_create=yes\n-else\n-  ac_cv_lib_pthread_pthread_create=no\n-fi\n-rm -f core conftest.err conftest.$ac_objext \\\n-    conftest$ac_exeext conftest.$ac_ext\n-LIBS=$ac_check_lib_save_LIBS\n-fi\n-{ $as_echo \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create\" >&5\n-$as_echo \"$ac_cv_lib_pthread_pthread_create\" >&6; }\n-if test \"x$ac_cv_lib_pthread_pthread_create\" = xyes; then :\n-  cat >>confdefs.h <<_ACEOF\n-#define HAVE_LIBPTHREAD 1\n-_ACEOF\n-\n-  LIBS=\"-lpthread $LIBS\"\n-\n-else\n-  as_fn_error $? \"pthread is missing\" \"$LINENO\" 5\n-fi\n-\n-CFLAGS=\"$CFLAGS -pthread\"\n-\n # DEBUG\n # Check whether --enable-debug was given.\n if test \"${enable_debug+set}\" = set; then :\n"
  },
  {
    "path": "packages/goaccess/tcbtdb.h.patch",
    "content": "diff -uNr goaccess-1.3/src/tcbtdb.h goaccess-1.3.mod/src/tcbtdb.h\n--- goaccess-1.3/src/tcbtdb.h\t2018-11-23 04:00:08.000000000 +0200\n+++ goaccess-1.3.mod/src/tcbtdb.h\t2019-02-01 01:30:19.191246767 +0200\n@@ -46,7 +46,7 @@\n #define TC_LMEMB 128\n #define TC_NMEMB 256\n #define TC_BNUM  32749\n-#define TC_DBPATH \"/tmp/goaccess\"\n+#define TC_DBPATH \"@TERMUX_PREFIX@/tmp/goaccess\"\n #define TC_DBPMODE 0755\n #define TC_ZLIB 1\n #define TC_BZ2  2\n"
  },
  {
    "path": "packages/goaccess/websocket.h.patch",
    "content": "diff -uNr goaccess-1.3/src/websocket.h goaccess-1.3.mod/src/websocket.h\n--- goaccess-1.3/src/websocket.h\t2018-11-23 04:00:08.000000000 +0200\n+++ goaccess-1.3.mod/src/websocket.h\t2019-02-01 01:30:02.260971076 +0200\n@@ -90,8 +90,8 @@\n #define MAX(a,b) (((a)>(b))?(a):(b))\n #include \"gslist.h\"\n \n-#define WS_PIPEIN \"/tmp/wspipein.fifo\"\n-#define WS_PIPEOUT \"/tmp/wspipeout.fifo\"\n+#define WS_PIPEIN \"@TERMUX_PREFIX@/tmp/wspipein.fifo\"\n+#define WS_PIPEOUT \"@TERMUX_PREFIX@/tmp/wspipeout.fifo\"\n \n #define WS_BAD_REQUEST_STR \"HTTP/1.1 400 Invalid Request\\r\\n\\r\\n\"\n #define WS_SWITCH_PROTO_STR \"HTTP/1.1 101 Switching Protocols\"\n"
  },
  {
    "path": "packages/golang/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://golang.org/\nTERMUX_PKG_DESCRIPTION=\"Go programming language compiler\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nlocal _MAJOR_VERSION=1.13.5\n# Use the ~ deb versioning construct in the future:\nTERMUX_PKG_VERSION=2:${_MAJOR_VERSION}\nTERMUX_PKG_SRCURL=https://storage.googleapis.com/golang/go${_MAJOR_VERSION}.src.tar.gz\nTERMUX_PKG_SHA256=27d356e2a0b30d9983b60a788cf225da5f914066b37a6b4f69d457ba55a626ff\nTERMUX_PKG_DEPENDS=\"clang\"\nTERMUX_PKG_NO_STATICSPLIT=true\n\ntermux_step_make_install() {\n\ttermux_setup_golang\n\n\tTERMUX_GOLANG_DIRNAME=${GOOS}_$GOARCH\n\tTERMUX_GODIR=$TERMUX_PREFIX/lib/go\n\n\tcd $TERMUX_PKG_SRCDIR/src\n\t# Unset PKG_CONFIG to avoid the path being hardcoded into src/cmd/cgo/zdefaultcc.go,\n\t# see https://github.com/termux/termux-packages/issues/3505.\n\tenv CC_FOR_TARGET=$CC \\\n\t    CXX_FOR_TARGET=$CXX \\\n\t    CC=gcc \\\n\t    GO_LDFLAGS=\"-extldflags=-pie\" \\\n\t    GOROOT_BOOTSTRAP=$GOROOT \\\n\t    GOROOT_FINAL=$TERMUX_GODIR \\\n\t    PKG_CONFIG= \\\n\t    ./make.bash\n\n\tcd ..\n\trm -Rf $TERMUX_GODIR\n\tmkdir -p $TERMUX_GODIR/{bin,src,doc,lib,pkg/tool/$TERMUX_GOLANG_DIRNAME,pkg/include,pkg/${TERMUX_GOLANG_DIRNAME}}\n\tcp bin/$TERMUX_GOLANG_DIRNAME/{go,gofmt} $TERMUX_GODIR/bin/\n\tln -sfr $TERMUX_GODIR/bin/go $TERMUX_PREFIX/bin/go\n\tln -sfr $TERMUX_GODIR/bin/gofmt $TERMUX_PREFIX/bin/gofmt\n\tcp VERSION $TERMUX_GODIR/\n\tcp pkg/tool/$TERMUX_GOLANG_DIRNAME/* $TERMUX_GODIR/pkg/tool/$TERMUX_GOLANG_DIRNAME/\n\tcp -Rf src/* $TERMUX_GODIR/src/\n\tcp -Rf doc/* $TERMUX_GODIR/doc/\n\tcp pkg/include/* $TERMUX_GODIR/pkg/include/\n\tcp -Rf lib/* $TERMUX_GODIR/lib\n\tcp -Rf pkg/${TERMUX_GOLANG_DIRNAME}/* $TERMUX_GODIR/pkg/${TERMUX_GOLANG_DIRNAME}/\n}\n\ntermux_step_post_massage() {\n\tfind . -path '*/testdata*' -delete\n}\n"
  },
  {
    "path": "packages/golang/golang-doc.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/go/doc\"\nTERMUX_SUBPKG_DESCRIPTION=\"Go programming language - documentation\"\n"
  },
  {
    "path": "packages/golang/src-os-file_unix.go.patch",
    "content": "--- ../go/src/os/file_unix.go\t2015-08-06 00:36:35.000000000 -0400\n+++ ./src/os/file_unix.go\t2015-08-14 03:28:11.634760646 -0400\n@@ -329,11 +329,7 @@\n func TempDir() string {\n \tdir := Getenv(\"TMPDIR\")\n \tif dir == \"\" {\n-\t\tif runtime.GOOS == \"android\" {\n-\t\t\tdir = \"/data/local/tmp\"\n-\t\t} else {\n-\t\t\tdir = \"/tmp\"\n-\t\t}\n+\t\tdir = \"@TERMUX_PREFIX@/tmp\"\n \t}\n \treturn dir\n }\n"
  },
  {
    "path": "packages/golang/src-runtime-cgo-cgo.go.patch",
    "content": "diff -u -r ../go/src/runtime/cgo/cgo.go ./src/runtime/cgo/cgo.go\n--- ../go/src/runtime/cgo/cgo.go\t2015-08-06 00:36:35.000000000 -0400\n+++ ./src/runtime/cgo/cgo.go\t2015-08-16 16:03:29.614948543 -0400\n@@ -16,7 +16,6 @@\n #cgo darwin,arm64 LDFLAGS: -framework CoreFoundation\n #cgo dragonfly LDFLAGS: -lpthread\n #cgo freebsd LDFLAGS: -lpthread\n-#cgo android LDFLAGS: -llog\n #cgo !android,linux LDFLAGS: -lpthread\n #cgo netbsd LDFLAGS: -lpthread\n #cgo openbsd LDFLAGS: -lpthread\n"
  },
  {
    "path": "packages/golang/src-runtime-cgo-gcc_android.c.patch",
    "content": "diff -u -r ../go/src/runtime/cgo/gcc_android.c ./src/runtime/cgo/gcc_android.c\n--- ../go/src/runtime/cgo/gcc_android.c\t2015-08-06 00:36:35.000000000 -0400\n+++ ./src/runtime/cgo/gcc_android.c\t2015-08-16 16:08:05.346940583 -0400\n@@ -11,21 +11,11 @@\n {\n \tva_list ap;\n \n-\t// Write to both stderr and logcat.\n-\t//\n-\t// When running from an .apk, /dev/stderr and /dev/stdout\n-\t// redirect to /dev/null. And when running a test binary\n-\t// via adb shell, it's easy to miss logcat.\n-\n \tfprintf(stderr, \"runtime/cgo: \");\n \tva_start(ap, format);\n \tvfprintf(stderr, format, ap);\n \tva_end(ap);\n \tfprintf(stderr, \"\\n\");\n \n-\tva_start(ap, format);\n-\t__android_log_vprint(ANDROID_LOG_FATAL, \"runtime/cgo\", format, ap);\n-\tva_end(ap);\n-\n \tabort();\n }\n"
  },
  {
    "path": "packages/google-glog/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/glog\nTERMUX_PKG_DESCRIPTION=\"Logging library for C++\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.4.0\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://github.com/google/glog/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"google-glog-dev\"\nTERMUX_PKG_REPLACES=\"google-glog-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBUILD_SHARED_LIBS=ON\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -llog\"\n}\n\ntermux_step_post_make_install() {\n\tinstall -Dm600 \"$TERMUX_PKG_SRCDIR\"/libglog.pc.in \\\n\t\t\"$TERMUX_PREFIX\"/lib/pkgconfig/libglog.pc\n\tsed -i \"s|@prefix@|$TERMUX_PREFIX|g\" \"$TERMUX_PREFIX\"/lib/pkgconfig/libglog.pc\n\tsed -i \"s|@exec_prefix@|$TERMUX_PREFIX|g\" \"$TERMUX_PREFIX\"/lib/pkgconfig/libglog.pc\n\tsed -i \"s|@libdir@|$TERMUX_PREFIX/lib|g\" \"$TERMUX_PREFIX\"/lib/pkgconfig/libglog.pc\n\tsed -i \"s|@includedir@|$TERMUX_PREFIX/include|g\" \"$TERMUX_PREFIX\"/lib/pkgconfig/libglog.pc\n\tsed -i \"s|@VERSION@|$TERMUX_PKG_VERSION|g\" \"$TERMUX_PREFIX\"/lib/pkgconfig/libglog.pc\n}\n"
  },
  {
    "path": "packages/googletest/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/googletest\nTERMUX_PKG_DESCRIPTION=\"Google C++ testing framework\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.10.0\nTERMUX_PKG_SRCURL=https://github.com/google/googletest/archive/release-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DBUILD_SHARED_LIBS=ON\"\n\n"
  },
  {
    "path": "packages/gotty/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/yudai/gotty\nTERMUX_PKG_DESCRIPTION=\"Share your terminal as a web application\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.0.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/yudai/gotty/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=32695d70a79f55efdf4fba6f06f830515a2055abc58fc15e2124dff5be75695b\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/github.com/yudai\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/yudai/gotty\n\n\tcd \"$GOPATH\"/src/github.com/yudai/gotty\n\tgo build\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/src/github.com/yudai/gotty/gotty \\\n\t\t\"$TERMUX_PREFIX\"/bin/\n}\n"
  },
  {
    "path": "packages/gperf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gperf\nTERMUX_PKG_DESCRIPTION=\"A perfect hash function generator\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=3.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gperf/gperf-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/gperf/output.cc.patch",
    "content": "--- ./src/output.cc\n+++ ../src/output.cc\n@@ -2083,6 +2083,16 @@\n     }\n   printf (\"\\n\");\n \n+  // Include stdlib.h or cstdlib header to fix errors about size_t\n+  if (option[KRC] || option[C] || option[ANSIC])\n+    {\n+      printf(\"#include <stdlib.h>\\n\\n\");\n+    }\n+  else if (option[CPLUSPLUS])\n+    {\n+      printf(\"#include <cstdlib>\\n\\n\");\n+    }\n+\n   if (_charset_dependent\n       && (_key_positions.get_size() > 0 || option[UPPERLOWER]))\n     {\n"
  },
  {
    "path": "packages/gpgme/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/gpgme/\nTERMUX_PKG_DESCRIPTION=\"Library designed to make access to GnuPG easier\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.13.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=ftp://ftp.gnupg.org/gcrypt/gpgme/gpgme-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=c4e30b227682374c23cddc7fdb9324a99694d907e79242a25a4deeedb393be46\nTERMUX_PKG_DEPENDS=\"gnupg (>= 2.2.9-1), libassuan, libgpg-error\"\nTERMUX_PKG_BREAKS=\"gpgme-dev\"\nTERMUX_PKG_REPLACES=\"gpgme-dev\"\n# Use \"--disable-gpg-test\" to avoid \"No rule to make target `../../src/libgpgme-pthread.la\":\n# Use \"--enable-languages=no\" to only build the C library.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-gpg-test\n--enable-languages=no\n--with-gpg=$TERMUX_PREFIX/bin/gpg2\n--without-g13\n--without-gpgconf\n--without-gpgsm\n\"\n"
  },
  {
    "path": "packages/gpsbabel/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gpsbabel.org/\nTERMUX_PKG_DESCRIPTION=\"GPS file conversion plus transfer to/from GPS units\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.4.4\nTERMUX_PKG_SHA256=22860e913f093aa9124e295d52d1d4ae1afccaa67ed6bed6f1f8d8b0a45336d1\nTERMUX_PKG_SRCURL=https://github.com/gpsbabel/gpsbabel/archive/gpsbabel_${TERMUX_PKG_VERSION//./_}.tar.gz\nTERMUX_PKG_DEPENDS=\"libexpat\"\n\ntermux_step_post_extract_package() {\n\tTERMUX_PKG_SRCDIR+=/gpsbabel\n}\n"
  },
  {
    "path": "packages/graphicsmagick/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.graphicsmagick.org/\nTERMUX_PKG_DESCRIPTION=\"Collection of image processing tools\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.3.33\n# Bandwith limited on main ftp site, so it's asked to use sourceforge instead:\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/${TERMUX_PKG_VERSION}/GraphicsMagick-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=130cb330a633580b5124eba5c125bbcbc484298423a97b9bed37ccd50d6dc778\nTERMUX_PKG_DEPENDS=\"littlecms, libc++, libtiff, freetype, libjasper, libjpeg-turbo, libpng, libbz2, libxml2, liblzma, zstd, zlib\"\nTERMUX_PKG_BREAKS=\"graphicsmagick-dev\"\nTERMUX_PKG_REPLACES=\"graphicsmagick++, graphicsmagick-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_ftime=no\n--with-fontpath=/system/fonts\n--without-webp\n--without-x\n\"\n"
  },
  {
    "path": "packages/graphviz/add-libcommon-to-gc.patch",
    "content": "diff -r -u graphviz-2.38.0/cmd/tools/Makefile.am src/cmd/tools/Makefile.am\n--- graphviz-2.38.0/cmd/tools/Makefile.am\t2014-04-13 13:40:25.000000000 -0700\n+++ src/cmd/tools/Makefile.am\t2016-04-09 09:34:27.178979677 -0700\n@@ -135,6 +135,7 @@\n gc_SOURCES = gc.c\n \n gc_LDADD = \\\n+\t$(top_builddir)/lib/common/libcommon_C.la \\\n \t$(top_builddir)/lib/ingraphs/libingraphs_C.la \\\n \t$(top_builddir)/lib/cgraph/libcgraph.la\n \nOnly in src/cmd/tools: Makefile.am~\ndiff -r -u graphviz-2.38.0/cmd/tools/Makefile.in src/cmd/tools/Makefile.in\n--- graphviz-2.38.0/cmd/tools/Makefile.in\t2014-04-13 13:41:53.000000000 -0700\n+++ src/cmd/tools/Makefile.in\t2016-04-09 09:35:23.858509449 -0700\n@@ -722,6 +722,7 @@\n \n gc_SOURCES = gc.c\n gc_LDADD = \\\n+\t$(top_builddir)/lib/common/libcommon_C.la \\\n \t$(top_builddir)/lib/ingraphs/libingraphs_C.la \\\n \t$(top_builddir)/lib/cgraph/libcgraph.la\n \nOnly in src/cmd/tools: Makefile.in~\n"
  },
  {
    "path": "packages/graphviz/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.graphviz.org/\nTERMUX_PKG_DESCRIPTION=\"Rich set of graph drawing tools\"\nTERMUX_PKG_LICENSE=\"EPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Dustin DeWeese @HackerFoo\"\nTERMUX_PKG_VERSION=2.40.1\nTERMUX_PKG_REVISION=9\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/graphviz-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=ca5218fade0204d59947126c38439f432853543b0818d9d728c589dfe7f3a421\nTERMUX_PKG_DEPENDS=\"libandroid-glob, libc++, libcairo, pango, libexpat, libltdl, librsvg, libgd, zlib\"\nTERMUX_PKG_BREAKS=\"graphviz-dev\"\nTERMUX_PKG_REPLACES=\"graphviz-dev\"\nTERMUX_PKG_BUILD_DEPENDS=\"libtool\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-guile=no\n--enable-java=no\n--enable-lua=no\n--enable-ocaml=no\n--enable-perl=no\n--enable-php=no\n--enable-python=no\n--enable-r=no\n--enable-ruby=no\n--enable-sharp=no\n--enable-swig=no\n--enable-tcl=no\n--with-ltdl-include=$TERMUX_PREFIX/include\n--with-ltdl-lib=$TERMUX_PREFIX/lib\n--with-pangocairo=yes\n--with-pic\n--with-poppler=no\n--with-x=no\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/*-config share/man/man1/*-config.1\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n\tCPPFLAGS+=\" -D_typ_ssize_t=1\"\n}\n\ntermux_step_post_make_install() {\n\t# Some binaries (dot_builtins, gvpack) links against these:\n\tcd $TERMUX_PREFIX/lib\n\tfor lib in graphviz/*.so.*; do\n\t\tln -s -f $lib $(basename $lib)\n\tdone\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"dot -c\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n}\n"
  },
  {
    "path": "packages/graphviz/cmd-edgepaint-Makefile.in.patch",
    "content": "diff -u -r ../graphviz-2.40.1/cmd/edgepaint/Makefile.in ./cmd/edgepaint/Makefile.in\n--- ../graphviz-2.40.1/cmd/edgepaint/Makefile.in\t2016-12-25 03:04:55.000000000 +0000\n+++ ./cmd/edgepaint/Makefile.in\t2019-04-26 20:26:13.197184745 +0000\n@@ -585,7 +585,7 @@\n \t$(top_builddir)/lib/edgepaint/liblab_gamut.la \\\n \t$(top_builddir)/lib/cgraph/libcgraph.la \\\n \t$(top_builddir)/lib/cdt/libcdt.la \\\n-\t$(ANN_LIBS) -lstdc++ -lm\n+\t$(ANN_LIBS) -lc++_shared -lm\n \n EXTRA_DIST = $(man_MANS) $(pdf_DATA) edgepaint.vcxproj*\n DISTCLEANFILES = $(pdf_DATA)\n"
  },
  {
    "path": "packages/graphviz/configure.patch",
    "content": "Do not require libltdl.la for building.\n\ndiff -u -r ../graphviz-2.40.1/configure ./configure\n--- ../graphviz-2.40.1/configure\t2016-12-25 04:04:52.000000000 +0100\n+++ ./configure\t2017-08-11 14:35:43.459379008 +0200\n@@ -19556,15 +19556,6 @@\n fi\n \n \n-if test -n \"$with_ltdl_lib\"; then\n-  if test -f \"$with_ltdl_lib/libltdl.la\"; then :\n-  else\n-    as_fn_error $? \"invalid ltdl library directory: \\`$with_ltdl_lib'\" \"$LINENO\" 5\n-  fi\n-else\n-  with_ltdl_lib=no\n-fi\n-\n case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in\n   ,yes,no,no,)\n \tcase $enable_ltdl_convenience in\n"
  },
  {
    "path": "packages/graphviz/no-configure-dot-plugins.patch",
    "content": "diff -r -u graphviz-2.38.0/cmd/dot/Makefile.am src/cmd/dot/Makefile.am\n--- graphviz-2.38.0/cmd/dot/Makefile.am\t2014-04-13 13:40:25.000000000 -0700\n+++ src/cmd/dot/Makefile.am\t2016-04-04 15:38:30.797597592 -0700\n@@ -58,7 +58,6 @@\n # run \"dot -c\", if possible, to create plugin config\n install-exec-hook:\n \t(cd $(DESTDIR)$(bindir); if test -x dot$(EXEEXT); then for i in $(linkedprogram); do rm -f $$i; $(LN_S) dot$(EXEEXT) $$i; done; fi;)\n-\tif 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\n \n uninstall-hook:\n \t(cd $(DESTDIR)$(man1dir); for i in $(linkedman); do rm -f $$i; done;)\nOnly in src/cmd/dot: Makefile.am~\ndiff -r -u graphviz-2.38.0/cmd/dot/Makefile.in src/cmd/dot/Makefile.in\n--- graphviz-2.38.0/cmd/dot/Makefile.in\t2014-04-13 13:41:50.000000000 -0700\n+++ src/cmd/dot/Makefile.in\t2016-04-04 15:38:02.213908307 -0700\n@@ -1177,7 +1177,6 @@\n # run \"dot -c\", if possible, to create plugin config\n install-exec-hook:\n \t(cd $(DESTDIR)$(bindir); if test -x dot$(EXEEXT); then for i in $(linkedprogram); do rm -f $$i; $(LN_S) dot$(EXEEXT) $$i; done; fi;)\n-\tif 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\n \n uninstall-hook:\n \t(cd $(DESTDIR)$(man1dir); for i in $(linkedman); do rm -f $$i; done;)\nOnly in src/cmd/dot: Makefile.in~\n"
  },
  {
    "path": "packages/graphviz/no-mkdefs.patch",
    "content": "http://www.graphviz.org/content/cant-cross-compile-graphviz\n\ndiff -u -r ../graphviz-2.40.1/lib/gvpr/Makefile.am ./lib/gvpr/Makefile.am\n--- ../graphviz-2.40.1/lib/gvpr/Makefile.am\t2016-08-09 23:02:10.000000000 +0200\n+++ ./lib/gvpr/Makefile.am\t2017-01-19 20:01:22.745725697 +0100\n@@ -57,7 +57,7 @@\n mkdefs_SOURCES = mkdefs.c\n \n gdefs.h: $(top_srcdir)/lib/gvpr/gprdata mkdefs$(EXEEXT)\n-\t./mkdefs$(EXEEXT) gdefs.h < $(top_srcdir)/lib/gvpr/gprdata\n+\ttouch gdefs.h\n \n EXTRA_DIST = $(man_MANS) $(pdf_DATA) gprdata mkdefs.c gdefs.h trie.c gvprlib.vcxproj*\n \ndiff -u -r ../graphviz-2.40.1/lib/gvpr/Makefile.in ./lib/gvpr/Makefile.in\n--- ../graphviz-2.40.1/lib/gvpr/Makefile.in\t2016-12-25 04:04:59.000000000 +0100\n+++ ./lib/gvpr/Makefile.in\t2017-01-19 20:02:07.293214993 +0100\n@@ -1084,7 +1084,7 @@\n \t- @GROFF@ -Tps -man $(srcdir)/gvpr.3 | @PS2PDF@ - - >gvpr.3.pdf\n \n gdefs.h: $(top_srcdir)/lib/gvpr/gprdata mkdefs$(EXEEXT)\n-\t./mkdefs$(EXEEXT) gdefs.h < $(top_srcdir)/lib/gvpr/gprdata\n+\ttouch gdefs.h\n \n # Tell versions [3.59,3.63) of GNU make to not export all variables.\n # Otherwise a system limit (for SysV at least) may be exceeded.\n"
  },
  {
    "path": "packages/graphviz/sfdpgen-free.patch",
    "content": "--- src/lib/sfdpgen/PriorityQueue.c.orig\t2016-04-01 08:29:58.788223689 -0700\n+++ src/lib/sfdpgen/PriorityQueue.c\t2016-04-01 08:30:44.507731384 -0700\n@@ -11,6 +11,8 @@\n  * Contributors: See CVS logs. Details at http://www.graphviz.org/\n  *************************************************************************/\n \n+void free(void *ptr);\n+\n #include \"LinkedList.h\"\n #include \"PriorityQueue.h\"\n #include \"memory.h\"\n"
  },
  {
    "path": "packages/grep/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/grep/\nTERMUX_PKG_DESCRIPTION=\"Command which searches one or more input files for lines containing a match to a specified pattern\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=3.3\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/grep/grep-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=b960541c499619efd6afe1fa795402e4733c8e11ebf9fafccc0bb4bccdc5b514\nTERMUX_PKG_DEPENDS=\"libandroid-support, pcre\"\nTERMUX_PKG_ESSENTIAL=true\n\ntermux_step_pre_configure() {\n\tif $TERMUX_DEBUG; then\n\t\t# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:\n\t\t# /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'\n\t\t# return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap);\n\t\t#                                                 ^\n\t\t# lib/cdefs.h:123:48: note: expanded from macro '__bos'\n\t\t# #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)\n\t\t#                                                ^\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n"
  },
  {
    "path": "packages/gsl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gsl/\nTERMUX_PKG_DESCRIPTION=\"GNU Scientific Library (GSL) providing a wide range of mathematical routines\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.6\nTERMUX_PKG_SHA256=b782339fc7a38fe17689cb39966c4d821236c28018b6593ddb6fd59ee40786a8\nTERMUX_PKG_BREAKS=\"gsl-dev\"\nTERMUX_PKG_REPLACES=\"gsl-dev\"\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gsl/gsl-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/ share/man/man1\"\n\n# Workaround for linker on Android 5 (fixed in Android 6) not supporting RTLD_GLOBAL.\n# See https://github.com/termux/termux-packages/issues/507\nexport GSL_LDFLAGS=\"-Lcblas/.libs/ -lgslcblas\"\n"
  },
  {
    "path": "packages/gst-plugins-bad/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"GStreamer Bad Plug-ins\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.16.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=56481c95339b8985af13bac19b18bc8da7118c2a7d9440ed70e7dcd799c2adb5\nTERMUX_PKG_DEPENDS=\"gst-plugins-base, libbz2, libcurl, libiconv, libpng, librsvg, libssh2, libsndfile, libx264, libx265, littlecms, openal-soft, openjpeg\"\nTERMUX_PKG_BREAKS=\"gst-plugins-bad-dev\"\nTERMUX_PKG_REPLACES=\"gst-plugins-bad-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-android_media\n--disable-examples\n--disable-rtmp\n--disable-tests\n--disable-zbar\n--disable-webp\n--with-hls-crypto=openssl\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gtk-doc/\"\n\ntermux_step_pre_configure() {\n\texport GNUSTL_LIBS=\"-lc\"\n\texport GNUSTL_CFLAGS=\"-Oz\"\n\texport GLIB_MKENUMS=\"/usr/bin/glib-mkenums\"\n}\n"
  },
  {
    "path": "packages/gst-plugins-base/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"GStreamer base plug-ins\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.16.1\nTERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=5c3cc489933d0597087c9bc6ba251c93693d64554bcc563539a084fa2d5fcb2b\nTERMUX_PKG_DEPENDS=\"gstreamer, libjpeg-turbo, libopus, libpng, libvorbis, zlib\"\nTERMUX_PKG_BREAKS=\"gst-plugins-base-dev\"\nTERMUX_PKG_REPLACES=\"gst-plugins-base-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nGLIB_GENMARSHAL=/usr/bin/glib-genmarshal\nGLIB_MKENUMS=/usr/bin/glib-mkenums\n--disable-tests\n--disable-examples\n--disable-pango\n\"\n"
  },
  {
    "path": "packages/gst-plugins-good/autoplug_libcaca.patch",
    "content": "--- src/ext/libcaca/gstcacasink.c.orig\t2017-10-05 05:57:01.990156123 +0000\n+++ src/ext/libcaca/gstcacasink.c\t2017-10-05 06:17:58.320938634 +0000\n@@ -407,7 +407,7 @@\n static gboolean\n plugin_init (GstPlugin * plugin)\n {\n-  if (!gst_element_register (plugin, \"cacasink\", GST_RANK_NONE,\n+  if (!gst_element_register (plugin, \"cacasink\", GST_RANK_PRIMARY,\n           GST_TYPE_CACASINK))\n     return FALSE;\n \n"
  },
  {
    "path": "packages/gst-plugins-good/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"GStreamer Good Plug-ins\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.16.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=9fbabe69018fcec707df0b71150168776040cde6c1a26bb5a82a136755fa8f1f\nTERMUX_PKG_DEPENDS=\"gst-plugins-base, libcaca, libsoup, libjpeg-turbo, libpng, libflac, libbz2, libvpx, pulseaudio, libmp3lame, gstreamer, libogg, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n# pcre needed by glib. libxml2 needed by libsoup\nTERMUX_PKG_BUILD_DEPENDS=\"glib, pcre, libxml2\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-android_media\n--disable-cairo\n--disable-examples\n--disable-gdk_pixbuf\n--disable-oss\n--disable-oss4\n--disable-tests\n--disable-gst_v4l2\n--disable-aalib\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gtk-doc/\"\n"
  },
  {
    "path": "packages/gst-plugins-ugly/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"GStreamer Ugly Plug-ins\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.16.1\nTERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=4bf913b2ca5195ac3b53b5e3ade2dc7c45d2258507552ddc850c5fa425968a1d\nTERMUX_PKG_DEPENDS=\"gst-plugins-base, libx264\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-tests\n--disable-examples\n--disable-android_media\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gtk-doc/\"\n"
  },
  {
    "path": "packages/gstreamer/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gstreamer.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"Open source multimedia framework\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.16.1\nTERMUX_PKG_SRCURL=https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=02211c3447c4daa55919c5c0f43a82a6fbb51740d57fc3af0639d46f1cf4377d\nTERMUX_PKG_DEPENDS=\"glib\"\nTERMUX_PKG_BREAKS=\"gstreamer-dev\"\nTERMUX_PKG_REPLACES=\"gstreamer-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-check\n--disable-tests\n--disable-examples\n--disable-benchmarks\n--with-unwind=no\n--with-dw=no\nGLIB_GENMARSHAL=/usr/bin/glib-genmarshal\nGLIB_MKENUMS=/usr/bin/glib-mkenums\n\"\n"
  },
  {
    "path": "packages/gtypist/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gtypist/\nTERMUX_PKG_DESCRIPTION=\"Universal typing tutor\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.9.5\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gtypist/gtypist-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=c13af40b12479f8219ffa6c66020618c0ce305ad305590fde02d2c20eb9cf977\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv, ncurses\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_header_ncursesw_ncurses_h=yes --enable-nls=no ac_cv_header_libintl_h=no\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/emacs/site-lisp bin/typefortune share/man/man1/typefortune.1\"\n"
  },
  {
    "path": "packages/gtypist/dont_build_manpage.patch",
    "content": "diff -u -r ../gtypist-2.9.4/src/Makefile.in ./src/Makefile.in\n--- ../gtypist-2.9.4/src/Makefile.in\t2014-02-02 14:06:58.000000000 +0100\n+++ ./src/Makefile.in\t2014-03-01 01:38:51.000000000 +0100\n@@ -324,7 +324,6 @@\n \n \n # GEN_MAN is a shell command that generates the man page\n-man_MANS = gtypist.1\n MAINTAINERCLEANFILES = gtypist.1\n all: all-am\n \n"
  },
  {
    "path": "packages/gtypist/src-cursmenu.c.patch",
    "content": "diff -u -r ../gtypist-2.9.5/src/cursmenu.c ./src/cursmenu.c\n--- ../gtypist-2.9.5/src/cursmenu.c\t2013-08-18 14:36:14.000000000 +0000\n+++ ./src/cursmenu.c\t2017-07-07 08:35:39.553927999 +0000\n@@ -20,6 +20,7 @@\n #include \"config.h\"\n #include \"cursmenu.h\"\n #include \"script.h\"\n+#include \"utf8.h\"\n \n #ifdef HAVE_PDCURSES\n #include <curses.h>\n"
  },
  {
    "path": "packages/gtypist/src-gtypist.c.patch",
    "content": "diff -u -r ../gtypist-2.9.5/src/gtypist.c ./src/gtypist.c\n--- ../gtypist-2.9.5/src/gtypist.c\t2014-08-12 06:29:13.000000000 +0000\n+++ ./src/gtypist.c\t2017-07-07 08:34:41.950574988 +0000\n@@ -21,6 +21,7 @@\n  */\n \n #include \"config.h\"\n+#include \"utf8.h\"\n #include <stdlib.h>\n #include <unistd.h>\n #include <stdio.h>\n@@ -42,7 +43,7 @@\n #include <assert.h>\n #include <locale.h>\n #include <wctype.h>\n-#ifndef MINGW\n+#if !defined(MINGW) && !defined(__ANDROID__)\n #include <langinfo.h>\n #endif\n \n@@ -62,6 +63,8 @@\n char* locale_encoding; /* current locale's encoding */\n int isUTF8Locale; /* does the current locale have a UTF-8 encoding? */\n \n+void check_script_file_with_current_encoding( FILE *script );\n+\n /* character to be display to represent \"enter key\" */\n /* TODO: this requires beginner mode!\n #define RETURN_CHARACTER 0x000023CE */\n@@ -139,7 +142,7 @@\n #define ADDCH_REV(X) wideaddch_rev(X)\n \n \n-#ifdef MINGW\n+#if defined(MINGW) || defined(__ANDROID__)\n #define MIN( a, b ) ( ( a ) < ( b )? ( a ) : ( b ) )\n #define MAX( a, b ) ( ( a ) > ( b )? ( a ) : ( b ) )\n #endif\n@@ -2010,7 +2013,7 @@\n   textdomain (PACKAGE);\n #endif\n \n-#ifdef MINGW\n+#if defined(MINGW) || defined(__ANDROID__)\n   locale_encoding = \"UTF-8\";\n #else\n   locale_encoding = nl_langinfo(CODESET);\n"
  },
  {
    "path": "packages/gtypist/src-utf8.c.patch",
    "content": "diff -u -r ../gtypist-2.9.5/src/utf8.c ./src/utf8.c\n--- ../gtypist-2.9.5/src/utf8.c\t2013-08-18 14:36:14.000000000 +0000\n+++ ./src/utf8.c\t2017-07-07 08:32:20.764160765 +0000\n@@ -19,6 +19,7 @@\n \n #include \"config.h\"\n #include \"utf8.h\"\n+#include \"error.h\"\n \n #ifdef HAVE_PDCURSES\n #include <curses.h>\n"
  },
  {
    "path": "packages/gumbo-parser/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/gumbo-parser\nTERMUX_PKG_DESCRIPTION=\"An HTML5 parsing library\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.10.1\nTERMUX_PKG_SRCURL=https://github.com/google/gumbo-parser/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/gzip/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gzip/\nTERMUX_PKG_DESCRIPTION=\"Standard GNU file compression utilities\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.10\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gzip/gzip-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=8425ccac99872d544d4310305f915f5ea81e04d0f437ef1a230dc9d1c819d7c0\nTERMUX_PKG_ESSENTIAL=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_path_GREP=grep\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = i686 ]; then\n\t\t# Avoid text relocations\n\t\texport DEFS=\"NO_ASM\"\n\tfi\n}\n"
  },
  {
    "path": "packages/gzip/fix-gzexe.patch",
    "content": "diff -uNr gzip-1.9/gzexe.in gzip-1.9.mod/gzexe.in\n--- gzip-1.9/gzexe.in\t2018-01-07 07:05:21.000000000 +0200\n+++ gzip-1.9.mod/gzexe.in\t2018-03-05 21:35:50.589287700 +0200\n@@ -113,7 +113,7 @@\n   esac\n \n   dir=`dirname \"$file\"` || dir=$TMPDIR\n-  test -d \"$dir\" && test -w \"$dir\" && test -x \"$dir\" || dir=/tmp\n+  test -d \"$dir\" && test -w \"$dir\" && test -x \"$dir\" || dir=@TERMUX_PREFIX@/tmp\n   test -n \"$tmp\" && rm -f \"$tmp\"\n   if test -z \"$mktemp_status\"; then\n     type mktemp >/dev/null 2>&1\n@@ -144,8 +144,9 @@\n   fi\n   if test $decomp -eq 0; then\n     (cat <<'EOF' &&\n-#!/bin/sh\n-skip=44\n+#!@TERMUX_PREFIX@/bin/sh\n+skip=50\n+set -e\n \n tab='\t'\n nl='\n@@ -164,7 +165,7 @@\n case $TMPDIR in\n   / | /*/) ;;\n   /*) TMPDIR=$TMPDIR/;;\n-  *) TMPDIR=/tmp/;;\n+  *) TMPDIR=@TERMUX_PREFIX@/tmp/;;\n esac\n if type mktemp >/dev/null 2>&1; then\n   gztmpdir=`mktemp -d \"${TMPDIR}gztmpXXXXXXXXX\"`\n@@ -201,7 +202,7 @@\n \n   else\n     # decompression\n-    skip=44\n+    skip=50\n     skip_line=`sed -e 1d -e 2q \"$file\"`\n     case $skip_line in\n     skip=[0-9] | skip=[0-9][0-9] | skip=[0-9][0-9][0-9])\n"
  },
  {
    "path": "packages/gzip/lib-stdio-impl.h.patch",
    "content": "diff -u -r ../gzip-1.10/lib/stdio-impl.h ./lib/stdio-impl.h\n--- ../gzip-1.10/lib/stdio-impl.h\t2018-06-25 04:09:24.000000000 +0000\n+++ ./lib/stdio-impl.h\t2019-01-03 00:28:58.881820632 +0000\n@@ -60,7 +60,7 @@\n #  define _flags pub._flags\n #  define _r pub._r\n #  define _w pub._w\n-# elif defined __ANDROID__ /* Android */\n+# elif defined __ANDROID_BUT_THIS_IS_BROKEN__ /* Android */\n   /* Up to this commit from 2015-10-12\n      <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>\n      the innards of FILE were public, and fp_ub could be defined like for OpenBSD,\n"
  },
  {
    "path": "packages/gzip/zdiff.in.patch",
    "content": "diff -uNr gzip-1.10/zdiff.in gzip-1.10.mod/zdiff.in\n--- gzip-1.10/zdiff.in\t2018-03-31 06:55:32.000000000 +0300\n+++ gzip-1.10.mod/zdiff.in\t2019-03-01 18:41:43.685032331 +0200\n@@ -119,7 +119,7 @@\n                         case $TMPDIR in\n                           / | /*/) ;;\n                           /*) TMPDIR=$TMPDIR/;;\n-                          *) TMPDIR=/tmp/;;\n+                          *) TMPDIR=@TERMUX_PREFIX@/tmp/;;\n                         esac\n                         if type mktemp >/dev/null 2>&1; then\n                           tmp=`mktemp \"${TMPDIR}zdiffXXXXXXXXX\"` ||\n"
  },
  {
    "path": "packages/gzip/zgrep.in.patch",
    "content": "diff -uNr gzip-1.10/zgrep.in gzip-1.10.mod/zgrep.in\n--- gzip-1.10/zgrep.in\t2018-03-31 06:55:32.000000000 +0300\n+++ gzip-1.10.mod/zgrep.in\t2019-03-01 18:41:31.001645453 +0200\n@@ -136,7 +136,7 @@\n       case $TMPDIR in\n         / | /*/) ;;\n         /*) TMPDIR=$TMPDIR/;;\n-        *) TMPDIR=/tmp/;;\n+        *) TMPDIR=@TERMUX_PREFIX@/tmp/;;\n       esac\n       if type mktemp >/dev/null 2>&1; then\n         pattmp=$(mktemp \"${TMPDIR}zgrepXXXXXXXXX\") || exit 2\n"
  },
  {
    "path": "packages/harfbuzz/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/HarfBuzz/\nTERMUX_PKG_DESCRIPTION=\"OpenType text shaping engine\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.6.4\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/harfbuzz-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=9413b8d96132d699687ef914ebb8c50440efc87b3f775d25856d7ec347c03c12\nTERMUX_PKG_DEPENDS=\"freetype, glib, libbz2, libc++, libpng, libgraphite\"\nTERMUX_PKG_BREAKS=\"harfbuzz-dev\"\nTERMUX_PKG_REPLACES=\"harfbuzz-dev\"\nTERMUX_PKG_BUILD_DEPENDS=\"libicu\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-icu=yes --with-graphite2=yes --disable-gtk-doc-html\"\n"
  },
  {
    "path": "packages/harfbuzz/harfbuzz-icu.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/libharfbuzz-icu*\"\nTERMUX_SUBPKG_DESCRIPTION=\"OpenType text shaping engine ICU backend\"\nTERMUX_SUBPKG_DEPENDS=\"libicu\"\n"
  },
  {
    "path": "packages/harfbuzz/harfbuzz-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Tools using the harfbuzz library\"\nTERMUX_SUBPKG_DEPENDS=\"libcairo, fontconfig, liblzma, libpixman, libxml2\"\n"
  },
  {
    "path": "packages/hashdeep/PRIu_PRId.patch",
    "content": "--- ../display.cpp.orig\t2018-09-14 05:18:09.639671232 +0000\n+++ ./src/display.cpp\t2018-09-14 05:31:01.173668070 +0000\n@@ -311,7 +311,13 @@\n \n \tss << mb_read << \"MB of \" << fdht->stat_megs() << \"MB done, \";\n \tchar msg[64];\n-\tsnprintf(msg,sizeof(msg),\"%02\"PRIu64\":%02\"PRIu64\":%02\"PRIu64\" left\", hour, min, seconds);\n+\tsnprintf(msg,sizeof(msg),\"%02\"\n+\t\t PRIu64\n+\t\t \":%02\"\n+\t\t PRIu64\n+\t\t \":%02\"\n+\t\t PRIu64\n+\t\t \" left\", hour, min, seconds);\n \tss << msg;\n     }\n     ss << \"\\r\";\n@@ -424,14 +430,23 @@\n   \n     if (opt_verbose)    {\n \tif(opt_verbose >= MORE_VERBOSE){\n-\t    status(\"   Input files examined: %\"PRIu64, this->match.total);\n-\t    status(\"  Known files expecting: %\"PRIu64, this->match.expect);\n+\t    status(\"   Input files examined: %\"\n+\t\t   PRIu64\n+\t\t   , this->match.total);\n+\t    status(\"  Known files expecting: %\"\n+\t\t   PRIu64\n+\t\t   , this->match.expect);\n \t}\n-\tstatus(\"          Files matched: %\"PRIu64, this->match.exact);\n-\tstatus(\"Files partially matched: %\"PRIu64, this->match.partial);\n-\tstatus(\"            Files moved: %\"PRIu64, this->match.moved);\n-\tstatus(\"        New files found: %\"PRIu64, this->match.unknown);\n-\tstatus(\"  Known files not found: %\"PRIu64, this->match.unused);\n+\tstatus(\"          Files matched: %\"\n+\t       PRIu64, this->match.exact);\n+\tstatus(\"Files partially matched: %\"\n+\t       PRIu64, this->match.partial);\n+\tstatus(\"            Files moved: %\"\n+\t       PRIu64, this->match.moved);\n+\tstatus(\"        New files found: %\"\n+\t       PRIu64, this->match.unknown);\n+\tstatus(\"  Known files not found: %\"\n+\t       PRIu64, this->match.unused);\n     }\n }\n \n--- ../files.cpp.orig\t2018-09-14 05:40:44.400251202 +0000\n+++ ./src/files.cpp\t2018-09-14 05:53:37.048950212 +0000\n@@ -509,7 +509,8 @@\n         \n \t    // Users expect the line numbers to start at one, not zero.\n \t    if ((!ocb.opt_silent) || (mode_warn_only)) {\n-\t\tocb.error(\"%s: No hash found in line %\"PRIu32, fn, count + 1);\n+\t\tocb.error(\"%s: No hash found in line %\"\n+\t\t\t  PRIu32, fn, count + 1);\n \t\tocb.error(\"%s: %s\", fn, strerror(errno));\n \t\treturn status_t::STATUS_USER_ERROR;\n \t    }\n@@ -542,7 +543,9 @@\n     }\n \n     if (expected_hashes != count){\n-\tocb.error(\"%s: Expecting %\"PRIu32\" hashes, found %\"PRIu32\"\\n\", \n+\tocb.error(\"%s: Expecting %\"\n+\t\t  PRIu32\" hashes, found %\"\n+\t\t  PRIu32\"\\n\", \n \t\t\tfn, expected_hashes, count);\n     }\n     return status_t::status_ok;\n--- ../hash.cpp.orig\t2018-09-14 05:18:30.955822289 +0000\n+++ ./src/hash.cpp\t2018-09-14 05:31:24.777749460 +0000\n@@ -124,7 +124,9 @@\n     \n \t// If an error occured, display a message and see if we need to quit.\n \tif ((current_read_bytes<0) || (this->handle && ferror(this->handle))){\n-\t    ocb->error_filename(this->file_name,\"error at offset %\"PRIu64\": %s\",\n+\t    ocb->error_filename(this->file_name,\"error at offset %\"\n+\t\t\t\tPRIu64\n+\t\t\t\t\": %s\",\n \t\t\t\trequest_start, strerror(errno));\n \t   \n \t    if (file_fatal_error()){\n--- ../hashlist.cpp.orig\t2018-09-14 05:32:48.130337357 +0000\n+++ ./src/hashlist.cpp\t2018-09-14 05:33:08.194462187 +0000\n@@ -342,7 +342,8 @@\n     file_data_t *t = new (std::nothrow) file_data_t();\n     if (NULL == t)\n     {\n-      ocb->fatal_error(\"%s: Out of memory in line %\"PRIu64,\n+      ocb->fatal_error(\"%s: Out of memory in line %\"\n+\t\t       PRIu64,\n \t\t       fn.c_str(), line_number);\n     }\n \n@@ -390,7 +391,8 @@\n       if ( !algorithm_t::valid_hash(hash_column[column_number],word))\n       {\n \tif (ocb)\n-\t  ocb->error(\"%s: Invalid %s hash in line %\"PRIu64,\n+\t  ocb->error(\"%s: Invalid %s hash in line %\"\n+\t\t     PRIu64,\n \t\t     fn.c_str(),\n \t\t     hashes[hash_column[column_number]].name.c_str(),\n \t\t     line_number);\n--- ../xml.h.orig\t2018-09-14 05:12:00.783661170 +0000\n+++ ./src/xml.h\t2018-09-14 05:29:23.697673797 +0000\n@@ -100,7 +100,8 @@\n     void xmlout(const std::string &tag,const std::string &value){ xmlout(tag,value,\"\",true); }\n     void xmlout(const std::string &tag,const int value){ xmlprintf(tag,\"\",\"%d\",value); }\n     void xmloutl(const std::string &tag,const long value){ xmlprintf(tag,\"\",\"%ld\",value); }\n-    void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,\"\",\"%\"PRId64,value); }\n+    void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,\"\",\"%\"\n+\t\t\t\t\t\t\t\t       PRId64,value); }\n     void xmlout(const std::string &tag,const double value){ xmlprintf(tag,\"\",\"%f\",value); }\n     void xmlout(const std::string &tag,const struct timeval &ts){\n \txmlprintf(tag,\"\",\"%d.%06d\",(int)ts.tv_sec, (int)ts.tv_usec);\n"
  },
  {
    "path": "packages/hashdeep/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://md5deep.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Programs to compute hashsums of arbitrary number of files recursively\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.4\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://github.com/jessek/hashdeep/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=ad78d42142f9a74fe8ec0c61bc78d6588a528cbb9aede9440f50b6ff477f3a7f\nTERMUX_PKG_DEPENDS=\"libc++\"\n\ntermux_step_pre_configure() {\n\tsh bootstrap.sh\n\tCPPFLAGS+=\" -DTERMUX_EXPOSE_FILE_OFFSET64=1\"\n}\n"
  },
  {
    "path": "packages/hashdeep/configure.ac.patch",
    "content": "Remove -MD option as that avoids pie wrapper script functionality.\n\ndiff -u -r ../hashdeep-4.4/configure.ac ./configure.ac\n--- ../hashdeep-4.4/configure.ac\t2015-04-01 02:12:52.000000000 +0200\n+++ ./configure.ac\t2017-09-23 02:18:08.770776322 +0200\n@@ -64,7 +64,7 @@\n ################################################################\n ### I am a glutten for punishment and this is security-critical software\n # Check GCC\n-WARNINGS_TO_TEST=\"-MD -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes \\\n+WARNINGS_TO_TEST=\"-D_FORTIFY_SOURCE=2 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes \\\n     -Wshadow -Wwrite-strings -Wcast-align -Waggregate-return \\\n     -Wbad-function-cast -Wcast-qual -Wundef -Wredundant-decls -Wdisabled-optimization \\\n     -Wfloat-equal -Wmissing-format-attribute -Wmultichar -Wc++-compat -Wmissing-noreturn  -funit-at-a-time\"\n@@ -97,7 +97,7 @@\n # -Wcast-qual \n # -Wmissing-format-attribute  - can't get this one right\n AC_LANG_PUSH(C++)\n-WARNINGS_TO_TEST=\"-Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith \\\n+WARNINGS_TO_TEST=\"-Wall -D_FORTIFY_SOURCE=2 -Wpointer-arith \\\n     -Wshadow -Wwrite-strings -Wcast-align  \\\n     -Wredundant-decls -Wdisabled-optimization \\\n     -Wfloat-equal -Wmultichar -Wmissing-noreturn \\\n"
  },
  {
    "path": "packages/hashdeep/hash.patch",
    "content": "diff --git a/src/hash.cpp b/src/hash.cpp\nindex 4216157..4c83454 100644\n--- a/src/hash.cpp\n+++ b/src/hash.cpp\n@@ -279,7 +279,7 @@ void file_data_hasher_t::hash()\n \t\tMAP_FILE|\n #endif\n \t\tMAP_SHARED,fd,0);\n-\t    if(fdht->base>0){\t\t\n+\t    if(fdht->base>(void *)0){\t\t\n \t\t/* mmap is successful, so set the bounds.\n \t\t * if it is not successful, we default to reading the fd\n \t\t */\n"
  },
  {
    "path": "packages/help2man/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/help2man/\nTERMUX_PKG_DESCRIPTION=\"Conversion tool to create man files.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.47.11\nTERMUX_PKG_SRCURL=http://mirrors.kernel.org/gnu/help2man/help2man-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=5985b257f86304c8791842c0c807a37541d0d6807ee973000cf8a3fe6ad47b88\nTERMUX_PKG_DEPENDS=\"perl\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/hexcurse/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/LonnyGomes/hexcurse\nTERMUX_PKG_DESCRIPTION=\"Console hexeditor\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.60.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/LonnyGomes/hexcurse/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=f6919e4a824ee354f003f0c42e4c4cef98a93aa7e3aa449caedd13f9a2db5530\nTERMUX_PKG_DEPENDS=\"ncurses\"\n"
  },
  {
    "path": "packages/hexcurse/hexcurse.c.patch",
    "content": "From 37f94f2c1d0a3cc5110b2771e02ed894522d65d3 Mon Sep 17 00:00:00 2001\nFrom: Lonny Gomes <code@lonnygomes.com>\nDate: Wed, 18 Nov 2015 23:57:31 -0500\nSubject: [PATCH] Fixes #23, shows help if no filename argument is supplied\n\n---\n src/hexcurse.c | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/src/hexcurse.c b/src/hexcurse.c\nindex 9a275ee..9342eb5 100644\n--- a/src/hexcurse.c\n+++ b/src/hexcurse.c\n@@ -217,9 +217,13 @@ off_t parseArgs(int argc, char *argv[])\n         fpINfilename = strdup(argv[0]);\n     }\n \n-    if (fpINfilename && strcmp(fpINfilename, \"\"))\n+    if (fpINfilename == NULL) {\n+        print_usage();\n+        exit(-1);\n+    } else if (fpINfilename && strcmp(fpINfilename, \"\")) {\n         if ((fpIN = fopen(fpINfilename, \"r\")) == NULL)\n             exit_err(\"Could not open file\");\n+    }\n \n     return ((fpIN != NULL) ? maxLoc(fpIN):0);\t\t/* return file length */\n }\n"
  },
  {
    "path": "packages/hexedit/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://rigaux.org/hexedit.html\nTERMUX_PKG_DESCRIPTION=\"view and edit files in hexadecimal or in ASCII\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.4.2\nTERMUX_PKG_SHA256=c81ffb36af9243aefc0887e33dd8e41c4b22d091f1f27d413cbda443b0440d66\nTERMUX_PKG_SRCURL=https://github.com/pixel/hexedit/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/hexyl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/hexyl\nTERMUX_PKG_DESCRIPTION=\"A command-line hex viewer\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.6.0\nTERMUX_PKG_SRCURL=https://github.com/sharkdp/hexyl/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=5031b20c13b3ccb27abbf119b54609cef16c4152aca2823ee5c53cd5f434b97e\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/heyu/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.heyu.org/\nTERMUX_PKG_DESCRIPTION=\"Program for remotely controlling lights and appliances\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.11-rc3\nTERMUX_PKG_SHA256=6285f134e03688b5ec03986ef53cce463abc007281996156cac52b61cbeb58b2\nTERMUX_PKG_SRCURL=https://github.com/HeyuX10Automation/heyu/archive/v$TERMUX_PKG_VERSION.tar.gz\n\ntermux_step_pre_configure() {\n\t# rindex is an obsolete version of strrchr which is not available in Android:\n\tCFLAGS+=\" -Drindex=strrchr\"\n\texport LIBS=\"-llog\"\n}\n"
  },
  {
    "path": "packages/hfsutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.mars.org/home/rob/proj/hfs/\nTERMUX_PKG_DESCRIPTION=\"Tool for manipulating HFS images.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.2.6\nTERMUX_PKG_SRCURL=ftp://ftp.mars.org/pub/hfs/hfsutils-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=bc9d22d6d252b920ec9cdf18e00b7655a6189b3f34f42e58d5bb152957289840\nTERMUX_PKG_DEPENDS=\"libandroid-support\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=$TERMUX_PREFIX/share/man\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_configure() {\n\tmkdir -p ${TERMUX_PREFIX}/share/man/man1\n}\n\n"
  },
  {
    "path": "packages/hfsutils/lfs.patch",
    "content": "Support >4GiB images. Based on Debian patch\n\n--- hfsutils-3.2.6.orig/libhfs/os/unix.c\n+++ hfsutils-3.2.6/libhfs/os/unix.c\n@@ -19,6 +19,9 @@\n  * $Id: unix.c,v 1.8 1998/11/02 22:09:13 rob Exp $\n  */\n \n+#define _FILE_OFFSET_BITS 64\n+#define _LARGE_FILES\n+\n # ifdef HAVE_CONFIG_H\n #  include \"config.h\"\n # endif\n"
  },
  {
    "path": "packages/hfsutils/replace_hardlink_with_symlink.patch",
    "content": "diff -ur hfsutils-3.2.6-orig/Makefile.in hfsutils-3.2.6/Makefile.in\n--- hfsutils-3.2.6-orig/Makefile.in\t2017-08-03 04:55:38.195906965 +0200\n+++ hfsutils-3.2.6/Makefile.in\t2017-08-03 04:57:31.204993434 +0200\n@@ -114,11 +114,9 @@\n \t$(BININSTALL) $(HFSUTIL) \"$(BINDEST)/.\"\n \n \tfor file in $(CLITARGETS); do  \\\n-\t\t$(HARDLINK) \"$(BINDEST)/$(HFSUTIL)\" \"$(BINDEST)/$$file\";  \\\n+\t\tln -sf \"$(HFSUTIL)\" \"$(BINDEST)/$$file\";  \\\n \tdone\n \n-\trm -f \"$(BINDEST)/$(HFSUTIL)\"\n-\n \tfor file in $(GENERALDOCS) $(CLIDOCS); do  \\\n \t\t$(LIBINSTALL) doc/man/$$file  \\\n \t\t\"$(MANDEST)/man$(MANEXT)/`basename $$file .1`.$(MANEXT)\";  \\\n@@ -232,7 +230,7 @@\n \t\t-lhfs $(LIBS) $(LIBOBJS) -o $@\n \n $(CLITARGETS): $(HFSUTIL)\n-\t-$(HARDLINK) $(HFSUTIL) $@\n+\t-ln -sf $(HFSUTIL) $@\n \n hfssh: $(LIBHFS) hfssh.o tclhfs.o $(UTILOBJS) $(LIBOBJS)\n \t$(CC) $(LDFLAGS) hfssh.o tclhfs.o $(UTILOBJS)  \\\nOnly in hfsutils-3.2.6: Makefile.in~\n"
  },
  {
    "path": "packages/hiptext/artiste.cc.patch",
    "content": "--- hiptext-2.0/src/artiste.cc\t2019-03-01 19:40:54.553801723 +0800\n+++ hiptext-2.0_mod/src/artiste.cc\t2019-03-01 17:33:22.031073100 +0800\n@@ -7,7 +7,7 @@\n #include <stdio.h>\n #include <signal.h>\n #include <sys/ioctl.h>\n-#include <sys/termios.h>\n+#include <termios.h>\n #include <sys/select.h>\n #include <gflags/gflags.h>\n #include <glog/logging.h>\n"
  },
  {
    "path": "packages/hiptext/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/jart/hiptext\nTERMUX_PKG_DESCRIPTION=\"Turn images into text better than caca/aalib\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.2\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=https://github.com/jart/hiptext/releases/download/$TERMUX_PKG_VERSION/hiptext-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=7f2217dec8775b445be6745f7bd439c24ce99c4316a9faf657bee7b42bc72e8f\nTERMUX_PKG_DEPENDS=\"ffmpeg, freetype, gflags, google-glog, libjpeg-turbo, libpng, ncurses\"\nTERMUX_PKG_BUILD_DEPENDS=\"ragel\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t#Font reference on file font.cc --> Patch by font.cc.patch\n\t#Because of ttf-dejavu is x11 package, the hiptext is not a x11 package.\n\tinstall -Dm600 -t \"$TERMUX_PREFIX\"/share/hiptext/ \\\n\t\t\"$TERMUX_PKG_SRCDIR\"/DejaVuSansMono.ttf\n}\n"
  },
  {
    "path": "packages/hiptext/font.cc.patch",
    "content": "--- hiptext-0.2/src/font.cc\t2019-03-03 13:47:56.235315625 +0800\n+++ hiptext-0.2_mod/src/font.cc\t2019-03-03 13:56:39.610971934 +0800\n@@ -11,7 +11,7 @@\n #include \"hiptext/graphic.h\"\n #include \"hiptext/pixel.h\"\n \n-DEFINE_string(font, \"DejaVuSansMono.ttf\",\n+DEFINE_string(font, \"@TERMUX_PREFIX@/share/hiptext/DejaVuSansMono.ttf\",\n               \"The path to the font .ttf file to use.\");\n DEFINE_int32(font_index, 0, \"Index of face to use inside font .ttf file.\");\n DEFINE_int32(font_size, 11, \"The size of the font in points.\");\n"
  },
  {
    "path": "packages/hiptext/movie.cc.patch",
    "content": "--- hiptext-2.0/src/movie.cc\t2019-03-01 19:40:54.553801723 +0800\n+++ hiptext-2.0_mod/src/movie.cc\t2019-03-01 17:41:38.290586786 +0800\n@@ -53,7 +53,7 @@\n \n   // Prepare context for scaling and converting to RGB.\n   sws_ = sws_getContext(context_->width, context_->height, context_->pix_fmt,\n-                        width_, height_, PIX_FMT_RGB24, SWS_FAST_BILINEAR,\n+                        width_, height_, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR,\n                         nullptr, nullptr, nullptr);\n   CHECK(codec_ = avcodec_find_decoder(context_->codec_id))\n       << \"Unsupported codec.\\n\";\n@@ -61,13 +61,13 @@\n       << \"Could not open codec.\\n\";\n \n   // Allocate Raw + RGB frame buffers.\n-  CHECK(frame_ = avcodec_alloc_frame());\n-  CHECK(frame_rgb_ = avcodec_alloc_frame());\n-  int rgb_bytes = avpicture_get_size(PIX_FMT_RGB24, width_, height_);\n+  CHECK(frame_ = av_frame_alloc());\n+  CHECK(frame_rgb_ = av_frame_alloc());\n+  int rgb_bytes = avpicture_get_size(AV_PIX_FMT_RGB24, width_, height_);\n   buffer_ = static_cast<uint8_t*>(av_malloc(rgb_bytes));\n   LOG(INFO) << \"RGB Buffer: \" << rgb_bytes << \" bytes.\";\n   int prep = avpicture_fill(reinterpret_cast<AVPicture*>(frame_rgb_),\n-                            buffer_, PIX_FMT_RGB24, width_, height_);\n+                            buffer_, AV_PIX_FMT_RGB24, width_, height_);\n   CHECK_GE(prep, 0) << \"Failed to prepare RGB buffer.\";\n   LOG(INFO) << \"RGB dimensions: \" << width_  << \"x\" << height_;\n }\n"
  },
  {
    "path": "packages/hoedown/Makefile.patch",
    "content": "diff --git a/Makefile b/Makefile\nindex ebfab0b..1b60b1e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1,5 +1,5 @@\n CFLAGS = -g -O3 -ansi -pedantic -Wall -Wextra -Wno-unused-parameter\n-PREFIX = /usr/local\n+PREFIX = @TERMUX_PREFIX@\n BINDIR = $(PREFIX)/bin\n LIBDIR = $(PREFIX)/lib\n INCLUDEDIR = $(PREFIX)/include\n"
  },
  {
    "path": "packages/hoedown/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/hoedown/hoedown\nTERMUX_PKG_DESCRIPTION=\"Hoedown is a revived fork of Sundown, the Markdown parser based on the original code of the Upskirt library\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.0.7\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/hoedown/hoedown/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=01b6021b1ec329b70687c0d240b12edcaf09c4aa28423ddf344d2bd9056ba920\nTERMUX_PKG_BREAKS=\"hoedown-dev\"\nTERMUX_PKG_REPLACES=\"hoedown-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/htop/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://hisham.hm/htop/\nTERMUX_PKG_DESCRIPTION=\"Interactive process viewer for Linux\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.2.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=d9d6826f10ce3887950d709b53ee1d8c1849a70fa38e91d5896ad8cbc6ba3c57\nTERMUX_PKG_SRCURL=http://hisham.hm/htop/releases/${TERMUX_PKG_VERSION}/htop-${TERMUX_PKG_VERSION}.tar.gz\n# htop checks setlocale() return value for UTF-8 support, so use libandroid-support.\nTERMUX_PKG_DEPENDS=\"ncurses, libandroid-support\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/applications share/pixmaps\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_ncursesw6_addnwstr=yes\nLIBS=-landroid-support\n\"\n"
  },
  {
    "path": "packages/htop/fix-missing-macros.patch",
    "content": "diff -uNr htop-2.1.0/linux/LinuxProcessList.c htop-2.1.0.mod/linux/LinuxProcessList.c\n--- htop-2.1.0/linux/LinuxProcessList.c\t2018-02-04 20:57:13.000000000 +0200\n+++ htop-2.1.0.mod/linux/LinuxProcessList.c\t2018-03-05 17:57:46.901891199 +0200\n@@ -37,6 +37,14 @@\n #include <linux/taskstats.h>\n #endif\n \n+#ifndef major\n+#define major(rdev) ((rdev)>>8)\n+#endif\n+\n+#ifndef minor\n+#define minor(rdev) ((rdev) & 0xff)\n+#endif\n+\n /*{\n \n #include \"ProcessList.h\"\n@@ -241,7 +249,7 @@\n    // Update CPU count:\n    FILE* file = fopen(PROCSTATFILE, \"r\");\n    if (file == NULL) {\n-      CRT_fatalError(\"Cannot open \" PROCSTATFILE);\n+      return pl;\n    }\n    char buffer[PROC_LINE_LENGTH + 1];\n    int cpus = -1;\n@@ -966,7 +974,7 @@\n \n    FILE* file = fopen(PROCSTATFILE, \"r\");\n    if (file == NULL) {\n-      CRT_fatalError(\"Cannot open \" PROCSTATFILE);\n+      return 0;\n    }\n    int cpus = this->super.cpuCount;\n    assert(cpus > 0);\ndiff -uNr htop-2.1.0/Process.c htop-2.1.0.mod/Process.c\n--- htop-2.1.0/Process.c\t2018-02-04 20:57:13.000000000 +0200\n+++ htop-2.1.0.mod/Process.c\t2018-03-05 17:59:16.522983619 +0200\n@@ -29,6 +29,14 @@\n #include <assert.h>\n #include <math.h>\n \n+#ifndef major\n+#define major(rdev) ((rdev)>>8)\n+#endif\n+\n+#ifndef minor\n+#define minor(rdev) ((rdev) & 0xff)\n+#endif\n+\n #ifdef __ANDROID__\n #define SYS_ioprio_get __NR_ioprio_get\n #define SYS_ioprio_set __NR_ioprio_set\n"
  },
  {
    "path": "packages/httping/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.vanheusden.com/httping/\nTERMUX_PKG_DESCRIPTION=\"ping-like program for http-requests\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.5\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://fossies.org/linux/www/httping-${TERMUX_PKG_VERSION}.tgz\nTERMUX_PKG_SHA256=3e895a0a6d7bd79de25a255a1376d4da88eb09c34efdd0476ab5a907e75bfaf8\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"fftw, libandroid-support, ncurses, openssl\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-fftw3 --with-ncurses --with-openssl\"\nTERMUX_PKG_MAINTAINER=\"Pierre Rudloff @Rudloff\"\n"
  },
  {
    "path": "packages/httping/fix-spam_file-path.patch",
    "content": "diff -uNr httping-2.5/gen.h httping-2.5.mod/gen.h\n--- httping-2.5/gen.h\t2016-09-12 10:45:50.000000000 +0300\n+++ httping-2.5.mod/gen.h\t2017-09-14 13:30:46.432863081 +0300\n@@ -12,7 +12,7 @@\n \n #define RECV_BUFFER_SIZE (128 * 1024)\n \n-#define SPAM_FILE \"/tmp/httping.dat\"\n+#define SPAM_FILE \"@TERMUX_PREFIX@/tmp/httping.dat\"\n \n #define MAX_SHOW_SUPPRESSION 3\n \n"
  },
  {
    "path": "packages/httping/mssl.c.patch",
    "content": "diff -u -r ../httping-2.5/mssl.c ./mssl.c\n--- ../httping-2.5/mssl.c\t2016-09-12 07:45:50.000000000 +0000\n+++ ./mssl.c\t2018-08-23 19:38:43.467717597 +0000\n@@ -35,7 +35,9 @@\n \tERR_free_strings();\n \n \tERR_remove_state(0);\n+#ifndef OPENSSL_NO_ENGINE\n \tENGINE_cleanup();\n+#endif\n \tCONF_modules_free();\n \tEVP_cleanup();\n \tCRYPTO_cleanup_all_ex_data();\n"
  },
  {
    "path": "packages/httrack/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.httrack.com\nTERMUX_PKG_DESCRIPTION=\"It allows you to download a World Wide Web site from the Internet\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.49.2\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=http://mirror.httrack.com/historical/httrack-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3477a0e5568e241c63c9899accbfcdb6aadef2812fcce0173688567b4c7d4025\nTERMUX_PKG_DEPENDS=\"libiconv, openssl, zlib\"\nTERMUX_PKG_BREAKS=\"httrack-dev\"\nTERMUX_PKG_REPLACES=\"httrack-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-zlib=$TERMUX_PREFIX LIBS=-liconv\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/httrack/htsglobal.h.patch",
    "content": "--- httrack-3.49.2/src/htsglobal.h\t2017-05-20 14:03:03.000000000 +0530\n+++ htsglobal.h\t2018-04-10 11:16:00.468000020 +0530\n@@ -178,16 +178,16 @@\n #else\n \n #ifndef HTS_ETCPATH\n-#define HTS_ETCPATH \"/etc\"\n+#define HTS_ETCPATH \"@TERMUX_PREFIX@/etc\"\n #endif\n #ifndef HTS_BINPATH\n-#define HTS_BINPATH \"/usr/bin\"\n+#define HTS_BINPATH \"@TERMUX_PREFIX@/bin\"\n #endif\n #ifndef HTS_LIBPATH\n-#define HTS_LIBPATH \"/usr/lib\"\n+#define HTS_LIBPATH \"@TERMUX_PREFIX@/lib\"\n #endif\n #ifndef HTS_PREFIX\n-#define HTS_PREFIX \"/usr\"\n+#define HTS_PREFIX \"@TERMUX_PREFIX@\"\n #endif\n \n #define HTS_HTTRACKRC \".httrackrc\"\n@@ -196,7 +196,7 @@\n #ifdef DATADIR\n #define HTS_HTTRACKDIR DATADIR\"/httrack/\"\n #else\n-#define HTS_HTTRACKDIR HTS_PREFIX\"/share/httrack/\"\n+#define HTS_HTTRACKDIR HTS_PREFIX\"@TERMUX_PREFIX@/share/httrack/\"\n #endif\n \n #endif\n"
  },
  {
    "path": "packages/httrack/store.c.patch",
    "content": "--- httrack-3.49.2/src/proxy/store.c\t2017-04-02 01:08:17.000000000 +0530\n+++ store.c\t2018-04-10 12:10:59.385000003 +0530\n@@ -30,9 +30,9 @@\n #include <stdlib.h>\n #include <string.h>\n #include <time.h>\n-#ifdef __ANDROID__\n+/* #ifdef __ANDROID__\n static long int  timezone = 0;\n-#endif\n+#endif */\n \n /* Locking */\n #ifdef _WIN32\n@@ -1941,7 +1941,7 @@\n \n   if (t != (time_t) - 1 && t != (time_t) 0) {\n     /* BSD does not have static \"timezone\" declared */\n-#if (defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__))\n+#if (defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__)) || defined(__ANDROID__)\n     time_t now = time(NULL);\n     time_t timezone = -localtime(&now)->tm_gmtoff;\n #endif\n"
  },
  {
    "path": "packages/hub/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://hub.github.com/\nTERMUX_PKG_DESCRIPTION=\"Command-line wrapper for git that makes you better at GitHub\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.13.0\nTERMUX_PKG_SRCURL=https://github.com/github/hub/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=0b5147a25aa8dff37d6c88b2a30ed38c05d35e03c64d79039925dcb49de80940\nTERMUX_PKG_DEPENDS=\"git\"\n\ntermux_step_make_install() {\n\ttermux_setup_golang\n\n\tcd $TERMUX_PKG_SRCDIR\n\n\texport GOPATH=\"${TERMUX_PKG_BUILDDIR}\"\n\tmkdir -p \"${GOPATH}/src/github.com/github\"\n\tcp -a \"${TERMUX_PKG_SRCDIR}\" \"${GOPATH}/src/github.com/github/hub\"\n\tcd \"${GOPATH}/src/github.com/github/hub\"\n\tmake bin/hub prefix=$TERMUX_PREFIX\n\tcp ./bin/hub $TERMUX_PREFIX/bin/hub\n}\n"
  },
  {
    "path": "packages/hub/utils-utils.go.patch",
    "content": "diff -uNr hub-2.12.1/utils/utils.go hub-2.12.1.mod/utils/utils.go\n--- hub-2.12.1/utils/utils.go\t2019-06-28 23:19:41.000000000 +0300\n+++ hub-2.12.1.mod/utils/utils.go\t2019-06-29 17:11:57.853729989 +0300\n@@ -30,7 +30,7 @@\n func BrowserLauncher() ([]string, error) {\n \tbrowser := os.Getenv(\"BROWSER\")\n \tif browser == \"\" {\n-\t\tbrowser = searchBrowserLauncher(runtime.GOOS)\n+\t\tbrowser = \"termux-open\"\n \t} else {\n \t\tbrowser = os.ExpandEnv(browser)\n \t}\n"
  },
  {
    "path": "packages/hugo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gohugo.io/\nTERMUX_PKG_DESCRIPTION=\"A fast and flexible static site generator\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.60.1\nTERMUX_PKG_SRCURL=https://github.com/gohugoio/hugo/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=5c857cb27a4e1b43477f6775f2b2e870b937e9ebf32f52347ba7fdbde1ee50f7\nTERMUX_PKG_DEPENDS=\"libc++\"\n\ntermux_step_make() {\n\ttermux_setup_golang\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\n\tcd $TERMUX_PKG_SRCDIR\n\tgo build \\\n\t\t-o \"$TERMUX_PREFIX/bin/hugo\" \\\n\t\t-tags \"linux extended\" \\\n\t\tmain.go\n\t\t# \"linux\" tag should not be necessary\n\t\t# try removing when golang version is upgraded\n\n\t# Building for host to generate manpages and completion.\n\tchmod 700 -R $GOPATH/pkg && rm -rf $GOPATH/pkg\n\tunset GOOS GOARCH CGO_LDFLAGS\n\tunset CC CXX CFLAGS CXXFLAGS LDFLAGS\n\tgo build \\\n\t\t-o \"$TERMUX_PKG_BUILDDIR/hugo\" \\\n\t\t-tags \"linux extended\" \\\n\t\tmain.go\n\t\t# \"linux\" tag should not be necessary\n\t\t# try removing when golang version is upgraded\n}\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/{bash-completion/completions,man/man1}\n\n\t$TERMUX_PKG_BUILDDIR/hugo gen autocomplete \\\n\t\t--completionfile=$TERMUX_PREFIX/share/bash-completion/completions/hugo\n\t$TERMUX_PKG_BUILDDIR/hugo gen man \\\n\t\t--dir=$TERMUX_PREFIX/share/man/man1/\n}\n"
  },
  {
    "path": "packages/hunspell/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://hunspell.github.io\nTERMUX_PKG_DESCRIPTION=\"Spell checker\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.7.0\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://github.com/hunspell/hunspell/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a\nTERMUX_PKG_DEPENDS=\"libc++, libiconv, ncurses, readline, hunspell-en-us\"\nTERMUX_PKG_BREAKS=\"hunspell-dev\"\nTERMUX_PKG_REPLACES=\"hunspell-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-ui --with-readline\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tautoreconf -vfi\n}\n"
  },
  {
    "path": "packages/hunspell/fix-hardcoded-paths.patch",
    "content": "diff -uNr hunspell-1.6.1/src/tools/hunspell.cxx hunspell-1.6.1.mod/src/tools/hunspell.cxx\n--- hunspell-1.6.1/src/tools/hunspell.cxx\t2017-09-14 13:34:22.032862927 +0300\n+++ hunspell-1.6.1.mod/src/tools/hunspell.cxx\t2017-09-14 13:35:48.482862865 +0300\n@@ -660,7 +660,7 @@\n \n   const char* extension = (filename) ? basename(filename, '.') : NULL;\n   TextParser* parser = get_parser(format, extension, pMS[0]);\n-  char tmpdirtemplate[] = \"/tmp/hunspellXXXXXX\";\n+  char tmpdirtemplate[] = \"@TERMUX_PREFIX@/tmp/hunspellXXXXXX\";\n \n   bool bZippedOdf = is_zipped_odf(parser, extension);\n   // access content.xml of ODF\n@@ -1567,7 +1567,7 @@\n \n   const char* extension = basename(filename, '.');\n   TextParser* parser = get_parser(format, extension, pMS[0]);\n-  char tmpdirtemplate[] = \"/tmp/hunspellXXXXXX\";\n+  char tmpdirtemplate[] = \"@TERMUX_PREFIX@/tmp/hunspellXXXXXX\";\n \n   bool bZippedOdf = is_zipped_odf(parser, extension);\n   // access content.xml of ODF\ndiff -uNr hunspell-1.6.1/src/tools/hzip.cxx hunspell-1.6.1.mod/src/tools/hzip.cxx\n--- hunspell-1.6.1/src/tools/hzip.cxx\t2017-03-25 23:20:45.000000000 +0200\n+++ hunspell-1.6.1.mod/src/tools/hzip.cxx\t2017-09-14 13:36:09.462862850 +0300\n@@ -343,7 +343,7 @@\n   if (!f)\n     return fail(\"hzip: %s: Permission denied\\n\", filename);\n \n-  char tmpfiletemplate[] = \"/tmp/hunspellXXXXXX\";\n+  char tmpfiletemplate[] = \"@TERMUX_PREFIX@/tmp/hunspellXXXXXX\";\n   mode_t mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);\n   int tempfileno = mkstemp(tmpfiletemplate);\n   umask(mask);\n"
  },
  {
    "path": "packages/hunspell/src-tools-hunspell.cxx.patch",
    "content": "diff -u -r ../hunspell-1.4.1/src/tools/hunspell.cxx ./src/tools/hunspell.cxx\n--- ../hunspell-1.4.1/src/tools/hunspell.cxx\t2016-05-03 03:55:52.000000000 -0400\n+++ ./src/tools/hunspell.cxx\t2016-05-03 06:49:59.025455094 -0400\n@@ -113,7 +113,7 @@\n #include \"odfparser.hxx\"\n \n #define LIBDIR                \\\n-  \"/usr/share/hunspell:\"      \\\n+  \"@TERMUX_PREFIX@/share/hunspell:\"      \\\n   \"/usr/share/myspell:\"       \\\n   \"/usr/share/myspell/dicts:\" \\\n   \"/Library/Spelling\"\n@@ -137,7 +137,7 @@\n   \"/usr/lib/openoffice.org2.0/share/dict/ooo\"\n #define HOME getenv(\"HOME\")\n #define DICBASENAME \".hunspell_\"\n-#define LOGFILE \"/tmp/hunspell.log\"\n+#define LOGFILE \"@TERMUX_PREFIX@/tmp/hunspell.log\"\n #define DIRSEPCH '/'\n #define DIRSEP \"/\"\n #define PATHSEP \":\"\n"
  },
  {
    "path": "packages/hunspell-en-us/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://hunspell.github.io\nTERMUX_PKG_DESCRIPTION=\"American english dictionary for hunspell\"\nTERMUX_PKG_LICENSE=\"LGPL-3.0\"\nTERMUX_PKG_VERSION=20181025\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/hunspell/\n\t# On checksum mismatch the files may have been updated:\n\t#  https://cgit.freedesktop.org/libreoffice/dictionaries/log/en/en_US.aff\n\t#  https://cgit.freedesktop.org/libreoffice/dictionaries/log/en/en_US.dic\n\t# In which case we need to bump version and checksum used.\n\ttermux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff \\\n\t\t\t$TERMUX_PREFIX/share/hunspell/en_US.aff \\\n\t\t\tc7a8c4d08c29d237880844b1623099f59092602f189be38ce3912e457ff38bc1\n\ttermux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.dic \\\n\t\t\t$TERMUX_PREFIX/share/hunspell/en_US.dic \\\n\t\t        e2aec1aff3e2b840c59e2a4f49f7eb9388b6078c681d960153fc72ce183086cc\n\ttouch $TERMUX_PREFIX/share/hunspell/en_US.{aff,dic}\n}\n"
  },
  {
    "path": "packages/hunspell-ru/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://hunspell.github.io\nTERMUX_PKG_DESCRIPTION=\"Russian dictionary for hunspell\"\nTERMUX_PKG_LICENSE=\"LGPL-3.0\"\nTERMUX_PKG_VERSION=20170303\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/hunspell/\n\t# On checksum mismatch the files may have been updated:\n\t#  https://cgit.freedesktop.org/libreoffice/dictionaries/log/ru_RU/ru_RU.aff\n\t#  https://cgit.freedesktop.org/libreoffice/dictionaries/log/ru_RU/ru_RU.dic\n\t# In which case we need to bump version and checksum used.\n\ttermux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/ru_RU/ru_RU.aff \\\n\t\t\t$TERMUX_PREFIX/share/hunspell/ru_RU.aff \\\n\t\t\t709cf9b41208961226e995a3ab75a2da834aaf4f9707cb87cbb37d4943b6a50d\n\ttermux_download https://cgit.freedesktop.org/libreoffice/dictionaries/plain/ru_RU/ru_RU.dic \\\n\t\t\t$TERMUX_PREFIX/share/hunspell/ru_RU.dic \\\n\t\t\tc0d81126b0a905ccc6fd891c923b43d39b4ce449da5a333859229354c510168f\n\ttouch $TERMUX_PREFIX/share/hunspell/ru_RU.{aff,dic}\n}\n"
  },
  {
    "path": "packages/hydra/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/vanhauser-thc/thc-hydra\nTERMUX_PKG_DESCRIPTION=\"Network logon cracker supporting different services\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=9.0\nTERMUX_PKG_SHA256=56672e253c128abaa6fb19e77f6f59ba6a93762a9ba435505a009ef6d58e8d0e\nTERMUX_PKG_SRCURL=https://github.com/vanhauser-thc/thc-hydra/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"openssl, pcre, libssh\"\n\ntermux_step_configure() {\n\t# Skip the ./configure file (which does not support cross compilation)\n\t# and configure the build manually.\n\tCFLAGS+=\" -Dindex=strchr -DLIBOPENSSL -DNO_RINDEX -DHAVE_MATH_H -DHAVE_PCRE -DLIBSSH\"\n\texport MANDIR=/share/man/man1\n\texport XLIBS=\"-lcrypto -lssl -lpcre -lssh\"\n\tcat Makefile.am | sed 's/^install:.*/install: all/'  >> Makefile\n}\n"
  },
  {
    "path": "packages/hydra/hydra.c.patch",
    "content": "It's probably safe to assume color support in terminals without\nlinking against and checking with ncurses.\n\ndiff -u -r ../thc-hydra-8.4/hydra.c ./hydra.c\n--- ../thc-hydra-8.4/hydra.c\t2017-01-27 17:19:18.000000000 +0100\n+++ ./hydra.c\t2017-01-31 13:37:34.496298083 +0100\n@@ -2622,10 +2622,6 @@\n       colored_output = 0;\n     }\n   }\n-#else\n-  //don't want border line effect so disabling color output\n-  //if we are not sure about the term\n-  colored_output = 0;\n #endif\n \n   if (debug)\n"
  },
  {
    "path": "packages/hyperfine/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/sharkdp/hyperfine\nTERMUX_PKG_DESCRIPTION=\"A command-line benchmarking tool\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.9.0\nTERMUX_PKG_SRCURL=https://github.com/sharkdp/hyperfine/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=c2b1c6b6364b849acad43dc740c693f5b75a1a4649f24f43967a98c59ad9e9f7\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/icecast/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://icecast.org\nTERMUX_PKG_DESCRIPTION=\"Icecast is a streaming media (audio/video) server\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.4.4\nTERMUX_PKG_SRCURL=https://downloads.xiph.org/releases/icecast/icecast-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=49b5979f9f614140b6a38046154203ee28218d8fc549888596a683ad604e4d44\nTERMUX_PKG_DEPENDS=\"libcurl, libgnutls, libogg, libvorbis, libxml2, libxslt, mime-support, openssl\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n    perl -p -i -e \"s#/etc/mime.types#$TERMUX_PREFIX/etc/mime.types#\" $TERMUX_PKG_SRCDIR/src/cfgfile.c\n}\n"
  },
  {
    "path": "packages/icecast/thread.c.patch",
    "content": "--- ../../build/icecast/cache/icecast-2.4.3/src/thread/thread.c\t2015-12-27 17:46:32.000000000 +0100\n+++ ./src/thread/thread.c\t2017-01-01 22:52:28.256272825 +0100\n@@ -294,10 +294,10 @@\n         start->thread = thread;\n \n         pthread_attr_setstacksize (&attr, 512*1024);\n-        pthread_attr_setinheritsched (&attr, PTHREAD_INHERIT_SCHED);\n+        //pthread_attr_setinheritsched (&attr, PTHREAD_INHERIT_SCHED);\n         if (detached)\n         {\n-            pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);\n+            //pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);\n             thread->detached = 1;\n         }\n \n@@ -651,7 +651,7 @@\n     LOG_INFO4(\"Added thread %d [%s] started at [%s:%d]\", thread->thread_id, thread->name, thread->file, thread->line);\n #endif\n \n-    pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);\n+    //pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);\n     free (start);\n \n     (start_routine)(real_arg);\n"
  },
  {
    "path": "packages/imagemagick/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.imagemagick.org/\nTERMUX_PKG_DESCRIPTION=\"Suite to create, edit, compose, or convert images in a variety of formats\"\nTERMUX_PKG_LICENSE=\"ImageMagick\"\nTERMUX_PKG_VERSION=7.0.9.5\nTERMUX_PKG_SRCURL=https://github.com/ImageMagick/ImageMagick/archive/$(echo $TERMUX_PKG_VERSION | sed 's/\\(.*\\)\\./\\1-/').tar.gz\nTERMUX_PKG_SHA256=d15abd31e7e18f7edec47df156773a23e5100386e55c6ce50f5353e9572d3413\nTERMUX_PKG_DEPENDS=\"fftw, pango, glib, libbz2, libjpeg-turbo, liblzma, libpng, libtiff, libxml2, openjpeg, littlecms, libwebp, librsvg\"\nTERMUX_PKG_BREAKS=\"imagemagick-dev\"\nTERMUX_PKG_REPLACES=\"imagemagick-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-largefile\n--without-x\n--without-gvc\n--with-magick-plus-plus=no\n--with-bzlib=yes\n--with-xml=yes\n--with-rsvg=yes\n--with-lzma\n--disable-openmp\nac_cv_func_ftime=no\n\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/Magick-config\nbin/MagickCore-config\nbin/MagickWand-config\nbin/Wand-config\nshare/ImageMagick-7/francais.xml\nshare/man/man1/Magick-config.1\nshare/man/man1/MagickCore-config.1\nshare/man/man1/MagickWand-config.1\nshare/man/man1/Wand-config.1\n\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\t# Avoid \"libMagickCore-7.Q16HDRI.so: error: undefined reference to '__atomic_load'\":\n\t\tLDFLAGS+=\" -latomic\"\n\tfi\n}\n"
  },
  {
    "path": "packages/imgflo/Makefile.patch",
    "content": "diff -u -r ../imgflo-0.4.2/Makefile ./Makefile\n--- ../imgflo-0.4.2/Makefile\t2016-08-21 08:46:27.000000000 +0000\n+++ ./Makefile\t2018-05-17 17:48:06.151296541 +0000\n@@ -1,7 +1,5 @@\n \n VERSION=$(shell echo `git describe --tags`)\n-#PREFIX=/opt/imgflo\n-PREFIX=$(shell echo `pwd`/install)\n FLAGS=-Wall -Werror -std=c99 -g\n DEBUGPROG=\n PORT=3569\n@@ -21,10 +19,10 @@\n PKGCONFIG_ARGS:=\n endif\n \n-LIBS=gegl-0.3 libsoup-2.4\n+LIBS=gegl-0.4 libsoup-2.4\n SYSTEM_LIBS=gio-unix-2.0 json-glib-1.0 libpng\n-DEPS=$(shell $(PREFIX)/env.sh pkg-config $(PKGCONFIG_ARGS) --libs --cflags $(LIBS))\n-DEPS+=$(shell $(PREFIX)/env.sh pkg-config --libs --cflags $(SYSTEM_LIBS))\n+DEPS=$(shell  pkg-config $(PKGCONFIG_ARGS) --libs --cflags $(LIBS))\n+DEPS+=$(shell  pkg-config --libs --cflags $(SYSTEM_LIBS))\n TRAVIS_DEPENDENCIES=$(shell echo `cat .vendor_urls | sed -e \"s/heroku/travis-${TRAVIS_OS_NAME}/\" | tr -d '\\n'`)\n \n RUN_ARGUMENTS:=--port $(PORT) --external-port=$(EXTPORT)\n@@ -53,31 +51,31 @@\n all: install\n \n run-noinstall:\n-\t$(PREFIX)/env.sh $(DEBUGPROG) ./bin/imgflo-runtime $(RUN_ARGUMENTS)\n+\t $(DEBUGPROG) ./bin/imgflo-runtime $(RUN_ARGUMENTS)\n \n run: install run-noinstall\n \n process: install\n-\t$(PREFIX)/env.sh $(DEBUGPROG) ./bin/imgflo $(PROCESS_ARGUMENTS)\n+\t $(DEBUGPROG) ./bin/imgflo $(PROCESS_ARGUMENTS)\n \n-install: env imgflo imgflo-runtime imgflo-graphinfo\n+install:  imgflo imgflo-runtime imgflo-graphinfo\n \tcp ./bin/imgflo $(PREFIX)/bin/\n \tcp ./bin/imgflo-runtime $(PREFIX)/bin/\n \tcp ./bin/imgflo-graphinfo $(PREFIX)/bin/\n \n imgflo:\n-\t$(PREFIX)/env.sh $(CC) -o ./bin/imgflo bin/imgflo.c -I. $(FLAGS) $(DEPS)\n+\t $(CC) -o ./bin/imgflo bin/imgflo.c -I. $(FLAGS) $(CFLAGS) $(LDFLAGS) $(DEPS)\n \n imgflo-graphinfo:\n-\t$(PREFIX)/env.sh $(CC) -o ./bin/imgflo-graphinfo bin/imgflo-graphinfo.c -I. $(FLAGS) $(DEPS)\n+\t $(CC) -o ./bin/imgflo-graphinfo bin/imgflo-graphinfo.c -I. $(FLAGS) $(CFLAGS) $(LDFLAGS) $(DEPS)\n \n imgflo-runtime:\n-\t$(PREFIX)/env.sh $(CC) -o ./bin/imgflo-runtime bin/imgflo-runtime.c -I. $(FLAGS) $(DEPS)\n+\t $(CC) -o ./bin/imgflo-runtime bin/imgflo-runtime.c -I. $(FLAGS) $(CFLAGS) $(LDFLAGS) $(DEPS)\n \n env:\n-\tmkdir -p $(PREFIX) || true\n-\tsed -e 's|@PREFIX@|$(PREFIX)|' env.sh.in > $(PREFIX)/env.sh\n-\tchmod +x $(PREFIX)/env.sh\n+#\tmkdir -p $(PREFIX) || true\n+#\tsed -e 's|@PREFIX@|$(PREFIX)|' env.sh.in > $(PREFIX)/env.sh\n+#\tchmod +x $(PREFIX)/env.sh\n \n travis-deps:\n \twget -O imgflo-dependencies.tgz $(TRAVIS_DEPENDENCIES)\n@@ -93,14 +91,14 @@\n COMPONENT_FLAGS += -DIMGFLO_OP_NAME\\(orig\\)=\\\"$(COMPONENT_NAME_PREFIX)\\\"orig\\\"$(COMPONENT_NAME_SUFFIX)\\\"\n endif\n \n-component-install-dir: env\n+component-install-dir: \n \trm -rf $(COMPONENTINSTALLDIR)\n \tmkdir -p $(COMPONENTINSTALLDIR) || true\n components: component-install-dir $(COMPONENT_PLUGINS)\n component: component-install-dir $(COMPONENT_OUT)\n \n $(COMPONENTINSTALLDIR)/%.$(SHAREDLIB_SUFFIX): $(COMPONENTDIR)/%.c\n-\t$(PREFIX)/env.sh $(CC) -o $@ $< -DGEGL_OP_C_FILE=\\\"`basename $<`\\\" $(COMPONENT_FLAGS) $(DEPS)\n+\t $(CC) -o $@ $< -DGEGL_OP_C_FILE=\\\"`basename $<`\\\" $(COMPONENT_FLAGS) $(DEPS)\n \n dependencies:\n \tcd dependencies && make PREFIX=$(PREFIX) dependencies\n@@ -115,7 +113,7 @@\n \tcd dependencies && make PREFIX=$(PREFIX) glib\n \n check: install\n-\t$(PREFIX)/env.sh ./node_modules/.bin/mocha --reporter spec --compilers .coffee:coffee-script/register ./spec/*.coffee $(TEST_ARGUMENTS)\n+\t ./node_modules/.bin/mocha --reporter spec --compilers .coffee:coffee-script/register ./spec/*.coffee $(TEST_ARGUMENTS)\n \n clean:\n \tgit clean -dfx --exclude node_modules --exclude install\n"
  },
  {
    "path": "packages/imgflo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.imgflo.org/\nTERMUX_PKG_DESCRIPTION=\"HTTP image processing server & Flowhub.io compatible runtime\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.4.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/imgflo/imgflo/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=4dd5fc9d34f3cfc294fd69a14d50ed5401abeb829132f1b1ac316e28223fc393\nTERMUX_PKG_DEPENDS=\"gegl, libsoup, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/imgflo/env.sh.in.patch",
    "content": "--- ../cache/imgflo-0.4.2/env.sh.in\t2016-08-21 08:46:27.000000000 +0000\n+++ ./env.sh.in\t2017-05-11 02:54:53.849611941 +0000\n@@ -1,17 +1,3 @@\n #!/bin/bash\n-\n-PREFIX=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n-\n-export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH\n-export LD_LIBRARY_PATH=${PREFIX}/lib:$LD_LIBRARY_PATH\n-export DYLD_LIBRARY_PATH=${PREFIX}/lib:$DYLD_LIBRARY_PATH\n-export ACLOCAL_PATH=${PREFIX}/share/aclocal:$ACLOCAL_PATH\n-export PATH=${PREFIX}/bin:$PATH\n-export GEGL_PATH=${PREFIX}/lib/imgflo/operations:${PREFIX}/lib/gegl-0.3:${GEGL_PATH}\n-export BABL_PATH=${PREFIX}/lib/babl-0.1\n-\n # If not sourcing the script, execute the command that follows\n-if [[ \"${BASH_SOURCE[0]}\" = \"${0}\" ]];\n-then\n     exec \"$@\"\n-fi\n"
  },
  {
    "path": "packages/imgflo/library.c.patch",
    "content": "--- ../cache/imgflo-0.4.2/lib/library.c\t2016-08-21 08:46:27.000000000 +0000\n+++ ./lib/library.c\t2017-05-11 02:57:06.259072817 +0000\n@@ -342,12 +342,12 @@\n     GFile* dir = g_file_get_parent(file);\n     gchar* dir_name = g_file_get_path(dir);\n \n-    gchar *stdout = NULL;\n-    gchar *stderr = NULL;\n+    //gchar *stdout = NULL;\n+    //gchar *stderr = NULL;\n     gint exitcode = 1;\n     GError *err = NULL;\n     gchar **argv = g_new0(gchar *, 10);\n-    argv[0] = g_strdup(\"/usr/bin/env\");\n+    argv[0] = g_strdup(\"@TERMUX_PREFIX@/bin/env\");\n     argv[1] = g_strdup(\"make\");\n     argv[2] = g_strdup(\"component\");\n     argv[3] = g_strdup_printf(\"COMPONENT=%s\", component);\n@@ -358,7 +358,7 @@\n  \n     const gboolean success = g_spawn_sync(NULL, argv, NULL,\n                               G_SPAWN_DEFAULT, NULL, NULL,\n-                              &stdout, &stderr, &exitcode, &err);\n+                              NULL, NULL, &exitcode, &err);\n     try_print_error(err);\n     if (!success || stderr) {\n         imgflo_message(\"%s\", stderr);\n"
  },
  {
    "path": "packages/imlib2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/enlightenment/\nTERMUX_PKG_DESCRIPTION=\"Library that does image file loading and saving as well as rendering, manipulation, arbitrary polygon support\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.5.1\nTERMUX_PKG_REVISION=10\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/enlightenment/imlib2-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b25df9347648cf3dfb784c099139ab24157b1dbd1baa9428f103b683b8a78c61\nTERMUX_PKG_DEPENDS=\"freetype, giflib, libandroid-shmem, libbz2, libid3tag, libjpeg-turbo, libpng, libtiff, libxext, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"LIBS=-landroid-shmem\"\n"
  },
  {
    "path": "packages/imlib2/imlib2-1.5.1_src_bin_imlib2_show.c.patch",
    "content": "diff -uNr imlib2-1.5.1/src/bin/imlib2_show.c imlib2-1.5.1.mod/src/bin/imlib2_show.c\n--- imlib2-1.5.1/src/bin/imlib2_show.c\t2018-03-16 17:29:59.000000000 +0200\n+++ imlib2-1.5.1.mod/src/bin/imlib2_show.c\t2018-11-14 19:08:41.689118629 +0200\n@@ -23,6 +23,11 @@\n  */\n #include \"Imlib2.h\"\n \n+static int android_mblen(const char *s, size_t n)\n+{\n+    return mbtowc(0, s, n);\n+}\n+\n Display            *disp;\n Window              win;\n Visual             *vis;\n@@ -1276,7 +1281,7 @@\n                        char                tmp[16];\n                        int                 len;\n \n-                       len = mblen(str + cp, MB_CUR_MAX);\n+                       len = android_mblen(str + cp, MB_CUR_MAX);\n                        if (len < 0)\n                           len = 1;\n                        strncpy(tmp, str + cp, len);\n"
  },
  {
    "path": "packages/imlib2/imlib2-1.5.1_src_lib_ximage.c.patch",
    "content": "diff -uNr imlib2-1.5.1/src/lib/ximage.c imlib2-1.5.1.mod/src/lib/ximage.c\n--- imlib2-1.5.1/src/lib/ximage.c\t2018-03-10 21:31:39.000000000 +0200\n+++ imlib2-1.5.1.mod/src/lib/ximage.c\t2019-09-10 22:24:51.561058349 +0300\n@@ -9,7 +9,8 @@\n #include <sys/mman.h>\n #endif\n #include <sys/ipc.h>\n-#include <sys/shm.h>\n+#include <linux/shm.h>\n+#include <dlfcn.h>\n \n #include \"ximage.h\"\n \n@@ -36,6 +37,79 @@\n /* temporary X error catcher we use later */\n static char         _x_err = 0;\n \n+#ifndef shmid_ds\n+# define shmid_ds shmid64_ds\n+#endif\n+\n+static void * (*android_shmat)(int shmid, const void *shmaddr, int shmflg) = NULL;\n+static int (*android_shmdt)(const void *shmaddr) = NULL;\n+static int (*android_shmget)(key_t key, size_t size, int shmflg) = NULL;\n+static int (*android_shmctl)(int shmid, int cmd, struct shmid_ds *buf) = NULL;\n+\n+static void * shmat(int shmid, const void *shmaddr, int shmflg) {\n+\tif (!android_shmat) {\n+\t\tvoid *handle = dlopen(\"@TERMUX_PREFIX@/lib/libandroid-shmem.so\", RTLD_LOCAL | RTLD_LAZY);\n+\n+\t\tif (!handle) {\n+\t\t\t\tabort();\n+\t\t}\n+\n+\t\tandroid_shmat = dlsym(handle, \"shmat\");\n+\n+\t\tdlclose(handle);\n+\t}\n+\n+\treturn android_shmat(shmid, shmaddr, shmflg);\n+}\n+\n+static int shmdt(const void *shmaddr) {\n+\tif (!android_shmdt) {\n+\t\tvoid *handle = dlopen(\"@TERMUX_PREFIX@/lib/libandroid-shmem.so\", RTLD_LOCAL | RTLD_LAZY);\n+\n+\t\tif (!handle) {\n+\t\t\t\tabort();\n+\t\t}\n+\n+\t\tandroid_shmdt = dlsym(handle, \"shmdt\");\n+\n+\t\tdlclose(handle);\n+\t}\n+\n+\treturn android_shmdt(shmaddr);\n+}\n+\n+static int shmget(key_t key, size_t size, int shmflg) {\n+\tif (!android_shmget) {\n+\t\tvoid *handle = dlopen(\"@TERMUX_PREFIX@/lib/libandroid-shmem.so\", RTLD_LOCAL | RTLD_LAZY);\n+\n+\t\tif (!handle) {\n+\t\t\t\tabort();\n+\t\t}\n+\n+\t\tandroid_shmget = dlsym(handle, \"shmget\");\n+\n+\t\tdlclose(handle);\n+\t}\n+\n+\treturn android_shmget(key, size, shmflg);\n+}\n+\n+static int shmctl(int shmid, int cmd, struct shmid_ds *buf) {\n+\tif (!android_shmctl) {\n+\t\tvoid *handle = dlopen(\"@TERMUX_PREFIX@/lib/libandroid-shmem.so\", RTLD_LOCAL | RTLD_LAZY);\n+\n+\t\tif (!handle) {\n+\t\t\t\tabort();\n+\t\t}\n+\n+\t\tandroid_shmctl = dlsym(handle, \"shmctl\");\n+\n+\t\tdlclose(handle);\n+\t}\n+\n+\treturn android_shmctl(shmid, cmd, buf);\n+}\n+\n /* the function we use for catching the error */\n static int\n TmpXError(Display * d, XErrorEvent * ev)\n"
  },
  {
    "path": "packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_bz2.c.patch",
    "content": "diff -uNr imlib2-1.5.1/src/modules/loaders/loader_bz2.c imlib2-1.5.1.mod/src/modules/loaders/loader_bz2.c\n--- imlib2-1.5.1/src/modules/loaders/loader_bz2.c\t2017-12-16 15:03:10.000000000 +0200\n+++ imlib2-1.5.1.mod/src/modules/loaders/loader_bz2.c\t2018-11-14 19:06:26.991364123 +0200\n@@ -52,7 +52,7 @@\n    ImlibLoader        *loader;\n    FILE               *fp;\n    int                 dest, res;\n-   char               *file, *p, *q, tmp[] = \"/tmp/imlib2_loader_bz2-XXXXXX\";\n+   char               *file, *p, *q, tmp[] = \"@TERMUX_PREFIX@/tmp/imlib2_loader_bz2-XXXXXX\";\n    char               *real_ext;\n \n    assert(im);\n"
  },
  {
    "path": "packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_id3.c.patch",
    "content": "diff -uNr imlib2-1.5.1/src/modules/loaders/loader_id3.c imlib2-1.5.1.mod/src/modules/loaders/loader_id3.c\n--- imlib2-1.5.1/src/modules/loaders/loader_id3.c\t2018-03-10 21:31:39.000000000 +0200\n+++ imlib2-1.5.1.mod/src/modules/loaders/loader_id3.c\t2018-11-14 19:06:26.994697483 +0200\n@@ -507,7 +507,7 @@\n \n    if (loader)\n      {\n-        char               *ofile, tmp[] = \"/tmp/imlib2_loader_id3-XXXXXX\";\n+        char               *ofile, tmp[] = \"@TERMUX_PREFIX@/tmp/imlib2_loader_id3-XXXXXX\";\n         int                 dest;\n \n         if ((dest = mkstemp(tmp)) < 0)\n"
  },
  {
    "path": "packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_xpm.c.patch",
    "content": "diff -uNr imlib2-1.5.1/src/modules/loaders/loader_xpm.c imlib2-1.5.1.mod/src/modules/loaders/loader_xpm.c\n--- imlib2-1.5.1/src/modules/loaders/loader_xpm.c\t2018-03-11 09:54:36.000000000 +0200\n+++ imlib2-1.5.1.mod/src/modules/loaders/loader_xpm.c\t2018-11-14 19:06:27.004697564 +0200\n@@ -51,11 +51,11 @@\n      }\n    /* look in rgb txt database */\n    if (!rgb_txt)\n-      rgb_txt = fopen(\"/usr/share/X11/rgb.txt\", \"r\");\n+      rgb_txt = fopen(\"@TERMUX_PREFIX@/share/X11/rgb.txt\", \"r\");\n    if (!rgb_txt)\n-      rgb_txt = fopen(\"/usr/X11R6/lib/X11/rgb.txt\", \"r\");\n+      rgb_txt = fopen(\"@TERMUX_PREFIX@/X11R6/lib/X11/rgb.txt\", \"r\");\n    if (!rgb_txt)\n-      rgb_txt = fopen(\"/usr/openwin/lib/X11/rgb.txt\", \"r\");\n+      rgb_txt = fopen(\"@TERMUX_PREFIX@/openwin/lib/X11/rgb.txt\", \"r\");\n    if (!rgb_txt)\n       return;\n    fseek(rgb_txt, 0, SEEK_SET);\n"
  },
  {
    "path": "packages/imlib2/imlib2-1.5.1_src_modules_loaders_loader_zlib.c.patch",
    "content": "diff -uNr imlib2-1.5.1/src/modules/loaders/loader_zlib.c imlib2-1.5.1.mod/src/modules/loaders/loader_zlib.c\n--- imlib2-1.5.1/src/modules/loaders/loader_zlib.c\t2017-12-16 15:03:10.000000000 +0200\n+++ imlib2-1.5.1.mod/src/modules/loaders/loader_zlib.c\t2018-11-14 19:06:27.008030924 +0200\n@@ -44,7 +44,7 @@\n {\n    ImlibLoader        *loader;\n    int                 src, dest, res;\n-   char               *file, *p, *q, tmp[] = \"/tmp/imlib2_loader_zlib-XXXXXX\";\n+   char               *file, *p, *q, tmp[] = \"@TERMUX_PREFIX@/tmp/imlib2_loader_zlib-XXXXXX\";\n    char               *real_ext;\n    struct stat         st;\n \n"
  },
  {
    "path": "packages/indent/Makefile.in.patch",
    "content": "diff -u -r ../indent-2.2.12/Makefile.in ./Makefile.in\n--- ../indent-2.2.12/Makefile.in\t2018-09-05 21:00:27.000000000 +0000\n+++ ./Makefile.in\t2018-09-08 00:11:20.094710325 +0000\n@@ -378,7 +378,7 @@\n top_builddir = @top_builddir@\n top_srcdir = @top_srcdir@\n AUTOMAKE_OPTIONS = no-texinfo.tex\n-SUBDIRS = intl src doc po man regression\n+SUBDIRS = intl src po man\n BUILT_SOURCES = \n DISTFILES = $(DIST_COMMON:README=README.md) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\n EXTRA_DIST = README.md \\\n"
  },
  {
    "path": "packages/indent/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/indent/\nTERMUX_PKG_DESCRIPTION=\"C language source code formatting program\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.2.12\nTERMUX_PKG_SHA256=b745a5dfc68f86a483d7f96dc1cda7aafd1e78ecba3c7d8ad304709e91e1defb\nTERMUX_PKG_SRCURL=http://mirrors.kernel.org/gnu/indent/indent-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_DEPENDS=\"libandroid-support\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_func_setlocale=no\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/texinfo2man\"\n"
  },
  {
    "path": "packages/indent/code_io.c.patch",
    "content": "--- ../code_io.c.orig\t2019-05-30 20:55:54.216630725 +0200\n+++ ./src/code_io.c\t2019-05-30 20:55:57.723297366 +0200\n@@ -210,7 +210,7 @@\n #endif\n \n     unsigned int namelen = strlen(filename);\n-    int          fd      = open(filename, O_RDONLY, 0777);\n+    int          fd      = open(filename, O_RDONLY);\n \n     if (fd < 0)\n     {\n"
  },
  {
    "path": "packages/inetutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/inetutils/\nTERMUX_PKG_DESCRIPTION=\"Collection of common network programs\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.9.4\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/inetutils/inetutils-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=849d96f136effdef69548a940e3e0ec0624fc0c81265296987986a0dd36ded37\nTERMUX_PKG_DEPENDS=\"readline\"\n# These are old cruft / not suited for android\n# (we --disable-traceroute as it requires root\n# in favour of tracepath, which sets up traceroute\n# as a symlink to tracepath):\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-hostname\n--disable-ifconfig\n--disable-ping\n--disable-ping6\n--disable-rcp\n--disable-rexec\n--disable-rexecd\n--disable-rlogin\n--disable-rsh\n--disable-traceroute\n--disable-uucpd\nac_cv_lib_crypt_crypt=no\n\"\n\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"LIBS=-llog\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -DLOGIN_PROCESS=6 -DDEAD_PROCESS=8 -DLOG_NFACILITIES=24\"\n}\n"
  },
  {
    "path": "packages/inetutils/configure-pthreads-no-weak.patch",
    "content": "diff -uNr inetutils-1.9.4/configure inetutils-1.9.4.mod/configure\n--- inetutils-1.9.4/configure\t2015-06-09 10:53:47.000000000 +0300\n+++ inetutils-1.9.4.mod/configure\t2019-08-16 17:07:41.868736971 +0300\n@@ -15894,7 +15894,7 @@\n           if test -n \"$LIBMULTITHREAD\" || test -n \"$LTLIBMULTITHREAD\"; then\n             if case \"$gl_cv_have_weak\" in *yes) true;; *) false;; esac; then\n \n-$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n+#$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n \n               LIBTHREAD=\n               LTLIBTHREAD=\n"
  },
  {
    "path": "packages/inetutils/ftp-getpass.patch",
    "content": "Submitted upstream at:\nhttp://lists.gnu.org/archive/html/bug-inetutils/2016-10/msg00000.html\n\ndiff -u -r ../inetutils-1.9.4/ftp/cmds.c ./ftp/cmds.c\n--- ../inetutils-1.9.4/ftp/cmds.c\t2015-06-09 03:41:47.000000000 -0400\n+++ ./ftp/cmds.c\t2016-10-22 08:13:16.282265064 -0400\n@@ -1721,6 +1721,9 @@\n void\n user (int argc, char **argv)\n {\n+# if !HAVE_DECL_GETPASS\n+  extern char *getpass ();\n+# endif\n   char acct[80];\n   int n, aflag = 0;\n \n@@ -2070,6 +2073,9 @@\n void\n account (int argc, char **argv)\n {\n+# if !HAVE_DECL_GETPASS\n+  extern char *getpass ();\n+# endif\n   char acct[50], *ap;\n \n   if (argc > 1)\ndiff -u -r ../inetutils-1.9.4/ftp/ftp.c ./ftp/ftp.c\n--- ../inetutils-1.9.4/ftp/ftp.c\t2015-03-31 11:40:47.000000000 -0400\n+++ ./ftp/ftp.c\t2016-10-22 08:13:37.005945253 -0400\n@@ -292,6 +292,9 @@\n int\n login (char *host)\n {\n+# if !HAVE_DECL_GETPASS\n+  extern char *getpass ();\n+# endif\n   char tmp[80];\n   char *user, *pass, *acct;\n   int n, aflag = 0;\n"
  },
  {
    "path": "packages/inetutils/ftpd.c.patch",
    "content": "diff -u -r ../inetutils-1.9.3/ftpd/auth.c ./ftpd/auth.c\n--- ../inetutils-1.9.3/ftpd/auth.c\t2015-03-31 11:40:47.000000000 -0400\n+++ ./ftpd/auth.c\t2015-05-12 16:33:16.860147663 -0400\n@@ -184,6 +184,9 @@\n     case AUTH_TYPE_PASSWD:\n     default:\n       {\n+#ifdef __ANDROID__\n+\treturn -1;\n+#else\n \tchar *xpasswd;\n \tchar *salt = pcred->passwd;\n \t/* Try to authenticate the user.  */\n@@ -191,6 +194,7 @@\n \t  return 1;\t\t/* Failed. */\n \txpasswd = crypt (passwd, salt);\n \treturn (!xpasswd || strcmp (xpasswd, pcred->passwd) != 0);\n+#endif\n       }\n     }\t\t\t\t/* switch (auth_type) */\n   return -1;\n"
  },
  {
    "path": "packages/inetutils/if_index.c.patch",
    "content": "diff -u -r ../inetutils-1.9.3/libinetutils/if_index.c ./libinetutils/if_index.c\n--- ../inetutils-1.9.3/libinetutils/if_index.c\t2015-03-31 11:40:48.000000000 -0400\n+++ ./libinetutils/if_index.c\t2015-05-12 15:32:45.660145151 -0400\n@@ -37,10 +37,22 @@\n #include <net/if.h>\n \n #ifndef HAVE_STRUCT_IF_NAMEINDEX\n+\n+#ifdef __ANDROID__\n+struct if_nameindex {\n+\tunsigned int if_index;\n+       char    *if_name;\n+};\n+# define ifr_ifindex     ifr_ifru.ifru_ivalue    /* interface index      */\n+#endif\n+\n unsigned int\n if_nametoindex (const char *ifname)\n {\n   int result = 0;\n+#ifdef __ANDROID__\n+  return result;\n+#else\n #ifdef SIOCGIFINDEX\n   {\n     int fd = socket (AF_INET, SOCK_DGRAM, 0);\n@@ -75,11 +87,13 @@\n       }\n     return result;\n   }\n+#endif\n }\n \n void\n if_freenameindex (struct if_nameindex *ifn)\n {\n+#ifndef __ANDROID__\n   struct if_nameindex *ptr = ifn;\n   if (!ifn)\n     return;\n@@ -88,6 +102,7 @@\n       free (ptr->if_name);\n       ++ptr;\n     }\n+#endif\n   free (ifn);\n }\n \n@@ -162,7 +177,7 @@\n \t  return NULL;\n \t}\n \n-# if defined SIOCGIFINDEX\n+# if defined SIOCGIFINDEX && !defined(__ANDROID__)\n       if (ioctl (fd, SIOCGIFINDEX, cur) >= 0)\n \tidx[i].if_index = cur->ifr_index;\n       else\n"
  },
  {
    "path": "packages/inetutils/utmp_logout.c.patch",
    "content": "diff -u -r ../inetutils-1.9.3/libinetutils/utmp_logout.c ./libinetutils/utmp_logout.c\n--- ../inetutils-1.9.3/libinetutils/utmp_logout.c\t2015-03-31 11:40:48.000000000 -0400\n+++ ./libinetutils/utmp_logout.c\t2015-05-12 16:29:06.884147490 -0400\n@@ -68,6 +68,7 @@\n void\n utmp_logout (char *line)\n {\n+#ifndef __ANDROID__\n #ifdef HAVE_UTMPX_H\n   struct utmpx utx;\n   struct utmpx *ut;\n@@ -166,4 +167,5 @@\n     logwtmp (line, \"\", \"\");\n # endif /* HAVE_LOGOUT */\n #endif\n+#endif\n }\n"
  },
  {
    "path": "packages/inotify-tools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/rvoicilas/inotify-tools/wiki\nTERMUX_PKG_DESCRIPTION=\"Programs providing a simple interface to inotify\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.20.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=a433cc1dedba851078276db69b0e97f9fe41e4ba3336d2971adfca4b3a6242ac\nTERMUX_PKG_BREAKS=\"inotify-tools-dev\"\nTERMUX_PKG_REPLACES=\"inotify-tools-dev\"\nTERMUX_PKG_SRCURL=https://github.com/rvoicilas/inotify-tools/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n\n\tLDFLAGS+=\" -llog\"\n}\n\ntermux_step_make() {\n\t:\n}\n\ntermux_step_make_install() {\n\t# the command-line tools needs the libinotifytools installed before building\n\tmake -C libinotifytools install\n\tmake install\n}\n"
  },
  {
    "path": "packages/inotify-tools/src-Makefile.am.patch",
    "content": "diff -u -r ../inotify-tools-3.20.1/src/Makefile.am ./src/Makefile.am\n--- ../inotify-tools-3.20.1/src/Makefile.am\t2018-01-06 12:10:51.000000000 +0100\n+++ ./src/Makefile.am\t2018-05-19 00:38:08.962826874 +0200\n@@ -2,7 +2,7 @@\n inotifywait_SOURCES = inotifywait.c common.c common.h\n inotifywatch_SOURCES = inotifywatch.c common.c common.h\n \n-AM_CFLAGS = -Wall -Werror -Wpointer-arith -std=c99 -I../libinotifytools/src -L../libinotifytools/src\n+AM_CFLAGS = -Wall -Wpointer-arith -std=c99 -I../libinotifytools/src -L../libinotifytools/src\n AM_CPPFLAGS = -I$(top_srcdir)/libinotifytools/src\n LDADD = ../libinotifytools/src/libinotifytools.la\n \n"
  },
  {
    "path": "packages/ipcalc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://jodies.de/ipcalc\nTERMUX_PKG_DESCRIPTION=\"Calculates IP broadcast, network, Cisco wildcard mask, and host ranges\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_DEPENDS=\"perl\"\nTERMUX_PKG_VERSION=0.41\nTERMUX_PKG_SRCURL=http://jodies.de/ipcalc-archive/ipcalc-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=dda9c571ce3369e5b6b06e92790434b54bec1f2b03f1c9df054c0988aa4e2e8a\n\ntermux_step_make_install() {\n  cp $TERMUX_PKG_SRCDIR/ipcalc $TERMUX_PREFIX/bin/\n}\n\n"
  },
  {
    "path": "packages/iperf3/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/esnet/iperf\nTERMUX_PKG_DESCRIPTION=\"TCP, UDP, and SCTP network bandwidth measurement tool\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=3.7\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=d846040224317caf2f75c843d309a950a7db23f9b44b94688ccbe557d6d1710c\nTERMUX_PKG_SRCURL=https://fossies.org/linux/privat/iperf-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BREAKS=\"iperf3-dev\"\nTERMUX_PKG_REPLACES=\"iperf3-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-profiling\"\n"
  },
  {
    "path": "packages/iperf3/main_Makefile.in.patch",
    "content": "diff -u -r ../iperf-3.0.3/Makefile.in ./Makefile.in\n--- ../iperf-3.0.3/Makefile.in\t2014-03-26 19:06:38.000000000 +0100\n+++ ./Makefile.in\t2014-06-16 08:41:13.908269513 +0200\n@@ -212,7 +212,7 @@\n top_build_prefix = @top_build_prefix@\n top_builddir = @top_builddir@\n top_srcdir = @top_srcdir@\n-SUBDIRS = src examples\n+SUBDIRS = src\n all: all-recursive\n \n .SUFFIXES:\n"
  },
  {
    "path": "packages/iperf3/src-iperf_api.c.patch",
    "content": "diff -u -r ../iperf-3.2/src/iperf_api.c ./src/iperf_api.c\n--- ../iperf-3.2/src/iperf_api.c\t2017-06-26 19:42:56.000000000 +0200\n+++ ./src/iperf_api.c\t2017-07-26 14:00:54.136126122 +0200\n@@ -3168,7 +3168,7 @@\n             tempdir = getenv(\"TMP\");\n         }\n         if (tempdir == 0){\n-            tempdir = \"/tmp\";\n+            tempdir = \"@TERMUX_PREFIX@/tmp\";\n         }\n         snprintf(template, sizeof(template) / sizeof(char), \"%s/iperf3.XXXXXX\", tempdir);\n     }\n"
  },
  {
    "path": "packages/ipfs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ipfs.io/\nTERMUX_PKG_DESCRIPTION=\"A peer-to-peer hypermedia distribution protocol\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.4.22\nTERMUX_PKG_REVISION=1\n# Use a snapshot to fix building with go 1.13:\n#TERMUX_PKG_SRCURL=https://github.com/ipfs/go-ipfs/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SRCURL=https://github.com/ipfs/go-ipfs/archive/d5977fc4759137f13c8980323d577759dad3d923.zip\nTERMUX_PKG_SHA256=7d8c791489b5de14aa72a78485d5ef87ada205b185b63d25467f42692e5d6d8d\n\ntermux_step_make() {\n    termux_setup_golang\n\n    export GOPATH=${TERMUX_PKG_BUILDDIR}\n    export GOARCH=${TERMUX_ARCH}\n\n    if [ \"${TERMUX_ARCH}\" = \"aarch64\" ]; then\n        GOARCH=\"arm64\"\n    elif [ \"${TERMUX_ARCH}\" = \"i686\" ]; then\n        GOARCH=\"386\"\n    elif [ \"${TERMUX_ARCH}\" = \"x86_64\" ]; then\n        GOARCH=\"amd64\"\n    fi\n\n    mkdir -p \"${GOPATH}/src/github.com/ipfs\"\n    cp -a \"${TERMUX_PKG_SRCDIR}\" \"${GOPATH}/src/github.com/ipfs/go-ipfs\"\n    cd \"${GOPATH}/src/github.com/ipfs/go-ipfs\"\n\n    make build\n\n    # Fix folders without write permissions preventing which fails repeating builds:\n    cd $TERMUX_PKG_BUILDDIR\n    find . -type d -exec chmod u+w {} \\;\n}\n\ntermux_step_make_install() {\n    mkdir -p \"${TERMUX_PREFIX}/bin\"\n    cp -f \"${TERMUX_PKG_BUILDDIR}/src/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs\" \"${TERMUX_PREFIX}/bin/\"\n}\n"
  },
  {
    "path": "packages/ipfs/go-ipfs-0.4.15_bin_dist_get.patch",
    "content": "diff -uNr go-ipfs-0.4.15/bin/dist_get go-ipfs-0.4.15.mod/bin/dist_get\n--- go-ipfs-0.4.15/bin/dist_get\t2018-05-10 12:22:02.000000000 +0300\n+++ go-ipfs-0.4.15.mod/bin/dist_get\t2018-06-24 17:57:59.457862326 +0300\n@@ -112,7 +112,7 @@\n \tm_archive=\"$4\"\n \tm_govars=$(get_go_vars) || die \"could not get go env vars\"\n \n-\techo \"https://ipfs.io$m_root/$m_name/$m_vers/${m_name}_${m_vers}_$m_govars.$m_archive\"\n+\techo \"https://ipfs.io$m_root/$m_name/$m_vers/${m_name}_${m_vers}_linux-amd64.$m_archive\"\n }\n \n distroot=\"$1\"\n@@ -138,6 +138,9 @@\n goenv=$(get_go_vars) || die \"could not get go env vars\"\n \n case $goenv in\n+\tandroid-*)\n+\t\tarchive=\"tar.gz\"\n+\t\t;;\n \tlinux-*)\n \t\tarchive=\"tar.gz\"\n \t\t;;\n"
  },
  {
    "path": "packages/ipmitool/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://ipmitool.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Command-line interface to IPMI-enabled devices\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.8.18\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/ipmitool/ipmitool/$TERMUX_PKG_VERSION/ipmitool-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01\nTERMUX_PKG_DEPENDS=\"ncurses, openssl, readline\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-llog\"\n}\n"
  },
  {
    "path": "packages/ipmitool/index-strchr.patch",
    "content": "diff -uNr ipmitool-1.8.18/lib/ipmi_sel.c ipmitool-1.8.18.mod/lib/ipmi_sel.c\n--- ipmitool-1.8.18/lib/ipmi_sel.c\t2016-10-06 07:14:42.000000000 +0300\n+++ ipmitool-1.8.18.mod/lib/ipmi_sel.c\t2019-02-01 02:14:57.521358035 +0200\n@@ -2457,18 +2457,18 @@\n \t\t\t/* evt.sel_type.standard_type.timestamp; */\n \n \t\t\t/* skip timestamp */\n-\t\t\tcursor = index((const char *)cursor, ';');\n+\t\t\tcursor = strchr((const char *)cursor, ';');\n \t\t\tcursor++;\n \n \t\t\t/* FIXME: parse originator */\n \t\t\tevt.sel_type.standard_type.gen_id = 0x0020;\n \n \t\t\t/* skip  originator info */\n-\t\t\tcursor = index((const char *)cursor, ';');\n+\t\t\tcursor = strchr((const char *)cursor, ';');\n \t\t\tcursor++;\n \n \t\t\t/* Get sensor type */\n-\t\t\tcursor = index((const char *)cursor, '(');\n+\t\t\tcursor = strchr((const char *)cursor, '(');\n \t\t\tcursor++;\n \n \t\t\terrno = 0;\n@@ -2479,7 +2479,7 @@\n \t\t\t\tstatus = (-1);\n \t\t\t\tbreak;\n \t\t\t}\t\n-\t\t\tcursor = index((const char *)cursor, ',');\n+\t\t\tcursor = strchr((const char *)cursor, ',');\n \t\t\tcursor++;\n \n \t\t\terrno = 0;\n@@ -2492,7 +2492,7 @@\n \t\t\t}\t\n \n \t\t\t/* skip  to event type  info */\n-\t\t\tcursor = index((const char *)cursor, ':');\n+\t\t\tcursor = strchr((const char *)cursor, ':');\n \t\t\tcursor++;\n \n \t\t\terrno = 0;\n@@ -2505,7 +2505,7 @@\n \t\t\t}\t\n \n \t\t\t/* skip  to event dir  info */\n-\t\t\tcursor = index((const char *)cursor, '(');\n+\t\t\tcursor = strchr((const char *)cursor, '(');\n \t\t\tcursor++;\n \t\t\tif (*cursor == 'a') {\n \t\t\t\tevt.sel_type.standard_type.event_dir = 0;\n@@ -2513,7 +2513,7 @@\n \t\t\t\tevt.sel_type.standard_type.event_dir = 1;\n \t\t\t}\n \t\t\t/* skip  to data info */\n-\t\t\tcursor = index((const char *)cursor, ' ');\n+\t\t\tcursor = strchr((const char *)cursor, ' ');\n \t\t\tcursor++;\n \n \t\t\tif (evt.sel_type.standard_type.sensor_type == 0xF0) {\n@@ -2532,7 +2532,7 @@\n \t\t\t\t}\t\n \n \t\t\t\t/* Get to previous state */\n-\t\t\t\tcursor = index((const char *)cursor, 'M');\n+\t\t\t\tcursor = strchr((const char *)cursor, 'M');\n \t\t\t\tcursor++;\n \n \t\t\t\t/* Set previous state */\n@@ -2546,7 +2546,7 @@\n \t\t\t\t}\t\n \n \t\t\t\t/* Get to current state */\n-\t\t\t\tcursor = index((const char *)cursor, 'M');\n+\t\t\t\tcursor = strchr((const char *)cursor, 'M');\n \t\t\t\tcursor++;\n \n \t\t\t\t/* Set current state */\n@@ -2560,7 +2560,7 @@\n \t\t\t\t}\t\n \n \t\t\t\t/* skip  to cause */\n-\t\t\t\tcursor = index((const char *)cursor, '=');\n+\t\t\t\tcursor = strchr((const char *)cursor, '=');\n \t\t\t\tcursor++;\n \t\t\t\terrno = 0;\n \t\t\t\tevt.sel_type.standard_type.event_data[1] |=\n@@ -2579,7 +2579,7 @@\n \t\t\t\t\tstatus = (-1);\n \t\t\t\t\tbreak;\n \t\t\t\t}\t\n-\t\t\t\tcursor = index((const char *)cursor, ' ');\n+\t\t\t\tcursor = strchr((const char *)cursor, ' ');\n \t\t\t\tcursor++;\n \n \t\t\t\terrno = 0;\n@@ -2591,7 +2591,7 @@\n \t\t\t\t\tbreak;\n \t\t\t\t}\t\n \n-\t\t\t\tcursor = index((const char *)cursor, ' ');\n+\t\t\t\tcursor = strchr((const char *)cursor, ' ');\n \t\t\t\tcursor++;\n \n \t\t\t\terrno = 0;\n"
  },
  {
    "path": "packages/ipmitool/openssl-1.1.patch",
    "content": "diff -urNp old/src/plugins/lanplus/lanplus_crypt_impl.c new/src/plugins/lanplus/lanplus_crypt_impl.c\n--- old/src/plugins/lanplus/lanplus_crypt_impl.c\t2016-05-28 10:20:20.000000000 +0200\n+++ new/src/plugins/lanplus/lanplus_crypt_impl.c\t2017-02-21 10:50:21.634873466 +0100\n@@ -164,10 +164,10 @@ lanplus_encrypt_aes_cbc_128(const uint8_\n \t\t\t\t\t\t\tuint8_t       * output,\n \t\t\t\t\t\t\tuint32_t        * bytes_written)\n {\n-\tEVP_CIPHER_CTX ctx;\n-\tEVP_CIPHER_CTX_init(&ctx);\n-\tEVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);\n-\tEVP_CIPHER_CTX_set_padding(&ctx, 0);\n+\tEVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();\n+\tEVP_CIPHER_CTX_init(ctx);\n+\tEVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);\n+\tEVP_CIPHER_CTX_set_padding(ctx, 0);\n \t\n \n \t*bytes_written = 0;\n@@ -191,7 +191,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_\n \tassert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);\n \n \n-\tif(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))\n+\tif(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))\n \t{\n \t\t/* Error */\n \t\t*bytes_written = 0;\n@@ -201,7 +201,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_\n \t{\n \t\tuint32_t tmplen;\n \n-\t\tif(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))\n+\t\tif(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))\n \t\t{\n \t\t\t*bytes_written = 0;\n \t\t\treturn; /* Error */\n@@ -210,7 +210,8 @@ lanplus_encrypt_aes_cbc_128(const uint8_\n \t\t{\n \t\t\t/* Success */\n \t\t\t*bytes_written += tmplen;\n-\t\t\tEVP_CIPHER_CTX_cleanup(&ctx);\n+\t\t\tEVP_CIPHER_CTX_cleanup(ctx);\n+\t\t\tEVP_CIPHER_CTX_free(ctx);\n \t\t}\n \t}\n }\n@@ -239,10 +240,10 @@ lanplus_decrypt_aes_cbc_128(const uint8_\n \t\t\t\t\t\t\tuint8_t       * output,\n \t\t\t\t\t\t\tuint32_t        * bytes_written)\n {\n-\tEVP_CIPHER_CTX ctx;\n-\tEVP_CIPHER_CTX_init(&ctx);\n-\tEVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);\n-\tEVP_CIPHER_CTX_set_padding(&ctx, 0);\n+\tEVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();\n+\tEVP_CIPHER_CTX_init(ctx);\n+\tEVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);\n+\tEVP_CIPHER_CTX_set_padding(ctx, 0);\n \n \n \tif (verbose >= 5)\n@@ -266,7 +267,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_\n \tassert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);\n \n \n-\tif (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))\n+\tif (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))\n \t{\n \t\t/* Error */\n \t\tlprintf(LOG_DEBUG, \"ERROR: decrypt update failed\");\n@@ -277,7 +278,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_\n \t{\n \t\tuint32_t tmplen;\n \n-\t\tif (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))\n+\t\tif (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))\n \t\t{\n \t\t\tchar buffer[1000];\n \t\t\tERR_error_string(ERR_get_error(), buffer);\n@@ -290,7 +291,8 @@ lanplus_decrypt_aes_cbc_128(const uint8_\n \t\t{\n \t\t\t/* Success */\n \t\t\t*bytes_written += tmplen;\n-\t\t\tEVP_CIPHER_CTX_cleanup(&ctx);\n+\t\t\tEVP_CIPHER_CTX_cleanup(ctx);\n+\t\t\tEVP_CIPHER_CTX_free(ctx);\n \t\t}\n \t}\n \n"
  },
  {
    "path": "packages/ired/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/radare/ired\nTERMUX_PKG_DESCRIPTION=\"Minimalist hexadecimal editor\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.6\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/radare/ired/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=c15d37b96b1a25c44435d824bd7ef1f9aea9dc191be14c78b689d3156312d58a\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $LDFLAGS\"\n}\n"
  },
  {
    "path": "packages/irssi/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://irssi.org/\nTERMUX_PKG_DESCRIPTION=\"Terminal based IRC client\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.2.2\nTERMUX_PKG_SRCURL=https://github.com/irssi/irssi/releases/download/$TERMUX_PKG_VERSION/irssi-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=6727060c918568ba2ff4295ad736128dba0b995d7b20491bca11f593bd857578\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses, openssl, glib, libandroid-glob, utf8proc\"\nTERMUX_PKG_BREAKS=\"irssi-dev\"\nTERMUX_PKG_REPLACES=\"irssi-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n"
  },
  {
    "path": "packages/irssi/fix-paths.patch",
    "content": "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\n--- irssi-1.2.0/src/fe-common/core/fe-exec.c\t2019-02-11 19:27:58.000000000 +0200\n+++ irssi-1.2.0.mod/src/fe-common/core/fe-exec.c\t2019-03-01 20:46:39.912473788 +0200\n@@ -281,7 +281,7 @@\n \n static void process_exec(PROCESS_REC *rec, const char *cmd)\n {\n-\tconst char *shell_args[4] = { \"/bin/sh\", \"-c\", NULL, NULL };\n+\tconst char *shell_args[4] = { \"@TERMUX_PREFIX@/bin/sh\", \"-c\", NULL, NULL };\n         char **args;\n \tint in[2], out[2];\n         int n;\n@@ -339,7 +339,7 @@\n \tif (rec->shell) {\n \t\texecvp(shell_args[0], (char **) shell_args);\n \n-\t\tfprintf(stderr, \"Exec: /bin/sh: %s\\n\", g_strerror(errno));\n+\t\tfprintf(stderr, \"Exec: @TERMUX_PREFIX@/bin/sh: %s\\n\", g_strerror(errno));\n \t} else {\n \t\targs = g_strsplit(cmd, \" \", -1);\n                 execvp(args[0], args);\ndiff -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\n--- irssi-1.2.0/src/fe-fuzz/fe-common/core/theme-load.c\t2019-02-11 19:27:58.000000000 +0200\n+++ irssi-1.2.0.mod/src/fe-fuzz/fe-common/core/theme-load.c\t2019-03-01 20:47:09.179339329 +0200\n@@ -38,7 +38,7 @@\n int LLVMFuzzerInitialize(int *argc, char ***argv) {\n \tcore_register_options();\n \tfe_common_core_register_options();\n-\tchar *irssi_argv[] = {*argv[0], \"--home\", \"/tmp/irssi\", NULL};\n+\tchar *irssi_argv[] = {*argv[0], \"--home\", \"@TERMUX_PREFIX@/tmp/irssi\", NULL};\n \tint irssi_argc = sizeof(irssi_argv) / sizeof(char *) - 1;\n \targs_execute(irssi_argc, irssi_argv);\n \tcore_preinit((*argv)[0]);\n@@ -52,7 +52,7 @@\n int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {\n \tgchar *copy = g_strndup((const gchar *)data, size);\n \n-\tFILE *fp = fopen(\"/tmp/irssi/fuzz.theme\", \"wb\");\n+\tFILE *fp = fopen(\"@TERMUX_PREFIX@/tmp/irssi/fuzz.theme\", \"wb\");\n \tif (fp) {\n \t\tfwrite(copy, strlen(copy), 1, fp);\n \t\tfclose(fp);\n"
  },
  {
    "path": "packages/isync/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://isync.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"IMAP and MailDir mailbox synchronizer\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.3.1\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/isync/isync/${TERMUX_PKG_VERSION}/isync-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=68cb4643d58152097f01c9b3abead7d7d4c9563183d72f3c2a31d22bc168f0ea\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-sasl ac_cv_header_db=no ac_cv_berkdb4=no\"\nTERMUX_PKG_DEPENDS=\"openssl, zlib\"\n"
  },
  {
    "path": "packages/isync/isync.patch",
    "content": "diff -u -r ../isync-1.3.0.orig/src/compat/config.c ./src/compat/config.c\n--- ../isync-1.3.0.orig/src/compat/config.c\t2017-10-01 17:42:35.000000000 +0900\n+++ ./src/compat/config.c\t2018-02-06 08:41:15.750006264 +0900\n@@ -451,7 +451,7 @@\n \t\t\t\t\tgoto gotstor;\n \t\t\tbox->local_store_path = my_strndup( path, pl );\n \t\t\t/* derive a suitable name */\n-\t\t\tif (!strcmp( box->local_store_path, \"/var/mail/\" ) || !strcmp( box->local_store_path, \"/var/spool/mail/\" )) {\n+\t\t\tif (!strcmp( box->local_store_path, \"@TERMUX_PREFIX@/var/mail/\" ) || !strcmp( box->local_store_path, \"@TERMUX_PREFIX@/var/spool/mail/\" )) {\n \t\t\t\tlocal_store = nfstrdup( \"spool\" );\n \t\t\t} else if (!strcmp( box->local_store_path, \"~/\" )) {\n \t\t\t\tlocal_store = nfstrdup( \"home\" );\ndiff -u -r ../isync-1.3.0.orig/src/compat/main.c ./src/compat/main.c\n--- ../isync-1.3.0.orig/src/compat/main.c\t2017-10-01 17:42:35.000000000 +0900\n+++ ./src/compat/main.c\t2018-02-06 08:41:15.750006264 +0900\n@@ -384,7 +384,7 @@\n \t\t\treturn 1;\n \t\t}\n \t} else {\n-\t\tstrcpy( path2, \"/tmp/mbsyncrcXXXXXX\" );\n+\t\tstrcpy( path2, \"@TERMUX_PREFIX@/tmp/mbsyncrcXXXXXX\" );\n \t\tif ((fd = mkstemp( path2 )) < 0) {\n \t\t\tsys_error( \"Error: cannot create temporary config file\" );\n \t\t\treturn 1;\ndiff -u -r ../isync-1.3.0.orig/src/socket.c ./src/socket.c\n--- ../isync-1.3.0.orig/src/socket.c\t2017-10-01 17:42:35.000000000 +0900\n+++ ./src/socket.c\t2018-02-06 08:41:15.750006264 +0900\n@@ -398,7 +398,7 @@\n \t\t\t\t_exit( 127 );\n \t\t\tclose( a[0] );\n \t\t\tclose( a[1] );\n-\t\t\texecl( \"/bin/sh\", \"sh\", \"-c\", conf->tunnel, (char *)0 );\n+\t\t\texecl( \"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", conf->tunnel, (char *)0 );\n \t\t\t_exit( 127 );\n \t\t}\n \n"
  },
  {
    "path": "packages/iverilog/Makefile.in.patch",
    "content": "diff -uNr iverilog-10_2/Makefile.in iverilog-10_2.mod/Makefile.in\n--- iverilog-10_2/Makefile.in\t2017-08-24 18:22:49.000000000 +0300\n+++ iverilog-10_2.mod/Makefile.in\t2019-02-25 20:18:55.327140615 +0200\n@@ -67,8 +67,8 @@\n dllib=@DLLIB@\n \n # For a cross compile these defines will need to be set accordingly.\n-HOSTCC = @CC@\n-HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@\n+HOSTCC = gcc\n+HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@\n \n CC = @CC@\n CXX = @CXX@\n"
  },
  {
    "path": "packages/iverilog/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://iverilog.icarus.com/\nTERMUX_PKG_DESCRIPTION=\"Icarus Verilog compiler and simulation tool\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=10.3\nTERMUX_PKG_SRCURL=https://github.com/steveicarus/iverilog/archive/v${TERMUX_PKG_VERSION/./_}.tar.gz\nTERMUX_PKG_SHA256=4b884261645a73b37467242d6ae69264fdde2e7c4c15b245d902531efaaeb234\nTERMUX_PKG_DEPENDS=\"libbz2, libc++, readline, zlib\"\nTERMUX_PKG_BREAKS=\"iverilog-dev\"\nTERMUX_PKG_REPLACES=\"iverilog-dev\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -lm\"\n\taclocal\n\tautoconf\n}\n"
  },
  {
    "path": "packages/iverilog/driver-main.c.patch",
    "content": "diff -uNr iverilog-10_2/driver/main.c iverilog-10_2.mod/driver/main.c\n--- iverilog-10_2/driver/main.c\t2017-08-24 18:22:49.000000000 +0300\n+++ iverilog-10_2.mod/driver/main.c\t2019-02-25 20:10:43.322593058 +0200\n@@ -282,7 +282,7 @@\n \t    tmpdir = \"C:\\\\TEMP\";\n #else\n       if (tmpdir == 0)\n-\t    tmpdir = \"/tmp\";\n+\t    tmpdir = \"@TERMUX_PREFIX@/tmp\";\n #endif\n \n       assert(tmpdir);\n"
  },
  {
    "path": "packages/iverilog/vvp-Makefile.in.patch",
    "content": "diff -uNr iverilog-10_2/vvp/Makefile.in iverilog-10_2.mod/vvp/Makefile.in\n--- iverilog-10_2/vvp/Makefile.in\t2017-08-24 18:22:49.000000000 +0300\n+++ iverilog-10_2.mod/vvp/Makefile.in\t2019-02-25 20:18:31.607079821 +0200\n@@ -32,8 +32,8 @@\n includedir = @includedir@\n \n # For a cross compile these defines will need to be set accordingly.\n-HOSTCC = @CC@\n-HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@ @CFLAGS@\n+HOSTCC = gcc\n+HOSTCFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CC@\n \n CC = @CC@\n CXX = @CXX@\n"
  },
  {
    "path": "packages/jbig2dec/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://jbig2dec.com/\nTERMUX_PKG_DESCRIPTION=\"Decoder implementation of the JBIG2 image compression format\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.17\nTERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/jbig2dec-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=f72bad7102638b31fa96be7492fb3d447a83d71c644cffd01f2a7ec52bd5fb72\nTERMUX_PKG_DEPENDS=\"libpng\"\nTERMUX_PKG_BREAKS=\"jbig2dec-dev\"\nTERMUX_PKG_REPLACES=\"jbig2dec-dev\"\n"
  },
  {
    "path": "packages/jhead/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.sentex.net/~mwandel/jhead/\nTERMUX_PKG_DESCRIPTION=\"Exif Jpeg header manipulation tool\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_VERSION=3.04\nTERMUX_PKG_SHA256=ef89bbcf4f6c25ed88088cf242a47a6aedfff4f08cc7dc205bf3e2c0f10a03c9\nTERMUX_PKG_SRCURL=http://www.sentex.net/~mwandel/jhead/jhead-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tinstall -Dm700 jhead $TERMUX_PREFIX/bin/jhead\n\tinstall -Dm600 jhead.1 $TERMUX_PREFIX/share/man/man1/jhead.1\n}\n"
  },
  {
    "path": "packages/joe/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://joe-editor.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Wordstar like text editor\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_CONFLICTS=\"jupp\"\nTERMUX_PKG_VERSION=4.6\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://sourceforge.net/projects/joe-editor/files/JOE%20sources/joe-${TERMUX_PKG_VERSION}/joe-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=495a0a61f26404070fe8a719d80406dc7f337623788e445b92a9f6de512ab9de\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-termcap\"\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/joe 10\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/joe\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/joe/do_not_build_utils.patch",
    "content": "--- src/joe/Makefile.in~\t2016-08-31 16:47:12.000000000 +0200\n+++ src/joe/Makefile.in\t2016-12-26 18:03:33.523645366 +0100\n@@ -316,7 +316,7 @@\n top_builddir = @top_builddir@\n top_srcdir = @top_srcdir@\n AUTOMAKE_OPTIONS = foreign\n-SUBDIRS = util\n+SUBDIR = \n EXTRA_DIST = TODO\n sysconf_joedir = $(sysconfdir)/joe\n data_joedir = $(datadir)/joe\n"
  },
  {
    "path": "packages/joe/fix_errno.patch",
    "content": "--- src/joe/b.c~\t2016-08-22 15:52:28.000000000 +0200\n+++ src/joe/b.c\t2016-12-26 18:17:44.449852459 +0100\n@@ -5,6 +5,8 @@\n  *\n  *\tThis file is part of JOE (Joe's Own Editor)\n  */\n+\n+\n #include \"types.h\"\n \n #ifdef HAVE_PWD_H\n@@ -19,7 +21,7 @@\n #endif\n #endif\n \n-extern int errno;\n+\n \n #ifdef WITH_SELINUX\n #include <selinux/selinux.h>\n"
  },
  {
    "path": "packages/joe/no_getpwent.patch",
    "content": "--- src/joe/path.c~\t2016-07-18 17:11:09.000000000 +0200\n+++ src/joe/path.c\t2016-12-26 18:48:04.010421451 +0100\n@@ -401,14 +401,14 @@\n {\n \tchar **lst = NULL;\n \tstruct passwd *pw;\n-\n+#ifndef __ANDROID__\n \twhile((pw=getpwent()))\n \t\tif (rmatch(word+1, pw->pw_name)) {\n \t\t\tchar *t = vsncpy(NULL,0,sc(\"~\"));\n \t\t\tlst = vaadd(lst, vsncpy(sv(t),sz(pw->pw_name)));\n \t\t\t}\n \tendpwent();\n-\n+#endif\n \treturn lst;\n }\n /********************************************************************/\n"
  },
  {
    "path": "packages/jp2a/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/cslarsen/jp2a\nTERMUX_PKG_DESCRIPTION=\"A simple JPEG to ASCII converter\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.0.8\nTERMUX_PKG_REVISION=5\n_COMMIT=61d205f6959d88e0cc8d8879fe7d66eb0932ecca\nTERMUX_PKG_SRCURL=https://github.com/cslarsen/jp2a/archive/${_COMMIT}.zip\nTERMUX_PKG_SHA256=26f655e4b977bf24b8193150f34c015195c07c1116d064375223dd46ea5b8b4e\nTERMUX_PKG_DEPENDS=\"libcurl, libjpeg-turbo, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tautoreconf -vi\n}\n"
  },
  {
    "path": "packages/jq/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://stedolan.github.io/jq/\nTERMUX_PKG_DESCRIPTION=\"Command-line JSON processor\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.6\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72\nTERMUX_PKG_BREAKS=\"jq-dev\"\nTERMUX_PKG_REPLACES=\"jq-dev\"\nTERMUX_PKG_SRCURL=https://github.com/stedolan/jq/releases/download/jq-$TERMUX_PKG_VERSION/jq-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-oniguruma=no\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/json-c/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/json-c/json-c/wiki\nTERMUX_PKG_DESCRIPTION=\"A JSON implementation in C\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Balazs Kutil @balazs_kutil\"\nTERMUX_PKG_VERSION=0.13.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=b87e608d4d3f7bfdd36ef78d56d53c74e66ab278d318b71e6002a369d36f4873\nTERMUX_PKG_BREAKS=\"json-c-dev\"\nTERMUX_PKG_REPLACES=\"json-c-dev\"\nTERMUX_PKG_SRCURL=https://s3.amazonaws.com/json-c_releases/releases/json-c-${TERMUX_PKG_VERSION}.tar.gz\n\ntermux_step_make() {\n\tmake \\\n\t\tLDFLAGS=\"$LDFLAGS -llog\"\n}\n"
  },
  {
    "path": "packages/json-glib/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/JsonGlib\nTERMUX_PKG_DESCRIPTION=\"GLib JSON manipulation library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.4.4\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=720c5f4379513dc11fd97dc75336eb0c0d3338c53128044d9fabec4374f4bc47\nTERMUX_PKG_SRCURL=https://download.gnome.org/sources/json-glib/${TERMUX_PKG_VERSION:0:3}/json-glib-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"glib\"\nTERMUX_PKG_BREAKS=\"json-glib-dev\"\nTERMUX_PKG_REPLACES=\"json-glib-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nshare/installed-tests\nlibexec/installed-tests\nbin/\n\"\n\ntermux_step_pre_configure() {\n\t# Remove configure wrapper around meson build which prevents\n\t# meson setup in termux_step_configure.\n\trm configure\n}\n"
  },
  {
    "path": "packages/jsoncpp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/open-source-parsers/jsoncpp\nTERMUX_PKG_DESCRIPTION=\"C++ library for interacting with JSON\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.9.2\nTERMUX_PKG_SHA256=77a402fb577b2e0e5d0bdc1cf9c65278915cdb25171e3452c68b6da8a561f8f0\nTERMUX_PKG_SRCURL=https://github.com/open-source-parsers/jsoncpp/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"jsoncpp-dev\"\nTERMUX_PKG_REPLACES=\"jsoncpp-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBUILD_SHARED_LIBS=ON\n-DJSONCPP_WITH_TESTS=OFF\n-DCCACHE_FOUND=OFF\n\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# The installation does not overwrite symlinks such as libjsoncpp.so.1,\n\t# so if rebuilding these are not detected as modified. Fix that:\n\trm -f $TERMUX_PREFIX/lib/libjsoncpp.so*\n}\n"
  },
  {
    "path": "packages/jupp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.mirbsd.org/jupp.htm\nTERMUX_PKG_DESCRIPTION=\"User friendly full screen text editor\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Dominik George @Natureshadow\"\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_CONFLICTS=\"joe\"\nTERMUX_PKG_VERSION=3.1jupp38\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://www.mirbsd.org/MirOS/dist/jupp/joe-${TERMUX_PKG_VERSION}.tgz\nTERMUX_PKG_SHA256=c5cbe3f97683f6e513f611a60531feefb9b877f8cea4c6e9087b48631f69ed40\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-dependency-tracking\n--disable-getpwnam\n--disable-termcap\n--disable-termidx\n--enable-sysconfjoesubdir=/jupp\n\"\n\ntermux_step_post_extract_package() {\n\tchmod +x $TERMUX_PKG_SRCDIR/configure\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/jupp 10\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/jupp\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/kakoune/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/mawww/kakoune\nTERMUX_PKG_DESCRIPTION=\"Code editor heavily inspired by Vim\"\nTERMUX_PKG_LICENSE=\"Unlicense\"\nTERMUX_PKG_VERSION=2019.07.01\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/mawww/kakoune/releases/download/v$TERMUX_PKG_VERSION/kakoune-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=8cf978499000bd71a78736eaee5663bd996f53c4e610c62a9bd97502a3ed6fd3\nTERMUX_PKG_DEPENDS=\"libc++, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\" -C src debug=no\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tCXXFLAGS+=\" -no-integrated-as\"\n\tfi\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/kak 45\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/kak\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/kakoune/src-cs-path-compat.patch",
    "content": "diff --git a/src/shell_manager.cc b/src/shell_manager.cc\nindex b92edb4c..df025943 100644\n--- a/src/shell_manager.cc\n+++ b/src/shell_manager.cc\n@@ -30,9 +30,7 @@ ShellManager::ShellManager(ConstArrayView<EnvVarDesc> builtin_env_vars)\n {\n     // Get a guaranteed to be POSIX shell binary\n     {\n-        auto size = confstr(_CS_PATH, nullptr, 0);\n-        String path; path.resize(size-1, 0);\n-        confstr(_CS_PATH, path.data(), size);\n+        String path = \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:.\";\n         for (auto dir : StringView{path} | split<StringView>(':'))\n         {\n             String candidate = format(\"{}/sh\", dir);\n"
  },
  {
    "path": "packages/keybase/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://keybase.io\nTERMUX_PKG_DESCRIPTION=\"Key directory that maps social media identities to encryption keys\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=4.7.2\nTERMUX_PKG_SRCURL=https://github.com/keybase/client/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=d6cf2ac1f13bd95c713a534ec504fe20556bd8da93bb5cfe1cdcb6287ed1fc4d\nTERMUX_PKG_REPLACES=\"kbfs\"\nTERMUX_PKG_CONFLICTS=\"kbfs\"\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\n\ttermux_setup_golang\n\n\tmkdir -p .gopath/src/github.com/keybase\n\tln -sf \"$PWD\" .gopath/src/github.com/keybase/client\n\texport GOPATH=\"$PWD/.gopath\"\n\n\tgo build -v -tags 'production' -o keybase github.com/keybase/client/go/keybase\n\tgo build -v -tags 'production' -o git-remote-keybase github.com/keybase/client/go/kbfs/kbfsgit/git-remote-keybase\n\tgo build -v -tags 'production' -o kbfsfusebin github.com/keybase/client/go/kbfs/kbfsfuse\n\n\tcp keybase $TERMUX_PREFIX/bin/keybase\n\tcp git-remote-keybase $TERMUX_PREFIX/bin/git-remote-keybase\n\tcp kbfsfusebin $TERMUX_PREFIX/bin/kbfsfuse\n}\n"
  },
  {
    "path": "packages/keybase/go-libkb-env.go.patch",
    "content": "diff -u -r ../client-4.0.0/go/libkb/env.go ./go/libkb/env.go\n--- ../client-4.0.0/go/libkb/env.go\t2019-05-07 19:35:07.000000000 +0000\n+++ ./go/libkb/env.go\t2019-05-11 22:36:35.015703478 +0000\n@@ -1784,7 +1784,7 @@\n func (e *Env) ForceSecretStoreFile() bool {\n \t// By default use system-provided secret store (like MacOS Keychain), but\n \t// allow users to fall back to file-based store for testing and debugging.\n-\treturn e.GetBool(false,\n+\treturn e.GetBool(true,\n \t\tfunc() (bool, bool) { return e.getEnvBool(\"KEYBASE_SECRET_STORE_FILE\") },\n \t\tfunc() (bool, bool) { return e.GetConfig().GetForceSecretStoreFile() },\n \t)\n"
  },
  {
    "path": "packages/keystone/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.keystone-engine.org/\nTERMUX_PKG_DESCRIPTION=\"Keystone is a lightweight multi-platform, multi-architecture assembler framework\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.9.1\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://github.com/keystone-engine/keystone/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=e9d706cd0c19c49a6524b77db8158449b9c434b415fbf94a073968b68cf8a9f0\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"keystone-dev\"\nTERMUX_PKG_REPLACES=\"keystone-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DPYTHON_EXECUTABLE=$(which python2.7)\n-DBUILD_SHARED_LIBS=ON\"\n"
  },
  {
    "path": "packages/kona/Makefile.patch",
    "content": "diff -uNr kona-Win64-20190226/Makefile kona-Win64-20190226.mod/Makefile\n--- kona-Win64-20190226/Makefile\t2019-02-26 22:13:07.000000000 +0200\n+++ kona-Win64-20190226.mod/Makefile\t2019-05-21 14:37:07.394973847 +0300\n@@ -1,10 +1,8 @@\n-PREFIX = /usr/local\n-CFLAGS=-g\n-PRODFLAGS = -O3 #-pg -g3\n+PRODFLAGS =\n LIB=libkona.a\n DEVFLAGS = -O0 -g3 -DDEBUG -Wall\n \n-OS := $(shell uname -s | tr \"[:upper:]\" \"[:lower:]\")\n+OS := android\n \n # Win-64\n ifeq (msys_nt-10.0,$(OS))\n@@ -30,16 +28,12 @@\n endif\n \n ifeq (android,$(OS))\n-CC=arm-linux-androideabi-gcc\n-OBJS= src/0.o src/bswap.o src/c.o src/getline.o src/getline_android.o src/mt.o src/p.o  \\\n+OBJS= src/0.o src/bswap.o src/c.o src/getline.o src/mt.o src/p.o  \\\n       src/r.o src/k.o src/kc.o src/kx.o src/kg.o src/km.o src/kn.o src/ko.o  \\\n       src/ks.o src/v.o src/va.o src/vc.o src/vd.o src/vf.o src/vg.o src/vq.o\n-LDFLAGS = -Wl,--gc-sections -Wl,-z,nocopyreloc -lgcc -no-canonical-prefixes \\\n-          -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -mthumb \\\n-          -lc -lm -ldl\n-CFLAGS += -fPIE -fpic -ffunction-sections -funwind-tables -fstack-protector \\\n-          -no-canonical-prefixes -mtune=xscale -msoft-float -mthumb \\\n-          -fomit-frame-pointer -fno-strict-aliasing\n+LDFLAGS += -Wl,--gc-sections -Wl,-z,nocopyreloc -lgcc -no-canonical-prefixes \\\n+          -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \\\n+          -lm\n endif\n \n ifeq (linux,$(OS))\n"
  },
  {
    "path": "packages/kona/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/kevinlawler/kona\nTERMUX_PKG_DESCRIPTION=\"Open-source implementation of the APL-like K programming language\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_MAINTAINER=\"Jonathan Badger @jhbadger\"\nTERMUX_PKG_VERSION=20190226\nTERMUX_PKG_SRCURL=https://github.com/kevinlawler/kona/archive/Win64-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=26cfebd47a3ae60753fc8a910132f45cad58381155255fbac2129e4507fef403\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/kona/getline_android.c.patch",
    "content": "--- ../kona-Win.3.36-64/src/getline_android.c\t2015-07-30 11:18:02.000000000 -0400\n+++ ./src/getline_android.c\t2015-12-06 03:22:55.000000000 -0500\n@@ -9,7 +9,7 @@\n #include <errno.h>\n #include <stdlib.h>\n \n-I getline(S *s,size_t*n, FILE *f){ R getdelim(s,n,'\\n',f);}\n+I new_getline(S *s,size_t*n, FILE *f){ R getdelim(s,n,'\\n',f);}\n \n /* getdelim.c --- Implementation of replacement getdelim function.\n    Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2012 Free Software\n@@ -44,7 +44,7 @@\n    necessary.  Returns the number of characters read (not including\n    the null terminator), or -1 on error or EOF.  */\n \n-I getdelim (S *lineptr, size_t * __restrict__ n, I delimiter, FILE *fp)\n+I new_getdelim (S *lineptr, size_t * __restrict__ n, I delimiter, FILE *fp)\n {\n   ssize_t result;\n   size_t cur_len = 0;\n"
  },
  {
    "path": "packages/kona/src-0.c.patch",
    "content": "diff -u -r ../kona-Win.3.39-69/src/0.c ./src/0.c\n--- ../kona-Win.3.39-69/src/0.c\t2016-04-17 18:10:22.000000000 +0000\n+++ ./src/0.c\t2017-07-06 22:48:04.933685208 +0000\n@@ -13,6 +13,7 @@\n #if defined(__OpenBSD__) || defined(__FreeBSD__)  || defined(__NetBSD__) || defined(__ANDROID__)\n #include <sys/socket.h>\n #include <netinet/in.h>\n+#include <sys/wait.h> /* For wait(2). */\n #endif\n \n #include \"0.h\"\n"
  },
  {
    "path": "packages/kona/src-bswap.c.patch",
    "content": "diff -u -r ../kona-Win.3.39-69/src/bswap.c ./src/bswap.c\n--- ../kona-Win.3.39-69/src/bswap.c\t2016-04-17 14:10:22.000000000 -0400\n+++ ./src/bswap.c\t2016-05-03 14:17:03.393640037 -0400\n@@ -11,8 +11,6 @@\n \n #if defined(__linux__) && defined(__GNUC__)\n #include <byteswap.h>\n-#define bswap32 __bswap_32\n-#define bswap64 __bswap_64\n #endif\n \n #ifdef _MSC_VER\n"
  },
  {
    "path": "packages/kona/src-getline.h.patch",
    "content": "diff -uNr kona-Win64-20190226/src/getline.h kona-Win64-20190226.mod/src/getline.h\n--- kona-Win64-20190226/src/getline.h\t2019-02-26 22:13:07.000000000 +0200\n+++ kona-Win64-20190226.mod/src/getline.h\t2019-05-21 14:38:35.428447096 +0300\n@@ -6,8 +6,7 @@\n I appender(S *s,I *n,S t,I k);\n I expander(S *s,I n);\n \n-#if defined(__MACH__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070 || \\\n-   defined(__ANDROID__)\n+#if defined(__MACH__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070\n I getline(S *s,size_t * __restrict__ n,FILE *f);\n I getdelim(S *s,size_t * __restrict__ n,I d,FILE *f);\n #endif\n"
  },
  {
    "path": "packages/kona/src-kn.c.patch",
    "content": "diff -u -r ../kona-Win.3.39-69/src/kn.c ./src/kn.c\n--- ../kona-Win.3.39-69/src/kn.c\t2016-04-17 18:10:22.000000000 +0000\n+++ ./src/kn.c\t2017-07-06 22:56:28.547903872 +0000\n@@ -4,6 +4,7 @@\n #include \"k.h\"\n #include \"km.h\"\n #include \"kn.h\"\n+#include \"c.h\"\n \n #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__ANDROID__)\n #include <sys/socket.h>\n"
  },
  {
    "path": "packages/kona/src-p.c.patch",
    "content": "diff -u -r ../kona-Win.3.39-69/src/p.c ./src/p.c\n--- ../kona-Win.3.39-69/src/p.c\t2016-04-17 18:10:22.000000000 +0000\n+++ ./src/p.c\t2017-07-06 22:52:49.750416845 +0000\n@@ -1,4 +1,5 @@\n #include \"incs.h\"\n+#include \"c.h\"\n #include \"k.h\"\n #include \"km.h\"\n #include \"p.h\"\n"
  },
  {
    "path": "packages/kona/src-v.h.patch",
    "content": "diff -uNr kona-Win64-20190226/src/v.h kona-Win64-20190226.mod/src/v.h\n--- kona-Win64-20190226/src/v.h\t2019-02-26 22:13:07.000000000 +0200\n+++ kona-Win64-20190226.mod/src/v.h\t2019-05-21 14:40:16.130994527 +0300\n@@ -6,3 +6,6 @@\n extern V offsetSSR,offsetWhat,offsetAt,offsetDot,offsetColon;  //k.c\n extern K KTREE;                      //k.c\n K wd_(S s,int n,K*dict,K func);        //p.c\n+\n+K lookupEntryOrCreate(K *p, S k);\n+K* EAP(K e);\n"
  },
  {
    "path": "packages/krb5/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://web.mit.edu/kerberos\nTERMUX_PKG_DESCRIPTION=\"The Kerberos network authentication system\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.17\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/krb5-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=5a6e2284a53de5702d3dc2be3b9339c963f9b5397d3fbbc53beb249380a781f5\nTERMUX_PKG_DEPENDS=\"libandroid-support, libandroid-glob, readline, openssl, libdb\"\nTERMUX_PKG_BREAKS=\"krb5-dev\"\nTERMUX_PKG_REPLACES=\"krb5-dev\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_CONFFILES=\"etc/krb5.conf var/krb5kdc/kdc.conf\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-static\n--with-readline\n--without-system-verto\n--with-netlib=-lc\n--enable-dns-for-realm\n--sbindir=$TERMUX_PREFIX/bin\n--with-size-optimizations\n--with-system-db\nDEFCCNAME=$TERMUX_PREFIX/tmp/krb5cc_%{uid}\nDEFKTNAME=$TERMUX_PREFIX/etc/krb5.keytab\nDEFCKTNAME=$TERMUX_PREFIX/var/krb5/user/%{euid}/client.keytab\n\"\n\ntermux_step_post_extract_package() {\n\tTERMUX_PKG_SRCDIR+=\"/src\"\n}\n\ntermux_step_pre_configure() {\n\t# cannot test these when cross compiling\n\texport krb5_cv_attr_constructor_destructor='yes,yes'\n\texport ac_cv_func_regcomp='yes'\n\texport ac_cv_printf_positional='yes'\n\n\t# bionic doesn't have getpass\n\tcp \"$TERMUX_PKG_BUILDER_DIR/netbsd_getpass.c\" \"$TERMUX_PKG_SRCDIR/clients/kpasswd/\"\n\n\tCFLAGS=\"$CFLAGS -D_PASSWORD_LEN=PASS_MAX\"\n\texport LIBS=\"-landroid-glob -llog\"\n}\n\ntermux_step_post_make_install() {\n\t# Enable logging to STDERR by default\n\techo -e \"\\tdefault = STDERR\" >> $TERMUX_PKG_SRCDIR/config-files/krb5.conf\n\n\t# Sample KDC config file\n\tinstall -dm 700 $TERMUX_PREFIX/var/krb5kdc\n\tinstall -pm 600 $TERMUX_PKG_SRCDIR/config-files/kdc.conf $TERMUX_PREFIX/var/krb5kdc/kdc.conf\n\n\t# Default configuration file\n\tinstall -pm 600 $TERMUX_PKG_SRCDIR/config-files/krb5.conf $TERMUX_PREFIX/etc/krb5.conf\n\n\tinstall -dm 700 $TERMUX_PREFIX/share/aclocal\n\tinstall -m 600 $TERMUX_PKG_SRCDIR/util/ac_check_krb5.m4 $TERMUX_PREFIX/share/aclocal\n}\n"
  },
  {
    "path": "packages/krb5/config-files-kdc.conf.patch",
    "content": "--- ./config-files/kdc.conf\t2017-03-03 03:36:02.000000000 +0530\n+++ ../kdc.conf\t2017-04-02 20:29:55.296108766 +0530\n@@ -1,14 +1,14 @@\n [kdcdefaults]\n-\tkdc_listen = 88\n-\tkdc_tcp_listen = 88\n+\tkdc_listen = 1088\n+\tkdc_tcp_listen = 1088\n \n [realms]\n \tATHENA.MIT.EDU = {\n-\t\tdatabase_name = /usr/local/var/krb5kdc/principal\n-\t\tacl_file = /usr/local/var/krb5kdc/kadm5.acl\n-\t\tkey_stash_file = /usr/local/var/krb5kdc/.k5.ATHENA.MIT.EDU\n-\t\tkdc_listen = 88\n-\t\tkdc_tcp_listen = 88\n+\t\tdatabase_name = @TERMUX_PREFIX@/var/krb5kdc/principal\n+\t\tacl_file = @TERMUX_PREFIX@/var/krb5kdc/kadm5.acl\n+\t\tkey_stash_file = @TERMUX_PREFIX@/var/krb5kdc/.k5.ATHENA.MIT.EDU\n+\t\tkdc_listen = 1088\n+\t\tkdc_tcp_listen = 1088\n \t\tmax_life = 10h 0m 0s\n \t\tmax_renewable_life = 7d 0h 0m 0s\n \t}\n"
  },
  {
    "path": "packages/krb5/include-osconf.hin.patch",
    "content": "--- ./include/osconf.hin\t2017-03-03 03:36:02.000000000 +0530\n+++ ../osconf.hin\t2017-04-03 10:45:03.475924421 +0530\n@@ -81,12 +81,12 @@\n \n #define KDC_PORTNAME            \"kerberos\" /* for /etc/services or equiv. */\n \n-#define KRB5_DEFAULT_PORT       88\n+#define KRB5_DEFAULT_PORT       1088\n \n-#define DEFAULT_KPASSWD_PORT    464\n+#define DEFAULT_KPASSWD_PORT    1464\n \n-#define DEFAULT_KDC_UDP_PORTLIST \"88\"\n-#define DEFAULT_KDC_TCP_PORTLIST \"88\"\n+#define DEFAULT_KDC_UDP_PORTLIST \"1088\"\n+#define DEFAULT_KDC_TCP_PORTLIST \"1088\"\n #define DEFAULT_TCP_LISTEN_BACKLOG 5\n \n /*\n@@ -94,7 +94,7 @@\n  */\n #define DEFAULT_KADM5_KEYTAB    KDC_DIR \"/kadm5.keytab\"\n #define DEFAULT_KADM5_ACL_FILE  KDC_DIR \"/kadm5.acl\"\n-#define DEFAULT_KADM5_PORT      749 /* assigned by IANA */\n+#define DEFAULT_KADM5_PORT      1749 /* assigned by IANA */\n \n #define KRB5_DEFAULT_SUPPORTED_ENCTYPES                 \\\n     \"aes256-cts-hmac-sha1-96:normal \"                   \\\n"
  },
  {
    "path": "packages/krb5/krb5-config_LDFLAGS.patch",
    "content": "https://bugs.gentoo.org/show_bug.cgi?id=448778\n--- ./build-tools/krb5-config.in\t2012-12-18 02:47:04.000000000 +0000\n+++ ./build-tools/krb5-config.in\t2012-12-28 07:13:16.582693363 +0000\n@@ -217,7 +217,7 @@\n \t    -e 's#\\$(PROG_RPATH)#'$libdir'#' \\\n \t    -e 's#\\$(PROG_LIBPATH)#'$libdirarg'#' \\\n \t    -e 's#\\$(RPATH_FLAG)#'\"$RPATH_FLAG\"'#' \\\n-\t    -e 's#\\$(LDFLAGS)#'\"$LDFLAGS\"'#' \\\n+\t    -e 's#\\$(LDFLAGS)##' \\\n \t    -e 's#\\$(PTHREAD_CFLAGS)#'\"$PTHREAD_CFLAGS\"'#' \\\n \t    -e 's#\\$(CFLAGS)##'`\n \n"
  },
  {
    "path": "packages/krb5/netbsd_getpass.c",
    "content": "/*\t$NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $\t*/\n/*\n * Copyright (c) 1988, 1993\n *\tThe Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n#if 0\n#include <sys/cdefs.h>\n#if defined(LIBC_SCCS) && !defined(lint)\n#if 0\nstatic char sccsid[] = \"@(#)getpass.c\t8.1 (Berkeley) 6/4/93\";\n#else\n__RCSID(\"$NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $\");\n#endif\n#endif /* LIBC_SCCS and not lint */\n#include \"namespace.h\"\n#endif\n#include <assert.h>\n#include <paths.h>\n#include <pwd.h>\n#include <signal.h>\n#include <stdio.h>\n#include <termios.h>\n#include <unistd.h>\n#if 0\n#ifdef __weak_alias\n__weak_alias(getpass,_getpass)\n#endif\n#endif\nchar *\ngetpass(prompt)\n\tconst char *prompt;\n{\n\tstruct termios term;\n\tint ch;\n\tchar *p;\n\tFILE *fp, *outfp;\n\tint echo;\n\tstatic char buf[_PASSWORD_LEN + 1];\n\tsigset_t oset, nset;\n#if 0\n\t_DIAGASSERT(prompt != NULL);\n#endif\n\t/*\n\t * read and write to /dev/tty if possible; else read from\n\t * stdin and write to stderr.\n\t */\n\tif ((outfp = fp = fopen(_PATH_TTY, \"w+\")) == NULL) {\n\t\toutfp = stderr;\n\t\tfp = stdin;\n\t}\n\t/*\n\t * note - blocking signals isn't necessarily the\n\t * right thing, but we leave it for now.\n\t */\n\tsigemptyset(&nset);\n\tsigaddset(&nset, SIGINT);\n\tsigaddset(&nset, SIGTSTP);\n\t(void)sigprocmask(SIG_BLOCK, &nset, &oset);\n\t(void)tcgetattr(fileno(fp), &term);\n\tif ((echo = (term.c_lflag & ECHO)) != 0) {\n\t\tterm.c_lflag &= ~ECHO;\n\t\t(void)tcsetattr(fileno(fp), TCSAFLUSH /*|TCSASOFT*/, &term);\n\t}\n\tif (prompt != NULL)\n\t\t(void)fputs(prompt, outfp);\n\trewind(outfp);\t\t\t/* implied flush */\n\tfor (p = buf; (ch = getc(fp)) != EOF && ch != '\\n';)\n\t\tif (p < buf + _PASSWORD_LEN)\n\t\t\t*p++ = ch;\n\t*p = '\\0';\n\t(void)write(fileno(outfp), \"\\n\", 1);\n\tif (echo) {\n\t\tterm.c_lflag |= ECHO;\n\t\t(void)tcsetattr(fileno(fp), TCSAFLUSH/*|TCSASOFT*/, &term);\n\t}\n\t(void)sigprocmask(SIG_SETMASK, &oset, NULL);\n\tif (fp != stdin)\n\t\t(void)fclose(fp);\n\treturn(buf);\n}\n"
  },
  {
    "path": "packages/krb5/plugins-kdb-db2.patch",
    "content": "--- ./plugins/kdb/db2/policy_db.h\t2017-03-03 03:36:02.000000000 +0530\n+++ ../policy_db.h\t2017-04-02 09:46:43.244368060 +0530\n@@ -30,7 +30,7 @@\n    where we find u_int32_t.  */\n #include <gssrpc/types.h>\n #include <gssrpc/xdr.h>\n-#include <db.h>\n+#include <db_185.h>\n #include \"adb_err.h\"\n #include <com_err.h>\n \n--- ./plugins/kdb/db2/adb_openclose.c\t2017-03-03 03:36:02.000000000 +0530\n+++ ../adb_openclose.c\t2017-04-02 09:50:13.854729855 +0530\n@@ -11,7 +11,7 @@\n #include        <unistd.h>\n #include        \"policy_db.h\"\n #include        <stdlib.h>\n-#include        <db.h>\n+#include        <db_185.h>\n \n struct _locklist {\n     osa_adb_lock_ent lockinfo;\n--- ./plugins/kdb/db2/db2_exp.c\t2017-03-03 03:36:02.000000000 +0530\n+++ ../db2_exp.c\t2017-04-02 09:51:07.528042151 +0530\n@@ -38,7 +38,7 @@\n #include <unistd.h>\n #endif\n \n-#include <db.h>\n+#include <db_185.h>\n #include <stdio.h>\n #include <errno.h>\n #include <utime.h>\n--- ./plugins/kdb/db2/kdb_db2.c\t2017-03-03 03:36:02.000000000 +0530\n+++ ../kdb_db2.c\t2017-04-02 09:52:14.924568844 +0530\n@@ -57,7 +57,7 @@\n #include <unistd.h>\n #endif\n \n-#include <db.h>\n+#include <db_185.h>\n #include <stdio.h>\n #include <errno.h>\n #include <utime.h>\n"
  },
  {
    "path": "packages/krb5/sethostent.patch",
    "content": "--- ./tests/resolve/resolve.c\t2016-12-02 04:01:25.000000000 +0530\n+++ ../resolve.c\t2016-12-07 11:10:38.473122715 +0530\n@@ -111,7 +111,7 @@\n \n \n     /* Set the hosts db to close each time - effectively rewinding file */\n-    sethostent(0);\n+    /* sethostent(0); */\n \n     if((host = gethostbyname (myname)) == NULL) {\n         fprintf(stderr,\n"
  },
  {
    "path": "packages/kubectl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://kubernetes.io\nTERMUX_PKG_DESCRIPTION=\"Kubernetes.io client binary\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.16.3\nTERMUX_PKG_SRCURL=https://dl.k8s.io/v$TERMUX_PKG_VERSION/kubernetes-src.tar.gz\nTERMUX_PKG_SHA256=d176b9d8f641be5b4cd2c62be86cb6a0baa7e52c224f02ef12cab1f39b57ecec\n\ntermux_step_extract_package() {\n\tmkdir -p \"$TERMUX_PKG_CACHEDIR\"\n\tmkdir -p \"$TERMUX_PKG_SRCDIR\"\n\n\ttermux_download \"$TERMUX_PKG_SRCURL\" \"$TERMUX_PKG_CACHEDIR\"/kubernetes-src.tar.gz \\\n\t\t\"$TERMUX_PKG_SHA256\"\n\n\ttar xf \"$TERMUX_PKG_CACHEDIR\"/kubernetes-src.tar.gz \\\n\t\t-C \"$TERMUX_PKG_SRCDIR\"\n}\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\t# Needed to generate manpages.\n\t#(\n\t#\texport GOPATH=\"$TERMUX_PKG_BUILDDIR/host\"\n\t#\tunset GOOS GOARCH CGO_LDFLAGS\n\t#\tunset CC CXX CFLAGS CXXFLAGS LDFLAGS\n\t#\tcd \"$TERMUX_PKG_SRCDIR\"\n\t#\t./hack/update-generated-docs.sh\n\t#)\n\n\texport GOPATH=\"$TERMUX_PKG_BUILDDIR/target\"\n\t#chmod +w \"$TERMUX_PKG_SRCDIR\"/_output\n\t#rm -rf \"$TERMUX_PKG_SRCDIR\"/_output\n\n\tcd \"$TERMUX_PKG_SRCDIR\"/cmd/kubectl\n\tgo build .\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \"$TERMUX_PKG_SRCDIR\"/cmd/kubectl/kubectl \\\n\t\t\"$TERMUX_PREFIX\"/bin/kubectl\n\n\t#mkdir -p \"$TERMUX_PREFIX\"/share/man/man1\n\t#cp -f \"$TERMUX_PKG_SRCDIR\"/docs/man/man1/kubectl-*.1 \\\n\t#\t\"$TERMUX_PREFIX\"/share/man/man1/\n}\n"
  },
  {
    "path": "packages/ldc/build.sh",
    "content": "LLVM_INSTALL_DIR=$TERMUX_PKG_BUILDDIR/llvm-install\n\nTERMUX_PKG_HOMEPAGE=https://github.com/ldc-developers/ldc\nTERMUX_PKG_DESCRIPTION=\"D programming language compiler, built with LLVM\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=()\nTERMUX_PKG_VERSION+=(1.18.0)\nTERMUX_PKG_VERSION+=(9.0.0)   # LLVM version\nTERMUX_PKG_VERSION+=(2.088.1) # TOOLS version\nTERMUX_PKG_VERSION+=(8ffc09ed6fb9625837161ffbbda2d926f490196c)  # DUB version\nTERMUX_PKG_REVISION=5\n\nTERMUX_PKG_SRCURL=(https://github.com/ldc-developers/ldc/releases/download/v${TERMUX_PKG_VERSION}/ldc-${TERMUX_PKG_VERSION}-src.tar.gz\n\t\t   https://github.com/ldc-developers/llvm/releases/download/ldc-v${TERMUX_PKG_VERSION[1]}/llvm-${TERMUX_PKG_VERSION[1]}.src.tar.xz\n\t\t   https://github.com/dlang/tools/archive/v${TERMUX_PKG_VERSION[2]}.tar.gz\n\t\t   https://github.com/dlang/dub/archive/${TERMUX_PKG_VERSION[3]}.tar.gz\n\t\t   https://github.com/ldc-developers/ldc/releases/download/v${TERMUX_PKG_VERSION}/ldc2-${TERMUX_PKG_VERSION}-linux-x86_64.tar.xz)\nTERMUX_PKG_SHA256=(aa6b491a4d756942c471778724dbdc7e96026eba4d55720cd66574b9ce42155d\n\t\t   0d8d5ebde82843f9b9829494a210c09315c6866c9f8b5df78be35d44943bb1f0\n\t\t   e2eb1afe24985096554c971059916bfad1573b85786529c0394009c8db967139\n\t\t   e11c4b171c0d26f4d85216aabb1e03d289a5551eda4e2c1bd7b70cf2ca57fd6a\n\t\t   04ba1573fb9c728d555340249b8d54cf7d34d249ea185a240be7ab341c764cf5)\nTERMUX_PKG_DEPENDS=\"clang, libc++, zlib\"\nTERMUX_PKG_NO_STATICSPLIT=true\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_FORCE_CMAKE=true\n#These CMake args are only used to configure a patched LLVM\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DLLVM_ENABLE_PIC=ON\n-DLLVM_ENABLE_PLUGINS=OFF\n-DLLVM_BUILD_TOOLS=OFF\n-DLLVM_BUILD_UTILS=OFF\n-DCOMPILER_RT_INCLUDE_TESTS=OFF\n-DLLVM_INCLUDE_TESTS=OFF\n-DLLVM_ENABLE_TERMINFO=OFF\n-DLLVM_ENABLE_LIBEDIT=OFF\n-DLLVM_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-tblgen\n-DLLVM_CONFIG_PATH=$TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-config\n-DPYTHON_EXECUTABLE=$(which python3)\n-DLLVM_TARGETS_TO_BUILD='AArch64;ARM;WebAssembly;X86'\n-DCMAKE_INSTALL_PREFIX=$LLVM_INSTALL_DIR\n\"\n\ntermux_step_post_extract_package() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tmv llvm-${TERMUX_PKG_VERSION[1]}.src llvm\n\tmv tools-${TERMUX_PKG_VERSION[2]} dlang-tools\n\tmv dub-${TERMUX_PKG_VERSION[3]} dub\n\n\tLLVM_TRIPLE=${TERMUX_HOST_PLATFORM/-/--}\n\tif [ $TERMUX_ARCH = arm ]; then LLVM_TRIPLE=${LLVM_TRIPLE/arm-/armv7a-}; fi\n}\n\ntermux_step_host_build() {\n\ttermux_setup_cmake\n\ttermux_setup_ninja\n\n\t# Build native llvm-tblgen, a prerequisite for cross-compiling LLVM\n\tcmake -GNinja $TERMUX_PKG_SRCDIR/llvm \\\n\t\t-DCMAKE_BUILD_TYPE=Release \\\n\t\t-DLLVM_BUILD_TOOLS=OFF \\\n\t\t-DLLVM_BUILD_UTILS=OFF \\\n\t\t-DCOMPILER_RT_INCLUDE_TESTS=OFF \\\n\t\t-DLLVM_INCLUDE_TESTS=OFF\n\tninja -j $TERMUX_MAKE_PROCESSES llvm-tblgen\n}\n\n# Just before CMake invokation for LLVM:\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -lc++_shared\"\n\n\tlocal LLVM_TARGET_ARCH\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tLLVM_TARGET_ARCH=ARM\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\tLLVM_TARGET_ARCH=AArch64\n\t\t# LLVM 8.0.1's libclang_rt.hwasan-*-android.so fails to link for AArch64 and x86_64\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DCOMPILER_RT_BUILD_SANITIZERS=OFF\"\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tLLVM_TARGET_ARCH=X86\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\tLLVM_TARGET_ARCH=X86\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DCOMPILER_RT_BUILD_SANITIZERS=OFF\"\n\telse\n\t\ttermux_error_exit \"Invalid arch: $TERMUX_ARCH\"\n\tfi\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TRIPLE}\"\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DLLVM_TARGET_ARCH=${LLVM_TARGET_ARCH}\"\n\n\t# CPPFLAGS adds the system llvm to the include path, which causes\n\t# conflicts with the local patched llvm when compiling ldc\n\tCPPFLAGS=\"\"\n\n\tOLD_TERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR\n\tTERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/llvm\n\n\tOLD_TERMUX_PKG_BUILDDIR=$TERMUX_PKG_BUILDDIR\n\tTERMUX_PKG_BUILDDIR=$TERMUX_PKG_BUILDDIR/llvm\n\tmkdir \"$TERMUX_PKG_BUILDDIR\"\n}\n\n# CMake for LLVM has been run:\ntermux_step_post_configure() {\n\t# Cross-compile & install LLVM\n\tcd \"$TERMUX_PKG_BUILDDIR\"\n\tif test -f build.ninja; then\n\t\tninja -j $TERMUX_MAKE_PROCESSES install\n\tfi\n\n\t# Invoke CMake for LDC:\n\n\tTERMUX_PKG_SRCDIR=$OLD_TERMUX_PKG_SRCDIR\n\tTERMUX_PKG_BUILDDIR=$OLD_TERMUX_PKG_BUILDDIR\n\tcd \"$TERMUX_PKG_BUILDDIR\"\n\n\t# Replace non-native llvm-config executable with bash script,\n\t# as it is going to be invoked during LDC CMake config.\n\tsed $TERMUX_PKG_SRCDIR/.azure-pipelines/android-llvm-config.in \\\n\t\t-e \"s|@LLVM_VERSION@|${TERMUX_PKG_VERSION[1]}|g\" \\\n\t\t-e \"s|@LLVM_INSTALL_DIR@|$LLVM_INSTALL_DIR|g\" \\\n\t\t-e \"s|@TERMUX_PKG_SRCDIR@|$TERMUX_PKG_SRCDIR/llvm|g\" \\\n\t\t-e \"s|@LLVM_DEFAULT_TARGET_TRIPLE@|$LLVM_TRIPLE|g\" \\\n\t\t-e \"s|@LLVM_TARGETS@|AArch64 ARM X86 WebAssembly|g\" > $LLVM_INSTALL_DIR/bin/llvm-config\n\tchmod 755 $LLVM_INSTALL_DIR/bin/llvm-config\n\n\tLDC_FLAGS=\"-mtriple=$LLVM_TRIPLE\"\n\tif [ $TERMUX_ARCH = arm ]; then LDC_FLAGS=\"$LDC_FLAGS;-mcpu=cortex-a8\"; fi\n\n\tLDC_PATH=$TERMUX_PKG_SRCDIR/ldc2-$TERMUX_PKG_VERSION-linux-x86_64\n\tDMD=$LDC_PATH/bin/ldmd2\n\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\" -DLLVM_ROOT_DIR=$LLVM_INSTALL_DIR \\\n\t\t-DD_COMPILER=$DMD \\\n\t\t-DCMAKE_INSTALL_PREFIX=$TERMUX_PREFIX \\\n\t\t-DLDC_WITH_LLD=OFF \\\n\t\t-DD_LINKER_ARGS='-fuse-ld=bfd;-Lldc-build-runtime.tmp/lib;-lphobos2-ldc;-ldruntime-ldc;-Wl,--gc-sections'\"\n\n\ttermux_step_configure_cmake\n}\n\ntermux_step_make() {\n\t# Cross-compile the runtime libraries\n\t$LDC_PATH/bin/ldc-build-runtime --ninja -j $TERMUX_MAKE_PROCESSES \\\n\t\t--dFlags=\"$LDC_FLAGS\" --cFlags=\"$CFLAGS -I$TERMUX_PREFIX/include\" \\\n\t\t--targetSystem=\"Android;Linux;UNIX\" --ldcSrcDir=\"$TERMUX_PKG_SRCDIR\"\n\n\t# Set up host ldmd2 for cross-compilation\n\texport DFLAGS=\"${LDC_FLAGS//;/ }\"\n\n\t# Cross-compile LDC executables (linked against runtime libs above)\n\tif test -f build.ninja; then\n\t\tninja -j $TERMUX_MAKE_PROCESSES ldc2 ldmd2 ldc-build-runtime ldc-profdata ldc-prune-cache\n\tfi\n\n\t# Cross-compile dlang tools and dub:\n\n\t# Set up host ldmd2 for cross-compilation & -linking\n\texport DFLAGS=\"$DFLAGS -linker=bfd -L-L$TERMUX_PKG_BUILDDIR/ldc-build-runtime.tmp/lib -Xcc=-pie -L-z -Lnocopyreloc\"\n\tif [ $TERMUX_ARCH = arm ]; then export DFLAGS=\"$DFLAGS -L--fix-cortex-a8\"; fi\n\n\tcd  $TERMUX_PKG_SRCDIR/dlang-tools\n\t$DMD -w -de rdmd.d -of=$TERMUX_PKG_BUILDDIR/bin/rdmd\n\t$DMD -w -de ddemangle.d -of=$TERMUX_PKG_BUILDDIR/bin/ddemangle\n\t$DMD -w -de DustMite/dustmite.d DustMite/splitter.d -of=$TERMUX_PKG_BUILDDIR/bin/dustmite\n\n\tcd $TERMUX_PKG_SRCDIR/dub\n\t$DMD -O -w -version=DubUseCurl -version=DubApplication -Isource @build-files.txt -of=$TERMUX_PKG_BUILDDIR/bin/dub\n}\n\ntermux_step_make_install() {\n\tcp bin/{ddemangle,dub,dustmite,ldc-build-runtime,ldc-profdata,ldc-prune-cache,ldc2,ldmd2,rdmd} $TERMUX_PREFIX/bin\n\tcp $TERMUX_PKG_BUILDDIR/ldc-build-runtime.tmp/lib/*.a $TERMUX_PREFIX/lib\n\tsed \"s|$TERMUX_PREFIX/|%%ldcbinarypath%%/../|g\" bin/ldc2_install.conf > $TERMUX_PREFIX/etc/ldc2.conf\n\tcat $TERMUX_PREFIX/etc/ldc2.conf\n\n\trm -Rf $TERMUX_PREFIX/include/d\n\tmkdir $TERMUX_PREFIX/include/d\n\tcp -r $TERMUX_PKG_SRCDIR/runtime/druntime/src/{core,etc,ldc,object.d} $TERMUX_PREFIX/include/d\n\tcp $LDC_PATH/import/ldc/gccbuiltins_{aarch64,arm,x86}.di $TERMUX_PREFIX/include/d/ldc\n\tcp -r $TERMUX_PKG_SRCDIR/runtime/phobos/etc/c $TERMUX_PREFIX/include/d/etc\n\trm -Rf $TERMUX_PREFIX/include/d/etc/c/zlib\n\tcp -r $TERMUX_PKG_SRCDIR/runtime/phobos/std $TERMUX_PREFIX/include/d\n\n\trm -Rf $TERMUX_PREFIX/share/ldc\n\tmkdir $TERMUX_PREFIX/share/ldc\n\tcp -r $TERMUX_PKG_SRCDIR/{LICENSE,README,packaging/bash_completion.d} $TERMUX_PREFIX/share/ldc\n}\n"
  },
  {
    "path": "packages/ldc/ldc-readme.patch",
    "content": "diff --git a/README b/README\nnew file mode 100644\nindex 00000000..cd578cb7\n--- /dev/null\n+++ b/README\n@@ -0,0 +1,18 @@\n+This is LDC, the LLVM-based D compiler.  It will natively\n+compile D on Android devices.\n+\n+The compiler configuration file is etc/ldc2.conf, and by\n+default only include/d is on the module search path.\n+\n+To develop for Android, you will find the D headers and\n+sample apps at this github repository useful:\n+\n+https://github.com/joakim-noah/android\n+\n+You can find instructions on building Android apps at the\n+D wiki:\n+\n+http://wiki.dlang.org/Build_D_for_Android\n+\n+For further information, including how to report bugs,\n+please refer to the LDC wiki: http://wiki.dlang.org/LDC.\n"
  },
  {
    "path": "packages/ldc/ldc-x64-sprintf.patch",
    "content": "diff --git a/dmd/dmangle.d b/dmd/dmangle.d\nindex 8e2fc5b6f..7de4a02de 100644\n--- a/dmd/dmangle.d\n+++ b/dmd/dmangle.d\n@@ -926,7 +926,10 @@ public:\n \n         char[36] buffer = void;\n         // 'A' format yields [-]0xh.hhhhp+-d\n-        const n = CTFloat.sprint(buffer.ptr, 'A', value);\n+        // sprintf/printf with hex formatting is broken for certain long\n+        // doubles on Android/x64, so use decimal format instead.\n+        char fmt = global.params.isAndroidX86_64 ? 'g' : 'A';\n+        const n = CTFloat.sprint(buffer.ptr, fmt, value);\n         assert(n < buffer.length);\n         foreach (const c; buffer[2 .. n])\n         {\ndiff --git a/dmd/globals.d b/dmd/globals.d\nindex 8589b6cf2..5dae07256 100644\n--- a/dmd/globals.d\n+++ b/dmd/globals.d\n@@ -139,6 +139,7 @@ struct Param\n     bool is64bit = (size_t.sizeof == 8);  // generate 64 bit code; true by default for 64 bit dmd\n     bool isLP64;            // generate code for LP64\n     bool isLinux;           // generate code for linux\n+    bool isAndroidX86_64;   // generate code for Android x86_64\n     bool isOSX;             // generate code for Mac OSX\n     bool isWindows;         // generate code for Windows\n     bool isFreeBSD;         // generate code for FreeBSD\ndiff --git a/dmd/globals.h b/dmd/globals.h\nindex 098116f4d..57429400c 100644\n--- a/dmd/globals.h\n+++ b/dmd/globals.h\n@@ -119,6 +119,7 @@ struct Param\n     bool is64bit;       // generate 64 bit code\n     bool isLP64;        // generate code for LP64\n     bool isLinux;       // generate code for linux\n+    bool isAndroidX86_64;  // generate code for Android x86_64\n     bool isOSX;         // generate code for Mac OSX\n     bool isWindows;     // generate code for Windows\n     bool isFreeBSD;     // generate code for FreeBSD\ndiff --git a/driver/main.cpp b/driver/main.cpp\nindex c8c7ec2c5..18b581759 100644\n--- a/driver/main.cpp\n+++ b/driver/main.cpp\n@@ -1000,6 +1000,9 @@ int cppmain() {\n     llvm::Triple *triple = new llvm::Triple(gTargetMachine->getTargetTriple());\n     global.params.targetTriple = triple;\n     global.params.isLinux = triple->isOSLinux();\n+    global.params.isAndroidX86_64 =\n+        triple->getEnvironment() == llvm::Triple::Android &&\n+        triple->getArch() == llvm::Triple::x86_64;\n     global.params.isOSX = triple->isOSDarwin();\n     global.params.isWindows = triple->isOSWindows();\n     global.params.isFreeBSD = triple->isOSFreeBSD();\n"
  },
  {
    "path": "packages/ldc/tests/hello_world.sh",
    "content": "ldc2 --version\nldmd2 --version\ndub --version\n\necho 'void main() { import std.stdio; writefln(\"Hello world, %d bits\", size_t.sizeof * 8); }' > hello.d\nldc2 hello.d\n./hello\nrm hello.{d,o} hello\n"
  },
  {
    "path": "packages/ldns/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.nlnetlabs.nl/projects/ldns/\nTERMUX_PKG_DESCRIPTION=\"Library for simplifying DNS programming and supporting recent and experimental RFCs\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.7.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://www.nlnetlabs.nl/downloads/ldns/ldns-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=8ac84c16bdca60e710eea75782356f3ac3b55680d40e1530d7cea474ac208229\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BREAKS=\"ldns-dev\"\nTERMUX_PKG_REPLACES=\"ldns-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-ssl=$TERMUX_PREFIX\n--disable-gost\n\"\n\ntermux_step_post_make_install() {\n\t# The ldns build doesn't install its pkg-config:\n\tmkdir -p $TERMUX_PREFIX/lib/pkgconfig\n\tcp packaging/libldns.pc $TERMUX_PREFIX/lib/pkgconfig/libldns.pc\n}\n"
  },
  {
    "path": "packages/ldns/fix-hardcoded-paths.patch",
    "content": "diff -uNr ldns-1.7.0/ldns/resolver.h ldns-1.7.0.mod/ldns/resolver.h\n--- ldns-1.7.0/ldns/resolver.h\t2016-12-20 12:48:22.000000000 +0200\n+++ ldns-1.7.0.mod/ldns/resolver.h\t2017-10-04 16:27:10.112448953 +0300\n@@ -33,9 +33,9 @@\n #endif\n \n /** Default location of the resolv.conf file */\n-#define LDNS_RESOLV_CONF\t\"/etc/resolv.conf\"\n+#define LDNS_RESOLV_CONF\t\"@TERMUX_PREFIX@/etc/resolv.conf\"\n /** Default location of the hosts file */\n-#define LDNS_RESOLV_HOSTS\t\"/etc/hosts\"\n+#define LDNS_RESOLV_HOSTS\t\"@TERMUX_PREFIX@/etc/hosts\"\n \n #define LDNS_RESOLV_KEYWORD     -1\n #define LDNS_RESOLV_DEFDOMAIN\t0\ndiff -uNr ldns-1.7.0/resolver.c ldns-1.7.0.mod/resolver.c\n--- ldns-1.7.0/resolver.c\t2016-12-20 12:48:22.000000000 +0200\n+++ ldns-1.7.0.mod/resolver.c\t2017-10-04 16:28:34.203407382 +0300\n@@ -780,7 +780,7 @@\n         if(!line_nr) line_nr = &lnr;\n \n \tif(!fp) {\n-\t\tmyfp = fopen(\"/etc/resolv.conf\", \"r\");\n+\t\tmyfp = fopen(\"@TERMUX_PREFIX@/etc/resolv.conf\", \"r\");\n \t\tif(!myfp)\n \t\t\treturn LDNS_STATUS_FILE_ERR;\n \t}\n"
  },
  {
    "path": "packages/ldns/keys.c.patch",
    "content": "diff -u -r ../ldns-1.7.0/keys.c ./keys.c\n--- ../ldns-1.7.0/keys.c\t2016-12-20 10:48:22.000000000 +0000\n+++ ./keys.c\t2018-08-23 17:05:00.759800098 +0000\n@@ -107,7 +107,7 @@\n \n \tk = ldns_key_new();\n         if(!k) return LDNS_STATUS_MEM_ERR;\n-#ifndef S_SPLINT_S\n+#if !defined(S_SPLINT_S) && !defined(OPENSSL_NO_ENGINE)\n \tk->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL);\n         if(!k->_key.key) {\n                 ldns_key_free(k);\n"
  },
  {
    "path": "packages/ledger/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.ledger-cli.org\nTERMUX_PKG_DESCRIPTION=\"Powerful, double-entry accounting system\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=3.1.3\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/ledger/ledger/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b248c91d65c7a101b9d6226025f2b4bf3dabe94c0c49ab6d51ce84a22a39622b\nTERMUX_PKG_DEPENDS=\"boost, libc++, libedit, libmpfr, libgmp\"\nTERMUX_PKG_BREAKS=\"ledger-dev\"\nTERMUX_PKG_REPLACES=\"ledger-dev\"\nTERMUX_PKG_BUILD_DEPENDS=\"utf8cpp\"\n# See https://gitlab.kitware.com/cmake/cmake/issues/18865:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DBoost_NO_BOOST_CMAKE=ON\"\n"
  },
  {
    "path": "packages/leptonica/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.leptonica.com/\nTERMUX_PKG_DESCRIPTION=\"Library for image processing and image analysis\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=1.78.0\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=f8ac4d93cc76b524c2c81d27850bfc342e68b91368aa7a1f7d69e34ce13adbb4\nTERMUX_PKG_SRCURL=https://github.com/DanBloomberg/leptonica/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libjpeg-turbo, libpng, libtiff, zlib\"\nTERMUX_PKG_BREAKS=\"leptonica-dev\"\nTERMUX_PKG_REPLACES=\"leptonica-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-giflib --without-libwebp --without-libopenjpeg\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/leptonica/silence-tmpfile-warnings.patch",
    "content": "diff -u -r ../leptonica-1.74.1/src/boxbasic.c ./src/boxbasic.c\n--- ../leptonica-1.74.1/src/boxbasic.c\t2016-12-02 20:42:49.000000000 +0100\n+++ ./src/boxbasic.c\t2017-01-29 22:11:16.276072146 +0100\n@@ -2066,7 +2066,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = boxaaWriteStream(fp, baa);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n@@ -2287,7 +2286,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = boxaWriteStream(fp, boxa);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/colormap.c ./src/colormap.c\n--- ../leptonica-1.74.1/src/colormap.c\t2016-12-02 20:42:53.000000000 +0100\n+++ ./src/colormap.c\t2017-01-29 22:11:16.316071650 +0100\n@@ -1715,7 +1715,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixcmapWriteStream(fp, cmap);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/dewarp1.c ./src/dewarp1.c\n--- ../leptonica-1.74.1/src/dewarp1.c\t2016-12-02 20:42:57.000000000 +0100\n+++ ./src/dewarp1.c\t2017-01-29 22:11:16.352071204 +0100\n@@ -1401,7 +1401,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = dewarpWriteStream(fp, dew);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n@@ -1673,7 +1672,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = dewarpaWriteStream(fp, dewa);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/fpix1.c ./src/fpix1.c\n--- ../leptonica-1.74.1/src/fpix1.c\t2016-12-02 20:43:01.000000000 +0100\n+++ ./src/fpix1.c\t2017-01-29 22:11:16.400070608 +0100\n@@ -1904,7 +1904,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = fpixWriteStream(fp, fpix);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n@@ -2203,7 +2202,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = dpixWriteStream(fp, dpix);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/jp2kio.c ./src/jp2kio.c\n--- ../leptonica-1.74.1/src/jp2kio.c\t2016-12-02 20:43:11.000000000 +0100\n+++ ./src/jp2kio.c\t2017-01-29 22:11:16.424070311 +0100\n@@ -847,7 +847,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixWriteStreamJp2k(fp, pix, quality, nlevels, hint, debug);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/jpegio.c ./src/jpegio.c\n--- ../leptonica-1.74.1/src/jpegio.c\t2016-12-02 20:43:18.000000000 +0100\n+++ ./src/jpegio.c\t2017-01-29 22:11:16.428070261 +0100\n@@ -1091,7 +1091,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixWriteStreamJpeg(fp, pix, quality, progressive);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/numabasic.c ./src/numabasic.c\n--- ../leptonica-1.74.1/src/numabasic.c\t2016-12-02 20:43:25.000000000 +0100\n+++ ./src/numabasic.c\t2017-01-29 22:11:16.444070062 +0100\n@@ -1276,7 +1276,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = numaWriteStream(fp, na);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n@@ -1962,7 +1961,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = numaaWriteStream(fp, naa);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/pixabasic.c ./src/pixabasic.c\n--- ../leptonica-1.74.1/src/pixabasic.c\t2016-12-02 20:43:29.000000000 +0100\n+++ ./src/pixabasic.c\t2017-01-29 22:11:16.488069517 +0100\n@@ -2626,7 +2626,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixaWriteStream(fp, pixa);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n@@ -2998,7 +2997,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixaaWriteStream(fp, paa);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/pixcomp.c ./src/pixcomp.c\n--- ../leptonica-1.74.1/src/pixcomp.c\t2016-12-02 20:43:33.000000000 +0100\n+++ ./src/pixcomp.c\t2017-01-29 22:11:16.500069368 +0100\n@@ -1841,7 +1841,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixacompWriteStream(fp, pixac);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/pnmio.c ./src/pnmio.c\n--- ../leptonica-1.74.1/src/pnmio.c\t2016-12-27 19:30:34.000000000 +0100\n+++ ./src/pnmio.c\t2017-01-29 22:11:16.512069219 +0100\n@@ -1179,7 +1179,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixWriteStreamPnm(fp, pix);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n@@ -1234,7 +1233,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = pixWriteStreamPam(fp, pix);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/ptabasic.c ./src/ptabasic.c\n--- ../leptonica-1.74.1/src/ptabasic.c\t2016-12-02 20:43:49.000000000 +0100\n+++ ./src/ptabasic.c\t2017-01-29 22:11:16.520069120 +0100\n@@ -871,7 +871,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = ptaWriteStream(fp, pta, type);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n@@ -1463,7 +1462,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = ptaaWriteStream(fp, ptaa, type);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/sarray1.c ./src/sarray1.c\n--- ../leptonica-1.74.1/src/sarray1.c\t2016-12-21 21:11:34.000000000 +0100\n+++ ./src/sarray1.c\t2017-01-29 22:11:16.552068723 +0100\n@@ -1567,7 +1567,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = sarrayWriteStream(fp, sa);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\ndiff -u -r ../leptonica-1.74.1/src/utils2.c ./src/utils2.c\n--- ../leptonica-1.74.1/src/utils2.c\t2016-12-21 21:11:53.000000000 +0100\n+++ ./src/utils2.c\t2017-01-29 22:11:16.584068326 +0100\n@@ -1635,7 +1635,6 @@\n     if ((fp = fmemopen((void *)data, size, \"rb\")) == NULL)\n         return (FILE *)ERROR_PTR(\"stream not opened\", procName, NULL);\n #else  /* write to tmp file */\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return (FILE *)ERROR_PTR(\"tmpfile stream not opened\", procName, NULL);\n"
  },
  {
    "path": "packages/leptonica/src-recogbasic.c.patch",
    "content": "diff -u -r ../leptonica-1.74.2/src/recogbasic.c ./src/recogbasic.c\n--- ../leptonica-1.74.2/src/recogbasic.c\t2017-05-20 03:30:27.000000000 +0200\n+++ ./src/recogbasic.c\t2017-06-07 01:17:15.994340419 +0200\n@@ -1065,7 +1065,6 @@\n         return ERROR_INT(\"stream not opened\", procName, 1);\n     ret = recogWriteStream(fp, recog);\n #else\n-    L_INFO(\"work-around: writing to a temp file\\n\", procName);\n   #ifdef _WIN32\n     if ((fp = fopenWriteWinTempfile()) == NULL)\n         return ERROR_INT(\"tmpfile stream not opened\", procName, 1);\n"
  },
  {
    "path": "packages/less/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.greenwoodsoftware.com/less/\nTERMUX_PKG_DESCRIPTION=\"Terminal pager program used to view the contents of a text file one screen at a time\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=551\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://www.greenwoodsoftware.com/less/less-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=ff165275859381a63f19135a8f1f6c5a194d53ec3187f94121ecd8ef0795fe3d\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_ESSENTIAL=true\n"
  },
  {
    "path": "packages/less/configure.patch",
    "content": "diff -u -r ../less-487/configure ./configure\n--- ../less-487/configure\t2016-10-25 14:37:42.000000000 +0000\n+++ ./configure\t2017-07-07 08:39:29.875341117 +0000\n@@ -4077,6 +4077,7 @@\n     LIBS=\"$LIBS $TERMLIBS\"\n     cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n /* end confdefs.h.  */\n+#include <termcap.h>\n \n int\n main ()\n"
  },
  {
    "path": "packages/less/less_multilib.patch",
    "content": "Index: SOURCES/less-multilib.patch\ndiff -u /dev/null SOURCES/less-multilib.patch:1.1\n--- /dev/null\tFri Mar  2 18:37:48 2007\n+++ less-multilib.patch\tFri Mar  2 18:37:43 2007\n@@ -0,0 +1,19 @@\n+--- less-394/Makefile.in.orig\t2007-03-02 17:40:55.000000000 +0100\n++++ less-394/Makefile.in\t2007-03-02 17:41:38.000000000 +0100\n+@@ -51,13 +51,13 @@\n+ all: less lesskey lessecho\n+ \n+ less: ${OBJ}\n+-\t${CC} ${LDFLAGS} -o $@ ${OBJ} ${LIBS}\n++\t${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJ} ${LIBS}\n+ \n+ lesskey: lesskey.${O} version.${O}\n+-\t${CC} ${LDFLAGS} -o $@ lesskey.${O} version.${O}\n++\t${CC} ${CFLAGS} ${LDFLAGS} -o $@ lesskey.${O} version.${O}\n+ \n+ lessecho: lessecho.${O} version.${O}\n+-\t${CC} ${LDFLAGS} -o $@ lessecho.${O} version.${O}\n++\t${CC} ${CFLAGS} ${LDFLAGS} -o $@ lessecho.${O} version.${O}\n+ \n+ ${OBJ}: ${srcdir}/less.h ${srcdir}/funcs.h defines.h \n+ \n\n"
  },
  {
    "path": "packages/leveldb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/leveldb\nTERMUX_PKG_DESCRIPTION=\"Fast key-value storage library\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.22\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/google/leveldb/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=55423cac9e3306f4a9502c738a001e4a339d1a38ffbee7572d4a07d5d63949b2\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"leveldb-dev\"\nTERMUX_PKG_REPLACES=\"leveldb-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DBUILD_SHARED_LIBS=TRUE\"\n"
  },
  {
    "path": "packages/lftp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://lftp.tech/\nTERMUX_PKG_DESCRIPTION=\"FTP/HTTP client and file transfer program\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=4.8.4\nTERMUX_PKG_REVISION=9\nTERMUX_PKG_SRCURL=https://lftp.tech/ftp/lftp-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=4ebc271e9e5cea84a683375a0f7e91086e5dac90c5d51bb3f169f75386107a62\nTERMUX_PKG_DEPENDS=\"libandroid-support, libc++, libexpat, libiconv, openssl, readline, libidn2, zlib\"\n\n# (1) Android has dn_expand, but lftp assumes that dn_skipname then exists, which it does not on android.\n# (2) Use --with-openssl to use openssl instead of gnutls.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_dn_expand=no\n--with-openssl\n--with-expat=$TERMUX_PREFIX\n--with-readline=$TERMUX_PREFIX\n--with-zlib=$TERMUX_PREFIX\n\"\n\ntermux_step_pre_configure() {\n\tif $TERMUX_DEBUG; then\n\t\t# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:\n\t\t# /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'\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n\n\tCXXFLAGS+=\" -DNO_INLINE_GETPASS=1\"\n}\n"
  },
  {
    "path": "packages/lftp/lftp_ssl.cc.patch",
    "content": "diff -uNr lftp-4.8.3/src/lftp_ssl.cc lftp-4.8.3.mod/src/lftp_ssl.cc\n--- lftp-4.8.3/src/lftp_ssl.cc\t2017-08-10 12:57:37.000000000 +0300\n+++ lftp-4.8.3.mod/src/lftp_ssl.cc\t2017-12-19 17:06:58.526580533 +0200\n@@ -214,6 +214,8 @@\n       \"/usr/local/ssl/certs/ca-bundle.crt\",\n       \"/etc/apache/ssl.crt/ca-bundle.crt\",\n       \"/usr/share/curl/curl-ca-bundle.crt\",\n+      \"@TERMUX_PREFIX@/etc/tls/cert.pem\",\n+      \"@TERMUX_PREFIX@/etc/tls/ca-bundle.crt\",\n       0};\n    for(int i=0; ca_file_location[i]; i++)\n    {\n"
  },
  {
    "path": "packages/lftp/lib-vasnprintf.c.patch",
    "content": "diff -uNr lftp-4.8.4/lib/vasnprintf.c lftp-4.8.4.mod/lib/vasnprintf.c\n--- lftp-4.8.4/lib/vasnprintf.c\t2018-07-31 14:04:57.000000000 +0300\n+++ lftp-4.8.4.mod/lib/vasnprintf.c\t2019-10-27 20:05:33.109405874 +0200\n@@ -4872,7 +4872,7 @@\n # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))        \\\n          && !defined __UCLIBC__)                                            \\\n         || (defined __APPLE__ && defined __MACH__)                          \\\n-        || (defined _WIN32 && ! defined __CYGWIN__))\n+        || (defined _WIN32 && ! defined __CYGWIN__) || defined(__ANDROID__))\n                 fbp[1] = '%';\n                 fbp[2] = 'n';\n                 fbp[3] = '\\0';\n"
  },
  {
    "path": "packages/lftp/src-Filter.cc.patch",
    "content": "diff -u -r ../lftp-4.8.0/src/Filter.cc ./src/Filter.cc\n--- ../lftp-4.8.0/src/Filter.cc\t2017-04-24 08:20:52.000000000 +0200\n+++ ./src/Filter.cc\t2017-08-20 22:06:59.423505183 +0200\n@@ -209,7 +209,7 @@\n       }\n       else\n       {\n-\t execl(\"/bin/sh\",\"sh\",\"-c\",name.get(),NULL);\n+\t execl(\"@TERMUX_PREFIX@/bin/sh\",\"sh\",\"-c\",name.get(),NULL);\n \t fprintf(stderr,_(\"execl(/bin/sh) failed: %s\\n\"),strerror(errno));\n       }\n       fflush(stderr);\n"
  },
  {
    "path": "packages/lftp/src-PtyShell.cc.patch",
    "content": "--- ../cache/lftp-4.8.0/src/PtyShell.cc\t2016-02-21 00:57:52.000000000 +1100\n+++ ./src/PtyShell.cc\t2017-07-21 14:33:14.130083766 +1000\n@@ -143,7 +143,7 @@\n       putenv((char*)\"LANGUAGE=C\");\n       if(a)\n \t execvp(a->a0(),a->GetVNonConst());\n-      execl(\"/bin/sh\",\"sh\",\"-c\",name.get(),NULL);\n+      execl(\"@TERMUX_PREFIX@/bin/sh\",\"sh\",\"-c\",name.get(),NULL);\n       fprintf(stderr,_(\"execl(/bin/sh) failed: %s\\n\"),strerror(errno));\n       fflush(stderr);\n       _exit(1);\n"
  },
  {
    "path": "packages/lftp/src-SysCmdJob.cc.patch",
    "content": "diff -u -r ../lftp-4.8.0/src/SysCmdJob.cc ./src/SysCmdJob.cc\n--- ../lftp-4.8.0/src/SysCmdJob.cc\t2013-03-19 14:02:12.000000000 +0100\n+++ ./src/SysCmdJob.cc\t2017-08-20 22:05:45.452393625 +0200\n@@ -54,7 +54,7 @@\n \n    const char *shell=getenv(\"SHELL\");\n    if(!shell)\n-      shell=\"/bin/sh\";\n+      shell=\"@TERMUX_PREFIX@/bin/sh\";\n \n    ProcWait::Signal(false);\n \n"
  },
  {
    "path": "packages/lftp/src-commands.cc.patch",
    "content": "diff -uNr lftp-4.8.3/src/commands.cc lftp-4.8.3.mod/src/commands.cc\n--- lftp-4.8.3/src/commands.cc\t2017-08-10 13:17:10.000000000 +0300\n+++ lftp-4.8.3.mod/src/commands.cc\t2017-12-19 16:59:50.095958249 +0200\n@@ -3006,7 +3006,7 @@\n \n       xstring cmd0(\"exec ${EDITOR:-vi} \");\n       cmd0.append(shell_encode(lftp_bookmarks.GetFilePath()));\n-      xstring cmd1(\"/bin/sh -c \");\n+      xstring cmd1(\"@TERMUX_PREFIX@/bin/sh -c \");\n       cmd1.append(shell_encode(cmd0));\n \n       parent->PrependCmd(xstring::get_tmp(\"shell \").append_quoted(cmd1));\n"
  },
  {
    "path": "packages/lhasa/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://fragglet.github.io/lhasa/\nTERMUX_PKG_DESCRIPTION=\"LHA compressor/decompressor\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.3.1\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://soulsphere.org/projects/lhasa/lhasa-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3fb08e5f85a9b9dd023922896be9157d5fb5c0448424681810aaa2b0558a5f24\nTERMUX_PKG_BREAKS=\"lhasa-dev\"\nTERMUX_PKG_REPLACES=\"lhasa-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/libandroid-glob/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://man7.org/linux/man-pages/man3/glob.3.html\nTERMUX_PKG_DESCRIPTION=\"Shared library for the glob(3) system function\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.6\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_BREAKS=\"libandroid-glob-dev\"\nTERMUX_PKG_REPLACES=\"libandroid-glob-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\t$CC $CFLAGS $CPPFLAGS -I$TERMUX_PKG_BUILDER_DIR -c $TERMUX_PKG_BUILDER_DIR/glob.c\n\t$CC $LDFLAGS -shared glob.o -o libandroid-glob.so\n\t$AR rcu libandroid-glob.a glob.o\n}\n\ntermux_step_make_install() {\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/glob.h $TERMUX_PREFIX/include/glob.h\n\tinstall -Dm600 libandroid-glob.a $TERMUX_PREFIX/lib/libandroid-glob.a\n\tinstall -Dm600 libandroid-glob.so $TERMUX_PREFIX/lib/libandroid-glob.so\n}\n"
  },
  {
    "path": "packages/libandroid-glob/glob.c",
    "content": "/*\n * Natanael Arndt, 2011: removed collate.h dependencies\n *  (my changes are trivial)\n *\n * Copyright (c) 1989, 1993\n *\tThe Regents of the University of California.  All rights reserved.\n *\n * This code is derived from software contributed to Berkeley by\n * Guido van Rossum.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 4. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#if defined(LIBC_SCCS) && !defined(lint)\nstatic char sccsid[] = \"@(#)glob.c\t8.3 (Berkeley) 10/13/93\";\n#endif /* LIBC_SCCS and not lint */\n#include <sys/cdefs.h>\n__FBSDID(\"$FreeBSD$\");\n\n/*\n * glob(3) -- a superset of the one defined in POSIX 1003.2.\n *\n * The [!...] convention to negate a range is supported (SysV, Posix, ksh).\n *\n * Optional extra services, controlled by flags not defined by POSIX:\n *\n * GLOB_QUOTE:\n *\tEscaping convention: \\ inhibits any special meaning the following\n *\tcharacter might have (except \\ at end of string is retained).\n * GLOB_MAGCHAR:\n *\tSet in gl_flags if pattern contained a globbing character.\n * GLOB_NOMAGIC:\n *\tSame as GLOB_NOCHECK, but it will only append pattern if it did\n *\tnot contain any magic characters.  [Used in csh style globbing]\n * GLOB_ALTDIRFUNC:\n *\tUse alternately specified directory access functions.\n * GLOB_TILDE:\n *\texpand ~user/foo to the /home/dir/of/user/foo\n * GLOB_BRACE:\n *\texpand {1,2}{a,b} to 1a 1b 2a 2b\n * gl_matchc:\n *\tNumber of matches in the current invocation of glob.\n */\n\n/*\n * Some notes on multibyte character support:\n * 1. Patterns with illegal byte sequences match nothing - even if\n *    GLOB_NOCHECK is specified.\n * 2. Illegal byte sequences in filenames are handled by treating them as\n *    single-byte characters with a value of the first byte of the sequence\n *    cast to wchar_t.\n * 3. State-dependent encodings are not currently supported.\n */\n\n#include <sys/param.h>\n#include <sys/stat.h>\n\n#include <ctype.h>\n#include <dirent.h>\n#include <errno.h>\n#include <glob.h>\n#include <limits.h>\n#include <pwd.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n#include <wchar.h>\n\n#define\tDOLLAR\t\t'$'\n#define\tDOT\t\t'.'\n#define\tEOS\t\t'\\0'\n#define\tLBRACKET\t'['\n#define\tNOT\t\t'!'\n#define\tQUESTION\t'?'\n#define\tQUOTE\t\t'\\\\'\n#define\tRANGE\t\t'-'\n#define\tRBRACKET\t']'\n#define\tSEP\t\t'/'\n#define\tSTAR\t\t'*'\n#define\tTILDE\t\t'~'\n#define\tUNDERSCORE\t'_'\n#define\tLBRACE\t\t'{'\n#define\tRBRACE\t\t'}'\n#define\tSLASH\t\t'/'\n#define\tCOMMA\t\t','\n\n#ifndef DEBUG\n\n#define\tM_QUOTE\t\t0x8000000000ULL\n#define\tM_PROTECT\t0x4000000000ULL\n#define\tM_MASK\t\t0xffffffffffULL\n#define\tM_CHAR\t\t0x00ffffffffULL\n\ntypedef uint_fast64_t Char;\n\n#else\n\n#define\tM_QUOTE\t\t0x80\n#define\tM_PROTECT\t0x40\n#define\tM_MASK\t\t0xff\n#define\tM_CHAR\t\t0x7f\n\ntypedef char Char;\n\n#endif\n\n\n#define\tCHAR(c)\t\t((Char)((c)&M_CHAR))\n#define\tMETA(c)\t\t((Char)((c)|M_QUOTE))\n#define\tM_ALL\t\tMETA('*')\n#define\tM_END\t\tMETA(']')\n#define\tM_NOT\t\tMETA('!')\n#define\tM_ONE\t\tMETA('?')\n#define\tM_RNG\t\tMETA('-')\n#define\tM_SET\t\tMETA('[')\n#define\tismeta(c)\t(((c)&M_QUOTE) != 0)\n\n\nstatic int\t compare(const void *, const void *);\nstatic int\t g_Ctoc(const Char *, char *, size_t);\nstatic int\t g_lstat(Char *, struct stat *, glob_t *);\nstatic DIR\t*g_opendir(Char *, glob_t *);\nstatic const Char *g_strchr(const Char *, wchar_t);\n#ifdef notdef\nstatic Char\t*g_strcat(Char *, const Char *);\n#endif\nstatic int\t g_stat(Char *, struct stat *, glob_t *);\nstatic int\t glob0(const Char *, glob_t *, size_t *);\nstatic int\t glob1(Char *, glob_t *, size_t *);\nstatic int\t glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *);\nstatic int\t glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *);\nstatic int\t globextend(const Char *, glob_t *, size_t *);\nstatic const Char *\t\n\t\t globtilde(const Char *, Char *, size_t, glob_t *);\nstatic int\t globexp1(const Char *, glob_t *, size_t *);\nstatic int\t globexp2(const Char *, const Char *, glob_t *, int *, size_t *);\nstatic int\t match(Char *, Char *, Char *);\n#ifdef DEBUG\nstatic void\t qprintf(const char *, Char *);\n#endif\n\nint\nglob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob)\n{\n\tconst char *patnext;\n\tsize_t limit;\n\tChar *bufnext, *bufend, patbuf[MAXPATHLEN], prot;\n\tmbstate_t mbs;\n\twchar_t wc;\n\tsize_t clen;\n\n\tpatnext = pattern;\n\tif (!(flags & GLOB_APPEND)) {\n\t\tpglob->gl_pathc = 0;\n\t\tpglob->gl_pathv = NULL;\n\t\tif (!(flags & GLOB_DOOFFS))\n\t\t\tpglob->gl_offs = 0;\n\t}\n\tif (flags & GLOB_LIMIT) {\n\t\tlimit = pglob->gl_matchc;\n\t\tif (limit == 0)\n\t\t\tlimit = sysconf(_SC_ARG_MAX);\n\t} else\n\t\tlimit = 0;\n\tpglob->gl_flags = flags & ~GLOB_MAGCHAR;\n\tpglob->gl_errfunc = errfunc;\n\tpglob->gl_matchc = 0;\n\n\tbufnext = patbuf;\n\tbufend = bufnext + MAXPATHLEN - 1;\n\tif (flags & GLOB_NOESCAPE) {\n\t\tmemset(&mbs, 0, sizeof(mbs));\n\t\twhile (bufend - bufnext >= MB_CUR_MAX) {\n\t\t\tclen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs);\n\t\t\tif (clen == (size_t)-1 || clen == (size_t)-2)\n\t\t\t\treturn (GLOB_NOMATCH);\n\t\t\telse if (clen == 0)\n\t\t\t\tbreak;\n\t\t\t*bufnext++ = wc;\n\t\t\tpatnext += clen;\n\t\t}\n\t} else {\n\t\t/* Protect the quoted characters. */\n\t\tmemset(&mbs, 0, sizeof(mbs));\n\t\twhile (bufend - bufnext >= MB_CUR_MAX) {\n\t\t\tif (*patnext == QUOTE) {\n\t\t\t\tif (*++patnext == EOS) {\n\t\t\t\t\t*bufnext++ = QUOTE | M_PROTECT;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tprot = M_PROTECT;\n\t\t\t} else\n\t\t\t\tprot = 0;\n\t\t\tclen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs);\n\t\t\tif (clen == (size_t)-1 || clen == (size_t)-2)\n\t\t\t\treturn (GLOB_NOMATCH);\n\t\t\telse if (clen == 0)\n\t\t\t\tbreak;\n\t\t\t*bufnext++ = wc | prot;\n\t\t\tpatnext += clen;\n\t\t}\n\t}\n\t*bufnext = EOS;\n\n\tif (flags & GLOB_BRACE)\n\t    return globexp1(patbuf, pglob, &limit);\n\telse\n\t    return glob0(patbuf, pglob, &limit);\n}\n\n/*\n * Expand recursively a glob {} pattern. When there is no more expansion\n * invoke the standard globbing routine to glob the rest of the magic\n * characters\n */\nstatic int\nglobexp1(const Char *pattern, glob_t *pglob, size_t *limit)\n{\n\tconst Char* ptr = pattern;\n\tint rv;\n\n\t/* Protect a single {}, for find(1), like csh */\n\tif (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)\n\t\treturn glob0(pattern, pglob, limit);\n\n\twhile ((ptr = g_strchr(ptr, LBRACE)) != NULL)\n\t\tif (!globexp2(ptr, pattern, pglob, &rv, limit))\n\t\t\treturn rv;\n\n\treturn glob0(pattern, pglob, limit);\n}\n\n\n/*\n * Recursive brace globbing helper. Tries to expand a single brace.\n * If it succeeds then it invokes globexp1 with the new pattern.\n * If it fails then it tries to glob the rest of the pattern and returns.\n */\nstatic int\nglobexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit)\n{\n\tint     i;\n\tChar   *lm, *ls;\n\tconst Char *pe, *pm, *pm1, *pl;\n\tChar    patbuf[MAXPATHLEN];\n\n\t/* copy part up to the brace */\n\tfor (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)\n\t\tcontinue;\n\t*lm = EOS;\n\tls = lm;\n\n\t/* Find the balanced brace */\n\tfor (i = 0, pe = ++ptr; *pe; pe++)\n\t\tif (*pe == LBRACKET) {\n\t\t\t/* Ignore everything between [] */\n\t\t\tfor (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++)\n\t\t\t\tcontinue;\n\t\t\tif (*pe == EOS) {\n\t\t\t\t/*\n\t\t\t\t * We could not find a matching RBRACKET.\n\t\t\t\t * Ignore and just look for RBRACE\n\t\t\t\t */\n\t\t\t\tpe = pm;\n\t\t\t}\n\t\t}\n\t\telse if (*pe == LBRACE)\n\t\t\ti++;\n\t\telse if (*pe == RBRACE) {\n\t\t\tif (i == 0)\n\t\t\t\tbreak;\n\t\t\ti--;\n\t\t}\n\n\t/* Non matching braces; just glob the pattern */\n\tif (i != 0 || *pe == EOS) {\n\t\t*rv = glob0(patbuf, pglob, limit);\n\t\treturn 0;\n\t}\n\n\tfor (i = 0, pl = pm = ptr; pm <= pe; pm++)\n\t\tswitch (*pm) {\n\t\tcase LBRACKET:\n\t\t\t/* Ignore everything between [] */\n\t\t\tfor (pm1 = pm++; *pm != RBRACKET && *pm != EOS; pm++)\n\t\t\t\tcontinue;\n\t\t\tif (*pm == EOS) {\n\t\t\t\t/*\n\t\t\t\t * We could not find a matching RBRACKET.\n\t\t\t\t * Ignore and just look for RBRACE\n\t\t\t\t */\n\t\t\t\tpm = pm1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase LBRACE:\n\t\t\ti++;\n\t\t\tbreak;\n\n\t\tcase RBRACE:\n\t\t\tif (i) {\n\t\t\t    i--;\n\t\t\t    break;\n\t\t\t}\n\t\t\t/* FALLTHROUGH */\n\t\tcase COMMA:\n\t\t\tif (i && *pm == COMMA)\n\t\t\t\tbreak;\n\t\t\telse {\n\t\t\t\t/* Append the current string */\n\t\t\t\tfor (lm = ls; (pl < pm); *lm++ = *pl++)\n\t\t\t\t\tcontinue;\n\t\t\t\t/*\n\t\t\t\t * Append the rest of the pattern after the\n\t\t\t\t * closing brace\n\t\t\t\t */\n\t\t\t\tfor (pl = pe + 1; (*lm++ = *pl++) != EOS;)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t/* Expand the current pattern */\n#ifdef DEBUG\n\t\t\t\tqprintf(\"globexp2:\", patbuf);\n#endif\n\t\t\t\t*rv = globexp1(patbuf, pglob, limit);\n\n\t\t\t\t/* move after the comma, to the next string */\n\t\t\t\tpl = pm + 1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t*rv = 0;\n\treturn 0;\n}\n\n\n\n/*\n * expand tilde from the passwd file.\n */\nstatic const Char *\nglobtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)\n{\n\tstruct passwd *pwd;\n\tchar *h;\n\tconst Char *p;\n\tChar *b, *eb;\n\n\tif (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))\n\t\treturn pattern;\n\n\t/* \n\t * Copy up to the end of the string or / \n\t */\n\teb = &patbuf[patbuf_len - 1];\n\tfor (p = pattern + 1, h = (char *) patbuf;\n\t    h < (char *)eb && *p && *p != SLASH; *h++ = *p++)\n\t\tcontinue;\n\n\t*h = EOS;\n\n\tif (((char *) patbuf)[0] == EOS) {\n\t\t/*\n\t\t * handle a plain ~ or ~/ by expanding $HOME first (iff\n\t\t * we're not running setuid or setgid) and then trying\n\t\t * the password file\n\t\t */\n\t\tif (\n#ifndef __ANDROID__\n\t\t     issetugid() != 0 ||\n#endif\n\t\t    (h = getenv(\"HOME\")) == NULL) {\n\t\t\tif (((h = getlogin()) != NULL &&\n\t\t\t     (pwd = getpwnam(h)) != NULL) ||\n\t\t\t    (pwd = getpwuid(getuid())) != NULL)\n\t\t\t\th = pwd->pw_dir;\n\t\t\telse\n\t\t\t\treturn pattern;\n\t\t}\n\t}\n\telse {\n\t\t/*\n\t\t * Expand a ~user\n\t\t */\n\t\tif ((pwd = getpwnam((char*) patbuf)) == NULL)\n\t\t\treturn pattern;\n\t\telse\n\t\t\th = pwd->pw_dir;\n\t}\n\n\t/* Copy the home directory */\n\tfor (b = patbuf; b < eb && *h; *b++ = *h++)\n\t\tcontinue;\n\n\t/* Append the rest of the pattern */\n\twhile (b < eb && (*b++ = *p++) != EOS)\n\t\tcontinue;\n\t*b = EOS;\n\n\treturn patbuf;\n}\n\n\n/*\n * The main glob() routine: compiles the pattern (optionally processing\n * quotes), calls glob1() to do the real pattern matching, and finally\n * sorts the list (unless unsorted operation is requested).  Returns 0\n * if things went well, nonzero if errors occurred.\n */\nstatic int\nglob0(const Char *pattern, glob_t *pglob, size_t *limit)\n{\n\tconst Char *qpatnext;\n\tint err;\n\tsize_t oldpathc;\n\tChar *bufnext, c, patbuf[MAXPATHLEN];\n\n\tqpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob);\n\toldpathc = pglob->gl_pathc;\n\tbufnext = patbuf;\n\n\t/* We don't need to check for buffer overflow any more. */\n\twhile ((c = *qpatnext++) != EOS) {\n\t\tswitch (c) {\n\t\tcase LBRACKET:\n\t\t\tc = *qpatnext;\n\t\t\tif (c == NOT)\n\t\t\t\t++qpatnext;\n\t\t\tif (*qpatnext == EOS ||\n\t\t\t    g_strchr(qpatnext+1, RBRACKET) == NULL) {\n\t\t\t\t*bufnext++ = LBRACKET;\n\t\t\t\tif (c == NOT)\n\t\t\t\t\t--qpatnext;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t*bufnext++ = M_SET;\n\t\t\tif (c == NOT)\n\t\t\t\t*bufnext++ = M_NOT;\n\t\t\tc = *qpatnext++;\n\t\t\tdo {\n\t\t\t\t*bufnext++ = CHAR(c);\n\t\t\t\tif (*qpatnext == RANGE &&\n\t\t\t\t    (c = qpatnext[1]) != RBRACKET) {\n\t\t\t\t\t*bufnext++ = M_RNG;\n\t\t\t\t\t*bufnext++ = CHAR(c);\n\t\t\t\t\tqpatnext += 2;\n\t\t\t\t}\n\t\t\t} while ((c = *qpatnext++) != RBRACKET);\n\t\t\tpglob->gl_flags |= GLOB_MAGCHAR;\n\t\t\t*bufnext++ = M_END;\n\t\t\tbreak;\n\t\tcase QUESTION:\n\t\t\tpglob->gl_flags |= GLOB_MAGCHAR;\n\t\t\t*bufnext++ = M_ONE;\n\t\t\tbreak;\n\t\tcase STAR:\n\t\t\tpglob->gl_flags |= GLOB_MAGCHAR;\n\t\t\t/* collapse adjacent stars to one,\n\t\t\t * to avoid exponential behavior\n\t\t\t */\n\t\t\tif (bufnext == patbuf || bufnext[-1] != M_ALL)\n\t\t\t    *bufnext++ = M_ALL;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t*bufnext++ = CHAR(c);\n\t\t\tbreak;\n\t\t}\n\t}\n\t*bufnext = EOS;\n#ifdef DEBUG\n\tqprintf(\"glob0:\", patbuf);\n#endif\n\n\tif ((err = glob1(patbuf, pglob, limit)) != 0)\n\t\treturn(err);\n\n\t/*\n\t * If there was no match we are going to append the pattern\n\t * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified\n\t * and the pattern did not contain any magic characters\n\t * GLOB_NOMAGIC is there just for compatibility with csh.\n\t */\n\tif (pglob->gl_pathc == oldpathc) {\n\t\tif (((pglob->gl_flags & GLOB_NOCHECK) ||\n\t\t    ((pglob->gl_flags & GLOB_NOMAGIC) &&\n\t\t\t!(pglob->gl_flags & GLOB_MAGCHAR))))\n\t\t\treturn(globextend(pattern, pglob, limit));\n\t\telse\n\t\t\treturn(GLOB_NOMATCH);\n\t}\n\tif (!(pglob->gl_flags & GLOB_NOSORT))\n\t\tqsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,\n\t\t    pglob->gl_pathc - oldpathc, sizeof(char *), compare);\n\treturn(0);\n}\n\nstatic int\ncompare(const void *p, const void *q)\n{\n\treturn(strcmp(*(char **)p, *(char **)q));\n}\n\nstatic int\nglob1(Char *pattern, glob_t *pglob, size_t *limit)\n{\n\tChar pathbuf[MAXPATHLEN];\n\n\t/* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */\n\tif (*pattern == EOS)\n\t\treturn(0);\n\treturn(glob2(pathbuf, pathbuf, pathbuf + MAXPATHLEN - 1,\n\t    pattern, pglob, limit));\n}\n\n/*\n * The functions glob2 and glob3 are mutually recursive; there is one level\n * of recursion for each segment in the pattern that contains one or more\n * meta characters.\n */\nstatic int\nglob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern,\n      glob_t *pglob, size_t *limit)\n{\n\tstruct stat sb;\n\tChar *p, *q;\n\tint anymeta;\n\n\t/*\n\t * Loop over pattern segments until end of pattern or until\n\t * segment with meta character found.\n\t */\n\tfor (anymeta = 0;;) {\n\t\tif (*pattern == EOS) {\t\t/* End of pattern? */\n\t\t\t*pathend = EOS;\n\t\t\tif (g_lstat(pathbuf, &sb, pglob))\n\t\t\t\treturn(0);\n\n\t\t\tif (((pglob->gl_flags & GLOB_MARK) &&\n\t\t\t    pathend[-1] != SEP) && (S_ISDIR(sb.st_mode)\n\t\t\t    || (S_ISLNK(sb.st_mode) &&\n\t\t\t    (g_stat(pathbuf, &sb, pglob) == 0) &&\n\t\t\t    S_ISDIR(sb.st_mode)))) {\n\t\t\t\tif (pathend + 1 > pathend_last)\n\t\t\t\t\treturn (GLOB_ABORTED);\n\t\t\t\t*pathend++ = SEP;\n\t\t\t\t*pathend = EOS;\n\t\t\t}\n\t\t\t++pglob->gl_matchc;\n\t\t\treturn(globextend(pathbuf, pglob, limit));\n\t\t}\n\n\t\t/* Find end of next segment, copy tentatively to pathend. */\n\t\tq = pathend;\n\t\tp = pattern;\n\t\twhile (*p != EOS && *p != SEP) {\n\t\t\tif (ismeta(*p))\n\t\t\t\tanymeta = 1;\n\t\t\tif (q + 1 > pathend_last)\n\t\t\t\treturn (GLOB_ABORTED);\n\t\t\t*q++ = *p++;\n\t\t}\n\n\t\tif (!anymeta) {\t\t/* No expansion, do next segment. */\n\t\t\tpathend = q;\n\t\t\tpattern = p;\n\t\t\twhile (*pattern == SEP) {\n\t\t\t\tif (pathend + 1 > pathend_last)\n\t\t\t\t\treturn (GLOB_ABORTED);\n\t\t\t\t*pathend++ = *pattern++;\n\t\t\t}\n\t\t} else\t\t\t/* Need expansion, recurse. */\n\t\t\treturn(glob3(pathbuf, pathend, pathend_last, pattern, p,\n\t\t\t    pglob, limit));\n\t}\n\t/* NOTREACHED */\n}\n\nstatic int\nglob3(Char *pathbuf, Char *pathend, Char *pathend_last,\n      Char *pattern, Char *restpattern,\n      glob_t *pglob, size_t *limit)\n{\n\tstruct dirent *dp;\n\tDIR *dirp;\n\tint err;\n\tchar buf[MAXPATHLEN];\n\n\t/*\n\t * The readdirfunc declaration can't be prototyped, because it is\n\t * assigned, below, to two functions which are prototyped in glob.h\n\t * and dirent.h as taking pointers to differently typed opaque\n\t * structures.\n\t */\n\tstruct dirent *(*readdirfunc)();\n\n\tif (pathend > pathend_last)\n\t\treturn (GLOB_ABORTED);\n\t*pathend = EOS;\n\terrno = 0;\n\n\tif ((dirp = g_opendir(pathbuf, pglob)) == NULL) {\n\t\t/* TODO: don't call for ENOENT or ENOTDIR? */\n\t\tif (pglob->gl_errfunc) {\n\t\t\tif (g_Ctoc(pathbuf, buf, sizeof(buf)))\n\t\t\t\treturn (GLOB_ABORTED);\n\t\t\tif (pglob->gl_errfunc(buf, errno) ||\n\t\t\t    pglob->gl_flags & GLOB_ERR)\n\t\t\t\treturn (GLOB_ABORTED);\n\t\t}\n\t\treturn(0);\n\t}\n\n\terr = 0;\n\n\t/* Search directory for matching names. */\n\tif (pglob->gl_flags & GLOB_ALTDIRFUNC)\n\t\treaddirfunc = pglob->gl_readdir;\n\telse\n\t\treaddirfunc = readdir;\n\twhile ((dp = (*readdirfunc)(dirp))) {\n\t\tchar *sc;\n\t\tChar *dc;\n\t\twchar_t wc;\n\t\tsize_t clen;\n\t\tmbstate_t mbs;\n\n\t\t/* Initial DOT must be matched literally. */\n\t\tif (dp->d_name[0] == DOT && *pattern != DOT)\n\t\t\tcontinue;\n\t\tmemset(&mbs, 0, sizeof(mbs));\n\t\tdc = pathend;\n\t\tsc = dp->d_name;\n\t\twhile (dc < pathend_last) {\n\t\t\tclen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs);\n\t\t\tif (clen == (size_t)-1 || clen == (size_t)-2) {\n\t\t\t\twc = *sc;\n\t\t\t\tclen = 1;\n\t\t\t\tmemset(&mbs, 0, sizeof(mbs));\n\t\t\t}\n\t\t\tif ((*dc++ = wc) == EOS)\n\t\t\t\tbreak;\n\t\t\tsc += clen;\n\t\t}\n\t\tif (!match(pathend, pattern, restpattern)) {\n\t\t\t*pathend = EOS;\n\t\t\tcontinue;\n\t\t}\n\t\terr = glob2(pathbuf, --dc, pathend_last, restpattern,\n\t\t    pglob, limit);\n\t\tif (err)\n\t\t\tbreak;\n\t}\n\n\tif (pglob->gl_flags & GLOB_ALTDIRFUNC)\n\t\t(*pglob->gl_closedir)(dirp);\n\telse\n\t\tclosedir(dirp);\n\treturn(err);\n}\n\n\n/*\n * Extend the gl_pathv member of a glob_t structure to accomodate a new item,\n * add the new item, and update gl_pathc.\n *\n * This assumes the BSD realloc, which only copies the block when its size\n * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic\n * behavior.\n *\n * Return 0 if new item added, error code if memory couldn't be allocated.\n *\n * Invariant of the glob_t structure:\n *\tEither gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and\n *\tgl_pathv points to (gl_offs + gl_pathc + 1) items.\n */\nstatic int\nglobextend(const Char *path, glob_t *pglob, size_t *limit)\n{\n\tchar **pathv;\n\tsize_t i, newsize, len;\n\tchar *copy;\n\tconst Char *p;\n\n\tif (*limit && pglob->gl_pathc > *limit) {\n\t\terrno = 0;\n\t\treturn (GLOB_NOSPACE);\n\t}\n\n\tnewsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);\n\tpathv = pglob->gl_pathv ?\n\t\t    realloc((char *)pglob->gl_pathv, newsize) :\n\t\t    malloc(newsize);\n\tif (pathv == NULL) {\n\t\tif (pglob->gl_pathv) {\n\t\t\tfree(pglob->gl_pathv);\n\t\t\tpglob->gl_pathv = NULL;\n\t\t}\n\t\treturn(GLOB_NOSPACE);\n\t}\n\n\tif (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {\n\t\t/* first time around -- clear initial gl_offs items */\n\t\tpathv += pglob->gl_offs;\n\t\tfor (i = pglob->gl_offs + 1; --i > 0; )\n\t\t\t*--pathv = NULL;\n\t}\n\tpglob->gl_pathv = pathv;\n\n\tfor (p = path; *p++;)\n\t\tcontinue;\n\tlen = MB_CUR_MAX * (size_t)(p - path);\t/* XXX overallocation */\n\tif ((copy = malloc(len)) != NULL) {\n\t\tif (g_Ctoc(path, copy, len)) {\n\t\t\tfree(copy);\n\t\t\treturn (GLOB_NOSPACE);\n\t\t}\n\t\tpathv[pglob->gl_offs + pglob->gl_pathc++] = copy;\n\t}\n\tpathv[pglob->gl_offs + pglob->gl_pathc] = NULL;\n\treturn(copy == NULL ? GLOB_NOSPACE : 0);\n}\n\n/*\n * pattern matching function for filenames.  Each occurrence of the *\n * pattern causes a recursion level.\n */\nstatic int\nmatch(Char *name, Char *pat, Char *patend)\n{\n\tint ok, negate_range;\n\tChar c, k;\n\n\twhile (pat < patend) {\n\t\tc = *pat++;\n\t\tswitch (c & M_MASK) {\n\t\tcase M_ALL:\n\t\t\tif (pat == patend)\n\t\t\t\treturn(1);\n\t\t\tdo\n\t\t\t    if (match(name, pat, patend))\n\t\t\t\t    return(1);\n\t\t\twhile (*name++ != EOS);\n\t\t\treturn(0);\n\t\tcase M_ONE:\n\t\t\tif (*name++ == EOS)\n\t\t\t\treturn(0);\n\t\t\tbreak;\n\t\tcase M_SET:\n\t\t\tok = 0;\n\t\t\tif ((k = *name++) == EOS)\n\t\t\t\treturn(0);\n\t\t\tif ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS)\n\t\t\t\t++pat;\n\t\t\twhile (((c = *pat++) & M_MASK) != M_END)\n\t\t\t\tif ((*pat & M_MASK) == M_RNG) {\n\t\t\t\t\tif (CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1])) ok = 1;\n\t\t\t\t\tpat += 2;\n\t\t\t\t} else if (c == k)\n\t\t\t\t\tok = 1;\n\t\t\tif (ok == negate_range)\n\t\t\t\treturn(0);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (*name++ != c)\n\t\t\t\treturn(0);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn(*name == EOS);\n}\n\n/* Free allocated data belonging to a glob_t structure. */\nvoid\nglobfree(glob_t *pglob)\n{\n\tsize_t i;\n\tchar **pp;\n\n\tif (pglob->gl_pathv != NULL) {\n\t\tpp = pglob->gl_pathv + pglob->gl_offs;\n\t\tfor (i = pglob->gl_pathc; i--; ++pp)\n\t\t\tif (*pp)\n\t\t\t\tfree(*pp);\n\t\tfree(pglob->gl_pathv);\n\t\tpglob->gl_pathv = NULL;\n\t}\n}\n\nstatic DIR *\ng_opendir(Char *str, glob_t *pglob)\n{\n\tchar buf[MAXPATHLEN];\n\n\tif (!*str)\n\t\tstrcpy(buf, \".\");\n\telse {\n\t\tif (g_Ctoc(str, buf, sizeof(buf)))\n\t\t\treturn (NULL);\n\t}\n\n\tif (pglob->gl_flags & GLOB_ALTDIRFUNC)\n\t\treturn((*pglob->gl_opendir)(buf));\n\n\treturn(opendir(buf));\n}\n\nstatic int\ng_lstat(Char *fn, struct stat *sb, glob_t *pglob)\n{\n\tchar buf[MAXPATHLEN];\n\n\tif (g_Ctoc(fn, buf, sizeof(buf))) {\n\t\terrno = ENAMETOOLONG;\n\t\treturn (-1);\n\t}\n\tif (pglob->gl_flags & GLOB_ALTDIRFUNC)\n\t\treturn((*pglob->gl_lstat)(buf, sb));\n\treturn(lstat(buf, sb));\n}\n\nstatic int\ng_stat(Char *fn, struct stat *sb, glob_t *pglob)\n{\n\tchar buf[MAXPATHLEN];\n\n\tif (g_Ctoc(fn, buf, sizeof(buf))) {\n\t\terrno = ENAMETOOLONG;\n\t\treturn (-1);\n\t}\n\tif (pglob->gl_flags & GLOB_ALTDIRFUNC)\n\t\treturn((*pglob->gl_stat)(buf, sb));\n\treturn(stat(buf, sb));\n}\n\nstatic const Char *\ng_strchr(const Char *str, wchar_t ch)\n{\n\n\tdo {\n\t\tif (*str == ch)\n\t\t\treturn (str);\n\t} while (*str++);\n\treturn (NULL);\n}\n\nstatic int\ng_Ctoc(const Char *str, char *buf, size_t len)\n{\n\tmbstate_t mbs;\n\tsize_t clen;\n\n\tmemset(&mbs, 0, sizeof(mbs));\n\twhile (len >= MB_CUR_MAX) {\n\t\tclen = wcrtomb(buf, *str, &mbs);\n\t\tif (clen == (size_t)-1)\n\t\t\treturn (1);\n\t\tif (*str == L'\\0')\n\t\t\treturn (0);\n\t\tstr++;\n\t\tbuf += clen;\n\t\tlen -= clen;\n\t}\n\treturn (1);\n}\n\n#ifdef DEBUG\nstatic void\nqprintf(const char *str, Char *s)\n{\n\tChar *p;\n\n\t(void)printf(\"%s:\\n\", str);\n\tfor (p = s; *p; p++)\n\t\t(void)printf(\"%c\", CHAR(*p));\n\t(void)printf(\"\\n\");\n\tfor (p = s; *p; p++)\n\t\t(void)printf(\"%c\", *p & M_PROTECT ? '\"' : ' ');\n\t(void)printf(\"\\n\");\n\tfor (p = s; *p; p++)\n\t\t(void)printf(\"%c\", ismeta(*p) ? '_' : ' ');\n\t(void)printf(\"\\n\");\n}\n#endif\n"
  },
  {
    "path": "packages/libandroid-glob/glob.h",
    "content": "/*\n * Copyright (c) 1989, 1993\n *\tThe Regents of the University of California.  All rights reserved.\n *\n * This code is derived from software contributed to Berkeley by\n * Guido van Rossum.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n *\t@(#)glob.h\t8.1 (Berkeley) 6/2/93\n * $FreeBSD$\n */\n\n#ifndef _GLOB_H_\n#define\t_GLOB_H_\n\n#include <sys/cdefs.h>\n#include <sys/types.h>\n\nstruct stat;\ntypedef struct {\n\tsize_t gl_pathc;\t/* Count of total paths so far. */\n\tsize_t gl_matchc;\t/* Count of paths matching pattern. */\n\tsize_t gl_offs;\t\t/* Reserved at beginning of gl_pathv. */\n\tint gl_flags;\t\t/* Copy of flags parameter to glob. */\n\tchar **gl_pathv;\t/* List of paths matching pattern. */\n\t\t\t\t/* Copy of errfunc parameter to glob. */\n\tint (*gl_errfunc)(const char *, int);\n\n\t/*\n\t * Alternate filesystem access methods for glob; replacement\n\t * versions of closedir(3), readdir(3), opendir(3), stat(2)\n\t * and lstat(2).\n\t */\n\tvoid (*gl_closedir)(void *);\n\tstruct dirent *(*gl_readdir)(void *);\n\tvoid *(*gl_opendir)(const char *);\n\tint (*gl_lstat)(const char *, struct stat *);\n\tint (*gl_stat)(const char *, struct stat *);\n} glob_t;\n\n/* Believed to have been introduced in 1003.2-1992 */\n#define\tGLOB_APPEND\t0x0001\t/* Append to output from previous call. */\n#define\tGLOB_DOOFFS\t0x0002\t/* Use gl_offs. */\n#define\tGLOB_ERR\t0x0004\t/* Return on error. */\n#define\tGLOB_MARK\t0x0008\t/* Append / to matching directories. */\n#define\tGLOB_NOCHECK\t0x0010\t/* Return pattern itself if nothing matches. */\n#define\tGLOB_NOSORT\t0x0020\t/* Don't sort. */\n#define\tGLOB_NOESCAPE\t0x2000\t/* Disable backslash escaping. */\n\n/* Error values returned by glob(3) */\n#define\tGLOB_NOSPACE\t(-1)\t/* Malloc call failed. */\n#define\tGLOB_ABORTED\t(-2)\t/* Unignored error. */\n#define\tGLOB_NOMATCH\t(-3)\t/* No match and GLOB_NOCHECK was not set. */\n#define\tGLOB_NOSYS\t(-4)\t/* Obsolete: source comptability only. */\n\n#define\tGLOB_ALTDIRFUNC\t0x0040\t/* Use alternately specified directory funcs. */\n#define\tGLOB_BRACE\t0x0080\t/* Expand braces ala csh. */\n#define\tGLOB_MAGCHAR\t0x0100\t/* Pattern had globbing characters. */\n#define\tGLOB_NOMAGIC\t0x0200\t/* GLOB_NOCHECK without magic chars (csh). */\n#define\tGLOB_QUOTE\t0x0400\t/* Quote special chars with \\. */\n#define\tGLOB_TILDE\t0x0800\t/* Expand tilde names from the passwd file. */\n#define\tGLOB_LIMIT\t0x1000\t/* limit number of returned paths */\n\n/* source compatibility, these are the old names */\n#define GLOB_MAXPATH\tGLOB_LIMIT\n#define\tGLOB_ABEND\tGLOB_ABORTED\n\n__BEGIN_DECLS\nint\tglob(const char *, int, int (*)(const char *, int), glob_t *);\nvoid\tglobfree(glob_t *);\n__END_DECLS\n\n#endif /* !_GLOB_H_ */\n"
  },
  {
    "path": "packages/libandroid-shmem/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/libandroid-shmem\nTERMUX_PKG_DESCRIPTION=\"System V shared memory emulation on Android using ashmem\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.2.1\nTERMUX_PKG_SRCURL=https://github.com/termux/libandroid-shmem/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=09369398658af357e3644178d42ebfcc79ea11fe760b10855011521fc3e35be4\nTERMUX_PKG_BREAKS=\"libandroid-shmem-dev\"\nTERMUX_PKG_REPLACES=\"libandroid-shmem-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/libandroid-spawn/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://man7.org/linux/man-pages/man3/posix_spawn.3.html\nTERMUX_PKG_DESCRIPTION=\"Shared library for the posix_spawn system function\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=0.2\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\t$CC $CFLAGS $CPPFLAGS -I$TERMUX_PKG_BUILDER_DIR -c $TERMUX_PKG_BUILDER_DIR/posix_spawn.cpp\n\t$CC $LDFLAGS -shared posix_spawn.o -o libandroid-spawn.so\n\t$AR rcu libandroid-spawn.a posix_spawn.o\n}\n\ntermux_step_make_install() {\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/posix_spawn.h $TERMUX_PREFIX/include/spawn.h\n\tinstall -Dm600 libandroid-spawn.a $TERMUX_PREFIX/lib/libandroid-spawn.a\n\tinstall -Dm600 libandroid-spawn.so $TERMUX_PREFIX/lib/libandroid-spawn.so\n}\n"
  },
  {
    "path": "packages/libandroid-spawn/posix_spawn.cpp",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include <errno.h>\n#include <fcntl.h>\n#include <signal.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n\n#include <android/fdsan.h>\n\n#include \"posix_spawn.h\"\n\n// Bionic \"private/ScopedSignalBlocker.h\" + one macro needed\n#define BIONIC_DISALLOW_COPY_AND_ASSIGN(TypeName) \\\n  TypeName(const TypeName&) = delete;             \\\n    void operator=(const TypeName&) = delete\n\nclass ScopedSignalBlocker {\n public:\n  // Block all signals.\n  explicit ScopedSignalBlocker() {\n    sigset_t set;\n    sigfillset(&set);\n    sigprocmask(SIG_BLOCK, &set, &old_set_);\n  }\n\n  // Block just the specified signal.\n  explicit ScopedSignalBlocker(int signal) {\n    sigset_t set = {};\n    sigaddset(&set, signal);\n    sigprocmask(SIG_BLOCK, &set, &old_set_);\n  }\n\n  ~ScopedSignalBlocker() {\n    reset();\n  }\n\n  void reset() {\n    sigprocmask(SIG_SETMASK, &old_set_, nullptr);\n  }\n\n  sigset_t old_set_;\n\n  BIONIC_DISALLOW_COPY_AND_ASSIGN(ScopedSignalBlocker);\n};\n\n// Bionic \"private/SigSetConverter.h\"\nunion SigSetConverter {\n  int bsd;\n  sigset_t sigset;\n  sigset64_t sigset64;\n};\n\nenum Action {\n  kOpen,\n  kClose,\n  kDup2\n};\n\nstruct __posix_spawn_file_action {\n  __posix_spawn_file_action* next;\n\n  Action what;\n  int fd;\n  int new_fd;\n  char* path;\n  int flags;\n  mode_t mode;\n\n  void Do() {\n    if (what == kOpen) {\n      fd = open(path, flags, mode);\n      if (fd == -1) _exit(127);\n      // If it didn't land where we wanted it, move it.\n      if (fd != new_fd) {\n        if (dup2(fd, new_fd) == -1) _exit(127);\n        close(fd);\n      }\n    } else if (what == kClose) {\n      // Failure to close is ignored.\n      close(fd);\n    } else {\n      if (dup2(fd, new_fd) == -1) _exit(127);\n    }\n  }\n};\n\nstruct __posix_spawn_file_actions {\n  __posix_spawn_file_action* head;\n  __posix_spawn_file_action* last;\n\n  void Do() {\n    for (__posix_spawn_file_action* action = head; action != nullptr; action = action->next) {\n      action->Do();\n    }\n  }\n};\n\nstruct __posix_spawnattr {\n  short flags;\n  pid_t pgroup;\n  sched_param schedparam;\n  int schedpolicy;\n  SigSetConverter sigmask;\n  SigSetConverter sigdefault;\n};\n\nstatic void ApplyAttrs(short flags, const posix_spawnattr_t* attr) {\n  // POSIX: \"If POSIX_SPAWN_SETSIGDEF is set ... signals in sigdefault ...\n  // shall be set to their default actions in the child process.\"\n  // POSIX: \"Signals set to be caught by the calling process shall be\n  // set to the default action in the child process.\"\n  bool use_sigdefault = ((flags & POSIX_SPAWN_SETSIGDEF) != 0);\n  const struct sigaction default_sa = { .sa_handler = SIG_DFL };\n  for (int s = 1; s < _NSIG; ++s) {\n    bool reset = false;\n    if (use_sigdefault && sigismember(&(*attr)->sigdefault.sigset, s)) {\n      reset = true;\n    } else {\n      struct sigaction current;\n      if (sigaction(s, nullptr, &current) == -1) _exit(127);\n      reset = (current.sa_handler != SIG_IGN && current.sa_handler != SIG_DFL);\n    }\n    if (reset && sigaction(s, &default_sa, nullptr) == -1) _exit(127);\n  }\n\n  if ((flags & POSIX_SPAWN_SETPGROUP) != 0 && setpgid(0, (*attr)->pgroup) == -1) _exit(127);\n  if ((flags & POSIX_SPAWN_SETSID) != 0 && setsid() == -1) _exit(127);\n\n  // POSIX_SPAWN_SETSCHEDULER overrides POSIX_SPAWN_SETSCHEDPARAM, but it is not an error\n  // to set both.\n  if ((flags & POSIX_SPAWN_SETSCHEDULER) != 0) {\n    if (sched_setscheduler(0, (*attr)->schedpolicy, &(*attr)->schedparam) == -1) _exit(127);\n  } else if ((flags & POSIX_SPAWN_SETSCHEDPARAM) != 0) {\n    if (sched_setparam(0, &(*attr)->schedparam) == -1) _exit(127);\n  }\n\n  if ((flags & POSIX_SPAWN_RESETIDS) != 0) {\n    if (seteuid(getuid()) == -1 || setegid(getgid()) == -1) _exit(127);\n  }\n\n  if ((flags & POSIX_SPAWN_SETSIGMASK) != 0) {\n    if (sigprocmask(SIG_SETMASK, &(*attr)->sigmask.sigset, nullptr)) _exit(127);\n  }\n}\n\nstatic int posix_spawn(pid_t* pid_ptr,\n                       const char* path,\n                       const posix_spawn_file_actions_t* actions,\n                       const posix_spawnattr_t* attr,\n                       char* const argv[],\n                       char* const env[],\n                       int exec_fn(const char* path, char* const argv[], char* const env[])) {\n  // See http://man7.org/linux/man-pages/man3/posix_spawn.3.html\n  // and http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html\n\n  ScopedSignalBlocker ssb;\n\n  short flags = attr ? (*attr)->flags : 0;\n  bool use_vfork = ((flags & POSIX_SPAWN_USEVFORK) != 0) || (actions == nullptr && flags == 0);\n\n  pid_t pid = use_vfork ? vfork() : fork();\n  if (pid == -1) return errno;\n\n  if (pid == 0) {\n    // Child.\n    ApplyAttrs(flags, attr);\n    if (actions) (*actions)->Do();\n    if ((flags & POSIX_SPAWN_SETSIGMASK) == 0) ssb.reset();\n    exec_fn(path, argv, env ? env : environ);\n    _exit(127);\n  }\n\n  // Parent.\n  if (pid_ptr) *pid_ptr = pid;\n  return 0;\n}\n\nint posix_spawn(pid_t* pid, const char* path, const posix_spawn_file_actions_t* actions,\n                const posix_spawnattr_t* attr, char* const argv[], char* const env[]) {\n  return posix_spawn(pid, path, actions, attr, argv, env, execve);\n}\n\nint posix_spawnp(pid_t* pid, const char* file, const posix_spawn_file_actions_t* actions,\n                 const posix_spawnattr_t* attr, char* const argv[], char* const env[]) {\n  return posix_spawn(pid, file, actions, attr, argv, env, execvpe);\n}\n\nint posix_spawnattr_init(posix_spawnattr_t* attr) {\n  *attr = reinterpret_cast<__posix_spawnattr*>(calloc(1, sizeof(__posix_spawnattr)));\n  return (*attr == nullptr) ? errno : 0;\n}\n\nint posix_spawnattr_destroy(posix_spawnattr_t* attr) {\n  free(*attr);\n  *attr = nullptr;\n  return 0;\n}\n\nint posix_spawnattr_setflags(posix_spawnattr_t* attr, short flags) {\n  if ((flags & ~(POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP | POSIX_SPAWN_SETSIGDEF |\n                 POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER |\n                 POSIX_SPAWN_USEVFORK | POSIX_SPAWN_SETSID)) != 0) {\n    return EINVAL;\n  }\n  (*attr)->flags = flags;\n  return 0;\n}\n\nint posix_spawnattr_getflags(const posix_spawnattr_t* attr, short* flags) {\n  *flags = (*attr)->flags;\n  return 0;\n}\n\nint posix_spawnattr_setpgroup(posix_spawnattr_t* attr, pid_t pgroup) {\n  (*attr)->pgroup = pgroup;\n  return 0;\n}\n\nint posix_spawnattr_getpgroup(const posix_spawnattr_t* attr, pid_t* pgroup) {\n  *pgroup = (*attr)->pgroup;\n  return 0;\n}\n\nint posix_spawnattr_setsigmask(posix_spawnattr_t* attr, const sigset_t* mask) {\n  (*attr)->sigmask.sigset = *mask;\n  return 0;\n}\n\nint posix_spawnattr_setsigmask64(posix_spawnattr_t* attr, const sigset64_t* mask) {\n  (*attr)->sigmask.sigset64 = *mask;\n  return 0;\n}\n\nint posix_spawnattr_getsigmask(const posix_spawnattr_t* attr, sigset_t* mask) {\n  *mask = (*attr)->sigmask.sigset;\n  return 0;\n}\n\nint posix_spawnattr_getsigmask64(const posix_spawnattr_t* attr, sigset64_t* mask) {\n  *mask = (*attr)->sigmask.sigset64;\n  return 0;\n}\n\nint posix_spawnattr_setsigdefault(posix_spawnattr_t* attr, const sigset_t* mask) {\n  (*attr)->sigdefault.sigset = *mask;\n  return 0;\n}\n\nint posix_spawnattr_setsigdefault64(posix_spawnattr_t* attr, const sigset64_t* mask) {\n  (*attr)->sigdefault.sigset64 = *mask;\n  return 0;\n}\n\nint posix_spawnattr_getsigdefault(const posix_spawnattr_t* attr, sigset_t* mask) {\n  *mask = (*attr)->sigdefault.sigset;\n  return 0;\n}\n\nint posix_spawnattr_getsigdefault64(const posix_spawnattr_t* attr, sigset64_t* mask) {\n  *mask = (*attr)->sigdefault.sigset64;\n  return 0;\n}\n\nint posix_spawnattr_setschedparam(posix_spawnattr_t* attr, const struct sched_param* param) {\n  (*attr)->schedparam = *param;\n  return 0;\n}\n\nint posix_spawnattr_getschedparam(const posix_spawnattr_t* attr, struct sched_param* param) {\n  *param = (*attr)->schedparam;\n  return 0;\n}\n\nint posix_spawnattr_setschedpolicy(posix_spawnattr_t* attr, int policy) {\n  (*attr)->schedpolicy = policy;\n  return 0;\n}\n\nint posix_spawnattr_getschedpolicy(const posix_spawnattr_t* attr, int* policy) {\n  *policy = (*attr)->schedpolicy;\n  return 0;\n}\n\nint posix_spawn_file_actions_init(posix_spawn_file_actions_t* actions) {\n  *actions = reinterpret_cast<__posix_spawn_file_actions*>(calloc(1, sizeof(**actions)));\n  return (*actions == nullptr) ? errno : 0;\n}\n\nint posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* actions) {\n  __posix_spawn_file_action* a = (*actions)->head;\n  while (a) {\n    __posix_spawn_file_action* last = a;\n    a = a->next;\n    free(last->path);\n    free(last);\n  }\n  free(*actions);\n  *actions = nullptr;\n  return 0;\n}\n\nstatic int posix_spawn_add_file_action(posix_spawn_file_actions_t* actions,\n                                       Action what,\n                                       int fd,\n                                       int new_fd,\n                                       const char* path,\n                                       int flags,\n                                       mode_t mode) {\n  __posix_spawn_file_action* action =\n      reinterpret_cast<__posix_spawn_file_action*>(malloc(sizeof(*action)));\n  if (action == nullptr) return errno;\n\n  action->next = nullptr;\n  if (path != nullptr) {\n    action->path = strdup(path);\n    if (action->path == nullptr) {\n      free(action);\n      return errno;\n    }\n  } else {\n    action->path = nullptr;\n  }\n  action->what = what;\n  action->fd = fd;\n  action->new_fd = new_fd;\n  action->flags = flags;\n  action->mode = mode;\n\n  if ((*actions)->head == nullptr) {\n    (*actions)->head = (*actions)->last = action;\n  } else {\n    (*actions)->last->next = action;\n    (*actions)->last = action;\n  }\n\n  return 0;\n}\n\nint posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* actions,\n                                     int fd, const char* path, int flags, mode_t mode) {\n  if (fd < 0) return EBADF;\n  return posix_spawn_add_file_action(actions, kOpen, -1, fd, path, flags, mode);\n}\n\nint posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* actions, int fd) {\n  if (fd < 0) return EBADF;\n  return posix_spawn_add_file_action(actions, kClose, fd, -1, nullptr, 0, 0);\n}\n\nint posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* actions, int fd, int new_fd) {\n  if (fd < 0 || new_fd < 0) return EBADF;\n  return posix_spawn_add_file_action(actions, kDup2, fd, new_fd, nullptr, 0, 0);\n}\n"
  },
  {
    "path": "packages/libandroid-spawn/posix_spawn.h",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#ifndef _SPAWN_H_\n#define _SPAWN_H_\n\n#include <sys/cdefs.h>\n#include <sys/types.h>\n#include <sched.h>\n#include <signal.h>\n\n__BEGIN_DECLS\n\n#define POSIX_SPAWN_RESETIDS 1\n#define POSIX_SPAWN_SETPGROUP 2\n#define POSIX_SPAWN_SETSIGDEF 4\n#define POSIX_SPAWN_SETSIGMASK 8\n#define POSIX_SPAWN_SETSCHEDPARAM 16\n#define POSIX_SPAWN_SETSCHEDULER 32\n#if defined(__USE_GNU)\n#define POSIX_SPAWN_USEVFORK 64\n#define POSIX_SPAWN_SETSID 128\n#endif\n\ntypedef struct __posix_spawnattr* posix_spawnattr_t;\ntypedef struct __posix_spawn_file_actions* posix_spawn_file_actions_t;\n\nint 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);\nint 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);\n\nint posix_spawnattr_init(posix_spawnattr_t* __attr) __INTRODUCED_IN(28);\nint posix_spawnattr_destroy(posix_spawnattr_t* __attr) __INTRODUCED_IN(28);\n\nint posix_spawnattr_setflags(posix_spawnattr_t* __attr, short __flags) __INTRODUCED_IN(28);\nint posix_spawnattr_getflags(const posix_spawnattr_t* __attr, short* __flags) __INTRODUCED_IN(28);\n\nint posix_spawnattr_setpgroup(posix_spawnattr_t* __attr, pid_t __pgroup) __INTRODUCED_IN(28);\nint posix_spawnattr_getpgroup(const posix_spawnattr_t* __attr, pid_t* __pgroup) __INTRODUCED_IN(28);\n\nint posix_spawnattr_setsigmask(posix_spawnattr_t* __attr, const sigset_t* __mask) __INTRODUCED_IN(28);\nint posix_spawnattr_setsigmask64(posix_spawnattr_t* __attr, const sigset64_t* __mask) __INTRODUCED_IN(28);\nint posix_spawnattr_getsigmask(const posix_spawnattr_t* __attr, sigset_t* __mask) __INTRODUCED_IN(28);\nint posix_spawnattr_getsigmask64(const posix_spawnattr_t* __attr, sigset64_t* __mask) __INTRODUCED_IN(28);\n\nint posix_spawnattr_setsigdefault(posix_spawnattr_t* __attr, const sigset_t* __mask) __INTRODUCED_IN(28);\nint posix_spawnattr_setsigdefault64(posix_spawnattr_t* __attr, const sigset64_t* __mask) __INTRODUCED_IN(28);\nint posix_spawnattr_getsigdefault(const posix_spawnattr_t* __attr, sigset_t* __mask) __INTRODUCED_IN(28);\nint posix_spawnattr_getsigdefault64(const posix_spawnattr_t* __attr, sigset64_t* __mask) __INTRODUCED_IN(28);\n\nint posix_spawnattr_setschedparam(posix_spawnattr_t* __attr, const struct sched_param* __param) __INTRODUCED_IN(28);\nint posix_spawnattr_getschedparam(const posix_spawnattr_t* __attr, struct sched_param* __param) __INTRODUCED_IN(28);\n\nint posix_spawnattr_setschedpolicy(posix_spawnattr_t* __attr, int __policy) __INTRODUCED_IN(28);\nint posix_spawnattr_getschedpolicy(const posix_spawnattr_t* __attr, int* __policy) __INTRODUCED_IN(28);\n\nint posix_spawn_file_actions_init(posix_spawn_file_actions_t* __actions) __INTRODUCED_IN(28);\nint posix_spawn_file_actions_destroy(posix_spawn_file_actions_t* __actions) __INTRODUCED_IN(28);\n\nint posix_spawn_file_actions_addopen(posix_spawn_file_actions_t* __actions, int __fd, const char* __path, int __flags, mode_t __mode) __INTRODUCED_IN(28);\nint posix_spawn_file_actions_addclose(posix_spawn_file_actions_t* __actions, int __fd) __INTRODUCED_IN(28);\nint posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t* __actions, int __fd, int __new_fd) __INTRODUCED_IN(28);\n\n__END_DECLS\n\n#endif\n"
  },
  {
    "path": "packages/libandroid-support/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/libandroid-support\nTERMUX_PKG_DESCRIPTION=\"Library extending the Android C library (Bionic) for additional multibyte, locale and math support\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=25\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/termux/libandroid-support/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=42e7b55c2e5fc91cc0447fa8bea432e7a75ec78b03469330668af17aea56f660\nTERMUX_PKG_PRE_DEPENDS=\"dpkg (>= 1.19.4-3)\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_ESSENTIAL=true\n\ntermux_step_make() {\n\tlocal c_file\n\n\tmkdir objects\n\tfor c_file in $(find src -type f -iname \\*.c); do\n\t\t$CC $CPPFLAGS $CFLAGS -std=c99 -DNULL=0 -fPIC -Iinclude \\\n\t\t\t-c $c_file -o ./objects/$(basename \"$c_file\").o\n\tdone\n\n\tcd objects\n\tar rcu ../libandroid-support.a *.o\n\t$CC $LDFLAGS -shared -o ../libandroid-support.so *.o\n}\n\ntermux_step_make_install() {\n\tinstall -Dm600 libandroid-support.a $TERMUX_PREFIX/lib/libandroid-support.a\n\tinstall -Dm600 libandroid-support.so $TERMUX_PREFIX/lib/libandroid-support.so\n}\n"
  },
  {
    "path": "packages/libao/ao_private.h.patch",
    "content": "--- ../cache/libao-1.2.2/include/ao/ao_private.h\t2016-11-14 16:03:30.000000000 +0000\n+++ ./include/ao/ao_private.h\t2018-07-10 21:09:26.757188903 +0000\n@@ -51,7 +51,7 @@\n /* --- Constants --- */\n\n #ifndef AO_SYSTEM_CONFIG\n-#define AO_SYSTEM_CONFIG \"/etc/libao.conf\"\n+#define AO_SYSTEM_CONFIG \"@TERMUX_PREFIX@/etc/libao.conf\"\n #endif\n #ifndef AO_USER_CONFIG\n #define AO_USER_CONFIG   \"/.libao\"\n"
  },
  {
    "path": "packages/libao/ao_pulse.c.patch",
    "content": "diff --git a/src/plugins/pulse/ao_pulse.c b/src/plugins/pulse/ao_pulse.c\nindex 2d10d57..6780830 100644\n--- a/src/plugins/pulse/ao_pulse.c\n+++ b/src/plugins/pulse/ao_pulse.c\n@@ -41,7 +41,7 @@\n #include <ao/ao.h>\n #include <ao/plugin.h>\n \n-#define AO_PULSE_BUFFER_TIME 20000\n+#define AO_PULSE_BUFFER_TIME 20\n \n /* Unfortunately libao doesn't allow \"const\" for these structures... */\n static char * ao_pulse_options[] = {\n@@ -73,7 +73,7 @@ typedef struct ao_pulse_internal {\n     struct pa_simple *simple;\n     char *server, *sink, *client_name;\n     pa_usec_t static_delay;\n-    pa_usec_t buffer_time;\n+    int buffer_time;\n } ao_pulse_internal;\n \n /* Yes, this is very ugly, but required nonetheless... */\n@@ -174,8 +174,8 @@ int ao_plugin_set_option(ao_device *device, const char *key, const char *value)\n     } else if (!strcmp(key, \"client_name\")) {\n         free(internal->client_name);\n         internal->client_name = strdup(value);\n-    }else if (!strcmp(key, \"buffer_time\")){\n-      internal->buffer_time = atoi(value) * 1000;\n+    } else if (!strcmp(key, \"buffer_time\")) {\n+        internal->buffer_time = atoi(value);\n     }\n \n     return 1;\n@@ -256,12 +256,10 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format) {\n     }\n \n     /* buffering attributes */\n-    battr.prebuf = battr.minreq = battr.fragsize = -1;\n+    battr.prebuf = battr.minreq = battr.fragsize = battr.maxlength = -1;\n \n-    battr.tlength = (int)(internal->buffer_time * format->rate) / 1000000 *\n-      ((format->bits+7)/8) * device->output_channels;\n-    battr.minreq = battr.tlength/4;\n-    battr.maxlength = battr.tlength+battr.minreq;\n+    battr.tlength = internal->buffer_time * format->rate / 1000 *\n+      (format->bits / 8) * device->output_channels;\n \n     internal->simple = pa_simple_new(internal->server, t, PA_STREAM_PLAYBACK,\n                                      internal->sink, t2, &ss,\n"
  },
  {
    "path": "packages/libao/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.xiph.org/ao/\nTERMUX_PKG_DESCRIPTION=\"A cross platform audio library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.2.2\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=df8a6d0e238feeccb26a783e778716fb41a801536fe7b6fce068e313c0e2bf4d\nTERMUX_PKG_SRCURL=https://github.com/xiph/libao/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"pulseaudio\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-pulse\"\nTERMUX_PKG_CONFFILES=\"etc/libao.conf\"\n\ntermux_step_pre_configure () {\n\t./autogen.sh\n}\n\ntermux_step_post_make_install () {\n\t#generate libao config file\n\tmkdir -p $TERMUX_PREFIX/etc/\n\tcat << EOF > $TERMUX_PREFIX/etc/libao.conf\ndefault_driver=pulse\nbuffer_time=50\nquiet\nEOF\n}\n"
  },
  {
    "path": "packages/libao/configure.ac.patch",
    "content": "--- ../cache/libao-1.2.2/configure.ac\t2016-11-14 16:03:30.000000000 +0800\n+++ ./configure.ac\t2018-08-03 00:58:07.600931951 +0800\n@@ -114,7 +114,7 @@\n \tLIBAO_LA_LDFLAGS=\"-no-undefined\"\n \t;;\n     *)\t\n-\tLIBAO_LA_LDFLAGS=\"\"\n+\tLIBAO_LA_LDFLAGS=\"-lpulse\"\n \t;;\n esac\n AC_SUBST(LIBAO_LA_LDFLAGS)\n"
  },
  {
    "path": "packages/libarchive/archive.h.patch",
    "content": "diff -u -r ../libarchive-3.2.0/libarchive/archive.h ./libarchive/archive.h\n--- ../libarchive-3.2.0/libarchive/archive.h\t2016-04-30 00:44:07.000000000 -0400\n+++ ./libarchive/archive.h\t2016-05-02 19:58:33.742590137 -0400\n@@ -96,11 +96,6 @@\n # endif\n #endif\n \n-/* Large file support for Android */\n-#ifdef __ANDROID__\n-#include \"android_lf.h\"\n-#endif\n-\n /*\n  * On Windows, define LIBARCHIVE_STATIC if you're building or using a\n  * .lib.  The default here assumes you're building a DLL.  Only\n"
  },
  {
    "path": "packages/libarchive/archive_entry.h.patch",
    "content": "diff -u -r ../libarchive-3.2.0/libarchive/archive_entry.h ./libarchive/archive_entry.h\n--- ../libarchive-3.2.0/libarchive/archive_entry.h\t2016-04-30 00:44:07.000000000 -0400\n+++ ./libarchive/archive_entry.h\t2016-05-02 19:58:22.878678982 -0400\n@@ -75,11 +75,6 @@\n # define\t__LA_MODE_T\tmode_t\n #endif\n \n-/* Large file support for Android */\n-#ifdef __ANDROID__\n-#include \"android_lf.h\"\n-#endif\n-\n /*\n  * On Windows, define LIBARCHIVE_STATIC if you're building or using a\n  * .lib.  The default here assumes you're building a DLL.  Only\n"
  },
  {
    "path": "packages/libarchive/archive_string.c.patch",
    "content": "diff -u -r ../libarchive-3.1.2/libarchive/archive_string.c ./libarchive/archive_string.c\n--- ../libarchive-3.1.2/libarchive/archive_string.c\t2013-01-14 02:43:45.000000000 +0100\n+++ ./libarchive/archive_string.c\t2014-07-15 19:07:54.334848056 +0200\n@@ -414,7 +414,9 @@\n default_iconv_charset(const char *charset) {\n \tif (charset != NULL && charset[0] != '\\0')\n \t\treturn charset;\n-#if HAVE_LOCALE_CHARSET && !defined(__APPLE__)\n+#ifdef __ANDROID__\n+        return \"UTF-8\";\n+#elif HAVE_LOCALE_CHARSET && !defined(__APPLE__)\n \t/* locale_charset() is broken on Mac OS */\n \treturn locale_charset();\n #elif HAVE_NL_LANGINFO\n"
  },
  {
    "path": "packages/libarchive/archive_util.c.patch",
    "content": "diff -uNr libarchive-3.3.3/libarchive/archive_util.c libarchive-3.3.3.mod/libarchive/archive_util.c\n--- libarchive-3.3.3/libarchive/archive_util.c\t2018-09-02 09:05:18.000000000 +0300\n+++ libarchive-3.3.3.mod/libarchive/archive_util.c\t2019-03-02 02:14:39.252942170 +0200\n@@ -374,7 +374,7 @@\n #ifdef _PATH_TMP\n \t\ttmp = _PATH_TMP;\n #else\n-                tmp = \"/tmp\";\n+                tmp = \"@TERMUX_PREFIX@/tmp\";\n #endif\n \tarchive_strcpy(temppath, tmp);\n \tif (temppath->s[temppath->length-1] != '/')\n"
  },
  {
    "path": "packages/libarchive/archive_write_disk_posix.c.patch",
    "content": "diff -u -r ../libarchive-3.3.1/libarchive/archive_write_disk_posix.c ./libarchive/archive_write_disk_posix.c\n--- ../libarchive-3.3.1/libarchive/archive_write_disk_posix.c\t2017-02-25 18:37:08.000000000 +0100\n+++ ./libarchive/archive_write_disk_posix.c\t2017-03-27 02:35:07.446390387 +0200\n@@ -2756,7 +2756,11 @@\n \talen = 0;\n \tmb = 0;\n \tcomplete = 1;\n+#ifdef __ANDROID__\n+\tutf8 = 1;\n+#else\n \tutf8 = (strcmp(nl_langinfo(CODESET), \"UTF-8\") == 0)? 1: 0;\n+#endif\n \tfor (p = path; *p != '\\0'; p++) {\n \t\t++alen;\n \t\tif (*p == '\\\\') {\n"
  },
  {
    "path": "packages/libarchive/archive_write_set_format_zip.c.patch",
    "content": "diff -u -r ../libarchive-3.2.0/libarchive/archive_write_set_format_zip.c ./libarchive/archive_write_set_format_zip.c\n--- ../libarchive-3.2.0/libarchive/archive_write_set_format_zip.c\t2016-01-01 17:18:57.000000000 -0500\n+++ ./libarchive/archive_write_set_format_zip.c\t2016-05-02 20:09:52.331542213 -0400\n@@ -651,10 +651,8 @@\n \t\t\tif (strcmp(archive_string_conversion_charset_name(\n \t\t\t\t\tzip->opt_sconv), \"UTF-8\") == 0)\n \t\t\t\tzip->entry_flags |= ZIP_ENTRY_FLAG_UTF8_NAME;\n-#if HAVE_NL_LANGINFO\n-\t\t} else if (strcmp(nl_langinfo(CODESET), \"UTF-8\") == 0) {\n+\t\t} else {\n \t\t\tzip->entry_flags |= ZIP_ENTRY_FLAG_UTF8_NAME;\n-#endif\n \t\t}\n \t}\n \tfilename_length = path_length(zip->entry);\n"
  },
  {
    "path": "packages/libarchive/bsdtar.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"The tar(1) and cpio(1) programs from FreeBSD, using libarchive\"\n"
  },
  {
    "path": "packages/libarchive/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.libarchive.org/\nTERMUX_PKG_DESCRIPTION=\"Multi-format archive and compression library\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=3.4.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=8643d50ed40c759f5412a3af4e353cffbce4fdf3b5cf321cb72cacf06b2d825e\nTERMUX_PKG_SRCURL=https://github.com/libarchive/libarchive/releases/download/v$TERMUX_PKG_VERSION/libarchive-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libbz2, libiconv, liblzma, libxml2, openssl, zlib\"\nTERMUX_PKG_BREAKS=\"libarchive-dev\"\nTERMUX_PKG_REPLACES=\"libarchive-dev\"\n\n# --without-nettle to use openssl instead:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--without-nettle\n--without-lz4\n--without-zstd\n\"\n"
  },
  {
    "path": "packages/libass/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/libass/libass\nTERMUX_PKG_DESCRIPTION=\"A portable library for SSA/ASS subtitles rendering\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.14.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/libass/libass/releases/download/$TERMUX_PKG_VERSION/libass-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=881f2382af48aead75b7a0e02e65d88c5ebd369fe46bc77d9270a94aa8fd38a2\nTERMUX_PKG_DEPENDS=\"fontconfig, fribidi, glib, harfbuzz\"\nTERMUX_PKG_BREAKS=\"libass-dev\"\nTERMUX_PKG_REPLACES=\"libass-dev\"\n"
  },
  {
    "path": "packages/libassuan/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/libassuan/\nTERMUX_PKG_DESCRIPTION=\"Library implementing the Assuan IPC protocol used between most newer GnuPG components\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.5.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=91bcb0403866b4e7c4bc1cc52ed4c364a9b5414b3994f718c70303f7f765e702\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"libgpg-error\"\nTERMUX_PKG_BREAKS=\"libassuan-dev\"\nTERMUX_PKG_REPLACES=\"libassuan-dev\"\n"
  },
  {
    "path": "packages/libbsd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libbsd.freedesktop.org\nTERMUX_PKG_DESCRIPTION=\"utility functions from BSD systems\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.10.0\nTERMUX_PKG_SRCURL=https://libbsd.freedesktop.org/releases/libbsd-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=34b8adc726883d0e85b3118fa13605e179a62b31ba51f676136ecb2d0bc1a887\nTERMUX_PKG_BREAKS=\"libbsd-dev\"\nTERMUX_PKG_REPLACES=\"libbsd-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/libbsd/endian.h.patch",
    "content": "diff -uNr libbsd-0.10.0/include/bsd/sys/endian.h libbsd-0.10.0.mod/include/bsd/sys/endian.h\n--- libbsd-0.10.0/include/bsd/sys/endian.h\t2019-08-08 01:00:44.000000000 +0300\n+++ libbsd-0.10.0.mod/include/bsd/sys/endian.h\t2019-08-11 20:23:57.120370524 +0300\n@@ -28,12 +28,12 @@\n \n #ifdef LIBBSD_OVERLAY\n #include <sys/cdefs.h>\n-#if __has_include_next(<endian.h>)\n+#if __has_include_next(<endian.h>) && !defined(__ANDROID__)\n #include_next <endian.h>\n #endif\n #else\n #include <bsd/sys/cdefs.h>\n-#if __has_include(<endian.h>)\n+#if __has_include(<endian.h>) && !defined(__ANDROID__)\n #include <endian.h>\n #endif\n #endif\n"
  },
  {
    "path": "packages/libbsd/funopen.c.patch",
    "content": "--- ../cache/libbsd-0.9.1/src/funopen.c\t2018-04-21 21:30:22.000000000 +0000\n+++ ./src/funopen.c\t2018-10-16 02:22:46.623852072 +0000\n@@ -137,7 +137,7 @@\n \n \treturn fopencookie(cookiewrap, mode, funcswrap);\n }\n-#elif defined(__MUSL__)\n+#elif defined(__MUSL__) || defined(__BIONIC__)\n /*\n  * This is unimplementable on musl based systems, and upstream has stated\n  * they will not add the needed support to implement it. Just ignore this\n"
  },
  {
    "path": "packages/libbsd/local-elf.h.patch",
    "content": "--- ../cache/libbsd-0.9.1/src/local-elf.h\t2018-04-21 21:30:22.000000000 +0000\n+++ ./src/local-elf.h\t2018-10-16 03:40:41.756419536 +0000\n@@ -240,8 +240,10 @@\n #endif\n \n #if ELF_TARG_CLASS == ELFCLASS32\n+#if !defined(__ANDROID__)\n #define ELF_ST_BIND\tELF32_ST_BIND\n #define ELF_ST_TYPE\tELF32_ST_TYPE\n+#endif\n #define Elf_Word\tElf32_Word\n #define Elf_Sword\tElf32_Sword\n #define Elf_Sym\t\tElf32_Sym\n@@ -249,8 +251,10 @@\n #define Elf_Shdr\tElf32_Shdr\n #define Elf_Ehdr\tElf32_Ehdr\n #elif ELF_TARG_CLASS == ELFCLASS64\n+#if !defined(__ANDROID__)\n #define ELF_ST_BIND\tELF64_ST_BIND\n #define ELF_ST_TYPE\tELF64_ST_TYPE\n+#endif\n #define Elf_Word\tElf64_Word\n #define Elf_Sword\tElf64_Sword\n #define Elf_Sym\t\tElf64_Sym\n"
  },
  {
    "path": "packages/libbsd/nlist.c.patch",
    "content": "--- ../cache/libbsd-0.9.1/src/nlist.c\t2018-05-14 22:54:12.000000000 +0000\n+++ ./src/nlist.c\t2018-10-16 03:17:23.141271836 +0000\n@@ -39,8 +39,11 @@\n #include <stdlib.h>\n #include <string.h>\n #include <unistd.h>\n+#if !defined(__ANDROID__)\n #include <nlist.h>\n-\n+#else\n+#include \"../include/bsd/nlist.h\"\n+#endif\n #include \"local-elf.h\"\n \n #define SIZE_T_MAX 0xffffffffU\n"
  },
  {
    "path": "packages/libbz2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.bzip.org/\nTERMUX_PKG_DESCRIPTION=\"BZ2 format compression library\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.0.8\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/bzip2-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=47fd74b2ff83effad0ddf62074e6fad1f6b4a77a96e121ab421c20a216371a1f\nTERMUX_PKG_BREAKS=\"libbz2-dev\"\nTERMUX_PKG_REPLACES=\"libbz2-dev\"\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"PREFIX=$TERMUX_PREFIX\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# bzip2 does not use configure. But place man pages at correct path:\n\tsed -i \"s@(PREFIX)/man@(PREFIX)/share/man@g\" $TERMUX_PKG_SRCDIR/Makefile\n}\n\ntermux_step_make() {\n\t# bzip2 uses a separate makefile for the shared library\n\tmake -f Makefile-libbz2_so\n}\n\ntermux_step_make_install() {\n\t# The shared library makefile contains no install makefile, so issue a normal install to get scripts\n\tmake $TERMUX_PKG_EXTRA_MAKE_ARGS install\n\n\t# Clean out statically linked binaries and libs and replace them with shared ones:\n\trm -Rf $TERMUX_PREFIX/lib/libbz2*\n\trm -Rf $TERMUX_PREFIX/bin/{bzcat,bunzip2}\n\tcp bzip2-shared $TERMUX_PREFIX/bin/bzip2\n\tcp libbz2.so.${TERMUX_PKG_VERSION} $TERMUX_PREFIX/lib\n\t(cd $TERMUX_PREFIX/lib && ln -s libbz2.so.${TERMUX_PKG_VERSION} libbz2.so.1.0)\n\t(cd $TERMUX_PREFIX/lib && ln -s libbz2.so.${TERMUX_PKG_VERSION} libbz2.so)\n\t(cd $TERMUX_PREFIX/bin && ln -s bzip2 bzcat)\n\t(cd $TERMUX_PREFIX/bin && ln -s bzip2 bunzip2)\n\t# bzgrep should be enough so remove bz{e,f}grep\n\trm $TERMUX_PREFIX/bin/bz{e,f}grep $TERMUX_PREFIX/share/man/man1/bz{e,f}grep.1\n}\n"
  },
  {
    "path": "packages/libbz2/bzdiff.patch",
    "content": "diff -uNr bzip2-1.0.8/bzdiff bzip2-1.0.8.mod/bzdiff\n--- bzip2-1.0.8/bzdiff\t2019-07-13 20:50:05.000000000 +0300\n+++ bzip2-1.0.8.mod/bzdiff\t2019-07-20 11:46:36.090211623 +0300\n@@ -49,14 +49,14 @@\n                 case \"$2\" in\n \t        *.bz2)\n \t\t\tF=`echo \"$2\" | sed 's|.*/||;s|.bz2$||'`\n-\t\t\ttmp=`mktemp \"${TMPDIR:-/tmp}\"/bzdiff.XXXXXXXXXX` || {\n+\t\t\ttmp=`mktemp \"${TMPDIR:-@TERMUX_PREFIX@/tmp}\"/bzdiff.XXXXXXXXXX` || {\n \t\t\t      echo 'cannot create a temporary file' >&2\n \t\t\t      exit 1\n \t\t\t}\n                         bzip2 -cdfq \"$2\" > \"$tmp\"\n                         bzip2 -cdfq \"$1\" | $comp $OPTIONS - \"$tmp\"\n                         STAT=\"$?\"\n-\t\t\t/bin/rm -f \"$tmp\";;\n+\t\t\trm -f \"$tmp\";;\n\n                 *)      bzip2 -cdfq \"$1\" | $comp $OPTIONS - \"$2\"\n                         STAT=\"$?\";;\n"
  },
  {
    "path": "packages/libbz2/bzip2.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Tools for working with bzip2 compression\"\nTERMUX_SUBPKG_ESSENTIAL=true\n"
  },
  {
    "path": "packages/libbz2/cross_compile.patch",
    "content": "diff -u -r ../bzip2-1.0.6/Makefile ./Makefile\n--- ../bzip2-1.0.6/Makefile\t2010-09-11 00:46:02.000000000 +0200\n+++ ./Makefile\t2014-02-24 22:03:59.000000000 +0100\n@@ -14,17 +14,11 @@\n \n SHELL=/bin/sh\n \n-# To assist in cross-compiling\n-CC=gcc\n-AR=ar\n-RANLIB=ranlib\n-LDFLAGS=\n \n BIGFILES=-D_FILE_OFFSET_BITS=64\n CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)\n \n # Where you want it installed when you do 'make install'\n-PREFIX=/usr/local\n \n \n OBJS= blocksort.o  \\\n"
  },
  {
    "path": "packages/libbz2/shared_library.patch",
    "content": "diff -uNr bzip2-1.0.8/Makefile-libbz2_so bzip2-1.0.8.mod/Makefile-libbz2_so\n--- bzip2-1.0.8/Makefile-libbz2_so\t2019-07-13 20:50:05.000000000 +0300\n+++ bzip2-1.0.8.mod/Makefile-libbz2_so\t2019-07-20 11:51:36.370015038 +0300\n@@ -22,9 +22,9 @@\n \n \n SHELL=/bin/sh\n-CC=gcc\n+CC ?= gcc\n BIGFILES=-D_FILE_OFFSET_BITS=64\n-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)\n+CFLAGS ?= -fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)\n \n OBJS= blocksort.o  \\\n       huffman.o    \\\n@@ -35,8 +35,8 @@\n       bzlib.o\n \n all: $(OBJS)\n-\t$(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)\n-\t$(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8\n+\t$(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)\n+\t$(CC) $(CFLAGS) $(LDFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8\n \trm -f libbz2.so.1.0\n \tln -s libbz2.so.1.0.8 libbz2.so.1.0\n \n"
  },
  {
    "path": "packages/libc++/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libcxx.llvm.org/\nTERMUX_PKG_DESCRIPTION=\"C++ Standard Library\"\nTERMUX_PKG_LICENSE=\"NCSA\"\nTERMUX_PKG_VERSION=$TERMUX_NDK_VERSION\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_ESSENTIAL=true\n\ntermux_step_post_make_install() {\n\tcp \"$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/${TERMUX_HOST_PLATFORM}/libc++_shared.so\" $TERMUX_PREFIX/lib\n}\n"
  },
  {
    "path": "packages/libcaca/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://caca.zoy.org/wiki/libcaca\nTERMUX_PKG_DESCRIPTION=\"Graphics library that outputs text instead of pixels\"\nTERMUX_PKG_LICENSE=\"WTFPL\"\nTERMUX_PKG_VERSION=0.99.beta19\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=http://fossies.org/linux/privat/libcaca-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=128b467c4ed03264c187405172a4e83049342cc8cc2f655f53a2d0ee9d3772f4\nTERMUX_PKG_DEPENDS=\"imlib2, libc++, ncurses, zlib\"\nTERMUX_PKG_BREAKS=\"libcaca-dev\"\nTERMUX_PKG_REPLACES=\"libcaca-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-doc\n--disable-java\n--disable-python\n--disable-ruby\n--enable-imlib2\n\"\n\ntermux_step_post_configure() {\n\tif [ $TERMUX_ARCH = x86_64 ]; then\n\t\t# Remove troublesome asm usage:\n\t\tperl -p -i -e 's/#define HAVE_FLDLN2 1//' $TERMUX_PKG_BUILDDIR/config.h\n\tfi\n}\n"
  },
  {
    "path": "packages/libcairo/android-shmem.patch",
    "content": "Just linking with libandroid-shmem doesn't work for libcairo for some reason.\n\ndiff -uNr cairo-1.16.0/src/android-shmem.c cairo-1.16.0.mod/src/android-shmem.c\n--- cairo-1.16.0/src/android-shmem.c\t1970-01-01 03:00:00.000000000 +0300\n+++ cairo-1.16.0.mod/src/android-shmem.c\t2019-08-16 20:37:14.952643714 +0300\n@@ -0,0 +1,549 @@\n+#include <android/log.h>\n+#include <errno.h>\n+#include <pthread.h>\n+#include <stdbool.h>\n+#include <stdint.h>\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <sys/mman.h>\n+#include <sys/socket.h>\n+#include <sys/un.h>\n+#include <unistd.h>\n+#include <paths.h>\n+\n+#define __u32 uint32_t\n+#include <linux/ashmem.h>\n+\n+#include \"android-shmem.h\"\n+\n+#define DBG(...) __android_log_print(ANDROID_LOG_INFO, \"shmem\", __VA_ARGS__)\n+#define ASHV_KEY_SYMLINK_PATH _PATH_TMP \"ashv_key_%d\"\n+#define ANDROID_SHMEM_SOCKNAME \"/dev/shm/%08x\"\n+#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))\n+\n+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;\n+\n+typedef struct {\n+\t// The shmid (shared memory id) contains the socket address (16 bits)\n+\t// and a local id (15 bits).\n+\tint id;\n+\tvoid *addr;\n+\tint descriptor;\n+\tsize_t size;\n+\tbool markedForDeletion;\n+\tkey_t key;\n+} shmem_t;\n+\n+static shmem_t* shmem = NULL;\n+static size_t shmem_amount = 0;\n+\n+// The lower 16 bits of (getpid() + i), where i is a sequence number.\n+// It is unique among processes as it's only set when bound.\n+static int ashv_local_socket_id = 0;\n+// To handle forks we store which pid the ashv_local_socket_id was\n+// created for.\n+static int ashv_pid_setup = 0;\n+static pthread_t ashv_listening_thread_id = 0;\n+\n+static int ancil_send_fd(int sock, int fd)\n+{\n+\tchar nothing = '!';\n+\tstruct iovec nothing_ptr = { .iov_base = &nothing, .iov_len = 1 };\n+\n+\tstruct {\n+\t\tstruct cmsghdr align;\n+\t\tint fd[1];\n+\t} ancillary_data_buffer;\n+\n+\tstruct msghdr message_header = {\n+\t\t.msg_name = NULL,\n+\t\t.msg_namelen = 0,\n+\t\t.msg_iov = &nothing_ptr,\n+\t\t.msg_iovlen = 1,\n+\t\t.msg_flags = 0,\n+\t\t.msg_control = &ancillary_data_buffer,\n+\t\t.msg_controllen = sizeof(struct cmsghdr) + sizeof(int)\n+\t};\n+\n+\tstruct cmsghdr* cmsg = CMSG_FIRSTHDR(&message_header);\n+\tcmsg->cmsg_len = message_header.msg_controllen; // sizeof(int);\n+\tcmsg->cmsg_level = SOL_SOCKET;\n+\tcmsg->cmsg_type = SCM_RIGHTS;\n+\t((int*) CMSG_DATA(cmsg))[0] = fd;\n+\n+\treturn sendmsg(sock, &message_header, 0) >= 0 ? 0 : -1;\n+}\n+\n+static int ancil_recv_fd(int sock)\n+{\n+\tchar nothing = '!';\n+\tstruct iovec nothing_ptr = { .iov_base = &nothing, .iov_len = 1 };\n+\n+\tstruct {\n+\t\tstruct cmsghdr align;\n+\t\tint fd[1];\n+\t} ancillary_data_buffer;\n+\n+\tstruct msghdr message_header = {\n+\t\t.msg_name = NULL,\n+\t\t.msg_namelen = 0,\n+\t\t.msg_iov = &nothing_ptr,\n+\t\t.msg_iovlen = 1,\n+\t\t.msg_flags = 0,\n+\t\t.msg_control = &ancillary_data_buffer,\n+\t\t.msg_controllen = sizeof(struct cmsghdr) + sizeof(int)\n+\t};\n+\n+\tstruct cmsghdr* cmsg = CMSG_FIRSTHDR(&message_header);\n+\tcmsg->cmsg_len = message_header.msg_controllen;\n+\tcmsg->cmsg_level = SOL_SOCKET;\n+\tcmsg->cmsg_type = SCM_RIGHTS;\n+\t((int*) CMSG_DATA(cmsg))[0] = -1;\n+\n+\tif (recvmsg(sock, &message_header, 0) < 0) return -1;\n+\n+\treturn ((int*) CMSG_DATA(cmsg))[0];\n+}\n+\n+static int ashmem_get_size_region(int fd)\n+{\n+\t//int ret = __ashmem_is_ashmem(fd, 1);\n+\t//if (ret < 0) return ret;\n+\treturn TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_GET_SIZE, NULL));\n+}\n+\n+/*\n+ * From https://android.googlesource.com/platform/system/core/+/master/libcutils/ashmem-dev.c\n+ *\n+ * ashmem_create_region - creates a new named ashmem region and returns the file\n+ * descriptor, or <0 on error.\n+ *\n+ * `name' is the label to give the region (visible in /proc/pid/maps)\n+ * `size' is the size of the region, in page-aligned bytes\n+ */\n+static int ashmem_create_region(char const* name, size_t size)\n+{\n+\tint fd = open(\"/dev/ashmem\", O_RDWR);\n+\tif (fd < 0) return fd;\n+\n+\tchar name_buffer[ASHMEM_NAME_LEN] = {0};\n+\tstrncpy(name_buffer, name, sizeof(name_buffer));\n+\tname_buffer[sizeof(name_buffer)-1] = 0;\n+\n+\tint ret = ioctl(fd, ASHMEM_SET_NAME, name_buffer);\n+\tif (ret < 0) goto error;\n+\n+\tret = ioctl(fd, ASHMEM_SET_SIZE, size);\n+\tif (ret < 0) goto error;\n+\n+\treturn fd;\n+error:\n+\tclose(fd);\n+\treturn ret;\n+}\n+\n+static void ashv_check_pid()\n+{\n+\tpid_t mypid = getpid();\n+\tif (ashv_pid_setup == 0) {\n+\t\tashv_pid_setup = mypid;\n+\t} else if (ashv_pid_setup != mypid) {\n+\t\tDBG(\"%s: Cleaning to new pid=%d from oldpid=%d\", __PRETTY_FUNCTION__, mypid, ashv_pid_setup);\n+\t\t// We inherited old state across a fork.\n+\t\tashv_pid_setup = mypid;\n+\t\tashv_local_socket_id = 0;\n+\t\tashv_listening_thread_id = 0;\n+\t\tshmem_amount = 0;\n+\t\t// Unlock if fork left us with held lock from parent thread.\n+\t\tpthread_mutex_unlock(&mutex);\n+\t\tif (shmem != NULL) free(shmem);\n+\t\tshmem = NULL;\n+\t}\n+}\n+\n+\n+// Store index in the lower 15 bits and the socket id in the\n+// higher 16 bits.\n+static int ashv_shmid_from_counter(unsigned int counter)\n+{\n+\treturn ashv_local_socket_id * 0x10000 + counter;\n+}\n+\n+static int ashv_socket_id_from_shmid(int shmid)\n+{\n+\treturn shmid / 0x10000;\n+}\n+\n+static int ashv_find_local_index(int shmid)\n+{\n+\tfor (size_t i = 0; i < shmem_amount; i++)\n+\t\tif (shmem[i].id == shmid)\n+\t\t\treturn i;\n+\treturn -1;\n+}\n+\n+static void* ashv_thread_function(void* arg)\n+{\n+\tint sock = *(int*)arg;\n+\tfree(arg);\n+\tstruct sockaddr_un addr;\n+\tsocklen_t len = sizeof(addr);\n+\tint sendsock;\n+\t//DBG(\"%s: thread started\", __PRETTY_FUNCTION__);\n+\twhile ((sendsock = accept(sock, (struct sockaddr *)&addr, &len)) != -1) {\n+\t\tint shmid;\n+\t\tif (recv(sendsock, &shmid, sizeof(shmid), 0) != sizeof(shmid)) {\n+\t\t\tDBG(\"%s: ERROR: recv() returned not %zu bytes\", __PRETTY_FUNCTION__, sizeof(shmid));\n+\t\t\tclose(sendsock);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tpthread_mutex_lock(&mutex);\n+\t\tint idx = ashv_find_local_index(shmid);\n+\t\tif (idx != -1) {\n+\t\t\tif (write(sendsock, &shmem[idx].key, sizeof(key_t)) != sizeof(key_t)) {\n+\t\t\t\tDBG(\"%s: ERROR: write failed: %s\", __PRETTY_FUNCTION__, strerror(errno));\n+\t\t\t}\n+\t\t\tif (ancil_send_fd(sendsock, shmem[idx].descriptor) != 0) {\n+\t\t\t\tDBG(\"%s: ERROR: ancil_send_fd() failed: %s\", __PRETTY_FUNCTION__, strerror(errno));\n+\t\t\t}\n+\t\t} else {\n+\t\t\tDBG(\"%s: ERROR: cannot find shmid 0x%x\", __PRETTY_FUNCTION__, shmid);\n+\t\t}\n+\t\tpthread_mutex_unlock(&mutex);\n+\t\tclose(sendsock);\n+\t\tlen = sizeof(addr);\n+\t}\n+\tDBG (\"%s: ERROR: listen() failed, thread stopped\", __PRETTY_FUNCTION__);\n+\treturn NULL;\n+}\n+\n+static void android_shmem_delete(int idx)\n+{\n+\tif (shmem[idx].descriptor) close(shmem[idx].descriptor);\n+\tshmem_amount--;\n+\tmemmove(&shmem[idx], &shmem[idx+1], (shmem_amount - idx) * sizeof(shmem_t));\n+}\n+\n+static int ashv_read_remote_segment(int shmid)\n+{\n+\tstruct sockaddr_un addr;\n+\tmemset(&addr, 0, sizeof(addr));\n+\taddr.sun_family = AF_UNIX;\n+\tsprintf(&addr.sun_path[1], ANDROID_SHMEM_SOCKNAME, ashv_socket_id_from_shmid(shmid));\n+\tint addrlen = sizeof(addr.sun_family) + strlen(&addr.sun_path[1]) + 1;\n+\n+\tint recvsock = socket(AF_UNIX, SOCK_STREAM, 0);\n+\tif (recvsock == -1) {\n+\t\tDBG (\"%s: cannot create UNIX socket: %s\", __PRETTY_FUNCTION__, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\tif (connect(recvsock, (struct sockaddr*) &addr, addrlen) != 0) {\n+\t\tDBG(\"%s: Cannot connect to UNIX socket %s: %s, len %d\", __PRETTY_FUNCTION__, addr.sun_path + 1, strerror(errno), addrlen);\n+\t\tclose(recvsock);\n+\t\treturn -1;\n+\t}\n+\n+\tif (send(recvsock, &shmid, sizeof(shmid), 0) != sizeof(shmid)) {\n+\t\tDBG (\"%s: send() failed on socket %s: %s\", __PRETTY_FUNCTION__, addr.sun_path + 1, strerror(errno));\n+\t\tclose(recvsock);\n+\t\treturn -1;\n+\t}\n+\n+\tkey_t key;\n+\tif (read(recvsock, &key, sizeof(key_t)) != sizeof(key_t)) {\n+\t\tDBG(\"%s: ERROR: failed read\", __PRETTY_FUNCTION__);\n+\t\tclose(recvsock);\n+\t\treturn -1;\n+\t}\n+\n+\tint descriptor = ancil_recv_fd(recvsock);\n+\tif (descriptor < 0) {\n+\t\tDBG(\"%s: ERROR: ancil_recv_fd() failed on socket %s: %s\", __PRETTY_FUNCTION__, addr.sun_path + 1, strerror(errno));\n+\t\tclose(recvsock);\n+\t\treturn -1;\n+\t}\n+\tclose(recvsock);\n+\n+\tint size = ashmem_get_size_region(descriptor);\n+\tif (size == 0 || size == -1) {\n+\t\tDBG (\"%s: ERROR: ashmem_get_size_region() returned %d on socket %s: %s\", __PRETTY_FUNCTION__, size, addr.sun_path + 1, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\tint idx = shmem_amount;\n+\tshmem_amount ++;\n+\tshmem = realloc(shmem, shmem_amount * sizeof(shmem_t));\n+\tshmem[idx].id = shmid;\n+\tshmem[idx].descriptor = descriptor;\n+\tshmem[idx].size = size;\n+\tshmem[idx].addr = NULL;\n+\tshmem[idx].markedForDeletion = false;\n+\tshmem[idx].key = key;\n+\treturn idx;\n+}\n+\n+/* Get shared memory area identifier. */\n+int android_shmget(key_t key, size_t size, int flags)\n+{\n+\t(void) flags;\n+\n+\tashv_check_pid();\n+\n+\t// Counter wrapping around at 15 bits.\n+\tstatic size_t shmem_counter = 0;\n+\n+\tif (!ashv_listening_thread_id) {\n+\t\tint sock = socket(AF_UNIX, SOCK_STREAM, 0);\n+\t\tif (!sock) {\n+\t\t\tDBG (\"%s: cannot create UNIX socket: %s\", __PRETTY_FUNCTION__, strerror(errno));\n+\t\t\terrno = EINVAL;\n+\t\t\treturn -1;\n+\t\t}\n+\t\tint i;\n+\t\tfor (i = 0; i < 4096; i++) {\n+\t\t\tstruct sockaddr_un addr;\n+\t\t\tint len;\n+\t\t\tmemset (&addr, 0, sizeof(addr));\n+\t\t\taddr.sun_family = AF_UNIX;\n+\t\t\tashv_local_socket_id = (getpid() + i) & 0xffff;\n+\t\t\tsprintf(&addr.sun_path[1], ANDROID_SHMEM_SOCKNAME, ashv_local_socket_id);\n+\t\t\tlen = sizeof(addr.sun_family) + strlen(&addr.sun_path[1]) + 1;\n+\t\t\tif (bind(sock, (struct sockaddr *)&addr, len) != 0) continue;\n+\t\t\tDBG(\"%s: bound UNIX socket %s in pid=%d\", __PRETTY_FUNCTION__, addr.sun_path + 1, getpid());\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (i == 4096) {\n+\t\t\tDBG(\"%s: cannot bind UNIX socket, bailing out\", __PRETTY_FUNCTION__);\n+\t\t\tashv_local_socket_id = 0;\n+\t\t\terrno = ENOMEM;\n+\t\t\treturn -1;\n+\t\t}\n+\t\tif (listen(sock, 4) != 0) {\n+\t\t\tDBG(\"%s: listen failed\", __PRETTY_FUNCTION__);\n+\t\t\terrno = ENOMEM;\n+\t\t\treturn -1;\n+\t\t}\n+\t\tint* socket_arg = malloc(sizeof(int));\n+\t\t*socket_arg = sock;\n+\t\tpthread_create(&ashv_listening_thread_id, NULL, &ashv_thread_function, socket_arg);\n+\t}\n+\n+\tint shmid = -1;\n+\n+\tpthread_mutex_lock(&mutex);\n+\tchar symlink_path[256];\n+\tif (key != IPC_PRIVATE) {\n+\t\t// (1) Check if symlink exists telling us where to connect.\n+\t\t// (2) If so, try to connect and open.\n+\t\t// (3) If connected and opened, done. If connection refused\n+\t\t//     take ownership of the key and create the symlink.\n+\t\t// (4) If no symlink, create it.\n+\t\tsprintf(symlink_path, ASHV_KEY_SYMLINK_PATH, key);\n+\t\tchar path_buffer[256];\n+\t\tchar num_buffer[64];\n+\t\twhile (true) {\n+\t\t\tint path_length = readlink(symlink_path, path_buffer, sizeof(path_buffer) - 1);\n+\t\t\tif (path_length != -1) {\n+\t\t\t\tpath_buffer[path_length] = '\\0';\n+\t\t\t\tint shmid = atoi(path_buffer);\n+\t\t\t\tif (shmid != 0) {\n+\t\t\t\t\tint idx = ashv_read_remote_segment(shmid);\n+\t\t\t\t\tif (idx != -1) {\n+\t\t\t\t\t\tpthread_mutex_unlock(&mutex);\n+\t\t\t\t\t\treturn shmem[idx].id;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t\t// TODO: Not sure we should try to remove previous owner if e.g.\n+\t\t\t\t// there was a tempporary failture to get a soket. Need to\n+\t\t\t\t// distinguish between why ashv_read_remote_segment failed.\n+\t\t\t\tunlink(symlink_path);\n+\t\t\t}\n+\t\t\t// Take ownership.\n+\t\t\t// TODO: HAndle error (out of resouces, no infinite loop)\n+\t\t\tif (shmid == -1) {\n+\t\t\t\tshmem_counter = (shmem_counter + 1) & 0x7fff;\n+\t\t\t\tshmid = ashv_shmid_from_counter(shmem_counter);\n+\t\t\t\tsprintf(num_buffer, \"%d\", shmid);\n+\t\t\t}\n+\t\t\tif (symlink(num_buffer, symlink_path) == 0) break;\n+\t\t}\n+\t}\n+\n+\n+\tint idx = shmem_amount;\n+\tchar buf[256];\n+\tsprintf(buf, ANDROID_SHMEM_SOCKNAME \"-%d\", ashv_local_socket_id, idx);\n+\n+\tshmem_amount++;\n+\tif (shmid == -1) {\n+\t\tshmem_counter = (shmem_counter + 1) & 0x7fff;\n+\t\tshmid = ashv_shmid_from_counter(shmem_counter);\n+\t}\n+\n+\tshmem = realloc(shmem, shmem_amount * sizeof(shmem_t));\n+\tsize = ROUND_UP(size, getpagesize());\n+\tshmem[idx].size = size;\n+\tshmem[idx].descriptor = ashmem_create_region(buf, size);\n+\tshmem[idx].addr = NULL;\n+\tshmem[idx].id = shmid;\n+\tshmem[idx].markedForDeletion = false;\n+\tshmem[idx].key = key;\n+\n+\tif (shmem[idx].descriptor < 0) {\n+\t\tDBG(\"%s: ashmem_create_region() failed for size %zu: %s\", __PRETTY_FUNCTION__, size, strerror(errno));\n+\t\tshmem_amount --;\n+\t\tshmem = realloc(shmem, shmem_amount * sizeof(shmem_t));\n+\t\tpthread_mutex_unlock (&mutex);\n+\t\treturn -1;\n+\t}\n+\t//DBG(\"%s: ID %d shmid %x FD %d size %zu\", __PRETTY_FUNCTION__, idx, shmid, shmem[idx].descriptor, shmem[idx].size);\n+\t/*\n+\tstatus = ashmem_set_prot_region (shmem[idx].descriptor, 0666);\n+\tif (status < 0) {\n+\t\tDBG (\"%s: ashmem_set_prot_region() failed for size %zu: %s %d\", __PRETTY_FUNCTION__, size, strerror(status), status);\n+\t\tshmem_amount --;\n+\t\tshmem = realloc (shmem, shmem_amount * sizeof(shmem_t));\n+\t\tpthread_mutex_unlock (&mutex);\n+\t\treturn -1;\n+\t}\n+\t*/\n+\t/*\n+\tstatus = ashmem_pin_region (shmem[idx].descriptor, 0, shmem[idx].size);\n+\tif (status < 0) {\n+\t\tDBG (\"%s: ashmem_pin_region() failed for size %zu: %s %d\", __PRETTY_FUNCTION__, size, strerror(status), status);\n+\t\tshmem_amount --;\n+\t\tshmem = realloc (shmem, shmem_amount * sizeof(shmem_t));\n+\t\tpthread_mutex_unlock (&mutex);\n+\t\treturn -1;\n+\t}\n+\t*/\n+\tpthread_mutex_unlock(&mutex);\n+\n+\treturn shmid;\n+}\n+\n+/* Attach shared memory segment. */\n+void* android_shmat(int shmid, void const* shmaddr, int shmflg)\n+{\n+\tashv_check_pid();\n+\n+\tint socket_id = ashv_socket_id_from_shmid(shmid);\n+\tvoid *addr;\n+\n+\tpthread_mutex_lock(&mutex);\n+\n+\tint idx = ashv_find_local_index(shmid);\n+\tif (idx == -1 && socket_id != ashv_local_socket_id) {\n+\t\tidx = ashv_read_remote_segment(shmid);\n+\t}\n+\n+\tif (idx == -1) {\n+\t\tDBG (\"%s: shmid %x does not exist\", __PRETTY_FUNCTION__, shmid);\n+\t\tpthread_mutex_unlock(&mutex);\n+\t\terrno = EINVAL;\n+\t\treturn (void*) -1;\n+\t}\n+\n+\tif (shmem[idx].addr == NULL) {\n+\t\tshmem[idx].addr = mmap((void*) shmaddr, shmem[idx].size, PROT_READ | (shmflg == 0 ? PROT_WRITE : 0), MAP_SHARED, shmem[idx].descriptor, 0);\n+\t\tif (shmem[idx].addr == MAP_FAILED) {\n+\t\t\tDBG (\"%s: mmap() failed for ID %x FD %d: %s\", __PRETTY_FUNCTION__, idx, shmem[idx].descriptor, strerror(errno));\n+\t\t\tshmem[idx].addr = NULL;\n+\t\t}\n+\t}\n+\taddr = shmem[idx].addr;\n+\tDBG (\"%s: mapped addr %p for FD %d ID %d\", __PRETTY_FUNCTION__, addr, shmem[idx].descriptor, idx);\n+\tpthread_mutex_unlock (&mutex);\n+\n+\treturn addr ? addr : (void *)-1;\n+}\n+\n+/* Detach shared memory segment. */\n+int android_shmdt(void const* shmaddr)\n+{\n+\tashv_check_pid();\n+\n+\tpthread_mutex_lock(&mutex);\n+\tfor (size_t i = 0; i < shmem_amount; i++) {\n+\t\tif (shmem[i].addr == shmaddr) {\n+\t\t\tif (munmap(shmem[i].addr, shmem[i].size) != 0) {\n+\t\t\t\tDBG(\"%s: munmap %p failed\", __PRETTY_FUNCTION__, shmaddr);\n+\t\t\t}\n+\t\t\tshmem[i].addr = NULL;\n+\t\t\tDBG(\"%s: unmapped addr %p for FD %d ID %zu shmid %x\", __PRETTY_FUNCTION__, shmaddr, shmem[i].descriptor, i, shmem[i].id);\n+\t\t\tif (shmem[i].markedForDeletion || ashv_socket_id_from_shmid(shmem[i].id) != ashv_local_socket_id) {\n+\t\t\t\tDBG (\"%s: deleting shmid %x\", __PRETTY_FUNCTION__, shmem[i].id);\n+\t\t\t\tandroid_shmem_delete(i);\n+\t\t\t}\n+\t\t\tpthread_mutex_unlock(&mutex);\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\tpthread_mutex_unlock(&mutex);\n+\n+\tDBG(\"%s: invalid address %p\", __PRETTY_FUNCTION__, shmaddr);\n+\t/* Could be a remove segment, do not report an error for that. */\n+\treturn 0;\n+}\n+\n+/* Shared memory control operation. */\n+int android_shmctl(int shmid, int cmd, struct shmid_ds *buf)\n+{\n+\tashv_check_pid();\n+\n+\tif (cmd == IPC_RMID) {\n+\t\tDBG(\"%s: IPC_RMID for shmid=%x\", __PRETTY_FUNCTION__, shmid);\n+\t\tpthread_mutex_lock(&mutex);\n+\t\tint idx = ashv_find_local_index(shmid);\n+\t\tif (idx == -1) {\n+\t\t\tDBG(\"%s: shmid=%x does not exist locally\", __PRETTY_FUNCTION__, shmid);\n+\t\t\t/* We do not rm non-local regions, but do not report an error for that. */\n+\t\t\tpthread_mutex_unlock(&mutex);\n+\t\t\treturn 0;\n+\t\t}\n+\n+\t\tif (shmem[idx].addr) {\n+\t\t\t// shmctl(2): The segment will actually be destroyed only\n+\t\t\t// after the last process detaches it (i.e., when the shm_nattch\n+\t\t\t// member of the associated structure shmid_ds is zero.\n+\t\t\tshmem[idx].markedForDeletion = true;\n+\t\t} else {\n+\t\t\tandroid_shmem_delete(idx);\n+\t\t}\n+\t\tpthread_mutex_unlock(&mutex);\n+\t\treturn 0;\n+\t} else if (cmd == IPC_STAT) {\n+\t\tif (!buf) {\n+\t\t\tDBG (\"%s: ERROR: buf == NULL for shmid %x\", __PRETTY_FUNCTION__, shmid);\n+\t\t\terrno = EINVAL;\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tpthread_mutex_lock(&mutex);\n+\t\tint idx = ashv_find_local_index(shmid);\n+\t\tif (idx == -1) {\n+\t\t\tDBG (\"%s: ERROR: shmid %x does not exist\", __PRETTY_FUNCTION__, shmid);\n+\t\t\tpthread_mutex_unlock (&mutex);\n+\t\t\terrno = EINVAL;\n+\t\t\treturn -1;\n+\t\t}\n+\t\t/* Report max permissive mode */\n+\t\tmemset(buf, 0, sizeof(struct shmid_ds));\n+\t\tbuf->shm_segsz = shmem[idx].size;\n+\t\tbuf->shm_nattch = 1;\n+\t\tbuf->shm_perm.key = shmem[idx].key;\n+\t\tbuf->shm_perm.uid = geteuid();\n+\t\tbuf->shm_perm.gid = getegid();\n+\t\tbuf->shm_perm.cuid = geteuid();\n+\t\tbuf->shm_perm.cgid = getegid();\n+\t\tbuf->shm_perm.mode = 0666;\n+\t\tbuf->shm_perm.seq = 1;\n+\n+\t\tpthread_mutex_unlock (&mutex);\n+\t\treturn 0;\n+\t}\n+\n+\tDBG(\"%s: cmd %d not implemented yet!\", __PRETTY_FUNCTION__, cmd);\n+\terrno = EINVAL;\n+\treturn -1;\n+}\ndiff -uNr cairo-1.16.0/src/android-shmem.h cairo-1.16.0.mod/src/android-shmem.h\n--- cairo-1.16.0/src/android-shmem.h\t1970-01-01 03:00:00.000000000 +0300\n+++ cairo-1.16.0.mod/src/android-shmem.h\t2019-08-16 20:37:14.955977067 +0300\n@@ -0,0 +1,28 @@\n+#ifndef _SYS_SHM_H\n+#define _SYS_SHM_H\n+\n+#include <linux/shm.h>\n+#include <stdint.h>\n+#include <sys/types.h>\n+\n+__BEGIN_DECLS\n+\n+#ifndef shmid_ds\n+# define shmid_ds shmid64_ds\n+#endif\n+\n+/* Shared memory control operations. */\n+int android_shmctl(int shmid, int cmd, struct shmid_ds* buf);\n+\n+/* Get shared memory area identifier. */\n+int android_shmget(key_t key, size_t size, int shmflg);\n+\n+/* Attach shared memory segment. */\n+void *android_shmat(int shmid, void const* shmaddr, int shmflg);\n+\n+/* Detach shared memory segment. */\n+int android_shmdt(void const* shmaddr);\n+\n+__END_DECLS\n+\n+#endif\ndiff -uNr cairo-1.16.0/src/cairo.pc.in cairo-1.16.0.mod/src/cairo.pc.in\n--- cairo-1.16.0/src/cairo.pc.in\t2018-08-17 04:10:53.000000000 +0300\n+++ cairo-1.16.0.mod/src/cairo.pc.in\t2019-08-16 20:37:14.955977067 +0300\n@@ -9,5 +9,5 @@\n \n @PKGCONFIG_REQUIRES@: @CAIRO_REQUIRES@\n Libs: -L${libdir} -lcairo\n-Libs.private: @CAIRO_NONPKGCONFIG_LIBS@\n+Libs.private: @CAIRO_NONPKGCONFIG_LIBS@ -llog\n Cflags: -I${includedir}/cairo\ndiff -uNr cairo-1.16.0/src/cairo-xcb-connection.c cairo-1.16.0.mod/src/cairo-xcb-connection.c\n--- cairo-1.16.0/src/cairo-xcb-connection.c\t2018-08-17 04:10:53.000000000 +0300\n+++ cairo-1.16.0.mod/src/cairo-xcb-connection.c\t2019-08-16 20:38:23.676405816 +0300\n@@ -32,6 +32,7 @@\n \n #include \"cairoint.h\"\n \n+#include \"android-shmem.h\"\n #include \"cairo-xcb-private.h\"\n #include \"cairo-hash-private.h\"\n #include \"cairo-freelist-private.h\"\n@@ -43,7 +44,6 @@\n \n #if CAIRO_HAS_XCB_SHM_FUNCTIONS\n #include <sys/ipc.h>\n-#include <sys/shm.h>\n #include <xcb/shm.h>\n #endif\n \n@@ -452,13 +452,13 @@\n     uint32_t shmseg;\n     void *ptr;\n \n-    shmid = shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600);\n+    shmid = android_shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600);\n     if (shmid == -1)\n \treturn FALSE;\n \n-    ptr = shmat (shmid, NULL, 0);\n+    ptr = android_shmat (shmid, NULL, 0);\n     if (ptr == (char *) -1) {\n-\tshmctl (shmid, IPC_RMID, NULL);\n+\tandroid_shmctl (shmid, IPC_RMID, NULL);\n \treturn FALSE;\n     }\n \n@@ -475,8 +475,8 @@\n     if (error != NULL)\n \tsuccess = FALSE;\n \n-    shmctl (shmid, IPC_RMID, NULL);\n-    shmdt (ptr);\n+    android_shmctl (shmid, IPC_RMID, NULL);\n+    android_shmdt (ptr);\n \n     return success;\n }\ndiff -uNr cairo-1.16.0/src/cairo-xcb-shm.c cairo-1.16.0.mod/src/cairo-xcb-shm.c\n--- cairo-1.16.0/src/cairo-xcb-shm.c\t2018-08-17 04:10:53.000000000 +0300\n+++ cairo-1.16.0.mod/src/cairo-xcb-shm.c\t2019-08-16 20:37:48.552853136 +0300\n@@ -38,13 +38,13 @@\n \n #if CAIRO_HAS_XCB_SHM_FUNCTIONS\n \n+#include \"android-shmem.h\"\n #include \"cairo-xcb-private.h\"\n #include \"cairo-list-inline.h\"\n #include \"cairo-mempool-private.h\"\n \n #include <xcb/shm.h>\n #include <sys/ipc.h>\n-#include <sys/shm.h>\n #include <errno.h>\n \n #define CAIRO_MAX_SHM_MEMORY (16*1024*1024)\n@@ -75,7 +75,7 @@\n {\n     cairo_list_del (&pool->link);\n \n-    shmdt (pool->shm);\n+    android_shmdt (pool->shm);\n     _cairo_mempool_fini (&pool->mem);\n \n     free (pool);\n@@ -221,7 +221,7 @@\n     bytes <<= 3;\n \n     do {\n-\tpool->shmid = shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600);\n+\tpool->shmid = android_shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600);\n \tif (pool->shmid != -1)\n \t    break;\n \n@@ -240,9 +240,9 @@\n \treturn CAIRO_INT_STATUS_UNSUPPORTED;\n     }\n \n-    pool->shm = shmat (pool->shmid, NULL, 0);\n+    pool->shm = android_shmat (pool->shmid, NULL, 0);\n     if (unlikely (pool->shm == (char *) -1)) {\n-\tshmctl (pool->shmid, IPC_RMID, NULL);\n+\tandroid_shmctl (pool->shmid, IPC_RMID, NULL);\n \tfree (pool);\n \tCAIRO_MUTEX_UNLOCK (connection->shm_mutex);\n \treturn _cairo_error (CAIRO_STATUS_NO_MEMORY);\n@@ -251,14 +251,14 @@\n     status = _cairo_mempool_init (&pool->mem, pool->shm, bytes,\n \t\t\t\t  minbits, maxbits - minbits + 1);\n     if (unlikely (status)) {\n-\tshmdt (pool->shm);\n+\tandroid_shmdt (pool->shm);\n \tfree (pool);\n \tCAIRO_MUTEX_UNLOCK (connection->shm_mutex);\n \treturn status;\n     }\n \n     pool->shmseg = _cairo_xcb_connection_shm_attach (connection, pool->shmid, FALSE);\n-    shmctl (pool->shmid, IPC_RMID, NULL);\n+    android_shmctl (pool->shmid, IPC_RMID, NULL);\n \n     cairo_list_add (&pool->link, &connection->shm_pools);\n     mem = _cairo_mempool_alloc (&pool->mem, size);\ndiff -uNr cairo-1.16.0/src/cairo-xlib-surface.c cairo-1.16.0.mod/src/cairo-xlib-surface.c\n--- cairo-1.16.0/src/cairo-xlib-surface.c\t2018-08-17 04:10:53.000000000 +0300\n+++ cairo-1.16.0.mod/src/cairo-xlib-surface.c\t2019-08-16 20:37:56.532902932 +0300\n@@ -70,7 +70,6 @@\n \n #include <X11/extensions/XShm.h>\n #include <sys/ipc.h>\n-#include <sys/shm.h>\n \n #define XLIB_COORD_MAX 32767\n \n@@ -1390,7 +1389,7 @@\n     *image_extra = NULL;\n     *image_out = (cairo_image_surface_t *)\n \t_cairo_xlib_surface_get_shm (abstract_surface, FALSE);\n-    if (*image_out) \n+    if (*image_out)\n \t    return (*image_out)->base.status;\n \n     extents.x = extents.y = 0;\ndiff -uNr cairo-1.16.0/src/cairo-xlib-surface-shm.c cairo-1.16.0.mod/src/cairo-xlib-surface-shm.c\n--- cairo-1.16.0/src/cairo-xlib-surface-shm.c\t2018-08-17 04:10:53.000000000 +0300\n+++ cairo-1.16.0.mod/src/cairo-xlib-surface-shm.c\t2019-08-16 20:38:09.702985163 +0300\n@@ -39,6 +39,7 @@\n \n #if !CAIRO_HAS_XLIB_XCB_FUNCTIONS\n \n+#include \"android-shmem.h\"\n #include \"cairo-xlib-private.h\"\n #include \"cairo-xlib-surface-private.h\"\n \n@@ -150,7 +151,6 @@\n #include <X11/extensions/shmstr.h>\n #endif\n #include <sys/ipc.h>\n-#include <sys/shm.h>\n \n #define MIN_PIXMAP_SIZE 4096\n \n@@ -372,14 +372,14 @@\n \n     XShmQueryVersion (dpy, &major, &minor, has_pixmap);\n \n-    shm.shmid = shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600);\n+    shm.shmid = android_shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600);\n     if (shm.shmid == -1)\n \treturn FALSE;\n \n     shm.readOnly = FALSE;\n-    shm.shmaddr = shmat (shm.shmid, NULL, 0);\n+    shm.shmaddr = android_shmat (shm.shmid, NULL, 0);\n     if (shm.shmaddr == (char *) -1) {\n-\tshmctl (shm.shmid, IPC_RMID, NULL);\n+\tandroid_shmctl (shm.shmid, IPC_RMID, NULL);\n \treturn FALSE;\n     }\n \n@@ -398,8 +398,8 @@\n     XSetErrorHandler (old_handler);\n     XUnlockDisplay (dpy);\n \n-    shmctl (shm.shmid, IPC_RMID, NULL);\n-    shmdt (shm.shmaddr);\n+    android_shmctl (shm.shmid, IPC_RMID, NULL);\n+    android_shmdt (shm.shmaddr);\n \n     return success && ! _x_error_occurred;\n }\n@@ -420,7 +420,7 @@\n _cairo_xlib_display_shm_pool_destroy (cairo_xlib_display_t *display,\n \t\t\t\t      cairo_xlib_shm_t *pool)\n {\n-    shmdt (pool->shm.shmaddr);\n+    android_shmdt (pool->shm.shmaddr);\n     if (display->display) /* may be called after CloseDisplay */\n \tXShmDetach (display->display, &pool->shm);\n \n@@ -584,18 +584,18 @@\n \n     minbits += (maxbits - 16) / 2;\n \n-    pool->shm.shmid = shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600);\n+    pool->shm.shmid = android_shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600);\n     while (pool->shm.shmid == -1 && bytes >= 2*size) {\n \tbytes >>= 1;\n-\tpool->shm.shmid = shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600);\n+\tpool->shm.shmid = android_shmget (IPC_PRIVATE, bytes, IPC_CREAT | 0600);\n     }\n     if (pool->shm.shmid == -1)\n \tgoto cleanup;\n \n     pool->shm.readOnly = FALSE;\n-    pool->shm.shmaddr = shmat (pool->shm.shmid, NULL, 0);\n+    pool->shm.shmaddr = android_shmat (pool->shm.shmid, NULL, 0);\n     if (pool->shm.shmaddr == (char *) -1) {\n-\tshmctl (pool->shm.shmid, IPC_RMID, NULL);\n+\tandroid_shmctl (pool->shm.shmid, IPC_RMID, NULL);\n \tgoto cleanup;\n     }\n \n@@ -604,7 +604,7 @@\n #if !IPC_RMID_DEFERRED_RELEASE\n     XSync (dpy, FALSE);\n #endif\n-    shmctl (pool->shm.shmid, IPC_RMID, NULL);\n+    android_shmctl (pool->shm.shmid, IPC_RMID, NULL);\n \n     if (! success)\n \tgoto cleanup_shm;\n@@ -622,7 +622,7 @@\n cleanup_detach:\n     XShmDetach (dpy, &pool->shm);\n cleanup_shm:\n-    shmdt (pool->shm.shmaddr);\n+    android_shmdt (pool->shm.shmaddr);\n cleanup:\n     free (pool);\n     return NULL;\n@@ -1307,14 +1307,14 @@\n     XShmCompletionEvent ev;\n     XShmSegmentInfo info;\n \n-    info.shmid = shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600);\n+    info.shmid = android_shmget (IPC_PRIVATE, 0x1000, IPC_CREAT | 0600);\n     if (info.shmid == -1)\n \treturn TRUE;\n \n     info.readOnly = FALSE;\n-    info.shmaddr = shmat (info.shmid, NULL, 0);\n+    info.shmaddr = android_shmat (info.shmid, NULL, 0);\n     if (info.shmaddr == (char *) -1) {\n-\tshmctl (info.shmid, IPC_RMID, NULL);\n+\tandroid_shmctl (info.shmid, IPC_RMID, NULL);\n \treturn TRUE;\n     }\n \n@@ -1343,8 +1343,8 @@\n     XSetErrorHandler (old_handler);\n     XUnlockDisplay (dpy);\n \n-    shmctl (info.shmid, IPC_RMID, NULL);\n-    shmdt (info.shmaddr);\n+    android_shmctl (info.shmid, IPC_RMID, NULL);\n+    android_shmdt (info.shmaddr);\n \n     return _x_error_occurred;\n }\ndiff -uNr cairo-1.16.0/src/Makefile.am cairo-1.16.0.mod/src/Makefile.am\n--- cairo-1.16.0/src/Makefile.am\t2018-08-17 04:10:53.000000000 +0300\n+++ cairo-1.16.0.mod/src/Makefile.am\t2019-08-16 20:37:14.955977067 +0300\n@@ -35,7 +35,7 @@\n \t$(enabled_cairo_cxx_sources) \\\n \t$(NULL)\n libcairo_cxx_la_LDFLAGS = $(AM_LDFLAGS) $(export_symbols)\n-libcairo_cxx_la_LIBADD = $(CAIRO_LIBS)\n+libcairo_cxx_la_LIBADD = $(CAIRO_LIBS) -llog\n libcairo_cxx_la_DEPENDENCIES = $(cairo_def_dependency)\n \n \n@@ -46,7 +46,7 @@\n \t$(NULL)\n libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)\n libcairo_la_LIBADD = $(CAIRO_LIBS) \\\n-\t$(cairo_cxx_lib)\n+\t$(cairo_cxx_lib) -llog\n libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(cairo_cxx_lib)\n \n # Special headers\ndiff -uNr cairo-1.16.0/src/Makefile.in cairo-1.16.0.mod/src/Makefile.in\n--- cairo-1.16.0/src/Makefile.in\t2018-10-19 23:20:07.000000000 +0300\n+++ cairo-1.16.0.mod/src/Makefile.in\t2019-08-16 20:37:14.959310422 +0300\n@@ -568,7 +568,7 @@\n \tcairo-svg-surface.c test-compositor-surface.c \\\n \ttest-null-compositor-surface.c test-base-compositor-surface.c \\\n \ttest-paginated-surface.c cairo-tee-surface.c \\\n-\tcairo-xml-surface.c cairo-version.h\n+\tcairo-xml-surface.c cairo-version.h android-shmem.c\n am__objects_1 =\n @CAIRO_HAS_XLIB_SURFACE_TRUE@am__objects_2 = $(am__objects_1)\n @CAIRO_HAS_XLIB_XRENDER_SURFACE_TRUE@am__objects_3 = $(am__objects_1)\n@@ -780,7 +780,7 @@\n AM_V_lt = $(am__v_lt_@AM_V@)\n am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\n am__v_lt_0 = --silent\n-am__v_lt_1 = \n+am__v_lt_1 =\n libcairo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n \t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n \t$(libcairo_la_LDFLAGS) $(LDFLAGS) -o $@\n@@ -896,11 +896,11 @@\n AM_V_GEN = $(am__v_GEN_@AM_V@)\n am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\n am__v_GEN_0 = @echo \"  GEN     \" $@;\n-am__v_GEN_1 = \n+am__v_GEN_1 =\n AM_V_at = $(am__v_at_@AM_V@)\n am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\n am__v_at_0 = @\n-am__v_at_1 = \n+am__v_at_1 =\n DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)\n depcomp = $(SHELL) $(top_srcdir)/build/depcomp\n am__depfiles_maybe = depfiles\n@@ -914,7 +914,7 @@\n AM_V_CC = $(am__v_CC_@AM_V@)\n am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\n am__v_CC_0 = @echo \"  CC      \" $@;\n-am__v_CC_1 = \n+am__v_CC_1 =\n CCLD = $(CC)\n LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n \t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n@@ -922,7 +922,7 @@\n AM_V_CCLD = $(am__v_CCLD_@AM_V@)\n am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\n am__v_CCLD_0 = @echo \"  CCLD    \" $@;\n-am__v_CCLD_1 = \n+am__v_CCLD_1 =\n CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n \t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \\\n@@ -932,7 +932,7 @@\n AM_V_CXX = $(am__v_CXX_@AM_V@)\n am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)\n am__v_CXX_0 = @echo \"  CXX     \" $@;\n-am__v_CXX_1 = \n+am__v_CXX_1 =\n CXXLD = $(CXX)\n CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \\\n \t$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \\\n@@ -940,7 +940,7 @@\n AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)\n am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)\n am__v_CXXLD_0 = @echo \"  CXXLD   \" $@;\n-am__v_CXXLD_1 = \n+am__v_CXXLD_1 =\n SOURCES = $(libcairo_la_SOURCES) $(nodist_libcairo_la_SOURCES) \\\n \t$(libcairo_cxx_la_SOURCES) check-link.c\n DIST_SOURCES = $(am__libcairo_la_SOURCES_DIST) \\\n@@ -1177,7 +1177,7 @@\n CAIROBOILERPLATE_LIBS = @CAIROBOILERPLATE_LIBS@\n CAIRO_CFLAGS = @CAIRO_CFLAGS@\n CAIRO_LDFLAGS = @CAIRO_LDFLAGS@\n-CAIRO_LIBS = @CAIRO_LIBS@\n+CAIRO_LIBS = @CAIRO_LIBS@ -llog\n CAIRO_LIBTOOL_VERSION_INFO = @CAIRO_LIBTOOL_VERSION_INFO@\n CAIRO_NONPKGCONFIG_CFLAGS = @CAIRO_NONPKGCONFIG_CFLAGS@\n CAIRO_NONPKGCONFIG_LIBS = @CAIRO_NONPKGCONFIG_LIBS@\n@@ -1390,7 +1390,7 @@\n \tcairo-supported-features.h\n EXTRA_DIST = Makefile.win32 Makefile.win32.features $(TESTS_SH) \\\n \tcheck-has-hidden-symbols.c check-doc-syntax.awk\n-EXTRA_LTLIBRARIES = \n+EXTRA_LTLIBRARIES =\n MAINTAINERCLEANFILES = Makefile.in\n cairo_headers = cairo.h cairo-deprecated.h\n cairo_private = cairoint.h cairo-analysis-surface-private.h \\\n@@ -1901,7 +1901,7 @@\n cairoinclude_HEADERS = $(enabled_cairo_headers) \\\n \t$(top_srcdir)/cairo-version.h\n lib_LTLIBRARIES = libcairo.la\n-@BUILD_CXX_FALSE@cairo_cxx_lib = \n+@BUILD_CXX_FALSE@cairo_cxx_lib =\n @BUILD_CXX_TRUE@cairo_cxx_lib = libcairo_cxx.la\n noinst_LTLIBRARIES = $(cairo_cxx_lib)\n libcairo_cxx_la_SOURCES = \\\n@@ -2103,10 +2103,10 @@\n \t  rm -f $${locs}; \\\n \t}\n \n-libcairo.la: $(libcairo_la_OBJECTS) $(libcairo_la_DEPENDENCIES) $(EXTRA_libcairo_la_DEPENDENCIES) \n+libcairo.la: $(libcairo_la_OBJECTS) $(libcairo_la_DEPENDENCIES) $(EXTRA_libcairo_la_DEPENDENCIES)\n \t$(AM_V_CCLD)$(libcairo_la_LINK) -rpath $(libdir) $(libcairo_la_OBJECTS) $(libcairo_la_LIBADD) $(LIBS)\n \n-libcairo_cxx.la: $(libcairo_cxx_la_OBJECTS) $(libcairo_cxx_la_DEPENDENCIES) $(EXTRA_libcairo_cxx_la_DEPENDENCIES) \n+libcairo_cxx.la: $(libcairo_cxx_la_OBJECTS) $(libcairo_cxx_la_DEPENDENCIES) $(EXTRA_libcairo_cxx_la_DEPENDENCIES)\n \t$(AM_V_CXXLD)$(libcairo_cxx_la_LINK) $(am_libcairo_cxx_la_rpath) $(libcairo_cxx_la_OBJECTS) $(libcairo_cxx_la_LIBADD) $(LIBS)\n \n clean-checkPROGRAMS:\n@@ -2118,7 +2118,7 @@\n \techo \" rm -f\" $$list; \\\n \trm -f $$list\n \n-check-link$(EXEEXT): $(check_link_OBJECTS) $(check_link_DEPENDENCIES) $(EXTRA_check_link_DEPENDENCIES) \n+check-link$(EXEEXT): $(check_link_OBJECTS) $(check_link_DEPENDENCIES) $(EXTRA_check_link_DEPENDENCIES)\n \t@rm -f check-link$(EXEEXT)\n \t$(AM_V_CCLD)$(LINK) $(check_link_OBJECTS) $(check_link_LDADD) $(LIBS)\n \ndiff -uNr cairo-1.16.0/src/Makefile.sources cairo-1.16.0.mod/src/Makefile.sources\n--- cairo-1.16.0/src/Makefile.sources\t2018-10-18 03:21:03.000000000 +0300\n+++ cairo-1.16.0.mod/src/Makefile.sources\t2019-08-16 20:37:14.959310422 +0300\n@@ -240,6 +240,7 @@\n \tcairo-version.c \\\n \tcairo-wideint.c \\\n \tcairo.c \\\n+\tandroid-shmem.c \\\n \t$(NULL)\n \n _cairo_font_subset_private = \\\n"
  },
  {
    "path": "packages/libcairo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://cairographics.org\nTERMUX_PKG_DESCRIPTION=\"Cairo 2D vector graphics library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.16.0\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/cairo-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331\nTERMUX_PKG_DEPENDS=\"fontconfig, freetype, glib, liblzo, libpixman, libpng, libx11, libxcb, libxext, libxrender, zlib\"\nTERMUX_PKG_BREAKS=\"libcairo-dev, libcairo-gobject\"\nTERMUX_PKG_REPLACES=\"libcairo-dev, libcairo-gobject\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-gtk-doc-html\n--disable-gl\n--enable-gobject\n--enable-pdf\n--enable-svg\n--enable-ps\n\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gtk-doc/html\"\n\ntermux_step_pre_configure() {\n\tautoreconf -fi\n}\n"
  },
  {
    "path": "packages/libcairo/cairo-script-operators.c.patch",
    "content": "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\n--- cairo-1.14.12/util/cairo-script/cairo-script-operators.c\t2017-12-05 00:26:25.000000000 +0200\n+++ cairo-1.14.12.mod/util/cairo-script/cairo-script-operators.c\t2018-06-19 17:48:57.767824702 +0300\n@@ -1719,7 +1719,7 @@\n static void *\n _mmap_bytes (const struct mmap_vec *vec, int count)\n {\n-    char template[] = \"/tmp/csi-font.XXXXXX\";\n+    char template[] = \"@TERMUX_PREFIX@/tmp/csi-font.XXXXXX\";\n     void *ptr;\n     int fd;\n     int num_bytes;\n"
  },
  {
    "path": "packages/libcairo/fdr.c.patch",
    "content": "diff -uNr cairo-1.14.12/util/cairo-fdr/fdr.c cairo-1.14.12.mod/util/cairo-fdr/fdr.c\n--- cairo-1.14.12/util/cairo-fdr/fdr.c\t2017-12-05 00:24:46.000000000 +0200\n+++ cairo-1.14.12.mod/util/cairo-fdr/fdr.c\t2017-12-17 13:40:14.062948088 +0200\n@@ -67,7 +67,7 @@\n     cairo_device_t *ctx;\n     int n;\n \n-    ctx = DLCALL (cairo_script_create, \"/tmp/fdr.trace\");\n+    ctx = DLCALL (cairo_script_create, \"@TERMUX_PREFIX@/tmp/fdr.trace\");\n \n     for (n = fdr_position; n < RINGBUFFER_SIZE; n++)\n \tfdr_replay_to_script (fdr_ringbuffer[n], ctx);\n"
  },
  {
    "path": "packages/libcap/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sites.google.com/site/fullycapable/\nTERMUX_PKG_DESCRIPTION=\"POSIX 1003.1e capabilities\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.27\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=dac1792d0118bee6aae6ba7fb93ff1602c6a9bda812fd63916eee1435b9c486a\nTERMUX_PKG_DEPENDS=\"attr\"\nTERMUX_PKG_BREAKS=\"libcap-dev\"\nTERMUX_PKG_REPLACES=\"libcap-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake CC=\"$CC -Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags\" PREFIX=\"$TERMUX_PREFIX\"\n}\n\ntermux_step_make_install() {\n\tmake CC=\"$CC -Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags\" prefix=\"$TERMUX_PREFIX\" RAISE_SETFCAP=no lib=/lib install\n}\n"
  },
  {
    "path": "packages/libcap/libcap-makefile.patch",
    "content": "diff -uNr libcap-2.26/libcap/Makefile libcap-2.26.mod/libcap/Makefile\n--- libcap-2.26/libcap/Makefile\t2018-09-11 06:02:10.000000000 +0300\n+++ libcap-2.26.mod/libcap/Makefile\t2019-03-18 21:53:27.413691421 +0200\n@@ -35,7 +35,7 @@\n \t\t$< >$@\n \n _makenames: _makenames.c cap_names.list.h\n-\t$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@\n+\tgcc $(BUILD_CFLAGS) $< -o $@\n \n cap_names.h: _makenames\n \t./_makenames > cap_names.h\n"
  },
  {
    "path": "packages/libcap/progs-capsh.patch",
    "content": "diff -uNr libcap-2.26/progs/capsh.c libcap-2.26.mod/progs/capsh.c\n--- libcap-2.26/progs/capsh.c\t2018-09-08 23:07:52.000000000 +0300\n+++ libcap-2.26.mod/progs/capsh.c\t2019-03-05 19:42:47.917246690 +0200\n@@ -692,10 +692,10 @@\n \t} else if (!strcmp(\"--print\", argv[i])) {\n \t    arg_print();\n \t} else if ((!strcmp(\"--\", argv[i])) || (!strcmp(\"==\", argv[i]))) {\n-\t    argv[i] = strdup(argv[i][0] == '-' ? \"/bin/bash\" : argv[0]);\n+\t    argv[i] = strdup(argv[i][0] == '-' ? \"@TERMUX_PREFIX@/bin/bash\" : argv[0]);\n \t    argv[argc] = NULL;\n \t    execve(argv[i], argv+i, envp);\n-\t    fprintf(stderr, \"execve /bin/bash failed!\\n\");\n+\t    fprintf(stderr, \"execve @TERMUX_PREFIX@/bin/bash failed!\\n\");\n \t    exit(1);\n \t} else {\n \tusage:\n@@ -720,7 +720,7 @@\n \t\t   \"  --killit=<n>   send signal(n) to child\\n\"\n \t\t   \"  --forkfor=<n>  fork and make child sleep for <n> sec\\n\"\n \t\t   \"  ==             re-exec(capsh) with args as for --\\n\"\n-\t\t   \"  --             remaing arguments are for /bin/bash\\n\"\n+\t\t   \"  --             remaing arguments are for $PREFIX/bin/bash\\n\"\n \t\t   \"                 (without -- [%s] will simply exit(0))\\n\",\n \t\t   argv[0], argv[0]);\n \n"
  },
  {
    "path": "packages/libcln/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.ginac.de/CLN/\nTERMUX_PKG_DESCRIPTION=\"CLN is a library for efficient computations with all kinds of numbers in arbitrary precision\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.3.5\nTERMUX_PKG_SRCURL=https://www.ginac.de/CLN/cln-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=78810064a50b4299a0a3c16cade54a7d2e72ac92a8ee295f9a9177efc81e842d\nTERMUX_PKG_DEPENDS=\"libc++, libgmp\"\nTERMUX_PKG_BREAKS=\"libcln-dev\"\nTERMUX_PKG_REPLACES=\"libcln-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = arm ]; then\n\t\t# See the following section in INSTALL:\n\t\t# \"(*) On these platforms, problems with the assembler routines have been\n\t\t# reported. It may be best to add \"-DNO_ASM\" to CPPFLAGS before configuring.\"\n\t\tCPPFLAGS+=\" -DNO_ASM\"\n\t\tCXXFLAGS+=\" -fintegrated-as\"\n\tfi\n\n\tsed -i -e 's%tests/Makefile %%' configure.ac\n\tsed -i -e 's%examples/Makefile %%' configure.ac\n\tsed -i -e 's%benchmarks/Makefile %%' configure.ac\n\n\tautoreconf\n}\n\ntermux_step_post_configure() {\n\tcd $TERMUX_PKG_SRCDIR\n\tsed -i -e 's% tests%%' Makefile\n\tsed -i -e 's% examples%%' Makefile\n\tsed -i -e 's% benchmarks%%' Makefile\n}\n"
  },
  {
    "path": "packages/libcln/revert_configure_tests.patch",
    "content": "Reverts this commit in the cln repo:\n\ncommit 2f7994014542920ad6ca726fbd8d023a5f49abc2\nAuthor: Richard Kreckel <kreckel@ginac.de>\nDate:   Sun Oct 27 14:57:36 2019 +0100\n\n    Replace typedef int[<negative>] trick with static_assert.\n\ndiff -u -r ../src/m4/floatparam.m4 ./m4/floatparam.m4\n--- ../src/m4/floatparam.m4\t2019-10-27 14:41:55.000000000 +0100\n+++ ./m4/floatparam.m4\t2019-11-28 08:21:28.161830204 +0100\n@@ -22,16 +22,20 @@\n         epsilon_bits=-1; y=\"($type)1.0\"\n         while true; do\n           AC_TRY_COMPILE([],\n-            [static_assert((($type)(($type)1.0 + ($type)($y)) == ($type)1.0)\n-                         || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y), \"\");],\n+            [typedef int verify[2*(\n+               (($type)(($type)1.0 + ($type)($y)) == ($type)1.0)\n+               || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y)\n+             ) - 1];],\n             [break;])\n           epsilon_bits=`expr $epsilon_bits + 1`; y=\"$y * ($type)0.5\"\n         done\n         negepsilon_bits=-1; y=\"($type)-1.0\"\n         while true; do\n           AC_TRY_COMPILE([],\n-            [static_assert((($type)(($type)1.0 + ($type)($y)) == ($type)1.0)\n-                         || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y), \"\");],\n+            [typedef int verify[2*(\n+               (($type)(($type)1.0 + ($type)($y)) == ($type)1.0)\n+               || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y)\n+             ) - 1];],\n             [break;])\n           negepsilon_bits=`expr $negepsilon_bits + 1`; y=\"$y * ($type)0.5\"\n         done\n@@ -64,22 +68,30 @@\n         rounds=\n         if test -z \"$rounds\"; then\n           AC_TRY_COMPILE([],\n-            [static_assert($ys1 == $y1 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z2, \"\");],\n+            [typedef int verify[2*(\n+               $ys1 == $y1 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z2\n+             ) - 1];],\n             [rounds=rounds_to_nearest])\n         fi\n         if test -z \"$rounds\"; then\n           AC_TRY_COMPILE([],\n-            [static_assert($ys1 == $y1 && $ys2 == $y1 && $zs1 == $z1 && $zs2 == $z1, \"\");],\n+            [typedef int verify[2*(\n+               $ys1 == $y1 && $ys2 == $y1 && $zs1 == $z1 && $zs2 == $z1\n+             ) - 1];],\n             [rounds=rounds_to_zero])\n         fi\n         if test -z \"$rounds\"; then\n           AC_TRY_COMPILE([],\n-            [static_assert($ys1 == $y2 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z1, \"\");],\n+            [typedef int verify[2*(\n+               $ys1 == $y2 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z1\n+             ) - 1];],\n             [rounds=rounds_to_infinity])\n         fi\n         if test -z \"$rounds\"; then\n           AC_TRY_COMPILE([],\n-            [static_assert($ys1 == $y1 && $ys2 == $y1 && $zs1 == $z2 && $zs2 == $z2, \"\");],\n+            [typedef int verify[2*(\n+               $ys1 == $y1 && $ys2 == $y1 && $zs1 == $z2 && $zs2 == $z2\n+             ) - 1];],\n             [rounds=rounds_to_minus_infinity])\n         fi\n         if test -n \"$rounds\"; then\ndiff -u -r ../src/m4/intparam.m4 ./m4/intparam.m4\n--- ../src/m4/intparam.m4\t2019-11-02 17:04:20.000000000 +0100\n+++ ./m4/intparam.m4\t2019-11-28 08:21:28.161830204 +0100\n@@ -113,7 +113,7 @@\n         echo \"#error \\\"Integer types long long and unsigned long long have different sizes!!\\\"\"\n       fi\n     fi\n-    AC_TRY_COMPILE([], [static_assert(sizeof(char*) <= sizeof(intptr_t), \"\");],\n+    AC_TRY_COMPILE([], [typedef int verify[2*(sizeof(char*)<=sizeof (long))-1];],\n       [], [echo \"#error \\\"Type char * does not fit into an intptr_t!!\\\"\"])\n     _AC_COMPUTE_INT([sizeof (char *)], [pointer_size])\n     pointer_bitsize=`expr $pointer_size '*' $char_bitsize`\n@@ -258,7 +258,7 @@\n [\n   n=1; x=\"($1)2\"\n   while true; do\n-    AC_TRY_COMPILE([], [static_assert(($1)($x) == 0, \"\");],\n+    AC_TRY_COMPILE([], [typedef int verify[2*(($1)($x) == 0) - 1];],\n       [$2=$n; break;],\n       [if test $n = 1000; then $2=; break; fi;])\n     n=`expr $n + 1`; x=\"$x * ($1)2\"\n@@ -290,7 +290,7 @@\n #else\n # define alignof(type)  offsetof (struct { char slot1; type slot2; }, slot2)\n #endif\n-], [static_assert(alignof($1) == $n, \"\");],\n+], [typedef int verify[2*(alignof($1) == $n) - 1];],\n       [$2=$n; break;]\n       [if test $n = 0; then $2=; break; fi])\n     n=`expr $n '*' 2`\n--- ../src/include/cln/number.h\t2019-10-27 14:29:45.000000000 +0100\n+++ ./include/cln/number.h\t2019-11-28 08:21:28.161830204 +0100\n@@ -257,8 +257,7 @@\n inline const type& the(const cl_number& x)\n {\n \t// check that sizeof(type)==sizeof(cl_number)\n-\tstatic_assert(sizeof(type)==sizeof(cl_number),\n-\t              \"sizeof(type)!=sizeof(cl_number)\");\n+\tint (*dummy1)(int assertion1 [1 - 2 * (sizeof(type) != sizeof(cl_number))]); (void)dummy1;\n \treturn *(const type *) &x;\n }\n // Conversions to subtypes without checking, macro version:\n"
  },
  {
    "path": "packages/libcln/src-base-low-cl_low_div.cc.patch",
    "content": "diff -u -r ../cln-1.3.4/src/base/low/cl_low_div.cc ./src/base/low/cl_low_div.cc\n--- ../cln-1.3.4/src/base/low/cl_low_div.cc\t2011-04-08 21:07:28.000000000 +0000\n+++ ./src/base/low/cl_low_div.cc\t2017-01-17 23:06:55.460210789 +0000\n@@ -10,11 +10,11 @@\n // Implementation.\n \n #ifdef NEED_VAR_divu_16_rest\n-uint16 divu_16_rest;\n+extern \"C\" { uint16 divu_16_rest; }\n #endif\n \n #ifdef NEED_FUNCTION_divu_3216_1616_\n-uint16 divu_16_rest;\n+extern \"C\" { uint16 divu_16_rest; }\n namespace cln {\n #if 1\n // Most processors have a good 32 by 32 bit division, use that.\n@@ -101,11 +101,11 @@\n #endif\n \n #ifdef NEED_VAR_divu_32_rest\n-uint32 divu_32_rest;\n+extern \"C\" { uint32 divu_32_rest; }\n #endif\n \n #ifdef NEED_FUNCTION_divu_6432_3232_\n-uint32 divu_32_rest;\n+extern \"C\" { uint32 divu_32_rest; }\n namespace cln {\n uint32 divu_6432_3232_(uint32 xhi, uint32 xlo, uint32 y)\n // Methode:\n@@ -207,7 +207,7 @@\n #endif\n \n #ifdef NEED_VAR_divu_64_rest\n-uint64 divu_64_rest;\n+extern \"C\" { uint64 divu_64_rest; }\n #endif\n \n #ifdef NEED_FUNCTION_divu_6464_6464_\n"
  },
  {
    "path": "packages/libcln/src-base-low-cl_low_mul.cc.patch",
    "content": "diff -u -r ../cln-1.3.4/src/base/low/cl_low_mul.cc ./src/base/low/cl_low_mul.cc\n--- ../cln-1.3.4/src/base/low/cl_low_mul.cc\t2011-04-08 21:06:30.000000000 +0000\n+++ ./src/base/low/cl_low_mul.cc\t2017-01-17 23:08:39.856001383 +0000\n@@ -10,11 +10,11 @@\n // Implementation.\n \n #ifdef NEED_VAR_mulu32_high\n-uint32 mulu32_high;\n+extern \"C\" { uint32 mulu32_high; }\n #endif\n \n #ifdef NEED_FUNCTION_mulu32_\n-uint32 mulu32_high;\n+extern \"C\" { uint32 mulu32_high; }\n namespace cln {\n uint32 mulu32_ (uint32 x, uint32 y)\n {\n@@ -50,11 +50,11 @@\n \n \n #ifdef NEED_VAR_mulu64_high\n-uint64 mulu64_high;\n+extern \"C\" { uint64 mulu64_high; }\n #endif\n \n #ifdef NEED_FUNCTION_mulu64_\n-uint64 mulu64_high;\n+extern \"C\" { uint64 mulu64_high; }\n namespace cln {\n extern \"C\" uint64 mulu64_ (uint64 x, uint64 y);\n uint64 mulu64_ (uint64 x, uint64 y)\n"
  },
  {
    "path": "packages/libcoap/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libcoap.net/\nTERMUX_PKG_DESCRIPTION=\"Implementation of CoAP, a lightweight protocol for resource constrained devices\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=4.2.1\nTERMUX_PKG_SHA256=29a0394a265d3febee41e5e2dc03d34292a0aede37f5f80334e529ac0dab2321\nTERMUX_PKG_SRCURL=https://github.com/obgm/libcoap/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BREAKS=\"libcoap-dev\"\nTERMUX_PKG_REPLACES=\"libcoap-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-openssl --disable-doxygen\"\n\ntermux_step_pre_configure() {\n\tNOCONFIGURE=1 ./autogen.sh\n}\n"
  },
  {
    "path": "packages/libconfig/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/hyperrealm/libconfig\nTERMUX_PKG_DESCRIPTION=\"C/C++ Configuration File Library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.7.2\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/hyperrealm/libconfig/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=f67ac44099916ae260a6c9e290a90809e7d782d96cdd462cac656ebc5b685726\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"libconfig-dev\"\nTERMUX_PKG_REPLACES=\"libconfig-dev\"\n\ntermux_step_pre_configure() {\n\tautoreconf -fi\n}\n"
  },
  {
    "path": "packages/libconfuse/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/martinh/libconfuse\nTERMUX_PKG_DESCRIPTION=\"Small configuration file parser library for C\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=3.2.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=71316b55592f8d0c98924242c98dbfa6252153a8b6e7d89e57fe6923934d77d0\nTERMUX_PKG_BREAKS=\"libconfuse-dev\"\nTERMUX_PKG_REPLACES=\"libconfuse-dev\"\nTERMUX_PKG_SRCURL=https://github.com/martinh/libconfuse/releases/download/v$TERMUX_PKG_VERSION/confuse-$TERMUX_PKG_VERSION.tar.gz\n"
  },
  {
    "path": "packages/libcroco/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/GNOME/libcroco\nTERMUX_PKG_DESCRIPTION=\"CSS parsing and manipulation library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=0.6.13\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=767ec234ae7aa684695b3a735548224888132e063f92db585759b422570621d4\nTERMUX_PKG_SRCURL=http://ftp.gnome.org/pub/gnome/sources/libcroco/${TERMUX_PKG_VERSION:0:3}/libcroco-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"glib,liblzma,libxml2\"\nTERMUX_PKG_BREAKS=\"libcroco-dev\"\nTERMUX_PKG_REPLACES=\"libcroco-dev\"\n"
  },
  {
    "path": "packages/libcrypt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://michael.dipperstein.com/crypt/\nTERMUX_PKG_DESCRIPTION=\"A crypt(3) implementation\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=0.2\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BREAKS=\"libcrypt-dev\"\nTERMUX_PKG_REPLACES=\"libcrypt-dev\"\n\ntermux_step_make_install() {\n\t$CC $CFLAGS $CPPFLAGS $LDFLAGS -Wall -Wextra -fPIC -shared $TERMUX_PKG_BUILDER_DIR/crypt3.c -lcrypto -o $TERMUX_PREFIX/lib/libcrypt.so\n\tmkdir -p $TERMUX_PREFIX/include/\n\tcp $TERMUX_PKG_BUILDER_DIR/crypt.h $TERMUX_PREFIX/include/\n}\n"
  },
  {
    "path": "packages/libcrypt/crypt.h",
    "content": "#ifndef CRYPT_H_INCLUDED\n#define CRYPT_H_INCLUDED\n\n#include <sys/cdefs.h>\n\n__BEGIN_DECLS\n\nchar* crypt(const char* key, const char* salt);\n\n__END_DECLS\n\n#endif\n"
  },
  {
    "path": "packages/libcrypt/crypt3.c",
    "content": "/**************************************************************************\n* Implementation of crypt(3) using routines in libcrypto from openssl for\n* use on Android in Termux.\n*\n*  https://www.freebsd.org/cgi/man.cgi?crypt(3)\n*  http://man7.org/linux/man-pages/man3/crypt.3.html\n*\n* Relevant code is from FreeBSD with license given below.\n**************************************************************************/\n\n/*\n * Copyright (c) 2011 The FreeBSD Project. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include <arpa/inet.h>\n#include <errno.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdbool.h>\n#include <openssl/sha.h>\n#include <openssl/md5.h>\n\n/* START: Freebsd compat */\ntypedef unsigned long u_long;\n#define MIN(a,b) (((a)<(b))?(a):(b))\n#define MAX(a,b) (((a)>(b))?(a):(b))\n#define MD5_SIZE 16\n#define\t_PASSWORD_EFMT1\t\t'_'\n#define DES_SALT_ALPHABET \\\n\t\"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"\n#define MD5Init MD5_Init\n#define MD5Update MD5_Update\n#define MD5Final MD5_Final\n/* END: Freebsd compat */\n\n\n/* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/misc.c */\nstatic char itoa64[] =\t\t/* 0 ... 63 => ascii - 64 */\n\t\"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n\nvoid\n_crypt_to64(char *s, u_long v, int n)\n{\n\twhile (--n >= 0) {\n\t\t*s++ = itoa64[v&0x3f];\n\t\tv >>= 6;\n\t}\n}\n\nvoid\nb64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp)\n{\n\tuint32_t w;\n\tint i;\n\n\tw = (B2 << 16) | (B1 << 8) | B0;\n\tfor (i = 0; i < n; i++) {\n\t\t**cp = itoa64[w&0x3f];\n\t\t(*cp)++;\n\t\tif ((*buflen)-- < 0)\n\t\t\tbreak;\n\t\tw >>= 6;\n\t}\n}\n/* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/misc.c */\n\n\n/* START: https://github.com/freebsd/freebsd/blob/master/secure/lib/libcrypt/crypt-des.c */\n#if\tdefined(__GNUC__) && !defined(lint)\n#define INLINE inline\n#else\n#define INLINE\n#endif\n\nstatic u_char\tIP[64] = {\n\t58, 50, 42, 34, 26, 18, 10,  2, 60, 52, 44, 36, 28, 20, 12,  4,\n\t62, 54, 46, 38, 30, 22, 14,  6, 64, 56, 48, 40, 32, 24, 16,  8,\n\t57, 49, 41, 33, 25, 17,  9,  1, 59, 51, 43, 35, 27, 19, 11,  3,\n\t61, 53, 45, 37, 29, 21, 13,  5, 63, 55, 47, 39, 31, 23, 15,  7\n};\n\nstatic u_char\tinv_key_perm[64];\nstatic u_char\tkey_perm[56] = {\n\t57, 49, 41, 33, 25, 17,  9,  1, 58, 50, 42, 34, 26, 18,\n\t10,  2, 59, 51, 43, 35, 27, 19, 11,  3, 60, 52, 44, 36,\n\t63, 55, 47, 39, 31, 23, 15,  7, 62, 54, 46, 38, 30, 22,\n\t14,  6, 61, 53, 45, 37, 29, 21, 13,  5, 28, 20, 12,  4\n};\n\nstatic u_char\tkey_shifts[16] = {\n\t1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1\n};\n\nstatic u_char\tinv_comp_perm[56];\nstatic u_char\tcomp_perm[48] = {\n\t14, 17, 11, 24,  1,  5,  3, 28, 15,  6, 21, 10,\n\t23, 19, 12,  4, 26,  8, 16,  7, 27, 20, 13,  2,\n\t41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48,\n\t44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32\n};\n\n/*\n *\tNo E box is used, as it's replaced by some ANDs, shifts, and ORs.\n */\n\nstatic u_char\tu_sbox[8][64];\nstatic u_char\tsbox[8][64] = {\n\t{\n\t\t14,  4, 13,  1,  2, 15, 11,  8,  3, 10,  6, 12,  5,  9,  0,  7,\n\t\t 0, 15,  7,  4, 14,  2, 13,  1, 10,  6, 12, 11,  9,  5,  3,  8,\n\t\t 4,  1, 14,  8, 13,  6,  2, 11, 15, 12,  9,  7,  3, 10,  5,  0,\n\t\t15, 12,  8,  2,  4,  9,  1,  7,  5, 11,  3, 14, 10,  0,  6, 13\n\t},\n\t{\n\t\t15,  1,  8, 14,  6, 11,  3,  4,  9,  7,  2, 13, 12,  0,  5, 10,\n\t\t 3, 13,  4,  7, 15,  2,  8, 14, 12,  0,  1, 10,  6,  9, 11,  5,\n\t\t 0, 14,  7, 11, 10,  4, 13,  1,  5,  8, 12,  6,  9,  3,  2, 15,\n\t\t13,  8, 10,  1,  3, 15,  4,  2, 11,  6,  7, 12,  0,  5, 14,  9\n\t},\n\t{\n\t\t10,  0,  9, 14,  6,  3, 15,  5,  1, 13, 12,  7, 11,  4,  2,  8,\n\t\t13,  7,  0,  9,  3,  4,  6, 10,  2,  8,  5, 14, 12, 11, 15,  1,\n\t\t13,  6,  4,  9,  8, 15,  3,  0, 11,  1,  2, 12,  5, 10, 14,  7,\n\t\t 1, 10, 13,  0,  6,  9,  8,  7,  4, 15, 14,  3, 11,  5,  2, 12\n\t},\n\t{\n\t\t 7, 13, 14,  3,  0,  6,  9, 10,  1,  2,  8,  5, 11, 12,  4, 15,\n\t\t13,  8, 11,  5,  6, 15,  0,  3,  4,  7,  2, 12,  1, 10, 14,  9,\n\t\t10,  6,  9,  0, 12, 11,  7, 13, 15,  1,  3, 14,  5,  2,  8,  4,\n\t\t 3, 15,  0,  6, 10,  1, 13,  8,  9,  4,  5, 11, 12,  7,  2, 14\n\t},\n\t{\n\t\t 2, 12,  4,  1,  7, 10, 11,  6,  8,  5,  3, 15, 13,  0, 14,  9,\n\t\t14, 11,  2, 12,  4,  7, 13,  1,  5,  0, 15, 10,  3,  9,  8,  6,\n\t\t 4,  2,  1, 11, 10, 13,  7,  8, 15,  9, 12,  5,  6,  3,  0, 14,\n\t\t11,  8, 12,  7,  1, 14,  2, 13,  6, 15,  0,  9, 10,  4,  5,  3\n\t},\n\t{\n\t\t12,  1, 10, 15,  9,  2,  6,  8,  0, 13,  3,  4, 14,  7,  5, 11,\n\t\t10, 15,  4,  2,  7, 12,  9,  5,  6,  1, 13, 14,  0, 11,  3,  8,\n\t\t 9, 14, 15,  5,  2,  8, 12,  3,  7,  0,  4, 10,  1, 13, 11,  6,\n\t\t 4,  3,  2, 12,  9,  5, 15, 10, 11, 14,  1,  7,  6,  0,  8, 13\n\t},\n\t{\n\t\t 4, 11,  2, 14, 15,  0,  8, 13,  3, 12,  9,  7,  5, 10,  6,  1,\n\t\t13,  0, 11,  7,  4,  9,  1, 10, 14,  3,  5, 12,  2, 15,  8,  6,\n\t\t 1,  4, 11, 13, 12,  3,  7, 14, 10, 15,  6,  8,  0,  5,  9,  2,\n\t\t 6, 11, 13,  8,  1,  4, 10,  7,  9,  5,  0, 15, 14,  2,  3, 12\n\t},\n\t{\n\t\t13,  2,  8,  4,  6, 15, 11,  1, 10,  9,  3, 14,  5,  0, 12,  7,\n\t\t 1, 15, 13,  8, 10,  3,  7,  4, 12,  5,  6, 11,  0, 14,  9,  2,\n\t\t 7, 11,  4,  1,  9, 12, 14,  2,  0,  6, 10, 13, 15,  3,  5,  8,\n\t\t 2,  1, 14,  7,  4, 10,  8, 13, 15, 12,  9,  0,  3,  5,  6, 11\n\t}\n};\n\nstatic u_char\tun_pbox[32];\nstatic u_char\tpbox[32] = {\n\t16,  7, 20, 21, 29, 12, 28, 17,  1, 15, 23, 26,  5, 18, 31, 10,\n\t 2,  8, 24, 14, 32, 27,  3,  9, 19, 13, 30,  6, 22, 11,  4, 25\n};\n\nstatic u_int32_t\tbits32[32] =\n{\n\t0x80000000, 0x40000000, 0x20000000, 0x10000000,\n\t0x08000000, 0x04000000, 0x02000000, 0x01000000,\n\t0x00800000, 0x00400000, 0x00200000, 0x00100000,\n\t0x00080000, 0x00040000, 0x00020000, 0x00010000,\n\t0x00008000, 0x00004000, 0x00002000, 0x00001000,\n\t0x00000800, 0x00000400, 0x00000200, 0x00000100,\n\t0x00000080, 0x00000040, 0x00000020, 0x00000010,\n\t0x00000008, 0x00000004, 0x00000002, 0x00000001\n};\n\nstatic u_char\tbits8[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };\n\nstatic u_int32_t\tsaltbits;\nstatic u_int32_t\told_salt;\nstatic u_int32_t\t*bits28, *bits24;\nstatic u_char\t\tinit_perm[64], final_perm[64];\nstatic u_int32_t\ten_keysl[16], en_keysr[16];\nstatic u_int32_t\tde_keysl[16], de_keysr[16];\nstatic int\t\tdes_initialised = 0;\nstatic u_char\t\tm_sbox[4][4096];\nstatic u_int32_t\tpsbox[4][256];\nstatic u_int32_t\tip_maskl[8][256], ip_maskr[8][256];\nstatic u_int32_t\tfp_maskl[8][256], fp_maskr[8][256];\nstatic u_int32_t\tkey_perm_maskl[8][128], key_perm_maskr[8][128];\nstatic u_int32_t\tcomp_maskl[8][128], comp_maskr[8][128];\nstatic u_int32_t\told_rawkey0, old_rawkey1;\n\nstatic u_char\tascii64[] =\n\t \"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n/*\t  0000000000111111111122222222223333333333444444444455555555556666 */\n/*\t  0123456789012345678901234567890123456789012345678901234567890123 */\n\nstatic INLINE int\nascii_to_bin(char ch)\n{\n\tif (ch > 'z')\n\t\treturn(0);\n\tif (ch >= 'a')\n\t\treturn(ch - 'a' + 38);\n\tif (ch > 'Z')\n\t\treturn(0);\n\tif (ch >= 'A')\n\t\treturn(ch - 'A' + 12);\n\tif (ch > '9')\n\t\treturn(0);\n\tif (ch >= '.')\n\t\treturn(ch - '.');\n\treturn(0);\n}\n\nstatic void\ndes_init(void)\n{\n\tint\ti, j, b, k, inbit, obit;\n\tu_int32_t\t*p, *il, *ir, *fl, *fr;\n\n\told_rawkey0 = old_rawkey1 = 0L;\n\tsaltbits = 0L;\n\told_salt = 0L;\n\tbits24 = (bits28 = bits32 + 4) + 4;\n\n\t/*\n\t * Invert the S-boxes, reordering the input bits.\n\t */\n\tfor (i = 0; i < 8; i++)\n\t\tfor (j = 0; j < 64; j++) {\n\t\t\tb = (j & 0x20) | ((j & 1) << 4) | ((j >> 1) & 0xf);\n\t\t\tu_sbox[i][j] = sbox[i][b];\n\t\t}\n\n\t/*\n\t * Convert the inverted S-boxes into 4 arrays of 8 bits.\n\t * Each will handle 12 bits of the S-box input.\n\t */\n\tfor (b = 0; b < 4; b++)\n\t\tfor (i = 0; i < 64; i++)\n\t\t\tfor (j = 0; j < 64; j++)\n\t\t\t\tm_sbox[b][(i << 6) | j] =\n\t\t\t\t\t(u_char)((u_sbox[(b << 1)][i] << 4) |\n\t\t\t\t\tu_sbox[(b << 1) + 1][j]);\n\n\t/*\n\t * Set up the initial & final permutations into a useful form, and\n\t * initialise the inverted key permutation.\n\t */\n\tfor (i = 0; i < 64; i++) {\n\t\tinit_perm[final_perm[i] = IP[i] - 1] = (u_char)i;\n\t\tinv_key_perm[i] = 255;\n\t}\n\n\t/*\n\t * Invert the key permutation and initialise the inverted key\n\t * compression permutation.\n\t */\n\tfor (i = 0; i < 56; i++) {\n\t\tinv_key_perm[key_perm[i] - 1] = (u_char)i;\n\t\tinv_comp_perm[i] = 255;\n\t}\n\n\t/*\n\t * Invert the key compression permutation.\n\t */\n\tfor (i = 0; i < 48; i++) {\n\t\tinv_comp_perm[comp_perm[i] - 1] = (u_char)i;\n\t}\n\n\t/*\n\t * Set up the OR-mask arrays for the initial and final permutations,\n\t * and for the key initial and compression permutations.\n\t */\n\tfor (k = 0; k < 8; k++) {\n\t\tfor (i = 0; i < 256; i++) {\n\t\t\t*(il = &ip_maskl[k][i]) = 0L;\n\t\t\t*(ir = &ip_maskr[k][i]) = 0L;\n\t\t\t*(fl = &fp_maskl[k][i]) = 0L;\n\t\t\t*(fr = &fp_maskr[k][i]) = 0L;\n\t\t\tfor (j = 0; j < 8; j++) {\n\t\t\t\tinbit = 8 * k + j;\n\t\t\t\tif (i & bits8[j]) {\n\t\t\t\t\tif ((obit = init_perm[inbit]) < 32)\n\t\t\t\t\t\t*il |= bits32[obit];\n\t\t\t\t\telse\n\t\t\t\t\t\t*ir |= bits32[obit-32];\n\t\t\t\t\tif ((obit = final_perm[inbit]) < 32)\n\t\t\t\t\t\t*fl |= bits32[obit];\n\t\t\t\t\telse\n\t\t\t\t\t\t*fr |= bits32[obit - 32];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < 128; i++) {\n\t\t\t*(il = &key_perm_maskl[k][i]) = 0L;\n\t\t\t*(ir = &key_perm_maskr[k][i]) = 0L;\n\t\t\tfor (j = 0; j < 7; j++) {\n\t\t\t\tinbit = 8 * k + j;\n\t\t\t\tif (i & bits8[j + 1]) {\n\t\t\t\t\tif ((obit = inv_key_perm[inbit]) == 255)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (obit < 28)\n\t\t\t\t\t\t*il |= bits28[obit];\n\t\t\t\t\telse\n\t\t\t\t\t\t*ir |= bits28[obit - 28];\n\t\t\t\t}\n\t\t\t}\n\t\t\t*(il = &comp_maskl[k][i]) = 0L;\n\t\t\t*(ir = &comp_maskr[k][i]) = 0L;\n\t\t\tfor (j = 0; j < 7; j++) {\n\t\t\t\tinbit = 7 * k + j;\n\t\t\t\tif (i & bits8[j + 1]) {\n\t\t\t\t\tif ((obit=inv_comp_perm[inbit]) == 255)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif (obit < 24)\n\t\t\t\t\t\t*il |= bits24[obit];\n\t\t\t\t\telse\n\t\t\t\t\t\t*ir |= bits24[obit - 24];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Invert the P-box permutation, and convert into OR-masks for\n\t * handling the output of the S-box arrays setup above.\n\t */\n\tfor (i = 0; i < 32; i++)\n\t\tun_pbox[pbox[i] - 1] = (u_char)i;\n\n\tfor (b = 0; b < 4; b++)\n\t\tfor (i = 0; i < 256; i++) {\n\t\t\t*(p = &psbox[b][i]) = 0L;\n\t\t\tfor (j = 0; j < 8; j++) {\n\t\t\t\tif (i & bits8[j])\n\t\t\t\t\t*p |= bits32[un_pbox[8 * b + j]];\n\t\t\t}\n\t\t}\n\n\tdes_initialised = 1;\n}\n\nstatic void\nsetup_salt(u_int32_t salt)\n{\n\tu_int32_t\tobit, saltbit;\n\tint\t\ti;\n\n\tif (salt == old_salt)\n\t\treturn;\n\told_salt = salt;\n\n\tsaltbits = 0L;\n\tsaltbit = 1;\n\tobit = 0x800000;\n\tfor (i = 0; i < 24; i++) {\n\t\tif (salt & saltbit)\n\t\t\tsaltbits |= obit;\n\t\tsaltbit <<= 1;\n\t\tobit >>= 1;\n\t}\n}\n\nstatic int\ndes_setkey(const char *key)\n{\n\tu_int32_t\tk0, k1, rawkey0, rawkey1;\n\tint\t\tshifts, round;\n\n\tif (!des_initialised)\n\t\tdes_init();\n\n\trawkey0 = ntohl(*(const u_int32_t *) key);\n\trawkey1 = ntohl(*(const u_int32_t *) (key + 4));\n\n\tif ((rawkey0 | rawkey1)\n\t    && rawkey0 == old_rawkey0\n\t    && rawkey1 == old_rawkey1) {\n\t\t/*\n\t\t * Already setup for this key.\n\t\t * This optimisation fails on a zero key (which is weak and\n\t\t * has bad parity anyway) in order to simplify the starting\n\t\t * conditions.\n\t\t */\n\t\treturn(0);\n\t}\n\told_rawkey0 = rawkey0;\n\told_rawkey1 = rawkey1;\n\n\t/*\n\t *\tDo key permutation and split into two 28-bit subkeys.\n\t */\n\tk0 = key_perm_maskl[0][rawkey0 >> 25]\n\t   | key_perm_maskl[1][(rawkey0 >> 17) & 0x7f]\n\t   | key_perm_maskl[2][(rawkey0 >> 9) & 0x7f]\n\t   | key_perm_maskl[3][(rawkey0 >> 1) & 0x7f]\n\t   | key_perm_maskl[4][rawkey1 >> 25]\n\t   | key_perm_maskl[5][(rawkey1 >> 17) & 0x7f]\n\t   | key_perm_maskl[6][(rawkey1 >> 9) & 0x7f]\n\t   | key_perm_maskl[7][(rawkey1 >> 1) & 0x7f];\n\tk1 = key_perm_maskr[0][rawkey0 >> 25]\n\t   | key_perm_maskr[1][(rawkey0 >> 17) & 0x7f]\n\t   | key_perm_maskr[2][(rawkey0 >> 9) & 0x7f]\n\t   | key_perm_maskr[3][(rawkey0 >> 1) & 0x7f]\n\t   | key_perm_maskr[4][rawkey1 >> 25]\n\t   | key_perm_maskr[5][(rawkey1 >> 17) & 0x7f]\n\t   | key_perm_maskr[6][(rawkey1 >> 9) & 0x7f]\n\t   | key_perm_maskr[7][(rawkey1 >> 1) & 0x7f];\n\t/*\n\t *\tRotate subkeys and do compression permutation.\n\t */\n\tshifts = 0;\n\tfor (round = 0; round < 16; round++) {\n\t\tu_int32_t\tt0, t1;\n\n\t\tshifts += key_shifts[round];\n\n\t\tt0 = (k0 << shifts) | (k0 >> (28 - shifts));\n\t\tt1 = (k1 << shifts) | (k1 >> (28 - shifts));\n\n\t\tde_keysl[15 - round] =\n\t\ten_keysl[round] = comp_maskl[0][(t0 >> 21) & 0x7f]\n\t\t\t\t| comp_maskl[1][(t0 >> 14) & 0x7f]\n\t\t\t\t| comp_maskl[2][(t0 >> 7) & 0x7f]\n\t\t\t\t| comp_maskl[3][t0 & 0x7f]\n\t\t\t\t| comp_maskl[4][(t1 >> 21) & 0x7f]\n\t\t\t\t| comp_maskl[5][(t1 >> 14) & 0x7f]\n\t\t\t\t| comp_maskl[6][(t1 >> 7) & 0x7f]\n\t\t\t\t| comp_maskl[7][t1 & 0x7f];\n\n\t\tde_keysr[15 - round] =\n\t\ten_keysr[round] = comp_maskr[0][(t0 >> 21) & 0x7f]\n\t\t\t\t| comp_maskr[1][(t0 >> 14) & 0x7f]\n\t\t\t\t| comp_maskr[2][(t0 >> 7) & 0x7f]\n\t\t\t\t| comp_maskr[3][t0 & 0x7f]\n\t\t\t\t| comp_maskr[4][(t1 >> 21) & 0x7f]\n\t\t\t\t| comp_maskr[5][(t1 >> 14) & 0x7f]\n\t\t\t\t| comp_maskr[6][(t1 >> 7) & 0x7f]\n\t\t\t\t| comp_maskr[7][t1 & 0x7f];\n\t}\n\treturn(0);\n}\n\nstatic int\ndo_des(\tu_int32_t l_in, u_int32_t r_in, u_int32_t *l_out, u_int32_t *r_out, int count)\n{\n\t/*\n\t *\tl_in, r_in, l_out, and r_out are in pseudo-\"big-endian\" format.\n\t */\n\tu_int32_t\tl, r, *kl, *kr, *kl1, *kr1;\n\tu_int32_t\tf, r48l, r48r;\n\tint\t\tround;\n\n\tif (count == 0) {\n\t\treturn(1);\n\t} else if (count > 0) {\n\t\t/*\n\t\t * Encrypting\n\t\t */\n\t\tkl1 = en_keysl;\n\t\tkr1 = en_keysr;\n\t} else {\n\t\t/*\n\t\t * Decrypting\n\t\t */\n\t\tcount = -count;\n\t\tkl1 = de_keysl;\n\t\tkr1 = de_keysr;\n\t}\n\n\t/*\n\t *\tDo initial permutation (IP).\n\t */\n\tl = ip_maskl[0][l_in >> 24]\n\t  | ip_maskl[1][(l_in >> 16) & 0xff]\n\t  | ip_maskl[2][(l_in >> 8) & 0xff]\n\t  | ip_maskl[3][l_in & 0xff]\n\t  | ip_maskl[4][r_in >> 24]\n\t  | ip_maskl[5][(r_in >> 16) & 0xff]\n\t  | ip_maskl[6][(r_in >> 8) & 0xff]\n\t  | ip_maskl[7][r_in & 0xff];\n\tr = ip_maskr[0][l_in >> 24]\n\t  | ip_maskr[1][(l_in >> 16) & 0xff]\n\t  | ip_maskr[2][(l_in >> 8) & 0xff]\n\t  | ip_maskr[3][l_in & 0xff]\n\t  | ip_maskr[4][r_in >> 24]\n\t  | ip_maskr[5][(r_in >> 16) & 0xff]\n\t  | ip_maskr[6][(r_in >> 8) & 0xff]\n\t  | ip_maskr[7][r_in & 0xff];\n\n\twhile (count--) {\n\t\t/*\n\t\t * Do each round.\n\t\t */\n\t\tkl = kl1;\n\t\tkr = kr1;\n\t\tround = 16;\n\t\twhile (round--) {\n\t\t\t/*\n\t\t\t * Expand R to 48 bits (simulate the E-box).\n\t\t\t */\n\t\t\tr48l\t= ((r & 0x00000001) << 23)\n\t\t\t\t| ((r & 0xf8000000) >> 9)\n\t\t\t\t| ((r & 0x1f800000) >> 11)\n\t\t\t\t| ((r & 0x01f80000) >> 13)\n\t\t\t\t| ((r & 0x001f8000) >> 15);\n\n\t\t\tr48r\t= ((r & 0x0001f800) << 7)\n\t\t\t\t| ((r & 0x00001f80) << 5)\n\t\t\t\t| ((r & 0x000001f8) << 3)\n\t\t\t\t| ((r & 0x0000001f) << 1)\n\t\t\t\t| ((r & 0x80000000) >> 31);\n\t\t\t/*\n\t\t\t * Do salting for crypt() and friends, and\n\t\t\t * XOR with the permuted key.\n\t\t\t */\n\t\t\tf = (r48l ^ r48r) & saltbits;\n\t\t\tr48l ^= f ^ *kl++;\n\t\t\tr48r ^= f ^ *kr++;\n\t\t\t/*\n\t\t\t * Do sbox lookups (which shrink it back to 32 bits)\n\t\t\t * and do the pbox permutation at the same time.\n\t\t\t */\n\t\t\tf = psbox[0][m_sbox[0][r48l >> 12]]\n\t\t\t  | psbox[1][m_sbox[1][r48l & 0xfff]]\n\t\t\t  | psbox[2][m_sbox[2][r48r >> 12]]\n\t\t\t  | psbox[3][m_sbox[3][r48r & 0xfff]];\n\t\t\t/*\n\t\t\t * Now that we've permuted things, complete f().\n\t\t\t */\n\t\t\tf ^= l;\n\t\t\tl = r;\n\t\t\tr = f;\n\t\t}\n\t\tr = l;\n\t\tl = f;\n\t}\n\t/*\n\t * Do final permutation (inverse of IP).\n\t */\n\t*l_out\t= fp_maskl[0][l >> 24]\n\t\t| fp_maskl[1][(l >> 16) & 0xff]\n\t\t| fp_maskl[2][(l >> 8) & 0xff]\n\t\t| fp_maskl[3][l & 0xff]\n\t\t| fp_maskl[4][r >> 24]\n\t\t| fp_maskl[5][(r >> 16) & 0xff]\n\t\t| fp_maskl[6][(r >> 8) & 0xff]\n\t\t| fp_maskl[7][r & 0xff];\n\t*r_out\t= fp_maskr[0][l >> 24]\n\t\t| fp_maskr[1][(l >> 16) & 0xff]\n\t\t| fp_maskr[2][(l >> 8) & 0xff]\n\t\t| fp_maskr[3][l & 0xff]\n\t\t| fp_maskr[4][r >> 24]\n\t\t| fp_maskr[5][(r >> 16) & 0xff]\n\t\t| fp_maskr[6][(r >> 8) & 0xff]\n\t\t| fp_maskr[7][r & 0xff];\n\treturn(0);\n}\n\nstatic int\ndes_cipher(const char *in, char *out, u_long salt, int count)\n{\n\tu_int32_t\tl_out, r_out, rawl, rawr;\n\tint\t\tretval;\n\tunion {\n\t\tu_int32_t\t*ui32;\n\t\tconst char\t*c;\n\t} trans;\n\n\tif (!des_initialised)\n\t\tdes_init();\n\n\tsetup_salt(salt);\n\n\ttrans.c = in;\n\trawl = ntohl(*trans.ui32++);\n\trawr = ntohl(*trans.ui32);\n\n\tretval = do_des(rawl, rawr, &l_out, &r_out, count);\n\n\ttrans.c = out;\n\t*trans.ui32++ = htonl(l_out);\n\t*trans.ui32 = htonl(r_out);\n\treturn(retval);\n}\n\nchar *\ncrypt_des(const char *key, const char *setting)\n{\n\tint\t\ti;\n\tu_int32_t\tcount, salt, l, r0, r1, keybuf[2];\n\tu_char\t\t*p, *q;\n\tstatic char\toutput[21];\n\n\tif (!des_initialised)\n\t\tdes_init();\n\n\t/*\n\t * Copy the key, shifting each character up by one bit\n\t * and padding with zeros.\n\t */\n\tq = (u_char *)keybuf;\n\twhile (q - (u_char *)keybuf - 8) {\n\t\t*q++ = *key << 1;\n\t\tif (*key != '\\0')\n\t\t\tkey++;\n\t}\n\tif (des_setkey((char *)keybuf))\n\t\treturn(NULL);\n\n\tif (*setting == _PASSWORD_EFMT1) {\n\t\t/*\n\t\t * \"new\"-style:\n\t\t *\tsetting - underscore, 4 bytes of count, 4 bytes of salt\n\t\t *\tkey - unlimited characters\n\t\t */\n\t\tfor (i = 1, count = 0L; i < 5; i++)\n\t\t\tcount |= ascii_to_bin(setting[i]) << ((i - 1) * 6);\n\n\t\tfor (i = 5, salt = 0L; i < 9; i++)\n\t\t\tsalt |= ascii_to_bin(setting[i]) << ((i - 5) * 6);\n\n\t\twhile (*key) {\n\t\t\t/*\n\t\t\t * Encrypt the key with itself.\n\t\t\t */\n\t\t\tif (des_cipher((char *)keybuf, (char *)keybuf, 0L, 1))\n\t\t\t\treturn(NULL);\n\t\t\t/*\n\t\t\t * And XOR with the next 8 characters of the key.\n\t\t\t */\n\t\t\tq = (u_char *)keybuf;\n\t\t\twhile (q - (u_char *)keybuf - 8 && *key)\n\t\t\t\t*q++ ^= *key++ << 1;\n\n\t\t\tif (des_setkey((char *)keybuf))\n\t\t\t\treturn(NULL);\n\t\t}\n\t\tstrncpy(output, setting, 9);\n\n\t\t/*\n\t\t * Double check that we weren't given a short setting.\n\t\t * If we were, the above code will probably have created\n\t\t * wierd values for count and salt, but we don't really care.\n\t\t * Just make sure the output string doesn't have an extra\n\t\t * NUL in it.\n\t\t */\n\t\toutput[9] = '\\0';\n\t\tp = (u_char *)output + strlen(output);\n\t} else {\n\t\t/*\n\t\t * \"old\"-style:\n\t\t *\tsetting - 2 bytes of salt\n\t\t *\tkey - up to 8 characters\n\t\t */\n\t\tcount = 25;\n\n\t\tsalt = (ascii_to_bin(setting[1]) << 6)\n\t\t     |  ascii_to_bin(setting[0]);\n\n\t\toutput[0] = setting[0];\n\t\t/*\n\t\t * If the encrypted password that the salt was extracted from\n\t\t * is only 1 character long, the salt will be corrupted.  We\n\t\t * need to ensure that the output string doesn't have an extra\n\t\t * NUL in it!\n\t\t */\n\t\toutput[1] = setting[1] ? setting[1] : output[0];\n\n\t\tp = (u_char *)output + 2;\n\t}\n\tsetup_salt(salt);\n\t/*\n\t * Do it.\n\t */\n\tif (do_des(0L, 0L, &r0, &r1, (int)count))\n\t\treturn(NULL);\n\t/*\n\t * Now encode the result...\n\t */\n\tl = (r0 >> 8);\n\t*p++ = ascii64[(l >> 18) & 0x3f];\n\t*p++ = ascii64[(l >> 12) & 0x3f];\n\t*p++ = ascii64[(l >> 6) & 0x3f];\n\t*p++ = ascii64[l & 0x3f];\n\n\tl = (r0 << 16) | ((r1 >> 16) & 0xffff);\n\t*p++ = ascii64[(l >> 18) & 0x3f];\n\t*p++ = ascii64[(l >> 12) & 0x3f];\n\t*p++ = ascii64[(l >> 6) & 0x3f];\n\t*p++ = ascii64[l & 0x3f];\n\n\tl = r1 << 2;\n\t*p++ = ascii64[(l >> 12) & 0x3f];\n\t*p++ = ascii64[(l >> 6) & 0x3f];\n\t*p++ = ascii64[l & 0x3f];\n\t*p = 0;\n\n\treturn(output);\n}\n/* END: https://github.com/freebsd/freebsd/blob/master/secure/lib/libcrypt/crypt-des.c */\n\n\n/* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-md5.c */\nchar *\ncrypt_md5(const char *pw, const char *salt)\n{\n\tMD5_CTX\tctx,ctx1;\n\tunsigned long l;\n\tint sl, pl;\n\tu_int i;\n\tu_char final[MD5_SIZE];\n\tstatic const char *sp, *ep;\n\tstatic char passwd[120], *p;\n\tstatic const char *magic = \"$1$\";\n\n\t/* Refine the Salt first */\n\tsp = salt;\n\n\t/* If it starts with the magic string, then skip that */\n\tif(!strncmp(sp, magic, strlen(magic)))\n\t\tsp += strlen(magic);\n\n\t/* It stops at the first '$', max 8 chars */\n\tfor(ep = sp; *ep && *ep != '$' && ep < (sp + 8); ep++)\n\t\tcontinue;\n\n\t/* get the length of the true salt */\n\tsl = ep - sp;\n\n\tMD5Init(&ctx);\n\n\t/* The password first, since that is what is most unknown */\n\tMD5Update(&ctx, (const u_char *)pw, strlen(pw));\n\n\t/* Then our magic string */\n\tMD5Update(&ctx, (const u_char *)magic, strlen(magic));\n\n\t/* Then the raw salt */\n\tMD5Update(&ctx, (const u_char *)sp, (u_int)sl);\n\n\t/* Then just as many characters of the MD5(pw,salt,pw) */\n\tMD5Init(&ctx1);\n\tMD5Update(&ctx1, (const u_char *)pw, strlen(pw));\n\tMD5Update(&ctx1, (const u_char *)sp, (u_int)sl);\n\tMD5Update(&ctx1, (const u_char *)pw, strlen(pw));\n\tMD5Final(final, &ctx1);\n\tfor(pl = (int)strlen(pw); pl > 0; pl -= MD5_SIZE)\n\t\tMD5Update(&ctx, (const u_char *)final,\n\t\t    (u_int)(pl > MD5_SIZE ? MD5_SIZE : pl));\n\n\t/* Don't leave anything around in vm they could use. */\n\tmemset(final, 0, sizeof(final));\n\n\t/* Then something really weird... */\n\tfor (i = strlen(pw); i; i >>= 1)\n\t\tif(i & 1)\n\t\t    MD5Update(&ctx, (const u_char *)final, 1);\n\t\telse\n\t\t    MD5Update(&ctx, (const u_char *)pw, 1);\n\n\t/* Now make the output string */\n\tstrcpy(passwd, magic);\n\tstrncat(passwd, sp, (u_int)sl);\n\tstrcat(passwd, \"$\");\n\n\tMD5Final(final, &ctx);\n\n\t/*\n\t * and now, just to make sure things don't run too fast\n\t * On a 60 Mhz Pentium this takes 34 msec, so you would\n\t * need 30 seconds to build a 1000 entry dictionary...\n\t */\n\tfor(i = 0; i < 1000; i++) {\n\t\tMD5Init(&ctx1);\n\t\tif(i & 1)\n\t\t\tMD5Update(&ctx1, (const u_char *)pw, strlen(pw));\n\t\telse\n\t\t\tMD5Update(&ctx1, (const u_char *)final, MD5_SIZE);\n\n\t\tif(i % 3)\n\t\t\tMD5Update(&ctx1, (const u_char *)sp, (u_int)sl);\n\n\t\tif(i % 7)\n\t\t\tMD5Update(&ctx1, (const u_char *)pw, strlen(pw));\n\n\t\tif(i & 1)\n\t\t\tMD5Update(&ctx1, (const u_char *)final, MD5_SIZE);\n\t\telse\n\t\t\tMD5Update(&ctx1, (const u_char *)pw, strlen(pw));\n\t\tMD5Final(final, &ctx1);\n\t}\n\n\tp = passwd + strlen(passwd);\n\n\tl = (final[ 0]<<16) | (final[ 6]<<8) | final[12];\n\t_crypt_to64(p, l, 4); p += 4;\n\tl = (final[ 1]<<16) | (final[ 7]<<8) | final[13];\n\t_crypt_to64(p, l, 4); p += 4;\n\tl = (final[ 2]<<16) | (final[ 8]<<8) | final[14];\n\t_crypt_to64(p, l, 4); p += 4;\n\tl = (final[ 3]<<16) | (final[ 9]<<8) | final[15];\n\t_crypt_to64(p, l, 4); p += 4;\n\tl = (final[ 4]<<16) | (final[10]<<8) | final[ 5];\n\t_crypt_to64(p, l, 4); p += 4;\n\tl = final[11];\n\t_crypt_to64(p, l, 2); p += 2;\n\t*p = '\\0';\n\n\t/* Don't leave anything around in vm they could use. */\n\tmemset(final, 0, sizeof(final));\n\n\treturn (passwd);\n}\n/* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-md5.c */\n\n\n/* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha256.c */\nstatic const char sha256_salt_prefix[] = \"$5$\";\n\n/* Prefix for optional rounds specification. */\nstatic const char sha256_rounds_prefix[] = \"rounds=\";\n\n/* Maximum salt string length. */\n#define SALT_LEN_MAX 16\n/* Default number of rounds if not explicitly specified. */\n#define ROUNDS_DEFAULT 5000\n/* Minimum number of rounds. */\n#define ROUNDS_MIN 1000\n/* Maximum number of rounds. */\n#define ROUNDS_MAX 999999999\n\nstatic char *\ncrypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen)\n{\n\tu_long srounds;\n\tint n;\n\tuint8_t alt_result[32], temp_result[32];\n\tSHA256_CTX ctx, alt_ctx;\n\tsize_t salt_len, key_len, cnt, rounds;\n\tchar *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;\n\tconst char *num;\n\tbool rounds_custom;\n\n\tcopied_key = NULL;\n\tcopied_salt = NULL;\n\n\t/* Default number of rounds. */\n\trounds = ROUNDS_DEFAULT;\n\trounds_custom = false;\n\n\t/* Find beginning of salt string. The prefix should normally always\n\t * be present. Just in case it is not. */\n\tif (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0)\n\t\t/* Skip salt prefix. */\n\t\tsalt += sizeof(sha256_salt_prefix) - 1;\n\n\tif (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1)\n\t    == 0) {\n\t\tnum = salt + sizeof(sha256_rounds_prefix) - 1;\n\t\tsrounds = strtoul(num, &endp, 10);\n\n\t\tif (*endp == '$') {\n\t\t\tsalt = endp + 1;\n\t\t\trounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));\n\t\t\trounds_custom = true;\n\t\t}\n\t}\n\n\tsalt_len = MIN(strcspn(salt, \"$\"), SALT_LEN_MAX);\n\tkey_len = strlen(key);\n\n\t/* Prepare for the real work. */\n\tSHA256_Init(&ctx);\n\n\t/* Add the key string. */\n\tSHA256_Update(&ctx, key, key_len);\n\n\t/* The last part is the salt string. This must be at most 8\n\t * characters and it ends at the first `$' character (for\n\t * compatibility with existing implementations). */\n\tSHA256_Update(&ctx, salt, salt_len);\n\n\t/* Compute alternate SHA256 sum with input KEY, SALT, and KEY. The\n\t * final result will be added to the first context. */\n\tSHA256_Init(&alt_ctx);\n\n\t/* Add key. */\n\tSHA256_Update(&alt_ctx, key, key_len);\n\n\t/* Add salt. */\n\tSHA256_Update(&alt_ctx, salt, salt_len);\n\n\t/* Add key again. */\n\tSHA256_Update(&alt_ctx, key, key_len);\n\n\t/* Now get result of this (32 bytes) and add it to the other context. */\n\tSHA256_Final(alt_result, &alt_ctx);\n\n\t/* Add for any character in the key one byte of the alternate sum. */\n\tfor (cnt = key_len; cnt > 32; cnt -= 32)\n\t\tSHA256_Update(&ctx, alt_result, 32);\n\tSHA256_Update(&ctx, alt_result, cnt);\n\n\t/* Take the binary representation of the length of the key and for\n\t * every 1 add the alternate sum, for every 0 the key. */\n\tfor (cnt = key_len; cnt > 0; cnt >>= 1)\n\t\tif ((cnt & 1) != 0)\n\t\t\tSHA256_Update(&ctx, alt_result, 32);\n\t\telse\n\t\t\tSHA256_Update(&ctx, key, key_len);\n\n\t/* Create intermediate result. */\n\tSHA256_Final(alt_result, &ctx);\n\n\t/* Start computation of P byte sequence. */\n\tSHA256_Init(&alt_ctx);\n\n\t/* For every character in the password add the entire password. */\n\tfor (cnt = 0; cnt < key_len; ++cnt)\n\t\tSHA256_Update(&alt_ctx, key, key_len);\n\n\t/* Finish the digest. */\n\tSHA256_Final(temp_result, &alt_ctx);\n\n\t/* Create byte sequence P. */\n\tcp = p_bytes = alloca(key_len);\n\tfor (cnt = key_len; cnt >= 32; cnt -= 32) {\n\t\tmemcpy(cp, temp_result, 32);\n\t\tcp += 32;\n\t}\n\tmemcpy(cp, temp_result, cnt);\n\n\t/* Start computation of S byte sequence. */\n\tSHA256_Init(&alt_ctx);\n\n\t/* For every character in the password add the entire password. */\n\tfor (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)\n\t\tSHA256_Update(&alt_ctx, salt, salt_len);\n\n\t/* Finish the digest. */\n\tSHA256_Final(temp_result, &alt_ctx);\n\n\t/* Create byte sequence S. */\n\tcp = s_bytes = alloca(salt_len);\n\tfor (cnt = salt_len; cnt >= 32; cnt -= 32) {\n\t\tmemcpy(cp, temp_result, 32);\n\t\tcp += 32;\n\t}\n\tmemcpy(cp, temp_result, cnt);\n\n\t/* Repeatedly run the collected hash value through SHA256 to burn CPU\n\t * cycles. */\n\tfor (cnt = 0; cnt < rounds; ++cnt) {\n\t\t/* New context. */\n\t\tSHA256_Init(&ctx);\n\n\t\t/* Add key or last result. */\n\t\tif ((cnt & 1) != 0)\n\t\t\tSHA256_Update(&ctx, p_bytes, key_len);\n\t\telse\n\t\t\tSHA256_Update(&ctx, alt_result, 32);\n\n\t\t/* Add salt for numbers not divisible by 3. */\n\t\tif (cnt % 3 != 0)\n\t\t\tSHA256_Update(&ctx, s_bytes, salt_len);\n\n\t\t/* Add key for numbers not divisible by 7. */\n\t\tif (cnt % 7 != 0)\n\t\t\tSHA256_Update(&ctx, p_bytes, key_len);\n\n\t\t/* Add key or last result. */\n\t\tif ((cnt & 1) != 0)\n\t\t\tSHA256_Update(&ctx, alt_result, 32);\n\t\telse\n\t\t\tSHA256_Update(&ctx, p_bytes, key_len);\n\n\t\t/* Create intermediate result. */\n\t\tSHA256_Final(alt_result, &ctx);\n\t}\n\n\t/* Now we can construct the result string. It consists of three\n\t * parts. */\n\tcp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));\n\tbuflen -= sizeof(sha256_salt_prefix) - 1;\n\n\tif (rounds_custom) {\n\t\tn = snprintf(cp, MAX(0, buflen), \"%s%zu$\",\n\t\t\t sha256_rounds_prefix, rounds);\n\n\t\tcp += n;\n\t\tbuflen -= n;\n\t}\n\n\tcp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));\n\tbuflen -= MIN((size_t)MAX(0, buflen), salt_len);\n\n\tif (buflen > 0) {\n\t\t*cp++ = '$';\n\t\t--buflen;\n\t}\n\n\tb64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4, &buflen, &cp);\n\tb64_from_24bit(0, alt_result[31], alt_result[30], 3, &buflen, &cp);\n\tif (buflen <= 0) {\n\t\terrno = ERANGE;\n\t\tbuffer = NULL;\n\t}\n\telse\n\t\t*cp = '\\0';\t/* Terminate the string. */\n\n\t/* Clear the buffer for the intermediate result so that people\n\t * attaching to processes or reading core dumps cannot get any\n\t * information. We do it in this way to clear correct_words[] inside\n\t * the SHA256 implementation as well. */\n\tSHA256_Init(&ctx);\n\tSHA256_Final(alt_result, &ctx);\n\tmemset(temp_result, '\\0', sizeof(temp_result));\n\tmemset(p_bytes, '\\0', key_len);\n\tmemset(s_bytes, '\\0', salt_len);\n\tmemset(&ctx, '\\0', sizeof(ctx));\n\tmemset(&alt_ctx, '\\0', sizeof(alt_ctx));\n\tif (copied_key != NULL)\n\t\tmemset(copied_key, '\\0', key_len);\n\tif (copied_salt != NULL)\n\t\tmemset(copied_salt, '\\0', salt_len);\n\n\treturn buffer;\n}\n\n/* This entry point is equivalent to crypt(3). */\nchar* crypt_sha256(const char *key, const char *salt)\n{\n\t/* We don't want to have an arbitrary limit in the size of the\n\t * password. We can compute an upper bound for the size of the\n\t * result in advance and so we can prepare the buffer we pass to\n\t * `crypt_sha256_r'. */\n\tstatic char *buffer;\n\tstatic int buflen;\n\tint needed;\n\tchar *new_buffer;\n\n\tneeded = (sizeof(sha256_salt_prefix) - 1\n\t      + sizeof(sha256_rounds_prefix) + 9 + 1\n\t      + strlen(salt) + 1 + 43 + 1);\n\n\tif (buflen < needed) {\n\t\tnew_buffer = (char *)realloc(buffer, needed);\n\n\t\tif (new_buffer == NULL)\n\t\t\treturn NULL;\n\n\t\tbuffer = new_buffer;\n\t\tbuflen = needed;\n\t}\n\n\treturn crypt_sha256_r(key, salt, buffer, buflen);\n}\n/* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha256.c */\n\n\n/* START: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha512.c */\n/* Define our magic string to mark salt for SHA512 \"encryption\" replacement. */\nstatic const char sha512_salt_prefix[] = \"$6$\";\n\n/* Prefix for optional rounds specification. */\nstatic const char sha512_rounds_prefix[] = \"rounds=\";\n\n/* Maximum salt string length. */\n#define SALT_LEN_MAX 16\n/* Default number of rounds if not explicitly specified. */\n#define ROUNDS_DEFAULT 5000\n/* Minimum number of rounds. */\n#define ROUNDS_MIN 1000\n/* Maximum number of rounds. */\n#define ROUNDS_MAX 999999999\n\nstatic char *\ncrypt_sha512_r(const char *key, const char *salt, char *buffer, int buflen)\n{\n\tu_long srounds;\n\tint n;\n\tuint8_t alt_result[64], temp_result[64];\n\tSHA512_CTX ctx, alt_ctx;\n\tsize_t salt_len, key_len, cnt, rounds;\n\tchar *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp;\n\tconst char *num;\n\tbool rounds_custom;\n\n\tcopied_key = NULL;\n\tcopied_salt = NULL;\n\n\t/* Default number of rounds. */\n\trounds = ROUNDS_DEFAULT;\n\trounds_custom = false;\n\n\t/* Find beginning of salt string. The prefix should normally always\n\t * be present. Just in case it is not. */\n\tif (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0)\n\t\t/* Skip salt prefix. */\n\t\tsalt += sizeof(sha512_salt_prefix) - 1;\n\n\tif (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1)\n\t    == 0) {\n\t\tnum = salt + sizeof(sha512_rounds_prefix) - 1;\n\t\tsrounds = strtoul(num, &endp, 10);\n\n\t\tif (*endp == '$') {\n\t\t\tsalt = endp + 1;\n\t\t\trounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));\n\t\t\trounds_custom = true;\n\t\t}\n\t}\n\n\tsalt_len = MIN(strcspn(salt, \"$\"), SALT_LEN_MAX);\n\tkey_len = strlen(key);\n\n\t/* Prepare for the real work. */\n\tSHA512_Init(&ctx);\n\n\t/* Add the key string. */\n\tSHA512_Update(&ctx, key, key_len);\n\n\t/* The last part is the salt string. This must be at most 8\n\t * characters and it ends at the first `$' character (for\n\t * compatibility with existing implementations). */\n\tSHA512_Update(&ctx, salt, salt_len);\n\n\t/* Compute alternate SHA512 sum with input KEY, SALT, and KEY. The\n\t * final result will be added to the first context. */\n\tSHA512_Init(&alt_ctx);\n\n\t/* Add key. */\n\tSHA512_Update(&alt_ctx, key, key_len);\n\n\t/* Add salt. */\n\tSHA512_Update(&alt_ctx, salt, salt_len);\n\n\t/* Add key again. */\n\tSHA512_Update(&alt_ctx, key, key_len);\n\n\t/* Now get result of this (64 bytes) and add it to the other context. */\n\tSHA512_Final(alt_result, &alt_ctx);\n\n\t/* Add for any character in the key one byte of the alternate sum. */\n\tfor (cnt = key_len; cnt > 64; cnt -= 64)\n\t\tSHA512_Update(&ctx, alt_result, 64);\n\tSHA512_Update(&ctx, alt_result, cnt);\n\n\t/* Take the binary representation of the length of the key and for\n\t * every 1 add the alternate sum, for every 0 the key. */\n\tfor (cnt = key_len; cnt > 0; cnt >>= 1)\n\t\tif ((cnt & 1) != 0)\n\t\t\tSHA512_Update(&ctx, alt_result, 64);\n\t\telse\n\t\t\tSHA512_Update(&ctx, key, key_len);\n\n\t/* Create intermediate result. */\n\tSHA512_Final(alt_result, &ctx);\n\n\t/* Start computation of P byte sequence. */\n\tSHA512_Init(&alt_ctx);\n\n\t/* For every character in the password add the entire password. */\n\tfor (cnt = 0; cnt < key_len; ++cnt)\n\t\tSHA512_Update(&alt_ctx, key, key_len);\n\n\t/* Finish the digest. */\n\tSHA512_Final(temp_result, &alt_ctx);\n\n\t/* Create byte sequence P. */\n\tcp = p_bytes = alloca(key_len);\n\tfor (cnt = key_len; cnt >= 64; cnt -= 64) {\n\t\tmemcpy(cp, temp_result, 64);\n\t\tcp += 64;\n\t}\n\tmemcpy(cp, temp_result, cnt);\n\n\t/* Start computation of S byte sequence. */\n\tSHA512_Init(&alt_ctx);\n\n\t/* For every character in the password add the entire password. */\n\tfor (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)\n\t\tSHA512_Update(&alt_ctx, salt, salt_len);\n\n\t/* Finish the digest. */\n\tSHA512_Final(temp_result, &alt_ctx);\n\n\t/* Create byte sequence S. */\n\tcp = s_bytes = alloca(salt_len);\n\tfor (cnt = salt_len; cnt >= 64; cnt -= 64) {\n\t\tmemcpy(cp, temp_result, 64);\n\t\tcp += 64;\n\t}\n\tmemcpy(cp, temp_result, cnt);\n\n\t/* Repeatedly run the collected hash value through SHA512 to burn CPU\n\t * cycles. */\n\tfor (cnt = 0; cnt < rounds; ++cnt) {\n\t\t/* New context. */\n\t\tSHA512_Init(&ctx);\n\n\t\t/* Add key or last result. */\n\t\tif ((cnt & 1) != 0)\n\t\t\tSHA512_Update(&ctx, p_bytes, key_len);\n\t\telse\n\t\t\tSHA512_Update(&ctx, alt_result, 64);\n\n\t\t/* Add salt for numbers not divisible by 3. */\n\t\tif (cnt % 3 != 0)\n\t\t\tSHA512_Update(&ctx, s_bytes, salt_len);\n\n\t\t/* Add key for numbers not divisible by 7. */\n\t\tif (cnt % 7 != 0)\n\t\t\tSHA512_Update(&ctx, p_bytes, key_len);\n\n\t\t/* Add key or last result. */\n\t\tif ((cnt & 1) != 0)\n\t\t\tSHA512_Update(&ctx, alt_result, 64);\n\t\telse\n\t\t\tSHA512_Update(&ctx, p_bytes, key_len);\n\n\t\t/* Create intermediate result. */\n\t\tSHA512_Final(alt_result, &ctx);\n\t}\n\n\t/* Now we can construct the result string. It consists of three\n\t * parts. */\n\tcp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));\n\tbuflen -= sizeof(sha512_salt_prefix) - 1;\n\n\tif (rounds_custom) {\n\t\tn = snprintf(cp, MAX(0, buflen), \"%s%zu$\",\n\t\t\t sha512_rounds_prefix, rounds);\n\n\t\tcp += n;\n\t\tbuflen -= n;\n\t}\n\n\tcp = stpncpy(cp, salt, MIN((size_t)MAX(0, buflen), salt_len));\n\tbuflen -= MIN((size_t)MAX(0, buflen), salt_len);\n\n\tif (buflen > 0) {\n\t\t*cp++ = '$';\n\t\t--buflen;\n\t}\n\n\tb64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4, &buflen, &cp);\n\tb64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4, &buflen, &cp);\n\tb64_from_24bit(0, 0, alt_result[63], 2, &buflen, &cp);\n\n\tif (buflen <= 0) {\n\t\terrno = ERANGE;\n\t\tbuffer = NULL;\n\t}\n\telse\n\t\t*cp = '\\0';\t/* Terminate the string. */\n\n\t/* Clear the buffer for the intermediate result so that people\n\t * attaching to processes or reading core dumps cannot get any\n\t * information. We do it in this way to clear correct_words[] inside\n\t * the SHA512 implementation as well. */\n\tSHA512_Init(&ctx);\n\tSHA512_Final(alt_result, &ctx);\n\tmemset(temp_result, '\\0', sizeof(temp_result));\n\tmemset(p_bytes, '\\0', key_len);\n\tmemset(s_bytes, '\\0', salt_len);\n\tmemset(&ctx, '\\0', sizeof(ctx));\n\tmemset(&alt_ctx, '\\0', sizeof(alt_ctx));\n\tif (copied_key != NULL)\n\t\tmemset(copied_key, '\\0', key_len);\n\tif (copied_salt != NULL)\n\t\tmemset(copied_salt, '\\0', salt_len);\n\n\treturn buffer;\n}\n\n/* This entry point is equivalent to crypt(3). */\nchar *\ncrypt_sha512(const char *key, const char *salt)\n{\n\t/* We don't want to have an arbitrary limit in the size of the\n\t * password. We can compute an upper bound for the size of the\n\t * result in advance and so we can prepare the buffer we pass to\n\t * `crypt_sha512_r'. */\n\tstatic char *buffer;\n\tstatic int buflen;\n\tint needed;\n\tchar *new_buffer;\n\n\tneeded = (sizeof(sha512_salt_prefix) - 1\n\t      + sizeof(sha512_rounds_prefix) + 9 + 1\n\t      + strlen(salt) + 1 + 86 + 1);\n\n\tif (buflen < needed) {\n\t\tnew_buffer = (char *)realloc(buffer, needed);\n\n\t\tif (new_buffer == NULL)\n\t\t\treturn NULL;\n\n\t\tbuffer = new_buffer;\n\t\tbuflen = needed;\n\t}\n\n\treturn crypt_sha512_r(key, salt, buffer, buflen);\n}\n/* END: https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt-sha512.c */\n\n\n/** From https://github.com/freebsd/freebsd/blob/master/lib/libcrypt/crypt.c */\nstatic const struct crypt_format {\n\tconst char* const name;\n\tconst char* const magic;\n\tchar* (*const func)(char const*, char const*);\n} crypt_formats[] = {\n\t{ \"des\", \"_\", crypt_des },\n\t{ \"md5\", \"$1$\", crypt_md5 },\n\t{ \"sha256\", \"$5$\", crypt_sha256 },\n\t{ \"sha512\", \"$6$\", crypt_sha512 },\n\t{ NULL,\tNULL, NULL }\n};\n\n\nchar* crypt(const char* key, const char* salt)\n{\n\tsize_t len;\n\tconst struct crypt_format *cf;\n\n\tfor (cf = crypt_formats; cf->name != NULL; ++cf) {\n\t\tif (cf->magic != NULL && strstr(salt, cf->magic) == salt) {\n\t\t\treturn cf->func(key, salt);\n\t\t}\n\t}\n\n\tlen = strlen(salt);\n\tif ((len == 13 || len == 2) && strspn(salt, DES_SALT_ALPHABET) == len) {\n\t\treturn (crypt_des(key, salt));\n\t}\n\n\treturn crypt_formats[0].func(key, salt);\n}\n"
  },
  {
    "path": "packages/libcue/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/lipnitsk/libcue/\nTERMUX_PKG_DESCRIPTION=\"CUE Sheet Parser Library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.2.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=f27bc3ebb2e892cd9d32a7bee6d84576a60f955f29f748b9b487b173712f1200\nTERMUX_PKG_BREAKS=\"libcue-dev\"\nTERMUX_PKG_REPLACES=\"libcue-dev\"\nTERMUX_PKG_SRCURL=https://github.com/lipnitsk/libcue/archive/v${TERMUX_PKG_VERSION}.tar.gz\n# To avoid picking up cross-compiled flex and bison:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBISON_EXECUTABLE=$(which bison)\n-DFLEX_EXECUTABLE=$(which flex)\n-DBUILD_SHARED_LIBS=ON\n\"\n"
  },
  {
    "path": "packages/libcurl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://curl.haxx.se/\nTERMUX_PKG_DESCRIPTION=\"Easy-to-use client-side URL transfer library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=7.67.0\nTERMUX_PKG_SRCURL=https://curl.haxx.se/download/curl-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=dd5f6956821a548bf4b44f067a530ce9445cc8094fd3e7e3fc7854815858586c\nTERMUX_PKG_DEPENDS=\"libnghttp2, openssl (>= 1.1.1), zlib\"\nTERMUX_PKG_BREAKS=\"libcurl-dev\"\nTERMUX_PKG_REPLACES=\"libcurl-dev\"\nTERMUX_PKG_ESSENTIAL=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-ntlm-wb=$TERMUX_PREFIX/bin/ntlm_auth\n--with-ca-bundle=$TERMUX_PREFIX/etc/tls/cert.pem\n--with-ca-path=$TERMUX_PREFIX/etc/tls/certs\n--with-nghttp2\n--without-libidn\n--without-libidn2\n--without-librtmp\n--without-brotli\n--with-ssl\n\"\n\n\n# Starting with version 7.62 curl started enabling http/2 by default.\n# Support for http/2 as added in version 1.4.8-8 of the apt package, so we\n# conflict with previous versions to avoid broken installations.\nTERMUX_PKG_CONFLICTS=\"apt (<< 1.4.8-8)\"\n"
  },
  {
    "path": "packages/libcurl/curl.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/curl share/man/man1/curl.1.gz\"\nTERMUX_SUBPKG_DESCRIPTION=\"Command line tool for transferring data with URL syntax\"\nTERMUX_SUBPKG_ESSENTIAL=true\n"
  },
  {
    "path": "packages/libdav1d/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://code.videolan.org/videolan/dav1d/\nTERMUX_PKG_DESCRIPTION=\"AV1 cross-platform decoder focused on speed and correctness\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=0.4.0\nTERMUX_PKG_SRCURL=https://downloads.videolan.org/pub/videolan/dav1d/${TERMUX_PKG_VERSION}/dav1d-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=2553b2e65081c0ec799c11a752ea43ad8f2d11b2fb36a83375972d1a00add823\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-Denable_asm=false\n-Denable_tools=false\n-Denable_tests=false\n\"\n"
  },
  {
    "path": "packages/libdb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.oracle.com/database/berkeley-db\nTERMUX_PKG_DESCRIPTION=\"The Berkeley DB embedded database system (library)\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=18.1.32\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=fa1fe7de9ba91ad472c25d026f931802597c29f28ae951960685cde487c8d654\nTERMUX_PKG_BREAKS=\"libdb-dev\"\nTERMUX_PKG_REPLACES=\"libdb-dev\"\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/db-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-hash\n--enable-smallbuild\n--enable-compat185\ndb_cv_atomic=gcc-builtin\n--enable-cxx\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"docs\"\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/dist\n}\n"
  },
  {
    "path": "packages/libdb/db.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/\"\nTERMUX_SUBPKG_DESCRIPTION=\"The Berkeley DB embedded database system\"\n"
  },
  {
    "path": "packages/libdb/fix-tmpdir.patch",
    "content": "diff -uNr db-6.2.32/src/os/os_tmpdir.c db-6.2.32.mod/src/os/os_tmpdir.c\n--- db-6.2.32/src/os/os_tmpdir.c\t2017-04-13 17:06:21.000000000 +0300\n+++ db-6.2.32.mod/src/os/os_tmpdir.c\t2019-03-02 02:06:03.557665103 +0200\n@@ -125,9 +125,9 @@\n \tDB_TEMP_DIRECTORY(\"C:/temp\");\n \tDB_TEMP_DIRECTORY(\"C:/tmp\");\n #else\n-\tDB_TEMP_DIRECTORY(\"/var/tmp\");\n-\tDB_TEMP_DIRECTORY(\"/usr/tmp\");\n-\tDB_TEMP_DIRECTORY(\"/tmp\");\n+\tDB_TEMP_DIRECTORY(\"@TERMUX_PREFIX@/var/tmp\");\n+\tDB_TEMP_DIRECTORY(\"@TERMUX_PREFIX@/usr/tmp\");\n+\tDB_TEMP_DIRECTORY(\"@TERMUX_PREFIX@/tmp\");\n #if defined(ANDROID) || defined(DB_ANDROID)\n \tDB_TEMP_DIRECTORY(\"/cache\");\n #endif\n"
  },
  {
    "path": "packages/libdb/lang-sql-generated-sqlite3.c.patch",
    "content": "diff -u -r ../db-18.1.32/lang/sql/generated/sqlite3.c ./lang/sql/generated/sqlite3.c\n--- ../db-18.1.32/lang/sql/generated/sqlite3.c\t2019-02-19 21:51:18.000000000 +0000\n+++ ./lang/sql/generated/sqlite3.c\t2019-04-13 07:40:01.383960498 +0000\n@@ -35380,9 +35380,7 @@\n   static const char *azDirs[] = {\n      0,\n      0,\n-     \"/var/tmp\",\n-     \"/usr/tmp\",\n-     \"/tmp\",\n+     \"@TERMUX_PREFIX@/tmp\",\n      \".\"\n   };\n   unsigned int i = 0;\n"
  },
  {
    "path": "packages/libdb/lang-sql-sqlite-src-os_unix.c.patch",
    "content": "diff -u -r ../db-18.1.32/lang/sql/sqlite/src/os_unix.c ./lang/sql/sqlite/src/os_unix.c\n--- ../db-18.1.32/lang/sql/sqlite/src/os_unix.c\t2019-02-19 21:51:18.000000000 +0000\n+++ ./lang/sql/sqlite/src/os_unix.c\t2019-04-13 07:37:00.461881967 +0000\n@@ -5421,9 +5421,7 @@\n   static const char *azDirs[] = {\n      0,\n      0,\n-     \"/var/tmp\",\n-     \"/usr/tmp\",\n-     \"/tmp\",\n+     \"@TERMUX_PREFIX@/tmp\",\n      \".\"\n   };\n   unsigned int i = 0;\n"
  },
  {
    "path": "packages/libdispatch/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-corelibs-libdspatch\nTERMUX_PKG_DESCRIPTION=\"The libdispatch project, for concurrency on multicore hardware\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\n_VERSION=5.1\nTERMUX_PKG_VERSION=1:${_VERSION}\nTERMUX_PKG_SRCURL=https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${_VERSION}-RELEASE.tar.gz\nTERMUX_PKG_SHA256=da24d299eecc10e7d4b40a24e0700ca2f73da622795ecf6f4a5da4d33c486662\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DENABLE_TESTING=OFF\"\n"
  },
  {
    "path": "packages/libdispatch/src-CMakeLists.txt.patch",
    "content": "diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt\nindex 2809c11..368d428 100644\n--- a/src/CMakeLists.txt\n+++ b/src/CMakeLists.txt\n@@ -246,6 +246,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)\n                  \"-Xlinker -alias_list -Xlinker ${PROJECT_SOURCE_DIR}/xcodeconfig/libdispatch.aliases\")\n endif()\n dispatch_set_linker(dispatch)\n+if(CMAKE_SYSTEM_NAME STREQUAL Android)\n+  set_property(TARGET dispatch APPEND PROPERTY LINK_LIBRARIES \"log\")\n+endif()\n \n install(TARGETS\n           dispatch\n"
  },
  {
    "path": "packages/libduktape/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.duktape.org/\nTERMUX_PKG_DESCRIPTION=\"An embeddable Javascript engine with a focus on portability and compact footprint\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.4.0\nTERMUX_PKG_REPLACES=\"duktape (<< 2.3.0-1), libduktape-dev\"\nTERMUX_PKG_BREAKS=\"duktape (<< 2.3.0-1), libduktape-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_extract_package() {\n\tgit clone --depth=1 https://github.com/svaarala/duktape.git -b v${TERMUX_PKG_VERSION} ${TERMUX_PKG_SRCDIR}\n}\n\ntermux_step_pre_configure() {\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\t# configure.py requires 'yaml' python2 module.\n\t\tif ! pip2 show pyyaml > /dev/null 2>&1; then\n\t\t\tpip2 install pyyaml\n\t\tfi\n\tfi\n}\n\ntermux_step_make() {\n\tmake libduktape.so.1.0.0 duk CC=${CC} GXX=${CXX}\n}\n\ntermux_step_make_install() {\n\tinstall libduktape.so.1.0.0 ${TERMUX_PREFIX}/lib/libduktape.so\n\tinstall duk ${TERMUX_PREFIX}/bin\n\tinstall prep/nondebug/*.h ${TERMUX_PREFIX}/include\n}\n\ntermux_step_post_make_install() {\n\t# Add a pkg-config file for the duktape lib\n\tcat > \"$PKG_CONFIG_LIBDIR/duktape.pc\" <<-HERE\n\t\tName: Duktape\n\t\tDescription: Shared library for the Duktape interpreter\n\t\tVersion: $TERMUX_PKG_VERSION\n\t\tRequires:\n\t\tLibs: -lduktape -lm\n\tHERE\n}\n"
  },
  {
    "path": "packages/libduktape/duktape.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Simple REPL for Duktape\"\n"
  },
  {
    "path": "packages/libedit/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://thrysoee.dk/editline/\nTERMUX_PKG_DESCRIPTION=\"Library providing line editing, history, and tokenization functions\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=20191025-3.1\nTERMUX_PKG_SHA256=6dff036660d478bfaa14e407fc5de26d22da1087118c897b1a3ad2e90cb7bf39\nTERMUX_PKG_SRCURL=https://thrysoee.dk/editline/libedit-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses\"\nTERMUX_PKG_BREAKS=\"libedit-dev\"\nTERMUX_PKG_REPLACES=\"libedit-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/man/man7/editline.7 share/man/man3/history.3\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -D__STDC_ISO_10646__=201103L -DNBBY=CHAR_BIT\"\n}\n"
  },
  {
    "path": "packages/libedit/src-readline.c.patch",
    "content": "diff -uNr libedit-20170329-3.1/src/readline.c libedit-20170329-3.1.mod/src/readline.c\n--- libedit-20170329-3.1/src/readline.c\t2017-03-29 21:15:04.000000000 +0300\n+++ libedit-20170329-3.1.mod/src/readline.c\t2018-06-19 17:16:05.344389818 +0300\n@@ -1198,7 +1198,7 @@\n \treturn max_input_history != INT_MAX;\n }\n \n-static const char _history_tmp_template[] = \"/tmp/.historyXXXXXX\";\n+static const char _history_tmp_template[] = \"@TERMUX_PREFIX@/tmp/.historyXXXXXX\";\n \n int\n history_truncate_file (const char *filename, int nlines)\n@@ -1772,6 +1772,9 @@\n char *\n username_completion_function(const char *text, int state)\n {\n+#ifdef __ANDROID__\n+\treturn NULL;\n+#else\n \tstruct passwd *pass = NULL;\n \n \tif (text[0] == '\\0')\n@@ -1794,6 +1797,7 @@\n \t\treturn NULL;\n \t}\n \treturn strdup(pass->pw_name);\n+#endif\n }\n \n \n"
  },
  {
    "path": "packages/libedit/src-vi.c.patch",
    "content": "diff -uNr libedit-20170329-3.1/src/vi.c libedit-20170329-3.1.mod/src/vi.c\n--- libedit-20170329-3.1/src/vi.c\t2017-03-29 21:08:21.000000000 +0300\n+++ libedit-20170329-3.1.mod/src/vi.c\t2018-06-19 17:16:24.144390787 +0300\n@@ -1004,7 +1004,7 @@\n \tpid_t pid;\n \tssize_t st;\n \tint status;\n-\tchar tempfile[] = \"/tmp/histedit.XXXXXXXXXX\";\n+\tchar tempfile[] = \"@TERMUX_PREFIX@/tmp/histedit.XXXXXXXXXX\";\n \tchar *cp = NULL;\n \tsize_t len;\n \twchar_t *line = NULL;\n"
  },
  {
    "path": "packages/libelf/aligned_alloc.c",
    "content": "/*****************************************************************************\n * aligned_alloc.c: C11 aligned_alloc() replacement\n *****************************************************************************\n * Copyright © 2012, 2017 Rémi Denis-Courmont\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as published by\n * the Free Software Foundation; either version 2.1 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public License\n * along with this program; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.\n *****************************************************************************/\n\n#ifdef HAVE_CONFIG_H\n# include <config.h>\n#endif\n\n#include <assert.h>\n#include <stdlib.h>\n#include <errno.h>\n#if !defined (HAVE_POSIX_MEMALIGN)\n# include <malloc.h>\n#endif\n\nvoid *aligned_alloc(size_t align, size_t size)\n{\n    /* align must be a power of 2 */\n    /* size must be a multiple of align */\n    if ((align & (align - 1)) || (size & (align - 1)))\n    {\n        errno = EINVAL;\n        return NULL;\n    }\n\n#ifdef __ANDROID__\n    if (align < sizeof (void *)) /* POSIX does not allow small alignment */\n        align = sizeof (void *);\n\n    void *ptr;\n    int err = posix_memalign(&ptr, align, size);\n    if (err)\n    {\n        errno = err;\n        ptr = NULL;\n    }\n    return ptr;\n\n#elif defined(HAVE_MEMALIGN)\n    return memalign(align, size);\n#elif defined (_WIN32) && defined(__MINGW32__)\n    return __mingw_aligned_malloc(size, align);\n#elif defined (_WIN32) && defined(_MSC_VER)\n    return _aligned_malloc(size, align);\n#else\n#warning unsupported aligned allocation!\n    if (size > 0)\n        errno = ENOMEM;\n    return NULL;\n#endif\n}\n"
  },
  {
    "path": "packages/libelf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceware.org/elfutils/\nTERMUX_PKG_DESCRIPTION=\"ELF object file access library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\n# NOTE: We only build the libelf part of elfutils for now,\n# as other parts are not clang compatible.\nTERMUX_PKG_VERSION=0.177\nTERMUX_PKG_SHA256=fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e\nTERMUX_PKG_SRCURL=ftp://sourceware.org/pub/elfutils/${TERMUX_PKG_VERSION}/elfutils-${TERMUX_PKG_VERSION}.tar.bz2\n# libandroid-support for langinfo.\nTERMUX_PKG_DEPENDS=\"libandroid-support, zlib\"\nTERMUX_PKG_BUILD_DEPENDS=\"argp\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_c99=yes --disable-symbol-versioning\"\nTERMUX_PKG_CONFLICTS=\"elfutils, libelf-dev\"\nTERMUX_PKG_REPLACES=\"elfutils, libelf-dev\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -Wno-error=unused-value -Wno-error=format-nonliteral -Wno-error\"\n\n\t# Exposes ACCESSPERMS in <sys/stat.h> which elfutils uses:\n\tCFLAGS+=\" -D__USE_BSD\"\n\n\tCFLAGS+=\" -DFNM_EXTMATCH=0\"\n\n\tif [ \"$TERMUX_ARCH\" = \"arm\" ]; then\n\t\tCFLAGS=\"${CFLAGS/-Oz/-O1}\"\n\tfi\n\n\tcp $TERMUX_PKG_BUILDER_DIR/error.h .\n\tcp $TERMUX_PKG_BUILDER_DIR/stdio_ext.h .\n\tcp $TERMUX_PKG_BUILDER_DIR/obstack.h .\n\tcp $TERMUX_PKG_BUILDER_DIR/qsort_r.h .\n\tcp $TERMUX_PKG_BUILDER_DIR/aligned_alloc.c libelf\n\tautoreconf -if\n}\n\ntermux_step_make() {\n\tmake -j $TERMUX_MAKE_PROCESSES -C lib\n\tmake -j $TERMUX_MAKE_PROCESSES -C libelf\n}\n\ntermux_step_make_install() {\n\tmake -j $TERMUX_MAKE_PROCESSES -C libelf install\n}\n"
  },
  {
    "path": "packages/libelf/dwfl_error.c.patch",
    "content": "diff -u -r ../elfutils-0.166/libdwfl/dwfl_error.c ./libdwfl/dwfl_error.c\n--- ../elfutils-0.166/libdwfl/dwfl_error.c\t2015-11-27 08:36:29.000000000 -0500\n+++ ./libdwfl/dwfl_error.c\t2016-05-04 13:15:42.522820139 -0400\n@@ -140,6 +140,7 @@\n const char *\n dwfl_errmsg (int error)\n {\n+  char* error_msg;\n   if (error == 0 || error == -1)\n     {\n       int last_error = global_error;\n@@ -154,7 +155,9 @@\n   switch (error &~ 0xffff)\n     {\n     case OTHER_ERROR (ERRNO):\n-      return strerror_r (error & 0xffff, \"bad\", 0);\n+      error_msg = malloc(256);\n+      strerror_r (error & 0xffff, error_msg, 256);\n+      return error_msg;\n     case OTHER_ERROR (LIBELF):\n       return elf_errmsg (error & 0xffff);\n     case OTHER_ERROR (LIBDW):\n"
  },
  {
    "path": "packages/libelf/elf_getarsym.c.patch",
    "content": "diff -u -r ../elfutils-0.159/libelf/elf_getarsym.c ./libelf/elf_getarsym.c\n--- ../elfutils-0.159/libelf/elf_getarsym.c\t2014-05-18 16:32:15.000000000 +0200\n+++ ./libelf/elf_getarsym.c\t2014-05-30 14:53:58.602211085 +0200\n@@ -45,6 +45,124 @@\n #include <dl-hash.h>\n #include \"libelfP.h\"\n \n+#ifdef __ANDROID__\n+/* Find the first occurrence of C in S.  */\n+void *\n+rawmemchr (const void *s, int c_in)\n+{\n+  /* On 32-bit hardware, choosing longword to be a 32-bit unsigned\n+     long instead of a 64-bit uintmax_t tends to give better\n+     performance.  On 64-bit hardware, unsigned long is generally 64\n+     bits already.  Change this typedef to experiment with\n+     performance.  */\n+  typedef unsigned long int longword;\n+\n+  const unsigned char *char_ptr;\n+  const longword *longword_ptr;\n+  longword repeated_one;\n+  longword repeated_c;\n+  unsigned char c;\n+\n+  c = (unsigned char) c_in;\n+\n+  /* Handle the first few bytes by reading one byte at a time.\n+     Do this until CHAR_PTR is aligned on a longword boundary.  */\n+  for (char_ptr = (const unsigned char *) s;\n+       (size_t) char_ptr % sizeof (longword) != 0;\n+       ++char_ptr)\n+    if (*char_ptr == c)\n+      return (void *) char_ptr;\n+\n+  longword_ptr = (const longword *) char_ptr;\n+\n+  /* All these elucidatory comments refer to 4-byte longwords,\n+     but the theory applies equally well to any size longwords.  */\n+\n+  /* Compute auxiliary longword values:\n+     repeated_one is a value which has a 1 in every byte.\n+     repeated_c has c in every byte.  */\n+  repeated_one = 0x01010101;\n+  repeated_c = c | (c << 8);\n+  repeated_c |= repeated_c << 16;\n+  if (0xffffffffU < (longword) -1)\n+    {\n+      repeated_one |= repeated_one << 31 << 1;\n+      repeated_c |= repeated_c << 31 << 1;\n+      if (8 < sizeof (longword))\n+        {\n+          size_t i;\n+\n+          for (i = 64; i < sizeof (longword) * 8; i *= 2)\n+            {\n+              repeated_one |= repeated_one << i;\n+              repeated_c |= repeated_c << i;\n+            }\n+        }\n+    }\n+\n+  /* Instead of the traditional loop which tests each byte, we will\n+     test a longword at a time.  The tricky part is testing if *any of\n+     the four* bytes in the longword in question are equal to NUL or\n+     c.  We first use an xor with repeated_c.  This reduces the task\n+     to testing whether *any of the four* bytes in longword1 is zero.\n+\n+     We compute tmp =\n+       ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).\n+     That is, we perform the following operations:\n+       1. Subtract repeated_one.\n+       2. & ~longword1.\n+       3. & a mask consisting of 0x80 in every byte.\n+     Consider what happens in each byte:\n+       - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,\n+         and step 3 transforms it into 0x80.  A carry can also be propagated\n+         to more significant bytes.\n+       - If a byte of longword1 is nonzero, let its lowest 1 bit be at\n+         position k (0 <= k <= 7); so the lowest k bits are 0.  After step 1,\n+         the byte ends in a single bit of value 0 and k bits of value 1.\n+         After step 2, the result is just k bits of value 1: 2^k - 1.  After\n+         step 3, the result is 0.  And no carry is produced.\n+     So, if longword1 has only non-zero bytes, tmp is zero.\n+     Whereas if longword1 has a zero byte, call j the position of the least\n+     significant zero byte.  Then the result has a zero at positions 0, ...,\n+     j-1 and a 0x80 at position j.  We cannot predict the result at the more\n+     significant bytes (positions j+1..3), but it does not matter since we\n+     already have a non-zero bit at position 8*j+7.\n+\n+     The test whether any byte in longword1 is zero is equivalent\n+     to testing whether tmp is nonzero.\n+\n+     This test can read beyond the end of a string, depending on where\n+     C_IN is encountered.  However, this is considered safe since the\n+     initialization phase ensured that the read will be aligned,\n+     therefore, the read will not cross page boundaries and will not\n+     cause a fault.  */\n+\n+  while (1)\n+    {\n+      longword longword1 = *longword_ptr ^ repeated_c;\n+\n+      if ((((longword1 - repeated_one) & ~longword1)\n+           & (repeated_one << 7)) != 0)\n+        break;\n+      longword_ptr++;\n+    }\n+\n+  char_ptr = (const unsigned char *) longword_ptr;\n+\n+  /* At this point, we know that one of the sizeof (longword) bytes\n+     starting at char_ptr is == c.  On little-endian machines, we\n+     could determine the first such byte without any further memory\n+     accesses, just by looking at the tmp result from the last loop\n+     iteration.  But this does not work on big-endian machines.\n+     Choose code that works in both cases.  */\n+\n+  char_ptr = (unsigned char *) longword_ptr;\n+  while (*char_ptr != c)\n+    char_ptr++;\n+  return (void *) char_ptr;\n+}\n+#endif\n+\n \n static int\n read_number_entries (uint64_t *nump, Elf *elf, size_t *offp, bool index64_p)\n"
  },
  {
    "path": "packages/libelf/elf_update.c.patch",
    "content": "diff -u -r ../elfutils-0.166/libelf/elf_update.c ./libelf/elf_update.c\n--- ../elfutils-0.166/libelf/elf_update.c\t2015-11-27 08:36:29.000000000 -0500\n+++ ./libelf/elf_update.c\t2016-05-04 13:06:15.836140729 -0400\n@@ -39,6 +39,7 @@\n \n #include \"libelfP.h\"\n \n+#define off_t loff_t\n \n static off_t\n write_file (Elf *elf, off_t size, int change_bo, size_t shnum)\n"
  },
  {
    "path": "packages/libelf/error.h",
    "content": "#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n/* program_invocation_short_name GNU extension - http://linux.die.net/man/3/program_invocation_short_name */\nextern char* __progname;\n#define program_invocation_short_name __progname\n\n/* error(3) GNU extension - http://man7.org/linux/man-pages/man3/error.3.html */\nunsigned int error_message_count;\nstatic inline void error(int status, int errnum, const char* format, ...) {\n        error_message_count++;\n        va_list myargs;\n        va_start(myargs, format);\n        vfprintf(stderr, format, myargs);\n        va_end(myargs);\n        exit(status);\n}\n\n/* strchrnul(3) GNU extension - http://man7.org/linux/man-pages/man3/strchr.3.html */\nstatic inline char* strchrnul(char const* s, int c)\n{\n        char* result = strchr(s, c);\n        return (result == NULL) ? (char*)(s + strlen(s)) : result;\n}\n"
  },
  {
    "path": "packages/libelf/lib-color.c.patch",
    "content": "diff -uNr elfutils-0.177/lib/color.c elfutils-0.177.mod/lib/color.c\n--- elfutils-0.177/lib/color.c\t2019-08-14 13:12:33.000000000 +0300\n+++ elfutils-0.177.mod/lib/color.c\t2019-09-18 16:23:09.802519067 +0300\n@@ -40,6 +40,8 @@\n #include \"libeu.h\"\n #include \"color.h\"\n \n+extern char* __progname;\n+\n /* Prototype for option handler.  */\n static error_t parse_opt (int key, char *arg, struct argp_state *state);\n \n@@ -130,9 +132,9 @@\n   - 'always', 'yes', 'force'\\n\\\n   - 'never', 'no', 'none'\\n\\\n   - 'auto', 'tty', 'if-tty'\\n\"),\n-\t\t     program_invocation_short_name, arg);\n+\t\t     __progname, arg);\n \t      argp_help (&color_argp, stderr, ARGP_HELP_SEE,\n-\t\t\t (char *) program_invocation_short_name);\n+\t\t\t __progname);\n \t      exit (EXIT_FAILURE);\n \t    }\n \t}\n"
  },
  {
    "path": "packages/libelf/libdwflP.h.patch",
    "content": "diff -u -r ../elfutils-0.166/libdwfl/libdwflP.h ./libdwfl/libdwflP.h\n--- ../elfutils-0.166/libdwfl/libdwflP.h\t2016-01-12 07:49:19.000000000 -0500\n+++ ./libdwfl/libdwflP.h\t2016-05-04 13:21:07.997599838 -0400\n@@ -771,5 +771,10 @@\n /* The default used by dwfl_standard_find_debuginfo.  */\n #define DEFAULT_DEBUGINFO_PATH \":.debug:/usr/lib/debug\"\n \n+ /* canonicalize_file_name GNU extension - http://man7.org/linux/man-pages/man3/canonicalize_file_name.3.html */\n+inline static char* canonicalize_file_name(const char *path)\n+{\n+        return realpath(path, NULL);\n+}\n \n #endif\t/* libdwflP.h */\n"
  },
  {
    "path": "packages/libelf/libelfmakefile.am.patch",
    "content": "--- ./libelf/Makefile.am.orig\t2019-05-29 05:19:01.983292465 +0000\n+++ ./libelf/Makefile.am\t2019-05-29 05:19:19.759573256 +0000\n@@ -62,7 +62,7 @@\n \t\t   gelf_update_ehdr.c \\\n \t\t   elf32_getphdr.c elf64_getphdr.c gelf_getphdr.c \\\n \t\t   elf32_newphdr.c elf64_newphdr.c gelf_newphdr.c \\\n-\t\t   gelf_update_phdr.c \\\n+\t\t   gelf_update_phdr.c aligned_alloc.c \\\n \t\t   elf_getarhdr.c elf_getarsym.c \\\n \t\t   elf_rawfile.c elf_readall.c elf_cntl.c \\\n \t\t   elf_getscn.c elf_nextscn.c elf_ndxscn.c elf_newscn.c \\\n"
  },
  {
    "path": "packages/libelf/obstack.h",
    "content": "/* obstack.h - object stack macros\n   Copyright (C) 1988-1994,1996-1999,2003,2004,2005,2009,2011,2012\n\tFree Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, see\n   <http://www.gnu.org/licenses/>.  */\n\n/* Summary:\n\nAll the apparent functions defined here are macros. The idea\nis that you would use these pre-tested macros to solve a\nvery specific set of problems, and they would run fast.\nCaution: no side-effects in arguments please!! They may be\nevaluated MANY times!!\n\nThese macros operate a stack of objects.  Each object starts life\nsmall, and may grow to maturity.  (Consider building a word syllable\nby syllable.)  An object can move while it is growing.  Once it has\nbeen \"finished\" it never changes address again.  So the \"top of the\nstack\" is typically an immature growing object, while the rest of the\nstack is of mature, fixed size and fixed address objects.\n\nThese routines grab large chunks of memory, using a function you\nsupply, called `obstack_chunk_alloc'.  On occasion, they free chunks,\nby calling `obstack_chunk_free'.  You must define them and declare\nthem before using any obstack macros.\n\nEach independent stack is represented by a `struct obstack'.\nEach of the obstack macros expects a pointer to such a structure\nas the first argument.\n\nOne motivation for this package is the problem of growing char strings\nin symbol tables.  Unless you are \"fascist pig with a read-only mind\"\n--Gosper's immortal quote from HAKMEM item 154, out of context--you\nwould not like to put any arbitrary upper limit on the length of your\nsymbols.\n\nIn practice this often means you will build many short symbols and a\nfew long symbols.  At the time you are reading a symbol you don't know\nhow long it is.  One traditional method is to read a symbol into a\nbuffer, realloc()ating the buffer every time you try to read a symbol\nthat is longer than the buffer.  This is beaut, but you still will\nwant to copy the symbol from the buffer to a more permanent\nsymbol-table entry say about half the time.\n\nWith obstacks, you can work differently.  Use one obstack for all symbol\nnames.  As you read a symbol, grow the name in the obstack gradually.\nWhen the name is complete, finalize it.  Then, if the symbol exists already,\nfree the newly read name.\n\nThe way we do this is to take a large chunk, allocating memory from\nlow addresses.  When you want to build a symbol in the chunk you just\nadd chars above the current \"high water mark\" in the chunk.  When you\nhave finished adding chars, because you got to the end of the symbol,\nyou know how long the chars are, and you can create a new object.\nMostly the chars will not burst over the highest address of the chunk,\nbecause you would typically expect a chunk to be (say) 100 times as\nlong as an average object.\n\nIn case that isn't clear, when we have enough chars to make up\nthe object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)\nso we just point to it where it lies.  No moving of chars is\nneeded and this is the second win: potentially long strings need\nnever be explicitly shuffled. Once an object is formed, it does not\nchange its address during its lifetime.\n\nWhen the chars burst over a chunk boundary, we allocate a larger\nchunk, and then copy the partly formed object from the end of the old\nchunk to the beginning of the new larger chunk.  We then carry on\naccreting characters to the end of the object as we normally would.\n\nA special macro is provided to add a single char at a time to a\ngrowing object.  This allows the use of register variables, which\nbreak the ordinary 'growth' macro.\n\nSummary:\n\tWe allocate large chunks.\n\tWe carve out one object at a time from the current chunk.\n\tOnce carved, an object never moves.\n\tWe are free to append data of any size to the currently\n\t  growing object.\n\tExactly one object is growing in an obstack at any one time.\n\tYou can run one obstack per control block.\n\tYou may have as many control blocks as you dare.\n\tBecause of the way we do it, you can `unwind' an obstack\n\t  back to a previous state. (You may remove objects much\n\t  as you would with a stack.)\n*/\n\n\n/* Don't do the contents of this file more than once.  */\n\n#ifndef _OBSTACK_H\n#define _OBSTACK_H 1\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\f\n/* We need the type of a pointer subtraction.  If __PTRDIFF_TYPE__ is\n   defined, as with GNU C, use that; that way we don't pollute the\n   namespace with <stddef.h>'s symbols.  Otherwise, include <stddef.h>\n   and use ptrdiff_t.  */\n\n#ifdef __PTRDIFF_TYPE__\n# define PTR_INT_TYPE __PTRDIFF_TYPE__\n#else\n# include <stddef.h>\n# define PTR_INT_TYPE ptrdiff_t\n#endif\n\n/* If B is the base of an object addressed by P, return the result of\n   aligning P to the next multiple of A + 1.  B and P must be of type\n   char *.  A + 1 must be a power of 2.  */\n\n#define __BPTR_ALIGN(B, P, A) ((B) + (((P) - (B) + (A)) & ~(A)))\n\n/* Similiar to _BPTR_ALIGN (B, P, A), except optimize the common case\n   where pointers can be converted to integers, aligned as integers,\n   and converted back again.  If PTR_INT_TYPE is narrower than a\n   pointer (e.g., the AS/400), play it safe and compute the alignment\n   relative to B.  Otherwise, use the faster strategy of computing the\n   alignment relative to 0.  */\n\n#define __PTR_ALIGN(B, P, A)\t\t\t\t\t\t    \\\n  __BPTR_ALIGN (sizeof (PTR_INT_TYPE) < sizeof (void *) ? (B) : (char *) 0, \\\n\t\tP, A)\n\n#include <string.h>\n\nstruct _obstack_chunk\t\t/* Lives at front of each chunk. */\n{\n  char  *limit;\t\t\t/* 1 past end of this chunk */\n  struct _obstack_chunk *prev;\t/* address of prior chunk or NULL */\n  char\tcontents[4];\t\t/* objects begin here */\n};\n\nstruct obstack\t\t/* control current object in current chunk */\n{\n  long\tchunk_size;\t\t/* preferred size to allocate chunks in */\n  struct _obstack_chunk *chunk;\t/* address of current struct obstack_chunk */\n  char\t*object_base;\t\t/* address of object we are building */\n  char\t*next_free;\t\t/* where to add next char to current object */\n  char\t*chunk_limit;\t\t/* address of char after current chunk */\n  union\n  {\n    PTR_INT_TYPE tempint;\n    void *tempptr;\n  } temp;\t\t\t/* Temporary for some macros.  */\n  int   alignment_mask;\t\t/* Mask of alignment for each object. */\n  /* These prototypes vary based on `use_extra_arg', and we use\n     casts to the prototypeless function type in all assignments,\n     but having prototypes here quiets -Wstrict-prototypes.  */\n  struct _obstack_chunk *(*chunkfun) (void *, long);\n  void (*freefun) (void *, struct _obstack_chunk *);\n  void *extra_arg;\t\t/* first arg for chunk alloc/dealloc funcs */\n  unsigned use_extra_arg:1;\t/* chunk alloc/dealloc funcs take extra arg */\n  unsigned maybe_empty_object:1;/* There is a possibility that the current\n\t\t\t\t   chunk contains a zero-length object.  This\n\t\t\t\t   prevents freeing the chunk if we allocate\n\t\t\t\t   a bigger chunk to replace it. */\n  unsigned alloc_failed:1;\t/* No longer used, as we now call the failed\n\t\t\t\t   handler on error, but retained for binary\n\t\t\t\t   compatibility.  */\n};\n\nstatic void _obstack_newchunk (struct obstack *h, int length);\n\n/* Exit value used when `print_and_abort' is used.  */\nextern int obstack_exit_failure;\n\f\n/* Pointer to beginning of object being allocated or to be allocated next.\n   Note that this might not be the final address of the object\n   because a new chunk might be needed to hold the final size.  */\n\n#define obstack_base(h) ((void *) (h)->object_base)\n\n/* Size for allocating ordinary chunks.  */\n\n#define obstack_chunk_size(h) ((h)->chunk_size)\n\n/* Pointer to next byte not yet allocated in current chunk.  */\n\n#define obstack_next_free(h)\t((h)->next_free)\n\n/* Mask specifying low bits that should be clear in address of an object.  */\n\n#define obstack_alignment_mask(h) ((h)->alignment_mask)\n\n/* To prevent prototype warnings provide complete argument list.  */\n#define obstack_init(h)\t\t\t\t\t\t\\\n  _obstack_begin ((h), 0, 0,\t\t\t\t\t\\\n\t\t  (void *(*) (long)) obstack_chunk_alloc,\t\\\n\t\t  (void (*) (void *)) obstack_chunk_free)\n\n#define obstack_begin(h, size)\t\t\t\t\t\\\n  _obstack_begin ((h), (size), 0,\t\t\t\t\\\n\t\t  (void *(*) (long)) obstack_chunk_alloc,\t\\\n\t\t  (void (*) (void *)) obstack_chunk_free)\n\n#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun)  \\\n  _obstack_begin ((h), (size), (alignment),\t\t\t\t   \\\n\t\t  (void *(*) (long)) (chunkfun),\t\t\t   \\\n\t\t  (void (*) (void *)) (freefun))\n\n#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \\\n  _obstack_begin_1 ((h), (size), (alignment),\t\t\t\t\\\n\t\t    (void *(*) (void *, long)) (chunkfun),\t\t\\\n\t\t    (void (*) (void *, void *)) (freefun), (arg))\n\n#define obstack_chunkfun(h, newchunkfun) \\\n  ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))\n\n#define obstack_freefun(h, newfreefun) \\\n  ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))\n\n#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))\n\n#define obstack_blank_fast(h,n) ((h)->next_free += (n))\n\n#define obstack_memory_used(h) _obstack_memory_used (h)\n\f\n#if defined __GNUC__\n/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and\n   does not implement __extension__.  But that compiler doesn't define\n   __GNUC_MINOR__.  */\n# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)\n#  define __extension__\n# endif\n\n/* For GNU C, if not -traditional,\n   we can define these macros to compute all args only once\n   without using a global variable.\n   Also, we can avoid using the `temp' slot, to make faster code.  */\n\n# define obstack_object_size(OBSTACK)\t\t\t\t\t\\\n  __extension__\t\t\t\t\t\t\t\t\\\n  ({ struct obstack const *__o = (OBSTACK);\t\t\t\t\\\n     (unsigned) (__o->next_free - __o->object_base); })\n\n# define obstack_room(OBSTACK)\t\t\t\t\t\t\\\n  __extension__\t\t\t\t\t\t\t\t\\\n  ({ struct obstack const *__o = (OBSTACK);\t\t\t\t\\\n     (unsigned) (__o->chunk_limit - __o->next_free); })\n\n# define obstack_make_room(OBSTACK,length)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   int __len = (length);\t\t\t\t\t\t\\\n   if (__o->chunk_limit - __o->next_free < __len)\t\t\t\\\n     _obstack_newchunk (__o, __len);\t\t\t\t\t\\\n   (void) 0; })\n\n# define obstack_empty_p(OBSTACK)\t\t\t\t\t\\\n  __extension__\t\t\t\t\t\t\t\t\\\n  ({ struct obstack const *__o = (OBSTACK);\t\t\t\t\\\n     (__o->chunk->prev == 0\t\t\t\t\t\t\\\n      && __o->next_free == __PTR_ALIGN ((char *) __o->chunk,\t\t\\\n\t\t\t\t\t__o->chunk->contents,\t\t\\\n\t\t\t\t\t__o->alignment_mask)); })\n\n# define obstack_grow(OBSTACK,where,length)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   int __len = (length);\t\t\t\t\t\t\\\n   if (__o->next_free + __len > __o->chunk_limit)\t\t\t\\\n     _obstack_newchunk (__o, __len);\t\t\t\t\t\\\n   memcpy (__o->next_free, where, __len);\t\t\t\t\\\n   __o->next_free += __len;\t\t\t\t\t\t\\\n   (void) 0; })\n\n# define obstack_grow0(OBSTACK,where,length)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   int __len = (length);\t\t\t\t\t\t\\\n   if (__o->next_free + __len + 1 > __o->chunk_limit)\t\t\t\\\n     _obstack_newchunk (__o, __len + 1);\t\t\t\t\\\n   memcpy (__o->next_free, where, __len);\t\t\t\t\\\n   __o->next_free += __len;\t\t\t\t\t\t\\\n   *(__o->next_free)++ = 0;\t\t\t\t\t\t\\\n   (void) 0; })\n\n# define obstack_1grow(OBSTACK,datum)\t\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   if (__o->next_free + 1 > __o->chunk_limit)\t\t\t\t\\\n     _obstack_newchunk (__o, 1);\t\t\t\t\t\\\n   obstack_1grow_fast (__o, datum);\t\t\t\t\t\\\n   (void) 0; })\n\n/* These assume that the obstack alignment is good enough for pointers\n   or ints, and that the data added so far to the current object\n   shares that much alignment.  */\n\n# define obstack_ptr_grow(OBSTACK,datum)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   if (__o->next_free + sizeof (void *) > __o->chunk_limit)\t\t\\\n     _obstack_newchunk (__o, sizeof (void *));\t\t\t\t\\\n   obstack_ptr_grow_fast (__o, datum); })\t\t\t\t\\\n\n# define obstack_int_grow(OBSTACK,datum)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   if (__o->next_free + sizeof (int) > __o->chunk_limit)\t\t\\\n     _obstack_newchunk (__o, sizeof (int));\t\t\t\t\\\n   obstack_int_grow_fast (__o, datum); })\n\n# define obstack_ptr_grow_fast(OBSTACK,aptr)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o1 = (OBSTACK);\t\t\t\t\t\\\n   *(const void **) __o1->next_free = (aptr);\t\t\t\t\\\n   __o1->next_free += sizeof (const void *);\t\t\t\t\\\n   (void) 0; })\n\n# define obstack_int_grow_fast(OBSTACK,aint)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o1 = (OBSTACK);\t\t\t\t\t\\\n   *(int *) __o1->next_free = (aint);\t\t\t\t\t\\\n   __o1->next_free += sizeof (int);\t\t\t\t\t\\\n   (void) 0; })\n\n# define obstack_blank(OBSTACK,length)\t\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   int __len = (length);\t\t\t\t\t\t\\\n   if (__o->chunk_limit - __o->next_free < __len)\t\t\t\\\n     _obstack_newchunk (__o, __len);\t\t\t\t\t\\\n   obstack_blank_fast (__o, __len);\t\t\t\t\t\\\n   (void) 0; })\n\n# define obstack_alloc(OBSTACK,length)\t\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__h = (OBSTACK);\t\t\t\t\t\\\n   obstack_blank (__h, (length));\t\t\t\t\t\\\n   obstack_finish (__h); })\n\n# define obstack_copy(OBSTACK,where,length)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__h = (OBSTACK);\t\t\t\t\t\\\n   obstack_grow (__h, (where), (length));\t\t\t\t\\\n   obstack_finish (__h); })\n\n# define obstack_copy0(OBSTACK,where,length)\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__h = (OBSTACK);\t\t\t\t\t\\\n   obstack_grow0 (__h, (where), (length));\t\t\t\t\\\n   obstack_finish (__h); })\n\n/* The local variable is named __o1 to avoid a name conflict\n   when obstack_blank is called.  */\n# define obstack_finish(OBSTACK)\t\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o1 = (OBSTACK);\t\t\t\t\t\\\n   void *__value = (void *) __o1->object_base;\t\t\t\t\\\n   if (__o1->next_free == __value)\t\t\t\t\t\\\n     __o1->maybe_empty_object = 1;\t\t\t\t\t\\\n   __o1->next_free\t\t\t\t\t\t\t\\\n     = __PTR_ALIGN (__o1->object_base, __o1->next_free,\t\t\t\\\n\t\t    __o1->alignment_mask);\t\t\t\t\\\n   if (__o1->next_free - (char *)__o1->chunk\t\t\t\t\\\n       > __o1->chunk_limit - (char *)__o1->chunk)\t\t\t\\\n     __o1->next_free = __o1->chunk_limit;\t\t\t\t\\\n   __o1->object_base = __o1->next_free;\t\t\t\t\t\\\n   __value; })\n\n# define obstack_free(OBSTACK, OBJ)\t\t\t\t\t\\\n__extension__\t\t\t\t\t\t\t\t\\\n({ struct obstack *__o = (OBSTACK);\t\t\t\t\t\\\n   void *__obj = (OBJ);\t\t\t\t\t\t\t\\\n   if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit)  \\\n     __o->next_free = __o->object_base = (char *)__obj;\t\t\t\\\n   else (obstack_free_func) (__o, __obj); })\n\f\n#else /* not __GNUC__ */\n\n# define obstack_object_size(h) \\\n (unsigned) ((h)->next_free - (h)->object_base)\n\n# define obstack_room(h)\t\t\\\n (unsigned) ((h)->chunk_limit - (h)->next_free)\n\n# define obstack_empty_p(h) \\\n ((h)->chunk->prev == 0\t\t\t\t\t\t\t\\\n  && (h)->next_free == __PTR_ALIGN ((char *) (h)->chunk,\t\t\\\n\t\t\t\t    (h)->chunk->contents,\t\t\\\n\t\t\t\t    (h)->alignment_mask))\n\n/* Note that the call to _obstack_newchunk is enclosed in (..., 0)\n   so that we can avoid having void expressions\n   in the arms of the conditional expression.\n   Casting the third operand to void was tried before,\n   but some compilers won't accept it.  */\n\n# define obstack_make_room(h,length)\t\t\t\t\t\\\n( (h)->temp.tempint = (length),\t\t\t\t\t\t\\\n  (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit)\t\t\\\n   ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0))\n\n# define obstack_grow(h,where,length)\t\t\t\t\t\\\n( (h)->temp.tempint = (length),\t\t\t\t\t\t\\\n  (((h)->next_free + (h)->temp.tempint > (h)->chunk_limit)\t\t\\\n   ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0),\t\t\\\n  memcpy ((h)->next_free, where, (h)->temp.tempint),\t\t\t\\\n  (h)->next_free += (h)->temp.tempint)\n\n# define obstack_grow0(h,where,length)\t\t\t\t\t\\\n( (h)->temp.tempint = (length),\t\t\t\t\t\t\\\n  (((h)->next_free + (h)->temp.tempint + 1 > (h)->chunk_limit)\t\t\\\n   ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0),\t\t\\\n  memcpy ((h)->next_free, where, (h)->temp.tempint),\t\t\t\\\n  (h)->next_free += (h)->temp.tempint,\t\t\t\t\t\\\n  *((h)->next_free)++ = 0)\n\n# define obstack_1grow(h,datum)\t\t\t\t\t\t\\\n( (((h)->next_free + 1 > (h)->chunk_limit)\t\t\t\t\\\n   ? (_obstack_newchunk ((h), 1), 0) : 0),\t\t\t\t\\\n  obstack_1grow_fast (h, datum))\n\n# define obstack_ptr_grow(h,datum)\t\t\t\t\t\\\n( (((h)->next_free + sizeof (char *) > (h)->chunk_limit)\t\t\\\n   ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0),\t\t\\\n  obstack_ptr_grow_fast (h, datum))\n\n# define obstack_int_grow(h,datum)\t\t\t\t\t\\\n( (((h)->next_free + sizeof (int) > (h)->chunk_limit)\t\t\t\\\n   ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0),\t\t\t\\\n  obstack_int_grow_fast (h, datum))\n\n# define obstack_ptr_grow_fast(h,aptr)\t\t\t\t\t\\\n  (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr))\n\n# define obstack_int_grow_fast(h,aint)\t\t\t\t\t\\\n  (((int *) ((h)->next_free += sizeof (int)))[-1] = (aint))\n\n# define obstack_blank(h,length)\t\t\t\t\t\\\n( (h)->temp.tempint = (length),\t\t\t\t\t\t\\\n  (((h)->chunk_limit - (h)->next_free < (h)->temp.tempint)\t\t\\\n   ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0),\t\t\\\n  obstack_blank_fast (h, (h)->temp.tempint))\n\n# define obstack_alloc(h,length)\t\t\t\t\t\\\n (obstack_blank ((h), (length)), obstack_finish ((h)))\n\n# define obstack_copy(h,where,length)\t\t\t\t\t\\\n (obstack_grow ((h), (where), (length)), obstack_finish ((h)))\n\n# define obstack_copy0(h,where,length)\t\t\t\t\t\\\n (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))\n\n# define obstack_finish(h)\t\t\t\t\t\t\\\n( ((h)->next_free == (h)->object_base\t\t\t\t\t\\\n   ? (((h)->maybe_empty_object = 1), 0)\t\t\t\t\t\\\n   : 0),\t\t\t\t\t\t\t\t\\\n  (h)->temp.tempptr = (h)->object_base,\t\t\t\t\t\\\n  (h)->next_free\t\t\t\t\t\t\t\\\n    = __PTR_ALIGN ((h)->object_base, (h)->next_free,\t\t\t\\\n\t\t   (h)->alignment_mask),\t\t\t\t\\\n  (((h)->next_free - (char *) (h)->chunk\t\t\t\t\\\n    > (h)->chunk_limit - (char *) (h)->chunk)\t\t\t\t\\\n   ? ((h)->next_free = (h)->chunk_limit) : 0),\t\t\t\t\\\n  (h)->object_base = (h)->next_free,\t\t\t\t\t\\\n  (h)->temp.tempptr)\n\n# define obstack_free(h,obj)\t\t\t\t\t\t\\\n( (h)->temp.tempint = (char *) (obj) - (char *) (h)->chunk,\t\t\\\n  ((((h)->temp.tempint > 0\t\t\t\t\t\t\\\n    && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk))\t\\\n   ? (((h)->next_free = (h)->object_base\t\t\t\t\\\n       = (h)->temp.tempint + (char *) (h)->chunk), 0)\t\t\t\\\n   : ((obstack_free_func) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0)))\n\n#endif /* not __GNUC__ */\n\n/* START LOCAL ADDITION */\nstatic inline int obstack_printf(struct obstack *obst, const char *fmt, ...)\n{\n        char buf[1024];\n        va_list ap;\n        int len;\n\n        va_start(ap, fmt);\n        len = vsnprintf(buf, sizeof(buf), fmt, ap);\n        obstack_grow(obst, buf, len);\n        va_end(ap);\n\n        return len;\n}\n/* Determine default alignment.  */\nunion fooround\n{\n  uintmax_t i;\n  long double d;\n  void *p;\n};\nstruct fooalign\n{\n  char c;\n  union fooround u;\n};\n/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.\n   But in fact it might be less smart and round addresses to as much as\n   DEFAULT_ROUNDING.  So we prepare for it to do that.  */\nenum\n  {\n    DEFAULT_ALIGNMENT = offsetof (struct fooalign, u),\n    DEFAULT_ROUNDING = sizeof (union fooround)\n  };\n\n/* When we copy a long block of data, this is the unit to do it with.\n   On some machines, copying successive ints does not work;\n   in such a case, redefine COPYING_UNIT to `long' (if that works)\n   or `char' as a last resort.  */\n# ifndef COPYING_UNIT\n#  define COPYING_UNIT int\n# endif\n\n\n/* The functions allocating more room by calling `obstack_chunk_alloc'\n   jump to the handler pointed to by `obstack_alloc_failed_handler'.\n   This can be set to a user defined function which should either\n   abort gracefully or use longjump - but shouldn't return.  This\n   variable by default points to the internal function\n   `print_and_abort'.  */\nstatic void print_and_abort (void);\n\n# ifdef _LIBC\n#  if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)\n/* A looong time ago (before 1994, anyway; we're not sure) this global variable\n   was used by non-GNU-C macros to avoid multiple evaluation.  The GNU C\n   library still exports it because somebody might use it.  */\nstruct obstack *_obstack_compat;\ncompat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0);\n#  endif\n# endif\n\n/* Define a macro that either calls functions with the traditional malloc/free\n   calling interface, or calls functions with the mmalloc/mfree interface\n   (that adds an extra first argument), based on the state of use_extra_arg.\n   For free, do not use ?:, since some compilers, like the MIPS compilers,\n   do not allow (expr) ? void : void.  */\n\n# define CALL_CHUNKFUN(h, size) \\\n  (((h) -> use_extra_arg) \\\n   ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \\\n   : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))\n\n# define CALL_FREEFUN(h, old_chunk) \\\n  do { \\\n    if ((h) -> use_extra_arg) \\\n      (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \\\n    else \\\n      (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \\\n  } while (0)\n\n\f\n/* Initialize an obstack H for use.  Specify chunk size SIZE (0 means default).\n   Objects start on multiples of ALIGNMENT (0 means use default).\n   CHUNKFUN is the function to use to allocate chunks,\n   and FREEFUN the function to free them.\n   Return nonzero if successful, calls obstack_alloc_failed_handler if\n   allocation fails.  */\n\nstatic int _obstack_begin (struct obstack *h,\n                int size, int alignment,\n                void *(*chunkfun) (long),\n                void (*freefun) (void *))\n{\n  register struct _obstack_chunk *chunk; /* points to new chunk */\n\n  if (alignment == 0)\n    alignment = DEFAULT_ALIGNMENT;\n  if (size == 0)\n    /* Default size is what GNU malloc can fit in a 4096-byte block.  */\n    {\n      /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.\n         Use the values for range checking, because if range checking is off,\n         the extra bytes won't be missed terribly, but if range checking is on\n         and we used a larger request, a whole extra 4096 bytes would be\n         allocated.\n         These number are irrelevant to the new GNU malloc.  I suspect it is\n         less sensitive to the size of the request.  */\n      int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))\n                    + 4 + DEFAULT_ROUNDING - 1)\n                   & ~(DEFAULT_ROUNDING - 1));\n      size = 4096 - extra;\n    }\n\n  h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;\n  h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;\n  h->chunk_size = size;\n  h->alignment_mask = alignment - 1;\n  h->use_extra_arg = 0;\n\n  chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);\n  if (!chunk) print_and_abort();\n  h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,\n                                               alignment - 1);\n  h->chunk_limit = chunk->limit\n    = (char *) chunk + h->chunk_size;\n  chunk->prev = 0;\n  /* The initial chunk now contains no empty object.  */\n  h->maybe_empty_object = 0;\n  h->alloc_failed = 0;\n  return 1;\n}\n\nstatic int _obstack_begin_1 (struct obstack *h, int size, int alignment,\n                  void *(*chunkfun) (void *, long),\n                  void (*freefun) (void *, void *),\n                  void *arg)\n{\n  register struct _obstack_chunk *chunk; /* points to new chunk */\n\n  if (alignment == 0)\n    alignment = DEFAULT_ALIGNMENT;\n  if (size == 0)\n    /* Default size is what GNU malloc can fit in a 4096-byte block.  */\n    {\n      /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.\n         Use the values for range checking, because if range checking is off,\n         the extra bytes won't be missed terribly, but if range checking is on\n         and we used a larger request, a whole extra 4096 bytes would be\n         allocated.\n         These number are irrelevant to the new GNU malloc.  I suspect it is\n         less sensitive to the size of the request.  */\n      int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))\n                    + 4 + DEFAULT_ROUNDING - 1)\n                   & ~(DEFAULT_ROUNDING - 1));\n      size = 4096 - extra;\n    }\n\n  h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;\n  h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;\n  h->chunk_size = size;\n  h->alignment_mask = alignment - 1;\n  h->extra_arg = arg;\n  h->use_extra_arg = 1;\n\n  chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);\n  if (!chunk) print_and_abort();\n  h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,\n                                               alignment - 1);\n  h->chunk_limit = chunk->limit\n    = (char *) chunk + h->chunk_size;\n  chunk->prev = 0;\n  /* The initial chunk now contains no empty object.  */\n  h->maybe_empty_object = 0;\n  h->alloc_failed = 0;\n  return 1;\n}\n\n/* Allocate a new current chunk for the obstack *H\n   on the assumption that LENGTH bytes need to be added\n   to the current object, or a new object of length LENGTH allocated.\n   Copies any partial object from the end of the old chunk\n   to the beginning of the new one.  */\n\nstatic void _obstack_newchunk (struct obstack *h, int length)\n{\n  register struct _obstack_chunk *old_chunk = h->chunk;\n  register struct _obstack_chunk *new_chunk;\n  register long new_size;\n  register long obj_size = h->next_free - h->object_base;\n  register long i;\n  long already;\n  char *object_base;\n\n  /* Compute size for new chunk.  */\n  new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100;\n  if (new_size < h->chunk_size)\n    new_size = h->chunk_size;\n\n  /* Allocate and initialize the new chunk.  */\n  new_chunk = CALL_CHUNKFUN (h, new_size);\n  if (!new_chunk) print_and_abort();\n  h->chunk = new_chunk;\n  new_chunk->prev = old_chunk;\n  new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;\n\n  /* Compute an aligned object_base in the new chunk */\n  object_base =\n    __PTR_ALIGN ((char *) new_chunk, new_chunk->contents, h->alignment_mask);\n\n  /* Move the existing object to the new chunk.\n     Word at a time is fast and is safe if the object\n     is sufficiently aligned.  */\n  if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT)\n    {\n      for (i = obj_size / sizeof (COPYING_UNIT) - 1;\n           i >= 0; i--)\n        ((COPYING_UNIT *)object_base)[i]\n          = ((COPYING_UNIT *)h->object_base)[i];\n      /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,\n         but that can cross a page boundary on a machine\n         which does not do strict alignment for COPYING_UNITS.  */\n      already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT);\n    }\n  else\n    already = 0;\n  /* Copy remaining bytes one by one.  */\n  for (i = already; i < obj_size; i++)\n    object_base[i] = h->object_base[i];\n\n  /* If the object just copied was the only data in OLD_CHUNK,\n     free that chunk and remove it from the chain.\n     But not if that chunk might contain an empty object.  */\n  if (! h->maybe_empty_object\n      && (h->object_base\n          == __PTR_ALIGN ((char *) old_chunk, old_chunk->contents,\n                          h->alignment_mask)))\n    {\n      new_chunk->prev = old_chunk->prev;\n      CALL_FREEFUN (h, old_chunk);\n    }\n\n  h->object_base = object_base;\n  h->next_free = h->object_base + obj_size;\n  /* The new chunk certainly contains no empty object yet.  */\n  h->maybe_empty_object = 0;\n}\n\n/* Return nonzero if object OBJ has been allocated from obstack H.\n   This is here for debugging.\n   If you use it in a program, you are probably losing.  */\n\n/* Free objects in obstack H, including OBJ and everything allocate\n   more recently than OBJ.  If OBJ is zero, free everything in H.  */\nstatic void obstack_free_func (struct obstack *h, void *obj)\n{\n        register struct _obstack_chunk *lp;   /* below addr of any objects in this chunk */\n        register struct _obstack_chunk *plp;        /* point to previous chunk if any */\n\n        lp = h->chunk;\n        /* We use >= because there cannot be an object at the beginning of a chunk.\n           But there can be an empty object at that address\n           at the end of another chunk.  */\n        while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))\n        {\n                plp = lp->prev;\n                CALL_FREEFUN (h, lp);\n                lp = plp;\n                /* If we switch chunks, we can't tell whether the new current\n                   chunk contains an empty object, so assume that it may.  */\n                h->maybe_empty_object = 1;\n        }\n        if (lp)\n        {\n                h->object_base = h->next_free = (char *) (obj);\n                h->chunk_limit = lp->limit;\n                h->chunk = lp;\n        }\n        else if (obj != 0)\n                /* obj is not in any of the chunks! */\n                abort ();\n}\n\nstatic int _obstack_memory_used (struct obstack *h)\n{\n  register struct _obstack_chunk* lp;\n  register int nbytes = 0;\n\n  for (lp = h->chunk; lp != 0; lp = lp->prev)\n    {\n      nbytes += lp->limit - (char *) lp;\n    }\n  return nbytes;\n}\n\nstatic void __attribute__ ((noreturn)) print_and_abort (void)\n{\n        fprintf(stderr, \"%s\\n\", \"memory exhausted\");\n        exit(1);\n}\n\n/* END LOCAL ADDITION */\n\n#ifdef __cplusplus\n}\t/* C++ */\n#endif\n\n#endif /* obstack.h */\n"
  },
  {
    "path": "packages/libelf/qsort_r.h",
    "content": "/* https://raw.githubusercontent.com/android/platform_bionic/master/libc/upstream-freebsd/lib/libc/stdlib/qsort.c */\n\n#define I_AM_QSORT_R\n\n/*-\n * Copyright (c) 1992, 1993\n *      The Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include <sys/cdefs.h>\n#include <stdlib.h>\n\n#ifdef I_AM_QSORT_R\ntypedef int              cmp_t(void *, const void *, const void *);\n#else\ntypedef int              cmp_t(const void *, const void *);\n#endif\nstatic inline char      *med3(char *, char *, char *, cmp_t *, void *);\nstatic inline void       swapfunc(char *, char *, int, int);\n\n#define min(a, b)       (a) < (b) ? a : b\n\n/*\n * Qsort routine from Bentley & McIlroy's \"Engineering a Sort Function\".\n */\n#define swapcode(TYPE, parmi, parmj, n) {               \\\n        long i = (n) / sizeof (TYPE);                   \\\n        TYPE *pi = (TYPE *) (parmi);            \\\n        TYPE *pj = (TYPE *) (parmj);            \\\n        do {                                            \\\n                TYPE    t = *pi;                \\\n                *pi++ = *pj;                            \\\n                *pj++ = t;                              \\\n        } while (--i > 0);                              \\\n}\n\n#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \\\n        es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;\n\nstatic inline void\nswapfunc(a, b, n, swaptype)\n        char *a, *b;\n        int n, swaptype;\n{\n        if(swaptype <= 1)\n                swapcode(long, a, b, n)\n        else\n                swapcode(char, a, b, n)\n}\n\n#define swap(a, b)                                      \\\n        if (swaptype == 0) {                            \\\n                long t = *(long *)(a);                  \\\n                *(long *)(a) = *(long *)(b);            \\\n                *(long *)(b) = t;                       \\\n        } else                                          \\\n                swapfunc(a, b, es, swaptype)\n\n#define vecswap(a, b, n)        if ((n) > 0) swapfunc(a, b, n, swaptype)\n\n#ifdef I_AM_QSORT_R\n#define CMP(t, x, y) (cmp((t), (x), (y)))\n#else\n#define CMP(t, x, y) (cmp((x), (y)))\n#endif\n\nstatic inline char *\nmed3(char *a, char *b, char *c, cmp_t *cmp, void *thunk\n#ifndef I_AM_QSORT_R\n__unused\n#endif\n)\n{\n        return CMP(thunk, a, b) < 0 ?\n               (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))\n              :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));\n}\n\n#ifdef I_AM_QSORT_R\nvoid\nqsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)\n#else\n#define thunk NULL\nvoid\nqsort(void *a, size_t n, size_t es, cmp_t *cmp)\n#endif\n{\n        char *pa, *pb, *pc, *pd, *pl, *pm, *pn;\n        size_t d, r;\n        int cmp_result;\n        int swaptype, swap_cnt;\n\nloop:   SWAPINIT(a, es);\n        swap_cnt = 0;\n        if (n < 7) {\n                for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)\n                        for (pl = pm; \n                             pl > (char *)a && CMP(thunk, pl - es, pl) > 0;\n                             pl -= es)\n                                swap(pl, pl - es);\n                return;\n        }\n        pm = (char *)a + (n / 2) * es;\n        if (n > 7) {\n                pl = a;\n                pn = (char *)a + (n - 1) * es;\n                if (n > 40) {\n                        d = (n / 8) * es;\n                        pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);\n                        pm = med3(pm - d, pm, pm + d, cmp, thunk);\n                        pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);\n                }\n                pm = med3(pl, pm, pn, cmp, thunk);\n        }\n        swap(a, pm);\n        pa = pb = (char *)a + es;\n\n        pc = pd = (char *)a + (n - 1) * es;\n        for (;;) {\n                while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) {\n                        if (cmp_result == 0) {\n                                swap_cnt = 1;\n                                swap(pa, pb);\n                                pa += es;\n                        }\n                        pb += es;\n                }\n                while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) {\n                        if (cmp_result == 0) {\n                                swap_cnt = 1;\n                                swap(pc, pd);\n                                pd -= es;\n                        }\n                        pc -= es;\n                }\n                if (pb > pc)\n                        break;\n                swap(pb, pc);\n                swap_cnt = 1;\n                pb += es;\n                pc -= es;\n        }\n        if (swap_cnt == 0) {  /* Switch to insertion sort */\n                for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)\n                        for (pl = pm; \n                             pl > (char *)a && CMP(thunk, pl - es, pl) > 0;\n                             pl -= es)\n                                swap(pl, pl - es);\n                return;\n        }\n\n        pn = (char *)a + n * es;\n        r = min(pa - (char *)a, pb - pa);\n        vecswap(a, pb - r, r);\n        r = min(pd - pc, pn - pd - es);\n        vecswap(pb, pn - r, r);\n        if ((r = pb - pa) > es)\n#ifdef I_AM_QSORT_R\n                qsort_r(a, r / es, es, thunk, cmp);\n#else\n                qsort(a, r / es, es, cmp);\n#endif\n        if ((r = pd - pc) > es) {\n                /* Iterate rather than recurse to save stack space */\n                a = pn - r;\n                n = r / es;\n                goto loop;\n        }\n/*              qsort(pn - r, r / es, es, cmp);*/\n}\n\n"
  },
  {
    "path": "packages/libelf/ranlib.c.patch",
    "content": "diff -u -r ../elfutils-0.166/src/ranlib.c ./src/ranlib.c\n--- ../elfutils-0.166/src/ranlib.c\t2015-11-27 08:36:29.000000000 -0500\n+++ ./src/ranlib.c\t2016-05-04 14:18:56.314550152 -0400\n@@ -138,11 +138,6 @@\n \n   assert (off + n <= len);\n \n-  /* Tell the kernel we will read all the pages sequentially.  */\n-  size_t ps = sysconf (_SC_PAGESIZE);\n-  if (n > 2 * ps)\n-    posix_madvise (rawfile + (off & ~(ps - 1)), n, POSIX_MADV_SEQUENTIAL);\n-\n   return write_retry (newfd, rawfile + off, n) != (ssize_t) n;\n }\n \n"
  },
  {
    "path": "packages/libelf/src-readelf.c.patch",
    "content": "diff -u -r ../elfutils-0.170/src/readelf.c ./src/readelf.c\n--- ../elfutils-0.170/src/readelf.c\t2017-08-02 14:06:25.000000000 +0200\n+++ ./src/readelf.c\t2017-12-10 01:14:25.898858528 +0100\n@@ -43,6 +43,7 @@\n #include <unistd.h>\n #include <sys/stat.h>\n #include <signal.h>\n+#include <qsort_r.h>\n \n #include <libeu.h>\n #include <system.h>\n"
  },
  {
    "path": "packages/libelf/stdio_ext.h",
    "content": "#ifndef STDIO_EXT_H_INCLUDED\n#define STDIO_EXT_H_INCLUDED\n\n#include <stdio.h>\n\n/* http://linux.die.net/man/3/__fsetlocking */\n#define FSETLOCKING_INTERNAL 1\n#define FSETLOCKING_BYCALLER 2\n#define FSETLOCKING_QUERY 3\nstatic inline int __fsetlocking(FILE *stream, int type)\n{\n        (void) stream;\n        (void) type;\n        return FSETLOCKING_INTERNAL;\n}\n\nstatic inline int feof_unlocked(FILE *stream)\n{\n        return feof(stream);\n}\n\nstatic inline int ferror_unlocked(FILE *stream)\n{\n        return ferror(stream);\n}\n\nstatic inline int fputs_unlocked(const char *s, FILE *stream)\n{\n        return fputs(s, stream);\n}\n\nstatic inline int fputc_unlocked(int c, FILE *stream)\n{\n        return fputc(c, stream);\n}\n\nstatic inline size_t fread_unlocked(void *data, size_t size, size_t count, FILE *stream)\n{\n        return fread(data, size, count, stream);\n}\n\nstatic inline size_t fwrite_unlocked(const void *data, size_t size, size_t count, FILE *stream)\n{\n        return fwrite(data, size, count, stream);\n}\n\n#endif\n"
  },
  {
    "path": "packages/libelf/strings.c.patch",
    "content": "diff -u -r ../elfutils-0.166/src/strings.c ./src/strings.c\n--- ../elfutils-0.166/src/strings.c\t2015-11-27 08:36:29.000000000 -0500\n+++ ./src/strings.c\t2016-05-04 14:19:55.593602311 -0400\n@@ -494,7 +494,6 @@\n       if (mem != MAP_FAILED)\n \t{\n \t  /* We will go through the mapping sequentially.  */\n-\t  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);\n \t  break;\n \t}\n       if (errno != EINVAL && errno != ENOMEM)\n"
  },
  {
    "path": "packages/libelf/strip.c.patch",
    "content": "diff -u -r ../elfutils-0.166/src/strip.c ./src/strip.c\n--- ../elfutils-0.166/src/strip.c\t2016-03-02 11:25:38.000000000 -0500\n+++ ./src/strip.c\t2016-05-04 14:03:53.052913249 -0400\n@@ -323,8 +323,14 @@\n \n       /* If we have to preserve the timestamp, we need it in the\n \t format utimes() understands.  */\n-      tv[0] = pre_st.st_atim;\n-      tv[1] = pre_st.st_mtim;\n+      struct timespec atime;\n+      atime.tv_sec = pre_st.st_atime;\n+      atime.tv_nsec = pre_st.st_atime_nsec;\n+      struct timespec mtime;\n+      mtime.tv_sec = pre_st.st_mtime;\n+      mtime.tv_nsec = pre_st.st_mtime_nsec;\n+      tv[0] = atime;\n+      tv[1] = mtime;\n     }\n \n   /* Open the file.  */\n"
  },
  {
    "path": "packages/libelf/unstrip.c.patch",
    "content": "diff -u -r ../elfutils-0.166/src/unstrip.c ./src/unstrip.c\n--- ../elfutils-0.166/src/unstrip.c\t2016-01-12 07:49:19.000000000 -0500\n+++ ./src/unstrip.c\t2016-05-04 15:22:24.975567076 -0400\n@@ -303,7 +304,11 @@\n   if (lastslash == path)\n     return;\n \n-  char *dir = strndupa (path, lastslash - path);\n+  size_t substr_len = lastslash - path;\n+  char *dir = alloca(substr_len+1);\n+  strncpy(dir, path, substr_len);\n+  dir[substr_len] = 0;\n+\n   while (mkdir (dir, 0777) < 0 && errno != EEXIST)\n     if (errno == ENOENT)\n       make_directories (dir);\n"
  },
  {
    "path": "packages/libev/Makefile.in.patch",
    "content": "diff -u -r ../libev-4.22/Makefile.in ./Makefile.in\n--- ../libev-4.22/Makefile.in\t2015-12-20 16:12:45.000000000 -0500\n+++ ./Makefile.in\t2016-02-02 10:30:17.445084694 -0500\n@@ -343,7 +343,7 @@\n \t     ev.3 ev.pod Symbols.ev Symbols.event\n \n man_MANS = ev.3\n-include_HEADERS = ev.h ev++.h event.h\n+include_HEADERS = ev.h ev++.h\n lib_LTLIBRARIES = libev.la\n libev_la_SOURCES = ev.c event.c\n libev_la_LDFLAGS = -version-info $(VERSION_INFO)\n"
  },
  {
    "path": "packages/libev/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://software.schmorp.de/pkg/libev.html\nTERMUX_PKG_DESCRIPTION=\"Full-featured and high-performance event loop library\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=4.27\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=2d5526fc8da4f072dd5c73e18fbb1666f5ef8ed78b73bba12e195cfdd810344e\nTERMUX_PKG_BREAKS=\"libev-dev\"\nTERMUX_PKG_REPLACES=\"libev-dev\"\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/libev-$TERMUX_PKG_VERSION.tar.gz\n"
  },
  {
    "path": "packages/libevent/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libevent.org/\nTERMUX_PKG_DESCRIPTION=\"Library that provides asynchronous event notification\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=2.1.11\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/libevent/libevent/archive/release-${TERMUX_PKG_VERSION}-stable.tar.gz\nTERMUX_PKG_SHA256=229393ab2bf0dc94694f21836846b424f3532585bac3468738b7bf752c03901e\nTERMUX_PKG_BREAKS=\"libevent-dev\"\nTERMUX_PKG_REPLACES=\"libevent-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/event_rpcgen.py\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DEVENT__BUILD_SHARED_LIBRARIES=ON\n-DEVENT__DISABLE_BENCHMARK=ON\n-DEVENT__DISABLE_OPENSSL=ON\n-DEVENT__DISABLE_REGRESS=ON\n-DEVENT__DISABLE_SAMPLES=ON\n-DEVENT__DISABLE_TESTS=ON\n-DEVENT__DISABLE_TESTS=ON\n-DEVENT__HAVE_WAITPID_WITH_WNOWAIT=ON\n-DEVENT__SIZEOF_PTHREAD_T=$((TERMUX_ARCH_BITS/8))\n\"\n"
  },
  {
    "path": "packages/libevent/evdns.c.patch",
    "content": "diff -uNr libevent-release-2.1.8-stable/evdns.c libevent-release-2.1.8-stable.mod/evdns.c\n--- libevent-release-2.1.8-stable/evdns.c\t2017-01-26 01:37:15.000000000 +0200\n+++ libevent-release-2.1.8-stable.mod/evdns.c\t2017-09-12 12:58:45.352988051 +0300\n@@ -52,6 +52,9 @@\n #include \"evconfig-private.h\"\n \n #include <sys/types.h>\n+#ifdef __ANDROID__\n+# include <sys/system_properties.h>\n+#endif\n \n #ifndef _FORTIFY_SOURCE\n #define _FORTIFY_SOURCE 3\n@@ -3602,7 +3605,7 @@\n \tevutil_snprintf(path_out, len_out, \"%s%s\", path, hostfile);\n \treturn path_out;\n #else\n-\treturn mm_strdup(\"/etc/hosts\");\n+\treturn mm_strdup(\"@TERMUX_PREFIX@/etc/hosts\");\n #endif\n }\n \n@@ -3959,6 +3962,21 @@\n \t\tint r;\n #ifdef _WIN32\n \t\tr = evdns_base_config_windows_nameservers(base);\n+#elif defined(__ANDROID__)\n+\t\t/** From: http://www.programering.com/a/MjMwcjMwATA.html */\n+\t\tint add_servers = 0;\n+\t\tchar buf[PROP_VALUE_MAX];\n+\t\tr = __system_property_get(\"net.dns1\", buf);\n+\t\tif (r >= 7) {\n+\t\t\tadd_servers++;\n+\t\t\tevdns_base_nameserver_ip_add(base, buf);\n+\t\t}\n+\t\tr = __system_property_get(\"net.dns2\", buf);\n+\t\tif (r >= 7) {\n+\t\t\tadd_servers++;\n+\t\t\tevdns_base_nameserver_ip_add(base, buf);\n+\t\t}\n+\t\tif (add_servers == 0) evdns_base_nameserver_ip_add(base, \"8.8.8.8\");\n #else\n \t\tr = evdns_base_resolv_conf_parse(base, DNS_OPTIONS_ALL, \"/etc/resolv.conf\");\n #endif\n"
  },
  {
    "path": "packages/libevent/evutil.c.patch",
    "content": "diff -u -r ../libevent-release-2.1.8-stable/evutil.c ./evutil.c\n--- ../libevent-release-2.1.8-stable/evutil.c\t2017-01-26 00:37:15.000000000 +0100\n+++ ./evutil.c\t2017-07-07 01:04:14.746540880 +0200\n@@ -47,6 +47,7 @@\n #include <sys/socket.h>\n #endif\n #ifdef EVENT__HAVE_UNISTD_H\n+#define __USE_GNU 1 /* For pipe2(). */\n #include <unistd.h>\n #endif\n #ifdef EVENT__HAVE_FCNTL_H\n"
  },
  {
    "path": "packages/libevent/evutil_rand.c.patch",
    "content": "diff -u -r ../libevent-release-2.1.8-stable/evutil_rand.c ./evutil_rand.c\n--- ../libevent-release-2.1.8-stable/evutil_rand.c\t2017-01-26 00:37:15.000000000 +0100\n+++ ./evutil_rand.c\t2017-01-27 23:51:13.124764486 +0100\n@@ -195,8 +195,10 @@\n void\n evutil_secure_rng_add_bytes(const char *buf, size_t n)\n {\n+#ifndef __ANDROID__\n \tarc4random_addrandom((unsigned char*)buf,\n \t    n>(size_t)INT_MAX ? INT_MAX : (int)n);\n+#endif\n }\n \n void\n"
  },
  {
    "path": "packages/libexif/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libexif.github.io/\nTERMUX_PKG_DESCRIPTION=\"Library for reading and writing EXIF image metadata\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=0.6.21\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/libexif/libexif/${TERMUX_PKG_VERSION}/libexif-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=16cdaeb62eb3e6dfab2435f7d7bccd2f37438d21c5218ec4e58efa9157d4d41a\nTERMUX_PKG_BREAKS=\"libexif-dev\"\nTERMUX_PKG_REPLACES=\"libexif-dev\"\n"
  },
  {
    "path": "packages/libexpat/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libexpat.github.io/\nTERMUX_PKG_DESCRIPTION=\"XML parsing C library\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.2.9\nTERMUX_PKG_SRCURL=https://github.com/libexpat/libexpat/releases/download/R_${TERMUX_PKG_VERSION//./_}/expat-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=f1063084dc4302a427dabcca499c8312b3a32a29b7d2506653ecc8f950a9a237\nTERMUX_PKG_BREAKS=\"libexpat-dev\"\nTERMUX_PKG_REPLACES=\"libexpat-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-xmlwf --without-docbook\"\n"
  },
  {
    "path": "packages/libffi/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceware.org/libffi/\nTERMUX_PKG_DESCRIPTION=\"Library providing a portable, high level programming interface to various calling conventions\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=3.3\nTERMUX_PKG_SRCURL=ftp://sourceware.org/pub/libffi/libffi-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056\nTERMUX_PKG_BREAKS=\"libffi-dev\"\nTERMUX_PKG_REPLACES=\"libffi-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-multi-os-directory\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/libffi-${TERMUX_PKG_VERSION}/include\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = arm ]; then\n\t\tCFLAGS+=\" -fno-integrated-as\"\n\tfi\n}\ntermux_step_post_configure() {\n\t# work around since mmap can't be written and marked executable in android anymore from userspace\n\techo \"#define FFI_MMAP_EXEC_WRIT 1\" >> fficonfig.h\n}\n"
  },
  {
    "path": "packages/libflac/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xiph.org/flac/\nTERMUX_PKG_DESCRIPTION=\"FLAC (Free Lossless Audio Codec) library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.3.3\nTERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/flac/flac-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748\nTERMUX_PKG_DEPENDS=\"libc++, libogg\"\nTERMUX_PKG_BREAKS=\"libflac-dev\"\nTERMUX_PKG_REPLACES=\"libflac-dev\"\n"
  },
  {
    "path": "packages/libflac/flac.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/flac bin/metaflac share/man/man1\"\nTERMUX_SUBPKG_DESCRIPTION=\"FLAC (Free Lossless Audio Codec) command-line tool\"\n"
  },
  {
    "path": "packages/libgc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.hboehm.info/gc/\nTERMUX_PKG_DESCRIPTION=\"Library providing the Boehm-Demers-Weiser conservative garbage collector\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=(8.0.4\n                    7.6.10)\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=(https://github.com/ivmai/bdwgc/releases/download/v$TERMUX_PKG_VERSION/gc-$TERMUX_PKG_VERSION.tar.gz\n                   https://github.com/ivmai/libatomic_ops/releases/download/v${TERMUX_PKG_VERSION[1]}/libatomic_ops-${TERMUX_PKG_VERSION[1]}.tar.gz)\nTERMUX_PKG_SHA256=(436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d\n                   587edf60817f56daf1e1ab38a4b3c729b8e846ff67b4f62a6157183708f099af)\nTERMUX_PKG_BREAKS=\"libgc-dev\"\nTERMUX_PKG_REPLACES=\"libgc-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gc\"\n\ntermux_step_post_extract_package() {\n\tmv libatomic_ops-${TERMUX_PKG_VERSION[1]} libatomic_ops\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/libgc/include-private-gcconfig.h.patch",
    "content": "diff -u -r ../gc-8.0.2/include/private/gcconfig.h ./include/private/gcconfig.h\n--- ../gc-8.0.2/include/private/gcconfig.h\t2018-12-23 21:28:41.000000000 +0000\n+++ ./include/private/gcconfig.h\t2019-01-20 21:31:50.050945027 +0000\n@@ -2283,6 +2283,7 @@\n #     define HBLKSIZE 4096\n #   endif\n #   ifdef LINUX\n+#     define SEARCH_FOR_DATA_START\n #     define OS_TYPE \"LINUX\"\n #     define LINUX_STACKBOTTOM\n #     define DYNAMIC_LOADING\n"
  },
  {
    "path": "packages/libgcrypt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libgcrypt/\nTERMUX_PKG_DESCRIPTION=\"General purpose cryptographic library based on the code from GnuPG\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.8.5\nTERMUX_PKG_SHA256=3b4a2a94cb637eff5bdebbcaf46f4d95c4f25206f459809339cdada0eb577ac3\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"libgpg-error\"\nTERMUX_PKG_BREAKS=\"libgcrypt-dev\"\nTERMUX_PKG_REPLACES=\"libgcrypt-dev\"\n# configure tries to detect pthreads by linking with -lpthread, which does not exist on Android:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_pthread_pthread_create=yes\n--disable-jent-support\n\"\n\ntermux_step_pre_configure() {\n\t# libgcrypt uses syslog, which we redirect to android logging:\n\tLDFLAGS=\"$LDFLAGS -llog\"\n\n\tCFLAGS+=\" -no-integrated-as\"\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\t# See http://marc.info/?l=gnupg-devel&m=139136972631909&w=3\n\t\tCFLAGS+=\" -mno-unaligned-access\"\n\t\t# Avoid text relocations:\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" gcry_cv_gcc_inline_asm_neon=no\"\n\telif [ $TERMUX_ARCH = \"i686\" ] || [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\t# Fix i686 android build, also in https://bugzilla.gnome.org/show_bug.cgi?id=724050\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --disable-asm\"\n\tfi\n}\n"
  },
  {
    "path": "packages/libgcrypt/fix-hardcoded-paths.patch",
    "content": "diff -uNr libgcrypt-1.8.1/random/random.c libgcrypt-1.8.1.mod/random/random.c\n--- libgcrypt-1.8.1/random/random.c\t2017-06-24 14:34:29.000000000 +0300\n+++ libgcrypt-1.8.1.mod/random/random.c\t2017-09-12 10:37:13.012994125 +0300\n@@ -40,7 +40,7 @@\n #include \"cipher.h\"         /* For _gcry_sha1_hash_buffer().  */\n \n /* The name of a file used to globally configure the RNG. */\n-#define RANDOM_CONF_FILE \"/etc/gcrypt/random.conf\"\n+#define RANDOM_CONF_FILE \"@TERMUX_PREFIX@/etc/gcrypt/random.conf\"\n \n \n /* If not NULL a progress function called from certain places and the\ndiff -uNr libgcrypt-1.8.1/random/rndunix.c libgcrypt-1.8.1.mod/random/rndunix.c\n--- libgcrypt-1.8.1/random/rndunix.c\t2017-05-23 18:30:34.000000000 +0300\n+++ libgcrypt-1.8.1.mod/random/rndunix.c\t2017-09-12 10:54:50.432993369 +0300\n@@ -226,6 +226,42 @@\n     const int hasAlternative;\t    /* Whether source has alt.location */\n } dataSources[] = {\n \n+    // For Android\n+    {\t\"/system/bin/vmstat\", \"-s\", SC(-3), NULL, 0, 0, 0, 1    },\n+    {\t\"/system/xbin/vmstat\", \"-s\", SC(-3), NULL, 0, 0, 0, 1    },\n+    {\t\"/system/bin/netstat\", \"-s\", SC(2), NULL, 0, 0, 0, 1 },\n+    {\t\"/system/xbin/netstat\", \"-s\", SC(2), NULL, 0, 0, 0, 1 },\n+    {\t\"/system/bin/mpstat\", NULL, SC(1), NULL, 0, 0, 0, 0     },\n+    {\t\"/system/xbin/mpstat\", NULL, SC(1), NULL, 0, 0, 0, 0     },\n+    {\t\"/system/bin/df\", NULL, SC(1), NULL, 0, 0, 0, 0             },\n+    {\t\"/system/xbin/df\", NULL, SC(1), NULL, 0, 0, 0, 0             },\n+    {\t\"/system/bin/iostat\", NULL, SC(SC_0), NULL, 0, 0, 0, 0  },\n+    {\t\"/system/xbin/iostat\", NULL, SC(SC_0), NULL, 0, 0, 0, 0  },\n+    {\t\"/system/bin/uptime\", NULL, SC(SC_0), NULL, 0, 0, 0, 1   },\n+    {\t\"/system/xbin/uptime\", NULL, SC(SC_0), NULL, 0, 0, 0, 1   },\n+    {\t\"/system/bin/ps\", \"aux\", SC(0.3), NULL, 0, 0, 0, 1       },\n+    {\t\"/system/xbin/ps\", \"aux\", SC(0.3), NULL, 0, 0, 0, 1       },\n+    {\t\"/system/bin/arp\", \"-a\", SC(0.1), NULL, 0, 0, 0, 1  },\n+    {\t\"/system/xbin/arp\", \"-a\", SC(0.1), NULL, 0, 0, 0, 1  },\n+\n+    // For Termux\n+    {\t\"@TERMUX_PREFIX@/bin/vmstat\", \"-s\", SC(-3), NULL, 0, 0, 0, 1    },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/vmstat\", \"-s\", SC(-3), NULL, 0, 0, 0, 1    },\n+    {\t\"@TERMUX_PREFIX@/bin/netstat\", \"-s\", SC(2), NULL, 0, 0, 0, 1 },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/netstat\", \"-s\", SC(2), NULL, 0, 0, 0, 1 },\n+    {\t\"@TERMUX_PREFIX@/bin/mpstat\", NULL, SC(1), NULL, 0, 0, 0, 0     },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/mpstat\", NULL, SC(1), NULL, 0, 0, 0, 0     },\n+    {\t\"@TERMUX_PREFIX@/bin/df\", NULL, SC(1), NULL, 0, 0, 0, 0             },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/df\", NULL, SC(1), NULL, 0, 0, 0, 0             },\n+    {\t\"@TERMUX_PREFIX@/bin/iostat\", NULL, SC(SC_0), NULL, 0, 0, 0, 0  },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/iostat\", NULL, SC(SC_0), NULL, 0, 0, 0, 0  },\n+    {\t\"@TERMUX_PREFIX@/bin/uptime\", NULL, SC(SC_0), NULL, 0, 0, 0, 1   },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/uptime\", NULL, SC(SC_0), NULL, 0, 0, 0, 1   },\n+    {\t\"@TERMUX_PREFIX@/bin/ps\", \"aux\", SC(0.3), NULL, 0, 0, 0, 1       },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/ps\", \"aux\", SC(0.3), NULL, 0, 0, 0, 1       },\n+    {\t\"@TERMUX_PREFIX@/bin/arp\", \"-a\", SC(0.1), NULL, 0, 0, 0, 1  },\n+    {\t\"@TERMUX_PREFIX@/bin/applets/arp\", \"-a\", SC(0.1), NULL, 0, 0, 0, 1  },\n+\n     {\t\"/bin/vmstat\", \"-s\", SC(-3), NULL, 0, 0, 0, 1    },\n     {\t\"/usr/bin/vmstat\", \"-s\", SC(-3), NULL, 0, 0, 0, 0},\n     {\t\"/bin/vmstat\", \"-c\", SC(-3), NULL, 0, 0, 0, 1     },\ndiff -uNr libgcrypt-1.8.1/src/fips.c libgcrypt-1.8.1.mod/src/fips.c\n--- libgcrypt-1.8.1/src/fips.c\t2016-04-07 18:30:08.000000000 +0300\n+++ libgcrypt-1.8.1.mod/src/fips.c\t2017-09-12 10:36:08.292994171 +0300\n@@ -36,7 +36,7 @@\n \n \n /* The name of the file used to force libgcrypt into fips mode. */\n-#define FIPS_FORCE_FILE \"/etc/gcrypt/fips_enabled\"\n+#define FIPS_FORCE_FILE \"@TERMUX_PREFIX@/etc/gcrypt/fips_enabled\"\n \n \n /* The states of the finite state machine used in fips mode.  */\ndiff -uNr libgcrypt-1.8.1/src/hwfeatures.c libgcrypt-1.8.1.mod/src/hwfeatures.c\n--- libgcrypt-1.8.1/src/hwfeatures.c\t2017-06-24 14:34:29.000000000 +0300\n+++ libgcrypt-1.8.1.mod/src/hwfeatures.c\t2017-09-12 10:37:03.892994132 +0300\n@@ -33,7 +33,7 @@\n #include \"hwf-common.h\"\n \n /* The name of a file used to globally disable selected features. */\n-#define HWF_DENY_FILE \"/etc/gcrypt/hwf.deny\"\n+#define HWF_DENY_FILE \"@TERMUX_PREFIX@/etc/gcrypt/hwf.deny\"\n \n /* A table to map hardware features to a string.  */\n static struct\n"
  },
  {
    "path": "packages/libgd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libgd.github.io/\nTERMUX_PKG_DESCRIPTION=\"GD is an open source code library for the dynamic creation of images by programmers\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.2.5\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SHA256=a66111c9b4a04e818e9e2a37d7ae8d4aae0939a100a36b0ffb52c706a09074b5\nTERMUX_PKG_SRCURL=https://github.com/libgd/libgd/releases/download/gd-${TERMUX_PKG_VERSION}/libgd-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"freetype, fontconfig, libiconv, libjpeg-turbo, libpng, libtiff, libwebp, zlib\"\nTERMUX_PKG_BREAKS=\"libgd-dev\"\nTERMUX_PKG_REPLACES=\"libgd-dev\"\n\n# Disable vpx support for now, look at https://github.com/gagern/libgd/commit/d41eb72cd4545c394578332e5c102dee69e02ee8\n# for enabling:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-vpx --without-x\"\n"
  },
  {
    "path": "packages/libgfshare/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.digital-scurf.org/software/libgfshare\nTERMUX_PKG_DESCRIPTION=\"Utilities for multi-way secret-sharing\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.0.0\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=http://www.digital-scurf.org/files/libgfshare/libgfshare-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=86f602860133c828356b7cf7b8c319ba9b27adf70a624fe32275ba1ed268331f\nTERMUX_PKG_BREAKS=\"libgfshare-dev\"\nTERMUX_PKG_REPLACES=\"libgfshare-dev\"\n\ntermux_step_post_configure() {\n\tgcc -DHAVE_CONFIG_H \\\n\t\t-I. \\\n\t\t-I\"$TERMUX_PKG_SRCDIR\" \\\n\t\t-I\"$TERMUX_PKG_SRCDIR\"/include \\\n\t\t\"$TERMUX_PKG_SRCDIR\"/src/gfshare_maketable.c \\\n\t\t-o gfshare_maketable\n\ttouch -d \"next hour\" gfshare_maketable\n}\n"
  },
  {
    "path": "packages/libgit2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libgit2.github.com/\nTERMUX_PKG_DESCRIPTION=\"C library implementing Git core methods\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.28.3\nTERMUX_PKG_SRCURL=https://github.com/libgit2/libgit2/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=ee5344730fe11ce7c86646e19c2d257757be293f5a567548d398fb3af8b8e53b\nTERMUX_PKG_DEPENDS=\"libcurl, openssl, libssh2, zlib\"\nTERMUX_PKG_BREAKS=\"libgit2-dev\"\nTERMUX_PKG_REPLACES=\"libgit2-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DBUILD_CLAR=OFF\"\n"
  },
  {
    "path": "packages/libgit2/fix-etc-dir-path.patch",
    "content": "diff -uNr libgit2-0.26.0/src/sysdir.c libgit2-0.26.0.mod/src/sysdir.c\n--- libgit2-0.26.0/src/sysdir.c\t2017-06-14 14:31:20.000000000 +0300\n+++ libgit2-0.26.0.mod/src/sysdir.c\t2017-09-12 11:57:35.382990676 +0300\n@@ -30,7 +30,7 @@\n #ifdef GIT_WIN32\n \treturn git_win32__find_system_dirs(out, L\"etc\\\\\");\n #else\n-\treturn git_buf_sets(out, \"/etc\");\n+\treturn git_buf_sets(out, \"@TERMUX_PREFIX@/etc\");\n #endif\n }\n \n"
  },
  {
    "path": "packages/libgmime/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://spruce.sourceforge.net/gmime/\nTERMUX_PKG_DESCRIPTION=\"MIME message parser and creator\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.2.5\nTERMUX_PKG_SRCURL=https://download.gnome.org/sources/gmime/${TERMUX_PKG_VERSION:0:3}/gmime-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=fb7556501f85c3bf3e65fdd82697cbc4fa4b55dccd33ad14239ce0197e78ba59\nTERMUX_PKG_DEPENDS=\"glib, libffi, libiconv, libidn2, zlib\"\nTERMUX_PKG_BREAKS=\"libgmime-dev\"\nTERMUX_PKG_REPLACES=\"libgmime-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_have_iconv_detect_h=yes\n--with-libiconv=gnu\n--disable-glibtest\n--disable-crypto\n\"\n"
  },
  {
    "path": "packages/libgmime/iconv-detect.h.patch",
    "content": "diff -N -a -u -r ../gmime-2.6.23/iconv-detect.h ./iconv-detect.h\n--- ../gmime-2.6.23/iconv-detect.h\t1970-01-01 01:00:00.000000000 +0100\n+++ ./iconv-detect.h\t2017-04-06 18:24:52.423896227 +0200\n@@ -0,0 +1,5 @@\n+/* This is an auto-generated header, DO NOT EDIT! */\n+\n+#define ICONV_ISO_INT_FORMAT \"iso-%u-%u\"\n+#define ICONV_ISO_STR_FORMAT \"iso-%u-%s\"\n+#define ICONV_10646 \"UCS-4BE\"\n"
  },
  {
    "path": "packages/libgmp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gmplib.org/\nTERMUX_PKG_DESCRIPTION=\"Library for arbitrary precision arithmetic\"\nTERMUX_PKG_LICENSE=\"LGPL-3.0\"\nTERMUX_PKG_VERSION=6.1.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gmp/gmp-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912\nTERMUX_PKG_BREAKS=\"libgmp-dev\"\nTERMUX_PKG_REPLACES=\"libgmp-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-cxx\"\n\ntermux_step_pre_configure() {\n# the cxx tests fail because it won't link properly without this\n    CXXFLAGS+=\" -L$TERMUX_PREFIX/lib\"\n}\n"
  },
  {
    "path": "packages/libgnutls/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnutls.org/\nTERMUX_PKG_DESCRIPTION=\"Secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_VERSION=3.6.11.1\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/gnutls/v${TERMUX_PKG_VERSION:0:3}/gnutls-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=fbba12f3db9a55dbf027e14111755817ec44b57eabec3e8089aac8ac6f533cf8\nTERMUX_PKG_DEPENDS=\"libgmp, libnettle, ca-certificates, libidn2, libunistring\"\nTERMUX_PKG_BREAKS=\"libgnutls-dev\"\nTERMUX_PKG_REPLACES=\"libgnutls-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-cxx\n--disable-hardware-acceleration\n--disable-openssl-compatibility\n--with-default-trust-store-file=$TERMUX_PREFIX/etc/tls/cert.pem\n--with-system-priority-file=${TERMUX_PREFIX}/etc/gnutls/default-priorities\n--with-included-libtasn1\n--without-p11-kit\n\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -DNO_INLINE_GETPASS=1\"\n}\n"
  },
  {
    "path": "packages/libgnutls/gnutls.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Commandline utilities for interfacing with the gnutls library\"\n"
  },
  {
    "path": "packages/libgpg-error/atexit.patch",
    "content": "--- src/src/estream.c\t2017-02-28 09:11:05.000000000 +0000\n+++ ./_patches/estream.c\t2017-05-14 23:41:57.522426391 +0000\n@@ -510,7 +510,11 @@\n {\n   static int initialized;\n \n+#ifdef __ANDROID__\n+  if (initialized < 2)\n+#else\n   if (!initialized)\n+#endif\n     {\n       initialized = 1;\n       atexit (do_deinit);\n"
  },
  {
    "path": "packages/libgpg-error/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/libgpg-error/\nTERMUX_PKG_DESCRIPTION=\"Small library that defines common error values for all GnuPG components\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.36\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=babd98437208c163175c29453f8681094bcaf92968a15cafb1a276076b33c97c\nTERMUX_PKG_BREAKS=\"libgpg-error-dev\"\nTERMUX_PKG_REPLACES=\"libgpg-error-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/common-lisp\"\n\ntermux_step_post_extract_package() {\n\t# Upstream only has Android definitions for platform-specific lock objects.\n\t# See https://lists.gnupg.org/pipermail/gnupg-devel/2014-January/028203.html\n\t# for how to generate a lock-obj header file on devices.\n\n\t# For aarch64 this was generated on a device:\n\tcp $TERMUX_PKG_BUILDER_DIR/lock-obj-pub.aarch64-unknown-linux-android.h $TERMUX_PKG_SRCDIR/src/syscfg/\n\n\tif [ $TERMUX_ARCH = i686 ]; then\n\t\t# Android i686 has same config as arm (verified by generating a file on a i686 device):\n\t\tcp $TERMUX_PKG_SRCDIR/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h \\\n\t\t   $TERMUX_PKG_SRCDIR/src/syscfg/lock-obj-pub.linux-android.h\n\telif [ $TERMUX_ARCH = x86_64 ]; then\n\t\t# FIXME: Generate on device.\n\t\tcp $TERMUX_PKG_BUILDER_DIR/lock-obj-pub.aarch64-unknown-linux-android.h \\\n\t\t\t$TERMUX_PKG_SRCDIR/src/syscfg/lock-obj-pub.linux-android.h\n\tfi\n}\n\ntermux_step_pre_configure() {\n\tautoreconf -fi\n\t# USE_POSIX_THREADS_WEAK is being enabled for on-device build and causes\n\t# errors, so force-disable it.\n\tsed -i 's/USE_POSIX_THREADS_WEAK/DONT_USE_POSIX_THREADS_WEAK/g' configure\n}\n"
  },
  {
    "path": "packages/libgpg-error/gawk5.0-support.patch",
    "content": "From 7865041c77f4f7005282f10f9b6666b19072fbdf Mon Sep 17 00:00:00 2001\nFrom: NIIBE Yutaka <gniibe@fsij.org>\nDate: Mon, 15 Apr 2019 15:10:44 +0900\nSubject: [PATCH] awk: Prepare for Gawk 5.0.\n\n* src/Makefile.am: Use pkg_namespace (instead of namespace).\n* src/mkerrnos.awk: Likewise.\n* lang/cl/mkerrcodes.awk: Don't escape # in regexp.\n* src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto.\n\n--\n\nIn Gawk 5.0, regexp routines are replaced by Gnulib implementation,\nwhich only allows escaping specific characters.\n\nGnuPG-bug-id: 4459\nReported-by: Marius Schamschula\nSigned-off-by: NIIBE Yutaka <gniibe@fsij.org>\n---\n lang/cl/mkerrcodes.awk |  2 +-\n src/Makefile.am        |  2 +-\n src/mkerrcodes.awk     |  2 +-\n src/mkerrcodes1.awk    |  2 +-\n src/mkerrcodes2.awk    |  2 +-\n src/mkerrnos.awk       |  2 +-\n src/mkstrtable.awk     | 10 +++++-----\n 7 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk\nindex ae29043..9a1fc18 100644\n--- a/lang/cl/mkerrcodes.awk\n+++ b/lang/cl/mkerrcodes.awk\n@@ -122,7 +122,7 @@ header {\n }\n \n !header {\n-  sub (/\\#.+/, \"\");\n+  sub (/#.+/, \"\");\n   sub (/[ \t]+$/, \"\"); # Strip trailing space and tab characters.\n \n   if (/^$/)\ndiff --git a/src/Makefile.am b/src/Makefile.am\nindex ce1b882..f2590cb 100644\n--- a/src/Makefile.am\n+++ b/src/Makefile.am\n@@ -293,7 +293,7 @@ code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile\n \n errnos-sym.h: Makefile mkstrtable.awk errnos.in\n \t$(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \\\n-\t\t-v prefix=GPG_ERR_ -v namespace=errnos_ \\\n+\t\t-v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \\\n \t\t$(srcdir)/errnos.in >$@\n \n \ndiff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk\nindex 46d436c..e9c857c 100644\n--- a/src/mkerrcodes.awk\n+++ b/src/mkerrcodes.awk\n@@ -85,7 +85,7 @@ header {\n }\n \n !header {\n-  sub (/\\#.+/, \"\");\n+  sub (/#.+/, \"\");\n   sub (/[ \t]+$/, \"\"); # Strip trailing space and tab characters.\n \n   if (/^$/)\ndiff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk\nindex a771a73..4578e29 100644\n--- a/src/mkerrcodes1.awk\n+++ b/src/mkerrcodes1.awk\n@@ -81,7 +81,7 @@ header {\n }\n \n !header {\n-  sub (/\\#.+/, \"\");\n+  sub (/#.+/, \"\");\n   sub (/[ \t]+$/, \"\"); # Strip trailing space and tab characters.\n \n   if (/^$/)\ndiff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk\nindex ea58503..188f7a4 100644\n--- a/src/mkerrcodes2.awk\n+++ b/src/mkerrcodes2.awk\n@@ -91,7 +91,7 @@ header {\n }\n \n !header {\n-  sub (/\\#.+/, \"\");\n+  sub (/#.+/, \"\");\n   sub (/[ \t]+$/, \"\"); # Strip trailing space and tab characters.\n \n   if (/^$/)\ndiff --git a/src/mkerrnos.awk b/src/mkerrnos.awk\nindex f79df66..15b1aad 100644\n--- a/src/mkerrnos.awk\n+++ b/src/mkerrnos.awk\n@@ -83,7 +83,7 @@ header {\n }\n \n !header {\n-  sub (/\\#.+/, \"\");\n+  sub (/#.+/, \"\");\n   sub (/[ \t]+$/, \"\"); # Strip trailing space and tab characters.\n \n   if (/^$/)\ndiff --git a/src/mkstrtable.awk b/src/mkstrtable.awk\nindex c9de9c1..285e45f 100644\n--- a/src/mkstrtable.awk\n+++ b/src/mkstrtable.awk\n@@ -77,7 +77,7 @@\n #\n # The variable prefix can be used to prepend a string to each message.\n #\n-# The variable namespace can be used to prepend a string to each\n+# The variable pkg_namespace can be used to prepend a string to each\n # variable and macro name.\n \n BEGIN {\n@@ -102,7 +102,7 @@ header {\n       print \"/* The purpose of this complex string table is to produce\";\n       print \"   optimal code with a minimum of relocations.  */\";\n       print \"\";\n-      print \"static const char \" namespace \"msgstr[] = \";\n+      print \"static const char \" pkg_namespace \"msgstr[] = \";\n       header = 0;\n     }\n   else\n@@ -110,7 +110,7 @@ header {\n }\n \n !header {\n-  sub (/\\#.+/, \"\");\n+  sub (/#.+/, \"\");\n   sub (/[ \t]+$/, \"\"); # Strip trailing space and tab characters.\n \n   if (/^$/)\n@@ -150,7 +150,7 @@ END {\n   else\n     print \"  gettext_noop (\\\"\" last_msgstr \"\\\");\";\n   print \"\";\n-  print \"static const int \" namespace \"msgidx[] =\";\n+  print \"static const int \" pkg_namespace \"msgidx[] =\";\n   print \"  {\";\n   for (i = 0; i < coded_msgs; i++)\n     print \"    \" pos[i] \",\";\n@@ -158,7 +158,7 @@ END {\n   print \"  };\";\n   print \"\";\n   print \"static GPG_ERR_INLINE int\";\n-  print namespace \"msgidxof (int code)\";\n+  print pkg_namespace \"msgidxof (int code)\";\n   print \"{\";\n   print \"  return (0 ? 0\";\n \n-- \n2.21.0\n\n"
  },
  {
    "path": "packages/libgpg-error/lock-obj-pub.aarch64-unknown-linux-android.h",
    "content": "## lock-obj-pub.armv8l-unknown-linux-gnu.h\n## File created by gen-posix-lock-obj - DO NOT EDIT\n## To be included by mkheader into gpg-error.h\n\ntypedef struct\n{\n  long _vers;\n  union {\n    volatile char _priv[40];\n    long _x_align;\n    long *_xp_align;\n  } u;\n} gpgrt_lock_t;\n\n#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \\\n                                    0,0,0,0,0,0,0,0, \\\n                                    0,0,0,0,0,0,0,0, \\\n                                    0,0,0,0,0,0,0,0, \\\n                                    0,0,0,0,0,0,0,0}}}\n##\n## Local Variables:\n## mode: c\n## buffer-read-only: t\n## End:\n##\n"
  },
  {
    "path": "packages/libgraphite/CMakeLists.txt.patch",
    "content": "Fixes \"undefined reference to '__cxa_call_unexpected\" on arm.\n\ndiff -u -r ../graphite-1.3.9/CMakeLists.txt ./CMakeLists.txt\n--- ../graphite-1.3.9/CMakeLists.txt\t2016-11-11 10:53:21.000000000 +0100\n+++ ./CMakeLists.txt\t2017-01-19 11:54:59.187814558 +0100\n@@ -58,7 +58,6 @@\n message(STATUS \"Using vm machine type: ${GRAPHITE2_VM_TYPE}\")\n \n add_subdirectory(src)\n-add_subdirectory(tests)\n add_subdirectory(doc)\n if (NOT (GRAPHITE2_NSEGCACHE OR GRAPHITE2_NFILEFACE))\n     add_subdirectory(gr2fonttest)\n"
  },
  {
    "path": "packages/libgraphite/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/silnrsi/graphite\nTERMUX_PKG_DESCRIPTION=\"Font system for multiple languages\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.3.13\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/silnrsi/graphite/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=2f9f609deeddfe2b193502adc8df3b0396694b799a433c36e85fd1242e654cd9\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"libgraphite-dev\"\nTERMUX_PKG_REPLACES=\"libgraphite-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/gr2fonttest\"\n"
  },
  {
    "path": "packages/libgraphite/src-CMakeLists.txt.patch",
    "content": "diff -u -r ../graphite-1.3.9/src/CMakeLists.txt ./src/CMakeLists.txt\n--- ../graphite-1.3.9/src/CMakeLists.txt\t2016-11-11 10:53:21.000000000 +0100\n+++ ./src/CMakeLists.txt\t2017-01-19 05:12:08.903024071 +0100\n@@ -152,4 +152,4 @@\n \n \n install(TARGETS graphite2 EXPORT graphite2 LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} PUBLIC_HEADER DESTINATION include/graphite2 RUNTIME DESTINATION bin)\n-install(EXPORT graphite2 DESTINATION share/graphite2 NAMESPACE gr2_)\n+install(EXPORT graphite2 DESTINATION lib/cmake/graphite2 NAMESPACE gr2_)\n"
  },
  {
    "path": "packages/libgrpc/CMakeLists.txt.diff",
    "content": "diff -u -r ../cache/checkout-1.20.1/CMakeLists.txt ./CMakeLists.txt\n--- ../cache/checkout-1.20.1/CMakeLists.txt\t2019-05-05 19:34:14.719680525 +0000\n+++ ./CMakeLists.txt\t2019-05-05 19:44:36.428274714 +0000\n@@ -206,7 +206,7 @@\n       COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}\n       ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}\n            --cpp_out=${_gRPC_PROTO_GENS_DIR}\n-           --plugin=protoc-gen-grpc=${_gRPC_CPP_PLUGIN}\n+\t   --plugin=protoc-gen-grpc=@PATH_TO_PLUGIN@\n            ${_protobuf_include_path}\n            ${REL_FIL}\n       DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin\n"
  },
  {
    "path": "packages/libgrpc/CMakeLists.txt.patch",
    "content": "--- ./CMakeLists.txt\t2017-06-28 01:16:01.000000000 +0530\n+++ ../CMakeLists.txt\t2017-07-08 22:10:35.062570096 +0530\n@@ -272,7 +272,7 @@\n if(_gRPC_PLATFORM_MAC)\n   set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m pthread)\n elseif(UNIX)\n-  set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} rt m pthread)\n+  set(_gRPC_ALLTARGETS_LIBRARIES ${CMAKE_DL_LIBS} m)\n endif()\n \n if(WIN32 AND MSVC)\n@@ -813,12 +813,6 @@\n target_link_libraries(gpr\n   ${_gRPC_ALLTARGETS_LIBRARIES}\n )\n-if (_gRPC_PLATFORM_ANDROID)\n-  target_link_libraries(gpr\n-    android\n-    log\n-  )\n-endif (_gRPC_PLATFORM_ANDROID)\n \n foreach(_hdr\n   include/grpc/support/alloc.h\n"
  },
  {
    "path": "packages/libgrpc/Makefile.patch",
    "content": "diff -u -r ../grpc-1.8.3/Makefile ./Makefile\n--- ../grpc-1.8.3/Makefile\t2017-12-31 20:38:59.000000000 +0000\n+++ ./Makefile\t2018-01-13 00:48:23.449627239 +0000\n@@ -369,7 +369,7 @@\n endif\n \n ifeq ($(SYSTEM),Linux)\n-LIBS = dl rt m pthread\n+LIBS = dl m\n LDFLAGS += -pthread\n endif\n \n"
  },
  {
    "path": "packages/libgrpc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://grpc.io/\nTERMUX_PKG_DESCRIPTION=\"High performance, open source, general RPC framework that puts mobile and HTTP/2 first\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=1.25.0\nTERMUX_PKG_DEPENDS=\"libc++, openssl, protobuf, c-ares, zlib\"\nTERMUX_PKG_BREAKS=\"libgrpc-dev\"\nTERMUX_PKG_REPLACES=\"libgrpc-dev\"\nTERMUX_PKG_BUILD_DEPENDS=\"libprotobuf\"\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DCMAKE_STRIP=$(which strip)\n-DGIT_EXECUTABLE=$(which git)\n-DBUILD_SHARED_LIBS=ON\n-DgRPC_CARES_PROVIDER=package\n-DgRPC_PROTOBUF_PROVIDER=package\n-DgRPC_SSL_PROVIDER=package\n-DgRPC_ZLIB_PROVIDER=package\n-DRUN_HAVE_POSIX_REGEX=0\n-DRUN_HAVE_STD_REGEX=0\n-DRUN_HAVE_STEADY_CLOCK=0\n-DProtobuf_PROTOC_LIBRARY=$TERMUX_PREFIX/lib/libprotoc.so\n\"\n\ntermux_step_extract_package() {\n\tlocal CHECKED_OUT_FOLDER=$TERMUX_PKG_CACHEDIR/checkout-$TERMUX_PKG_VERSION\n\tif [ ! -d $CHECKED_OUT_FOLDER ]; then\n\t\tlocal TMP_CHECKOUT=$TERMUX_PKG_TMPDIR/tmp-checkout\n\t\trm -Rf $TMP_CHECKOUT\n\t\tmkdir -p $TMP_CHECKOUT\n\n\t\tgit clone --depth 1 \\\n\t\t\t--branch v$TERMUX_PKG_VERSION \\\n\t\t\thttps://github.com/grpc/grpc.git \\\n\t\t\t$TMP_CHECKOUT\n\t\tcd $TMP_CHECKOUT\n\t\tgit submodule update --init # --depth 1\n\t\tmv $TMP_CHECKOUT $CHECKED_OUT_FOLDER\n\tfi\n\n\tmkdir $TERMUX_PKG_SRCDIR\n\tcd $TERMUX_PKG_SRCDIR\n\tcp -Rf $CHECKED_OUT_FOLDER/* .\n\n\ttermux_setup_protobuf\n}\n\ntermux_step_host_build() {\n\ttermux_setup_cmake\n\n\tcd $TERMUX_PKG_SRCDIR\n\texport LD=gcc\n\texport LDXX=g++\n\n\t# -Wno-error=class-memaccess is used to avoid\n\t# 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]\n\t# memset(c, 0, sizeof(grpc_oauth2_token_fetcher_credentials));\n\t# when building version 1.17.2:\n\tCXXFLAGS=\"-Wno-error=class-memaccess\" \\\n\t\tCFLAGS=\"-Wno-implicit-fallthrough\" \\\n\t\tmake -j $TERMUX_MAKE_PROCESSES \\\n\t\tHAS_SYSTEM_PROTOBUF=false \\\n\t\tprefix=$TERMUX_PKG_HOSTBUILD_DIR \\\n\t\tinstall\n\tmake clean\n}\n\ntermux_step_pre_configure() {\n\tsed \"s|@PATH_TO_PLUGIN@|$TERMUX_PKG_HOSTBUILD_DIR/bin/grpc_cpp_plugin|g\" \\\n\t\t$TERMUX_PKG_BUILDER_DIR/CMakeLists.txt.diff \\\n\t\t| patch -p1\n\texport GRPC_CROSS_COMPILE=true\n}\n"
  },
  {
    "path": "packages/libgrpc/fix-arg-list-too-long.patch.beforehostbuild",
    "content": "--- a/Makefile\t2018-06-26 11:07:45.948160976 +0200\n+++ b/Makefile\t2019-06-26 11:04:25.798966336 +0200\n@@ -2820,13 +2820,15 @@\n\n install-headers_c:\n \t$(E) \"[INSTALL] Installing public C headers\"\n-\t$(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1\n-\t$(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1\n+\t$(Q) for h in $(PUBLIC_HEADERS_C); do \\\n+\t$(INSTALL) -D $$h $(prefix)/$$h ; \\\n+\tdone\n\n install-headers_cxx:\n \t$(E) \"[INSTALL] Installing public C++ headers\"\n-\t$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1\n-\t$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1\n+\t$(Q) for h in $(PUBLIC_HEADERS_CXX); do \\\n+\t$(INSTALL) -D $$h $(prefix)/$$h ; \\\n+\tdone\n\n install-static: install-static_c install-static_cxx\n\n--- a/templates/Makefile.template\t2019-06-26 12:38:36.777292299 +0200\n+++ b/templates/Makefile.template\t2019-06-26 12:48:35.668550020 +0200\n@@ -1302,13 +1302,15 @@\n\n   install-headers_c:\n   \t$(E) \"[INSTALL] Installing public C headers\"\n-  \t$(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1\n-  \t$(Q) $(foreach h, $(PUBLIC_HEADERS_C), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1\n+  \t$(Q) for h in $(PUBLIC_HEADERS_C); do \\\n+  \t$(INSTALL) -D $$h $(prefix)/$$h ; \\\n+  \tdone\n\n   install-headers_cxx:\n   \t$(E) \"[INSTALL] Installing public C++ headers\"\n-  \t$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) -d $(prefix)/$(dir $(h)) && ) exit 0 || exit 1\n-  \t$(Q) $(foreach h, $(PUBLIC_HEADERS_CXX), $(INSTALL) $(h) $(prefix)/$(h) && ) exit 0 || exit 1\n+  \t$(Q) for h in $(PUBLIC_HEADERS_CXX); do \\\n+  \t$(INSTALL) -D $$h $(prefix)/$$h ; \\\n+  \tdone\n\n   install-static: install-static_c install-static_cxx\n\n"
  },
  {
    "path": "packages/libgrpc/log_android.cc.patch",
    "content": "diff -u -r ../cache/checkout-1.14.1/src/core/lib/gpr/log_android.cc ./src/core/lib/gpr/log_android.cc\n--- ../cache/checkout-1.14.1/src/core/lib/gpr/log_android.cc\t2018-08-21 11:52:18.904711327 +0000\n+++ ./src/core/lib/gpr/log_android.cc\t2018-08-21 12:04:56.616148484 +0000\n@@ -27,18 +27,6 @@\n #include <stdio.h>\n #include <string.h>\n \n-static android_LogPriority severity_to_log_priority(gpr_log_severity severity) {\n-  switch (severity) {\n-    case GPR_LOG_SEVERITY_DEBUG:\n-      return ANDROID_LOG_DEBUG;\n-    case GPR_LOG_SEVERITY_INFO:\n-      return ANDROID_LOG_INFO;\n-    case GPR_LOG_SEVERITY_ERROR:\n-      return ANDROID_LOG_ERROR;\n-  }\n-  return ANDROID_LOG_DEFAULT;\n-}\n-\n void gpr_log(const char* file, int line, gpr_log_severity severity,\n              const char* format, ...) {\n   /* Avoid message construction if gpr_log_message won't log */\n@@ -67,7 +55,7 @@\n \n   asprintf(&output, \"%s:%d] %s\", display_file, args->line, args->message);\n \n-  __android_log_write(severity_to_log_priority(args->severity), \"GRPC\", output);\n+  // __android_log_write(severity_to_log_priority(args->severity), \"GRPC\", output);\n \n   /* allocated by asprintf => use free, not gpr_free */\n   free(output);\n"
  },
  {
    "path": "packages/libgrpc/src-core-lib-grpc-wrap_memcpy.cc.patch",
    "content": "diff -u -r ../cache/checkout-1.12.0/src/core/lib/gpr/wrap_memcpy.cc ./src/core/lib/gpr/wrap_memcpy.cc\n--- ../cache/checkout-1.12.0/src/core/lib/gpr/wrap_memcpy.cc\t2018-05-22 13:07:29.307092222 +0000\n+++ ./src/core/lib/gpr/wrap_memcpy.cc\t2018-05-23 22:21:40.602239126 +0000\n@@ -28,7 +28,7 @@\n \n extern \"C\" {\n #ifdef __linux__\n-#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT)\n+#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && !defined(__ANDROID__)\n __asm__(\".symver memcpy,memcpy@GLIBC_2.2.5\");\n void* __wrap_memcpy(void* destination, const void* source, size_t num) {\n   return memcpy(destination, source, num);\n"
  },
  {
    "path": "packages/libgsasl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gsasl\nTERMUX_PKG_DESCRIPTION=\"GNU SASL library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.8.1\nTERMUX_PKG_SHA256=19e2f90525c531010918c50bb1febef0d7115d620150cc66153b9ce73ff814e6\nTERMUX_PKG_SRCURL=https://download.savannah.nongnu.org/releases/gsasl/libgsasl-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libidn\"\nTERMUX_PKG_BREAKS=\"libgsasl-dev\"\nTERMUX_PKG_REPLACES=\"libgsasl-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-libgcrypt\"\n"
  },
  {
    "path": "packages/libical/CMakeLists.txt.patch",
    "content": "Avoid opportunistic linkage against libdb and libicu.\n\ndiff -u -r ../libical-3.0.1/CMakeLists.txt ./CMakeLists.txt\n--- ../libical-3.0.1/CMakeLists.txt\t2017-11-19 14:32:53.000000000 +0000\n+++ ./CMakeLists.txt\t2017-12-08 23:54:59.745527096 +0000\n@@ -154,47 +154,6 @@\n   set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS True)\n endif()\n \n-# libicu is highly recommended for RSCALE support\n-#  libicu can be found at http://www.icu-project.org\n-#  RSCALE info at http://tools.ietf.org/html/rfc7529\n-find_package(ICU)\n-set_package_properties(ICU PROPERTIES\n-  TYPE RECOMMENDED\n-  PURPOSE \"For RSCALE (RFC7529) support\"\n-)\n-add_feature_info(\n-  \"RSCALE support (RFC7529)\"\n-  ICU_FOUND\n-  \"build in RSCALE support\"\n-)\n-if(ICU_FOUND)\n-  set(REQUIRES_PRIVATE_ICU \"Requires.private: icu-i18n\") #for libical.pc\n-  set(HAVE_LIBICU 1)\n-  if(ICU_MAJOR_VERSION VERSION_GREATER 50)\n-    set(HAVE_ICU_DANGI TRUE)\n-  else()\n-    set(HAVE_ICU_DANGI FALSE)\n-  endif()\n-endif()\n-if(ICU_I18N_FOUND)\n-  set(HAVE_LIBICU_I18N 1)\n-endif()\n-\n-# compile in Berkeley DB support\n-find_package(BDB)\n-set_package_properties(BDB PROPERTIES\n-  TYPE OPTIONAL\n-  PURPOSE \"For Berkeley DB storage support\"\n-)\n-add_feature_info(\n-  \"Berkeley DB storage support\"\n-  BDB_FOUND\n-  \"build in support for Berkeley DB storage\"\n-)\n-if(BDB_FOUND)\n-  set(HAVE_BDB True)\n-endif()\n-\n # MSVC specific definitions\n if(WIN32)\n   if(MSVC)\n"
  },
  {
    "path": "packages/libical/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://libical.github.io/libical/\nTERMUX_PKG_DESCRIPTION=\"Libical is an Open Source implementation of the iCalendar protocols and protocol data units\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=3.0.6\nTERMUX_PKG_SRCURL=https://github.com/libical/libical/releases/download/v$TERMUX_PKG_VERSION/libical-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=5c8a21c2b732ece4a33e5c862970b4f35a8548bbcda50de5695f6fc211ac4d97\nTERMUX_PKG_DEPENDS=\"libc++, libxml2\"\nTERMUX_PKG_BREAKS=\"libical-dev\"\nTERMUX_PKG_REPLACES=\"libical-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\" -DSHARED_ONLY=true -DICAL_GLIB=false -DUSE_BUILTIN_TZDATA=true -DPERL_EXECUTABLE=/usr/bin/perl\"\n"
  },
  {
    "path": "packages/libical/src-libical-CMakeLists.txt.patch",
    "content": "diff -u -r ../libical-3.0.1/src/libical/CMakeLists.txt ./src/libical/CMakeLists.txt\n--- ../libical-3.0.1/src/libical/CMakeLists.txt\t2017-11-19 15:32:53.000000000 +0100\n+++ ./src/libical/CMakeLists.txt\t2017-12-09 22:14:42.254898817 +0100\n@@ -17,7 +17,7 @@\n   include_directories(${ICU_INCLUDE_DIR})\n endif()\n \n-set(PACKAGE_DATA_DIR \"\\\\\\\"${CMAKE_INSTALL_PREFIX}/share/libical\\\\\\\"\")\n+set(PACKAGE_DATA_DIR \"${CMAKE_INSTALL_PREFIX}/share/libical\")\n add_definitions(-DPACKAGE_DATA_DIR=\"${PACKAGE_DATA_DIR}\")\n \n set(ICALSCRIPTS ${CMAKE_SOURCE_DIR}/scripts/)\n"
  },
  {
    "path": "packages/libiconv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libiconv/\nTERMUX_PKG_DESCRIPTION=\"An implementation of iconv()\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.16\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04\nTERMUX_PKG_BREAKS=\"libandroid-support (<= 24), libiconv-dev, libandroid-support-dev\"\nTERMUX_PKG_REPLACES=\"libandroid-support (<= 24), libiconv-dev, libandroid-support-dev\"\n\n# Enable extra encodings (such as CP437) needed by some programs:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-extra-encodings\"\n"
  },
  {
    "path": "packages/libiconv/iconv.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/iconv\"\nTERMUX_SUBPKG_DESCRIPTION=\"Utility converting between different character encodings\"\n"
  },
  {
    "path": "packages/libicu/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://site.icu-project.org/home\nTERMUX_PKG_DESCRIPTION='International Components for Unicode library'\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=65.1\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/icu4c-${TERMUX_PKG_VERSION//./_}-src.tar.xz\nTERMUX_PKG_SHA256=bd002bdeb2e854a224c2617ba1d0e9ccea7fde3065682333902e234dce4dd380\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"libicu-dev\"\nTERMUX_PKG_REPLACES=\"libicu-dev\"\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS=\"--disable-samples --disable-tests\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-samples --disable-tests --with-cross-build=$TERMUX_PKG_HOSTBUILD_DIR\"\n\ntermux_step_post_extract_package() {\n\tTERMUX_PKG_SRCDIR+=\"/source\"\n}\n"
  },
  {
    "path": "packages/libicu/icu-devtools.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/ share/man/man8\"\nTERMUX_SUBPKG_DESCRIPTION=\"Development utilities for International Components for Unicode\"\n"
  },
  {
    "path": "packages/libid3tag/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.underbit.com/products/mad/\nTERMUX_PKG_DESCRIPTION=\"MAD ID3 tag manipulation library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.15.1b\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=ftp://ftp.mars.org/pub/mpeg/libid3tag-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_BREAKS=\"libid3tag-dev\"\nTERMUX_PKG_REPLACES=\"libid3tag-dev\"\n"
  },
  {
    "path": "packages/libidn/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libidn/\nTERMUX_PKG_DESCRIPTION=\"GNU Libidn library, implementation of IETF IDN specifications\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.35\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=f11af1005b46b7b15d057d7f107315a1ad46935c7fcdf243c16e46ec14f0fe1e\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/libidn/libidn-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libiconv\"\nTERMUX_PKG_BREAKS=\"libidn-dev\"\nTERMUX_PKG_REPLACES=\"libidn-dev\"\n\n# Remove the idn tool for now, add it as subpackage if desired::\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/idn share/man/man1/idn.1 share/emacs\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-ld-version-script\"\n"
  },
  {
    "path": "packages/libidn2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libidn/#libidn2\nTERMUX_PKG_DESCRIPTION=\"Free software implementation of IDNA2008, Punycode and TR46\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"lokesh @hax4us\"\nTERMUX_PKG_VERSION=2.3.0\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/libidn/libidn2-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=e1cb1db3d2e249a6a3eb6f0946777c2e892d5c5dc7bd91c74394fc3a01cab8b5\nTERMUX_PKG_DEPENDS=\"libunistring, libandroid-support\"\nTERMUX_PKG_BREAKS=\"libidn2-dev\"\nTERMUX_PKG_REPLACES=\"libidn2-dev\"\n"
  },
  {
    "path": "packages/libisl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://isl.gforge.inria.fr/\nTERMUX_PKG_DESCRIPTION=\"Library for manipulating sets and relations of integer points bounded by linear constraints\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.22\nTERMUX_PKG_SHA256=6c8bc56c477affecba9c59e2c9f026967ac8bad01b51bdd07916db40a517b9fa\nTERMUX_PKG_SRCURL=http://isl.gforge.inria.fr/isl-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"libgmp\"\nTERMUX_PKG_BREAKS=\"libisl-dev\"\nTERMUX_PKG_REPLACES=\"libisl-dev\"\n"
  },
  {
    "path": "packages/libjansson/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.digip.org/jansson/\nTERMUX_PKG_DESCRIPTION=\"C library for encoding, decoding and manipulating JSON data\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.12\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=76260d30e9bbd0ef392798525e8cd7fe59a6450c54ca6135672e3cd6a1642941\nTERMUX_PKG_BREAKS=\"libjansson-dev\"\nTERMUX_PKG_REPLACES=\"libjansson-dev\"\nTERMUX_PKG_SRCURL=https://github.com/akheron/jansson/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tautoreconf -fi\n}\n"
  },
  {
    "path": "packages/libjasper/CMakeLists.txt.patch",
    "content": "diff -uNr jasper-version-2.0.16/CMakeLists.txt jasper-version-2.0.16.mod/CMakeLists.txt\n--- jasper-version-2.0.16/CMakeLists.txt\t2019-03-12 20:04:35.000000000 +0200\n+++ jasper-version-2.0.16.mod/CMakeLists.txt\t2019-08-16 21:46:51.751881755 +0300\n@@ -323,7 +323,7 @@\n \n find_library(MATH_LIBRARY m)\n if (NOT MATH_LIBRARY)\n-\tset(MATH_LIBRARY \"\")\n+\tset(MATH_LIBRARY \"-lm\")\n endif()\n \n ################################################################################\n"
  },
  {
    "path": "packages/libjasper/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.ece.uvic.ca/~frodo/jasper/\nTERMUX_PKG_DESCRIPTION=\"Library for manipulating JPEG-2000 files\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.0.16\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/mdadams/jasper/archive/version-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=f1d8b90f231184d99968f361884e2054a1714fdbbd9944ba1ae4ebdcc9bbfdb1\nTERMUX_PKG_DEPENDS=\"libjpeg-turbo\"\nTERMUX_PKG_BREAKS=\"libjasper-dev\"\nTERMUX_PKG_REPLACES=\"libjasper-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-H$TERMUX_PKG_SRCDIR\n-B$TERMUX_PKG_BUILDDIR\n-DCMAKE_INSTALL_LIBDIR=$TERMUX_PREFIX/lib\n\"\n"
  },
  {
    "path": "packages/libjasper/libjasper-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"JPEG-2000 utilities\"\n"
  },
  {
    "path": "packages/libjpeg-turbo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libjpeg-turbo.virtualgl.org\nTERMUX_PKG_DESCRIPTION=\"Library for reading and writing JPEG image files\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.0.3\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/libjpeg-turbo/${TERMUX_PKG_VERSION}/libjpeg-turbo-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=4246de500544d4ee408ee57048aa4aadc6f165fc17f141da87669f20ed3241b7\nTERMUX_PKG_BREAKS=\"libjpeg-turbo-dev\"\nTERMUX_PKG_REPLACES=\"libjpeg-turbo-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DWITH_JPEG8=1\"\n"
  },
  {
    "path": "packages/libjpeg-turbo/libjpeg-turbo-progs.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Programs for manipulating JPEG files\"\n"
  },
  {
    "path": "packages/libksba/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gnupg.org/related_software/libksba/\nTERMUX_PKG_DESCRIPTION=\"Library for using X.509 certificates and CMS (Cryptographic Message Syntax) easily accessible\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.3.5\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/libksba/libksba-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=41444fd7a6ff73a79ad9728f985e71c9ba8cd3e5e53358e70d5f066d35c1a340\nTERMUX_PKG_DEPENDS=\"libgpg-error\"\nTERMUX_PKG_BREAKS=\"libksba-dev\"\nTERMUX_PKG_REPLACES=\"libksba-dev\"\n"
  },
  {
    "path": "packages/libllvm/ORCv2.rst.patch",
    "content": "From fe4cc4507a5f23efd105194b017d28311d1620e4 Mon Sep 17 00:00:00 2001\nFrom: Lang Hames <lhames@gmail.com>\nDate: Wed, 31 Jul 2019 18:07:37 +0000\nSubject: [PATCH] [docs] Add references to unreferenced footnotes.\n\nThanks to Stefan Granitz for catching the issue.\n\ngit-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367458 91177308-0d34-0410-b5e6-96231b3b80d8\n---\n docs/ORCv2.rst | 26 +++++++++++++-------------\n 1 file changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/docs/ORCv2.rst b/docs/ORCv2.rst\nindex 7423c041d40a..4f9e08b9a154 100644\n--- a/docs/ORCv2.rst\n+++ b/docs/ORCv2.rst\n@@ -153,8 +153,8 @@ Design Overview\n ORC's JIT'd program model aims to emulate the linking and symbol resolution\n rules used by the static and dynamic linkers. This allows ORC to JIT\n arbitrary LLVM IR, including IR produced by an ordinary static compiler (e.g.\n-clang) that uses constructs like symbol linkage and visibility, and weak and\n-common symbol definitions.\n+clang) that uses constructs like symbol linkage and visibility, and weak [4]_\n+and common symbol definitions.\n \n To see how this works, imagine a program ``foo`` which links against a pair\n of dynamic libraries: ``libA`` and ``libB``. On the command line, building this\n@@ -326,7 +326,7 @@ prefix in LLVM 8.0, and have deprecation warnings attached in LLVM 9.0. In LLVM\n 10.0 ORCv1 will be removed entirely.\n \n Transitioning from ORCv1 to ORCv2 should be easy for most clients. Most of the\n-ORCv1 layers and utilities have ORCv2 counterparts[2]_ that can be directly\n+ORCv1 layers and utilities have ORCv2 counterparts [2]_ that can be directly\n substituted. However there are some design differences between ORCv1 and ORCv2\n to be aware of:\n \n@@ -497,8 +497,8 @@ locking must be done explicitly:\n     }\n \n Clients wishing to maximize possibilities for concurrent compilation will want\n-to create every new ThreadSafeModule on a new ThreadSafeContext. For this reason\n-a convenience constructor for ThreadSafeModule is provided that implicitly\n+to create every new ThreadSafeModule on a new ThreadSafeContext [3]_. For this\n+reason a convenience constructor for ThreadSafeModule is provided that implicitly\n constructs a new ThreadSafeContext value from a std::unique_ptr<LLVMContext>:\n \n   .. code-block:: c++\n@@ -622,11 +622,11 @@ TBD: Speculative compilation. Object Caches.\n \n .. [3] Sharing ThreadSafeModules in a concurrent compilation can be dangerous:\n        if interdependent modules are loaded on the same context, but compiled\n-       on different threads a deadlock may occur (with each compile waiting for\n-       the other(s) to complete, and the other(s) unable to proceed because the\n-       context is locked).\n-\n-.. [4] Mostly. Weak definitions are handled correctly within dylibs, but if\n-       multiple dylibs provide a weak definition of a symbol each will end up\n-       with its own definition (similar to how weak symbols in Windows DLLs\n-       behave). This will be fixed in the future.\n\\ No newline at end of file\n+       on different threads a deadlock may occur, with each compile waiting for\n+       the other to complete, and the other unable to proceed because the\n+       context is locked.\n+\n+.. [4] Weak definitions are currently handled correctly within dylibs, but if\n+       multiple dylibs provide a weak definition of a symbol then each will end\n+       up with its own definition (similar to how weak definitions are handled\n+       in Windows DLLs). This will be fixed in the future.\n"
  },
  {
    "path": "packages/libllvm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://clang.llvm.org/\nTERMUX_PKG_DESCRIPTION=\"Modular compiler and toolchain technologies library\"\nTERMUX_PKG_LICENSE=\"NCSA\"\nTERMUX_PKG_VERSION=9.0.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=(d6a0565cf21f22e9b4353b2eb92622e8365000a9e90a16b09b56f8157eabfe84\n                   7ba81eef7c22ca5da688fdf9d88c20934d2d6b40bfe150ffd338900890aa4610\n\t\t   31c6748b235d09723fb73fea0c816ed5a3fab0f96b66f8fbc546a0fcc8688f91\n\t\t   9979eb1133066376cc0be29d1682bc0b0e7fb541075b391061679111ae4d3b5b)\nTERMUX_PKG_SRCURL=(https://releases.llvm.org/$TERMUX_PKG_VERSION/llvm-$TERMUX_PKG_VERSION.src.tar.xz\n\t\t   https://releases.llvm.org/$TERMUX_PKG_VERSION/cfe-$TERMUX_PKG_VERSION.src.tar.xz\n                   https://releases.llvm.org/$TERMUX_PKG_VERSION/lld-$TERMUX_PKG_VERSION.src.tar.xz\n\t\t   https://releases.llvm.org/$TERMUX_PKG_VERSION/openmp-$TERMUX_PKG_VERSION.src.tar.xz\n\t\t   )\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/clang-check\nbin/clang-import-test\nbin/clang-offload-bundler\nbin/git-clang-format\nbin/macho-dump\nlib/libgomp.a\nlib/libiomp5.a\n\"\nTERMUX_PKG_DEPENDS=\"binutils, libc++, ncurses, ndk-sysroot, libffi, zlib\"\n# Replace gcc since gcc is deprecated by google on android and is not maintained upstream.\n# Conflict with clang versions earlier than 3.9.1-3 since they bundled llvm.\nTERMUX_PKG_CONFLICTS=\"gcc, clang (<< 3.9.1-3)\"\nTERMUX_PKG_BREAKS=\"libclang, libclang-dev, libllvm-dev\"\nTERMUX_PKG_REPLACES=\"gcc, libclang, libclang-dev, libllvm-dev\"\n# See http://llvm.org/docs/CMake.html:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DPYTHON_EXECUTABLE=$(which python3)\n-DLLVM_ENABLE_PIC=ON\n-DLLVM_ENABLE_LIBEDIT=OFF\n-DLLVM_BUILD_TESTS=OFF\n-DLLVM_INCLUDE_TESTS=OFF\n-DCLANG_DEFAULT_CXX_STDLIB=libc++\n-DCLANG_INCLUDE_TESTS=OFF\n-DCLANG_TOOL_C_INDEX_TEST_BUILD=OFF\n-DC_INCLUDE_DIRS=$TERMUX_PREFIX/include\n-DLLVM_LINK_LLVM_DYLIB=ON\n-DLLVM_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-tblgen\n-DCLANG_TABLEGEN=$TERMUX_PKG_HOSTBUILD_DIR/bin/clang-tblgen\n-DLIBOMP_ENABLE_SHARED=FALSE\n-DOPENMP_ENABLE_LIBOMPTARGET=OFF\n-DLLVM_BINUTILS_INCDIR=$TERMUX_PREFIX/include\n-DLLVM_ENABLE_SPHINX=ON\n-DSPHINX_OUTPUT_MAN=ON\n-DLLVM_TARGETS_TO_BUILD=all\n-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV\n-DPERL_EXECUTABLE=$(which perl)\n-DLLVM_ENABLE_FFI=ON\n-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR\n\"\nTERMUX_PKG_FORCE_CMAKE=true\nTERMUX_PKG_HAS_DEBUG=false\n# Debug build succeeds but make install with:\n# cp: cannot stat '../src/projects/openmp/runtime/exports/common.min.50.ompt.optional/include/omp.h': No such file or directory\n# common.min.50.ompt.optional should be common.deb.50.ompt.optional when doing debug build\n\ntermux_step_post_extract_package() {\n\tmv cfe-${TERMUX_PKG_VERSION}.src tools/clang\n\tmv lld-${TERMUX_PKG_VERSION}.src tools/lld\n\tmv openmp-${TERMUX_PKG_VERSION}.src projects/openmp\n}\n\ntermux_step_host_build() {\n\ttermux_setup_cmake\n\tcmake -G \"Unix Makefiles\" $TERMUX_PKG_SRCDIR \\\n\t\t-DLLVM_BUILD_TESTS=OFF \\\n\t\t-DLLVM_INCLUDE_TESTS=OFF\n\tmake -j $TERMUX_MAKE_PROCESSES clang-tblgen llvm-tblgen\n}\n\ntermux_step_pre_configure() {\n\tmkdir projects/openmp/runtime/src/android\n\tcp $TERMUX_PKG_BUILDER_DIR/nl_types.h projects/openmp/runtime/src/android\n\tcp $TERMUX_PKG_BUILDER_DIR/nltypes_stubs.cpp projects/openmp/runtime/src/android\n\n\tcd $TERMUX_PKG_BUILDDIR\n\texport LLVM_DEFAULT_TARGET_TRIPLE=$TERMUX_HOST_PLATFORM\n\texport LLVM_TARGET_ARCH\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tLLVM_TARGET_ARCH=ARM\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\tLLVM_TARGET_ARCH=AArch64\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tLLVM_TARGET_ARCH=X86\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\tLLVM_TARGET_ARCH=X86\n\telse\n\t\ttermux_error_exit \"Invalid arch: $TERMUX_ARCH\"\n\tfi\n\t# see CMakeLists.txt and tools/clang/CMakeLists.txt\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DLLVM_DEFAULT_TARGET_TRIPLE=$LLVM_DEFAULT_TARGET_TRIPLE\"\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DLLVM_TARGET_ARCH=$LLVM_TARGET_ARCH -DLLVM_TARGETS_TO_BUILD=all\"\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DLLVM_HOST_TRIPLE=$LLVM_DEFAULT_TARGET_TRIPLE\"\n}\ntermux_step_make() {\n\tninja || zsh\n}\ntermux_step_post_make_install() {\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tcp ../src/projects/openmp/runtime/exports/common.min/include/omp.h $TERMUX_PREFIX/include\n\telse\n\t\tcp ../src/projects/openmp/runtime/exports/common.min.ompt.optional/include/omp.h $TERMUX_PREFIX/include\n\tfi\t\n\tif [ \"$TERMUX_CMAKE_BUILD\" = Ninja ]; then\n\t\tninja docs-llvm-man\n\telse\n\t\tmake docs-llvm-man\n\tfi\n\n\tcp docs/man/* $TERMUX_PREFIX/share/man/man1\n\tcd $TERMUX_PREFIX/bin\n\n\tfor tool in clang clang++ cc c++ cpp gcc g++ ${TERMUX_HOST_PLATFORM}-{clang,clang++,gcc,g++,cpp}; do\n\t\tln -f -s clang-${TERMUX_PKG_VERSION:0:1} $tool\n\tdone\n}\n\ntermux_step_post_massage() {\n\tsed $TERMUX_PKG_BUILDER_DIR/llvm-config.in \\\n\t\t-e \"s|@TERMUX_PKG_VERSION@|$TERMUX_PKG_VERSION|g\" \\\n\t\t-e \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g\" \\\n\t\t-e \"s|@TERMUX_PKG_SRCDIR@|$TERMUX_PKG_SRCDIR|g\" \\\n\t\t-e \"s|@LLVM_TARGET_ARCH@|$LLVM_TARGET_ARCH|g\" \\\n\t\t-e \"s|@LLVM_DEFAULT_TARGET_TRIPLE@|$LLVM_DEFAULT_TARGET_TRIPLE|g\" \\\n\t\t-e \"s|@TERMUX_ARCH@|$TERMUX_ARCH|g\" > $TERMUX_PREFIX/bin/llvm-config\n\tchmod 755 $TERMUX_PREFIX/bin/llvm-config\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/bin/llvm-tblgen $TERMUX_PREFIX/bin\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/bin/clang-tblgen $TERMUX_PREFIX/bin\n}\n"
  },
  {
    "path": "packages/libllvm/clang.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"\nbin/c++\nbin/cc\nbin/*clang*\nbin/*cpp\nbin/*g++\nbin/*gcc\nbin/scan-build\nlib/clang\nlib/libomp.a\nlibexec/\nshare/clang\nshare/man/man1/scan-build.1\n\"\nTERMUX_SUBPKG_DESCRIPTION=\"C language frontend for LLVM\"\n"
  },
  {
    "path": "packages/libllvm/cxx-libm.patch",
    "content": "diff --git a/tools/clang/lib/Driver/ToolChains/Gnu.cpp~ b/tools/clang/lib/Driver/ToolChains/Gnu.cpp\nindex 2ad4509..4d0b060 100644\n--- a/tools/clang/lib/Driver/ToolChains/Gnu.cpp~\n+++ b/tools/clang/lib/Driver/ToolChains/Gnu.cpp\n@@ -483,7 +483,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,\n       if (OnlyLibstdcxxStatic)\n         CmdArgs.push_back(\"-Bdynamic\");\n     }\n-    CmdArgs.push_back(\"-lm\");\n   }\n   // Silence warnings when linking C code with a C++ '-stdlib' argument.\n   Args.ClaimAllArgs(options::OPT_stdlib_EQ);\n@@ -513,6 +512,9 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,\n \n       AddRunTimeLibs(ToolChain, D, CmdArgs, Args);\n \n+      if (D.CCCIsCXX())\n+        CmdArgs.push_back(\"-lm\");\n+\n       if (WantPthread && !isAndroid)\n         CmdArgs.push_back(\"-lpthread\");\n \n"
  },
  {
    "path": "packages/libllvm/lld.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"\ninclude/lld/\nlib/liblldConfig.a\nlib/liblldCore.a\nlib/liblldDriver.a\nlib/liblldReaderWriter.a\nlib/liblldMachO.a\nlib/liblldYAML.a\nbin/lld\nbin/lld-link\nbin/ld.lld\nbin/wasm-ld\nbin/ld64.lld\nlib/liblldCOFF.a\nlib/liblldELF.a\n\"\nTERMUX_SUBPKG_DESCRIPTION=\"LD replace based on LLVM\"\n"
  },
  {
    "path": "packages/libllvm/llvm-config.in",
    "content": "#!/bin/sh\nshow_help () {\necho \"usage: llvm-config <OPTION>... [<COMPONENT>...]\n\nGet various configuration information needed to compile programs which use\nLLVM.  Typically called from 'configure' scripts.  Examples:\n  llvm-config --cxxflags\n  llvm-config --ldflags\n  llvm-config --libs engine bcreader scalaropts\n\nOptions:\n  --version         Print LLVM version.\n  --prefix          Print the installation prefix.\n  --src-root        Print the source root LLVM was built from.\n  --obj-root        Print the object root used to build LLVM.\n  --bindir          Directory containing LLVM executables.\n  --includedir      Directory containing LLVM headers.\n  --libdir          Directory containing LLVM libraries.\n  --cppflags        C preprocessor flags for files that include LLVM headers.\n  --cflags          C compiler flags for files that include LLVM headers.\n  --cxxflags        C++ compiler flags for files that include LLVM headers.\n  --ldflags         Print Linker flags.\n  --system-libs     System Libraries needed to link against LLVM components.\n  --libs            Libraries needed to link against LLVM components.\n  --libnames        Bare library names for in-tree builds.\n  --libfiles        Fully qualified library filenames for makefile depends.\n  --components      List of all possible components.\n  --targets-built   List of all targets currently built.\n  --host-target     Target triple used to configure LLVM.\n  --build-mode      Print build mode of LLVM tree (e.g. Debug or Release).\n  --assertion-mode  Print assertion mode of LLVM tree (ON or OFF).\n  --build-system    Print the build system used to build LLVM (always cmake).\n  --has-rtti        Print whether or not LLVM was built with rtti (YES or NO).\n  --has-global-isel Print whether or not LLVM was built with global-isel support (YES or NO).\n  --shared-mode     Print how the provided components can be collectively linked (\\`shared\\` or \\`static\\`).\n  --link-shared     Link the components as shared libraries.\n  --link-static     Link the component libraries statically.                                                                                                                                 \nTypical components:                                                                                                                                                                          \n  all               All LLVM libraries (default).                                                                                                                                            \n  engine            Either a native JIT or a bitcode interpreter.\"\n}\n\narch=@TERMUX_ARCH@\nversion=@TERMUX_PKG_VERSION@\nprefix=@TERMUX_PREFIX@\nhas_rtti=NO\nCPPFLAGS=\"-I${prefix}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS\"\nCFLAGS=\"${CPPFLAGS} ${CFLAGS}  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS\"\nCXXFLAGS=\"${CFLAGS} -fvisibility-inlines-hidden -Wcast-qual -Wnon-virtual-dtor -std=c++11 -fno-exceptions\"\nif [ \"$has_rtti\" != \"YES\" ]; then CXXFLAGS=\"$CXXFLAGS -fno-rtti\"; fi\nLDFLAGS=\"-L${prefix}/lib\"\nLIBFILE=\"${prefix}/lib/libLLVM-$version.so\"\ncomponents=\"aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc \\\naarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu \\\namdgpuasmparser amdgpuasmprinter amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils \\\nanalysis arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo armutils asmparser \\\nasmprinter binaryformat bitreader bitwriter bpf bpfasmparser bpfasmprinter bpfcodegen bpfdesc \\\nbpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfomsf \\\ndebuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser \\\nhexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo \\\nirreader lanai lanaiasmparser lanaiasmprinter lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver \\\nlineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen \\\nmipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430asmprinter msp430codegen \\\nmsp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxasmprinter nvptxcodegen \\\nnvptxdesc nvptxinfo objcarcopts object objectyaml option optremarks orcjit passes powerpc \\\npowerpcasmparser powerpcasmprinter powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo \\\nprofiledata riscv riscvasmparser riscvasmprinter riscvcodegen riscvdesc riscvdisassembler riscvinfo \\\nriscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparcasmprinter sparccodegen sparcdesc \\\nsparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzasmprinter systemzcodegen \\\nsystemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly \\\nwebassemblyasmparser webassemblyasmprinter webassemblycodegen webassemblydesc webassemblydisassembler \\\nwebassemblyinfo windowsmanifest x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info \\\nx86utils xcore xcoreasmprinter xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray\"\nstatic_libs=\"-lLLVMObjectYAML -lLLVMDlltoolDriver -lLLVMLineEditor -lLLVMFuzzMutate -lLLVMCoroutines \\\n-lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMTextAPI -lLLVMCoverage -lLLVMXRay -lLLVMInterpreter \\\n-lLLVMMIRParser -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoDWARF -lLLVMRISCVDisassembler \\\n-lLLVMRISCVCodeGen -lLLVMRISCVAsmParser -lLLVMRISCVDesc -lLLVMRISCVInfo -lLLVMRISCVAsmPrinter \\\n-lLLVMRISCVUtils -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter \\\n-lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils \\\n-lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyDesc -lLLVMWebAssemblyAsmPrinter -lLLVMWebAssemblyAsmParser \\\n-lLLVMWebAssemblyInfo -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo \\\n-lLLVMSystemZAsmPrinter -lLLVMSparcDisassembler -lLLVMSparcCodeGen -lLLVMSparcAsmParser -lLLVMSparcDesc -lLLVMSparcInfo \\\n-lLLVMSparcAsmPrinter -lLLVMPowerPCDisassembler -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo \\\n-lLLVMPowerPCAsmPrinter -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMMSP430Disassembler \\\n-lLLVMMSP430CodeGen -lLLVMMSP430AsmParser -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMMipsDisassembler \\\n-lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen \\\n-lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiAsmPrinter -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen \\\n-lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFCodeGen -lLLVMBPFAsmParser -lLLVMBPFDesc \\\n-lLLVMBPFInfo -lLLVMBPFAsmPrinter -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo \\\n-lLLVMARMAsmPrinter -lLLVMARMUtils -lLLVMAMDGPUDisassembler -lLLVMAMDGPUCodeGen -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize \\\n-lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMAMDGPUAsmParser -lLLVMAMDGPUDesc -lLLVMAMDGPUInfo -lLLVMAMDGPUAsmPrinter \\\n-lLLVMAMDGPUUtils -lLLVMLibDriver -lLLVMOption -lLLVMWindowsManifest -lLLVMAArch64Disassembler -lLLVMMCDisassembler -lLLVMAArch64AsmParser \\\n-lLLVMMCJIT -lLLVMTableGen -lLLVMOrcJIT -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOptRemarks -lLLVMMCA -lLLVMAArch64CodeGen -lLLVMGlobalISel \\\n-lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine \\\n-lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMCore -lLLVMAArch64Desc \\\n-lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMAArch64Utils \\\n-lLLVMSupport -lLLVMDemangle\"\nshared_libs=\"-lLLVM-$version\"\nlibs=$shared_libs\nhandle_args () {\n\tcase \"${1##--}\" in\n\t\tlink-shared) libs=$shared_libs ;;\n\t\tlink-static) libs=$static_libs ;;\n\t\tversion) echo \"$version\\n\";;\n\t\tprefix) echo \"$prefix\";;\n\t\tsrc-root) echo \"@TERMUX_PKG_SRCDIR@\";;\n\t\tobj-root) echo \"$prefix\";;\n\t\tbindir) echo \"$prefix/bin\";;\n\t\tincludedir) echo \"$prefix/include\";;\n\t\tlibdir) echo \"$prefix/lib\";;\n\t\tcppflags) echo \"$CPPFLAGS\";;\n\t\tcflags) echo \"$CFLAGS\";;\n\t\tcxxflags) echo \"$CXXFLAGS\";;\n\t\tldflags) echo \"$LDFLAGS\";;\n\t\tsystem-libs) echo \"-lc -ldl -lcurses -lz -lm\";;\n\t\tlibs) echo \"$libs\";;\n\t\tlibnames) echo \"libLLVM-$version.so\";;\n\t\tlibfiles) echo \"$LIBFILE\";;\n\t\tcomponents) echo \"$components\";;\n\t\ttargets-built) echo \"AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX PowerPC Sparc SystemZ X86 XCore WebAssembly\";;\n\t\thost-target) echo \"@LLVM_DEFAULT_TARGET_TRIPLE@\";;\n\t\tbuild-mode) echo \"Release\";;\n\t\tassertion-mode) echo \"OFF\";;\n\t\tbuild-system) echo \"cmake\";;\n\t\thas-rtti) echo \"$has_rtti\";;\n\t\thas-global-isel) echo \"OFF\";;\n\t\tshared-mode) echo \"shared\";;\n\t\tcmakedir) echo \"$prefix/lib/cmake/llvm\";;\n\t\t*) show_help >&2;;\n\tesac\n}\n\nfor arg in $@; do handle_args $arg; done\n\n"
  },
  {
    "path": "packages/libllvm/llvm.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"\nbin/llc\nbin/lli\nbin/sancov\nbin/sanstats\nbin/llvm*\nbin/obj2yaml\nbin/opt\nbin/verify-uselistorder\nbin/yaml2obj\nshare/opt-viewer\nbin/bugpoint\nbin/clang-check\nbin/scan-build\nbin/scan-view\nshare/man/man1/llc.1\nshare/man/man1/lli.1\nshare/man/man1/llvm*\nshare/man/man1/opt.1\nshare/man/man1/bugpoint.1\nshare/man/man1/tblgen.1\n\"\nTERMUX_SUBPKG_DESCRIPTION=\"C language frontend for LLVM\"\n"
  },
  {
    "path": "packages/libllvm/nl_types.h",
    "content": "/*\n * Copyright (C) 2013 The Android Open Source Project\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n#ifndef ANDROID_NLTYPES_H\n#define ANDROID_NLTYPES_H\n\n#include_next <nl_types.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nnl_catd  catopen(const char*, int);\nchar*    catgets(nl_catd, int, int, const char*);\nint      catclose(nl_catd);\n\n#ifdef __cplusplus\n}  // extern \"C\"\n#endif\n\n#endif  /* ANDROID_NLTYPES_H */\n\n"
  },
  {
    "path": "packages/libllvm/nltypes_stubs.cpp",
    "content": "/*\n * Copyright (C) 2016 The Android Open Source Project\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include <nl_types.h>\n\n#include <errno.h>\n\n__attribute__((weak,visibility(\"hidden\")))\nnl_catd catopen(const char*, int) {\n  return reinterpret_cast<nl_catd>(-1);\n}\n\n__attribute__((weak,visibility(\"hidden\")))\nchar* catgets(nl_catd, int, int, const char* message) {\n  return const_cast<char*>(message);\n}\n\n__attribute__((weak,visibility(\"hidden\")))\nint catclose(nl_catd) {\n  // Since we didn't hand out a valid nl_catd, you can't be returning one to us.\n  errno = EBADF;\n  return -1;\n}\n"
  },
  {
    "path": "packages/libllvm/openmp-config-ix-m32.patch",
    "content": "--- projects/openmp/runtime/cmake/config-ix.cmake.orig\t2019-04-04 21:32:58.195143957 +0000\n+++ ./projects/openmp/runtime/cmake/config-ix.cmake\t2019-04-04 21:33:43.999700683 +0000\n@@ -71,7 +71,6 @@\n check_c_compiler_flag(-msse2 LIBOMP_HAVE_MSSE2_FLAG)\n check_c_compiler_flag(-ftls-model=initial-exec LIBOMP_HAVE_FTLS_MODEL_FLAG)\n libomp_check_architecture_flag(-mmic LIBOMP_HAVE_MMIC_FLAG)\n-libomp_check_architecture_flag(-m32 LIBOMP_HAVE_M32_FLAG)\n if(WIN32)\n   if(MSVC)\n     # Check Windows MSVC style flags.\n"
  },
  {
    "path": "packages/libllvm/project-openmp-runtime-src-CMakeLists.txt.patch",
    "content": "--- ../../cache/llvm-project-20170507-release_600/openmp/runtime/src/CMakeLists.txt\t2018-03-02 09:50:00.000000000 +0000\n+++ ./projects/openmp/runtime/src/CMakeLists.txt\t2018-03-08 03:39:14.548490023 +0000\n@@ -50,6 +50,9 @@\n if(${LIBOMP_USE_HWLOC})\n   include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)\n endif()\n+if(ANDROID)\n+\tinclude_directories(${LIBOMP_SRC_DIR}/android)\n+endif()\n \n # Getting correct source files to build library\n set(LIBOMP_CFILES)\n@@ -95,6 +98,9 @@\n     libomp_append(LIBOMP_CXXFILES kmp_gsupport.cpp)\n     libomp_append(LIBOMP_ASMFILES z_Linux_asm.S) # Unix assembly file\n   endif()\n+  if(ANDROID)\n+    libomp_append(LIBOMP_CXXFILES android/nltypes_stubs.cpp)\n+  endif()\n   libomp_append(LIBOMP_CFILES thirdparty/ittnotify/ittnotify_static.c LIBOMP_USE_ITT_NOTIFY)\n   libomp_append(LIBOMP_CXXFILES kmp_debugger.cpp LIBOMP_USE_DEBUGGER)\n   libomp_append(LIBOMP_CXXFILES kmp_stats.cpp LIBOMP_STATS)\n"
  },
  {
    "path": "packages/libllvm/tools-clang-lib-Driver-ToolChain.cpp.patch",
    "content": "diff -u -r ../llvm-4.0.1.src/tools/clang/lib/Driver/ToolChain.cpp ./tools/clang/lib/Driver/ToolChain.cpp\n--- ../llvm-4.0.1.src/tools/clang/lib/Driver/ToolChain.cpp\t2016-12-14 17:46:50.000000000 +0100\n+++ ./tools/clang/lib/Driver/ToolChain.cpp\t2017-07-13 12:35:02.862534376 +0200\n@@ -632,7 +632,7 @@\n \n   switch (Type) {\n   case ToolChain::CST_Libcxx:\n-    CmdArgs.push_back(\"-lc++\");\n+    CmdArgs.push_back(\"-lc++_shared\");\n     break;\n \n   case ToolChain::CST_Libstdcxx:\n"
  },
  {
    "path": "packages/libllvm/tools-clang-lib-Driver-ToolChains-Gnu.cpp.patch",
    "content": "diff -u -r ../llvm-5.0.0.src/tools/clang/lib/Driver/ToolChains/Gnu.cpp ./tools/clang/lib/Driver/ToolChains/Gnu.cpp\n--- ../llvm-5.0.0.src/tools/clang/lib/Driver/ToolChains/Gnu.cpp\t2017-08-11 03:47:32.000000000 +0200\n+++ ./tools/clang/lib/Driver/ToolChains/Gnu.cpp\t2017-09-10 20:14:54.636653647 +0200\n@@ -152,14 +152,11 @@\n     }\n   }\n \n-  const std::string &customGCCName = D.getCCCGenericGCCName();\n-  const char *GCCName;\n-  if (!customGCCName.empty())\n-    GCCName = customGCCName.c_str();\n-  else if (D.CCCIsCXX()) {\n-    GCCName = \"g++\";\n-  } else\n-    GCCName = \"gcc\";\n+  // Termux modification: Disable calling into gcc from clang.\n+  // Clang calls into gcc if it tries to compile a language it doesn't understand.\n+  // On Termux gcc is a symlink to clang, so this leads into fork loop until\n+  // the whole system runs out of memory.\n+  const char *GCCName = \"false\";\n \n   const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));\n   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));\n"
  },
  {
    "path": "packages/libllvm/tools-clang-lib-Driver-ToolChains-Linux.cpp.patch",
    "content": "--- tools/clang/lib/Driver/ToolChains/Linux.cpp.orig\t2019-03-28 00:40:14.508554643 +0000\n+++ ./tools/clang/lib/Driver/ToolChains/Linux.cpp\t2019-03-28 00:46:12.983564436 +0000\n@@ -314,6 +314,41 @@\n \n   const std::string OSLibDir = getOSLibDir(Triple, Args);\n   const std::string MultiarchTriple = getMultiarchTriple(D, Triple, SysRoot);\n+  bool NativeBuild = true;\n+\n+  if(IsAndroid) {\n+    if (MultiarchTriple == llvm::sys::getDefaultTargetTriple())\n+      addPathIfExists(D, SysRoot + \"@TERMUX_PREFIX@/lib\", Paths);\n+    else\n+      NativeBuild = false;\n+\n+    if (Arch == llvm::Triple::aarch64) {\n+      addPathIfExists(D, SysRoot + \"@TERMUX_PREFIX@/aarch64-linux-android/lib\", Paths);\n+      addPathIfExists(D, SysRoot + \"/system/lib64\", Paths);\n+      if (!NativeBuild)\n+        ExtraOpts.push_back(\"-rpath=@TERMUX_PREFIX@/aarch64-linux-android/lib\");\n+    }\n+    else if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) {\n+      addPathIfExists(D, SysRoot + \"@TERMUX_PREFIX@/arm-linux-androideabi/lib\", Paths);\n+      addPathIfExists(D, SysRoot + \"/system/lib\", Paths);\n+      if (!NativeBuild)\n+        ExtraOpts.push_back(\"-rpath=@TERMUX_PREFIX@/arm-linux-androideabi/lib\");\n+    }\n+    else if (Arch == llvm::Triple::x86_64) {\n+      addPathIfExists(D, SysRoot + \"@TERMUX_PREFIX@/x86_64-linux-android/lib\", Paths);\n+      addPathIfExists(D, SysRoot + \"/system/lib64\", Paths);\n+      if (!NativeBuild)\n+        ExtraOpts.push_back(\"-rpath=@TERMUX_PREFIX@/x86_64-linux-android/lib\");\n+    }\n+    else if (Arch == llvm::Triple::x86) {\n+      addPathIfExists(D, SysRoot + \"@TERMUX_PREFIX@/i686-linux-android/lib\", Paths);\n+      addPathIfExists(D, SysRoot + \"/system/lib\", Paths);\n+      if (!NativeBuild)\n+        ExtraOpts.push_back(\"-rpath=@TERMUX_PREFIX@/i686-linux-android/lib\");\n+    }\n+\n+    ExtraOpts.push_back(\"-rpath=@TERMUX_PREFIX@/lib\");\n+  }\n \n   // Add the multilib suffixed paths where they are available.\n   if (GCCInstallation.isValid()) {\n@@ -652,8 +679,27 @@\n     return;\n \n   if (!DriverArgs.hasArg(options::OPT_nostdlibinc))\n+    if  (getTriple().isAndroid()) {\n+      switch (getTriple().getArch()) {\n+\tcase llvm::Triple::x86_64:\n+\taddSystemInclude(DriverArgs, CC1Args, SysRoot + \"@TERMUX_PREFIX@/include/x86_64-linux-android\");\n+\tbreak;\n+\tcase llvm::Triple::x86:\n+\taddSystemInclude(DriverArgs, CC1Args, SysRoot + \"@TERMUX_PREFIX@/include/i686-linux-android\");\n+\tbreak;\n+\tcase llvm::Triple::aarch64:\n+\taddSystemInclude(DriverArgs, CC1Args, SysRoot + \"@TERMUX_PREFIX@/include/aarch64-linux-android\");\n+\tbreak;\n+\tcase llvm::Triple::arm:\n+\tcase llvm::Triple::thumb:\n+\taddSystemInclude(DriverArgs, CC1Args, SysRoot + \"@TERMUX_PREFIX@/include/arm-linux-androideabi\");\n+\tbreak;\n+\tdefault:\n+\tbreak;\n+    \t}\n+   \n     addSystemInclude(DriverArgs, CC1Args, SysRoot + \"/usr/local/include\");\n-\n+  }\n   if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {\n     SmallString<128> P(D.ResourceDir);\n     llvm::sys::path::append(P, \"include\");\n@@ -968,7 +1014,7 @@\n }\n \n bool Linux::isPIEDefault() const {\n-  return (getTriple().isAndroid() && !getTriple().isAndroidVersionLT(16)) ||\n+  return getTriple().isAndroid()  ||\n           getTriple().isMusl() || getSanitizerArgs().requiresPIE();\n }\n \n"
  },
  {
    "path": "packages/libllvm/tools-llvm-shlib-CMakeLists.txt.patch",
    "content": "--- ./tools/llvm-shlib/CMakeLists.txt.orig\t2019-03-20 21:24:00.144316380 +0000\n+++ ./tools/llvm-shlib/CMakeLists.txt\t2019-03-20 21:25:26.117941452 +0000\n@@ -48,6 +48,7 @@\n      OR (\"${CMAKE_SYSTEM_NAME}\" STREQUAL \"OpenBSD\")\n      OR (\"${CMAKE_SYSTEM_NAME}\" STREQUAL \"Fuchsia\")\n      OR (\"${CMAKE_SYSTEM_NAME}\" STREQUAL \"DragonFly\")\n+     OR (\"${CMAKE_SYSTEM_NAME}\" STREQUAL \"Android\")\n      OR (\"${CMAKE_SYSTEM_NAME}\" STREQUAL \"SunOS\")) # FIXME: It should be \"GNU ld for elf\"\n     configure_file(\n     ${CMAKE_CURRENT_SOURCE_DIR}/simple_version_script.map.in\n"
  },
  {
    "path": "packages/liblua/Makefile.patch",
    "content": "diff -u -r ../lua-5.3.4/Makefile ./Makefile\n--- ../lua-5.3.4/Makefile\t2016-12-20 17:26:08.000000000 +0100\n+++ ./Makefile\t2017-02-02 01:32:24.472329105 +0100\n@@ -4,17 +4,17 @@\n # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================\n \n # Your platform. See PLATS for possible values.\n-PLAT= none\n+PLAT= linux\n \n # Where to install. The installation starts in the src and doc directories,\n # so take care if INSTALL_TOP is not an absolute path. See the local target.\n # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with\n # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.\n-INSTALL_TOP= /usr/local\n+INSTALL_TOP= $(PREFIX)\n INSTALL_BIN= $(INSTALL_TOP)/bin\n INSTALL_INC= $(INSTALL_TOP)/include\n INSTALL_LIB= $(INSTALL_TOP)/lib\n-INSTALL_MAN= $(INSTALL_TOP)/man/man1\n+INSTALL_MAN= $(INSTALL_TOP)/share/man/man1\n INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V\n INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V\n \n@@ -38,21 +38,21 @@\n # Convenience platforms targets.\n PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris\n \n+# Lua version and release.\n+V= 5.3\n+R= $V.5\n+\n # What to install.\n TO_BIN= lua luac\n TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp\n-TO_LIB= liblua.a\n+TO_LIB= liblua.a liblua.so.$(R)\n TO_MAN= lua.1 luac.1\n \n-# Lua version and release.\n-V= 5.3\n-R= $V.4\n-\n # Targets start here.\n all:\t$(PLAT)\n \n $(PLATS) clean:\n-\tcd src && $(MAKE) $@\n+\tcd src && $(MAKE) $@ V=$(V) R=$(R)\n \n test:\tdummy\n \tsrc/lua -v\n@@ -63,6 +63,8 @@\n \tcd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)\n \tcd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)\n \tcd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)\n+\tln -f -s $(INSTALL_LIB)/liblua.so.$(R) $(INSTALL_LIB)/liblua.so.$(V)\n+\tln -f -s $(INSTALL_LIB)/liblua.so.$(R) $(INSTALL_LIB)/liblua.so\n \n uninstall:\n \tcd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)\n"
  },
  {
    "path": "packages/liblua/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.lua.org/\nTERMUX_PKG_DESCRIPTION=\"Shared library for the Lua interpreter\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=5.3.5\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SHA256=0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac\nTERMUX_PKG_SRCURL=https://www.lua.org/ftp/lua-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_MAKE_ARGS=linux\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_BREAKS=\"liblua-dev\"\nTERMUX_PKG_REPLACES=\"liblua-dev\"\nTERMUX_PKG_BUILD_DEPENDS=\"readline\"\n\ntermux_step_pre_configure() {\n\tAR+=\" rcu\"\n\tCFLAGS+=\" -fPIC -DLUA_COMPAT_5_2 -DLUA_COMPAT_UNPACK\"\n\texport MYLDFLAGS=$LDFLAGS\n}\n\ntermux_step_post_make_install() {\n\t# Add a pkg-config file for the system zlib\n\tcat > \"$PKG_CONFIG_LIBDIR/lua.pc\" <<-HERE\n\t\tName: Lua\n\t\tDescription: An Extensible Extension Language\n\t\tVersion: $TERMUX_PKG_VERSION\n\t\tRequires:\n\t\tLibs: -llua -lm\n\tHERE\n}\n"
  },
  {
    "path": "packages/liblua/fix-lua_tmpnametemplate.patch",
    "content": "--- ./src/loslib.c.orig\t2019-06-07 23:19:03.666887235 +0000\n+++ ./src/loslib.c\t2019-06-07 23:19:47.295164822 +0000\n@@ -112,10 +112,10 @@\n \n #include <unistd.h>\n \n-#define LUA_TMPNAMBUFSIZE\t32\n+#define LUA_TMPNAMBUFSIZE\t128\n \n #if !defined(LUA_TMPNAMTEMPLATE)\n-#define LUA_TMPNAMTEMPLATE\t\"/tmp/lua_XXXXXX\"\n+#define LUA_TMPNAMTEMPLATE\t\"@TERMUX_PREFIX@/tmp/lua_XXXXXX\"\n #endif\n \n #define lua_tmpnam(b,e,s) {\t       \\\n"
  },
  {
    "path": "packages/liblua/lua.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Simple, extensible, embeddable programming language\"\nTERMUX_SUBPKG_DEPENDS=\"readline\"\n"
  },
  {
    "path": "packages/liblua/src-Makefile.patch",
    "content": "diff -r -u ../lua-5.3.3/src/Makefile ./src/Makefile\n--- ../lua-5.3.3/src/Makefile\t2015-05-27 13:10:11.000000000 +0200\n+++ ./src/Makefile\t2017-01-18 00:26:04.985042439 +0100\n@@ -4,31 +4,20 @@\n # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================\n \n # Your platform. See PLATS for possible values.\n-PLAT= none\n+PLAT= linux\n \n-CC= gcc -std=gnu99\n-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)\n+CFLAGS+= $(SYSCFLAGS)\n-LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)\n+LDFLAGS+= $(SYSLDFLAGS) $(MYLDFLAGS)\n LIBS= -lm $(SYSLIBS) $(MYLIBS)\n \n-AR= ar rcu\n-RANLIB= ranlib\n RM= rm -f\n \n-SYSCFLAGS=\n-SYSLDFLAGS=\n-SYSLIBS=\n-\n-MYCFLAGS=\n-MYLDFLAGS=\n-MYLIBS=\n-MYOBJS=\n-\n # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======\n \n PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris\n \n LUA_A=\tliblua.a\n+LUA_SO=\tliblua.so\n CORE_O=\tlapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \\\n \tlmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \\\n \tltm.o lundump.o lvm.o lzio.o\n@@ -43,7 +32,7 @@\n LUAC_O=\tluac.o\n \n ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)\n-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)\n+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)\n ALL_A= $(LUA_A)\n \n # Targets start here.\n@@ -59,6 +48,11 @@\n \t$(AR) $@ $(BASE_O)\n \t$(RANLIB) $@\n \n+$(LUA_SO): $(CORE_O) $(LIB_O)\n+\t$(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)\n+\tln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)\n+\tln -sf $(LUA_SO).$(R) $(LUA_SO)\n+\n $(LUA_T): $(LUA_O) $(LUA_A)\n \t$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)\n \n"
  },
  {
    "path": "packages/liblua/src-loslib.c.patch",
    "content": "--- ./src/loslib.c\t2017-11-18 15:51:35.425137997 +0000\n+++ ../loslib.c\t2017-11-18 16:20:36.202578294 +0000\n@@ -118,8 +118,8 @@\n #define LUA_TMPNAMTEMPLATE\t\"@TERMUX_PREFIX@/tmp/lua_XXXXXX\"\n #endif\n \n-#define lua_tmpnam(b,e) { \\\n-        strcpy(b, LUA_TMPNAMTEMPLATE); \\\n+#define lua_tmpnam(b,e,s) {\t       \\\n+        strncpy(b, LUA_TMPNAMTEMPLATE, s);   \\\n         e = mkstemp(b); \\\n         if (e != -1) close(e); \\\n         e = (e == -1); }\n@@ -166,7 +166,7 @@\n static int os_tmpname (lua_State *L) {\n   char buff[LUA_TMPNAMBUFSIZE];\n   int err;\n-  lua_tmpnam(buff, err);\n+  lua_tmpnam(buff, err, LUA_TMPNAMBUFSIZE - 1);\n   if (err)\n     return luaL_error(L, \"unable to generate a unique filename\");\n   lua_pushstring(L, buff);\n"
  },
  {
    "path": "packages/liblua/src-luaconf.h.patch",
    "content": "diff -r -u ../lua-5.3.3/src/luaconf.h ./src/luaconf.h\n--- ../lua-5.3.3/src/luaconf.h\t2016-05-01 22:06:09.000000000 +0200\n+++ ./src/luaconf.h\t2017-01-17 23:47:26.867840450 +0100\n@@ -188,7 +188,7 @@\n \n #else\t\t\t/* }{ */\n \n-#define LUA_ROOT\t\"/usr/local/\"\n+#define LUA_ROOT\t\"@TERMUX_PREFIX@/\"\n #define LUA_LDIR\tLUA_ROOT \"share/lua/\" LUA_VDIR \"/\"\n #define LUA_CDIR\tLUA_ROOT \"lib/lua/\" LUA_VDIR \"/\"\n #define LUA_PATH_DEFAULT  \\\n"
  },
  {
    "path": "packages/liblua52/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.lua.org\nTERMUX_PKG_DESCRIPTION=\"Shared library for the Lua interpreter (v5.2.x)\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=5.2.4\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://www.lua.org/ftp/lua-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b\nTERMUX_PKG_BREAKS=\"liblua52-dev\"\nTERMUX_PKG_REPLACES=\"liblua52-dev\"\nTERMUX_PKG_BUILD_DEPENDS=\"readline\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\tsed -e \"s/%VER%/${TERMUX_PKG_VERSION%.*}/g;s/%REL%/${TERMUX_PKG_VERSION}/g\" \\\n\t\t-e \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|\" \\\n\t\t\"$TERMUX_PKG_BUILDER_DIR\"/lua.pc.in > lua.pc\n}\n\ntermux_step_make() {\n\tmake -j $TERMUX_MAKE_PROCESSES \\\n\t\tMYCFLAGS=\"$CFLAGS -fPIC\" \\\n\t\tMYLDFLAGS=\"$LDFLAGS\" \\\n\t\tCC=\"$CC\" \\\n\t\tCXX=\"$CXX\" \\\n\t\tlinux\n}\n\ntermux_step_make_install() {\n\tmake \\\n\t\tTO_BIN=\"lua5.2 luac5.2\" \\\n\t\tTO_LIB=\"liblua5.2.so liblua5.2.so.5.2 liblua5.2.so.${TERMUX_PKG_VERSION}\" \\\n\t\tINSTALL_DATA=\"cp -d\" \\\n\t\tINSTALL_TOP=\"$TERMUX_PREFIX\" \\\n\t\tINSTALL_INC=\"$TERMUX_PREFIX/include/lua5.2\" \\\n\t\tINSTALL_MAN=\"$TERMUX_PREFIX/share/man/man1\" \\\n\t\tinstall\n\tinstall -Dm600 lua.pc \"$TERMUX_PREFIX\"/lib/pkgconfig/lua52.pc\n\n\tmv -f \"$TERMUX_PREFIX\"/share/man/man1/lua.1 \"$TERMUX_PREFIX\"/share/man/man1/lua5.2.1\n\tmv -f \"$TERMUX_PREFIX\"/share/man/man1/luac.1 \"$TERMUX_PREFIX\"/share/man/man1/luac5.2.1\n}\n"
  },
  {
    "path": "packages/liblua52/lua-5.2.4_Makefile.patch",
    "content": "diff -uNr lua-5.2.4/Makefile lua-5.2.4.mod/Makefile\n--- lua-5.2.4/Makefile\t2015-02-24 03:28:54.000000000 +0200\n+++ lua-5.2.4.mod/Makefile\t2018-06-26 16:12:33.817832374 +0300\n@@ -10,7 +10,7 @@\n # so take care if INSTALL_TOP is not an absolute path. See the local target.\n # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with\n # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.\n-INSTALL_TOP= /usr/local\n+INSTALL_TOP= @TERMUX_PREFIX@\n INSTALL_BIN= $(INSTALL_TOP)/bin\n INSTALL_INC= $(INSTALL_TOP)/include\n INSTALL_LIB= $(INSTALL_TOP)/lib\n@@ -52,7 +52,7 @@\n all:\t$(PLAT)\n \n $(PLATS) clean:\n-\tcd src && $(MAKE) $@\n+\tcd src && $(MAKE) $@ V=$(V) R=$(R)\n \n test:\tdummy\n \tsrc/lua -v\n"
  },
  {
    "path": "packages/liblua52/lua-5.2.4_src_Makefile.patch",
    "content": "diff -uNr lua-5.2.4/src/Makefile lua-5.2.4.mod/src/Makefile\n--- lua-5.2.4/src/Makefile\t2013-11-11 13:45:49.000000000 +0200\n+++ lua-5.2.4.mod/src/Makefile\t2018-06-26 16:14:09.981170535 +0300\n@@ -28,7 +28,8 @@\n \n PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris\n \n-LUA_A=\tliblua.a\n+LUA_A=\tliblua5.2.a\n+LUA_SO= liblua5.2.so\n CORE_O=\tlapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \\\n \tlmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \\\n \tltm.o lundump.o lvm.o lzio.o\n@@ -36,14 +37,14 @@\n \tlmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o\n BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)\n \n-LUA_T=\tlua\n+LUA_T=\tlua5.2\n LUA_O=\tlua.o\n \n-LUAC_T=\tluac\n+LUAC_T=\tluac5.2\n LUAC_O=\tluac.o\n \n ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)\n-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)\n+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)\n ALL_A= $(LUA_A)\n \n # Targets start here.\n@@ -59,6 +60,12 @@\n \t$(AR) $@ $(BASE_O)\n \t$(RANLIB) $@\n \n+$(LUA_SO): $(CORE_O) $(LIB_O)\n+\t$(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)\n+\tln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)\n+\tln -sf $(LUA_SO).$(R) $(LUA_SO)\n+\n+\n $(LUA_T): $(LUA_O) $(LUA_A)\n \t$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)\n \n"
  },
  {
    "path": "packages/liblua52/lua-5.2.4_src_loslib.c.patch",
    "content": "diff -uNr lua-5.2.4/src/loslib.c lua-5.2.4.mod/src/loslib.c\n--- lua-5.2.4/src/loslib.c\t2013-04-12 21:48:47.000000000 +0300\n+++ lua-5.2.4.mod/src/loslib.c\t2018-06-26 16:13:07.191167382 +0300\n@@ -44,9 +44,9 @@\n */\n #if defined(LUA_USE_MKSTEMP)\n #include <unistd.h>\n-#define LUA_TMPNAMBUFSIZE\t32\n+#define LUA_TMPNAMBUFSIZE\t256\n #define lua_tmpnam(b,e) { \\\n-        strcpy(b, \"/tmp/lua_XXXXXX\"); \\\n+        strcpy(b, \"@TERMUX_PREFIX@/tmp/lua_XXXXXX\"); \\\n         e = mkstemp(b); \\\n         if (e != -1) close(e); \\\n         e = (e == -1); }\n"
  },
  {
    "path": "packages/liblua52/lua-5.2.4_src_luaconf.h.patch",
    "content": "diff -uNr lua-5.2.4/src/luaconf.h lua-5.2.4.mod/src/luaconf.h\n--- lua-5.2.4/src/luaconf.h\t2013-11-21 19:26:16.000000000 +0200\n+++ lua-5.2.4.mod/src/luaconf.h\t2018-06-26 16:12:33.824499040 +0300\n@@ -100,7 +100,7 @@\n #else\t\t\t/* }{ */\n \n #define LUA_VDIR\tLUA_VERSION_MAJOR \".\" LUA_VERSION_MINOR \"/\"\n-#define LUA_ROOT\t\"/usr/local/\"\n+#define LUA_ROOT\t\"@TERMUX_PREFIX@/\"\n #define LUA_LDIR\tLUA_ROOT \"share/lua/\" LUA_VDIR\n #define LUA_CDIR\tLUA_ROOT \"lib/lua/\" LUA_VDIR\n #define LUA_PATH_DEFAULT  \\\n"
  },
  {
    "path": "packages/liblua52/lua.pc.in",
    "content": "V=%VER%\nR=%REL%\n\nprefix=@TERMUX_PREFIX@\nINSTALL_BIN=${prefix}/bin\nINSTALL_INC=${prefix}/include/lua5.2\nINSTALL_LIB=${prefix}/lib\nINSTALL_MAN=${prefix}/man/man1\nINSTALL_LMOD=${prefix}/share/lua/${V}\nINSTALL_CMOD=${prefix}/lib/lua/${V}\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include/lua5.2\n\nName: Lua\nDescription: An Extensible Extension Language\nVersion: ${R}\nRequires: \nLibs: -L${libdir} -llua5.2 -lm\nCflags: -I${includedir}\n"
  },
  {
    "path": "packages/liblua52/lua52.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Simple, extensible, embeddable programming language\"\nTERMUX_SUBPKG_DEPENDS=\"readline\"\nTERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\n"
  },
  {
    "path": "packages/libluajit/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://luajit.org/\nTERMUX_PKG_DESCRIPTION=\"Just-In-Time Compiler for Lua\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com\"\nTERMUX_PKG_VERSION=2.1.0~beta3\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/LuaJIT/LuaJIT/archive/v2.1.0-beta3.tar.gz\nTERMUX_PKG_SHA256=409f7fe570d3c16558e594421c47bdd130238323c9d6fd6c83dedd2aaeb082a8\nTERMUX_PKG_BREAKS=\"libluajit-dev\"\nTERMUX_PKG_REPLACES=\"libluajit-dev\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"amalg PREFIX=$TERMUX_PREFIX\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t# luajit wants same pointer size for host and target build\n\texport HOST_CC=\"gcc\"\n\tif [ $TERMUX_ARCH_BITS = \"32\" ]; then\n\t\tif [ $(uname) = \"Linux\" ]; then\n\t\t\t# NOTE: \"apt install libc6-dev-i386\" for 32-bit headers\n\t\t\texport HOST_CFLAGS=\"-m32\"\n\t\t\texport HOST_LDFLAGS=\"-m32\"\n\t\telif [ $(uname) = \"Darwin\" ]; then\n\t\t\texport HOST_CFLAGS=\"-m32 -arch i386\"\n\t\t\texport HOST_LDFLAGS=\"-arch i386\"\n\t\tfi\n\tfi\n\texport TARGET_FLAGS=\"$CFLAGS $CPPFLAGS $LDFLAGS\"\n\texport TARGET_SYS=Linux\n\tunset CFLAGS LDFLAGS\n}\n\ntermux_step_make_install () {\n\tmkdir -p $TERMUX_PREFIX/include/luajit-2.0/\n\tcp -f $TERMUX_PKG_SRCDIR/src/{lauxlib.h,lua.h,lua.hpp,luaconf.h,luajit.h,lualib.h} $TERMUX_PREFIX/include/luajit-2.0/\n\trm -f $TERMUX_PREFIX/lib/libluajit*\n\n\tinstall -Dm600 $TERMUX_PKG_SRCDIR/src/libluajit.so $TERMUX_PREFIX/lib/libluajit-5.1.so\n\t(cd $TERMUX_PREFIX/lib; ln -s -f libluajit-5.1.so libluajit.so)\n\n\tinstall -Dm600 $TERMUX_PKG_SRCDIR/etc/luajit.1 $TERMUX_PREFIX/share/man/man1/luajit.1\n\tinstall -Dm600 $TERMUX_PKG_SRCDIR/etc/luajit.pc $TERMUX_PREFIX/lib/pkgconfig/luajit.pc\n\tinstall -Dm700 $TERMUX_PKG_SRCDIR/src/luajit $TERMUX_PREFIX/bin/luajit\n\n\t# Files needed for the -b option (http://luajit.org/running.html) to work.\n\t# Note that they end up in the 'luajit' subpackage, not the 'libluajit' one.\n\tTERMUX_LUAJIT_JIT_FOLDER_RELATIVE=share/luajit-$TERMUX_PKG_VERSION/jit\n\tlocal TERMUX_LUAJIT_JIT_FOLDER=$TERMUX_PREFIX/$TERMUX_LUAJIT_JIT_FOLDER_RELATIVE\n\trm -Rf $TERMUX_LUAJIT_JIT_FOLDER\n\tmkdir -p $TERMUX_LUAJIT_JIT_FOLDER\n\tcp $TERMUX_PKG_SRCDIR/src/jit/*lua $TERMUX_LUAJIT_JIT_FOLDER\n}\n"
  },
  {
    "path": "packages/libluajit/etc-luajit.pc.patch",
    "content": "diff -uNr LuaJIT-2.1.0-beta3/etc/luajit.pc LuaJIT-2.1.0-beta3.mod/etc/luajit.pc\n--- LuaJIT-2.1.0-beta3/etc/luajit.pc\t2017-05-01 22:03:01.000000000 +0300\n+++ LuaJIT-2.1.0-beta3.mod/etc/luajit.pc\t2019-07-01 17:40:16.877257398 +0300\n@@ -5,7 +5,7 @@\n version=${majver}.${minver}.${relver}-beta3\n abiver=5.1\n \n-prefix=/usr/local\n+prefix=@TERMUX_PREFIX@\n multilib=lib\n exec_prefix=${prefix}\n libdir=${exec_prefix}/${multilib}\n"
  },
  {
    "path": "packages/libluajit/luajit.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/luajit share/man/man1 $TERMUX_LUAJIT_JIT_FOLDER_RELATIVE\"\nTERMUX_SUBPKG_DESCRIPTION=\"Just-In-Time compiler for Lua - command line tool\"\n"
  },
  {
    "path": "packages/libluajit/src-Makefile.patch",
    "content": "diff -uNr LuaJIT-2.1.0-beta3/src/Makefile LuaJIT-2.1.0-beta3.mod/src/Makefile\n--- LuaJIT-2.1.0-beta3/src/Makefile\t2017-05-01 22:03:01.000000000 +0300\n+++ LuaJIT-2.1.0-beta3.mod/src/Makefile\t2019-07-01 21:33:38.426284669 +0300\n@@ -27,7 +27,7 @@\n DEFAULT_CC = gcc\n #\n # LuaJIT builds as a native 32 or 64 bit binary by default.\n-CC= $(DEFAULT_CC)\n+CC?= $(DEFAULT_CC)\n #\n # Use this if you want to force a 32 bit build on a 64 bit multilib OS.\n #CC= $(DEFAULT_CC) -m32\n@@ -71,14 +71,14 @@\n # as dynamic mode.\n #\n # Mixed mode creates a static + dynamic library and a statically linked luajit.\n-BUILDMODE= mixed\n+#BUILDMODE= mixed\n #\n # Static mode creates a static library and a statically linked luajit.\n #BUILDMODE= static\n #\n # Dynamic mode creates a dynamic library and a dynamically linked luajit.\n # Note: this executable will only run when the library is installed!\n-#BUILDMODE= dynamic\n+BUILDMODE= dynamic\n #\n ##############################################################################\n \n@@ -190,7 +190,7 @@\n CCOPTIONS= $(CCDEBUG) $(ASOPTIONS)\n LDOPTIONS= $(CCDEBUG) $(LDFLAGS)\n \n-HOST_CC= $(CC)\n+HOST_CC?= $(CC)\n HOST_RM= rm -f\n # If left blank, minilua is built and used. You can supply an installed\n # copy of (plain) Lua 5.1 or 5.2, plus Lua BitOp. E.g. with: HOST_LUA=lua\n@@ -203,17 +203,17 @@\n HOST_ALDFLAGS= $(LDOPTIONS) $(HOST_XLDFLAGS) $(HOST_LDFLAGS)\n HOST_ALIBS= $(HOST_XLIBS) $(LIBS) $(HOST_LIBS)\n \n-STATIC_CC = $(CROSS)$(CC)\n-DYNAMIC_CC = $(CROSS)$(CC) -fPIC\n+STATIC_CC = $(CC)\n+DYNAMIC_CC = $(CC) -fPIC\n TARGET_CC= $(STATIC_CC)\n TARGET_STCC= $(STATIC_CC)\n TARGET_DYNCC= $(DYNAMIC_CC)\n-TARGET_LD= $(CROSS)$(CC)\n-TARGET_AR= $(CROSS)ar rcus 2>/dev/null\n-TARGET_STRIP= $(CROSS)strip\n+TARGET_LD= $(CC)\n+TARGET_AR= $(AR) rcus 2>/dev/null\n+TARGET_STRIP= $(STRIP)\n \n TARGET_LIBPATH= $(or $(PREFIX),/usr/local)/$(or $(MULTILIB),lib)\n-TARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER)\n+TARGET_SONAME= libluajit-$(ABIVER).so\n TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib\n TARGET_DYLIBPATH= $(TARGET_LIBPATH)/$(TARGET_DYLIBNAME)\n TARGET_DLLNAME= lua$(NODOTABIVER).dll\n@@ -585,7 +585,7 @@\n endif\n endif\n \n-Q= @\n+Q=\n E= @echo\n #Q=\n #E= @:\n"
  },
  {
    "path": "packages/liblz4/Makefile.inc.patch",
    "content": "diff -uNr lz4-1.9.2/Makefile.inc lz4-1.9.2.mod/Makefile.inc\n--- lz4-1.9.2/Makefile.inc\t2019-08-15 14:59:59.000000000 +0300\n+++ lz4-1.9.2.mod/Makefile.inc\t2019-09-09 03:40:49.761918035 +0300\n@@ -70,7 +70,7 @@\n LN_S  = cp -p\n LN_SF = cp -p\n     else\n-LN_S   = ln -s\n+LN_S   = ln -sf\n LN_SF  = ln -sf\n     endif\n   endif\n"
  },
  {
    "path": "packages/liblz4/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://lz4.github.io/lz4/\nTERMUX_PKG_DESCRIPTION=\"Fast LZ compression algorithm library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.9.2\nTERMUX_PKG_SRCURL=https://github.com/lz4/lz4/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc\nTERMUX_PKG_BREAKS=\"liblz4-dev\"\nTERMUX_PKG_REPLACES=\"liblz4-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_SRCDIR+=lib\n}\n\n# Do not execute this step since on `make install` it will\n# recompile libraries & tools again.\ntermux_step_make() {\n\t:\n}\n"
  },
  {
    "path": "packages/liblz4/lz4.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Fast LZ compression algorithm tool\"\n"
  },
  {
    "path": "packages/liblzma/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://tukaani.org/xz/\nTERMUX_PKG_DESCRIPTION=\"XZ-format compression library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=5.2.4\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/xz-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=9717ae363760dedf573dad241420c5fea86256b65bc21d2cf71b2b12f0544f4b\nTERMUX_PKG_BREAKS=\"liblzma-dev\"\nTERMUX_PKG_REPLACES=\"liblzma-dev\"\nTERMUX_PKG_ESSENTIAL=true\n"
  },
  {
    "path": "packages/liblzma/configure.patch",
    "content": "diff -uNr xz-5.2.4/configure xz-5.2.4.mod/configure\n--- xz-5.2.4/configure\t2018-04-29 19:01:24.000000000 +0300\n+++ xz-5.2.4.mod/configure\t2019-05-03 15:50:52.793155366 +0300\n@@ -14026,26 +14026,6 @@\n   dynamic_linker=no\n   ;;\n \n-linux*android*)\n-  version_type=none # Android doesn't support versioned libraries.\n-  need_lib_prefix=no\n-  need_version=no\n-  library_names_spec='$libname$release$shared_ext'\n-  soname_spec='$libname$release$shared_ext'\n-  finish_cmds=\n-  shlibpath_var=LD_LIBRARY_PATH\n-  shlibpath_overrides_runpath=yes\n-\n-  # This implies no fast_install, which is unacceptable.\n-  # Some rework will be needed to allow for fast_install\n-  # before this can be enabled.\n-  hardcode_into_libs=yes\n-\n-  dynamic_linker='Android linker'\n-  # Don't embed -rpath directories since the linker doesn't support them.\n-  hardcode_libdir_flag_spec='-L$libdir'\n-  ;;\n-\n # This must be glibc/ELF.\n linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)\n   version_type=linux # correct to gnu/linux during the next big refactor\n@@ -14053,7 +14033,7 @@\n   need_version=no\n   library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'\n   soname_spec='$libname$release$shared_ext$major'\n-  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n+  finish_cmds=\n   shlibpath_var=LD_LIBRARY_PATH\n   shlibpath_overrides_runpath=no\n \n"
  },
  {
    "path": "packages/liblzma/xz-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"XZ-format compression tools\"\nTERMUX_SUBPKG_ESSENTIAL=true\n"
  },
  {
    "path": "packages/liblzo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.oberhumer.com/opensource/lzo\nTERMUX_PKG_DESCRIPTION=\"Portable lossless data compression library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.10\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/lzo-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_SHA256=37ed4369e45944c53306b0d6a36b66f03e5b6aede8849c9b6388f4b62b20b443\nTERMUX_PKG_BREAKS=\"liblzo-dev\"\nTERMUX_PKG_REPLACES=\"liblzo-dev\"\n"
  },
  {
    "path": "packages/libmaa/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://sourceforge.net/projects/dict/\nTERMUX_PKG_DESCRIPTION=\"Provides many low-level data structures which are helpful for writing compilers\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.3.2\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/dict/libmaa/libmaa-${TERMUX_PKG_VERSION}/libmaa-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=59a5a01e3a9036bd32160ec535d25b72e579824e391fea7079e9c40b0623b1c5\n\ntermux_step_pre_configure() {\n    autoreconf -ivf\n    LDFLAGS+=\" -llog\"\n}\n"
  },
  {
    "path": "packages/libmaa/libmaa.patch",
    "content": "diff -u -r ../libmaa-1.3.2.orig/Makefile.in ./Makefile.in\n--- ../libmaa-1.3.2.orig/Makefile.in\t2011-04-11 00:06:20.000000000 +0900\n+++ ./Makefile.in\t2018-02-10 00:15:25.508838999 +0900\n@@ -27,6 +27,7 @@\n .SUFFIXES:\n .SUFFIXES: .c .o\n \n+top_builddir=\t@top_builddir@\n srcdir=\t\t@srcdir@\n VPATH=\t\t@srcdir@\n prefix=\t\t@prefix@\n@@ -37,6 +38,7 @@\n \n CC=\t\t@CC@\n CPP=\t\t@CPP@\n+LD=\t\t@LD@\n LIBTOOL=\t@LIBTOOL@\n INSTALL=        @INSTALL@\n INSTALL_PROGRAM=@INSTALL_PROGRAM@\n@@ -136,9 +138,9 @@\n \t$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS)\n \n $(MAALIB): $(LIBOBJS)\n-\t$(LIBTOOL) --tag=CC --mode=link ${CC} -o libmaa.la ${LIBOBJS:.o=.lo} \\\n+\t$(LIBTOOL) --tag=CC --mode=link $(CC) -o libmaa.la $(LIBOBJS:.o=.lo) \\\n \t   $(LDFLAGS) $(LIBS) \\\n-\t   -rpath \"${libdir}\" -export-symbols ${srcdir}/export.sym \\\n+\t   -rpath $(libdir) -export-symbols $(srcdir)/export.sym \\\n \t   -version-info 3:0\n \n $(LIBOBJS): $(HEADERS) # version.stamp # don't automatically bump version\ndiff -u -r ../libmaa-1.3.2.orig/configure.in ./configure.in\n--- ../libmaa-1.3.2.orig/configure.in\t2012-07-22 23:47:18.000000000 +0900\n+++ ./configure.in\t2018-02-10 00:15:25.508838999 +0900\n@@ -38,7 +38,7 @@\n AC_CANONICAL_HOST\n AC_PROG_AWK\n AC_PROG_CC\n-#AC_PROG_LIBTOOL\n+AC_PROG_LIBTOOL\n AC_ISC_POSIX\n \n if test \"$CC\" = gcc; then\n"
  },
  {
    "path": "packages/libmad/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.underbit.com/products/mad/\nTERMUX_PKG_DESCRIPTION=\"MAD is a high-quality MPEG audio decoder\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.15.1b\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=ftp://ftp.mars.org/pub/mpeg/libmad-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690\nTERMUX_PKG_BREAKS=\"libmad-dev\"\nTERMUX_PKG_REPLACES=\"libmad-dev\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = arm ]; then\n\t\t# See https://www.mars.org/pipermail/mad-dev/2013-July/001433.html\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --enable-fpm=default\"\n\tfi\n}\n\ntermux_post_configure() {\n\tcd $TERMUX_PKG_SRCDIR\n\tsed -i -e 's/-force-mem//g' Makefile\n}\n"
  },
  {
    "path": "packages/libmaxminddb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://dev.maxmind.com/geoip/geoip2/\nTERMUX_PKG_DESCRIPTION=\"MaxMind GeoIP2 database - library and utilities\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.4.2\nTERMUX_PKG_SRCURL=https://github.com/maxmind/libmaxminddb/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=22e15ee6cac6da28e8845e4429e2de0037b177aa6d192780aabc1e76bc9a00b0\nTERMUX_PKG_BREAKS=\"libmaxminddb-dev\"\nTERMUX_PKG_REPLACES=\"libmaxminddb-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-tests\"\n\ntermux_step_pre_configure() {\n\t./bootstrap\n}\n"
  },
  {
    "path": "packages/libmaxminddb/libmaxminddb-tools.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"A geoip lookup utility for MaxMind DB\"\nTERMUX_SUBPKG_DEPENDS=\"geoip2-database\"\n\nTERMUX_SUBPKG_INCLUDE=\"\nbin/mmdblookup\nshare/man/man1/mmdblookup.1\"\n"
  },
  {
    "path": "packages/libmcrypt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://mcrypt.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"A library which provides a uniform interface to several symmetric encryption algorithms\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.5.8\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/mcrypt/libmcrypt-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=bf2f1671f44af88e66477db0982d5ecb5116a5c767b0a0d68acb34499d41b793\nTERMUX_PKG_BREAKS=\"libmcrypt-dev\"\nTERMUX_PKG_REPLACES=\"libmcrypt-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=$TERMUX_PREFIX/share/man\"\n"
  },
  {
    "path": "packages/libmesode/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/boothj5/libmesode\nTERMUX_PKG_DESCRIPTION=\"Minimal XMPP library written for use with Profanity XMPP client\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.9.3\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_SRCURL=https://github.com/boothj5/libmesode/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=746e0646a9176a303a07ec8ed7c443a38416acc743ed19eeddf6a89d97209ffd\nTERMUX_PKG_DEPENDS=\"openssl,libexpat\"\nTERMUX_PKG_BREAKS=\"libmesode-dev\"\nTERMUX_PKG_REPLACES=\"libmesode-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n./bootstrap.sh\n}\n"
  },
  {
    "path": "packages/libmhash/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://mhash.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"A thread-safe hash library which provides a uniform interface to hash algorithms\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.9.9.9\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/sourceforge/mhash/mhash-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=56521c52a9033779154432d0ae47ad7198914785265e1f570cee21ab248dfef0\nTERMUX_PKG_BREAKS=\"libmhash-dev\"\nTERMUX_PKG_REPLACES=\"libmhash-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/libmicrohttpd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.gnu.org/software/libmicrohttpd/\nTERMUX_PKG_DESCRIPTION=\"A small C library that is supposed to make it easy to run an HTTP server as part of another application\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.9.68\nTERMUX_PKG_SRCURL=https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=c5716e2a2899abc9e16c8fa7a1a58da88f81aca96a0b7e68a5d4d89e21610b61\nTERMUX_PKG_DEPENDS=\"libgnutls\"\nTERMUX_PKG_BREAKS=\"libmicrohttpd-dev\"\nTERMUX_PKG_REPLACES=\"libmicrohttpd-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-examples\n--enable-curl\n--enable-https\n--enable-largefile\n--enable-messages\"\n"
  },
  {
    "path": "packages/libmnl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.netfilter.org/projects/libmnl/\nTERMUX_PKG_DESCRIPTION=\"a minimalistic user-space library oriented to Netlink developers\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_VERSION=1.0.4\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://netfilter.org/projects/libmnl/files/libmnl-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81\nTERMUX_PKG_BREAKS=\"libmnl-dev\"\nTERMUX_PKG_REPLACES=\"libmnl-dev\"\n"
  },
  {
    "path": "packages/libmosquitto/CMakeLists.txt.patch",
    "content": "diff -u -r ../mosquitto-1.5.1/src/CMakeLists.txt ./src/CMakeLists.txt\n--- ../mosquitto-1.5.1/src/CMakeLists.txt\t2018-08-16 16:05:26.000000000 +0000\n+++ ./src/CMakeLists.txt\t2018-08-19 15:42:58.946457265 +0000\n@@ -160,7 +160,7 @@\n endif(NOT APPLE)\n \n add_executable(mosquitto ${MOSQ_SRCS})\n-target_link_libraries(mosquitto ${MOSQ_LIBS})\n+target_link_libraries(mosquitto ${MOSQ_LIBS} log)\n \n if (UNIX)\n \tif (APPLE)\n"
  },
  {
    "path": "packages/libmosquitto/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://mosquitto.org/\nTERMUX_PKG_DESCRIPTION=\"MQTT library\"\nTERMUX_PKG_LICENSE=\"EPL-1.0\"\nTERMUX_PKG_MAINTAINER=\"Nathaniel Wesley Filardo @nwf\"\nTERMUX_PKG_VERSION=1.6.8\nTERMUX_PKG_SRCURL=https://mosquitto.org/files/source/mosquitto-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=7df23c81ca37f0e070574fe74414403cf25183016433d07add6134366fb45df6\nTERMUX_PKG_DEPENDS=\"c-ares, libc++, libwebsockets, openssl\"\nTERMUX_PKG_BREAKS=\"libmosquitto-dev\"\nTERMUX_PKG_REPLACES=\"libmosquitto-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DWITH_THREADING=OFF\n-DWITH_TLS_PSK=OFF\n-DWITH_WEBSOCKETS=ON\"\n"
  },
  {
    "path": "packages/libmosquitto/mosquitto.subpackage.sh",
    "content": "TERMUX_SUBPKG_DEPENDS=\"libuuid\"\nTERMUX_SUBPKG_INCLUDE=\"bin/ share/man/ etc/\"\nTERMUX_SUBPKG_DESCRIPTION=\"MQTT version 3.1/3.1.1 compatible message broker and clients\"\n"
  },
  {
    "path": "packages/libmp3lame/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://lame.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"High quality MPEG Audio Layer III (MP3) encoder\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=3.100\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e\nTERMUX_PKG_BREAKS=\"libmp3lame-dev\"\nTERMUX_PKG_REPLACES=\"libmp3lame-dev\"\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/lame/lame/${TERMUX_PKG_VERSION}/lame-${TERMUX_PKG_VERSION}.tar.gz\n"
  },
  {
    "path": "packages/libmp3lame/lame.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin share/doc/lame share/man\"\nTERMUX_SUBPKG_DESCRIPTION=\"High quality MPEG Audio Layer III (MP3) encoder - frontend\"\nTERMUX_SUBPKG_DEPENDS=ncurses\n"
  },
  {
    "path": "packages/libmp3splt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://mp3splt.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Utility to split MP3, Ogg Vorbis and native FLAC files without decoding\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.9.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://prdownloads.sourceforge.net/mp3splt/libmp3splt-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=30eed64fce58cb379b7cc6a0d8e545579cb99d0f0f31eb00b9acc8aaa1b035dc\nTERMUX_PKG_DEPENDS=\"libmad, libid3tag, libvorbis, libflac, pcre, libtool\"\nTERMUX_PKG_BREAKS=\"libmp3splt-dev\"\nTERMUX_PKG_REPLACES=\"libmp3splt-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-cutter\"\n"
  },
  {
    "path": "packages/libmpc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.multiprecision.org/\nTERMUX_PKG_DESCRIPTION=\"Library for the arithmetic of complex numbers with arbitrarily high precision\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_DEPENDS=\"libgmp, libmpfr\"\nTERMUX_PKG_BREAKS=\"libmpc-dev\"\nTERMUX_PKG_REPLACES=\"libmpc-dev\"\nTERMUX_PKG_VERSION=1.1.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/mpc/mpc-$TERMUX_PKG_VERSION.tar.gz\n"
  },
  {
    "path": "packages/libmpdclient/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.musicpd.org/libs/libmpdclient/\nTERMUX_PKG_DESCRIPTION=\"Asynchronous API library for interfacing MPD in the C, C++ & Objective C languages\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_MAINTAINER=\"Matthew Klein @mklein994\"\nTERMUX_PKG_VERSION=2.16\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=6651898489b69d2f2f8e94f0ed6ddcc0dd2cdbcf99b02131b790551922558d6c\nTERMUX_PKG_BREAKS=\"libmpdclient-dev\"\nTERMUX_PKG_REPLACES=\"libmpdclient-dev\"\nTERMUX_PKG_SRCURL=https://github.com/MusicPlayerDaemon/libmpdclient/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\" -D default_socket==${TERMUX_PREFIX}/var/run/mpd/socket\"\n"
  },
  {
    "path": "packages/libmpfr/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.mpfr.org/\nTERMUX_PKG_DESCRIPTION=\"C library for multiple-precision floating-point computations with correct rounding\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_DEPENDS=\"libgmp\"\nTERMUX_PKG_BREAKS=\"libmpfr-dev\"\nTERMUX_PKG_REPLACES=\"libmpfr-dev\"\nTERMUX_PKG_VERSION=4.0.2\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/mpfr/mpfr-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_header_locale_h=no\"\n"
  },
  {
    "path": "packages/libmsgpack/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/msgpack/msgpack-c/\nTERMUX_PKG_DESCRIPTION=\"MessagePack implementation for C and C++\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=3.2.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=fbaa28c363a316fd7523f31d1745cf03eab0d1e1ea5a1c60aa0dffd4ce551afe\nTERMUX_PKG_BREAKS=\"libmsgpack-dev\"\nTERMUX_PKG_REPLACES=\"libmsgpack-dev\"\nTERMUX_PKG_SRCURL=https://github.com/msgpack/msgpack-c/releases/download/cpp-${TERMUX_PKG_VERSION}/msgpack-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DMSGPACK_BUILD_EXAMPLES=OFF\n-DMSGPACK_BUILD_TESTS=OFF\n-DMSGPACK_ENABLE_CXX=OFF\n\"\n"
  },
  {
    "path": "packages/libnet/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/libnet-dev\nTERMUX_PKG_DESCRIPTION=\"A library which provides API for commonly used low-level net functions\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.1.6\nTERMUX_PKG_SRCURL=https://sourceforge.net/projects/libnet-dev/files/libnet-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=d392bb5825c4b6b672fc93a0268433c86dc964e1500c279dc6d0711ea6ec467a\n"
  },
  {
    "path": "packages/libnettle/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.lysator.liu.se/~nisse/nettle/\nTERMUX_PKG_DESCRIPTION=\"Cryptographic library that is designed to fit easily in more or less any context\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.5.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=75cca1998761b02e16f2db56da52992aef622bf55a3b45ec538bc2eedadc9419\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/nettle/nettle-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libgmp\"\nTERMUX_PKG_BREAKS=\"libnettle-dev\"\nTERMUX_PKG_REPLACES=\"libnettle-dev\"\n"
  },
  {
    "path": "packages/libnettle/configure.patch",
    "content": "diff -u -r ../nettle-3.3/configure ./configure\n--- ../nettle-3.3/configure\t2016-10-01 09:28:38.000000000 +0200\n+++ ./configure\t2017-07-07 08:35:12.539208424 +0200\n@@ -7091,6 +7091,7 @@\n   CFLAGS=\"$CFLAGS $CCPIC\"\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n /* end confdefs.h.  */\n+#include <stdlib.h>\n \n int\n main ()\n"
  },
  {
    "path": "packages/libnettle/nettle.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Low level cryptographic tools\"\n"
  },
  {
    "path": "packages/libnfs/add-timeh.patch",
    "content": "diff -uNr libnfs-libnfs-3.0.0/lib/libnfs.c libnfs-libnfs-3.0.0.mod/lib/libnfs.c\n--- libnfs-libnfs-3.0.0/lib/libnfs.c\t2018-06-24 01:53:52.000000000 +0300\n+++ libnfs-libnfs-3.0.0.mod/lib/libnfs.c\t2019-01-30 19:06:40.638282264 +0200\n@@ -66,6 +66,8 @@\n #include <sys/sysmacros.h>\n #endif\n \n+#include <time.h>\n+\n #include <errno.h>\n #include <stdarg.h>\n #include <stdlib.h>\n"
  },
  {
    "path": "packages/libnfs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/sahlberg/libnfs\nTERMUX_PKG_DESCRIPTION=\"NFS client library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=4.0.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/sahlberg/libnfs/archive/libnfs-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=6ee77e9fe220e2d3e3b1f53cfea04fb319828cc7dbb97dd9df09e46e901d797d\nTERMUX_PKG_BREAKS=\"libnfs-dev\"\nTERMUX_PKG_REPLACES=\"libnfs-dev\"\n\ntermux_step_pre_configure() {\n\tautoreconf -fi\n}\n"
  },
  {
    "path": "packages/libnftnl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.netfilter.org/projects/libnftnl/\nTERMUX_PKG_DESCRIPTION=\"Netfilter library providing interface to the nf_tables subsystem\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.1.4\nTERMUX_PKG_SRCURL=http://netfilter.org/projects/libnftnl/files/libnftnl-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=c8c7988347adf261efac5bba59f8e5f995ffb65f247a88cc144e69620573ed20\nTERMUX_PKG_DEPENDS=\"libmnl\"\nTERMUX_PKG_BREAKS=\"libnftnl-dev\"\nTERMUX_PKG_REPLACES=\"libnftnl-dev\"\n"
  },
  {
    "path": "packages/libnghttp2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://nghttp2.org/\nTERMUX_PKG_DESCRIPTION=\"nghttp HTTP 2.0 library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.40.0\nTERMUX_PKG_SRCURL=https://github.com/nghttp2/nghttp2/releases/download/v${TERMUX_PKG_VERSION}/nghttp2-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=09fc43d428ff237138733c737b29fb1a7e49d49de06d2edbed3bc4cdcee69073\nTERMUX_PKG_BREAKS=\"libnghttp2-dev\"\nTERMUX_PKG_REPLACES=\"libnghttp2-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-lib-only\"\n# The tools are not built due to --enable-lib-only:\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/man/man1 share/nghttp2/fetch-ocsp-response\"\n"
  },
  {
    "path": "packages/libnl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/thom311/libnl\nTERMUX_PKG_DESCRIPTION=\"Collection of libraries providing APIs to netlink protocol based Linux kernel interfaces\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.5.0\nTERMUX_PKG_SRCURL=https://github.com/thom311/libnl/releases/download/libnl${TERMUX_PKG_VERSION//./_}/libnl-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=352133ec9545da76f77e70ccb48c9d7e5324d67f6474744647a7ed382b5e05fa\nTERMUX_PKG_BREAKS=\"libnl-dev\"\nTERMUX_PKG_REPLACES=\"libnl-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-pthreads --disable-cli\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -Dsockaddr_storage=__kernel_sockaddr_storage\"\n}\n"
  },
  {
    "path": "packages/libnl/include-netlink-private-netlink.h.patch",
    "content": "--- ./include/netlink-private/netlink.h\t2018-05-10 17:48:07.762060270 +0530\n+++ ./include/netlink-private/netlink.h\t2018-05-10 17:48:57.891691514 +0530\n@@ -29,6 +29,7 @@\n #include <limits.h>\n #include <search.h>\n \n+typedef uint32_t in_addr_t;\n #include <arpa/inet.h>\n #include <netdb.h>\n \n"
  },
  {
    "path": "packages/libnl/nf-log.c.patch",
    "content": "--- ../../build/libnl3/cache/libnl-3.2.25/src/nf-log.c\t2014-06-16 16:45:51.000000000 +0200\n+++ ./src/nf-log.c\t2017-02-09 00:08:20.671339521 +0100\n@@ -11,6 +11,7 @@\n  * Copyright (c) 2007 Secure Computing Corporation\n  */\n \n+#include <sys/select.h>\n #include <netlink/cli/utils.h>\n #include <netlink/cli/link.h>\n #include <linux/netfilter/nfnetlink_log.h>\n"
  },
  {
    "path": "packages/libnl/nf-monitor.c.patch",
    "content": "--- ../../build/libnl3/cache/libnl-3.2.25/src/nf-monitor.c\t2014-06-16 16:45:51.000000000 +0200\n+++ ./src/nf-monitor.c\t2017-02-09 00:09:08.904697365 +0100\n@@ -11,6 +11,7 @@\n  * Copyright (c) 2007 Secure Computing Corporation\n  */\n \n+#include <sys/select.h>\n #include <netlink/cli/utils.h>\n #include <netlink/netfilter/nfnl.h>\n \n"
  },
  {
    "path": "packages/libnl/nf-queue.c.patch",
    "content": "--- ../../build/libnl3/cache/libnl-3.2.25/src/nf-queue.c\t2014-06-16 16:45:51.000000000 +0200\n+++ ./src/nf-queue.c\t2017-02-09 00:08:34.248440250 +0100\n@@ -10,7 +10,7 @@\n  * Copyright (c) 2010  Karl Hiramoto <karl@hiramoto.org>\n  */\n \n-\n+#include <sys/select.h>\n #include <netlink/cli/utils.h>\n #include <netlink/cli/link.h>\n #include <netinet/in.h>\n"
  },
  {
    "path": "packages/libnl/nl-monitor.c.patch",
    "content": "--- ../../build/libnl3/cache/libnl-3.2.25/src/nl-monitor.c\t2014-06-16 16:45:51.000000000 +0200\n+++ ./src/nl-monitor.c\t2017-02-09 00:08:20.660339439 +0100\n@@ -9,6 +9,7 @@\n  * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch>\n  */\n \n+#include <sys/select.h>\n #include <netlink/cli/utils.h>\n #include <netlink/cli/link.h>\n \n"
  },
  {
    "path": "packages/libnpth/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/npth/\nTERMUX_PKG_DESCRIPTION=\"New GNU Portable Threads Library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.6\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=1393abd9adcf0762d34798dc34fdcf4d0d22a8410721e76f1e3afcd1daa4e2d1\nTERMUX_PKG_BREAKS=\"libnpth-dev\"\nTERMUX_PKG_REPLACES=\"libnpth-dev\"\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/npth/npth-${TERMUX_PKG_VERSION}.tar.bz2\n"
  },
  {
    "path": "packages/libogg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xiph.org/ogg/\nTERMUX_PKG_DESCRIPTION=\"Library for working with the Ogg multimedia container format\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.3.4\nTERMUX_PKG_SRCURL=https://downloads.xiph.org/releases/ogg/libogg-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e\nTERMUX_PKG_BREAKS=\"libogg-dev\"\nTERMUX_PKG_REPLACES=\"libogg-dev\"\n"
  },
  {
    "path": "packages/liboggz/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.xiph.org/oggz/\nTERMUX_PKG_DESCRIPTION=\"Command and library to inspect, tweak, edit and validate Ogg files\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.1.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/liboggz/liboggz-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=6bafadb1e0a9ae4ac83304f38621a5621b8e8e32927889e65a98706d213d415a\nTERMUX_PKG_DEPENDS=\"libogg\"\nTERMUX_PKG_BREAKS=\"liboggz-dev\"\nTERMUX_PKG_REPLACES=\"liboggz-dev\"\n"
  },
  {
    "path": "packages/libopus/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.opus-codec.org/\nTERMUX_PKG_DESCRIPTION=\"Reference implementation of the Opus codec\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.3.1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://archive.mozilla.org/pub/opus/opus-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d\nTERMUX_PKG_BREAKS=\"libopus-dev\"\nTERMUX_PKG_REPLACES=\"libopus-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-extra-programs\"\n"
  },
  {
    "path": "packages/libopusenc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/xiph/libopusenc\nTERMUX_PKG_DESCRIPTION=\"High-level API for encoding .opus files\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.2.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=8298db61a8d3d63e41c1a80705baa8ce9ff3f50452ea7ec1c19a564fe106cbb9\nTERMUX_PKG_SRCURL=https://archive.mozilla.org/pub/opus/libopusenc-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libopus\"\nTERMUX_PKG_BREAKS=\"libopusenc-dev\"\nTERMUX_PKG_REPLACES=\"libopusenc-dev\"\n"
  },
  {
    "path": "packages/libotr/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://otr.cypherpunks.ca\nTERMUX_PKG_DESCRIPTION=\"Off-the-Record (OTR) Messaging allows you to have private conversations over instant messaging by providing: Encryption, Authentication, Deniability, Perfect forward secrecy\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=4.1.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_SRCURL=https://otr.cypherpunks.ca/libotr-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=8b3b182424251067a952fb4e6c7b95a21e644fbb27fbd5f8af2b2ed87ca419f5\nTERMUX_PKG_DEPENDS=\"libgcrypt\"\nTERMUX_PKG_BREAKS=\"libotr-dev\"\nTERMUX_PKG_REPLACES=\"libotr-dev\"\nTERMUX_PKG_BUILD_DEPENDS=\"libgpg-error\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/libotr/configure.patch",
    "content": "diff --git a/configure b/configure\nindex e5b064c..cd3fa35 100755\n--- a/configure\n+++ b/configure\n@@ -11647,13 +11647,8 @@ case $host_os in\n esac\n \n # Build tests for now only for Linux.\n- if test x$HOST_OS = xlinux; then\n-  BUILD_TESTS_TRUE=\n-  BUILD_TESTS_FALSE='#'\n-else\n   BUILD_TESTS_TRUE='#'\n   BUILD_TESTS_FALSE=\n-fi\n \n \n \n"
  },
  {
    "path": "packages/libpcap/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tcpdump.org\nTERMUX_PKG_DESCRIPTION=\"Library for network traffic capture\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.9.1\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/libpcap-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=028c199f4b7334c128b92cb76e4652e5a0a644bac6c9b356c2e2275824994dde\nTERMUX_PKG_BREAKS=\"libpcap-dev\"\nTERMUX_PKG_REPLACES=\"libpcap-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-pcap=linux --without-libnl\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/pcap-config share/man/man1/pcap-config.1\"\n"
  },
  {
    "path": "packages/libpcap/fix-path-etc-ethers.patch",
    "content": "diff -uNr libpcap-1.8.1/pcap/namedb.h libpcap-1.8.1.mod/pcap/namedb.h\n--- libpcap-1.8.1/pcap/namedb.h\t2016-10-26 03:07:59.000000000 +0300\n+++ libpcap-1.8.1.mod/pcap/namedb.h\t2017-09-12 11:12:26.672992613 +0300\n@@ -53,7 +53,7 @@\n \tchar name[122];\n };\n #ifndef PCAP_ETHERS_FILE\n-#define PCAP_ETHERS_FILE \"/etc/ethers\"\n+#define PCAP_ETHERS_FILE \"@TERMUX_PREFIX@/etc/ethers\"\n #endif\n PCAP_API struct\tpcap_etherent *pcap_next_etherent(FILE *);\n PCAP_API u_char *pcap_ether_hostton(const char*);\n"
  },
  {
    "path": "packages/libpipeline/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://libpipeline.nongnu.org/\nTERMUX_PKG_DESCRIPTION=\"C library for manipulating pipelines of subprocesses in a flexible and convenient way\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.5.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=d633706b7d845f08b42bc66ddbe845d57e726bf89298e2cee29f09577e2f902f\nTERMUX_PKG_BREAKS=\"libpipeline-dev\"\nTERMUX_PKG_REPLACES=\"libpipeline-dev\"\nTERMUX_PKG_SRCURL=http://download.savannah.gnu.org/releases/libpipeline/libpipeline-${TERMUX_PKG_VERSION}.tar.gz\n"
  },
  {
    "path": "packages/libpixman/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.pixman.org/\nTERMUX_PKG_DESCRIPTION=\"Low-level library for pixel manipulation\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=0.38.4\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://cairographics.org/releases/pixman-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=da66d6fd6e40aee70f7bd02e4f8f76fc3f006ec879d346bae6a723025cfbdde7\nTERMUX_PKG_BREAKS=\"libpixman-dev\"\nTERMUX_PKG_REPLACES=\"libpixman-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-libpng\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = arm ]; then\n\t\tCFLAGS+=\" -fno-integrated-as\"\n\tfi\n}\n"
  },
  {
    "path": "packages/libpixman/pixman-arm.c.patch",
    "content": "diff -u -r ../pixman-0.32.6/pixman/pixman-arm.c ./pixman/pixman-arm.c\n--- ../pixman-0.32.6/pixman/pixman-arm.c\t2013-11-17 09:43:18.000000000 +0100\n+++ ./pixman/pixman-arm.c\t2014-08-05 12:54:39.252322492 +0200\n@@ -96,30 +96,10 @@\n \n #elif defined(__ANDROID__) || defined(ANDROID) /* Android */\n \n-#include <cpu-features.h>\n-\n static arm_cpu_features_t\n detect_cpu_features (void)\n {\n-    arm_cpu_features_t features = 0;\n-    AndroidCpuFamily cpu_family;\n-    uint64_t cpu_features;\n-\n-    cpu_family = android_getCpuFamily();\n-    cpu_features = android_getCpuFeatures();\n-\n-    if (cpu_family == ANDROID_CPU_FAMILY_ARM)\n-    {\n-\tif (cpu_features & ANDROID_CPU_ARM_FEATURE_ARMv7)\n-\t    features |= ARM_V7;\n-\n-\tif (cpu_features & ANDROID_CPU_ARM_FEATURE_VFPv3)\n-\t    features |= ARM_VFP;\n-\n-\tif (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON)\n-\t    features |= ARM_NEON;\n-    }\n-\n+    arm_cpu_features_t features = (ARM_V7 | ARM_VFP | ARM_NEON);\n     return features;\n }\n \n"
  },
  {
    "path": "packages/libpng/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.libpng.org/pub/png/libpng.html\nTERMUX_PKG_DESCRIPTION=\"Official PNG reference library\"\nTERMUX_PKG_LICENSE=\"Libpng\"\nTERMUX_PKG_VERSION=1.6.37\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/libpng-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_BREAKS=\"libpng-dev\"\nTERMUX_PKG_REPLACES=\"libpng-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/png-fix-itxt bin/pngfix\"\n"
  },
  {
    "path": "packages/libpopt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.linuxfromscratch.org/blfs/view/svn/general/popt.html\nTERMUX_PKG_DESCRIPTION=\"Library for parsing cmdline parameters\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.16\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/popt-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8\nTERMUX_PKG_DEPENDS=\"libandroid-glob\"\nTERMUX_PKG_BREAKS=\"libpopt-dev\"\nTERMUX_PKG_REPLACES=\"libpopt-dev\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n"
  },
  {
    "path": "packages/libpopt/fix-hardcoded-paths.patch",
    "content": "diff -uNr popt-1.16/poptconfig.c popt-1.16.mod/poptconfig.c\n--- popt-1.16/poptconfig.c\t2009-05-20 16:18:07.000000000 +0300\n+++ popt-1.16.mod/poptconfig.c\t2017-09-12 12:08:55.442990190 +0300\n@@ -499,7 +499,7 @@\n int poptReadDefaultConfig(poptContext con, /*@unused@*/ UNUSED(int useEnv))\n {\n     static const char _popt_sysconfdir[] = POPT_SYSCONFDIR \"/popt\";\n-    static const char _popt_etc[] = \"/etc/popt\";\n+    static const char _popt_etc[] = \"@TERMUX_PREFIX@/etc/popt\";\n     char * home;\n     struct stat sb;\n     int rc = 0;\t\t/* assume success */\n@@ -515,12 +515,12 @@\n     if (rc) goto exit;\n \n #if defined(HAVE_GLOB_H)\n-    if (!stat(\"/etc/popt.d\", &sb) && S_ISDIR(sb.st_mode)) {\n+    if (!stat(\"@TERMUX_PREFIX@/etc/popt.d\", &sb) && S_ISDIR(sb.st_mode)) {\n \tconst char ** av = NULL;\n \tint ac = 0;\n \tint i;\n \n-\tif ((rc = poptGlob(con, \"/etc/popt.d/*\", &ac, &av)) == 0) {\n+\tif ((rc = poptGlob(con, \"@TERMUX_PREFIX@/etc/popt.d/*\", &ac, &av)) == 0) {\n \t    for (i = 0; rc == 0 && i < ac; i++) {\n \t\tconst char * fn = av[i];\n \t\tif (fn == NULL || strstr(fn, \".rpmnew\") || strstr(fn, \".rpmsave\"))\n"
  },
  {
    "path": "packages/libprotobuf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/protobuf\nTERMUX_PKG_DESCRIPTION=\"Protocol buffers C++ library\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=3.11.1\nTERMUX_PKG_SRCURL=https://github.com/google/protobuf/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=4f8e805825c53bbc3c9f6b6abc009b5b5679e4702bccfca1121c42ff5ec801c7\nTERMUX_PKG_DEPENDS=\"libc++, zlib\"\nTERMUX_PKG_BREAKS=\"libprotobuf-dev\"\nTERMUX_PKG_REPLACES=\"libprotobuf-dev\"\nTERMUX_PKG_FORCE_CMAKE=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-Dprotobuf_BUILD_TESTS=OFF\n-DBUILD_SHARED_LIBS=ON\n\"\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_SRCDIR+=\"/cmake/\"\n}\n"
  },
  {
    "path": "packages/libprotobuf/protobuf.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ lib/libprotobuf-lite.so* lib/libprotoc.so*\"\nTERMUX_SUBPKG_DESCRIPTION=\"Compiler for protocol buffer definition files\"\n\n"
  },
  {
    "path": "packages/libprotobuf/remove-android-logging.patch",
    "content": "diff -u -r ../protobuf-3.2.0/src/google/protobuf/stubs/common.cc ./src/google/protobuf/stubs/common.cc\n--- ../protobuf-3.2.0/src/google/protobuf/stubs/common.cc\t2017-01-28 00:49:29.000000000 +0100\n+++ ./src/google/protobuf/stubs/common.cc\t2017-01-29 14:43:35.021889040 +0100\n@@ -116,7 +116,7 @@\n \n namespace internal {\n \n-#if defined(__ANDROID__)\n+#if defined(__ANDROID__) && 0\n inline void DefaultLogHandler(LogLevel level, const char* filename, int line,\n                               const string& message) {\n   if (level < GOOGLE_PROTOBUF_MIN_LOG_LEVEL) {\n"
  },
  {
    "path": "packages/libprotobuf-c/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/protobuf-c/protobuf-c\nTERMUX_PKG_DESCRIPTION=\"Protocol buffers C library\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=1.3.2\nTERMUX_PKG_SRCURL=https://github.com/protobuf-c/protobuf-c/releases/download/v${TERMUX_PKG_VERSION}/protobuf-c-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=53f251f14c597bdb087aecf0b63630f434d73f5a10fc1ac545073597535b9e74\nTERMUX_PKG_DEPENDS=\"libc++, libprotobuf, protobuf\"\nTERMUX_PKG_BREAKS=\"libprotobuf-c-dev\"\nTERMUX_PKG_REPLACES=\"libprotobuf-c-dev\"\n"
  },
  {
    "path": "packages/libpsl/build-fix.patch",
    "content": "From 9347024221f4a9d63f9dcafcda13362a7c8d92fe Mon Sep 17 00:00:00 2001\nFrom: Po-Chuan Hsieh <sunpoet@sunpoet.net>\nDate: Wed, 17 Apr 2019 13:25:48 +0000\nSubject: [PATCH] Fix build when configured with --with-psl-file\n\nThe error message is as follows:\nMaking all in tests\nmake: don't know how to make ../list/public_suffix_list.dat. Stop\n\nmake: stopped in /usr/ports/works/usr/ports/dns/libpsl/work/libpsl-libpsl-0.21.0/tests\n*** Error code 1\n\nStop.\n---\n tests/Makefile.am | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/tests/Makefile.am b/tests/Makefile.am\nindex 480b236..9c37ce3 100644\n--- a/tests/Makefile.am\n+++ b/tests/Makefile.am\n@@ -33,9 +33,9 @@ TESTS = $(PSL_TESTS)\n # dafsa.psl and dafsa_ascii.psl must be created before any test is executed\n # check-local target works in parallel to the tests, so the test suite will likely fail\n BUILT_SOURCES = psl.dafsa psl_ascii.dafsa\n-psl.dafsa: $(top_srcdir)/list/public_suffix_list.dat\n+psl.dafsa: $(PSL_FILE)\n \t$(top_srcdir)/src/psl-make-dafsa --output-format=binary \"$(PSL_FILE)\" psl.dafsa\n-psl_ascii.dafsa: $(top_srcdir)/list/public_suffix_list.dat\n+psl_ascii.dafsa: $(PSL_FILE)\n \t$(top_srcdir)/src/psl-make-dafsa --output-format=binary --encoding=ascii \"$(PSL_FILE)\" psl_ascii.dafsa\n \n clean-local:\n"
  },
  {
    "path": "packages/libpsl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/rockdaboot/libpsl\nTERMUX_PKG_DESCRIPTION=\"Public Suffix List library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.21.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/rockdaboot/libpsl/releases/download/libpsl-${TERMUX_PKG_VERSION}/libpsl-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=41bd1c75a375b85c337b59783f5deb93dbb443fb0a52d257f403df7bd653ee12\nTERMUX_PKG_DEPENDS=\"libidn2, libunistring\"\nTERMUX_PKG_BREAKS=\"libpsl-dev\"\nTERMUX_PKG_REPLACES=\"libpsl-dev\"\n\ntermux_step_pre_configure() {\n\tautoreconf -fiv\n}\n"
  },
  {
    "path": "packages/libqrencode/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://fukuchi.org/works/qrencode/\nTERMUX_PKG_DESCRIPTION=\"Libqrencode is a fast and compact library for encoding data in a QR Code symbol, a 2D symbology that can be scanned by handy terminals\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=4.0.2\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=43091fea4752101f0fe61a957310ead10a7cb4b81e170ce61e5baa73a6291ac2\nTERMUX_PKG_SRCURL=https://github.com/fukuchi/libqrencode/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libandroid-support, libpng, zlib\"\nTERMUX_PKG_BREAKS=\"libqrencode-dev\"\nTERMUX_PKG_REPLACES=\"libqrencode-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DBUILD_SHARED_LIBS=ON\"\n"
  },
  {
    "path": "packages/librsvg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/action/show/Projects/LibRsvg\nTERMUX_PKG_DESCRIPTION=\"Library to render SVG files using cairo\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=2.46.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://ftp.gnome.org/pub/GNOME/sources/librsvg/${TERMUX_PKG_VERSION:0:4}/librsvg-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=768e46467d874161a277bd696551f4f364b3c8d51eeedeb9b4fe1277a2496ae8\nTERMUX_PKG_DEPENDS=\"gdk-pixbuf, libcairo, libcroco, pango, zlib\"\nTERMUX_PKG_BREAKS=\"librsvg-dev\"\nTERMUX_PKG_REPLACES=\"librsvg-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-introspection --disable-pixbuf-loader\"\n\ntermux_step_pre_configure() {\n\ttermux_setup_rust\n\n\tLDFLAGS+=\" -fuse-ld=lld\"\n\n\t# See https://github.com/GNOME/librsvg/blob/master/COMPILING.md\n\texport RUST_TARGET=$CARGO_TARGET_NAME\n}\n"
  },
  {
    "path": "packages/librsync/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/librsync/librsync\nTERMUX_PKG_DESCRIPTION=\"Remote delta-compression library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=2.2.1\nTERMUX_PKG_SRCURL=https://github.com/librsync/librsync/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b5ab8e2092b82b7d7bb9c1dd52e6a77083a89f8ad9b9309da611f490d0b49a71\nTERMUX_PKG_DEPENDS=\"libbz2\"\nTERMUX_PKG_BUILD_DEPENDS=\"libpopt\"\nTERMUX_PKG_BREAKS=\"librsync-dev\"\nTERMUX_PKG_REPLACES=\"librsync-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DPERL_EXECUTABLE=$(which perl)\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Remove old files to ensure new timestamps on symlinks:\n\trm -Rf $TERMUX_PREFIX/lib/librsync.*\n}\n\ntermux_step_post_configure() {\n\tmkdir -p $TERMUX_PREFIX/share/man/man{1,3}\n\tcp $TERMUX_PKG_SRCDIR/doc/rdiff.1 $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/doc/librsync.3 $TERMUX_PREFIX/share/man/man3\n}\n"
  },
  {
    "path": "packages/librsync/rdiff.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/rdiff share/man/man1/rdiff.1.gz\"\nTERMUX_SUBPKG_DESCRIPTION=\"Remote incremental backup\"\nTERMUX_SUBPKG_DEPENDS=\"libpopt\"\n"
  },
  {
    "path": "packages/libsasl/auth_getpwent.c.patch",
    "content": "diff -u -r ../cyrus-sasl-2.1.27/saslauthd/auth_getpwent.c ./saslauthd/auth_getpwent.c\n--- ../cyrus-sasl-2.1.27/saslauthd/auth_getpwent.c\t2016-12-10 16:17:11.000000000 +0000\n+++ ./saslauthd/auth_getpwent.c\t2018-12-27 22:51:44.851604495 +0000\n@@ -72,6 +72,9 @@\n   /* END PARAMETERS */\n   )\n {\n+#ifdef __ANDROID__\n+   RETURN(\"NO Invalid username\");\n+#else\n     /* VARIABLES */\n     struct passwd *pw;\t\t\t/* pointer to passwd file entry */\n     char *crpt_passwd;\t\t\t/* encrypted password */\n@@ -115,6 +118,7 @@\n \tsyslog(LOG_DEBUG, \"DEBUG: auth_getpwent: OK: %s\", login);\n     }\n     RETURN(\"OK\");\n+#endif\n }\n \n /* END FUNCTION: auth_getpwent */\n"
  },
  {
    "path": "packages/libsasl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.cyrusimap.org/sasl/\nTERMUX_PKG_DESCRIPTION=\"Cyrus SASL - authentication abstraction library\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.1.27\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=6eaf75ce1e73be63894fb04d1fd0bfa9f54f33e88269743dd8f2ff54e27ea043\nTERMUX_PKG_BREAKS=\"libsasl-dev\"\nTERMUX_PKG_REPLACES=\"libsasl-dev\"\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/cyrus-sasl-$TERMUX_PKG_VERSION.tar.xz\n# Seems to be race issues in build (symlink creation)::\nTERMUX_MAKE_PROCESSES=1\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nlt_cv_deplibs_check_method=pass_all\nac_cv_func_syslog=no\nac_cv_header_syslog_h=no\n--disable-gssapi\n--disable-otp\n--sysconfdir=$TERMUX_PREFIX/etc\n--with-dblib=none\n--with-dbpath=$TERMUX_PREFIX/var/lib/sasldb\n--without-des\n--without-saslauthd\n--with-plugindir=$TERMUX_PREFIX/lib/sasl2\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/pluginviewer\"\n\ntermux_step_post_configure() {\n\t# Build wants to run makemd5 at build time:\n\tgcc $TERMUX_PKG_SRCDIR/include/makemd5.c -o $TERMUX_PKG_BUILDDIR/include/makemd5\n\ttouch -d \"next hour\" $TERMUX_PKG_BUILDDIR/include/makemd5\n}\n\ntermux_step_post_massage() {\n\tfor sub in anonymous crammd5 digestmd5 plain; do\n\t\tlocal base=lib/sasl2/lib${sub}\n\t\tif [ ! -f ${base}.so ]; then\n\t\t\ttermux_error_exit \"libsasl not packaged with $base\"\n\t\tfi\n\tdone\n}\n"
  },
  {
    "path": "packages/libsearpc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/haiwen/libsearpc\nTERMUX_PKG_DESCRIPTION=\"A simple C language RPC framework (mainly for seafile)\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=3.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/haiwen/libsearpc/archive/v${TERMUX_PKG_VERSION}-latest.tar.gz\nTERMUX_PKG_SHA256=08411c2581e4c3967f4590f25a357952cd7d71d83229171a3c1e1f321d457806\nTERMUX_PKG_DEPENDS=\"glib, libjansson\"\nTERMUX_PKG_BREAKS=\"libsearpc-dev\"\nTERMUX_PKG_REPLACES=\"libsearpc-dev\"\n\ntermux_step_post_extract_package() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/libsearpc/lib-Makefile.am.patch",
    "content": "diff -uNr libsearpc-3.1-latest/lib/Makefile.am libsearpc-3.1-latest.mod/lib/Makefile.am\n--- libsearpc-3.1-latest/lib/Makefile.am\t2019-07-19 10:31:10.000000000 +0300\n+++ libsearpc-3.1-latest.mod/lib/Makefile.am\t2019-07-25 18:03:05.629491489 +0300\n@@ -12,6 +12,6 @@\n \n libsearpc_la_LDFLAGS = -version-info 1:2:0  -no-undefined\n \n-libsearpc_la_LIBADD = @GLIB_LIBS@ @JANSSON_LIBS@ -lpthread\n+libsearpc_la_LIBADD = @GLIB_LIBS@ @JANSSON_LIBS@\n \n dist_bin_SCRIPTS = searpc-codegen.py\n"
  },
  {
    "path": "packages/libsignal-protocol-c/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/signalapp/libsignal-protocol-c\nTERMUX_PKG_DESCRIPTION=\"Signal Protocol C Library\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.3.2\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_SRCURL=https://github.com/signalapp/libsignal-protocol-c/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=f3826f3045352e14027611c95449bfcfe39bfd3d093d578c70f70eee0c85000d\nTERMUX_PKG_DEPENDS=\"openssl\"\n\ntermux_step_pre_configure() {\n    TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DBUILD_SHARED_LIBS=ON\"\n    TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DM_LIB=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libm.so\"\n}\n"
  },
  {
    "path": "packages/libsigsegv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libsigsegv/\nTERMUX_PKG_DESCRIPTION=\"GNU libsigsegv is a library for handling page faults in user mode\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.12\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3ae1af359eebaa4ffc5896a1aee3568c052c99879316a1ab57f8fe1789c390b6\nTERMUX_PKG_BREAKS=\"libsigsegv-dev\"\nTERMUX_PKG_REPLACES=\"libsigsegv-dev\"\n"
  },
  {
    "path": "packages/libsndfile/Makefile.am.patch",
    "content": "Temporary patch (to avoid having to install autogen) until 1.0.29 is released.\n\ndiff -u -r ../libsndfile-826d5296da54c016e3cb0f7f00de3b9e295b9c4a/Makefile.am ./Makefile.am\n--- ../libsndfile-826d5296da54c016e3cb0f7f00de3b9e295b9c4a/Makefile.am\t2017-10-31 09:30:54.000000000 +0100\n+++ ./Makefile.am\t2017-11-15 23:24:38.275420688 +0100\n@@ -30,18 +30,13 @@\n \n test: check\n \n-# Need this target to force building of test programs.\n-checkprograms: $(check_PROGRAMS)\n-\n ########\n # src/ #\n ########\n \n-BUILT_SOURCES = src/test_endswap.c\n-\n SYMBOL_FILES = src/Symbols.gnu-binutils src/Symbols.darwin src/libsndfile-1.def src/Symbols.os2 src/Symbols.static\n \n-EXTRA_DIST += src/sndfile.h.in src/config.h.in src/test_endswap.tpl src/test_endswap.def \\\n+EXTRA_DIST += src/sndfile.h.in src/config.h.in \\\n \t$(SYMBOL_FILES) src/create_symbols_file.py src/binheader_writef_check.py \\\n \tsrc/GSM610/README src/GSM610/COPYRIGHT src/GSM610/ChangeLog \\\n \tsrc/G72x/README src/G72x/README.original src/G72x/ChangeLog \\\n@@ -80,13 +75,6 @@\n \tsrc/ima_oki_adpcm.c src/ima_oki_adpcm.h src/alac.c src/chunk.c src/ogg.c src/chanmap.c \\\n \tsrc/windows.c src/id3.c $(WIN_VERSION_FILE)\n \n-check_PROGRAMS = src/test_main\n-src_test_main_SOURCES = src/test_main.c src/test_main.h src/test_conversions.c src/test_float.c src/test_endswap.c \\\n-\tsrc/test_audio_detect.c src/test_log_printf.c src/test_file_io.c src/test_ima_oki_adpcm.c \\\n-\tsrc/test_strncpy_crlf.c src/test_broadcast_var.c src/test_cart_var.c \\\n-\tsrc/test_binheader_writef.c\n-src_test_main_LDADD = src/libcommon.la\n-\n ##############\n # src/GSM610 #\n ##############\n@@ -106,7 +94,6 @@\n src_G72x_libg72x_la_SOURCES = src/G72x/g72x.h src/G72x/g72x_priv.h \\\n \tsrc/G72x/g721.c src/G72x/g723_16.c src/G72x/g723_24.c src/G72x/g723_40.c src/G72x/g72x.c\n \n-check_PROGRAMS += src/G72x/g72x_test\n src_G72x_g72x_test_SOURCES = src/G72x/g72x_test.c\n src_G72x_g72x_test_LDADD = src/G72x/libg72x.la\n \n@@ -167,9 +154,6 @@\n # examples/ #\n #############\n \n-check_PROGRAMS += examples/make_sine examples/sfprocess examples/list_formats examples/generate examples/sndfilehandle \\\n-\texamples/sndfile-to-text examples/sndfile-loopify\n-\n examples_sndfile_to_text_SOURCES = examples/sndfile-to-text.c\n examples_sndfile_to_text_LDADD = src/libsndfile.la\n \n@@ -191,211 +175,6 @@\n examples_sndfilehandle_SOURCES = examples/sndfilehandle.cc\n examples_sndfilehandle_LDADD = src/libsndfile.la\n \n-##########\n-# tests/ #\n-##########\n-\n-TESTS_ENVIRONMENT = $(SHELL) tests/test_wrapper.sh\n-\n-if ENABLE_TEST_COVERAGE\n-CPP_TEST =\n-else\n-CPP_TEST = tests/cpp_test\n-endif\n-\n-TESTS = tests/pedantic-header-test.sh\n-\n-check_PROGRAMS += tests/sfversion tests/floating_point_test tests/write_read_test \\\n-\ttests/lossy_comp_test tests/error_test tests/ulaw_test tests/alaw_test tests/dwvw_test \\\n-\ttests/peak_chunk_test tests/command_test tests/stdio_test \\\n-\ttests/pcm_test tests/headerless_test tests/pipe_test tests/header_test tests/misc_test \\\n-\ttests/raw_test tests/string_test tests/multi_file_test tests/chunk_test \\\n-\ttests/scale_clip_test tests/win32_test tests/aiff_rw_test tests/virtual_io_test \\\n-\ttests/locale_test tests/win32_ordinal_test tests/ogg_test tests/compression_size_test \\\n-\ttests/checksum_test tests/external_libs_test tests/rdwr_test tests/format_check_test $(CPP_TEST) \\\n-\ttests/channel_test tests/long_read_write_test tests/stdin_test tests/stdout_test \\\n-\ttests/dither_test tests/fix_this tests/largefile_test tests/benchmark\n-\n-BUILT_SOURCES += \\\n-\ttests/write_read_test.c \\\n-\ttests/pcm_test.c \\\n-\ttests/header_test.c \\\n-\ttests/utils.c \\\n-\ttests/scale_clip_test.c \\\n-\ttests/pipe_test.c \\\n-\ttests/rdwr_test.c \\\n-\ttests/floating_point_test.c \\\n-\ttests/benchmark.c\n-\n-EXTRA_DIST += $(BUILT_SOURCES) \\\n-\ttests/write_read_test.tpl     tests/write_read_test.def \\\n-\ttests/pcm_test.tpl            tests/pcm_test.def \\\n-\ttests/header_test.tpl         tests/header_test.def \\\n-\ttests/utils.tpl               tests/utils.def \\\n-\ttests/scale_clip_test.tpl     tests/scale_clip_test.def \\\n-\ttests/pipe_test.tpl           tests/pipe_test.def \\\n-\ttests/rdwr_test.tpl           tests/rdwr_test.def \\\n-\ttests/floating_point_test.tpl tests/floating_point_test.def \\\n-\ttests/benchmark.tpl           tests/benchmark.def\n-\n-# If we're cross compiling from Linux to Windows and running the test suite\n-# under Wine, we need a symbolic link to the generated libsndfile DLL.\n-\n-if LINUX_MINGW_CROSS_TEST\n-\n-$(check_PROGRAMS) : libsndfile-1.dll\n-\n-libsndfile-1.dll :\n-\t$(LN_S) src/.libs/$@ $@\n-\n-clean-local :\n-\t-rm -f libsndfile-1.dll\n-\n-endif\n-\n-#===============================================================================\n-\n-tests_sfversion_SOURCES = tests/sfversion.c\n-tests_sfversion_LDADD = src/libsndfile.la\n-\n-tests_write_read_test_SOURCES = tests/utils.c tests/generate.c tests/generate.h tests/write_read_test.c tests/utils.h\n-tests_write_read_test_LDADD = src/libsndfile.la\n-\n-tests_lossy_comp_test_SOURCES = tests/utils.c tests/lossy_comp_test.c tests/utils.h\n-tests_lossy_comp_test_LDADD = src/libsndfile.la\n-\n-tests_fix_this_SOURCES = tests/utils.c tests/fix_this.c tests/utils.h\n-tests_fix_this_LDADD = src/libsndfile.la\n-\n-tests_error_test_SOURCES = tests/error_test.c tests/utils.c tests/utils.h\n-tests_error_test_LDADD = src/libsndfile.la\n-\n-tests_ulaw_test_SOURCES = tests/utils.c tests/ulaw_test.c tests/utils.h\n-tests_ulaw_test_LDADD = src/libsndfile.la\n-\n-tests_alaw_test_SOURCES = tests/utils.c tests/alaw_test.c tests/utils.h\n-tests_alaw_test_LDADD = src/libsndfile.la\n-\n-tests_aiff_rw_test_SOURCES = tests/utils.c tests/aiff_rw_test.c tests/utils.h\n-tests_aiff_rw_test_LDADD = src/libsndfile.la\n-\n-tests_command_test_SOURCES = tests/command_test.c tests/utils.c tests/utils.h\n-tests_command_test_LDADD = src/libsndfile.la\n-\n-tests_locale_test_SOURCES = tests/locale_test.c tests/utils.c tests/utils.h\n-tests_locale_test_LDADD = src/libsndfile.la\n-\n-tests_largefile_test_SOURCES = tests/largefile_test.c tests/utils.c tests/utils.h\n-tests_largefile_test_LDADD = src/libsndfile.la\n-\n-tests_pcm_test_SOURCES = tests/pcm_test.c tests/utils.c tests/utils.h\n-tests_pcm_test_LDADD = src/libsndfile.la\n-\n-tests_headerless_test_SOURCES = tests/utils.c tests/headerless_test.c tests/utils.h\n-tests_headerless_test_LDADD = src/libsndfile.la\n-\n-tests_stdin_test_SOURCES = tests/stdin_test.c tests/utils.c tests/utils.h\n-tests_stdin_test_LDADD = src/libsndfile.la\n-\n-tests_stdout_test_SOURCES = tests/stdout_test.c tests/utils.h\n-tests_stdout_test_LDADD = src/libsndfile.la\n-\n-tests_stdio_test_SOURCES = tests/stdio_test.c tests/utils.c tests/utils.h\n-tests_stdio_test_LDADD = src/libsndfile.la\n-\n-tests_pipe_test_SOURCES = tests/pipe_test.c tests/utils.c tests/utils.h\n-tests_pipe_test_LDADD = src/libsndfile.la\n-\n-tests_benchmark_SOURCES = tests/benchmark.c tests/utils.h\n-tests_benchmark_LDADD = src/libsndfile.la\n-\n-tests_header_test_SOURCES = tests/header_test.c tests/utils.c tests/utils.h\n-tests_header_test_LDADD = src/libsndfile.la\n-\n-tests_misc_test_SOURCES = tests/misc_test.c tests/utils.c tests/utils.h\n-tests_misc_test_LDADD = src/libsndfile.la\n-\n-tests_raw_test_SOURCES = tests/raw_test.c tests/utils.c tests/utils.h\n-tests_raw_test_LDADD = src/libsndfile.la\n-\n-tests_string_test_SOURCES = tests/string_test.c tests/utils.c tests/utils.h\n-tests_string_test_LDADD = src/libsndfile.la\n-\n-tests_dither_test_SOURCES = tests/dither_test.c tests/utils.c tests/utils.h\n-tests_dither_test_LDADD = src/libsndfile.la\n-\n-tests_chunk_test_SOURCES = tests/chunk_test.c tests/utils.c tests/utils.h\n-tests_chunk_test_LDADD = src/libsndfile.la\n-\n-tests_multi_file_test_SOURCES = tests/multi_file_test.c tests/utils.c tests/utils.h\n-tests_multi_file_test_LDADD = src/libsndfile.la\n-\n-tests_virtual_io_test_SOURCES = tests/virtual_io_test.c tests/utils.c tests/utils.h\n-tests_virtual_io_test_LDADD = src/libsndfile.la\n-\n-tests_ogg_test_SOURCES = tests/ogg_test.c tests/utils.c tests/utils.h\n-tests_ogg_test_LDADD = src/libsndfile.la\n-\n-tests_compression_size_test_SOURCES = tests/compression_size_test.c tests/utils.c tests/utils.h tests/dft_cmp.h\n-tests_compression_size_test_LDADD = src/libsndfile.la\n-\n-tests_rdwr_test_SOURCES = tests/rdwr_test.c tests/utils.c tests/utils.h\n-tests_rdwr_test_LDADD = src/libsndfile.la\n-\n-tests_win32_test_SOURCES = tests/win32_test.c\n-# Link lib here so that generating the testsuite tarball works correctly.\n-tests_win32_test_LDADD = src/libsndfile.la\n-\n-tests_win32_ordinal_test_SOURCES = tests/win32_ordinal_test.c tests/utils.c tests/utils.h\n-tests_win32_ordinal_test_LDADD = src/libsndfile.la\n-\n-tests_external_libs_test_SOURCES = tests/external_libs_test.c tests/utils.c tests/utils.h\n-tests_external_libs_test_LDADD = src/libsndfile.la\n-\n-tests_format_check_test_SOURCES = tests/format_check_test.c tests/utils.c tests/utils.h\n-tests_format_check_test_LDADD = src/libsndfile.la\n-\n-tests_channel_test_SOURCES = tests/channel_test.c tests/utils.c tests/utils.h\n-tests_channel_test_LDADD = src/libsndfile.la\n-\n-tests_long_read_write_test_SOURCES = tests/long_read_write_test.c tests/utils.c tests/utils.h tests/dft_cmp.h\n-tests_long_read_write_test_LDADD = src/libsndfile.la\n-\n-tests_cpp_test_SOURCES = tests/cpp_test.cc tests/utils.c tests/utils.h\n-tests_cpp_test_LDADD = src/libsndfile.la\n-\n-tests_checksum_test_SOURCES = tests/checksum_test.c tests/utils.c tests/utils.h\n-tests_checksum_test_LDADD = src/libsndfile.la\n-\n-# Lite remove start\n-tests_dwvw_test_SOURCES = tests/dwvw_test.c tests/utils.c tests/utils.h\n-tests_dwvw_test_LDADD = src/libsndfile.la\n-\n-tests_floating_point_test_SOURCES = tests/utils.c tests/utils.h tests/dft_cmp.c tests/dft_cmp.h tests/floating_point_test.c\n-tests_floating_point_test_LDADD = src/libsndfile.la\n-\n-tests_peak_chunk_test_SOURCES = tests/peak_chunk_test.c tests/utils.c tests/utils.h\n-tests_peak_chunk_test_LDADD = src/libsndfile.la\n-\n-tests_scale_clip_test_SOURCES = tests/scale_clip_test.c tests/utils.c tests/utils.h\n-tests_scale_clip_test_LDADD = src/libsndfile.la\n-# Lite remove end\n-\n-#===============================================================================\n-# Autogen generated sources.\n-# These GNU style rules actually work. The old style suffix rules do not.\n-\n-%.c : %.def %.tpl\n-\tcd $(top_srcdir)/$(@D) && autogen --writable $(<F)\n-\n-# recommended Automake way for multi-output targets:\n-# https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html\n-%.h : %.c %.def %.tpl\n-\t@if test -f $@; then :; else \\\n-\t  rm -f $<; \\\n-\t  $(MAKE) $(AM_MAKEFLAGS) $<; \\\n-\tfi\n-\n ########\n # man/ #\n ########\n@@ -423,9 +202,6 @@\n \tprograms/sndfile-deinterleave programs/sndfile-concat programs/sndfile-salvage\n endif\n \n-# required by test-sndfile-metadata-set.py\n-check_PROGRAMS += programs/sndfile-metadata-set programs/sndfile-metadata-get\n-\n # This is the BeOS version of sndfile-play. It needs to be compiled with the C++\n # compiler.\n EXTRA_DIST += programs/sndfile-play-beos.cpp programs/test-sndfile-metadata-set.py\n@@ -459,22 +235,3 @@\n \n programs_sndfile_salvage_SOURCES = programs/sndfile-salvage.c programs/common.c programs/common.h\n programs_sndfile_salvage_LDADD = src/libsndfile.la\n-\n-############\n-# regtest/ #\n-############\n-\n-if HAVE_SQLITE3\n-check_PROGRAMS += regtest/sndfile-regtest\n-endif\n-\n-regtest_sndfile_regtest_SOURCES = regtest/regtest.h regtest/sndfile-regtest.c regtest/database.c regtest/checksum.c\n-regtest_sndfile_CPPFLAGS = -I$(top_srcdir)/src $(SQLITE3_CFLAGS) $(OS_SPECIFIC_CFLAGS)\n-regtest_sndfile_regtest_LDADD = src/libsndfile.la $(SQLITE3_LIBS)\n-\n-################\n-# test-tarball #\n-################\n-test-tarball : Scripts/build-test-tarball.mk\n-\t$(MAKE) $(bin_PROGRAMS) $(check_PROGRAMS)\n-\t$(MAKE) -f Scripts/build-test-tarball.mk\n"
  },
  {
    "path": "packages/libsndfile/autogen.sh.patch",
    "content": "diff -u -r ../libsndfile-826d5296da54c016e3cb0f7f00de3b9e295b9c4a/autogen.sh ./autogen.sh\n--- ../libsndfile-826d5296da54c016e3cb0f7f00de3b9e295b9c4a/autogen.sh\t2017-10-31 09:30:54.000000000 +0100\n+++ ./autogen.sh\t2017-11-15 23:12:23.210491716 +0100\n@@ -11,18 +11,6 @@\n cd \"$srcdir\"\n DIE=0\n \n-printf \"checking for autogen ... \"\n-result=\"yes\"\n-(autogen --version) < /dev/null > /dev/null 2>&1 || {\n-        echo\n-        echo \"You must have GNU autogen installed to compile $package.\"\n-        echo \"Download the appropriate package for your distribution,\"\n-        echo \"or get the source tarball at ftp://ftp.gnu.org/pub/gnu/\"\n-\t\tresult=\"no\"\n-        DIE=1\n-}\n-echo $result\n-\n printf \"checking for autoconf ... \"\n result=\"yes\"\n (autoconf --version) < /dev/null > /dev/null 2>&1 || {\n"
  },
  {
    "path": "packages/libsndfile/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.mega-nerd.com/libsndfile\nTERMUX_PKG_DESCRIPTION=\"Library for reading/writing audio files\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\n# Use a git master snapshot until 1.0.29 is released:\nTERMUX_PKG_VERSION=1.0.29~pre1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/erikd/libsndfile/archive/826d5296da54c016e3cb0f7f00de3b9e295b9c4a.zip\nTERMUX_PKG_SHA256=84651201a8468c448f1fd172a48ccf47f3761d23fd0f59bcaaf908050e9eeb7c\nTERMUX_PKG_DEPENDS=\"libflac, libvorbis\"\nTERMUX_PKG_BREAKS=\"libsndfile-dev\"\nTERMUX_PKG_REPLACES=\"libsndfile-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-sqlite --disable-alsa\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/ share/man/man1/\"\n\ntermux_step_pre_configure() {\n\tsh autogen.sh\n}\n"
  },
  {
    "path": "packages/libsndfile/tmpdir.patch",
    "content": "diff -uNr libsndfile/src/common.c libsndfile.mod/src/common.c\n--- libsndfile/src/common.c\t2017-10-31 10:30:54.000000000 +0200\n+++ libsndfile.mod/src/common.c\t2018-06-19 17:08:45.344367164 +0300\n@@ -1730,7 +1730,7 @@\n \t\ttmpdir = getenv (\"TEMP\") ;\n \telse\n \t{\ttmpdir = getenv (\"TMPDIR\") ;\n-\t\ttmpdir = tmpdir == NULL ? \"/tmp\" : tmpdir ;\n+\t\ttmpdir = tmpdir == NULL ? \"@TERMUX_PREFIX@/tmp\" : tmpdir ;\n \t\t} ;\n \n \tif (tmpdir && access (tmpdir, R_OK | W_OK | X_OK) == 0)\n"
  },
  {
    "path": "packages/libsodium/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libsodium.org/\nTERMUX_PKG_DESCRIPTION=\"Network communication, cryptography and signaturing library\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_VERSION=1.0.18\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/jedisct1/libsodium/archive/${TERMUX_PKG_VERSION}-RELEASE.tar.gz\nTERMUX_PKG_SHA256=b7292dd1da67a049c8e78415cd498ec138d194cfdb302e716b08d26b80fecc10\nTERMUX_PKG_BREAKS=\"libsodium-dev\"\nTERMUX_PKG_REPLACES=\"libsodium-dev\"\n"
  },
  {
    "path": "packages/libsoup/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/action/show/Projects/libsoup\nTERMUX_PKG_DESCRIPTION=\"HTTP client and server library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=2.68.2\nTERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/GNOME/sources/libsoup/${TERMUX_PKG_VERSION:0:4}/libsoup-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=51ad3001a946fe3bcf29b692dc9ffe05cdf702ea6ca0ee8c3099a99a2f4e3933\nTERMUX_PKG_DEPENDS=\"glib, libpsl, libsqlite, libxml2\"\nTERMUX_PKG_BREAKS=\"libsoup-dev\"\nTERMUX_PKG_REPLACES=\"libsoup-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-Dvapi=disabled -Dgssapi=disabled -Dtls_check=false\"\n"
  },
  {
    "path": "packages/libsoxr/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/soxr/\nTERMUX_PKG_DESCRIPTION=\"High quality, one-dimensional sample-rate conversion library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.1.3\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://sourceforge.net/projects/soxr/files/soxr-$TERMUX_PKG_VERSION-Source.tar.xz\nTERMUX_PKG_SHA256=b111c15fdc8c029989330ff559184198c161100a59312f5dc19ddeb9b5a15889\nTERMUX_PKG_BREAKS=\"libsoxr-dev\"\nTERMUX_PKG_REPLACES=\"libsoxr-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\treturn 0\n}\n\ntermux_step_make() {\n\ttermux_setup_cmake\n\t./go\n}\n"
  },
  {
    "path": "packages/libsoxr/go.patch",
    "content": "diff -u -r ../soxr-0.1.3-Source/go ./go\n--- ../soxr-0.1.3-Source/go\t2018-02-21 07:36:46.000000000 +0000\n+++ ./go\t2018-05-18 23:27:01.320832208 +0000\n@@ -13,6 +13,7 @@\n mkdir -p \"$build\"\n cd \"$build\"\n \n-cmake -Wno-dev -DCMAKE_BUILD_TYPE=\"$build\" ..\n+cmake -Wno-dev -DCMAKE_BUILD_TYPE=\"$build\" -DCMAKE_INSTALL_PREFIX=@TERMUX_PREFIX@ -DBUILD_TESTS=off ..\n make $j\n+make install\n ctest $j || echo \"FAILURE details in $build/Testing/Temporary/LastTest.log\"\n"
  },
  {
    "path": "packages/libsqlite/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.sqlite.org\nTERMUX_PKG_DESCRIPTION=\"Library implementing a self-contained and transactional SQL database engine\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\n# Note: Updating this version requires bumping the tcl package as well.\n_SQLITE_MAJOR=3\n_SQLITE_MINOR=30\n_SQLITE_PATCH=1\nTERMUX_PKG_SHA256=8c5a50db089bd2a1b08dbc5b00d2027602ca7ff238ba7658fabca454d4298e60\nTERMUX_PKG_VERSION=${_SQLITE_MAJOR}.${_SQLITE_MINOR}.${_SQLITE_PATCH}\nTERMUX_PKG_SRCURL=https://www.sqlite.org/2019/sqlite-autoconf-${_SQLITE_MAJOR}${_SQLITE_MINOR}0${_SQLITE_PATCH}00.tar.gz\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_BREAKS=\"libsqlite-dev\"\nTERMUX_PKG_REPLACES=\"libsqlite-dev\"\n# ac_cv_func_strerror_r=no as strerror_r() with the\n# GNU signature is only # available in android-23:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_strerror_r=no\n--enable-readline\n\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -Werror -DSQLITE_ENABLE_DBSTAT_VTAB=1\"\n\tLDFLAGS+=\" -lm\"\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/src/libsqlite\n\tcp $TERMUX_PKG_SRCDIR/tea/generic/tclsqlite3.c $TERMUX_PREFIX/src/libsqlite/tclsqlite3.c\n}\n"
  },
  {
    "path": "packages/libsqlite/sqlite.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Command line shell for SQLite\"\nTERMUX_SUBPKG_DEPENDS=\"readline\"\n"
  },
  {
    "path": "packages/libsqlite/sqlite3.c.patch",
    "content": "diff -uNr sqlite-autoconf-3240000/sqlite3.c sqlite-autoconf-3240000.mod/sqlite3.c\n--- sqlite-autoconf-3240000/sqlite3.c\t2018-06-04 22:51:29.000000000 +0300\n+++ sqlite-autoconf-3240000.mod/sqlite3.c\t2018-06-19 16:38:55.317608333 +0300\n@@ -37234,9 +37234,8 @@\n   static const char *azDirs[] = {\n      0,\n      0,\n-     \"/var/tmp\",\n-     \"/usr/tmp\",\n-     \"/tmp\",\n+     \"@TERMUX_PREFIX@/var/tmp\",\n+     \"@TERMUX_PREFIX@/tmp\",\n      \".\"\n   };\n   unsigned int i = 0;\n"
  },
  {
    "path": "packages/libssh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.libssh.org/\nTERMUX_PKG_DESCRIPTION=\"Tiny C SSH library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=0.9.2\nTERMUX_PKG_SRCURL=https://www.libssh.org/files/${TERMUX_PKG_VERSION:0:3}/libssh-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=1970a8991374fc8cbdcb7fcc3683fe8f8824aa37d575f38cfb75fe0fe50fd9ad\nTERMUX_PKG_DEPENDS=\"openssl, zlib\"\nTERMUX_PKG_BREAKS=\"libssh-dev\"\nTERMUX_PKG_REPLACES=\"libssh-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DHAVE_ARGP_H=OFF\n-DWITH_GSSAPI=OFF\n\"\n"
  },
  {
    "path": "packages/libssh/fix-paths.patch",
    "content": "diff -uNr libssh-0.9.0/src/dh-gex.c libssh-0.9.0.mod/src/dh-gex.c\n--- libssh-0.9.0/src/dh-gex.c\t2019-06-27 11:37:37.000000000 +0300\n+++ libssh-0.9.0.mod/src/dh-gex.c\t2019-06-29 17:28:16.549587113 +0300\n@@ -294,7 +294,7 @@\n \n #ifdef WITH_SERVER\n \n-#define MODULI_FILE \"/etc/ssh/moduli\"\n+#define MODULI_FILE \"@TERMUX_PREFIX@/etc/ssh/moduli\"\n /* 2     \"Safe\" prime; (p-1)/2 is also prime. */\n #define SAFE_PRIME 2\n /* 0x04  Probabilistic Miller-Rabin primality tests. */\ndiff -uNr libssh-0.9.0/src/options.c libssh-0.9.0.mod/src/options.c\n--- libssh-0.9.0/src/options.c\t2019-06-27 11:34:16.000000000 +0300\n+++ libssh-0.9.0.mod/src/options.c\t2019-06-29 17:28:52.049933003 +0300\n@@ -666,7 +666,7 @@\n             SAFE_FREE(session->opts.global_knownhosts);\n             if (v == NULL) {\n                 session->opts.global_knownhosts =\n-                    strdup(\"/etc/ssh/ssh_known_hosts\");\n+                    strdup(\"@TERMUX_PREFIX@/etc/ssh/ssh_known_hosts\");\n                 if (session->opts.global_knownhosts == NULL) {\n                     ssh_set_error_oom(session);\n                     return -1;\n@@ -1449,7 +1449,7 @@\n     session->opts.knownhosts = tmp;\n \n     if (session->opts.global_knownhosts == NULL) {\n-        tmp = strdup(\"/etc/ssh/ssh_known_hosts\");\n+        tmp = strdup(\"@TERMUX_PREFIX@/etc/ssh/ssh_known_hosts\");\n     } else {\n         tmp = ssh_path_expand_escape(session, session->opts.global_knownhosts);\n     }\ndiff -uNr libssh-0.9.0/src/socket.c libssh-0.9.0.mod/src/socket.c\n--- libssh-0.9.0/src/socket.c\t2019-06-27 11:34:16.000000000 +0300\n+++ libssh-0.9.0.mod/src/socket.c\t2019-06-29 17:26:21.278467080 +0300\n@@ -838,7 +838,7 @@\n void\n ssh_execute_command(const char *command, socket_t in, socket_t out)\n {\n-    const char *args[] = {\"/bin/sh\", \"-c\", command, NULL};\n+    const char *args[] = {\"@TERMUX_PREFIX@/bin/sh\", \"-c\", command, NULL};\n     /* Prepare /dev/null socket for the stderr redirection */\n     int devnull = open(\"/dev/null\", O_WRONLY);\n     if (devnull == -1) {\n"
  },
  {
    "path": "packages/libssh2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.libssh2.org\nTERMUX_PKG_DESCRIPTION=\"Client-side library implementing the SSH2 protocol\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.9.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd\nTERMUX_PKG_SRCURL=https://www.libssh2.org/download/libssh2-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"openssl, zlib\"\nTERMUX_PKG_BREAKS=\"libssh2-dev\"\nTERMUX_PKG_REPLACES=\"libssh2-dev\"\n"
  },
  {
    "path": "packages/libtalloc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://talloc.samba.org/talloc/doc/html/index.html\nTERMUX_PKG_DESCRIPTION=\"Hierarchical, reference counted memory pool system with destructors\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.1.14\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://www.samba.org/ftp/talloc/talloc-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b185602756a628bac507fa8af8b9df92ace69d27c0add5dab93190ad7c3367ce\nTERMUX_PKG_BREAKS=\"libtalloc-dev\"\nTERMUX_PKG_REPLACES=\"libtalloc-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Force fresh install:\n\trm -f $TERMUX_PREFIX/include/talloc.h\n\n\t# Make sure symlinks are installed:\n\trm $TERMUX_PREFIX/lib/libtalloc* || true\n\n\tcd $TERMUX_PKG_SRCDIR\n\n\tcat <<EOF > cross-answers.txt\nChecking uname sysname type: \"Linux\"\nChecking uname machine type: \"dontcare\"\nChecking uname release type: \"dontcare\"\nChecking uname version type: \"dontcare\"\nChecking simple C program: OK\nbuilding library support: OK\nChecking for large file support: OK\nChecking for -D_FILE_OFFSET_BITS=64: OK\nChecking for WORDS_BIGENDIAN: OK\nChecking for C99 vsnprintf: OK\nChecking for HAVE_SECURE_MKSTEMP: OK\nrpath library support: OK\n-Wl,--version-script support: FAIL\nChecking correct behavior of strtoll: OK\nChecking correct behavior of strptime: OK\nChecking for HAVE_IFACE_GETIFADDRS: OK\nChecking for HAVE_IFACE_IFCONF: OK\nChecking for HAVE_IFACE_IFREQ: OK\nChecking getconf LFS_CFLAGS: OK\nChecking for large file support without additional flags: OK\nChecking for working strptime: OK\nChecking for HAVE_SHARED_MMAP: OK\nChecking for HAVE_MREMAP: OK\nChecking for HAVE_INCOHERENT_MMAP: OK\nChecking getconf large file support flags work: OK\nEOF\n\n\t./configure --prefix=$TERMUX_PREFIX \\\n\t\t--disable-rpath \\\n\t\t--disable-python \\\n\t\t--cross-compile \\\n\t\t--cross-answers=cross-answers.txt\n}\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PKG_SRCDIR/bin/default\n\t$AR rcu libtalloc.a talloc_*.o\n\tinstall -Dm600 libtalloc.a $TERMUX_PREFIX/lib/libtalloc.a\n}\n"
  },
  {
    "path": "packages/libtalloc/lib-replace-wscript.patch",
    "content": "diff -u -r ../talloc-2.1.14/lib/replace/wscript ./lib/replace/wscript\n--- ../talloc-2.1.14/lib/replace/wscript\t2018-07-12 05:51:30.000000000 +0000\n+++ ./lib/replace/wscript\t2019-03-17 10:38:26.655881820 +0000\n@@ -32,7 +32,7 @@\n     conf.DEFINE('HAVE_LIBREPLACE', 1)\n     conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)\n \n-    conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')\n+    conf.CHECK_HEADERS('linux/types.h locale.h acl/libacl.h compat.h')\n     conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')\n     conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')\n     conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')\n@@ -551,9 +551,6 @@\n              conf.CONFIG_SET('HAVE_PTHREAD_MUTEX_CONSISTENT_NP'))):\n             conf.DEFINE('HAVE_ROBUST_MUTEXES', 1)\n \n-    conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True)\n-    conf.CHECK_FUNCS_IN('crypt_r', 'crypt', checklibc=True)\n-\n     conf.CHECK_VARIABLE('rl_event_hook', define='HAVE_DECL_RL_EVENT_HOOK', always=True,\n                         headers='readline.h readline/readline.h readline/history.h')\n \n@@ -761,7 +758,6 @@\n                 break\n \n     extra_libs = ''\n-    if bld.CONFIG_SET('HAVE_LIBBSD'): extra_libs += ' bsd'\n \n     bld.SAMBA_SUBSYSTEM('LIBREPLACE_HOSTCC',\n         REPLACE_HOSTCC_SOURCE,\n@@ -775,7 +771,6 @@\n     REPLACE_SOURCE = REPLACE_HOSTCC_SOURCE\n     REPLACE_SOURCE += ' cwrap.c'\n \n-    if not bld.CONFIG_SET('HAVE_CRYPT'):         REPLACE_SOURCE += ' crypt.c'\n     if not bld.CONFIG_SET('HAVE_DLOPEN'):        REPLACE_SOURCE += ' dlfcn.c'\n     if not bld.CONFIG_SET('HAVE_POLL'):          REPLACE_SOURCE += ' poll.c'\n \n@@ -802,7 +797,7 @@\n                       # at the moment:\n                       # hide_symbols=bld.BUILTIN_LIBRARY('replace'),\n                       private_library=True,\n-                      deps='crypt dl nsl socket rt attr' + extra_libs)\n+                      deps='dl nsl socket rt attr' + extra_libs)\n \n     replace_test_cflags=\"-Wno-format-zero-length\"\n     if bld.CONFIG_SET('HAVE_WNO_FORMAT_TRUNCATION'):\n"
  },
  {
    "path": "packages/libtalloc/wscript.patch",
    "content": "diff -u -r ../talloc-2.1.5/wscript ./wscript\n--- ../talloc-2.1.5/wscript\t2015-11-06 08:28:25.000000000 -0500\n+++ ./wscript\t2016-01-08 19:19:24.233750343 -0500\n@@ -95,15 +95,6 @@\n         if bld.CONFIG_SET('HAVE_PTHREAD'):\n             testsuite_deps += ' pthread'\n \n-        bld.SAMBA_BINARY('talloc_testsuite',\n-                         'testsuite_main.c testsuite.c',\n-                         testsuite_deps,\n-                         install=False)\n-\n-        bld.SAMBA_BINARY('talloc_test_magic_differs_helper',\n-                         'test_magic_differs_helper.c',\n-                         'talloc', install=False)\n-\n     else:\n         private_library = True\n \n"
  },
  {
    "path": "packages/libtermkey/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.leonerd.org.uk/code/libtermkey/\nTERMUX_PKG_DESCRIPTION=\"Library for processing of keyboard entry for terminal-based programs\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.22\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600\nTERMUX_PKG_SRCURL=http://www.leonerd.org.uk/code/libtermkey/libtermkey-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libunibilium\"\nTERMUX_PKG_BREAKS=\"libtermkey-dev\"\nTERMUX_PKG_REPLACES=\"libtermkey-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\treturn\n}\n\ntermux_step_make_install() {\n\tCFLAGS+=\" -std=c99 -DHAVE_UNIBILIUM=1\"\n\t$CC $CFLAGS $CPPFLAGS -c -fPIC termkey.c -o termkey.o\n\t$CC $CFLAGS $CPPFLAGS -c -fPIC driver-csi.c -o driver-csi.o\n\t$CC $CFLAGS $CPPFLAGS -c -fPIC driver-ti.c -o driver-ti.o\n\n\t$CC -shared -fPIC $LDFLAGS -o $TERMUX_PREFIX/lib/libtermkey.so termkey.o driver-csi.o driver-ti.o -lunibilium\n\n\tchmod u+w termkey.h\n\tcp termkey.h $TERMUX_PREFIX/include/\n\tLIBDIR=$TERMUX_PREFIX/lib INCDIR=$TERMUX_PREFIX/include VERSION=$TERMUX_PKG_VERSION sh termkey.pc.sh > \\\n\t\t$PKG_CONFIG_LIBDIR/termkey.pc\n}\n"
  },
  {
    "path": "packages/libtiff/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.simplesystems.org/libtiff/ # Note that http://libtiff.org/ is hijacked\nTERMUX_PKG_DESCRIPTION=\"Support for the Tag Image File Format (TIFF) for storing image data\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=4.1.0\nTERMUX_PKG_SRCURL=http://download.osgeo.org/libtiff/tiff-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634\nTERMUX_PKG_DEPENDS=\"libc++, libjpeg-turbo, liblzma, zlib\"\nTERMUX_PKG_BREAKS=\"libtiff-dev\"\nTERMUX_PKG_REPLACES=\"libtiff-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-cxx --disable-webp\"\n"
  },
  {
    "path": "packages/libtiff/libtiff-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin share/man\"\nTERMUX_SUBPKG_DESCRIPTION=\"Tools for working with tiff files\"\n"
  },
  {
    "path": "packages/libtool/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libtool/\nTERMUX_PKG_DESCRIPTION=\"Generic library support script hiding the complexity of using shared libraries behind a consistent, portable interface\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.4.6\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/libtool/libtool-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3\nTERMUX_PKG_DEPENDS=\"bash,grep,sed,libltdl\"\nTERMUX_PKG_CONFLICTS=\"libtool-dev\"\nTERMUX_PKG_REPLACES=\"libtool-dev\"\n\ntermux_step_post_make_install() {\n\tperl -p -i -e \"s|\\\"/bin/|\\\"$TERMUX_PREFIX/bin/|\" $TERMUX_PREFIX/bin/{libtool,libtoolize}\n}\n"
  },
  {
    "path": "packages/libtool/libltdl.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/libltdl.so\"\nTERMUX_SUBPKG_DESCRIPTION=\"Library for dlopening libraries\"\n"
  },
  {
    "path": "packages/libunibilium/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/mauke/unibilium\nTERMUX_PKG_DESCRIPTION=\"Terminfo parsing library\"\nTERMUX_PKG_LICENSE=\"LGPL-3.0\"\nTERMUX_PKG_VERSION=2.0.0\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=78997d38d4c8177c60d3d0c1aa8c53fd0806eb21825b7b335b1768d7116bc1c1\nTERMUX_PKG_BREAKS=\"libunibilium-dev\"\nTERMUX_PKG_REPLACES=\"libunibilium-dev\"\nTERMUX_PKG_SRCURL=https://github.com/mauke/unibilium/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\treturn\n}\n\ntermux_step_make_install() {\n\tCFLAGS+=\" -DTERMINFO_DIRS=\\\"$TERMUX_PREFIX/share/terminfo/\\\"\"\n\t$CC $CFLAGS -c -fPIC unibilium.c -o unibilium.o\n\t$CC $CFLAGS -c -fPIC uninames.c -o uninames.o\n\t$CC $CFLAGS -c -fPIC uniutil.c -o uniutil.o\n\t$CC -shared -fPIC $LDFLAGS -o $TERMUX_PREFIX/lib/libunibilium.so unibilium.o uninames.o uniutil.o\n\tcp unibilium.h $TERMUX_PREFIX/include/\n\n\tmkdir -p $PKG_CONFIG_LIBDIR\n\tsed \"s|@VERSION@|$TERMUX_PKG_VERSION|\" unibilium.pc.in | \\\n\t\tsed \"s|@INCDIR@|$TERMUX_PREFIX/include|\" | \\\n\t\tsed \"s|@LIBDIR@|$TERMUX_PREFIX/lib|\" > \\\n\t\t$PKG_CONFIG_LIBDIR/unibilium.pc\n}\n"
  },
  {
    "path": "packages/libunistring/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/libunistring/\nTERMUX_PKG_DESCRIPTION=\"Library providing functions for manipulating Unicode strings\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.9.10\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=a82e5b333339a88ea4608e4635479a1cfb2e01aafb925e1290b65710d43f610b\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/libunistring/libunistring-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv\"\nTERMUX_PKG_BREAKS=\"libunistring-dev\"\nTERMUX_PKG_REPLACES=\"libunistring-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_func_uselocale=no am_cv_langinfo_codeset=yes\"\n"
  },
  {
    "path": "packages/libusb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libusb.info/\nTERMUX_PKG_DESCRIPTION=\"A C library that provides generic access to USB devices\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_VERSION=1.0.23\nTERMUX_PKG_SRCURL=https://github.com/libusb/libusb/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=02620708c4eea7e736240a623b0b156650c39bfa93a14bcfa5f3e05270313eba\nTERMUX_PKG_BREAKS=\"libusb-dev\"\nTERMUX_PKG_REPLACES=\"libusb-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-udev\"\n\ntermux_step_pre_configure() {\n\tNOCONFIGURE=true ./autogen.sh\n}\n"
  },
  {
    "path": "packages/libuuid/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/libuuid/\nTERMUX_PKG_DESCRIPTION=\"Portable uuid C library\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.0.3\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/libuuid/libuuid-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644\nTERMUX_PKG_BREAKS=\"libuuid-dev\"\nTERMUX_PKG_REPLACES=\"libuuid-dev\"\n"
  },
  {
    "path": "packages/libuuid/gen_uuid.c.patch",
    "content": "diff -u -r ../libuuid-1.0.3/gen_uuid.c ./gen_uuid.c\n--- ../libuuid-1.0.3/gen_uuid.c\t2014-08-12 10:07:18.000000000 +0200\n+++ ./gen_uuid.c\t2017-07-07 01:46:59.528994512 +0200\n@@ -38,6 +38,8 @@\n  */\n #define _SVID_SOURCE\n \n+#include \"c.h\"\n+\n #ifdef _WIN32\n #define _WIN32_WINNT 0x0500\n #include <windows.h>\n@@ -91,7 +97,6 @@\n #include \"uuidP.h\"\n #include \"uuidd.h\"\n #include \"randutils.h\"\n-#include \"c.h\"\n \n #ifdef HAVE_TLS\n #define THREAD_LOCAL static __thread\n"
  },
  {
    "path": "packages/libuuid/uuidP.h.patch",
    "content": "diff -uNr libuuid-1.0.3/uuidP.h libuuid-1.0.3.mod/uuidP.h\n--- libuuid-1.0.3/uuidP.h\t2014-08-12 11:07:18.000000000 +0300\n+++ libuuid-1.0.3.mod/uuidP.h\t2018-06-19 16:34:52.864262517 +0300\n@@ -37,7 +37,7 @@\n \n #include \"uuid.h\"\n \n-#define LIBUUID_CLOCK_FILE\t\"/var/lib/libuuid/clock.txt\"\n+#define LIBUUID_CLOCK_FILE\t\"@TERMUX_PREFIX@/var/lib/libuuid/clock.txt\"\n \n /*\n  * Offset between 15-Oct-1582 and 1-Jan-70\n"
  },
  {
    "path": "packages/libuv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libuv.org\nTERMUX_PKG_DESCRIPTION=\"Support library with a focus on asynchronous I/O\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.33.1\nTERMUX_PKG_SRCURL=https://dist.libuv.org/dist/v${TERMUX_PKG_VERSION}/libuv-v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b4b5dc15103f7bbfecb81a0a9575841fdb7217b9f709634be8118972c1c8ce27\nTERMUX_PKG_BREAKS=\"libuv-dev\"\nTERMUX_PKG_REPLACES=\"libuv-dev\"\n\ntermux_step_pre_configure() {\n\texport PLATFORM=android\n\tsh autogen.sh\n}\n"
  },
  {
    "path": "packages/libuv/pthread-sigmask.patch",
    "content": "diff -u -r ../libuv-v1.9.1/src/unix/internal.h ./src/unix/internal.h\n--- ../libuv-v1.9.1/src/unix/internal.h\t2016-05-16 17:22:19.000000000 -0400\n+++ ./src/unix/internal.h\t2016-05-18 10:48:45.456553752 -0400\n@@ -55,14 +55,6 @@\n # include <CoreServices/CoreServices.h>\n #endif\n \n-#if defined(__ANDROID__)\n-int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset);\n-# ifdef pthread_sigmask\n-# undef pthread_sigmask\n-# endif\n-# define pthread_sigmask(how, set, oldset) uv__pthread_sigmask(how, set, oldset)\n-#endif\n-\n #define ACCESS_ONCE(type, var)                                                \\\n   (*(volatile type*) &(var))\n \ndiff -u -r ../libuv-v1.9.1/src/unix/pthread-fixes.c ./src/unix/pthread-fixes.c\n--- ../libuv-v1.9.1/src/unix/pthread-fixes.c\t2016-05-16 17:22:19.000000000 -0400\n+++ ./src/unix/pthread-fixes.c\t2016-05-18 10:47:54.209328719 -0400\n@@ -33,24 +33,3 @@\n #include <errno.h>\n #include <pthread.h>\n #include <signal.h>\n-\n-int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset) {\n-  static int workaround;\n-  int err;\n-\n-  if (workaround) {\n-    return sigprocmask(how, set, oset);\n-  } else {\n-    err = pthread_sigmask(how, set, oset);\n-    if (err) {\n-      if (err == EINVAL && sigprocmask(how, set, oset) == 0) {\n-        workaround = 1;\n-        return 0;\n-      } else {\n-        return -1;\n-      }\n-    }\n-  }\n-\n-  return 0;\n-}\n"
  },
  {
    "path": "packages/libuv/src-unix-fs.c.patch",
    "content": "diff -u -r ../libuv-v1.27.0/src/unix/fs.c ./src/unix/fs.c\n--- ../libuv-v1.27.0/src/unix/fs.c\t2019-03-16 18:31:48.000000000 +0000\n+++ ./src/unix/fs.c\t2019-03-19 22:29:31.285186496 +0000\n@@ -1059,7 +1059,8 @@\n                         int is_lstat,\n                         uv_stat_t* buf) {\n   STATIC_ASSERT(UV_ENOSYS != -1);\n-#ifdef __linux__\n+#if defined(__linux__) && !defined(__ANDROID__)\n+  /* The statx system call is prevented by seccomp on Android. */\n   static int no_statx;\n   struct uv__statx statxbuf;\n   int dirfd;\n"
  },
  {
    "path": "packages/libvorbis/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.vorbis.com/\nTERMUX_PKG_DESCRIPTION=\"Library for using the Ogg Vorbis compressed audio format\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.3.6\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/vorbis/libvorbis-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=af00bb5a784e7c9e69f56823de4637c350643deedaf333d0fa86ecdba6fcb415\nTERMUX_PKG_DEPENDS=\"libogg\"\nTERMUX_PKG_BREAKS=\"libvorbis-dev\"\nTERMUX_PKG_REPLACES=\"libvorbis-dev\"\n"
  },
  {
    "path": "packages/libvorbis/configure.patch",
    "content": "clang does not support -mno-ieee-fp:\n  https://llvm.org/bugs/show_bug.cgi?id=25615\n\ndiff -u -r ../libvorbis-1.3.6/configure ./configure\n--- ../libvorbis-1.3.6/configure\t2018-03-16 03:36:56.000000000 +0000\n+++ ./configure\t2018-03-18 20:09:59.528102502 +0000\n@@ -12734,7 +12734,7 @@\n \tcase $host in\n \t*86-*-linux*)\n \t\tDEBUG=\"-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char\"\n-\t\tCFLAGS=\"-O3 -Wall -Wextra -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char\"\n+\t\tCFLAGS=\"-O3 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char\"\n #              \tPROFILE=\"-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static\"\n \t\tPROFILE=\"-Wall -Wextra -pg -g -O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline\"\n \n"
  },
  {
    "path": "packages/libvpx/arm_cpudetect-always-neon.patch",
    "content": "diff -u -r ../libvpx-1.6.1/vpx_ports/arm_cpudetect.c ./vpx_ports/arm_cpudetect.c\n--- ../libvpx-1.6.1/vpx_ports/arm_cpudetect.c\t2017-01-12 21:27:27.000000000 +0100\n+++ ./vpx_ports/arm_cpudetect.c\t2017-01-29 23:55:05.399283897 +0100\n@@ -92,20 +92,17 @@\n }\n \n #elif defined(__ANDROID__) /* end _MSC_VER */\n-#include <cpu-features.h>\n \n int arm_cpu_caps(void) {\n   int flags;\n   int mask;\n-  uint64_t features;\n   if (!arm_cpu_env_flags(&flags)) {\n     return flags;\n   }\n   mask = arm_cpu_env_mask();\n-  features = android_getCpuFeatures();\n \n #if HAVE_NEON || HAVE_NEON_ASM\n-  if (features & ANDROID_CPU_ARM_FEATURE_NEON) flags |= HAS_NEON;\n+  flags |= HAS_NEON;\n #endif /* HAVE_NEON || HAVE_NEON_ASM */\n   return flags & mask;\n }\n"
  },
  {
    "path": "packages/libvpx/build-make-configure.sh.patch",
    "content": "diff -uNr libvpx-1.8.1/build/make/configure.sh libvpx-1.8.1.mod/build/make/configure.sh\n--- libvpx-1.8.1/build/make/configure.sh\t2019-07-16 00:55:33.000000000 +0300\n+++ libvpx-1.8.1.mod/build/make/configure.sh\t2019-07-21 18:30:38.097784114 +0300\n@@ -1100,7 +1100,6 @@\n         android*)\n           echo \"Assuming standalone build with NDK toolchain.\"\n           echo \"See build/make/Android.mk for details.\"\n-          check_add_ldflags -static\n           soft_enable unit_tests\n           ;;\n \n"
  },
  {
    "path": "packages/libvpx/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.webmproject.org\nTERMUX_PKG_DESCRIPTION=\"VP8 & VP9 Codec SDK\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.8.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/webmproject/libvpx/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=df19b8f24758e90640e1ab228ab4a4676ec3df19d23e4593375e6f3847dee03e\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"libvpx-dev\"\nTERMUX_PKG_REPLACES=\"libvpx-dev\"\n\ntermux_step_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Force fresh install of header files:\n\trm -Rf $TERMUX_PREFIX/include/vpx\n\n\texport LD=$CC\n\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\texport AS=$TERMUX_HOST_PLATFORM-as\n\t\t_CONFIGURE_TARGET=\"--target=armv7-android-gcc\"\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\texport AS=yasm\n\t\t_CONFIGURE_TARGET=\"--target=x86-android-gcc\"\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\t_CONFIGURE_TARGET=\"--force-target=arm64-v8a-android-gcc\"\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\texport AS=yasm\n\t\t_CONFIGURE_TARGET=\"--target=x86_64-android-gcc\"\n\telse\n\t\ttermux_error_exit \"Unsupported arch: $TERMUX_ARCH\"\n\tfi\n\n\t# For --disable-realtime-only, see\n\t# https://bugs.chromium.org/p/webm/issues/detail?id=800\n\t# \"The issue is that on android we soft enable realtime only.\n\t#  [..] You can enable non-realtime by setting --disable-realtime-only\"\n\t# Discovered in https://github.com/termux/termux-packages/issues/554\n\t#CROSS=${TERMUX_HOST_PLATFORM}- CC=clang CXX=clang++ $TERMUX_PKG_SRCDIR/configure \\\n\t$TERMUX_PKG_SRCDIR/configure \\\n\t\t$_CONFIGURE_TARGET \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--disable-examples \\\n\t\t--disable-realtime-only \\\n\t\t--disable-unit-tests \\\n\t\t--enable-pic \\\n\t\t--enable-vp8 \\\n\t\t--enable-shared \\\n\t\t--enable-small\n}\n"
  },
  {
    "path": "packages/libvpx/configure.patch",
    "content": "diff -u -r ../libvpx-1.6.1/configure ./configure\n--- ../libvpx-1.6.1/configure\t2017-01-12 20:27:27.000000000 +0000\n+++ ./configure\t2017-07-27 01:09:43.590546540 +0000\n@@ -500,7 +500,7 @@\n             # Supported platforms\n             ;;\n         *)\n-            if enabled gnu; then\n+            if enabled gnu || enabled android; then\n                 echo \"--enable-shared is only supported on ELF; assuming this is OK\"\n             else\n                 die \"--enable-shared only supported on ELF, OS/2, and Darwin for now\"\n"
  },
  {
    "path": "packages/libvterm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://libvterm.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Terminal emulator library\"\nTERMUX_PKG_LICENSE=\"MIT\"\n# libvterm does not do releases, take a specific commit for now:\nTERMUX_PKG_VERSION=19.09.17\n_COMMIT=fcbccd3c79bfa811800fea24db3a77384941cb70\nTERMUX_PKG_SHA256=a20ebb18f37dccc685d8518147a0db78280582138ebc76e2635830cd93572bde\nTERMUX_PKG_BREAKS=\"libvterm-dev\"\nTERMUX_PKG_REPLACES=\"libvterm-dev\"\nTERMUX_PKG_SRCURL=https://github.com/neovim/libvterm/archive/$_COMMIT.zip\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake src/encoding/DECdrawing.inc src/encoding/uk.inc\n}\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR/src\n\t$CC -std=c99 -shared -fPIC $LDFLAGS -o $TERMUX_PREFIX/lib/libvterm.so *.c -I../include -I.\n\tcp ../include/*.h $TERMUX_PREFIX/include/\n}\n"
  },
  {
    "path": "packages/libwebp/CMakeLists.txt.patch",
    "content": "diff -u -r ../libwebp-1.0.3/CMakeLists.txt ./CMakeLists.txt\n--- ../libwebp-1.0.3/CMakeLists.txt\t2019-07-04 19:32:37.000000000 +0000\n+++ ./CMakeLists.txt\t2019-07-14 17:21:56.050221574 +0000\n@@ -75,20 +75,7 @@\n \n # ##############################################################################\n # Android only.\n-if(ANDROID)\n-  include_directories(${ANDROID_NDK}/sources/android/cpufeatures)\n-  add_library(cpufeatures STATIC\n-              ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)\n-  list(APPEND INSTALLED_LIBRARIES cpufeatures)\n-  target_link_libraries(cpufeatures dl)\n-  set(WEBP_DEP_LIBRARIES ${WEBP_DEP_LIBRARIES} cpufeatures)\n-  set(WEBP_DEP_INCLUDE_DIRS ${WEBP_DEP_INCLUDE_DIRS}\n-      ${ANDROID_NDK}/sources/android/cpufeatures)\n-  add_definitions(-DHAVE_CPU_FEATURES_H=1)\n-  set(HAVE_CPU_FEATURES_H 1)\n-else()\n-  set(HAVE_CPU_FEATURES_H 0)\n-endif()\n+set(HAVE_CPU_FEATURES_H 0)\n \n function(configure_pkg_config FILE)\n   configure_file(\"${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.in\"\n"
  },
  {
    "path": "packages/libwebp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/webmproject/libwebp\nTERMUX_PKG_DESCRIPTION=\"Library to encode and decode images in WebP format\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.0.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=082d114bcb18a0e2aafc3148d43367c39304f86bf18ba0b2e766447e111a4a91\nTERMUX_PKG_BREAKS=\"libwebp-dev\"\nTERMUX_PKG_REPLACES=\"libwebp-dev\"\nTERMUX_PKG_SRCURL=https://github.com/webmproject/libwebp/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-gif\n--disable-jpeg\n--disable-libwebpdemux\n--disable-png\n--disable-tiff\n--disable-wic\n\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/man/man1\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/libwebsockets/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libwebsockets.org\nTERMUX_PKG_DESCRIPTION=\"Lightweight C websockets library\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=3.2.99.1\nTERMUX_PKG_SHA256=c0964b19cdd0311834352235216226298685b3bdf80b337c63db53fca686c284\nTERMUX_PKG_SRCURL=https://github.com/warmcat/libwebsockets/archive/216abea32c4f281632c2e45800acc26c1483c4a0.zip\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BREAKS=\"libwebsockets-dev\"\nTERMUX_PKG_REPLACES=\"libwebsockets-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DLWS_WITHOUT_TESTAPPS=ON -DLWS_WITH_STATIC=OFF\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/pkgconfig/libwebsockets_static.pc\"\n\ntermux_step_pre_configure() {\n\t# For syslog():\n\tLDFLAGS+=\" -llog\"\n}\n"
  },
  {
    "path": "packages/libx11/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X11 client-side library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.6.9\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/libX11-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=9cc7e8d000d6193fa5af580d50d689380b8287052270f5bb26a5fb6b58b2bed1\nTERMUX_PKG_DEPENDS=\"libandroid-support, libxcb\"\nTERMUX_PKG_BUILD_DEPENDS=\"xorgproto, xorg-util-macros, xtrans\"\nTERMUX_PKG_RECOMMENDS=\"xorg-xauth\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-malloc0returnsnull\"\n\ntermux_step_post_make_install() {\n\tln -sfr \"${TERMUX_PREFIX}/lib/libX11.so\" \"${TERMUX_PREFIX}/lib/libX11.so.6\"\n}\n"
  },
  {
    "path": "packages/libx11/src-CrGlCur.c.patch",
    "content": "diff -uNr libX11-1.6.7/src/CrGlCur.c libX11-1.6.7.mod/src/CrGlCur.c\n--- libX11-1.6.7/src/CrGlCur.c\t2018-10-09 17:27:08.000000000 +0300\n+++ libX11-1.6.7.mod/src/CrGlCur.c\t2018-11-28 19:31:06.941489053 +0200\n@@ -55,7 +55,7 @@\n #endif\n \n #ifndef LIBXCURSOR\n-#define LIBXCURSOR \"libXcursor.so.1\"\n+#define LIBXCURSOR \"libXcursor.so\"\n #endif\n \n static char libraryName[] = LIBXCURSOR;\n"
  },
  {
    "path": "packages/libx11/src-XlibInt.c.patch",
    "content": "diff -uNr libX11-1.6.8/src/XlibInt.c libX11-1.6.8.mod/src/XlibInt.c\n--- libX11-1.6.8/src/XlibInt.c\t2019-06-17 17:47:35.000000000 +0300\n+++ libX11-1.6.8.mod/src/XlibInt.c\t2019-06-29 22:13:06.054460413 +0300\n@@ -1263,7 +1263,7 @@\n     WSASetLastError(last_error);\n #else\n     last_error = errno;\n-    ioctl(ConnectionNumber(dpy), FIONREAD, &bytes);\n+    ioctl(ConnectionNumber(dpy), /* FIONREAD */ 0x541B, &bytes);\n     errno = last_error;\n #endif\n     return bytes;\n"
  },
  {
    "path": "packages/libx264/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.videolan.org/developers/x264.html\nTERMUX_PKG_DESCRIPTION=\"Library for encoding video streams into the H.264/MPEG-4 AVC format\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=20190215\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=731c26a106dd97509feaaba2e6b57b27c754031d48186af6e1474cc0e1eee582\nTERMUX_PKG_BREAKS=\"libx264-dev\"\nTERMUX_PKG_REPLACES=\"libx264-dev\"\nTERMUX_PKG_SRCURL=http://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${TERMUX_PKG_VERSION}-2245-stable.tar.bz2\n# Avoid linking against ffmpeg libraries to avoid circular dependency:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-swscale\n--disable-lavf\"\n\ntermux_step_pre_configure() {\n\t#if [ $TERMUX_ARCH = \"i686\" -o $TERMUX_ARCH = \"x86_64\" ]; then\n\tif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\t# Avoid text relocations on i686, see:\n\t\t# https://mailman.videolan.org/pipermail/x264-devel/2016-March/011589.html\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --disable-asm\"\n\t\t# Avoid errors such as \"relocation R_386_GOTOFF against preemptible symbol\n\t\t# x264_significant_coeff_flag_offset cannot be used when making a shared object\":\n\t\tLDFLAGS+=\" -fuse-ld=bfd\"\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\t# Avoid requiring nasm for now:\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --disable-asm\"\n\tfi\n}\n"
  },
  {
    "path": "packages/libx264/x264.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=bin\nTERMUX_SUBPKG_DESCRIPTION=\"Commandline video encoder for the H.264/MPEG-4 AVC format\"\n"
  },
  {
    "path": "packages/libx265/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://x265.org/\nTERMUX_PKG_DESCRIPTION=\"H.265/HEVC video stream encoder library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.2.1\nTERMUX_PKG_SRCURL=https://bitbucket.org/multicoreware/x265/downloads/x265_$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=fb9badcf92364fd3567f8b5aa0e5e952aeea7a39a2b864387cec31e3b58cbbcc\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"libx265-dev\"\nTERMUX_PKG_REPLACES=\"libx265-dev\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\t# Avoid text relocations.\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DENABLE_ASSEMBLY=OFF\"\n\tfi\n\tTERMUX_PKG_SRCDIR=\"$TERMUX_PKG_SRCDIR/source\"\n}\n\n"
  },
  {
    "path": "packages/libx265/source-CMakeLists.txt.patch",
    "content": "Submitted upstream at:\nhttps://bitbucket.org/multicoreware/x265/pull-requests/31\n\ndiff -u -r ../x265_2.2/source/CMakeLists.txt ./source/CMakeLists.txt\n--- ../x265_2.2/source/CMakeLists.txt\t2016-12-23 00:57:39.000000000 -0500\n+++ ./source/CMakeLists.txt\t2017-01-03 18:42:19.823674722 -0500\n@@ -80,7 +80,10 @@\n endif()\n \n if(UNIX)\n-    list(APPEND PLATFORM_LIBS pthread)\n+    find_library(LIBPTHREAD pthread)\n+    if(LIBPTHREAD)\n+         list(APPEND PLATFORM_LIBS pthread)\n+    endif()\n     find_library(LIBRT rt)\n     if(LIBRT)\n         list(APPEND PLATFORM_LIBS rt)\n"
  },
  {
    "path": "packages/libx265/x265.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/x265\"\nTERMUX_SUBPKG_DESCRIPTION=\"H.265/HEVC video stream encoder tool\"\n"
  },
  {
    "path": "packages/libxapian/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xapian.org\nTERMUX_PKG_DESCRIPTION=\"Xapian search engine library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.4.14\nTERMUX_PKG_SRCURL=http://oligarchy.co.uk/xapian/${TERMUX_PKG_VERSION}/xapian-core-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=975a7ac018c9d34a15cc94a3ecc883204403469f748907e5c4c64d0aec2e4949\n# Note that we cannot /proc/sys/kernel/random/uuid (permission denied on\n# new android versions) so need libuuid.\nTERMUX_PKG_DEPENDS=\"libc++, libuuid, zlib\"\nTERMUX_PKG_BREAKS=\"libxapian-dev\"\nTERMUX_PKG_REPLACES=\"libxapian-dev\"\n"
  },
  {
    "path": "packages/libxapian/xapian-tools.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"\nshare/xapian-core\nshare/man/man1/copydatabase.1\nshare/man/man1/xapian-compact.1\nshare/man/man1/xapian-metadata.1\nshare/man/man1/xapian-delve.1\nshare/man/man1/xapian-progsrv.1\nshare/man/man1/xapian-replicate.1\nshare/man/man1/xapian-tcpsrv.1\nshare/man/man1/quest.1\nshare/man/man1/xapian-check.1\nshare/man/man1/xapian-replicate-server.1\nbin/simpleexpand\nbin/xapian-metadata\nbin/simpleindex\nbin/quest\nbin/xapian-replicate-server\nbin/xapian-check\nbin/xapian-tcpsrv\nbin/copydatabase\nbin/xapian-progsrv\nbin/simplesearch\nbin/xapian-compact\nbin/xapian-delve\nbin/xapian-replicate\n\"\nTERMUX_SUBPKG_DESCRIPTION=\"Basic tools for the Xapian search engine\"\n"
  },
  {
    "path": "packages/libxau/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X11 authorisation library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.0.9\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/libXau-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=ccf8cbf0dbf676faa2ea0a6d64bcc3b6746064722b606c8c52917ed00dcb73ec\nTERMUX_PKG_BUILD_DEPENDS=\"xorgproto\"\n"
  },
  {
    "path": "packages/libxau/libXau-1.0.8_AuLock.c.patch",
    "content": "diff -uNr libXau-1.0.8/AuLock.c libXau-1.0.8.mod/AuLock.c\n--- libXau-1.0.8/AuLock.c\t2013-05-25 01:04:09.000000000 +0300\n+++ libXau-1.0.8.mod/AuLock.c\t2017-11-23 14:08:52.004479977 +0200\n@@ -91,7 +91,7 @@\n \t    } else\n #endif\n \t    {\n-\t    \tif (link (creat_name, link_name) != -1)\n+\t    \tif (symlink (creat_name, link_name) != -1)\n \t\t    return LOCK_SUCCESS;\n \t\tif (errno == ENOENT) {\n \t\t    creat_fd = -1;\t/* force re-creat next time around */\n"
  },
  {
    "path": "packages/libxcb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xcb.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X11 client-side library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.13.1\nTERMUX_PKG_REVISION=9\nTERMUX_PKG_SRCURL=https://xcb.freedesktop.org/dist/libxcb-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=a89fb7af7a11f43d2ce84a844a4b38df688c092bf4b67683aef179cdf2a647c4\nTERMUX_PKG_DEPENDS=\"libxau, libxdmcp\"\nTERMUX_PKG_BUILD_DEPENDS=\"xcb-proto, xorg-util-macros\"\nTERMUX_PKG_RECOMMENDS=\"xorg-xauth\"\n"
  },
  {
    "path": "packages/libxcb/libxcb-1.12_configure.patch",
    "content": "--- ./configure\t2016-05-18 22:14:50.000000000 +0530\n+++ ../configure\t2017-02-08 22:48:44.459892477 +0530\n@@ -19666,7 +19666,7 @@\n $as_echo \"yes\" >&6; }\n \n fi\n-NEEDED=\"pthread-stubs xau >= 0.99.2\"\n+NEEDED=\"xau >= 0.99.2\"\n \n pkg_failed=no\n { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for NEEDED\" >&5\n"
  },
  {
    "path": "packages/libxcb/libxcb-1.12_src_xcb_util.c.patch",
    "content": "diff -uNr libxcb-1.12/src/xcb_util.c libxcb-1.12.mod/src/xcb_util.c\n--- libxcb-1.12/src/xcb_util.c\t2016-05-09 19:10:55.000000000 +0300\n+++ libxcb-1.12.mod/src/xcb_util.c\t2017-11-22 00:13:51.337058457 +0200\n@@ -229,7 +229,7 @@\n #ifdef __hpux\n     static const char unix_base[] = \"/usr/spool/sockets/X11/\";\n #else\n-    static const char unix_base[] = \"/tmp/.X11-unix/X\";\n+    static const char unix_base[] = \"/data/data/com.termux/files/usr/tmp/.X11-unix/X\";\n #endif\n     const char *base = unix_base;\n     size_t filelen;\n"
  },
  {
    "path": "packages/libxdmcp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X11 Display Manager Control Protocol library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.1.3\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/archive/individual/lib/libXdmcp-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=20523b44aaa513e17c009e873ad7bbc301507a3224c232610ce2e099011c6529\nTERMUX_PKG_BUILD_DEPENDS=\"xorgproto, xorg-util-macros\"\n"
  },
  {
    "path": "packages/libxext/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X11 miscellaneous extensions library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.3.4\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/libXext-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=59ad6fcce98deaecc14d39a672cf218ca37aba617c9a0f691cac3bcd28edf82b\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-malloc0returnsnull\"\nTERMUX_PKG_DEPENDS=\"libx11, libxau, libxcb, libxdmcp\"\nTERMUX_PKG_BUILD_DEPENDS=\"xorgproto, xorg-util-macros\"\n"
  },
  {
    "path": "packages/libxft/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"FreeType-based font drawing library for X\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.3.3\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/libXft-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=225c68e616dd29dbb27809e45e9eadf18e4d74c50be43020ef20015274529216\nTERMUX_PKG_DEPENDS=\"fontconfig, freetype, libbz2, liblzma, libpng, libuuid, libx11, libxau, libxcb, libxdmcp, libxml2, libxrender\"\n"
  },
  {
    "path": "packages/libxml2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.xmlsoft.org\nTERMUX_PKG_DESCRIPTION=\"Library for parsing XML documents\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.9.10\nTERMUX_PKG_SRCURL=ftp://xmlsoft.org/libxml2/libxml2-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-python\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/gtk-doc\"\nTERMUX_PKG_DEPENDS=\"libiconv, liblzma, zlib\"\nTERMUX_PKG_BREAKS=\"libxml2-dev\"\nTERMUX_PKG_REPLACES=\"libxml2-dev\"\n"
  },
  {
    "path": "packages/libxml2/fix-catalog-paths.patch",
    "content": "diff -uNr libxml2-2.9.7/catalog.c libxml2-2.9.7.mod/catalog.c\n--- libxml2-2.9.7/catalog.c\t2017-10-26 10:54:40.000000000 +0300\n+++ libxml2-2.9.7.mod/catalog.c\t2017-11-29 15:19:49.877207795 +0200\n@@ -70,15 +70,15 @@\n #define XML_URN_PUBID \"urn:publicid:\"\n #define XML_CATAL_BREAK ((xmlChar *) -1)\n #ifndef XML_XML_DEFAULT_CATALOG\n-#define XML_XML_DEFAULT_CATALOG \"file:///etc/xml/catalog\"\n+#define XML_XML_DEFAULT_CATALOG \"file://@TERMUX_PREFIX@/etc/xml/catalog\"\n #endif\n #ifndef XML_SGML_DEFAULT_CATALOG\n-#define XML_SGML_DEFAULT_CATALOG \"file:///etc/sgml/catalog\"\n+#define XML_SGML_DEFAULT_CATALOG \"file://@TERMUX_PREFIX@/etc/sgml/catalog\"\n #endif\n \n #if defined(_WIN32) && defined(_MSC_VER)\n #undef XML_XML_DEFAULT_CATALOG\n-static char XML_XML_DEFAULT_CATALOG[256] = \"file:///etc/xml/catalog\";\n+static char XML_XML_DEFAULT_CATALOG[256] = \"file://@TERMUX_PREFIX@/etc/xml/catalog\";\n #if defined(_WIN32_WCE)\n /* Windows CE don't have a A variant */\n #define GetModuleHandleA GetModuleHandle\ndiff -uNr libxml2-2.9.7/xmlcatalog.c libxml2-2.9.7.mod/xmlcatalog.c\n--- libxml2-2.9.7/xmlcatalog.c\t2017-10-26 10:54:40.000000000 +0300\n+++ libxml2-2.9.7.mod/xmlcatalog.c\t2017-11-29 15:20:40.207875604 +0200\n@@ -43,7 +43,7 @@\n \n \n #ifndef XML_SGML_DEFAULT_CATALOG\n-#define XML_SGML_DEFAULT_CATALOG \"/etc/sgml/catalog\"\n+#define XML_SGML_DEFAULT_CATALOG \"@TERMUX_PREFIX@/etc/sgml/catalog\"\n #endif\n \n /************************************************************************\ndiff -uNr libxml2-2.9.7/xmllint.c libxml2-2.9.7.mod/xmllint.c\n--- libxml2-2.9.7/xmllint.c\t2017-10-26 10:54:40.000000000 +0300\n+++ libxml2-2.9.7.mod/xmllint.c\t2017-11-29 15:20:08.607456724 +0200\n@@ -87,7 +87,7 @@\n #endif\n \n #ifndef XML_XML_DEFAULT_CATALOG\n-#define XML_XML_DEFAULT_CATALOG \"file:///etc/xml/catalog\"\n+#define XML_XML_DEFAULT_CATALOG \"file://@TERMUX_PREFIX@/etc/xml/catalog\"\n #endif\n \n typedef enum {\n"
  },
  {
    "path": "packages/libxml2/libxml2-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/xmllint bin/xmlcatalog share/man/man1/xmllint.1.gz share/man/man1/xmlcatalog.1.gz\"\nTERMUX_SUBPKG_DESCRIPTION=\"XML utilities\"\n"
  },
  {
    "path": "packages/libxrender/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X Rendering Extension client library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.9.10\nTERMUX_PKG_REVISION=11\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/libXrender-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=c06d5979f86e64cabbde57c223938db0b939dff49fdb5a793a1d3d0396650949\nTERMUX_PKG_DEPENDS=\"libx11\"\nTERMUX_PKG_BUILD_DEPENDS=\"xorgproto\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-malloc0returnsnull\"\n"
  },
  {
    "path": "packages/libxslt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://xmlsoft.org/libxslt/\nTERMUX_PKG_DESCRIPTION=\"XSLT processing library\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.1.34\nTERMUX_PKG_SHA256=98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f\nTERMUX_PKG_SRCURL=ftp://xmlsoft.org/libxslt/libxslt-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-python\"\nTERMUX_PKG_DEPENDS=\"libxml2, libgcrypt, libgpg-error, zlib\"\nTERMUX_PKG_BREAKS=\"libxslt-dev\"\nTERMUX_PKG_REPLACES=\"libxslt-dev\"\n"
  },
  {
    "path": "packages/libxslt/xsltproc.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/xsltproc share/man/man1/xsltproc.1.gz\"\nTERMUX_SUBPKG_DESCRIPTION=\"XSLT command line processor\"\n"
  },
  {
    "path": "packages/libxss/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X11 Screen Saver extension library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.2.3\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/libXScrnSaver-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=f917075a1b7b5a38d67a8b0238eaab14acd2557679835b154cf2bca576e89bf8\nTERMUX_PKG_DEPENDS=\"libx11, libxau, libxcb, libxdmcp, libxext\"\nTERMUX_PKG_BUILD_DEPENDS=\"xorgproto, xorg-util-macros\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-malloc0returnsnull\"\n"
  },
  {
    "path": "packages/libyaml/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://pyyaml.org/wiki/LibYAML\nTERMUX_PKG_DESCRIPTION=\"LibYAML is a YAML 1.1 parser and emitter written in C\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.2.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=46bca77dc8be954686cff21888d6ce10ca4016b360ae1f56962e6882a17aa1fe\nTERMUX_PKG_BREAKS=\"libyaml-dev\"\nTERMUX_PKG_REPLACES=\"libyaml-dev\"\nTERMUX_PKG_SRCURL=https://github.com/yaml/libyaml/archive/$TERMUX_PKG_VERSION.tar.gz\n\ntermux_step_pre_configure() {\n\t./bootstrap\n}\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PREFIX/lib\n\tln -s -f libyaml-0.so libyaml.so\n}\n"
  },
  {
    "path": "packages/libzip/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://libzip.org/\nTERMUX_PKG_DESCRIPTION=\"Library for reading, creating, and modifying zip archives\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.5.2\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://libzip.org/download/libzip-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=be694a4abb2ffe5ec02074146757c8b56084dbcebf329123c84b205417435e15\nTERMUX_PKG_DEPENDS=\"libbz2, openssl, zlib\"\nTERMUX_PKG_BREAKS=\"libzip-dev\"\nTERMUX_PKG_REPLACES=\"libzip-dev\"\n"
  },
  {
    "path": "packages/libzmq/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://zeromq.org/\nTERMUX_PKG_DESCRIPTION=\"Fast messaging system built on sockets. C and C++ bindings. aka 0MQ, ZMQ.\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=4.3.2\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/zeromq/libzmq/releases/download/v${TERMUX_PKG_VERSION}/zeromq-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763\nTERMUX_PKG_DEPENDS=\"libc++, libsodium\"\nTERMUX_PKG_BREAKS=\"libzmq-dev\"\nTERMUX_PKG_REPLACES=\"libzmq-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-libsodium --disable-libunwind --disable-Werror\"\n\ntermux_step_post_extract_package() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/libzopfli/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/google/zopfli\nTERMUX_PKG_DESCRIPTION=\"New zlib compatible compressor library\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.0.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/google/zopfli/archive/zopfli-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e955a7739f71af37ef3349c4fa141c648e8775bceb2195be07e86f8e638814bd\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"libzopfli-dev\"\nTERMUX_PKG_REPLACES=\"libzopfli-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DZOPFLI_BUILD_SHARED=ON\"\n"
  },
  {
    "path": "packages/libzopfli/zopfli.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/\"\nTERMUX_SUBPKG_DESCRIPTION=\"New zlib compatible compressor tools\"\n"
  },
  {
    "path": "packages/lighttpd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.lighttpd.net\nTERMUX_PKG_DESCRIPTION=\"Fast webserver with minimal memory footprint\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.4.54\nTERMUX_PKG_SHA256=cf14cce2254a96d8fcb6d3181e1a3c29a8f832531c3e86ff6f2524ecda9a8721\nTERMUX_PKG_SRCURL=https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-bzip2 --with-openssl --with-pcre --with-zlib\"\nTERMUX_PKG_DEPENDS=\"libbz2, openssl, pcre, libcrypt, libandroid-glob, zlib\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/lighttpd-angel\"\n\ntermux_step_pre_configure() {\n\t# liblog for syslog:\n\tLDFLAGS=\"$LDFLAGS -llog -landroid-glob\"\n}\n"
  },
  {
    "path": "packages/links/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://links.twibright.com\nTERMUX_PKG_DESCRIPTION=\"Links is a text and graphics mode WWW browser\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.20.2\nTERMUX_PKG_SRCURL=http://links.twibright.com/download/links-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=f0ec13b019e5501ef29858bf61a3bf89cece0b0f065b5064be242bce84e675bd\nTERMUX_PKG_DEPENDS=\"libbz2, libevent, liblzma, openssl, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\" --mandir=$TERMUX_PREFIX/share/man\"\n"
  },
  {
    "path": "packages/links/fix-hardcoded-paths.patch",
    "content": "diff -uNr links-2.18/dns.c links-2.18.mod/dns.c\n--- links-2.18/dns.c\t2018-09-01 00:37:34.000000000 +0300\n+++ links-2.18.mod/dns.c\t2019-01-30 17:35:36.615018534 +0200\n@@ -203,7 +203,7 @@\n \t\tif (rs == -1) _exit(1);\n \t\tEINTRLOOP(rs, close(pi[1]));\n \t\tEINTRLOOP(rs, execlp(\"host\", \"host\", cast_const_char name, (char *)NULL));\n-\t\tEINTRLOOP(rs, execl(\"/usr/sbin/host\", \"host\", cast_const_char name, (char *)NULL));\n+\t\tEINTRLOOP(rs, execl(\"@TERMUX_PREFIX@/bin/host\", \"host\", cast_const_char name, (char *)NULL));\n \t\t_exit(1);\n \t}\n \tEINTRLOOP(rs, close(pi[1]));\ndiff -uNr links-2.18/fn_impl.c links-2.18.mod/fn_impl.c\n--- links-2.18/fn_impl.c\t2018-08-25 13:53:57.000000000 +0300\n+++ links-2.18.mod/fn_impl.c\t2019-01-30 17:34:22.214761816 +0200\n@@ -95,7 +95,7 @@\n #ifdef P_tmpdir\n \t\t\td = cast_uchar(P_tmpdir);\n #else\n-\t\t\td = cast_uchar \"/tmp\";\n+\t\t\td = cast_uchar \"@TERMUX_PREFIX@/tmp\";\n #endif\n \t\t}\n \t}\ndiff -uNr links-2.18/os_dep.c links-2.18.mod/os_dep.c\n--- links-2.18/os_dep.c\t2019-01-11 20:24:12.000000000 +0200\n+++ links-2.18.mod/os_dep.c\t2019-01-30 17:36:13.688483362 +0200\n@@ -1505,7 +1505,7 @@\n \t}\n \t/* UWin corrupts heap if we use threads and fork */\n \tfd_lock();\n-\tpid = spawnl(\"/bin/sh\", \"/bin/sh\", \"-c\", arg, (char *)NULL);\n+\tpid = spawnl(\"@TERMUX_PREFIX@/bin/sh\", \"@TERMUX_PREFIX@/bin/sh\", \"-c\", arg, (char *)NULL);\n \tfd_unlock();\n #else\n #if 1\t\t/* spawn breaks mouse, do this only in graphics mode */\n@@ -3004,7 +3004,7 @@\n {\n \tunsigned char *param_x = stracpy(param);\n \tadd_to_strn(&param_x, cast_uchar \"'\");\n-\texec_new_links(term, cast_uchar(INTERIX_START_COMMAND \" '\\\"Links\\\"' posix /u /c /bin/sh -c '\"), exe, param_x);\n+\texec_new_links(term, cast_uchar(INTERIX_START_COMMAND \" '\\\"Links\\\"' posix /u /c @TERMUX_PREFIX@/bin/sh -c '\"), exe, param_x);\n \tmem_free(param_x);\n \treturn 0;\n }\ndiff -uNr links-2.18/os_dep.h links-2.18.mod/os_dep.h\n--- links-2.18/os_dep.h\t2018-09-23 01:22:10.000000000 +0300\n+++ links-2.18.mod/os_dep.h\t2019-01-30 17:34:54.501538658 +0200\n@@ -55,9 +55,9 @@\n #define FS_UNIX_USERS\n #define SYSTEM_ID SYS_UNIX\n #define SYSTEM_NAME \"Unix\"\n-#define DEFAULT_SHELL \"/bin/sh\"\n+#define DEFAULT_SHELL \"@TERMUX_PREFIX@/bin/sh\"\n #define GETSHELL getenv(\"SHELL\")\n-#define SHARED_CONFIG_DIR \"/etc/\"\n+#define SHARED_CONFIG_DIR \"@TERMUX_PREFIX@/etc/\"\n #ifdef HAVE_SYS_UN_H\n #define USE_AF_UNIX\n #endif\n"
  },
  {
    "path": "packages/linux-man-pages/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.kernel.org/doc/man-pages/\nTERMUX_PKG_DESCRIPTION=\"Man pages for linux kernel and C library interfaces\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=(5.03\n\t\t    2013)\nTERMUX_PKG_SHA256=(7fe13aeaf9081f4c134c711270a66e264dce24dae3df7e9fec3dd18c8a485120\n\t\t   19633a5c75ff7deab35b1d2c3d5b7748e7bd4ef4ab598b647bb7e7f60b90a808)\nTERMUX_PKG_SRCURL=(https://www.kernel.org/pub/linux/docs/man-pages/man-pages-${TERMUX_PKG_VERSION}.tar.xz\n\t\t   https://www.kernel.org/pub/linux/docs/man-pages/man-pages-posix/man-pages-posix-${TERMUX_PKG_VERSION[1]}-a.tar.xz)\nTERMUX_PKG_DEPENDS=\"man\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"prefix=$TERMUX_PREFIX\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n# Problems with changing permissions of non-built files\nTERMUX_MAKE_PROCESSSES=1\n\n# man.7 and mdoc.7 is included with mandoc:\n# getconf man page included with the getconf package:\n# iconv-related manpages included with libiconv package:\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nshare/man/man1\nshare/man/man3/iconv.3\nshare/man/man3/iconv_close.3\nshare/man/man3/iconv_open.3\nshare/man/man8\nshare/man/man7/man.7\nshare/man/man7/mdoc.7\nshare/man/man1p/getconf.1p\"\n\n\ntermux_step_pre_configure() {\n\t# Bundle posix man pages in same package:\n\tcd man-pages-posix-2013-a\n\tmake install\n}\n"
  },
  {
    "path": "packages/littlecms/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.littlecms.com/\nTERMUX_PKG_DESCRIPTION=\"Color management library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.9\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=48c6fdf98396fa245ed86e622028caf49b96fa22f3e5734f853f806fbc8e7d20\nTERMUX_PKG_BREAKS=\"littlecms-dev\"\nTERMUX_PKG_REPLACES=\"littlecms-dev\"\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/lcms/lcms/${TERMUX_PKG_VERSION}/lcms2-${TERMUX_PKG_VERSION}.tar.gz\n"
  },
  {
    "path": "packages/littlecms/littlecms-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ share/man/man1/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Color management utilities\"\nTERMUX_SUBPKG_DEPENDS=\"libtiff\"\n"
  },
  {
    "path": "packages/llbuild/CMakeLists.txt.patch",
    "content": "diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex 0c30c55..26336a1 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -202,7 +202,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL \"Windows\")\n endif()\n \n # On BSD and Linux, always build with PIC.\n-if(${CMAKE_SYSTEM_NAME} MATCHES \".*BSD\" OR ${CMAKE_SYSTEM_NAME} MATCHES \"Linux\")\n+if(${CMAKE_SYSTEM_NAME} MATCHES \".*BSD\" OR ${CMAKE_SYSTEM_NAME} MATCHES \"Linux\" OR\n+   CMAKE_SYSTEM_NAME STREQUAL Android)\n   set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} -fPIC\")\n   set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -fPIC\")\n endif ()\n"
  },
  {
    "path": "packages/llbuild/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-llbuild\nTERMUX_PKG_DESCRIPTION=\"A low-level build system, used by the Swift Package Manager\"\nTERMUX_PKG_LICENSE=\"Apache-2.0, NCSA\"\nTERMUX_PKG_VERSION=5.1\nTERMUX_PKG_SRCURL=https://github.com/apple/swift-llbuild/archive/swift-${TERMUX_PKG_VERSION}-RELEASE.tar.gz\nTERMUX_PKG_SHA256=cbd228619d1172f7f6d38983f0419226baa1cfbecc6afac891856fcb46ba4920\nTERMUX_PKG_DEPENDS=\"libc++, libandroid-spawn, libsqlite\"\n"
  },
  {
    "path": "packages/llbuild/include-llbuild-BuildSystem-BuildSystemFrontend.h.patch",
    "content": "commit 111d9828e6422447321196b1826c0a666a0632d2\nAuthor: Igor Makarov <igormaka@gmail.com>\nDate:   Wed Aug 21 15:06:30 2019 +0300\n\n    change ProcessHandle int width so it complies with platform int width\n\ndiff --git a/include/llbuild/BuildSystem/BuildSystemFrontend.h b/include/llbuild/BuildSystem/BuildSystemFrontend.h\nindex b14e9c8..53bf570 100644\n--- a/include/llbuild/BuildSystem/BuildSystemFrontend.h\n+++ b/include/llbuild/BuildSystem/BuildSystemFrontend.h\n@@ -116,7 +116,7 @@ public:\n   /// Handle used to communicate information about a launched process.\n   struct ProcessHandle {\n     /// Opaque ID.\n-    uintptr_t id;\n+    uint64_t id;\n   };\n   \n private:\n"
  },
  {
    "path": "packages/llbuild/include-llvm-Config-config.h.patch",
    "content": "diff --git a/include/llvm/Config/config.h b/include/llvm/Config/config.h\nindex 9cf1c89..9af2945 100644\n--- a/include/llvm/Config/config.h\n+++ b/include/llvm/Config/config.h\n@@ -14,7 +14,9 @@\n #define ENABLE_CRASH_OVERRIDES 1\n \n /* Define to 1 if you have the `backtrace' function. */\n+#if !defined(__ANDROID__)\n #define HAVE_BACKTRACE TRUE\n+#endif\n \n #define BACKTRACE_HEADER <execinfo.h>\n \n@@ -74,7 +76,11 @@\n /* #undef HAVE_FFI_H */\n \n /* Define to 1 if you have the `futimens' function. */\n+#if defined(__ANDROID__)\n+#define HAVE_FUTIMENS 1\n+#else\n /* #undef HAVE_FUTIMENS */\n+#endif\n \n /* Define to 1 if you have the `futimes' function. */\n #define HAVE_FUTIMES 1\n@@ -104,7 +110,9 @@\n #define HAVE_LIBPTHREAD 1\n \n /* Define to 1 if you have the `pthread_getname_np' function. */\n+#if !defined(__ANDROID__)\n #define HAVE_PTHREAD_GETNAME_NP 1\n+#endif\n \n /* Define to 1 if you have the `pthread_setname_np' function. */\n #define HAVE_PTHREAD_SETNAME_NP 1\n"
  },
  {
    "path": "packages/llbuild/lib-Basic-PlatformUtility.cpp.patch",
    "content": "diff --git a/lib/Basic/PlatformUtility.cpp b/lib/Basic/PlatformUtility.cpp\nindex afbfa01..3a495b8 100644\n--- a/lib/Basic/PlatformUtility.cpp\n+++ b/lib/Basic/PlatformUtility.cpp\n@@ -324,7 +324,7 @@ std::string sys::makeTmpDir() {\n   CreateDirectoryW((LPCWSTR)wPath.data(), NULL);\n   return std::string(path);\n #else\n-  char tmpDirPathBuf[] = \"/tmp/fileXXXXXX\";\n+  char tmpDirPathBuf[] = \"@TERMUX_PREFIX@/tmp/fileXXXXXX\";\n   return std::string(mkdtemp(tmpDirPathBuf));\n #endif\n }\n"
  },
  {
    "path": "packages/llbuild/lib-llvm-Support-CmakeLists.txt.patch",
    "content": "diff --git a/lib/llvm/Support/CMakeLists.txt b/lib/llvm/Support/CMakeLists.txt\nindex 8e79e18..a844183 100644\n--- a/lib/llvm/Support/CMakeLists.txt\n+++ b/lib/llvm/Support/CMakeLists.txt\n@@ -45,3 +45,7 @@ endif()\n if(${CMAKE_SYSTEM_NAME} MATCHES \"Linux\")\n   target_link_libraries(llvmSupport pthread dl)\n endif()\n+\n+if(${CMAKE_SYSTEM_NAME} MATCHES \"Android\")\n+  target_link_libraries(llvmSupport PRIVATE android-spawn)\n+endif()\n"
  },
  {
    "path": "packages/llbuild/products-llbuild-CMakeLists.txt.patch",
    "content": "diff --git a/products/llbuild/CMakeLists.txt b/products/llbuild/CMakeLists.txt\nindex 6ec9d16..3d4b9dc 100644\n--- a/products/llbuild/CMakeLists.txt\n+++ b/products/llbuild/CMakeLists.txt\n@@ -13,3 +13,7 @@ target_link_libraries(llbuild\n if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL \"Windows\")\n   target_link_libraries(llbuild curses)\n endif()\n+\n+install(TARGETS llbuild\n+        COMPONENT llbuild\n+        DESTINATION bin)\n"
  },
  {
    "path": "packages/lldb/ArchSpec.cpp.patch",
    "content": "--- source/Utility/ArchSpec.cpp.orig\t2019-03-29 01:49:35.969953714 +0000\n+++ ./source/Utility/ArchSpec.cpp\t2019-03-29 01:49:39.102006003 +0000\n@@ -197,7 +197,11 @@\n      \"i486\"},\n     {eByteOrderLittle, 4, 1, 15, llvm::Triple::x86,\n      ArchSpec::eCore_x86_32_i486sx, \"i486sx\"},\n+#ifndef __ANDROID__ \n     {eByteOrderLittle, 4, 1, 15, llvm::Triple::x86, ArchSpec::eCore_x86_32_i686,\n+#else\n+    {eByteOrderLittle, 4, 1, 15, llvm::Triple::x86, ArchSpec::eCore_x86_32_i386,\n+#endif\n      \"i686\"},\n \n     {eByteOrderLittle, 8, 1, 15, llvm::Triple::x86_64,\n"
  },
  {
    "path": "packages/lldb/Editline.h.patch",
    "content": "--- ../cache/lldb-6.0.0.src/include/lldb/Host/Editline.h\t2017-05-25 20:12:30.000000000 +0000\n+++ ./include/lldb/Host/Editline.h\t2018-04-13 09:51:29.606274657 +0000\n@@ -56,10 +56,9 @@\n \n #if defined(_WIN32)\n #include \"lldb/Host/windows/editlinewin.h\"\n-#elif !defined(__ANDROID__)\n-#include <histedit.h>\n #endif\n \n+#include <histedit.h>\n #include <mutex>\n #include <string>\n #include <vector>\n"
  },
  {
    "path": "packages/lldb/LLDBStandalone.cmake.patch",
    "content": "--- cmake/modules/LLDBStandalone.cmake.orig\t2019-10-28 03:16:27.880770642 +0000\n+++ ./cmake/modules/LLDBStandalone.cmake\t2019-10-28 03:16:53.936718250 +0000\n@@ -32,12 +32,7 @@\n set(LLVM_DEFAULT_EXTERNAL_LIT ${lit_full_path} CACHE PATH \"Path to llvm-lit\")\n \n if(CMAKE_CROSSCOMPILING)\n-  set(LLVM_NATIVE_BUILD \"${LLVM_BINARY_DIR}/NATIVE\")\n-  if (NOT EXISTS \"${LLVM_NATIVE_BUILD}\")\n-    message(FATAL_ERROR\n-      \"Attempting to cross-compile LLDB standalone but no native LLVM build\n-      found. Please cross-compile LLVM as well.\")\n-  endif()\n+  set(LLVM_NATIVE_BUILD \"${LLVM_BINARY_DIR}/\")\n \n   if (CMAKE_HOST_SYSTEM_NAME MATCHES \"Windows\")\n     set(HOST_EXECUTABLE_SUFFIX \".exe\")\n"
  },
  {
    "path": "packages/lldb/ProcessLauncherPosixFork.cpp.patch",
    "content": "--- source/Host/posix/ProcessLauncherPosixFork.cpp.orig\t2019-11-03 00:42:25.977205716 +0000\n+++ ./source/Host/posix/ProcessLauncherPosixFork.cpp\t2019-11-03 00:43:11.313499292 +0000\n@@ -136,8 +136,8 @@\n \n   if (info.GetFlags().Test(eLaunchFlagDebug)) {\n     // Do not inherit setgid powers.\n-    if (setgid(getgid()) != 0)\n-      ExitWithError(error_fd, \"setgid\");\n+ //   if (setgid(getgid()) != 0)\n+   //   ExitWithError(error_fd, \"setgid\");\n \n     // HACK:\n     // Close everything besides stdin, stdout, and stderr that has no file\n"
  },
  {
    "path": "packages/lldb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://lldb.llvm.org\nTERMUX_PKG_DESCRIPTION=\"LLVM based debugger\"\nTERMUX_PKG_LICENSE=\"NCSA\"\nTERMUX_PKG_VERSION=9.0.0\nTERMUX_PKG_SRCURL=https://releases.llvm.org/$TERMUX_PKG_VERSION/lldb-$TERMUX_PKG_VERSION.src.tar.xz\nTERMUX_PKG_SHA256=1e4c2f6a1f153f4b8afa2470d2e99dab493034c1ba8b7ffbbd7600de016d0794\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_DEPENDS=\"libc++, libedit, libllvm, libxml2, ncurses-ui-libs\"\nTERMUX_PKG_BUILD_DEPENDS=\"libllvm-static\"\nTERMUX_PKG_BREAKS=\"lldb-dev, lldb-static\"\nTERMUX_PKG_REPLACES=\"lldb-dev, lldb-static\"\nTERMUX_PKG_HAS_DEBUG=false\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DLLDB_DISABLE_CURSES=0\n-DLLDB_DISABLE_LIBEDIT=0\n-DLLDB_DISABLE_PYTHON=1\n-DLLVM_CONFIG=$TERMUX_PREFIX/bin/llvm-config\n-DLLVM_ENABLE_TERMINFO=1\n-DLLVM_LINK_LLVM_DYLIB=ON\n-DLLVM_DIR=$TERMUX_PREFIX/lib/cmake/llvm\n-DClang_DIR=$TERMUX_PREFIX/lib/cmake/clang\n-DLLVM_NATIVE_BUILD=$TERMUX_PREFIX/bin\n\"\ntermux_step_pre_configure() {\n\tcd $TERMUX_PKG_TMPDIR\n\ttermux_download https://its-pointless.github.io/tblgen-llvm-lldb-9.tar.xz tblgen-llvm-lldb-9.tar.xz \\\n\t\t0022ca75adeeda6c87f0fde352888e7a55747de05bc93035c2172535bb35f6c5\n\ttar xvf tblgen-llvm-lldb-9.tar.xz\n\tmv llvm-tblgen $TERMUX_PREFIX/bin\n\tPATH=$PATH:$TERMUX_PKG_TMPDIR\n\tif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\texport LD_LIBRARY_PATH=/lib/x86_64-linux-gnu/\n\tfi\n\ttouch $TERMUX_PREFIX/bin/clang-import-test\n}\n\ntermux_step_post_make_install() {\n\tcp $TERMUX_PKG_SRCDIR/docs/lldb.1 $TERMUX_PREFIX/share/man/man1\n\trm -f  $TERMUX_PREFIX/bin/llvm-tblgen $TERMUX_PREFIX/bin/clang-import-test\n}\n"
  },
  {
    "path": "packages/lldb/cmakelists.txt.patch",
    "content": "--- ./CMakeLists.txt.orig\t2019-10-28 02:55:47.051030643 +0000\n+++ ./CMakeLists.txt\t2019-10-28 02:55:59.659010243 +0000\n@@ -39,18 +39,6 @@\n   add_subdirectory(scripts)\n endif ()\n \n-if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE)\n-  set(LLVM_USE_HOST_TOOLS ON)\n-  include(CrossCompile)\n-  if (NOT NATIVE_LLVM_DIR OR NOT NATIVE_Clang_DIR)\n-    message(FATAL_ERROR\n-      \"Crosscompiling standalone requires the variables NATIVE_{CLANG,LLVM}_DIR\n-      for building the native lldb-tblgen used during the build process.\")\n-  endif()\n-  llvm_create_cross_target(lldb NATIVE \"\" Release\n-    -DLLVM_DIR=${NATIVE_LLVM_DIR}\n-    -DClang_DIR=${NATIVE_Clang_DIR})\n-endif()\n \n add_subdirectory(utils/TableGen)\n add_subdirectory(source)\n"
  },
  {
    "path": "packages/lnd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/lightningnetwork/lnd\nTERMUX_PKG_DESCRIPTION=\"Lightning Network Daemon\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.8.0-beta\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=(https://github.com/lightningnetwork/lnd/archive/v${TERMUX_PKG_VERSION}.tar.gz\n                   https://github.com/lightningnetwork/lnd/releases/download/v${TERMUX_PKG_VERSION}/vendor.tar.gz)\nTERMUX_PKG_SHA256=(ab6003ee617d86f11237334c25718ce81a279c2b4b5867a7b2e0d16e85a0d687\n                   22fd5504519ff2328bf3c4e416c2c37ce9ab111859c987c3602c66513dcf5fb6)\nTERMUX_PKG_DEPENDS=\"bitcoin\"\nTERMUX_PKG_CONFFILES=\"var/service/lnd/run var/service/lnd/log/run\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n    termux_setup_golang\n\n    GO111MODULE=on go build -tags linux -v -mod=vendor -ldflags \"-X github.com/lightningnetwork/lnd/build.Commit=v$TERMUX_PKG_VERSION\" ./cmd/lnd\n    GO111MODULE=on go build -tags linux -v -mod=vendor -ldflags \"-X github.com/lightningnetwork/lnd/build.Commit=v$TERMUX_PKG_VERSION\" ./cmd/lncli\n}\n\ntermux_step_make_install() {\n    install -Dm700 lnd lncli \"$TERMUX_PREFIX\"/bin/\n}\n\ntermux_step_post_make_install() {\n    mkdir -p $TERMUX_PREFIX/var/service\n    cd $TERMUX_PREFIX/var/service\n    mkdir -p lnd/log\n    echo \"#!$TERMUX_PREFIX/bin/sh\" > lnd/run\n    echo 'exec lnd 2>&1' >> lnd/run\n    chmod +x lnd/run\n    touch lnd/down\n\n    ln -sf $TERMUX_PREFIX/share/termux-services/svlogger lnd/log/run\n}\n"
  },
  {
    "path": "packages/loksh/Makefile.patch",
    "content": "diff -uNr loksh-6.6/Makefile loksh-6.6.mod/Makefile\n--- loksh-6.6/Makefile\t2019-10-17 17:47:17.000000000 +0300\n+++ loksh-6.6.mod/Makefile\t2019-11-03 03:27:27.575357097 +0200\n@@ -33,7 +33,6 @@\n install: all\n \tinstall -v -D -m 755 ksh $(DESTDIR)/$(BIN_DIR)/$(BIN_NAME)\n \tinstall -v -D -m 644 ksh.1 $(DESTDIR)/$(MAN_DIR)/man1/$(BIN_NAME).1\n-\tinstall -v -m 644 sh.1 $(DESTDIR)/$(MAN_DIR)/man1/sh.1\n \tinstall -v -D -m 644 README.md $(DESTDIR)/$(DOC_DIR)/README.md\n \tinstall -v -m 644 README $(DESTDIR)/$(DOC_DIR)/README\n \tinstall -v -m 644 CONTRIBUTORS $(DESTDIR)/$(DOC_DIR)/CONTRIBUTORS\n"
  },
  {
    "path": "packages/loksh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/dimkr/loksh\nTERMUX_PKG_DESCRIPTION=\"A Linux port of OpenBSD's ksh\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=6.6\nTERMUX_PKG_SRCURL=https://github.com/dimkr/loksh/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=97a020df82ceebe216c5a306e87360c5e3398d7403347aaff50978446ccb764d\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/loksh/clock_monotonic.patch",
    "content": "diff -uNr loksh-6.4/c_sh.c loksh-6.4.mod/c_sh.c\n--- loksh-6.4/c_sh.c\t2018-10-18 19:25:07.000000000 +0300\n+++ loksh-6.4.mod/c_sh.c\t2019-02-20 21:08:11.282582629 +0200\n@@ -8,6 +8,7 @@\n #include <sys/resource.h>\n #include <sys/stat.h>\n #include <sys/time.h>\n+#include <linux/time.h>\n \n #include <ctype.h>\n #include <errno.h>\ndiff -uNr loksh-6.4/mail.c loksh-6.4.mod/mail.c\n--- loksh-6.4/mail.c\t2018-10-18 19:25:07.000000000 +0300\n+++ loksh-6.4.mod/mail.c\t2019-02-20 21:08:16.325940697 +0200\n@@ -7,6 +7,7 @@\n \n #include <sys/stat.h>\n #include <sys/time.h>\n+#include <linux/time.h>\n \n #include <string.h>\n #include <time.h>\ndiff -uNr loksh-6.4/var.c loksh-6.4.mod/var.c\n--- loksh-6.4/var.c\t2018-10-18 19:25:07.000000000 +0300\n+++ loksh-6.4.mod/var.c\t2019-02-20 21:08:21.149297670 +0200\n@@ -2,6 +2,7 @@\n \n #include <sys/stat.h>\n #include <sys/time.h>\n+#include <linux/time.h>\n \n #include <ctype.h>\n #include <errno.h>\n"
  },
  {
    "path": "packages/loksh/fix-hardcoded-paths.patch",
    "content": "diff -uNr loksh-6.3/io.c loksh-6.3.mod/io.c\n--- loksh-6.3/io.c\t2018-04-14 12:35:14.000000000 +0300\n+++ loksh-6.3.mod/io.c\t2019-01-29 15:27:54.298336806 +0200\n@@ -170,7 +170,7 @@\n {\n \tif (kshdebug_shf)\n \t\tshf_close(kshdebug_shf);\n-\tkshdebug_shf = shf_open(\"/tmp/ksh-debug.log\",\n+\tkshdebug_shf = shf_open(\"@TERMUX_PREFIX@/tmp/ksh-debug.log\",\n \t    O_WRONLY|O_APPEND|O_CREAT, 0600, SHF_WR|SHF_MAPHI);\n \tif (kshdebug_shf) {\n \t\tshf_fprintf(kshdebug_shf, \"\\nNew shell[pid %d]\\n\", getpid());\n@@ -442,7 +442,7 @@\n \tchar *path;\n \tconst char *dir;\n \n-\tdir = tmpdir ? tmpdir : \"/tmp\";\n+\tdir = tmpdir ? tmpdir : \"@TERMUX_PREFIX@/tmp\";\n \t/* The 20 + 20 is a paranoid worst case for pid/inc */\n \tlen = strlen(dir) + 3 + 20 + 20 + 1;\n \ttp = alloc(sizeof(struct temp) + len, ap);\ndiff -uNr loksh-6.3/sh.h loksh-6.3.mod/sh.h\n--- loksh-6.3/sh.h\t2018-04-14 12:35:14.000000000 +0300\n+++ loksh-6.3.mod/sh.h\t2019-01-29 15:28:14.971788093 +0200\n@@ -358,7 +358,7 @@\n #define CBRACE\t'}'\n \n /* Determine the location of the system (common) profile */\n-#define KSH_SYSTEM_PROFILE \"/etc/profile\"\n+#define KSH_SYSTEM_PROFILE \"@TERMUX_PREFIX@/etc/profile\"\n \n /* Used by v_evaluate() and setstr() to control action when error occurs */\n #define KSH_UNWIND_ERROR\t0x0\t/* unwind the stack (longjmp) */\n"
  },
  {
    "path": "packages/loksh/no-cs_path.patch",
    "content": "diff -uNr loksh-6.3/main.c loksh-6.3.mod/main.c\n--- loksh-6.3/main.c\t2018-04-14 12:35:14.000000000 +0300\n+++ loksh-6.3.mod/main.c\t2019-01-29 15:29:47.035733470 +0200\n@@ -188,16 +188,6 @@\n \tinit_histvec();\n \n \tdef_path = _PATH_DEFPATH;\n-\t{\n-\t\tsize_t len = confstr(_CS_PATH, NULL, 0);\n-\t\tchar *new;\n-\n-\t\tif (len > 0) {\n-\t\t\tconfstr(_CS_PATH, new = alloc(len + 1, APERM), len + 1);\n-\t\t\tdef_path = new;\n-\t\t}\n-\t}\n-\n \t/* Set PATH to def_path (will set the path global variable).\n \t * (import of environment below will probably change this setting).\n \t */\n@@ -389,7 +379,7 @@\n \t}\n \n \tif (Flag(FPRIVILEGED))\n-\t\tinclude(\"/etc/suid_profile\", 0, NULL, 1);\n+\t\tinclude(\"@TERMUX_PREFIX@/etc/suid_profile\", 0, NULL, 1);\n \telse if (Flag(FTALKING)) {\n \t\tchar *env_file;\n \n"
  },
  {
    "path": "packages/ltrace/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.ltrace.org/\nTERMUX_PKG_DESCRIPTION=\"Tracks runtime library calls in dynamically linked programs\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.7.3.20160411\nTERMUX_PKG_REVISION=5\nlocal _COMMIT=2def9f1217374cc8371105993003b2c663aefda7\nTERMUX_PKG_SRCURL=https://github.com/dkogan/ltrace/archive/${_COMMIT}.zip\nTERMUX_PKG_SHA256=d089ae8affd8af782c12aed7ba97f44c7f55b60033ec78ab07e415e7b091a90c\nTERMUX_PKG_DEPENDS=\"libc++, libelf\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-werror\n--without-libunwind\nac_cv_host=$TERMUX_ARCH-generic-linux-gnu\n\"\n\ntermux_step_pre_configure() {\n\t# rindex is an obsolete version of strrchr which is not available in Android:\n\tCFLAGS+=\" -Drindex=strrchr\"\n\tif [ \"$TERMUX_ARCH\" == \"arm\" ]; then\n\t\tCFLAGS+=\" -DSHT_ARM_ATTRIBUTES=0x70000000+3\"\n\tfi\n\n\tautoreconf -i ../src\n}\n"
  },
  {
    "path": "packages/ltrace/ltrace-elf.c.patch",
    "content": "diff --git a/ltrace-elf.c b/ltrace-elf.c\nindex f439cb0..60f1941 100644\n--- a/ltrace-elf.c\n+++ b/ltrace-elf.c\n@@ -423,7 +423,9 @@ ltelf_destroy(struct ltelf *lte)\n \tdebug(DEBUG_FUNCTION, \"close_elf()\");\n \telf_end(lte->elf);\n \tclose(lte->fd);\n-\tVECT_DESTROY(&lte->plt_relocs, GElf_Rela, NULL, NULL);\n+\tif (lte->plt_relocs.elt_size) {\n+\t\tVECT_DESTROY(&lte->plt_relocs, GElf_Rela, NULL, NULL);\n+\t}\n }\n \n static void\n@@ -1149,9 +1151,11 @@ read_module(struct library *lib, struct process *proc,\n \t * determine whether ABI is supported.  This is to get\n \t * reasonable error messages when trying to run 64-bit binary\n \t * with 32-bit ltrace.  It is desirable to preserve this.  */\n-\tproc->e_machine = lte.ehdr.e_machine;\n-\tproc->e_class = lte.ehdr.e_ident[EI_CLASS];\n-\tget_arch_dep(proc);\n+\tif (proc->e_machine == 0) {\n+\t\tproc->e_machine = lte.ehdr.e_machine;\n+\t\tproc->e_class = lte.ehdr.e_ident[EI_CLASS];\n+\t\tget_arch_dep(proc);\n+\t}\n \n \t/* Find out the base address.  For PIE main binaries we look\n \t * into auxv, otherwise we scan phdrs.  */\n"
  },
  {
    "path": "packages/ltrace/sysdeps-linux-gnu-proc.c.patch",
    "content": "diff --git a/sysdeps/linux-gnu/proc.c b/sysdeps/linux-gnu/proc.c\nindex 953fd86..bdb96cb 100644\n--- a/sysdeps/linux-gnu/proc.c\n+++ b/sysdeps/linux-gnu/proc.c\n@@ -524,9 +524,53 @@ crawl_linkmap(struct process *proc, struct lt_r_debug_64 *dbg)\n \t\t    || strcmp(lib_name, \"linux-vdso.so.1\") == 0\n \t\t    || strcmp(lib_name, \"linux-gate.so.1\") == 0\n \t\t    || strcmp(lib_name, \"linux-vdso32.so.1\") == 0\n-\t\t    || strcmp(lib_name, \"linux-vdso64.so.1\") == 0)\n+\t\t    || strcmp(lib_name, \"linux-vdso64.so.1\") == 0\n+\t\t    || strcmp(lib_name, \"[vdso]\") == 0\n+\t\t    /* Android linker includes itself in list of libraries\n+\t\t     * on GNU linker it appears as empty string */\n+\t\t    || strcmp(lib_name, \"/system/bin/linker\") == 0\n+\t\t    || strcmp(lib_name, \"/system/bin/linker64\") == 0)\n \t\t\tcontinue;\n \n+\t\t/* On Android main executable is included in library list\n+\t\t * On GNU it appears as empty string */\n+\t\tif (rlm.l_prev == 0 && strstr(lib_name, \".so\") == NULL) {\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\t/* Android < 6 provides just library name without full path,\n+\t\t * will find full path ourselves */\n+\t\tif (lib_name[0] != '/') {\n+\t\t\tchar local_path[1024];\n+\t\t\t/* Include path from LD_LIBRARY_PATH */\n+\t\t\tconst char *path = getenv(\"LD_LIBRARY_PATH\");\n+\t\t\tif (path) {\n+\t\t\t\tstrlcpy(local_path, path, sizeof(local_path));\n+\t\t\t} else {\n+\t\t\t\tlocal_path[0] = '\\0';\n+\t\t\t}\n+\t\t\t/* Include default path (hardcoded in /system/bin/linker) */\n+\t\t\tstrlcat(\n+\t\t\t\t\tlocal_path,\n+\t\t\t\t\tselect_32_64(proc, \":/vendor/lib:/system/lib\", \":/vendor/lib64:/system/lib64\"),\n+\t\t\t\t\tsizeof(local_path)\n+\t\t\t);\n+\n+\t\t\tchar *local_path_ptr = local_path;\n+\t\t\tconst char *tested_path;\n+\t\t\tchar full_lib_name[BUFSIZ];\n+\t\t\twhile ((tested_path = strsep(&local_path_ptr, \":\"))) {\n+\t\t\t\tif (tested_path[0] == '\\0') {\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t\tsnprintf(full_lib_name, sizeof(full_lib_name), \"%s/%s\", tested_path, lib_name);\n+\t\t\t\tif (access(full_lib_name, F_OK) == 0) {\n+\t\t\t\t\tstrlcpy(lib_name, full_lib_name, sizeof(lib_name));\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\n \t\t/* Do we have that library already?  */\n \t\tif (proc_each_library(proc, NULL, library_with_key_cb, &key))\n \t\t\tcontinue;\n"
  },
  {
    "path": "packages/lua-lpeg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.inf.puc-rio.br/~roberto/lpeg\nTERMUX_PKG_DESCRIPTION=\"Pattern-matching library for Lua 5.3\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.0.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe\nTERMUX_PKG_DEPENDS=\"liblua\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake \\\n\t\tCC=\"$CC\" \\\n\t\tCFLAGS=\"$CFLAGS -fPIC\" \\\n\t\tLDFLAGS=\"$LDFLAGS -llua\" \\\n\t\tLUADIR=\"$TERMUX_PREFIX\"/include\n}\n\ntermux_step_make_install() {\n\tinstall -Dm600 lpeg.so \"$TERMUX_PREFIX\"/lib/lua/5.3/lpeg.so\n\tinstall -Dm600 re.lua \"$TERMUX_PREFIX\"/share/lua/5.3/re.lua\n}\n"
  },
  {
    "path": "packages/lua-lpeg/makefile.patch",
    "content": "diff -uNr lpeg-1.0.2/makefile lpeg-1.0.2.mod/makefile\n--- lpeg-1.0.2/makefile\t2019-03-11 16:08:29.000000000 +0200\n+++ lpeg-1.0.2.mod/makefile\t2019-05-10 16:13:05.997196863 +0300\n@@ -1,7 +1,7 @@\n LIBNAME = lpeg\n LUADIR = ../lua/\n \n-COPT = -O2 -DNDEBUG\n+#COPT = -O2 -DNDEBUG\n # COPT = -g\n \n CWARNS = -Wall -Wextra -pedantic \\\n@@ -22,7 +22,7 @@\n # -Wunreachable-code \\\n \n \n-CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC\n+CFLAGS += $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC\n CC = gcc\n \n FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o\n@@ -36,7 +36,7 @@\n \t$(MAKE) lpeg.so \"DLLFLAGS = -bundle -undefined dynamic_lookup\"\n \n lpeg.so: $(FILES)\n-\tenv $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so\n+\tenv $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so $(LDFLAGS)\n \n $(FILES): makefile\n \n"
  },
  {
    "path": "packages/luarocks/GNUmakefile.patch",
    "content": "--- ./GNUmakefile.orig\t2019-06-07 23:32:53.163938603 +0000\n+++ ./GNUmakefile\t2019-06-07 23:33:13.536058761 +0000\n@@ -52,7 +52,7 @@\n \techo \"unset LUA_PATH LUA_PATH_5_2 LUA_PATH_5_3 LUA_PATH_5_4\" >> luarocks\n \techo 'LUAROCKS_SYSCONFDIR=\"$(luarocksconfdir)\" LUA_PATH=\"$(CURDIR)/src/?.lua;;\" exec \"$(LUA)\" \"$(CURDIR)/src/bin/luarocks\" --project-tree=\"$(CURDIR)/lua_modules\" \"$$@\"' >> luarocks\n \tchmod +rx ./luarocks\n-\t./luarocks init\n+\t./luarocks init --lua-dir=$(PREFIX)\n \tcp $(builddir)/config-$(LUA_VERSION).lua .luarocks/config-$(LUA_VERSION).lua\n \n luarocks-admin: config.unix\n"
  },
  {
    "path": "packages/luarocks/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://luarocks.org/\nTERMUX_PKG_DESCRIPTION=\"Deployment and management system for Lua modules\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=3.1.3\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://luarocks.org/releases/luarocks-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=c573435f495aac159e34eaa0a3847172a2298eb6295fcdc35d565f9f9b990513\nTERMUX_PKG_DEPENDS=\"curl, lua\"\nTERMUX_PKG_BUILD_DEPENDS=\"liblua\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_configure() {\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\tTERMUX_PKG_EXTRA_MAKE_ARGS=\"LUA=$TERMUX_PREFIX/bin/lua\"\n\telse\n\t\tTERMUX_PKG_EXTRA_MAKE_ARGS=\"LUA=/usr/bin/lua5.3\"\n\tfi\n\n\t./configure --prefix=$TERMUX_PREFIX \\\n\t\t--with-lua=$TERMUX_PREFIX \\\n\t\t--with-lua-include=$TERMUX_PREFIX/include \\\n\t\t--lua-version=5.3\n}\ntermux_step_post_massage() {\n\tsed -i \"1 s|$|lua|\" bin/luarocks\n\tsed -i \"1 s|$|lua|\" bin/luarocks-admin\n}\n"
  },
  {
    "path": "packages/luarocks/configure.patch",
    "content": "--- ./configure.orig\t2019-03-10 15:10:39.226464224 +0100\n+++ ./configure\t2019-03-10 15:13:22.879796367 +0100\n@@ -377,37 +377,6 @@\n    }\n done\n \n-if [ \"$lua_interp_found\" != \"yes\" ]\n-then\n-   if [ \"$LUA_VERSION_SET\" ]\n-   then\n-      interp=\"Lua $LUA_VERSION\"\n-   else\n-      interp=\"Lua\"\n-   fi\n-   if [ \"$LUA_DIR_SET\" ] || [ \"$LUA_BINDIR_SET\" ]\n-   then\n-      where=\"$LUA_BINDIR\"\n-   else\n-      where=\"\\$PATH\"\n-   fi\n-   echo \"$(RED $interp interpreter not found) in $where\"\n-   echo \"You may want to use the flags $(BOLD --with-lua), $(BOLD --with-lua-bin) and/or $(BOLD --lua-version)\"\n-   die \"Run $(BOLD ./configure --help) for details.\"\n-fi\n-\n-if [ \"$LUA_VERSION_SET\" = \"yes\" ]\n-then\n-   echo_n \"Checking if $LUA_BINDIR/$LUA_INTERPRETER is Lua version $LUA_VERSION... \"\n-   if detect_lua_version \"$LUA_BINDIR/$LUA_INTERPRETER\"\n-   then\n-      echo \"yes\"\n-   else\n-      echo \"no\"\n-      die \"You may want to use the flags --with-lua, --with-lua-bin and/or --lua-version. See --help.\"\n-   fi\n-fi\n-\n # ----------------------------------------\n # Additional checks\n # ----------------------------------------\n"
  },
  {
    "path": "packages/luarocks/lua.lua.patch",
    "content": "--- ./src/luarocks/fs/lua.lua.orig\t2019-06-07 22:33:12.441995154 +0000\n+++ ./src/luarocks/fs/lua.lua\t2019-06-07 22:33:22.938066139 +0000\n@@ -259,7 +259,7 @@\n end\n \n function fs_lua.system_temp_dir()\n-   return os.getenv(\"TMPDIR\") or os.getenv(\"TEMP\") or \"/tmp\"\n+   return os.getenv(\"TMPDIR\") or os.getenv(\"TEMP\") or \"@TERMUX_PREFIX@/tmp\"\n end\n \n ---------------------------------------------------------------------\n"
  },
  {
    "path": "packages/luarocks/src-luarocks-core-cfg.lua.patch",
    "content": "--- ./src/luarocks/core/cfg.lua~\t2018-10-30 18:31:40.000000000 +0100\n+++ ./src/luarocks/core/cfg.lua\t2019-03-10 16:33:24.676428404 +0100\n@@ -358,7 +358,7 @@\n       defaults.static_lib_extension = \"a\"\n       defaults.external_lib_extension = \"so\"\n       defaults.obj_extension = \"o\"\n-      defaults.external_deps_dirs = { \"/usr/local\", \"/usr\", \"/\" }\n+      defaults.external_deps_dirs = { \"@TERMUX_PREFIX@/local\", \"@TERMUX_PREFIX@\" }\n       defaults.variables.CFLAGS = \"-O2\"\n       defaults.cmake_generator = \"Unix Makefiles\"\n       defaults.variables.CC = \"gcc\"\n"
  },
  {
    "path": "packages/luarocks/unix-tools.lua.patch",
    "content": "--- ./src/luarocks/fs/unix/tools.lua.orig\t2019-03-10 16:35:27.583094191 +0100\n+++ ./src/luarocks/fs/unix/tools.lua\t2019-03-10 16:36:17.913093843 +0100\n@@ -300,7 +300,7 @@\n    assert(type(name_pattern) == \"string\")\n    name_pattern = dir.normalize(name_pattern)\n \n-   local template = (os.getenv(\"TMPDIR\") or \"/tmp\") .. \"/luarocks_\" .. name_pattern:gsub(\"/\", \"_\") .. \"-XXXXXX\"\n+   local template = (os.getenv(\"TMPDIR\") or \"@TERMUX_PREFIX@/tmp\") .. \"/luarocks_\" .. name_pattern:gsub(\"/\", \"_\") .. \"-XXXXXX\"\n    local pipe = io.popen(vars.MKTEMP..\" -d \"..fs.Q(template))\n    local dirname = pipe:read(\"*l\")\n    pipe:close()\n"
  },
  {
    "path": "packages/luv/CMakeLists.txt.patch",
    "content": "diff -u -r ../luv-1.30.1-1/CMakeLists.txt ./CMakeLists.txt\n--- ../luv-1.30.1-1/CMakeLists.txt\t2019-09-18 04:33:34.000000000 +0000\n+++ ./CMakeLists.txt\t2019-09-25 22:23:19.659091635 +0000\n@@ -107,7 +107,6 @@\n       include_directories(${LUAJIT_INCLUDE_DIR})\n       link_directories(${LUAJIT_LIBRARIES})\n     else (USE_LUAJIT)\n-      find_package(Lua REQUIRED)\n       include_directories(${LUA_INCLUDE_DIR})\n     endif (USE_LUAJIT)\n \n@@ -175,7 +174,7 @@\n elseif(\"${CMAKE_SYSTEM_NAME}\" MATCHES \"Linux\")\n   target_link_libraries(luv ${LIBUV_LIBRARIES} rt)\n else()\n-  target_link_libraries(luv ${LIBUV_LIBRARIES})\n+  target_link_libraries(luv m lua ${LIBUV_LIBRARIES})\n endif()\n \n if (NOT LUA)\n"
  },
  {
    "path": "packages/luv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/luvit/luv\nTERMUX_PKG_DESCRIPTION=\"Bare libuv bindings for lua\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=\"1.32.0-0\"\nTERMUX_PKG_SHA256=25a34b2aecf02d1fd32352c855577dcecd20c756dee9eb7ebecd206bf1de26d3\nTERMUX_PKG_SRCURL=https://github.com/luvit/luv/releases/download/$TERMUX_PKG_VERSION/luv-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"liblua, libuv\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBUILD_MODULE=OFF\n-DBUILD_SHARED_LIBS=ON\n-DLUA_BUILD_TYPE=System\n-DLUA_INCLUDE_DIR=$TERMUX_PREFIX/include\n-DWITH_LUA_ENGINE=Lua\n-DWITH_SHARED_LIBUV=ON\n\"\n"
  },
  {
    "path": "packages/lynx/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://lynx.browser.org/\nTERMUX_PKG_DESCRIPTION=\"The text web browser\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.8.9rel.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SHA256=387f193d7792f9cfada14c60b0e5c0bff18f227d9257a39483e14fa1aaf79595\nTERMUX_PKG_SRCURL=http://invisible-mirror.net/archives/lynx/tarballs/lynx${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses, openssl, libbz2, libidn, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-screen=ncursesw --enable-widec --enable-scrollbar --enable-nested-tables --enable-htmlized-cfg --with-ssl --with-zlib --with-bzlib --enable-cjk --enable-japanese-utf8 --enable-progressbar --enable-prettysrc --enable-forms-options --enable-8bit-toupper --enable-ascii-ctypes --disable-font-switch --with-mime-libdir=$TERMUX_PREFIX/etc\"\n\n## set default paths for tools that may be used in runtime by 'lynx' binary\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_BZIP2=${TERMUX_PREFIX}/bin/bzip2\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_COMPRESS=${TERMUX_PREFIX}/bin/compress\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_GZIP=${TERMUX_PREFIX}/bin/gzip\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_INSTALL=${TERMUX_PREFIX}/bin/install\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_MSGINIT=${TERMUX_PREFIX}/bin/msginit\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_MV=${TERMUX_PREFIX}/bin/mv\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_RM=${TERMUX_PREFIX}/bin/rm\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_TAR=${TERMUX_PREFIX}/bin/tar\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_TELNET=${TERMUX_PREFIX}/bin/applets/telnet\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_UNCOMPRESS=${TERMUX_PREFIX}/bin/uncompress\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_UNZIP=${TERMUX_PREFIX}/bin/unzip\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_UUDECODE=${TERMUX_PREFIX}/bin/uudecode\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_ZCAT=${TERMUX_PREFIX}/bin/zcat\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_path_ZIP=${TERMUX_PREFIX}/bin/zip\"\n\ntermux_step_pre_configure() {\n\tCC+=\" $LDFLAGS\"\n\tunset LDFLAGS\n}\n\ntermux_step_make_install() {\n\tmake uninstall\n\tmake install\n}\n"
  },
  {
    "path": "packages/lynx/fix-paths.patch",
    "content": "diff -uNr lynx2.8.9rel.1/src/LYNews.c lynx2.8.9rel.1.mod/src/LYNews.c\n--- lynx2.8.9rel.1/src/LYNews.c\t2018-03-18 20:51:02.000000000 +0200\n+++ lynx2.8.9rel.1.mod/src/LYNews.c\t2019-03-01 22:04:51.671752655 +0200\n@@ -261,7 +261,7 @@\n \tStrAllocCat(cp, org);\n     }\n #ifdef UNIX\n-    else if ((fp = fopen(\"/etc/organization\", TXT_R)) != NULL) {\n+    else if ((fp = fopen(\"@TERMUX_PREFIX@/etc/organization\", TXT_R)) != NULL) {\n \tchar *buffer = 0;\n\n \tif (LYSafeGets(&buffer, fp) != NULL) {\ndiff -uNr lynx2.8.9rel.1/src/LYUtils.c lynx2.8.9rel.1.mod/src/LYUtils.c\n--- lynx2.8.9rel.1/src/LYUtils.c\t2018-05-16 00:20:52.000000000 +0300\n+++ lynx2.8.9rel.1.mod/src/LYUtils.c\t2019-03-01 22:05:42.915339501 +0200\n@@ -165,7 +165,7 @@\n #if defined(__FreeBSD__) || defined(__bsdi__)\n #define UTMP_FILE _PATH_UTMP\n #else\n-#define UTMP_FILE \"/etc/utmp\"\n+#define UTMP_FILE \"@TERMUX_PREFIX@/etc/utmp\"\n #endif /* __FreeBSD__ || __bsdi__ */\n #endif /* !UTMP_FILE */\n\n@@ -5185,7 +5185,7 @@\n \t\t/*\n \t\t * Use /tmp; it should be writable.\n \t\t */\n-\t\tStrAllocCopy(HomeDir, \"/tmp\");\n+\t\tStrAllocCopy(HomeDir, \"@TERMUX_PREFIX@/tmp\");\n \t    }\n #endif\n #endif /* VMS */\ndiff -uNr lynx2.8.9rel.1/WWW/Library/Implementation/HTFile.c lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFile.c\n--- lynx2.8.9rel.1/WWW/Library/Implementation/HTFile.c\t2018-05-12 02:20:35.000000000 +0300\n+++ lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFile.c\t2019-03-01 22:04:51.675086005 +0200\n@@ -145,7 +145,7 @@\n static const char *HTCacheRoot = \"/WWW$SCRATCH\";\t/* Where to cache things */\n\n #else\n-static const char *HTCacheRoot = \"/tmp/W3_Cache_\";\t/* Where to cache things */\n+static const char *HTCacheRoot = \"@TERMUX_PREFIX@/tmp/W3_Cache_\";\t/* Where to cache things */\n #endif /* VMS */\n\n static char s_no_suffix[] = \"*\";\n@@ -743,7 +743,7 @@\n \thome = LYGetEnv(\"HOME\");\n #endif\n \tif (home == NULL)\n-\t    home = \"/tmp\";\n+\t    home = \"@TERMUX_PREFIX@/tmp\";\n #endif /* VMS */\n \tHTSprintf0(&result, \"%s/WWW/%s/%s%s\", home, acc_method, host, path);\n     } else {\ndiff -uNr lynx2.8.9rel.1/WWW/Library/Implementation/HTFormat.c lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFormat.c\n--- lynx2.8.9rel.1/WWW/Library/Implementation/HTFormat.c\t2018-05-12 01:18:24.000000000 +0300\n+++ lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTFormat.c\t2019-03-01 22:04:51.678419355 +0200\n@@ -27,7 +27,7 @@\n #ifdef NeXT\n #define PRESENT_POSTSCRIPT \"open %s; /bin/rm -f %s\\n\"\n #else\n-#define PRESENT_POSTSCRIPT \"(ghostview %s ; /bin/rm -f %s)&\\n\"\n+#define PRESENT_POSTSCRIPT \"(ghostview %s ; rm -f %s)&\\n\"\n \t\t\t   /* Full pathname would be better! */\n #endif /* NeXT */\n #endif /* UNIX */\ndiff -uNr lynx2.8.9rel.1/WWW/Library/Implementation/HTNews.c lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTNews.c\n--- lynx2.8.9rel.1/WWW/Library/Implementation/HTNews.c\t2018-02-26 02:28:40.000000000 +0200\n+++ lynx2.8.9rel.1.mod/WWW/Library/Implementation/HTNews.c\t2019-03-01 22:04:51.681752704 +0200\n@@ -36,7 +36,7 @@\n #endif /* DEFAULT_NEWS_HOST */\n\n #ifndef NEWS_SERVER_FILE\n-#define NEWS_SERVER_FILE \"/usr/local/lib/rn/server\"\n+#define NEWS_SERVER_FILE \"@TERMUX_PREFIX@/lib/rn/server\"\n #endif /* NEWS_SERVER_FILE */\n\n #ifndef NEWS_AUTH_FILE\n"
  },
  {
    "path": "packages/lynx/lynx2.8.9dev.19_WWW_Library_Implementation_www_tcp.h.patch",
    "content": "diff -uNr lynx2.8.9dev.19/WWW/Library/Implementation/www_tcp.h lynx2.8.9dev.19.mod/WWW/Library/Implementation/www_tcp.h\n--- lynx2.8.9dev.19/WWW/Library/Implementation/www_tcp.h\t2018-05-16 23:31:43.000000000 +0300\n+++ lynx2.8.9dev.19.mod/WWW/Library/Implementation/www_tcp.h\t2018-06-19 19:40:07.064834756 +0300\n@@ -797,7 +797,7 @@\n \n #if defined(VMS)\n #define socklen_t unsigned\n-#else\n+#elif !defined(__APPLE__)\n #define socklen_t int\t\t/* used for default LY_SOCKLEN definition */\n #endif\n \n"
  },
  {
    "path": "packages/lynx/lynx2.8.9dev.19_src_LYMain.c.patch",
    "content": "diff -uNr lynx2.8.9dev.19/src/LYMain.c lynx2.8.9dev.19.mod/src/LYMain.c\n--- lynx2.8.9dev.19/src/LYMain.c\t2018-05-12 02:11:18.000000000 +0300\n+++ lynx2.8.9dev.19.mod/src/LYMain.c\t2018-06-19 19:40:07.051501423 +0300\n@@ -394,7 +394,7 @@\n BOOLEAN LYSetCookies = SET_COOKIES;\t/* Process Set-Cookie headers? */\n BOOLEAN LYUseDefSelPop = TRUE;\t/* Command line -popup toggle */\n BOOLEAN LYUseDefaultRawMode = TRUE;\n-BOOLEAN LYUseMouse = FALSE;\n+BOOLEAN LYUseMouse = TRUE;\n BOOLEAN LYisConfiguredForX = FALSE;\n BOOLEAN UCForce8bitTOUPPER = FALSE;\t/* override locale for case-conversion? */\n BOOLEAN UCSaveBookmarksInUnicode = FALSE;\n"
  },
  {
    "path": "packages/lynx/lynx2.8.9dev.19_userdefs.h.patch",
    "content": "diff -uNr lynx2.8.9dev.19/userdefs.h lynx2.8.9dev.19.mod/userdefs.h\n--- lynx2.8.9dev.19/userdefs.h\t2018-05-16 00:12:20.000000000 +0300\n+++ lynx2.8.9dev.19.mod/userdefs.h\t2018-06-19 19:40:07.061501423 +0300\n@@ -366,7 +366,7 @@\n  * the \"TMPDIR\" (unix), or \"TEMP\" or \"TMP\" (Windows,DOS,OS/2)\n  * variable.\n  */\n-#define TEMP_SPACE \"/tmp/\"\n+#define TEMP_SPACE \"@TERMUX_PREFIX@/tmp/\"\n \n /********************************\n  * Comment this line out to disable code that implements command logging\n@@ -741,7 +741,7 @@\n  *     RFC 1345 Mnemonic                  mnemonic\n  *     Transparent                        x-transparent\n  */\n-#define CHARACTER_SET \"iso-8859-1\"\n+#define CHARACTER_SET \"utf-8\"\n \n /*****************************\n  * PREFERRED_LANGUAGE is the language in MIME notation (e.g., \"en\",\n@@ -770,7 +770,7 @@\n  * an error response with the 406 (not acceptable) status code, though\n  * the sending of an unacceptable response is also allowed. (RFC2068)\n  */\n-#define PREFERRED_CHARSET \"\"\n+#define PREFERRED_CHARSET \"utf-8\"\n \n /*****************************\n * If MULTI_BOOKMARK_SUPPORT is set to MBM_STANDARD or MBM_ADVANCED, and\n@@ -924,7 +924,7 @@\n  * The default defined here can be changed in lynx.cfg, and .lynxrc, or\n  * toggled via the -accept_all_cookies command line switch.\n  */\n-#define ACCEPT_ALL_COOKIES FALSE\n+#define ACCEPT_ALL_COOKIES TRUE\n \n /****************************************************************\n  *   Section 2.   Things that you probably want to change or review\n@@ -975,7 +975,7 @@\n  * and configuration defaults, and the default always can be toggled\n  * via the -show_cursor command line switch.\n  */\n-#define SHOW_CURSOR FALSE\n+#define SHOW_CURSOR TRUE\n \n /******************************\n * UNDERLINE_LINKS controls whether links are underlined by default, or shown\n"
  },
  {
    "path": "packages/lzip/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.nongnu.org/lzip/\nTERMUX_PKG_DESCRIPTION=\"Lossless data compressor similar to gzip and bzip2\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.21\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://download.savannah.gnu.org/releases/lzip/lzip-${TERMUX_PKG_VERSION}.tar.lz\nTERMUX_PKG_SHA256=68c703c7b5198b3fd7a0c3f20011e9a8c938b8dec14824c4c873922fdb01719f\nTERMUX_PKG_DEPENDS=\"libc++\"\n"
  },
  {
    "path": "packages/lzip/configure.patch",
    "content": "diff -u -r ../lzip-1.19/configure ./configure\n--- ../lzip-1.19/configure\t2017-04-13 12:52:40.000000000 +0200\n+++ ./configure\t2017-05-02 10:44:44.249358716 +0200\n@@ -20,17 +20,10 @@\n datarootdir='$(prefix)/share'\n infodir='$(datarootdir)/info'\n mandir='$(datarootdir)/man'\n-CXX=g++\n-CPPFLAGS=\n-CXXFLAGS='-Wall -W -O2'\n-LDFLAGS=\n-\n-# checking whether we are using GNU C++.\n-/bin/sh -c \"${CXX} --version\" > /dev/null 2>&1 ||\n-\t{\n-\tCXX=c++\n-\tCXXFLAGS=-O2\n-\t}\n+CXX?=g++\n+CPPFLAGS?=\n+CXXFLAGS?='-Wall -W -O2'\n+LDFLAGS?=\n \n # Loop over all args\n args=\n"
  },
  {
    "path": "packages/lzlib/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.nongnu.org/lzip/lzlib.html\nTERMUX_PKG_DESCRIPTION=\"A library providing in-memory LZMA compression and decompression functions\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.11\nTERMUX_PKG_SRCURL=http://download.savannah.gnu.org/releases/lzip/lzlib/lzlib-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=6c5c5f8759d1ab7c4c3c53788ea2d9daad04aeddcf338226893f8ff134914d36\nTERMUX_PKG_DEPENDS=\"lzlib\"\n"
  },
  {
    "path": "packages/lzlib/configure.patch",
    "content": "diff -uNr lzlib-1.11/configure lzlib-1.11.mod/configure\n--- lzlib-1.11/configure\t2019-01-02 13:51:19.000000000 +0200\n+++ lzlib-1.11.mod/configure\t2019-09-23 19:34:31.423708870 +0300\n@@ -28,10 +28,10 @@\n infodir='$(datarootdir)/info'\n libdir='$(exec_prefix)/lib'\n mandir='$(datarootdir)/man'\n-CC=gcc\n-CPPFLAGS=\n-CFLAGS='-Wall -W -O2'\n-LDFLAGS=\n+CC?=gcc\n+CPPFLAGS?=\n+CFLAGS?='-Wall -W -O2'\n+LDFLAGS?=\n \n # checking whether we are using GNU C.\n /bin/sh -c \"${CC} --version\" > /dev/null 2>&1 ||\n"
  },
  {
    "path": "packages/lzop/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.lzop.org\nTERMUX_PKG_DESCRIPTION='File compressor using lzo lib.'\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.04\nTERMUX_PKG_SHA256=dd294d2425a646952e5a316907356ea3c6bddab0f47d5f88ac808c89b290467b\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/lzop-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_DEPENDS=\"liblzo\"\nTERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas'\n\n"
  },
  {
    "path": "packages/m4/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/m4/m4.html\nTERMUX_PKG_DESCRIPTION=\"Traditional Unix macro processor\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.4.18\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/m4/m4-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_header_spawn_h=no\n\"\n"
  },
  {
    "path": "packages/m4/fix-paths.patch",
    "content": "diff -uNr m4-1.4.18/lib/spawni.c m4-1.4.18.mod/lib/spawni.c\n--- m4-1.4.18/lib/spawni.c\t2016-12-31 15:54:42.000000000 +0200\n+++ m4-1.4.18.mod/lib/spawni.c\t2019-03-01 20:54:18.601984363 +0200\n@@ -32,7 +32,7 @@\n #if _LIBC || HAVE_PATHS_H\n # include <paths.h>\n #else\n-# define _PATH_BSHELL \"/bin/sh\"\n+# define _PATH_BSHELL \"@TERMUX_PREFIX@/bin/sh\"\n #endif\n \n #include <signal.h>\ndiff -uNr m4-1.4.18/lib/tempname.c m4-1.4.18.mod/lib/tempname.c\n--- m4-1.4.18/lib/tempname.c\t2016-12-31 15:54:42.000000000 +0200\n+++ m4-1.4.18.mod/lib/tempname.c\t2019-03-01 20:52:48.978132063 +0200\n@@ -32,7 +32,7 @@\n \n #include <stdio.h>\n #ifndef P_tmpdir\n-# define P_tmpdir \"/tmp\"\n+# define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n #endif\n #ifndef TMP_MAX\n # define TMP_MAX 238328\n@@ -148,8 +148,8 @@\n     {\n       if (direxists (P_tmpdir))\n         dir = P_tmpdir;\n-      else if (strcmp (P_tmpdir, \"/tmp\") != 0 && direxists (\"/tmp\"))\n-        dir = \"/tmp\";\n+      else if (strcmp (P_tmpdir, \"@TERMUX_PREFIX@/tmp\") != 0 && direxists (\"@TERMUX_PREFIX@/tmp\"))\n+        dir = \"@TERMUX_PREFIX@/tmp\";\n       else\n         {\n           __set_errno (ENOENT);\ndiff -uNr m4-1.4.18/lib/tmpdir.c m4-1.4.18.mod/lib/tmpdir.c\n--- m4-1.4.18/lib/tmpdir.c\t2016-12-31 15:54:42.000000000 +0200\n+++ m4-1.4.18.mod/lib/tmpdir.c\t2019-03-01 20:53:16.521626327 +0200\n@@ -36,7 +36,7 @@\n # ifdef _P_tmpdir /* native Windows */\n #  define P_tmpdir _P_tmpdir\n # else\n-#  define P_tmpdir \"/tmp\"\n+#  define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n # endif\n #endif\n \n@@ -130,8 +130,8 @@\n #endif\n       if (direxists (P_tmpdir))\n         dir = P_tmpdir;\n-      else if (strcmp (P_tmpdir, \"/tmp\") != 0 && direxists (\"/tmp\"))\n-        dir = \"/tmp\";\n+      else if (strcmp (P_tmpdir, \"@TERMUX_PREFIX@/tmp\") != 0 && direxists (\"@TERMUX_PREFIX@/tmp\"))\n+        dir = \"@TERMUX_PREFIX@/tmp\";\n       else\n         {\n           __set_errno (ENOENT);\n"
  },
  {
    "path": "packages/m4/lib-vasnprintf.c.patch",
    "content": "diff -u -r ../m4-1.4.18/lib/vasnprintf.c ./lib/vasnprintf.c\n--- ../m4-1.4.18/lib/vasnprintf.c\t2016-12-31 13:54:42.000000000 +0000\n+++ ./lib/vasnprintf.c\t2019-10-02 19:32:13.576211922 +0000\n@@ -4858,7 +4858,7 @@\n #endif\n                   *fbp = dp->conversion;\n #if USE_SNPRINTF\n-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))\n+# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined(__ANDROID__))\n                 fbp[1] = '%';\n                 fbp[2] = 'n';\n                 fbp[3] = '\\0';\n"
  },
  {
    "path": "packages/m4/lib-xalloc-oversized.h.patch",
    "content": "Fixed \"undefined reference to __muloti4\".\n\ndiff -u -r ../m4-1.4.18/lib/xalloc-oversized.h ./lib/xalloc-oversized.h\n--- ../m4-1.4.18/lib/xalloc-oversized.h\t2016-12-31 13:54:42.000000000 +0000\n+++ ./lib/xalloc-oversized.h\t2018-08-06 14:25:19.420628987 +0000\n@@ -46,23 +46,6 @@\n    positive and N must be nonnegative.  This is a macro, not a\n    function, so that it works correctly even when SIZE_MAX < N.  */\n \n-#if 7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p)\n-# define xalloc_oversized(n, s) \\\n-   __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)\n-#elif ((5 <= __GNUC__ \\\n-        || (__has_builtin (__builtin_mul_overflow) \\\n-            && __has_builtin (__builtin_constant_p))) \\\n-       && !__STRICT_ANSI__)\n-# define xalloc_oversized(n, s) \\\n-   (__builtin_constant_p (n) && __builtin_constant_p (s) \\\n-    ? __xalloc_oversized (n, s) \\\n-    : ({ __xalloc_count_type __xalloc_count; \\\n-         __builtin_mul_overflow (n, s, &__xalloc_count); }))\n-\n-/* Other compilers use integer division; this may be slower but is\n-   more portable.  */\n-#else\n # define xalloc_oversized(n, s) __xalloc_oversized (n, s)\n-#endif\n \n #endif /* !XALLOC_OVERSIZED_H_ */\n"
  },
  {
    "path": "packages/m4/spawn.patch",
    "content": "Fixes compilation on 64-bit Android which has removed getdtablesize.\ndiff -u -r ../m4-1.4.17/lib/spawn_faction_addclose.c ./lib/spawn_faction_addclose.c\n--- ../m4-1.4.17/lib/spawn_faction_addclose.c\t2013-09-22 02:15:20.000000000 -0400\n+++ ./lib/spawn_faction_addclose.c\t2016-01-03 20:37:44.870178045 -0500\n@@ -37,7 +37,7 @@\n                                    int fd)\n #undef posix_spawn_file_actions_addclose\n {\n-  int maxfd = __sysconf (_SC_OPEN_MAX);\n+  int maxfd = sysconf (_SC_OPEN_MAX);\n \n   /* Test for the validity of the file descriptor.  */\n   if (fd < 0 || fd >= maxfd)\ndiff -u -r ../m4-1.4.17/lib/spawn_faction_adddup2.c ./lib/spawn_faction_adddup2.c\n--- ../m4-1.4.17/lib/spawn_faction_adddup2.c\t2013-09-22 02:15:20.000000000 -0400\n+++ ./lib/spawn_faction_adddup2.c\t2016-01-03 20:38:11.981753903 -0500\n@@ -37,7 +37,7 @@\n                                   int fd, int newfd)\n #undef posix_spawn_file_actions_adddup2\n {\n-  int maxfd = __sysconf (_SC_OPEN_MAX);\n+  int maxfd = sysconf (_SC_OPEN_MAX);\n \n   /* Test for the validity of the file descriptor.  */\n   if (fd < 0 || newfd < 0 || fd >= maxfd || newfd >= maxfd)\ndiff -u -r ../m4-1.4.17/lib/spawn_faction_addopen.c ./lib/spawn_faction_addopen.c\n--- ../m4-1.4.17/lib/spawn_faction_addopen.c\t2013-09-22 02:15:20.000000000 -0400\n+++ ./lib/spawn_faction_addopen.c\t2016-01-03 20:38:21.341607440 -0500\n@@ -38,7 +38,7 @@\n                                   mode_t mode)\n #undef posix_spawn_file_actions_addopen\n {\n-  int maxfd = __sysconf (_SC_OPEN_MAX);\n+  int maxfd = sysconf (_SC_OPEN_MAX);\n \n   /* Test for the validity of the file descriptor.  */\n   if (fd < 0 || fd >= maxfd)\n"
  },
  {
    "path": "packages/make/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/make/\nTERMUX_PKG_DESCRIPTION=\"Tool to control the generation of non-source files from source files\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=4.2.1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7\nTERMUX_PKG_BREAKS=\"make-dev\"\nTERMUX_PKG_REPLACES=\"make-dev\"\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/make/make-${TERMUX_PKG_VERSION}.tar.gz\n# Prevent linking against libelf:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_lib_elf_elf_begin=no\"\n\ntermux_step_pre_configure() {\n    if [ \"$TERMUX_ARCH\" = arm ]; then\n\t# Fix issue with make on arm hanging at least under cmake:\n\t# https://github.com/termux/termux-packages/issues/2983\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_pselect=no\"\n    fi\n}\n\ntermux_step_make() {\n\t# Allow to bootstrap make if building on device without make installed.\n\tif $TERMUX_ON_DEVICE_BUILD && [ -z \"$(command -v make)\" ]; then\n\t\t./build.sh\n\telse\n\t\tmake -j $TERMUX_MAKE_PROCESSES\n\tfi\n}\n\ntermux_step_make_install() {\n\tif $TERMUX_ON_DEVICE_BUILD && [ -z \"$(command -v make)\" ]; then\n\t\t./make -j 1 install\n\telse\n\t\tmake -j 1 install\n\tfi\n}\n"
  },
  {
    "path": "packages/make/make.patch",
    "content": "diff -u -r ../make-4.1/job.c ./job.c\n--- ../make-4.1/job.c\t2014-10-05 12:24:51.000000000 -0400\n+++ ./job.c\t2015-07-19 17:01:19.751113443 -0400\n@@ -69,7 +69,7 @@\n \n #else\n \n-const char *default_shell = \"/bin/sh\";\n+const char *default_shell = \"@TERMUX_PREFIX@/bin/sh\";\n int batch_mode_shell = 0;\n \n #endif\n"
  },
  {
    "path": "packages/make/no-append.patch",
    "content": "diff --git a/output.c b/output.c\nindex 65182c4..efa98ad 100644\n--- a/output.c\n+++ b/output.c\n@@ -157,6 +157,10 @@ log_working_directory (int entering)\n static void\n set_append_mode (int fd)\n {\n+#ifdef __ANDROID__\n+  /* SELinux has a deny rule for append on stderr (eg. SCM_RIGHTS returns MSG_CTRUNC) */\n+  if (isatty(fd)) return;\n+#endif\n #if defined(F_GETFL) && defined(F_SETFL) && defined(O_APPEND)\n   int flags = fcntl (fd, F_GETFL, 0);\n   if (flags >= 0)\n"
  },
  {
    "path": "packages/man/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://mdocml.bsd.lv/\nTERMUX_PKG_DESCRIPTION=\"Man page viewer from the mandoc toolset\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.14.5\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=8219b42cb56fc07b2aa660574e6211ac38eefdbf21f41b698d3348793ba5d8f7\nTERMUX_PKG_SRCURL=http://mdocml.bsd.lv/snapshots/mandoc-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"less,libandroid-glob,zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/examples\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n\techo \"PREFIX=\\\"$TERMUX_PREFIX\\\"\" > configure.local\n\techo \"CC=\\\"$CC\\\"\" >> configure.local\n\techo \"MANDIR=\\\"$TERMUX_PREFIX/share/man\\\"\" >> configure.local\n\techo \"CFLAGS=\\\"$CFLAGS -std=c99 -DNULL=0 $CPPFLAGS\\\"\" >> configure.local\n\techo \"LDFLAGS=\\\"$LDFLAGS\\\"\" >> configure.local\n\tfor HAVING in HAVE_FGETLN HAVE_MMAP HAVE_STRLCAT HAVE_STRLCPY HAVE_SYS_ENDIAN HAVE_ENDIAN HAVE_NTOHL HAVE_NANOSLEEP HAVE_O_DIRECTORY; do\n\t\techo \"$HAVING=1\" >> configure.local\n\tdone\n\techo \"HAVE_MANPATH=0\" >> configure.local\n\techo \"HAVE_SQLITE3=1\" >> configure.local\n}\n\ntermux_step_create_debscripts() {\n\techo \"interest-noawait $TERMUX_PREFIX/share/man\" > triggers\n\t\n\techo \"#!$TERMUX_PREFIX/bin/sh\" >> postinst\n\techo \"makewhatis -Q\" >> postinst\n\techo \"exit 0\" >> postinst\n}\n"
  },
  {
    "path": "packages/man/configure.patch",
    "content": "diff -u -r ../mandoc-1.14.5/configure ./configure\n--- ../mandoc-1.14.5/configure\t2019-03-10 09:56:43.000000000 +0000\n+++ ./configure\t2019-03-17 11:00:40.653234300 +0000\n@@ -35,16 +35,13 @@\n \n SOURCEDIR=`dirname \"$0\"`\n \n-MANPATH_BASE=\"/usr/share/man:/usr/X11R6/man\"\n-MANPATH_DEFAULT=\"/usr/share/man:/usr/X11R6/man:/usr/local/man\"\n+MANPATH_BASE=\"@TERMUX_PREFIX@/share/man\"\n+MANPATH_DEFAULT=\"@TERMUX_PREFIX@/share/man\"\n OSENUM=\n OSNAME=\n UTF8_LOCALE=\n \n-CC=`printf \"all:\\\\n\\\\t@echo \\\\\\$(CC)\\\\n\" | env -i make -sf -`\n-CFLAGS=\n LDADD=\n-LDFLAGS=\n LD_NANOSLEEP=\n LD_OHASH=\n LD_RECVMSG=\n@@ -126,7 +123,7 @@\n INSTALL_LIB=\n INSTALL_MAN=\n INSTALL_DATA=\n-LN=\"ln -f\"\n+LN=\"ln -s -f\"\n \n # --- manual settings from configure.local -----------------------------\n \n@@ -367,7 +364,7 @@\n elif singletest nanosleep NANOSLEEP; then\n \t:\n elif runtest nanosleep NANOSLEEP \"-lrt\"; then\n-\tLD_NANOSLEEP=\"-lrt\"\n+\tLD_NANOSLEEP=\"\"\n fi\n if [ \"${HAVE_NANOSLEEP}\" -eq 0 ]; then\n \techo \"FATAL: nanosleep: no\" 1>&2\n@@ -452,7 +449,7 @@\n [ ${HAVE_GETLINE} -eq 0 ] && echo \"#include <stdio.h>\"\n \n echo\n-echo \"#define MAN_CONF_FILE \\\"/etc/${MANM_MANCONF}\\\"\"\n+echo \"#define MAN_CONF_FILE \\\"@TERMUX_PREFIX@/etc/${MANM_MANCONF}\\\"\"\n echo \"#define MANPATH_BASE \\\"${MANPATH_BASE}\\\"\"\n echo \"#define MANPATH_DEFAULT \\\"${MANPATH_DEFAULT}\\\"\"\n echo \"#define OSENUM ${OSENUM}\"\n"
  },
  {
    "path": "packages/man/main.c.patch",
    "content": "diff -u -r ../mandoc-1.14.4/main.c ./main.c\n--- ../mandoc-1.14.4/main.c\t2018-08-08 14:51:51.000000000 +0000\n+++ ./main.c\t2018-08-11 09:58:01.245684598 +0000\n@@ -1187,7 +1187,7 @@\n \tif (pager == NULL || *pager == '\\0')\n \t\tpager = getenv(\"PAGER\");\n \tif (pager == NULL || *pager == '\\0')\n-\t\tpager = \"more -s\";\n+\t\tpager = \"less -s\";\n \tcp = mandoc_strdup(pager);\n \n \t/*\n"
  },
  {
    "path": "packages/man/mandocdb.c.patch",
    "content": "diff -uNr mandoc-1.14.3/mandocdb.c mandoc-1.14.3.mod/mandocdb.c\n--- mandoc-1.14.3/mandocdb.c\t2017-08-05 15:40:22.000000000 +0300\n+++ mandoc-1.14.3.mod/mandocdb.c\t2017-09-14 14:33:07.342860405 +0300\n@@ -2154,7 +2154,7 @@\n \t * file, but let's at least check whether the data changed.\n \t */\n \n-\t(void)strlcpy(tfn, \"/tmp/mandocdb.XXXXXXXX\", sizeof(tfn));\n+\t(void)strlcpy(tfn, \"@TERMUX_PREFIX@/tmp/mandocdb.XXXXXXXX\", sizeof(tfn));\n \tif (mkdtemp(tfn) == NULL) {\n \t\texitcode = (int)MANDOCLEVEL_SYSERR;\n \t\tsay(\"\", \"&%s\", tfn);\n"
  },
  {
    "path": "packages/man/tag.c.patch",
    "content": "diff -u -r ../mdocml-1.13.4/tag.c ./tag.c\n--- ../mdocml-1.13.4/tag.c\t2016-07-14 07:13:40.000000000 -0400\n+++ ./tag.c\t2016-07-16 19:03:04.023051008 -0400\n@@ -82,9 +82,9 @@\n \n \t/* Create both temporary output files. */\n \n-\t(void)strlcpy(tag_files.ofn, \"/tmp/man.XXXXXXXXXX\",\n+\t(void)strlcpy(tag_files.ofn, \"@TERMUX_PREFIX@/tmp/man.XXXXXXXXXX\",\n \t    sizeof(tag_files.ofn));\n-\t(void)strlcpy(tag_files.tfn, \"/tmp/man.XXXXXXXXXX\",\n+\t(void)strlcpy(tag_files.tfn, \"@TERMUX_PREFIX@/tmp/man.XXXXXXXXXX\",\n \t    sizeof(tag_files.tfn));\n \tif ((ofd = mkstemp(tag_files.ofn)) == -1)\n \t\tgoto fail;\n"
  },
  {
    "path": "packages/man/tag.h.patch",
    "content": "diff -u -r ../mandoc-1.14.5/tag.h ./tag.h\n--- ../mandoc-1.14.5/tag.h\t2019-03-10 09:56:43.000000000 +0000\n+++ ./tag.h\t2019-03-17 11:02:57.271630396 +0000\n@@ -16,8 +16,8 @@\n  */\n \n struct\ttag_files {\n-\tchar\t ofn[20];\n-\tchar\t tfn[20];\n+\tchar\t ofn[127];\n+\tchar\t tfn[127];\n \tchar\t*tagname;\n \tint\t ofd;\n \tint\t tfd;\n"
  },
  {
    "path": "packages/mariadb/CMakeLists.txt.patch",
    "content": "diff -u -r ../mariadb-10.3.8/CMakeLists.txt ./CMakeLists.txt\n--- ../mariadb-10.3.8/CMakeLists.txt\t2018-07-02 07:34:08.000000000 +0000\n+++ ./CMakeLists.txt\t2018-07-03 11:15:40.073729412 +0000\n@@ -397,7 +397,6 @@\n   OPTION (WITH_EMBEDDED_SERVER \"Compile MySQL with embedded server\" OFF)\n   IF(WITH_EMBEDDED_SERVER) \n    ADD_SUBDIRECTORY(libmysqld)\n-   ADD_SUBDIRECTORY(libmysqld/examples)\n    ADD_SUBDIRECTORY(unittest/embedded)\n   ENDIF(WITH_EMBEDDED_SERVER)\n \n"
  },
  {
    "path": "packages/mariadb/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://mariadb.org\nTERMUX_PKG_DESCRIPTION=\"A drop-in replacement for mysql server\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\n_VERSION=10.4.6\nTERMUX_PKG_VERSION=1:${_VERSION}\nTERMUX_PKG_SRCURL=https://ftp.osuosl.org/pub/mariadb/mariadb-${_VERSION}/source/mariadb-${_VERSION}.tar.gz\nTERMUX_PKG_SHA256=a270fe6169a1aaf6f2cbbc945de2c954d818c48e1a0fc02fbed92ecb94678e70\nTERMUX_PKG_DEPENDS=\"libc++, libiconv, liblzma, ncurses, libedit, openssl, pcre, libcrypt, libandroid-support, libandroid-glob, zlib\"\nTERMUX_PKG_BREAKS=\"mariadb-dev\"\nTERMUX_PKG_REPLACES=\"mariadb-dev\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBISON_EXECUTABLE=$(which bison)\n-DGETCONF=$(which getconf)\n-DBUILD_CONFIG=mysql_release\n-DCAT_EXECUTABLE=$(which cat)\n-DGIT_EXECUTABLE=$(which git)\n-DGSSAPI_FOUND=NO\n-DGRN_WITH_LZ4=no\n-DENABLED_LOCAL_INFILE=ON\n-DHAVE_UCONTEXT_H=False\n-DIMPORT_EXECUTABLES=$TERMUX_PKG_HOSTBUILD_DIR/import_executables.cmake\n-DINSTALL_LAYOUT=DEB\n-DINSTALL_UNIX_ADDRDIR=$TERMUX_PREFIX/tmp/mysqld.sock\n-DINSTALL_SBINDIR=$TERMUX_PREFIX/bin\n-DMYSQL_DATADIR=$TERMUX_PREFIX/var/lib/mysql\n-DPLUGIN_AUTH_GSSAPI_CLIENT=OFF\n-DPLUGIN_AUTH_GSSAPI=NO\n-DPLUGIN_CONNECT=NO\n-DPLUGIN_DAEMON_EXAMPLE=NO\n-DPLUGIN_EXAMPLE=NO\n-DPLUGIN_GSSAPI=OFF\n-DPLUGIN_ROCKSDB=NO\n-DPLUGIN_TOKUDB=NO\n-DPLUGIN_SERVER_AUDIT=NO\n-DSTACK_DIRECTION=-1\n-DTMPDIR=$TERMUX_PREFIX/tmp\n-DWITH_EXTRA_CHARSETS=complex\n-DWITH_JEMALLOC=OFF\n-DWITH_MARIABACKUP=OFF\n-DWITH_PCRE=system\n-DWITH_READLINE=OFF\n-DWITH_SSL=system\n-DWITH_WSREP=False\n-DWITH_ZLIB=system\n-DWITH_INNODB_BZIP2=OFF\n-DWITH_INNODB_LZ4=OFF\n-DWITH_INNODB_LZMA=ON\n-DWITH_INNODB_LZO=OFF\n-DWITH_INNODB_SNAPPY=OFF\n-DWITH_UNIT_TESTS=OFF\n-DINSTALL_SYSCONFDIR=$TERMUX_PREFIX/etc\n\"\n\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_CONFLICTS=\"mysql\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/mysqltest*\"\n\ntermux_step_host_build() {\n\ttermux_setup_cmake\n\tcmake -G \"Unix Makefiles\" \\\n\t\t$TERMUX_PKG_SRCDIR \\\n\t\t-DWITH_SSL=bundled \\\n\t\t-DCMAKE_BUILD_TYPE=Release\n\tmake -j $TERMUX_MAKE_PROCESSES import_executables\n}\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tCPPFLAGS+=\" -Dushort=u_short\"\n\n\tif [ $TERMUX_ARCH_BITS = 32 ]; then\n\t\tCPPFLAGS+=\" -D__off64_t_defined -DTERMUX_EXPOSE_FILE_OFFSET64=1\"\n\tfi\n\n\tif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\t# Avoid undefined reference to __atomic_load_8:\n\t\tCFLAGS+=\" -latomic\"\n\tfi\n}\n\ntermux_step_post_make_install() {\n\t# files not needed\n\trm -r $TERMUX_PREFIX/{mysql-test,sql-bench}\n\trm $TERMUX_PREFIX/share/man/man1/mysql-test-run.pl.1\n}\n\ntermux_step_post_massage() {\n\tmkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/etc/my.cnf.d\n}\n\ntermux_step_create_debscripts() {\n\techo \"if [ ! -e \"$TERMUX_PREFIX/var/lib/mysql\" ]; then\" > postinst\n\techo \"  echo 'Initializing mysql data directory...'\" >> postinst\n\techo \"  mkdir -p $TERMUX_PREFIX/var/lib/mysql\" >> postinst\n\techo \"  $TERMUX_PREFIX/bin/mysql_install_db --user=\\$(whoami) --datadir=$TERMUX_PREFIX/var/lib/mysql --basedir=$TERMUX_PREFIX\" >> postinst\n\techo \"fi\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n}\n"
  },
  {
    "path": "packages/mariadb/client-CMakeLists.txt.patch",
    "content": "diff -uNr mariadb-10.4.6/client/CMakeLists.txt mariadb-10.4.6.mod/client/CMakeLists.txt\n--- mariadb-10.4.6/client/CMakeLists.txt\t2019-06-18 01:00:31.000000000 +0300\n+++ mariadb-10.4.6.mod/client/CMakeLists.txt\t2019-07-24 17:53:17.771246533 +0300\n@@ -44,10 +44,6 @@\n   SET_TARGET_PROPERTIES(mysql PROPERTIES ENABLE_EXPORTS TRUE)\n ENDIF(UNIX)\n\n-MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)\n-SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS \"-DTHREADS\")\n-TARGET_LINK_LIBRARIES(mysqltest  ${CLIENT_LIB} pcreposix pcre)\n-SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE)\n\n\n MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)\n@@ -92,7 +88,7 @@\n SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap mysql_plugin async_example\n PROPERTIES HAS_CXX TRUE)\n\n-FOREACH(t mysql mysqltest mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysql_plugin mysqlbinlog\n+FOREACH(t mysql mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysql_plugin mysqlbinlog\n   mysqladmin mysqlslap async_example)\n   ADD_DEPENDENCIES(${t} GenError ${CLIENT_LIB})\n ENDFOREACH()\n"
  },
  {
    "path": "packages/mariadb/client-mysql.cc.patch",
    "content": "diff -u -r ../mariadb-10.1.22/client/mysql.cc ./client/mysql.cc\n--- ../mariadb-10.1.22/client/mysql.cc\t2017-03-11 20:08:54.000000000 +0100\n+++ ./client/mysql.cc\t2017-04-07 03:12:08.091397345 +0200\n@@ -2676,9 +2676,9 @@\n #ifdef HAVE_LOCALE_H\n   setlocale(LC_ALL,\"\"); /* so as libedit use isprint */\n #endif\n-  rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;\n-  rl_completion_entry_function= &no_completion;\n-  rl_add_defun(\"magic-space\", (Function*)&fake_magic_space, -1);\n+  rl_attempted_completion_function= (rl_completion_func_t*)&new_mysql_completion;\n+  rl_completion_entry_function= (rl_compentry_func_t*)&no_completion;\n+  rl_add_defun(\"magic-space\", (rl_command_func_t*)&fake_magic_space, -1);\n #else\n   rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;\n   rl_completion_entry_function= &no_completion;\n@@ -2700,7 +2700,7 @@\n #if defined(USE_NEW_READLINE_INTERFACE)\n     return rl_completion_matches(text, new_command_generator);\n #else\n-    return completion_matches((char *)text, (CPFunction *)new_command_generator);\n+    return completion_matches((char *)text, (rl_compentry_func_t *)new_command_generator);\n #endif\n   else\n     return (char**) 0;\n"
  },
  {
    "path": "packages/mariadb/cmake-install_layout.cmake.patch",
    "content": "diff -u -r ../mariadb-10.3.8/cmake/install_layout.cmake ./cmake/install_layout.cmake\n--- ../mariadb-10.3.8/cmake/install_layout.cmake\t2018-07-02 09:34:08.000000000 +0200\n+++ ./cmake/install_layout.cmake\t2018-07-22 23:28:13.863668234 +0200\n@@ -172,7 +172,6 @@\n SET(INSTALL_SBINDIR_DEB                 \"sbin\")\n SET(INSTALL_SCRIPTDIR_DEB               \"bin\")\n SET(INSTALL_SYSCONFDIR_DEB              \"/etc\")\n-SET(INSTALL_SYSCONF2DIR_DEB             \"/etc/mysql/conf.d\")\n #\n SET(INSTALL_LIBDIR_DEB                  \"lib\")\n SET(INSTALL_PLUGINDIR_DEB               \"lib/mysql/plugin\")\n"
  },
  {
    "path": "packages/mariadb/cmake-mariadb_connector_c.cmake.patch.beforehostbuild",
    "content": "Patch to make host build work without gnutls.\n\ndiff -u -r ../mariadb-10.2.10/cmake/mariadb_connector_c.cmake ./cmake/mariadb_connector_c.cmake\n--- ../mariadb-10.2.10/cmake/mariadb_connector_c.cmake\t2017-10-30 09:10:43.000000000 +0100\n+++ ./cmake/mariadb_connector_c.cmake\t2017-11-22 00:20:32.172653814 +0100\n@@ -15,7 +15,7 @@\n   IF(WIN32)\n     SET(CONC_WITH_SSL \"SCHANNEL\")\n   ELSE()\n-    SET(CONC_WITH_SSL \"GNUTLS\") # that's what debian wants, right?\n+    SET(CONC_WITH_SSL \"YASSL\")\n   ENDIF()\n ELSE()\n   SET(CONC_WITH_SSL \"OPENSSL\")\n"
  },
  {
    "path": "packages/mariadb/cmake-pcre.cmake.patch",
    "content": "diff -u -r ../mariadb-10.2.10/cmake/pcre.cmake ./cmake/pcre.cmake\n--- ../mariadb-10.2.10/cmake/pcre.cmake\t2017-10-30 09:10:43.000000000 +0100\n+++ ./cmake/pcre.cmake\t2017-11-07 04:56:54.904935897 +0100\n@@ -6,7 +6,9 @@\n MACRO (CHECK_PCRE)\n   IF(WITH_PCRE STREQUAL \"system\" OR WITH_PCRE STREQUAL \"auto\")\n     CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard \"\" HAVE_PCRE_STACK_GUARD)\n-    IF(NOT CMAKE_CROSSCOMPILING)\n+    IF(CMAKE_CROSSCOMPILING)\n+      SET(PCRE_STACK_SIZE_OK TRUE)\n+    ELSE()\n       SET(CMAKE_REQUIRED_LIBRARIES \"pcre\")\n       CHECK_C_SOURCE_RUNS(\"\n         #include <pcre.h>\n"
  },
  {
    "path": "packages/mariadb/cmake-readline.cmake.patch",
    "content": "diff -u -r ../mariadb-10.1.22/cmake/readline.cmake ./cmake/readline.cmake\n--- ../mariadb-10.1.22/cmake/readline.cmake\t2017-03-11 20:08:54.000000000 +0100\n+++ ./cmake/readline.cmake\t2017-04-07 02:43:58.242765383 +0200\n@@ -180,7 +180,7 @@\n     #include <readline.h>\n     int main(int argc, char **argv)\n     {\n-      int res= (*rl_completion_entry_function)(0,0);\n+      char* res= (*rl_completion_entry_function)(0,0);\n       completion_matches(0,0);\n     }\"\n     LIBEDIT_INTERFACE)\n"
  },
  {
    "path": "packages/mariadb/etc-my.cnf.patch",
    "content": "diff -u -r ./support-files/mysql-multi.server.sh ../src.orig/support-files/mysql-multi.server.sh\n--- ./support-files/mysql-multi.server.sh\t2017-10-30 08:10:49.000000000 +0000\n+++ ../src.orig/support-files/mysql-multi.server.sh\t2017-12-09 20:12:10.456623540 +0000\n@@ -77,8 +77,8 @@\n then\n   print_defaults=\"@bindir@/mysql_print_defaults\"\n else\n-  # Try to find basedir in /etc/my.cnf\n-  conf=/etc/my.cnf\n+  # Try to find basedir in @TERMUX_PREFIX@/etc/my.cnf\n+  conf=@TERMUX_PREFIX@/etc/my.cnf\n   print_defaults=\n   if test -r $conf\n   then\ndiff -u -r ./support-files/mysql.server.sh ../src.orig/support-files/mysql.server.sh\n--- ./support-files/mysql.server.sh\t2017-10-30 08:10:49.000000000 +0000\n+++ ../src.orig/support-files/mysql.server.sh\t2017-12-09 20:12:10.460623538 +0000\n@@ -159,8 +159,8 @@\n if test -x \"$bindir/my_print_defaults\";  then\n   print_defaults=\"$bindir/my_print_defaults\"\n else\n-  # Try to find basedir in /etc/my.cnf\n-  conf=/etc/my.cnf\n+  # Try to find basedir in @TERMUX_PREFIX@/etc/my.cnf\n+  conf=@TERMUX_PREFIX@/etc/my.cnf\n   print_defaults=\n   if test -r $conf\n   then\ndiff -u -r ./support-files/policy/apparmor/usr.sbin.mysqld ../src.orig/support-files/policy/apparmor/usr.sbin.mysqld\n--- ./support-files/policy/apparmor/usr.sbin.mysqld\t2017-10-30 08:10:49.000000000 +0000\n+++ ../src.orig/support-files/policy/apparmor/usr.sbin.mysqld\t2017-12-09 20:12:10.432623549 +0000\n@@ -29,7 +29,7 @@\n   /etc/hosts.deny r,\n   /etc/ld.so.cache r,\n   /etc/mtab r,\n-  /etc/my.cnf r,\n+  @TERMUX_PREFIX@/etc/my.cnf r,\n   /etc/mysql/*.cnf r,\n   /etc/mysql/*.pem r,\n   /etc/mysql/conf.d/ r,\n@@ -81,7 +81,7 @@\n     /bin/which rix,\n     /dev/tty rw,\n     /etc/ld.so.cache r,\n-    /etc/my.cnf r,\n+    @TERMUX_PREFIX@/etc/my.cnf r,\n     /proc/ r,\n     /proc/*/cmdline r,\n     /proc/*/fd/ r,\ndiff -u -r ./support-files/rpm/my.cnf ../src.orig/support-files/rpm/my.cnf\n--- ./support-files/rpm/my.cnf\t2017-10-30 08:10:49.000000000 +0000\n+++ ../src.orig/support-files/rpm/my.cnf\t2017-12-09 20:12:10.440623546 +0000\n@@ -7,5 +7,5 @@\n #\n # include all files from the config directory\n #\n-!includedir /etc/my.cnf.d\n+!includedir @TERMUX_PREFIX@/etc/my.cnf.d\n \n"
  },
  {
    "path": "packages/mariadb/libmariadb-libmariadb-CMakeLists.txt.patch",
    "content": "diff -u -r ../mariadb-10.3.14/libmariadb/libmariadb/CMakeLists.txt ./libmariadb/libmariadb/CMakeLists.txt\n--- ../mariadb-10.3.14/libmariadb/libmariadb/CMakeLists.txt\t2019-04-01 14:03:57.000000000 +0000\n+++ ./libmariadb/libmariadb/CMakeLists.txt\t2019-05-22 23:50:06.105346983 +0000\n@@ -302,7 +302,6 @@\n   IF(ICONV_INCLUDE_DIR)\n      INCLUDE_DIRECTORIES(BEFORE ${ICONV_INCLUDE_DIR}) \n   ENDIF()\n-  ADD_DEFINITIONS(-DLIBICONV_PLUG)\n ENDIF()\n \n IF(ZLIB_FOUND AND WITH_EXTERNAL_ZLIB)\n"
  },
  {
    "path": "packages/mariadb/scripts-mysql_install_db.sh.patch",
    "content": "diff -uNr mariadb-10.4.6/scripts/mysql_install_db.sh mariadb-10.4.6.mod/scripts/mysql_install_db.sh\n--- mariadb-10.4.6/scripts/mysql_install_db.sh\t2019-06-18 01:00:32.000000000 +0300\n+++ mariadb-10.4.6.mod/scripts/mysql_install_db.sh\t2019-08-04 21:52:11.299044998 +0300\n@@ -1,16 +1,16 @@\n #!/bin/sh\n # Copyright (c) 2000, 2013, Oracle and/or its affiliates.\n # Copyright (c) 2009, 2013, Monty Program Ab\n-# \n+#\n # This program is free software; you can redistribute it and/or modify\n # it under the terms of the GNU General Public License as published by\n # the Free Software Foundation; version 2 of the License.\n-# \n+#\n # This program is distributed in the hope that it will be useful,\n # but WITHOUT ANY WARRANTY; without even the implied warranty of\n # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n # GNU General Public License for more details.\n-# \n+#\n # You should have received a copy of the GNU General Public License\n # along with this program; if not, write to the Free Software\n # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1335  USA\n@@ -76,7 +76,7 @@\n   --force              Causes mysql_install_db to run even if DNS does not\n                        work.  In that case, grant table entries that\n                        normally use hostnames will use IP addresses.\n-  --help               Display this help and exit.                     \n+  --help               Display this help and exit.\n   --ldata=path         The path to the MariaDB data directory. Same as\n                        --datadir.\n   --no-defaults        Don't read default options from any option file.\n@@ -453,37 +453,10 @@\n     fi\n     chmod 700 \"$dir\"\n   fi\n-  if test -n \"$user\"\n-  then\n-    chown $user \"$dir\"\n-    if test $? -ne 0\n-    then\n-      echo \"Cannot change ownership of the database directories to the '$user'\"\n-      echo \"user.  Check that you have the necessary permissions and try again.\"\n-      exit 1\n-    fi\n-  fi\n done\n \n if test -n \"$user\"\n then\n-  chown $user \"$pamtooldir/auth_pam_tool_dir\"\n-  if test $? -ne 0\n-  then\n-      echo \"Cannot change ownership of the '$pamtooldir/auth_pam_tool_dir' directory\"\n-      echo \" to the '$user' user. Check that you have the necessary permissions and try again.\"\n-      exit 1\n-  fi\n-  if test -z \"$srcdir\"\n-  then\n-    chown 0 \"$pamtooldir/auth_pam_tool_dir/auth_pam_tool\"\n-    if test $? -ne 0\n-    then\n-        echo \"Couldn't set an owner to '$pamtooldir/auth_pam_tool_dir/auth_pam_tool'.\"\n-        echo \" It must be root, the PAM authentication plugin doesn't work otherwise..\"\n-        echo\n-    fi\n-  fi\n   args=\"$args --user=$user\"\n fi\n \n"
  },
  {
    "path": "packages/mariadb/sql-CMakeLists.txt.patch",
    "content": "diff -u -r ../mariadb-10.3.8/sql/CMakeLists.txt ./sql/CMakeLists.txt\n--- ../mariadb-10.3.8/sql/CMakeLists.txt\t2018-07-02 07:34:11.000000000 +0000\n+++ ./sql/CMakeLists.txt\t2018-07-22 21:00:22.913542838 +0000\n@@ -388,6 +388,7 @@\n         DEPENDS\n         ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h\n         ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h\n+        ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc\n         ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc_ora.cc\n )\n \n"
  },
  {
    "path": "packages/mathomatic/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://en.wikipedia.org/wiki/Mathomatic\nTERMUX_PKG_DESCRIPTION=\"Simple CAS and symbolic calculator\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=16.0.5\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=\"https://fossies.org/linux/misc/old/mathomatic-${TERMUX_PKG_VERSION}.tar.xz\"\nTERMUX_PKG_SHA256=7f525bdb2e13006549dd8f17906c26f926f5ac51174f02f074107c612491e05c\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"READLINE=1\"\nTERMUX_PKG_DEPENDS=\"readline\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/applications/mathomatic.desktop share/pixmaps\"\nTERMUX_PKG_MAINTAINER=\"Jonathan Badger @jhbadger\"\n\ntermux_step_pre_configure() {\n\trm $TERMUX_PKG_SRCDIR/CMakeLists.txt\n\tCPPFLAGS+=\" -DUSE_TGAMMA -DBOLD_COLOR\"\n}\n"
  },
  {
    "path": "packages/mathomatic/fix-paths.patch",
    "content": "diff -uNr mathomatic-16.0.5/am.h mathomatic-16.0.5.mod/am.h\n--- mathomatic-16.0.5/am.h\t2012-08-19 17:42:52.000000000 +0300\n+++ mathomatic-16.0.5.mod/am.h\t2019-03-01 20:49:40.456989348 +0200\n@@ -57,7 +57,7 @@\n #define\tTEXT_ROWS\tSTANDARD_SCREEN_ROWS\t\t/* number of lines per page in the symbolic math library */\n #define\tTEXT_COLUMNS\tSTANDARD_SCREEN_COLUMNS\t\t/* default number of columns per page in the symbolic math library */\n\n-#define\tTMP_FILE\t\"/tmp/mathomatic.XXXXXX\"\t/* temporary file template for mkstemp(3) */\n+#define\tTMP_FILE\t\"@TERMUX_PREFIX@/tmp/mathomatic.XXXXXX\"\t/* temporary file template for mkstemp(3) */\n\n #define\tPROMPT_STR\t\"-> \"\t\t\t\t/* user interface main prompt strings, preceded by the current equation number */\n #define\tHTML_PROMPT_STR\t\"&minus;&gt; \"\t\t\t/* main prompt in HTML output mode, should be same number of columns as above */\ndiff -uNr mathomatic-16.0.5/help.c mathomatic-16.0.5.mod/help.c\n--- mathomatic-16.0.5/help.c\t2012-10-01 13:43:46.000000000 +0300\n+++ mathomatic-16.0.5.mod/help.c\t2019-03-01 20:50:09.883839729 +0200\n@@ -612,7 +612,7 @@\n #else\n \t\tcp1 = getenv(\"SHELL\");\n \t\tif (cp1 == NULL) {\n-\t\t\tcp1 = \"/bin/sh\";\n+\t\t\tcp1 = \"@TERMUX_PREFIX@/bin/sh\";\n \t\t}\n #endif\n #if\t0\n@@ -1157,7 +1157,7 @@\n \t\t}\n \t\tif (cp[0] == '!') {\n \t\t\tSP(\"A command preceded by an exclamation point (such as \\\"!ls\\\") is taken to\");\n-\t\t\tSP(\"be a shell command and is passed unchanged to the shell (/bin/sh) when\");\n+\t\t\tSP(\"be a shell command and is passed unchanged to the shell (@TERMUX_PREFIX@/bin/sh) when\");\n \t\t\tSP(\"Mathomatic is not in secure mode.  \\\"!\\\" by itself invokes the default shell,\");\n \t\t\tEP(\"which is specified in the SHELL environment variable.\\n\");\n\n"
  },
  {
    "path": "packages/mbedtls/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://tls.mbed.org/\nTERMUX_PKG_DESCRIPTION=\"Light-weight cryptographic and SSL/TLS library\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Andy Li @andyli\"\nTERMUX_PKG_VERSION=2.17.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=321a2c0220d9f75703e929c01dabba7b77da4cf2e39944897fc41d888bb1ef0d\nTERMUX_PKG_BREAKS=\"mbedtls-dev\"\nTERMUX_PKG_REPLACES=\"mbedtls-dev\"\nTERMUX_PKG_SRCURL=https://github.com/ARMmbed/mbedtls/archive/mbedtls-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DUSE_STATIC_MBEDTLS_LIBRARY=OFF\n-DUSE_SHARED_MBEDTLS_LIBRARY=ON\n-DENABLE_TESTING=OFF\n-DENABLE_PROGRAMS=OFF\n\"\n"
  },
  {
    "path": "packages/mc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.midnight-commander.org/\nTERMUX_PKG_DESCRIPTION=\"Midnight Commander - a powerful file manager\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.8.23\nTERMUX_PKG_SHA256=dd7f7ce74183307b0df25b5c3e60ad3293fd3d3d27d2f37dd7a10efce13dff1c\nTERMUX_PKG_SRCURL=http://ftp.midnight-commander.org/mc-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv, ncurses, glib, openssl, libssh2, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_util_openpty=no\nac_cv_path_PERL=$TERMUX_PREFIX/bin/perl\nac_cv_path_PYTHON=$TERMUX_PREFIX/bin/python\nac_cv_path_RUBY=$TERMUX_PREFIX/bin/ruby\nac_cv_path_UNZIP=$TERMUX_PREFIX/bin/unzip\nac_cv_path_ZIP=$TERMUX_PREFIX/bin/zip\n--with-ncurses-includes=$TERMUX_PREFIX/include\n--with-ncurses-libs=$TERMUX_PREFIX/lib\n--with-screen=ncurses\n\"\n\ntermux_step_pre_configure() {\n\tif $TERMUX_DEBUG; then\n\t\t# Debug build fails with:\n\t\t# /home/builder/.termux-build/mc/src/src/filemanager/file.c:2019:37: error: 'umask' called with invalid mode\n\t\t# src_mode = umask (-1);\n\t\t#\t\t      ^\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n"
  },
  {
    "path": "packages/mc/configure.patch",
    "content": "diff -u -r ../mc-4.8.23/configure ./configure\n--- ../mc-4.8.23/configure\t2019-06-22 11:44:11.000000000 +0000\n+++ ./configure\t2019-06-23 17:51:24.487569137 +0000\n@@ -20600,12 +20600,6 @@\n     esac\n   fi\n \n-  if test -z \"$ac_list_mounted_fs\"; then\n-    as_fn_error $? \"could not determine how to read list of mounted file systems\" \"$LINENO\" 5\n-    # FIXME -- no need to abort building the whole package\n-    # Can't build mountlist.c or anything that needs its functions\n-  fi\n-\n   if test $ac_list_mounted_fs = found; then\n     gl_cv_list_mounted_fs=yes\n   else\n"
  },
  {
    "path": "packages/mc/filegui_magics.patch",
    "content": "diff -u -r ../mc-4.8.11/src/filemanager/filegui.c ./src/filemanager/filegui.c\n--- ../mc-4.8.11/src/filemanager/filegui.c\t2013-11-29 19:27:07.000000000 +0100\n+++ ./src/filemanager/filegui.c\t2014-02-07 02:01:49.000000000 +0100\n@@ -184,13 +184,7 @@\n \n /* *INDENT-OFF* */\n typedef enum {\n-    MSDOS_SUPER_MAGIC     = 0x4d44,\n-    NTFS_SB_MAGIC         = 0x5346544e,\n-    FUSE_MAGIC            = 0x65735546,\n-    PROC_SUPER_MAGIC      = 0x9fa0,\n-    SMB_SUPER_MAGIC       = 0x517B,\n-    NCP_SUPER_MAGIC       = 0x564c,\n-    USBDEVICE_SUPER_MAGIC = 0x9fa2\n+    FUSE_MAGIC            = 0x65735546\n } filegui_nonattrs_fs_t;\n /* *INDENT-ON* */\n \n"
  },
  {
    "path": "packages/mc/filemanager_ext.c.patch",
    "content": "diff -u -r ../mc-4.8.12/src/filemanager/ext.c ./src/filemanager/ext.c\n--- ../mc-4.8.12/src/filemanager/ext.c\t2014-04-01 12:54:01.000000000 +0200\n+++ ./src/filemanager/ext.c\t2014-06-05 16:26:24.821998594 +0200\n@@ -454,7 +454,7 @@\n     }\n \n     cmd_file = fdopen (cmd_file_fd, \"w\");\n-    fputs (\"#! /bin/sh\\n\\n\", cmd_file);\n+    fputs (\"#! @TERMUX_PREFIX@/bin/sh\\n\\n\", cmd_file);\n \n     export_variables = exec_get_export_variables (filename_vpath);\n     if (export_variables != NULL)\n@@ -472,7 +472,7 @@\n      * so we clean up after calling view().\n      */\n     if (!run_view)\n-        fprintf (cmd_file, \"\\n/bin/rm -f %s\\n\", vfs_path_as_str (script_vpath));\n+        fprintf (cmd_file, \"\\n@TERMUX_PREFIX@/bin/applets/rm -f %s\\n\", vfs_path_as_str (script_vpath));\n \n     fclose (cmd_file);\n \n@@ -486,7 +486,7 @@\n         /* Set executable flag on the command file ... */\n         mc_chmod (script_vpath, S_IRWXU);\n         /* ... but don't rely on it - run /bin/sh explicitly */\n-        cmd = g_strconcat (\"/bin/sh \", vfs_path_as_str (script_vpath), (char *) NULL);\n+        cmd = g_strconcat (\"@TERMUX_PREFIX@/bin/sh \", vfs_path_as_str (script_vpath), (char *) NULL);\n     }\n \n     if (run_view)\n"
  },
  {
    "path": "packages/mc/lib-shell.c.patch",
    "content": "diff -u -r ../mc-4.8.17/lib/shell.c ./lib/shell.c\n--- ../mc-4.8.17/lib/shell.c\t2016-05-07 11:42:52.000000000 -0400\n+++ ./lib/shell.c\t2016-05-21 17:00:02.116441571 -0400\n@@ -64,20 +64,14 @@\n     mc_shell = g_new0 (mc_shell_t, 1);\n \n     /* 3rd choice: look for existing shells supported as MC subshells.  */\n-    if (access (\"/bin/bash\", X_OK) == 0)\n-        mc_shell->path = g_strdup (\"/bin/bash\");\n-    else if (access (\"/bin/ash\", X_OK) == 0)\n-        mc_shell->path = g_strdup (\"/bin/ash\");\n-    else if (access (\"/bin/dash\", X_OK) == 0)\n-        mc_shell->path = g_strdup (\"/bin/dash\");\n-    else if (access (\"/bin/busybox\", X_OK) == 0)\n-        mc_shell->path = g_strdup (\"/bin/busybox\");\n-    else if (access (\"/bin/zsh\", X_OK) == 0)\n-        mc_shell->path = g_strdup (\"/bin/zsh\");\n-    else if (access (\"/bin/tcsh\", X_OK) == 0)\n-        mc_shell->path = g_strdup (\"/bin/tcsh\");\n-    else if (access (\"/bin/csh\", X_OK) == 0)\n-        mc_shell->path = g_strdup (\"/bin/csh\");\n+    if (access (\"@TERMUX_PREFIX@/bin/bash\", X_OK) == 0)\n+        mc_shell->path = g_strdup (\"@TERMUX_PREFIX@/bin/bash\");\n+    else if (access (\"@TERMUX_PREFIX@/bin/ash\", X_OK) == 0)\n+        mc_shell->path = g_strdup (\"@TERMUX_PREFIX@/bin/ash\");\n+    else if (access (\"@TERMUX_PREFIX@/bin/dash\", X_OK) == 0)\n+        mc_shell->path = g_strdup (\"@TERMUX_PREFIX@/bin/dash\");\n+    else if (access (\"@TERMUX_PREFIX@/bin/zsh\", X_OK) == 0)\n+        mc_shell->path = g_strdup (\"@TERMUX_PREFIX@/bin/zsh\");\n     /* No fish as fallback because it is so much different from other shells and\n      * in a way exotic (even though user-friendly by name) that we should not\n      * present it as a subshell without the user's explicit intention. We rather\n@@ -87,7 +81,7 @@\n      */\n     else\n         /* Fallback and last resort: system default shell */\n-        mc_shell->path = g_strdup (\"/bin/sh\");\n+        mc_shell->path = g_strdup (\"@TERMUX_PREFIX@/bin/sh\");\n \n     return mc_shell;\n }\n"
  },
  {
    "path": "packages/mc/lib-tty-key.c.patch",
    "content": "The code assumes that \"kmous\" capability is for X10 mouse reporting,\nso if an event for kmous happens it tries to decode it according to\nthe X10 protocol.\n\nThis breaks starting with ncurses 6.1 as the terminfo for xterm\nstarted using the SGR sequence for xterm in 6.1.\n\nThis is a hacky, non-invasive patch which just assumes that the SGR\nprotocol is used.\n\ndiff -u -r ../mc-4.8.20/lib/tty/key.c ./lib/tty/key.c\n--- ../mc-4.8.20/lib/tty/key.c\t2017-03-04 18:51:38.000000000 +0100\n+++ ./lib/tty/key.c\t2018-02-08 23:19:38.207353992 +0100\n@@ -2140,7 +2140,7 @@\n                           || c == MCKEY_EXTENDED_MOUSE))\n     {\n         /* Mouse event */\n-        xmouse_get_event (event, c == MCKEY_EXTENDED_MOUSE);\n+        xmouse_get_event (event, 1);\n         c = (event->type != 0) ? EV_MOUSE : EV_NONE;\n     }\n     else if (c == MCKEY_BRACKETED_PASTING_START)\n"
  },
  {
    "path": "packages/mc/lib-tty-tty.c.patch",
    "content": "diff -u -r ../mc-4.8.11/lib/tty/tty.c ./lib/tty/tty.c\n--- ../mc-4.8.11/lib/tty/tty.c\t2013-11-29 19:27:07.000000000 +0100\n+++ ./lib/tty/tty.c\t2014-01-08 12:02:35.217251791 +0100\n@@ -34,6 +34,7 @@\n #include <stdarg.h>\n #include <stdlib.h>\n #include <string.h>             /* memset() */\n+#include <termios.h>\n #include <unistd.h>             /* exit() */\n \n #ifdef HAVE_SYS_IOCTL_H\n"
  },
  {
    "path": "packages/mc/lib-utilunix.c.patch",
    "content": "diff -u -r ../mc-4.8.20/lib/utilunix.c ./lib/utilunix.c\n--- ../mc-4.8.20/lib/utilunix.c\t2017-03-04 18:51:38.000000000 +0100\n+++ ./lib/utilunix.c\t2017-11-26 23:09:50.934799848 +0100\n@@ -511,7 +511,7 @@\n mc_popen (const char *command, GError ** error)\n {\n     mc_pipe_t *p;\n-    const char *const argv[] = { \"/bin/sh\", \"sh\", \"-c\", command, NULL };\n+    const char *const argv[] = { \"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", command, NULL };\n \n     p = g_try_new (mc_pipe_t, 1);\n     if (p == NULL)\n"
  },
  {
    "path": "packages/mc/lib-widget-input_complete.c.patch",
    "content": "diff -u -r ../mc-4.8.17/lib/widget/input_complete.c ./lib/widget/input_complete.c\n--- ../mc-4.8.17/lib/widget/input_complete.c\t2016-05-07 11:42:52.000000000 -0400\n+++ ./lib/widget/input_complete.c\t2016-05-21 17:03:05.409602557 -0400\n@@ -313,6 +313,7 @@\n static char *\n username_completion_function (const char *text, int state, input_complete_t flags)\n {\n+#ifndef __ANDROID__\n     static struct passwd *entry = NULL;\n     static size_t userlen = 0;\n \n@@ -340,6 +341,7 @@\n         return g_strconcat (\"~\", entry->pw_name, PATH_SEP_STR, (char *) NULL);\n \n     endpwent ();\n+#endif\n     return NULL;\n }\n \n"
  },
  {
    "path": "packages/mc/man2hlp.in.patch",
    "content": "diff --git a/src/man2hlp/man2hlp.in b/src/man2hlp/man2hlp.in\nindex f095830..f7a97ea 100644\n--- a/src/man2hlp/man2hlp.in\n+++ b/src/man2hlp/man2hlp.in\n@@ -1,4 +1,4 @@\n-#! @PERL@ -w\n+#! /usr/bin/perl -w\n #\n #  Man page to help file converter\n #  Copyright (C) 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004, 2005,\n"
  },
  {
    "path": "packages/mc/src-filemanager-achown.c.patch",
    "content": "diff -u -r ../mc-4.8.21/src/filemanager/achown.c ./src/filemanager/achown.c\n--- ../mc-4.8.21/src/filemanager/achown.c\t2018-05-27 19:56:21.000000000 +0000\n+++ ./src/filemanager/achown.c\t2018-06-03 22:53:50.499299792 +0000\n@@ -564,22 +564,26 @@\n         listbox_add_item (chl_list, LISTBOX_APPEND_AT_END, 0, \"<Unknown>\", NULL, FALSE);\n         if (is_owner)\n         {\n+#ifndef __ANDROID__\n             /* get and put user names in the listbox */\n             setpwent ();\n             while ((chl_pass = getpwent ()) != NULL)\n                 listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0, chl_pass->pw_name, NULL,\n                                   FALSE);\n             endpwent ();\n+#endif\n             fe = listbox_search_text (chl_list, get_owner (sf_stat.st_uid));\n         }\n         else\n         {\n+#ifndef __ANDROID__\n             /* get and put group names in the listbox */\n             setgrent ();\n             while ((chl_grp = getgrent ()) != NULL)\n                 listbox_add_item (chl_list, LISTBOX_APPEND_SORTED, 0, chl_grp->gr_name, NULL,\n                                   FALSE);\n             endgrent ();\n+#endif\n             fe = listbox_search_text (chl_list, get_group (sf_stat.st_gid));\n         }\n \n"
  },
  {
    "path": "packages/mc/src-filemanager-chown.c.patch",
    "content": "diff -u -r ../mc-4.8.15/src/filemanager/chown.c ./src/filemanager/chown.c\n--- ../mc-4.8.15/src/filemanager/chown.c\t2015-11-06 04:11:09.000000000 -0500\n+++ ./src/filemanager/chown.c\t2015-11-20 18:01:45.372666628 -0500\n@@ -220,10 +220,12 @@\n     /* add field for unknown names (numbers) */\n     listbox_add_item (l_user, LISTBOX_APPEND_AT_END, 0, _(\"<Unknown user>\"), NULL, FALSE);\n     /* get and put user names in the listbox */\n+#ifndef __ANDROID__\n     setpwent ();\n     while ((l_pass = getpwent ()) != NULL)\n         listbox_add_item (l_user, LISTBOX_APPEND_SORTED, 0, l_pass->pw_name, NULL, FALSE);\n     endpwent ();\n+#endif\n \n     add_widget (ch_dlg, groupbox_new (2, 4 + GW, GH, GW, _(\"Group name\")));\n     l_group = listbox_new (3, 5 + GW, GH - 2, GW - 2, FALSE, NULL);\n@@ -231,10 +233,12 @@\n     /* add field for unknown names (numbers) */\n     listbox_add_item (l_group, LISTBOX_APPEND_AT_END, 0, _(\"<Unknown group>\"), NULL, FALSE);\n     /* get and put group names in the listbox */\n+#ifndef __ANDROID__\n     setgrent ();\n     while ((l_grp = getgrent ()) != NULL)\n         listbox_add_item (l_group, LISTBOX_APPEND_SORTED, 0, l_grp->gr_name, NULL, FALSE);\n     endgrent ();\n+#endif\n \n     add_widget (ch_dlg, groupbox_new (2, 5 + GW * 2, GH, GW, _(\"File\")));\n     /* add widgets for the file information */\n"
  },
  {
    "path": "packages/mc/src-filemanager-file.c.patch",
    "content": "diff -u -r ../mc-4.8.19/src/filemanager/file.c ./src/filemanager/file.c\n--- ../mc-4.8.19/src/filemanager/file.c\t2017-03-04 18:51:38.000000000 +0100\n+++ ./src/filemanager/file.c\t2017-03-07 14:20:17.123804844 +0100\n@@ -665,8 +665,15 @@\n get_times (const struct stat *sb, mc_timesbuf_t * times)\n {\n #ifdef HAVE_UTIMENSAT\n+# ifdef __ANDROID__\n+    (*times)[0].tv_sec = sb->st_atime;\n+    (*times)[0].tv_nsec = sb->st_atime_nsec;\n+    (*times)[1].tv_sec = sb->st_mtime;\n+    (*times)[1].tv_nsec = sb->st_mtime_nsec;\n+#  else\n     (*times)[0] = sb->st_atim;\n     (*times)[1] = sb->st_mtim;\n+# endif\n #else\n     times->actime = sb->st_atime;\n     times->modtime = sb->st_mtime;\n"
  },
  {
    "path": "packages/mc/src-usermenu.c.patch",
    "content": "diff -u -r ../mc-4.8.21/src/usermenu.c ./src/usermenu.c\n--- ../mc-4.8.21/src/usermenu.c\t2018-05-27 19:56:21.000000000 +0000\n+++ ./src/usermenu.c\t2018-06-03 22:55:09.086449615 +0000\n@@ -450,7 +450,7 @@\n     }\n \n     cmd_file = fdopen (cmd_file_fd, \"w\");\n-    fputs (\"#! /bin/sh\\n\", cmd_file);\n+    fputs (\"#! @TERMUX_PREFIX@/bin/sh\\n\", cmd_file);\n     commands++;\n \n     for (col = 0; *commands != '\\0'; commands++)\n@@ -555,7 +555,7 @@\n          * on no-exec filesystems. */\n         char *cmd;\n \n-        cmd = g_strconcat (\"/bin/sh \", vfs_path_as_str (file_name_vpath), (char *) NULL);\n+        cmd = g_strconcat (\"@TERMUX_PREFIX@/bin/sh \", vfs_path_as_str (file_name_vpath), (char *) NULL);\n \n         if (show_prompt)\n             shell_execute (cmd, EXECUTE_HIDE);\n"
  },
  {
    "path": "packages/mc/src-vfs-sfs-sfs.c.patch",
    "content": "diff -u -r ../mc-4.8.16/src/vfs/sfs/sfs.c ./src/vfs/sfs/sfs.c\n--- ../mc-4.8.16/src/vfs/sfs/sfs.c\t2016-03-12 10:45:48.000000000 -0500\n+++ ./src/vfs/sfs/sfs.c\t2016-03-14 20:36:48.293235351 -0400\n@@ -206,7 +206,7 @@\n \n     g_free (pqname);\n     open_error_pipe ();\n-    if (my_system (EXECUTE_AS_SHELL, \"/bin/sh\", pad))\n+    if (my_system (EXECUTE_AS_SHELL, \"@TERMUX_PREFIX@/bin/sh\", pad))\n     {\n         close_error_pipe (D_ERROR, NULL);\n         return -1;\n"
  },
  {
    "path": "packages/mc/tmpdir_default.patch",
    "content": "diff -u -r ../mc-4.8.11/lib/global.h ./lib/global.h\n--- ../mc-4.8.11/lib/global.h\t2013-10-15 11:52:41.000000000 +0200\n+++ ./lib/global.h\t2014-02-07 02:32:06.000000000 +0100\n@@ -129,7 +129,7 @@\n #define PATH_SEP '/'\n #define PATH_SEP_STR \"/\"\n #define PATH_ENV_SEP ':'\n-#define TMPDIR_DEFAULT \"/tmp\"\n+#define TMPDIR_DEFAULT \"@TERMUX_PREFIX@/tmp\"\n #define SCRIPT_SUFFIX \"\"\n #define get_default_editor() \"vi\"\n #define OS_SORT_CASE_SENSITIVE_DEFAULT 1\n"
  },
  {
    "path": "packages/mc/use-python2-for-extfs-helpers.patch",
    "content": "diff --git a/src/vfs/extfs/helpers/s3+.in b/src/vfs/extfs/helpers/s3+.in\nindex 2ab596a..65b709b 100644\n--- a/src/vfs/extfs/helpers/s3+.in\n+++ b/src/vfs/extfs/helpers/s3+.in\n@@ -1,4 +1,4 @@\n-#! @PYTHON@\n+#! @PYTHON@2\n # -*- coding: utf-8 -*-\n \n #\ndiff --git a/src/vfs/extfs/helpers/uc1541.in b/src/vfs/extfs/helpers/uc1541.in\nindex dd7b7c4..8da6bfb 100644\n--- a/src/vfs/extfs/helpers/uc1541.in\n+++ b/src/vfs/extfs/helpers/uc1541.in\n@@ -1,4 +1,4 @@\n-#! @PYTHON@\n+#! @PYTHON@2\n \"\"\"\n UC1541 Virtual filesystem\n \n"
  },
  {
    "path": "packages/mdp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/visit1985/mdp\nTERMUX_PKG_DESCRIPTION=\" A command-line based markdown presentation tool.\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER='lokesh @hax4us'\nTERMUX_PKG_VERSION=1.0.15\nTERMUX_PKG_SHA256=3edc8ea1551fdf290d6bba721105e2e2c23964070ac18c13b4b8d959cdf6116f\nTERMUX_PKG_SRCURL=https://github.com/visit1985/mdp/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/megatools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://megatools.megous.com/\nTERMUX_PKG_DESCRIPTION=\"Open-source command line tools and C library (libmega) for accessing Mega.co.nz cloud storage\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.10.2\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://megatools.megous.com/builds/megatools-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=179e84c68e24696c171238a72bcfe5e28198e4c4e9f9043704f36e5c0b17c38a\nTERMUX_PKG_DEPENDS=\"glib, libandroid-support, libcurl, libgmp, openssl\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-fuse --enable-docs-build\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n    mkdir -p m4\n    autoreconf -v --install\n\n    sed -i -e 's/-V -qversion//' configure\n    sed -i -e 's/GOBJECT_INTROSPECTION_CHECK/#GOBJECT_INTROSPECTION_CHECK/' configure\n}\n"
  },
  {
    "path": "packages/megatools/lib-mega.c.patch",
    "content": "diff -u -r ../megatools-1.10.1/lib/mega.c ./lib/mega.c\n--- ../megatools-1.10.1/lib/mega.c\t2018-07-27 11:40:26.000000000 +0000\n+++ ./lib/mega.c\t2018-07-29 21:32:54.574899892 +0000\n@@ -3910,7 +3910,7 @@\n \n \tif (has_ffmpegthumbnailer && g_regex_match_simple(\"\\\\.(mpg|mpeg|avi|mkv|flv|rm|mp4|wmv|asf|ram|mov)$\",\n \t\t\t\t\t\t\t  local_path, G_REGEX_CASELESS, 0)) {\n-\t\tgchar buf[50] = \"/tmp/megatools.XXXXXX\";\n+\t\tgchar buf[100] = \"@TERMUX_PREFIX@/tmp/megatools.XXXXXX\";\n \t\tgchar *dir = g_mkdtemp(buf);\n \t\tif (dir) {\n \t\t\tgint status = 1;\n@@ -3941,7 +3941,7 @@\n \t\t}\n \t} else if (has_convert && g_regex_match_simple(\"\\\\.(jpe?g|png|gif|bmp|tiff|svg|pnm|eps|ico|pdf)$\", local_path,\n \t\t\t\t\t\t       G_REGEX_CASELESS, 0)) {\n-\t\tgchar buf[50] = \"/tmp/megatools.XXXXXX\";\n+\t\tgchar buf[100] = \"@TERMUX_PREFIX@/tmp/megatools.XXXXXX\";\n \t\tgchar *dir = g_mkdtemp(buf);\n \t\tif (dir) {\n \t\t\tgint status = 1;\n"
  },
  {
    "path": "packages/memcached/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://memcached.org/\nTERMUX_PKG_DESCRIPTION=\"Free & open source, high-performance, distributed memory object caching system\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.5.20\nTERMUX_PKG_SRCURL=https://www.memcached.org/files/memcached-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=cfd7b023a9cefe7ae8a67184f51d841dbbf97994ed0e8a55e31ee092320ea1e4\nTERMUX_PKG_DEPENDS=\"libevent, libsasl\"\nTERMUX_PKG_BREAKS=\"memcached-dev\"\nTERMUX_PKG_REPLACES=\"memcached-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-sasl --disable-coverage\"\n\ntermux_step_pre_configure() {\n    export ac_cv_c_endian=little\n\n    # fix SASL configuration path\n    perl -p -i -e \"s#/etc/sasl#$TERMUX_PREFIX/etc/sasl#\" $TERMUX_PKG_BUILDDIR/sasl_defs.c\n\n    # getsubopt() taken from https://github.com/lxc/lxc/blob/master/src/include/getsubopt.c\n    cp $TERMUX_PKG_BUILDER_DIR/getsubopt.c $TERMUX_PKG_SRCDIR\n    cp $TERMUX_PKG_BUILDER_DIR/getsubopt.h $TERMUX_PKG_SRCDIR\n}\n"
  },
  {
    "path": "packages/memcached/getsubopt.c",
    "content": "/*\n * Android c-library does not have getsubopt,\n * so code lifted from uClibc\n * http://git.uclibc.org/uClibc/tree/libc/unistd/getsubopt.c\n */\n\n/* Parse comma separate list into words.\n   Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\n\n#include <stdlib.h>\n#include <string.h>\n\nchar *strchrnul(const char *s, int c)\n{\n    char *result;\n\n    result = strchr( s, c );\n\n    if( !result )\n    {\n        result = (char *)s + strlen( s );\n    }\n\n    return( result );\n}\n\n/* Parse comma separated suboption from *OPTIONP and match against\n   strings in TOKENS.  If found return index and set *VALUEP to\n   optional value introduced by an equal sign.  If the suboption is\n   not part of TOKENS return in *VALUEP beginning of unknown\n   suboption.  On exit *OPTIONP is set to the beginning of the next\n   token or at the terminating NUL character.  */\nint\ngetsubopt (char **optionp, char *const *tokens, char **valuep)\n{\n  char *endp, *vstart;\n  int cnt;\n\n  if (**optionp == '\\0')\n    return -1;\n\n  /* Find end of next token.  */\n  endp = strchrnul (*optionp, ',');\n\n  /* Find start of value.  */\n  vstart = memchr (*optionp, '=', endp - *optionp);\n  if (vstart == NULL)\n    vstart = endp;\n\n  /* Try to match the characters between *OPTIONP and VSTART against\n     one of the TOKENS.  */\n  for (cnt = 0; tokens[cnt] != NULL; ++cnt)\n    if (strncmp (*optionp, tokens[cnt], vstart - *optionp) == 0\n    && tokens[cnt][vstart - *optionp] == '\\0')\n      {\n    /* We found the current option in TOKENS.  */\n    *valuep = vstart != endp ? vstart + 1 : NULL;\n\n    if (*endp != '\\0')\n      *endp++ = '\\0';\n    *optionp = endp;\n\n    return cnt;\n      }\n\n  /* The current suboption does not match any option.  */\n  *valuep = *optionp;\n\n  if (*endp != '\\0')\n    *endp++ = '\\0';\n  *optionp = endp;\n\n  return -1;\n}\n"
  },
  {
    "path": "packages/memcached/getsubopt.h",
    "content": "#ifndef _getsubopt_h\n#define _getsubopt_h\nint getsubopt (char **optionp, char *const *tokens, char **valuep);\n#endif\n"
  },
  {
    "path": "packages/memcached/memcached.c.patch",
    "content": "diff -u -r ../memcached-1.5.5/memcached.c ./memcached.c\n--- ../memcached-1.5.5/memcached.c\t2018-02-13 05:09:37.000000000 +0000\n+++ ./memcached.c\t2018-02-13 14:15:00.622511540 +0000\n@@ -14,6 +14,7 @@\n  *      Brad Fitzpatrick <brad@danga.com>\n  */\n #include \"memcached.h\"\n+#include \"getsubopt.h\"\n #ifdef EXTSTORE\n #include \"storage.h\"\n #endif\n@@ -57,7 +58,7 @@\n \n /* FreeBSD 4.x doesn't have IOV_MAX exposed. */\n #ifndef IOV_MAX\n-#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__GNU__)\n+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__ANDROID__)\n # define IOV_MAX 1024\n /* GNU/Hurd don't set MAXPATHLEN\n  * http://www.gnu.org/software/hurd/hurd/porting/guidelines.html#PATH_MAX_tt_MAX_PATH_tt_MAXPATHL */\n"
  },
  {
    "path": "packages/mg/GNUmakefile.patch",
    "content": "diff -u -r ../mg-20180927/GNUmakefile ./GNUmakefile\n--- ../mg-20180927/GNUmakefile\t2018-09-27 20:00:17.000000000 +0000\n+++ ./GNUmakefile\t2018-11-17 23:55:15.804955616 +0000\n@@ -11,7 +11,7 @@\n bindir=\t\t$(prefix)/bin\n libdir=\t\t$(prefix)/lib\n includedir=\t$(prefix)/include\n-mandir=\t\t$(prefix)/man\n+mandir=\t\t$(prefix)/share/man\n \n PKG_CONFIG=\t/usr/bin/pkg-config --silence-errors\n INSTALL=\t/usr/bin/install\n"
  },
  {
    "path": "packages/mg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/hboetes/mg\nTERMUX_PKG_DESCRIPTION=\"microscopic GNU Emacs-style editor\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_VERSION=20180927\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/hboetes/mg/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=fbb09729ea00fe42dcdbc96ac7fc1d2b89eac651dec49e4e7af52fad4f5788f6\nTERMUX_PKG_DEPENDS=\"libbsd, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $CPPFLAGS\"\n}\n\ntermux_step_make_install() {\n\tmake prefix=$PREFIX install\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/mg 30\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/mg\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/micro/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://micro-editor.github.io/\nTERMUX_PKG_DESCRIPTION=\"Modern and intuitive terminal-based text editor\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.4.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/zyedidia/micro/releases/download/v${TERMUX_PKG_VERSION}/micro-${TERMUX_PKG_VERSION}-src.tar.gz\nTERMUX_PKG_SHA256=0b516826226cf1ddf2fbb274f049cab456a5c162efe3d648f0871564fadcf812\n\ntermux_step_make() {\n\treturn\n}\n\ntermux_step_make_install() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tlocal MICRO_SRC=$GOPATH/src/github.com/zyedidia/micro\n\n\tcd $TERMUX_PKG_SRCDIR\n\tmkdir -p $MICRO_SRC\n\tcp -R . $MICRO_SRC\n\n\tcd $MICRO_SRC\n\tmake build-quick\n\tmv micro $TERMUX_PREFIX/bin/micro\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/micro 25\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/micro\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/mime-support/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/en/stretch/mime-support\nTERMUX_PKG_DESCRIPTION=\"MIME type associations for file types\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_VERSION=3.64\nTERMUX_PKG_SRCURL=http://http.debian.net/debian/pool/main/m/mime-support/mime-support_$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=587f35aabd25e9cabd9be485ce94539fb783d5b8d23492798dbec320ee6b1e88\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_CONFFILES=\"etc/mime.types\"\n# etc/mime.types was previously in mutt:\nTERMUX_PKG_CONFLICTS=\"mutt (<< 1.8.3-1)\"\n\ntermux_step_make_install() {\n\tinstall -Dm600 $TERMUX_PKG_SRCDIR/mime.types $TERMUX_PREFIX/etc/mime.types\n}\n"
  },
  {
    "path": "packages/minicom/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://alioth.debian.org/projects/minicom/\nTERMUX_PKG_DESCRIPTION=\"Friendly menu driven serial communication program\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.7.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/minicom-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=890875220458e1dd4c27ecb8cec508b06365159bfe7adb8f408a07b0a48763e9\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-socket\n--disable-music\n--enable-lock-dir=$TERMUX_PREFIX/var/run\n\"\n"
  },
  {
    "path": "packages/minicom/dial.c.patch",
    "content": "--- ../minicom-2.7/src/dial.c\t2013-05-10 04:32:02.000000000 +1000\n+++ ./src/dial.c\t2016-04-19 15:38:20.216743308 +1000\n@@ -33,7 +33,7 @@\n #include <stdint.h>\n #include <limits.h>\n #include <arpa/inet.h>\n-\n+#include <linux/kd.h>\n #include \"port.h\"\n #include \"minicom.h\"\n #include \"intl.h\"\n"
  },
  {
    "path": "packages/minicom/file.c.patch",
    "content": "--- ../minicom-2.7/src/file.c\t2011-02-14 21:14:57.000000000 +1100\n+++ ./src/file.c\t2016-04-19 15:56:22.188283387 +1000\n@@ -25,7 +25,7 @@\n #endif\n \n #include <limits.h>\n-\n+#include <sys/types.h>\n #include \"port.h\"\n #include \"minicom.h\"\n #include \"intl.h\"\n"
  },
  {
    "path": "packages/minicom/getdir.c.patch",
    "content": "--- ../minicom-2.7/src/getsdir.c\t2011-02-14 21:07:00.000000000 +1100\n+++ ./src/getsdir.c\t2016-04-19 15:47:10.402330875 +1000\n@@ -145,7 +145,7 @@\n  *\n  *\t\t\t    The data will be in the form:\n  *\t\t\t\ttypedef struct dirEntry {\n- *\t\t\t\t    char fname[MAXNAMLEN + 1];\n+ *\t\t\t\t    char fname[NAME_MAX + 1];\n  *\t\t\t\t    time_t time;\n  *\t\t\t\t    mode_t mode;\n  *\t\t\t\t} GETSDIR_ENTRY;\n@@ -232,7 +232,7 @@\n             }\n \n           /* copy the filename */\n-          strncpy((*datptr)[cnt].fname, dp->d_name, MAXNAMLEN);\n+          strncpy((*datptr)[cnt].fname, dp->d_name, NAME_MAX);\n \n           /* get information about the directory entry */\n           snprintf(fpath, sizeof(fpath), \"%s/%s\", dirpath, dp->d_name);\n"
  },
  {
    "path": "packages/minicom/getdir.h.patch",
    "content": "--- ../minicom-2.7/src/getsdir.h\t2009-12-13 02:47:47.000000000 +1100\n+++ ./src/getsdir.h\t2016-04-19 15:59:00.459999674 +1000\n@@ -23,12 +23,13 @@\n  */\n \n #include <dirent.h>\n-\n+#include <sys/types.h>\n+#include <limits.h>\n typedef struct dirEntry {\t\t/* structure of data item */\n-  char fname[MAXNAMLEN + 1];\t\t/* filename + terminating null */\n+  char fname[NAME_MAX + 1];\t\t/* filename + terminating null */\n   time_t time;\t\t\t\t/* last modification date */\n   mode_t mode;\t\t\t\t/* file mode (dir? etc.) */\n-  ushort cflags;\t\t\t/* caller field for convenience */\n+  u_short cflags;\t\t\t/* caller field for convenience */\n } GETSDIR_ENTRY;\n \n #define GETSDIR_PARNT    0x01\t\t/* include parent dir (..) */\n"
  },
  {
    "path": "packages/minicom/script.h.patch",
    "content": "--- ../minicom-2.7/src/script.c\t2013-10-29 22:07:42.000000000 +1100\n+++ ./src/script.c\t2016-04-19 16:02:45.252434872 +1000\n@@ -33,7 +33,7 @@\n #endif\n \n #include <stdarg.h>\n-\n+#include <sys/wait.h>\n #include \"port.h\"\n #include \"minicom.h\"\n #include \"intl.h\"\n"
  },
  {
    "path": "packages/minicom/wkeys.c.patch",
    "content": "--- ../minicom-2.7/src/wkeys.c\t2013-01-11 08:39:27.000000000 +1100\n+++ ./src/wkeys.c\t2016-04-20 12:28:36.762865823 +1000\n@@ -27,7 +27,7 @@\n #include \"intl.h\"\n \n #if KEY_KLUDGE && defined(linux)\n-#  include <sys/kd.h>\n+#  include <linux/kd.h>\n #  include <sys/ioctl.h>\n #endif\n \n"
  },
  {
    "path": "packages/miniupnpc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://miniupnp.tuxfamily.org/\nTERMUX_PKG_DESCRIPTION=\"Small UPnP client library and tool to access Internet Gateway Devices\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.1.20190824\nTERMUX_PKG_SRCURL=https://miniupnp.tuxfamily.org/files/miniupnpc-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=1fadefea0ecdceb3e35bb5d901f0db880c826740e93148ddfb087b4b4389e165\nTERMUX_PKG_BREAKS=\"miniupnpc-dev\"\nTERMUX_PKG_REPLACES=\"miniupnpc-dev\"\n\ntermux_step_post_make_install() {\n\tinstall -Dm700 upnpc-static \"$TERMUX_PREFIX/bin/upnpc\"\n}\n"
  },
  {
    "path": "packages/miniupnpc/miniupnpc-2.1_minissdpc.c.patch",
    "content": "diff -uNr miniupnpc-2.1/minissdpc.c miniupnpc-2.1.mod/minissdpc.c\n--- miniupnpc-2.1/minissdpc.c\t2018-04-06 13:53:30.000000000 +0300\n+++ miniupnpc-2.1.mod/minissdpc.c\t2018-06-26 01:08:05.665993662 +0300\n@@ -195,7 +195,7 @@\n \t}\n #endif /* #ifdef MINIUPNPC_SET_SOCKET_TIMEOUT */\n \tif(!socketpath)\n-\t\tsocketpath = \"/var/run/minissdpd.sock\";\n+\t\tsocketpath = \"@TERMUX_PREFIX@/var/run/minissdpd.sock\";\n \tmemset(&addr, 0, sizeof(addr));\n \taddr.sun_family = AF_UNIX;\n \tstrncpy(addr.sun_path, socketpath, sizeof(addr.sun_path));\n"
  },
  {
    "path": "packages/miniupnpc/miniupnpc-2.1_miniupnpc.c.patch",
    "content": "diff -uNr miniupnpc-2.1/miniupnpc.c miniupnpc-2.1.mod/miniupnpc.c\n--- miniupnpc-2.1/miniupnpc.c\t2018-04-06 13:53:30.000000000 +0300\n+++ miniupnpc-2.1.mod/miniupnpc.c\t2018-06-26 01:07:59.089326656 +0300\n@@ -301,7 +301,7 @@\n #if !defined(_WIN32) && !defined(__amigaos__) && !defined(__amigaos4__)\n \t/* first try to get infos from minissdpd ! */\n \tif(!minissdpdsock)\n-\t\tminissdpdsock = \"/var/run/minissdpd.sock\";\n+\t\tminissdpdsock = \"@TERMUX_PREFIX@/var/run/minissdpd.sock\";\n \tif(minissdpdsock[0] != '\\0') {\n \t\tfor(deviceIndex = 0; deviceTypes[deviceIndex]; deviceIndex++) {\n \t\t\tstruct UPNPDev * minissdpd_devlist;\n"
  },
  {
    "path": "packages/mksh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.mirbsd.org/mksh.htm\nTERMUX_PKG_DESCRIPTION=\"The MirBSD Korn Shell - an enhanced version of the public domain ksh\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=57\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R${TERMUX_PKG_VERSION/./}.tgz\nTERMUX_PKG_SHA256=3d101154182d52ae54ef26e1360c95bc89c929d28859d378cc1c84f3439dbe75\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tsh Build.sh -r\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 mksh \"$TERMUX_PREFIX\"/bin/mksh\n\tinstall -Dm600 mksh.1 \"$TERMUX_PREFIX\"/share/man/man1/mksh.1\n}\n"
  },
  {
    "path": "packages/mksh/sh.h.patch",
    "content": "diff -uNr mksh/sh.h mksh.mod/sh.h\n--- mksh/sh.h\t2018-01-14 03:48:03.000000000 +0200\n+++ mksh.mod/sh.h\t2019-02-26 00:23:47.223523334 +0200\n@@ -420,7 +420,7 @@\n #ifdef __OS2__\n #define MKSH_UNIXROOT\t\"/@unixroot\"\n #else\n-#define MKSH_UNIXROOT\t\"\"\n+#define MKSH_UNIXROOT\t\"@TERMUX_PREFIX@\"\n #endif\n \n #ifdef MKSH_DOSPATH\n"
  },
  {
    "path": "packages/mktorrent/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/Rudde/mktorrent\nTERMUX_PKG_DESCRIPTION=\"command line utility to create BitTorrent metainfo files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/Rudde/mktorrent/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=d0f47500192605d01b5a2569c605e51ed319f557d24cfcbcb23a26d51d6138c9\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/mktorrent/seekdir_telldir.patch",
    "content": "diff -uNr mktorrent-1.1/ftw.c mktorrent-1.1.mod/ftw.c\n--- mktorrent-1.1/ftw.c\t2017-01-11 23:13:16.000000000 +0200\n+++ mktorrent-1.1.mod/ftw.c\t2019-01-30 16:51:09.927683504 +0200\n@@ -45,6 +45,20 @@\n \toff_t offset;\n };\n \n+struct DIR {\n+\tint fd_;\n+};\n+\n+static long telldir_custom(struct DIR *dirp)\n+{\n+\treturn (long) lseek(dirp->fd_, 0, SEEK_CUR);\n+}\n+\n+static void seekdir_custom(DIR *dirp, long loc)\n+{\n+\t(void) lseek(dirp->fd_, loc, SEEK_SET);\n+}\n+\n static struct dir_state *dir_state_new(struct dir_state *prev,\n \t\tstruct dir_state *next)\n {\n@@ -88,14 +102,14 @@\n \n \tname[ds->length] = DIRSEP_CHAR;\n \n-\tseekdir(ds->dir, ds->offset);\n+\tseekdir_custom(ds->dir, ds->offset);\n \n \treturn 0;\n }\n \n static unsigned int dir_state_close(struct dir_state *ds)\n {\n-\tds->offset = telldir(ds->dir);\n+\tds->offset = telldir_custom(ds->dir);\n \tif (ds->offset < 0) {\n \t\tfprintf(stderr, \"Error getting dir offset: %s\\n\",\n \t\t\t\tstrerror(errno));\n"
  },
  {
    "path": "packages/mlocate/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://pagure.io/mlocate\nTERMUX_PKG_DESCRIPTION=\"Tool to find files anywhere in the filesystem based on their name\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\n# If not linking to libandroid-support we segfault in\n# the libc mbsnrtowcs() function when using a wildcard\n# like in '*.deb'.\nTERMUX_PKG_DEPENDS=\"libandroid-support\"\nTERMUX_PKG_VERSION=0.26\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://releases.pagure.org/mlocate/mlocate-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=3063df79fe198fb9618e180c54baf3105b33d88fe602ff2d8570aaf944f1263e\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -DLINE_MAX=_POSIX2_LINE_MAX\"\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"mkdir -p $TERMUX_PREFIX/var/mlocate/\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n}\n"
  },
  {
    "path": "packages/mlocate/conf.c.patch",
    "content": "diff -u -r ../mlocate-0.26/src/conf.c ./src/conf.c\n--- ../mlocate-0.26/src/conf.c\t2011-12-12 00:13:18.000000000 +0100\n+++ ./src/conf.c\t2014-07-02 03:34:47.000000000 +0200\n@@ -646,7 +646,7 @@\n     error (EXIT_FAILURE, 0, _(\"unexpected operand on command line\"));\n   if (conf_scan_root == NULL)\n     {\n-      static char root[] = \"/\";\n+      static char root[] = \"/data/data/com.termux/files/\";\n \n       conf_scan_root = root;\n     }\n"
  },
  {
    "path": "packages/mlocate/no_getid.patch",
    "content": "--- ../locate.c.orig\n+++ ./src/locate.c\n@@ -945,8 +945,10 @@\n static void\n drop_setgid (void)\n {\n+#if !defined(__ANDROID__)\n   if (setgid (getgid ()) != 0)\n     error (EXIT_FAILURE, errno, _(\"can not drop privileges\"));\n+#endif\n }\n \n /* Handle a conf_dbpath ENTRY, drop privileges when they are no longer\n"
  },
  {
    "path": "packages/mlocate/src-locate.c.patch",
    "content": "Do not fail if \"/\" is not accessible - which it is not on Android starting\nwith Android 7.0.\n\ndiff -u -r ../mlocate-0.26/src/locate.c ./src/locate.c\n--- ../mlocate-0.26/src/locate.c\t2012-09-22 03:48:54.000000000 +0200\n+++ ./src/locate.c\t2017-09-22 20:57:44.062275402 +0200\n@@ -1026,11 +1027,6 @@\n   uc_obstack_mark = obstack_alloc (&uc_obstack, 0);\n   obstack_init (&check_stack_obstack);\n   res = EXIT_FAILURE;\n-  /* Don't call access (\"/\", R_OK | X_OK) all the time.  This is too strict,\n-     it is possible to have \"/\" --x and have a database describing a\n-     subdirectory, but that is just too improbable. */\n-  if (conf_statistics == false && access (\"/\", R_OK | X_OK) != 0)\n-    goto done;\n   for (i = 0; i < conf_dbpath.len; i++)\n     {\n       if (conf_output_limit_set != false && matches_found >= conf_output_limit)\n"
  },
  {
    "path": "packages/mlocate/updatedb.c.patch",
    "content": "diff -u -r ../mlocate-0.26/src/updatedb.c ./src/updatedb.c\n--- ../mlocate-0.26/src/updatedb.c\t2012-03-23 19:00:48.000000000 +0100\n+++ ./src/updatedb.c\t2014-07-02 03:23:18.000000000 +0200\n@@ -354,6 +354,9 @@\n static bool\n filesystem_is_excluded (const char *path)\n {\n+#ifdef __ANDROID__\n+\treturn false;\n+#else\n   static char *type; /* = NULL; */\n   static size_t type_size; /* = 0; */\n \n@@ -415,6 +418,7 @@\n     /* This is debuging output, don't mark anything for translation */\n     fprintf (stderr, \"...done\\n\");\n   return res;\n+#endif\n }\n \n \f /* Filesystem scanning */\n@@ -1014,7 +1018,9 @@\n   if (fwriteerror (new_db))\n     error (EXIT_FAILURE, errno, _(\"I/O error while writing to `%s'\"),\n \t   new_db_filename);\n+#ifndef __ANDROID__\n   new_db_setup_permissions ();\n+#endif\n   if (rename (new_db_filename, conf_output) != 0)\n     error (EXIT_FAILURE, errno, _(\"error replacing `%s'\"), conf_output);\n   /* There is really no race condition in removing other files now: unlink ()\n"
  },
  {
    "path": "packages/morse2ascii/Makefile.patch",
    "content": "--- ./Makefile\n+++ ../Makefile\n@@ -1,6 +1,6 @@\n EXE\t\t= morse2ascii\n CFLAGS\t+= -O2 -s\n-PREFIX\t= /usr/local\n+PREFIX\t= @TERMUX_PREFIX@\n BINDIR\t= $(PREFIX)/bin\n LIBS\t= -lm\n \n"
  },
  {
    "path": "packages/morse2ascii/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/sid/morse2ascii\nTERMUX_PKG_DESCRIPTION=\"A tool to decode the morse codes from a PCM WAV file as well as from text and RAW PCM files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/m/morse2ascii/morse2ascii_${TERMUX_PKG_VERSION}+dfsg.orig.tar.xz\nTERMUX_PKG_SHA256=0d41f544818f27db2fb211b2950e48893ff4856f1d114ab1878c91e6e27e4c49\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/mosh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://mosh.org\nTERMUX_PKG_DESCRIPTION=\"Mobile shell that supports roaming and intelligent local echo\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.3.2\nTERMUX_PKG_REVISION=17\nTERMUX_PKG_SRCURL=https://github.com/mobile-shell/mosh/releases/download/mosh-${TERMUX_PKG_VERSION}/mosh-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216\nTERMUX_PKG_DEPENDS=\"libandroid-support, libc++, libprotobuf, ncurses, openssl, openssh\"\n\ntermux_step_pre_configure() {\n\ttermux_setup_protobuf\n}\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PREFIX/bin\n\tmv mosh mosh.pl\n\t$CXX $CXXFLAGS $LDFLAGS \\\n\t\t-isystem $TERMUX_PREFIX/include \\\n\t\t-DPACKAGE_VERSION=\\\"$TERMUX_PKG_VERSION\\\" \\\n\t\t-std=c++11 -Wall -Wextra -Werror \\\n\t\t$TERMUX_PKG_BUILDER_DIR/mosh.cc -o mosh\n}\n"
  },
  {
    "path": "packages/mosh/mosh-server.cc.patch",
    "content": "diff -uNr mosh-1.3.2/src/frontend/mosh-server.cc mosh-1.3.2.mod/src/frontend/mosh-server.cc\n--- mosh-1.3.2/src/frontend/mosh-server.cc\t2017-07-23 00:14:53.000000000 +0300\n+++ mosh-1.3.2.mod/src/frontend/mosh-server.cc\t2019-03-01 22:37:18.009498882 +0200\n@@ -562,8 +562,8 @@\n       // this always happens.\n       // XXX Hackish knowledge of Ubuntu PAM configuration.\n       // But this seems less awful than build-time detection with autoconf.\n-      if (!print_motd(\"/run/motd.dynamic\")) {\n-\tprint_motd(\"/var/run/motd.dynamic\");\n+      if (!print_motd(\"@TERMUX_PREFIX@/run/motd.dynamic\")) {\n+\tprint_motd(\"@TERMUX_PREFIX@/var/run/motd.dynamic\");\n       }\n       // Always print traditional /etc/motd.\n       print_motd(\"/etc/motd\");\n"
  },
  {
    "path": "packages/mosh/mosh.cc",
    "content": "//   Mosh: the mobile shell\n//   Copyright 2012 Keith Winstein\n//\n//   This program is free software: you can redistribute it and/or modify\n//   it under the terms of the GNU General Public License as published by\n//   the Free Software Foundation, either version 3 of the License, or\n//   (at your option) any later version.\n//\n//   This program is distributed in the hope that it will be useful,\n//   but WITHOUT ANY WARRANTY; without even the implied warranty of\n//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//   GNU General Public License for more details.\n//\n//   You should have received a copy of the GNU General Public License\n//   along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\n#include <limits.h>\n#include <unistd.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n#include <vector>\n#include <map>\n#include <stdio.h>\n#include <string>\n#include <sys/socket.h>\n#include <getopt.h>\n#include <arpa/inet.h>\n#include <netdb.h>\n#include <signal.h>\n#include <errno.h>\n#include <sys/ioctl.h>\n#include <sys/types.h>\n#include <sys/wait.h>\n#include <termios.h>\n#include <pty.h>\n\nusing namespace std;\n\ninline string shell_quote_string( const string &x )\n{\n  string result = \"'\";\n  string rest = x;\n  while ( rest.size() ) {\n    size_t good_part = rest.find( \"'\" );\n    result += rest.substr( 0, good_part );\n    if ( good_part != string::npos ) {\n      result += \"'\\\\''\";\n      rest = rest.substr( good_part + 1 );\n    } else {\n      break;\n    }\n  }\n  return result + \"'\";\n}\n\ntemplate <typename SequenceT>\ninline string shell_quote( const SequenceT &sequence )\n{\n  string result;\n  for ( typename SequenceT::const_iterator i = sequence.begin();\n        i != sequence.end();\n        i++ ) {\n    result += shell_quote_string( *i ) + \" \";\n  }\n  return result.substr( 0, result.size() - 1 );\n}\n\nvoid die( const char *format, ... ) {\n  va_list args;\n  va_start( args, format );\n  vfprintf( stderr, format, args );\n  va_end( args );\n  fprintf( stderr, \"\\n\" );\n  exit( 255 );\n}\n\nstatic const char *usage_format =\n\"Usage: %s [options] [--] [user@]host [command...]\\n\"\n\"        --client=PATH        mosh client on local machine\\n\"\n\"                                (default: \\\"mosh-client\\\")\\n\"\n\"        --server=COMMAND     mosh server on remote machine\\n\"\n\"                                (default: \\\"mosh-server\\\")\\n\"\n\"\\n\"\n\"        --predict=adaptive      local echo for slower links [default]\\n\"\n\"-a      --predict=always        use local echo even on fast links\\n\"\n\"-n      --predict=never         never use local echo\\n\"\n\"-6                           use IPv6 only\\n\"\n\"\\n\"\n\"-p NUM  --port=NUM           server-side UDP port\\n\"\n\"\\n\"\n\"-P NUM  --ssh-port=NUM       ssh server port\\n\"\n\"                                (default: let the ssh command choose)\\n\"\n\"\\n\"\n\"        --ssh=COMMAND        ssh command to run when setting up session\\n\"\n\"                                (example: \\\"ssh -p 2222\\\")\\n\"\n\"                                (default: \\\"ssh\\\")\\n\"\n\"\\n\"\n\"        --no-init            do not send terminal initialization string\\n\"\n\"\\n\"\n\"        --help               this message\\n\"\n\"        --version            version and copyright information\\n\"\n\"\\n\"\n\"Please report bugs to mosh-devel@mit.edu.\\n\"\n\"Mosh home page: http://mosh.mit.edu\";\n\nstatic const char *version_format =\n\"mosh %s\\n\"\n\"Copyright 2012 Keith Winstein <mosh-devel@mit.edu>\\n\"\n\"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\\n\"\n\"This is free software: you are free to change and redistribute it.\\n\"\n\"There is NO WARRANTY, to the extent permitted by law.\";\n\nstatic const char *key_valid_char_set =\n\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/+\";\n\nstatic char *argv0;\n\nvoid predict_check( const string &predict, bool env_set )\n{\n  if ( predict != \"adaptive\" &&\n       predict != \"always\" &&\n       predict != \"never\" ) {\n    fprintf( stderr, \"%s: Unknown mode \\\"%s\\\"%s.\\n\", argv0, predict.c_str(),\n        env_set ? \" (MOSH_PREDICTION_DISPLAY in environment)\" : \"\" );\n    die( usage_format, argv0 );\n  }\n}\n\nvoid cat( int ifd, int ofd )\n{\n  char buf[4096];\n  ssize_t n;\n  while ( 1 ) {\n    n = read( ifd, buf, sizeof( buf ) );\n    if ( n==-1 ) {\n      if (errno == EINTR ) {\n        continue;\n      }\n      break;\n    }\n    if ( n==0 ) {\n      break;\n    }\n    n = write( ofd, buf, n );\n    if ( n==-1 ) {\n      break;\n    }\n  }\n}\n\nbool valid_port(string port) {\n  if ( port.size() ) {\n    return port.find_first_not_of( \"0123456789\" ) == string::npos &&\n         atoi( port.c_str() ) > 0 &&\n         atoi( port.c_str() ) <= 65535;\n  }\n  return true; // consider no port to be the default value\n}\n\nint main( int argc, char *argv[] )\n{\n  argv0 = argv[0];\n  string client = \"mosh-client\";\n  string server = \"mosh-server\";\n  string ssh = \"ssh\";\n  string predict, port_request, ssh_port;\n  int help=0, version=0, fake_proxy=0, term_init=1;\n  int force_ipv6 = 0;\n\n  static struct option long_options[] =\n  {\n    { \"client\",      required_argument,  0,              'c' },\n    { \"server\",      required_argument,  0,              's' },\n    { \"no-init\",     no_argument,        &term_init,      0  },\n    { \"predict\",     required_argument,  0,              'r' },\n    { \"port\",        required_argument,  0,              'p' },\n    { \"ssh-port\",    required_argument,  0,              'P' },\n    { \"ssh\",         required_argument,  0,              'S' },\n    { \"help\",        no_argument,        &help,           1  },\n    { \"version\",     no_argument,        &version,        1  },\n    { \"fake-proxy\",  no_argument,        &fake_proxy,     1  },\n    { 0, 0, 0, 0 }\n  };\n  while ( 1 ) {\n    int option_index = 0;\n    int c = getopt_long( argc, argv, \"6anp:P:\",\n        long_options, &option_index );\n    if ( c == -1 ) {\n      break;\n    }\n\n    switch ( c ) {\n      case 0:\n        // flag has been set\n        break;\n      case 'c':\n        client = optarg;\n        break;\n      case 's':\n        server = optarg;\n        break;\n      case 'r':\n        predict = optarg;\n        break;\n      case 'p':\n        port_request = optarg;\n        break;\n      case 'P':\n        ssh_port = optarg;\n        break;\n      case 'S':\n        ssh = optarg;\n        break;\n      case 'a':\n        predict = \"always\";\n        break;\n      case 'n':\n        predict = \"never\";\n        break;\n      case '6':\n\tforce_ipv6 = true;\n\tbreak;\n      default:\n        die( usage_format, argv[0] );\n    }\n  }\n\n  if ( help ) {\n    die( usage_format, argv[0] );\n  }\n  if ( version ) {\n    die( version_format, PACKAGE_VERSION );\n  }\n\n  if ( predict.size() ) {\n    predict_check( predict, 0 );\n  } else if ( getenv( \"MOSH_PREDICTION_DELAY\" ) ) {\n    predict = getenv( \"MOSH_PREDICTION_DELAY\" );\n    predict_check( predict, 1 );\n  } else {\n    predict = \"adaptive\";\n    predict_check( predict, 0 );\n  }\n\n  if(!valid_port(port_request)) {\n    die( \"%s: Server-side port (%s) must be within valid range [0..65535].\",\n        argv[0],\n        port_request.c_str() );\n  }\n\n  if(!valid_port(ssh_port)) {\n    die( \"%s: SSH port (%s) must be within valid range [0..65535].\",\n        argv[0],\n        ssh_port.c_str() );\n  }\n\n  unsetenv( \"MOSH_PREDICTION_DISPLAY\" );\n\n  if ( fake_proxy ) {\n    string host = argv[optind++];\n    string port = argv[optind++];\n\n    int sockfd = -1;\n    struct addrinfo hints, *servinfo, *p;\n    int rv;\n\n    memset( &hints, 0, sizeof( hints ) );\n    hints.ai_socktype = SOCK_STREAM;\n    if (force_ipv6) {\n      hints.ai_family = AF_INET6;\n    }\n\n    if ( ( rv = getaddrinfo( host.c_str(),\n                             port.c_str(),\n                             &hints,\n                             &servinfo ) ) != 0 ) {\n      die( \"%s: Could not resolve hostname %s: getaddrinfo: %s\",\n           argv[0],\n           host.c_str(),\n           gai_strerror( rv ) );\n    }\n\n    int try_family = AF_INET;\n    if (force_ipv6) {\n      try_family = AF_INET6;\n    }\n    // loop through all the results and connect to the first we can\n    for ( p = servinfo; p != NULL || try_family == AF_INET; p = p->ai_next ) {\n      if(p == NULL && try_family == AF_INET) { // start over and try AF_INET6\n        p = servinfo;\n        try_family = AF_INET6;\n      }\n      if(p == NULL) {\n        break; // servinfo == NULL\n      }\n\n      if(p->ai_family != try_family) {\n        continue;\n      }\n\n      if ( ( sockfd = socket( p->ai_family, SOCK_STREAM, IPPROTO_TCP ) ) == -1 ) {\n        continue;\n      }\n\n      if ( connect( sockfd, p->ai_addr, p->ai_addrlen ) == -1 ) {\n        close( sockfd );\n        continue;\n      }\n\n      char host[NI_MAXHOST], service[NI_MAXSERV];\n      if ( getnameinfo( p->ai_addr, p->ai_addrlen,\n            host, NI_MAXHOST,\n            service, NI_MAXSERV,\n            NI_NUMERICSERV | NI_NUMERICHOST ) == -1 ) {\n        die( \"Couldn't get host name info\" );\n      }\n\n      fprintf( stderr, \"MOSH IP %s\\n\", host );\n      break; // if we get here, we must have connected successfully\n    }\n\n    if ( p == NULL ) {\n      // looped off the end of the list with no connection\n      die( \"%s: failed to connect to host %s port %s\",\n            argv[0], host.c_str(), port.c_str() );\n    }\n\n    freeaddrinfo( servinfo ); // all done with this structure\n\n    int pid = fork();\n    if ( pid == -1 ) die( \"%s: fork: %d\", argv[0], errno );\n    if ( pid == 0 ) {\n      close( STDIN_FILENO );\n      cat( sockfd, STDOUT_FILENO );\n      shutdown( sockfd, 0 );\n      exit( 0 );\n    }\n    signal( SIGHUP, SIG_IGN );\n    close( STDOUT_FILENO );\n    cat( STDIN_FILENO, sockfd );\n    shutdown( sockfd, SHUT_WR /* = 1 */ );\n    close( STDIN_FILENO );\n    waitpid( pid, NULL, 0 );\n    exit( 0 );\n  }\n\n  if ( argc - optind < 1 ) {\n    die( usage_format, argv[0] );\n  }\n\n  string userhost = argv[optind++];\n  char **command = &argv[optind];\n  int commands = argc - optind;\n\n  char *buf = NULL;\n  size_t buf_sz = 0;\n  ssize_t n;\n\n  int pty, pty_slave;\n  struct winsize ws;\n  if ( ioctl( 0, TIOCGWINSZ, &ws ) == -1 ) {\n    die( \"%s: ioctl: %d\", argv[0], errno );\n  }\n\n  if ( openpty( &pty, &pty_slave, NULL, NULL, &ws ) == -1 ) {\n    die( \"%s: openpty: %d\", argv[0], errno );\n  }\n\n  int pid = fork();\n  if ( pid == -1 ) die( \"%s: fork: %d\", argv[0], errno );\n  if ( pid == 0 ) {\n    close( pty );\n    if ( -1 == dup2( pty_slave, 1 ) ||\n         -1 == dup2( pty_slave, 2 ) ) {\n      die( \"%s: dup2: %d\", argv[0], errno );\n    }\n    close( pty_slave );\n\n    vector<string> server_args;\n    server_args.push_back( \"new\" );\n    server_args.push_back( \"-c\" );\n    server_args.push_back( \"256\" );\n    server_args.push_back( \"-s\" );\n    if ( port_request.size() ) {\n      server_args.push_back( \"-p\" );\n      server_args.push_back( port_request );\n    }\n\n    for (char const* env_name : {\n        \"LANG\", \"LANGUAGE\", \"LC_CTYPE\", \"LC_NUMERIC\",\n        \"LC_TIME\", \"LC_COLLATE\", \"LC_MONETARY\", \"LC_MESSAGES\", \"LC_PAPER\",\n        \"LC_NAME\", \"LC_ADDRESS\", \"LC_TELEPHONE\", \"LC_MEASUREMENT\",\n        \"LC_IDENTIFICATION\", \"LC_ALL\" }) {\n      char* env_value = getenv(env_name);\n      if (env_value) {\n        server_args.push_back(\"-l\");\n        server_args.push_back(string(env_name) + \"=\" + env_value);\n      }\n    }\n\n    if ( commands ) {\n      server_args.push_back( \"--\" );\n      server_args.insert( server_args.end(), command, command + commands );\n    }\n\n    string quoted_self = shell_quote_string( string( argv[0] ) );\n    string quoted_server_args = shell_quote( server_args );\n    fflush( stdout );\n\n    string proxy_arg = \"ProxyCommand=\" + quoted_self;\n    if (force_ipv6) {\n      proxy_arg += \" -6\";\n    }\n    proxy_arg += \" --fake-proxy -- %h %p\";\n    string ssh_remote_command = server + \" \" + quoted_server_args;\n\n    vector<string> ssh_args;\n    ssh_args.push_back( \"-n\" );\n    ssh_args.push_back( \"-tt\" );\n    ssh_args.push_back( \"-S\" );\n    ssh_args.push_back( \"none\" );\n    ssh_args.push_back( \"-o\" );\n    ssh_args.push_back( proxy_arg );\n    ssh_args.push_back( userhost );\n    if ( ssh_port.size() ) {\n      ssh_args.push_back( \"-p\" );\n      ssh_args.push_back( ssh_port );\n    }\n    if ( force_ipv6 ) {\n      ssh_args.push_back( \"-6\" );\n    }\n    ssh_args.push_back( \"--\" );\n    ssh_args.push_back( ssh_remote_command );\n\n    string ssh_exec_string = ssh + \" \" + shell_quote( ssh_args );\n\n    int ret = execlp( \"sh\", \"sh\", \"-c\", ssh_exec_string.c_str(), (char *)NULL );\n    if ( ret == -1 ) {\n      die( \"Cannot exec ssh: %d\", errno );\n    }\n  }\n\n  close( pty_slave );\n  string ip, port, key;\n\n  FILE *pty_file = fdopen( pty, \"r\" );\n  string line;\n  while ( ( n = getline( &buf, &buf_sz, pty_file ) ) >= 0 ) {\n    line = string( buf, n );\n    line = line.erase( line.find_last_not_of( \"\\n\" ) );\n    if ( line.compare( 0, 8, \"MOSH IP \" ) == 0 ) {\n      size_t ip_end = line.find_last_not_of( \" \\t\\n\\r\" );\n      if ( ip_end != string::npos && ip_end >= 8 ) {\n        ip = line.substr( 8, ip_end + 1 - 8 );\n      }\n    } else if ( line.compare( 0, 13, \"MOSH CONNECT \" ) == 0 ) {\n      size_t port_end = line.find_first_not_of( \"0123456789\", 13 );\n      if ( port_end != string::npos && port_end >= 13 ) {\n        port = line.substr( 13, port_end - 13 );\n      }\n      string rest = line.substr( port_end + 1 );\n      size_t key_end = rest.find_last_not_of( \" \\t\\n\\r\" );\n      size_t key_valid_end = rest.find_last_of( key_valid_char_set );\n      if ( key_valid_end == key_end && key_end + 1 == 22 ) {\n        key = rest.substr( 0, key_end + 1 );\n      }\n      break;\n    } else {\n      printf( \"%s\\n\", line.c_str() );\n    }\n  }\n  waitpid( pid, NULL, 0 );\n\n  if ( !ip.size() ) {\n    die( \"%s: Did not find remote IP address (is SSH ProxyCommand disabled?).\",\n         argv[0] );\n  }\n\n  if ( !key.size() || !port.size() ) {\n    die( \"%s: Did not find mosh server startup message.\", argv[0] );\n  }\n\n  setenv( \"MOSH_KEY\", key.c_str(), 1 );\n  setenv( \"MOSH_PREDICTION_DISPLAY\", predict.c_str(), 1 );\n  if (!term_init) setenv( \"MOSH_NO_TERM_INIT\", \"1\", 1 );\n  execlp( client.c_str(), client.c_str(), ip.c_str(), port.c_str(), (char *)NULL );\n}\n"
  },
  {
    "path": "packages/mosh/mosh.pl.patch",
    "content": "diff -u -r ../mosh-05fe24d50ddbabf1c87be748b7397907ae1b9654/scripts/mosh.pl ./scripts/mosh.pl\n--- ../mosh-05fe24d50ddbabf1c87be748b7397907ae1b9654/scripts/mosh.pl\t2016-05-25 02:13:12.000000000 -0400\n+++ ./scripts/mosh.pl\t2016-06-01 05:51:47.622538718 -0400\n@@ -370,7 +370,7 @@\n   if ( $use_remote_ip eq 'proxy' ) {\n     # Non-standard shells and broken shrc files cause the ssh\n     # proxy to break mysteriously.\n-    $ENV{ 'SHELL' } = '/bin/sh';\n+    $ENV{ 'SHELL' } = '@TERMUX_PREFIX@/bin/sh';\n     my $quoted_proxy_command = shell_quote( $0, \"--family=$family\" );\n     push @sshopts, ( '-S', 'none', '-o', \"ProxyCommand=$quoted_proxy_command --fake-proxy -- %h %p\" );\n   }\n"
  },
  {
    "path": "packages/mosh/src-network-network.cc.patch",
    "content": "diff -u -r ../mosh-1.3.2/src/network/network.cc ./src/network/network.cc\n--- ../mosh-1.3.2/src/network/network.cc\t2017-07-22 21:14:53.000000000 +0000\n+++ ./src/network/network.cc\t2018-09-21 22:19:34.358866860 +0000\n@@ -60,7 +60,6 @@\n #define AI_NUMERICSERV 0\n #endif\n \n-using namespace std;\n using namespace Network;\n using namespace Crypto;\n \n@@ -335,7 +334,7 @@\n       }\n     }\n \n-    if ( bind( sock(), &local_addr.sa, local_addr_len ) == 0 ) {\n+    if ( ::bind( sock(), &local_addr.sa, local_addr_len ) == 0 ) {\n       set_MTU( local_addr.sa.sa_family );\n       return true;\n     } else if ( i == search_high ) { /* last port to search */\n"
  },
  {
    "path": "packages/mp3splt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://mp3splt.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Utility to split mp3, ogg vorbis and FLAC files without decoding\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.6.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://prdownloads.sourceforge.net/mp3splt/mp3splt-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=3ec32b10ddd8bb11af987b8cd1c76382c48d265d0ffda53041d9aceb1f103baa\nTERMUX_PKG_DEPENDS=\"libmp3splt\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=$TERMUX_PREFIX/share/man\"\n\ntermux_step_post_configure() {\n\tcd $TERMUX_PKG_SRCDIR/src\n\tsed -i -e 's/BEOS/ANDROID/g' freedb.c\n\ttouch langinfo.h\n}\n"
  },
  {
    "path": "packages/mpc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.musicpd.org/clients/mpc/\nTERMUX_PKG_DESCRIPTION=\"Minimalist command line interface for MPD\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Matthew Klein @mklein994\"\nTERMUX_PKG_VERSION=0.33\nTERMUX_PKG_SRCURL=https://www.musicpd.org/download/mpc/${TERMUX_PKG_VERSION:0:1}/mpc-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=4f40ccbe18f5095437283cfc525a97815e983cbfd3a29e48ff610fa4f1bf1296\nTERMUX_PKG_DEPENDS=\"libiconv, libmpdclient\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-Diconv=enabled\"\n\n# There seems to be issues with sphinx-build when using concurrent builds:\nTERMUX_MAKE_PROCESSES=1\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -liconv\"\n}\n"
  },
  {
    "path": "packages/mpc/meson.build.patch",
    "content": "diff -uNr mpc-0.32/meson.build mpc-0.32.mod/meson.build\n--- mpc-0.32/meson.build\t2019-06-11 19:02:54.000000000 +0300\n+++ mpc-0.32.mod/meson.build\t2019-08-13 22:42:17.206151787 +0300\n@@ -15,17 +15,7 @@\n \n conf.set('HAVE_STRNDUP', cc.has_function('strndup', prefix: '#define _GNU_SOURCE\\n#include <string.h>'))\n \n-iconv = get_option('iconv')\n-if iconv.disabled()\n-  iconv = false\n-elif cc.has_function('iconv')\n-  iconv = true\n-elif iconv.auto()\n-  iconv = false\n-else\n-  error('iconv() not available')\n-endif\n-conf.set('HAVE_ICONV', iconv)\n+conf.set('HAVE_ICONV', true)\n \n configure_file(output: 'config.h', configuration: conf)\n \n@@ -75,11 +65,7 @@\n   '.',\n )\n \n-if iconv\n-  iconv_sources = files('src/charset.c')\n-else\n-  iconv_sources = []\n-endif\n+iconv_sources = files('src/charset.c')\n \n executable('mpc',\n   'src/main.c',\n"
  },
  {
    "path": "packages/mpd/HybridDsdDecoderPlugin.cxx.patch",
    "content": "diff -u -r ../MPD-0.21.7/src/decoder/plugins/HybridDsdDecoderPlugin.cxx ./src/decoder/plugins/HybridDsdDecoderPlugin.cxx\n--- ../MPD-0.21.7/src/decoder/plugins/HybridDsdDecoderPlugin.cxx\t2019-04-03 10:18:29.000000000 +0000\n+++ ./src/decoder/plugins/HybridDsdDecoderPlugin.cxx\t2019-04-11 23:28:00.503100747 +0000\n@@ -39,8 +39,6 @@\n \t   without a DSD DAC, the PCM (=ALAC) part of the file is\n \t   better */\n \tif (block.GetBlockParam(\"enabled\") == nullptr) {\n-\t\tLogDebug(hybrid_dsd_domain,\n-\t\t\t \"The Hybrid DSD decoder is disabled because it was not explicitly enabled\");\n \t\treturn false;\n \t}\n \n"
  },
  {
    "path": "packages/mpd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.musicpd.org\nTERMUX_PKG_DESCRIPTION=\"Music player daemon\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.21.16\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/MusicPlayerDaemon/MPD/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=fc9f14e3bc5d7cba8fff8da0bfe33781448ebf1dafef142636e1d1206e1313e1\nTERMUX_PKG_DEPENDS=\"libc++, libcurl, libid3tag, libopus, pulseaudio, libmpdclient, openal-soft, libvorbis, libsqlite, ffmpeg, libmp3lame, libbz2, libogg, libnfs, zlib\"\nTERMUX_PKG_BUILD_DEPENDS=\"boost\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-Dalsa=disabled\n-Dao=disabled\n-Depoll=false\n-Dexpat=disabled\n-Diconv=disabled\n-Dicu=disabled\n-Dmad=disabled\n-Dpcre=disabled\n-Dsndio=disabled\n\"\nTERMUX_PKG_CONFFILES=\"etc/mpd.conf var/service/mpd/run var/service/mpd/log/run\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tCXXFLAGS+=\" -DTERMUX -UANDROID\"\n\tLDFLAGS+=\" -llog -lOpenSLES\"\n\trm -f $TERMUX_PREFIX/etc/mpd.conf\n}\n\ntermux_step_post_make_install() {\n\tinstall -Dm600 $TERMUX_PKG_SRCDIR/doc/mpdconf.example $TERMUX_PREFIX/etc/mpd.conf\n\n\t# Setup mpd service script\n\tmkdir -p $TERMUX_PREFIX/var/service\n\tcd $TERMUX_PREFIX/var/service\n\tmkdir -p mpd/log\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > mpd/run\n\techo 'if [ -f \"$HOME/.mpd/mpd.conf\" ]; then CONFIG=\"$HOME/.mpd/mpd.conf\"; else CONFIG=\"$PREFIX/etc/mpd.conf\"; fi' >> mpd/run\n\techo 'exec mpd --stdout --no-daemon $CONFIG 2>&1' >> mpd/run\n\tchmod +x mpd/run\n\ttouch mpd/down\n\tln -sf $PREFIX/share/termux-services/svlogger mpd/log/run\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo 'mkdir -p $HOME/.mpd/playlists' >> postinst\n}\n"
  },
  {
    "path": "packages/mpd/doc-mpdconf.example.patch",
    "content": "diff -u -r ../MPD-0.21.3/doc/mpdconf.example ./doc/mpdconf.example\n--- ../MPD-0.21.3/doc/mpdconf.example\t2018-11-16 12:27:58.000000000 +0000\n+++ ./doc/mpdconf.example\t2018-12-30 22:31:44.428337004 +0000\n@@ -10,14 +10,14 @@\n # be disabled and audio files will only be accepted over ipc socket (using\n # file:// protocol) or streaming files over an accepted protocol.\n #\n-#music_directory\t\t\"~/music\"\n+music_directory\t\"/sdcard/Music\"\n #\n # This setting sets the MPD internal playlist directory. The purpose of this\n # directory is storage for playlists created by MPD. The server will use \n # playlist files not created by the server but only if they are in the MPD\n # format. This setting defaults to playlist saving being disabled.\n #\n-#playlist_directory\t\t\"~/.mpd/playlists\"\n+playlist_directory\t\t\"~/.mpd/playlists\"\n #\n # This setting sets the location of the MPD database. This file is used to\n # load the database at server start up and store the database while the \n@@ -25,7 +25,7 @@\n # MPD to accept files over ipc socket (using file:// protocol) or streaming\n # files over an accepted protocol.\n #\n-#db_file\t\t\t\"~/.mpd/database\"\n+db_file\t\t\t\"~/.mpd/database\"\n # \n # These settings are the locations for the daemon log files for the daemon.\n # These logs are great for troubleshooting, depending on your log_level\n@@ -34,25 +34,25 @@\n # The special value \"syslog\" makes MPD use the local syslog daemon. This\n # setting defaults to logging to syslog.\n #\n-#log_file\t\t\t\"~/.mpd/log\"\n+#log_file\t\t\t\"@TERMUX_HOME@/.mpd/log\"\n #\n # This setting sets the location of the file which stores the process ID\n # for use of mpd --kill and some init scripts. This setting is disabled by\n # default and the pid file will not be stored.\n #\n-#pid_file\t\t\t\"~/.mpd/pid\"\n+pid_file\t\t\t\"~/.mpd/pid\"\n #\n # This setting sets the location of the file which contains information about\n # most variables to get MPD back into the same general shape it was in before\n # it was brought down. This setting is disabled by default and the server \n # state will be reset on server start up.\n #\n-#state_file\t\t\t\"~/.mpd/state\"\n+state_file\t\t\t\"~/.mpd/state\"\n #\n # The location of the sticker database.  This is a database which\n # manages dynamic information attached to songs.\n #\n-#sticker_file\t\t\t\"~/.mpd/sticker.sql\"\n+sticker_file\t\t\t\"~/.mpd/sticker.sql\"\n #\n ###############################################################################\n \n@@ -77,17 +77,18 @@\n # should be paid if this is assigned to anything other then the default, any.\n # This setting can deny access to control of the daemon. Not effective if\n # systemd socket activiation is in use.\n-#\n+# For local connections only \n+#bind_to_address\t\t\"localhost\"\n # For network\n #bind_to_address\t\t\"any\"\n #\n # And for Unix Socket\n-#bind_to_address\t\t\"~/.mpd/socket\"\n+bind_to_address\t\t\"@TERMUX_PREFIX@/var/run/mpd.socket\"\n #\n # This setting is the TCP port that is desired for the daemon to get assigned\n-# to.\n+# to. Normally this is 6600 but for termux this port needs to be above 8000. \n #\n-#port\t\t\t\t\"6600\"\n+#port\t\t\t\t\"8600\"\n #\n # This setting controls the type of information which is logged. Available \n # setting arguments are \"default\", \"secure\" or \"verbose\". The \"verbose\" setting\n@@ -133,12 +134,12 @@\n # If this setting is set to \"yes\", MPD will discover audio files by following \n # symbolic links outside of the configured music_directory.\n #\n-#follow_outside_symlinks\t\"yes\"\n+follow_outside_symlinks\t\"yes\"\n #\n # If this setting is set to \"yes\", MPD will discover audio files by following\n # symbolic links inside of the configured music_directory.\n #\n-#follow_inside_symlinks\t\t\"yes\"\n+follow_inside_symlinks\t\t\"yes\"\n #\n ###############################################################################\n \n@@ -201,28 +202,6 @@\n # blocks. Setting this block is optional, though the server will only attempt\n # autodetection for one sound card.\n #\n-# An example of an ALSA output:\n-#\n-#audio_output {\n-#\ttype\t\t\"alsa\"\n-#\tname\t\t\"My ALSA Device\"\n-##\tdevice\t\t\"hw:0,0\"\t# optional\n-##\tmixer_type      \"hardware\"\t# optional\n-##\tmixer_device\t\"default\"\t# optional\n-##\tmixer_control\t\"PCM\"\t\t# optional\n-##\tmixer_index\t\"0\"\t\t# optional\n-#}\n-#\n-# An example of an OSS output:\n-#\n-#audio_output {\n-#\ttype\t\t\"oss\"\n-#\tname\t\t\"My OSS Device\"\n-##\tdevice\t\t\"/dev/dsp\"\t# optional\n-##\tmixer_type      \"hardware\"\t# optional\n-##\tmixer_device\t\"/dev/mixer\"\t# optional\n-##\tmixer_control\t\"PCM\"\t\t# optional\n-#}\n #\n # An example of a shout output (for streaming to Icecast):\n #\n@@ -253,7 +232,8 @@\n #\ttype\t\t\"recorder\"\n #\tname\t\t\"My recorder\"\n #\tencoder\t\t\"vorbis\"\t\t# optional, vorbis or lame\n-#\tpath\t\t\"/var/lib/mpd/recorder/mpd.ogg\"\n+##  for termux changed \"path\" to somewhere on android that works\n+#\tpath\t\t\"~/mpd.ogg\" \n ##\tquality\t\t\"5.0\"\t\t\t# do not define if bitrate is defined\n #\tbitrate\t\t\"128\"\t\t\t# do not define if quality is defined\n #\tformat\t\t\"44100:16:1\"\n@@ -282,42 +262,31 @@\n ##\tsink\t\t\"remote_server_sink\"\t# optional\n #}\n #\n-# An example of a winmm output (Windows multimedia API).\n-#\n-#audio_output {\n-#\ttype\t\t\"winmm\"\n-#\tname\t\t\"My WinMM output\"\n-##\tdevice\t\t\"Digital Audio (S/PDIF) (High Definition Audio Device)\" # optional\n-#\t\tor\n-##\tdevice\t\t\"0\"\t\t# optional\n-##\tmixer_type\t\"hardware\"\t# optional\n-#}\n+# An example of an opensl android output.\n+audio_output {\n+        type            \"sles\"\n+        name            \"OpenSLES output\"\n+        mixer_type      \"software\"\n+}\n #\n # An example of an openal output.\n #\n-#audio_output {\n-#\ttype\t\t\"openal\"\n-#\tname\t\t\"My OpenAL output\"\n-##\tdevice\t\t\"Digital Audio (S/PDIF) (High Definition Audio Device)\" # optional\n-#}\n-#\n-# An example of an sndio output.\n-#\n-#audio_output {\n-#\ttype\t\t\"sndio\"\n-#\tname\t\t\"sndio output\"\n-#\tmixer_type\t\"hardware\"\n-#}\n-#\n-# An example of an OS X output:\n-#\n-#audio_output {\n-#\ttype\t\t\"osx\"\n-#\tname\t\t\"My OS X Device\"\n-##\tdevice\t\t\"Built-in Output\"\t# optional\n-##\tchannel_map      \"-1,-1,0,1\"\t# optional\n-#}\n-#\n+audio_output {\n+\ttype\t\t\"openal\"\n+\tname\t\t\"OpenAL output\"\n+\tmixer_type\t\"software\"\n+\tdevice\t\t\"OpenSL\"\n+\tenabled\t\t\"no\"\n+}\n+#Fifo output for visualizations in ncmpcpp-git\n+audio_output {\n+        type            \"fifo\"\n+        name            \"ncmpcpp visualizer\"\n+        path            \"@TERMUX_PREFIX@/var/run/mpd.fifo\"\n+        format          \"44100:16:2\"\n+\tenabled\t\t\"no\"\n+}\n+\n ## Example \"pipe\" output:\n #\n #audio_output {\n"
  },
  {
    "path": "packages/mpd/mpd-script.sh",
    "content": "mpd_test=$(pgrep -f /data/data/com.termux/files/usr/libexec/mpd)\nCmdArgs=$(echo \"$@\")\n#echo $mpd_test\nmkdir -p ~/.mpd\nmkdir -p ~/.mpd/playlists\ntouch ~/.mpd/state\ntouch ~/.mpd/log\ntouch ~/.mpd/pid\nif [ \"x$CmdArgs\" = x ] ; then\n\tif [ -z \"$MULTIPLE_MPDS\"  ] ; then\n\t\tif [ -n \"$mpd_test\" ] ;  then\n\t\techo -n \"restart music player daemon (y/n)? \"\n\t\tread answer\n\t\t\tif echo \"$answer\" | grep -iq \"^y\" ;then\n\t\t\techo \"restarting music player daemon\"\n\t\t\tpgrep -f  /data/data/com.termux/files/usr/libexec/mpd  | while read line; do kill  \"$line\"; done\n\t\t\telse \n\t\t\techo \"doing nothing\"\n\t\t\texit\n\t\t\tfi\n\t\telse\n\t\techo \"starting mpd the music player daemon\"\n\t\tfi\n\t\tsleep 0.5;\n\t\tchmod +rw ~/.mpd/*  2>&1 > /dev/null\n\t\trm -rf ~/.mpd/pid   2>&1 > /dev/null\n\tfi\nfi\n"
  },
  {
    "path": "packages/mpd/registry.cxx.patch",
    "content": "--- ../cache/MPD-0.20.6/src/output/Registry.cxx\t2017-03-10 15:57:59.000000000 +0000\n+++ ./src/output/Registry.cxx\t2017-05-13 03:07:25.443629772 +0000\n@@ -47,7 +47,7 @@\n \t&shout_output_plugin,\n #endif\n \t&null_output_plugin,\n-#ifdef ANDROID\n+#if defined(ANDROID) || defined(TERMUX)\n \t&sles_output_plugin,\n #endif\n #ifdef HAVE_FIFO\n"
  },
  {
    "path": "packages/mpd/src-fs-io-FileOutputStream.hxx.patch",
    "content": "--- ../FileOutputStream.hxx.orig\t2019-08-24 20:56:41.969642005 +0200\n+++ ./src/fs/io/FileOutputStream.hxx\t2019-08-12 21:47:53.854420002 +0200\n@@ -45,7 +45,7 @@\n #include <windows.h>\n #endif\n \n-#if defined(__linux__) && !defined(ANDROID)\n+#if defined(__linux__) && !defined(__ANDROID__)\n /* we don't use O_TMPFILE on Android because Android's braindead\n    SELinux policy disallows hardlinks\n    (https://android.googlesource.com/platform/external/sepolicy/+/85ce2c7),\n"
  },
  {
    "path": "packages/mpd/src-input-Error.cxx.patch",
    "content": "diff -u -r ../MPD-0.21.3/src/input/Error.cxx ./src/input/Error.cxx\n--- ../MPD-0.21.3/src/input/Error.cxx\t2018-11-16 12:27:58.000000000 +0000\n+++ ./src/input/Error.cxx\t2018-12-31 00:46:04.225900587 +0000\n@@ -30,22 +30,28 @@\n #include <nfsc/libnfs-raw-nfs.h>\n #endif\n \n+#include <iostream>\n+\n bool\n IsFileNotFound(std::exception_ptr ep) noexcept\n {\n \ttry {\n \t\tstd::rethrow_exception(ep);\n \t} catch (const std::system_error &e) {\n+\t\tstd::cout << \"\";\n \t\treturn IsFileNotFound(e);\n #ifdef ENABLE_CURL\n \t} catch (const HttpStatusError &e) {\n+\t\tstd::cout << \"\";\n \t\treturn e.GetStatus() == 404;\n #endif\n #ifdef ENABLE_NFS\n \t} catch (const NfsClientError &e) {\n+\t\tstd::cout << \"\";\n \t\treturn e.GetCode() == NFS3ERR_NOENT;\n #endif\n \t} catch (...) {\n+\t\tstd::cout << \"\";\n \t}\n \n \treturn false;\n"
  },
  {
    "path": "packages/mpd/src-lib-gcrypt-meson.build.patch",
    "content": "diff -u -r ../MPD-0.21.7/src/lib/gcrypt/meson.build ./src/lib/gcrypt/meson.build\n--- ../MPD-0.21.7/src/lib/gcrypt/meson.build\t2019-04-03 10:18:29.000000000 +0000\n+++ ./src/lib/gcrypt/meson.build\t2019-04-11 23:30:00.477643167 +0000\n@@ -8,7 +8,7 @@\n # will falsly assume it has found the gcrypt library for the target.\n #\n # See: https://github.com/MusicPlayerDaemon/MPD/pull/495\n-gcrypt_dep = c_compiler.find_library('gcrypt', required: get_option('qobuz'))\n+gcrypt_dep = c_compiler.find_library('gcrypt_disabled', required: get_option('qobuz'))\n if gcrypt_dep.found()\n   gcrypt_dep = dependency('libgcrypt')\n endif\n"
  },
  {
    "path": "packages/mpd/src-output-plugins-meson.build.patch",
    "content": "diff -u -r ../MPD-0.21.3/src/output/plugins/meson.build ./src/output/plugins/meson.build\n--- ../MPD-0.21.3/src/output/plugins/meson.build\t2018-11-16 12:27:58.000000000 +0000\n+++ ./src/output/plugins/meson.build\t2018-12-30 23:30:25.443763055 +0000\n@@ -106,12 +106,8 @@\n   need_encoder = true\n endif\n \n-if is_android\n   sles_dep = c_compiler.find_library('OpenSLES')\n   output_plugins_sources += 'sles/SlesOutputPlugin.cxx'\n-else\n-  sles_dep = dependency('', required: false)\n-endif\n \n if libsndio_dep.found()\n   output_plugins_sources += 'SndioOutputPlugin.cxx'\n"
  },
  {
    "path": "packages/mpd/thread-Util.cxx.patch",
    "content": "diff --git a/src/thread/Util.cxx~ b/src/thread/Util.cxx\nindex 0dbf818..671eb6a 100644\n--- a/src/thread/Util.cxx~\n+++ b/src/thread/Util.cxx\n@@ -40,7 +40,7 @@\n \n #ifdef __linux__\n \n-#ifndef ANDROID\n+#if !defined(ANDROID) && !defined(TERMUX)\n \n static int\n linux_ioprio_set(int which, int who, int ioprio)\n@@ -60,7 +60,7 @@ ioprio_set_idle()\n \tlinux_ioprio_set(_IOPRIO_WHO_PROCESS, 0, _IOPRIO_IDLE);\n }\n \n-#endif /* !ANDROID */\n+#endif /* !ANDROID && !TERMUX */\n \n /**\n  * Wrapper for the \"sched_setscheduler\" system call.  We don't use the\n@@ -84,7 +84,7 @@ SetThreadIdlePriority()\n \tlinux_sched_setscheduler(0, SCHED_IDLE, &sched_param);\n #endif\n \n-#ifndef ANDROID\n+#if !defined(ANDROID) && !defined(TERMUX)\n \t/* this system call is forbidden via seccomp on Android 8 and\n \t   leads to crash (SIGSYS) */\n \tioprio_set_idle();\n"
  },
  {
    "path": "packages/mpdscribble/Makefile.am.patch",
    "content": "--- ../Makefile.am.orig\t2019-07-26 23:06:17.899096875 +0200\n+++ ./Makefile.am\t2019-07-26 23:18:44.680264101 +0200\n@@ -43,7 +43,8 @@\n \t$(LIBMPDCLIENT_LIBS) \\\n \t$(libgthread_LIBS) \\\n \t$(libgcrypt_LIBS) \\\n-\t$(libglib_LIBS)\n+\t$(libglib_LIBS) \\\n+\t-llog\n \n AM_CPPFLAGS += -DFILE_CONF='\"$(sysconfdir)/mpdscribble.conf\"'\n \n"
  },
  {
    "path": "packages/mpdscribble/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.musicpd.org/clients/mpdscribble/\nTERMUX_PKG_DESCRIPTION=\"A Music Player Daemon (MPD) client which submits information about tracks being played to a scrobbler\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=0.22\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/MusicPlayerDaemon/mpdscribble/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=9f6d73e1d0d44bf782c199732acc91bb07efc1c02ae04d037d711860dd8e4012\nTERMUX_PKG_DEPENDS=\"libcurl, mpd, libmpdclient, glib\"\nTERMUX_PKG_CONFFILES=\"etc/mpdscribble.conf\"\n\ntermux_step_pre_configure () {\n\tNOCONFIGURE=1 ./autogen.sh\n}\n\ntermux_step_post_make_install () {\n\tinstall $TERMUX_PKG_SRCDIR/doc/mpdscribble.conf $TERMUX_PREFIX/etc/\n}\ntermux_step_create_debscripts () {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"mkdir -p ~/.mpdscribble\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n}\n"
  },
  {
    "path": "packages/mpdscribble/file.c.patch",
    "content": "--- ../file.c.orig\t2018-11-23 13:05:51.749928637 +0100\n+++ ./src/file.c\t2018-11-23 13:07:24.143261299 +0100\n@@ -38,7 +38,7 @@\n \n #ifndef G_OS_WIN32\n \n-#define FILE_CACHE \"/var/cache/mpdscribble/mpdscribble.cache\"\n+#define FILE_CACHE \"@TERMUX_PREFIX@/var/cache/mpdscribble/mpdscribble.cache\"\n #define FILE_HOME_CONF \"~/.mpdscribble/mpdscribble.conf\"\n #define FILE_HOME_CACHE \"~/.mpdscribble/mpdscribble.cache\"\n \n"
  },
  {
    "path": "packages/mpdscribble/mpdscribble.conf.patch",
    "content": "--- ../mpdscribble.conf.orig\t2018-11-23 15:02:34.929996250 +0100\n+++ ./doc/mpdscribble.conf\t2018-11-23 15:07:03.259994317 +0100\n@@ -5,7 +5,7 @@\n #proxy = http://the.proxy.server:3128\n \n # The location of the pid file.  mpdscribble saves its process id there.\n-#pidfile = /var/run/mpdscribble.pid\n+pidfile = @TERMUX_HOME@/.mpdscribble/pid\n \n # Change to this system user after daemonization.\n #daemon_user = mpdscribble\n@@ -14,7 +14,7 @@\n # \"syslog\" makes mpdscribble use the local syslog daemon.  On most\n # systems, log messages will appear in /var/log/daemon.log then.\n # \"-\" means log to stderr (the current terminal).\n-log = syslog\n+log = @TERMUX_HOME@/.mpdscribble/log\n \n # How verbose mpdscribble's logging should be.  Default is 1.\n verbose = 1\n@@ -24,7 +24,7 @@\n \n # The host running MPD, possibly protected by a password\n # ([PASSWORD@]HOSTNAME).  Defaults to $MPD_HOST or localhost.\n-#host = localhost\n+host = @TERMUX_PREFIX@/tmp/mpd.socket\n \n # The port that the MPD listens on and mpdscribble should try to\n # connect to.  Defaults to $MPD_PORT or 6600.\n@@ -36,19 +36,19 @@\n password =\n # The file where mpdscribble should store its Last.fm journal in case\n # you do not have a connection to the Last.fm server.\n-journal = /var/cache/mpdscribble/lastfm.journal\n+journal = @TERMUX_HOME@/.mpdscribble/lastfm.journal\n \n #[libre.fm]\n #url = http://turtle.libre.fm/\n #username = my_username\n #password = my_password\n-#journal = /var/cache/mpdscribble/librefm.journal\n+#journal = @TERMUX_HOME@/.mpdscribble/librefm.journal\n \n #[jamendo]\n #url = http://postaudioscrobbler.jamendo.com/\n #username = my_username\n #password = my_password\n-#journal = /var/cache/mpdscribble/jamendo.journal\n+#journal = @TERMUX_HOME@/.mpdscribble/jamendo.journal\n \n #[file]\n-#file = /var/log/mpdscribble/log\n+#file = @TERMUX_HOME@/.mpdscribble/log\n"
  },
  {
    "path": "packages/mpv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://mpv.io/\nTERMUX_PKG_DESCRIPTION=\"Command-line media player\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.30.0\nTERMUX_PKG_SRCURL=https://github.com/mpv-player/mpv/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=33a1bcb7e74ff17f070e754c15c52228cf44f2cefbfd8f34886ae81df214ca35\nTERMUX_PKG_DEPENDS=\"ffmpeg, libandroid-glob, libandroid-support, libarchive, libcaca, libiconv, liblua52, pulseaudio, openal-soft, zlib\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/icons share/applications\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\n\t./bootstrap.py\n\n\t./waf configure \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--disable-gl \\\n\t\t--disable-jpeg \\\n\t\t--disable-lcms2 \\\n\t\t--enable-libarchive \\\n\t\t--disable-libass \\\n\t\t--enable-lua \\\n\t\t--enable-pulse \\\n\t\t--enable-openal \\\n\t\t--enable-caca \\\n\t\t--disable-alsa \\\n\t\t--disable-x11\n\n\t./waf -v install\n\n\t# Use opensles audio out be default:\n\tmkdir -p $TERMUX_PREFIX/etc/mpv\n\tcp $TERMUX_PKG_BUILDER_DIR/mpv.conf $TERMUX_PREFIX/etc/mpv/mpv.conf\n}\n"
  },
  {
    "path": "packages/mpv/main.c.patch",
    "content": "We don't need a warning every time.\n\ndiff -u -r ../mpv-0.19.0/player/main.c ./player/main.c\n--- ../mpv-0.19.0/player/main.c\t2016-08-15 10:10:59.000000000 -0400\n+++ ./player/main.c\t2016-08-26 18:40:46.624646426 -0400\n@@ -455,10 +455,12 @@\n     }\n #endif\n \n+#ifndef __ANDROID__\n #if !HAVE_LIBASS\n     MP_WARN(mpctx, \"Compiled without libass.\\n\");\n     MP_WARN(mpctx, \"There will be no OSD and no text subtitles.\\n\");\n #endif\n+#endif\n \n     mpctx->osd = osd_create(mpctx->global);\n \n"
  },
  {
    "path": "packages/mpv/mpv.conf",
    "content": "# Default configuration for mpv\n\n# Enable OpenSL ES output, since this should work on all Android devices\nao=opensles\n\n# Use the following option to increase or decrease audio buffer\n# when necessary / desired. The default is 250ms (0.25s).\n\n# opensles-buffer-size-in-ms=250\n\n# You can also use the generic audio-buffer option (which takes\n# value in second instead), but it will only has effect on the\n# opensles ao if the above option is explicitly set to 0.\n\n# By default mpv allows s32 and float output. If they aren't\n# supported in your device (which should not happen with API\n# 21 and above), disable them with the following option:\n\n# audio-format=s16\n\n# Disable Video Decode and Output. Termux doesn't support video output (with the exception of \"tct\").\nvid=no\n"
  },
  {
    "path": "packages/mpv/wscript.patch",
    "content": "diff --git a/wscript b/wscript\nindex 830201a6bd..543a30feea 100644\n--- a/wscript\n+++ b/wscript\n@@ -154,7 +154,7 @@ main_dependencies = [\n     }, {\n         'name': '--android',\n         'desc': 'Android environment',\n-        'func': check_statement('android/api-level.h', '(void)__ANDROID__'),  # arbitrary android-specific header\n+        'func': check_cc(lib=['android']),\n     }, {\n         'name': '--tvos',\n         'desc': 'tvOS environment',\n@@ -167,7 +167,7 @@ main_dependencies = [\n         'desc': 'Android EGL support',\n         'deps': 'android',\n         'groups': [ 'gl' ],\n-        'func': check_cc(lib=['android', 'EGL']),\n+        'func': check_cc(lib=['EGL']),\n     }, {\n         'name': 'posix-or-mingw',\n         'desc': 'development environment',\n"
  },
  {
    "path": "packages/msmtp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://marlam.de/msmtp/\nTERMUX_PKG_DESCRIPTION=\"Lightweight SMTP client\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.8.6\nTERMUX_PKG_SRCURL=https://marlam.de/msmtp/releases/msmtp-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=6625f147430c65ba8527f52c4fe5d4d33552d3c0fb6d793ba7df819a3b3042e1\nTERMUX_PKG_DEPENDS=\"openssl, libidn2\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-tls=openssl\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-llog\"\n\tautoreconf -if\n}\n"
  },
  {
    "path": "packages/mtd-utils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.linux-mtd.infradead.org/\nTERMUX_PKG_DESCRIPTION=\"Utilities for dealing with MTD devices\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.1.1\nTERMUX_PKG_SRCURL=ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=8d15e8b70f036d6af1a66011f8ca0e048e9675fa7983d33bea92c24313a232d2\nTERMUX_PKG_DEPENDS=\"openssl, liblzo, libuuid, zlib, zstd\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/mtd-utils/mkfs.jffs2.c.patch",
    "content": "diff -uNr mtd-utils-2.1.1/jffsX-utils/mkfs.jffs2.c mtd-utils-2.1.1.mod/jffsX-utils/mkfs.jffs2.c\n--- mtd-utils-2.1.1/jffsX-utils/mkfs.jffs2.c\t2018-10-02 15:07:55.000000000 +0300\n+++ mtd-utils-2.1.1.mod/jffsX-utils/mkfs.jffs2.c\t2019-10-04 20:22:36.232097463 +0300\n@@ -86,6 +86,10 @@\n \n #define PAD(x) (((x)+3)&~3)\n \n+#ifndef IFTODT\n+#define IFTODT(mode) (((mode) & 0170000) >> 12)\n+#endif\n+\n struct filesystem_entry {\n \tchar *name;\t\t\t\t\t/* Name of this directory (think basename) */\n \tchar *path;\t\t\t\t\t/* Path of this directory (think dirname) */\n"
  },
  {
    "path": "packages/mtools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/mtools/\nTERMUX_PKG_DESCRIPTION=\"Tool for manipulating FAT images.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.0.23\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=f188db26751aeb5692a79b2380b440ecc05fd1848a52f869d7ca1193f2ef8ee3\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/mtools/mtools-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-floppyd\nac_cv_lib_bsd_main=no\n\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-liconv\"\n}\n"
  },
  {
    "path": "packages/mtools/sysinc.patch",
    "content": "Change UNUSED macro to a more modern equivalent to prevent clang from choking.\n\n--- tmp/sysincludes.h\t2017-08-02 00:55:33.321338244 +0200\n+++ mtools/src/sysincludes.h\t2017-08-02 00:55:39.884624033 +0200\n@@ -103,7 +103,7 @@\n # define PACKED __attribute__ ((packed))\n # if __GNUC__ == 2 && __GNUC_MINOR__ > 6 || __GNUC__ >= 3\n /* gcc 2.6.3 doesn't have \"unused\" */\t\t/* mool */\n-#  define UNUSED(x) x __attribute__ ((unused));x\n+#  define UNUSED(x) x __attribute__ ((unused))\n #  define UNUSEDP __attribute__ ((unused))\n # else\n #  define UNUSED(x) x\n"
  },
  {
    "path": "packages/mu/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.djcbsoftware.nl/code/mu/\nTERMUX_PKG_DESCRIPTION=\"Maildir indexer/searcher and Emacs client (mu4e)\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/djcb/mu/releases/download/$TERMUX_PKG_VERSION/mu-$TERMUX_PKG_VERSION.0.tar.xz\nTERMUX_PKG_SHA256=f634c7f244dc6844ff71dc3c3e1893e48e193caa9e0e747eba616309775f053a\nTERMUX_PKG_DEPENDS=\"glib, libc++, libxapian, libgmime\"\n"
  },
  {
    "path": "packages/multitail/Makefile.patch",
    "content": "diff -u -r ../multitail-6.5.0/Makefile ./Makefile\n--- ../multitail-6.5.0/Makefile\t2019-11-07 12:56:23.000000000 +0000\n+++ ./Makefile\t2019-11-20 23:07:26.648217975 +0000\n@@ -8,8 +8,8 @@\n # -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -lncurses -ltinfo\n \n UTF8_SUPPORT:=yes\n-DESTDIR=\n-PREFIX=/usr/local\n+DESTDIR=@TERMUX_PREFIX@\n+PREFIX=\n CONFIG_FILE=$(DESTDIR)$(PREFIX)/etc/multitail.conf\n \n CC?=gcc\n@@ -24,7 +24,7 @@\n     LDFLAGS+=-lpanel $(NCURSES_LIB) -lutil -lm\n else\n ifeq ($(UTF8_SUPPORT),yes)\n-    LDFLAGS+=-lpanelw -lncursesw -lutil -lm\n+    LDFLAGS+=-lpanelw -lncursesw -lm\n     CPPFLAGS+=-DUTF8_SUPPORT\n else\n     LDFLAGS+=-lpanel -lncurses -lutil -lm\n@@ -57,7 +57,7 @@\n \t### YOURSELF WITH THE NEW FILE\n \t#\n \tmkdir -p $(DESTDIR)$(PREFIX)/etc/multitail/\n-\tcp multitail.conf $(CONFIG_FILE).new\n+\tcp multitail.conf $(CONFIG_FILE)\n \tcp conversion-scripts/* $(DESTDIR)$(PREFIX)/etc/multitail/\n #rm -f $(DESTDIR)$(PREFIX)/share/man/man1/multitail.1.gz\n #gzip -9 $(DESTDIR)$(PREFIX)/share/man/man1/multitail.1\n"
  },
  {
    "path": "packages/multitail/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.vanheusden.com/multitail/\nTERMUX_PKG_DESCRIPTION=\"Tool to monitor logfiles and command output in multiple windows in a terminal, colorize, filter and merge\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=6.5.0\nTERMUX_PKG_SRCURL=https://fossies.org/linux/privat/multitail-${TERMUX_PKG_VERSION}.tgz\nTERMUX_PKG_SHA256=b29d5e77dfc663c7500f78da67de5d82d35d9417a4741a89a18ce9ee7bdba9ed\nTERMUX_PKG_DEPENDS=\"ncurses, ncurses-ui-libs, libandroid-glob\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -DNCURSES_WIDECHAR\"\n\tLDFLAGS+=\" -landroid-glob\"\n}\n"
  },
  {
    "path": "packages/multitail/mt.c.patch",
    "content": "diff -u -r ../multitail-6.2.1/mt.c ./mt.c\n--- ../multitail-6.2.1/mt.c\t2014-02-16 15:06:54.000000000 +0100\n+++ ./mt.c\t2014-06-30 16:43:12.000000000 +0200\n@@ -23,7 +23,7 @@\n #include <sys/ioctl.h>\n #include <sys/stat.h>\n #ifndef AIX\n-#include <sys/termios.h> /* needed on Solaris 8 */\n+#include <termios.h> /* needed on Solaris 8 */\n #endif\n #include <sys/time.h>\n #include <sys/wait.h>\n"
  },
  {
    "path": "packages/multitail/my_pty.c.patch",
    "content": "diff -u -r ../multitail-6.4.2/my_pty.c ./my_pty.c\n--- ../multitail-6.4.2/my_pty.c\t2014-05-01 12:54:06.000000000 +0000\n+++ ./my_pty.c\t2017-07-07 08:47:03.030247339 +0000\n@@ -22,6 +22,7 @@\n #include <sys/ioctl.h>\n \n #include \"mt.h\"\n+#include \"utils.h\" /* For myopen(). */\n \n #ifdef __APPLE__\n #include <util.h>\n@@ -29,7 +30,7 @@\n #ifdef __OpenBSD__\n #include <util.h>\n #endif\n-#if defined(linux) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)\n+#if (defined(linux) && !defined(__ANDROID__)) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)\n #include <pty.h>\n #endif\n #if defined(__FreeBSD__) || defined(__minix)\n@@ -78,7 +79,7 @@\n \n int get_pty_and_fork(int *fd_master, int *fd_slave)\n {\n-#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix)\n+#if defined(__FreeBSD__) || (defined(linux) && !defined(__ANDROID__)) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__) || defined(__minix)\n \n \tif (openpty(fd_master, fd_slave, NULL, NULL, NULL) == -1)\n \t{\n@@ -88,7 +89,7 @@\n \n \treturn fork();\n \n-#elif defined(sun) || defined(__sun) || defined(AIX) || defined(_HPUX_SOURCE) || defined(OSF1) || defined(scoos)\n+#elif defined(sun) || defined(__sun) || defined(AIX) || defined(_HPUX_SOURCE) || defined(OSF1) || defined(scoos) || defined(__ANDROID__)\n \n \t/*\n \t * This code is used e.g. on Solaris 2.x.  (Note that Solaris 2.3\n@@ -123,7 +124,7 @@\n \t\t*fd_slave = myopen(pts, O_RDWR | O_NOCTTY);\n \t\tif (*fd_slave < 0) error_exit(TRUE, FALSE, \"Problem opening slave-side of pseudo tty (file '%s').\\n\", pts);\n \n-#if !defined(AIX) && !defined(scoos)\n+#if !defined(AIX) && !defined(scoos) && !defined(__ANDROID__)\n \t\t/* Push the appropriate streams modules, as described in Solaris pts(7). */\n \t\tif (ioctl(*fd_slave, I_PUSH, \"ptem\") < 0) error_exit(TRUE, FALSE, \"ioctl I_PUSH ptem failed.\\n\");\n \t\tif (ioctl(*fd_slave, I_PUSH, \"ldterm\") < 0) error_exit(TRUE, FALSE, \"ioctl I_PUSH ldterm failed.\\n\");\n"
  },
  {
    "path": "packages/multitail/term.c.patch",
    "content": "diff -u -r ../multitail-6.2.1/term.c ./term.c\n--- ../multitail-6.2.1/term.c\t2014-02-16 15:06:54.000000000 +0100\n+++ ./term.c\t2014-06-30 16:43:51.000000000 +0200\n@@ -16,7 +16,7 @@\n #include <stropts.h>\n #endif\n #ifndef AIX\n-#include <sys/termios.h> /* needed on Solaris 8 */\n+#include <termios.h> /* needed on Solaris 8 */\n #endif\n #include <sys/socket.h>\n #include <netinet/in.h>\n"
  },
  {
    "path": "packages/multitail/utils.c.patch",
    "content": "diff -u -r ../multitail-6.2.1/utils.c ./utils.c\n--- ../multitail-6.2.1/utils.c\t2014-02-16 15:06:54.000000000 +0100\n+++ ./utils.c\t2014-06-30 16:50:19.000000000 +0200\n@@ -95,7 +95,7 @@\n \n void get_load_values(double *v1, double *v2, double *v3)\n {\n-#if !defined(__UCLIBC__) && (defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__sun) || defined(sun))\n+#if !defined(__ANDROID__) && !defined(__UCLIBC__) && (defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__sun) || defined(sun))\n #if defined(__GLIBC__) && ( __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2))\n \t/* Older glibc doesn't have getloadavg() - use sysinfo() */\n \t/* thanks to Ville Herva for this code! */\n@@ -367,7 +367,7 @@\n \n \tfor(;;)\n \t{\n-\t\tfd = open64(path, mode);\n+\t\tfd = open(path, mode);\n \t\tif (fd == -1)\n \t\t{\n \t\t\tif (errno == EINTR || errno == EAGAIN) /* for AIX */\n"
  },
  {
    "path": "packages/mutt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.mutt.org/\nTERMUX_PKG_DESCRIPTION=\"Mail client with patches from neomutt\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.13.0\nTERMUX_PKG_SRCURL=ftp://ftp.mutt.org/pub/mutt/mutt-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=a00ddc21084f45f53653c35a8a991ca86d68c7162b7c8ec1625d63cfeaf5f5b7\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses, gdbm, openssl, libsasl, mime-support, zlib, libiconv\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nmutt_cv_c99_snprintf=yes\nmutt_cv_c99_vsnprintf=yes\n--disable-gpgme\n--enable-compressed\n--enable-hcache\n--enable-imap\n--enable-pop\n--enable-sidebar\n--enable-smtp\n--with-exec-shell=$TERMUX_PREFIX/bin/sh\n--with-mailpath=$TERMUX_PREFIX/var/mail\n--without-idn\n--with-sasl\n--with-ssl\n\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/flea\nbin/muttbug\nshare/man/man1/muttbug.1\nshare/man/man1/flea.1\netc/mime.types\n\"\n\nTERMUX_PKG_CONFFILES=\"etc/Muttrc\"\n\ntermux_step_post_configure() {\n\t# Build wants to run mutt_md5 and makedoc:\n\tgcc -DHAVE_STDINT_H -DMD5UTIL $TERMUX_PKG_SRCDIR/md5.c -o $TERMUX_PKG_BUILDDIR/mutt_md5\n\tgcc -DHAVE_STRERROR $TERMUX_PKG_SRCDIR/doc/makedoc.c -o $TERMUX_PKG_BUILDDIR/doc/makedoc\n\ttouch -d \"next hour\" $TERMUX_PKG_BUILDDIR/mutt_md5 $TERMUX_PKG_BUILDDIR/doc/makedoc\n}\n\ntermux_step_post_make_install() {\n\tcp $TERMUX_PKG_SRCDIR/doc/mutt.man $TERMUX_PREFIX/share/man/man1/mutt.1.man\n\tmkdir -p $TERMUX_PREFIX/share/examples/mutt/\n\tcp $TERMUX_PKG_SRCDIR/contrib/gpg.rc $TERMUX_PREFIX/share/examples/mutt/gpg.rc\n\tmv $TERMUX_PREFIX/etc/mime.types.dist $TERMUX_PREFIX/etc/mime.types\n\tmv $TERMUX_PREFIX/etc/Muttrc.dist $TERMUX_PREFIX/etc/Muttrc\n}\n"
  },
  {
    "path": "packages/mutt/getdomain.c.patch",
    "content": "diff -u -r ../mutt-1.7.1/getdomain.c ./getdomain.c\n--- ../mutt-1.7.1/getdomain.c\t2016-10-08 15:30:21.000000000 -0400\n+++ ./getdomain.c\t2016-10-08 17:58:14.895654111 -0400\n@@ -46,7 +46,9 @@\n   hints.ai_family = AF_UNSPEC;\n \n   /* A DNS name can actually be only 253 octets, string is 256 */\n+#ifdef _SC_HOST_NAME_MAX\n   if ((node_len = sysconf(_SC_HOST_NAME_MAX)) == -1)\n+#endif\n     node_len = STRING;\n   node = safe_malloc(node_len + 1);\n   if (gethostname(node, node_len))\n"
  },
  {
    "path": "packages/mutt/init.c.patch",
    "content": "diff -u -r ../mutt-1.5.23/init.c ./init.c\n--- ../mutt-1.5.23/init.c\t2014-03-12 17:03:45.000000000 +0100\n+++ ./init.c\t2014-07-02 11:35:54.739985058 +0200\n@@ -3002,7 +3002,7 @@\n     MailcapPath = safe_strdup (\"~/.mailcap:\" PKGDATADIR \"/mailcap:\" SYSCONFDIR \"/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap\");\n   }\n \n-  Tempdir = safe_strdup ((p = getenv (\"TMPDIR\")) ? p : \"/tmp\");\n+  Tempdir = safe_strdup ((p = getenv (\"TMPDIR\")) ? p : \"@TERMUX_PREFIX@/tmp\");\n \n   p = getenv (\"VISUAL\");\n   if (!p)\n"
  },
  {
    "path": "packages/mutt/lib.c.patch",
    "content": "diff -u -r ../mutt-1.5.24/lib.c ./lib.c\n--- ../mutt-1.5.24/lib.c\t2015-08-30 13:06:38.000000000 -0400\n+++ ./lib.c\t2015-12-13 17:05:02.546904223 -0500\n@@ -445,6 +445,10 @@\n \n int safe_rename (const char *src, const char *target)\n {\n+#ifdef __ANDROID__\n+  /* Android (since 6.0) does not support hardlinks. */\n+  return rename(src, target);\n+#else\n   struct stat ssb, tsb;\n \n   if (!src || !target)\n@@ -537,6 +541,7 @@\n   \n \n   return 0;\n+#endif\n }\n \n \n"
  },
  {
    "path": "packages/mutt/muttlib.c.patch",
    "content": "diff -u -r ../mutt-1.5.23/muttlib.c ./muttlib.c\n--- ../mutt-1.5.23/muttlib.c\t2014-03-12 17:03:45.000000000 +0100\n+++ ./muttlib.c\t2014-07-02 04:15:09.652707991 +0200\n@@ -563,6 +563,9 @@\n \n char *mutt_gecos_name (char *dest, size_t destlen, struct passwd *pw)\n {\n+#ifdef __ANDROID__\n+  return NULL;\n+#else\n   regmatch_t pat_match[1];\n   size_t pwnl;\n   int idx;\n@@ -598,6 +601,7 @@\n   }\n       \n   return dest;\n+#endif\n }\n   \n \n"
  },
  {
    "path": "packages/mutt/smime_keys_path.patch",
    "content": "diff -u -r ../mutt-1.5.24/smime_keys.pl ./smime_keys.pl\n--- ../mutt-1.5.24/smime_keys.pl\t2015-08-30 13:06:38.000000000 -0400\n+++ ./smime_keys.pl\t2015-11-08 01:41:12.179119879 -0500\n@@ -76,7 +76,7 @@\n \n \n my $mutt = $ENV{MUTT_CMDLINE} || 'mutt';\n-my $opensslbin = \"/usr/bin/openssl\";\n+my $opensslbin = \"@TERMUX_PREFIX@/bin/openssl\";\n my $tmpdir;\n \n # Get the directories mutt uses for certificate/key storage.\n"
  },
  {
    "path": "packages/myrepos/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://myrepos.branchable.com/\nTERMUX_PKG_DESCRIPTION=\"Tool to manage all your version control repos\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.20180726\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://deb.debian.org/debian/pool/main/m/myrepos/myrepos_$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=9e9e4c114aae22e0aac51ecbc8d84ae617a5e5dfa979fab0d3bc42945f603f1e\nTERMUX_PKG_DEPENDS=\"git, perl\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"PREFIX=$TERMUX_PREFIX\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/nano/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.nano-editor.org/\nTERMUX_PKG_DESCRIPTION=\"Small, free and friendly text editor\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.6\nTERMUX_PKG_SRCURL=https://nano-editor.org/dist/latest/nano-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=9bac3a4153774fd921dd3eb291986d43985466b081165b5ac5262b37b79628e9\nTERMUX_PKG_DEPENDS=\"libandroid-support, libandroid-glob, ncurses\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_header_pwd_h=no\n--disable-libmagic\n--enable-utf8\n--with-wordbounds\n\"\nTERMUX_PKG_CONFFILES=\"etc/nanorc\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/rnano share/man/man1/rnano.1 share/nano/man-html\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n\tif $TERMUX_DEBUG; then\n\t\t# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:\n\t\t# /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'\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n\ntermux_step_post_make_install() {\n\t# Configure nano to use syntax highlighting:\n\tNANORC=$TERMUX_PREFIX/etc/nanorc\n\techo include \\\"$TERMUX_PREFIX/share/nano/\\*nanorc\\\" > $NANORC\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/nano 20\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/nano\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/nano/src-files.c.patch",
    "content": "diff -u -r ../nano-4.6/src/files.c ./src/files.c\n--- ../nano-4.6/src/files.c\t2019-11-29 10:12:07.000000000 +0000\n+++ ./src/files.c\t2019-12-01 16:31:03.622452000 +0000\n@@ -1359,7 +1359,7 @@\n \t\ttempdir = check_writable_directory(P_tmpdir);\n \n \tif (tempdir == NULL)\n-\t\ttempdir = copy_of(\"/tmp/\");\n+\t\ttempdir = copy_of(\"@TERMUX_PREFIX@/tmp/\");\n \n \ttempfile_name = charealloc(tempdir, strlen(tempdir) + 12);\n \tstrcat(tempfile_name, \"nano.XXXXXX\");\n"
  },
  {
    "path": "packages/nano/src-text.c.patch",
    "content": "diff -u -r ../nano-4.6/src/text.c ./src/text.c\n--- ../nano-4.6/src/text.c\t2019-11-29 10:12:07.000000000 +0000\n+++ ./src/text.c\t2019-12-01 16:32:08.956643000 +0000\n@@ -962,7 +962,7 @@\n \t\tconst char *theshell = getenv(\"SHELL\");\n \n \t\tif (theshell == NULL)\n-\t\t\ttheshell = (char *)\"/bin/sh\";\n+\t\t\ttheshell = (char *)\"@TERMUX_PREFIX@/bin/sh\";\n \n \t\t/* Child: close the unused read end of the output pipe. */\n \t\tclose(from_fd[0]);\n"
  },
  {
    "path": "packages/ncdc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://dev.yorhel.nl/ncdc\nTERMUX_PKG_DESCRIPTION=\"Modern and lightweight direct connect client with a friendly ncurses interface\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.22.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://dev.yorhel.nl/download/ncdc-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=d15fd378aa345f423e59a38691c668f69b516cd4b8afbbcdc446007740c3afad\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv, libgnutls, libsqlite, bzip2, glib, ncurses, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_configure() {\n\t# Cross compiling steps documented in ncdc README\n\tgcc $TERMUX_PKG_SRCDIR/deps/makeheaders.c -o makeheaders\n\tgcc -I. $TERMUX_PKG_SRCDIR/doc/gendoc.c -o gendoc\n\ttouch -d \"next hour\" makeheaders gendoc\n}\n"
  },
  {
    "path": "packages/ncdu/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://dev.yorhel.nl/ncdu\nTERMUX_PKG_DESCRIPTION=\"Disk usage analyzer\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.14.1\nTERMUX_PKG_SHA256=be31e0e8c13a0189f2a186936f7e298c6390ebdc573bb4a1330bc1fcbf56e13e\nTERMUX_PKG_SRCURL=https://dev.yorhel.nl/download/ncdu-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"ncurses, libandroid-support\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-shell=$TERMUX_PREFIX/bin/bash\"\n"
  },
  {
    "path": "packages/ncmpcpp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://rybczak.net/ncmpcpp/\nTERMUX_PKG_DESCRIPTION=\"NCurses Music Player Client (Plus Plus)\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.8.2\nTERMUX_PKG_REVISION=13\nTERMUX_PKG_SRCURL=https://rybczak.net/ncmpcpp/stable/ncmpcpp-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=650ba3e8089624b7ad9e4cc19bc1ac6028edb7523cc111fa1686ea44c0921554\nTERMUX_PKG_DEPENDS=\"fftw, boost, readline, libandroid-support, libc++, libcurl, libmpdclient, ncurses, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-visualizer --enable-outputs --enable-clock\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n\tCXXFLAGS+=\" -DNCURSES_WIDECHAR -U_XOPEN_SOURCE\"\n}\n"
  },
  {
    "path": "packages/ncmpcpp/config.patch",
    "content": "--- ../cache/ncmpcpp-8134e6e23b2787322fa10e65e44d286da82eea91/doc/config\t2017-04-23 02:24:57.000000000 +0000\n+++ ./doc/config\t2017-05-13 23:29:50.055629354 +0000\n@@ -49,7 +49,13 @@\n ## }\n ##\n #\n-#visualizer_fifo_path = /tmp/mpd.fifo\n+visualizer_fifo_path = \"@TERMUX_PREFIX@/tmp/mpd.fifo\"\n+visualizer_output_name = \"my_fifo\"\n+visualizer_sync_interval = \"30\"\n+visualizer_in_stereo = \"yes\"\n+visualizer_type = \"spectrum\"\n+visualizer_look = \"+|\"\n+\n #\n ##\n ## Note: Below parameter is needed for ncmpcpp to determine which output\n"
  },
  {
    "path": "packages/ncmpcpp/configure.ac.patch",
    "content": "--- ../cache/ncmpcpp-8134e6e23b2787322fa10e65e44d286da82eea91/configure.ac\t2017-04-23 02:24:57.000000000 +0000\n+++ ./configure.ac\t2017-05-06 00:32:15.468042009 +0000\n@@ -147,9 +147,9 @@\n fi\n \n # pthread\n-AC_CHECK_LIB(pthread, pthread_create, LIBS=\"$LIBS -lpthread\",\n-\tAC_MSG_ERROR([pthread library is required])\n-)\n+#AC_CHECK_LIB(pthread, pthread_create, LIBS=\"$LIBS -lboost_thread\",\n+#\tAC_MSG_ERROR([pthread library is required])\n+#)\n \n # ncursesw\n PKG_CHECK_MODULES([ncursesw], [ncursesw], [\n"
  },
  {
    "path": "packages/ncmpcpp/locale.patch",
    "content": "--- ../configure.ac.orig\t2019-04-13 16:42:43.319705874 +0000\n+++ ./configure.ac\t2019-04-13 16:42:50.146372491 +0000\n@@ -78,7 +78,7 @@\n AC_SUBST(BOOST_LOCALE_LDFLAGS)\n AC_SUBST(BOOST_LOCALE_LIBS)\n LDFLAGS=\"$LDFLAGS $BOOST_LOCALE_LDFLAGS\"\n-LIBS=\"$LIBS $BOOST_LOCALE_LIBS\"\n+LIBS=\"$LIBS $BOOST_LOCALE_LIBS -landroid-support\"\n \n BOOST_PROGRAM_OPTIONS\n AC_SUBST(BOOST_PROGRAM_OPTIONS_LDFLAGS)\n"
  },
  {
    "path": "packages/ncmpcpp/ncmpcpp.cpp.patch",
    "content": "--- ../cache/ncmpcpp-8134e6e23b2787322fa10e65e44d286da82eea91/src/ncmpcpp.cpp\t2017-04-23 02:24:57.000000000 +0000\n+++ ./src/ncmpcpp.cpp\t2017-04-30 03:20:01.848812572 +0000\n@@ -108,8 +108,8 @@\n \tcerr_buffer = std::cerr.rdbuf();\n \tstd::cerr.rdbuf(errorlog.rdbuf());\n \t\n-\tsigignore(SIGPIPE);\n+\t// sigignore(SIGPIPE);\n\tsignal(SIGWINCH, sighandler);\n \n \tMpd.setNoidleCallback(Status::update);\n \n"
  },
  {
    "path": "packages/ncmpcpp/settings.cpp.patch",
    "content": "--- ../cache/ncmpcpp-0.8/src/settings.cpp\t2017-05-21 14:10:48.000000000 +0000\n+++ ./src/settings.cpp\t2017-05-24 02:02:40.462100405 +0000\n@@ -265,17 +265,17 @@\n \t// keep the same order of variables as in configuration file\n \tp.add(\"ncmpcpp_directory\", &ncmpcpp_directory, \"~/.ncmpcpp/\", adjust_directory);\n \tp.add(\"lyrics_directory\", &lyrics_directory, \"~/.lyrics/\", adjust_directory);\n-\tp.add<void>(\"mpd_host\", nullptr, \"localhost\", [](std::string host) {\n+\tp.add<void>(\"mpd_host\", nullptr, \"@TERMUX_PREFIX@/var/run/mpd.socket\", [](std::string host) {\n \t\t\texpand_home(host);\n \t\t\tMpd.SetHostname(host);\n \t\t});\n \tp.add<void>(\"mpd_port\", nullptr, \"6600\", [](std::string port) {\n \t\t\tMpd.SetPort(verbose_lexical_cast<unsigned>(port));\n \t\t});\n-\tp.add(\"mpd_music_dir\", &mpd_music_dir, \"~/music\", adjust_directory);\n+\tp.add(\"mpd_music_dir\", &mpd_music_dir, \"/sdcard/Music\", adjust_directory);\n \tp.add(\"mpd_connection_timeout\", &mpd_connection_timeout, \"5\");\n \tp.add(\"mpd_crossfade_time\", &crossfade_time, \"5\");\n-\tp.add(\"visualizer_fifo_path\", &visualizer_fifo_path, \"/tmp/mpd.fifo\", adjust_path);\n+\tp.add(\"visualizer_fifo_path\", &visualizer_fifo_path, \"@TERMUX_PREFIX@/var/run/mpd.fifo\", adjust_path);\n \tp.add(\"visualizer_output_name\", &visualizer_output_name, \"Visualizer feed\");\n \tp.add(\"visualizer_in_stereo\", &visualizer_in_stereo, \"yes\", yes_no);\n \tp.add(\"visualizer_sync_interval\", &visualizer_sync_interval, \"30\",\n"
  },
  {
    "path": "packages/ncompress/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/vapier/ncompress\nTERMUX_PKG_DESCRIPTION=\"The classic unix compression utility which can handle the ancient .Z archive\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=4.2.4.6\nTERMUX_PKG_SRCURL=https://github.com/vapier/ncompress/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=112acfc76382e7b631d6cfc8e6ff9c8fd5b3677e5d49d3d9f1657bc15ad13d13\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tmkdir -p \"$TERMUX_PREFIX\"/share/man/man1/\n\tinstall -Dm700 compress \"$TERMUX_PREFIX\"/bin/\n\tinstall -Dm600 compress.1 \"$TERMUX_PREFIX\"/share/man/man1/\n}"
  },
  {
    "path": "packages/ncurses/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://invisible-island.net/ncurses/\nTERMUX_PKG_DESCRIPTION=\"Library for text-based user interfaces in a terminal-independent manner\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=(6.1.20190928\n\t\t    9.22\n\t\t    15)\nTERMUX_PKG_SHA256=(a607b171152c04a01f3b784d83f19b877cb9a63d7c5c7e2005424b48a24ccd5e\n\t\t   e94628e9bcfa0adb1115d83649f898d6edb4baced44f5d5b769c2eeb8b95addd\n\t\t   3ae9ebef28aad081c6c11351f086776e2fd9547563b2f900732b41c376bec05a)\nTERMUX_PKG_SRCURL=(https://dl.bintray.com/termux/upstream/ncurses-${TERMUX_PKG_VERSION:0:3}-${TERMUX_PKG_VERSION:4}.tgz\n\t\t   https://fossies.org/linux/misc/rxvt-unicode-${TERMUX_PKG_VERSION[1]}.tar.bz2\n\t\t   https://github.com/thestinger/termite/archive/v${TERMUX_PKG_VERSION[2]}.tar.gz)\n\n# ncurses-utils: tset/reset/clear are moved to package 'ncurses'.\nTERMUX_PKG_BREAKS=\"ncurses-dev, ncurses-utils (<< 6.1.20190511-4)\"\nTERMUX_PKG_REPLACES=\"ncurses-dev, ncurses-utils (<< 6.1.20190511-4)\"\n\n# --disable-stripping to disable -s argument to install which does not work when cross compiling:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_header_locale_h=no\n--disable-stripping\n--enable-const\n--enable-ext-colors\n--enable-ext-mouse\n--enable-overwrite\n--enable-pc-files\n--enable-termcap\n--enable-widec\n--mandir=$TERMUX_PREFIX/share/man\n--without-ada\n--without-cxx-binding\n--without-debug\n--without-tests\n--with-normal\n--with-static\n--with-shared\n--with-termpath=$TERMUX_PREFIX/etc/termcap:$TERMUX_PREFIX/share/misc/termcap\n\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nshare/man/man5\nshare/man/man7\n\"\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --with-pkg-config-libdir=$PKG_CONFIG_LIBDIR\"\n}\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PREFIX/lib\n\n\t# Ncursesw/Ncurses compatibility symlinks.\n\tfor lib in form menu ncurses panel; do\n\t\tln -sfr lib${lib}w.so.${TERMUX_PKG_VERSION:0:3} lib${lib}.so.${TERMUX_PKG_VERSION:0:3}\n\t\tln -sfr lib${lib}w.so.${TERMUX_PKG_VERSION:0:3} lib${lib}.so.${TERMUX_PKG_VERSION:0:1}\n\t\tln -sfr lib${lib}w.so.${TERMUX_PKG_VERSION:0:3} lib${lib}.so\n\t\tln -sfr lib${lib}w.a lib${lib}.a\n\t\t(cd pkgconfig; ln -sf ${lib}w.pc $lib.pc)\n\tdone\n\n\t# Legacy compatibility symlinks (libcurses, libtermcap, libtic, libtinfo).\n\tfor lib in curses termcap tic tinfo; do\n\t\tln -sfr libncursesw.so.${TERMUX_PKG_VERSION:0:3} lib${lib}.so.${TERMUX_PKG_VERSION:0:3}\n\t\tln -sfr libncursesw.so.${TERMUX_PKG_VERSION:0:3} lib${lib}.so.${TERMUX_PKG_VERSION:0:1}\n\t\tln -sfr libncursesw.so.${TERMUX_PKG_VERSION:0:3} lib${lib}.so\n\t\tln -sfr libncursesw.a lib${lib}.a\n\t\t(cd pkgconfig; ln -sfr ncursesw.pc ${lib}.pc)\n\tdone\n\n\t# Some packages want these:\n\tcd $TERMUX_PREFIX/include/\n\trm -Rf ncurses{,w}\n\tmkdir ncurses{,w}\n\tln -s ../{ncurses.h,termcap.h,panel.h,unctrl.h,menu.h,form.h,tic.h,nc_tparm.h,term.h,eti.h,term_entry.h,ncurses_dll.h,curses.h} ncurses\n\tln -s ../{ncurses.h,termcap.h,panel.h,unctrl.h,menu.h,form.h,tic.h,nc_tparm.h,term.h,eti.h,term_entry.h,ncurses_dll.h,curses.h} ncursesw\n}\n\ntermux_step_post_massage() {\n\t# Strip away 30 years of cruft to decrease size.\n\tlocal TI=$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/share/terminfo\n\tmv $TI $TERMUX_PKG_TMPDIR/full-terminfo\n\tmkdir -p $TI/{a,d,e,n,l,p,r,s,t,v,x}\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/a/ansi $TI/a/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/d/{dtterm,dumb} $TI/d/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/e/eterm-color $TI/e/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/n/nsterm $TI/n/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/l/linux $TI/l/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/p/putty{,-256color} $TI/p/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/r/rxvt{,-256color} $TI/r/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/s/{screen{,2,-256color},st{,-256color}} $TI/s/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/t/tmux{,-256color} $TI/t/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/v/{vt52,vt100,vt102} $TI/v/\n\tcp $TERMUX_PKG_TMPDIR/full-terminfo/x/xterm{,-color,-new,-16color,-256color,+256color} $TI/x/\n\n\ttic -x -o $TI $TERMUX_PKG_SRCDIR/rxvt-unicode-${TERMUX_PKG_VERSION[1]}/doc/etc/rxvt-unicode.terminfo\n\ttic -x -o $TI $TERMUX_PKG_SRCDIR/termite-${TERMUX_PKG_VERSION[2]}/termite.terminfo\n}\n"
  },
  {
    "path": "packages/ncurses/fix-paths.patch",
    "content": "diff -uNr ncurses-6.1-20181117/progs/tic.c ncurses-6.1-20181117.mod/progs/tic.c\n--- ncurses-6.1-20181117/progs/tic.c\t2018-03-18 02:05:10.000000000 +0200\n+++ ncurses-6.1-20181117.mod/progs/tic.c\t2019-03-01 20:40:56.193173489 +0200\n@@ -386,7 +386,7 @@\n {\n     FILE *result = 0;\n \n-    _nc_STRCPY(filename, \"/tmp/XXXXXX\", PATH_MAX);\n+    _nc_STRCPY(filename, \"@TERMUX_PREFIX@/tmp/XXXXXX\", PATH_MAX);\n #if HAVE_MKSTEMP\n     {\n \tint oldmask = (int) umask(077);\n@@ -900,7 +900,7 @@\n     } else {\n \tif (infodump == TRUE) {\n \t    /* captoinfo's no-argument case */\n-\t    source_file = \"/etc/termcap\";\n+\t    source_file = \"@TERMUX_PREFIX@/etc/termcap\";\n \t    if ((termcap = getenv(\"TERMCAP\")) != 0\n \t\t&& (namelst = make_namelist(getenv(\"TERM\"))) != 0) {\n \t\tif (access(termcap, F_OK) == 0) {\ndiff -uNr ncurses-6.1-20181117/progs/tset.c ncurses-6.1-20181117.mod/progs/tset.c\n--- ncurses-6.1-20181117/progs/tset.c\t2017-10-08 03:01:29.000000000 +0300\n+++ ncurses-6.1-20181117.mod/progs/tset.c\t2019-03-01 20:40:15.049476720 +0200\n@@ -566,8 +566,8 @@\n \t    goto map;\n \t}\n #else\n-\tif ((fp = fopen(\"/etc/ttytype\", \"r\")) != 0\n-\t    || (fp = fopen(\"/etc/ttys\", \"r\")) != 0) {\n+\tif ((fp = fopen(\"@TERMUX_PREFIX@/etc/ttytype\", \"r\")) != 0\n+\t    || (fp = fopen(\"@TERMUX_PREFIX@/etc/ttys\", \"r\")) != 0) {\n \t    char buffer[BUFSIZ];\n \t    char *s, *t, *d;\n \n"
  },
  {
    "path": "packages/ncurses/ncurses-tinfo-lib_setup.c.patch",
    "content": "diff -u -r ../src-patched/ncurses/tinfo/lib_setup.c ./ncurses/tinfo/lib_setup.c\n--- ../src-patched/ncurses/tinfo/lib_setup.c\t2015-07-11 10:03:50.340357853 -0400\n+++ ./ncurses/tinfo/lib_setup.c\t2015-07-11 14:42:01.049867165 -0400\n@@ -352,21 +352,6 @@\n \t\t    _nc_setenv_num(\"COLUMNS\", *colp);\n \t\t}\n \t    }\n-\n-\t    /*\n-\t     * Finally, look for environment variables.\n-\t     *\n-\t     * Solaris lets users override either dimension with an environment\n-\t     * variable.\n-\t     */\n-\t    if ((value = _nc_getenv_num(\"LINES\")) > 0) {\n-\t\t*linep = value;\n-\t\tT((\"screen size: environment LINES = %d\", *linep));\n-\t    }\n-\t    if ((value = _nc_getenv_num(\"COLUMNS\")) > 0) {\n-\t\t*colp = value;\n-\t\tT((\"screen size: environment COLUMNS = %d\", *colp));\n-\t    }\n \t}\n \n \t/* if we can't get dynamic info about the size, use static */\n"
  },
  {
    "path": "packages/ncurses/ncurses-tinfo-tinfo_driver.c.patch",
    "content": "diff -u -r ../src-patched/ncurses/tinfo/tinfo_driver.c ./ncurses/tinfo/tinfo_driver.c\n--- ../src-patched/ncurses/tinfo/tinfo_driver.c\t2015-07-11 10:03:50.340357853 -0400\n+++ ./ncurses/tinfo/tinfo_driver.c\t2015-07-11 10:04:02.836153796 -0400\n@@ -417,21 +417,6 @@\n \t\t    _nc_setenv_num(\"COLUMNS\", *colp);\n \t\t}\n \t    }\n-\n-\t    /*\n-\t     * Finally, look for environment variables.\n-\t     *\n-\t     * Solaris lets users override either dimension with an environment\n-\t     * variable.\n-\t     */\n-\t    if ((value = _nc_getenv_num(\"LINES\")) > 0) {\n-\t\t*linep = value;\n-\t\tT((\"screen size: environment LINES = %d\", *linep));\n-\t    }\n-\t    if ((value = _nc_getenv_num(\"COLUMNS\")) > 0) {\n-\t\t*colp = value;\n-\t\tT((\"screen size: environment COLUMNS = %d\", *colp));\n-\t    }\n \t}\n \n \t/* if we can't get dynamic info about the size, use static */\n"
  },
  {
    "path": "packages/ncurses/ncurses-ui-libs-static.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/libform*.a lib/libmenu*.a lib/libpanel*.a\"\nTERMUX_SUBPKG_DESCRIPTION=\"Static libraries for terminal user interfaces based on ncurses\"\n"
  },
  {
    "path": "packages/ncurses/ncurses-ui-libs.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/libform*.so* lib/libmenu*.so* lib/libpanel*.so*\"\nTERMUX_SUBPKG_DESCRIPTION=\"Libraries for terminal user interfaces based on ncurses\"\n"
  },
  {
    "path": "packages/ncurses/ncurses-utils.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"\nbin/captoinfo\nbin/infotocap\nbin/toe\nbin/tput\nbin/tabs\nbin/infocmp\nbin/tic\nshare/man/man1/captoinfo.1.gz\nshare/man/man1/infotocap.1.gz\nshare/man/man1/toe.1.gz\nshare/man/man1/tput.1.gz\nshare/man/man1/tabs.1.gz\nshare/man/man1/infocmp.1.gz\nshare/man/man1/tic.1.gz\n\"\nTERMUX_SUBPKG_DESCRIPTION=\"Tools for working with terminals\"\n"
  },
  {
    "path": "packages/ndk-multilib/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html\nTERMUX_PKG_DESCRIPTION=\"Multilib binaries for cross-compilation\"\nTERMUX_PKG_LICENSE=\"NCSA\"\nTERMUX_PKG_VERSION=$TERMUX_NDK_VERSION\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_NO_STATICSPLIT=true\n\nprepare_libs() {\n\tlocal ARCH=\"$1\"\n\tlocal SUFFIX=\"$2\"\n\tlocal NDK_SUFFIX=$SUFFIX\n\n\tif [ $ARCH = x86 ] || [ $ARCH = x86_64 ]; then\n\t    NDK_SUFFIX=$ARCH\n\tfi\n\n\tmkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib\n\tlocal BASEDIR=$NDK/platforms/android-${TERMUX_PKG_API_LEVEL}/arch-$ARCH/usr/lib\n\tif [ $ARCH = x86_64 ]; then BASEDIR+=\"64\"; fi\n\tcp $BASEDIR/*.o $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib\n\tcp $BASEDIR/lib{c,dl,log,m}.so $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib\n\tcp $BASEDIR/lib{c,dl,m}.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib\n\tcp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/${SUFFIX}/libc++_shared.so $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib\n\tcp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/${SUFFIX}/lib{c++_static,c++abi}.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib\n\techo 'INPUT(-lc++_static -lc++abi)' > $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib/libc++_shared.a\n\n\tLIBATOMIC=$NDK/toolchains/${NDK_SUFFIX}-*/prebuilt/linux-*/${SUFFIX}/lib\n\tif [ $ARCH = \"arm64\" ] || [ $ARCH = \"x86_64\" ]; then LIBATOMIC+=\"64\"; fi\n\tif [ $ARCH = \"arm\" ]; then LIBATOMIC+=\"/armv7-a\"; fi\n\tcp $LIBATOMIC/libatomic.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib/\n\n\tLIBGCC=$NDK/toolchains/${NDK_SUFFIX}-*/prebuilt/linux-*/lib/gcc/${SUFFIX}/4.9.x\n\tif [ $ARCH = \"arm\" ]; then LIBGCC+=\"/armv7-a\"; fi\n\tcp $LIBGCC/libgcc.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib/\n}\n\ntermux_step_extract_into_massagedir() {\n\tprepare_libs \"arm\" \"arm-linux-androideabi\"\n\tprepare_libs \"arm64\" \"aarch64-linux-android\"\n\tprepare_libs \"x86\" \"i686-linux-android\"\n\tprepare_libs \"x86_64\" \"x86_64-linux-android\"\n}\n"
  },
  {
    "path": "packages/ndk-sysroot/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html\nTERMUX_PKG_DESCRIPTION=\"System header and library files from the Android NDK needed for compiling C programs\"\nTERMUX_PKG_LICENSE=\"NCSA\"\nTERMUX_PKG_VERSION=$TERMUX_NDK_VERSION\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\n# This package has taken over <pty.h> from the previous libutil-dev\n# and iconv.h from libandroid-support-dev:\nTERMUX_PKG_CONFLICTS=\"libutil-dev, libgcc, libandroid-support-dev\"\nTERMUX_PKG_REPLACES=\"libutil-dev, libgcc, libandroid-support-dev, ndk-stl\"\nTERMUX_PKG_NO_STATICSPLIT=true\n\ntermux_step_extract_into_massagedir() {\n\tmkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib \\\n\t\t$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include\n\n\tcp -Rf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/* \\\n\t\t$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include\n\n\tpatch -d $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1  -p1 < $TERMUX_PKG_BUILDER_DIR/math-header.diff\n\n\tcp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/*.o \\\n\t\t$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib\n\n\tlocal LIBATOMIC_PATH=$TERMUX_STANDALONE_TOOLCHAIN/$TERMUX_HOST_PLATFORM/lib\n\tif [ $TERMUX_ARCH_BITS = 64 ]; then LIBATOMIC_PATH+=\"64\"; fi\n\tif [ $TERMUX_ARCH = \"arm\" ]; then LIBATOMIC_PATH+=\"/armv7-a\"; fi\n\tLIBATOMIC_PATH+=\"/libatomic.a\"\n\tcp $LIBATOMIC_PATH $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/\n\n\tlocal LIBGCC_PATH=$TERMUX_STANDALONE_TOOLCHAIN/lib/gcc/$TERMUX_HOST_PLATFORM/4.9.x\n\tif [ $TERMUX_ARCH = \"arm\" ]; then LIBGCC_PATH+=\"/armv7-a\"; fi\n\tcp $LIBGCC_PATH/* -r $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/\n\tcp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libcompiler_rt-extras.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/\n\t# librt and libpthread are built into libc on android, so setup them as symlinks\n\t# to libc for compatibility with programs that users try to build:\n\tlocal _SYSTEM_LIBDIR=/system/lib64\n\tif [ $TERMUX_ARCH_BITS = 32 ]; then _SYSTEM_LIBDIR=/system/lib; fi\n\tmkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib\n\tcd $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\trm thumb -rf\n\t\tcp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/libunwind.a .\n\tfi\n\n\tfor lib in librt.so libpthread.so libutil.so; do\n\t\techo 'INPUT(-lc)' > $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/$lib\n\tdone\n\tunset lib\n}\n"
  },
  {
    "path": "packages/ndk-sysroot/math-header.diff",
    "content": "--- data/data/com.termux/files/usr/include/c++/v1/cmath.orig\t2019-03-24 00:31:49.512145195 +0000\n+++ ./cmath\t2019-03-24 00:32:19.392703442 +0000\n@@ -302,7 +302,7 @@\n */\n \n #include <__config>\n-#include <math.h>\n+#include <c++/v1/math.h>\n #include \"version\"\n \n #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n--- data/data/com.termux/files/usr/include/c++/v1/math.h.orig\t2019-03-24 01:10:28.881807799 +0000\n+++ ./math.h\t2019-03-24 01:11:01.078384393 +0000\n@@ -298,7 +298,7 @@\n #pragma GCC system_header\n #endif\n \n-#include_next <math.h>\n+#include \"../../math.h\"\n \n #ifdef __cplusplus\n \n"
  },
  {
    "path": "packages/ne/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://ne.di.unimi.it/\nTERMUX_PKG_DESCRIPTION=\"Easy-to-use and powerful text editor\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"David Martínez @vaites\"\nTERMUX_PKG_VERSION=3.2.1\nTERMUX_PKG_SRCURL=https://github.com/vigna/ne/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=6b9324d9a4c3deef02f4ecf75407f5b5ed4e68a3bb4af3f9c1ea19dc628f9b5d\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"info/\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\texport OPTS=\"$CFLAGS $CPPFLAGS\"\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/ne 15\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/ne\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/neofetch/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/dylanaraps/neofetch\nTERMUX_PKG_DESCRIPTION=\"Simple system information script\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Muhammad Herdiansyah @konimex\"\nTERMUX_PKG_VERSION=6.1.0\nTERMUX_PKG_SHA256=ece351e35286b64d362000d409b27597fcbdcf77e8e60fa0adae1f29d3c29637\nTERMUX_PKG_SRCURL=https://github.com/dylanaraps/neofetch/archive/${TERMUX_PKG_VERSION}/neofetch-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"bash\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"PREFIX=$TERMUX_PREFIX SYSCONFDIR=$TERMUX_PREFIX/etc\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/neovim/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://neovim.io/\nTERMUX_PKG_DESCRIPTION=\"Ambitious Vim-fork focused on extensibility and agility (nvim)\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.4.3\nTERMUX_PKG_SHA256=91a0b5d32204a821bf414690e6b48cf69224d1961d37158c2b383f6a6cf854d2\nTERMUX_PKG_SRCURL=https://github.com/neovim/neovim/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libiconv, libuv, luv, libmsgpack, libandroid-support, libvterm, libtermkey, liblua, libunibilium\"\nTERMUX_PKG_HOSTBUILD=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DENABLE_JEMALLOC=OFF\n-DGETTEXT_MSGFMT_EXECUTABLE=$(which msgfmt)\n-DGETTEXT_MSGMERGE_EXECUTABLE=$(which msgmerge)\n-DGPERF_PRG=$TERMUX_PKG_HOSTBUILD_DIR/deps/usr/bin/gperf\n-DLUA_PRG=$TERMUX_PKG_HOSTBUILD_DIR/deps/usr/bin/luajit\n-DPKG_CONFIG_EXECUTABLE=$(which pkg-config)\n-DXGETTEXT_PRG=$(which xgettext)\n-DPREFER_LUA=ON\n-DLUA_INCLUDE_DIR=$TERMUX_PREFIX/include\n\"\nTERMUX_PKG_CONFFILES=\"share/nvim/sysinit.vim\"\n\ntermux_step_host_build() {\n\ttermux_setup_cmake\n\n\tmkdir -p $TERMUX_PKG_HOSTBUILD_DIR/deps\n\tcd $TERMUX_PKG_HOSTBUILD_DIR/deps\n\tcmake $TERMUX_PKG_SRCDIR/third-party\n\tmake -j 1\n\n\tcd $TERMUX_PKG_SRCDIR\n\tmake CMAKE_EXTRA_FLAGS=\"-DCMAKE_INSTALL_PREFIX=$TERMUX_PKG_HOSTBUILD_DIR -DUSE_BUNDLED_LUAROCKS=ON\" install\n\tmake distclean\n\trm -Rf build/\n}\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" -DLUA_MATH_LIBRARY=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libm.so\"\n}\n\ntermux_step_post_make_install() {\n\tlocal _CONFIG_DIR=$TERMUX_PREFIX/share/nvim\n\tmkdir -p $_CONFIG_DIR\n\tcp $TERMUX_PKG_BUILDER_DIR/sysinit.vim $_CONFIG_DIR/\n}\n"
  },
  {
    "path": "packages/neovim/runtime-CMakeLists.txt.patch",
    "content": "diff -u -r ../neovim-0.3.2/runtime/CMakeLists.txt ./runtime/CMakeLists.txt\n--- ../neovim-0.3.2/runtime/CMakeLists.txt\t2018-12-31 00:06:17.000000000 +0000\n+++ ./runtime/CMakeLists.txt\t2019-01-03 00:07:55.652628776 +0000\n@@ -32,7 +32,7 @@\n     add_custom_target(\"${PACKNAME}-tags\"\n       COMMAND ${CMAKE_COMMAND} -E copy_directory\n         ${PACKAGE} ${GENERATED_PACKAGE_DIR}/${PACKNAME}\n-      COMMAND \"${PROJECT_BINARY_DIR}/bin/nvim\"\n+      COMMAND \"${PROJECT_BINARY_DIR}/../host-build/bin/nvim\"\n         -u NONE -i NONE -e --headless -c \"helptags doc\" -c quit\n       DEPENDS\n         nvim\n@@ -71,7 +71,7 @@\n   COMMAND ${CMAKE_COMMAND} -E remove doc/*\n   COMMAND ${CMAKE_COMMAND} -E copy_directory\n     ${PROJECT_SOURCE_DIR}/runtime/doc doc\n-  COMMAND \"${PROJECT_BINARY_DIR}/bin/nvim\"\n+  COMMAND \"${PROJECT_BINARY_DIR}/../host-build/bin/nvim\"\n     -u NONE -i NONE -e --headless -c \"helptags ++t doc\" -c quit\n   DEPENDS\n     nvim\n"
  },
  {
    "path": "packages/neovim/runtime-autoload-man.vim.patch",
    "content": "diff -u -r ../neovim-0851057a8deaa1197bd0af22babb62c1146d836c/runtime/autoload/man.vim ./runtime/autoload/man.vim\n--- ../neovim-0851057a8deaa1197bd0af22babb62c1146d836c/runtime/autoload/man.vim\t2018-02-04 12:54:30.000000000 +0000\n+++ ./runtime/autoload/man.vim\t2018-02-05 00:48:37.422608665 +0000\n@@ -149,7 +149,7 @@\n   \" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).\n   \" http://comments.gmane.org/gmane.editors.vim.devel/29085\n   \" Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces.\n-  let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'MAN_KEEP_FORMATTING=1', 'man']\n+  let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'MAN_KEEP_FORMATTING=1', 'mandoc']\n   return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path]))\n endfunction\n \n"
  },
  {
    "path": "packages/neovim/runtime-autoload-provider-clipboard.vim.patch",
    "content": "diff -u -r ../neovim-b57d9a4ff08fc1ef8db79d422b441b792493ff4e/runtime/autoload/provider/clipboard.vim ./runtime/autoload/provider/clipboard.vim\n--- ../neovim-b57d9a4ff08fc1ef8db79d422b441b792493ff4e/runtime/autoload/provider/clipboard.vim\t2017-11-25 22:22:46.000000000 +0000\n+++ ./runtime/autoload/provider/clipboard.vim\t2017-11-25 22:51:34.076263411 +0000\n@@ -103,6 +103,12 @@\n     let s:copy['*'] = s:copy['+']\n     let s:paste['*'] = s:paste['+']\n     return 'win32yank'\n+  elseif executable('termux-clipboard-set')\n+    let s:copy['+'] = 'termux-clipboard-set'\n+    let s:paste['+'] = 'termux-clipboard-get'\n+    let s:copy['*'] = s:copy['+']\n+    let s:paste['*'] = s:paste['+']\n+    return 'termux-clipboard'\n   elseif exists('$TMUX') && executable('tmux')\n     let s:copy['+'] = 'tmux load-buffer -'\n     let s:paste['+'] = 'tmux save-buffer -'\n"
  },
  {
    "path": "packages/neovim/src-nvim-os-stdpaths.c.patch",
    "content": "diff -u -r ../neovim-master/src/nvim/os/stdpaths.c ./src/nvim/os/stdpaths.c\n--- ../neovim-master/src/nvim/os/stdpaths.c\t2015-11-01 16:16:38.000000000 -0500\n+++ ./src/nvim/os/stdpaths.c\t2015-11-02 14:12:12.770172673 -0500\n@@ -34,8 +34,8 @@\n   [kXDGDataHome] = \"~/.local/share\",\n   [kXDGCacheHome] = \"~/.cache\",\n   [kXDGRuntimeDir] = NULL,\n-  [kXDGConfigDirs] = \"/etc/xdg/\",\n-  [kXDGDataDirs] = \"/usr/local/share/:/usr/share/\",\n+  [kXDGConfigDirs] = \"@TERMUX_PREFIX@/etc/xdg/\",\n+  [kXDGDataDirs] = \"@TERMUX_PREFIX@/usr/local/share/:@TERMUX_PREFIX@/usr/share/\",\n #endif\n };\n \n"
  },
  {
    "path": "packages/neovim/sysinit.vim",
    "content": "\" Scroll only one line for mouse wheel events to get smooth scrolling on touch screens\nset mouse=a\nmap <ScrollWheelUp> <C-Y>\nimap <ScrollWheelUp> <C-X><C-Y>\nmap <ScrollWheelDown> <C-E>\nimap <ScrollWheelDown> <C-X><C-E>\n"
  },
  {
    "path": "packages/net-tools/arp.c.patch",
    "content": "diff -uNr net-tools/arp.c net-tools.mod/arp.c\n--- net-tools/arp.c\t2017-02-21 20:24:32.000000000 +0200\n+++ net-tools.mod/arp.c\t2019-03-01 19:05:20.555355036 +0200\n@@ -644,7 +644,7 @@\n     fprintf(stderr, _(\"        -i, --device             specify network interface (e.g. eth0)\\n\"));\n     fprintf(stderr, _(\"        -D, --use-device         read <hwaddr> from given device\\n\"));\n     fprintf(stderr, _(\"        -A, -p, --protocol       specify protocol family\\n\"));\n-    fprintf(stderr, _(\"        -f, --file               read new entries from file or from /etc/ethers\\n\\n\"));\n+    fprintf(stderr, _(\"        -f, --file               read new entries from file or from $PREFIX/etc/ethers\\n\\n\"));\n \n     fprintf(stderr, _(\"  <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\\n\"), DFLT_HW);\n     fprintf(stderr, _(\"  List of possible hardware types (which support ARP):\\n\"));\n@@ -791,7 +791,7 @@\n \tbreak;\n \n     case 2:\t\t\t/* process an EtherFile */\n-\twhat = arp_file(argv[optind] ? argv[optind] : \"/etc/ethers\");\n+\twhat = arp_file(argv[optind] ? argv[optind] : \"@TERMUX_PREFIX@/etc/ethers\");\n \tbreak;\n \n     case 3:\t\t\t/* delete an ARP entry from the cache */\n"
  },
  {
    "path": "packages/net-tools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://net-tools.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Configuration tools for Linux networking\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.60.2017.02.21\nTERMUX_PKG_REVISION=2\nlocal commit=479bb4a7e11a4084e2935c0a576388f92469225b\nTERMUX_PKG_SHA256=7e9f8e8dcbabed0c8eeb976100496567abae7ac9d92c72cebd1a9d965473e943\n# We use a mirror to avoid using\n# https://sourceforge.net/code-snapshots/git/n/ne/net-tools/code.git/net-tools-code-$commit.zip\n# which does not work all the time (sourceforge caching system):\nTERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/net-tools-code-${commit}.zip\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"BINDIR=$TERMUX_PREFIX/bin SBINDIR=$TERMUX_PREFIX/bin HAVE_HOSTNAME_TOOLS=0\"\n\ntermux_step_configure() {\n\tCFLAGS=\"$CFLAGS -D_LINUX_IN6_H -Dindex=strchr -Drindex=strrchr\"\n\texport LDLIBS=\"-llog\"\n\tsed -i \"s#/usr#$TERMUX_PREFIX#\" $TERMUX_PKG_SRCDIR/man/Makefile\n\tyes \"\" | make config || true\n}\n\ntermux_step_make_install() {\n\tmake $TERMUX_PKG_EXTRA_MAKE_ARGS update\n}\n"
  },
  {
    "path": "packages/net-tools/ifconfig.c.patch",
    "content": "--- ./ifconfig.c\t2017-02-21 23:54:32.000000000 +0530\n+++ ../ifconfig.c\t2017-04-09 14:12:07.253003297 +0530\n@@ -44,6 +44,7 @@\n #include <string.h>\n #include <unistd.h>\n #include <netdb.h>\n+#include <arpa/inet.h>\n \n /* Ugh.  But libc5 doesn't provide POSIX types.  */\n #include <asm/types.h>\n"
  },
  {
    "path": "packages/net-tools/lib-inet.c.patch",
    "content": "--- ./lib/inet.c\t2017-02-21 23:54:32.000000000 +0530\n+++ ../inet.c\t2017-04-09 14:43:19.639365853 +0530\n@@ -414,6 +414,7 @@\n \t}\n     }\n     endservent();\n+#if 0\n     setprotoent(1);\n     while ((pe = getprotoent())) {\n \t/* Allocate a service entry. */\n@@ -423,6 +424,7 @@\n \tadd2list(&raw_name, item);\n     }\n     endprotoent();\n+#endif\n     return (0);\n }\n \n"
  },
  {
    "path": "packages/net-tools/lib-inet6.c.patch",
    "content": "--- ./lib/inet6.c\t2017-02-21 23:54:32.000000000 +0530\n+++ ../inet6.c\t2017-04-09 14:01:12.215538103 +0530\n@@ -46,7 +46,7 @@\n \n static char *fix_v4_address(char *buf, const struct in6_addr *in6)\n {\n-\tif (IN6_IS_ADDR_V4MAPPED(in6->s6_addr)) {\n+\tif (IN6_IS_ADDR_V4MAPPED(in6)) {\n \t\t\tchar *s =strchr(buf, '.');\n \t\t\tif (s) {\n \t\t\t\twhile (s > buf && *s != ':')\n"
  },
  {
    "path": "packages/net-tools/lib-inet6_sr.c.patch",
    "content": "--- ./lib/inet6_sr.c\t2017-02-21 23:54:32.000000000 +0530\n+++ ../inet6_sr.c\t2017-04-09 14:07:22.352743997 +0530\n@@ -35,6 +35,7 @@\n #include \"intl.h\"\n #include \"net-features.h\"\n #include \"util.h\"\n+#include <linux/ipv6_route.h>\n \n \n extern struct aftype inet6_aftype;\n"
  },
  {
    "path": "packages/net-tools/lib-pathnames.h.patch",
    "content": "diff -uNr net-tools/lib/pathnames.h net-tools.mod/lib/pathnames.h\n--- net-tools/lib/pathnames.h\t2017-02-21 20:24:32.000000000 +0200\n+++ net-tools.mod/lib/pathnames.h\t2019-03-01 19:05:45.935478227 +0200\n@@ -47,7 +47,7 @@\n #define _PATH_PROCNET_IFINET6\t\t\"/proc/net/if_inet6\"\n #define _PATH_PROCNET_DEV\t\t\"/proc/net/dev\"\n #define _PATH_PROCNET_RARP\t\t\"/proc/net/rarp\"\n-#define _PATH_ETHERS\t\t\t\"/etc/ethers\"\n+#define _PATH_ETHERS\t\t\t\"@TERMUX_PREFIX@/etc/ethers\"\n #define _PATH_PROCNET_ROSE\t\t\"/proc/net/rose\"\n #define _PATH_PROCNET_ROSE_NEIGH\t\"/proc/net/rose_neigh\"\n #define _PATH_PROCNET_ROSE_NODES\t\"/proc/net/rose_nodes\"\n"
  },
  {
    "path": "packages/net-tools/nameif.c.patch",
    "content": "diff -uNr net-tools/nameif.c net-tools.mod/nameif.c\n--- net-tools/nameif.c\t2017-02-21 20:24:32.000000000 +0200\n+++ net-tools.mod/nameif.c\t2019-03-01 19:02:26.447822359 +0200\n@@ -10,7 +10,7 @@\n #endif\n #include <stdio.h>\n #include <getopt.h>\n-#include <sys/syslog.h>\n+#include <syslog.h>\n #include <errno.h>\n #include <stdlib.h>\n #include <ctype.h>\n@@ -25,7 +25,7 @@\n #include \"net-support.h\"\n #include \"util.h\"\n \n-const char default_conf[] = \"/etc/mactab\";\n+const char default_conf[] = \"@TERMUX_PREFIX@/etc/mactab\";\n const char *fname = default_conf;\n int use_syslog;\n int ctl_sk = -1;\n"
  },
  {
    "path": "packages/net-tools/rarp.c.patch",
    "content": "diff -uNr net-tools/rarp.c net-tools.mod/rarp.c\n--- net-tools/rarp.c\t2017-02-21 20:24:32.000000000 +0200\n+++ net-tools.mod/rarp.c\t2019-03-01 19:06:09.028923071 +0200\n@@ -178,7 +178,7 @@\n     fprintf(stderr, _(\"Usage: rarp -a                               list entries in cache.\\n\"));\n     fprintf(stderr, _(\"       rarp -d <hostname>                    delete entry from cache.\\n\"));\n     fprintf(stderr, _(\"       rarp [<HW>] -s <hostname> <hwaddr>    add entry to cache.\\n\"));\n-    fprintf(stderr, _(\"       rarp -f                               add entries from /etc/ethers.\\n\"));\n+    fprintf(stderr, _(\"       rarp -f                               add entries from $PREFIX/etc/ethers.\\n\"));\n     fprintf(stderr, _(\"       rarp -V                               display program version.\\n\\n\"));\n \n     fprintf(stderr, _(\"  <HW>=Use '-H <hw>' to specify hardware address type. Default: %s\\n\"), DFLT_HW);\n"
  },
  {
    "path": "packages/net-tools/slattach.c.patch",
    "content": "diff -uNr net-tools/slattach.c net-tools.mod/slattach.c\n--- net-tools/slattach.c\t2017-02-21 20:24:32.000000000 +0200\n+++ net-tools.mod/slattach.c\t2019-03-01 21:54:06.558251056 +0200\n@@ -55,7 +55,7 @@\n #include \"util.h\"\n \n #ifndef _PATH_LOCKD\n-#define _PATH_LOCKD\t\"/var/lock\"\t\t/* lock files   */\n+#define _PATH_LOCKD\t\"@TERMUX_PREFIX@/var/lock\"\t\t/* lock files   */\n #endif\n #ifndef _UID_UUCP\n #define _UID_UUCP\t\"uucp\"\t\t\t/* owns locks   */\n"
  },
  {
    "path": "packages/net-tools/unknown_state.patch",
    "content": "Fix the case of unknown state.\n\nOn android we sometimes get state 138. Show it properly as \"Unknown(138)\"\nrather than a random string in the binary.\n\n--- net-tools/netstat.c\t2017-02-21 19:24:32.000000000 +0100\n+++ net-tools-mod/netstat.c\t2017-08-27 13:55:54.221049921 +0200\n@@ -1195,7 +1195,7 @@\n \t    }\n \n \tprintf(\"%-4s  %6ld %6ld %-*s %-*s %-11s\",\n-\t       prot, rxq, txq, (int)netmax(23,strlen(local_addr)), local_addr, (int)netmax(23,strlen(rem_addr)), rem_addr, _(tcp_state[state]));\n+\t       prot, rxq, txq, (int)netmax(23,strlen(local_addr)), local_addr, (int)netmax(23,strlen(rem_addr)), rem_addr, sctp_socket_state_str(state));\n \n \tfinish_this_one(uid,inode,timers);\n }\n"
  },
  {
    "path": "packages/netpbm/GNUmakefile.patch",
    "content": "diff -u -r ../advanced/GNUmakefile ./GNUmakefile\n--- ../advanced/GNUmakefile\t2014-12-29 02:10:40.608106336 -0500\n+++ ./GNUmakefile\t2014-12-29 02:29:28.600107116 -0500\n@@ -121,18 +121,8 @@\n \t$(SRCDIR)/configure $(SRCDIR)/config.mk.in\n \n \n-# typegen is a utility program used by the make file below.\n-TYPEGEN = $(BUILDDIR)/buildtools/typegen\n-\n-# endiangen is a utility program used by the make file below.\n-ENDIANGEN = $(BUILDDIR)/buildtools/endiangen\n-\n-$(TYPEGEN) $(ENDIANGEN): $(BUILDDIR)/buildtools\n-\t$(MAKE) -C $(dir $@) -f $(SRCDIR)/buildtools/Makefile \\\n-\t    SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) $(notdir $@) \n-\n inttypes_netpbm.h: $(TYPEGEN)\n-\t$(TYPEGEN) >$@\n+\techo 'include <inttypes.h>' > inttypes_netpbm.h\n \n # We run a couple of programs on the build machine in computing the\n # contents of pm_config.h.  We need to give the user a way not to do\n@@ -147,6 +137,7 @@\n \techo '/* pm_config.h GENERATED BY A MAKE RULE */' >$@\n \techo '#ifndef PM_CONFIG_H' >>$@\n \techo '#define PM_CONFIG_H' >>$@\n+\techo '#include <sys/endian.h> /* For BYTE_ORDER on Android */' >>$@\n ifeq ($(INTTYPES_H)x,x)\n \techo '/* Dont need to #include any inttypes.h-type thing */' >>$@\n else\n"
  },
  {
    "path": "packages/netpbm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://netpbm.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Toolkit for manipulation of graphic images of different formats\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\n# The netpbm releases are described at http://netpbm.sourceforge.net/release.html\n# and are divided among (1) Development, (2) Advanced, (3) Stable and (4) Super Stable.\n# Only Super Stable is distributed as a tar ball, but is outdated and does not compile with modern libpng.\n# So use revisions from http://svn.code.sf.net/p/netpbm/code/advanced for packages.\nTERMUX_PKG_VERSION=3094\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SHA256=2f4d8c245f174e391a4cf2418075c06532aee8a5fcc8dbbb8f2e7012cd9d52a4\nTERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/netpbm-advanced-r${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libpng, libxml2, libjpeg-turbo, libtiff, zlib\"\nTERMUX_PKG_BREAKS=\"netpbm-dev\"\nTERMUX_PKG_REPLACES=\"netpbm-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\t# Put the android libpng-config script in the path (before the host one):\n\tTERMUX_PKG_LIBPNG_CONFIG_DIR=$TERMUX_PKG_TMPDIR/libpng-config\n\tmkdir -p $TERMUX_PKG_LIBPNG_CONFIG_DIR\n\tcp $TERMUX_PREFIX/bin/libpng-config $TERMUX_PKG_LIBPNG_CONFIG_DIR/\n\texport PATH=$TERMUX_PKG_LIBPNG_CONFIG_DIR:$PATH\n\n\t# See $SRC/doc/INSTALL about netpbm build system. For automatic builds it recommends just copying config.mk.in\n\tcd $TERMUX_PKG_SRCDIR\n\tcp config.mk.in config.mk\n\techo \"AR = $AR\" >> config.mk\n\techo \"RANLIB = $RANLIB\" >> config.mk\n\techo \"CC = $CC\" >> config.mk\n\techo \"CFLAGS = $CFLAGS\" >> config.mk\n\techo \"CFLAGS_SHLIB = -fPIC\" >> config.mk\n\techo \"LDFLAGS = $LDFLAGS\" >> config.mk\n\techo \"STATICLIB_TOO = n\" >> config.mk\n\techo \"INTTYPES_H = <inttypes.h>\" >> config.mk\n\texport STRIPPROG=$STRIP\n\n\techo \"CC_FOR_BUILD = cc\" >> config.mk\n\techo \"LD_FOR_BUILD = cc\" >> config.mk\n\techo \"CFLAGS_FOR_BUILD = \" >> config.mk\n\techo \"LDFLAGS_FOR_BUILD = \" >> config.mk\n\techo \"JPEGLIB = ${TERMUX_PREFIX}/lib/libjpeg.so\" >> config.mk\n\techo \"TIFFLIB = ${TERMUX_PREFIX}/lib/libtiff.so\" >> config.mk\n\techo \"TIFFLIB_NEEDS_Z = N\" >> config.mk\n\n\tcp $TERMUX_PKG_BUILDER_DIR/standardppmdfont.c lib/\n}\n\ntermux_step_make_install() {\n\trm -Rf /tmp/netpbm\n\tmake -j 1 package pkgdir=/tmp/netpbm\n\t./installnetpbm\n}\n"
  },
  {
    "path": "packages/netpbm/buildtools-Makefile.patch",
    "content": "diff -u -r ../src-orig/buildtools/Makefile ./buildtools/Makefile\n--- ../src-orig/buildtools/Makefile\t2015-06-28 19:14:14.522452203 -0400\n+++ ./buildtools/Makefile\t2015-06-28 19:14:28.146229128 -0400\n@@ -27,7 +27,7 @@\n \t$(CC_FOR_BUILD) -c -o $@ $(CFLAGS_FOR_BUILD) \\\n \t  -DSHLIBPREFIXLIST=\"\\\"$(SHLIBPREFIXLIST)\\\"\" \\\n \t  $(STRIP_DLL_VERSION) $(EXPLICIT) \\\n-\t  $(CFLAGS_PERSONAL) $(CFLAGS) $(CADD) \\\n+\t  $(CFLAGS_PERSONAL) $(CADD) \\\n \t  $<\n \n typegen.o endiangen.o:%.o:%.c\n"
  },
  {
    "path": "packages/netpbm/buildtools-installnetpbm.pl.patch",
    "content": "diff -u -r ../netpbm-advanced-r3084/buildtools/installnetpbm.pl ./buildtools/installnetpbm.pl\n--- ../netpbm-advanced-r3084/buildtools/installnetpbm.pl\t2017-10-06 07:49:15.000000000 +0200\n+++ ./buildtools/installnetpbm.pl\t2017-10-06 12:18:07.809552955 +0200\n@@ -32,16 +32,7 @@\n \n     my ($prompt, $default) = @_;\n \n-    print(\"$prompt ($default) ==> \");\n-\n-    my $response = <STDIN>;\n-\n-    chomp($response);\n-    if ($response eq \"\") {\n-        $response = $default;\n-    }\n-\n-    return $response;\n+    return $default;\n }\n \n \n@@ -185,7 +176,7 @@\n         $default = \"/usr/local/netpbm\";\n     }\n \n-    my $response = fsObjPrompt(\"install prefix\", $default);\n+    my $response = \"@TERMUX_PREFIX@\";\n \n     my $prefix;\n \n@@ -573,7 +564,7 @@\n         $done = $FALSE;\n \n         while (!$done) {\n-            my $response = prompt(\"Y(es) or N(o)\", \"Y\");\n+            my $response = \"N\";\n \n             if (uc($response) eq \"Y\") {\n                 execLdconfig();\n"
  },
  {
    "path": "packages/netpbm/camera.c.patch",
    "content": "diff -u -r ../advanced/converter/other/cameratopam/camera.c ./converter/other/cameratopam/camera.c\n--- ../advanced/converter/other/cameratopam/camera.c\t2014-12-29 02:10:41.516106336 -0500\n+++ ./converter/other/cameratopam/camera.c\t2014-12-29 02:32:47.236107253 -0500\n@@ -775,6 +775,21 @@\n kodak_jpeg_load_raw(Image const Image) {}\n #else\n \n+static void\n+swab (const void *bfrom, void *bto, ssize_t n)\n+{\n+\tconst char *from = (const char *) bfrom;\n+\tchar *to = (char *) bto;\n+\n+\tn &= ~((ssize_t) 1);\n+\twhile (n > 1)\n+\t{\n+\t\tconst char b0 = from[--n], b1 = from[--n];\n+\t\tto[n] = b0;\n+\t\tto[n + 1] = b1;\n+\t}\n+}\n+\n static bool\n fill_input_buffer (j_decompress_ptr cinfo)\n {\n"
  },
  {
    "path": "packages/netpbm/lib-Makefile.patch",
    "content": "diff -u -r ../netpbm-10.35.95/lib/Makefile ./lib/Makefile\n--- ../netpbm-10.35.95/lib/Makefile\t2009-09-18 15:04:37.000000000 -0400\n+++ ./lib/Makefile\t2014-12-29 01:36:13.772104906 -0500\n@@ -117,7 +117,7 @@\n \trm -f $@\n \t$(SYMLINK) $< $@\n libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN): $(LIBOBJECTS) $(LIBOBJECTS_X)\n-\t$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \\\n+\t$(LD) $(LDFLAGS) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \\\n           $(SHLIB_CLIB) -lm $(LADD)\n endif\n \n"
  },
  {
    "path": "packages/netpbm/standardppmdfont.c",
    "content": "/* THIS FILE WAS GENERATED BY 'ppmdcfont' from a ppmfont file. */\n\n#include \"ppmdfont.h\"\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_33[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 2 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_34[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 243 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 249 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 10, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 243 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 249 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_35[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 1, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 240 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 253 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 253 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 3 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_36[26] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 254, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 13 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 2, 240 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 13 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 247 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_37[31] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 9, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 252, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 244 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 5, 2 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 2 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_38[34] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 10, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 246, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 246, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 7 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_39[7] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 250 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_40[10] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 4, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 242 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 11 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 14 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_41[10] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 252, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 242 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 11 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 14 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_42[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 6 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 253 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 3 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 5, 253 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 3 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_43[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 247, 0 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 0 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_44[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 10 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 12 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 13 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_45[2] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 247, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 0 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_46[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_47[2] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 9, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_48[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 255, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 244 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_49[4] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 252, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_50[14] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_51[15] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 5 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_52[6] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 3, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 2 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 3, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_53[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 5, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 5 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_54[23] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 2 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_55[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 244 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_56[29] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_57[23] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_58[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_59[14] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 10 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 12 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 13 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_60[3] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_61[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 247, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 253 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 247, 3 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 3 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_62[3] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_63[20] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 2 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_64[55] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 5, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 1 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 255, 249 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 4 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 5, 249 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 11, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 11, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 9, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 246, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 246, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 6 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 249 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 4 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_65[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 2 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 2 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_66[23] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 254 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_67[18] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 4 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_68[15] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_69[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 254 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 9 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_70[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 254 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_71[22] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 1 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 3, 1 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 1 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_72[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 254 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_73[2] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_74[10] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 4, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 2 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_75[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 2 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 254, 253 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_76[3] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_77[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_78[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_79[21] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_80[13] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 255 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_81[24] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 1, 5 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 11 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_82[16] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 254 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_83[20] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_84[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 244 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_85[10] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 244 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_86[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_87[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 246, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 10, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_88[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_89[6] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 254 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_90[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 244 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 244 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 249, 9 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_91[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 253, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 254, 240 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 253, 240 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 240 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 253, 16 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_92[2] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 9, 16 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 247, 240 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_93[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 2, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 3, 240 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 252, 240 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 240 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 252, 16 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_94[7] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 2 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 2 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 2 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_95[2] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 20, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_96[7] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 1, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 248 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_97[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_98[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_99[14] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_100[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_101[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_102[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 5, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 253, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 251 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_103[22] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 11 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 14 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 15 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 16 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 16 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 15 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_104[10] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 255 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_105[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 255, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 243 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 244 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_106[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 243 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 1, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 12 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 15 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 16 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_107[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 5, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 5 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 255, 1 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_108[2] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_109[18] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 245, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 245, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 245, 255 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 248, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 255 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 8, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 10, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 11, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 11, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_110[10] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 255 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_111[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_112[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_113[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 16 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_114[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 253, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 253, 1 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 251 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_115[17] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 6 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_116[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 253, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 251 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_117[10] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 5 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_118[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_119[11] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 248, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 8, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 4, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_120[5] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_121[9] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 250, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 13 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 252, 15 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 250, 16 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 249, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_122[8] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 251, 9 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 251 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 251 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 251, 9 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 6, 9 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_123[39] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 2, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 241 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 242 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 255 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 241 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 243 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 253, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 11 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 13 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 15 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 255, 1 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 10 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 12 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 14 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 15 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_124[2] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_125[39] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 254, 240 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 241 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 242 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 244 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 246 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 249 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 255 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 0, 241 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 243 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 245 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 247 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 248 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 250 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 4 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 6 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 9 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 11 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 13 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 15 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 1, 1 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 3 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 255, 5 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 7 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 8 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 10 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 2, 12 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 14 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 15 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 254, 16 }\n};\n\nstruct ppmd_glyphCommand const ppmd_standardfont_glyphTable_cmd_126[23] = {\n  {/* glyphCommand */ CMD_MOVEPEN, 2, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 0, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 251 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 252 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 11, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 13, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 15, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 17, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 18, 254 }\n  ,\n  {/* glyphCommand */ CMD_MOVEPEN, 2, 0 }\n  ,\n  {/* glyphCommand */ CMD_NOOP, 0, 0 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 1, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 3, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 5, 253 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 7, 254 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 11, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 13, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 15, 2 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 17, 1 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 18, 255 }\n  ,\n  {/* glyphCommand */ CMD_DRAWLINE, 18, 252 }\n};\n\nstruct ppmd_glyph const ppmd_standardfont_glyphTable[95] = {\n  { /* glyph */\n    { /* header */ 0, 0, 21}\n    ,\n    NULL\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_33\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 253, 15}\n    ,\n    ppmd_standardfont_glyphTable_cmd_34\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 246, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_35\n  }\n  ,\n  { /* glyph */\n    { /* header */ 26, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_36\n  }\n  ,\n  { /* glyph */\n    { /* header */ 31, 244, 12}\n    ,\n    ppmd_standardfont_glyphTable_cmd_37\n  }\n  ,\n  { /* glyph */\n    { /* header */ 34, 243, 13}\n    ,\n    ppmd_standardfont_glyphTable_cmd_38\n  }\n  ,\n  { /* glyph */\n    { /* header */ 7, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_39\n  }\n  ,\n  { /* glyph */\n    { /* header */ 10, 249, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_40\n  }\n  ,\n  { /* glyph */\n    { /* header */ 10, 249, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_41\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 248, 8}\n    ,\n    ppmd_standardfont_glyphTable_cmd_42\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 243, 13}\n    ,\n    ppmd_standardfont_glyphTable_cmd_43\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_44\n  }\n  ,\n  { /* glyph */\n    { /* header */ 2, 243, 13}\n    ,\n    ppmd_standardfont_glyphTable_cmd_45\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_46\n  }\n  ,\n  { /* glyph */\n    { /* header */ 2, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_47\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_48\n  }\n  ,\n  { /* glyph */\n    { /* header */ 4, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_49\n  }\n  ,\n  { /* glyph */\n    { /* header */ 14, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_50\n  }\n  ,\n  { /* glyph */\n    { /* header */ 15, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_51\n  }\n  ,\n  { /* glyph */\n    { /* header */ 6, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_52\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_53\n  }\n  ,\n  { /* glyph */\n    { /* header */ 23, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_54\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_55\n  }\n  ,\n  { /* glyph */\n    { /* header */ 29, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_56\n  }\n  ,\n  { /* glyph */\n    { /* header */ 23, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_57\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_58\n  }\n  ,\n  { /* glyph */\n    { /* header */ 14, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_59\n  }\n  ,\n  { /* glyph */\n    { /* header */ 3, 244, 12}\n    ,\n    ppmd_standardfont_glyphTable_cmd_60\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 243, 13}\n    ,\n    ppmd_standardfont_glyphTable_cmd_61\n  }\n  ,\n  { /* glyph */\n    { /* header */ 3, 244, 12}\n    ,\n    ppmd_standardfont_glyphTable_cmd_62\n  }\n  ,\n  { /* glyph */\n    { /* header */ 20, 247, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_63\n  }\n  ,\n  { /* glyph */\n    { /* header */ 55, 243, 14}\n    ,\n    ppmd_standardfont_glyphTable_cmd_64\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 247, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_65\n  }\n  ,\n  { /* glyph */\n    { /* header */ 23, 245, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_66\n  }\n  ,\n  { /* glyph */\n    { /* header */ 18, 246, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_67\n  }\n  ,\n  { /* glyph */\n    { /* header */ 15, 245, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_68\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 246, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_69\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 246, 8}\n    ,\n    ppmd_standardfont_glyphTable_cmd_70\n  }\n  ,\n  { /* glyph */\n    { /* header */ 22, 246, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_71\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_72\n  }\n  ,\n  { /* glyph */\n    { /* header */ 2, 252, 4}\n    ,\n    ppmd_standardfont_glyphTable_cmd_73\n  }\n  ,\n  { /* glyph */\n    { /* header */ 10, 248, 8}\n    ,\n    ppmd_standardfont_glyphTable_cmd_74\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 245, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_75\n  }\n  ,\n  { /* glyph */\n    { /* header */ 3, 246, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_76\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 244, 12}\n    ,\n    ppmd_standardfont_glyphTable_cmd_77\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_78\n  }\n  ,\n  { /* glyph */\n    { /* header */ 21, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_79\n  }\n  ,\n  { /* glyph */\n    { /* header */ 13, 245, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_80\n  }\n  ,\n  { /* glyph */\n    { /* header */ 24, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_81\n  }\n  ,\n  { /* glyph */\n    { /* header */ 16, 245, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_82\n  }\n  ,\n  { /* glyph */\n    { /* header */ 20, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_83\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 248, 8}\n    ,\n    ppmd_standardfont_glyphTable_cmd_84\n  }\n  ,\n  { /* glyph */\n    { /* header */ 10, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_85\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 247, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_86\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 244, 12}\n    ,\n    ppmd_standardfont_glyphTable_cmd_87\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_88\n  }\n  ,\n  { /* glyph */\n    { /* header */ 6, 247, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_89\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 246, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_90\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 249, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_91\n  }\n  ,\n  { /* glyph */\n    { /* header */ 2, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_92\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 249, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_93\n  }\n  ,\n  { /* glyph */\n    { /* header */ 7, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_94\n  }\n  ,\n  { /* glyph */\n    { /* header */ 2, 253, 22}\n    ,\n    ppmd_standardfont_glyphTable_cmd_95\n  }\n  ,\n  { /* glyph */\n    { /* header */ 7, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_96\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_97\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 246, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_98\n  }\n  ,\n  { /* glyph */\n    { /* header */ 14, 247, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_99\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_100\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 247, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_101\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 251, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_102\n  }\n  ,\n  { /* glyph */\n    { /* header */ 22, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_103\n  }\n  ,\n  { /* glyph */\n    { /* header */ 10, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_104\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 252, 4}\n    ,\n    ppmd_standardfont_glyphTable_cmd_105\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 251, 5}\n    ,\n    ppmd_standardfont_glyphTable_cmd_106\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 247, 8}\n    ,\n    ppmd_standardfont_glyphTable_cmd_107\n  }\n  ,\n  { /* glyph */\n    { /* header */ 2, 252, 4}\n    ,\n    ppmd_standardfont_glyphTable_cmd_108\n  }\n  ,\n  { /* glyph */\n    { /* header */ 18, 241, 15}\n    ,\n    ppmd_standardfont_glyphTable_cmd_109\n  }\n  ,\n  { /* glyph */\n    { /* header */ 10, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_110\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_111\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 246, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_112\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_113\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 249, 6}\n    ,\n    ppmd_standardfont_glyphTable_cmd_114\n  }\n  ,\n  { /* glyph */\n    { /* header */ 17, 248, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_115\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 251, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_116\n  }\n  ,\n  { /* glyph */\n    { /* header */ 10, 247, 10}\n    ,\n    ppmd_standardfont_glyphTable_cmd_117\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 248, 8}\n    ,\n    ppmd_standardfont_glyphTable_cmd_118\n  }\n  ,\n  { /* glyph */\n    { /* header */ 11, 245, 11}\n    ,\n    ppmd_standardfont_glyphTable_cmd_119\n  }\n  ,\n  { /* glyph */\n    { /* header */ 5, 248, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_120\n  }\n  ,\n  { /* glyph */\n    { /* header */ 9, 248, 8}\n    ,\n    ppmd_standardfont_glyphTable_cmd_121\n  }\n  ,\n  { /* glyph */\n    { /* header */ 8, 248, 9}\n    ,\n    ppmd_standardfont_glyphTable_cmd_122\n  }\n  ,\n  { /* glyph */\n    { /* header */ 39, 249, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_123\n  }\n  ,\n  { /* glyph */\n    { /* header */ 2, 252, 4}\n    ,\n    ppmd_standardfont_glyphTable_cmd_124\n  }\n  ,\n  { /* glyph */\n    { /* header */ 39, 249, 7}\n    ,\n    ppmd_standardfont_glyphTable_cmd_125\n  }\n  ,\n  { /* glyph */\n    { /* header */ 23, 255, 21}\n    ,\n    ppmd_standardfont_glyphTable_cmd_126\n  }\n};\n\n\nstruct ppmd_font const ppmd_standardfont = {\n  {/* .header */\n    {'p','p','m','d','f','o','n','t'},\n    0x01,\n    95,\n    32\n  }\n  ,\n  /* .glyphTable: */ ppmd_standardfont_glyphTable\n};\n"
  },
  {
    "path": "packages/netpbm/util.c.patch",
    "content": "diff -u -r ../advanced/converter/other/cameratopam/util.c ./converter/other/cameratopam/util.c\n--- ../advanced/converter/other/cameratopam/util.c\t2014-12-29 02:10:41.516106336 -0500\n+++ ./converter/other/cameratopam/util.c\t2014-12-29 02:35:33.156107368 -0500\n@@ -43,6 +43,21 @@\n         return a << 24 | b << 16 | c << 8 | d;\n }\n \n+static void\n+swab (const void *bfrom, void *bto, ssize_t n)\n+{\n+\tconst char *from = (const char *) bfrom;\n+\tchar *to = (char *) bto;\n+\n+\tn &= ~((ssize_t) 1);\n+\twhile (n > 1)\n+\t{\n+\t\tconst char b0 = from[--n], b1 = from[--n];\n+\t\tto[n] = b0;\n+\t\tto[n + 1] = b1;\n+\t}\n+}\n+\n /*\n    Faster than calling get2() multiple times.\n  */\n"
  },
  {
    "path": "packages/netsed/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://silicone.homelinux.org/projects/netsed/\nTERMUX_PKG_DESCRIPTION=\"Alter the contents of packets forwarded through network in real time\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.3\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=http://silicone.homelinux.org/release/netsed/netsed-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=f0891285442c9a4701e2b7fc7d28f2834a5352f94295649d1fdb60da1eca81aa\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/newsboat/Makefile.patch",
    "content": "diff -u -r ../newsboat-2.16.1/Makefile ./Makefile\n--- ../newsboat-2.16.1/Makefile\t2019-06-26 17:55:21.000000000 +0000\n+++ ./Makefile\t2019-08-06 17:59:51.574712056 +0000\n@@ -18,7 +18,7 @@\n \n WARNFLAGS=-Werror -Wall -Wextra -Wunreachable-code\n INCLUDES=-Iinclude -Istfl -Ifilter -I. -Irss\n-BARE_CXXFLAGS=-std=c++11 -O2 -ggdb $(INCLUDES)\n+BARE_CXXFLAGS=-std=c++11 -O2 $(INCLUDES)\n LDFLAGS+=-L.\n \n PACKAGE=newsboat\n@@ -32,7 +32,7 @@\n LDFLAGS+=-fprofile-arcs -ftest-coverage\n endif\n \n-CXXFLAGS:=$(BARE_CXXFLAGS) $(WARNFLAGS) $(DEFINES) $(CXXFLAGS)\n+CXXFLAGS:=$(BARE_CXXFLAGS) $(WARNFLAGS) $(DEFINES) $(CXXFLAGS) $(CPPFLAGS)\n CXXFLAGS_FOR_BUILD?=$(CXXFLAGS)\n \n LIB_SOURCES:=$(shell cat mk/libboat.deps)\n@@ -46,7 +46,7 @@\n NEWSBOAT=newsboat\n NEWSBOAT_SOURCES:=$(shell cat mk/newsboat.deps)\n NEWSBOAT_OBJS:=$(patsubst %.cpp,%.o,$(NEWSBOAT_SOURCES))\n-NEWSBOAT_LIBS=-lboat -lnewsboat -lfilter -lpthread -lrsspp -ldl\n+NEWSBOAT_LIBS=-lboat -lnewsboat -lfilter -lrsspp -landroid-glob\n \n RSSPPLIB_SOURCES=$(sort $(wildcard rss/*.cpp))\n RSSPPLIB_OBJS=$(patsubst rss/%.cpp,rss/%.o,$(RSSPPLIB_SOURCES))\n@@ -75,7 +75,7 @@\n PODBOAT=podboat\n PODBOAT_SOURCES:=$(shell cat mk/podboat.deps)\n PODBOAT_OBJS:=$(patsubst %.cpp,%.o,$(PODBOAT_SOURCES))\n-PODBOAT_LIBS=-lboat -lnewsboat -lpthread -ldl\n+PODBOAT_LIBS=-lboat -lnewsboat -ldl\n \n ifeq (, $(filter Linux GNU GNU/%, $(shell uname -s)))\n NEWSBOAT_LIBS+=-liconv -lintl\n"
  },
  {
    "path": "packages/newsboat/avoid-gettext.patch",
    "content": "diff -uNr newsboat-2.17/rust/libnewsboat/Cargo.toml newsboat-2.17.mod/rust/libnewsboat/Cargo.toml\n--- newsboat-2.17/rust/libnewsboat/Cargo.toml\t2019-09-22 17:19:19.000000000 +0300\n+++ newsboat-2.17.mod/rust/libnewsboat/Cargo.toml\t2019-09-24 20:57:10.680900795 +0300\n@@ -19,7 +19,6 @@\n unicode-segmentation = \"1\"\n curl-sys = \"0.4.5\"\n libc = \"0.2\"\n-gettext-rs = \"0.4.1\"\n natord = \"1.0.9\"\n \n # We don't use the following crates, but we pin their versions to make sure\n@@ -37,12 +36,6 @@\n #   I want as little dependencies as practically possible.\n default-features = false\n \n-[dependencies.gettext-sys]\n-version = \"0.19.8\"\n-# Don't let the crate build its own copy of gettext; force it to use the one\n-# built into glibc.\n-features = [ \"gettext-system\" ]\n-\n [dev-dependencies]\n tempfile = \"3\"\n proptest = \"0.7\"\ndiff -uNr newsboat-2.17/rust/libnewsboat/src/cliargsparser.rs newsboat-2.17.mod/rust/libnewsboat/src/cliargsparser.rs\n--- newsboat-2.17/rust/libnewsboat/src/cliargsparser.rs\t2019-09-22 17:19:19.000000000 +0300\n+++ newsboat-2.17.mod/rust/libnewsboat/src/cliargsparser.rs\t2019-09-24 20:56:44.030818719 +0300\n@@ -1,5 +1,4 @@\n use clap::{App, Arg};\n-use gettextrs::gettext;\n use libc::{EXIT_FAILURE, EXIT_SUCCESS};\n use std::path::PathBuf;\n \n@@ -282,7 +281,7 @@\n                 }\n                 _ => {\n                     args.display_msg = fmt!(\n-                        &gettext(\"%s: %s: invalid loglevel value\"),\n+                        \"%s: %s: invalid loglevel value\",\n                         &opts[0],\n                         log_level_str\n                     );\ndiff -uNr newsboat-2.17/rust/libnewsboat/src/configpaths.rs newsboat-2.17.mod/rust/libnewsboat/src/configpaths.rs\n--- newsboat-2.17/rust/libnewsboat/src/configpaths.rs\t2019-09-22 17:19:19.000000000 +0300\n+++ newsboat-2.17.mod/rust/libnewsboat/src/configpaths.rs\t2019-09-24 21:04:18.205613586 +0300\n@@ -1,6 +1,5 @@\n use cliargsparser::CliArgsParser;\n use dirs;\n-use gettextrs::gettext;\n use libc;\n use logger::{self, Level};\n use std::fs::{self, DirBuilder};\n@@ -69,11 +68,9 @@\n             let uid = unsafe { libc::getuid() };\n \n             config_paths.error_message = fmt!(\n-                &gettext(\n                     \"Fatal error: couldn't determine home directory!\\n\\\n                      Please set the HOME environment variable or add \\\n-                     a valid user for UID %u!\"\n-                ),\n+                     a valid user for UID %u!\",\n                 uid\n             );\n \n@@ -131,7 +128,7 @@\n         if !self.silent {\n             eprintln!(\n                 \"{}\",\n-                &gettext(\"Migrating configs and data from Newsbeuter's XDG dirs...\")\n+                \"Migrating configs and data from Newsbeuter's XDG dirs...\"\n             );\n         }\n \n@@ -187,7 +184,7 @@\n         if !self.silent {\n             eprintln!(\n                 \"{}\",\n-                &gettext(\"Migrating configs and data from Newsbeuter's dotdir...\")\n+                \"Migrating configs and data from Newsbeuter's dotdir...\"\n             );\n         }\n \n@@ -199,7 +196,7 @@\n                     eprintln!(\n                         \"{}\",\n                         &fmt!(\n-                            &gettext(\"Aborting migration because mkdir on `%s' failed: %s\"),\n+                            \"Aborting migration because mkdir on `%s' failed: %s\",\n                             &newsboat_dir.to_string_lossy().into_owned(),\n                             err.to_string()\n                         )\ndiff -uNr newsboat-2.17/rust/libnewsboat/src/lib.rs newsboat-2.17.mod/rust/libnewsboat/src/lib.rs\n--- newsboat-2.17/rust/libnewsboat/src/lib.rs\t2019-09-22 17:19:19.000000000 +0300\n+++ newsboat-2.17.mod/rust/libnewsboat/src/lib.rs\t2019-09-24 20:56:44.030818719 +0300\n@@ -11,7 +11,6 @@\n #[macro_use]\n extern crate proptest;\n extern crate clap;\n-extern crate gettextrs;\n extern crate libc;\n \n // This module must be declared before the others because it exports a `log!` macro that everyone\n"
  },
  {
    "path": "packages/newsboat/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://newsboat.org/\nTERMUX_PKG_DESCRIPTION=\"RSS/Atom feed reader for the text console\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.17.1\nTERMUX_PKG_SRCURL=https://newsboat.org/releases/${TERMUX_PKG_VERSION}/newsboat-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=c1ebd24b017173156e817a1a3dd1d982808dec30a891e1f487806e5f86171997\nTERMUX_PKG_DEPENDS=\"libc++, libiconv, libandroid-support, libandroid-glob, json-c, libsqlite, libcurl, libxml2, stfl, ncurses, openssl\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/locale\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_lib_bsd_main=no\"\nTERMUX_PKG_CONFLICTS=newsbeuter\nTERMUX_PKG_REPLACES=newsbeuter\n\ntermux_step_pre_configure() {\n\ttermux_setup_rust\n\n\texport CXX_FOR_BUILD=g++\n\texport CXXFLAGS_FOR_BUILD=\"-O2\"\n\n\t# Used by newsboat Makefile:\n\texport CARGO_BUILD_TARGET=$CARGO_TARGET_NAME\n\n\tLDFLAGS+=\" -liconv\"\n\n\texport PKG_CONFIG_ALLOW_CROSS=1\n}\n"
  },
  {
    "path": "packages/newsboat/fix-paths.patch",
    "content": "diff -uNr newsboat-2.14.1/src/controller.cpp newsboat-2.14.1.mod/src/controller.cpp\n--- newsboat-2.14.1/src/controller.cpp\t2019-02-10 18:07:09.000000000 +0200\n+++ newsboat-2.14.1.mod/src/controller.cpp\t2019-03-01 21:52:00.350784451 +0200\n@@ -768,7 +768,7 @@\n \t} else {\n \t\tsnprintf(filename,\n \t\t\tsizeof(filename),\n-\t\t\t\"/tmp/newsboat-article.XXXXXX\");\n+\t\t\t\"@TERMUX_PREFIX@/tmp/newsboat-article.XXXXXX\");\n \t}\n \tint fd = mkstemp(filename);\n \tif (fd != -1) {\ndiff -uNr newsboat-2.14.1/src/formaction.cpp newsboat-2.14.1.mod/src/formaction.cpp\n--- newsboat-2.14.1/src/formaction.cpp\t2019-02-10 18:07:09.000000000 +0200\n+++ newsboat-2.14.1.mod/src/formaction.cpp\t2019-03-01 21:51:38.197304516 +0200\n@@ -540,7 +540,7 @@\n \t\t\treturn \"\";\n \t\t} else {\n \t\t\tchar* my_argv[4];\n-\t\t\tmy_argv[0] = const_cast<char*>(\"/bin/sh\");\n+\t\t\tmy_argv[0] = const_cast<char*>(\"@TERMUX_PREFIX@/bin/sh\");\n \t\t\tmy_argv[1] = const_cast<char*>(\"-c\");\n \t\t\tmy_argv[2] = const_cast<char*>(cmdline.c_str());\n \t\t\tmy_argv[3] = nullptr;\ndiff -uNr newsboat-2.14.1/src/itemrenderer.cpp newsboat-2.14.1.mod/src/itemrenderer.cpp\n--- newsboat-2.14.1/src/itemrenderer.cpp\t2019-02-10 18:07:09.000000000 +0200\n+++ newsboat-2.14.1.mod/src/itemrenderer.cpp\t2019-03-01 21:51:38.200637872 +0200\n@@ -92,7 +92,7 @@\n \t\trnd.render(source, lines, thelinks, url);\n \t} else {\n \t\tchar* argv[4];\n-\t\targv[0] = const_cast<char*>(\"/bin/sh\");\n+\t\targv[0] = const_cast<char*>(\"@TERMUX_PREFIX@/bin/sh\");\n \t\targv[1] = const_cast<char*>(\"-c\");\n \t\targv[2] = const_cast<char*>(renderer.c_str());\n \t\targv[3] = nullptr;\ndiff -uNr newsboat-2.14.1/src/pbcontroller.cpp newsboat-2.14.1.mod/src/pbcontroller.cpp\n--- newsboat-2.14.1/src/pbcontroller.cpp\t2019-02-10 18:07:09.000000000 +0200\n+++ newsboat-2.14.1.mod/src/pbcontroller.cpp\t2019-03-01 21:51:38.200637872 +0200\n@@ -281,7 +281,7 @@\n \tcfgparser.register_handler(\"reset-unread-on-update\", &null_cah);\n \n \ttry {\n-\t\tcfgparser.parse(\"/etc/newsboat/config\");\n+\t\tcfgparser.parse(\"@TERMUX_PREFIX@/etc/newsboat/config\");\n \t\tcfgparser.parse(config_file);\n \t} catch (const ConfigException& ex) {\n \t\tstd::cout << ex.what() << std::endl;\ndiff -uNr newsboat-2.14.1/src/rssparser.cpp newsboat-2.14.1.mod/src/rssparser.cpp\n--- newsboat-2.14.1/src/rssparser.cpp\t2019-02-10 18:07:09.000000000 +0200\n+++ newsboat-2.14.1.mod/src/rssparser.cpp\t2019-03-01 21:51:38.203971227 +0200\n@@ -291,7 +291,7 @@\n {\n \tstd::string buf = utils::retrieve_url(uri, cfgcont);\n \n-\tchar* argv[4] = {const_cast<char*>(\"/bin/sh\"),\n+\tchar* argv[4] = {const_cast<char*>(\"@TERMUX_PREFIX@/bin/sh\"),\n \t\tconst_cast<char*>(\"-c\"),\n \t\tconst_cast<char*>(filter.c_str()),\n \t\tnullptr};\n"
  },
  {
    "path": "packages/newsboat/mbc-buffer-length-fix.patch",
    "content": "diff -uNr newsboat-2.17/src/tagsouppullparser.cpp newsboat-2.17.mod/src/tagsouppullparser.cpp\n--- newsboat-2.17/src/tagsouppullparser.cpp\t2019-09-22 17:19:19.000000000 +0300\n+++ newsboat-2.17.mod/src/tagsouppullparser.cpp\t2019-09-24 21:48:19.762987918 +0300\n@@ -515,7 +515,7 @@\n \t} else {\n \t\tfor (unsigned int i = 0; entity_table[i].entity; ++i) {\n \t\t\tif (s == entity_table[i].entity) {\n-\t\t\t\tchar mbc[MB_CUR_MAX];\n+\t\t\t\tchar mbc[16];\n \t\t\t\tint pos = wctomb(mbc, entity_table[i].value);\n \t\t\t\tif (pos == -1) {\n \t\t\t\t\treturn std::string();\n"
  },
  {
    "path": "packages/nginx/Android-crossfile.patch32",
    "content": "--- /dev/null\t2017-02-12 08:53:37.916801006 +0530\n+++ ./auto/cross/Android\t2017-02-12 10:05:45.391652407 +0530\n@@ -0,0 +1,11 @@\n+feature_NGX_SYS_NERR_CROSS=41\n+sizeof_int_CROSS=4\n+sizeof_long_CROSS=4\n+sizeof_long_long_CROSS=8\n+sizeof_void_ptr_CROSS=4\n+sizeof_sig_atomic_t_CROSS=4\n+sizeof_size_t_CROSS=4\n+sizeof_off_t_CROSS=4\n+sizeof_time_t_CROSS=4\n+endianness_CROSS=little\n+\n"
  },
  {
    "path": "packages/nginx/Android-crossfile.patch64",
    "content": "--- /dev/null\t2017-02-12 08:53:37.916801006 +0530\n+++ ./auto/cross/Android\t2017-02-12 10:05:45.391652407 +0530\n@@ -0,0 +1,11 @@\n+feature_NGX_SYS_NERR_CROSS=41\n+sizeof_int_CROSS=4\n+sizeof_long_CROSS=8\n+sizeof_long_long_CROSS=8\n+sizeof_void_ptr_CROSS=8\n+sizeof_sig_atomic_t_CROSS=4\n+sizeof_size_t_CROSS=8\n+sizeof_off_t_CROSS=8\n+sizeof_time_t_CROSS=8\n+endianness_CROSS=little\n+\n"
  },
  {
    "path": "packages/nginx/auto-threads.patch",
    "content": "diff -u -r ../nginx-1.14.0/auto/threads ./auto/threads\n--- ../nginx-1.14.0/auto/threads\t2018-04-17 15:22:36.000000000 +0000\n+++ ./auto/threads\t2018-05-19 01:20:25.703633445 +0000\n@@ -16,6 +16,5 @@\n     have=NGX_THREADS . auto/have\n     CORE_DEPS=\"$CORE_DEPS $THREAD_POOL_DEPS\"\n     CORE_SRCS=\"$CORE_SRCS $THREAD_POOL_SRCS\"\n-    CORE_LIBS=\"$CORE_LIBS -lpthread\"\n-    NGX_LIBPTHREAD=\"-lpthread\"\n+    NGX_LIBPTHREAD=\"\"\n fi\n"
  },
  {
    "path": "packages/nginx/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.nginx.org\nTERMUX_PKG_DESCRIPTION=\"Lightweight HTTP server\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=1.17.6\nTERMUX_PKG_SRCURL=http://nginx.org/download/nginx-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3cb4a5314dc0ab0a4e8a7b51ae17c027133417a45cc6c5a96e3dd80141c237b6\nTERMUX_PKG_DEPENDS=\"libandroid-glob, libcrypt, pcre, openssl, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_CONFFILES=\"\netc/nginx/fastcgi.conf\netc/nginx/fastcgi_params\netc/nginx/koi-win\netc/nginx/koi-utf\netc/nginx/mime.types\netc/nginx/nginx.conf\netc/nginx/scgi_params\netc/nginx/uwsgi_params\netc/nginx/win-utf\"\n\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tCPPFLAGS=\"$CPPFLAGS -DIOV_MAX=1024\"\n\tLDFLAGS=\"$LDFLAGS -landroid-glob\"\n\n\t# remove config from previouse installs\n\trm -rf \"$TERMUX_PREFIX/etc/nginx\"\n}\n\ntermux_step_configure() {\n\tDEBUG_FLAG=\"\"\n\t$TERMUX_DEBUG && DEBUG_FLAG=\"--with-debug\"\n\n\t./configure \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--crossbuild=\"Linux:3.16.1:$TERMUX_ARCH\" \\\n\t\t--crossfile=\"$TERMUX_PKG_SRCDIR/auto/cross/Android\" \\\n\t\t--with-cc=$CC \\\n\t\t--with-cpp=$CPP \\\n\t\t--with-cc-opt=\"$CPPFLAGS $CFLAGS\" \\\n\t\t--with-ld-opt=\"$LDFLAGS\" \\\n\t\t--with-pcre \\\n\t\t--with-pcre-jit \\\n\t\t--with-threads \\\n\t\t--with-ipv6 \\\n\t\t--sbin-path=\"$TERMUX_PREFIX/bin/nginx\" \\\n\t\t--conf-path=\"$TERMUX_PREFIX/etc/nginx/nginx.conf\" \\\n\t\t--http-log-path=\"$TERMUX_PREFIX/var/log/nginx/access.log\" \\\n\t\t--pid-path=\"$TERMUX_PREFIX/tmp/nginx.pid\" \\\n\t\t--lock-path=\"$TERMUX_PREFIX/tmp/nginx.lock\" \\\n\t\t--error-log-path=\"$TERMUX_PREFIX/var/log/nginx/error.log\" \\\n\t\t--http-client-body-temp-path=\"$TERMUX_PREFIX/var/lib/nginx/client-body\" \\\n\t\t--http-proxy-temp-path=\"$TERMUX_PREFIX/var/lib/nginx/proxy\" \\\n\t\t--http-fastcgi-temp-path=\"$TERMUX_PREFIX/var/lib/nginx/fastcgi\" \\\n\t\t--http-scgi-temp-path=\"$TERMUX_PREFIX/var/lib/nginx/scgi\" \\\n\t\t--http-uwsgi-temp-path=\"$TERMUX_PREFIX/var/lib/nginx/uwsgi\" \\\n\t\t--with-http_auth_request_module \\\n\t\t--with-http_ssl_module \\\n\t\t--with-http_v2_module \\\n\t\t--with-http_gunzip_module \\\n\t\t$DEBUG_FLAG\n}\n\ntermux_step_post_make_install() {\n\t# many parts are taken directly from Arch PKGBUILD\n\t# https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/nginx\n\n\t# set default port to 8080\n\tsed -i \"s| 80;| 8080;|\" \"$TERMUX_PREFIX/etc/nginx/nginx.conf\"\n\tcp conf/mime.types \"$TERMUX_PREFIX/etc/nginx/\"\n\trm \"$TERMUX_PREFIX\"/etc/nginx/*.default\n\n\t# move default html dir\n\tsed -e \"44s|html|$TERMUX_PREFIX/share/nginx/html|\" \\\n\t\t-e \"54s|html|$TERMUX_PREFIX/share/nginx/html|\" \\\n\t\t-i \"$TERMUX_PREFIX/etc/nginx/nginx.conf\"\n\trm -rf \"$TERMUX_PREFIX/share/nginx\"\n\tmkdir -p \"$TERMUX_PREFIX/share/nginx\"\n\tmv \"$TERMUX_PREFIX/html/\" \"$TERMUX_PREFIX/share/nginx\"\n\n\t# install vim contrib\n\tfor i in ftdetect indent syntax; do\n\t\tinstall -Dm644 \"$TERMUX_PKG_SRCDIR/contrib/vim/${i}/nginx.vim\" \\\n\t\t\t\"$TERMUX_PREFIX/share/vim/vimfiles/${i}/nginx.vim\"\n\tdone\n\n\t# install man pages\n\tmkdir -p \"$TERMUX_PREFIX/share/man/man8\"\n\tcp \"$TERMUX_PKG_SRCDIR/man/nginx.8\" \"$TERMUX_PREFIX/share/man/man8/\"\n}\n\ntermux_step_post_massage() {\n\t# keep empty dirs which were deleted in massage\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/log/nginx\"\n\tfor dir in client-body proxy fastcgi scgi uwsgi; do\n\t\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/lib/nginx/$dir\"\n\tdone\n}\n\n"
  },
  {
    "path": "packages/nginx/cross-compile-nginx.patch",
    "content": "--- ./auto/options\t2017-01-24 19:32:19.000000000 +0530\n+++ ../options\t2017-02-12 10:01:42.063174903 +0530\n@@ -34,6 +34,8 @@\n NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO\n \n NGX_PLATFORM=\n+NGX_CROSS=NO\n+NGX_CROSSFILE=\n NGX_WINE=\n \n EVENT_FOUND=NO\n@@ -190,7 +192,9 @@\n         --user=*)                        NGX_USER=\"$value\"          ;;\n         --group=*)                       NGX_GROUP=\"$value\"         ;;\n \n-        --crossbuild=*)                  NGX_PLATFORM=\"$value\"      ;;\n+        --crossbuild=*)                  NGX_PLATFORM=\"$value\"      ;\n+                                         NGX_CROSS=YES              ;;\n+        --crossfile=*)                   NGX_CROSSFILE=\"$value\"     ;;\n \n         --build=*)                       NGX_BUILD=\"$value\"         ;;\n         --builddir=*)                    NGX_OBJS=\"$value\"          ;;\n@@ -416,6 +420,10 @@\n   --group=GROUP                      set non-privileged group for\n                                      worker processes\n \n+  --crossbuild=PLAT:VER:ARCH         crossbuild for specified\n+                                     NGX_PLATFORM\n+  --crossfile=NAME                   file name in auto/cross\n+\n   --build=NAME                       set build name\n   --builddir=DIR                     set build directory\n \n--- ./auto/os/linux\t2017-01-24 19:32:19.000000000 +0530\n+++ ../linux\t2017-03-17 09:46:36.557329915 +0530\n@@ -18,7 +18,13 @@\n \n # Linux kernel version\n \n-version=$((`uname -r \\\n+if [ \"$NGX_CROSS\" = \"YES\" ]; then\n+    kern_version=`echo $NGX_PLATFORM | cut -d ':' -f 2`\n+else\n+    kern_version=`uname -r`\n+fi\n+\n+version=$((`echo $kern_version \\\n     | sed -n -e 's/^\\([0-9][0-9]*\\)\\.\\([0-9][0-9]*\\)\\.\\([0-9][0-9]*\\).*/ \\\n                                                  \\1*256*256+\\2*256+\\3/p' \\\n              -e 's/^\\([0-9][0-9]*\\)\\.\\([0-9][0-9]*\\).*/\\1*256*256+\\2*256/p'`))\n--- ./auto/types/sizeof\t2017-01-24 19:32:19.000000000 +0530\n+++ ../sizeof\t2017-03-17 10:11:46.379342795 +0530\n@@ -40,7 +40,13 @@\n \n \n if [ -x $NGX_AUTOTEST ]; then\n-    ngx_size=`$NGX_AUTOTEST`\n+    if [ \"$NGX_CROSS\" = \"YES\" ]; then\n+        crossvar=`echo \"sizeof_${ngx_type}_CROSS\" | sed -e 's| |_|g' -e 's|\\*|ptr|g'`\n+        . $NGX_CROSSFILE\n+        eval ngx_size=\\\"\\${$crossvar}\\\"\n+    else\n+        ngx_size=`$NGX_AUTOTEST`\n+    fi\n     echo \" $ngx_size bytes\"\n fi\n \n--- ./auto/feature\t2017-01-24 19:32:19.000000000 +0530\n+++ ../feature\t2017-02-12 10:18:38.010242484 +0530\n@@ -53,7 +53,7 @@\n \n         yes)\n             # /bin/sh is used to intercept \"Killed\" or \"Abort trap\" messages\n-            if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then\n+            if [ \"$NGX_CROSS\" = \"YES\" ] || bash -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1 ; then\n                 echo \" found\"\n                 ngx_found=yes\n \n@@ -68,7 +68,24 @@\n \n         value)\n             # /bin/sh is used to intercept \"Killed\" or \"Abort trap\" messages\n-            if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then\n+            if [ \"$NGX_CROSS\" = \"YES\" ]; then\n+                eval crossval=\\\"\\${`echo \"feature_${ngx_feature_name}_CROSS\" | sed 's| |_|g'`}\\\"\n+                . $NGX_CROSSFILE\n+                if [ -n \"$crossval\"  ]; then\n+                    echo \" found\"\n+                    ngx_found=yes\n+\n+                    cat << END >> $NGX_AUTO_CONFIG_H\n+\n+#ifndef $ngx_feature_name\n+#define $ngx_feature_name  `echo $crossval`\n+#endif\n+\n+END\n+                else\n+                    echo \" found but is not working\"\n+                fi\n+            elif /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then\n                 echo \" found\"\n                 ngx_found=yes\n \n--- ./auto/endianness\t2017-01-31 20:31:10.000000000 +0530\n+++ ../endianness\t2017-03-19 12:00:55.871579412 +0530\n@@ -31,7 +31,18 @@\n \n eval \"$ngx_test >> $NGX_AUTOCONF_ERR 2>&1\"\n \n-if [ -x $NGX_AUTOTEST ]; then\n+if [ \"$NGX_CROSS\" = \"YES\" ]; then\n+    . $NGX_CROSSFILE\n+    if [ \"$endianness_CROSS\" = \"little\" ]; then\n+        echo \" little endian\"\n+        have=NGX_HAVE_LITTLE_ENDIAN . auto/have\n+    else\n+        echo \" big endian\"\n+    fi\n+\n+    rm -rf $NGX_AUTOTEST*\n+\n+elif [ -x $NGX_AUTOTEST ]; then\n     if $NGX_AUTOTEST >/dev/null 2>&1; then\n         echo \" little endian\"\n         have=NGX_HAVE_LITTLE_ENDIAN . auto/have\n"
  },
  {
    "path": "packages/nginx/src-core-ngx_cycle.c.patch",
    "content": "diff -u -r ../nginx-1.15.3/src/core/ngx_cycle.c ./src/core/ngx_cycle.c\n--- ../nginx-1.15.3/src/core/ngx_cycle.c\t2018-08-28 15:36:00.000000000 +0000\n+++ ./src/core/ngx_cycle.c\t2018-09-19 22:13:38.876609223 +0000\n@@ -1130,7 +1130,7 @@\n             continue;\n         }\n \n-#if !(NGX_WIN32)\n+#if !(NGX_WIN32) && !defined(__ANDROID__)\n         if (user != (ngx_uid_t) NGX_CONF_UNSET_UINT) {\n             ngx_file_info_t  fi;\n \n"
  },
  {
    "path": "packages/nginx/src-core-ngx_file.c.patch",
    "content": "diff -u -r ../nginx-1.15.3/src/core/ngx_file.c ./src/core/ngx_file.c\n--- ../nginx-1.15.3/src/core/ngx_file.c\t2018-08-28 15:36:00.000000000 +0000\n+++ ./src/core/ngx_file.c\t2018-09-19 22:12:25.665430137 +0000\n@@ -618,7 +618,7 @@\n             continue;\n         }\n \n-#if !(NGX_WIN32)\n+#if !(NGX_WIN32) && !defined(__ANDROID__)\n         {\n         ngx_file_info_t   fi;\n \n"
  },
  {
    "path": "packages/nginx/src-event-modules-ngx_epoll_module.c.patch",
    "content": "diff -u -r ../nginx-1.15.3/src/event/modules/ngx_epoll_module.c ./src/event/modules/ngx_epoll_module.c\n--- ../nginx-1.15.3/src/event/modules/ngx_epoll_module.c\t2018-08-28 15:36:00.000000000 +0000\n+++ ./src/event/modules/ngx_epoll_module.c\t2018-09-19 21:55:21.381079239 +0000\n@@ -591,16 +591,12 @@\n     if (event == NGX_READ_EVENT) {\n         e = c->write;\n         prev = EPOLLOUT;\n-#if (NGX_READ_EVENT != EPOLLIN|EPOLLRDHUP)\n         events = EPOLLIN|EPOLLRDHUP;\n-#endif\n \n     } else {\n         e = c->read;\n         prev = EPOLLIN|EPOLLRDHUP;\n-#if (NGX_WRITE_EVENT != EPOLLOUT)\n         events = EPOLLOUT;\n-#endif\n     }\n \n     if (e->active) {\n"
  },
  {
    "path": "packages/nim/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://nim-lang.org/\nTERMUX_PKG_DESCRIPTION=\"Nim programming language compiler\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.0.4\nTERMUX_PKG_SRCURL=https://nim-lang.org/download/nim-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=89841545a14475911bb84616bcd5a1b93a3268e1a6a0089f54642e405eeaaee0\nTERMUX_PKG_DEPENDS=\"clang, git, libandroid-glob\"\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_host_build() {\n\tcp -r ../src/* ./\n\tmake -j $TERMUX_MAKE_PROCESSES CC=gcc LD=gcc\n}\n\ntermux_step_make() {\n\tif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\texport\tNIM_ARCH=amd64\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\texport\tNIM_ARCH=i386\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\texport NIM_ARCH=arm64\n\telse\n\t\texport NIM_ARCH=arm\n\tfi\n\tLDFLAGS+=\" -landroid-glob\"\n\tsed -i \"s%\\@CC\\@%${CC}%g\"  config/nim.cfg\n\tsed -i \"s%\\@CFLAGS\\@%${CFLAGS}%g\" config/nim.cfg\n\tsed -i \"s%\\@LDFLAGS\\@%${LDFLAGS}%g\" config/nim.cfg\n\tsed -i \"s%\\@CPPFLAGS\\@%${CPPFLAGS}%g\" config/nim.cfg\n\n\tfind -name \"stdlib_osproc.nim.c\" | xargs -n 1 sed -i 's',\"/system/bin/sh\\\"\\,\\ 14\",\"/data/data/com.termux/files/usr/bin/sh\\\"\\,\\ 38\",'g'\n\tPATH=$TERMUX_PKG_HOSTBUILD_DIR/bin:$PATH\n\n\tif [ $NIM_ARCH = \"amd64\" ]; then\n\t\tsed -i 's/arm64/amd64/g' makefile\n\tfi\n\texport CFLAGS=\" $CPPFLAGS $CFLAGS  -w  -fno-strict-aliasing\"\n\tmake LD=$CC uos=linux mycpu=$NIM_ARCH myos=android  -j $TERMUX_MAKE_PROCESSES useShPath=$TERMUX_PREFIX/bin/sh\n\tcp config/nim.cfg ../host-build/config\n\n\tnim --cc:clang --clang.exe=$CC --clang.linkerexe=$CC --opt:size --define:termux -d:release --os:android --cpu:$NIM_ARCH  -t:\"$CPPFLAGS $CFLAGS\" -l:\"$LDFLAGS -landroid-glob\" c koch.nim\n\tcd dist/nimble/src\n\tnim --cc:clang --clang.exe=$CC --clang.linkerexe=$CC --define:termux -d:release --os:android --cpu:$NIM_ARCH  -t:\"$CPPFLAGS $CFLAGS\" -l:\"$LDFLAGS -landroid-glob\" c nimble.nim\n}\n\ntermux_step_make_install() {\n\t./install.sh $TERMUX_PREFIX/lib\n\tcp koch $TERMUX_PREFIX/lib/nim/bin/\n\tcp dist/nimble/src/nimble $TERMUX_PREFIX/lib/nim/bin/\n\tln -sfr $TERMUX_PREFIX/lib/nim/bin/nim $TERMUX_PREFIX/bin/\n\tln -sfr $TERMUX_PREFIX/lib/nim/bin/koch $TERMUX_PREFIX/bin/\n\tln -sfr $TERMUX_PREFIX/lib/nim/bin/nimble $TERMUX_PREFIX/bin/\n}\n"
  },
  {
    "path": "packages/nim/osproc.nim.patch",
    "content": "--- ./lib/pure/osproc.a.nim\t2018-11-20 22:10:39.892888610 +0000\n+++ ./lib/pure/osproc.nim\t2018-11-20 22:11:48.031167863 +0000\n@@ -792,7 +792,7 @@\n     if poEvalCommand in options:\n       const useShPath {.strdefine.} =\n         when not defined(android): \"/bin/sh\"\n-        else: \"/system/bin/sh\"\n+        else: \"@TERMUX_PREFIX@/bin/sh\"\n       sysCommand = useShPath\n       sysArgsRaw = @[sysCommand, \"-c\", command]\n       assert args.len == 0, \"`args` has to be empty when using poEvalCommand.\"\n"
  },
  {
    "path": "packages/ninja/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ninja-build.org\nTERMUX_PKG_DESCRIPTION=\"A small build system with a focus on speed\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.9.0\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/ninja-build/ninja/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9\nTERMUX_PKG_DEPENDS=\"libc++, libandroid-spawn\"\n\ntermux_step_pre_configure() {\n\tCXXFLAGS+=\" $CPPFLAGS\"\n\tLDFLAGS+=\" -landroid-spawn\"\n}\n\ntermux_step_configure() {\n\t$TERMUX_PKG_SRCDIR/configure.py\n}\n\ntermux_step_make() {\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\t$TERMUX_PKG_SRCDIR/configure.py --bootstrap\n\telse\n\t\ttermux_setup_ninja\n\t\tninja -j $TERMUX_MAKE_PROCESSES\n\tfi\n}\n\ntermux_step_make_install() {\n\tcp ninja $TERMUX_PREFIX/bin\n}\n"
  },
  {
    "path": "packages/ninja/src-subprocess-posix.cc.patch",
    "content": "diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc\nindex 1de22c3..f988297 100644\n--- a/src/subprocess-posix.cc\n+++ b/src/subprocess-posix.cc\n@@ -110,8 +110,8 @@ bool Subprocess::Start(SubprocessSet* set, const string& command) {\n   if (err != 0)\n     Fatal(\"posix_spawnattr_setflags: %s\", strerror(err));\n \n-  const char* spawned_args[] = { \"/bin/sh\", \"-c\", command.c_str(), NULL };\n-  err = posix_spawn(&pid_, \"/bin/sh\", &action, &attr,\n+  const char* spawned_args[] = { \"@TERMUX_PREFIX@/bin/sh\", \"-c\", command.c_str(), NULL };\n+  err = posix_spawn(&pid_, \"@TERMUX_PREFIX@/bin/sh\", &action, &attr,\n         const_cast<char**>(spawned_args), environ);\n   if (err != 0)\n     Fatal(\"posix_spawn: %s\", strerror(err));\n"
  },
  {
    "path": "packages/ninja/src-util.cc.patch",
    "content": "diff --git a/src/util.cc b/src/util.cc\nindex 84de879..0ac9ec7 100644\n--- a/src/util.cc\n+++ b/src/util.cc\n@@ -585,7 +585,7 @@ double GetLoadAverage() {\n   // Calculation taken from comment in libperfstats.h\n   return double(cpu_stats.loadavg[0]) / double(1 << SBITS);\n }\n-#elif defined(__UCLIBC__)\n+#elif defined(__UCLIBC__) || defined(__ANDROID__)\n double GetLoadAverage() {\n   struct sysinfo si;\n   if (sysinfo(&si) != 0)\n"
  },
  {
    "path": "packages/nmap/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://nmap.org/\nTERMUX_PKG_DESCRIPTION=\"Utility for network discovery and security auditing\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=7.80\nTERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=fcfa5a0e42099e12e4bf7a68ebe6fde05553383a682e816a7ec9256ab4773faa\n# Depend on netcat so that it gets installed automatically when installing\n# nmap, since the ncat program is usually distributed as part of nmap.\nTERMUX_PKG_DEPENDS=\"libc++, libpcap, pcre, openssl, resolv-conf, netcat, liblua, libssh2, zlib\"\n# --without-nmap-update to avoid linking against libsvn_client:\n# --without-zenmap to avoid python scripts for graphical gtk frontend:\n# --without-ndiff to avoid python2-using ndiff utility:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-static --with-liblua=$TERMUX_PREFIX --without-nmap-update --without-zenmap --without-ndiff\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_make_install() {\n\t# Setup 'netcat' and 'nc' as symlink to 'ncat', since the other netcat implementations\n\t# are outdated (gnu-netcat) or non-portable (openbsd-netcat).\n\tfor prog in netcat nc; do\n\t\tcd $TERMUX_PREFIX/bin\n\t\tln -s -f ncat $prog\n\t\tcd $TERMUX_PREFIX/share/man/man1\n\t\tln -s -f ncat.1 ${prog}.1\n\tdone\n}\n"
  },
  {
    "path": "packages/nmap/fix-paths.patch",
    "content": "diff -uNr nmap-7.70/ncat/ncat_connect.c nmap-7.70.mod/ncat/ncat_connect.c\n--- nmap-7.70/ncat/ncat_connect.c\t2018-01-28 23:18:17.000000000 +0200\n+++ nmap-7.70.mod/ncat/ncat_connect.c\t2019-03-02 01:35:44.977992954 +0200\n@@ -1005,7 +1005,7 @@\n               char *tmpdir = getenv(\"TMPDIR\");\n               size_t size=0, offset=0;\n               strbuf_sprintf(&tmp_name, &size, &offset, \"%s/ncat.XXXXXX\",\n-                  tmpdir ? tmpdir : \"/tmp\");\n+                  tmpdir ? tmpdir : \"@TERMUX_PREFIX@/tmp\");\n               if (mkstemp(tmp_name) == -1) {\n                 bye(\"Failed to create name for temporary DGRAM source Unix domain socket (mkstemp).\");\n               }\ndiff -uNr nmap-7.70/ncat/ncat_main.c nmap-7.70.mod/ncat/ncat_main.c\n--- nmap-7.70/ncat/ncat_main.c\t2018-03-05 03:53:34.000000000 +0200\n+++ nmap-7.70.mod/ncat/ncat_main.c\t2019-03-02 01:35:44.977992954 +0200\n@@ -999,8 +999,8 @@\n \n #ifndef WIN32\n     /* See if the shell is executable before we get deep into this */\n-    if (o.execmode == EXEC_SHELL && access(\"/bin/sh\", X_OK) == -1)\n-        bye(\"/bin/sh is not executable, so `-c' won't work.\");\n+    if (o.execmode == EXEC_SHELL && access(\"@TERMUX_PREFIX@/bin/sh\", X_OK) == -1)\n+        bye(\"@TERMUX_PREFIX@/bin/sh is not executable, so `-c' won't work.\");\n #endif\n \n     if (targetaddrs->addr.storage.ss_family != AF_UNSPEC) {\ndiff -uNr nmap-7.70/ncat/ncat_posix.c nmap-7.70.mod/ncat/ncat_posix.c\n--- nmap-7.70/ncat/ncat_posix.c\t2018-01-28 23:18:17.000000000 +0200\n+++ nmap-7.70.mod/ncat/ncat_posix.c\t2019-03-02 01:35:44.981326300 +0200\n@@ -239,7 +239,7 @@\n         char **cmdargs;\n \n         case EXEC_SHELL:\n-            execl(\"/bin/sh\", \"sh\", \"-c\", cmdexec, (void *) NULL);\n+            execl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", cmdexec, (void *) NULL);\n             break;\n #ifdef HAVE_LUA\n         case EXEC_LUA:\ndiff -uNr nmap-7.70/nmap_dns.cc nmap-7.70.mod/nmap_dns.cc\n--- nmap-7.70/nmap_dns.cc\t2018-01-28 23:18:17.000000000 +0200\n+++ nmap-7.70.mod/nmap_dns.cc\t2019-03-02 01:35:44.981326300 +0200\n@@ -1016,9 +1016,9 @@\n   char fmt[32];\n   char ipaddr[INET6_ADDRSTRLEN+1];\n \n-  fp = fopen(\"/etc/resolv.conf\", \"r\");\n+  fp = fopen(\"@TERMUX_PREFIX@/etc/resolv.conf\", \"r\");\n   if (fp == NULL) {\n-    if (firstrun) error(\"mass_dns: warning: Unable to open /etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers\");\n+    if (firstrun) error(\"mass_dns: warning: Unable to open $PREFIX/etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers\");\n     return;\n   }\n \n@@ -1099,7 +1099,7 @@\n   parse_etchosts(tpbuf);\n \n #else\n-  parse_etchosts(\"/etc/hosts\");\n+  parse_etchosts(\"@TERMUX_PREFIX@/etc/hosts\");\n #endif // WIN32\n }\n \ndiff -uNr nmap-7.70/protocols.cc nmap-7.70.mod/protocols.cc\n--- nmap-7.70/protocols.cc\t2018-01-28 23:18:17.000000000 +0200\n+++ nmap-7.70.mod/protocols.cc\t2019-03-02 01:37:23.878379187 +0200\n@@ -156,8 +156,8 @@\n   int res;\n \n   if (nmap_fetchfile(filename, sizeof(filename), \"nmap-protocols\") != 1) {\n-    error(\"Unable to find nmap-protocols!  Resorting to /etc/protocols\");\n-    strcpy(filename, \"/etc/protocols\");\n+    error(\"Unable to find nmap-protocols!  Resorting to @TERMUX_PREFIX@/etc/protocols\");\n+    strcpy(filename, \"@TERMUX_PREFIX@/etc/protocols\");\n   }\n \n   fp = fopen(filename, \"r\");\ndiff -uNr nmap-7.70/services.cc nmap-7.70.mod/services.cc\n--- nmap-7.70/services.cc\t2018-01-28 23:18:17.000000000 +0200\n+++ nmap-7.70.mod/services.cc\t2019-03-02 01:36:46.291565552 +0200\n@@ -202,8 +202,8 @@\n \n   if (nmap_fetchfile(filename, sizeof(filename), \"nmap-services\") != 1) {\n #ifndef WIN32\n-    error(\"Unable to find nmap-services!  Resorting to /etc/services\");\n-    strcpy(filename, \"/etc/services\");\n+    error(\"Unable to find nmap-services!  Resorting to @TERMUX_PREFIX@/etc/services\");\n+    strcpy(filename, \"@TERMUX_PREFIX@/etc/services\");\n #else\n         int len, wnt = GetVersion() < 0x80000000;\n     error(\"Unable to find nmap-services!  Resorting to /etc/services\");\n"
  },
  {
    "path": "packages/nmap/netcat.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/ncat bin/netcat bin/nc share/man/man1/ncat.1.gz share/man/man1/netcat.1.gz share/man/man1/nc.1.gz\"\nTERMUX_SUBPKG_DESCRIPTION=\"Feature-packed networking utility which reads and writes data across networks from the command line\"\nTERMUX_SUBPKG_DEPENDS=\"libpcap, openssl, liblua\"\n"
  },
  {
    "path": "packages/nmap/nping-EchoServer.cc.patch",
    "content": "diff -u -r ../nmap-7.70/nping/EchoServer.cc ./nping/EchoServer.cc\n--- ../nmap-7.70/nping/EchoServer.cc\t2018-01-28 21:18:17.000000000 +0000\n+++ ./nping/EchoServer.cc\t2018-09-21 06:35:10.405423943 +0000\n@@ -281,12 +281,12 @@\n         server_addr6.sin6_len = sizeof(struct sockaddr_in6);\n     #endif\n     /* Bind to local address and the specified port */\n-    if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){\n+    if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){\n         nping_warning(QT_3, \"Failed to bind to source address %s. Trying to bind to port %d...\", IPtoa(server_addr6.sin6_addr), port);\n         /* If the bind failed for the supplied address, just try again with in6addr_any */\n         if( o.spoofSource() ){\n             server_addr6.sin6_addr = in6addr_any;\n-            if( bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){\n+            if( ::bind(master_sd, (struct sockaddr *)&server_addr6, sizeof(server_addr6)) != 0 ){\n                 nping_fatal(QT_3, \"Could not bind to port %d (%s).\", port, strerror(errno));\n             }else{ \n                 nping_print(VB_1, \"Server bound to port %d\", port);\n@@ -319,12 +319,12 @@\n #endif\n \n     /* Bind to local address and the specified port */\n-    if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){\n+    if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){\n         nping_warning(QT_3, \"Failed to bind to source address %s. Trying to bind to port %d...\", IPtoa(server_addr4.sin_addr), port);\n         /* If the bind failed for the supplied address, just try again with in6addr_any */\n         if( o.spoofSource() ){\n             server_addr4.sin_addr.s_addr=INADDR_ANY;\n-            if( bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){\n+            if( ::bind(master_sd, (struct sockaddr *)&server_addr4, sizeof(server_addr4)) != 0 ){\n                 nping_fatal(QT_3, \"Could not bind to port %d (%s).\", port, strerror(errno));\n             }else{\n                 nping_print(VB_1, \"Server bound to port %d\", port);\n"
  },
  {
    "path": "packages/nnn/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/jarun/nnn\nTERMUX_PKG_DESCRIPTION=\"Free, fast, friendly file browser\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=2.8.1\nTERMUX_PKG_SHA256=cadf9cf8038433aeeb50a777180ad4b309ac7d2fec81c7da177ddca515812f06\nTERMUX_PKG_SRCURL=https://github.com/jarun/nnn/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"file, findutils, readline, wget, libandroid-support\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/nodejs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://nodejs.org/\nTERMUX_PKG_DESCRIPTION=\"Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=13.0.0\nTERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=45ff3b40afc3fc93fd62e31c0f5dfa046f307f0b33d0f32e09019f306bc74767\n# Note that we do not use a shared libuv to avoid an issue with the Android\n# linker, which does not use symbols of linked shared libraries when resolving\n# symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462.\nTERMUX_PKG_DEPENDS=\"libc++, openssl, c-ares, libicu, zlib\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_CONFLICTS=\"nodejs-lts, nodejs-current\"\nTERMUX_PKG_BREAKS=\"nodejs-dev\"\nTERMUX_PKG_REPLACES=\"nodejs-current, nodejs-dev\"\nTERMUX_PKG_HOSTBUILD=true\n\ntermux_step_post_extract_package() {\n\t# Prevent caching of host build:\n\trm -Rf $TERMUX_PKG_HOSTBUILD_DIR\n}\n\ntermux_step_host_build() {\n\tlocal ICU_VERSION=65.1\n\tlocal ICU_TAR=icu4c-${ICU_VERSION//./_}-src.tar.xz\n\tlocal ICU_DOWNLOAD=https://fossies.org/linux/misc/$ICU_TAR\n\ttermux_download \\\n\t\t$ICU_DOWNLOAD\\\n\t\t$TERMUX_PKG_CACHEDIR/$ICU_TAR \\\n\t\tbd002bdeb2e854a224c2617ba1d0e9ccea7fde3065682333902e234dce4dd380\n\ttar xf $TERMUX_PKG_CACHEDIR/$ICU_TAR\n\tcd icu/source\n\tif [ \"$TERMUX_ARCH_BITS\" = 32 ]; then\n\t\t./configure --prefix $TERMUX_PKG_HOSTBUILD_DIR/icu-installed \\\n\t\t\t--disable-samples \\\n\t\t\t--disable-tests \\\n\t\t\t--build=i686-pc-linux-gnu \"CFLAGS=-m32\" \"CXXFLAGS=-m32\" \"LDFLAGS=-m32\"\n\telse\n\t\t./configure --prefix $TERMUX_PKG_HOSTBUILD_DIR/icu-installed \\\n\t\t\t--disable-samples \\\n\t\t\t--disable-tests\n\tfi\n\tmake -j $TERMUX_MAKE_PROCESSES install\n}\n\ntermux_step_configure() {\n\tlocal DEST_CPU\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tDEST_CPU=\"arm\"\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tDEST_CPU=\"ia32\"\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\tDEST_CPU=\"arm64\"\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\tDEST_CPU=\"x64\"\n\telse\n\t\ttermux_error_exit \"Unsupported arch '$TERMUX_ARCH'\"\n\tfi\n\n\texport GYP_DEFINES=\"host_os=linux\"\n\texport CC_host=gcc\n\texport CXX_host=g++\n\texport LINK_host=g++\n\n\t# See note above TERMUX_PKG_DEPENDS why we do not use a shared libuv.\n\t./configure \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--dest-cpu=$DEST_CPU \\\n\t\t--dest-os=android \\\n\t\t--shared-cares \\\n\t\t--shared-openssl \\\n\t\t--shared-zlib \\\n\t\t--with-intl=system-icu \\\n\t\t--without-snapshot \\\n\t\t--without-node-snapshot \\\n\t\t--cross-compiling\n\n\texport LD_LIBRARY_PATH=$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib\n\tperl -p -i -e \"s@LIBS := \\\\$\\\\(LIBS\\\\)@LIBS := -L$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib -lpthread -licui18n -licuuc -licudata@\" \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/torque.host.mk \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/bytecode_builtins_list_generator.host.mk \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/v8_libbase.host.mk \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/gen-regexp-special-case.host.mk\n}\n"
  },
  {
    "path": "packages/nodejs/configure.py.patch",
    "content": "diff -u -r ../node-v12.1.0/configure.py ./configure.py\n--- ../node-v12.1.0/configure.py\t2019-04-29 12:57:51.000000000 +0000\n+++ ./configure.py\t2019-05-05 21:21:04.289245037 +0000\n@@ -931,7 +931,7 @@\n                      else target_arch != host_arch)\n   want_snapshots = not options.without_snapshot\n   o['variables']['want_separate_host_toolset'] = int(\n-      cross_compiling and want_snapshots)\n+      cross_compiling)\n \n   if options.with_node_snapshot:\n     o['variables']['node_use_node_snapshot'] = 'true'\n"
  },
  {
    "path": "packages/nodejs/deps-uv-src-unix-core.c.patch",
    "content": "diff -uNr node-v8.4.0/deps/uv/src/unix/core.c node-v8.4.0.mod/deps/uv/src/unix/core.c\n--- node-v8.4.0/deps/uv/src/unix/core.c\t2017-08-15 19:42:28.000000000 +0300\n+++ node-v8.4.0.mod/deps/uv/src/unix/core.c\t2017-09-14 16:13:27.292856099 +0300\n@@ -1112,7 +1112,9 @@\n \n   /* No temp environment variables defined */\n   #if defined(__ANDROID__)\n-    buf = \"/data/local/tmp\";\n+    // Don't use '/data/local/tmp' in Termux\n+    //buf = \"/data/local/tmp\";\n+    buf = \"@TERMUX_PREFIX@/tmp\";\n   #else\n     buf = \"/tmp\";\n   #endif\n"
  },
  {
    "path": "packages/nodejs/deps-uv-src-unix-process.c.patch",
    "content": "diff -uNr node-v12.10.0/deps/uv/src/unix/process.c node-v12.10.0.mod/deps/uv/src/unix/process.c\n--- node-v12.10.0/deps/uv/src/unix/process.c\t2019-09-04 18:36:23.000000000 +0300\n+++ node-v12.10.0.mod/deps/uv/src/unix/process.c\t2019-09-23 01:39:39.069030779 +0300\n@@ -351,27 +351,6 @@\n     _exit(127);\n   }\n \n-  if (options->flags & (UV_PROCESS_SETUID | UV_PROCESS_SETGID)) {\n-    /* When dropping privileges from root, the `setgroups` call will\n-     * remove any extraneous groups. If we don't call this, then\n-     * even though our uid has dropped, we may still have groups\n-     * that enable us to do super-user things. This will fail if we\n-     * aren't root, so don't bother checking the return value, this\n-     * is just done as an optimistic privilege dropping function.\n-     */\n-    SAVE_ERRNO(setgroups(0, NULL));\n-  }\n-\n-  if ((options->flags & UV_PROCESS_SETGID) && setgid(options->gid)) {\n-    uv__write_int(error_fd, UV__ERR(errno));\n-    _exit(127);\n-  }\n-\n-  if ((options->flags & UV_PROCESS_SETUID) && setuid(options->uid)) {\n-    uv__write_int(error_fd, UV__ERR(errno));\n-    _exit(127);\n-  }\n-\n   if (options->env != NULL) {\n     environ = options->env;\n   }\n"
  },
  {
    "path": "packages/nodejs/deps-uv-uv.gyp.patch",
    "content": "diff -u -r ../node-v9.7.1/deps/uv/uv.gyp ./deps/uv/uv.gyp\n--- ../node-v9.7.1/deps/uv/uv.gyp\t2018-03-02 01:58:02.000000000 +0000\n+++ ./deps/uv/uv.gyp\t2018-03-05 10:51:15.530165566 +0000\n@@ -39,7 +39,7 @@\n     {\n       'target_name': 'libuv',\n       'type': '<(uv_library)',\n-      'include_dirs': [\n+      'include_dirs+': [\n         'include',\n         'src/',\n       ],\n@@ -54,7 +54,7 @@\n           '<@(shared_unix_defines)',\n           '<@(shared_zos_defines)',\n         ],\n-        'include_dirs': [ 'include' ],\n+        'include_dirs+': [ 'include' ],\n         'conditions': [\n           ['OS == \"linux\"', {\n             'defines': [ '_POSIX_C_SOURCE=200112' ],\n"
  },
  {
    "path": "packages/nodejs/deps-v8-src-flags-flag-definitions.h.patch",
    "content": "diff -u -r ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h ./deps/v8/src/flags/flag-definitions.h\n--- ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h\t2019-08-20 17:14:50.000000000 +0000\n+++ ./deps/v8/src/flags/flag-definitions.h\t2019-08-24 22:38:43.754905700 +0000\n@@ -1373,7 +1373,7 @@\n DEFINE_BOOL(perf_prof_unwinding_info, false,\n             \"Enable unwinding info for perf linux profiler (experimental).\")\n DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info)\n-DEFINE_STRING(gc_fake_mmap, \"/tmp/__v8_gc__\",\n+DEFINE_STRING(gc_fake_mmap, \"/@TERMUX_PREFIX@/tmp/__v8_gc__\",\n               \"Specify the name of the file for fake gc mmap used in ll_prof\")\n DEFINE_BOOL(log_internal_timer_events, false, \"Time internal events.\")\n DEFINE_IMPLICATION(log_internal_timer_events, prof)\n"
  },
  {
    "path": "packages/nodejs/deps-v8-src-logging-log.cc.patch",
    "content": "diff -u -r ../node-v12.9.0/deps/v8/src/logging/log.cc ./deps/v8/src/logging/log.cc\n--- ../node-v12.9.0/deps/v8/src/logging/log.cc\t2019-08-20 17:14:50.000000000 +0000\n+++ ./deps/v8/src/logging/log.cc\t2019-08-24 22:39:52.426124955 +0000\n@@ -280,7 +280,7 @@\n   FILE* perf_output_handle_;\n };\n \n-const char PerfBasicLogger::kFilenameFormatString[] = \"/tmp/perf-%d.map\";\n+const char PerfBasicLogger::kFilenameFormatString[] = \"@TERMUX_PREFIX@/tmp/perf-%d.map\";\n // Extra space for the PID in the filename\n const int PerfBasicLogger::kFilenameBufferPadding = 16;\n \n"
  },
  {
    "path": "packages/nodejs/fix_multiple_definitions.patch",
    "content": "diff -uNr node-v12.3.1/deps/uv/src/unix/sysinfo-memory.c node-v12.3.1.mod/deps/uv/src/unix/sysinfo-memory.c\n--- node-v12.3.1/deps/uv/src/unix/sysinfo-memory.c\t2019-05-22 15:21:52.000000000 +0300\n+++ node-v12.3.1.mod/deps/uv/src/unix/sysinfo-memory.c\t2019-05-28 15:37:28.698418026 +0300\n@@ -25,6 +25,7 @@\n #include <stdint.h>\n #include <sys/sysinfo.h>\n \n+#ifndef __ANDROID__\n uint64_t uv_get_free_memory(void) {\n   struct sysinfo info;\n \n@@ -40,3 +41,4 @@\n     return (uint64_t) info.totalram * info.mem_unit;\n   return 0;\n }\n+#endif\n"
  },
  {
    "path": "packages/nodejs/lib-child_process.js.patch",
    "content": "diff -u -r ../node-v6.2.0/lib/child_process.js ./lib/child_process.js\n--- ../node-v6.2.0/lib/child_process.js\t2016-05-17 15:53:06.000000000 -0400\n+++ ./lib/child_process.js\t2016-05-18 16:31:45.574685443 -0400\n@@ -335,7 +335,7 @@\n       if (typeof options.shell === 'string')\n         file = options.shell;\n       else if (process.platform === 'android')\n-        file = '/system/bin/sh';\n+        file = '@TERMUX_PREFIX@/bin/sh';\n       else\n         file = '/bin/sh';\n       args = ['-c', command];\n"
  },
  {
    "path": "packages/nodejs/lib-os.js.patch",
    "content": "diff -u -r ../node-v10.9.0/lib/os.js ./lib/os.js\n--- ../node-v10.9.0/lib/os.js\t2018-08-15 13:53:34.000000000 +0000\n+++ ./lib/os.js\t2018-08-23 20:42:39.611186774 +0000\n@@ -130,7 +130,7 @@\n     path = safeGetenv('TMPDIR') ||\n            safeGetenv('TMP') ||\n            safeGetenv('TEMP') ||\n-           '/tmp';\n+           '@TERMUX_PREFIX@/tmp';\n     if (path.length > 1 && path.endsWith('/'))\n       path = path.slice(0, -1);\n   }\n"
  },
  {
    "path": "packages/nodejs/node.gyp.patch",
    "content": "diff -u -r ../node-v12.9.0/node.gyp ./node.gyp\n--- ../node-v12.9.0/node.gyp\t2019-08-20 17:14:52.000000000 +0000\n+++ ./node.gyp\t2019-08-24 20:21:21.471982543 +0000\n@@ -1062,107 +1062,6 @@\n         } ],\n       ]\n     }, # specialize_node_d\n-    {\n-      'target_name': 'cctest',\n-      'type': 'executable',\n-\n-      'dependencies': [\n-        '<(node_lib_target_name)',\n-        'deps/histogram/histogram.gyp:histogram',\n-        'node_dtrace_header',\n-        'node_dtrace_ustack',\n-        'node_dtrace_provider',\n-      ],\n-\n-      'includes': [\n-        'node.gypi'\n-      ],\n-\n-      'include_dirs': [\n-        'src',\n-        'tools/msvs/genfiles',\n-        'deps/v8/include',\n-        'deps/cares/include',\n-        'deps/uv/include',\n-        'test/cctest',\n-      ],\n-\n-      'defines': [ 'NODE_WANT_INTERNALS=1' ],\n-\n-      'sources': [\n-        'src/node_snapshot_stub.cc',\n-        'src/node_code_cache_stub.cc',\n-        'test/cctest/gtest/gtest-all.cc',\n-        'test/cctest/gtest/gtest_main.cc',\n-        'test/cctest/node_test_fixture.cc',\n-        'test/cctest/node_test_fixture.h',\n-        'test/cctest/test_aliased_buffer.cc',\n-        'test/cctest/test_base64.cc',\n-        'test/cctest/test_node_postmortem_metadata.cc',\n-        'test/cctest/test_environment.cc',\n-        'test/cctest/test_linked_binding.cc',\n-        'test/cctest/test_per_process.cc',\n-        'test/cctest/test_platform.cc',\n-        'test/cctest/test_traced_value.cc',\n-        'test/cctest/test_util.cc',\n-        'test/cctest/test_url.cc',\n-      ],\n-\n-      'conditions': [\n-        [ 'node_use_openssl==\"true\"', {\n-          'defines': [\n-            'HAVE_OPENSSL=1',\n-          ],\n-        }],\n-        ['v8_enable_inspector==1', {\n-          'sources': [\n-            'test/cctest/test_inspector_socket.cc',\n-            'test/cctest/test_inspector_socket_server.cc'\n-          ],\n-          'defines': [\n-            'HAVE_INSPECTOR=1',\n-          ],\n-        }, {\n-           'defines': [\n-             'HAVE_INSPECTOR=0',\n-           ]\n-        }],\n-        ['OS==\"solaris\"', {\n-          'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]\n-        }],\n-        # Skip cctest while building shared lib node for Windows\n-        [ 'OS==\"win\" and node_shared==\"true\"', {\n-          'type': 'none',\n-        }],\n-        [ 'node_shared==\"true\"', {\n-          'xcode_settings': {\n-            'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],\n-          },\n-        }],\n-        [ 'node_report==\"true\"', {\n-          'sources': [\n-            'test/cctest/test_report_util.cc',\n-          ],\n-          'defines': [\n-            'NODE_REPORT',\n-            'NODE_ARCH=\"<(target_arch)\"',\n-            'NODE_PLATFORM=\"<(OS)\"',\n-          ],\n-          'conditions': [\n-            ['OS==\"win\"', {\n-              'libraries': [ 'Ws2_32' ],\n-            }],\n-          ],\n-        }],\n-        ['OS==\"win\"', {\n-          'libraries': [\n-            'Dbghelp.lib',\n-            'winmm.lib',\n-            'Ws2_32.lib',\n-          ],\n-        }],\n-      ],\n-    }, # cctest\n \n     # TODO(joyeecheung): do not depend on node_lib,\n     # instead create a smaller static library node_lib_base that does\n"
  },
  {
    "path": "packages/nodejs/npm-link-patch.patch",
    "content": "--- ../node/deps/npm/node_modules/cacache/lib/util/move-file.js\t2017-10-22 19:30:25.778456404 +0200\n+++ ./deps/npm/node_modules/cacache/lib/util/move-file.js\t2017-10-22 20:41:18.021337095 +0200\n@@ -4,6 +4,7 @@\n const BB = require('bluebird')\n const chmod = BB.promisify(fs.chmod)\n const unlink = BB.promisify(fs.unlink)\n+const access = BB.promisify(fs.access)\n let move\n let pinflight\n \n@@ -18,6 +19,18 @@\n   // content their own way.\n   //\n   // Note that, as the name suggests, this strictly only supports file moves.\n+\n+\n+  // Calling link() on android is not allowed, we get a SELinux security exception\n+  if(process.platform === 'android') {\n+    return access(dest, fs.constants.F_OK)\n+      .catch(err => {\n+        if (!move) { move = require('move-concurrently') }\n+        return move(src, dest, { BB, fs })\n+          .then(() => chmod(dest, '0444'))\n+      })\n+  }\n+\n   return BB.fromNode(cb => {\n     fs.link(src, dest, err => {\n       if (err) {\n"
  },
  {
    "path": "packages/nodejs/src-cares_wrap.cc.patch",
    "content": "diff -u -r ../node-v6.0.0/src/cares_wrap.cc ./src/cares_wrap.cc\n--- ../node-v6.0.0/src/cares_wrap.cc\t2016-04-26 15:50:22.000000000 -0400\n+++ ./src/cares_wrap.cc\t2016-05-02 00:24:26.349502775 -0400\n@@ -15,8 +15,7 @@\n #include <stdlib.h>\n #include <string.h>\n \n-#if defined(__ANDROID__) || \\\n-    defined(__MINGW32__) || \\\n+#if defined(__MINGW32__) || \\\n     defined(__OpenBSD__) || \\\n     defined(_MSC_VER)\n"
  },
  {
    "path": "packages/nodejs/src-node_internals.h.patch",
    "content": "diff -u -r ../node-v11.7.0/src/node_internals.h ./src/node_internals.h\n--- ../node-v11.7.0/src/node_internals.h\t2019-01-17 21:27:16.000000000 +0000\n+++ ./src/node_internals.h\t2019-01-18 22:44:06.207542176 +0000\n@@ -358,7 +358,7 @@\n \n // Functions defined in node.cc that are exposed via the bootstrapper object\n \n-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)\n+#if defined(__POSIX__) && !defined(__CloudABI__)\n #define NODE_IMPLEMENTS_POSIX_CREDENTIALS 1\n #endif  // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)\n \n"
  },
  {
    "path": "packages/nodejs/src-node_main.cc.patch",
    "content": "diff -u -r ../node-v6.3.1/src/node_main.cc ./src/node_main.cc\n--- ../node-v6.3.1/src/node_main.cc\t2016-07-21 16:44:43.000000000 -0400\n+++ ./src/node_main.cc\t2016-07-23 13:53:57.530095071 -0400\n@@ -54,6 +54,10 @@\n   // calls elsewhere in the program (e.g., any logging from V8.)\n   setvbuf(stdout, nullptr, _IONBF, 0);\n   setvbuf(stderr, nullptr, _IONBF, 0);\n+  if (getenv(\"TMPDIR\") == NULL) {\n+    // Give javascript programs (such as updated versions of npm) a working tmpdir.\n+    putenv(\"TMPDIR=@TERMUX_PREFIX@/tmp\");\n+  }\n   return node::Start(argc, argv);\n }\n #endif\n"
  },
  {
    "path": "packages/nodejs/tools-v8_gypfiles-v8.gyp.patch",
    "content": "diff -u -r ../node-v12.9.0/tools/v8_gypfiles/v8.gyp ./tools/v8_gypfiles/v8.gyp\n--- ../node-v12.9.0/tools/v8_gypfiles/v8.gyp\t2019-08-20 17:14:53.000000000 +0000\n+++ ./tools/v8_gypfiles/v8.gyp\t2019-08-24 22:02:57.943558855 +0000\n@@ -1010,6 +1010,7 @@\n             '<(V8_ROOT)/src/base/platform/platform-posix.h',\n             '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',\n             '<(V8_ROOT)/src/base/platform/platform-posix-time.h',\n+            '<(V8_ROOT)/src/base/platform/platform-linux.cc',\n           ],\n           'conditions': [\n             ['_toolset==\"host\"', {\n"
  },
  {
    "path": "packages/nodejs-lts/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://nodejs.org/\nTERMUX_PKG_DESCRIPTION=\"Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=12.13.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=a82b1541cf670318a0102c32e06f296662b5ccccae764c1f32be4a3cf038bef6\n# Note that we do not use a shared libuv to avoid an issue with the Android\n# linker, which does not use symbols of linked shared libraries when resolving\n# symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462.\nTERMUX_PKG_DEPENDS=\"libc++, openssl, c-ares, libicu, zlib\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_CONFLICTS=\"nodejs, nodejs-current\"\nTERMUX_PKG_BREAKS=\"nodejs-dev\"\nTERMUX_PKG_REPLACES=\"nodejs-current, nodejs-dev\"\nTERMUX_PKG_HOSTBUILD=true\n\ntermux_step_post_extract_package() {\n\t# Prevent caching of host build:\n\trm -Rf $TERMUX_PKG_HOSTBUILD_DIR\n}\n\ntermux_step_host_build() {\n\tlocal ICU_VERSION=65.1\n\tlocal ICU_TAR=icu4c-${ICU_VERSION//./_}-src.tar.xz\n\tlocal ICU_DOWNLOAD=https://fossies.org/linux/misc/$ICU_TAR\n\ttermux_download \\\n\t\t$ICU_DOWNLOAD\\\n\t\t$TERMUX_PKG_CACHEDIR/$ICU_TAR \\\n\t\tbd002bdeb2e854a224c2617ba1d0e9ccea7fde3065682333902e234dce4dd380\n\ttar xf $TERMUX_PKG_CACHEDIR/$ICU_TAR\n\tcd icu/source\n\tif [ \"$TERMUX_ARCH_BITS\" = 32 ]; then\n\t\t./configure --prefix $TERMUX_PKG_HOSTBUILD_DIR/icu-installed \\\n\t\t\t--disable-samples \\\n\t\t\t--disable-tests \\\n\t\t\t--build=i686-pc-linux-gnu \"CFLAGS=-m32\" \"CXXFLAGS=-m32\" \"LDFLAGS=-m32\"\n\telse\n\t\t./configure --prefix $TERMUX_PKG_HOSTBUILD_DIR/icu-installed \\\n\t\t\t--disable-samples \\\n\t\t\t--disable-tests\n\tfi\n\tmake -j $TERMUX_MAKE_PROCESSES install\n}\n\ntermux_step_configure() {\n\tlocal DEST_CPU\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tDEST_CPU=\"arm\"\n\telif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tDEST_CPU=\"ia32\"\n\telif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\tDEST_CPU=\"arm64\"\n\telif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\tDEST_CPU=\"x64\"\n\telse\n\t\ttermux_error_exit \"Unsupported arch '$TERMUX_ARCH'\"\n\tfi\n\n\texport GYP_DEFINES=\"host_os=linux\"\n\texport CC_host=gcc\n\texport CXX_host=g++\n\texport LINK_host=g++\n\n\t# See note above TERMUX_PKG_DEPENDS why we do not use a shared libuv.\n\t./configure \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--dest-cpu=$DEST_CPU \\\n\t\t--dest-os=android \\\n\t\t--shared-cares \\\n\t\t--shared-openssl \\\n\t\t--shared-zlib \\\n\t\t--with-intl=system-icu \\\n\t\t--without-snapshot \\\n\t\t--without-node-snapshot \\\n\t\t--cross-compiling\n\n\texport LD_LIBRARY_PATH=$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib\n\tperl -p -i -e \"s@LIBS := \\\\$\\\\(LIBS\\\\)@LIBS := -L$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib -lpthread -licui18n -licuuc -licudata@\" \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/torque.host.mk \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/bytecode_builtins_list_generator.host.mk \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/v8_libbase.host.mk \\\n\t\t$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/gen-regexp-special-case.host.mk\n}\n"
  },
  {
    "path": "packages/nodejs-lts/configure.py.patch",
    "content": "diff -u -r ../node-v12.1.0/configure.py ./configure.py\n--- ../node-v12.1.0/configure.py\t2019-04-29 12:57:51.000000000 +0000\n+++ ./configure.py\t2019-05-05 21:21:04.289245037 +0000\n@@ -931,7 +931,7 @@\n                      else target_arch != host_arch)\n   want_snapshots = not options.without_snapshot\n   o['variables']['want_separate_host_toolset'] = int(\n-      cross_compiling and want_snapshots)\n+      cross_compiling)\n \n   if options.with_node_snapshot:\n     o['variables']['node_use_node_snapshot'] = 'true'\n"
  },
  {
    "path": "packages/nodejs-lts/deps-uv-src-unix-core.c.patch",
    "content": "diff -uNr node-v8.4.0/deps/uv/src/unix/core.c node-v8.4.0.mod/deps/uv/src/unix/core.c\n--- node-v8.4.0/deps/uv/src/unix/core.c\t2017-08-15 19:42:28.000000000 +0300\n+++ node-v8.4.0.mod/deps/uv/src/unix/core.c\t2017-09-14 16:13:27.292856099 +0300\n@@ -1112,7 +1112,9 @@\n \n   /* No temp environment variables defined */\n   #if defined(__ANDROID__)\n-    buf = \"/data/local/tmp\";\n+    // Don't use '/data/local/tmp' in Termux\n+    //buf = \"/data/local/tmp\";\n+    buf = \"@TERMUX_PREFIX@/tmp\";\n   #else\n     buf = \"/tmp\";\n   #endif\n"
  },
  {
    "path": "packages/nodejs-lts/deps-uv-uv.gyp.patch",
    "content": "diff -u -r ../node-v9.7.1/deps/uv/uv.gyp ./deps/uv/uv.gyp\n--- ../node-v9.7.1/deps/uv/uv.gyp\t2018-03-02 01:58:02.000000000 +0000\n+++ ./deps/uv/uv.gyp\t2018-03-05 10:51:15.530165566 +0000\n@@ -39,7 +39,7 @@\n     {\n       'target_name': 'libuv',\n       'type': '<(uv_library)',\n-      'include_dirs': [\n+      'include_dirs+': [\n         'include',\n         'src/',\n       ],\n@@ -54,7 +54,7 @@\n           '<@(shared_unix_defines)',\n           '<@(shared_zos_defines)',\n         ],\n-        'include_dirs': [ 'include' ],\n+        'include_dirs+': [ 'include' ],\n         'conditions': [\n           ['OS == \"linux\"', {\n             'defines': [ '_POSIX_C_SOURCE=200112' ],\n"
  },
  {
    "path": "packages/nodejs-lts/deps-v8-src-flags-flag-definitions.h.patch",
    "content": "diff -u -r ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h ./deps/v8/src/flags/flag-definitions.h\n--- ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h\t2019-08-20 17:14:50.000000000 +0000\n+++ ./deps/v8/src/flags/flag-definitions.h\t2019-08-24 22:38:43.754905700 +0000\n@@ -1373,7 +1373,7 @@\n DEFINE_BOOL(perf_prof_unwinding_info, false,\n             \"Enable unwinding info for perf linux profiler (experimental).\")\n DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info)\n-DEFINE_STRING(gc_fake_mmap, \"/tmp/__v8_gc__\",\n+DEFINE_STRING(gc_fake_mmap, \"/@TERMUX_PREFIX@/tmp/__v8_gc__\",\n               \"Specify the name of the file for fake gc mmap used in ll_prof\")\n DEFINE_BOOL(log_internal_timer_events, false, \"Time internal events.\")\n DEFINE_IMPLICATION(log_internal_timer_events, prof)\n"
  },
  {
    "path": "packages/nodejs-lts/deps-v8-src-logging-log.cc.patch",
    "content": "diff -u -r ../node-v12.9.0/deps/v8/src/logging/log.cc ./deps/v8/src/logging/log.cc\n--- ../node-v12.9.0/deps/v8/src/logging/log.cc\t2019-08-20 17:14:50.000000000 +0000\n+++ ./deps/v8/src/logging/log.cc\t2019-08-24 22:39:52.426124955 +0000\n@@ -280,7 +280,7 @@\n   FILE* perf_output_handle_;\n };\n \n-const char PerfBasicLogger::kFilenameFormatString[] = \"/tmp/perf-%d.map\";\n+const char PerfBasicLogger::kFilenameFormatString[] = \"@TERMUX_PREFIX@/tmp/perf-%d.map\";\n // Extra space for the PID in the filename\n const int PerfBasicLogger::kFilenameBufferPadding = 16;\n \n"
  },
  {
    "path": "packages/nodejs-lts/fix_multiple_definitions.patch",
    "content": "diff -uNr node-v12.3.1/deps/uv/src/unix/sysinfo-memory.c node-v12.3.1.mod/deps/uv/src/unix/sysinfo-memory.c\n--- node-v12.3.1/deps/uv/src/unix/sysinfo-memory.c\t2019-05-22 15:21:52.000000000 +0300\n+++ node-v12.3.1.mod/deps/uv/src/unix/sysinfo-memory.c\t2019-05-28 15:37:28.698418026 +0300\n@@ -25,6 +25,7 @@\n #include <stdint.h>\n #include <sys/sysinfo.h>\n \n+#ifndef __ANDROID__\n uint64_t uv_get_free_memory(void) {\n   struct sysinfo info;\n \n@@ -40,3 +41,4 @@\n     return (uint64_t) info.totalram * info.mem_unit;\n   return 0;\n }\n+#endif\n"
  },
  {
    "path": "packages/nodejs-lts/lib-child_process.js.patch",
    "content": "diff -u -r ../node-v6.2.0/lib/child_process.js ./lib/child_process.js\n--- ../node-v6.2.0/lib/child_process.js\t2016-05-17 15:53:06.000000000 -0400\n+++ ./lib/child_process.js\t2016-05-18 16:31:45.574685443 -0400\n@@ -335,7 +335,7 @@\n       if (typeof options.shell === 'string')\n         file = options.shell;\n       else if (process.platform === 'android')\n-        file = '/system/bin/sh';\n+        file = '@TERMUX_PREFIX@/bin/sh';\n       else\n         file = '/bin/sh';\n       args = ['-c', command];\n"
  },
  {
    "path": "packages/nodejs-lts/lib-os.js.patch",
    "content": "diff -u -r ../node-v10.9.0/lib/os.js ./lib/os.js\n--- ../node-v10.9.0/lib/os.js\t2018-08-15 13:53:34.000000000 +0000\n+++ ./lib/os.js\t2018-08-23 20:42:39.611186774 +0000\n@@ -130,7 +130,7 @@\n     path = safeGetenv('TMPDIR') ||\n            safeGetenv('TMP') ||\n            safeGetenv('TEMP') ||\n-           '/tmp';\n+           '@TERMUX_PREFIX@/tmp';\n     if (path.length > 1 && path.endsWith('/'))\n       path = path.slice(0, -1);\n   }\n"
  },
  {
    "path": "packages/nodejs-lts/node.gyp.patch",
    "content": "diff -u -r ../node-v12.9.0/node.gyp ./node.gyp\n--- ../node-v12.9.0/node.gyp\t2019-08-20 17:14:52.000000000 +0000\n+++ ./node.gyp\t2019-08-24 20:21:21.471982543 +0000\n@@ -1062,107 +1062,6 @@\n         } ],\n       ]\n     }, # specialize_node_d\n-    {\n-      'target_name': 'cctest',\n-      'type': 'executable',\n-\n-      'dependencies': [\n-        '<(node_lib_target_name)',\n-        'deps/histogram/histogram.gyp:histogram',\n-        'node_dtrace_header',\n-        'node_dtrace_ustack',\n-        'node_dtrace_provider',\n-      ],\n-\n-      'includes': [\n-        'node.gypi'\n-      ],\n-\n-      'include_dirs': [\n-        'src',\n-        'tools/msvs/genfiles',\n-        'deps/v8/include',\n-        'deps/cares/include',\n-        'deps/uv/include',\n-        'test/cctest',\n-      ],\n-\n-      'defines': [ 'NODE_WANT_INTERNALS=1' ],\n-\n-      'sources': [\n-        'src/node_snapshot_stub.cc',\n-        'src/node_code_cache_stub.cc',\n-        'test/cctest/gtest/gtest-all.cc',\n-        'test/cctest/gtest/gtest_main.cc',\n-        'test/cctest/node_test_fixture.cc',\n-        'test/cctest/node_test_fixture.h',\n-        'test/cctest/test_aliased_buffer.cc',\n-        'test/cctest/test_base64.cc',\n-        'test/cctest/test_node_postmortem_metadata.cc',\n-        'test/cctest/test_environment.cc',\n-        'test/cctest/test_linked_binding.cc',\n-        'test/cctest/test_per_process.cc',\n-        'test/cctest/test_platform.cc',\n-        'test/cctest/test_traced_value.cc',\n-        'test/cctest/test_util.cc',\n-        'test/cctest/test_url.cc',\n-      ],\n-\n-      'conditions': [\n-        [ 'node_use_openssl==\"true\"', {\n-          'defines': [\n-            'HAVE_OPENSSL=1',\n-          ],\n-        }],\n-        ['v8_enable_inspector==1', {\n-          'sources': [\n-            'test/cctest/test_inspector_socket.cc',\n-            'test/cctest/test_inspector_socket_server.cc'\n-          ],\n-          'defines': [\n-            'HAVE_INSPECTOR=1',\n-          ],\n-        }, {\n-           'defines': [\n-             'HAVE_INSPECTOR=0',\n-           ]\n-        }],\n-        ['OS==\"solaris\"', {\n-          'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ]\n-        }],\n-        # Skip cctest while building shared lib node for Windows\n-        [ 'OS==\"win\" and node_shared==\"true\"', {\n-          'type': 'none',\n-        }],\n-        [ 'node_shared==\"true\"', {\n-          'xcode_settings': {\n-            'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],\n-          },\n-        }],\n-        [ 'node_report==\"true\"', {\n-          'sources': [\n-            'test/cctest/test_report_util.cc',\n-          ],\n-          'defines': [\n-            'NODE_REPORT',\n-            'NODE_ARCH=\"<(target_arch)\"',\n-            'NODE_PLATFORM=\"<(OS)\"',\n-          ],\n-          'conditions': [\n-            ['OS==\"win\"', {\n-              'libraries': [ 'Ws2_32' ],\n-            }],\n-          ],\n-        }],\n-        ['OS==\"win\"', {\n-          'libraries': [\n-            'Dbghelp.lib',\n-            'winmm.lib',\n-            'Ws2_32.lib',\n-          ],\n-        }],\n-      ],\n-    }, # cctest\n \n     # TODO(joyeecheung): do not depend on node_lib,\n     # instead create a smaller static library node_lib_base that does\n"
  },
  {
    "path": "packages/nodejs-lts/npm-link-patch.patch",
    "content": "--- ../node/deps/npm/node_modules/cacache/lib/util/move-file.js\t2017-10-22 19:30:25.778456404 +0200\n+++ ./deps/npm/node_modules/cacache/lib/util/move-file.js\t2017-10-22 20:41:18.021337095 +0200\n@@ -4,6 +4,7 @@\n const BB = require('bluebird')\n const chmod = BB.promisify(fs.chmod)\n const unlink = BB.promisify(fs.unlink)\n+const access = BB.promisify(fs.access)\n let move\n let pinflight\n \n@@ -18,6 +19,18 @@\n   // content their own way.\n   //\n   // Note that, as the name suggests, this strictly only supports file moves.\n+\n+\n+  // Calling link() on android is not allowed, we get a SELinux security exception\n+  if(process.platform === 'android') {\n+    return access(dest, fs.constants.F_OK)\n+      .catch(err => {\n+        if (!move) { move = require('move-concurrently') }\n+        return move(src, dest, { BB, fs })\n+          .then(() => chmod(dest, '0444'))\n+      })\n+  }\n+\n   return BB.fromNode(cb => {\n     fs.link(src, dest, err => {\n       if (err) {\n"
  },
  {
    "path": "packages/nodejs-lts/src-cares_wrap.cc.patch",
    "content": "diff -u -r ../node-v6.0.0/src/cares_wrap.cc ./src/cares_wrap.cc\n--- ../node-v6.0.0/src/cares_wrap.cc\t2016-04-26 15:50:22.000000000 -0400\n+++ ./src/cares_wrap.cc\t2016-05-02 00:24:26.349502775 -0400\n@@ -15,8 +15,7 @@\n #include <stdlib.h>\n #include <string.h>\n \n-#if defined(__ANDROID__) || \\\n-    defined(__MINGW32__) || \\\n+#if defined(__MINGW32__) || \\\n     defined(__OpenBSD__) || \\\n     defined(_MSC_VER)\n"
  },
  {
    "path": "packages/nodejs-lts/src-node_internals.h.patch",
    "content": "diff -u -r ../node-v11.7.0/src/node_internals.h ./src/node_internals.h\n--- ../node-v11.7.0/src/node_internals.h\t2019-01-17 21:27:16.000000000 +0000\n+++ ./src/node_internals.h\t2019-01-18 22:44:06.207542176 +0000\n@@ -358,7 +358,7 @@\n \n // Functions defined in node.cc that are exposed via the bootstrapper object\n \n-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)\n+#if defined(__POSIX__) && !defined(__CloudABI__)\n #define NODE_IMPLEMENTS_POSIX_CREDENTIALS 1\n #endif  // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)\n \n"
  },
  {
    "path": "packages/nodejs-lts/src-node_main.cc.patch",
    "content": "diff -u -r ../node-v6.3.1/src/node_main.cc ./src/node_main.cc\n--- ../node-v6.3.1/src/node_main.cc\t2016-07-21 16:44:43.000000000 -0400\n+++ ./src/node_main.cc\t2016-07-23 13:53:57.530095071 -0400\n@@ -54,6 +54,10 @@\n   // calls elsewhere in the program (e.g., any logging from V8.)\n   setvbuf(stdout, nullptr, _IONBF, 0);\n   setvbuf(stderr, nullptr, _IONBF, 0);\n+  if (getenv(\"TMPDIR\") == NULL) {\n+    // Give javascript programs (such as updated versions of npm) a working tmpdir.\n+    putenv(\"TMPDIR=@TERMUX_PREFIX@/tmp\");\n+  }\n   return node::Start(argc, argv);\n }\n #endif\n"
  },
  {
    "path": "packages/nodejs-lts/tools-v8_gypfiles-v8.gyp.patch",
    "content": "diff -u -r ../node-v12.9.0/tools/v8_gypfiles/v8.gyp ./tools/v8_gypfiles/v8.gyp\n--- ../node-v12.9.0/tools/v8_gypfiles/v8.gyp\t2019-08-20 17:14:53.000000000 +0000\n+++ ./tools/v8_gypfiles/v8.gyp\t2019-08-24 22:02:57.943558855 +0000\n@@ -1010,6 +1010,7 @@\n             '<(V8_ROOT)/src/base/platform/platform-posix.h',\n             '<(V8_ROOT)/src/base/platform/platform-posix-time.cc',\n             '<(V8_ROOT)/src/base/platform/platform-posix-time.h',\n+            '<(V8_ROOT)/src/base/platform/platform-linux.cc',\n           ],\n           'conditions': [\n             ['_toolset==\"host\"', {\n"
  },
  {
    "path": "packages/notmuch/Makefile.global.patch",
    "content": "Using CXX as the final linker avoids the following problem on 32-bit arm:\n\nlibgcc/unwind-arm-common.inc:855: error: undefined reference to '__cxa_call_unexpected'\n\ndiff -u -r ../notmuch-0.25/Makefile.global ./Makefile.global\n--- ../notmuch-0.25/Makefile.global\t2017-07-25 13:30:24.000000000 +0200\n+++ ./Makefile.global\t2017-08-18 21:15:27.998770016 +0200\n@@ -57,7 +57,7 @@\n FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS)\n endif\n FINAL_NOTMUCH_LDFLAGS += $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(ZLIB_LDFLAGS)\n-FINAL_NOTMUCH_LINKER = CC\n+FINAL_NOTMUCH_LINKER = CXX\n ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)\n FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)\n FINAL_NOTMUCH_LINKER = CXX\n"
  },
  {
    "path": "packages/notmuch/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://notmuchmail.org\nTERMUX_PKG_DESCRIPTION=\"Thread-based email index, search and tagging system\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.29.3\nTERMUX_PKG_SHA256=d5f704b9a72395e43303de9b1f4d8e14dd27bf3646fdbb374bb3dbb7d150dc35\nTERMUX_PKG_SRCURL=https://notmuchmail.org/releases/notmuch-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"glib, libc++, libgmime, libtalloc, libxapian, zlib\"\nTERMUX_PKG_BREAKS=\"notmuch-dev\"\nTERMUX_PKG_REPLACES=\"notmuch-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\t# Use python3 so that the python3-sphinx package is\n\t# found for man page generation.\n\texport PYTHON=python3\n\n\tcd $TERMUX_PKG_SRCDIR\n\tXAPIAN_CONFIG=$TERMUX_PREFIX/bin/xapian-config ./configure \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--without-api-docs \\\n\t\t--without-desktop \\\n\t\t--without-emacs \\\n\t\t--without-ruby\n}\n"
  },
  {
    "path": "packages/notmuch/configure.patch",
    "content": "diff -u -r ../notmuch-0.29.2/configure ./configure\n--- ../notmuch-0.29.2/configure\t2019-10-19 10:37:37.000000000 +0000\n+++ ./configure\t2019-10-23 07:21:43.909655362 +0000\n@@ -380,7 +380,7 @@\n     return 0;\n }\n EOF\n-if ${CC} ${CFLAGS} -I\"$srcdir\" _libversion.c -o _libversion > /dev/null 2>&1 \\\n+if ${CC_FOR_BUILD} -I\"$srcdir\" _libversion.c -o _libversion > /dev/null 2>&1 \\\n        && ./_libversion > _libversion.sh && . ./_libversion.sh\n then\n     printf \"OK.\\n\"\n@@ -498,67 +498,6 @@\n     gmime_cflags=$(pkg-config --cflags gmime-3.0)\n     gmime_ldflags=$(pkg-config --libs gmime-3.0)\n \n-    printf \"Checking for GMime session key extraction support... \"\n-\n-    cat > _check_session_keys.c <<EOF\n-#include <gmime/gmime.h>\n-#include <stdio.h>\n-\n-int main () {\n-    GError *error = NULL;\n-    GMimeParser *parser = NULL;\n-    GMimeMultipartEncrypted *body = NULL;\n-    GMimeDecryptResult *decrypt_result = NULL;\n-    GMimeObject *output = NULL;\n-\n-    g_mime_init ();\n-    parser = g_mime_parser_new ();\n-    g_mime_parser_init_with_stream (parser, g_mime_stream_file_open(\"test/corpora/crypto/basic-encrypted.eml\", \"r\", &error));\n-    if (error) return !! fprintf (stderr, \"failed to instantiate parser with test/corpora/crypto/basic-encrypted.eml\\n\");\n-\n-    body = GMIME_MULTIPART_ENCRYPTED(g_mime_message_get_mime_part (g_mime_parser_construct_message (parser, NULL)));\n-    if (body == NULL) return !!\tfprintf (stderr, \"did not find a multipart encrypted message\\n\");\n-\n-    output = g_mime_multipart_encrypted_decrypt (body, GMIME_DECRYPT_EXPORT_SESSION_KEY, NULL, &decrypt_result, &error);\n-    if (error || output == NULL) return !! fprintf (stderr, \"decryption failed\\n\");\n-\n-    if (decrypt_result == NULL) return !! fprintf (stderr, \"no GMimeDecryptResult found\\n\");\n-    if (decrypt_result->session_key == NULL) return !! fprintf (stderr, \"GMimeDecryptResult has no session key\\n\");\n-\n-    printf (\"%s\\n\", decrypt_result->session_key);\n-    return 0;\n-}\n-EOF\n-    if ! TEMP_GPG=$(mktemp -d \"${TMPDIR:-/tmp}/notmuch.XXXXXX\"); then\n-        printf 'No.\\nCould not make tempdir for testing session-key support.\\n'\n-        errors=$((errors + 1))\n-    elif ${CC} ${CFLAGS} ${gmime_cflags} _check_session_keys.c ${gmime_ldflags} -o _check_session_keys \\\n-           && GNUPGHOME=${TEMP_GPG} gpg --batch --quiet --import < test/gnupg-secret-key.asc \\\n-           && SESSION_KEY=$(GNUPGHOME=${TEMP_GPG} ./_check_session_keys) \\\n-           && [ $SESSION_KEY = 9:0BACD64099D1468AB07C796F0C0AC4851948A658A15B34E803865E9FC635F2F5 ]\n-    then\n-        printf \"OK.\\n\"\n-    else\n-        cat <<EOF\n-No.\n-*** Error: Could not extract session keys from encrypted message.\n-\n-This is likely due to your GMime having been built against a old\n-version of GPGME.\n-\n-Please try to rebuild your version of GMime against a more recent\n-version of GPGME (at least GPGME 1.8.0).\n-EOF\n-        if command -v gpgme-config >/dev/null; then\n-            printf 'Your current GPGME development version is: %s\\n' \"$(gpgme-config --version)\"\n-        else\n-            printf 'You do not have the GPGME development libraries installed.\\n'\n-        fi\n-        errors=$((errors + 1))\n-    fi\n-    if [ -n \"$TEMP_GPG\" -a -d \"$TEMP_GPG\" ]; then\n-        rm -rf \"$TEMP_GPG\"\n-    fi\n else\n     have_gmime=0\n     printf \"No.\\n\"\n@@ -662,12 +601,7 @@\n fi\n \n printf \"Checking for bash-completion (>= 1.90)... \"\n-if pkg-config --atleast-version=1.90 bash-completion; then\n     printf \"Yes.\\n\"\n-else\n-    printf \"No (will not install bash completion).\\n\"\n-    WITH_BASH=0\n-fi\n \n if [ -z \"${EMACSLISPDIR-}\" ]; then\n     EMACSLISPDIR=\"\\$(prefix)/share/emacs/site-lisp\"\n"
  },
  {
    "path": "packages/notmuch/notmuch-config.c.patch",
    "content": "diff -u -r ../notmuch-0.24.1/notmuch-config.c ./notmuch-config.c\n--- ../notmuch-0.24.1/notmuch-config.c\t2017-04-01 14:29:38.000000000 +0200\n+++ ./notmuch-config.c\t2017-04-07 01:01:21.205661688 +0200\n@@ -157,6 +157,8 @@\n         pw_buf = talloc_zero_size(ctx, pw_buf_size);\n     }\n \n+#if !defined(__ANDROID__) || defined(__LP64__)\n+    /* Only 64-bit Android has the pw_gecos field. */\n     if (e == 0) {\n \tchar *comma = strchr (passwd.pw_gecos, ',');\n \tif (comma)\n@@ -167,6 +169,9 @@\n     } else {\n \tname = talloc_strdup (ctx, \"\");\n     }\n+#else\n+    name = talloc_strdup (ctx, \"\");\n+#endif\n \n     talloc_free (pw_buf);\n \n"
  },
  {
    "path": "packages/nyancat/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://nyancat.dakko.us\nTERMUX_PKG_DESCRIPTION=\"Nyancat in your terminal, rendered through ANSI escape sequences.\"\nTERMUX_PKG_LICENSE=\"NCSA\"\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_VERSION=1.5.2\nTERMUX_PKG_SHA256=88cdcaa9c7134503dd0364a97fa860da3381a09cb555c3aae9918360827c2032\nTERMUX_PKG_SRCURL=https://github.com/klange/nyancat/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/nyancat/makefile.patch",
    "content": "diff --git a/Makefile b/Makefile\nindex 8d68431..6653583 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -33,7 +33,9 @@ distcheck: $(distdir).tar.gz\n \t@echo \"*** Package $(distdir).tar.gz is ready for distribution.\"\n \n install: all\n-\tinstall src/nyancat /usr/bin/${package}\n-\tgzip -9 -c < nyancat.1 > /usr/share/man/man1/nyancat.1.gz\n+\tinstall -d \"$(DESTDIR)$(PREFIX)/bin\"\n+\tinstall -d \"$(DESTDIR)$(PREFIX)/share/man/man1\"\n+\tinstall src/nyancat \"$(DESTDIR)$(PREFIX)/bin/nyancat\"\n+\tinstall -m644 nyancat.1 \"$(DESTDIR)$(PREFIX)/share/man/man1/nyancat.1\"\n \n .PHONY: FORCE all clean check dist distcheck install\n"
  },
  {
    "path": "packages/nzbget/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://nzbget.net/\nTERMUX_PKG_DESCRIPTION=\"The most efficient usenet downloader\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=21.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/nzbget/nzbget/releases/download/v${TERMUX_PKG_VERSION}/nzbget-${TERMUX_PKG_VERSION}-src.tar.gz\nTERMUX_PKG_SHA256=65a5d58eb8f301e62cf086b72212cbf91de72316ffc19182ae45119ddd058d53\nTERMUX_PKG_DEPENDS=\"libc++, libxml2, ncurses, openssl, p7zip, zlib\"\nTERMUX_PKG_RECOMMENDS=\"unrar\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"if [ -z \\\"\\$2\\\" ]; then\" >> postinst # Run only on fresh install, not on upgrade\n\techo \"sed -e 's|^\\(CertStore=\\).*|\\1$TERMUX_PREFIX/etc/tls/cert.pem|g\" >> postinst\n\techo \"s|^\\(ControlPassword=\\).*|\\1|g' $TERMUX_PREFIX/share/nzbget/nzbget.conf > $TERMUX_PREFIX/etc/nzbget.conf\" >> postinst\n\techo \"fi\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n}\n"
  },
  {
    "path": "packages/nzbget/options.cpp.patch",
    "content": "diff --git a/daemon/main/Options.cpp b/daemon/main/Options.cpp\nindex f41bd824..50fa8dd9 100644\n--- a/daemon/main/Options.cpp\n+++ b/daemon/main/Options.cpp\n@@ -182,10 +182,7 @@ const int BoolCount = 12;\n const char* PossibleConfigLocations[] =\n \t{\n \t\t\"~/.nzbget\",\n-\t\t\"/etc/nzbget.conf\",\n-\t\t\"/usr/etc/nzbget.conf\",\n-\t\t\"/usr/local/etc/nzbget.conf\",\n-\t\t\"/opt/etc/nzbget.conf\",\n+\t\t\"@TERMUX_PREFIX@/etc/nzbget.conf\",\n \t\tnullptr\n \t};\n #endif\n"
  },
  {
    "path": "packages/oathtool/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.nongnu.org/oath-toolkit/\nTERMUX_PKG_DESCRIPTION=\"One-time password components\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.6.2\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=http://download.savannah.nongnu.org/releases/oath-toolkit/oath-toolkit-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=b03446fa4b549af5ebe4d35d7aba51163442d255660558cd861ebce536824aa0\nTERMUX_PKG_DEPENDS=\"xmlsec, zlib\"\nTERMUX_PKG_BREAKS=\"oathtool-dev\"\nTERMUX_PKG_REPLACES=\"oathtool-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-pam\"\n\ntermux_step_pre_configure() {\n\tif $TERMUX_DEBUG; then\n\t\t# When doing debug build, -D_FORTIFY_SOURCE=2 gives this error:\n\t\t# /home/builder/.termux-build/oathtool/src/liboath/usersfile.c:482:46: error: 'umask' called with invalid mode\n\t\t#       old_umask = umask (~(S_IRUSR | S_IWUSR));\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n"
  },
  {
    "path": "packages/obfs4proxy/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/Yawning/obfs4\nTERMUX_PKG_DESCRIPTION=\"A pluggable transport plugin for Tor\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause, BSD 3-Clause, GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.0.11\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/Yawning/obfs4/archive/obfs4proxy-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=46f621f1d94d244e7b1d0b93dafea7abadb2428f8b1d0463559426362ea98eae\nTERMUX_PKG_BUILD_IN_SRC=true\n\n## obfs4proxy is a pluggable transport plugin for Tor, so\n## marking \"tor\" package as dependency.\nTERMUX_PKG_DEPENDS=\"tor\"\n\ntermux_step_make() {\n\ttermux_setup_golang\n\tcd \"$TERMUX_PKG_SRCDIR\"/obfs4proxy\n\tgo get -d ./...\n\tgo build .\n}\n\ntermux_step_post_make_install() {\n\tcd \"$TERMUX_PKG_SRCDIR\"/obfs4proxy\n\tinstall -Dm700 obfs4proxy \"${TERMUX_PREFIX}\"/bin/\n}\n"
  },
  {
    "path": "packages/ocrad/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/ocrad/ocrad.html\nTERMUX_PKG_DESCRIPTION=\"Optical Character Recognition program based on a feature extraction method\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.27\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/ocrad/ocrad-${TERMUX_PKG_VERSION}.tar.lz\nTERMUX_PKG_SHA256=a9bfe67e9a040907aff5640dca56392476b6a89e48e37dc94ba846c5b6733b36\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BREAKS=\"ocrad-dev\"\nTERMUX_PKG_REPLACES=\"ocrad-dev\"\n"
  },
  {
    "path": "packages/ocrad/configure.patch",
    "content": "diff -u -r ../ocrad-0.23/configure ./configure\n--- ../ocrad-0.23/configure\t2014-03-10 21:19:33.000000000 +0100\n+++ ./configure\t2014-08-03 03:00:32.678020824 +0200\n@@ -16,7 +16,7 @@\n LC_ALL=C\n export LC_ALL\n srcdir=\n-prefix=/usr/local\n+prefix=@TERMUX_PREFIX@\n exec_prefix='$(prefix)'\n bindir='$(exec_prefix)/bin'\n datarootdir='$(prefix)/share'\n@@ -24,10 +24,6 @@\n infodir='$(datarootdir)/info'\n libdir='${exec_prefix}/lib'\n mandir='$(datarootdir)/man'\n-CXX=g++\n-CPPFLAGS=\n-CXXFLAGS='-Wall -W -O2'\n-LDFLAGS=\n \n # checking whether we are using GNU C++.\n ${CXX} --version > /dev/null 2>&1\n"
  },
  {
    "path": "packages/odt2txt/Makefile.patch",
    "content": "diff -uNr odt2txt-0.5/Makefile odt2txt-0.5.mod/Makefile\n--- odt2txt-0.5/Makefile\t2014-11-18 19:10:08.000000000 +0200\n+++ odt2txt-0.5.mod/Makefile\t2019-08-13 21:39:23.220216345 +0300\n@@ -14,7 +14,7 @@\n CFLAGS += -DNO_ICONV\n endif\n \n-LIBS = -lz\n+LIBS = -liconv -lz\n ZIP_OBJS =\n ifdef HAVE_LIBZIP\n \tCFLAGS += -DHAVE_LIBZIP\n"
  },
  {
    "path": "packages/odt2txt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/dstosberg/odt2txt\nTERMUX_PKG_DESCRIPTION=\"Simple converter from OpenDocument Text to plain text\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.5\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/dstosberg/odt2txt/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=23a889109ca9087a719c638758f14cc3b867a5dcf30a6c90bf6a0985073556dd\nTERMUX_PKG_DEPENDS=\"libiconv, libzip, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"HAVE_LIBZIP=1 DESTDIR=$TERMUX_PREFIX\"\n"
  },
  {
    "path": "packages/oleo/basic.h.patch",
    "content": "--- ../tmp-orig/oleo-1.99.16/src/basic.h        2000-08-10 23:02:49.000000000 +0200\n+++ src/src/basic.h       2005-03-18 20:42:30.963398869 +0100\n@@ -36,9 +36,6 @@\n \n extern const int colmagic[9];\n extern  const int rowmagic[9];\n-extern char * motion_name[9];\n-extern enum motion_magic complementary_motion[9];\n-extern enum motion_magic opposite_motion[9];\n \n extern int run_load_hooks;\n"
  },
  {
    "path": "packages/oleo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/oleo/\nTERMUX_PKG_DESCRIPTION=\"The GNU Spreadsheet\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.99.16\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=http://ftp.gnu.org/gnu/oleo/oleo-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=6598df85d06ff2534ec08ed0657508f17dbbc58dd02d419160989de7c487bc86\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-x --infodir=$TERMUX_PREFIX/share/info\"\nTERMUX_PKG_KEEP_INFOPAGES=true\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nOleo/*\nshare/oleo/oleo.html\"\n"
  },
  {
    "path": "packages/oleo/global.h.patch",
    "content": "--- ../tmp-orig/oleo-1.99.16/src/global.h       2005-03-18 20:45:06.300809009 +0100\n+++ src/src/global.h      2005-03-18 20:42:30.963398869 +0100\n@@ -231,7 +231,7 @@\n \n extern unsigned short current_cycle;\n extern int ioerror;\n-extern int errno;\n+#include <errno.h>\n extern const char oleo_version_string[];\n \n extern double astof (char **);\n"
  },
  {
    "path": "packages/oleo/io-term.c.patch",
    "content": "--- ../tmp-orig/oleo-1.99.16/src/io-term.c      2001-02-14 00:38:06.000000000 +0100\n+++ src/src/io-term.c     2005-03-18 20:43:36.991391876 +0100\n@@ -234,7 +234,7 @@\n \n \t\tif (Preferences[i].copynext) {\n \t\t\tptr += strlen(Preferences[i].name) + 1;\n-\t\t\t((char *)Preferences[i].var) = strdup(ptr);\n+\t\t\tPreferences[i].var = strdup(ptr);\n \t\t} else if (Preferences[i].var)\n \t\t\t*((int *)Preferences[i].var) = Preferences[i].value;\n\n@@ -770,6 +770,8 @@\n     }\n }\n \n+extern struct cmd_func cmd_funcs[];\n+\n static void\n init_maps (void)\n {\n"
  },
  {
    "path": "packages/oleo/io-term.h.patch",
    "content": "--- ../tmp-orig/oleo-1.99.16/src/io-term.h      2001-02-10 09:27:04.000000000 +0100\n+++ src/src/io-term.h     2005-03-18 20:43:06.794338687 +0100\n@@ -44,8 +44,6 @@\n extern int default_lock;\n \n \n-extern struct cmd_func cmd_funcs[];\n-\n /* When printing ascii output, this controls page width. */\n extern int modified;\n"
  },
  {
    "path": "packages/oleo/plotter.c.patch",
    "content": "--- plotter.c\t2018-02-22 08:59:06.651246905 +0000\n+++ src/src/plotter.c\t2018-02-22 09:00:15.471539332 +0000\n@@ -2639,8 +2639,6 @@\n \tcase SP_PLOT_PIE:\n \t\tsp_pie_plot_point(mg, point);\n \t\tbreak;\n-\tdefault:\n-\t\t/* ?? */\n \t}\n }\n \n@@ -2770,8 +2768,6 @@\n \tcase SP_PLOT_PIE:\n \t\tsp_pie_begin_graph(mg, scale, trans_x, trans_y);\n \t\tbreak;\n-\tdefault:\n-\t\t/* ??? */\n \t}\n \n \tsp_first_dataset(mg);\n@@ -2790,8 +2786,6 @@\n \tcase SP_PLOT_PIE:\n \t\tsp_pie_end_graph(mg);\n \t\tbreak;\n-\tdefault:\n-\t\t/* ??? */\n \t}\n }\n \n"
  },
  {
    "path": "packages/oleo/texi2html.in.patch",
    "content": "--- src/texi2html.in\t2018-02-22 08:34:18.770561548 +0000\n+++ src/doc/texi2html.in\t2018-02-22 08:35:13.413226481 +0000\n@@ -2752,7 +2752,7 @@\n     s/\\@refill\\s+//g;\n     # other substitutions\n     &simple_substitutions;\n-    s/\\@value{($VARRE)}/$value{$1}/eg;\n+    s/\\@value\\{($VARRE)\\}/$value{$1}/eg;\n     s/\\@footnote\\{/\\@footnote$docu_doc\\{/g; # mark footnotes, cf. pass 4\n     #\n     # analyze the tag again\n@@ -3174,7 +3174,7 @@\n     #\n     # xref\n     #\n-    while (/\\@(x|px|info|)ref{([^{}]+)(}?)/) {\n+    while (/\\@(x|px|info|)ref\\{([^{}]+)(\\}?)/) {\n \t# note: Texinfo may accept other characters\n \t($type, $nodes, $full) = ($1, $2, $3);\n \t($before, $after) = ($`, $');\n@@ -3790,9 +3790,9 @@\n     my $ret;\n \n     $level--; # here we start at 0\n-    if ($name =~ /^appendix/ || defined(@appendix_sec_num)) {\n+    if ($name =~ /^appendix/ || defined()) {\n \t# appendix style\n-\tif (defined(@appendix_sec_num)) {\n+\tif (defined()) {\n \t    &incr_sec_num($level, @appendix_sec_num);\n \t} else {\n \t    @appendix_sec_num = ('A', 0, 0, 0);\n@@ -3800,7 +3800,7 @@\n \t$ret = join('.', @appendix_sec_num[0..$level]);\n     } else {\n \t# normal style\n-\tif (defined(@normal_sec_num)) \n+\tif (defined()) \n \t{\n \t  &incr_sec_num($level, @normal_sec_num);\n \t} \n"
  },
  {
    "path": "packages/oleo/xrdb.c.patch",
    "content": "--- ../tmp-orig/oleo-1.99.16/src/xrdb.c 2000-08-10 23:02:51.000000000 +0200\n+++ src/src/xrdb.c        2005-03-18 20:42:30.966398277 +0100\n@@ -450,6 +450,7 @@\n \n #ifdef TESTRM\n #include <stdio.h>\n+#include <errno.h>\n #include \"arg-list.h\"\n \n static void\n@@ -457,7 +458,6 @@\n     char *msg, *prog;\n     int x1, x2, x3, x4, x5;\n {\n-    extern int errno;\n \n     if (errno)\n       perror (prog);\n\n"
  },
  {
    "path": "packages/openal-soft/alc-alconfig.cpp.patch",
    "content": "diff -u -r ../openal-soft-openal-soft-1.20.0/alc/alconfig.cpp ./alc/alconfig.cpp\n--- ../openal-soft-openal-soft-1.20.0/alc/alconfig.cpp\t2019-11-28 08:45:08.000000000 +0000\n+++ ./alc/alconfig.cpp\t2019-12-01 17:05:51.388007000 +0000\n@@ -325,7 +325,7 @@\n \n void ReadALConfig()\n {\n-    const char *str{\"/etc/openal/alsoft.conf\"};\n+    const char *str{\"@TERMUX_PREFIX@/etc/openal/alsoft.conf\"};\n \n     TRACE(\"Loading config %s...\\n\", str);\n     al::ifstream f{str};\n@@ -333,7 +333,7 @@\n         LoadConfigFromFile(f);\n     f.close();\n \n-    std::string confpaths{al::getenv(\"XDG_CONFIG_DIRS\").value_or(\"/etc/xdg\")};\n+    std::string confpaths{al::getenv(\"XDG_CONFIG_DIRS\").value_or(\"@TERMUX_PREFIX@/etc/xdg\")};\n     /* Go through the list in reverse, since \"the order of base directories\n      * denotes their importance; the first directory listed is the most\n      * important\". Ergo, we need to load the settings from the later dirs\n"
  },
  {
    "path": "packages/openal-soft/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://openal-soft.org/\nTERMUX_PKG_DESCRIPTION=\"Software implementation of the OpenAL API\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.20.0\nTERMUX_PKG_SRCURL=https://github.com/kcat/openal-soft/archive/openal-soft-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=ea1582337ce0344754cc6742b9a5da248fb971fb6fbcc592f843f765423d9265\nTERMUX_PKG_BREAKS=\"openal-soft-dev\"\nTERMUX_PKG_REPLACES=\"openal-soft-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DALSOFT_UTILS=OFF\n-DALSOFT_EXAMPLES=OFF\n-DALSOFT_TESTS=OFF\n\"\n"
  },
  {
    "path": "packages/openal-soft/native-tools-CMakeLists.txt.patch",
    "content": "diff -uNr openal-soft-openal-soft-1.19.1/native-tools/CMakeLists.txt openal-soft-openal-soft-1.19.1.mod/native-tools/CMakeLists.txt\n--- openal-soft-openal-soft-1.19.1/native-tools/CMakeLists.txt\t2018-10-12 01:05:31.000000000 +0300\n+++ openal-soft-openal-soft-1.19.1.mod/native-tools/CMakeLists.txt\t2019-07-24 15:09:41.667923002 +0300\n@@ -4,6 +4,11 @@\n \n include(CheckLibraryExists)\n \n+set(CMAKE_C_COMPILER gcc)\n+set(CMAKE_C_FLAGS \"\")\n+set(CMAKE_LINKER \"\")\n+set(CMAKE_EXE_LINKER_FLAGS \"\")\n+\n set(CPP_DEFS )\n if(WIN32)\n     set(CPP_DEFS ${CPP_DEFS} _WIN32)\n"
  },
  {
    "path": "packages/openjpeg/CMakeLists.txt.patch",
    "content": "diff -u -r ../openjpeg-2.1.2/CMakeLists.txt ./CMakeLists.txt\n--- ../openjpeg-2.1.2/CMakeLists.txt\t2016-09-28 20:18:16.000000000 +0200\n+++ ./CMakeLists.txt\t2017-01-19 05:15:37.168652776 +0100\n@@ -148,7 +148,7 @@\n   # We could install *.cmake files in share/ however those files contains\n   # hardcoded path to libraries on a multi-arch system (fedora/debian) those\n   # path will be different (lib/i386-linux-gnu vs lib/x86_64-linux-gnu)\n-  set(OPENJPEG_INSTALL_PACKAGE_DIR \"${OPENJPEG_INSTALL_LIB_DIR}/${OPENJPEG_INSTALL_SUBDIR}\")\n+  set(OPENJPEG_INSTALL_PACKAGE_DIR \"${OPENJPEG_INSTALL_LIB_DIR}/cmake/${OPENJPEG_INSTALL_SUBDIR}\")\n endif()\n \n if (APPLE)\n"
  },
  {
    "path": "packages/openjpeg/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.openjpeg.org/\nTERMUX_PKG_DESCRIPTION=\"JPEG 2000 image compression library\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=2.3.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9\nTERMUX_PKG_BREAKS=\"openjpeg-dev\"\nTERMUX_PKG_REPLACES=\"openjpeg-dev\"\nTERMUX_PKG_SRCURL=https://github.com/uclouvain/openjpeg/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DBUILD_STATIC_LIBS=OFF\"\n# for fast building packages that depend on openjpeg with cmake\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Force symlinks to be overwritten:\n\trm -Rf $TERMUX_PREFIX/lib/libopenjp2.so*\n}\n"
  },
  {
    "path": "packages/openjpeg/openjpeg-tools.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/\"\nTERMUX_SUBPKG_DESCRIPTION=\"Command-line tools using the JPEG 2000 library\"\nTERMUX_SUBPKG_DEPENDS=\"libtiff, littlecms, libpng\"\n"
  },
  {
    "path": "packages/openssh/Makefile.in.patch",
    "content": "diff -u -r ../openssh-7.9p1/Makefile.in ./Makefile.in\n--- ../openssh-7.9p1/Makefile.in\t2018-10-17 00:01:20.000000000 +0000\n+++ ./Makefile.in\t2018-11-22 23:35:57.866748335 +0000\n@@ -172,7 +172,7 @@\n \t$(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHLIBS) $(LIBS) $(GSSLIBS)\n \n sshd$(EXEEXT): libssh.a\t$(LIBCOMPAT) $(SSHDOBJS)\n-\t$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS)\n+\t$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -ltermux-auth -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS)\n \n scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o\n \t$(LD) -o $@ scp.o progressmeter.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)\n"
  },
  {
    "path": "packages/openssh/auth.c.patch",
    "content": "diff -u -r ../openssh-6.6p1/auth.c ./auth.c\n--- ../openssh-6.6p1/auth.c\t2013-06-01 23:41:51.000000000 +0200\n+++ ./auth.c\t2014-06-04 12:59:53.060699278 +0200\n@@ -603,7 +603,13 @@\n \taix_setauthdb(user);\n #endif\n \n+#ifdef __ANDROID__\n+        /* Effectively a single-user system, use current user no matter supplied user */\n+        pw = getpwuid(getuid());\n+#else\n \tpw = getpwnam(user);\n+#endif\n+\n \n #if defined(_AIX) && defined(HAVE_SETAUTHDB)\n \taix_restoreauthdb();\n"
  },
  {
    "path": "packages/openssh/auth2-passwd.c.patch",
    "content": "diff -uNr openssh-7.9p1/auth2-passwd.c openssh-7.9p1.mod/auth2-passwd.c\n--- openssh-7.9p1/auth2-passwd.c\t2018-10-17 03:01:20.000000000 +0300\n+++ openssh-7.9p1.mod/auth2-passwd.c\t2018-10-21 14:30:10.208918070 +0300\n@@ -30,6 +30,8 @@\n #include <string.h>\n #include <stdarg.h>\n \n+#include <termux-auth.h>\n+\n #include \"packet.h\"\n #include \"ssherr.h\"\n #include \"log.h\"\n@@ -62,7 +64,7 @@\n \n \tif (change)\n \t\tlogit(\"password change not supported\");\n-\telse if (PRIVSEP(auth_password(ssh, password)) == 1)\n+\telse if (termux_auth(((Authctxt *)ssh->authctxt)->user, password))\n \t\tauthenticated = 1;\n \texplicit_bzero(password, len);\n \tfree(password);\n"
  },
  {
    "path": "packages/openssh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.openssh.com/\nTERMUX_PKG_DESCRIPTION=\"Secure shell for logging into a remote machine\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=8.1p1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=02f5dbef3835d0753556f973cd57b4c19b6b1f6cd24c03445e23ac77ca1b93ff\nTERMUX_PKG_SRCURL=https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libandroid-support, ldns, openssl, libedit, termux-auth, krb5, zlib\"\nTERMUX_PKG_CONFLICTS=\"dropbear\"\n# --disable-strip to prevent host \"install\" command to use \"-s\", which won't work for target binaries:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-etc-default-login\n--disable-lastlog\n--disable-libutil\n--disable-pututline\n--disable-pututxline\n--disable-strip\n--disable-utmp\n--disable-utmpx\n--disable-wtmp\n--disable-wtmpx\n--sysconfdir=$TERMUX_PREFIX/etc/ssh\n--with-cflags=-Dfd_mask=int\n--with-ldns\n--with-libedit\n--with-mantype=man\n--without-ssh1\n--without-stackprotect\n--with-pid-dir=$TERMUX_PREFIX/var/run\n--with-privsep-path=$TERMUX_PREFIX/var/empty\n--with-xauth=$TERMUX_PREFIX/bin/xauth\n--with-kerberos5\nac_cv_func_endgrent=yes\nac_cv_func_fmt_scaled=no\nac_cv_func_getlastlogxbyname=no\nac_cv_func_readpassphrase=no\nac_cv_func_strnvis=no\nac_cv_header_sys_un_h=yes\nac_cv_search_getrrsetbyname=no\nac_cv_func_bzero=yes\n\"\nTERMUX_PKG_MAKE_INSTALL_TARGET=\"install-nokeys\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/slogin share/man/man1/slogin.1\"\nTERMUX_PKG_CONFFILES=\"etc/ssh/ssh_config etc/ssh/sshd_config var/service/sshd/run var/service/sshd/log/run\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tautoreconf\n\n    ## Configure script require this variable to set\n    ## prefixed path to program 'passwd'\n    export PATH_PASSWD_PROG=\"${TERMUX_PREFIX}/bin/passwd\"\n\n\tCPPFLAGS+=\" -DHAVE_ATTRIBUTE__SENTINEL__=1 -DBROKEN_SETRESGID -DTERMUX_EXPOSE_FILE_OFFSET64\"\n\tLD=$CC # Needed to link the binaries\n\tLDFLAGS+=\" -llog\" # liblog for android logging in syslog hack\n}\n\ntermux_step_post_configure() {\n\t# We need to remove this file before installing, since otherwise the\n\t# install leaves it alone which means no updated timestamps.\n\trm -Rf $TERMUX_PREFIX/etc/moduli\n}\n\ntermux_step_post_make_install() {\n\techo -e \"PrintMotd yes\\nPasswordAuthentication yes\\nSubsystem sftp $TERMUX_PREFIX/libexec/sftp-server\" > $TERMUX_PREFIX/etc/ssh/sshd_config\n\tprintf \"SendEnv LANG\\n\" > $TERMUX_PREFIX/etc/ssh/ssh_config\n\tinstall -Dm700 $TERMUX_PKG_BUILDER_DIR/source-ssh-agent.sh $TERMUX_PREFIX/bin/source-ssh-agent\n\tinstall -Dm700 $TERMUX_PKG_BUILDER_DIR/ssh-with-agent.sh $TERMUX_PREFIX/bin/ssha\n\tinstall -Dm700 $TERMUX_PKG_BUILDER_DIR/sftp-with-agent.sh $TERMUX_PREFIX/bin/sftpa\n\n\t# Install ssh-copy-id:\n\tcp $TERMUX_PKG_SRCDIR/contrib/ssh-copy-id.1 $TERMUX_PREFIX/share/man/man1/\n\tcp $TERMUX_PKG_SRCDIR/contrib/ssh-copy-id $TERMUX_PREFIX/bin/\n\tchmod +x $TERMUX_PREFIX/bin/ssh-copy-id\n\n\tmkdir -p $TERMUX_PREFIX/var/run\n\techo \"OpenSSH needs this folder to put sshd.pid in\" >> $TERMUX_PREFIX/var/run/README.openssh\n\n\tmkdir -p $TERMUX_PREFIX/etc/ssh/\n\tcp $TERMUX_PKG_SRCDIR/moduli $TERMUX_PREFIX/etc/ssh/moduli\n\n\t# Setup sshd services\n\tmkdir -p $TERMUX_PREFIX/var/service\n\tcd $TERMUX_PREFIX/var/service\n\tmkdir -p sshd/log\n\techo '#!/bin/sh' > sshd/run\n\techo 'exec sshd -D -e 2>&1' >> sshd/run\n\tchmod +x sshd/run\n\ttouch sshd/down\n\tln -sf $TERMUX_PREFIX/share/termux-services/svlogger sshd/log/run\n}\n\ntermux_step_post_massage() {\n\t# Verify that we have man pages packaged (#1538).\n\tlocal manpage\n\tfor manpage in ssh-keyscan.1 ssh-add.1 scp.1 ssh-agent.1 ssh.1; do\n\t\tif [ ! -f share/man/man1/$manpage.gz ]; then\n\t\t\ttermux_error_exit \"Missing man page $manpage\"\n\t\tfi\n\tdone\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"mkdir -p \\$HOME/.ssh\" >> postinst\n\techo \"touch \\$HOME/.ssh/authorized_keys\" >> postinst\n\techo \"chmod 700 \\$HOME/.ssh\" >> postinst\n\techo \"chmod 600 \\$HOME/.ssh/authorized_keys\" >> postinst\n\techo \"\" >> postinst\n\techo \"for a in rsa dsa ecdsa ed25519; do\" >> postinst\n\techo \"\t  KEYFILE=$TERMUX_PREFIX/etc/ssh/ssh_host_\\${a}_key\" >> postinst\n\techo \"\t  test ! -f \\$KEYFILE && ssh-keygen -N '' -t \\$a -f \\$KEYFILE\" >> postinst\n\techo \"done\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n}\n"
  },
  {
    "path": "packages/openssh/fix-hardcoded-paths.patch",
    "content": "diff -uNr openssh-7.5p1/contrib/ssh-copy-id openssh-7.5p1.mod/contrib/ssh-copy-id\n--- openssh-7.5p1/contrib/ssh-copy-id\t2017-03-20 04:39:27.000000000 +0200\n+++ openssh-7.5p1.mod/contrib/ssh-copy-id\t2017-09-14 16:47:08.682854653 +0300\n@@ -36,7 +36,7 @@\n # check that we have something mildly sane as our shell, or try to find something better\n if false ^ printf \"%s: WARNING: ancient shell, hunting for a more modern one... \" \"$0\"\n then\n-  SANE_SH=${SANE_SH:-/usr/bin/ksh}\n+  SANE_SH=${SANE_SH:-@TERMUX_PREFIX@/bin/bash}\n   if printf 'true ^ false\\n' | \"$SANE_SH\"\n   then\n     printf \"'%s' seems viable.\\n\" \"$SANE_SH\"\ndiff -uNr openssh-7.5p1/defines.h openssh-7.5p1.mod/defines.h\n--- openssh-7.5p1/defines.h\t2017-03-20 04:39:27.000000000 +0200\n+++ openssh-7.5p1.mod/defines.h\t2017-09-14 16:25:44.422855572 +0300\n@@ -434,7 +434,7 @@\n #endif\n \n #ifndef _PATH_NOLOGIN\n-# define _PATH_NOLOGIN \"/etc/nologin\"\n+# define _PATH_NOLOGIN \"@TERMUX_PREFIX@/etc/nologin\"\n #endif\n \n /* Define this to be the path of the xauth program. */\n@@ -447,7 +447,7 @@\n #  ifdef __hpux\n #    define X_UNIX_PATH \"/var/spool/sockets/X11/%u\"\n #  else\n-#    define X_UNIX_PATH \"/tmp/.X11-unix/X%u\"\n+#    define X_UNIX_PATH \"@TERMUX_PREFIX@/tmp/.X11-unix/X%u\"\n #  endif\n #endif /* X_UNIX_PATH */\n #define _PATH_UNIX_X X_UNIX_PATH\ndiff -uNr openssh-7.5p1/pathnames.h openssh-7.5p1.mod/pathnames.h\n--- openssh-7.5p1/pathnames.h\t2017-03-20 04:39:27.000000000 +0200\n+++ openssh-7.5p1.mod/pathnames.h\t2017-09-14 16:30:10.012855382 +0300\n@@ -113,7 +113,7 @@\n  * ~/.rhosts and /etc/hosts.equiv if rhosts authentication is enabled.\n  */\n #define _PATH_SSH_HOSTS_EQUIV\t\tSSHDIR \"/shosts.equiv\"\n-#define _PATH_RHOSTS_EQUIV\t\t\"/etc/hosts.equiv\"\n+#define _PATH_RHOSTS_EQUIV\t\t\"@TERMUX_PREFIX@/etc/hosts.equiv\"\n \n /*\n  * Default location of askpass\n@@ -134,12 +134,12 @@\n \n /* xauth for X11 forwarding */\n #ifndef _PATH_XAUTH\n-#define _PATH_XAUTH\t\t\t\"/usr/X11R6/bin/xauth\"\n+#define _PATH_XAUTH\t\t\t\"@TERMUX_PREFIX@/bin/xauth\"\n #endif\n \n /* UNIX domain socket for X11 server; displaynum will replace %u */\n #ifndef _PATH_UNIX_X\n-#define _PATH_UNIX_X \"/tmp/.X11-unix/X%u\"\n+#define _PATH_UNIX_X \"@TERMUX_PREFIX@/tmp/.X11-unix/X%u\"\n #endif\n \n /* for scp */\n@@ -159,7 +159,7 @@\n \n /* for passwd change */\n #ifndef _PATH_PASSWD_PROG\n-#define _PATH_PASSWD_PROG             \"/usr/bin/passwd\"\n+#define _PATH_PASSWD_PROG             \"@TERMUX_PREFIX@/bin/passwd\"\n #endif\n \n #ifndef _PATH_LS\ndiff -uNr openssh-7.5p1/ssh-agent.c openssh-7.5p1.mod/ssh-agent.c\n--- openssh-7.5p1/ssh-agent.c\t2017-03-20 04:39:27.000000000 +0200\n+++ openssh-7.5p1.mod/ssh-agent.c\t2017-09-14 16:28:32.912855451 +0300\n@@ -89,7 +89,7 @@\n #endif\n \n #ifndef DEFAULT_PKCS11_WHITELIST\n-# define DEFAULT_PKCS11_WHITELIST \"/usr/lib*/*,/usr/local/lib*/*\"\n+# define DEFAULT_PKCS11_WHITELIST \"/usr/lib*/*,/usr/local/lib*/*,@TERMUX_PREFIX@/lib*/*\"\n #endif\n \n typedef enum {\n"
  },
  {
    "path": "packages/openssh/hostfile.c.patch",
    "content": "diff -u -r ../openssh-7.8p1/hostfile.c ./hostfile.c\n--- ../openssh-7.8p1/hostfile.c\t2018-08-23 05:41:42.000000000 +0000\n+++ ./hostfile.c\t2018-09-29 08:21:44.261152558 +0000\n@@ -603,7 +603,11 @@\n \t\t\tr = SSH_ERR_SYSTEM_ERROR;\n \t\t\tgoto fail;\n \t\t}\n+#ifdef __ANDROID__\n+\t\tif (rename(filename, back) == -1) {\n+#else\n \t\tif (link(filename, back) == -1) {\n+#endif\n \t\t\toerrno = errno;\n \t\t\terror(\"%s: link %.100s to %.100s: %s\", __func__,\n \t\t\t    filename, back, strerror(errno));\n"
  },
  {
    "path": "packages/openssh/misc_c.patch",
    "content": "diff -u -r ../openssh-6.4p1/misc.c ./misc.c\n--- ../openssh-6.4p1/misc.c\t2013-08-08 04:50:06.000000000 +0200\n+++ ./misc.c\t2014-02-03 03:58:35.000000000 +0100\n@@ -205,7 +205,7 @@\n \tstruct passwd *copy = xcalloc(1, sizeof(*copy));\n \n \tcopy->pw_name = xstrdup(pw->pw_name);\n-\tcopy->pw_passwd = xstrdup(pw->pw_passwd);\n+\tcopy->pw_passwd = pw->pw_passwd == NULL ? \"*\" : xstrdup(pw->pw_passwd);\n #ifdef HAVE_STRUCT_PASSWD_PW_GECOS\n \tcopy->pw_gecos = xstrdup(pw->pw_gecos);\n #endif\n@@ -948,7 +948,7 @@\n \t\tif (r > 0 && (size_t)r < len)\n \t\t\treturn;\n \t}\n-\tr = snprintf(s, len, \"/tmp/ssh-XXXXXXXXXXXX\");\n+\tr = snprintf(s, len, \"@TERMUX_PREFIX@/tmp/ssh-XXXXXXXXXXXX\");\n \tif (r < 0 || (size_t)r >= len)\n \t\tfatal(\"%s: template string too short\", __func__);\n }\n"
  },
  {
    "path": "packages/openssh/mux.c.patch",
    "content": "diff -u -r ../openssh-7.1p1/mux.c ./mux.c\n--- ../openssh-7.1p1/mux.c\t2015-08-21 00:49:03.000000000 -0400\n+++ ./mux.c\t2015-12-17 19:20:36.368902909 -0500\n@@ -1295,6 +1295,22 @@\n \t}\n \n \t/* Now atomically \"move\" the mux socket into position */\n+#ifdef __ANDROID__\n+\t/* Android does not support hard links, so use a non-atomic\n+\t   check-then-rename for now. */\n+\tif (access(orig_control_path, F_OK) == 0) {\n+\t\terror(\"ControlSocket %s already exists, disabling multiplexing\",\n+\t\t    orig_control_path);\n+\t\tunlink(options.control_path);\n+\t\tgoto disable_mux_master;\n+\t} else {\n+\t\tif (rename(options.control_path, orig_control_path) == -1) {\n+\t\t\tfatal(\"%s: link mux listener %s => %s: %s\", __func__, \n+\t\t\t    options.control_path, orig_control_path,\n+\t\t\t    strerror(errno));\n+\t\t}\n+\t}\n+#else\n \tif (link(options.control_path, orig_control_path) != 0) {\n \t\tif (errno != EEXIST) {\n \t\t\tfatal(\"%s: link mux listener %s => %s: %s\", __func__, \n@@ -1307,6 +1324,7 @@\n \t\tgoto disable_mux_master;\n \t}\n \tunlink(options.control_path);\n+#endif\n \tfree(options.control_path);\n \toptions.control_path = orig_control_path;\n \n"
  },
  {
    "path": "packages/openssh/no_loginrec.patch",
    "content": "--- ../openssh-6.4p1/loginrec.c\t2013-06-02 00:07:32.000000000 +0200\n+++ ./loginrec.c\t2014-02-04 21:21:32.000000000 +0100\n@@ -429,6 +429,9 @@\n int\n login_write(struct logininfo *li)\n {\n+#ifdef __ANDROID__\n+\treturn 1;\n+#endif\n #ifndef HAVE_CYGWIN\n \tif (geteuid() != 0) {\n \t\tlogit(\"Attempt to write login records by non-root user (aborting)\");\n"
  },
  {
    "path": "packages/openssh/no_tty_chmod.patch",
    "content": "--- ../openssh-6.4p1/sshpty.c\t2009-02-12 02:19:21.000000000 +0100\n+++ ./sshpty.c\t2014-02-04 21:15:37.000000000 +0100\n@@ -244,6 +244,7 @@\n \t\t}\n \t}\n \n+#ifndef __ANDROID__\n \tif ((st.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO)) != mode) {\n \t\tif (chmod(tty, mode) < 0) {\n \t\t\tif (errno == EROFS &&\n@@ -255,4 +256,5 @@\n \t\t\t\t    tty, (u_int)mode, strerror(errno));\n \t\t}\n \t}\n+#endif\n }\n"
  },
  {
    "path": "packages/openssh/openbsd-compat-explicit_bzero.c.patch",
    "content": "On Android bzero() is a macro.\n\ndiff -u -r ../openssh-7.4p1/openbsd-compat/explicit_bzero.c ./openbsd-compat/explicit_bzero.c\n--- ../openssh-7.4p1/openbsd-compat/explicit_bzero.c\t2016-12-18 23:59:41.000000000 -0500\n+++ ./openbsd-compat/explicit_bzero.c\t2016-12-20 19:57:24.595833810 -0500\n@@ -25,12 +25,6 @@\n \n #else /* HAVE_MEMSET_S */\n \n-/*\n- * Indirect bzero through a volatile pointer to hopefully avoid\n- * dead-store optimisation eliminating the call.\n- */\n-static void (* volatile ssh_bzero)(void *, size_t) = bzero;\n-\n void\n explicit_bzero(void *p, size_t n)\n {\n@@ -45,7 +39,7 @@\n # endif\n #endif\n \n-\tssh_bzero(p, n);\n+\tbzero(p, n);\n }\n \n #endif /* HAVE_MEMSET_S */\n"
  },
  {
    "path": "packages/openssh/openbsd-compat-xcrypt.c.patch",
    "content": "diff -u -r ../openssh-7.3p1/openbsd-compat/xcrypt.c ./openbsd-compat/xcrypt.c\n--- ../openssh-7.3p1/openbsd-compat/xcrypt.c\t2016-07-27 18:54:27.000000000 -0400\n+++ ./openbsd-compat/xcrypt.c\t2016-08-08 14:44:44.488143396 -0400\n@@ -80,6 +80,7 @@\n \tif (salt[0] != '\\0')\n \t\treturn salt;\n \tstrlcpy(salt, \"xx\", sizeof(salt));\n+#ifndef __ANDROID__\n \tsetpwent();\n \twhile ((pw = getpwent()) != NULL) {\n \t\tpasswd = shadow_pw(pw);\n@@ -92,6 +93,7 @@\n \t}\n  out:\n \tendpwent();\n+#endif\n \treturn salt;\n }\n \n"
  },
  {
    "path": "packages/openssh/servconf.c.patch",
    "content": "diff -u -r ../openssh-7.5p1/servconf.c ./servconf.c\n--- ../openssh-7.5p1/servconf.c\t2017-03-20 03:39:27.000000000 +0100\n+++ ./servconf.c\t2017-03-24 00:08:05.880913398 +0100\n@@ -212,7 +212,7 @@\n \t}\n \t/* No certificates by default */\n \tif (options->num_ports == 0)\n-\t\toptions->ports[options->num_ports++] = SSH_DEFAULT_PORT;\n+\t\toptions->ports[options->num_ports++] = 8022 /*SSH_DEFAULT_PORT*/;\n \tif (options->address_family == -1)\n \t\toptions->address_family = AF_UNSPEC;\n \tif (options->listen_addrs == NULL)\n@@ -336,9 +336,13 @@\n \n \tassemble_algorithms(options);\n \n-\t/* Turn privilege separation and sandboxing on by default */\n \tif (use_privsep == -1)\n+#ifdef __ANDROID__\n+\t\tuse_privsep = PRIVSEP_OFF;\n+#else\n+\t\t/* Turn privilege separation and sandboxing on by default */\n \t\tuse_privsep = PRIVSEP_ON;\n+#endif\n \n #define CLEAR_ON_NONE(v) \\\n \tdo { \\\n@@ -675,7 +679,7 @@\n \tu_int i;\n \n \tif (options->num_ports == 0)\n-\t\toptions->ports[options->num_ports++] = SSH_DEFAULT_PORT;\n+\t\toptions->ports[options->num_ports++] = 8022 /*SSH_DEFAULT_PORT*/;\n \tif (options->address_family == -1)\n \t\toptions->address_family = AF_UNSPEC;\n \n"
  },
  {
    "path": "packages/openssh/session.c.patch",
    "content": "diff -uNr openssh-8.0p1/session.c openssh-8.0p1.mod/session.c\n--- openssh-8.0p1/session.c\t2019-04-18 01:52:57.000000000 +0300\n+++ openssh-8.0p1.mod/session.c\t2019-09-06 01:41:30.581023746 +0300\n@@ -197,7 +197,7 @@\n \ttemporarily_use_uid(pw);\n \n \t/* Allocate a buffer for the socket name, and format the name. */\n-\tauth_sock_dir = xstrdup(\"/tmp/ssh-XXXXXXXXXX\");\n+\tauth_sock_dir = xstrdup(\"@TERMUX_PREFIX@/tmp/ssh-XXXXXXXXXX\");\n \n \t/* Create private directory for socket */\n \tif (mkdtemp(auth_sock_dir) == NULL) {\n@@ -267,7 +267,7 @@\n \t\treturn;\n \n \ttemporarily_use_uid(pw);\n-\tauth_info_file = xstrdup(\"/tmp/sshauth.XXXXXXXXXXXXXXX\");\n+\tauth_info_file = xstrdup(\"@TERMUX_PREFIX@/tmp/sshauth.XXXXXXXXXXXXXXX\");\n \tif ((fd = mkstemp(auth_info_file)) == -1) {\n \t\terror(\"%s: mkstemp: %s\", __func__, strerror(errno));\n \t\tgoto out;\n@@ -799,6 +799,11 @@\n \tchar buf[256];\n \n \tif (options.print_motd) {\n+#ifdef __ANDROID__\n+\t\t// Normally this environment variable should be already unset, but\n+\t\t// doing this anyway.\n+\t\tunsetenv(\"TERMUX_HUSHLOGIN\");\n+#else\n #ifdef HAVE_LOGIN_CAP\n \t\tf = fopen(login_getcapstr(lc, \"welcome\", \"/etc/motd\",\n \t\t    \"/etc/motd\"), \"r\");\n@@ -810,7 +815,14 @@\n \t\t\t\tfputs(buf, stdout);\n \t\t\tfclose(f);\n \t\t}\n+#endif\n \t}\n+#ifdef __ANDROID__\n+\telse {\n+\t\t// Tell Termux login script not to display motd.\n+\t\tsetenv(\"TERMUX_HUSHLOGIN\", \"1\", 1);\n+\t}\n+#endif\n }\n \n \n@@ -1052,11 +1064,13 @@\n # endif /* HAVE_CYGWIN */\n #endif /* HAVE_LOGIN_CAP */\n \n+#ifdef _PATH_MAILDIR\n \tif (!options.use_pam) {\n \t\tsnprintf(buf, sizeof buf, \"%.200s/%.50s\",\n \t\t    _PATH_MAILDIR, pw->pw_name);\n \t\tchild_set_env(&env, &envsize, \"MAIL\", buf);\n \t}\n+#endif\n \n \t/* Normal systems set SHELL by default. */\n \tchild_set_env(&env, &envsize, \"SHELL\", shell);\n@@ -1100,6 +1114,15 @@\n \t\t    auth_sock_name);\n \n \n+#ifdef __ANDROID__\n+\tchar const* envs_to_keep[] = {\"LD_LIBRARY_PATH\", \"PATH\", \"ANDROID_ROOT\", \"ANDROID_DATA\", \"EXTERNAL_STORAGE\", \"LANG\", \"PREFIX\", \"TERMUX_HUSHLOGIN\", \"TMPDIR\"};\n+\tfor (i = 0; i < (sizeof(envs_to_keep) / sizeof(envs_to_keep[0])); i++) {\n+\t\tchar const* env_to_keep_name = envs_to_keep[i];\n+\t\tchar const* env_to_keep_value = getenv(env_to_keep_name);\n+\t\tif (env_to_keep_value) child_set_env(&env, &envsize, env_to_keep_name, env_to_keep_value);\n+\t}\n+#endif\n+\n \t/* Set custom environment options from pubkey authentication. */\n \tif (options.permit_user_env) {\n \t\tfor (n = 0 ; n < auth_opts->nenv; n++) {\n"
  },
  {
    "path": "packages/openssh/sftp-server.c.patch",
    "content": "diff -u -r ../openssh-7.2p2/sftp-server.c ./sftp-server.c\n--- ../openssh-7.2p2/sftp-server.c\t2016-03-09 13:04:48.000000000 -0500\n+++ ./sftp-server.c\t2016-06-06 18:13:28.141236751 -0400\n@@ -1190,7 +1190,9 @@\n \tif (lstat(oldpath, &sb) == -1)\n \t\tstatus = errno_to_portable(errno);\n \telse if (S_ISREG(sb.st_mode)) {\n+#ifndef __ANDROID__\n \t\t/* Race-free rename of regular files */\n+\t\t/* Do not try this for Android which does not support links */\n \t\tif (link(oldpath, newpath) == -1) {\n \t\t\tif (errno == EOPNOTSUPP || errno == ENOSYS\n #ifdef EXDEV\n@@ -1200,6 +1202,7 @@\n \t\t\t    || errno == LINK_OPNOTSUPP_ERRNO\n #endif\n \t\t\t    ) {\n+#endif\n \t\t\t\tstruct stat st;\n \n \t\t\t\t/*\n@@ -1213,6 +1216,7 @@\n \t\t\t\t\telse\n \t\t\t\t\t\tstatus = SSH2_FX_OK;\n \t\t\t\t}\n+#ifndef __ANDROID__\n \t\t\t} else {\n \t\t\t\tstatus = errno_to_portable(errno);\n \t\t\t}\n@@ -1222,6 +1226,7 @@\n \t\t\tunlink(newpath);\n \t\t} else\n \t\t\tstatus = SSH2_FX_OK;\n+#endif\n \t} else if (stat(newpath, &sb) == -1) {\n \t\tif (rename(oldpath, newpath) == -1)\n \t\t\tstatus = errno_to_portable(errno);\n"
  },
  {
    "path": "packages/openssh/sftp-with-agent.sh",
    "content": "#!/bin/sh\n\n. source-ssh-agent\nsftp \"$@\"\n"
  },
  {
    "path": "packages/openssh/source-ssh-agent.sh",
    "content": "#!/bin/sh\n# source-ssh-agent: Script to source for ssh-agent to work.\n\n# Check if accidentaly executed instead of sourced:\nif echo \"$0\" | grep -q source-ssh-agent; then\n\techo \"source-ssh-agent: Do not execute directly - source me instead!\"\n\texit 1\nfi\n\nexport SSH_AUTH_SOCK=$PREFIX/tmp/ssh-agent\n\nstart_agent() {\n\trm -f $SSH_AUTH_SOCK\n\tssh-agent -a $SSH_AUTH_SOCK > /dev/null\n\tssh-add\n}\n\nMESSAGE=$(ssh-add -L 2>&1)\nif [ \"$MESSAGE\" = 'Could not open a connection to your authentication agent.' -o \\\n     \"$MESSAGE\" = 'Error connecting to agent: Connection refused' -o \\\n     \"$MESSAGE\" = 'Error connecting to agent: No such file or directory' ]; then\n\tstart_agent\nelif [ \"$MESSAGE\" = \"The agent has no identities.\" ]; then\n\tssh-add\nfi\n"
  },
  {
    "path": "packages/openssh/ssh-agent.c.patch",
    "content": "diff -ruN a/ssh-agent.c b/ssh-agent.c\n--- a/ssh-agent.c\t2018-08-08 13:44:30.076228968 +0200\n+++ b/ssh-agent.c\t2018-08-08 13:46:37.282997806 +0200\n@@ -1064,9 +1064,11 @@\n \t/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */\n \tsanitise_stdfd();\n \n+#ifndef __ANDROID__\n \t/* drop */\n \tsetegid(getgid());\n \tsetgid(getgid());\n+#endif\n \n \tplatform_disable_tracing(0);\t/* strict=no */\n \n"
  },
  {
    "path": "packages/openssh/ssh-keygen.c.patch",
    "content": "diff -u -r ../openssh-7.8p1/ssh-keygen.c ./ssh-keygen.c\n--- ../openssh-7.8p1/ssh-keygen.c\t2018-08-23 05:41:42.000000000 +0000\n+++ ./ssh-keygen.c\t2018-09-29 08:34:27.584063901 +0000\n@@ -1289,7 +1347,11 @@\n \t\t/* Backup existing file */\n \t\tif (unlink(old) == -1 && errno != ENOENT)\n \t\t\tfatal(\"unlink %.100s: %s\", old, strerror(errno));\n+#ifdef __ANDROID__\n+\t\tif (rename(identity_file, old) == -1)\n+#else\n \t\tif (link(identity_file, old) == -1)\n+#endif\n \t\t\tfatal(\"link %.100s to %.100s: %s\", identity_file, old,\n \t\t\t    strerror(errno));\n \t\t/* Move new one into place */\n"
  },
  {
    "path": "packages/openssh/ssh-with-agent.sh",
    "content": "#!/bin/sh\n\n. source-ssh-agent\nssh $@\n"
  },
  {
    "path": "packages/openssh/sshd.c.patch",
    "content": "diff -u -r ../openssh-8.1p1/sshd.c ./sshd.c\n--- ../openssh-8.1p1/sshd.c\t2019-10-09 00:31:03.000000000 +0000\n+++ ./sshd.c\t2019-10-13 09:16:33.447856567 +0000\n@@ -464,6 +464,7 @@\n \t\tif (chdir(\"/\") == -1)\n \t\t\tfatal(\"chdir(\\\"/\\\"): %s\", strerror(errno));\n \n+#ifndef __ANDROID__\n \t\t/* Drop our privileges */\n \t\tdebug3(\"privsep user:group %u:%u\", (u_int)privsep_pw->pw_uid,\n \t\t    (u_int)privsep_pw->pw_gid);\n@@ -471,6 +472,7 @@\n \t\tif (setgroups(1, gidset) == -1)\n \t\t\tfatal(\"setgroups: %.100s\", strerror(errno));\n \t\tpermanently_set_uid(privsep_pw);\n+#endif\n \t}\n }\n \n@@ -1442,7 +1444,8 @@\n \tsaved_argc = ac;\n \trexec_argc = ac;\n \tsaved_argv = xcalloc(ac + 1, sizeof(*saved_argv));\n-\tfor (i = 0; (int)i < ac; i++)\n+\tsaved_argv[0] = \"@TERMUX_PREFIX@/bin/sshd\";\n+\tfor (i = 1; (int)i < ac; i++)\n \t\tsaved_argv[i] = xstrdup(av[i]);\n \tsaved_argv[i] = NULL;\n \n@@ -1452,8 +1455,10 @@\n \tav = saved_argv;\n #endif\n \n+#ifndef __ANDROID__\n \tif (geteuid() == 0 && setgroups(0, NULL) == -1)\n \t\tdebug(\"setgroups(): %.200s\", strerror(errno));\n+#endif\n \n \t/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */\n \tsanitise_stdfd();\n@@ -1574,8 +1579,10 @@\n \t}\n \tif (rexeced_flag || inetd_flag)\n \t\trexec_flag = 0;\n+#ifndef __ANDROID__\n \tif (!test_flag && rexec_flag && !path_absolute(av[0]))\n \t\tfatal(\"sshd re-exec requires execution with an absolute path\");\n+#endif\n \tif (rexeced_flag)\n \t\tclosefrom(REEXEC_MIN_FREE_FD);\n \telse\n@@ -1694,7 +1701,9 @@\n \t\tfreezero(privsep_pw->pw_passwd, strlen(privsep_pw->pw_passwd));\n \t\tprivsep_pw->pw_passwd = xstrdup(\"*\");\n \t}\n+#ifndef __ANDROID__\n \tendpwent();\n+#endif\n \n \t/* load host keys */\n \tsensitive_data.host_keys = xcalloc(options.num_host_key_files,\n@@ -1863,8 +1872,10 @@\n \t * to create a file, and we can't control the code in every\n \t * module which might be used).\n \t */\n+#ifndef __ANDROID__\n \tif (setgroups(0, NULL) < 0)\n \t\tdebug(\"setgroups() failed: %.200s\", strerror(errno));\n+#endif\n \n \tif (rexec_flag) {\n \t\tif (rexec_argc < 0)\n"
  },
  {
    "path": "packages/openssh/sshd_config.5.patch",
    "content": "diff -u -r ../openssh-6.6p1/sshd_config.5 ./sshd_config.5\n--- ../openssh-6.6p1/sshd_config.5\t2014-02-28 00:01:28.000000000 +0100\n+++ ./sshd_config.5\t2014-06-04 13:13:34.092676833 +0200\n@@ -999,7 +999,7 @@\n Specifies the port number that\n .Xr sshd 8\n listens on.\n-The default is 22.\n+The default is 8022.\n Multiple options of this type are permitted.\n See also\n .Cm ListenAddress .\n"
  },
  {
    "path": "packages/openssl/Configurations-15-android.conf.patch",
    "content": "diff -u -r ../openssl-1.1.1-pre9/Configurations/15-android.conf ./Configurations/15-android.conf\n--- ../openssl-1.1.1-pre9/Configurations/15-android.conf\t2018-08-21 12:14:11.000000000 +0000\n+++ ./Configurations/15-android.conf\t2018-08-22 09:48:30.506584421 +0000\n@@ -130,10 +130,10 @@\n         # systems are perfectly capable of executing binaries targeting\n         # Froyo. Keep in mind that in the nutshell Android builds are\n         # about JNI, i.e. shared libraries, not applications.\n-        cflags           => add(sub { android_ndk()->{cflags} }),\n-        cppflags         => add(sub { android_ndk()->{cppflags} }),\n-        cxxflags         => add(sub { android_ndk()->{cflags} }),\n-        bn_ops           => sub { android_ndk()->{bn_ops} },\n+        #cflags           => add(sub { android_ndk()->{cflags} }),\n+        #cppflags         => add(sub { android_ndk()->{cppflags} }),\n+        #cxxflags         => add(sub { android_ndk()->{cflags} }),\n+        #bn_ops           => sub { android_ndk()->{bn_ops} },\n         bin_cflags       => \"-pie\",\n         enable           => [ ],\n     },\n@@ -166,11 +166,11 @@\n         # Newer NDK versions reportedly require additional -latomic.\n         #\n         inherit_from     => [ \"android\", asm(\"armv4_asm\") ],\n-        bn_ops           => add(\"RC4_CHAR\"),\n+        bn_ops           => \"BN_LLONG RC4_CHAR\",\n     },\n     \"android-arm64\" => {\n         inherit_from     => [ \"android\", asm(\"aarch64_asm\") ],\n-        bn_ops           => add(\"RC4_CHAR\"),\n+        bn_ops           => \"SIXTY_FOUR_BIT_LONG RC4_CHAR\",\n         perlasm_scheme   => \"linux64\",\n     },\n \n@@ -197,12 +197,12 @@\n     \"android-x86\" => {\n         inherit_from     => [ \"android\", asm(\"x86_asm\") ],\n         CFLAGS           => add(picker(release => \"-fomit-frame-pointer\")),\n-        bn_ops           => add(\"RC4_INT\"),\n+        bn_ops           => \"BN_LLONG RC4_INT\",\n         perlasm_scheme   => \"android\",\n     },\n     \"android-x86_64\" => {\n         inherit_from     => [ \"android\", asm(\"x86_64_asm\") ],\n-        bn_ops           => add(\"RC4_INT\"),\n+        bn_ops           => \"SIXTY_FOUR_BIT_LONG RC4_INT\",\n         perlasm_scheme   => \"elf\",\n     },\n \n"
  },
  {
    "path": "packages/openssl/add-trusted-certificate",
    "content": "#!/bin/sh\nset -e -u\n\nif [ $# != 1 ] || [ \"$1\" = \"-h\" ]; then\n    >&2 echo \"usage: add-trusted-certificate FILE\"\n    >&2 echo \"where FILE is a .pem, .crt, .cer, or .crl file\"\n    exit 1\nfi\n\nCERTIFICATE_TO_ADD=\"$1\"\nif [ ! -f \"$CERTIFICATE_TO_ADD\" ]; then\n    >&2 \"Error: Not a readable file: '$CERTIFICATE_TO_ADD'\"\n    exit 1\nfi\n\nCERT_DIR=@TERMUX_PREFIX@/etc/tls/certs/\nmkdir -p $CERT_DIR\necho \"Copying $CERTIFICATE_TO_ADD to $CERT_DIR\"\ncp \"$CERTIFICATE_TO_ADD\" $CERT_DIR\nopenssl rehash -v $CERT_DIR\n"
  },
  {
    "path": "packages/openssl/apps-ocsp.c.patch",
    "content": "diff -u -r ../openssl-1.1.1b/apps/ocsp.c ./apps/ocsp.c\n--- ../openssl-1.1.1b/apps/ocsp.c\t2019-02-26 14:15:30.000000000 +0000\n+++ ./apps/ocsp.c\t2019-03-01 20:32:41.429610048 +0000\n@@ -51,6 +51,7 @@\n #endif\n \n # if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \\\n+     && !defined(__ANDROID__) \\\n      && !defined(OPENSSL_NO_POSIX_IO)\n #  define OCSP_DAEMON\n #  include <sys/types.h>\n"
  },
  {
    "path": "packages/openssl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.openssl.org/\nTERMUX_PKG_DESCRIPTION=\"Library implementing the SSL and TLS protocols as well as general purpose cryptography functions\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_DEPENDS=\"ca-certificates\"\nTERMUX_PKG_VERSION=1.1.1d\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2\nTERMUX_PKG_SRCURL=https://www.openssl.org/source/openssl-${TERMUX_PKG_VERSION/\\~/-}.tar.gz\nTERMUX_PKG_CONFFILES=\"etc/tls/openssl.cnf\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/c_rehash etc/ssl/misc\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_CONFLICTS=\"libcurl (<< 7.61.0-1)\"\nTERMUX_PKG_BREAKS=\"openssl-tool (<< 1.1.1b-1), openssl-dev\"\nTERMUX_PKG_REPLACES=\"openssl-tool (<< 1.1.1b-1), openssl-dev\"\n\ntermux_step_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tCFLAGS+=\" -DNO_SYSLOG\"\n\tif [ $TERMUX_ARCH = arm ]; then\n\t\tCFLAGS+=\" -fno-integrated-as\"\n\tfi\n\n\tperl -p -i -e \"s@TERMUX_CFLAGS@$CFLAGS@g\" Configure\n\trm -Rf $TERMUX_PREFIX/lib/libcrypto.* $TERMUX_PREFIX/lib/libssl.*\n\ttest $TERMUX_ARCH = \"arm\" && TERMUX_OPENSSL_PLATFORM=\"android-arm\"\n\ttest $TERMUX_ARCH = \"aarch64\" && TERMUX_OPENSSL_PLATFORM=\"android-arm64\"\n\ttest $TERMUX_ARCH = \"i686\" && TERMUX_OPENSSL_PLATFORM=\"android-x86\"\n\ttest $TERMUX_ARCH = \"x86_64\" && TERMUX_OPENSSL_PLATFORM=\"android-x86_64\"\n\t# If enabling zlib-dynamic we need \"zlib-dynamic\" instead of \"no-comp no-dso\":\n\t./Configure $TERMUX_OPENSSL_PLATFORM \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--openssldir=$TERMUX_PREFIX/etc/tls \\\n\t\tshared \\\n\t\tno-ssl \\\n\t\tno-comp \\\n\t\tno-dso \\\n\t\tno-hw \\\n\t\tno-srp \\\n\t\tno-tests\n}\n\ntermux_step_make() {\n\tmake depend\n\tmake -j $TERMUX_MAKE_PROCESSES all\n}\n\ntermux_step_make_install() {\n\t# \"install_sw\" instead of \"install\" to not install man pages:\n\tmake -j 1 install_sw MANDIR=$TERMUX_PREFIX/share/man MANSUFFIX=.ssl\n\n\tmkdir -p $TERMUX_PREFIX/etc/tls/\n\n\tcp apps/openssl.cnf $TERMUX_PREFIX/etc/tls/openssl.cnf\n\n\tsed \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g\" \\\n\t\t$TERMUX_PKG_BUILDER_DIR/add-trusted-certificate \\\n\t\t> $TERMUX_PREFIX/bin/add-trusted-certificate\n\tchmod 700 $TERMUX_PREFIX/bin/add-trusted-certificate\n}\n"
  },
  {
    "path": "packages/openssl/crypto-armcap.c.patch",
    "content": "diff -u -r ../openssl-1.1.1c/crypto/armcap.c ./crypto/armcap.c\n--- ../openssl-1.1.1c/crypto/armcap.c\t2019-05-28 13:12:21.000000000 +0000\n+++ ./crypto/armcap.c\t2019-06-23 19:53:23.465656000 +0000\n@@ -63,12 +63,8 @@\n void OPENSSL_cpuid_setup(void) __attribute__ ((constructor));\n # endif\n \n-# if defined(__GLIBC__) && defined(__GLIBC_PREREQ)\n-#  if __GLIBC_PREREQ(2, 16)\n #   include <sys/auxv.h>\n #   define OSSL_IMPLEMENT_GETAUXVAL\n-#  endif\n-# endif\n \n /*\n  * ARM puts the feature bits for Crypto Extensions in AT_HWCAP2, whereas\n"
  },
  {
    "path": "packages/openssl/e_os.h.patch",
    "content": "diff -u -r ../openssl-1.1.1c/e_os.h ./e_os.h\n--- ../openssl-1.1.1c/e_os.h\t2019-05-28 13:12:21.000000000 +0000\n+++ ./e_os.h\t2019-05-29 20:59:46.153243395 +0000\n@@ -38,7 +38,7 @@\n  * sockets will be tried in the order listed in case accessing the device\n  * files listed in DEVRANDOM did not return enough randomness.\n  */\n-#  define DEVRANDOM_EGD \"/var/run/egd-pool\", \"/dev/egd-pool\", \"/etc/egd-pool\", \"/etc/entropy\"\n+#  define DEVRANDOM_EGD \"@TERMUX_PREFIX@/var/run/egd-pool\", \"/dev/egd-pool\", \"@TERMUX_PREFIX@/etc/egd-pool\", \"@TERMUX_PREFIX@/etc/entropy\"\n # endif\n \n # if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)\n"
  },
  {
    "path": "packages/openssl/openssl-tool.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin\"\nTERMUX_SUBPKG_DESCRIPTION=\"The openssl command line cryptographic tool\"\n"
  },
  {
    "path": "packages/optipng/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://optipng.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"PNG optimizer that recompresses image files to a smaller size, without losing any information\"\nTERMUX_PKG_LICENSE=\"ZLIB\"\nTERMUX_PKG_VERSION=0.7.7\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=4f32f233cef870b3f95d3ad6428bfe4224ef34908f1b42b0badf858216654452\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-${TERMUX_PKG_VERSION}/optipng-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libpng, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-system-zlib --with-system-libpng --mandir=$TERMUX_PREFIX/share/man\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tLD=$CC\n}\n"
  },
  {
    "path": "packages/optipng/configure.patch",
    "content": "diff -u -r ../optipng-0.7.4/configure ./configure\n--- ../optipng-0.7.4/configure\t2012-08-25 02:12:00.000000000 +0200\n+++ ./configure\t2014-03-19 00:01:50.000000000 +0100\n@@ -130,7 +130,6 @@\n     * )\n         echo \"error: unknown option: $arg\"\n         echo \"Type \\\"$0 -help\\\" for help\"\n-        exit 64  # EX_USAGE\n         ;;\n     esac\n done\n"
  },
  {
    "path": "packages/opus-tools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.opus-codec.org/\nTERMUX_PKG_DESCRIPTION=\"Utilities to encode and decode .opus files\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.2\nTERMUX_PKG_SHA256=b4e56cb00d3e509acfba9a9b627ffd8273b876b4e2408642259f6da28fa0ff86\nTERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/opus/opus-tools-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libopusenc, libogg, libflac, opusfile, libopus\"\n"
  },
  {
    "path": "packages/opusfile/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.opus-codec.org/\nTERMUX_PKG_DESCRIPTION=\"A high-level API for decoding and seeking within .opus files\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.11\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=74ce9b6cf4da103133e7b5c95df810ceb7195471e1162ed57af415fabf5603bf\nTERMUX_PKG_SRCURL=https://downloads.xiph.org/releases/opus/opusfile-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"libopus, libogg\"\nTERMUX_PKG_BREAKS=\"opusfile-dev\"\nTERMUX_PKG_REPLACES=\"opusfile-dev\"\n"
  },
  {
    "path": "packages/ossp-uuid/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.ossp.org/pkg/lib/uuid/\nTERMUX_PKG_DESCRIPTION=\"ISO-C:1999 uuid generator supporting DCE 1.1, ISO/IEC 11578:1996 and RFC 4122.\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_VERSION=1.6.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0\nTERMUX_PKG_BREAKS=\"ossp-uuid-dev\"\nTERMUX_PKG_REPLACES=\"ossp-uuid-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--includedir=$TERMUX_PREFIX/include/ossp-uuid\"\n\ntermux_step_pre_configure() {\n\texport ac_cv_va_copy=C99\n}\n"
  },
  {
    "path": "packages/ossp-uuid/ossp.patch",
    "content": "diff -up uuid-1.6.1/uuid-config.in.BAD uuid-1.6.1/uuid-config.in\n--- uuid-1.6.1/uuid-config.in.BAD\t2008-03-06 11:56:13.000000000 -0500\n+++ uuid-1.6.1/uuid-config.in\t2008-03-06 11:56:25.000000000 -0500\n@@ -121,7 +121,7 @@ do\n             output_extra=\"$output_extra $uuid_ldflags\"\n             ;;\n         --libs)\n-            output=\"$output -luuid\"\n+            output=\"$output -lossp-uuid\"\n             output_extra=\"$output_extra $uuid_libs\"\n             ;;\n         * )\ndiff -up uuid-1.6.1/Makefile.in.BAD uuid-1.6.1/Makefile.in\n--- uuid-1.6.1/Makefile.in.BAD\t2008-03-06 11:10:13.000000000 -0500\n+++ uuid-1.6.1/Makefile.in\t2008-03-06 11:11:39.000000000 -0500\n@@ -62,13 +62,13 @@ PERL        = @PERL@\n PHP         = @PHP@\n PG_CONFIG   = @PG_CONFIG@\n \n-LIB_NAME    = libuuid.la\n+LIB_NAME    = libossp-uuid.la\n LIB_OBJS    = uuid.lo uuid_md5.lo uuid_sha1.lo uuid_prng.lo uuid_mac.lo uuid_time.lo uuid_ui64.lo uuid_ui128.lo uuid_str.lo\n \n-DCE_NAME    = libuuid_dce.la\n+DCE_NAME    = libossp-uuid_dce.la\n DCE_OBJS    = uuid_dce.lo $(LIB_OBJS)\n \n-CXX_NAME    = libuuid++.la\n+CXX_NAME    = libossp-uuid++.la\n CXX_OBJS    = uuid++.lo $(LIB_OBJS)\n \n PRG_NAME    = uuid\n@@ -79,10 +79,10 @@ MAN_NAME    = uuid.3 uuid++.3 uuid.1\n PERL_NAME   = $(S)/perl/blib/lib/OSSP/uuid.pm\n PERL_OBJS   = $(S)/perl/uuid.pm\n \n-PHP_NAME    = $(S)/php/modules/uuid.so\n+PHP_NAME    = $(S)/php/modules/ossp-uuid.so\n PHP_OBJS    = $(S)/php/uuid.c\n \n-PGSQL_NAME  = $(S)/pgsql/libuuid.so\n+PGSQL_NAME  = $(S)/pgsql/libossp-uuid.so\n PGSQL_OBJS  = $(S)/pgsql/uuid.c\n \n TARGETS     = $(LIB_NAME) @DCE_NAME@ @CXX_NAME@ $(PRG_NAME) @PERL_NAME@ @PHP_NAME@ @PGSQL_NAME@\n@@ -231,7 +231,7 @@ install:\n \t$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1\n \t$(SHTOOL) install -c -m 755 uuid-config $(DESTDIR)$(bindir)/\n \t$(SHTOOL) install -c -m 644 $(S)/uuid-config.1 $(DESTDIR)$(mandir)/man1/\n-\t$(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/\n+\t$(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/ossp-uuid.pc\n \t$(SHTOOL) install -c -m 644 uuid.h $(DESTDIR)$(includedir)/\n \t-@if [ \".$(WITH_DCE)\" = .yes ]; then \\\n \t    echo \"$(SHTOOL) install -c -m 644 $(S)/uuid_dce.h $(DESTDIR)$(includedir)/\"; \\\n@@ -241,7 +241,7 @@ install:\n \t    echo \"$(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/\"; \\\n \t    $(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/; \\\n \tfi\n-\t$(SHTOOL) install -c -m 644 $(S)/uuid.3 $(DESTDIR)$(mandir)/man3/\n+\t$(SHTOOL) install -c -m 644 $(S)/uuid.3 $(DESTDIR)$(mandir)/man3/ossp-uuid.3\n \t-@if [ \".$(WITH_CXX)\" = .yes ]; then \\\n \t    echo \"$(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/\"; \\\n \t    $(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/; \\\n@@ -276,7 +276,7 @@ uninstall:\n \t-@if [ \".$(WITH_CXX)\" = .yes ]; then \\\n \t    $(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(CXX_NAME); \\\n \tfi\n-\t-$(RM) $(DESTDIR)$(mandir)/man3/uuid.3\n+\t-$(RM) $(DESTDIR)$(mandir)/man3/ossp-uuid.3\n \t-@if [ \".$(WITH_CXX)\" = .yes ]; then \\\n \t    echo \"$(RM) $(DESTDIR)$(mandir)/man3/uuid++.3\"; \\\n \t    $(RM) $(DESTDIR)$(mandir)/man3/uuid++.3; \\\n@@ -290,7 +290,7 @@ uninstall:\n \t    echo \"$(RM) $(DESTDIR)$(includedir)/uuid++.hh\"; \\\n \t    $(RM) $(DESTDIR)$(includedir)/uuid++.hh; \\\n \tfi\n-\t-$(RM) $(DESTDIR)$(libdir)/pkgconfig/uuid.pc\n+\t-$(RM) $(DESTDIR)$(libdir)/pkgconfig/ossp-uuid.pc\n \t-$(RM) $(DESTDIR)$(mandir)/man1/uuid-config.1\n \t-$(RM) $(DESTDIR)$(bindir)/uuid-config\n \t-$(RMDIR) $(DESTDIR)$(mandir)/man1 >/dev/null 2>&1 || $(TRUE)\ndiff -up uuid-1.6.1/pgsql/Makefile.BAD uuid-1.6.1/pgsql/Makefile\n--- uuid-1.6.1/pgsql/Makefile.BAD\t2008-03-06 11:53:26.000000000 -0500\n+++ uuid-1.6.1/pgsql/Makefile\t2008-03-06 11:54:14.000000000 -0500\n@@ -18,13 +18,13 @@ POSTGRES          := $(shell $(PG_CONFIG\n top_builddir      := $(dir $(PGXS))../..\n include           $(top_builddir)/src/Makefile.global\n     \n-NAME              = uuid\n+NAME              = ossp-uuid\n OBJS              = uuid.o\n SO_MAJOR_VERSION  = 1\n SO_MINOR_VERSION  = 0\n \n override CPPFLAGS := -I.. $(CPPFLAGS)\n-SHLIB_LINK        := -L../.libs -luuid\n+SHLIB_LINK        := -L../.libs -lossp-uuid\n SHLIB_LINK        += $(shell test $(shell uname -s) = FreeBSD && echo \"-Wl,-Bsymbolic\")\n SHLIB_LINK        += $(shell test $(shell uname -s) = Darwin && echo \"-bundle_loader $(POSTGRES)\")\n rpath             :=\n@@ -35,16 +35,16 @@ enable_shared     = yes\n include           $(top_builddir)/src/Makefile.shlib\n \n uuid.sql: uuid.sql.in\n-\tsed -e 's;MODULE_PATHNAME;$(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX);g' <uuid.sql.in >uuid.sql\n+\tsed -e 's;MODULE_PATHNAME;$(DESTDIR)$(pkglibdir)/ossp-uuid$(DLSUFFIX);g' <uuid.sql.in >uuid.sql\n \n install: all\n \t$(mkinstalldirs) $(DESTDIR)$(pkglibdir)\n \t$(mkinstalldirs) $(DESTDIR)$(datadir)\n-\t$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX)\n+\t$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/ossp-uuid$(DLSUFFIX)\n \t$(INSTALL_DATA) uuid.sql $(DESTDIR)$(datadir)/uuid.sql\n \n uninstall:\n-\t-rm -f $(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX)\n+\t-rm -f $(DESTDIR)$(pkglibdir)/ossp-uuid$(DLSUFFIX)\n \t-rm -f $(DESTDIR)$(datadir)/uuid.sql\n \n clean distclean: clean-lib\ndiff -up uuid-1.6.1/uuid.pc.in.BAD uuid-1.6.1/uuid.pc.in\n--- uuid-1.6.1/uuid.pc.in.BAD\t2008-03-06 11:57:29.000000000 -0500\n+++ uuid-1.6.1/uuid.pc.in\t2008-03-06 11:57:36.000000000 -0500\n@@ -37,6 +37,6 @@ Description: Universally Unique Identifi\n Version: @UUID_VERSION_RAW@\n URL: http://www.ossp.org/pkg/lib/uuid/\n Cflags: -I${includedir}\n-Libs: -L${libdir} -luuid\n+Libs: -L${libdir} -lossp-uuid\n Libs.private: @LIBS@\n \ndiff -up uuid-1.6.1/perl/Makefile.PL.BAD uuid-1.6.1/perl/Makefile.PL\n--- uuid-1.6.1/perl/Makefile.PL.BAD\t2008-03-06 11:12:05.000000000 -0500\n+++ uuid-1.6.1/perl/Makefile.PL\t2008-03-06 11:49:25.000000000 -0500\n@@ -33,9 +33,9 @@ use Config;\n use ExtUtils::MakeMaker;\n \n #   determine source directory\n-my ($srcdir) = map { my $d = $_; $d =~ s/\\/libuuid\\.la$//; $d }\n-               grep { -f $_ } (\"../libuuid.la\", glob(\"../*/libuuid.la\"))\n-    or die \"no source directory found (where libuuid.la is located)\";\n+my ($srcdir) = map { my $d = $_; $d =~ s/\\/libossp-uuid\\.la$//; $d }\n+               grep { -f $_ } (\"../libossp-uuid.la\", glob(\"../*/libossp-uuid.la\"))\n+    or die \"no source directory found (where libossp-uuid.la is located)\";\n \n #   determine extra build options\n my $compat = 0;\n@@ -47,7 +47,7 @@ WriteMakefile(\n     VERSION_FROM      => 'uuid.pm',\n     ABSTRACT_FROM     => 'uuid.pod',\n     PREREQ_PM         => {},\n-    LIBS              => [ \"-L$srcdir/.libs -L$srcdir -luuid\" ],\n+    LIBS              => [ \"-L$srcdir/.libs -L$srcdir -lossp-uuid\" ],\n     DEFINE            => '',\n     INC               => \"-I. -I$srcdir\",\n     PM                => { 'uuid.pm'   => '$(INST_LIBDIR)/uuid.pm',\ndiff -up uuid-1.6.1/Makefile.PL.BAD uuid-1.6.1/Makefile.PL\n--- uuid-1.6.1/Makefile.PL.BAD\t2008-03-06 11:09:49.000000000 -0500\n+++ uuid-1.6.1/Makefile.PL\t2008-03-06 11:10:01.000000000 -0500\n@@ -44,7 +44,7 @@ ARGS     = $ARGS\n all pure_all:\n \t\\@if [ ! -d build ]; then mkdir build; fi\n \t\\@if [ ! -f build/Makefile ]; then (cd build && ../configure --disable-shared); fi\n-\t\\@if [ ! -f build/libuuid.la ]; then (cd build && \\$(MAKE) \\$(MFLAGS) libuuid.la); fi\n+\t\\@if [ ! -f build/libossp-uuid.la ]; then (cd build && \\$(MAKE) \\$(MFLAGS) libossp-uuid.la); fi\n \t\\@if [ ! -f perl/Makefile ]; then (cd perl && \\$(PERL) Makefile.PL \\$(ARGS)); fi\n \t\\@cd perl && \\$(MAKE) \\$(MFLAGS) \\$\\@\n \ndiff -up uuid-1.6.1/php/config.m4.BAD uuid-1.6.1/php/config.m4\n--- uuid-1.6.1/php/config.m4.BAD\t2008-03-06 11:54:55.000000000 -0500\n+++ uuid-1.6.1/php/config.m4\t2008-03-06 11:55:07.000000000 -0500\n@@ -34,7 +34,7 @@ if test \"$PHP_UUID\" != \"no\"; then\n     PHP_NEW_EXTENSION(uuid, uuid.c, $ext_shared)\n     AC_DEFINE(HAVE_UUID, 1, [Have OSSP uuid library])\n     PHP_ADD_LIBPATH([..], )\n-    PHP_ADD_LIBRARY([uuid],, UUID_SHARED_LIBADD)\n+    PHP_ADD_LIBRARY([ossp-uuid],, UUID_SHARED_LIBADD)\n     PHP_ADD_INCLUDE([..])\n     PHP_SUBST(UUID_SHARED_LIBADD)\n \ndiff -up uuid-1.6.1/php/Makefile.local.BAD uuid-1.6.1/php/Makefile.local\n--- uuid-1.6.1/php/Makefile.local.BAD\t2008-03-06 11:54:39.000000000 -0500\n+++ uuid-1.6.1/php/Makefile.local\t2008-03-06 11:54:49.000000000 -0500\n@@ -48,7 +48,7 @@ install: build\n \t@version=`$(PHP)-config --version | sed -e 's;^\\([0-9]\\).*$$;\\1;'`; extdir=\"$(EXTDIR)\"; \\\n \techo \"installing PHP$$version API into $$extdir\"; \\\n \t./build/shtool mkdir -f -p -m 755 $(DESTDIR)$$extdir; \\\n-\t./build/shtool install -c -m 755 modules/uuid.so $(DESTDIR)$$extdir/uuid.so; \\\n+\t./build/shtool install -c -m 755 modules/uuid.so $(DESTDIR)$$extdir/ossp-uuid.so; \\\n \t./build/shtool install -c -m 644 uuid.php$$version $(DESTDIR)$$extdir/uuid.php\n \n clean:\ndiff -up uuid-1.6.1/php/uuid.ts.BAD uuid-1.6.1/php/uuid.ts\n--- uuid-1.6.1/php/uuid.ts.BAD\t2008-03-06 11:55:38.000000000 -0500\n+++ uuid-1.6.1/php/uuid.ts\t2008-03-06 11:56:03.000000000 -0500\n@@ -34,9 +34,9 @@\n \n $php_version = $argv[1];\n \n-print \"++ loading DSO uuid.so (low-level API)\\n\";\n+print \"++ loading DSO ossp-uuid.so (low-level API)\\n\";\n if (!extension_loaded('uuid')) {\n-    dl('modules/uuid.so');\n+    dl('modules/ossp-uuid.so');\n }\n \n print \"++ loading PHP uuid.php${php_version} (high-level API)\\n\";\n"
  },
  {
    "path": "packages/ossp-uuid/uuid-aarch64.patch",
    "content": "diff -urN uuid-1.6.2/config.guess uuid-1.6.2-aarch64/config.guess\n--- uuid-1.6.2/config.guess\t2008-07-04 16:43:08.000000000 -0500\n+++ uuid-1.6.2-aarch64/config.guess\t2013-03-03 09:02:58.671329550 -0600\n@@ -1,10 +1,10 @@\n #! /bin/sh\n # Attempt to guess a canonical system name.\n #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008\n-#   Free Software Foundation, Inc.\n+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\n+#   2011, 2012 Free Software Foundation, Inc.\n \n-timestamp='2008-01-08'\n+timestamp='2012-09-25'\n \n # This file is free software; you can redistribute it and/or modify it\n # under the terms of the GNU General Public License as published by\n@@ -17,9 +17,7 @@\n # General Public License for more details.\n #\n # You should have received a copy of the GNU General Public License\n-# along with this program; if not, write to the Free Software\n-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA\n-# 02110-1301, USA.\n+# along with this program; if not, see <http://www.gnu.org/licenses/>.\n #\n # As a special exception to the GNU General Public License, if you\n # distribute this file as part of a program that contains a\n@@ -27,16 +25,16 @@\n # the same distribution terms that you use for the rest of that program.\n \n \n-# Originally written by Per Bothner <per@bothner.com>.\n-# Please send patches to <config-patches@gnu.org>.  Submit a context\n-# diff and a properly formatted ChangeLog entry.\n+# Originally written by Per Bothner.  Please send patches (context\n+# diff format) to <config-patches@gnu.org> and include a ChangeLog\n+# entry.\n #\n # This script attempts to guess a canonical system name similar to\n # config.sub.  If it succeeds, it prints the system name on stdout, and\n # exits with 0.  Otherwise, it exits with 1.\n #\n-# The plan is that this can be called by configure scripts if you\n-# don't specify an explicit build system type.\n+# You can get the latest version of this script from:\n+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD\n \n me=`echo \"$0\" | sed -e 's,.*/,,'`\n \n@@ -56,8 +54,9 @@\n GNU config.guess ($timestamp)\n \n Originally written by Per Bothner.\n-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,\n-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,\n+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012\n+Free Software Foundation, Inc.\n \n This is free software; see the source for copying conditions.  There is NO\n warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n@@ -144,7 +143,7 @@\n case \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" in\n     *:NetBSD:*:*)\n \t# NetBSD (nbsd) targets should (where applicable) match one or\n-\t# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,\n+\t# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,\n \t# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently\n \t# switched to ELF, *-*-netbsd* would select the old\n \t# object file format.  This provides both forward\n@@ -170,7 +169,7 @@\n \t    arm*|i386|m68k|ns32k|sh3*|sparc|vax)\n \t\teval $set_cc_for_build\n \t\tif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n-\t\t\t| grep __ELF__ >/dev/null\n+\t\t\t| grep -q __ELF__\n \t\tthen\n \t\t    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).\n \t\t    # Return netbsd for either.  FIX?\n@@ -180,7 +179,7 @@\n \t\tfi\n \t\t;;\n \t    *)\n-\t        os=netbsd\n+\t\tos=netbsd\n \t\t;;\n \tesac\n \t# The OS release\n@@ -201,6 +200,10 @@\n \t# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.\n \techo \"${machine}-${os}${release}\"\n \texit ;;\n+    *:Bitrig:*:*)\n+\tUNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`\n+\techo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}\n+\texit ;;\n     *:OpenBSD:*:*)\n \tUNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`\n \techo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}\n@@ -223,7 +226,7 @@\n \t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`\n \t\t;;\n \t*5.*)\n-\t        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n+\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n \t\t;;\n \tesac\n \t# According to Compaq, /usr/sbin/psrinfo has been available on\n@@ -269,7 +272,10 @@\n \t# A Xn.n version is an unreleased experimental baselevel.\n \t# 1.2 uses \"1.2\" for uname -r.\n \techo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`\n-\texit ;;\n+\t# Reset EXIT trap before exiting to avoid spurious non-zero exit code.\n+\texitcode=$?\n+\ttrap '' 0\n+\texit $exitcode ;;\n     Alpha\\ *:Windows_NT*:*)\n \t# How do we know it's Interix rather than the generic POSIX subsystem?\n \t# Should we change UNAME_MACHINE based on the output of uname instead\n@@ -295,12 +301,12 @@\n \techo s390-ibm-zvmoe\n \texit ;;\n     *:OS400:*:*)\n-        echo powerpc-ibm-os400\n+\techo powerpc-ibm-os400\n \texit ;;\n     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)\n \techo arm-acorn-riscix${UNAME_RELEASE}\n \texit ;;\n-    arm:riscos:*:*|arm:RISCOS:*:*)\n+    arm*:riscos:*:*|arm*:RISCOS:*:*)\n \techo arm-unknown-riscos\n \texit ;;\n     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)\n@@ -324,14 +330,33 @@\n \tcase `/usr/bin/uname -p` in\n \t    sparc) echo sparc-icl-nx7; exit ;;\n \tesac ;;\n+    s390x:SunOS:*:*)\n+\techo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n+\texit ;;\n     sun4H:SunOS:5.*:*)\n \techo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n \texit ;;\n     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)\n \techo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n \texit ;;\n+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)\n+\techo i386-pc-auroraux${UNAME_RELEASE}\n+\texit ;;\n     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)\n-\techo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n+\teval $set_cc_for_build\n+\tSUN_ARCH=\"i386\"\n+\t# If there is a compiler, see if it is configured for 64-bit objects.\n+\t# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.\n+\t# This test works for both compilers.\n+\tif [ \"$CC_FOR_BUILD\" != 'no_compiler_found' ]; then\n+\t    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \\\n+\t\t(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \\\n+\t\tgrep IS_64BIT_ARCH >/dev/null\n+\t    then\n+\t\tSUN_ARCH=\"x86_64\"\n+\t    fi\n+\tfi\n+\techo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n \texit ;;\n     sun4*:SunOS:6*:*)\n \t# According to config.sub, this is the proper way to canonicalize\n@@ -375,23 +400,23 @@\n     # MiNT.  But MiNT is downward compatible to TOS, so this should\n     # be no problem.\n     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)\n-        echo m68k-atari-mint${UNAME_RELEASE}\n+\techo m68k-atari-mint${UNAME_RELEASE}\n \texit ;;\n     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)\n \techo m68k-atari-mint${UNAME_RELEASE}\n-        exit ;;\n+\texit ;;\n     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)\n-        echo m68k-atari-mint${UNAME_RELEASE}\n+\techo m68k-atari-mint${UNAME_RELEASE}\n \texit ;;\n     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)\n-        echo m68k-milan-mint${UNAME_RELEASE}\n-        exit ;;\n+\techo m68k-milan-mint${UNAME_RELEASE}\n+\texit ;;\n     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)\n-        echo m68k-hades-mint${UNAME_RELEASE}\n-        exit ;;\n+\techo m68k-hades-mint${UNAME_RELEASE}\n+\texit ;;\n     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)\n-        echo m68k-unknown-mint${UNAME_RELEASE}\n-        exit ;;\n+\techo m68k-unknown-mint${UNAME_RELEASE}\n+\texit ;;\n     m68k:machten:*:*)\n \techo m68k-apple-machten${UNAME_RELEASE}\n \texit ;;\n@@ -461,8 +486,8 @@\n \techo m88k-motorola-sysv3\n \texit ;;\n     AViiON:dgux:*:*)\n-        # DG/UX returns AViiON for all architectures\n-        UNAME_PROCESSOR=`/usr/bin/uname -p`\n+\t# DG/UX returns AViiON for all architectures\n+\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n \tif [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]\n \tthen\n \t    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \\\n@@ -475,7 +500,7 @@\n \telse\n \t    echo i586-dg-dgux${UNAME_RELEASE}\n \tfi\n- \texit ;;\n+\texit ;;\n     M88*:DolphinOS:*:*)\t# DolphinOS (SVR3)\n \techo m88k-dolphin-sysv3\n \texit ;;\n@@ -532,7 +557,7 @@\n \t\techo rs6000-ibm-aix3.2\n \tfi\n \texit ;;\n-    *:AIX:*:[456])\n+    *:AIX:*:[4567])\n \tIBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`\n \tif /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then\n \t\tIBM_ARCH=rs6000\n@@ -575,52 +600,52 @@\n \t    9000/[678][0-9][0-9])\n \t\tif [ -x /usr/bin/getconf ]; then\n \t\t    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`\n-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n-                    case \"${sc_cpu_version}\" in\n-                      523) HP_ARCH=\"hppa1.0\" ;; # CPU_PA_RISC1_0\n-                      528) HP_ARCH=\"hppa1.1\" ;; # CPU_PA_RISC1_1\n-                      532)                      # CPU_PA_RISC2_0\n-                        case \"${sc_kernel_bits}\" in\n-                          32) HP_ARCH=\"hppa2.0n\" ;;\n-                          64) HP_ARCH=\"hppa2.0w\" ;;\n+\t\t    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n+\t\t    case \"${sc_cpu_version}\" in\n+\t\t      523) HP_ARCH=\"hppa1.0\" ;; # CPU_PA_RISC1_0\n+\t\t      528) HP_ARCH=\"hppa1.1\" ;; # CPU_PA_RISC1_1\n+\t\t      532)                      # CPU_PA_RISC2_0\n+\t\t\tcase \"${sc_kernel_bits}\" in\n+\t\t\t  32) HP_ARCH=\"hppa2.0n\" ;;\n+\t\t\t  64) HP_ARCH=\"hppa2.0w\" ;;\n \t\t\t  '') HP_ARCH=\"hppa2.0\" ;;   # HP-UX 10.20\n-                        esac ;;\n-                    esac\n+\t\t\tesac ;;\n+\t\t    esac\n \t\tfi\n \t\tif [ \"${HP_ARCH}\" = \"\" ]; then\n \t\t    eval $set_cc_for_build\n-\t\t    sed 's/^              //' << EOF >$dummy.c\n+\t\t    sed 's/^\t\t//' << EOF >$dummy.c\n+\n+\t\t#define _HPUX_SOURCE\n+\t\t#include <stdlib.h>\n+\t\t#include <unistd.h>\n+\n+\t\tint main ()\n+\t\t{\n+\t\t#if defined(_SC_KERNEL_BITS)\n+\t\t    long bits = sysconf(_SC_KERNEL_BITS);\n+\t\t#endif\n+\t\t    long cpu  = sysconf (_SC_CPU_VERSION);\n \n-              #define _HPUX_SOURCE\n-              #include <stdlib.h>\n-              #include <unistd.h>\n-\n-              int main ()\n-              {\n-              #if defined(_SC_KERNEL_BITS)\n-                  long bits = sysconf(_SC_KERNEL_BITS);\n-              #endif\n-                  long cpu  = sysconf (_SC_CPU_VERSION);\n-\n-                  switch (cpu)\n-              \t{\n-              \tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n-              \tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n-              \tcase CPU_PA_RISC2_0:\n-              #if defined(_SC_KERNEL_BITS)\n-              \t    switch (bits)\n-              \t\t{\n-              \t\tcase 64: puts (\"hppa2.0w\"); break;\n-              \t\tcase 32: puts (\"hppa2.0n\"); break;\n-              \t\tdefault: puts (\"hppa2.0\"); break;\n-              \t\t} break;\n-              #else  /* !defined(_SC_KERNEL_BITS) */\n-              \t    puts (\"hppa2.0\"); break;\n-              #endif\n-              \tdefault: puts (\"hppa1.0\"); break;\n-              \t}\n-                  exit (0);\n-              }\n+\t\t    switch (cpu)\n+\t\t\t{\n+\t\t\tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n+\t\t\tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n+\t\t\tcase CPU_PA_RISC2_0:\n+\t\t#if defined(_SC_KERNEL_BITS)\n+\t\t\t    switch (bits)\n+\t\t\t\t{\n+\t\t\t\tcase 64: puts (\"hppa2.0w\"); break;\n+\t\t\t\tcase 32: puts (\"hppa2.0n\"); break;\n+\t\t\t\tdefault: puts (\"hppa2.0\"); break;\n+\t\t\t\t} break;\n+\t\t#else  /* !defined(_SC_KERNEL_BITS) */\n+\t\t\t    puts (\"hppa2.0\"); break;\n+\t\t#endif\n+\t\t\tdefault: puts (\"hppa1.0\"); break;\n+\t\t\t}\n+\t\t    exit (0);\n+\t\t}\n EOF\n \t\t    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`\n \t\t    test -z \"$HP_ARCH\" && HP_ARCH=hppa\n@@ -640,7 +665,7 @@\n \t    # => hppa64-hp-hpux11.23\n \n \t    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |\n-\t\tgrep __LP64__ >/dev/null\n+\t\tgrep -q __LP64__\n \t    then\n \t\tHP_ARCH=\"hppa2.0w\"\n \t    else\n@@ -711,22 +736,22 @@\n \texit ;;\n     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)\n \techo c1-convex-bsd\n-        exit ;;\n+\texit ;;\n     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)\n \tif getsysinfo -f scalar_acc\n \tthen echo c32-convex-bsd\n \telse echo c2-convex-bsd\n \tfi\n-        exit ;;\n+\texit ;;\n     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)\n \techo c34-convex-bsd\n-        exit ;;\n+\texit ;;\n     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)\n \techo c38-convex-bsd\n-        exit ;;\n+\texit ;;\n     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)\n \techo c4-convex-bsd\n-        exit ;;\n+\texit ;;\n     CRAY*Y-MP:*:*:*)\n \techo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n \texit ;;\n@@ -750,14 +775,14 @@\n \texit ;;\n     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)\n \tFUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`\n-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n-        echo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n-        exit ;;\n+\tFUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n+\tFUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n+\techo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n+\texit ;;\n     5000:UNIX_System_V:4.*:*)\n-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`\n-        echo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n+\tFUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n+\tFUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`\n+\techo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n \texit ;;\n     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\\ Embedded/OS:*:*)\n \techo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}\n@@ -769,34 +794,39 @@\n \techo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}\n \texit ;;\n     *:FreeBSD:*:*)\n-\tcase ${UNAME_MACHINE} in\n-\t    pc98)\n-\t\techo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n+\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n+\tcase ${UNAME_PROCESSOR} in\n \t    amd64)\n \t\techo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n \t    *)\n-\t\techo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n+\t\techo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n \tesac\n \texit ;;\n     i*:CYGWIN*:*)\n \techo ${UNAME_MACHINE}-pc-cygwin\n \texit ;;\n+    *:MINGW64*:*)\n+\techo ${UNAME_MACHINE}-pc-mingw64\n+\texit ;;\n     *:MINGW*:*)\n \techo ${UNAME_MACHINE}-pc-mingw32\n \texit ;;\n+    i*:MSYS*:*)\n+\techo ${UNAME_MACHINE}-pc-msys\n+\texit ;;\n     i*:windows32*:*)\n-    \t# uname -m includes \"-pc\" on this system.\n-    \techo ${UNAME_MACHINE}-mingw32\n+\t# uname -m includes \"-pc\" on this system.\n+\techo ${UNAME_MACHINE}-mingw32\n \texit ;;\n     i*:PW*:*)\n \techo ${UNAME_MACHINE}-pc-pw32\n \texit ;;\n-    *:Interix*:[3456]*)\n-    \tcase ${UNAME_MACHINE} in\n+    *:Interix*:*)\n+\tcase ${UNAME_MACHINE} in\n \t    x86)\n \t\techo i586-pc-interix${UNAME_RELEASE}\n \t\texit ;;\n-\t    EM64T | authenticamd)\n+\t    authenticamd | genuineintel | EM64T)\n \t\techo x86_64-unknown-interix${UNAME_RELEASE}\n \t\texit ;;\n \t    IA64)\n@@ -806,6 +836,9 @@\n     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)\n \techo i${UNAME_MACHINE}-pc-mks\n \texit ;;\n+    8664:Windows_NT:*)\n+\techo x86_64-pc-mks\n+\texit ;;\n     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)\n \t# How do we know it's Interix rather than the generic POSIX subsystem?\n \t# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we\n@@ -835,6 +868,27 @@\n     i*86:Minix:*:*)\n \techo ${UNAME_MACHINE}-pc-minix\n \texit ;;\n+    aarch64:Linux:*:*)\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n+\texit ;;\n+    aarch64_be:Linux:*:*)\n+\tUNAME_MACHINE=aarch64_be\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n+\texit ;;\n+    alpha:Linux:*:*)\n+\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n+\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n+\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n+\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n+\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n+\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n+\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n+\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n+\tesac\n+\tobjdump --private-headers /bin/sh | grep -q ld.so.1\n+\tif test \"$?\" = 0 ; then LIBC=\"libc1\" ; else LIBC=\"\" ; fi\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}\n+\texit ;;\n     arm*:Linux:*:*)\n \teval $set_cc_for_build\n \tif echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n@@ -842,20 +896,40 @@\n \tthen\n \t    echo ${UNAME_MACHINE}-unknown-linux-gnu\n \telse\n-\t    echo ${UNAME_MACHINE}-unknown-linux-gnueabi\n+\t    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \\\n+\t\t| grep -q __ARM_PCS_VFP\n+\t    then\n+\t\techo ${UNAME_MACHINE}-unknown-linux-gnueabi\n+\t    else\n+\t\techo ${UNAME_MACHINE}-unknown-linux-gnueabihf\n+\t    fi\n \tfi\n \texit ;;\n     avr32*:Linux:*:*)\n \techo ${UNAME_MACHINE}-unknown-linux-gnu\n \texit ;;\n     cris:Linux:*:*)\n-\techo cris-axis-linux-gnu\n+\techo ${UNAME_MACHINE}-axis-linux-gnu\n \texit ;;\n     crisv32:Linux:*:*)\n-\techo crisv32-axis-linux-gnu\n+\techo ${UNAME_MACHINE}-axis-linux-gnu\n \texit ;;\n     frv:Linux:*:*)\n-    \techo frv-unknown-linux-gnu\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n+\texit ;;\n+    hexagon:Linux:*:*)\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n+\texit ;;\n+    i*86:Linux:*:*)\n+\tLIBC=gnu\n+\teval $set_cc_for_build\n+\tsed 's/^\t//' << EOF >$dummy.c\n+\t#ifdef __dietlibc__\n+\tLIBC=dietlibc\n+\t#endif\n+EOF\n+\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`\n+\techo \"${UNAME_MACHINE}-pc-linux-${LIBC}\"\n \texit ;;\n     ia64:Linux:*:*)\n \techo ${UNAME_MACHINE}-unknown-linux-gnu\n@@ -866,74 +940,33 @@\n     m68*:Linux:*:*)\n \techo ${UNAME_MACHINE}-unknown-linux-gnu\n \texit ;;\n-    mips:Linux:*:*)\n+    mips:Linux:*:* | mips64:Linux:*:*)\n \teval $set_cc_for_build\n \tsed 's/^\t//' << EOF >$dummy.c\n \t#undef CPU\n-\t#undef mips\n-\t#undef mipsel\n+\t#undef ${UNAME_MACHINE}\n+\t#undef ${UNAME_MACHINE}el\n \t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n-\tCPU=mipsel\n+\tCPU=${UNAME_MACHINE}el\n \t#else\n \t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n-\tCPU=mips\n+\tCPU=${UNAME_MACHINE}\n \t#else\n \tCPU=\n \t#endif\n \t#endif\n EOF\n-\teval \"`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '\n-\t    /^CPU/{\n-\t\ts: ::g\n-\t\tp\n-\t    }'`\"\n-\ttest x\"${CPU}\" != x && { echo \"${CPU}-unknown-linux-gnu\"; exit; }\n-\t;;\n-    mips64:Linux:*:*)\n-\teval $set_cc_for_build\n-\tsed 's/^\t//' << EOF >$dummy.c\n-\t#undef CPU\n-\t#undef mips64\n-\t#undef mips64el\n-\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n-\tCPU=mips64el\n-\t#else\n-\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n-\tCPU=mips64\n-\t#else\n-\tCPU=\n-\t#endif\n-\t#endif\n-EOF\n-\teval \"`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '\n-\t    /^CPU/{\n-\t\ts: ::g\n-\t\tp\n-\t    }'`\"\n+\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`\n \ttest x\"${CPU}\" != x && { echo \"${CPU}-unknown-linux-gnu\"; exit; }\n \t;;\n     or32:Linux:*:*)\n-\techo or32-unknown-linux-gnu\n-\texit ;;\n-    ppc:Linux:*:*)\n-\techo powerpc-unknown-linux-gnu\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n \texit ;;\n-    ppc64:Linux:*:*)\n-\techo powerpc64-unknown-linux-gnu\n+    padre:Linux:*:*)\n+\techo sparc-unknown-linux-gnu\n \texit ;;\n-    alpha:Linux:*:*)\n-\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n-\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n-\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n-\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n-\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n-\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n-\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n-\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n-        esac\n-\tobjdump --private-headers /bin/sh | grep ld.so.1 >/dev/null\n-\tif test \"$?\" = 0 ; then LIBC=\"libc1\" ; else LIBC=\"\" ; fi\n-\techo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}\n+    parisc64:Linux:*:* | hppa64:Linux:*:*)\n+\techo hppa64-unknown-linux-gnu\n \texit ;;\n     parisc:Linux:*:* | hppa:Linux:*:*)\n \t# Look for CPU level\n@@ -943,14 +976,17 @@\n \t  *)    echo hppa-unknown-linux-gnu ;;\n \tesac\n \texit ;;\n-    parisc64:Linux:*:* | hppa64:Linux:*:*)\n-\techo hppa64-unknown-linux-gnu\n+    ppc64:Linux:*:*)\n+\techo powerpc64-unknown-linux-gnu\n+\texit ;;\n+    ppc:Linux:*:*)\n+\techo powerpc-unknown-linux-gnu\n \texit ;;\n     s390:Linux:*:* | s390x:Linux:*:*)\n \techo ${UNAME_MACHINE}-ibm-linux\n \texit ;;\n     sh64*:Linux:*:*)\n-    \techo ${UNAME_MACHINE}-unknown-linux-gnu\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n \texit ;;\n     sh*:Linux:*:*)\n \techo ${UNAME_MACHINE}-unknown-linux-gnu\n@@ -958,78 +994,18 @@\n     sparc:Linux:*:* | sparc64:Linux:*:*)\n \techo ${UNAME_MACHINE}-unknown-linux-gnu\n \texit ;;\n+    tile*:Linux:*:*)\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n+\texit ;;\n     vax:Linux:*:*)\n \techo ${UNAME_MACHINE}-dec-linux-gnu\n \texit ;;\n     x86_64:Linux:*:*)\n-\techo x86_64-unknown-linux-gnu\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n \texit ;;\n     xtensa*:Linux:*:*)\n-    \techo ${UNAME_MACHINE}-unknown-linux-gnu\n+\techo ${UNAME_MACHINE}-unknown-linux-gnu\n \texit ;;\n-    i*86:Linux:*:*)\n-\t# The BFD linker knows what the default object file format is, so\n-\t# first see if it will tell us. cd to the root directory to prevent\n-\t# problems with other programs or directories called `ld' in the path.\n-\t# Set LC_ALL=C to ensure ld outputs messages in English.\n-\tld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \\\n-\t\t\t | sed -ne '/supported targets:/!d\n-\t\t\t\t    s/[ \t][ \t]*/ /g\n-\t\t\t\t    s/.*supported targets: *//\n-\t\t\t\t    s/ .*//\n-\t\t\t\t    p'`\n-        case \"$ld_supported_targets\" in\n-\t  elf32-i386)\n-\t\tTENTATIVE=\"${UNAME_MACHINE}-pc-linux-gnu\"\n-\t\t;;\n-\t  a.out-i386-linux)\n-\t\techo \"${UNAME_MACHINE}-pc-linux-gnuaout\"\n-\t\texit ;;\n-\t  coff-i386)\n-\t\techo \"${UNAME_MACHINE}-pc-linux-gnucoff\"\n-\t\texit ;;\n-\t  \"\")\n-\t\t# Either a pre-BFD a.out linker (linux-gnuoldld) or\n-\t\t# one that does not give us useful --help.\n-\t\techo \"${UNAME_MACHINE}-pc-linux-gnuoldld\"\n-\t\texit ;;\n-\tesac\n-\t# Determine whether the default compiler is a.out or elf\n-\teval $set_cc_for_build\n-\tsed 's/^\t//' << EOF >$dummy.c\n-\t#include <features.h>\n-\t#ifdef __ELF__\n-\t# ifdef __GLIBC__\n-\t#  if __GLIBC__ >= 2\n-\tLIBC=gnu\n-\t#  else\n-\tLIBC=gnulibc1\n-\t#  endif\n-\t# else\n-\tLIBC=gnulibc1\n-\t# endif\n-\t#else\n-\t#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)\n-\tLIBC=gnu\n-\t#else\n-\tLIBC=gnuaout\n-\t#endif\n-\t#endif\n-\t#ifdef __dietlibc__\n-\tLIBC=dietlibc\n-\t#endif\n-EOF\n-\teval \"`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '\n-\t    /^LIBC/{\n-\t\ts: ::g\n-\t\tp\n-\t    }'`\"\n-\ttest x\"${LIBC}\" != x && {\n-\t\techo \"${UNAME_MACHINE}-pc-linux-${LIBC}\"\n-\t\texit\n-\t}\n-\ttest x\"${TENTATIVE}\" != x && { echo \"${TENTATIVE}\"; exit; }\n-\t;;\n     i*86:DYNIX/ptx:4*:*)\n \t# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.\n \t# earlier versions are messed up and put the nodename in both\n@@ -1037,11 +1013,11 @@\n \techo i386-sequent-sysv4\n \texit ;;\n     i*86:UNIX_SV:4.2MP:2.*)\n-        # Unixware is an offshoot of SVR4, but it has its own version\n-        # number series starting with 2...\n-        # I am not positive that other SVR4 systems won't match this,\n+\t# Unixware is an offshoot of SVR4, but it has its own version\n+\t# number series starting with 2...\n+\t# I am not positive that other SVR4 systems won't match this,\n \t# I just have to hope.  -- rms.\n-        # Use sysv4.2uw... so that sysv4* matches it.\n+\t# Use sysv4.2uw... so that sysv4* matches it.\n \techo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}\n \texit ;;\n     i*86:OS/2:*:*)\n@@ -1058,7 +1034,7 @@\n     i*86:syllable:*:*)\n \techo ${UNAME_MACHINE}-pc-syllable\n \texit ;;\n-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)\n+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)\n \techo i386-unknown-lynxos${UNAME_RELEASE}\n \texit ;;\n     i*86:*DOS:*:*)\n@@ -1073,7 +1049,7 @@\n \tfi\n \texit ;;\n     i*86:*:5:[678]*)\n-    \t# UnixWare 7.x, OpenUNIX and OpenServer 6.\n+\t# UnixWare 7.x, OpenUNIX and OpenServer 6.\n \tcase `/bin/uname -X | grep \"^Machine\"` in\n \t    *486*)\t     UNAME_MACHINE=i486 ;;\n \t    *Pentium)\t     UNAME_MACHINE=i586 ;;\n@@ -1101,10 +1077,13 @@\n \texit ;;\n     pc:*:*:*)\n \t# Left here for compatibility:\n-        # uname -m prints for DJGPP always 'pc', but it prints nothing about\n-        # the processor, so we play safe by assuming i386.\n-\techo i386-pc-msdosdjgpp\n-        exit ;;\n+\t# uname -m prints for DJGPP always 'pc', but it prints nothing about\n+\t# the processor, so we play safe by assuming i586.\n+\t# Note: whatever this is, it MUST be the same as what config.sub\n+\t# prints for the \"djgpp\" host, or else GDB configury will decide that\n+\t# this is a cross-build.\n+\techo i586-pc-msdosdjgpp\n+\texit ;;\n     Intel:Mach:3*:*)\n \techo i386-pc-mach3\n \texit ;;\n@@ -1139,8 +1118,18 @@\n \t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n \t  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)\n-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n-          && { echo i486-ncr-sysv4; exit; } ;;\n+\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n+\t  && { echo i486-ncr-sysv4; exit; } ;;\n+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)\n+\tOS_REL='.3'\n+\ttest -r /etc/.relid \\\n+\t    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n+\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n+\t    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n+\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n+\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }\n+\t/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \\\n+\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)\n \techo m68k-unknown-lynxos${UNAME_RELEASE}\n \texit ;;\n@@ -1153,7 +1142,7 @@\n     rs6000:LynxOS:2.*:*)\n \techo rs6000-unknown-lynxos${UNAME_RELEASE}\n \texit ;;\n-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)\n+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)\n \techo powerpc-unknown-lynxos${UNAME_RELEASE}\n \texit ;;\n     SM[BE]S:UNIX_SV:*:*)\n@@ -1173,10 +1162,10 @@\n \t\techo ns32k-sni-sysv\n \tfi\n \texit ;;\n-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n-                      # says <Richard.M.Bartel@ccMail.Census.GOV>\n-        echo i586-unisys-sysv4\n-        exit ;;\n+    PENTIUM:*:4.0*:*)\t# Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n+\t\t\t# says <Richard.M.Bartel@ccMail.Census.GOV>\n+\techo i586-unisys-sysv4\n+\texit ;;\n     *:UNIX_System_V:4*:FTX*)\n \t# From Gerald Hewes <hewes@openmarket.com>.\n \t# How about differentiating between stratus architectures? -djm\n@@ -1202,11 +1191,11 @@\n \texit ;;\n     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)\n \tif [ -d /usr/nec ]; then\n-\t        echo mips-nec-sysv${UNAME_RELEASE}\n+\t\techo mips-nec-sysv${UNAME_RELEASE}\n \telse\n-\t        echo mips-unknown-sysv${UNAME_RELEASE}\n+\t\techo mips-unknown-sysv${UNAME_RELEASE}\n \tfi\n-        exit ;;\n+\texit ;;\n     BeBox:BeOS:*:*)\t# BeOS running on hardware made by Be, PPC only.\n \techo powerpc-be-beos\n \texit ;;\n@@ -1216,6 +1205,12 @@\n     BePC:BeOS:*:*)\t# BeOS running on Intel PC compatible.\n \techo i586-pc-beos\n \texit ;;\n+    BePC:Haiku:*:*)\t# Haiku running on Intel PC compatible.\n+\techo i586-pc-haiku\n+\texit ;;\n+    x86_64:Haiku:*:*)\n+\techo x86_64-unknown-haiku\n+\texit ;;\n     SX-4:SUPER-UX:*:*)\n \techo sx4-nec-superux${UNAME_RELEASE}\n \texit ;;\n@@ -1243,6 +1238,16 @@\n     *:Darwin:*:*)\n \tUNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown\n \tcase $UNAME_PROCESSOR in\n+\t    i386)\n+\t\teval $set_cc_for_build\n+\t\tif [ \"$CC_FOR_BUILD\" != 'no_compiler_found' ]; then\n+\t\t  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \\\n+\t\t      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \\\n+\t\t      grep IS_64BIT_ARCH >/dev/null\n+\t\t  then\n+\t\t      UNAME_PROCESSOR=\"x86_64\"\n+\t\t  fi\n+\t\tfi ;;\n \t    unknown) UNAME_PROCESSOR=powerpc ;;\n \tesac\n \techo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}\n@@ -1258,7 +1263,10 @@\n     *:QNX:*:4*)\n \techo i386-pc-qnx\n \texit ;;\n-    NSE-?:NONSTOP_KERNEL:*:*)\n+    NEO-?:NONSTOP_KERNEL:*:*)\n+\techo neo-tandem-nsk${UNAME_RELEASE}\n+\texit ;;\n+    NSE-*:NONSTOP_KERNEL:*:*)\n \techo nse-tandem-nsk${UNAME_RELEASE}\n \texit ;;\n     NSR-?:NONSTOP_KERNEL:*:*)\n@@ -1303,13 +1311,13 @@\n \techo pdp10-unknown-its\n \texit ;;\n     SEI:*:*:SEIUX)\n-        echo mips-sei-seiux${UNAME_RELEASE}\n+\techo mips-sei-seiux${UNAME_RELEASE}\n \texit ;;\n     *:DragonFly:*:*)\n \techo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n \texit ;;\n     *:*VMS:*:*)\n-    \tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n+\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n \tcase \"${UNAME_MACHINE}\" in\n \t    A*) echo alpha-dec-vms ; exit ;;\n \t    I*) echo ia64-dec-vms ; exit ;;\n@@ -1324,11 +1332,14 @@\n     i*86:rdos:*:*)\n \techo ${UNAME_MACHINE}-pc-rdos\n \texit ;;\n+    i*86:AROS:*:*)\n+\techo ${UNAME_MACHINE}-pc-aros\n+\texit ;;\n+    x86_64:VMkernel:*:*)\n+\techo ${UNAME_MACHINE}-unknown-esx\n+\texit ;;\n esac\n \n-#echo '(No uname command or uname output not recognized.)' 1>&2\n-#echo \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" 1>&2\n-\n eval $set_cc_for_build\n cat >$dummy.c <<EOF\n #ifdef _SEQUENT_\n@@ -1346,11 +1357,11 @@\n #include <sys/param.h>\n   printf (\"m68k-sony-newsos%s\\n\",\n #ifdef NEWSOS4\n-          \"4\"\n+\t\"4\"\n #else\n-\t  \"\"\n+\t\"\"\n #endif\n-         ); exit (0);\n+\t); exit (0);\n #endif\n #endif\n \n@@ -1484,9 +1495,9 @@\n the operating system you are using. It is advised that you\n download the most up to date version of the config scripts from\n \n-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess\n+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD\n and\n-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub\n+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD\n \n If the version you run ($0) is already up to date, please\n send the following data and any information you think might be\ndiff -urN uuid-1.6.2/config.sub uuid-1.6.2-aarch64/config.sub\n--- uuid-1.6.2/config.sub\t2008-07-04 16:43:08.000000000 -0500\n+++ uuid-1.6.2-aarch64/config.sub\t2013-03-03 09:02:58.680328512 -0600\n@@ -1,10 +1,10 @@\n #! /bin/sh\n # Configuration validation subroutine script.\n #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008\n-#   Free Software Foundation, Inc.\n+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\n+#   2011, 2012 Free Software Foundation, Inc.\n \n-timestamp='2008-01-16'\n+timestamp='2012-10-10'\n \n # This file is (in principle) common to ALL GNU software.\n # The presence of a machine in this file suggests that SOME GNU software\n@@ -21,9 +21,7 @@\n # GNU General Public License for more details.\n #\n # You should have received a copy of the GNU General Public License\n-# along with this program; if not, write to the Free Software\n-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA\n-# 02110-1301, USA.\n+# along with this program; if not, see <http://www.gnu.org/licenses/>.\n #\n # As a special exception to the GNU General Public License, if you\n # distribute this file as part of a program that contains a\n@@ -32,13 +30,16 @@\n \n \n # Please send patches to <config-patches@gnu.org>.  Submit a context\n-# diff and a properly formatted ChangeLog entry.\n+# diff and a properly formatted GNU ChangeLog entry.\n #\n # Configuration subroutine to validate and canonicalize a configuration type.\n # Supply the specified configuration type as an argument.\n # If it is invalid, we print an error message on stderr and exit with code 1.\n # Otherwise, we print the canonical config type on stdout and succeed.\n \n+# You can get the latest version of this script from:\n+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD\n+\n # This file is supposed to be the same for all GNU packages\n # and recognize all the CPU types, system types and aliases\n # that are meaningful with *any* GNU software.\n@@ -72,8 +73,9 @@\n version=\"\\\n GNU config.sub ($timestamp)\n \n-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,\n-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,\n+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012\n+Free Software Foundation, Inc.\n \n This is free software; see the source for copying conditions.  There is NO\n warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n@@ -120,12 +122,18 @@\n # Here we must recognize all the valid KERNEL-OS combinations.\n maybe_os=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\2/'`\n case $maybe_os in\n-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \\\n-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \\\n+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \\\n+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \\\n+  knetbsd*-gnu* | netbsd*-gnu* | \\\n+  kopensolaris*-gnu* | \\\n   storm-chaos* | os2-emx* | rtmk-nova*)\n     os=-$maybe_os\n     basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`\n     ;;\n+  android-linux)\n+    os=-linux-android\n+    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`-unknown\n+    ;;\n   *)\n     basic_machine=`echo $1 | sed 's/-[^-]*$//'`\n     if [ $basic_machine != $1 ]\n@@ -148,10 +156,13 @@\n \t-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\\\n \t-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \\\n \t-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \\\n-\t-apple | -axis | -knuth | -cray)\n+\t-apple | -axis | -knuth | -cray | -microblaze*)\n \t\tos=\n \t\tbasic_machine=$1\n \t\t;;\n+\t-bluegene*)\n+\t\tos=-cnk\n+\t\t;;\n \t-sim | -cisco | -oki | -wec | -winbond)\n \t\tos=\n \t\tbasic_machine=$1\n@@ -166,10 +177,10 @@\n \t\tos=-chorusos\n \t\tbasic_machine=$1\n \t\t;;\n- \t-chorusrdb)\n- \t\tos=-chorusrdb\n+\t-chorusrdb)\n+\t\tos=-chorusrdb\n \t\tbasic_machine=$1\n- \t\t;;\n+\t\t;;\n \t-hiux*)\n \t\tos=-hiuxwe2\n \t\t;;\n@@ -214,6 +225,12 @@\n \t-isc*)\n \t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n \t\t;;\n+\t-lynx*178)\n+\t\tos=-lynxos178\n+\t\t;;\n+\t-lynx*5)\n+\t\tos=-lynxos5\n+\t\t;;\n \t-lynx*)\n \t\tos=-lynxos\n \t\t;;\n@@ -238,24 +255,32 @@\n \t# Some are omitted here because they have special meanings below.\n \t1750a | 580 \\\n \t| a29k \\\n+\t| aarch64 | aarch64_be \\\n \t| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \\\n \t| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \\\n \t| am33_2.0 \\\n \t| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \\\n+        | be32 | be64 \\\n \t| bfin \\\n \t| c4x | clipper \\\n \t| d10v | d30v | dlx | dsp16xx \\\n+\t| epiphany \\\n \t| fido | fr30 | frv \\\n \t| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \\\n+\t| hexagon \\\n \t| i370 | i860 | i960 | ia64 \\\n \t| ip2k | iq2000 \\\n+\t| le32 | le64 \\\n+\t| lm32 \\\n \t| m32c | m32r | m32rle | m68000 | m68k | m88k \\\n-\t| maxq | mb | microblaze | mcore | mep \\\n+\t| maxq | mb | microblaze | microblazeel | mcore | mep | metag \\\n \t| mips | mipsbe | mipseb | mipsel | mipsle \\\n \t| mips16 \\\n \t| mips64 | mips64el \\\n-\t| mips64vr | mips64vrel \\\n+\t| mips64octeon | mips64octeonel \\\n \t| mips64orion | mips64orionel \\\n+\t| mips64r5900 | mips64r5900el \\\n+\t| mips64vr | mips64vrel \\\n \t| mips64vr4100 | mips64vr4100el \\\n \t| mips64vr4300 | mips64vr4300el \\\n \t| mips64vr5000 | mips64vr5000el \\\n@@ -268,29 +293,42 @@\n \t| mipsisa64sr71k | mipsisa64sr71kel \\\n \t| mipstx39 | mipstx39el \\\n \t| mn10200 | mn10300 \\\n+\t| moxie \\\n \t| mt \\\n \t| msp430 \\\n+\t| nds32 | nds32le | nds32be \\\n \t| nios | nios2 \\\n \t| ns16k | ns32k \\\n+\t| open8 \\\n \t| or32 \\\n \t| pdp10 | pdp11 | pj | pjl \\\n-\t| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \\\n+\t| powerpc | powerpc64 | powerpc64le | powerpcle \\\n \t| pyramid \\\n+\t| rl78 | rx \\\n \t| score \\\n-\t| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \\\n+\t| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \\\n \t| sh64 | sh64le \\\n \t| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \\\n \t| sparcv8 | sparcv9 | sparcv9b | sparcv9v \\\n-\t| spu | strongarm \\\n-\t| tahoe | thumb | tic4x | tic80 | tron \\\n-\t| v850 | v850e \\\n+\t| spu \\\n+\t| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \\\n+\t| ubicom32 \\\n+\t| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \\\n \t| we32k \\\n-\t| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \\\n-\t| z8k)\n+\t| x86 | xc16x | xstormy16 | xtensa \\\n+\t| z8k | z80)\n \t\tbasic_machine=$basic_machine-unknown\n \t\t;;\n-\tm6811 | m68hc11 | m6812 | m68hc12)\n-\t\t# Motorola 68HC11/12.\n+\tc54x)\n+\t\tbasic_machine=tic54x-unknown\n+\t\t;;\n+\tc55x)\n+\t\tbasic_machine=tic55x-unknown\n+\t\t;;\n+\tc6x)\n+\t\tbasic_machine=tic6x-unknown\n+\t\t;;\n+\tm6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)\n \t\tbasic_machine=$basic_machine-unknown\n \t\tos=-none\n \t\t;;\n@@ -300,6 +338,21 @@\n \t\tbasic_machine=mt-unknown\n \t\t;;\n \n+\tstrongarm | thumb | xscale)\n+\t\tbasic_machine=arm-unknown\n+\t\t;;\n+\txgate)\n+\t\tbasic_machine=$basic_machine-unknown\n+\t\tos=-none\n+\t\t;;\n+\txscaleeb)\n+\t\tbasic_machine=armeb-unknown\n+\t\t;;\n+\n+\txscaleel)\n+\t\tbasic_machine=armel-unknown\n+\t\t;;\n+\n \t# We use `pc' rather than `unknown'\n \t# because (1) that's what they normally are, and\n \t# (2) the word \"unknown\" tends to confuse beginning users.\n@@ -314,29 +367,37 @@\n \t# Recognize the basic CPU types with company name.\n \t580-* \\\n \t| a29k-* \\\n+\t| aarch64-* | aarch64_be-* \\\n \t| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \\\n \t| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \\\n \t| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \\\n \t| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \\\n \t| avr-* | avr32-* \\\n+\t| be32-* | be64-* \\\n \t| bfin-* | bs2000-* \\\n-\t| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \\\n+\t| c[123]* | c30-* | [cjt]90-* | c4x-* \\\n \t| clipper-* | craynv-* | cydra-* \\\n \t| d10v-* | d30v-* | dlx-* \\\n \t| elxsi-* \\\n \t| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \\\n \t| h8300-* | h8500-* \\\n \t| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \\\n+\t| hexagon-* \\\n \t| i*86-* | i860-* | i960-* | ia64-* \\\n \t| ip2k-* | iq2000-* \\\n+\t| le32-* | le64-* \\\n+\t| lm32-* \\\n \t| m32c-* | m32r-* | m32rle-* \\\n \t| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \\\n-\t| m88110-* | m88k-* | maxq-* | mcore-* \\\n+\t| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \\\n+\t| microblaze-* | microblazeel-* \\\n \t| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \\\n \t| mips16-* \\\n \t| mips64-* | mips64el-* \\\n-\t| mips64vr-* | mips64vrel-* \\\n+\t| mips64octeon-* | mips64octeonel-* \\\n \t| mips64orion-* | mips64orionel-* \\\n+\t| mips64r5900-* | mips64r5900el-* \\\n+\t| mips64vr-* | mips64vrel-* \\\n \t| mips64vr4100-* | mips64vr4100el-* \\\n \t| mips64vr4300-* | mips64vr4300el-* \\\n \t| mips64vr5000-* | mips64vr5000el-* \\\n@@ -351,27 +412,32 @@\n \t| mmix-* \\\n \t| mt-* \\\n \t| msp430-* \\\n+\t| nds32-* | nds32le-* | nds32be-* \\\n \t| nios-* | nios2-* \\\n \t| none-* | np1-* | ns16k-* | ns32k-* \\\n+\t| open8-* \\\n \t| orion-* \\\n \t| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \\\n-\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \\\n+\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \\\n \t| pyramid-* \\\n-\t| romp-* | rs6000-* \\\n-\t| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \\\n+\t| rl78-* | romp-* | rs6000-* | rx-* \\\n+\t| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \\\n \t| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \\\n \t| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \\\n \t| sparclite-* \\\n-\t| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \\\n-\t| tahoe-* | thumb-* \\\n+\t| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \\\n+\t| tahoe-* \\\n \t| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \\\n+\t| tile*-* \\\n \t| tron-* \\\n-\t| v850-* | v850e-* | vax-* \\\n+\t| ubicom32-* \\\n+\t| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \\\n+\t| vax-* \\\n \t| we32k-* \\\n-\t| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \\\n+\t| x86-* | x86_64-* | xc16x-* | xps100-* \\\n \t| xstormy16-* | xtensa*-* \\\n \t| ymp-* \\\n-\t| z8k-*)\n+\t| z8k-* | z80-*)\n \t\t;;\n \t# Recognize the basic CPU types without company name, with glob match.\n \txtensa*)\n@@ -393,7 +459,7 @@\n \t\tbasic_machine=a29k-amd\n \t\tos=-udi\n \t\t;;\n-    \tabacus)\n+\tabacus)\n \t\tbasic_machine=abacus-unknown\n \t\t;;\n \tadobe68k)\n@@ -439,6 +505,10 @@\n \t\tbasic_machine=m68k-apollo\n \t\tos=-bsd\n \t\t;;\n+\taros)\n+\t\tbasic_machine=i386-pc\n+\t\tos=-aros\n+\t\t;;\n \taux)\n \t\tbasic_machine=m68k-apple\n \t\tos=-aux\n@@ -455,10 +525,27 @@\n \t\tbasic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`\n \t\tos=-linux\n \t\t;;\n+\tbluegene*)\n+\t\tbasic_machine=powerpc-ibm\n+\t\tos=-cnk\n+\t\t;;\n+\tc54x-*)\n+\t\tbasic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`\n+\t\t;;\n+\tc55x-*)\n+\t\tbasic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`\n+\t\t;;\n+\tc6x-*)\n+\t\tbasic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`\n+\t\t;;\n \tc90)\n \t\tbasic_machine=c90-cray\n \t\tos=-unicos\n \t\t;;\n+\tcegcc)\n+\t\tbasic_machine=arm-unknown\n+\t\tos=-cegcc\n+\t\t;;\n \tconvex-c1)\n \t\tbasic_machine=c1-convex\n \t\tos=-bsd\n@@ -487,7 +574,7 @@\n \t\tbasic_machine=craynv-cray\n \t\tos=-unicosmp\n \t\t;;\n-\tcr16)\n+\tcr16 | cr16-*)\n \t\tbasic_machine=cr16-unknown\n \t\tos=-elf\n \t\t;;\n@@ -526,6 +613,10 @@\n \t\tbasic_machine=m88k-motorola\n \t\tos=-sysv3\n \t\t;;\n+\tdicos)\n+\t\tbasic_machine=i686-pc\n+\t\tos=-dicos\n+\t\t;;\n \tdjgpp)\n \t\tbasic_machine=i586-pc\n \t\tos=-msdosdjgpp\n@@ -641,7 +732,6 @@\n \ti370-ibm* | ibm*)\n \t\tbasic_machine=i370-ibm\n \t\t;;\n-# I'm not sure what \"Sysv32\" means.  Should this be sysv3.2?\n \ti*86v32)\n \t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n \t\tos=-sysv32\n@@ -699,6 +789,13 @@\n \t\tbasic_machine=ns32k-utek\n \t\tos=-sysv\n \t\t;;\n+\tmicroblaze*)\n+\t\tbasic_machine=microblaze-xilinx\n+\t\t;;\n+\tmingw64)\n+\t\tbasic_machine=x86_64-pc\n+\t\tos=-mingw64\n+\t\t;;\n \tmingw32)\n \t\tbasic_machine=i386-pc\n \t\tos=-mingw32\n@@ -735,10 +832,18 @@\n \tms1-*)\n \t\tbasic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`\n \t\t;;\n+\tmsys)\n+\t\tbasic_machine=i386-pc\n+\t\tos=-msys\n+\t\t;;\n \tmvs)\n \t\tbasic_machine=i370-ibm\n \t\tos=-mvs\n \t\t;;\n+\tnacl)\n+\t\tbasic_machine=le32-unknown\n+\t\tos=-nacl\n+\t\t;;\n \tncr3000)\n \t\tbasic_machine=i486-ncr\n \t\tos=-sysv4\n@@ -803,6 +908,12 @@\n \tnp1)\n \t\tbasic_machine=np1-gould\n \t\t;;\n+\tneo-tandem)\n+\t\tbasic_machine=neo-tandem\n+\t\t;;\n+\tnse-tandem)\n+\t\tbasic_machine=nse-tandem\n+\t\t;;\n \tnsr-tandem)\n \t\tbasic_machine=nsr-tandem\n \t\t;;\n@@ -885,9 +996,10 @@\n \t\t;;\n \tpower)\tbasic_machine=power-ibm\n \t\t;;\n-\tppc)\tbasic_machine=powerpc-unknown\n+\tppc | ppcbe)\tbasic_machine=powerpc-unknown\n \t\t;;\n-\tppc-*)\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n+\tppc-* | ppcbe-*)\n+\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n \t\t;;\n \tppcle | powerpclittle | ppc-le | powerpc-little)\n \t\tbasic_machine=powerpcle-unknown\n@@ -981,6 +1093,9 @@\n \t\tbasic_machine=i860-stratus\n \t\tos=-sysv4\n \t\t;;\n+\tstrongarm-* | thumb-*)\n+\t\tbasic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`\n+\t\t;;\n \tsun2)\n \t\tbasic_machine=m68000-sun\n \t\t;;\n@@ -1037,20 +1152,8 @@\n \t\tbasic_machine=t90-cray\n \t\tos=-unicos\n \t\t;;\n-\ttic54x | c54x*)\n-\t\tbasic_machine=tic54x-unknown\n-\t\tos=-coff\n-\t\t;;\n-\ttic55x | c55x*)\n-\t\tbasic_machine=tic55x-unknown\n-\t\tos=-coff\n-\t\t;;\n-\ttic6x | c6x*)\n-\t\tbasic_machine=tic6x-unknown\n-\t\tos=-coff\n-\t\t;;\n \ttile*)\n-\t\tbasic_machine=tile-unknown\n+\t\tbasic_machine=$basic_machine-unknown\n \t\tos=-linux-gnu\n \t\t;;\n \ttx39)\n@@ -1120,6 +1223,9 @@\n \txps | xps100)\n \t\tbasic_machine=xps100-honeywell\n \t\t;;\n+\txscale-* | xscalee[bl]-*)\n+\t\tbasic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`\n+\t\t;;\n \tymp)\n \t\tbasic_machine=ymp-cray\n \t\tos=-unicos\n@@ -1128,6 +1234,10 @@\n \t\tbasic_machine=z8k-unknown\n \t\tos=-sim\n \t\t;;\n+\tz80-*-coff)\n+\t\tbasic_machine=z80-unknown\n+\t\tos=-sim\n+\t\t;;\n \tnone)\n \t\tbasic_machine=none-none\n \t\tos=-none\n@@ -1166,7 +1276,7 @@\n \twe32k)\n \t\tbasic_machine=we32k-att\n \t\t;;\n-\tsh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)\n+\tsh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)\n \t\tbasic_machine=sh-unknown\n \t\t;;\n \tsparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)\n@@ -1213,9 +1323,12 @@\n if [ x\"$os\" != x\"\" ]\n then\n case $os in\n-        # First match some system type aliases\n-        # that might get confused with valid system types.\n+\t# First match some system type aliases\n+\t# that might get confused with valid system types.\n \t# -solaris* is a basic system type, with this one exception.\n+\t-auroraux)\n+\t\tos=-auroraux\n+\t\t;;\n \t-solaris1 | -solaris1.*)\n \t\tos=`echo $os | sed -e 's|solaris1|sunos4|'`\n \t\t;;\n@@ -1236,21 +1349,23 @@\n \t# Each alternative MUST END IN A *, to match a version number.\n \t# -sysv* is not here because it comes later, after sysvr4.\n \t-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \\\n-\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\\\n-\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \\\n+\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\\\n+\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \\\n+\t      | -sym* | -kopensolaris* \\\n \t      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \\\n-\t      | -aos* \\\n+\t      | -aos* | -aros* \\\n \t      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \\\n \t      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \\\n \t      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \\\n-\t      | -openbsd* | -solidbsd* \\\n+\t      | -bitrig* | -openbsd* | -solidbsd* \\\n \t      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \\\n \t      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \\\n \t      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \\\n \t      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \\\n-\t      | -chorusos* | -chorusrdb* \\\n-\t      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n-\t      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \\\n+\t      | -chorusos* | -chorusrdb* | -cegcc* \\\n+\t      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n+\t      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \\\n+\t      | -linux-newlib* | -linux-musl* | -linux-uclibc* \\\n \t      | -uxpv* | -beos* | -mpeix* | -udk* \\\n \t      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \\\n \t      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \\\n@@ -1258,7 +1373,7 @@\n \t      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \\\n \t      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \\\n \t      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \\\n-\t      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)\n+\t      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)\n \t# Remember, each alternative MUST END IN *, to match a version number.\n \t\t;;\n \t-qnx*)\n@@ -1297,7 +1412,7 @@\n \t-opened*)\n \t\tos=-openedition\n \t\t;;\n-        -os400*)\n+\t-os400*)\n \t\tos=-os400\n \t\t;;\n \t-wince*)\n@@ -1346,7 +1461,7 @@\n \t-sinix*)\n \t\tos=-sysv4\n \t\t;;\n-        -tpf*)\n+\t-tpf*)\n \t\tos=-tpf\n \t\t;;\n \t-triton*)\n@@ -1388,6 +1503,11 @@\n \t-zvmoe)\n \t\tos=-zvmoe\n \t\t;;\n+\t-dicos*)\n+\t\tos=-dicos\n+\t\t;;\n+\t-nacl*)\n+\t\t;;\n \t-none)\n \t\t;;\n \t*)\n@@ -1410,10 +1530,10 @@\n # system, and we'll never get to this point.\n \n case $basic_machine in\n-        score-*)\n+\tscore-*)\n \t\tos=-elf\n \t\t;;\n-        spu-*)\n+\tspu-*)\n \t\tos=-elf\n \t\t;;\n \t*-acorn)\n@@ -1425,8 +1545,20 @@\n \tarm*-semi)\n \t\tos=-aout\n \t\t;;\n-        c4x-* | tic4x-*)\n-        \tos=-coff\n+\tc4x-* | tic4x-*)\n+\t\tos=-coff\n+\t\t;;\n+\thexagon-*)\n+\t\tos=-elf\n+\t\t;;\n+\ttic54x-*)\n+\t\tos=-coff\n+\t\t;;\n+\ttic55x-*)\n+\t\tos=-coff\n+\t\t;;\n+\ttic6x-*)\n+\t\tos=-coff\n \t\t;;\n \t# This must come before the *-dec entry.\n \tpdp10-*)\n@@ -1446,14 +1578,11 @@\n \t\t;;\n \tm68000-sun)\n \t\tos=-sunos3\n-\t\t# This also exists in the configure program, but was not the\n-\t\t# default.\n-\t\t# os=-sunos4\n \t\t;;\n \tm68*-cisco)\n \t\tos=-aout\n \t\t;;\n-        mep-*)\n+\tmep-*)\n \t\tos=-elf\n \t\t;;\n \tmips*-cisco)\n@@ -1480,7 +1609,7 @@\n \t*-ibm)\n \t\tos=-aix\n \t\t;;\n-    \t*-knuth)\n+\t*-knuth)\n \t\tos=-mmixware\n \t\t;;\n \t*-wec)\n@@ -1585,7 +1714,7 @@\n \t\t\t-sunos*)\n \t\t\t\tvendor=sun\n \t\t\t\t;;\n-\t\t\t-aix*)\n+\t\t\t-cnk*|-aix*)\n \t\t\t\tvendor=ibm\n \t\t\t\t;;\n \t\t\t-beos*)\n"
  },
  {
    "path": "packages/ossp-uuid/z-no-docs-no-strip.patch",
    "content": "--- src/Makefile.in.old\t2018-11-24 18:13:53.765023695 +0000\n+++ src/Makefile.in\t2018-11-24 18:15:02.875571529 +0000\n@@ -227,10 +227,7 @@\n \t$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)\n \t$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)\n \t$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)/pkgconfig\n-\t$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3\n-\t$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1\n \t$(SHTOOL) install -c -m 755 uuid-config $(DESTDIR)$(bindir)/\n-\t$(SHTOOL) install -c -m 644 $(S)/uuid-config.1 $(DESTDIR)$(mandir)/man1/\n \t$(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/ossp-uuid.pc\n \t$(SHTOOL) install -c -m 644 uuid.h $(DESTDIR)$(includedir)/\n \t-@if [ \".$(WITH_DCE)\" = .yes ]; then \\\n@@ -241,11 +238,6 @@\n \t    echo \"$(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/\"; \\\n \t    $(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/; \\\n \tfi\n-\t$(SHTOOL) install -c -m 644 $(S)/uuid.3 $(DESTDIR)$(mandir)/man3/ossp-uuid.3\n-\t-@if [ \".$(WITH_CXX)\" = .yes ]; then \\\n-\t    echo \"$(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/\"; \\\n-\t    $(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/; \\\n-\tfi\n \t@$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(LIB_NAME) $(DESTDIR)$(libdir)/\n \t-@if [ \".$(WITH_DCE)\" = .yes ]; then \\\n \t    $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(DCE_NAME) $(DESTDIR)$(libdir)/; \\\n@@ -253,8 +245,7 @@\n \t-@if [ \".$(WITH_CXX)\" = .yes ]; then \\\n \t    $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(CXX_NAME) $(DESTDIR)$(libdir)/; \\\n \tfi\n-\t@$(LIBTOOL) --mode=install $(SHTOOL) install -c -s -m 755 uuid $(DESTDIR)$(bindir)/\n-\t$(SHTOOL) install -c -m 644 $(S)/uuid.1 $(DESTDIR)$(mandir)/man1/\n+\t@$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 755 uuid $(DESTDIR)$(bindir)/\n \t-@if [ \".$(WITH_PERL)\" = .yes ]; then \\\n \t    (cd $(S)/perl && $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR)); \\\n \tfi\n"
  },
  {
    "path": "packages/p7zip/1-CVE-2016-9296.patch",
    "content": "diff -Nur p7zip/CPP/7zip/Archive/7z/7zIn.cpp CVE-2016-9296_mod/CPP/7zip/Archive/7z/7zIn.cpp\n--- p7zip/CPP/7zip/Archive/7z/7zIn.cpp\t2016-05-20 16:20:03.000000000 +0800\n+++ CVE-2016-9296_mod/CPP/7zip/Archive/7z/7zIn.cpp\t2019-03-06 22:03:43.370014466 +0800\n@@ -1097,7 +1097,8 @@\n       if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i])\n         ThrowIncorrect();\n   }\n-  HeadersSize += folders.PackPositions[folders.NumPackStreams];\n+  if (folders.PackPositions)\n+      HeadersSize += folders.PackPositions[folders.NumPackStreams];\n   return S_OK;\n }\n \n"
  },
  {
    "path": "packages/p7zip/2-CVE-2017-17969.patch",
    "content": "diff -Nur p7zip/CPP/7zip/Compress/ShrinkDecoder.cpp CVE-2017-17969_mod/CPP/7zip/Compress/ShrinkDecoder.cpp\n--- p7zip/CPP/7zip/Compress/ShrinkDecoder.cpp\t2016-05-19 01:31:02.000000000 +0800\n+++ CVE-2017-17969_mod/CPP/7zip/Compress/ShrinkDecoder.cpp\t2019-03-06 22:04:10.675224841 +0800\n@@ -121,8 +121,13 @@\n     {\n       _stack[i++] = _suffixes[cur];\n       cur = _parents[cur];\n+      if (cur >= kNumItems || i >= kNumItems)\n+        break;\n     }\n-    \n+\n+    if (cur >= kNumItems || i >= kNumItems)\n+      break;\n+\n     _stack[i++] = (Byte)cur;\n     lastChar2 = (Byte)cur;\n \n"
  },
  {
    "path": "packages/p7zip/3-CVE-2018-5996.patch",
    "content": "diff -Nur p7zip/CPP/7zip/Compress/Rar1Decoder.cpp CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.cpp\n--- p7zip/CPP/7zip/Compress/Rar1Decoder.cpp\t2015-09-02 02:04:52.000000000 +0800\n+++ CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.cpp\t2019-03-06 22:04:37.659374132 +0800\n@@ -29,7 +29,7 @@\n };\n */\n \n-CDecoder::CDecoder(): m_IsSolid(false) { }\n+CDecoder::CDecoder(): m_IsSolid(false), _errorMode(false) { }\n \n void CDecoder::InitStructures()\n {\n@@ -406,9 +406,14 @@\n   InitData();\n   if (!m_IsSolid)\n   {\n+    _errorMode = false;\n     InitStructures();\n     InitHuff();\n   }\n+\n+  if (_errorMode)\n+    return S_FALSE;\n+\n   if (m_UnpackSize > 0)\n   {\n     GetFlagsBuf();\n@@ -477,9 +482,9 @@\n     const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)\n {\n   try { return CodeReal(inStream, outStream, inSize, outSize, progress); }\n-  catch(const CInBufferException &e) { return e.ErrorCode; }\n-  catch(const CLzOutWindowException &e) { return e.ErrorCode; }\n-  catch(...) { return S_FALSE; }\n+  catch(const CInBufferException &e) { _errorMode = true; return e.ErrorCode; }\n+  catch(const CLzOutWindowException &e) { _errorMode = true; return e.ErrorCode; }\n+  catch(...) { _errorMode = true; return S_FALSE; }\n }\n \n STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size)\ndiff -Nur p7zip/CPP/7zip/Compress/Rar1Decoder.h CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.h\n--- p7zip/CPP/7zip/Compress/Rar1Decoder.h\t2014-12-21 20:44:00.000000000 +0800\n+++ CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.h\t2019-03-06 22:04:37.659374132 +0800\n@@ -39,6 +39,7 @@\n \n   Int64 m_UnpackSize;\n   bool m_IsSolid;\n+  bool _errorMode;\n \n   UInt32 ReadBits(int numBits);\n   HRESULT CopyBlock(UInt32 distance, UInt32 len);\ndiff -Nur p7zip/CPP/7zip/Compress/Rar2Decoder.cpp CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.cpp\n--- p7zip/CPP/7zip/Compress/Rar2Decoder.cpp\t2015-10-03 16:49:14.000000000 +0800\n+++ CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.cpp\t2019-03-06 22:04:37.659374132 +0800\n@@ -80,7 +80,8 @@\n static const UInt32 kWindowReservSize = (1 << 22) + 256;\n \n CDecoder::CDecoder():\n-  m_IsSolid(false)\n+  m_IsSolid(false),\n+  m_TablesOK(false)\n {\n }\n \n@@ -100,6 +101,8 @@\n \n bool CDecoder::ReadTables(void)\n {\n+  m_TablesOK = false;\n+\n   Byte levelLevels[kLevelTableSize];\n   Byte newLevels[kMaxTableSize];\n   m_AudioMode = (ReadBits(1) == 1);\n@@ -170,6 +173,8 @@\n   }\n   \n   memcpy(m_LastLevels, newLevels, kMaxTableSize);\n+  m_TablesOK = true;\n+\n   return true;\n }\n \n@@ -344,6 +349,9 @@\n       return S_FALSE;\n   }\n \n+  if (!m_TablesOK)\n+    return S_FALSE;\n+\n   UInt64 startPos = m_OutWindowStream.GetProcessedSize();\n   while (pos < unPackSize)\n   {\ndiff -Nur p7zip/CPP/7zip/Compress/Rar2Decoder.h CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.h\n--- p7zip/CPP/7zip/Compress/Rar2Decoder.h\t2015-06-19 18:52:06.000000000 +0800\n+++ CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.h\t2019-03-06 22:04:37.659374132 +0800\n@@ -139,6 +139,7 @@\n \n   UInt64 m_PackSize;\n   bool m_IsSolid;\n+  bool m_TablesOK;\n \n   void InitStructures();\n   UInt32 ReadBits(unsigned numBits);\ndiff -Nur p7zip/CPP/7zip/Compress/Rar3Decoder.cpp CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.cpp\n--- p7zip/CPP/7zip/Compress/Rar3Decoder.cpp\t2016-05-20 16:20:03.000000000 +0800\n+++ CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.cpp\t2019-03-06 22:04:37.659374132 +0800\n@@ -92,7 +92,8 @@\n   _writtenFileSize(0),\n   _vmData(0),\n   _vmCode(0),\n-  m_IsSolid(false)\n+  m_IsSolid(false),\n+  _errorMode(false)\n {\n   Ppmd7_Construct(&_ppmd);\n }\n@@ -545,6 +546,9 @@\n     return InitPPM();\n   }\n \n+  TablesRead = false;\n+  TablesOK = false;\n+\n   _lzMode = true;\n   PrevAlignBits = 0;\n   PrevAlignCount = 0;\n@@ -606,6 +610,9 @@\n       }\n     }\n   }\n+  if (InputEofError())\n+    return S_FALSE;\n+\n   TablesRead = true;\n \n   // original code has check here:\n@@ -623,6 +630,9 @@\n   RIF(m_LenDecoder.Build(&newLevels[kMainTableSize + kDistTableSize + kAlignTableSize]));\n \n   memcpy(m_LastLevels, newLevels, kTablesSizesSum);\n+\n+  TablesOK = true;\n+\n   return S_OK;\n }\n \n@@ -824,7 +834,12 @@\n     PpmEscChar = 2;\n     PpmError = true;\n     InitFilters();\n+    _errorMode = false;\n   }\n+\n+  if (_errorMode)\n+    return S_FALSE;\n+\n   if (!m_IsSolid || !TablesRead)\n   {\n     bool keepDecompressing;\n@@ -838,6 +853,8 @@\n     bool keepDecompressing;\n     if (_lzMode)\n     {\n+      if (!TablesOK)\n+        return S_FALSE;\n       RINOK(DecodeLZ(keepDecompressing))\n     }\n     else\n@@ -901,8 +918,8 @@\n     _unpackSize = outSize ? *outSize : (UInt64)(Int64)-1;\n     return CodeReal(progress);\n   }\n-  catch(const CInBufferException &e)  { return e.ErrorCode; }\n-  catch(...) { return S_FALSE; }\n+  catch(const CInBufferException &e)  { _errorMode = true; return e.ErrorCode; }\n+  catch(...) { _errorMode = true; return S_FALSE; }\n   // CNewException is possible here. But probably CNewException is caused\n   // by error in data stream.\n }\ndiff -Nur p7zip/CPP/7zip/Compress/Rar3Decoder.h CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.h\n--- p7zip/CPP/7zip/Compress/Rar3Decoder.h\t2015-10-03 16:49:12.000000000 +0800\n+++ CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.h\t2019-03-06 22:04:37.659374132 +0800\n@@ -192,6 +192,7 @@\n   UInt32 _lastFilter;\n \n   bool m_IsSolid;\n+  bool _errorMode;\n \n   bool _lzMode;\n   bool _unsupportedFilter;\n@@ -200,6 +201,7 @@\n   UInt32 PrevAlignCount;\n \n   bool TablesRead;\n+  bool TablesOK;\n \n   CPpmd7 _ppmd;\n   int PpmEscChar;\n"
  },
  {
    "path": "packages/p7zip/4-CVE-2018-10115.patch",
    "content": "diff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.cpp CVE-2018-10115_mod/CPP/7zip/Compress/Rar1Decoder.cpp\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.cpp\t2019-03-06 22:04:37.659374132 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar1Decoder.cpp\t2019-03-06 22:10:18.882278471 +0800\n@@ -29,7 +29,7 @@\n };\n */\n \n-CDecoder::CDecoder(): m_IsSolid(false), _errorMode(false) { }\n+CDecoder::CDecoder(): _isSolid(false), _solidAllowed(false), _errorMode(false) { }\n \n void CDecoder::InitStructures()\n {\n@@ -345,7 +345,7 @@\n \n void CDecoder::InitData()\n {\n-  if (!m_IsSolid)\n+  if (!_isSolid)\n   {\n     AvrPlcB = AvrLn1 = AvrLn2 = AvrLn3 = NumHuf = Buf60 = 0;\n     AvrPlc = 0x3500;\n@@ -391,6 +391,11 @@\n   if (inSize == NULL || outSize == NULL)\n     return E_INVALIDARG;\n \n+  if (_isSolid && !_solidAllowed)\n+    return S_FALSE;\n+\n+  _solidAllowed = false;\n+\n   if (!m_OutWindowStream.Create(kHistorySize))\n     return E_OUTOFMEMORY;\n   if (!m_InBitStream.Create(1 << 20))\n@@ -398,13 +403,13 @@\n \n   m_UnpackSize = (Int64)*outSize;\n   m_OutWindowStream.SetStream(outStream);\n-  m_OutWindowStream.Init(m_IsSolid);\n+  m_OutWindowStream.Init(_isSolid);\n   m_InBitStream.SetStream(inStream);\n   m_InBitStream.Init();\n \n   // CCoderReleaser coderReleaser(this);\n   InitData();\n-  if (!m_IsSolid)\n+  if (!_isSolid)\n   {\n     _errorMode = false;\n     InitStructures();\n@@ -475,6 +480,7 @@\n   }\n   if (m_UnpackSize < 0)\n     return S_FALSE;\n+  _solidAllowed = true;\n   return m_OutWindowStream.Flush();\n }\n \n@@ -491,7 +497,7 @@\n {\n   if (size < 1)\n     return E_INVALIDARG;\n-  m_IsSolid = ((data[0] & 1) != 0);\n+  _isSolid = ((data[0] & 1) != 0);\n   return S_OK;\n }\n \ndiff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.h CVE-2018-10115_mod/CPP/7zip/Compress/Rar1Decoder.h\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar1Decoder.h\t2019-03-06 22:04:37.659374132 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar1Decoder.h\t2019-03-06 22:10:18.882278471 +0800\n@@ -38,7 +38,8 @@\n   UInt32 LastLength;\n \n   Int64 m_UnpackSize;\n-  bool m_IsSolid;\n+  bool _isSolid;\n+  bool _solidAllowed;\n   bool _errorMode;\n \n   UInt32 ReadBits(int numBits);\ndiff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.cpp CVE-2018-10115_mod/CPP/7zip/Compress/Rar2Decoder.cpp\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.cpp\t2019-03-06 22:04:37.659374132 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar2Decoder.cpp\t2019-03-06 22:10:18.882278471 +0800\n@@ -80,7 +80,8 @@\n static const UInt32 kWindowReservSize = (1 << 22) + 256;\n \n CDecoder::CDecoder():\n-  m_IsSolid(false),\n+  _isSolid(false),\n+  _solidAllowed(false),\n   m_TablesOK(false)\n {\n }\n@@ -320,6 +321,10 @@\n   if (inSize == NULL || outSize == NULL)\n     return E_INVALIDARG;\n \n+  if (_isSolid && !_solidAllowed)\n+    return S_FALSE;\n+  _solidAllowed = false;\n+\n   if (!m_OutWindowStream.Create(kHistorySize))\n     return E_OUTOFMEMORY;\n   if (!m_InBitStream.Create(1 << 20))\n@@ -330,12 +335,12 @@\n   UInt64 pos = 0, unPackSize = *outSize;\n   \n   m_OutWindowStream.SetStream(outStream);\n-  m_OutWindowStream.Init(m_IsSolid);\n+  m_OutWindowStream.Init(_isSolid);\n   m_InBitStream.SetStream(inStream);\n   m_InBitStream.Init();\n \n   // CCoderReleaser coderReleaser(this);\n-  if (!m_IsSolid)\n+  if (!_isSolid)\n   {\n     InitStructures();\n     if (unPackSize == 0)\n@@ -343,6 +348,7 @@\n       if (m_InBitStream.GetProcessedSize() + 2 <= m_PackSize) // test it: probably incorrect;\n         if (!ReadTables())\n           return S_FALSE;\n+      _solidAllowed = true;\n       return S_OK;\n     }\n     if (!ReadTables())\n@@ -386,6 +392,9 @@\n \n   if (!ReadLastTables())\n     return S_FALSE;\n+\n+  _solidAllowed = true;\n+\n   return m_OutWindowStream.Flush();\n }\n \n@@ -402,7 +411,7 @@\n {\n   if (size < 1)\n     return E_INVALIDARG;\n-  m_IsSolid = ((data[0] & 1) != 0);\n+  _isSolid = ((data[0] & 1) != 0);\n   return S_OK;\n }\n \ndiff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.h CVE-2018-10115_mod/CPP/7zip/Compress/Rar2Decoder.h\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar2Decoder.h\t2019-03-06 22:04:37.659374132 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar2Decoder.h\t2019-03-06 22:10:18.882278471 +0800\n@@ -138,7 +138,8 @@\n   Byte m_LastLevels[kMaxTableSize];\n \n   UInt64 m_PackSize;\n-  bool m_IsSolid;\n+  bool _isSolid;\n+  bool _solidAllowed;\n   bool m_TablesOK;\n \n   void InitStructures();\ndiff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.cpp CVE-2018-10115_mod/CPP/7zip/Compress/Rar3Decoder.cpp\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.cpp\t2019-03-06 22:04:37.659374132 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar3Decoder.cpp\t2019-03-06 22:10:18.882278471 +0800\n@@ -92,7 +92,8 @@\n   _writtenFileSize(0),\n   _vmData(0),\n   _vmCode(0),\n-  m_IsSolid(false),\n+  _isSolid(false),\n+  _solidAllowed(false),\n   _errorMode(false)\n {\n   Ppmd7_Construct(&_ppmd);\n@@ -821,7 +822,7 @@\n {\n   _writtenFileSize = 0;\n   _unsupportedFilter = false;\n-  if (!m_IsSolid)\n+  if (!_isSolid)\n   {\n     _lzSize = 0;\n     _winPos = 0;\n@@ -840,12 +841,15 @@\n   if (_errorMode)\n     return S_FALSE;\n \n-  if (!m_IsSolid || !TablesRead)\n+  if (!_isSolid || !TablesRead)\n   {\n     bool keepDecompressing;\n     RINOK(ReadTables(keepDecompressing));\n     if (!keepDecompressing)\n+    {\n+      _solidAllowed = true;\n       return S_OK;\n+    }\n   }\n \n   for (;;)\n@@ -870,6 +874,9 @@\n     if (!keepDecompressing)\n       break;\n   }\n+\n+  _solidAllowed = true;\n+\n   RINOK(WriteBuf());\n   UInt64 packSize = m_InBitStream.BitDecoder.GetProcessedSize();\n   RINOK(progress->SetRatioInfo(&packSize, &_writtenFileSize));\n@@ -890,6 +897,10 @@\n     if (!inSize)\n       return E_INVALIDARG;\n \n+    if (_isSolid && !_solidAllowed)\n+      return S_FALSE;\n+    _solidAllowed = false;\n+\n     if (!_vmData)\n     {\n       _vmData = (Byte *)::MidAlloc(kVmDataSizeMax + kVmCodeSizeMax);\n@@ -928,7 +939,7 @@\n {\n   if (size < 1)\n     return E_INVALIDARG;\n-  m_IsSolid = ((data[0] & 1) != 0);\n+  _isSolid = ((data[0] & 1) != 0);\n   return S_OK;\n }\n \ndiff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.h CVE-2018-10115_mod/CPP/7zip/Compress/Rar3Decoder.h\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar3Decoder.h\t2019-03-06 22:04:37.659374132 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar3Decoder.h\t2019-03-06 22:10:18.882278471 +0800\n@@ -191,7 +191,8 @@\n   CRecordVector<CTempFilter *>  _tempFilters;\n   UInt32 _lastFilter;\n \n-  bool m_IsSolid;\n+  bool _isSolid;\n+  bool _solidAllowed;\n   bool _errorMode;\n \n   bool _lzMode;\ndiff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar5Decoder.cpp CVE-2018-10115_mod/CPP/7zip/Compress/Rar5Decoder.cpp\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar5Decoder.cpp\t2019-03-06 22:03:12.632738487 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar5Decoder.cpp\t2019-03-06 22:10:18.882278471 +0800\n@@ -72,6 +72,7 @@\n     _writtenFileSize(0),\n     _dictSizeLog(0),\n     _isSolid(false),\n+    _solidAllowed(false),\n     _wasInit(false),\n     _inputBuf(NULL)\n {\n@@ -801,7 +802,10 @@\n   */\n \n   if (res == S_OK)\n+  {\n+    _solidAllowed = true;\n     res = res2;\n+  }\n      \n   if (res == S_OK && _unpackSize_Defined && _writtenFileSize != _unpackSize)\n     return S_FALSE;\n@@ -821,6 +825,10 @@\n {\n   try\n   {\n+    if (_isSolid && !_solidAllowed)\n+      return S_FALSE;\n+    _solidAllowed = false;\n+\n     if (_dictSizeLog >= sizeof(size_t) * 8)\n       return E_NOTIMPL;\n \ndiff -Nur CVE-2018-5996_mod/CPP/7zip/Compress/Rar5Decoder.h CVE-2018-10115_mod/CPP/7zip/Compress/Rar5Decoder.h\n--- CVE-2018-5996_mod/CPP/7zip/Compress/Rar5Decoder.h\t2019-03-06 22:03:12.632738487 +0800\n+++ CVE-2018-10115_mod/CPP/7zip/Compress/Rar5Decoder.h\t2019-03-06 22:10:18.882278471 +0800\n@@ -271,6 +271,7 @@\n   Byte _dictSizeLog;\n   bool _tableWasFilled;\n   bool _isSolid;\n+  bool _solidAllowed;\n   bool _wasInit;\n \n   UInt32 _reps[kNumReps];\n"
  },
  {
    "path": "packages/p7zip/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://p7zip.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Command-line version of the 7zip compressed file archiver\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_MAINTAINER=\"Francisco Demartino @franciscod\"\nTERMUX_PKG_VERSION=16.02\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/p7zip/p7zip/${TERMUX_PKG_VERSION}/p7zip_${TERMUX_PKG_VERSION}_src_all.tar.bz2\nTERMUX_PKG_SHA256=5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\texport CXXFLAGS=\"$CXXFLAGS -Wno-c++11-narrowing\"\n\tcp makefile.android_arm makefile.machine\n}\n\ntermux_step_make() {\n\tLD=\"$CC $LDFLAGS\" CC=\"$CC $CFLAGS $CPPFLAGS $LDFLAGS\" \\\n\t\tmake -j $TERMUX_MAKE_PROCESSES all3 OPTFLAGS=\"${CXXFLAGS}\" DEST_HOME=$TERMUX_PREFIX\n}\n\ntermux_step_make_install() {\n\tmake install DEST_HOME=$TERMUX_PREFIX DEST_MAN=$TERMUX_PREFIX/share/man\n}\n"
  },
  {
    "path": "packages/p7zip/makefile.patch",
    "content": "diff -u -r ../p7zip_15.14.1/makefile.android_arm ./makefile.android_arm\n--- ../p7zip_15.14.1/makefile.android_arm\t2016-03-10 15:33:59.000000000 -0500\n+++ ./makefile.android_arm\t2016-05-03 23:15:52.868840453 -0400\n@@ -1,41 +1,29 @@\n #\n-# makefile for ANDROID (generic ARM)\n+# makefile for ANDROID with Termux\n #\n # export NDK=<ndk_home>\n # tested with android-ndk-r8c-linux-x86\n #\n \n-ANDROID_NDK_HOME=$(NDK)\n-ANDROID_NDK_BIN=$(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin\n-\n-# -fpic -Os\n-# -fstack-protector \n ANDROID_FLAGS=\\\n   -MMD -MP -MF \\\n   -fpic -ffunction-sections -funwind-tables -fstack-protector \\\n-  -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ \\\n-  -march=armv5te -mtune=xscale -msoft-float -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \\\n-  -I$(ANDROID_NDK_HOME)/sources/cxx-stl/system/include \\\n-  -I$(ANDROID_NDK_HOME)/platforms/android-3/arch-arm/usr/include \\\n+  -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \\\n   -DANDROID -DANDROID_NDK -DNDEBUG \\\n \n ANDROID_LINK= \\\n   -Wl,--gc-sections -Wl,-z,nocopyreloc \\\n-  --sysroot=$(NDK)/platforms/android-3/arch-arm \\\n   -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \\\n-  -L$(NDK)/platforms/android-3/arch-arm/usr/lib -lstdc++ \\\n-  $(NDK)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libsupc++.a \\\n   -lc -lm \n \n-OPTFLAGS=-O3 -s\n+OPTFLAGS=-Os -s\n \n ALLFLAGS=${OPTFLAGS} -pipe \\\n \t-DNDEBUG -D_REENTRANT -DENV_UNIX \\\n \t$(ANDROID_FLAGS) \\\n \t$(LOCAL_FLAGS)\n \n-CXX=$(ANDROID_NDK_BIN)/arm-linux-androideabi-g++ -fexceptions -frtti\n-CC=$(ANDROID_NDK_BIN)/arm-linux-androideabi-gcc\n+CXX+= -fexceptions -frtti\n CC_EXE= -fPIE\n LINK_EXE=-fPIE -pie  # -fPIE -pie : only for executable\n CC_SHARED= -fpic\n"
  },
  {
    "path": "packages/pango/bsearch-fix.patch",
    "content": "diff -uNr pango-1.44.6/pango/musl_bsearch.h pango-1.44.6.mod/pango/musl_bsearch.h\n--- pango-1.44.6/pango/musl_bsearch.h\t1970-01-01 03:00:00.000000000 +0300\n+++ pango-1.44.6.mod/pango/musl_bsearch.h\t2019-09-23 14:15:30.721769563 +0300\n@@ -0,0 +1,23 @@\n+#include <stdlib.h>\n+//\n+// bsearch() implementation from Musl libc.\n+//\n+\n+static void *musl_bsearch(const void *key, const void *base, size_t nel, size_t width, int (*cmp)(const void *, const void *))\n+{\n+\tvoid *try;\n+\tint sign;\n+\twhile (nel > 0) {\n+\t\ttry = (char *)base + width*(nel/2);\n+\t\tsign = cmp(key, try);\n+\t\tif (sign < 0) {\n+\t\t\tnel /= 2;\n+\t\t} else if (sign > 0) {\n+\t\t\tbase = (char *)try + width;\n+\t\t\tnel -= nel/2+1;\n+\t\t} else {\n+\t\t\treturn try;\n+\t\t}\n+\t}\n+\treturn NULL;\n+}\ndiff -uNr pango-1.44.6/pango/pango-color.c pango-1.44.6.mod/pango/pango-color.c\n--- pango-1.44.6/pango/pango-color.c\t2019-09-03 15:11:42.000000000 +0300\n+++ pango-1.44.6.mod/pango/pango-color.c\t2019-09-23 14:15:01.798237443 +0300\n@@ -144,6 +144,7 @@\n  */\n \n #include \"pango-color-table.h\"\n+#include \"musl_bsearch.h\"\n \n #define ISUPPER(c)              ((c) >= 'A' && (c) <= 'Z')\n #define TOLOWER(c)              (ISUPPER (c) ? (c) - 'A' + 'a' : (c))\n@@ -175,7 +176,7 @@\n {\n   ColorEntry *found;\n \n-  found = bsearch (name, color_entries, G_N_ELEMENTS (color_entries),\n+  found = musl_bsearch (name, color_entries, G_N_ELEMENTS (color_entries),\n \t\t   sizeof (ColorEntry),\n \t\t   compare_xcolor_entries);\n   if (found == NULL)\ndiff -uNr pango-1.44.6/pango/pango-emoji.c pango-1.44.6.mod/pango/pango-emoji.c\n--- pango-1.44.6/pango/pango-emoji.c\t2019-09-03 15:11:42.000000000 +0300\n+++ pango-1.44.6.mod/pango/pango-emoji.c\t2019-09-23 14:14:46.718134698 +0300\n@@ -51,7 +51,7 @@\n \n #include \"pango-emoji-private.h\"\n #include \"pango-emoji-table.h\"\n-\n+#include \"musl_bsearch.h\"\n \n static int\n interval_compare (const void *key, const void *elt)\n@@ -78,7 +78,7 @@\n     return FALSE; \\\n    */ \\\n  \\\n-  if (bsearch (GUINT_TO_POINTER (ch), \\\n+  if (musl_bsearch (GUINT_TO_POINTER (ch), \\\n                _pango_##name##_table, \\\n                G_N_ELEMENTS (_pango_##name##_table), \\\n                sizeof _pango_##name##_table[0], \\\ndiff -uNr pango-1.44.6/pango/pango-language.c pango-1.44.6.mod/pango/pango-language.c\n--- pango-1.44.6/pango/pango-language.c\t2019-09-03 15:11:42.000000000 +0300\n+++ pango-1.44.6.mod/pango/pango-language.c\t2019-09-23 14:14:16.651265104 +0300\n@@ -28,6 +28,7 @@\n \n #include \"pango-language.h\"\n #include \"pango-impl-utils.h\"\n+#include \"musl_bsearch.h\"\n \n #ifdef HAVE_CORE_TEXT\n #include <CoreFoundation/CoreFoundation.h>\n@@ -467,7 +468,7 @@\n \n   lang_str = pango_language_to_string (language);\n \n-  record = bsearch (lang_str,\n+  record = musl_bsearch (lang_str,\n \t\t    records, num_records, record_size,\n \t\t    lang_compare_first_component);\n   if (!record)\n"
  },
  {
    "path": "packages/pango/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.pango.org/\nTERMUX_PKG_DESCRIPTION=\"Library for laying out and rendering text\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=1.44.7\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/GNOME/sources/pango/${TERMUX_PKG_VERSION:0:4}/pango-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=66a5b6cc13db73efed67b8e933584509f8ddb7b10a8a40c3850ca4a985ea1b1f\nTERMUX_PKG_DEPENDS=\"fontconfig, fribidi, glib, harfbuzz, libcairo, libxft, zlib\"\nTERMUX_PKG_BREAKS=\"pango-dev\"\nTERMUX_PKG_REPLACES=\"pango-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-Dintrospection=false\"\n\ntermux_step_post_make_install() {\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/pango-view.1 \\\n\t\t$TERMUX_PREFIX/share/man/man1/pango-view.1\n}\n"
  },
  {
    "path": "packages/pango/pango-view.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.\n.TH PANGO-VIEW \"1\" \"January 2019\" \"pango-view (pango) 1.42.3\" \"User Commands\"\n.SH NAME\npango-view \\- Pango text viewer\n.SH DESCRIPTION\n.SS \"Usage:\"\n.IP\npango\\-view [OPTION?] \\- FILE\n.SS \"Help Options:\"\n.TP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\nShow help options\n.TP\n\\fB\\-\\-help\\-all\\fR\nShow all help options\n.TP\n\\fB\\-\\-help\\-cairo\\fR\nOptions understood by the cairo backend\n.SS \"Cairo backend options:\"\n.TP\n\\fB\\-\\-annotate\\fR=\\fI\\,1\\/\\fR or 2\nAnnotate the output\n.SS \"Application Options:\"\n.TP\n\\fB\\-\\-no\\-auto\\-dir\\fR\nNo layout direction according to contents\n.TP\n\\fB\\-\\-backend\\fR=\\fI\\,cairo\\/\\fR/xft/ft2\nPango backend to use for rendering (default: cairo)\n.TP\n\\fB\\-\\-background\\fR=\\fI\\,red\\/\\fR/#rrggbb/#rrggbbaa/transparent\nSet the background color\n.TP\n\\fB\\-q\\fR, \\fB\\-\\-no\\-display\\fR\nDo not display (just write to file or whatever)\n.TP\n\\fB\\-\\-dpi\\fR=\\fI\\,number\\/\\fR\nSet the resolution\n.TP\n\\fB\\-\\-align\\fR=\\fI\\,left\\/\\fR/center/right\nText alignment\n.TP\n\\fB\\-\\-ellipsize\\fR=\\fI\\,start\\/\\fR/middle/end\nEllipsization mode\n.TP\n\\fB\\-\\-font\\fR=\\fI\\,description\\/\\fR\nSet the font description\n.TP\n\\fB\\-\\-foreground\\fR=\\fI\\,red\\/\\fR/#rrggbb/#rrggbbaa\nSet the text color\n.TP\n\\fB\\-\\-gravity\\fR=\\fI\\,south\\/\\fR/east/north/west/auto\nBase gravity: glyph rotation\n.TP\n\\fB\\-\\-gravity\\-hint\\fR=\\fI\\,natural\\/\\fR/strong/line\nGravity hint\n.TP\n\\fB\\-\\-header\\fR\nDisplay the options in the output\n.TP\n\\fB\\-\\-height=\\fR+points/\\-numlines\nHeight in points (positive) or number of lines (negative) for ellipsizing\n.TP\n\\fB\\-\\-hinting\\fR=\\fI\\,none\\/\\fR/auto/full\nHinting style\n.TP\n\\fB\\-\\-indent\\fR=\\fI\\,points\\/\\fR\nWidth in points to indent paragraphs\n.TP\n\\fB\\-\\-justify\\fR\nAlign paragraph lines to be justified\n.TP\n\\fB\\-\\-language\\fR=\\fI\\,en_US\\/\\fR/etc\nLanguage to use for font selection\n.TP\n\\fB\\-\\-margin\\fR=\\fI\\,CSS\\-style\\/\\fR numbers in pixels\nSet the margin on the output in pixels\n.TP\n\\fB\\-\\-markup\\fR\nInterpret text as Pango markup\n.TP\n\\fB\\-o\\fR, \\fB\\-\\-output\\fR=\\fI\\,file\\/\\fR\nSave rendered image to output file\n.TP\n\\fB\\-\\-pixels\\fR\nUse pixel units instead of points (sets dpi to 72)\n.TP\n\\fB\\-\\-rtl\\fR\nSet base direction to right\\-to\\-left\n.TP\n\\fB\\-\\-rotate\\fR=\\fI\\,degrees\\/\\fR\nAngle at which to rotate results\n.TP\n\\fB\\-n\\fR, \\fB\\-\\-runs\\fR=\\fI\\,integer\\/\\fR\nRun Pango layout engine this many times\n.TP\n\\fB\\-\\-single\\-par\\fR\nEnable single\\-paragraph mode\n.TP\n\\fB\\-t\\fR, \\fB\\-\\-text\\fR=\\fI\\,string\\/\\fR\nText to display (instead of a file)\n.TP\n\\fB\\-\\-version\\fR\nShow version numbers\n.TP\n\\fB\\-\\-waterfall\\fR\nCreate a waterfall display\n.TP\n\\fB\\-w\\fR, \\fB\\-\\-width\\fR=\\fI\\,points\\/\\fR\nWidth in points to which to wrap lines or ellipsize\n.TP\n\\fB\\-\\-wrap\\fR=\\fI\\,word\\/\\fR/char/word\\-char\nText wrapping mode (needs a width to be set)\n"
  },
  {
    "path": "packages/par2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/Parchive/par2cmdline\nTERMUX_PKG_DESCRIPTION=\"par2cmdline is a PAR 2.0 compatible file verification and repair tool.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_VERSION=0.8.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/Parchive/par2cmdline/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=461b45627a0d800061657b2d800c432c7d1c86c859b40a3ced35a0cc6a85faca\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tsed -i 's/LDADD = -lstdc++/LDADD = -lstdc++ -latomic/' $TERMUX_PKG_SRCDIR/Makefile.am\n\tfi\n\taclocal\n\tautomake --add-missing\n\tautoconf\n}\n"
  },
  {
    "path": "packages/parallel/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/parallel/\nTERMUX_PKG_DESCRIPTION=\"GNU Parallel is a shell tool for executing jobs in parallel using one or more machines\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=20191122\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/parallel/parallel-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=182a93155dea12ddc36b7e85fd2d8342d7a88e7a449e4161a5a291e1f4989507\nTERMUX_PKG_DEPENDS=\"perl\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/parallel/parallel.patch",
    "content": "diff -uNr parallel-20190422/src/parallel parallel-20190422.mod/src/parallel\n--- parallel-20190422/src/parallel\t2019-04-21 15:45:35.000000000 +0300\n+++ parallel-20190422.mod/src/parallel\t2019-05-21 15:17:56.595625178 +0300\n@@ -1325,7 +1325,7 @@\n     if($opt::bug) { ::die_bug(\"test-bug\"); }\n     $Global::debug = $opt::D;\n     $Global::shell = $ENV{'PARALLEL_SHELL'} || parent_shell($$)\n-\t|| $ENV{'SHELL'} || \"/bin/sh\";\n+\t|| $ENV{'SHELL'} || \"@TERMUX_PREFIX@/bin/sh\";\n     if(not -x $Global::shell and not which($Global::shell)) {\n \t::error(\"Shell '$Global::shell' not found.\");\n \twait_and_exit(255);\n@@ -1780,12 +1780,12 @@\n     $Global::trim = 'n';\n     $Global::max_jobs_running = 0;\n     $Global::job_already_run = '';\n-    $ENV{'TMPDIR'} ||= \"/tmp\";\n+    $ENV{'TMPDIR'} ||= \"@TERMUX_PREFIX@/tmp\";\n     $ENV{'OLDPWD'} = $ENV{'PWD'};\n     if(not $ENV{HOME}) {\n \t# $ENV{HOME} is sometimes not set if called from PHP\n-\t::warning(\"\\$HOME not set. Using /tmp.\");\n-\t$ENV{HOME} = \"/tmp\";\n+\t::warning(\"\\$HOME not set. Using @TERMUX_PREFIX@/tmp.\");\n+\t$ENV{HOME} = \"@TERMUX_PREFIX@/tmp\";\n     }\n     # no warnings to allow for undefined $XDG_*\n     no warnings 'uninitialized';\n@@ -3712,7 +3712,7 @@\n     unlink $stderrname;\n \n     my $pid = ::open3($stdin_fh,$stdout_fh,$stderr_fh,\n-\t\t      $0,qw(--plain --shell /bin/sh --will-cite), @args);\n+\t\t      $0,qw(--plain --shell @TERMUX_PREFIX@/bin/sh --will-cite), @args);\n     if(my $writerpid = fork()) {\n \tclose $stdin_fh;\n \t@stdout = <$stdout_fh>;\n@@ -5216,6 +5216,7 @@\n \t    my $bsd = q(ps -o pid,ppid,command -ax);\n \t    %pid_parentpid_cmd =\n \t    (\n+\t     'android' => $sysv,\n \t     'aix' => $sysv,\n \t     'android' => $sysv,\n \t     'cygwin' => $sysv,\n"
  },
  {
    "path": "packages/parallel/sem.patch",
    "content": "diff -uNr parallel-20190422/src/sem parallel-20190422.mod/src/sem\n--- parallel-20190422/src/sem\t2019-04-21 15:45:35.000000000 +0300\n+++ parallel-20190422.mod/src/sem\t2019-05-21 15:19:40.243140514 +0300\n@@ -1325,7 +1325,7 @@\n     if($opt::bug) { ::die_bug(\"test-bug\"); }\n     $Global::debug = $opt::D;\n     $Global::shell = $ENV{'PARALLEL_SHELL'} || parent_shell($$)\n-\t|| $ENV{'SHELL'} || \"/bin/sh\";\n+\t|| $ENV{'SHELL'} || \"@TERMUX_PREFIX@/bin/sh\";\n     if(not -x $Global::shell and not which($Global::shell)) {\n \t::error(\"Shell '$Global::shell' not found.\");\n \twait_and_exit(255);\n@@ -1780,12 +1780,12 @@\n     $Global::trim = 'n';\n     $Global::max_jobs_running = 0;\n     $Global::job_already_run = '';\n-    $ENV{'TMPDIR'} ||= \"/tmp\";\n+    $ENV{'TMPDIR'} ||= \"@TERMUX_PREFIX@/tmp\";\n     $ENV{'OLDPWD'} = $ENV{'PWD'};\n     if(not $ENV{HOME}) {\n \t# $ENV{HOME} is sometimes not set if called from PHP\n-\t::warning(\"\\$HOME not set. Using /tmp.\");\n-\t$ENV{HOME} = \"/tmp\";\n+\t::warning(\"\\$HOME not set. Using @TERMUX_PREFIX@/tmp.\");\n+\t$ENV{HOME} = \"@TERMUX_PREFIX@/tmp\";\n     }\n     # no warnings to allow for undefined $XDG_*\n     no warnings 'uninitialized';\n@@ -3712,7 +3712,7 @@\n     unlink $stderrname;\n \n     my $pid = ::open3($stdin_fh,$stdout_fh,$stderr_fh,\n-\t\t      $0,qw(--plain --shell /bin/sh --will-cite), @args);\n+\t\t      $0,qw(--plain --shell @TERMUX_PREFIX@/bin/sh --will-cite), @args);\n     if(my $writerpid = fork()) {\n \tclose $stdin_fh;\n \t@stdout = <$stdout_fh>;\n"
  },
  {
    "path": "packages/parted/01_devmapper.patch",
    "content": "Fix disabling of libdevmapper.\n\nFix bugs related to disabling libdevmapper. Parted is rarely compiled without\ndevmapper. So couple of syntax errors for the cas3 of disabled devmapper\nsneaked in.\n\ndiff -ur src-orig/libparted/arch/linux.c src/libparted/arch/linux.c\n--- src-orig/libparted/arch/linux.c\t2017-08-31 15:47:07.007674598 +0200\n+++ src/libparted/arch/linux.c\t2017-08-31 15:50:01.487860337 +0200\n@@ -2304,6 +2304,7 @@\n   return r < 0 ? NULL : resultp;\n }\n \n+#ifdef ENABLE_DEVICE_MAPPER\n static char *\n dm_canonical_path (PedDevice const *dev)\n {\n@@ -2326,12 +2327,17 @@\n err:\n         return NULL;\n }\n+#endif\n \n static char*\n _device_get_part_path (PedDevice const *dev, int num)\n {\n+#ifdef ENABLE_DEVICE_MAPPER\n         char *devpath = (dev->type == PED_DEVICE_DM\n                          ? dm_canonical_path (dev) : dev->path);\n+#else\n+\tchar *devpath = dev->path;\n+#endif\n         size_t path_len = strlen (devpath);\n         char *result;\n         /* Check for devfs-style /disc => /partN transformation\n@@ -2946,10 +2948,18 @@\n \n \n         if (disk->dev->type == PED_DEVICE_DM) {\n+#ifdef ENABLE_DEVICE_MAPPER\n                 add_partition = _dm_add_partition;\n                 remove_partition = _dm_remove_partition;\n                 resize_partition = _dm_resize_partition;\n                 get_partition_start_and_length = _dm_get_partition_start_and_length;\n+#else\n+\t\tped_exception_throw (\n+                        PED_EXCEPTION_BUG,\n+                        PED_EXCEPTION_CANCEL,\n+                        \"This parted is compiled without devmapper support\");\n+\t\treturn 0;\n+#endif\n         } else {\n                 add_partition = _blkpg_add_partition;\n                 remove_partition = _blkpg_remove_partition;\n"
  },
  {
    "path": "packages/parted/02_lseek.patch",
    "content": "Change 64-bit offset code to Android variant.\n\nParted uses a workaround in case when off_t is 32-bit. This happens i.a.\non arm android. Use android functions rather than syscall.\n\n--- src-orig/libparted/arch/linux.c\t2018-06-21 02:53:48.635160013 +0200\n+++ src/libparted/arch/linux.c\t2018-06-21 02:59:37.842096052 +0200\n@@ -1712,25 +1712,10 @@\n \n #if SIZEOF_OFF_T < 8\n \n-static _syscall5(int,_llseek,\n-                 unsigned int, fd,\n-                 unsigned long, offset_high,\n-                 unsigned long, offset_low,\n-                 loff_t*, result,\n-                 unsigned int, origin)\n-\n loff_t\n llseek (unsigned int fd, loff_t offset, unsigned int whence)\n {\n-        loff_t result;\n-        int retval;\n-\n-        retval = _llseek(fd,\n-                         ((unsigned long long)offset) >> 32,\n-                         ((unsigned long long)offset) & 0xffffffff,\n-                         &result,\n-                         whence);\n-        return (retval==-1 ? (loff_t) retval : result);\n+        return lseek64(fd, offset, whence);\n }\n \n #endif /* SIZEOF_OFF_T < 8 */\n"
  },
  {
    "path": "packages/parted/03_minormajor.patch",
    "content": "Add missing major() and minor().\n\nBased on glibc version of this functions. Parted relies on those\nfunctions and they're not provided by bionic libc.\n\ndiff -ur src-orig/libparted/arch/linux.c src/libparted/arch/linux.c\n--- src-orig/libparted/arch/linux.c\t2017-08-31 15:47:07.007674598 +0200\n+++ src/libparted/arch/linux.c\t2017-08-31 15:50:01.487860337 +0200\n@@ -86,6 +86,22 @@\n #define WR_MODE (O_WRONLY)\n #define RW_MODE (O_RDWR)\n \n+unsigned int major(dev_t __dev)\n+{\n+\tunsigned int __major;\n+\t__major  = ((__dev & (dev_t) 0x00000000000fff00u) >>  8);\n+\t__major |= ((__dev & (dev_t) 0xfffff00000000000u) >> 32);\n+\treturn __major;\n+}\n+\n+unsigned int minor(dev_t __dev)\n+{\n+\tunsigned int __minor;\n+\t__minor  = ((__dev & (dev_t) 0x00000000000000ffu) >>  0);\n+\t__minor |= ((__dev & (dev_t) 0x00000ffffff00000u) >> 12);\n+\treturn __minor;\n+}\n+\n struct hd_geometry {\n         unsigned char heads;\n         unsigned char sectors;\n"
  },
  {
    "path": "packages/parted/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/parted/\nTERMUX_PKG_DESCRIPTION=\"Versatile partition editor\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=3.2\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/parted/parted-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4\nTERMUX_PKG_DEPENDS=\"libiconv, libuuid, readline\"\nTERMUX_PKG_BREAKS=\"parted-dev\"\nTERMUX_PKG_REPLACES=\"parted-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-device-mapper\n\"\n\ntermux_step_pre_configure() {\n    CFLAGS+=\" -Wno-gnu-designator\"\n    export LIBS=\"-liconv\"\n}\n"
  },
  {
    "path": "packages/parted/configure-pthreads-no-weak.patch",
    "content": "diff -uNr inetutils-1.9.4/configure inetutils-1.9.4.mod/configure\n--- inetutils-1.9.4/configure\t2015-06-09 10:53:47.000000000 +0300\n+++ inetutils-1.9.4.mod/configure\t2019-08-16 17:07:41.868736971 +0300\n@@ -15894,7 +15894,7 @@\n           if test -n \"$LIBMULTITHREAD\" || test -n \"$LTLIBMULTITHREAD\"; then\n             if case \"$gl_cv_have_weak\" in *yes) true;; *) false;; esac; then\n \n-$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n+#$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n \n               LIBTHREAD=\n               LTLIBTHREAD=\n"
  },
  {
    "path": "packages/pass/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.passwordstore.org\nTERMUX_PKG_DESCRIPTION=\"Lightweight directory-based password manager\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.7.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=2b6c65846ebace9a15a118503dcd31b6440949a30d3b5291dfb5b1615b99a3f4\nTERMUX_PKG_SRCURL=https://git.zx2c4.com/password-store/snapshot/password-store-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_BUILD_IN_SRC=true\n# Depend on coreutils as pass uses [:graph:] when calling tr, which busybox tr does not support:\nTERMUX_PKG_DEPENDS=\"bash, gnupg (>= 2.2.9-1), tree, coreutils\"\nTERMUX_PKG_RECOMMENDS=\"git\"\nTERMUX_PKG_SUGGESTS=\"pass-otp\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/pass/src-password-store.sh.patch",
    "content": "diff --git a/src/password-store.sh b/src/password-store.sh\nindex 7264ffc..f924de3 100755\n--- a/src/password-store.sh\n+++ b/src/password-store.sh\n@@ -11,7 +11,7 @@ GPG=\"gpg\"\n export GPG_TTY=\"${GPG_TTY:-$(tty 2>/dev/null)}\"\n which gpg2 &>/dev/null && GPG=\"gpg2\"\n [[ -n $GPG_AGENT_INFO || $GPG == \"gpg2\" ]] && GPG_OPTS+=( \"--batch\" \"--use-agent\" )\n-\n+TMPDIR=$PREFIX/tmp\n PREFIX=\"${PASSWORD_STORE_DIR:-$HOME/.password-store}\"\n EXTENSIONS=\"${PASSWORD_STORE_EXTENSIONS_DIR:-$PREFIX/.extensions}\"\n X_SELECTION=\"${PASSWORD_STORE_X_SELECTION:-clipboard}\"\n@@ -156,11 +156,11 @@ clip() {\n \t# trailing new lines.\n \tlocal sleep_argv0=\"password store sleep on display $DISPLAY\"\n \tpkill -f \"^$sleep_argv0\" 2>/dev/null && sleep 0.5\n-\tlocal before=\"$(xclip -o -selection \"$X_SELECTION\" 2>/dev/null | $BASE64)\"\n-\techo -n \"$1\" | xclip -selection \"$X_SELECTION\" || die \"Error: Could not copy data to the clipboard\"\n+\tlocal before=\"$(termux-clipboard-get 2>/dev/null | $BASE64)\"\n+\techo -n \"$1\" | termux-clipboard-set || die \"Error: Could not copy data to the clipboard\"\n \t(\n \t\t( exec -a \"$sleep_argv0\" bash <<<\"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait\" )\n-\t\tlocal now=\"$(xclip -o -selection \"$X_SELECTION\" | $BASE64)\"\n+\t\tlocal now=\"$(termux-clipboard-get | $BASE64)\"\n \t\t[[ $now != $(echo -n \"$1\" | $BASE64) ]] && before=\"$now\"\n \n \t\t# It might be nice to programatically check to see if klipper exists,\n@@ -172,7 +172,7 @@ clip() {\n \t\t# so we axe it here:\n \t\tqdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null\n \n-\t\techo \"$before\" | $BASE64 -d | xclip -selection \"$X_SELECTION\"\n+\t\techo \"$before\" | $BASE64 -d | termux-clipboard-set\n \t) >/dev/null 2>&1 & disown\n \techo \"Copied $2 to clipboard. Will clear in $CLIP_TIME seconds.\"\n }\n"
  },
  {
    "path": "packages/pass-otp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/tadfisher/pass-otp\nTERMUX_PKG_DESCRIPTION=\"A pass extension for managing one-time-password (OTP) tokens\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=1.2.0\nTERMUX_PKG_SHA256=5720a649267a240a4f7ba5a6445193481070049c1d08ba38b00d20fc551c3a67\nTERMUX_PKG_SRCURL=https://github.com/tadfisher/pass-otp/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_DEPENDS=\"pass, oathtool\"\nTERMUX_PKG_SUGGESTS=\"libqrencode\"\n\ntermux_step_pre_configure() {\n\texport BASHCOMPDIR=$TERMUX_PREFIX/etc/bash_completion.d\n}\n"
  },
  {
    "path": "packages/pastebinit/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://launchpad.net/pastebinit\nTERMUX_PKG_DESCRIPTION=\"Command-line pastebin client\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.5\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://launchpad.net/pastebinit/trunk/${TERMUX_PKG_VERSION}/+download/pastebinit-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=42e5a84ce7e46825fb3b6478e11893fad357197327257e474bd0d3549f438457\nTERMUX_PKG_DEPENDS=\"python\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_make_install() {\n\tcp pastebinit $TERMUX_PREFIX/bin/\n\txsltproc -''-nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl pastebinit.xml\n\tcp pastebinit.1 $TERMUX_PREFIX/share/man/man1/\n\n\trm -Rf $TERMUX_PREFIX/etc/pastebin.d\n\tmv pastebin.d $TERMUX_PREFIX/etc\n}\n"
  },
  {
    "path": "packages/pastebinit/pastebinit.patch",
    "content": "Changes:\n\n= Do not set default pastbin url based on distribution used.\n\n= Fix warning about deprecated methords in 'pasteURLopener' - applied patch from Debian.\n\n= Fix paths to configuration directories.\n\ndiff -uNr pastebinit-1.5/pastebinit pastebinit-1.5.mod/pastebinit\n--- pastebinit-1.5/pastebinit\t2016-03-01 07:52:32.000000000 +0200\n+++ pastebinit-1.5.mod/pastebinit\t2019-07-27 14:05:27.571525242 +0300\n@@ -27,28 +27,15 @@\n     from ConfigParser import NoOptionError\n     from ConfigParser import SafeConfigParser as ConfigParser\n     from urllib import urlencode\n-    from urllib import FancyURLopener\n+    from urllib import request\n else:\n     from configparser import ConfigParser, NoOptionError\n     from urllib.parse import urlencode\n-    from urllib.request import FancyURLopener\n+    from urllib import request\n\n # Set the default pastebin\n defaultPB = \"pastebin.com\"\n\n-# Now try to override it with a distributor pastebin\n-try:\n-    import platform\n-    release = platform.linux_distribution()[0].lower()\n-    if release == 'debian':\n-        defaultPB = \"paste.debian.net\"\n-    elif release == 'fedora':\n-        defaultPB = \"fpaste.org\"\n-    elif release == 'ubuntu':\n-        defaultPB = \"paste.ubuntu.com\"\n-except ImportError:\n-    pass\n-\n try:\n     import getopt\n     import gettext\n@@ -72,12 +59,13 @@\n     version = \"1.5\"\n     configfile = os.path.expanduser(\"~/.pastebinit.xml\")\n\n-    # Custom urlopener to handle 401's\n-    class pasteURLopener(FancyURLopener):\n+    class PasteRequest(request.Request):\n         version = \"Pastebinit v%s\" % version\n\n-        def http_error_401(self, url, fp, errcode, errmsg, headers, data=None):\n-            return None\n+        def __init__(self, *args, **opts):\n+            super(PasteRequest, self).__init__(*args, **opts)\n+            if 'User-agent' not in self.headers:\n+                self.add_header('User-agent', self.version)\n\n     def preloadPastebins():\n         # Check several places for config files:\n@@ -86,8 +74,8 @@\n         #  - user's overrides in ~/.pastebin.d\n         # Files found later override files found earlier.\n         pastebind = {}\n-        for confdir in ['/usr/share/pastebin.d', '/etc/pastebin.d',\n-                        '/usr/local/etc/pastebin.d',\n+        for confdir in ['@TERMUX_PREFIX@/share/pastebin.d', '@TERMUX_PREFIX@/etc/pastebin.d',\n+                        '@TERMUX_PREFIX@/local/etc/pastebin.d',\n                         os.path.expanduser('~/.pastebin.d'),\n                         os.path.join(\n                             os.path.dirname(\n@@ -410,25 +398,25 @@\n         else:\n             post_format = 'standard'\n\n-        url_opener = pasteURLopener()\n+        req = PasteRequest(fetch_url)\n\n         if post_format == 'json':\n             if json:\n-                params = json.dumps(params)\n-                url_opener.addheader('Content-type', 'text/json')\n+                params = bytes(json.dumps(params), encoding='US-ASCII')\n+                req.add_header('Content-type', 'text/json')\n             else:\n                 print(_(\"Could not find any json library.\"), file=sys.stderr)\n                 sys.exit(1)\n         else:\n             # Convert to a format usable with the HTML POST\n-            params = urlencode(params)\n+            params = bytes(urlencode(params), encoding='US-ASCII')\n\n         # Send the informations and be redirected to the final page\n         if verbose:\n             print(\"POSTing to: %s\\nParams: %s\" % (\n                 fetch_url, str(params)), file=sys.stderr)\n         try:\n-            page = url_opener.open(fetch_url, params)\n+            page = request.urlopen(req, params)\n         except Exception as e:\n             print(_(\"Failed to contact the server: %s\") % e, file=sys.stderr)\n             sys.exit(1)\n"
  },
  {
    "path": "packages/patch/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://savannah.gnu.org/projects/patch/\nTERMUX_PKG_DESCRIPTION=\"GNU patch which applies diff files to create patched files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.7.6\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/patch/patch-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-xattr ac_cv_path_ED=$TERMUX_PREFIX/bin/ed\"\n"
  },
  {
    "path": "packages/patch/tmpdir-path.patch",
    "content": "diff -uNr patch-2.7.6/lib/tempname.c patch-2.7.6.mod/lib/tempname.c\n--- patch-2.7.6/lib/tempname.c\t2018-02-03 14:41:53.000000000 +0200\n+++ patch-2.7.6.mod/lib/tempname.c\t2019-03-01 18:34:47.353225515 +0200\n@@ -32,7 +32,7 @@\n \n #include <stdio.h>\n #ifndef P_tmpdir\n-# define P_tmpdir \"/tmp\"\n+# define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n #endif\n #ifndef TMP_MAX\n # define TMP_MAX 238328\n@@ -147,8 +147,8 @@\n     {\n       if (direxists (P_tmpdir))\n         dir = P_tmpdir;\n-      else if (strcmp (P_tmpdir, \"/tmp\") != 0 && direxists (\"/tmp\"))\n-        dir = \"/tmp\";\n+      else if (strcmp (P_tmpdir, \"@TERMUX_PREFIX@/tmp\") != 0 && direxists (\"@TERMUX_PREFIX@/tmp\"))\n+        dir = \"@TERMUX_PREFIX@/tmp\";\n       else\n         {\n           __set_errno (ENOENT);\ndiff -uNr patch-2.7.6/src/util.c patch-2.7.6.mod/src/util.c\n--- patch-2.7.6/src/util.c\t2018-02-03 14:41:49.000000000 +0200\n+++ patch-2.7.6.mod/src/util.c\t2019-03-01 18:35:00.313283739 +0200\n@@ -1601,7 +1601,7 @@\n }\n \n #ifndef TMPDIR\n-#define TMPDIR \"/tmp\"\n+#define TMPDIR \"@TERMUX_PREFIX@/tmp\"\n #endif\n \n struct try_safe_open_args\n"
  },
  {
    "path": "packages/patchelf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://nixos.org/patchelf.html\nTERMUX_PKG_DESCRIPTION=\"Utility to modify the dynamic linker and RPATH of ELF executables\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.10\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/NixOS/patchelf/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=b3cb6bdedcef5607ce34a350cf0b182eb979f8f7bc31eae55a93a70a3f020d13\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t./bootstrap.sh\n}\n"
  },
  {
    "path": "packages/pathpicker/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://facebook.github.io/PathPicker/\nTERMUX_PKG_DESCRIPTION=\"Facebook PathPicker - a terminal-based file picker\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=0.9.2\nTERMUX_PKG_SRCURL=https://github.com/facebook/PathPicker/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=4b3deac0100fb9405adca17a1c75e133359a6cbb1351c392276a55ef8ef40857\nTERMUX_PKG_DEPENDS=\"bash,python\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\t_PKG_DIR=$TERMUX_PREFIX/share/pathpicker\n\trm -Rf $_PKG_DIR\n\tmkdir -p $_PKG_DIR\n\tcp -Rf src/ $_PKG_DIR\n\tcp fpp $_PKG_DIR/fpp\n\tcd $TERMUX_PREFIX/bin\n\tln -f -s ../share/pathpicker/fpp fpp\n\tchmod +x fpp\n}\n"
  },
  {
    "path": "packages/pcre/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.pcre.org\nTERMUX_PKG_DESCRIPTION=\"Library implementing regular expression pattern matching using the same syntax and semantics as Perl 5\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=8.43\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://ftp.pcre.org/pub/pcre/pcre-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=91e762520003013834ac1adb4a938d53b22a216341c061b0cf05603b290faf6b\nTERMUX_PKG_BREAKS=\"pcre-dev\"\nTERMUX_PKG_REPLACES=\"pcre-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/pcregrep bin/pcretest share/man/man1/pcre*.1\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-cpp --enable-jit --enable-utf8 --enable-unicode-properties\"\n"
  },
  {
    "path": "packages/pcre/libpcreposix.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/libpcreposix.so*\"\nTERMUX_SUBPKG_DESCRIPTION=\"Posix-compatible runtime libraries for libpcre\"\n"
  },
  {
    "path": "packages/pcre2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.pcre.org\nTERMUX_PKG_DESCRIPTION=\"Perl 5 compatible regular expression library\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=10.34\nTERMUX_PKG_SHA256=74c473ffaba9e13db6951fd146e0143fe9887852ce73406a03277af1d9b798ca\nTERMUX_PKG_BREAKS=\"pcre2-dev\"\nTERMUX_PKG_REPLACES=\"pcre2-dev\"\nTERMUX_PKG_SRCURL=https://ftp.pcre.org/pub/pcre/pcre2-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/pcre2grep\nbin/pcre2test\nshare/man/man1/pcre2*.1\nlib/libpcre2-posix.so\n\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-jit\n--enable-pcre2-16\n--enable-pcre2-32\n\"\n"
  },
  {
    "path": "packages/pdfgrep/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://pdfgrep.org/\nTERMUX_PKG_DESCRIPTION=\"Command line utility to search text in PDF files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.1.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://pdfgrep.org/download/pdfgrep-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=0ef3dca1d749323f08112ffe68e6f4eb7bc25f56f90a2e933db477261b082aba\nTERMUX_PKG_DEPENDS=\"libc++, libgcrypt, libgpg-error, pcre, poppler\"\n"
  },
  {
    "path": "packages/perl/Cwd.pm.patch",
    "content": "diff -u -r ../perl-5.22.0/dist/PathTools/Cwd.pm ./dist/PathTools/Cwd.pm\n--- ../perl-5.24.1/dist/PathTools/Cwd.pm\t2016-07-25 09:12:20.000000000 +0000\n+++ ./dist/PathTools/Cwd.pm\t2017-02-28 20:36:10.314765294 +0000\n@@ -179,9 +179,8 @@\n # so everything works under taint mode.\n my $pwd_cmd;\n if($^O ne 'MSWin32') {\n-    foreach my $try ('/bin/pwd',\n-\t\t     '/usr/bin/pwd',\n-\t\t     '/QOpenSys/bin/pwd', # OS/400 PASE.\n+    foreach my $try ('@TERMUX_PREFIX@/bin/applets/pwd',\n+\t\t     '@TERMUX_PREFIX@/bin/pwd'\n \t\t    ) {\n \tif( -x $try ) {\n \t    $pwd_cmd = $try;\n"
  },
  {
    "path": "packages/perl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.perl.org/\nTERMUX_PKG_DESCRIPTION=\"Capable, feature-rich programming language\"\nTERMUX_PKG_LICENSE=\"Artistic-License-2.0\"\nTERMUX_PKG_VERSION=(5.30.0\n                    1.3)\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=(851213c754d98ccff042caa40ba7a796b2cee88c5325f121be5cbb61bbf975f2\n                   49edea1ea2cd6c5c47386ca71beda8d150c748835781354dbe7f75b1df27e703)\nTERMUX_PKG_SRCURL=(http://www.cpan.org/src/5.0/perl-${TERMUX_PKG_VERSION}.tar.gz\n\t\t   https://github.com/arsv/perl-cross/releases/download/${TERMUX_PKG_VERSION[1]}/perl-cross-${TERMUX_PKG_VERSION[1]}.tar.gz)\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_MAKE_PROCESSES=1\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/perl${TERMUX_PKG_VERSION}\"\n\ntermux_step_post_extract_package() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# This port uses perl-cross: http://arsv.github.io/perl-cross/\n\tcp -rf perl-cross-${TERMUX_PKG_VERSION[1]}/* .\n\n\t# Remove old installation to force fresh:\n\trm -rf $TERMUX_PREFIX/lib/perl5\n\trm -f $TERMUX_PREFIX/lib/libperl.so\n\trm -f $TERMUX_PREFIX/include/perl\n}\n\ntermux_step_configure() {\n\texport PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin\n\n\tORIG_AR=$AR; unset AR\n\tORIG_AS=$AS; unset AS\n\tORIG_CC=$CC; unset CC\n\tORIG_CXX=$CXX; unset CXX\n\tORIG_CPP=$CPP; unset CPP\n\tORIG_CFLAGS=$CFLAGS; unset CFLAGS\n\tORIG_CPPFLAGS=$CPPFLAGS; unset CPPFLAGS\n\tORIG_CXXFLAGS=$CXXFLAGS; unset CXXFLAGS\n\tORIG_LDFLAGS=$LDFLAGS; unset LDFLAGS\n\tORIG_RANLIB=$RANLIB; unset RANLIB\n\tORIG_LD=$LD; unset LD\n\n\t# Since we specify $TERMUX_PREFIX/bin/sh below for the shell\n\t# it will be run during the build, so temporarily (removed in\n\t# termux_step_post_make_install below) setup symlink:\n\trm -f $TERMUX_PREFIX/bin/sh\n\tln -s /bin/sh $TERMUX_PREFIX/bin/sh\n\n\tcd $TERMUX_PKG_BUILDDIR\n\t$TERMUX_PKG_SRCDIR/configure \\\n\t\t--target=$TERMUX_HOST_PLATFORM \\\n\t\t-Dosname=android \\\n\t\t-Dsysroot=$TERMUX_STANDALONE_TOOLCHAIN/sysroot \\\n\t\t-Dprefix=$TERMUX_PREFIX \\\n\t\t-Dsh=$TERMUX_PREFIX/bin/sh \\\n\t\t-Dcc=\"$ORIG_CC -Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags\" \\\n\t\t-Duseshrplib\n}\n\ntermux_step_post_make_install() {\n\t# Replace hardlinks with symlinks:\n\tcd $TERMUX_PREFIX/share/man/man1\n\trm perlbug.1\n\tln -s perlthanks.1 perlbug.1\n\n\t# Cleanup:\n\trm $TERMUX_PREFIX/bin/sh\n\n\tcd $TERMUX_PREFIX/lib\n\tln -f -s perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE/libperl.so libperl.so\n\n\tcd $TERMUX_PREFIX/include\n\tln -f -s ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/CORE perl\n\tcd ../lib/perl5/${TERMUX_PKG_VERSION}/${TERMUX_ARCH}-android/\n\tchmod +w Config_heavy.pl\n\tsed 's',\"--sysroot=$TERMUX_STANDALONE_TOOLCHAIN\"/sysroot,\"-I${TERMUX_PREFIX}/include\",'g' Config_heavy.pl > Config_heavy.pl.new\n\tsed 's',\"$TERMUX_STANDALONE_TOOLCHAIN\"/sysroot,\"-I${TERMUX_PREFIX%%/usr}\",'g' Config_heavy.pl.new > Config_heavy.pl\n\trm Config_heavy.pl.new\n}\n"
  },
  {
    "path": "packages/perl/cnf-configure_func.sh.patch",
    "content": "With unified headers \"vprintf(NULL,0)\" fails to compile with clang\nsince the second argument should be a va_list.\n\ndiff -u -r ../src-orig/cnf/configure_func.sh ./cnf/configure_func.sh\n--- ../src-orig/cnf/configure_func.sh\t2017-06-28 11:41:43.391383248 +0200\n+++ ./cnf/configure_func.sh\t2017-06-28 11:42:10.055083970 +0200\n@@ -275,7 +275,7 @@\n checkfunc d_usleep 'usleep'\n checkfunc d_ustat 'ustat'\n define d_vfork 'undef' # unnecessary\n-checkfunc d_vprintf 'vprintf' 'NULL,0'\n+define d_vprintf 'define'\n checkfunc d_vsnprintf 'vsnprintf'\n checkfunc d_wait4 'wait4'\n checkfunc d_waitpid 'waitpid' '0,NULL,0'\n"
  },
  {
    "path": "packages/perl/cnf-configure_path.sh.patch",
    "content": "--- ../configure_path.sh.orig\t2019-05-17 19:33:29.839841883 +0200\n+++ ./cnf/configure_path.sh\t2019-05-17 19:33:56.726506709 +0200\n@@ -108,7 +108,7 @@\n define privlibexp \"$privlib\"\n define binexp \"$bin\"\n \n-define libpth \"/lib /usr/lib /usr/local/lib\"\n+define libpth \"@TERMUX_PREFIX@/lib @TERMUX_PREFIX@/local/lib\"\n define glibpth \"$libpth\"\n define plibpth\n \n"
  },
  {
    "path": "packages/perl/file-spec-unix.pm.patch",
    "content": "diff -u -r ../perl-5.22.1/dist/PathTools/lib/File/Spec/Unix.pm ./dist/PathTools/lib/File/Spec/Unix.pm\n--- ../perl-5.22.1/dist/PathTools/lib/File/Spec/Unix.pm\t2015-10-17 08:38:37.000000000 -0400\n+++ ./dist/PathTools/lib/File/Spec/Unix.pm\t2016-04-19 16:46:41.651532097 -0400\n@@ -210,7 +210,7 @@\n sub tmpdir {\n     my $cached = $_[0]->_cached_tmpdir('TMPDIR');\n     return $cached if defined $cached;\n-    $_[0]->_cache_tmpdir($_[0]->_tmpdir( $ENV{TMPDIR}, \"/tmp\" ), 'TMPDIR');\n+    $_[0]->_cache_tmpdir($_[0]->_tmpdir( $ENV{TMPDIR}, \"@TERMUX_PREFIX@/tmp\" ), 'TMPDIR');\n }\n \n =item updir\n"
  },
  {
    "path": "packages/perl/perlio.c.patch",
    "content": "diff -uNr perl-5.26.2/perlio.c perl-5.26.2.mod/perlio.c\n--- perl-5.26.2/perlio.c\t2018-03-23 21:34:37.000000000 +0200\n+++ perl-5.26.2.mod/perlio.c\t2018-06-19 17:56:36.691181671 +0300\n@@ -5061,7 +5061,7 @@\n #else /* WIN32 */\n #    if defined(HAS_MKSTEMP) && ! defined(VMS) && ! defined(OS2)\n      int fd = -1;\n-     char tempname[] = \"/tmp/PerlIO_XXXXXX\";\n+     char tempname[] = \"@TERMUX_PREFIX@/tmp/PerlIO_XXXXXX\";\n      const char * const tmpdir = TAINTING_get ? NULL : PerlEnv_getenv(\"TMPDIR\");\n      SV * sv = NULL;\n      int old_umask = umask(0177);\n"
  },
  {
    "path": "packages/pforth/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.softsynth.com/pforth/\nTERMUX_PKG_DESCRIPTION=\"Portable Forth in C\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\n_COMMIT=ee8dc9e9e0f59b8e38dec3732caefe9f3af2b431\nTERMUX_PKG_VERSION=20180513\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=3cf472bb944aa53b0eb0b93d021c8c2c0eff18dd2e3e54daddaf4af342e441ea\nTERMUX_PKG_SRCURL=https://github.com/philburk/pforth/archive/${_COMMIT}.zip\nTERMUX_PKG_HOSTBUILD=true\n\ntermux_step_post_configure() {\n\t# Avoid caching the host build as it differs between arches\n\t# and is quite fast here anyway:\n\trm -Rf $TERMUX_PKG_HOSTBUILD_DIR\n}\n\ntermux_step_host_build() {\n\tlocal M32=\"\"\n\tif [ $TERMUX_ARCH_BITS = \"32\" ]; then\n\t\tM32=\"-m32\"\n\tfi\n\tcp -Rf $TERMUX_PKG_SRCDIR/* .\n\tcd build/unix\n\tCC=\"gcc $M32\" make pfdicdat.h\n\tCC=\"gcc $M32\" make all\n}\n\ntermux_step_pre_configure() {\n\tfor file in pfdicdat.h pforth; do\n\t\tcp $TERMUX_PKG_HOSTBUILD_DIR/build/unix/$file $TERMUX_PKG_SRCDIR/build/unix/$file\n\t\ttouch -d \"next hour\" $TERMUX_PKG_SRCDIR/build/unix/$file\n\tdone\n\n\texport TERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR/build/unix\n\texport CC=\"$CC $CFLAGS $LDFLAGS\"\n}\ntermux_step_make_install() {\n\tcp $TERMUX_PKG_BUILDDIR/pforth_standalone $TERMUX_PREFIX/bin/pforth\n}\n"
  },
  {
    "path": "packages/php/Makefile.global.patch",
    "content": "Work around https://github.com/android-ndk/ndk/issues/201.\n\ndiff -u -r ../php-7.1.6/Makefile.global ./Makefile.global\n--- ../php-7.1.6/Makefile.global\t2017-06-07 10:09:38.000000000 +0200\n+++ ./Makefile.global\t2017-06-14 23:22:21.258154325 +0200\n@@ -16,7 +16,7 @@\n build-binaries: $(PHP_BINARIES)\n \n libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)\n-\t$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@\n+\t$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) -lapr-1 -laprutil-1 $(ZEND_EXTRA_LIBS) -o $@\n \t-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1\n \n libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)\n"
  },
  {
    "path": "packages/php/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://php.net\nTERMUX_PKG_DESCRIPTION=\"Server-side, HTML-embedded scripting language\"\nTERMUX_PKG_LICENSE=\"PHP-3.0\"\nTERMUX_PKG_VERSION=7.3.12\nTERMUX_PKG_SRCURL=https://secure.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=aafe5e9861ad828860c6af8c88cdc1488314785962328eb1783607c1fdd855df\n# Build native php for phar to build (see pear-Makefile.frag.patch):\nTERMUX_PKG_HOSTBUILD=true\n# Build the native php without xml support as we only need phar:\nTERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS=\"--disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear\"\nTERMUX_PKG_DEPENDS=\"libiconv, libandroid-glob, libxml2, liblzma, openssl, pcre2, libbz2, libcrypt, libcurl, libgd, readline, freetype, libandroid-support, zlib\"\n# mysql modules were initially shared libs\nTERMUX_PKG_CONFLICTS=\"php-mysql, php-dev\"\nTERMUX_PKG_REPLACES=\"php-mysql, php-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"php/php/fpm\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_res_nsearch=no\n--enable-bcmath\n--enable-calendar\n--enable-exif\n--enable-gd-native-ttf=$TERMUX_PREFIX\n--enable-mbstring\n--enable-opcache\n--enable-pcntl\n--enable-sockets\n--enable-zip\n--mandir=$TERMUX_PREFIX/share/man\n--with-bz2=$TERMUX_PREFIX\n--with-curl=$TERMUX_PREFIX\n--with-freetype-dir=$TERMUX_PREFIX\n--with-gd=$TERMUX_PREFIX\n--with-libxml-dir=$TERMUX_PREFIX\n--with-openssl=$TERMUX_PREFIX\n--with-pcre-regex=$TERMUX_PREFIX\n--with-png-dir=$TERMUX_PREFIX\n--with-readline=$TERMUX_PREFIX\n--with-zlib\n--without-libzip\n--with-pgsql=shared,$TERMUX_PREFIX\n--with-pdo-pgsql=shared,$TERMUX_PREFIX\n--with-mysqli=mysqlnd\n--with-pdo-mysql=mysqlnd\n--with-mysql-sock=$TERMUX_PREFIX/tmp/mysqld.sock\n--with-apxs2=$TERMUX_PKG_TMPDIR/apxs-wrapper.sh\n--with-iconv=$TERMUX_PREFIX\n--enable-fpm\n--sbindir=$TERMUX_PREFIX/bin\n\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob -llog\"\n\n\texport PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/\n\texport NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php\n\n\t# Run autoconf since we have patched config.m4 files.\n\tautoconf\n\n\texport EXTENSION_DIR=$TERMUX_PREFIX/lib/php\n\n\t# Use a wrapper since bin/apxs has the Termux shebang:\n\techo \"perl $TERMUX_PREFIX/bin/apxs \\$@\" > $TERMUX_PKG_TMPDIR/apxs-wrapper.sh\n\tchmod +x $TERMUX_PKG_TMPDIR/apxs-wrapper.sh\n\tcat $TERMUX_PKG_TMPDIR/apxs-wrapper.sh\n}\n\ntermux_step_post_configure() {\n\t# Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>:\n\tsed -i 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h\n\t# Avoid src/ext/standard/dns.c trying to use struct __res_state:\n\tsed -i 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/php-fpm.d\n\tcp sapi/fpm/php-fpm.conf $TERMUX_PREFIX/etc/\n\tcp sapi/fpm/www.conf $TERMUX_PREFIX/etc/php-fpm.d/\n\n\tsed -i 's/SED=.*/SED=sed/' $TERMUX_PREFIX/bin/phpize\n}\n"
  },
  {
    "path": "packages/php/ext-opcache-config.m4.patch",
    "content": "diff -u -r ../php-7.3.6/ext/opcache/config.m4 ./ext/opcache/config.m4\n--- ../php-7.3.6/ext/opcache/config.m4\t2019-05-28 09:33:00.000000000 +0000\n+++ ./ext/opcache/config.m4\t2019-06-24 20:40:39.725791000 +0000\n@@ -145,7 +145,9 @@\n }\n ]])],[dnl\n     AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])\n-    msg=yes],[msg=no],[msg=no])\n+    msg=yes],[msg=no],\n+    AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])\n+    msg=yes)\n   AC_MSG_RESULT([$msg])\n \n   AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support)\n@@ -379,6 +381,9 @@\n \tOptimizer/zend_dump.c,\n \tshared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes)\n \n+  OPCACHE_SHARED_LIBADD=-lpcre2-8\n+  PHP_SUBST(OPCACHE_SHARED_LIBADD)\n+\n   PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1)\n   PHP_ADD_EXTENSION_DEP(opcache, pcre)\n fi\n"
  },
  {
    "path": "packages/php/ext-opcache-zend_accelerator_module.c.patch",
    "content": "diff -u -r ../php-7.2.3/ext/opcache/zend_accelerator_module.c ./ext/opcache/zend_accelerator_module.c\n--- ../php-7.2.3/ext/opcache/zend_accelerator_module.c\t2018-02-27 16:33:06.000000000 +0000\n+++ ./ext/opcache/zend_accelerator_module.c\t2018-03-10 23:43:52.824368199 +0000\n@@ -308,7 +308,7 @@\n \tSTD_PHP_INI_ENTRY(\"opcache.restrict_api\"             , \"\"    , PHP_INI_SYSTEM, OnUpdateString,\t         accel_directives.restrict_api,              zend_accel_globals, accel_globals)\n \n #ifndef ZEND_WIN32\n-\tSTD_PHP_INI_ENTRY(\"opcache.lockfile_path\"             , \"/tmp\"    , PHP_INI_SYSTEM, OnUpdateString,           accel_directives.lockfile_path,              zend_accel_globals, accel_globals)\n+\tSTD_PHP_INI_ENTRY(\"opcache.lockfile_path\"             , \"@TERMUX_PREFIX@/tmp\"    , PHP_INI_SYSTEM, OnUpdateString,           accel_directives.lockfile_path,              zend_accel_globals, accel_globals)\n #else\n \tSTD_PHP_INI_ENTRY(\"opcache.mmap_base\", NULL, PHP_INI_SYSTEM,\tOnUpdateString,\t                             accel_directives.mmap_base,                 zend_accel_globals, accel_globals)\n #endif\n"
  },
  {
    "path": "packages/php/ext-pdo_pgsql-config.m4.patch",
    "content": "diff -u -r ../php-7.3.3/ext/pdo_pgsql/config.m4 ./ext/pdo_pgsql/config.m4\n--- ../php-7.3.3/ext/pdo_pgsql/config.m4\t2019-03-05 13:50:40.000000000 +0000\n+++ ./ext/pdo_pgsql/config.m4\t2019-03-17 22:38:42.906375088 +0000\n@@ -14,12 +14,7 @@\n   PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE)\n \n   AC_MSG_CHECKING(for pg_config)\n-  for i in $PHP_PDO_PGSQL $PHP_PDO_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin \"\"; do\n-    if test -x $i/pg_config; then\n-      PG_CONFIG=\"$i/pg_config\"\n-      break;\n-    fi\n-  done\n+  # Avoid picking up cross-compiled pg_config.\n \n   if test -n \"$PG_CONFIG\"; then\n     AC_MSG_RESULT([$PG_CONFIG])\n"
  },
  {
    "path": "packages/php/ext-pgsql-config.m4.patch",
    "content": "diff -u -r ../php-7.3.3/ext/pgsql/config.m4 ./ext/pgsql/config.m4\n--- ../php-7.3.3/ext/pgsql/config.m4\t2019-03-05 13:50:45.000000000 +0000\n+++ ./ext/pgsql/config.m4\t2019-03-17 22:54:10.391031721 +0000\n@@ -8,12 +8,7 @@\n   PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE)\n \n   AC_MSG_CHECKING(for pg_config)\n-  for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin /usr/bin \"\"; do\n-\tif test -x $i/pg_config; then\n-      PG_CONFIG=\"$i/pg_config\"\n-      break;\n-    fi\n-  done\n+  # Avoid picking up cross-compiled pg_config.\n \n   if test -n \"$PG_CONFIG\"; then\n     AC_MSG_RESULT([$PG_CONFIG])\n@@ -99,6 +94,11 @@\n   LDFLAGS=$old_LDFLAGS\n \n   PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)\n+  dnl The pgsql extension uses pcre2 so needs to link explicitly\n+  dnl against it to work on android (the php binary, which dlopen():s\n+  dnl this module already links to pcre2, but that is not enough on\n+  dnl Android, see https://github.com/android-ndk/ndk/issues/201):\n+  PHP_ADD_LIBRARY_WITH_PATH(pcre2-8, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)\n   PHP_SUBST(PGSQL_SHARED_LIBADD)\n \n   PHP_ADD_INCLUDE($PGSQL_INCLUDE)\n"
  },
  {
    "path": "packages/php/ext-phar-Makefile.frag.patch",
    "content": "diff -u -r ../php-7.1.0RC3/ext/phar/Makefile.frag ./ext/phar/Makefile.frag\n--- ../php-7.1.0RC3/ext/phar/Makefile.frag\t2016-09-28 22:15:43.000000000 -0400\n+++ ./ext/phar/Makefile.frag\t2016-10-03 05:47:53.106218451 -0400\n@@ -4,20 +4,7 @@\n pharcmd: $(builddir)/phar.php $(builddir)/phar.phar\n \n PHP_PHARCMD_SETTINGS = -n -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0'\n-PHP_PHARCMD_EXECUTABLE = ` \\\n-\tif test -x \"$(top_builddir)/$(SAPI_CLI_PATH)\"; then \\\n-\t\t$(top_srcdir)/build/shtool echo -n -- \"$(top_builddir)/$(SAPI_CLI_PATH) -n\"; \\\n-\t\tif test \"x$(PHP_MODULES)\" != \"x\"; then \\\n-\t\t$(top_srcdir)/build/shtool echo -n -- \" -d extension_dir=$(top_builddir)/modules\"; \\\n-\t\tfor i in bz2 zlib phar; do \\\n-\t\t\tif test -f \"$(top_builddir)/modules/$$i.la\"; then \\\n-\t\t\t\t. $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- \" -d extension=$$dlname\"; \\\n-\t\t\tfi; \\\n-\t\tdone; \\\n-\t\tfi; \\\n-\telse \\\n-\t\t$(top_srcdir)/build/shtool echo -n -- \"$(PHP_EXECUTABLE)\"; \\\n-\tfi;`\n+PHP_PHARCMD_EXECUTABLE = $(NATIVE_PHP_EXECUTABLE)\n PHP_PHARCMD_BANG = `$(top_srcdir)/build/shtool echo -n -- \"$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)\";`\n \n $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc\n"
  },
  {
    "path": "packages/php/ext-posix-posix.c.patch",
    "content": "diff -u -r ../php-7.1.0RC3/ext/posix/posix.c ./ext/posix/posix.c\n--- ../php-7.1.0RC3/ext/posix/posix.c\t2016-09-28 22:15:45.000000000 -0400\n+++ ./ext/posix/posix.c\t2016-10-03 08:39:39.009354865 -0400\n@@ -1163,7 +1163,10 @@\n \tadd_assoc_string(return_value, \"passwd\",    pw->pw_passwd);\n \tadd_assoc_long  (return_value, \"uid\",       pw->pw_uid);\n \tadd_assoc_long  (return_value, \"gid\",\t\tpw->pw_gid);\n+#if !defined(__ANDROID__) || defined(__LP64__)\n+\t/* Only 64-bit Android has the pw_gecos field. */\n \tadd_assoc_string(return_value, \"gecos\",     pw->pw_gecos);\n+#endif\n \tadd_assoc_string(return_value, \"dir\",       pw->pw_dir);\n \tadd_assoc_string(return_value, \"shell\",     pw->pw_shell);\n \treturn 1;\n"
  },
  {
    "path": "packages/php/ext-standard-basic_functions.c.patch",
    "content": "diff -u -r ../php-7.3.2/ext/standard/basic_functions.c ./ext/standard/basic_functions.c\n--- ../php-7.3.2/ext/standard/basic_functions.c\t2019-02-05 13:10:09.000000000 +0000\n+++ ./ext/standard/basic_functions.c\t2019-02-16 00:28:53.991218270 +0000\n@@ -3753,9 +3753,6 @@\n \n PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */\n {\n-#ifdef HAVE_SYSLOG_H\n-\tPHP_MSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);\n-#endif\n #ifdef ZTS\n \tts_free_id(basic_globals_id);\n #ifdef PHP_WIN32\n"
  },
  {
    "path": "packages/php/ext-standard-dns.c.patch",
    "content": "diff -u -r ../php-5.6.15/ext/standard/dns.c ./ext/standard/dns.c\n--- ../php-5.6.15/ext/standard/dns.c\t2015-10-29 05:55:01.000000000 -0400\n+++ ./ext/standard/dns.c\t2015-11-10 16:05:47.473119979 -0500\n@@ -938,7 +938,7 @@\n \n \t\t\t/* Skip QD entries, they're only used by dn_expand later on */\n \t\t\twhile (qd-- > 0) {\n-\t\t\t\tn = dn_skipname(cp, end);\n+\t\t\t\tn = __dn_skipname(cp, end);\n \t\t\t\tif (n < 0) {\n \t\t\t\t\tphp_error_docref(NULL TSRMLS_CC, E_WARNING, \"Unable to parse DNS data received\");\n \t\t\t\t\tzval_dtor(return_value);\n@@ -1049,14 +1049,14 @@\n \tcp = (u_char *)&ans + HFIXEDSZ;\n \tend = (u_char *)&ans +i;\n \tfor (qdc = ntohs((unsigned short)hp->qdcount); qdc--; cp += i + QFIXEDSZ) {\n-\t\tif ((i = dn_skipname(cp, end)) < 0 ) {\n+\t\tif ((i = __dn_skipname(cp, end)) < 0 ) {\n \t\t\tphp_dns_free_handle(handle);\n \t\t\tRETURN_FALSE;\n \t\t}\n \t}\n \tcount = ntohs((unsigned short)hp->ancount);\n \twhile (--count >= 0 && cp < end) {\n-\t\tif ((i = dn_skipname(cp, end)) < 0 ) {\n+\t\tif ((i = __dn_skipname(cp, end)) < 0 ) {\n \t\t\tphp_dns_free_handle(handle);\n \t\t\tRETURN_FALSE;\n \t\t}\n"
  },
  {
    "path": "packages/php/ext-standard-php_fopen_wrapper.c.patch",
    "content": "See https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/AXhZapYuHi8\n\ndiff -u -r ../php-5.6.16/ext/standard/php_fopen_wrapper.c ./ext/standard/php_fopen_wrapper.c\n--- ../php-5.6.16/ext/standard/php_fopen_wrapper.c\t2015-11-25 15:28:38.000000000 -0500\n+++ ./ext/standard/php_fopen_wrapper.c\t2016-01-04 06:42:57.421589363 -0500\n@@ -312,7 +312,7 @@\n \t\t}\n \n #if HAVE_UNISTD_H\n-\t\tdtablesize = getdtablesize();\n+\t\tdtablesize = sysconf(_SC_OPEN_MAX);\n #else\n \t\tdtablesize = INT_MAX;\n #endif\n"
  },
  {
    "path": "packages/php/ext-standard-proc_open.c.patch",
    "content": "diff -u -r ../php-5.6.17/ext/standard/proc_open.c ./ext/standard/proc_open.c > ~/php-proc_open.patch\n--- ../php-5.6.17/ext/standard/proc_open.c\t2016-03-04 18:41:21.108197300 +0100\n+++ ./ext/standard/proc_open.c\t2016-03-04 18:41:58.088196534 +0100\n@@ -881,9 +881,9 @@\n \t\t}\n \n \t\tif (env.envarray) {\n-\t\t\texecle(\"/bin/sh\", \"sh\", \"-c\", command, NULL, env.envarray);\n+\t\t\texecle(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", command, NULL, env.envarray);\n \t\t} else {\n-\t\t\texecl(\"/bin/sh\", \"sh\", \"-c\", command, NULL);\n+\t\t\texecl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", command, NULL);\n \t\t}\n \t\t_exit(127);\n \n"
  },
  {
    "path": "packages/php/iconv-config.m4.patch",
    "content": "--- ./ext/iconv/config.m4.orig\t2019-03-23 10:05:07.289878202 +0000\n+++ ./ext/iconv/config.m4\t2019-03-23 10:06:27.207978972 +0000\n@@ -12,22 +12,6 @@\n   ])\n \n   if test \"$iconv_avail\" != \"no\"; then\n-    if test -z \"$ICONV_DIR\"; then\n-      for i in /usr/local /usr; do\n-        if test -f \"$i/include/iconv.h\" || test -f \"$i/include/giconv.h\"; then\n-          PHP_ICONV_PREFIX=\"$i\"\n-          break\n-        fi\n-      done\n-      if test -z \"$PHP_ICONV_PREFIX\"; then\n-        PHP_ICONV_PREFIX=\"/usr\"\n-      fi\n-    else\n-      PHP_ICONV_PREFIX=\"$ICONV_DIR\"\n-    fi\n-\n-    CFLAGS=\"-I$PHP_ICONV_PREFIX/include $CFLAGS\"\n-    LDFLAGS=\"-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS\"\n \n     if test -r \"$PHP_ICONV_PREFIX/include/giconv.h\"; then\n       PHP_ICONV_H_PATH=\"$PHP_ICONV_PREFIX/include/giconv.h\"\n"
  },
  {
    "path": "packages/php/pear-Makefile.frag.patch",
    "content": "diff -u -r ../php-7.1.0RC3/pear/Makefile.frag ./pear/Makefile.frag\n--- ../php-7.1.0RC3/pear/Makefile.frag\t2016-09-28 22:15:47.000000000 -0400\n+++ ./pear/Makefile.frag\t2016-10-03 05:53:02.793555471 -0400\n@@ -12,7 +12,7 @@\n PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar\n \n install-pear-installer: $(SAPI_CLI_PATH)\n-\t@$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d \"$(peardir)\" -b \"$(bindir)\" ${PEAR_PREFIX} ${PEAR_SUFFIX}\n+\tphp $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d \"$(peardir)\" -b \"$(bindir)\" ${PEAR_PREFIX} ${PEAR_SUFFIX}\n \n install-pear:\n \t@echo \"Installing PEAR environment:      $(INSTALL_ROOT)$(peardir)/\"\n@@ -25,7 +25,7 @@\n \t\t\telif test ! -z \"$(FETCH)\" && test -x \"$(FETCH)\"; then \\\n \t\t\t\t\"$(FETCH)\" -o $(builddir)/ \"${PEAR_INSTALLER_URL}\"; \\\n \t\t\telse \\\n-\t\t\t\t$(top_builddir)/sapi/cli/php -n $(srcdir)/fetch.php \"${PEAR_INSTALLER_URL}\" $(builddir)/install-pear-nozlib.phar; \\\n+\t\t\t\tphp -n $(srcdir)/fetch.php \"${PEAR_INSTALLER_URL}\" $(builddir)/install-pear-nozlib.phar; \\\n \t\t\tfi \\\n \t\tfi \\\n \tfi\n"
  },
  {
    "path": "packages/php/php-apache.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Apache 2.0 Handler module for PHP\"\nTERMUX_SUBPKG_DEPENDS=\"apache2\"\nTERMUX_SUBPKG_INCLUDE=\"libexec/apache2/libphp7.so\"\n"
  },
  {
    "path": "packages/php/php-fpm.patch",
    "content": "--- ./sapi/fpm/www.conf.in\n+++ ./sapi/fpm/www.conf.in\n@@ -33,7 +33,7 @@\n ;                            (IPv6 and IPv4-mapped) on a specific port;\n ;   '/path/to/unix/socket' - to listen on a unix socket.\n ; Note: This value is mandatory.\n-listen = 127.0.0.1:9000\n+listen = @TERMUX_PREFIX@/var/run/php-fpm.sock\n \n ; Set listen(2) backlog.\n ; Default Value: 511 (-1 on FreeBSD and OpenBSD)\n"
  },
  {
    "path": "packages/php/php-fpm.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/php-fpm etc/php-fpm.conf etc/php-fpm.d/www.conf share/man/man8/php-fpm.8.gz\"\nTERMUX_SUBPKG_CONFFILES=\"etc/php-fpm.conf etc/php-fpm.d/www.conf\"\nTERMUX_SUBPKG_DESCRIPTION=\"FastCGI Process Manager for PHP\"\n"
  },
  {
    "path": "packages/php/php-pgsql.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/php/pgsql.so lib/php/pdo_pgsql.so\"\nTERMUX_SUBPKG_DEPENDS=\"postgresql\"\nTERMUX_SUBPKG_DESCRIPTION=\"PostgreSQL modules for PHP\"\n"
  },
  {
    "path": "packages/php/sapi-apache2handler-config.m4.patch",
    "content": "--- ./sapi/apache2handler/config.m4\t2017-05-09 17:59:42.000000000 +0530\n+++ ./sapi/apache2handler/config.m4\t2017-06-08 21:10:39.847173781 +0530\n@@ -67,18 +67,9 @@\n   fi\n \n   APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`\n-  if test -z `$APXS -q SYSCONFDIR`; then\n     INSTALL_IT=\"\\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \\\n                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \\\n                        -i -n php7\"\n-  else\n-    APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`\n-    INSTALL_IT=\"\\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \\\n-                \\$(mkinstalldirs) '$APXS_SYSCONFDIR' && \\\n-                 $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \\\n-                       -S SYSCONFDIR='$APXS_SYSCONFDIR' \\\n-                       -i -a -n php7\"\n-  fi\n \n   case $host_alias in\n   *aix*)\n@@ -122,7 +122,7 @@\n       PHP_BUILD_THREAD_SAFE\n     fi\n   else\n-    APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`\n+    APACHE_THREADED_MPM=true\n     if test -n \"$APACHE_THREADED_MPM\"; then\n       PHP_BUILD_THREAD_SAFE\n     fi\n"
  },
  {
    "path": "packages/pianobar/Makefile.patch",
    "content": "--- ../cache/pianobar-2018.06.22/Makefile\t2018-06-22 14:57:26.000000000 +0800\n+++ ./Makefile\t2018-08-15 19:56:31.529627505 +0800\n@@ -1,6 +1,6 @@\n # makefile of pianobar\n \n-PREFIX:=/usr/local\n+PREFIX:=@TERMUX_PREFIX@\n BINDIR:=${PREFIX}/bin\n LIBDIR:=${PREFIX}/lib\n INCDIR:=${PREFIX}/include\n@@ -64,7 +64,7 @@\n \t\t\t${LIBAV_CFLAGS} ${LIBCURL_CFLAGS} \\\n \t\t\t${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} \\\n \t\t\t${LIBAO_CFLAGS}\n-ALL_LDFLAGS:=${LDFLAGS} -lpthread -lm \\\n+ALL_LDFLAGS:=${LDFLAGS} -lm \\\n \t\t\t${LIBAV_LDFLAGS} ${LIBCURL_LDFLAGS} \\\n \t\t\t${LIBGCRYPT_LDFLAGS} ${LIBJSONC_LDFLAGS} \\\n \t\t\t${LIBAO_LDFLAGS}\n"
  },
  {
    "path": "packages/pianobar/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://6xq.net/pianobar/\nTERMUX_PKG_DESCRIPTION=\"pianobar is a free/open-source, console-based client for the personalized online radio Pandora.\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2019.02.14\nTERMUX_PKG_SHA256=415858f8bf938a84af06b15fd49daa49fd2089f3c66f55356c0987ac4fce20d7\nTERMUX_PKG_SRCURL=https://github.com/PromyLOPh/pianobar/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libao, ffmpeg, libgcrypt, libcurl, json-c\"\nTERMUX_PKG_BUILD_DEPENDS=\"libao, ffmpeg, libgcrypt, libcurl, json-c\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_make_install(){\n    #install useful script\n    install -Dm755 \"$TERMUX_PKG_SRCDIR\"/contrib/headless_pianobar \"$TERMUX_PREFIX\"/bin/pianoctl\n}\n"
  },
  {
    "path": "packages/pick/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/calleerlandsson/pick\nTERMUX_PKG_DESCRIPTION=\"Utility to choose one option from a set of choices with fuzzy search functionality\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=3.0.1\nTERMUX_PKG_SHA256=668c863751f94ad90e295cf861a80b4d94975e06645f401d7f82525e607c0266\nTERMUX_PKG_SRCURL=https://github.com/calleerlandsson/pick/releases/download/v${TERMUX_PKG_VERSION}/pick-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\texport MANDIR=$TERMUX_PREFIX/share/man\n}\n"
  },
  {
    "path": "packages/pick/configure.patch",
    "content": "diff -u -r ../pick-3.0.1/configure ./configure\n--- ../pick-3.0.1/configure\t2019-03-10 08:43:32.000000000 +0000\n+++ ./configure\t2019-05-07 23:32:41.496767302 +0000\n@@ -158,15 +158,8 @@\n # Enable tracing, will end up in config.log.\n set -x\n \n-if (LDFLAGS=-lcurses check_curses); then\n-\tHAVE_CURSES=1\n-\tLDFLAGS=\"${LDFLAGS} -lcurses\"\n-elif (LDFLAGS=-lncursesw check_curses); then\n \tHAVE_NCURSESW=1\n \tLDFLAGS=\"${LDFLAGS} -lncursesw\"\n-else\n-\tfatal \"curses library not found\"\n-fi\n \n check_dead __dead && HAVE_DEAD=1\n check_dead __dead2 && HAVE_DEAD2=1\n"
  },
  {
    "path": "packages/pick/pick.c.patch",
    "content": "diff -u -r ../pick-1.9.0/pick.c ./pick.c\n--- ../pick-1.9.0/pick.c\t2017-09-19 08:38:03.000000000 +0200\n+++ ./pick.c\t2017-09-20 00:53:21.927992913 +0200\n@@ -33,6 +33,10 @@\n \t\terrx(1, #capability \": unknown terminfo capability\");\t\\\n } while (0)\n \n+#ifndef CCEQ\n+# define CCEQ(val, c)\t((c) == (val) && (val) != _POSIX_VDISABLE)\n+#endif\n+\n enum key {\n \tUNKNOWN,\n \tALT_ENTER,\n"
  },
  {
    "path": "packages/picolisp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://picolisp.com\nTERMUX_PKG_DESCRIPTION=\"Lisp interpreter and application server framework\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_DEPENDS=\"libcrypt, openssl\"\nTERMUX_PKG_VERSION=19.11.25\nTERMUX_PKG_SHA256=2ca0300d84390ce47f5d94db7ec6bbb75650f764f2a4a9244edcc2b3812a06da\n# We use our bintray mirror since old version snapshots are not kept on main site.\nTERMUX_PKG_SRCURL=https://dl.bintray.com/termux/upstream/picolisp_${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n# arm and i686: The c code uses gcc-specific \"variable length array in structure\":\n# x86_64: The assembly is not position-independent:\nTERMUX_PKG_BLACKLISTED_ARCHES=\"arm, i686, x86_64\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Validate that we have the right version:\n\tgrep -q \"Version ${TERMUX_PKG_VERSION//./ }\" src64/version.l || {\n\t\ttermux_error_exit \"Picolisp version needs to be bumped\"\n\t}\n\n\tif [ $TERMUX_ARCH_BITS = 64 ]; then\n\t\tcd $TERMUX_PKG_SRCDIR\n\t\tif [ $TERMUX_ARCH = \"aarch64\" ]; then\n\t\t\texport TERMUX_PKG_EXTRA_MAKE_ARGS=arm64.android\n\t\telse\n\t\t\ttermux_error_exit \"Unsupported arch: $TERMUX_ARCH\"\n\t\tfi\n\t\tTERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/src64\n\telse\n\t\tTERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/src\n\tfi\n\tTERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR\n\tORIG_CFLAGS=\"$CFLAGS\"\n\tCFLAGS+=\" -c $LDFLAGS $CPPFLAGS\"\n}\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR/\n\n\tif [ $TERMUX_ARCH_BITS = \"64\" ]; then\n\t\t$TERMUX_HOST_PLATFORM-as -o ${TERMUX_PKG_EXTRA_MAKE_ARGS}.base.o ${TERMUX_PKG_EXTRA_MAKE_ARGS}.base.s\n\t\t$TERMUX_HOST_PLATFORM-as -o ${TERMUX_PKG_EXTRA_MAKE_ARGS}.ext.o ${TERMUX_PKG_EXTRA_MAKE_ARGS}.ext.s\n\t\t$TERMUX_HOST_PLATFORM-as -o ${TERMUX_PKG_EXTRA_MAKE_ARGS}.ht.o ${TERMUX_PKG_EXTRA_MAKE_ARGS}.ht.s\n\n\t\t# Use -fuse-ld=bfd to avoid using the gold linker (which Termux\n\t\t# patches NDK to use by default) as it causes (tzo), the time\n\t\t# zone offset, to always be 0 (and probably other problems):\n\t\t$CC -o ../bin/picolisp ${TERMUX_PKG_EXTRA_MAKE_ARGS}.base.o \\\n\t\t\t-Wl,--no-as-needed -rdynamic -lc -lm -ldl -pie -fuse-ld=bfd\n\t\tchmod +x ../bin/picolisp\n\t\t$CC -o ../lib/ext -shared -rdynamic -fuse-ld=bfd ${TERMUX_PKG_EXTRA_MAKE_ARGS}.ext.o\n\t\t$CC -o ../lib/ht -shared -rdynamic -fuse-ld=bfd ${TERMUX_PKG_EXTRA_MAKE_ARGS}.ht.o\n\tfi\n\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/../man/man1/{pil,picolisp}.1 $TERMUX_PREFIX/share/man/man1/\n\n\trm -Rf $TERMUX_PREFIX/lib/picolisp\n\tmkdir -p $TERMUX_PREFIX/lib/picolisp\n\n\tcp -Rf $TERMUX_PKG_SRCDIR/../* $TERMUX_PREFIX/lib/picolisp/\n\trm -Rf $TERMUX_PREFIX/lib/picolisp/{src,man,java,ersatz}\n\n\t# Replace first line \"#!/usr/bin/picolisp /usr/lib/picolisp/lib.l\":\n\tsed -i \"1 s|^.*$|#!$TERMUX_PREFIX/bin/picolisp $TERMUX_PREFIX/lib/picolisp/lib.l|g\" $TERMUX_PREFIX/lib/picolisp/bin/pil\n\n\t( cd $TERMUX_PREFIX/bin && ln -f -s ../lib/picolisp/bin/picolisp picolisp && ln -f -s ../lib/picolisp/bin/pil pil )\n\n\t# Bundled tools:\n\t$CC $ORIG_CFLAGS $CPPFLAGS $LDFLAGS -o $TERMUX_PREFIX/lib/picolisp/bin/ssl ../src/ssl.c -lssl -lcrypto\n\t$CC $ORIG_CFLAGS $CPPFLAGS $LDFLAGS -o $TERMUX_PREFIX/lib/picolisp/bin/httpGate ../src/httpGate.c -lssl -lcrypto\n\n\t# Man pages:\n\tcp $TERMUX_PKG_SRCDIR/../man/man1/{pil,picolisp}.1 $TERMUX_PREFIX/share/man/man1/\n}\n"
  },
  {
    "path": "packages/picolisp/src-Makefile.patch",
    "content": "diff -u -r ../picoLisp/src/Makefile ./src/Makefile\n--- ../picoLisp/src/Makefile\t2019-01-30 14:32:00.000000000 +0000\n+++ ./src/Makefile\t2019-07-16 12:35:22.543000406 +0000\n@@ -6,121 +6,17 @@\n \n picoFiles = main.c gc.c apply.c flow.c sym.c subr.c big.c io.c net.c tab.c\n \n-CC = gcc\n # CCLD is the cc (compiler frontend) to use for the link step.\n-CCLD = gcc\n-\n+CCLD = $(CC)\n+LCRYPT = -lcrypt\n+PICOLISP-FLAGS = -rdynamic -lm $(LDFLAGS)\n M32=-m32\n-\n-CFLAGS = -c -O2 -pipe \\\n+DYNAMIC-LIB-FLAGS = -shared -export-dynamic $(LDFLAGS) -lm\n+CFLAGS += -c -pipe \\\n \t-falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing \\\n \t-W -Wimplicit -Wreturn-type -Wunused -Wformat \\\n \t-Wuninitialized -Wstrict-prototypes \\\n-\t-D_GNU_SOURCE  -D_FILE_OFFSET_BITS=64\n-\n-DYNAMIC-CC-FLAGS=\n-\n-ifeq ($(shell uname), Linux)\n-\tOS = Linux\n-\tCFLAGS += ${M32}\n-\tPICOLISP-FLAGS = ${M32} -rdynamic\n-\tLIB-FLAGS = -lm -ldl\n-\tDYNAMIC-LIB-FLAGS = ${M32} -shared -export-dynamic\n-\tLCRYPT = -lcrypt\n-\tSTRIP = strip\n-else\n-ifeq ($(shell uname), OpenBSD)\n-\tOS = OpenBSD\n-\tCFLAGS += ${M32}\n-\tPICOLISP-FLAGS = ${M32} -rdynamic -Wl,-E\n-\tLIB-FLAGS = -lm\n-\tDYNAMIC-LIB-FLAGS = -Wl,-E -Wl,-shared\n-\tLCRYPT = -lcrypto\n-\tSTRIP = strip\n-else\n-ifeq ($(shell uname), FreeBSD)\n-\tOS = FreeBSD\n-\tCC = gcc\n-\tCCLD = clang\n-\tCFLAGS += ${M32} -fPIC\n-\tPICOLISP-FLAGS = ${M32} -rdynamic\n-\tLIB-FLAGS = -lm\n-\tDYNAMIC-LIB-FLAGS = ${M32} -shared\n-\tLCRYPT = -lcrypt\n-\tSTRIP = strip\n-else\n-ifeq ($(shell uname), NetBSD)\n-\tOS = NetBSD\n-\tCFLAGS += ${M32}\n-\tPICOLISP-FLAGS = ${M32} -rdynamic\n-\tLIB-FLAGS = -lm\n-\tDYNAMIC-LIB-FLAGS = ${M32} -shared -export-dynamic\n-\tLCRYPT = -lcrypto\n-\tSTRIP = strip\n-else\n-ifeq ($(shell uname), Darwin)\n-\tOS = Darwin\n-\tCFLAGS += ${M32}\n-\tPICOLISP-FLAGS = ${M32}\n-\tLIB-FLAGS = -lc -lm -ldl\n-\tDYNAMIC-LIB-FLAGS = ${M32} -dynamiclib -undefined dynamic_lookup\n-\tLCRYPT = -lcrypto\n-\tSTRIP = strip -x\n-else\n-ifeq ($(shell uname), SunOS)\n-\tOS = SunOS\n-\tCFLAGS += ${M32}\n-\tPICOLISP-FLAGS =\n-\tLIB-FLAGS = -lm -lnsl -lsocket\n-\tDYNAMIC-LIB-FLAGS = -G\n-\tLCRYPT = -lcrypt\n-\tSTRIP = strip\n-else\n-ifeq ($(shell uname), AIX)\n-\tOS = AIX\n-\tCFLAGS += -maix32\n-\tPICOLISP-FLAGS = -maix32 -Wl,-brtl -Wl,-bexpall\n-\tLIB-FLAGS = -lm\n-\tDYNAMIC-LIB-FLAGS = -maix32 -Wl,-G -shared -lm\n-\tLCRYPT = -lcrypt\n-\tSTRIP = strip\n-else\n-ifeq ($(shell uname), HP-UX)\n-\tOS = HP-UX\n-\tCFLAGS +=\n-\tPICOLISP-FLAGS = ${M32} -rdynamic\n-\tLIB-FLAGS = -lm -ldl\n-\tDYNAMIC-LIB-FLAGS = ${M32} -shared\n-\tLCRYPT =\n-\tSTRIP = strip\n-else\n-ifeq ($(shell uname), IRIX64)\n-\tOS = IRIX64\n-\tCFLAGS += -std=gnu99\n-\tDYNAMIC-LIB-FLAGS = -shared\n-\tSTRIP = strip -f\n-else\n-ifeq ($(shell uname -o | egrep -q \"Cygwin|Msys\" ; echo $$?), 0)\n-\tOS = Cygwin\n-\tCFLAGS += ${M32}\n-\tDYNAMIC-LIB-FLAGS = -shared\n-\tPICOLISP-FLAGS =\n-\tDLL-DEFS = $(bin)/picolisp.dll\n-\tLCRYPT = -lcrypt\n-\tSTRIP = strip\n-\texe = .exe\n-\tdll = .dll\n-endif\n-endif\n-endif\n-endif\n-endif\n-endif\n-endif\n-endif\n-endif\n-endif\n-\n+\t-D_GNU_SOURCE\n \n picolisp: $(bin)/picolisp $(lib)/ext$(dll) $(lib)/ht$(dll)\n tools: $(bin)/lat1 $(bin)/utf2 $(bin)/balance\n"
  },
  {
    "path": "packages/picolisp/src-ext.c.patch",
    "content": "diff -u -r ../picoLisp/src/ext.c ./src/ext.c\n--- ../picoLisp/src/ext.c\t2016-04-01 04:05:10.000000000 -0400\n+++ ./src/ext.c\t2016-04-13 06:40:31.791712225 -0400\n@@ -3,6 +3,7 @@\n  */\n \n #include \"pico.h\"\n+#include <crypt.h>\n \n /*** Soundex Algorithm ***/\n static int SnxTab[] = {\n"
  },
  {
    "path": "packages/picolisp/src64-mkAsm.patch",
    "content": "Avoid trying to run /usr/bin/picolisp since it is probably too\nold - just run the java version, since java is needed by the\nTermux package builds anyway.\n\ndiff -u -r ../picoLisp/src64/mkAsm ./src64/mkAsm\n--- ../picoLisp/src64/mkAsm\t2016-12-14 02:35:59.000000000 -0500\n+++ ./src64/mkAsm\t2016-12-27 20:06:01.126373627 -0500\n@@ -1,17 +1,6 @@\n #!/bin/sh\n # 14dec16abu\n \n-if test -x /usr/bin/picolisp\n-then\n-   /usr/bin/pil mkAsm.l \"$@\"\n-elif test -x ../bin/picolisp\n-then\n-   ../pil mkAsm.l \"$@\"\n-elif which java >/dev/null\n-then\n-   ../ersatz/pil mkAsm.l \"$@\"\n-else\n-   echo \"No PicoLisp binary found for bootstrapping\"\n-fi\n+../ersatz/pil mkAsm.l \"$@\"\n \n # vi:et:ts=3:sw=3\n"
  },
  {
    "path": "packages/pigz/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.zlib.net/pigz\nTERMUX_PKG_DESCRIPTION=\"Parallel implementation of the gzip file compressor\"\nTERMUX_PKG_LICENSE=\"ZLIB\"\nTERMUX_PKG_VERSION=2.4\nTERMUX_PKG_SRCURL=https://www.zlib.net/pigz/pigz-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=a4f816222a7b4269bd232680590b579ccc72591f1bb5adafcd7208ca77e14f73\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tinstall -Dm700 pigz $TERMUX_PREFIX/bin/pigz\n\tln -sfr $TERMUX_PREFIX/bin/pigz $TERMUX_PREFIX/bin/unpigz\n\tinstall -Dm600 pigz.1 $TERMUX_PREFIX/share/man/man1/pigz.1\n}\n"
  },
  {
    "path": "packages/pigz/pigz-2.4_Makefile.patch",
    "content": "diff -uNr pigz-2.4/Makefile pigz-2.4.mod/Makefile\n--- pigz-2.4/Makefile\t2017-12-27 02:35:01.000000000 +0200\n+++ pigz-2.4.mod/Makefile\t2019-09-23 22:45:25.088019565 +0300\n@@ -1,7 +1,7 @@\n-CC=gcc\n-CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas\n-LDFLAGS=\n-LIBS=-lm -lpthread -lz\n+CC?=gcc\n+CFLAGS+=-Wall -Wextra -Wno-unknown-pragmas\n+LDFLAGS?=\n+LIBS=-lz -lm\n ZOPFLI=zopfli/src/zopfli/\n ZOP=deflate.o blocksplitter.o tree.o lz77.o cache.o hash.o util.o squeeze.o katajainen.o\n \n"
  },
  {
    "path": "packages/pigz/pigz-2.4_yarn.c.patch",
    "content": "diff -uNr pigz-2.4/yarn.c pigz-2.4.mod/yarn.c\n--- pigz-2.4/yarn.c\t2015-01-20 06:12:31.000000000 +0200\n+++ pigz-2.4.mod/yarn.c\t2019-09-23 22:45:59.981446648 +0300\n@@ -374,7 +374,7 @@\n {\n     int ret;\n \n-    if ((ret = pthread_cancel(off_course->id)) != 0)\n+    if ((ret = pthread_kill(off_course->id, 0)) != 0)\n         fail(ret);\n     join(off_course);\n }\n"
  },
  {
    "path": "packages/pinentry/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/pinentry/index.html\nTERMUX_PKG_DESCRIPTION=\"Dialog allowing secure password entry\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.1.0\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SHA256=68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570\nTERMUX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"libandroid-support, libassuan, libiconv, ncurses\"\nTERMUX_PKG_BUILD_DEPENDS=\"libgpg-error\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-pinentry-fltk --without-libcap\"\n"
  },
  {
    "path": "packages/pinentry/pinentry-emacs.c.patch",
    "content": "diff -uNr pinentry-1.1.0/pinentry/pinentry-emacs.c pinentry-1.1.0.mod/pinentry/pinentry-emacs.c\n--- pinentry-1.1.0/pinentry/pinentry-emacs.c\t2017-12-03 18:13:05.000000000 +0200\n+++ pinentry-1.1.0.mod/pinentry/pinentry-emacs.c\t2019-03-01 18:38:36.250899637 +0200\n@@ -134,7 +134,7 @@\n \t}\n       else\n #endif\n-\ttmpdir = \"/tmp\";\n+\ttmpdir = \"@TERMUX_PREFIX@/tmp\";\n     }\n \n   socket_name_storage = malloc (strlen (tmpdir)\n"
  },
  {
    "path": "packages/pinentry/pinentry-pinentry.c.patch",
    "content": "diff -u -r ../pinentry-0.9.7/pinentry/pinentry.c ./pinentry/pinentry.c\n--- ../pinentry-0.9.7/pinentry/pinentry.c\t2015-09-16 14:47:52.000000000 -0400\n+++ ./pinentry/pinentry.c\t2016-01-20 16:28:14.364196578 -0500\n@@ -213,8 +213,10 @@\n     {\n       if (! lc_ctype_unknown_warning)\n \t{\n+#ifndef __ANDROID__\n \t  fprintf (stderr, \"%s: no LC_CTYPE known - assuming UTF-8\\n\",\n \t\t   this_pgmname);\n+#endif\n \t  lc_ctype_unknown_warning = 1;\n \t}\n       return strdup (text);\n"
  },
  {
    "path": "packages/pkg-config/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/pkg-config/\nTERMUX_PKG_DESCRIPTION=\"Helper tool used when compiling applications and libraries\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.29.2\nTERMUX_PKG_SRCURL=https://pkgconfig.freedesktop.org/releases/pkg-config-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591\nTERMUX_PKG_DEPENDS=\"glib\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/*-pkg-config\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\trm -Rf $TERMUX_PREFIX/bin/*pkg-config\n}\n"
  },
  {
    "path": "packages/play-audio/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/play-audio\nTERMUX_PKG_DESCRIPTION=\"Simple command line audio player for Android\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.5\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/termux/play-audio/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e114123c4b337cddb1d4aa6c3287574d8c81b2dc4b3abc07ce21616fa14f9e82\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/plzip/Makefile.in.patch",
    "content": "diff -uNr plzip-1.8/Makefile.in plzip-1.8.mod/Makefile.in\n--- plzip-1.8/Makefile.in\t2018-10-12 00:56:58.000000000 +0300\n+++ plzip-1.8.mod/Makefile.in\t2019-09-23 19:39:16.088047518 +0300\n@@ -4,7 +4,7 @@\n INSTALL_PROGRAM = $(INSTALL) -m 755\n INSTALL_DATA = $(INSTALL) -m 644\n INSTALL_DIR = $(INSTALL) -d -m 755\n-LIBS = -llz -lpthread\n+LIBS = -llz\n SHELL = /bin/sh\n CAN_RUN_INSTALLINFO = $(SHELL) -c \"install-info --version\" > /dev/null 2>&1\n \n"
  },
  {
    "path": "packages/plzip/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.nongnu.org/lzip/plzip.html\nTERMUX_PKG_DESCRIPTION=\"A massively parallel lossless data compressor based on the lzlib compression library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.8\nTERMUX_PKG_SRCURL=http://download.savannah.gnu.org/releases/lzip/plzip/plzip-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=edafae3c15142ac0ebd84c2231ff81da4f68db58359a737e750f2780686c3612\nTERMUX_PKG_DEPENDS=\"lzlib\"\n"
  },
  {
    "path": "packages/plzip/configure.patch",
    "content": "diff -uNr plzip-1.8/configure plzip-1.8.mod/configure\n--- plzip-1.8/configure\t2019-01-04 20:33:44.000000000 +0200\n+++ plzip-1.8.mod/configure\t2019-09-23 19:37:59.464411919 +0300\n@@ -21,10 +21,10 @@\n datarootdir='$(prefix)/share'\n infodir='$(datarootdir)/info'\n mandir='$(datarootdir)/man'\n-CXX=g++\n-CPPFLAGS=\n-CXXFLAGS='-Wall -W -O2'\n-LDFLAGS=\n+CXX?=g++\n+CPPFLAGS?=\n+CXXFLAGS?='-Wall -W -O2'\n+LDFLAGS?=\n \n # checking whether we are using GNU C++.\n /bin/sh -c \"${CXX} --version\" > /dev/null 2>&1 ||\n"
  },
  {
    "path": "packages/pngquant/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://pngquant.org\nTERMUX_PKG_DESCRIPTION=\"PNG image optimising utility\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.12.5\nTERMUX_PKG_SHA256=(9d2c5197b21c42931623fb3e6064b91c133bfb52c84428ee1bf9b84712c9b83c\n                   605d6f21df568d6dbdf206cfed1260bb9a26a4a0909d13841ebbb30b5dd58c40)\n# If both archives are .tar.gz then they overwrite eachother since they are the same version and hence the same name.\n# Work around this by using .zip for one of them...\nTERMUX_PKG_SRCURL=(https://github.com/pornel/pngquant/archive/$TERMUX_PKG_VERSION.tar.gz\n\t\t   https://github.com/ImageOptim/libimagequant/archive/$TERMUX_PKG_VERSION.zip)\nTERMUX_PKG_DEPENDS=\"libpng, littlecms, zlib\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-sse\"\n\ntermux_step_post_extract_package() {\n\tmv $TERMUX_PKG_SRCDIR/libimagequant-$TERMUX_PKG_VERSION/* $TERMUX_PKG_SRCDIR/lib/\n}\n"
  },
  {
    "path": "packages/pngquant/configure.patch",
    "content": "diff -u -r ../pngquant-2.12.1/configure ./configure\n--- ../pngquant-2.12.1/configure\t2018-06-04 11:30:47.000000000 +0000\n+++ ./configure\t2018-07-02 11:53:11.547417517 +0000\n@@ -360,12 +361,6 @@\n     DIRS+=(\"$LIQSRCDIR\" \"$LIQSRCDIR\") # local libimagequant\n fi\n \n-DIRS+=(\n-      \"/usr/local/include /usr/local/lib\"\n-      \"/usr/include /usr/lib64\"\n-      \"/usr/include /usr/lib\"\n-      \"/opt/local/include /opt/local/lib\" # macports\n-      )\n \n if [[ \"$OSTYPE\" =~ \"darwin\" ]]; then\n     SOLIBSUFFIX=dylib\n"
  },
  {
    "path": "packages/poppler/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://poppler.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"PDF rendering library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.79.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://poppler.freedesktop.org/poppler-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=f985a4608fe592d2546d9d37d4182e502ff6b4c42f8db4be0a021a1c369528c8\n# libcairo and littlecms is used by pdftocairo:\nTERMUX_PKG_DEPENDS=\"libc++, libiconv, fontconfig, glib, libcairo, libpng, libjpeg-turbo, libtiff, littlecms, openjpeg, freetype, libcurl\"\nTERMUX_PKG_BREAKS=\"poppler-dev\"\nTERMUX_PKG_REPLACES=\"poppler-dev\"\n#texlive needs the xpdf headers\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DENABLE_GLIB=ON\n-DENABLE_UNSTABLE_API_ABI_HEADERS=ON\n-DENABLE_QT5=OFF\n-DFONT_CONFIGURATION=fontconfig\n\"\n"
  },
  {
    "path": "packages/poppler/gstrtod.cc.patch",
    "content": "diff -u -r ../poppler-0.26.2/goo/gstrtod.cc ./goo/gstrtod.cc\n--- ../poppler-0.26.2/goo/gstrtod.cc\t2014-04-26 17:37:22.000000000 +0200\n+++ ./goo/gstrtod.cc\t2014-06-26 08:44:42.000000000 +0200\n@@ -41,7 +41,9 @@\n {\n   char *fail_pos;\n   double val;\n+#ifndef __ANDROID__\n   struct lconv *locale_data;\n+#endif\n   const char *decimal_point;\n   int decimal_point_len;\n   const char *p, *decimal_point_pos;\n@@ -50,8 +52,12 @@\n \n   fail_pos = NULL;\n \n+#ifdef __ANDROID__\n+  decimal_point = \".\";\n+#else\n   locale_data = localeconv ();\n   decimal_point = locale_data->decimal_point;\n+#endif\n   decimal_point_len = strlen (decimal_point);\n \n   decimal_point_pos = NULL;\n"
  },
  {
    "path": "packages/poppler/poppler-Form.cc.patch",
    "content": "Include <ctype.h> for isxdigit(3).\n\ndiff -u -r ../poppler-0.59.0/poppler/Form.cc ./poppler/Form.cc\n--- ../poppler-0.59.0/poppler/Form.cc\t2017-08-16 00:16:09.000000000 +0200\n+++ ./poppler/Form.cc\t2017-09-11 20:06:45.434163003 +0200\n@@ -29,6 +29,7 @@\n \n #include <set>\n #include <limits>\n+#include <ctype.h>\n #include <stddef.h>\n #include <string.h>\n #include \"goo/gmem.h\"\n"
  },
  {
    "path": "packages/postgresql/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.postgresql.org\nTERMUX_PKG_DESCRIPTION=\"Object-relational SQL database\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas'\nTERMUX_PKG_VERSION=12.1\nTERMUX_PKG_SRCURL=https://ftp.postgresql.org/pub/source/v$TERMUX_PKG_VERSION/postgresql-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=a09bf3abbaf6763980d0f8acbb943b7629a8b20073de18d867aecdb7988483ed\nTERMUX_PKG_DEPENDS=\"openssl, libcrypt, readline, libandroid-shmem, libuuid, libxml2, libicu, zlib\"\n# - pgac_cv_prog_cc_ldflags__Wl___as_needed: Inform that the linker supports as-needed. It's\n#   not stricly necessary but avoids unnecessary linking of binaries.\n# - USE_UNNAMED_POSIX_SEMAPHORES: Avoid using System V semaphores which are disabled on Android.\n# - ZIC=...: The zic tool is used to build the time zone database bundled with postgresql.\n#   We specify a binary built in termux_step_host_build which has been patched to use symlinks\n#   over hard links (which are not supported as of Android 6.0+).\n#   There exists a --with-system-tzdata configure flag, but that does not work here as Android\n#   uses a custom combined tzdata file.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\npgac_cv_prog_cc_ldflags__Wl___as_needed=yes\nUSE_UNNAMED_POSIX_SEMAPHORES=1\n--with-icu\n--with-libxml\n--with-openssl\n--with-uuid=e2fs\nZIC=$TERMUX_PKG_HOSTBUILD_DIR/src/timezone/zic\n\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\" -s\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"lib/libecpg* bin/ecpg share/man/man1/ecpg.1\"\nTERMUX_PKG_HOSTBUILD=true\nTERMUX_PKG_BREAKS=\"postgresql-contrib (<= 10.3-1), postgresql-dev\"\nTERMUX_PKG_REPLACES=\"postgresql-contrib (<= 10.3-1), postgresql-dev\"\n\ntermux_step_host_build() {\n\t# Build a native zic binary which we have patched to\n\t# use symlinks instead of hard links.\n\t$TERMUX_PKG_SRCDIR/configure --without-readline\n\tmake\n}\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_post_make_install() {\n\t# Man pages are not installed by default:\n\tmake -C doc/src/sgml install-man\n\n\tfor contrib in \\\n\t\thstore \\\n\t\tpageinspect \\\n\t\tpgcrypto \\\n\t\tpgrowlocks \\\n\t\tpg_freespacemap \\\n\t\tpg_stat_statements\\\n\t\tpg_trgm \\\n\t\tfuzzystrmatch \\\n\t\tunaccent \\\n\t\tuuid-ossp \\\n\t\t; do\n\t\t(cd contrib/$contrib && make -s -j $TERMUX_MAKE_PROCESSES install)\n\tdone\n}\n\ntermux_step_post_massage() {\n\t# Remove bin/pg_config so e.g. php doesn't try to use it, which won't\n\t# work as it's a cross-compiled binary:\n\trm $TERMUX_PREFIX/bin/pg_config\n}\n"
  },
  {
    "path": "packages/postgresql/src-backend-Makefile.patch",
    "content": "diff -u -r ../postgresql-9.6.1/src/backend/Makefile ./src/backend/Makefile\n--- ../postgresql-9.6.1/src/backend/Makefile\t2016-10-24 20:08:51.000000000 +0000\n+++ ./src/backend/Makefile\t2017-03-04 23:18:25.301563453 +0000\n@@ -49,6 +49,8 @@\n LIBS += -lsystemd\n endif\n \n+LIBS += -landroid-shmem -llog\n+\n ##########################################################################\n \n all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)\n"
  },
  {
    "path": "packages/postgresql/src-backend-commands-collationcmds.c.patch",
    "content": "diff -u -r ../postgresql-10.0/src/backend/commands/collationcmds.c ./src/backend/commands/collationcmds.c\n--- ../postgresql-10.0/src/backend/commands/collationcmds.c\t2017-10-02 23:09:15.000000000 +0200\n+++ ./src/backend/commands/collationcmds.c\t2017-10-06 22:00:29.165645642 +0200\n@@ -362,7 +362,7 @@\n \n \n /* will we use \"locale -a\" in pg_import_system_collations? */\n-#if defined(HAVE_LOCALE_T) && !defined(WIN32)\n+#if defined(HAVE_LOCALE_T) && !defined(WIN32) && !defined(__ANDROID__)\n #define READ_LOCALE_A_OUTPUT\n #endif\n \n"
  },
  {
    "path": "packages/postgresql/src-bin-initdb-initdb.c.patch",
    "content": "diff -u -r ../postgresql-11.0/src/bin/initdb/initdb.c ./src/bin/initdb/initdb.c\n--- ../postgresql-11.0/src/bin/initdb/initdb.c\t2018-10-15 21:12:02.000000000 +0000\n+++ ./src/bin/initdb/initdb.c\t2018-10-18 17:54:16.149615230 +0000\n@@ -120,8 +120,8 @@\n \n /* values to be obtained from arguments */\n static char *pg_data = NULL;\n-static char *encoding = NULL;\n-static char *locale = NULL;\n+static char *encoding = \"UTF-8\";\n+static char *locale = \"en_US.UTF-8\";\n static char *lc_collate = NULL;\n static char *lc_ctype = NULL;\n static char *lc_monetary = NULL;\n"
  },
  {
    "path": "packages/postgresql/src-bin-pg_ctl-pg_ctl.c.patch",
    "content": "diff -u -r ../postgresql-9.6.2/src/bin/pg_ctl/pg_ctl.c ./src/bin/pg_ctl/pg_ctl.c\n--- ../postgresql-9.6.2/src/bin/pg_ctl/pg_ctl.c\t2017-02-06 22:45:25.000000000 +0100\n+++ ./src/bin/pg_ctl/pg_ctl.c\t2017-03-05 14:47:06.985823535 +0100\n@@ -466,7 +466,7 @@\n \t\tsnprintf(cmd, MAXPGPATH, \"exec \\\"%s\\\" %s%s < \\\"%s\\\" 2>&1\",\n \t\t\t\t exec_path, pgdata_opt, post_opts, DEVNULL);\n \n-\t(void) execl(\"/bin/sh\", \"/bin/sh\", \"-c\", cmd, (char *) NULL);\n+\t(void) execl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", cmd, (char *) NULL);\n \n \t/* exec failed */\n \twrite_stderr(_(\"%s: could not start server: %s\\n\"),\n"
  },
  {
    "path": "packages/postgresql/src-bin-pg_upgrade-check.c.patch",
    "content": "diff -u -r ../postgresql-9.6.2/src/bin/pg_upgrade/check.c ./src/bin/pg_upgrade/check.c\n--- ../postgresql-9.6.2/src/bin/pg_upgrade/check.c\t2017-02-06 22:45:25.000000000 +0100\n+++ ./src/bin/pg_upgrade/check.c\t2017-03-05 14:47:58.793188439 +0100\n@@ -436,7 +436,7 @@\n \n #ifndef WIN32\n \t/* add shebang header */\n-\tfprintf(script, \"#!/bin/sh\\n\\n\");\n+\tfprintf(script, \"#!@TERMUX_PREFIX@/bin/sh\\n\\n\");\n #else\n \t/* suppress command echoing */\n \tfprintf(script, \"@echo off\\n\");\n@@ -564,7 +564,7 @@\n \n #ifndef WIN32\n \t/* add shebang header */\n-\tfprintf(script, \"#!/bin/sh\\n\\n\");\n+\tfprintf(script, \"#!@TERMUX_PREFIX@/bin/sh\\n\\n\");\n #endif\n \n \t/* delete old cluster's default tablespace */\n"
  },
  {
    "path": "packages/postgresql/src-bin-psql-command.c.patch",
    "content": "diff -u -r ../postgresql-9.6.2/src/bin/psql/command.c ./src/bin/psql/command.c\n--- ../postgresql-9.6.2/src/bin/psql/command.c\t2017-02-06 22:45:25.000000000 +0100\n+++ ./src/bin/psql/command.c\t2017-03-05 15:33:33.579755248 +0100\n@@ -2258,7 +2258,7 @@\n \t\tconst char *tmpdir = getenv(\"TMPDIR\");\n \n \t\tif (!tmpdir)\n-\t\t\ttmpdir = \"/tmp\";\n+\t\t\ttmpdir = \"@TERMUX_PREFIX@/tmp\";\n #else\n \t\tchar\t\ttmpdir[MAXPGPATH];\n \t\tint\t\t\tret;\n@@ -3076,7 +3076,7 @@\n \n \n #ifndef WIN32\n-#define DEFAULT_SHELL \"/bin/sh\"\n+#define DEFAULT_SHELL \"@TERMUX_PREFIX@/bin/sh\"\n #else\n /*\n  *\tCMD.EXE is in different places in different Win32 releases so we\n"
  },
  {
    "path": "packages/postgresql/src-include-pg_config_manual.h.patch",
    "content": "diff -u -r ../postgresql-9.6.2/src/include/pg_config_manual.h ./src/include/pg_config_manual.h\n--- ../postgresql-9.6.2/src/include/pg_config_manual.h\t2017-02-06 22:45:25.000000000 +0100\n+++ ./src/include/pg_config_manual.h\t2017-03-05 12:52:20.798099131 +0100\n@@ -13,6 +13,8 @@\n  *------------------------------------------------------------------------\n  */\n \n+#include <paths.h>\n+\n /*\n  * Maximum length for identifiers (e.g. table names, column names,\n  * function names).  Names actually are limited to one less byte than this,\n@@ -124,7 +126,7 @@\n /*\n  * Define this if your operating system supports link()\n  */\n-#if !defined(WIN32) && !defined(__CYGWIN__)\n+#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__ANDROID__)\n #define HAVE_WORKING_LINK 1\n #endif\n \n@@ -182,7 +184,11 @@\n  * here's where to twiddle it.  You can also override this at runtime\n  * with the postmaster's -k switch.\n  */\n+#ifdef _PATH_TMP\n+#define DEFAULT_PGSOCKET_DIR  _PATH_TMP\n+#else\n #define DEFAULT_PGSOCKET_DIR  \"/tmp\"\n+#endif\n \n /*\n  * This is the default event source for Windows event log.\n"
  },
  {
    "path": "packages/postgresql/src-timezone-zic.c.patch.beforehostbuild",
    "content": "diff -u -r ../postgresql-10.1/src/timezone/zic.c ./src/timezone/zic.c\n--- ../postgresql-10.1/src/timezone/zic.c\t2017-11-07 01:46:52.000000000 +0100\n+++ ./src/timezone/zic.c\t2017-11-11 19:32:52.836782026 +0100\n@@ -17,6 +17,12 @@\n #include \"private.h\"\n #include \"tzfile.h\"\n \n+/*\n+ * Avoid the qsort->pg_qsort define to more easily build\n+ * a native patched zic tool.\n+ */\n+#undef qsort\n+\n #define\tZIC_VERSION_PRE_2013 '2'\n #define\tZIC_VERSION\t'3'\n \n@@ -889,8 +895,16 @@\n \t\t\t\tprogname, directory, fromfield, strerror(EPERM));\n \t\texit(EXIT_FAILURE);\n \t}\n+#if 1\n+\t/*\n+\t * Android does not support hard links starting from 6.0\n+\t * so always use symlinks.\n+\t */\n+\tstaysymlink = true;\n+#else\n \tif (staysymlink)\n \t\tstaysymlink = itssymlink(tofield);\n+#endif\n \tif (remove(tofield) == 0)\n \t\ttodirs_made = true;\n \telse if (errno != ENOENT)\n"
  },
  {
    "path": "packages/potrace/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://potrace.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Tool for transforming a bitmap into a smooth, scalable image\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.16\nTERMUX_PKG_SHA256=be8248a17dedd6ccbaab2fcc45835bb0502d062e40fbded3bc56028ce5eb7acc\n# TERMUX_PKG_SRCURL=http://potrace.sourceforge.net/download/$TERMUX_PKG_VERSION/potrace-$TERMUX_PKG_VERSION.tar.gz\n# 2018-02-15: Switching to alternative url as above url is down:\nTERMUX_PKG_SRCURL=https://distfiles.macports.org/potrace/potrace-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"zlib\"\n"
  },
  {
    "path": "packages/privoxy/GNUmakefile.in.patch",
    "content": "--- ../../build/privoxy/cache/privoxy-3.0.24-stable/GNUmakefile.in\t2015-12-27 13:50:57.000000000 +0100\n+++ ./GNUmakefile.in\t2016-09-13 23:30:12.518162391 +0200\n@@ -471,8 +471,8 @@\n \tmkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\\\n \tnsgmls ../privoxy-man-page.sgml  | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\\\n \tperl -pi.bak -e 's/ <URL:.*>//; s/\\[ /\\[/g' $(MAN_PAGE) ;\\\n-\tperl -pi.bak -e \"s/\\[ /\\[/g;s//\\\\\\\\['a]/g;s//\\\\\\\\['e]/g\" $(MAN_PAGE); \\\n-\tperl -pi.bak -e \"s//\\\\\\\\[:o]/g\" $(MAN_PAGE); \\\n+\tperl -pi.bak -e \"s/\\[ /\\[/g;s/\\\\\\\\['a]/g;s/�/\\\\\\\\['e]/g\" $(MAN_PAGE); \\\n+\tperl -pi.bak -e \"s/\\\\\\\\[:o]/g\" $(MAN_PAGE); \\\n \tperl -pi.bak -e 's/([ {])-([a-z])/$$1\\\\-$$2/g' $(MAN_PAGE); \\\n \tperl -pi.bak -e 's/ --([a-z])/ \\\\-\\\\-$$1/g' $(MAN_PAGE); \\\n \tperl -pi.bak -e 's/\\\\fB--/\\\\fB\\\\-\\\\-/g' $(MAN_PAGE); \\\n@@ -872,41 +872,41 @@\n \t\t$(INSTALL) $(INSTALL_T) $$i $(DESTDIR)$(CONF_DEST)/templates ;\\\n \tdone\n \n-\t@# FIXME: group/user validation is overly convoluted.\n-\t@# If superuser install ... we require a minimum of group ownership\n-\t@# of those files the daemon writes to, to be non-root owned.\n-\t@if [ \"`$(ID) |sed 's/(.*//' |sed 's/.*=//'`\" = \"0\" ] ;then\\\n-\t\tif [ x$(USER) = x ] || [ $(USER) = root ]; then \\\n-\t\t\tif [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \\\n-\t\t\t\tif [ \"`$(ID) privoxy`\" ] && \\\n-\t\t\t\t\t$(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) \"\\<privoxy\\>\" >/dev/null; then \\\n-\t\t\t\t\t$(ECHO) \"Warning: Setting group owner to privoxy\";\\\n-\t\t\t\t\tGROUP_T=privoxy ;\\\n-\t\t\t\telse \\\n-\t\t\t\t\t$(ECHO)  \"******************************************************************\" ;\\\n-\t\t\t\t\t$(ECHO)  \" WARNING! WARNING! installing config files as root!\" ;\\\n-\t\t\t\t\t$(ECHO)  \" It is strongly recommended to run $(PROGRAM) as a non-root user,\" ;\\\n-\t\t\t\t\t$(ECHO)  \" and to install the config files as that user and/or group!\" ;\\\n-\t\t\t\t\t$(ECHO)  \" Please read INSTALL, and create a privoxy user and group!\" ;\\\n-\t\t\t\t\t$(ECHO)  \"*******************************************************************\" ;\\\n-\t\t\t\t\texit 1 ;\\\n-\t\t\t\tfi ;\\\n-\t\t\telse \\\n-\t\t\t\tGROUP_T=$(GROUP) ;\\\n-\t\t\tfi ;\\\n-\t\t\tINSTALL_CONF=\"$(INSTALL_R) -g $$GROUP_T \" ;\\\n-\t\telse \\\n-\t\t\t$(ECHO) \"Superuser install, installing config files as $(USER):$(GROUP_T)\" ;\\\n-\t\t\tINSTALL_CONF=\"$(INSTALL_R) -o $(USER) -g $(GROUP_T)\" ;\\\n-\t\t\tGROUP_T=$(GROUP_T) ;\\\n-\t\tfi ;\\\n-\telse \\\n-\t\tif [ ! \"`id $(USER)`\" = \"`id`\" ] ;then \\\n-\t\t\t$(ECHO) \"** WARNING ** current install user different from configured user!!\" ;\\\n-\t\t\t$(ECHO) \"Edit may fail.\" ;\\\n-\t\tfi ;\\\n-\t\tINSTALL_CONF=\"$(INSTALL_R)\" ;\\\n-\tfi ;\\\n+#\t@# FIXME: group/user validation is overly convoluted.\n+#\t@# If superuser install ... we require a minimum of group ownership\n+#\t@# of those files the daemon writes to, to be non-root owned.\n+#\t@if [ \"`$(ID) |sed 's/(.*//' |sed 's/.*=//'`\" = \"0\" ] ;then\\\n+#\t\tif [ x$(USER) = x ] || [ $(USER) = root ]; then \\\n+#\t\t\tif [ x$(GROUP) = x ] || [ $(GROUP) = root ]; then \\\n+#\t\t\t\tif [ \"`$(ID) privoxy`\" ] && \\\n+#\t\t\t\t\t$(GROUPS) privoxy | $(SED) 's/^.*://' |$(GREP) \"\\<privoxy\\>\" >/dev/null; then \\\n+#\t\t\t\t\t$(ECHO) \"Warning: Setting group owner to privoxy\";\\\n+#\t\t\t\t\tGROUP_T=privoxy ;\\\n+#\t\t\t\telse \\\n+#\t\t\t\t\t$(ECHO)  \"******************************************************************\" ;\\\n+#\t\t\t\t\t$(ECHO)  \" WARNING! WARNING! installing config files as root!\" ;\\\n+#\t\t\t\t\t$(ECHO)  \" It is strongly recommended to run $(PROGRAM) as a non-root user,\" ;\\\n+#\t\t\t\t\t$(ECHO)  \" and to install the config files as that user and/or group!\" ;\\\n+#\t\t\t\t\t$(ECHO)  \" Please read INSTALL, and create a privoxy user and group!\" ;\\\n+#\t\t\t\t\t$(ECHO)  \"*******************************************************************\" ;\\\n+#\t\t\t\t\texit 1 ;\\\n+#\t\t\t\tfi ;\\\n+#\t\t\telse \\\n+#\t\t\t\tGROUP_T=$(GROUP) ;\\\n+#\t\t\tfi ;\\\n+#\t\t\tINSTALL_CONF=\"$(INSTALL_R) -g $$GROUP_T \" ;\\\n+#\t\telse \\\n+#\t\t\t$(ECHO) \"Superuser install, installing config files as $(USER):$(GROUP_T)\" ;\\\n+#\t\t\tINSTALL_CONF=\"$(INSTALL_R) -o $(USER) -g $(GROUP_T)\" ;\\\n+#\t\t\tGROUP_T=$(GROUP_T) ;\\\n+#\t\tfi ;\\\n+#\telse \\\n+#\t\tif [ ! \"`id $(USER)`\" = \"`id`\" ] ;then \\\n+#\t\t\t$(ECHO) \"** WARNING ** current install user different from configured user!!\" ;\\\n+#\t\t\t$(ECHO) \"Edit may fail.\" ;\\\n+#\t\tfi ;\\\n+#\t\tINSTALL_CONF=\"$(INSTALL_R)\" ;\\\n+#\tfi ;\\\n \t$(ECHO) Installing configuration files to $(DESTDIR)$(CONF_DEST);\\\n \tfor i in $(CONFIGS); do \\\n \t\tif [ \"$$i\" = \"default.action\" ] || [ \"$$i\" = \"default.filter\" ] ; then \\\n"
  },
  {
    "path": "packages/privoxy/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.privoxy.org\nTERMUX_PKG_DESCRIPTION=\"Non-caching web proxy with advanced filtering capabilities\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.0.28\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=b5d78cc036aaadb3b7cf860e9d598d7332af468926a26e2d56167f1cb6f2824a\nTERMUX_PKG_SRCURL=https://www.privoxy.org/sf-download-mirror/Sources/$TERMUX_PKG_VERSION%20%28stable%29/privoxy-$TERMUX_PKG_VERSION-stable-src.tar.gz\nTERMUX_PKG_CONFFILES='etc/privoxy/config etc/privoxy/match-all.action etc/privoxy/trust etc/privoxy/user.action etc/privoxy/user.filter etc/privoxy/default.action etc/privoxy/default.filter'\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_pcreposix_regcomp=no\n--sysconfdir=$TERMUX_PREFIX/etc/privoxy\n\"\nTERMUX_PKG_DEPENDS=\"pcre, libpcreposix, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n    autoheader\n    autoconf\n\n    # avoid 'aarch64-linux-android-strip': No such file or directory\n    ln -s \"$TERMUX_STANDALONE_TOOLCHAIN/bin/$STRIP\" .\n}\n\ntermux_step_post_make_install() {\n    # delete link created to avoid errors\n    rm -f \"$TERMUX_PREFIX/sbin/$STRIP\"\n}\n\ntermux_step_post_massage() {\n    # copy default config files\n    for f in $TERMUX_PKG_CONFFILES; do\n\tcp \"$TERMUX_PKG_SRCDIR/$(basename $f)\" \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$f\"\n    done\n}\n"
  },
  {
    "path": "packages/privoxy/jcc.c.patch",
    "content": "--- ../../build/privoxy/cache/privoxy-3.0.24-stable/jcc.c\t2016-01-16 13:33:36.000000000 +0100\n+++ ./jcc.c\t2016-08-20 08:48:12.247371024 +0200\n@@ -3655,10 +3655,10 @@\n       }\n       if (NULL != grp)\n       {\n-         if (setgroups(1, &grp->gr_gid))\n-         {\n-            log_error(LOG_LEVEL_FATAL, \"setgroups() failed: %E\");\n-         }\n+         //if (setgroups(1, &grp->gr_gid))\n+         //{\n+         //   log_error(LOG_LEVEL_FATAL, \"setgroups() failed: %E\");\n+         //}\n       }\n       else if (initgroups(pw->pw_name, pw->pw_gid))\n       {\n"
  },
  {
    "path": "packages/privoxy/project.h.patch",
    "content": "diff -u -r ../privoxy-3.0.28-stable/project.h ./project.h\n--- ../privoxy-3.0.28-stable/project.h\t2018-12-30 18:40:13.000000000 +0000\n+++ ./project.h\t2019-01-03 00:34:59.829586492 +0000\n@@ -82,11 +82,7 @@\n #ifdef STATIC_PCRE\n #  include \"pcreposix.h\"\n #else\n-#  ifdef PCRE_H_IN_SUBDIR\n-#    include <pcre/pcreposix.h>\n-#  else\n-#    include <pcreposix.h>\n-#  endif\n+#  include <regex.h>\n #endif\n \n #ifdef _WIN32\n"
  },
  {
    "path": "packages/procps/Makefile.in.patch",
    "content": "Bionic lacks strverscmp as well.\n\ndiff -u -r ../procps-ng-3.3.14/Makefile.in ./Makefile.in\n--- ../procps-ng-3.3.14/Makefile.in\t2018-04-10 11:40:19.331497997 +0000\n+++ ./Makefile.in\t2018-05-19 00:15:36.379445979 +0000\n@@ -136,7 +136,7 @@\n @WITH_NCURSES_TRUE@\twatch.1 \\\n @WITH_NCURSES_TRUE@\ttop/top.1\n \n-@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__append_18 = lib/strverscmp.c\n+@WITH_NCURSES_TRUE@am__append_18 = lib/strverscmp.c\n @CYGWIN_FALSE@@WITH_NCURSES_TRUE@am__append_19 = \\\n @CYGWIN_FALSE@@WITH_NCURSES_TRUE@\tslabtop.1\n \n@@ -356,8 +356,8 @@\n tload_DEPENDENCIES = ./proc/libprocps.la $(am__DEPENDENCIES_2)\n am__top_top_SOURCES_DIST = top/top.h top/top.c top/top_nls.h \\\n \ttop/top_nls.c lib/fileutils.c lib/strverscmp.c\n-@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__objects_1 =  \\\n-@CYGWIN_TRUE@@WITH_NCURSES_TRUE@\tlib/strverscmp.$(OBJEXT)\n+@WITH_NCURSES_TRUE@am__objects_1 =  \\\n+@WITH_NCURSES_TRUE@\tlib/strverscmp.$(OBJEXT)\n @WITH_NCURSES_TRUE@am_top_top_OBJECTS = top/top.$(OBJEXT) \\\n @WITH_NCURSES_TRUE@\ttop/top_nls.$(OBJEXT) \\\n @WITH_NCURSES_TRUE@\tlib/fileutils.$(OBJEXT) $(am__objects_1)\n"
  },
  {
    "path": "packages/procps/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gitlab.com/procps-ng/procps\nTERMUX_PKG_DESCRIPTION=\"Utilities that give information about processes using the /proc filesystem\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=3.3.15\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/procps-ng-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=10bd744ffcb3de2d591d2f6acf1a54a7ba070fdcc432a855931a5057149f0465\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BREAKS=\"procps-dev\"\nTERMUX_PKG_REPLACES=\"procps-dev\"\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\n# error.h and stdio_ext.h in unified headers does\n# not provide any functionality prior to android-23:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_search_dlopen=\nac_cv_header_error_h=no\nac_cv_header_stdio_ext_h=no\n--enable-sigwinch\n--disable-modern-top\n\"\n\n# About kill: https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/141168:\n# \"For compatibility between distributions, can we have /bin/kill made available from coreutils?\"\n# About uptime: Does not work on later android versions as /proc/uptime cannot be read.\n# About top: The system top works better.\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/top share/man/man1/top.1\nbin/kill share/man/man1/kill.1\nbin/slabtop share/man/man1/slabtop.1\nbin/uptime share/man/man1/uptime.1\nbin/w share/man/man1/w.1\n\"\n"
  },
  {
    "path": "packages/procps/pgrep.c.patch",
    "content": "diff -u -r ../procps-ng-3.3.11/pgrep.c ./pgrep.c\n--- ../procps-ng-3.3.11/pgrep.c\t2015-08-09 01:54:54.298117295 -0400\n+++ ./pgrep.c\t2016-04-12 01:14:09.647108539 -0400\n@@ -713,7 +713,7 @@\n \t\t{NULL, 0, NULL, 0}\n \t};\n \n-\tif (strstr (program_invocation_short_name, \"pkill\")) {\n+\tif (strstr (argv[0], \"pkill\")) {\n \t\tint sig;\n \t\ti_am_pkill = 1;\n \t\tsig = signal_option(&argc, argv);\n"
  },
  {
    "path": "packages/procps/pmap.c.patch",
    "content": "diff -u -r ../procps-ng-3.3.9/pmap.c ./pmap.c\n--- ../procps-ng-3.3.9/pmap.c\t2013-09-11 13:53:35.000000000 +0200\n+++ ./pmap.c\t2014-07-06 07:58:12.054894441 +0200\n@@ -25,7 +25,9 @@\n #include <stdlib.h>\n #include <string.h>\n #include <sys/ipc.h>\n+#ifndef __ANDROID__\n #include <sys/shm.h>\n+#endif\n #include <sys/stat.h>\n #include <sys/types.h>\n #include <unistd.h>\n@@ -149,6 +151,7 @@\n \n static void discover_shm_minor(void)\n {\n+#ifndef __ANDROID__\n \tvoid *addr;\n \tint shmid;\n \tchar mapbuf_b[256];\n@@ -205,6 +208,7 @@\n \t\tperror(_(\"shared memory remove\"));\n \n \treturn;\n+#endif\n }\n \n static char *mapping_name(proc_t * p, unsigned KLONG addr,\n"
  },
  {
    "path": "packages/procps/proc-sysinfo.c.patch",
    "content": "diff -u -r ../procps-ng-3.3.15/proc/sysinfo.c ./proc/sysinfo.c\n--- ../procps-ng-3.3.15/proc/sysinfo.c\t2018-05-18 21:32:22.010979780 +0000\n+++ ./proc/sysinfo.c\t2019-08-07 19:53:05.528343190 +0000\n@@ -33,6 +33,9 @@\n #ifdef __CYGWIN__\n #include <sys/param.h>\n #endif\n+#ifdef __ANDROID__\n+#include <sys/sysinfo.h>\n+#endif\n #include \"alloc.h\"\n #include \"version.h\"\n #include \"sysinfo.h\" /* include self to verify prototypes */\n@@ -104,6 +107,18 @@\n \n /***********************************************************************/\n int uptime(double *restrict uptime_secs, double *restrict idle_secs) {\n+#ifdef __ANDROID__\n+    /* Android does not allow read access to /proc/uptime */\n+    SET_IF_DESIRED(idle_secs, 0.);\n+    struct sysinfo system_information;\n+    if (sysinfo(&system_information) == 0) {\n+        SET_IF_DESIRED(uptime_secs, (double) system_information.uptime);\n+        return (double) system_information.uptime;\n+    } else {\n+        SET_IF_DESIRED(uptime_secs, 0.);\n+        return 0;\n+    }\n+#else\n     double up=0, idle=0;\n     char *savelocale;\n \n@@ -121,6 +136,7 @@\n     SET_IF_DESIRED(uptime_secs, up);\n     SET_IF_DESIRED(idle_secs, idle);\n     return up;\t/* assume never be zero seconds in practice */\n+#endif\n }\n \n unsigned long getbtime(void) {\n@@ -134,6 +150,7 @@\n     /* /proc/stat can get very large on multi-CPU systems so we\n        can't use FILE_TO_BUF */\n     if (!(f = fopen(STAT_FILE, \"r\"))) {\n+\treturn 0;\n \tfputs(BAD_OPEN_MESSAGE, stderr);\n \tfflush(NULL);\n \t_exit(102);\n@@ -193,7 +210,9 @@\n   double up_1, up_2, seconds;\n   unsigned long long jiffies;\n   unsigned h;\n+#ifndef __ANDROID__\n   char *savelocale;\n+#endif\n   long hz;\n \n #ifdef _SC_CLK_TCK\n@@ -204,8 +223,10 @@\n #endif\n \n   wait_j = hirq_j = sirq_j = stol_j = 0;\n+#ifndef __ANDROID__\n   savelocale = strdup(setlocale(LC_NUMERIC, NULL));\n   setlocale(LC_NUMERIC, \"C\");\n+#endif\n   do{\n     FILE_TO_BUF(UPTIME_FILE,uptime_fd);  sscanf(buf, \"%lf\", &up_1);\n     /* uptime(&up_1, NULL); */\n@@ -214,8 +235,10 @@\n     FILE_TO_BUF(UPTIME_FILE,uptime_fd);  sscanf(buf, \"%lf\", &up_2);\n     /* uptime(&up_2, NULL); */\n   } while((long long)( (up_2-up_1)*1000.0/up_1 )); /* want under 0.1% error */\n+#ifndef __ANDROID__\n   setlocale(LC_NUMERIC, savelocale);\n   free(savelocale);\n+#endif\n   jiffies = user_j + nice_j + sys_j + other_j + wait_j + hirq_j + sirq_j + stol_j ;\n   seconds = (up_1 + up_2) / 2;\n   h = (unsigned)( (double)jiffies/seconds/smp_num_cpus );\n@@ -445,18 +468,30 @@\n /***********************************************************************/\n void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) {\n     double avg_1=0, avg_5=0, avg_15=0;\n+#ifndef __ANDROID__\n     char *savelocale;\n+#endif\n+\n+    if (loadavg_fd == -1 && (loadavg_fd = open(LOADAVG_FILE, O_RDONLY)) == -1) {\n+\treturn;\n+    }\n \n     FILE_TO_BUF(LOADAVG_FILE,loadavg_fd);\n+#ifndef __ANDROID__\n     savelocale = strdup(setlocale(LC_NUMERIC, NULL));\n     setlocale(LC_NUMERIC, \"C\");\n+#endif\n     if (sscanf(buf, \"%lf %lf %lf\", &avg_1, &avg_5, &avg_15) < 3) {\n \tfputs(\"bad data in \" LOADAVG_FILE \"\\n\", stderr);\n+#ifndef __ANDROID__\n \tfree(savelocale);\n+#endif\n \texit(1);\n     }\n+#ifndef __ANDROID__\n     setlocale(LC_NUMERIC, savelocale);\n     free(savelocale);\n+#endif\n     SET_IF_DESIRED(av1,  avg_1);\n     SET_IF_DESIRED(av5,  avg_5);\n     SET_IF_DESIRED(av15, avg_15);\n@@ -791,27 +826,8 @@\n     mem_used = kb_main_total - kb_main_free;\n   kb_main_used = (unsigned long)mem_used;\n \n-  /* zero? might need fallback for 2.6.27 <= kernel <? 3.14 */\n   if (!kb_main_available) {\n-#ifdef __linux__\n-    if (linux_version_code < LINUX_VERSION(2, 6, 27))\n-      kb_main_available = kb_main_free;\n-    else {\n-      FILE_TO_BUF(VM_MIN_FREE_FILE, vm_min_free_fd);\n-      kb_min_free = (unsigned long) strtoull(buf,&tail,10);\n-\n-      watermark_low = kb_min_free * 5 / 4; /* should be equal to sum of all 'low' fields in /proc/zoneinfo */\n-\n-      mem_available = (signed long)kb_main_free - watermark_low\n-      + kb_inactive_file + kb_active_file - MIN((kb_inactive_file + kb_active_file) / 2, watermark_low)\n-      + kb_slab_reclaimable - MIN(kb_slab_reclaimable / 2, watermark_low);\n-\n-      if (mem_available < 0) mem_available = 0;\n-      kb_main_available = (unsigned long)mem_available;\n-    }\n-#else\n-      kb_main_available = kb_main_free;\n-#endif /* linux */\n+      kb_main_available = kb_main_free + kb_page_cache + kb_main_buffers;\n   }\n }\n \n"
  },
  {
    "path": "packages/procps/procio.c.patch",
    "content": "diff -u -r ../procps-ng-3.3.14/procio.c ./procio.c\n--- ../procps-ng-3.3.14/procio.c\t2018-04-10 13:26:34.695269068 +0200\n+++ ./procio.c\t2018-05-19 03:03:48.858822656 +0200\n@@ -46,6 +46,7 @@\n static ssize_t proc_write(void *, const char *, size_t);\n static int proc_close(void *);\n \n+#ifndef __ANDROID__\n __extension__\n static cookie_io_functions_t procio = {\n     .read  = proc_read,\n@@ -53,9 +54,13 @@\n     .seek  = NULL,\n     .close = proc_close,\n };\n+#endif\n \n FILE *fprocopen(const char *path, const char *mode)\n {\n+#ifdef __ANDROID__\n+\treturn fopen(path, mode);\n+#else\n \tpcookie_t *cookie = NULL;\n \tFILE *handle = NULL;\n \tmode_t flags = 0;\n@@ -144,6 +149,7 @@\n \t}\n out:\n \treturn handle;\n+#endif\n }\n \n static\n"
  },
  {
    "path": "packages/procps/sysctl.c.patch",
    "content": "diff -u -r ../procps-ng-3.3.14/sysctl.c ./sysctl.c\n--- ../procps-ng-3.3.14/sysctl.c\t2018-03-12 01:59:52.530805100 +0000\n+++ ./sysctl.c\t2018-05-19 00:31:52.228321968 +0000\n@@ -29,7 +29,9 @@\n #include <dirent.h>\n #include <errno.h>\n #include <getopt.h>\n-#include <glob.h>\n+#ifndef __ANDROID__\n+# include <glob.h>\n+#endif\n #include <libgen.h>\n #include <limits.h>\n #include <regex.h>\n@@ -507,6 +509,9 @@\n  */\n static int Preload(const char *restrict const filename)\n {\n+#ifdef __ANDROID__\n+\treturn -1;\n+#else\n \tFILE *fp;\n \tchar *t;\n \tint n = 0;\n@@ -596,6 +601,7 @@\n \t}\n out:\n \treturn rc;\n+#endif\n }\n \n struct pair {\n"
  },
  {
    "path": "packages/procps/top-top.c.patch",
    "content": "Ignore Permission denied in several places.\n\nOn some Androids many of proc files can't actually be opened. So ignore\nwhen opening fails and go on.\n\ndiff -u -r ../procps-ng-3.3.14/top/top.c ./top/top.c\n--- ../procps-ng-3.3.14/top/top.c\t2018-03-03 07:11:55.698869268 +0000\n+++ ./top/top.c\t2018-05-19 00:20:58.203786150 +0000\n@@ -2558,7 +2558,7 @@\n       (sorry Linux, but you'll have to close it for us) */\n    if (!fp) {\n       if (!(fp = fopen(\"/proc/stat\", \"r\")))\n-         error_exit(fmtmk(N_fmt(FAIL_statopn_fmt), strerror(errno)));\n+         return;\n       /* note: we allocate one more CPU_t via totSLOT than 'cpus' so that a\n                slot can hold tics representing the /proc/stat cpu summary */\n       Cpu_tics = alloc_c(totSLOT * sizeof(CPU_t));\n@@ -4106,7 +4106,7 @@\n       tmptty.c_cc[VERASE] = *key_backspace;\n #ifdef TERMIOS_ONLY\n    if (-1 == tcsetattr(STDIN_FILENO, TCSAFLUSH, &tmptty))\n-      error_exit(fmtmk(N_fmt(FAIL_tty_set_fmt), strerror(errno)));\n+      {}\n    tcgetattr(STDIN_FILENO, &Tty_tweaked);\n #endif\n    // lastly, a nearly raw mode for unsolicited single keystrokes\n@@ -4114,7 +4114,7 @@\n    tmptty.c_cc[VMIN] = 1;\n    tmptty.c_cc[VTIME] = 0;\n    if (-1 == tcsetattr(STDIN_FILENO, TCSAFLUSH, &tmptty))\n-      error_exit(fmtmk(N_fmt(FAIL_tty_set_fmt), strerror(errno)));\n+      {}\n    tcgetattr(STDIN_FILENO, &Tty_raw);\n \n #ifndef OFF_STDIOLBF\n@@ -5444,7 +5444,7 @@\n \n       if (!Numa_node_tot) goto numa_nope;\n \n-      if (CHKw(w, View_CPUNOD)) {\n+      if (Cpu_tics && CHKw(w, View_CPUNOD)) {\n          if (Numa_node_sel < 0) {\n             // display the 1st /proc/stat line, then the nodes (if room)\n             summary_hlp(&Cpu_tics[smp_num_cpus], N_txt(WORD_allcpus_txt));\n@@ -5479,12 +5479,12 @@\n          }\n       } else\n numa_nope:\n-      if (CHKw(w, View_CPUSUM)) {\n+      if (Cpu_tics && CHKw(w, View_CPUSUM)) {\n          // display just the 1st /proc/stat line\n          summary_hlp(&Cpu_tics[Cpu_faux_tot], N_txt(WORD_allcpus_txt));\n          Msg_row += 1;\n \n-      } else {\n+      } else if (Cpu_tics) {\n          // display each cpu's states separately, screen height permitting...\n          for (i = 0; i < Cpu_faux_tot; i++) {\n             snprintf(tmp, sizeof(tmp), N_fmt(WORD_eachcpu_fmt), Cpu_tics[i].id);\n"
  },
  {
    "path": "packages/procps/w.c.patch",
    "content": "diff -u -r ../procps-ng-3.3.9/w.c ./w.c\n--- ../procps-ng-3.3.9/w.c\t2013-10-11 00:43:35.000000000 +0200\n+++ ./w.c\t2014-07-06 08:06:41.314880519 +0200\n@@ -186,13 +186,6 @@\n \n \tif (ip_addresses) { /* -i switch used */\n \t\tmemcpy(&ut_addr_v6, &u->ut_addr_v6, sizeof(ut_addr_v6));\n-\t\tif (IN6_IS_ADDR_V4MAPPED(&ut_addr_v6)) {\n-\t\t\t/* map back */\n-\t\t\tut_addr_v6[0] = ut_addr_v6[3];\n-\t\t\tut_addr_v6[1] = 0;\n-\t\t\tut_addr_v6[2] = 0;\n-\t\t\tut_addr_v6[3] = 0;\n-\t\t}\n \t\tif (ut_addr_v6[1] || ut_addr_v6[2] || ut_addr_v6[3]) {\n \t\t\t/* IPv6 */\n \t\t\tif (!inet_ntop(AF_INET6, &ut_addr_v6, buf_ipv6, sizeof(buf_ipv6))) {\n@@ -592,7 +585,7 @@\n \t\t\tprintf(_(\"   IDLE WHAT\\n\"));\n \t}\n \n-\tutmpname(UTMP_FILE);\n+\t// utmpname(UTMP_FILE);\n \tsetutent();\n \tif (user) {\n \t\tfor (;;) {\n"
  },
  {
    "path": "packages/profanity/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://profanity.im\nTERMUX_PKG_DESCRIPTION=\"Profanity is a console based XMPP client written in C using ncurses and libstrophe, inspired by Irssi\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_VERSION=0.7.1\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/profanity-im/profanity/releases/download/$TERMUX_PKG_VERSION/profanity-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3fe442948ff2ee258681c3812e878d39179dcf92e1c67bc8fe0ef8896440b05b\nTERMUX_PKG_DEPENDS=\"libandroid-support, libffi, ncurses, glib, libmesode, libcurl, readline, libuuid, libotr, gpgme, python, libassuan, libgpg-error, zlib, libsignal-protocol-c\"\nTERMUX_PKG_BREAKS=\"profanity-dev\"\nTERMUX_PKG_REPLACES=\"profanity-dev\"\n# openssl, libexpat needed by libmesode, pcre needed by glib:\nTERMUX_PKG_BUILD_DEPENDS=\"openssl, libexpat, pcre, libgcrypt, libcrypt\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\" --disable-python-plugins --without-xscreensaver\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -I$TERMUX_PREFIX/include/python3.8\"\n\tLDFLAGS+=\" -lpython3.8\"\n}\n\ntermux_step_post_configure() {\n\t# Enable python support manually, as trying to go using --enable-python-plugins\n\t# causes configure trying to execute python:\n\techo '#define HAVE_PYTHON 1' >> $TERMUX_PKG_SRCDIR/src/config.h\n\tperl -p -i -e 's|#am__objects_2|am__objects_2|' $TERMUX_PKG_SRCDIR/Makefile\n}\n"
  },
  {
    "path": "packages/profanity/cmd_funcs.c.patch",
    "content": "diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c\nindex f4b597c..b88092d 100644\n--- a/src/command/cmd_funcs.c\n+++ b/src/command/cmd_funcs.c\n@@ -46,7 +46,9 @@\n #include <sys/types.h>\n #include <fcntl.h>\n #include <unistd.h>\n+#ifndef __ANDROID__\n #include <langinfo.h>\n+#endif\n #include <ctype.h>\n \n #include \"profanity.h\"\n@@ -4746,7 +4748,11 @@ cmd_privileges(ProfWin *window, const char *const command, gchar **args)\n gboolean\n cmd_charset(ProfWin *window, const char *const command, gchar **args)\n {\n-    char *codeset = nl_langinfo(CODESET);\n+\t\t#if defined(__ANDROID__)\n+        char *codeset = \"UTF-8\";\n+\t\t#else\n+        char *codeset = nl_langinfo(CODESET);\n+\t\t#endif\n     char *lang = getenv(\"LANG\");\n \n     cons_show(\"Charset information:\");\n"
  },
  {
    "path": "packages/profanity/ui-inputwin.c.patch",
    "content": "diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c\nindex 9b4eddf..cf8c0b1 100644\n--- a/src/ui/inputwin.c\n+++ b/src/ui/inputwin.c\n@@ -39,6 +39,7 @@\n #include <string.h>\n #include <wchar.h>\n #include <sys/time.h>\n+#include <sys/select.h>\n #include <errno.h>\n \n #include <readline/readline.h>\n"
  },
  {
    "path": "packages/progress/Makefile.patch",
    "content": "--- progress/Makefile\t2019-09-06 19:43:06.150151728 +0800\n+++ progress_mod/Makefile\t2019-09-07 13:12:22.559267641 +0800\n@@ -12,6 +12,7 @@\n     $(error \"ncurses package not found\")\n     endif\n     override LDFLAGS += $(shell $(PKG_CONFIG) ncurses --libs)\n+    override CFLAGS += $(shell $(PKG_CONFIG) ncurses --cflags)\n endif\n ifeq ($(UNAME), Darwin)\n     override LDFLAGS += -lncurses\n"
  },
  {
    "path": "packages/progress/WithoutWordexp.patch",
    "content": "--- progress/progress.c\t2019-09-06 19:43:06.150151728 +0800\n+++ progress_mod/progress.c\t2019-09-08 10:27:05.529574702 +0800\n@@ -32,7 +32,20 @@\n #include <assert.h>\n #include <curses.h>\n \n-#include <wordexp.h>\n+/*\n+*#include <wordexp.h>\n+*Android without wordexp support\n+*/\n+typedef struct {\n+\tsize_t we_wordc;\n+\tchar **we_wordv;\n+\tsize_t we_offs;\n+} wordexp_t;\n+static inline int wordexp(const char *c, wordexp_t *w, int _i)\n+{\n+\treturn -1;\n+}\n+\n #include <getopt.h>\n \n #include <sys/ioctl.h>\n"
  },
  {
    "path": "packages/progress/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/Xfennec/progress\nTERMUX_PKG_DESCRIPTION=\"Linux tool to show progress for cp, mv, dd and more\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.14\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/Xfennec/progress/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=214a0d84b3ee5dde57ec9952ec9aa68ad9261fb336ef025324b344ed7ab48af1\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\n"
  },
  {
    "path": "packages/proot/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://proot-me.github.io/\nTERMUX_PKG_DESCRIPTION=\"Emulate chroot, bind mount and binfmt_misc for non-root users\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\n# Just bump commit and version when needed:\n_COMMIT=38042a5f60b5b6a2db68f18bd8b644748b530c8b\nTERMUX_PKG_VERSION=5.1.107\nTERMUX_PKG_REVISION=23\nTERMUX_PKG_SRCURL=https://github.com/termux/proot/archive/${_COMMIT}.zip\nTERMUX_PKG_SHA256=28820f7b903f5e7a15012f2c8499ba8e8acbe73afefee69f66854325d552c851\nTERMUX_PKG_DEPENDS=\"libtalloc\"\n\n# Install loader in libexec instead of extracting it every time\nexport PROOT_UNBUNDLE_LOADER=$TERMUX_PREFIX/libexec/proot\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -DARG_MAX=131072\"\n}\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR/src\n\tmake V=1\n\tmake install\n\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp $TERMUX_PKG_SRCDIR/doc/proot/man.1 $TERMUX_PREFIX/share/man/man1/proot.1\n\n\tcp $TERMUX_PKG_BUILDER_DIR/termux-chroot $TERMUX_PREFIX/bin/\n}\n"
  },
  {
    "path": "packages/proot/termux-chroot",
    "content": "#!/bin/sh\n\nSCRIPTNAME=termux-chroot\nshow_usage () {\n\techo \"Usage: $SCRIPTNAME [command]\"\n\techo \"termux-chroot: Setup a chroot to mimic a normal Linux file system\"\n\techo \"\"\n\techo \"Execute a command in a chroot with traditional file system hierarchy\"\n\techo \"(having e.g. the folders /bin, /etc and /usr) within Termux.\"\n\techo \"If run without argument, the default shell will be executed\"\n\texit 0\n}\n\nwhile getopts :h option\ndo\n\tcase \"$option\" in\n\t\th) show_usage;;\n\t\t?) echo \"$SCRIPTNAME: illegal option -$OPTARG\"; exit 1;\n\tesac\ndone\nshift $(($OPTIND-1))\n\n# For the /system/bin/linker(64) to be found:\nARGS=\"-b /system:/system\"\n\n# On some devices /vendor is required for termux packages to work correctly\n# See https://github.com/termux/proot/issues/2#issuecomment-303995382\nARGS=\"$ARGS -b /vendor:/vendor\"\n\n# Bind /data to include system folders such as /data/misc. Also $PREFIX\n# and $HOME so that Termux programs with hard-coded paths continue to work:\nARGS=\"$ARGS -b /data:/data\"\n\n\n# Bind Magisk binary directories so root works, closing per Issue #2100.\nif [ -d /sbin ] && [ -d /root ]; then\n\t# Both of these directories exist under Android even without Magisk installed,\n\t# The existence check is to ensure that it doesn't break if this changes.\n\tARGS=\"$ARGS -b /sbin:/sbin -b /root:/root\"\nfi\n\nif [ -f /property_contexts ]; then\n\t# Used by getprop (see https://github.com/termux/termux-packages/issues/1076)\n\t# but does not exist on Android 8.\n\tARGS=\"$ARGS -b /property_contexts:/property_contexts\"\nfi\n\n# Expose external and internal storage:\nif [ -d /storage ]; then\n\tARGS=\"$ARGS -b /storage:/storage\"\nfi\n\n# Mimic traditional Linux file system hierarchy - /usr:\nARGS=\"$ARGS -b $PREFIX:/usr\"\n\n# Mimic traditional Linux file system hierarchy - other Termux dirs:\nfor f in bin etc lib share tmp var; do\n\tARGS=\"$ARGS -b $PREFIX/$f:/$f\"\ndone\n\n# Mimic traditional Linux file system hierarchy- system dirs:\nfor f in dev proc; do\n\tARGS=\"$ARGS -b /$f:/$f\"\ndone\n\n# Set /home as current directory:\nARGS=\"$ARGS --cwd=/home\"\n\n# Root of the file system:\nARGS=\"$ARGS -r $PREFIX/..\"\n\n# Shell to execute:\nPROGRAM=/bin/bash\nif [ -x $HOME/.termux/shell ]; then\n\tPROGRAM=`readlink -f $HOME/.termux/shell`\nfi\n\nexport HOME=/home\n\n# Execute shell if no command has been supplied\nif [ -z \"$1\" ];then\n\tARGS=\"$ARGS $PROGRAM -l\"\n\texec $PREFIX/bin/proot $ARGS\nelse\n\t# When a command is executed directly instead of opening a shell run\n\t# the command in the current working directory instead of in /home\n\tARGS=\"$ARGS --cwd=.\"\n\t# Start supplied command with \"sh -c\" so things like these work:\n\t# termux-chroot \"make;make install\"\n\t# termux-chroot \"SOME_CONFIG=value ./configure\"\n\texec $PREFIX/bin/proot $ARGS sh -c \"$*\"\nfi\n"
  },
  {
    "path": "packages/proxychains-ng/Makefile.patch",
    "content": "diff -uNr proxychains-ng-4.13/Makefile proxychains-ng-4.13.mod/Makefile\n--- proxychains-ng-4.13/Makefile\t2018-06-25 02:26:05.000000000 +0300\n+++ proxychains-ng-4.13.mod/Makefile\t2019-03-05 19:35:28.924332422 +0200\n@@ -8,7 +8,7 @@\n exec_prefix = /usr/local\n bindir = $(exec_prefix)/bin\n \n-prefix = /usr/local/\n+prefix = @TERMUX_PREFIX@\n includedir = $(prefix)/include\n libdir = $(prefix)/lib\n sysconfdir=$(prefix)/etc\n@@ -25,7 +25,7 @@\n CFLAGS  += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe\n NO_AS_NEEDED = -Wl,--no-as-needed\n LIBDL   = -ldl\n-LDFLAGS = -fPIC $(NO_AS_NEEDED) $(LIBDL) -lpthread\n+LDFLAGS = -fPIC $(NO_AS_NEEDED) $(LIBDL)\n INC     = \n PIC     = -fPIC\n AR      = $(CROSS_COMPILE)ar\n"
  },
  {
    "path": "packages/proxychains-ng/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/rofl0r/proxychains-ng\nTERMUX_PKG_DESCRIPTION=\"A hook preloader that allows to redirect TCP traffic of existing dynamically linked programs through one or more SOCKS or HTTP proxies\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=4.14\nTERMUX_PKG_SRCURL=https://github.com/rofl0r/proxychains-ng/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=ab31626af7177cc2669433bb244b99a8f98c08031498233bb3df3bcc9711a9cc\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_post_make_install() {\n\t# Remove conf file from previous build, otherwise nothing will be done and it won't be included in the package\n\trm -f \"$TERMUX_PREFIX\"/etc/proxychains.conf\n\tmake install-config\n}\n"
  },
  {
    "path": "packages/proxychains-ng/hostreader.c.patch",
    "content": "diff -uNr proxychains-ng-4.13/src/hostsreader.c proxychains-ng-4.13.mod/src/hostsreader.c\n--- proxychains-ng-4.13/src/hostsreader.c\t2018-06-25 02:26:05.000000000 +0300\n+++ proxychains-ng-4.13.mod/src/hostsreader.c\t2019-03-05 19:34:06.360468021 +0200\n@@ -16,7 +16,11 @@\n };\n \n int hostsreader_open(struct hostsreader *ctx) {\n-\tif(!(ctx->f = fopen(\"/etc/hosts\", \"r\"))) return 0;\n+\tif(!(ctx->f = fopen(\"@TERMUX_PREFIX@/etc/hosts\", \"r\"))) {\n+\t\tif(!(ctx->f = fopen(\"/etc/hosts\", \"r\"))) {\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n \treturn 1;\n }\n \n"
  },
  {
    "path": "packages/proxychains-ng/libproxychains.c.patch",
    "content": "diff --git a/src/libproxychains.c b/src/libproxychains.c\nindex 7373d55..20bf993 100644\n--- a/src/libproxychains.c\n+++ b/src/libproxychains.c\n@@ -332,7 +332,7 @@ static int is_v4inv6(const struct in6_addr *a) {\n \treturn a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 &&\n \t       a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;\n }\n-int connect(int sock, const struct sockaddr *addr, unsigned int len) {\n+int connect(int sock, const struct sockaddr *addr, socklen_t len) {\n \tINIT();\n \tPFUNC();\n \n"
  },
  {
    "path": "packages/psmisc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://gitlab.com/psmisc/psmisc\nTERMUX_PKG_DESCRIPTION=\"Some small useful utilities that use the proc filesystem\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=23.3\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/psmisc-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=41750e1a5abf7ed2647b094f58127c73dbce6876f77ba4e0a7e0995ae5c7279a\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/pstree.x11\"\n"
  },
  {
    "path": "packages/psmisc/pstree.patch",
    "content": "Default to UTF-8 - may be overridden by command line flags.\n\ndiff -u -r ../psmisc-22.21/src/pstree.c ./src/pstree.c\n--- ../psmisc-22.21/src/pstree.c\t2014-02-02 06:59:07.000000000 +0100\n+++ ./src/pstree.c\t2014-06-30 18:35:12.064021186 +0200\n@@ -36,7 +36,9 @@\n #include <curses.h>\n #include <term.h>\n #include <termios.h>\n-#include <langinfo.h>\n+#ifndef __ANDROID__\n+# include <langinfo.h>\n+#endif\n #include <assert.h>\n #include <sys/types.h>\n #include <sys/stat.h>\n@@ -1087,6 +1089,10 @@\n      * command-line options, if given.\n      */\n \n+#ifdef __ANDROID__\n+    /* Droids love unicode */\n+    sym = &sym_utf;\n+#else\n     if (isatty(1) && !strcmp(nl_langinfo(CODESET), \"UTF-8\")) {\n         /* Use UTF-8 symbols if the locale's character set is UTF-8. */\n         sym = &sym_utf;\n@@ -1106,6 +1112,7 @@\n         /* Otherwise, fall back to ASCII. */\n         sym = &sym_ascii;\n     }\n+#endif\n \n #ifdef WITH_SELINUX\n     while ((c =\n"
  },
  {
    "path": "packages/psmisc/src-fuser.c.patch",
    "content": "diff -u -r ../psmisc-22.21/src/fuser.c ./src/fuser.c\n--- ../psmisc-22.21/src/fuser.c\t2014-01-31 14:07:32.000000000 +0100\n+++ ./src/fuser.c\t2017-06-28 16:09:52.947842253 +0200\n@@ -55,6 +55,10 @@\n #define MAXSYMLINKS SYMLINK_MAX\n #endif\n \n+#ifdef __ANDROID__\n+# include <sys/sysmacros.h> /* makedev() macro */\n+#endif\n+\n #include \"fuser.h\"\n #include \"signals.h\"\n #include \"i18n.h\"\n@@ -2085,7 +2089,7 @@\n \t\t\t\treturn (char *)0;\n \t\t\t}\n \n-\t\t\tdest = mempcpy(dest, start, end - start);\n+\t\t\tdest = ((char*) memcpy(dest, start, end - start)) + (end - start);\n \t\t\t*dest = '\\0';\n \n \t\t\tif (deep-- < 0) {\n"
  },
  {
    "path": "packages/pulseaudio/0001-atomic-Explicitly-cast-void-to-unsigned-long.patch",
    "content": "From e4450d8b586103ec1414e2d6245ff34a9096d97a Mon Sep 17 00:00:00 2001\nFrom: Peter Levine <plevine457@gmail.com>\nDate: Thu, 26 Sep 2019 07:24:40 +0000\nSubject: [PATCH] atomic: Explicitly cast void* to unsigned long\n\n\ndiff --git a/src/pulsecore/atomic.h b/src/pulsecore/atomic.h\nindex a82ca83c5..e5c140109 100644\n--- a/src/pulsecore/atomic.h\n+++ b/src/pulsecore/atomic.h\n@@ -117,7 +117,7 @@ static inline void* pa_atomic_ptr_load(const pa_atomic_ptr_t *a) {\n }\n \n static inline void pa_atomic_ptr_store(pa_atomic_ptr_t *a, void* p) {\n-    __atomic_store_n(&a->value, p, __ATOMIC_SEQ_CST);\n+    __atomic_store_n(&a->value, (unsigned long) p, __ATOMIC_SEQ_CST);\n }\n \n #else\n-- \n2.23.0\n\n"
  },
  {
    "path": "packages/pulseaudio/aaudio.patch",
    "content": "diff --git a/src/Makefile.am~ b/src/Makefile.am\nindex f4464d2..eebcf02 100644\n--- a/src/Makefile.am~\n+++ b/src/Makefile.am\n@@ -1495,6 +1495,12 @@ bin_SCRIPTS += utils/qpaeq\n endif\n endif\n \n+modlibexec_LTLIBRARIES += module-aaudio-sink.la\n+module_aaudio_sink_la_SOURCES = modules/aaudio/module-aaudio-sink.c\n+module_aaudio_sink_la_LDFLAGS = $(MODULE_LDFLAGS) -laaudio\n+module_aaudio_sink_la_LIBADD = $(MODULE_LIBADD)\n+module_aaudio_sink_la_CFLAGS = $(AM_CFLAGS) -DPA_MODULE_NAME=module_aaudio_sink\n+\n # Simple protocol\n \n module_simple_protocol_tcp_la_SOURCES = modules/module-protocol-stub.c\n"
  },
  {
    "path": "packages/pulseaudio/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/PulseAudio\nTERMUX_PKG_DESCRIPTION=\"A featureful, general-purpose sound server\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=13.0\nTERMUX_PKG_SHA256=961b23ca1acfd28f2bc87414c27bb40e12436efcf2158d29721b1e89f3f28057\nTERMUX_PKG_SRCURL=https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_DEPENDS=\"libltdl, libsndfile, libandroid-glob, libsoxr, speexdsp\"\nTERMUX_PKG_BREAKS=\"libpulseaudio-dev, libpulseaudio\"\nTERMUX_PKG_REPLACES=\"libpulseaudio-dev, libpulseaudio\"\nTERMUX_PKG_BUILD_DEPENDS=\"libtool\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-neon-opt\n--disable-alsa\n--disable-esound\n--disable-glib2\n--disable-x11\n--disable-gtk3\n--disable-openssl\n--without-caps\n--with-database=simple\n--disable-memfd\n--disable-gsettings\nax_cv_PTHREAD_PRIO_INHERIT=no\"\nTERMUX_PKG_CONFFILES=\"etc/pulse/client.conf etc/pulse/daemon.conf etc/pulse/default.pa etc/pulse/system.pa\"\n\ntermux_step_pre_configure() {\n\t# Our aaudio sink module needs libaaudio.so from a later android api version:\n\tlocal _NDK_ARCHNAME=$TERMUX_ARCH\n\tif [ \"$TERMUX_ARCH\" = \"aarch64\" ]; then\n\t\t_NDK_ARCHNAME=arm64\n\telif [ \"$TERMUX_ARCH\" = \"i686\" ]; then\n\t\t_NDK_ARCHNAME=x86\n\tfi\n\tmkdir $TERMUX_PKG_TMPDIR/libaaudio\n\tcp $NDK/platforms/android-26/arch-$_NDK_ARCHNAME/usr/lib*/libaaudio.so \\\n\t\t$TERMUX_PKG_TMPDIR/libaaudio/\n\tLDFLAGS+=\" -L$TERMUX_PKG_TMPDIR/libaaudio/\"\n\n\tmkdir $TERMUX_PKG_SRCDIR/src/modules/sles\n\tcp $TERMUX_PKG_BUILDER_DIR/module-sles-sink.c $TERMUX_PKG_SRCDIR/src/modules/sles\n\tcp $TERMUX_PKG_BUILDER_DIR/module-sles-source.c $TERMUX_PKG_SRCDIR/src/modules/sles\n\tmkdir $TERMUX_PKG_SRCDIR/src/modules/aaudio\n\tcp $TERMUX_PKG_BUILDER_DIR/module-aaudio-sink.c $TERMUX_PKG_SRCDIR/src/modules/aaudio\n\n\texport LIBS=\"-llog -landroid-glob\"\n}\n\ntermux_step_post_make_install() {\n\t# Some binaries link against these:\n\tcd $TERMUX_PREFIX/lib\n\tfor lib in pulseaudio/lib*.so* pulse-${TERMUX_PKG_VERSION}/modules/lib*.so*; do\n\t\tln -s -f $lib $(basename $lib)\n\tdone\n\n\t# Pulseaudio fails to start when it cannot detect any sound hardware\n\t# so disable hardware detection.\n\tsed -i $TERMUX_PREFIX/etc/pulse/default.pa \\\n\t\t-e '/^load-module module-detect$/s/^/#/'\n\techo \"load-module module-sles-sink\" >> $TERMUX_PREFIX/etc/pulse/default.pa\n\techo \"#load-module module-aaudio-sink\" >> $TERMUX_PREFIX/etc/pulse/default.pa\n}\n"
  },
  {
    "path": "packages/pulseaudio/fix-paths.patch",
    "content": "diff -uNr pulseaudio-12.2/src/Makefile.am pulseaudio-12.2.mod/src/Makefile.am\n--- pulseaudio-12.2/src/Makefile.am\t2018-07-16 17:40:33.000000000 +0300\n+++ pulseaudio-12.2.mod/src/Makefile.am\t2019-03-02 02:22:51.618146972 +0200\n@@ -1903,7 +1903,7 @@\n module_augment_properties_la_LDFLAGS = $(MODULE_LDFLAGS)\n module_augment_properties_la_LIBADD = $(MODULE_LIBADD)\n #module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\\\"$(datadir)/applications\\\"\n-module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\\\"/usr/share/applications\\\" -DPA_MODULE_NAME=module_augment_properties\n+module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\\\"@TERMUX_PREFIX@/share/applications\\\" -DPA_MODULE_NAME=module_augment_properties\n \n # Cork certain streams while others are active (e.g. cork music when phone streams appear)\n module_role_cork_la_SOURCES = modules/module-role-cork.c \\\ndiff -uNr pulseaudio-12.2/src/Makefile.in pulseaudio-12.2.mod/src/Makefile.in\n--- pulseaudio-12.2/src/Makefile.in\t2018-07-16 17:57:09.000000000 +0300\n+++ pulseaudio-12.2.mod/src/Makefile.in\t2019-03-02 02:22:31.711404512 +0200\n@@ -4708,7 +4708,7 @@\n module_augment_properties_la_LDFLAGS = $(MODULE_LDFLAGS)\n module_augment_properties_la_LIBADD = $(MODULE_LIBADD)\n #module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\\\"$(datadir)/applications\\\"\n-module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\\\"/usr/share/applications\\\" -DPA_MODULE_NAME=module_augment_properties\n+module_augment_properties_la_CFLAGS = $(AM_CFLAGS) -DDESKTOPFILEDIR=\\\"@TERMUX_PREFIX@/share/applications\\\" -DPA_MODULE_NAME=module_augment_properties\n \n # Cork certain streams while others are active (e.g. cork music when phone streams appear)\n module_role_cork_la_SOURCES = modules/module-role-cork.c \\\ndiff -uNr pulseaudio-12.2/src/modules/echo-cancel/module-echo-cancel.c pulseaudio-12.2.mod/src/modules/echo-cancel/module-echo-cancel.c\n--- pulseaudio-12.2/src/modules/echo-cancel/module-echo-cancel.c\t2018-07-16 17:40:33.000000000 +0300\n+++ pulseaudio-12.2.mod/src/modules/echo-cancel/module-echo-cancel.c\t2019-03-02 02:25:58.655526061 +0200\n@@ -2047,18 +2047,18 @@\n     }\n \n     if (u->save_aec) {\n-        pa_log(\"Creating AEC files in /tmp\");\n-        u->captured_file = fopen(\"/tmp/aec_rec.sw\", \"wb\");\n+        pa_log(\"Creating AEC files in @TERMUX_PREFIX@/tmp\");\n+        u->captured_file = fopen(\"@TERMUX_PREFIX@/tmp/aec_rec.sw\", \"wb\");\n         if (u->captured_file == NULL)\n             perror (\"fopen failed\");\n-        u->played_file = fopen(\"/tmp/aec_play.sw\", \"wb\");\n+        u->played_file = fopen(\"@TERMUX_PREFIX@/tmp/aec_play.sw\", \"wb\");\n         if (u->played_file == NULL)\n             perror (\"fopen failed\");\n-        u->canceled_file = fopen(\"/tmp/aec_out.sw\", \"wb\");\n+        u->canceled_file = fopen(\"@TERMUX_PREFIX@/tmp/aec_out.sw\", \"wb\");\n         if (u->canceled_file == NULL)\n             perror (\"fopen failed\");\n         if (u->ec->params.drift_compensation) {\n-            u->drift_file = fopen(\"/tmp/aec_drift.txt\", \"w\");\n+            u->drift_file = fopen(\"@TERMUX_PREFIX@/tmp/aec_drift.txt\", \"w\");\n             if (u->drift_file == NULL)\n                 perror (\"fopen failed\");\n         }\ndiff -uNr pulseaudio-12.2/src/modules/module-pipe-source.c pulseaudio-12.2.mod/src/modules/module-pipe-source.c\n--- pulseaudio-12.2/src/modules/module-pipe-source.c\t2018-07-14 18:53:48.000000000 +0300\n+++ pulseaudio-12.2.mod/src/modules/module-pipe-source.c\t2019-03-02 02:25:16.902033631 +0200\n@@ -59,7 +59,7 @@\n         \"channels=<number of channels> \"\n         \"channel_map=<channel map>\");\n \n-#define DEFAULT_FILE_NAME \"/tmp/music.input\"\n+#define DEFAULT_FILE_NAME \"@TERMUX_PREFIX@/tmp/music.input\"\n #define DEFAULT_SOURCE_NAME \"fifo_input\"\n \n struct userdata {\ndiff -uNr pulseaudio-12.2/src/modules/module-protocol-stub.c pulseaudio-12.2.mod/src/modules/module-protocol-stub.c\n--- pulseaudio-12.2/src/modules/module-protocol-stub.c\t2018-07-13 22:06:15.000000000 +0300\n+++ pulseaudio-12.2.mod/src/modules/module-protocol-stub.c\t2019-03-02 02:24:55.008616887 +0200\n@@ -301,9 +301,9 @@\n #  if defined(USE_PROTOCOL_ESOUND)\n \n #    if defined(USE_PER_USER_ESOUND_SOCKET)\n-    u->socket_path = pa_sprintf_malloc(\"/tmp/.esd-%lu/socket\", (unsigned long) getuid());\n+    u->socket_path = pa_sprintf_malloc(\"@TERMUX_PREFIX@/tmp/.esd-%lu/socket\", (unsigned long) getuid());\n #    else\n-    u->socket_path = pa_xstrdup(\"/tmp/.esd/socket\");\n+    u->socket_path = pa_xstrdup(\"@TERMUX_PREFIX@/tmp/.esd/socket\");\n #    endif\n \n     /* This socket doesn't reside in our own runtime dir but in\ndiff -uNr pulseaudio-12.2/src/pulsecore/core-util.c pulseaudio-12.2.mod/src/pulsecore/core-util.c\n--- pulseaudio-12.2/src/pulsecore/core-util.c\t2018-07-16 17:40:33.000000000 +0300\n+++ pulseaudio-12.2.mod/src/pulsecore/core-util.c\t2019-03-02 02:21:18.667793155 +0200\n@@ -1834,7 +1834,7 @@\n      * users, too. Since we need POSIX locking and UNIX sockets in\n      * this directory, we try XDG_RUNTIME_DIR first, and if that isn't\n      * set create a directory in $HOME and link it to a random subdir\n-     * in /tmp, if it was not explicitly configured. */\n+     * in @TERMUX_PREFIX@/tmp, if it was not explicitly configured. */\n \n     m = pa_in_system_mode() ? 0755U : 0700U;\n \n@@ -1907,7 +1907,7 @@\n \n #ifdef HAVE_SYMLINK\n             /* Hmm, so the runtime directory didn't exist yet, so let's\n-             * create one in /tmp and symlink that to it */\n+             * create one in @TERMUX_PREFIX@/tmp and symlink that to it */\n \n             if (make_random_dir_and_link(0700, k) < 0) {\n \n@@ -3120,8 +3120,8 @@\n     if ((f = pa_fopen_cloexec(PA_MACHINE_ID, \"r\")) ||\n         (f = pa_fopen_cloexec(PA_MACHINE_ID_FALLBACK, \"r\")) ||\n #if !defined(OS_IS_WIN32)\n-        (f = pa_fopen_cloexec(\"/etc/machine-id\", \"r\")) ||\n-        (f = pa_fopen_cloexec(\"/var/lib/dbus/machine-id\", \"r\"))\n+        (f = pa_fopen_cloexec(\"@TERMUX_PREFIX@/etc/machine-id\", \"r\")) ||\n+        (f = pa_fopen_cloexec(\"@TERMUX_PREFIX@/var/lib/dbus/machine-id\", \"r\"))\n #else\n         false\n #endif\n@@ -3468,7 +3468,7 @@\n         pa_is_path_absolute(t))\n         return t;\n \n-    return \"/tmp\";\n+    return \"@TERMUX_PREFIX@/tmp\";\n }\n \n int pa_open_cloexec(const char *fn, int flags, mode_t mode) {\ndiff -uNr pulseaudio-12.2/src/pulsecore/esound.h pulseaudio-12.2.mod/src/pulsecore/esound.h\n--- pulseaudio-12.2/src/pulsecore/esound.h\t2018-07-13 22:06:12.000000000 +0300\n+++ pulseaudio-12.2.mod/src/pulsecore/esound.h\t2019-03-02 02:24:34.161870804 +0200\n@@ -23,8 +23,8 @@\n /* Most of the following is blatantly stolen from esound. */\n \n /* path and name of the default EsounD domain socket */\n-#define ESD_UNIX_SOCKET_DIR     \"/tmp/.esd\"\n-#define ESD_UNIX_SOCKET_NAME    \"/tmp/.esd/socket\"\n+#define ESD_UNIX_SOCKET_DIR     \"@TERMUX_PREFIX@/tmp/.esd\"\n+#define ESD_UNIX_SOCKET_NAME    \"@TERMUX_PREFIX@/tmp/.esd/socket\"\n \n /* length of the audio buffer size */\n #define ESD_BUF_SIZE (4 * 1024)\ndiff -uNr pulseaudio-12.2/src/pulsecore/shm.c pulseaudio-12.2.mod/src/pulsecore/shm.c\n--- pulseaudio-12.2/src/pulsecore/shm.c\t2018-07-13 22:06:12.000000000 +0300\n+++ pulseaudio-12.2.mod/src/pulsecore/shm.c\t2019-03-02 02:28:09.806025965 +0200\n@@ -67,7 +67,7 @@\n /* On Linux we know that the shared memory blocks are files in\n  * /dev/shm. We can use that information to list all blocks and\n  * cleanup unused ones */\n-#define SHM_PATH \"/dev/shm/\"\n+#define SHM_PATH \"@TERMUX_PREFIX@/tmp/\"\n #define SHM_ID_LEN 10\n #elif defined(__sun)\n #define SHM_PATH \"/tmp\"\n"
  },
  {
    "path": "packages/pulseaudio/module-aaudio-sink.c",
    "content": "/***\n  This file is part of PulseAudio.\n\n  Copyright 2004-2008 Lennart Poettering\n\n  PulseAudio is free software; you can redistribute it and/or modify\n  it under the terms of the GNU Lesser General Public License as published\n  by the Free Software Foundation; either version 2.1 of the License,\n  or (at your option) any later version.\n\n  PulseAudio is distributed in the hope that it will be useful, but\n  WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n  General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public License\n  along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.\n***/\n\n#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <errno.h>\n#include <unistd.h>\n\n#include <pulse/rtclock.h>\n#include <pulse/timeval.h>\n#include <pulse/xmalloc.h>\n\n#include <pulsecore/i18n.h>\n#include <pulsecore/macro.h>\n#include <pulsecore/sink.h>\n#include <pulsecore/module.h>\n#include <pulsecore/core-util.h>\n#include <pulsecore/modargs.h>\n#include <pulsecore/log.h>\n#include <pulsecore/thread.h>\n#include <pulsecore/thread-mq.h>\n#include <pulsecore/rtpoll.h>\n\n#include <aaudio/AAudio.h>\n\nPA_MODULE_AUTHOR(\"Tom Yan\");\nPA_MODULE_DESCRIPTION(\"Android AAudio sink\");\nPA_MODULE_VERSION(PACKAGE_VERSION);\nPA_MODULE_LOAD_ONCE(false);\nPA_MODULE_USAGE(\n    \"sink_name=<name for the sink> \"\n    \"sink_properties=<properties for the sink> \"\n    \"rate=<sampling rate> \"\n    \"latency=<buffer length> \"\n    \"pm=<performance mode> \"\n    \"no_close_hack=<avoid segfault caused by AAudioStream_close()> \"\n);\n\n#define DEFAULT_SINK_NAME \"AAudio sink\"\n\nenum {\n    SINK_MESSAGE_RENDER = PA_SINK_MESSAGE_MAX,\n    SINK_MESSAGE_OPEN_STREAM\n};\n\nstruct userdata {\n    pa_core *core;\n    pa_module *module;\n    pa_sink *sink;\n\n    pa_thread *thread;\n    pa_thread_mq thread_mq;\n    pa_rtpoll *rtpoll;\n    pa_rtpoll_item *rtpoll_item;\n    pa_asyncmsgq *aaudio_msgq;\n\n    uint32_t rate;\n    uint32_t latency;\n    uint32_t pm;\n    bool no_close;\n\n    pa_memchunk memchunk;\n    size_t frame_size;\n\n    AAudioStreamBuilder *builder;\n    AAudioStream *stream;\n    pa_sample_spec ss;\n};\n\nstatic const char* const valid_modargs[] = {\n    \"sink_name\",\n    \"sink_properties\",\n    \"rate\",\n    \"latency\",\n    \"pm\",\n    \"no_close_hack\",\n    NULL\n};\n\nstatic int process_render(struct userdata *u, void *audioData, int64_t numFrames) {\n    pa_assert(u->sink->thread_info.state != PA_SINK_INIT);\n\n    /* a render message could be queued after a set state message */\n    if (!PA_SINK_IS_LINKED(u->sink->thread_info.state))\n        return AAUDIO_CALLBACK_RESULT_STOP;\n\n    u->memchunk.memblock = pa_memblock_new_fixed(u->core->mempool, audioData, u->frame_size * numFrames, false);\n    u->memchunk.length = pa_memblock_get_length(u->memchunk.memblock);\n    pa_sink_render_into_full(u->sink, &u->memchunk);\n    pa_memblock_unref_fixed(u->memchunk.memblock);\n\n    return AAUDIO_CALLBACK_RESULT_CONTINUE;\n}\n\nstatic aaudio_data_callback_result_t data_callback(AAudioStream *stream, void *userdata, void *audioData, int32_t numFrames) {\n    struct userdata* u = userdata;\n\n    pa_assert(u);\n\n    return pa_asyncmsgq_send(u->aaudio_msgq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_RENDER, audioData, numFrames, NULL);\n}\n\nstatic void error_callback(AAudioStream *stream, void *userdata, aaudio_result_t error) {\n    struct userdata* u = userdata;\n\n    pa_assert(u);\n\n    while (u->sink->state == PA_SINK_INIT);\n\n    if (error != AAUDIO_ERROR_DISCONNECTED)\n        pa_log_debug(\"AAudio error: %d\", error);\n\n    pa_sink_suspend(u->sink, true, PA_SUSPEND_UNAVAILABLE);\n    pa_sink_suspend(u->sink, false, PA_SUSPEND_UNAVAILABLE);\n}\n\n#define CHK(stmt) { \\\n    aaudio_result_t res = stmt; \\\n    if (res != AAUDIO_OK) { \\\n        fprintf(stderr, \"error %d at %s:%d\\n\", res, __FILE__, __LINE__); \\\n        goto fail; \\\n    } \\\n}\n\nstatic int pa_open_aaudio_stream(struct userdata *u)\n{\n    bool want_float;\n    aaudio_format_t format;\n    pa_sample_spec *ss = &u->ss;\n\n    CHK(AAudio_createStreamBuilder(&u->builder));\n    AAudioStreamBuilder_setPerformanceMode(u->builder, AAUDIO_PERFORMANCE_MODE_NONE + u->pm);\n    AAudioStreamBuilder_setDataCallback(u->builder, data_callback, u);\n    AAudioStreamBuilder_setErrorCallback(u->builder, error_callback, u);\n\n    want_float = ss->format > PA_SAMPLE_S16BE;\n    ss->format = want_float ? PA_SAMPLE_FLOAT32LE : PA_SAMPLE_S16LE;\n    format = want_float ? AAUDIO_FORMAT_PCM_FLOAT : AAUDIO_FORMAT_PCM_I16;\n    AAudioStreamBuilder_setFormat(u->builder, format);\n\n    if (u->rate)\n        AAudioStreamBuilder_setSampleRate(u->builder, u->rate);\n\n    AAudioStreamBuilder_setChannelCount(u->builder, ss->channels);\n\n    CHK(AAudioStreamBuilder_openStream(u->builder, &u->stream));\n    CHK(AAudioStreamBuilder_delete(u->builder));\n\n    ss->rate = AAudioStream_getSampleRate(u->stream);\n    u->frame_size = pa_frame_size(ss);\n\n    return 0;\n\nfail:\n    return -1;\n}\n\n#undef CHK\n\nstatic pa_usec_t get_latency(struct userdata *u) {\n    if(!u->latency) {\n        return PA_USEC_PER_SEC * AAudioStream_getBufferSizeInFrames(u->stream) / u->ss.rate / 2;\n    } else {\n        return PA_USEC_PER_MSEC * u->latency;\n    }\n}\n\nstatic int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *memchunk) {\n    struct userdata* u = PA_SINK(o)->userdata;\n\n    pa_assert(u);\n\n    switch (code) {\n        case SINK_MESSAGE_RENDER:\n            return process_render(u, data, offset);\n        case SINK_MESSAGE_OPEN_STREAM:\n            if (pa_open_aaudio_stream(u) < 0) {\n                pa_log(\"pa_open_aaudio_stream() failed.\");\n                return -1;\n            }\n            code = PA_SINK_MESSAGE_SET_FIXED_LATENCY;\n            offset = get_latency(u);\n            break;\n    }\n\n    return pa_sink_process_msg(o, code, data, offset, memchunk);\n};\n\nstatic int state_func_main(pa_sink *s, pa_sink_state_t state, pa_suspend_cause_t suspend_cause) {\n    struct userdata *u = s->userdata;\n    uint32_t idx;\n    pa_sink_input *i;\n    pa_idxset *inputs;\n\n    if (s->state == PA_SINK_SUSPENDED && PA_SINK_IS_OPENED(state)) {\n        if (pa_asyncmsgq_send(u->aaudio_msgq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_OPEN_STREAM, NULL, 0, NULL) < 0)\n            return -1;\n\n        inputs = pa_idxset_copy(s->inputs, NULL);\n        PA_IDXSET_FOREACH(i, inputs, idx) {\n            if (i->state == PA_SINK_INPUT_RUNNING) {\n                pa_sink_input_cork(i, true);\n            } else {\n                pa_idxset_remove_by_index(inputs, idx);\n            }\n        }\n\n        s->alternate_sample_rate = u->ss.rate;\n        pa_sink_reconfigure(s, &u->ss, false);\n        s->default_sample_rate = u->ss.rate;\n\n        /* Avoid infinite loop triggered if uncork in this case */\n        if (s->suspend_cause == PA_SUSPEND_IDLE)\n            pa_sink_suspend(u->sink, true, PA_SUSPEND_UNAVAILABLE);\n\n        PA_IDXSET_FOREACH(i, inputs, idx) pa_sink_input_cork(i, false);\n        pa_idxset_free(inputs, NULL);\n    }\n    return 0;\n}\n\nstatic int state_func_io(pa_sink *s, pa_sink_state_t state, pa_suspend_cause_t suspend_cause) {\n    struct userdata *u = s->userdata;\n\n    if (PA_SINK_IS_OPENED(s->thread_info.state) &&\n        (state == PA_SINK_SUSPENDED || state == PA_SINK_UNLINKED)) {\n        if (!u->no_close)\n            AAudioStream_close(u->stream);\n        else\n            AAudioStream_requestStop(u->stream);\n    } else if (s->thread_info.state == PA_SINK_SUSPENDED && PA_SINK_IS_OPENED(state)) {\n        if (AAudioStream_requestStart(u->stream) < 0)\n            pa_log(\"AAudioStream_requestStart() failed.\");\n    } else if (s->thread_info.state == PA_SINK_INIT && PA_SINK_IS_LINKED(state)) {\n        if (PA_SINK_IS_OPENED(state)) {\n            if (AAudioStream_requestStart(u->stream) < 0)\n                pa_log(\"AAudioStream_requestStart() failed.\");\n        } else {\n            if (!u->no_close)\n                AAudioStream_close(u->stream);\n        }\n    }\n    return 0;\n}\n\nstatic void reconfigure_func(pa_sink *s, pa_sample_spec *ss, bool passthrough) {\n    s->sample_spec.rate = ss->rate;\n}\n\nstatic void process_rewind(pa_sink *s) {\n    pa_sink_process_rewind(s, 0);\n}\n\nstatic void thread_func(void *userdata) {\n    struct userdata *u = userdata;\n\n    pa_assert(u);\n\n    pa_log_debug(\"Thread starting up\");\n    pa_thread_mq_install(&u->thread_mq);\n\n    for (;;) {\n        int ret;\n\n        if ((ret = pa_rtpoll_run(u->rtpoll)) < 0)\n            goto fail;\n\n        if (ret == 0)\n            goto finish;\n    }\n\nfail:\n    /* If this was no regular exit from the loop we have to continue\n     * processing messages until we received PA_MESSAGE_SHUTDOWN */\n    pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core), PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL);\n    pa_asyncmsgq_wait_for(u->thread_mq.inq, PA_MESSAGE_SHUTDOWN);\n\nfinish:\n    pa_log_debug(\"Thread shutting down\");\n}\n\nint pa__init(pa_module*m) {\n    struct userdata *u = NULL;\n    pa_channel_map map;\n    pa_modargs *ma = NULL;\n    pa_sink_new_data data;\n\n    pa_assert(m);\n\n    m->userdata = u = pa_xnew0(struct userdata, 1);\n\n    u->core = m->core;\n    u->module = m;\n    u->rtpoll = pa_rtpoll_new();\n\n    if (pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll) < 0) {\n        pa_log(\"pa_thread_mq_init() failed.\");\n        goto fail;\n    }\n\n    /* The queue linking the AudioTrack thread and our RT thread */\n    u->aaudio_msgq = pa_asyncmsgq_new(0);\n    if (!u->aaudio_msgq) {\n        pa_log(\"pa_asyncmsgq_new() failed.\");\n        goto fail;\n    }\n\n    /* The msgq from the AudioTrack RT thread should have an even higher\n     * priority than the normal message queues, to match the guarantee\n     * all other drivers make: supplying the audio device with data is\n     * the top priority -- and as long as that is possible we don't do\n     * anything else */\n    u->rtpoll_item = pa_rtpoll_item_new_asyncmsgq_read(u->rtpoll, PA_RTPOLL_EARLY-1, u->aaudio_msgq);\n\n    if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {\n        pa_log(\"Failed to parse module arguments.\");\n        goto fail;\n    }\n\n    u->ss = m->core->default_sample_spec;\n    map = m->core->default_channel_map;\n    pa_modargs_get_sample_rate(ma, &u->rate);\n\n    pa_modargs_get_value_u32(ma, \"latency\", &u->latency);\n\n    u->pm = AAUDIO_PERFORMANCE_MODE_LOW_LATENCY - AAUDIO_PERFORMANCE_MODE_NONE;\n    pa_modargs_get_value_u32(ma, \"pm\", &u->pm);\n\n    pa_modargs_get_value_boolean(ma, \"no_close_hack\", &u->no_close);\n\n    if (pa_open_aaudio_stream(u) < 0)\n        goto fail;\n\n    pa_sink_new_data_init(&data);\n    data.driver = __FILE__;\n    data.module = m;\n    pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, \"sink_name\", DEFAULT_SINK_NAME));\n    pa_sink_new_data_set_sample_spec(&data, &u->ss);\n    pa_sink_new_data_set_alternate_sample_rate(&data, u->ss.rate);\n    pa_sink_new_data_set_channel_map(&data, &map);\n    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, _(\"AAudio Output\"));\n    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, \"abstract\");\n\n    if (pa_modargs_get_proplist(ma, \"sink_properties\", data.proplist, PA_UPDATE_REPLACE) < 0) {\n        pa_log(\"Invalid properties\");\n        pa_sink_new_data_done(&data);\n        goto fail;\n    }\n\n    u->sink = pa_sink_new(m->core, &data, 0);\n    pa_sink_new_data_done(&data);\n\n    if (!u->sink) {\n        pa_log(\"Failed to create sink object.\");\n        goto fail;\n    }\n\n    u->sink->parent.process_msg = sink_process_msg;\n    u->sink->set_state_in_main_thread = state_func_main;\n    u->sink->set_state_in_io_thread = state_func_io;\n    u->sink->reconfigure = reconfigure_func;\n    u->sink->request_rewind = process_rewind;\n    u->sink->userdata = u;\n\n    pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);\n    pa_sink_set_rtpoll(u->sink, u->rtpoll);\n    pa_sink_set_fixed_latency(u->sink, get_latency(u));\n\n    if (!(u->thread = pa_thread_new(\"aaudio-sink\", thread_func, u))) {\n        pa_log(\"Failed to create thread.\");\n        goto fail;\n    }\n\n    pa_sink_put(u->sink);\n\n    pa_modargs_free(ma);\n\n    return 0;\n\nfail:\n    if (ma)\n        pa_modargs_free(ma);\n\n    pa__done(m);\n\n    return -1;\n}\n\nint pa__get_n_used(pa_module *m) {\n    struct userdata *u;\n\n    pa_assert(m);\n    pa_assert_se(u = m->userdata);\n\n    return pa_sink_linked_by(u->sink);\n}\n\nvoid pa__done(pa_module*m) {\n    struct userdata *u;\n\n    pa_assert(m);\n\n    if (!(u = m->userdata))\n        return;\n\n    if (u->sink)\n        pa_sink_unlink(u->sink);\n\n    if (u->thread) {\n        pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL);\n        pa_thread_free(u->thread);\n    }\n\n    pa_thread_mq_done(&u->thread_mq);\n\n    if (u->sink)\n        pa_sink_unref(u->sink);\n\n    if (u->rtpoll_item)\n        pa_rtpoll_item_free(u->rtpoll_item);\n\n    if (u->aaudio_msgq)\n        pa_asyncmsgq_unref(u->aaudio_msgq);\n\n    if (u->rtpoll)\n        pa_rtpoll_free(u->rtpoll);\n\n    pa_xfree(u);\n}\n"
  },
  {
    "path": "packages/pulseaudio/module-sles-sink.c",
    "content": "/***\n  This file is part of PulseAudio.\n\n  Copyright 2004-2008 Lennart Poettering\n\n  PulseAudio is free software; you can redistribute it and/or modify\n  it under the terms of the GNU Lesser General Public License as published\n  by the Free Software Foundation; either version 2.1 of the License,\n  or (at your option) any later version.\n\n  PulseAudio is distributed in the hope that it will be useful, but\n  WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n  General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public License\n  along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.\n***/\n\n#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <errno.h>\n#include <unistd.h>\n\n#include <pulse/rtclock.h>\n#include <pulse/timeval.h>\n#include <pulse/xmalloc.h>\n\n#include <pulsecore/i18n.h>\n#include <pulsecore/macro.h>\n#include <pulsecore/sink.h>\n#include <pulsecore/module.h>\n#include <pulsecore/core-util.h>\n#include <pulsecore/modargs.h>\n#include <pulsecore/log.h>\n#include <pulsecore/thread.h>\n#include <pulsecore/thread-mq.h>\n#include <pulsecore/rtpoll.h>\n\n#include <SLES/OpenSLES.h>\n#include <SLES/OpenSLES_Android.h>\n\nPA_MODULE_AUTHOR(\"Lennart Poettering, Nathan Martynov\");\nPA_MODULE_DESCRIPTION(\"Android OpenSL ES sink\");\nPA_MODULE_VERSION(PACKAGE_VERSION);\nPA_MODULE_LOAD_ONCE(false);\nPA_MODULE_USAGE(\n    \"sink_name=<name for the sink> \"\n    \"sink_properties=<properties for the sink> \"\n    \"rate=<sampling rate> \"\n    \"latency=<buffer length> \"\n);\n\n#define DEFAULT_SINK_NAME \"OpenSL ES sink\"\n#define BLOCK_USEC (PA_USEC_PER_MSEC * 125)\n\nenum {\n    SINK_MESSAGE_RENDER = PA_SINK_MESSAGE_MAX\n};\n\nstruct userdata {\n    pa_core *core;\n    pa_module *module;\n    pa_sink *sink;\n\n    pa_thread *thread;\n    pa_thread_mq thread_mq;\n    pa_rtpoll *rtpoll;\n    pa_rtpoll_item *rtpoll_item;\n    pa_asyncmsgq *sles_msgq;\n\n    pa_usec_t block_usec;\n\n    pa_memchunk memchunk;\n    void *buf;\n    size_t nbytes;\n\n    SLObjectItf engineObject;\n    SLObjectItf outputMixObject;\n    SLObjectItf bqPlayerObject;\n\n    SLEngineItf engineEngine;\n    SLPlayItf bqPlayerPlay;\n    SLBufferQueueItf bqPlayerBufferQueue;\n};\n\nstatic const char* const valid_modargs[] = {\n    \"sink_name\",\n    \"sink_properties\",\n    \"rate\",\n    \"latency\",\n    NULL\n};\n\nstatic void process_render(void *userdata) {\n    struct userdata* u = userdata;\n\n    pa_assert(u);\n\n    /* a render message could be queued after a set state message */\n    if (!PA_SINK_IS_LINKED(u->sink->thread_info.state))\n        return;\n\n    u->memchunk.length = u->nbytes;\n    pa_sink_render_into(u->sink, &u->memchunk);\n    (*u->bqPlayerBufferQueue)->Enqueue(u->bqPlayerBufferQueue, u->buf, u->memchunk.length);\n}\n\nstatic int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *memchunk) {\n    switch (code) {\n        case SINK_MESSAGE_RENDER:\n            process_render(data);\n            return 0;\n    }\n\n    return pa_sink_process_msg(o, code, data, offset, memchunk);\n};\n\nstatic void sles_callback(SLBufferQueueItf bqPlayerBufferQueue, void *userdata) {\n    struct userdata* u = userdata;\n\n    pa_assert(u);\n\n    pa_assert_se(pa_asyncmsgq_send(u->sles_msgq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_RENDER, u, 0, NULL) == 0);\n}\n\n#define CHK(stmt) { \\\n    SLresult res = stmt; \\\n    if (res != SL_RESULT_SUCCESS) { \\\n        fprintf(stderr, \"error %d at %s:%d\\n\", res, __FILE__, __LINE__); \\\n        goto fail; \\\n    } \\\n}\n\nstatic int pa_init_sles_player(struct userdata *u, pa_sample_spec *ss) {\n    CHK(slCreateEngine(&(u->engineObject), 0, NULL, 0, NULL, NULL));\n    CHK((*u->engineObject)->Realize(u->engineObject, SL_BOOLEAN_FALSE));\n\n    CHK((*u->engineObject)->GetInterface(u->engineObject, SL_IID_ENGINE, &(u->engineEngine)));\n\n    CHK((*u->engineEngine)->CreateOutputMix(u->engineEngine, &(u->outputMixObject), 0, NULL, NULL));\n    CHK((*u->outputMixObject)->Realize(u->outputMixObject, SL_BOOLEAN_FALSE));\n\n    SLDataLocator_BufferQueue locator_bufferqueue;\n    locator_bufferqueue.locatorType = SL_DATALOCATOR_BUFFERQUEUE;\n    locator_bufferqueue.numBuffers = 8;\n\n    SLAndroidDataFormat_PCM_EX pcm;\n    if (ss->format == PA_SAMPLE_FLOAT32LE) {\n        pcm.formatType = SL_ANDROID_DATAFORMAT_PCM_EX;\n        pcm.representation = SL_ANDROID_PCM_REPRESENTATION_FLOAT;\n    } else {\n        pcm.formatType = SL_DATAFORMAT_PCM;\n    }\n    pcm.numChannels = ss->channels;\n    pcm.sampleRate = ss->rate * 1000;\n    pcm.bitsPerSample = pcm.containerSize = pa_sample_size(ss) * 8;\n    pcm.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;\n    pcm.endianness = SL_BYTEORDER_LITTLEENDIAN;\n\n    SLDataSource audiosrc;\n    audiosrc.pLocator = &locator_bufferqueue;\n    audiosrc.pFormat = &pcm;\n\n    SLDataLocator_OutputMix locator_outputmix;\n    locator_outputmix.locatorType = SL_DATALOCATOR_OUTPUTMIX;\n    locator_outputmix.outputMix = u->outputMixObject;\n\n    SLDataSink audiosnk;\n    audiosnk.pLocator = &locator_outputmix;\n    audiosnk.pFormat = NULL;\n\n    SLInterfaceID ids[1] = {SL_IID_BUFFERQUEUE};\n    SLboolean flags[1] = {SL_BOOLEAN_TRUE};\n\n    CHK((*u->engineEngine)->CreateAudioPlayer(u->engineEngine, &u->bqPlayerObject, &audiosrc, &audiosnk, 1, ids, flags));\n    CHK((*u->bqPlayerObject)->Realize(u->bqPlayerObject, SL_BOOLEAN_FALSE));\n\n    CHK((*u->bqPlayerObject)->GetInterface(u->bqPlayerObject, SL_IID_PLAY, &u->bqPlayerPlay));\n\n    CHK((*u->bqPlayerObject)->GetInterface(u->bqPlayerObject, SL_IID_BUFFERQUEUE, &u->bqPlayerBufferQueue));\n    CHK((*u->bqPlayerBufferQueue)->RegisterCallback(u->bqPlayerBufferQueue, sles_callback, u));\n\n    return 0;\n\nfail:\n    return -1;\n}\n\n#undef CHK\n\nstatic void thread_func(void *userdata) {\n    struct userdata *u = userdata;\n\n    pa_assert(u);\n\n    pa_log_debug(\"Thread starting up\");\n    pa_thread_mq_install(&u->thread_mq);\n\n    for (;;) {\n        int ret;\n\n        if ((ret = pa_rtpoll_run(u->rtpoll)) < 0)\n            goto fail;\n\n        if (ret == 0)\n            goto finish;\n    }\n\nfail:\n    /* If this was no regular exit from the loop we have to continue\n     * processing messages until we received PA_MESSAGE_SHUTDOWN */\n    pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core), PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL);\n    pa_asyncmsgq_wait_for(u->thread_mq.inq, PA_MESSAGE_SHUTDOWN);\n\nfinish:\n    pa_log_debug(\"Thread shutting down\");\n}\n\nstatic int state_func(pa_sink *s, pa_sink_state_t state, pa_suspend_cause_t suspend_cause) {\n    struct userdata *u = s->userdata;\n\n    if (PA_SINK_IS_OPENED(s->state) &&\n        (state == PA_SINK_SUSPENDED || state == PA_SINK_UNLINKED))\n        (*u->bqPlayerPlay)->SetPlayState(u->bqPlayerPlay, SL_PLAYSTATE_STOPPED);\n    else if ((s->state == PA_SINK_SUSPENDED || s->state == PA_SINK_INIT) &&\n             PA_SINK_IS_OPENED(state))\n        (*u->bqPlayerPlay)->SetPlayState(u->bqPlayerPlay, SL_PLAYSTATE_PLAYING);\n    return 0;\n}\n\nstatic void process_rewind(pa_sink *s) {\n    pa_sink_process_rewind(s, 0);\n}\n\nint pa__init(pa_module*m) {\n    struct userdata *u = NULL;\n    pa_sample_spec ss;\n    pa_channel_map map;\n    pa_modargs *ma = NULL;\n    pa_sink_new_data data;\n    uint32_t latency = 0;\n\n    pa_assert(m);\n\n    m->userdata = u = pa_xnew0(struct userdata, 1);\n\n    u->core = m->core;\n    u->module = m;\n    u->rtpoll = pa_rtpoll_new();\n\n    if (pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll) < 0) {\n        pa_log(\"pa_thread_mq_init() failed.\");\n        goto fail;\n    }\n\n    /* The queue linking the AudioTrack thread and our RT thread */\n    u->sles_msgq = pa_asyncmsgq_new(0);\n    if (!u->sles_msgq) {\n        pa_log(\"pa_asyncmsgq_new() failed.\");\n        goto fail;\n    }\n\n    /* The msgq from the AudioTrack RT thread should have an even higher\n     * priority than the normal message queues, to match the guarantee\n     * all other drivers make: supplying the audio device with data is\n     * the top priority -- and as long as that is possible we don't do\n     * anything else */\n    u->rtpoll_item = pa_rtpoll_item_new_asyncmsgq_read(u->rtpoll, PA_RTPOLL_EARLY-1, u->sles_msgq);\n\n    if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {\n        pa_log(\"Failed to parse module arguments.\");\n        goto fail;\n    }\n\n    ss = m->core->default_sample_spec;\n    pa_channel_map_init_stereo(&map);\n\n    switch (ss.format) {\n    case PA_SAMPLE_S16LE:\n    case PA_SAMPLE_S24LE:\n    case PA_SAMPLE_S32LE:\n    case PA_SAMPLE_FLOAT32LE:\n        break;\n    default:\n        pa_log(\"Sample format not supported\");\n        goto fail;\n    }\n    pa_modargs_get_sample_rate(ma, &ss.rate);\n    ss.channels = map.channels;\n\n    if (pa_init_sles_player(u, &ss) < 0)\n        goto fail;\n\n    pa_sink_new_data_init(&data);\n    data.driver = __FILE__;\n    data.module = m;\n    pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, \"sink_name\", DEFAULT_SINK_NAME));\n    pa_sink_new_data_set_sample_spec(&data, &ss);\n    pa_sink_new_data_set_channel_map(&data, &map);\n    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, _(\"OpenSL ES Output\"));\n    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, \"abstract\");\n\n    if (pa_modargs_get_proplist(ma, \"sink_properties\", data.proplist, PA_UPDATE_REPLACE) < 0) {\n        pa_log(\"Invalid properties\");\n        pa_sink_new_data_done(&data);\n        goto fail;\n    }\n\n    u->sink = pa_sink_new(m->core, &data, 0);\n    pa_sink_new_data_done(&data);\n\n    if (!u->sink) {\n        pa_log(\"Failed to create sink object.\");\n        goto fail;\n    }\n\n    u->sink->parent.process_msg = sink_process_msg;\n    u->sink->set_state_in_main_thread = state_func;\n    u->sink->request_rewind = process_rewind;\n    u->sink->userdata = u;\n\n    pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);\n    pa_sink_set_rtpoll(u->sink, u->rtpoll);\n\n    pa_modargs_get_value_u32(ma, \"latency\", &latency);\n    if (latency)\n        u->block_usec = latency * PA_USEC_PER_MSEC;\n    else\n        u->block_usec = BLOCK_USEC;\n    pa_sink_set_fixed_latency(u->sink, u->block_usec);\n\n    u->nbytes = pa_usec_to_bytes(u->block_usec, &u->sink->sample_spec);\n    u->buf = calloc(1, u->nbytes);\n    u->memchunk.memblock = pa_memblock_new_fixed(m->core->mempool, u->buf, u->nbytes, false);\n\n    if (!(u->thread = pa_thread_new(\"sles-sink\", thread_func, u))) {\n        pa_log(\"Failed to create thread.\");\n        goto fail;\n    }\n\n    pa_sink_put(u->sink);\n    sles_callback(u->bqPlayerBufferQueue, u);\n\n    pa_modargs_free(ma);\n\n    return 0;\n\nfail:\n    if (ma)\n        pa_modargs_free(ma);\n\n    pa__done(m);\n\n    return -1;\n}\n\nint pa__get_n_used(pa_module *m) {\n    struct userdata *u;\n\n    pa_assert(m);\n    pa_assert_se(u = m->userdata);\n\n    return pa_sink_linked_by(u->sink);\n}\n\n#define DESTROY(object) if (u->object) (*u->object)->Destroy(u->object);\n\nvoid pa__done(pa_module*m) {\n    struct userdata *u;\n\n    pa_assert(m);\n\n    if (!(u = m->userdata))\n        return;\n\n    if (u->sink)\n        pa_sink_unlink(u->sink);\n\n    DESTROY(bqPlayerObject);\n    DESTROY(outputMixObject);\n    DESTROY(engineObject);\n\n    pa_memblock_unref_fixed(u->memchunk.memblock);\n    free(u->buf);\n\n    if (u->thread) {\n        pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL);\n        pa_thread_free(u->thread);\n    }\n\n    pa_thread_mq_done(&u->thread_mq);\n\n    if (u->sink)\n        pa_sink_unref(u->sink);\n\n    if (u->rtpoll_item)\n        pa_rtpoll_item_free(u->rtpoll_item);\n\n    if (u->sles_msgq)\n        pa_asyncmsgq_unref(u->sles_msgq);\n\n    if (u->rtpoll)\n        pa_rtpoll_free(u->rtpoll);\n\n    pa_xfree(u);\n}\n\n#undef DESTROY\n"
  },
  {
    "path": "packages/pulseaudio/module-sles-source.c",
    "content": "/***\n  This file is part of PulseAudio.\n\n  Copyright 2008 Lennart Poettering\n\n  PulseAudio is free software; you can redistribute it and/or modify\n  it under the terms of the GNU Lesser General Public License as published\n  by the Free Software Foundation; either version 2.1 of the License,\n  or (at your option) any later version.\n\n  PulseAudio is distributed in the hope that it will be useful, but\n  WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n  General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public License\n  along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.\n***/\n\n#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <errno.h>\n#include <unistd.h>\n\n#include <pulse/rtclock.h>\n#include <pulse/timeval.h>\n#include <pulse/xmalloc.h>\n\n#include <pulsecore/source.h>\n#include <pulsecore/module.h>\n#include <pulsecore/core-util.h>\n#include <pulsecore/modargs.h>\n#include <pulsecore/log.h>\n#include <pulsecore/thread.h>\n#include <pulsecore/thread-mq.h>\n#include <pulsecore/rtpoll.h>\n#include <SLES/OpenSLES.h>\n#include <SLES/OpenSLES_Android.h>\n#include <SLES/OpenSLES_AndroidConfiguration.h>\n\n\nPA_MODULE_AUTHOR(\"Lennart Poettering\");\nPA_MODULE_DESCRIPTION(\"Android OpenSL ES source\");\nPA_MODULE_VERSION(PACKAGE_VERSION);\nPA_MODULE_LOAD_ONCE(false);\nPA_MODULE_USAGE(\n        \"source_name=<name for the source> \"\n        \"source_properties=<properties for the source> \"\n        \"rate=<sample rate> \"\n\t\"channel_map=<channel map>\"\n\t\"latency=<buffer length>\"\n\n);\n#define CHK(stmt) { \\\n    SLresult res = stmt; \\\n    if (res != SL_RESULT_SUCCESS) { \\\n        fprintf(stderr, \"error %d at %s:%d\\n\", res, __FILE__, __LINE__); \\\n        goto fail; \\\n    } \\\n}\n\n#define DEFAULT_SOURCE_NAME \"OpenSL ES source\"\n#define BLOCK_USEC (PA_USEC_PER_MSEC * 125)\n\nenum {\n\t    SOURCE_MESSAGE_RENDER = PA_SOURCE_MESSAGE_MAX\n};                                \n\nstruct userdata {\n    pa_core *core;\n    pa_module *module;\n    pa_source *source;\n    pa_thread *thread;\n    pa_thread_mq thread_mq;\n    pa_rtpoll *rtpoll;\n    pa_rtpoll_item *rtpoll_item;\n\n    pa_memchunk memchunk;\n    \n    pa_usec_t block_usec; /* how much to push at once */\n    pa_usec_t timestamp;  /* when to push next */\n    SLObjectItf engineObject;\n    SLObjectItf RecorderObject;\n    SLEngineItf EngineItf;\n    SLRecordItf recordItf;\n    SLAndroidSimpleBufferQueueItf recBuffQueueItf; \n    pa_asyncmsgq *sles_msgq;\n    void *buf;\n    size_t nbytes;\n};\n\nstatic const char* const valid_modargs[] = {\n    \"source_name\",\n    \"source_properties\",\n    \"rate\",\n    \"latency\",\n    NULL\n};\nstatic void thread_func(void *userdata) {\n    struct userdata *u = userdata;\n\n    pa_assert(u);\n\n    pa_log_debug(\"Thread starting up\");\n    pa_thread_mq_install(&u->thread_mq);\n\n    for (;;) {\n        int ret;\n\n        if ((ret = pa_rtpoll_run(u->rtpoll)) < 0)\n            goto fail;\n\n        if (ret == 0)                                                                                                                                                                                               goto finish;\n    }\n\nfail:\n    /* If this was no regular exit from the loop we have to continue\n     * processing messages until we received PA_MESSAGE_SHUTDOWN */\n    pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->core), PA_CORE_MESSAGE_UNLOAD_MODULE, u->module, 0, NULL, NULL);\n    pa_asyncmsgq_wait_for(u->thread_mq.inq, PA_MESSAGE_SHUTDOWN);\n\nfinish:\n    pa_log_debug(\"Thread shutting down\");\n}\n\nstatic int state_func(pa_source *s, pa_source_state_t state, pa_suspend_cause_t suspend_cause) {\n    struct userdata *u = s->userdata;\n    if (PA_SOURCE_IS_OPENED(s->state) &&\n        (state == PA_SOURCE_SUSPENDED || state == PA_SOURCE_UNLINKED))\n\t(*u->recordItf)->SetRecordState(u->recordItf, SL_RECORDSTATE_STOPPED);\n    else if ((s->state == PA_SOURCE_SUSPENDED || s->state == PA_SOURCE_INIT) &&\n             PA_SOURCE_IS_OPENED(state))\n    \t(*u->recordItf)->SetRecordState(u->recordItf, SL_RECORDSTATE_RECORDING);\n    return 0;\n}\nstatic void process_render(void *userdata) {\n    struct userdata* u = userdata;\n    pa_assert(u);\n    (*u->recordItf)->SetRecordState(u->recordItf, SL_RECORDSTATE_RECORDING);\n    if (!PA_SOURCE_IS_LINKED(u->source->thread_info.state))\n        return;\n\n    u->memchunk.length = u->nbytes;\n\t(*u->recBuffQueueItf)->Enqueue(u->recBuffQueueItf, u->buf, u->memchunk.length);\n\tpa_source_post(u->source, &u->memchunk);\n}\n\nstatic int source_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *memchunk) {\n    switch (code) {\n        case SOURCE_MESSAGE_RENDER:\n            process_render(data);\n            return 0;                                                                                                                                                                                       }\n                                                                                                                                                                                                            return pa_source_process_msg(o, code, data, offset, memchunk);\n};\n\n\n\nstatic void sles_callback(SLAndroidSimpleBufferQueueItf recBuffQueueItf , void *userdata) {\n    struct userdata* u = userdata;\n    pa_assert(u);\n    pa_assert_se(pa_asyncmsgq_send(u->sles_msgq, PA_MSGOBJECT(u->source), SOURCE_MESSAGE_RENDER, u, 0, NULL) == 0); \n}\n\n\nstatic int pa_init_sles_record(struct userdata *u, pa_sample_spec *ss) {\n    pa_assert(u); \n    SLboolean\t required[2];\n    SLInterfaceID  iidArray[2];\n   \n    required[0] = SL_BOOLEAN_FALSE;\n    iidArray[0] = SL_IID_ANDROIDSIMPLEBUFFERQUEUE;\n    required[1] = SL_BOOLEAN_FALSE;\n    iidArray[1] = SL_IID_ANDROIDCONFIGURATION;\n\n    SLAndroidConfigurationItf configItf;    \n    SLDataSource           recSource;\n    SLDataLocator_IODevice ioDevice = {SL_DATALOCATOR_IODEVICE,\n    SL_IODEVICE_AUDIOINPUT,\n    SL_DEFAULTDEVICEID_AUDIOINPUT, NULL};\n    SLDataSink                recDest;\n    SLDataLocator_AndroidSimpleBufferQueue recBuffQueue;\n    \n    ioDevice.locatorType = SL_DATALOCATOR_IODEVICE; \n    ioDevice.deviceType = SL_IODEVICE_AUDIOINPUT; \n    ioDevice.deviceID = SL_DEFAULTDEVICEID_AUDIOINPUT;\n    ioDevice.device = NULL;\n    recSource.pLocator = (void *) &ioDevice; \n    recBuffQueue.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE;\n    recBuffQueue.numBuffers = 8; \n    SLAndroidDataFormat_PCM_EX pcm;\n    \n    if (ss->format == PA_SAMPLE_FLOAT32LE) {\n        pcm.formatType = SL_ANDROID_DATAFORMAT_PCM_EX;\n        pcm.representation = SL_ANDROID_PCM_REPRESENTATION_FLOAT;\n    } else {\n        pcm.formatType = SL_DATAFORMAT_PCM;\n    }\n    \n    pcm.numChannels = ss->channels;\n    pcm.sampleRate = ss->rate * 1000;\n    pcm.bitsPerSample = pcm.containerSize = pa_sample_size(ss) * 8;\n    pcm.channelMask = SL_SPEAKER_FRONT_LEFT;\n    pcm.endianness = SL_BYTEORDER_LITTLEENDIAN; \n    \n    recDest.pLocator = (void *) &recBuffQueue; \n    recDest.pFormat = (void * ) &pcm;\n    \n    CHK(slCreateEngine( &u->engineObject, 0, NULL, 0, NULL, NULL));\n    CHK((*u->engineObject)->Realize(u->engineObject, SL_BOOLEAN_FALSE)); \n    CHK((*u->engineObject)->GetInterface(u->engineObject, SL_IID_ENGINE, (void*)&u->EngineItf));\n    CHK((*u->EngineItf)->CreateAudioRecorder(u->EngineItf, &u->RecorderObject, &recSource, &recDest,\n\t\t    2, iidArray, required));\n    CHK((*u->engineObject)->GetInterface(u->RecorderObject, SL_IID_ANDROIDCONFIGURATION, (void*)&configItf));\n    SLuint32 presetValue = SL_ANDROID_RECORDING_PRESET_CAMCORDER;\n    CHK((*configItf)->SetConfiguration(configItf, SL_ANDROID_KEY_RECORDING_PRESET,\n\t\t    &presetValue, sizeof(SLuint32)));\n\n    presetValue = SL_ANDROID_RECORDING_PRESET_NONE; \n    SLuint32 presetSize = 2*sizeof(SLuint32); // intentionally too big       \n    CHK((*configItf)->GetConfiguration(configItf, SL_ANDROID_KEY_RECORDING_PRESET,\n\t\t    &presetSize, (void*)&presetValue)); \nif (presetValue != SL_ANDROID_RECORDING_PRESET_CAMCORDER) {\n\tfprintf(stderr, \"Error retrieved recording preset\\n\");\n}\n\n    CHK((*u->engineObject)->Realize(u->RecorderObject, SL_BOOLEAN_FALSE)); \n    CHK((*u->RecorderObject)->GetInterface(u->RecorderObject, SL_IID_RECORD, (void*)&u->recordItf));\n    CHK((*u->RecorderObject)->GetInterface(u->RecorderObject, SL_IID_ANDROIDSIMPLEBUFFERQUEUE,  \n\t\t(void*)&u->recBuffQueueItf));\n    CHK((*u->recBuffQueueItf)->RegisterCallback(u->recBuffQueueItf, sles_callback, u));\n    \n     return 0;\n\nfail:\n     return -1;\n}\n\n\nint pa__init(pa_module*m) {\n    struct userdata *u = NULL;\n    pa_modargs *ma;\n    pa_source_new_data data;\n    pa_sample_spec ss;\n    uint32_t latency = 0;\n    pa_assert(m);\n    m->userdata = u = pa_xnew0(struct userdata, 1);\n    if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {\n        pa_log(\"failed to parse module arguments.\");\n        goto fail;\n    }\n    ss = m->core->default_sample_spec;\n\n    switch (ss.format) {\n    case PA_SAMPLE_S16LE:\n    case PA_SAMPLE_S24LE:\n    case PA_SAMPLE_S32LE:\n    case PA_SAMPLE_FLOAT32LE:\n        break;\n    default:\n        pa_log(\"Sample format not supported\");\n        goto fail;\n    }\n\tss.channels = 1;\n\n    if (pa_modargs_get_sample_rate(ma, &ss.rate) < 0) {\n        pa_log(\"Invalid rate specification\");\n        goto fail;\n    }\n\n    u->core = m->core;\n    u->module = m;\n    u->rtpoll = pa_rtpoll_new();\n\n\n    if (pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll) < 0) {\n        pa_log(\"pa_thread_mq_init() failed.\");\n        goto fail;\n    }\n    \n    u->sles_msgq = pa_asyncmsgq_new(0);\n    if (!u->sles_msgq) {\n        pa_log(\"pa_asyncmsgq_new() failed.\");\n        goto fail;\n    }\n\tu->rtpoll_item = pa_rtpoll_item_new_asyncmsgq_read(u->rtpoll, PA_RTPOLL_EARLY-1, u->sles_msgq);\n\t\n    pa_source_new_data_init(&data);\n    data.driver = __FILE__;\n    data.module = m;\n    pa_source_new_data_set_name(&data, pa_modargs_get_value(ma, \"source_name\", DEFAULT_SOURCE_NAME));\n    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, _(\"OpenSL ES Input\"));\n    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, \"abstract\");\n    \n    pa_source_new_data_set_sample_spec(&data, &ss);\n\n    if (pa_modargs_get_proplist(ma, \"source_properties\", data.proplist, PA_UPDATE_REPLACE) < 0) {\n        pa_log(\"Invalid properties\");\n        pa_source_new_data_done(&data);\n        goto fail;\n    }\n\t\n    u->source = pa_source_new(m->core, &data, PA_SOURCE_LATENCY);\n    pa_source_new_data_done(&data);\n\n    if (!u->source) {\n        pa_log(\"Failed to create source.\");\n        goto fail;\n    }\n\n    u->source->parent.process_msg = source_process_msg;\n    u->source->set_state_in_main_thread = state_func;\n    u->source->userdata = u;\n\n    u->block_usec = BLOCK_USEC;\n\n    pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);\n    pa_source_set_rtpoll(u->source, u->rtpoll);\n\n    pa_modargs_get_value_u32(ma, \"latency\", &latency);\n    if (latency)\n        u->block_usec = latency * PA_USEC_PER_MSEC;\n    else\n        u->block_usec = BLOCK_USEC;\n    pa_source_set_fixed_latency(u->source, u->block_usec);\n\n    u->nbytes = pa_usec_to_bytes(u->block_usec, &u->source->sample_spec);\n    u->buf = calloc(8, u->nbytes);\n    u->memchunk.memblock = pa_memblock_new_fixed(m->core->mempool, u->buf, u->nbytes, false);\n    if (pa_init_sles_record(u, &ss) < 0)\n\tgoto fail;         \n    if (!(u->thread = pa_thread_new(\"sles_source\", thread_func, u))) {\n        pa_log(\"Failed to create thread.\");\n        goto fail;\n    }\n    pa_source_put(u->source);\n    sles_callback(u->recBuffQueueItf, u);\n    pa_modargs_free(ma);\n\n    return 0;\n\nfail:\n    if (ma)\n        pa_modargs_free(ma);\n\n    pa__done(m);\n\n    return -1;\n}\n\n#undef CHK\n\nint pa__get_n_used(pa_module *m) {\n    struct userdata *u;\n\n    pa_assert(m);\n    pa_assert_se(u = m->userdata);\n\n    return pa_source_linked_by(u->source);\n}\n#define DESTROY(object) if (u->object) (*u->object)->Destroy(u->object);\n\nvoid pa__done(pa_module*m) {\n    struct userdata *u;\n\n    pa_assert(m);\n\n    if (!(u = m->userdata))\n        return;\n\n    if (u->source)\n        pa_source_unlink(u->source);\n\n    DESTROY(RecorderObject);\n    DESTROY(engineObject);\n\n    if (u->thread) {\n        pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL);\n        pa_thread_free(u->thread);\n    }\n\n    pa_thread_mq_done(&u->thread_mq);\n\n    if (u->source)\n        pa_source_unref(u->source);\n\n    if (u->memchunk.memblock)\n        pa_memblock_unref(u->memchunk.memblock);\n\n    if (u->rtpoll)\n        pa_rtpoll_free(u->rtpoll);\n\n    pa_xfree(u);\n}\n"
  },
  {
    "path": "packages/pulseaudio/no_priv_drop.patch",
    "content": "diff -uNr pulseaudio-12.2/src/daemon/caps.c pulseaudio-12.2.mod/src/daemon/caps.c\n--- pulseaudio-12.2/src/daemon/caps.c\t2018-07-13 22:06:14.000000000 +0300\n+++ pulseaudio-12.2.mod/src/daemon/caps.c\t2018-09-23 11:34:28.598244818 +0300\n@@ -36,64 +36,11 @@\n \n #include \"caps.h\"\n \n-/* Glibc <= 2.2 has broken unistd.h */\n-#if defined(__linux__) && (__GLIBC__ <= 2 && __GLIBC_MINOR__ <= 2)\n-int setresgid(gid_t r, gid_t e, gid_t s);\n-int setresuid(uid_t r, uid_t e, uid_t s);\n-#endif\n-\n-/* Drop root rights when called SUID root */\n+/* Disable privilege dropping on Android. */\n void pa_drop_root(void) {\n-\n-#ifdef HAVE_GETUID\n-    uid_t uid;\n-    gid_t gid;\n-\n-    pa_log_debug(\"Cleaning up privileges.\");\n-    uid = getuid();\n-    gid = getgid();\n-\n-#if defined(HAVE_SETRESUID)\n-    pa_assert_se(setresuid(uid, uid, uid) >= 0);\n-    pa_assert_se(setresgid(gid, gid, gid) >= 0);\n-#elif defined(HAVE_SETREUID)\n-    pa_assert_se(setreuid(uid, uid) >= 0);\n-    pa_assert_se(setregid(gid, gid) >= 0);\n-#else\n-    pa_assert_se(setuid(uid) >= 0);\n-    pa_assert_se(seteuid(uid) >= 0);\n-    pa_assert_se(setgid(gid) >= 0);\n-    pa_assert_se(setegid(gid) >= 0);\n-#endif\n-\n-    pa_assert_se(getuid() == uid);\n-    pa_assert_se(geteuid() == uid);\n-    pa_assert_se(getgid() == gid);\n-    pa_assert_se(getegid() == gid);\n-\n-    if (uid != 0)\n-        pa_drop_caps();\n-#endif\n+    return;\n }\n \n void pa_drop_caps(void) {\n-#ifdef HAVE_SYS_CAPABILITY_H\n-#if defined(__linux__)\n-    cap_t caps;\n-    pa_assert_se(caps = cap_init());\n-    pa_assert_se(cap_clear(caps) == 0);\n-    pa_assert_se(cap_set_proc(caps) == 0);\n-    pa_assert_se(cap_free(caps) == 0);\n-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)\n-    /* FreeBSD doesn't have this functionality, even though sys/capability.h is\n-     * available. See https://bugs.freedesktop.org/show_bug.cgi?id=72580 */\n-    pa_log_warn(\"FreeBSD cannot drop extra capabilities, implementation needed.\");\n-#else\n-#error \"Don't know how to do capabilities on your system.  Please send a patch.\"\n-#endif /* __linux__ */\n-#else /* HAVE_SYS_CAPABILITY_H */\n-    pa_log_warn(\"Normally all extra capabilities would be dropped now, but \"\n-                \"that's impossible because PulseAudio was built without \"\n-                \"capabilities support.\");\n-#endif\n+    return;\n }\ndiff -uNr pulseaudio-12.2/src/daemon/main.c pulseaudio-12.2.mod/src/daemon/main.c\n--- pulseaudio-12.2/src/daemon/main.c\t2018-07-16 17:40:33.000000000 +0300\n+++ pulseaudio-12.2.mod/src/daemon/main.c\t2018-09-23 11:32:53.513876685 +0300\n@@ -147,119 +147,11 @@\n     }\n }\n \n-#if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)\n-\n+// Disable privilege dropping on Android.\n static int change_user(void) {\n-    struct passwd *pw;\n-    struct group * gr;\n-    int r;\n-\n-    /* This function is called only in system-wide mode. It creates a\n-     * runtime dir in /var/run/ with proper UID/GID and drops privs\n-     * afterwards. */\n-\n-    if (!(pw = getpwnam(PA_SYSTEM_USER))) {\n-        pa_log(_(\"Failed to find user '%s'.\"), PA_SYSTEM_USER);\n-        return -1;\n-    }\n-\n-    if (!(gr = getgrnam(PA_SYSTEM_GROUP))) {\n-        pa_log(_(\"Failed to find group '%s'.\"), PA_SYSTEM_GROUP);\n-        return -1;\n-    }\n-\n-    pa_log_info(\"Found user '%s' (UID %lu) and group '%s' (GID %lu).\",\n-                PA_SYSTEM_USER, (unsigned long) pw->pw_uid,\n-                PA_SYSTEM_GROUP, (unsigned long) gr->gr_gid);\n-\n-    if (pw->pw_gid != gr->gr_gid) {\n-        pa_log(_(\"GID of user '%s' and of group '%s' don't match.\"), PA_SYSTEM_USER, PA_SYSTEM_GROUP);\n-        return -1;\n-    }\n-\n-    if (!pa_streq(pw->pw_dir, PA_SYSTEM_RUNTIME_PATH))\n-        pa_log_warn(_(\"Home directory of user '%s' is not '%s', ignoring.\"), PA_SYSTEM_USER, PA_SYSTEM_RUNTIME_PATH);\n-\n-    if (pa_make_secure_dir(PA_SYSTEM_RUNTIME_PATH, 0755, pw->pw_uid, gr->gr_gid, true) < 0) {\n-        pa_log(_(\"Failed to create '%s': %s\"), PA_SYSTEM_RUNTIME_PATH, pa_cstrerror(errno));\n-        return -1;\n-    }\n-\n-    if (pa_make_secure_dir(PA_SYSTEM_STATE_PATH, 0700, pw->pw_uid, gr->gr_gid, true) < 0) {\n-        pa_log(_(\"Failed to create '%s': %s\"), PA_SYSTEM_STATE_PATH, pa_cstrerror(errno));\n-        return -1;\n-    }\n-\n-    /* We don't create the config dir here, because we don't need to write to it */\n-\n-    if (initgroups(PA_SYSTEM_USER, gr->gr_gid) != 0) {\n-        pa_log(_(\"Failed to change group list: %s\"), pa_cstrerror(errno));\n-        return -1;\n-    }\n-\n-#if defined(HAVE_SETRESGID)\n-    r = setresgid(gr->gr_gid, gr->gr_gid, gr->gr_gid);\n-#elif defined(HAVE_SETEGID)\n-    if ((r = setgid(gr->gr_gid)) >= 0)\n-        r = setegid(gr->gr_gid);\n-#elif defined(HAVE_SETREGID)\n-    r = setregid(gr->gr_gid, gr->gr_gid);\n-#else\n-#error \"No API to drop privileges\"\n-#endif\n-\n-    if (r < 0) {\n-        pa_log(_(\"Failed to change GID: %s\"), pa_cstrerror(errno));\n-        return -1;\n-    }\n-\n-#if defined(HAVE_SETRESUID)\n-    r = setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid);\n-#elif defined(HAVE_SETEUID)\n-    if ((r = setuid(pw->pw_uid)) >= 0)\n-        r = seteuid(pw->pw_uid);\n-#elif defined(HAVE_SETREUID)\n-    r = setreuid(pw->pw_uid, pw->pw_uid);\n-#else\n-#error \"No API to drop privileges\"\n-#endif\n-\n-    if (r < 0) {\n-        pa_log(_(\"Failed to change UID: %s\"), pa_cstrerror(errno));\n-        return -1;\n-    }\n-\n-    pa_drop_caps();\n-\n-    pa_set_env(\"USER\", PA_SYSTEM_USER);\n-    pa_set_env(\"USERNAME\", PA_SYSTEM_USER);\n-    pa_set_env(\"LOGNAME\", PA_SYSTEM_USER);\n-    pa_set_env(\"HOME\", PA_SYSTEM_RUNTIME_PATH);\n-\n-    /* Relevant for pa_runtime_path() */\n-    if (!getenv(\"PULSE_RUNTIME_PATH\"))\n-        pa_set_env(\"PULSE_RUNTIME_PATH\", PA_SYSTEM_RUNTIME_PATH);\n-\n-    if (!getenv(\"PULSE_CONFIG_PATH\"))\n-        pa_set_env(\"PULSE_CONFIG_PATH\", PA_SYSTEM_CONFIG_PATH);\n-\n-    if (!getenv(\"PULSE_STATE_PATH\"))\n-        pa_set_env(\"PULSE_STATE_PATH\", PA_SYSTEM_STATE_PATH);\n-\n-    pa_log_info(\"Successfully changed user to \\\"\" PA_SYSTEM_USER \"\\\".\");\n-\n     return 0;\n }\n \n-#else /* HAVE_PWD_H && HAVE_GRP_H */\n-\n-static int change_user(void) {\n-    pa_log(_(\"System wide mode unsupported on this platform.\"));\n-    return -1;\n-}\n-\n-#endif /* HAVE_PWD_H && HAVE_GRP_H */\n-\n #ifdef HAVE_SYS_RESOURCE_H\n \n static int set_one_rlimit(const pa_rlimit *r, int resource, const char *name) {\n"
  },
  {
    "path": "packages/pulseaudio/sles.patch",
    "content": "--- ./src/Makefile.am.orig\t2019-06-12 08:17:28.074335543 +0000\n+++ ./src/Makefile.am\t2019-06-16 04:40:11.022030070 +0000\n@@ -1501,6 +1501,20 @@\n module_aaudio_sink_la_LIBADD = $(MODULE_LIBADD)\n module_aaudio_sink_la_CFLAGS = $(AM_CFLAGS) -DPA_MODULE_NAME=module_aaudio_sink\n \n+modlibexec_LTLIBRARIES += module-sles-sink.la\n+module_sles_sink_la_SOURCES = modules/sles/module-sles-sink.c\n+module_sles_sink_la_LDFLAGS = $(MODULE_LDFLAGS) -lOpenSLES\n+module_sles_sink_la_LIBADD = $(MODULE_LIBADD)\n+module_sles_sink_la_CFLAGS = $(AM_CFLAGS) -DPA_MODULE_NAME=module_sles_sink\n+\n+modlibexec_LTLIBRARIES += module-sles-source.la\n+module_sles_source_la_SOURCES = modules/sles/module-sles-source.c\n+module_sles_source_la_LDFLAGS = $(MODULE_LDFLAGS) -lOpenSLES\n+module_sles_source_la_LIBADD = $(MODULE_LIBADD)\n+module_sles_source_la_CFLAGS = $(AM_CFLAGS) -DPA_MODULE_NAME=module_sles_source\n+\n+\n+\n # Simple protocol\n \n module_simple_protocol_tcp_la_SOURCES = modules/module-protocol-stub.c\n"
  },
  {
    "path": "packages/pure-ftpd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.pureftpd.org/project/pure-ftpd\nTERMUX_PKG_DESCRIPTION=\"Pure-FTPd is a free (BSD), secure, production-quality and standard-conformant FTP server\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.0.49\nTERMUX_PKG_SHA256=767bf458c70b24f80c0bb7a1bbc89823399e75a0a7da141d30051a2b8cc892a5\nTERMUX_PKG_SRCURL=https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libcrypt, openssl\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_elf_elf_begin=no\nac_cv_lib_sodium_crypto_pwhash_scryptsalsa208sha256_str=no\n--with-ftpwho\n--with-nonroot\n--with-puredb\n--with-tls\n\"\nTERMUX_PKG_CONFFILES=\"etc/pure-ftpd.conf\"\n"
  },
  {
    "path": "packages/pure-ftpd/pure-pwconvert.c.patch",
    "content": "--- ../../build/pure-ftpd/cache/pure-ftpd-1.0.45/src/pure-pwconvert.c\t2017-01-09 20:51:01.000000000 +0100\n+++ ./src/pure-pwconvert.c\t2017-02-23 20:57:25.626342233 +0100\n@@ -27,6 +27,7 @@\n # endif\n #endif\n \n+#ifndef __ANDROID__\n     setpwent();\n     while ((pwd = getpwent()) != NULL) {\n         if (pwd->pw_name == NULL) {\n@@ -76,6 +77,7 @@\n                pwd->pw_gecos, pwd->pw_dir);\n     }\n     endpwent();\n+#endif\n \n     return 0;\n }\n"
  },
  {
    "path": "packages/pure-ftpd/src-ftpd.h.patch",
    "content": "diff -u -r ../pure-ftpd-1.0.47/src/ftpd.h ./src/ftpd.h\n--- ../pure-ftpd-1.0.47/src/ftpd.h\t2017-08-19 01:47:43.000000000 +0200\n+++ ./src/ftpd.h\t2017-11-13 00:02:42.291967297 +0100\n@@ -416,7 +416,7 @@\n \n #ifdef WITH_TLS\n # ifndef TLS_CONFDIR\n-#  define TLS_CONFDIR \"/etc/ssl/private\"\n+#  define TLS_CONFDIR CONFDIR \"/ssl/private\"\n # endif\n # ifndef TLS_CERTIFICATE_FILE\n #  define TLS_CERTIFICATE_FILE TLS_CONFDIR \"/pure-ftpd.pem\"\n"
  },
  {
    "path": "packages/pure-ftpd/src-ftpd_p.h.patch",
    "content": "diff -u -r ../pure-ftpd-1.0.45/src/ftpd_p.h ./src/ftpd_p.h\n--- ../pure-ftpd-1.0.45/src/ftpd_p.h\t2017-01-09 20:51:00.000000000 +0100\n+++ ./src/ftpd_p.h\t2017-02-24 23:16:25.721476594 +0100\n@@ -350,7 +350,7 @@\n # define getpwnam(A) fakegetpwnam(A)\n # define getpwuid(A) fakegetpwnam(NULL)\n #endif\n-#define NON_ROOT_ANON_DIR \"/ftp\"\n+#define NON_ROOT_ANON_DIR \"@TERMUX_HOME@\"\n \n #ifdef PROBE_RANDOM_AT_RUNTIME\n static const char *random_device;\n"
  },
  {
    "path": "packages/pv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.ivarch.com/programs/pv.shtml\nTERMUX_PKG_DESCRIPTION=\"Terminal-based tool for monitoring the progress of data through a pipeline\"\nTERMUX_PKG_LICENSE=\"Artistic-License-2.0\"\nTERMUX_PKG_VERSION=1.6.6\nTERMUX_PKG_SRCURL=http://www.ivarch.com/programs/sources/pv-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=608ef935f7a377e1439c181c4fc188d247da10d51a19ef79bcdee5043b0973f1\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-ipc\"\n"
  },
  {
    "path": "packages/pv/header.in.patch",
    "content": "diff -u -r ../pv-1.5.7/autoconf/header.in ./autoconf/header.in\n--- ../pv-1.5.7/autoconf/header.in\t2014-01-23 23:57:26.000000000 +0100\n+++ ./autoconf/header.in\t2014-09-12 11:22:44.608329965 +0200\n@@ -74,8 +74,10 @@\n #  define stat64 stat\n #  define fstat64 fstat\n # endif\n-# define open64 open\n-# define lseek64 lseek\n+# define open64 open\n+# ifndef __ANDROID__\n+#  define lseek64 lseek\n+# endif\n #endif\n \n #undef HAVE_IPC\n"
  },
  {
    "path": "packages/pv/src-pv-cursor.c.patch",
    "content": "diff -u -r ../pv-1.6.0/src/pv/cursor.c ./src/pv/cursor.c\n--- ../pv-1.6.0/src/pv/cursor.c\t2015-03-15 00:37:18.000000000 +0000\n+++ ./src/pv/cursor.c\t2017-07-07 00:05:58.507914275 +0000\n@@ -21,6 +21,7 @@\n #include <unistd.h>\n #include <sys/stat.h>\n #include <fcntl.h>\n+#include <libgen.h> /* For basename(). */\n \n #ifdef HAVE_IPC\n #include <sys/ipc.h>\n"
  },
  {
    "path": "packages/pwgen/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://pwgen.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Password generator which by default, unless given the '-s' option, generates memorable but insecure passwords\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Iain Nicol @iainnicol\"\nTERMUX_PKG_VERSION=2.08\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/pwgen/pwgen/${TERMUX_PKG_VERSION}/pwgen-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=dab03dd30ad5a58e578c5581241a6e87e184a18eb2c3b2e0fffa8a9cf105c97b\n"
  },
  {
    "path": "packages/python/0001-compileall-Fix-ddir-when-recursing.patch",
    "content": "From 84fdbc156ed424d030686de350fbfc6c3593263f Mon Sep 17 00:00:00 2001\nMessage-Id: <84fdbc156ed424d030686de350fbfc6c3593263f.1537028533.git.jan.steffens@gmail.com>\nFrom: \"Jan Alexander Steffens (heftig)\" <jan.steffens@gmail.com>\nDate: Sat, 15 Sep 2018 18:22:06 +0200\nSubject: [PATCH] compileall: Fix ddir when recursing\n\n---\n Lib/compileall.py | 14 +++++++++-----\n 1 file changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/Lib/compileall.py b/Lib/compileall.py\nindex 72592126d7..70e246fd96 100644\n--- a/Lib/compileall.py\n+++ b/Lib/compileall.py\n@@ -45,12 +45,16 @@ def _walk_dir(dir, ddir=None, maxlevels=10, quiet=0):\n         else:\n             dfile = None\n         if not os.path.isdir(fullname):\n-            yield fullname\n+            yield fullname, ddir\n         elif (maxlevels > 0 and name != os.curdir and name != os.pardir and\n               os.path.isdir(fullname) and not os.path.islink(fullname)):\n             yield from _walk_dir(fullname, ddir=dfile,\n                                  maxlevels=maxlevels - 1, quiet=quiet)\n \n+def _compile_one(file_ddir, *args, **kwargs):\n+    file, ddir = file_ddir\n+    return compile_file(file, ddir, *args, **kwargs)\n+\n def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,\n                 quiet=0, legacy=False, optimize=-1, workers=1,\n                 invalidation_mode=py_compile.PycInvalidationMode.TIMESTAMP):\n@@ -79,17 +83,17 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,\n     if workers is not None and workers != 1 and ProcessPoolExecutor is not None:\n         workers = workers or None\n         with ProcessPoolExecutor(max_workers=workers) as executor:\n-            results = executor.map(partial(compile_file,\n-                                           ddir=ddir, force=force,\n+            results = executor.map(partial(_compile_one,\n+                                           force=force,\n                                            rx=rx, quiet=quiet,\n                                            legacy=legacy,\n                                            optimize=optimize,\n                                            invalidation_mode=invalidation_mode),\n                                    files)\n             success = min(results, default=True)\n     else:\n-        for file in files:\n-            if not compile_file(file, ddir, force, rx, quiet,\n+        for file_ddir in files:\n+            if not _compile_one(file_ddir, force, rx, quiet,\n                                 legacy, optimize, invalidation_mode):\n                 success = False\n     return success\n-- \n2.18.0\n\n"
  },
  {
    "path": "packages/python/Lib-pathlib.py.patch",
    "content": "diff -uNr Python-3.8.0/Lib/pathlib.py Python-3.8.0.mod/Lib/pathlib.py\n--- Python-3.8.0/Lib/pathlib.py\t2019-10-14 16:34:47.000000000 +0300\n+++ Python-3.8.0.mod/Lib/pathlib.py\t2019-11-17 23:35:51.224429521 +0200\n@@ -412,7 +412,11 @@\n \n     unlink = os.unlink\n \n-    link_to = os.link\n+    if hasattr(os, \"link\"):\n+        link_to = os.link\n+    else:\n+        def link_to(self, src, dst):\n+            NotImplementedError(\"link() not available on this system\")\n \n     rmdir = os.rmdir\n \n"
  },
  {
    "path": "packages/python/Lib-subprocess.py.patch",
    "content": "diff -u -r ../Python-3.7.1/Lib/subprocess.py ./Lib/subprocess.py\n--- ../Python-3.7.1/Lib/subprocess.py\t2018-10-20 06:04:19.000000000 +0000\n+++ ./Lib/subprocess.py\t2018-10-20 20:17:50.157206343 +0000\n@@ -1389,9 +1389,7 @@\n                 args = list(args)\n \n             if shell:\n-                # On Android the default shell is at '/system/bin/sh'.\n-                unix_shell = ('/system/bin/sh' if\n-                          hasattr(sys, 'getandroidapilevel') else '/bin/sh')\n+                unix_shell = ('@TERMUX_PREFIX@/bin/sh')\n                 args = [unix_shell, \"-c\"] + args\n                 if executable:\n                     args[0] = executable\n"
  },
  {
    "path": "packages/python/Lib-tmpfile.py.patch",
    "content": "diff -u -r ../Python-3.4.3/Lib/tempfile.py ./Lib/tempfile.py\n--- ../Python-3.4.3/Lib/tempfile.py\t2015-02-25 06:27:44.000000000 -0500\n+++ ./Lib/tempfile.py\t2015-07-21 19:58:07.631659902 -0400\n@@ -124,7 +124,7 @@\n     if _os.name == 'nt':\n         dirlist.extend([ r'c:\\temp', r'c:\\tmp', r'\\temp', r'\\tmp' ])\n     else:\n-        dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])\n+        dirlist.extend([ '@TERMUX_PREFIX@/tmp' ])\n \n     # As a last resort, the current directory.\n     try:\n"
  },
  {
    "path": "packages/python/Modules-socketmodule.c.patch",
    "content": "diff -u -r ../Python-3.6.5/Modules/socketmodule.c ./Modules/socketmodule.c\n--- ../Python-3.6.5/Modules/socketmodule.c\t2018-03-28 11:19:31.000000000 +0200\n+++ ./Modules/socketmodule.c\t2018-06-08 03:28:51.003730525 +0200\n@@ -5373,17 +5373,74 @@\n    This only returns the protocol number, since the other info is\n    already known or not useful (like the list of aliases). */\n \n+#ifdef __ANDROID__\n+struct protocol_name_and_number {\n+    char* name;\n+    int number;\n+};\n+#endif\n+\n /*ARGSUSED*/\n static PyObject *\n socket_getprotobyname(PyObject *self, PyObject *args)\n {\n+#ifdef __ANDROID__\n+    /* http://git.musl-libc.org/cgit/musl/tree/src/network/proto.c */\n+    static const struct protocol_name_and_number protocols[] = {\n+       {\"ip\", 0},\n+       {\"icmp\", 1},\n+       {\"igmp\", 2},\n+       {\"ggp\", 3},\n+       {\"ipencap\", 4},\n+       {\"st\", 5},\n+       {\"tcp\", 6},\n+       {\"egp\", 8},\n+       {\"pup\", 12},\n+       {\"udp\", 17},\n+       {\"hmp\", 20},\n+       {\"xns-idp\", 22},\n+       {\"iso-tp4\", 29},\n+       {\"xtp\", 36},\n+       {\"ddp\", 37},\n+       {\"idpr-cmtp\", 38},\n+       {\"ipv6\", 41},\n+       {\"ipv6-route\", 43},\n+       {\"ipv6-frag\", 44},\n+       {\"idrp\", 45},\n+       {\"rsvp\", 46},\n+       {\"gre\", 47},\n+       {\"esp\", 50},\n+       {\"ah\", 51},\n+       {\"skip\", 57},\n+       {\"ipv6-icmp\", 58},\n+       {\"ipv6-nonxt\", 59},\n+       {\"ipv6-opts\", 60},\n+       {\"rspf\", 73},\n+       {\"vmtp\", 81},\n+       {\"ospf\", 89},\n+       {\"ipip\", 94},\n+       {\"encap\", 98},\n+       {\"pim\", 103},\n+       {\"raw\", 255}\n+    };\n+    int i;\n+#endif\n     const char *name;\n     struct protoent *sp;\n     if (!PyArg_ParseTuple(args, \"s:getprotobyname\", &name))\n         return NULL;\n+#ifdef __ANDROID__\n+    for (i = 0; i < sizeof(protocols) / sizeof(protocols[0]); i++) {\n+        if (strcmp(protocols[i].name, name) == 0) {\n+            return PyLong_FromLong((long) protocols[i].number);\n+        }\n+    }\n+    sp = NULL;\n+#else\n     Py_BEGIN_ALLOW_THREADS\n     sp = getprotobyname(name);\n     Py_END_ALLOW_THREADS\n+#endif\n     if (sp == NULL) {\n         PyErr_SetString(PyExc_OSError, \"protocol not found\");\n         return NULL;\n"
  },
  {
    "path": "packages/python/_cursesmodule.c.patch",
    "content": "We use libandroid-support when building Python, but Python does not\nuse LDFLAGS when building modules (and not much point in this case).\n\ndiff -u -r ../Python-3.4.1/Modules/_cursesmodule.c ./Modules/_cursesmodule.c\n--- ../Python-3.4.1/Modules/_cursesmodule.c\t2014-05-19 07:19:39.000000000 +0200\n+++ ./Modules/_cursesmodule.c\t2014-06-04 08:56:50.441097925 +0200\n@@ -121,7 +121,7 @@\n #include <term.h>\n #endif\n \n-#ifdef HAVE_LANGINFO_H\n+#if defined(HAVE_LANGINFO_H) && !defined(__ANDROID__)\n #include <langinfo.h>\n #endif\n \n"
  },
  {
    "path": "packages/python/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://python.org/\nTERMUX_PKG_DESCRIPTION=\"Python 3 programming language intended to enable clear programs\"\nTERMUX_PKG_LICENSE=\"PythonPL\"\n_MAJOR_VERSION=3.8\nTERMUX_PKG_VERSION=${_MAJOR_VERSION}.0\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=b356244e13fb5491da890b35b13b2118c3122977c2cd825e3eb6e7d462030d84\nTERMUX_PKG_DEPENDS=\"gdbm, libandroid-support, libbz2, libcrypt, libffi, liblzma, libsqlite, ncurses, ncurses-ui-libs, openssl, readline, zlib\"\nTERMUX_PKG_SUGGESTS=\"python-tkinter\"\n\n# The flag --with(out)-pymalloc (disable/enable specialized mallocs) is enabled by default and causes m suffix versions of python.\n# Set ac_cv_func_wcsftime=no to avoid errors such as \"character U+ca0025 is not in range [U+0000; U+10ffff]\"\n# when executing e.g. \"from time import time, strftime, localtime; print(strftime(str('%Y-%m-%d %H:%M'), localtime()))\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_func_wcsftime=no\"\n# Avoid trying to include <sys/timeb.h> which does not exist on android-21:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_ftime=no\"\n# Avoid trying to use AT_EACCESS which is not defined:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_faccessat=no\"\n# The gethostbyname_r function does not exist on device libc:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_gethostbyname_r=no\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --build=$TERMUX_BUILD_TUPLE --with-system-ffi --without-ensurepip\"\n# Hard links does not work on Android 6:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_linkat=no\"\n# Posix semaphores are not supported on Android:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_posix_semaphores_enabled=no\"\n# Do not assume getaddrinfo is buggy when cross compiling:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_buggy_getaddrinfo=no\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --enable-loadable-sqlite-extensions\"\n# Fix https://github.com/termux/termux-packages/issues/2236:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_little_endian_double=yes\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nlib/python${_MAJOR_VERSION}/test\nlib/python${_MAJOR_VERSION}/*/test\nlib/python${_MAJOR_VERSION}/*/tests\n\"\nTERMUX_PKG_BREAKS=\"python2 (<= 2.7.15), python-dev\"\nTERMUX_PKG_REPLACES=\"python-dev\"\n\ntermux_step_pre_configure() {\n\t# Needed when building with clang, as setup.py only probes\n\t# gcc for include paths when finding headers for determining\n\t# if extension modules should be built (specifically, the\n\t# zlib extension module is not built without this):\n\tCPPFLAGS+=\" -I$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include\"\n\tLDFLAGS+=\" -L$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib\"\n\tif [ $TERMUX_ARCH = x86_64 ]; then LDFLAGS+=64; fi\n}\n\ntermux_step_post_make_install() {\n\t(cd $TERMUX_PREFIX/bin\n\t ln -sf idle${_MAJOR_VERSION} idle\n\t ln -sf python${_MAJOR_VERSION} python\n\t ln -sf python${_MAJOR_VERSION}-config python-config\n\t ln -sf pydoc${_MAJOR_VERSION} pydoc)\n\t(cd $TERMUX_PREFIX/share/man/man1\n\t ln -sf python${_MAJOR_VERSION}.1 python.1)\n}\n\ntermux_step_post_massage() {\n\t# Verify that desired modules have been included:\n\tfor module in _bz2 _curses _lzma _sqlite3 _ssl _tkinter zlib; do\n\t\tif [ ! -f \"${TERMUX_PREFIX}/lib/python${_MAJOR_VERSION}/lib-dynload/${module}\".*.so ]; then\n\t\t\ttermux_error_exit \"Python module library $module not built\"\n\t\tfi\n\tdone\n}\n\ntermux_step_create_debscripts() {\n\t# Post-installation script for setting up pip.\n\tcat <<- POSTINST_EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\n\techo \"Setting up pip...\"\n\n\t# Fix historical mistake which removed bin/pip but left site-packages/pip-*.dist-info,\n\t# which causes ensurepip to avoid installing pip due to already existing pip install:\n\tif [ ! -f \"$TERMUX_PREFIX/bin/pip\" ]; then\n\t    rm -Rf ${TERMUX_PREFIX}/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info\n\tfi\n\n\t${TERMUX_PREFIX}/bin/python3 -m ensurepip --upgrade --default-pip\n\n\texit 0\n\tPOSTINST_EOF\n\n\t# Pre-rm script to cleanup runtime-generated files.\n\tcat <<- PRERM_EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\n\tif [ \"\\$1\" != \"remove\" ]; then\n\t    exit 0\n\tfi\n\n\techo \"Uninstalling python modules...\"\n\tpip3 freeze 2>/dev/null | xargs pip3 uninstall -y >/dev/null 2>/dev/null\n\trm -f $TERMUX_PREFIX/bin/pip $TERMUX_PREFIX/bin/pip3* $TERMUX_PREFIX/bin/easy_install $TERMUX_PREFIX/bin/easy_install-3*\n\n\techo \"Deleting remaining files from site-packages...\"\n\trm -Rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/*\n\n\texit 0\n\tPRERM_EOF\n\n\tchmod 0755 postinst prerm\n}\n"
  },
  {
    "path": "packages/python/configure.patch",
    "content": "diff -u -r ../Python-3.6.1/configure ./configure\n--- ../Python-3.6.1/configure\t2017-03-21 07:32:38.000000000 +0100\n+++ ./configure\t2017-03-23 23:42:47.210898734 +0100\n@@ -9295,7 +9295,7 @@\n \t\t then CCSHARED=\"-fPIC\";\n \t\t else CCSHARED=\"+z\";\n \t\t fi;;\n-\tLinux-android*) ;;\n+\tLinux-android*) CCSHARED=\"-fPIC\";;\n \tLinux*|GNU*) CCSHARED=\"-fPIC\";;\n \tBSD/OS*/4*) CCSHARED=\"-fpic\";;\n \tFreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED=\"-fPIC\";;\n@@ -11293,8 +11293,6 @@\n _ACEOF\n if ac_fn_c_try_compile \"$LINENO\"; then :\n \n-$as_echo \"#define HAVE_LINK 1\" >>confdefs.h\n-\n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n $as_echo \"yes\" >&6; }\n else\n"
  },
  {
    "path": "packages/python/cryptmodule.c.patch",
    "content": "diff -u -r ../Python-3.5.1/Modules/_cryptmodule.c ./Modules/_cryptmodule.c\n--- ../Python-3.5.1/Modules/_cryptmodule.c\t2015-12-06 20:39:10.000000000 -0500\n+++ ./Modules/_cryptmodule.c\t2016-04-23 08:11:35.832616854 -0400\n@@ -4,6 +4,7 @@\n #include \"Python.h\"\n \n #include <sys/types.h>\n+#include <crypt.h>\n \n /* Module crypt */\n \n"
  },
  {
    "path": "packages/python/distutils-command-build.py.patch",
    "content": "--- ./Lib/distutils/command/build.py.orig\t2019-11-19 23:19:08.878782120 +0000\n+++ ./Lib/distutils/command/build.py\t2019-11-19 23:19:18.410915201 +0000\n@@ -118,7 +118,7 @@\n \n         if self.executable is None and sys.executable:\n             self.executable = os.path.normpath(sys.executable)\n-\n+        self.parallel = 1\n         if isinstance(self.parallel, str):\n             try:\n                 self.parallel = int(self.parallel)\n"
  },
  {
    "path": "packages/python/fix-paths.patch",
    "content": "diff -uNr Python-3.6.2/Lib/aifc.py Python-3.6.2.mod/Lib/aifc.py\n--- Python-3.6.2/Lib/aifc.py\t2017-07-08 06:33:27.000000000 +0300\n+++ Python-3.6.2.mod/Lib/aifc.py\t2017-09-15 15:09:08.092797061 +0300\n@@ -920,7 +920,7 @@\n if __name__ == '__main__':\n     import sys\n     if not sys.argv[1:]:\n-        sys.argv.append('/usr/demos/data/audio/bach.aiff')\n+        sys.argv.append('@TERMUX_PREFIX@/demos/data/audio/bach.aiff')\n     fn = sys.argv[1]\n     with open(fn, 'r') as f:\n         print(\"Reading\", fn)\ndiff -uNr Python-3.6.2/Lib/mailcap.py Python-3.6.2.mod/Lib/mailcap.py\n--- Python-3.6.2/Lib/mailcap.py\t2017-07-08 06:33:27.000000000 +0300\n+++ Python-3.6.2.mod/Lib/mailcap.py\t2017-09-15 15:08:41.312797081 +0300\n@@ -55,7 +55,8 @@\n             # Don't bother with getpwuid()\n             home = '.' # Last resort\n         mailcaps = [home + '/.mailcap', '/etc/mailcap',\n-                '/usr/etc/mailcap', '/usr/local/etc/mailcap']\n+                '/usr/etc/mailcap', '/usr/local/etc/mailcap',\n+                '@TERMUX_PREFIX@/etc/mailcap']\n     return mailcaps\n \n \ndiff -uNr Python-3.6.2/Lib/mimetypes.py Python-3.6.2.mod/Lib/mimetypes.py\n--- Python-3.6.2/Lib/mimetypes.py\t2017-07-08 06:33:27.000000000 +0300\n+++ Python-3.6.2.mod/Lib/mimetypes.py\t2017-09-15 15:08:05.522797106 +0300\n@@ -49,6 +49,7 @@\n     \"/usr/local/lib/netscape/mime.types\",\n     \"/usr/local/etc/httpd/conf/mime.types\",     # Apache 1.2\n     \"/usr/local/etc/mime.types\",                # Apache 1.3\n+    \"@TERMUX_PREFIX@/etc/mime.types\",           # Termux\n     ]\n \n inited = False\ndiff -uNr Python-3.6.2/Lib/posixpath.py Python-3.6.2.mod/Lib/posixpath.py\n--- Python-3.6.2/Lib/posixpath.py\t2017-07-08 06:33:27.000000000 +0300\n+++ Python-3.6.2.mod/Lib/posixpath.py\t2017-09-15 15:07:20.872797138 +0300\n@@ -32,7 +32,7 @@\n extsep = '.'\n sep = '/'\n pathsep = ':'\n-defpath = '/bin:/usr/bin'\n+defpath = '@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets'\n altsep = None\n devnull = '/dev/null'\n \ndiff -uNr Python-3.6.2/Lib/uuid.py Python-3.6.2.mod/Lib/uuid.py\n--- Python-3.6.2/Lib/uuid.py\t2017-07-08 06:33:27.000000000 +0300\n+++ Python-3.6.2.mod/Lib/uuid.py\t2017-09-15 15:06:36.372797170 +0300\n@@ -306,7 +306,7 @@\n     import os, shutil, subprocess\n     executable = shutil.which(command)\n     if executable is None:\n-        path = os.pathsep.join(('/sbin', '/usr/sbin'))\n+        path = os.pathsep.join(('@TERMUX_PREFIX@/bin', '@TERMUX_PREFIX@/bin/applets'))\n         executable = shutil.which(command, path=path)\n         if executable is None:\n             return None\n"
  },
  {
    "path": "packages/python/python-tkinter.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Tkinter support for Python 3\"\nTERMUX_SUBPKG_DEPENDS=\"tk\"\nTERMUX_SUBPKG_INCLUDE=\"\nbin/idle*\nlib/python${_MAJOR_VERSION}/idlelib\nlib/python${_MAJOR_VERSION}/tkinter\nlib/python${_MAJOR_VERSION}/turtle.py\nlib/python${_MAJOR_VERSION}/turtledemo\nlib/python${_MAJOR_VERSION}/lib-dynload/_tkinter.cpython-${_MAJOR_VERSION/./}m.so\nlib/python${_MAJOR_VERSION}/__pycache__/turtle.*.pyc\n\"\n"
  },
  {
    "path": "packages/python/setup.py.patch",
    "content": "diff -uNr Python-3.8.0/setup.py Python-3.8.0.mod/setup.py\n--- Python-3.8.0/setup.py\t2019-10-14 16:34:47.000000000 +0300\n+++ Python-3.8.0.mod/setup.py\t2019-11-17 21:16:46.524157731 +0200\n@@ -824,7 +824,8 @@\n \n         # Lance Ellinghaus's syslog module\n         # syslog daemon interface\n-        self.add(Extension('syslog', ['syslogmodule.c']))\n+        # Termux: Add 'log' android library since we use android logging:\n+        self.add(Extension('syslog', ['syslogmodule.c'], libraries=['log']))\n \n         # Python interface to subinterpreter C-API.\n         self.add(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c']))\n"
  },
  {
    "path": "packages/python2/Lib-subprocess.py.patch",
    "content": "diff -u -r ../Python-2.7.10/Lib/subprocess.py ./Lib/subprocess.py\n--- ../Python-2.7.10/Lib/subprocess.py\t2015-05-23 12:09:07.000000000 -0400\n+++ ./Lib/subprocess.py\t2015-09-26 18:01:13.672071916 -0400\n@@ -1206,7 +1206,7 @@\n                 args = list(args)\n \n             if shell:\n-                args = [\"/bin/sh\", \"-c\"] + args\n+                args = [\"@TERMUX_PREFIX@/bin/sh\", \"-c\"] + args\n                 if executable:\n                     args[0] = executable\n \n"
  },
  {
    "path": "packages/python2/Lib-tempfile.py.patch",
    "content": "diff -u -r ../Python-2.7.10/Lib/tempfile.py ./Lib/tempfile.py\n--- ../Python-2.7.10/Lib/tempfile.py\t2015-05-23 12:09:07.000000000 -0400\n+++ ./Lib/tempfile.py\t2015-09-16 20:45:13.138695050 -0400\n@@ -163,7 +163,7 @@\n     elif _os.name == 'nt':\n         dirlist.extend([ r'c:\\temp', r'c:\\tmp', r'\\temp', r'\\tmp' ])\n     else:\n-        dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])\n+        dirlist.extend([ '@TERMUX_PREFIX@/tmp' ])\n \n     # As a last resort, the current directory.\n     try:\n"
  },
  {
    "path": "packages/python2/Makefile.pre.in.patch",
    "content": "diff -u -r ../Python-2.7.10/Makefile.pre.in ./Makefile.pre.in\n--- ../Python-2.7.10/Makefile.pre.in\t2015-05-23 12:09:16.000000000 -0400\n+++ ./Makefile.pre.in\t2015-09-16 20:40:00.390764778 -0400\n@@ -1042,28 +1042,6 @@\n \t\t$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \\\n \t\t\t$(DESTDIR)$(LIBDEST)/distutils/tests ; \\\n \tfi\n-\tPYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \\\n-\t\t$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \\\n-\t\t-d $(LIBDEST) -f \\\n-\t\t-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \\\n-\t\t$(DESTDIR)$(LIBDEST)\n-\tPYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \\\n-\t\t$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \\\n-\t\t-d $(LIBDEST) -f \\\n-\t\t-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \\\n-\t\t$(DESTDIR)$(LIBDEST)\n-\t-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \\\n-\t\t$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \\\n-\t\t-d $(LIBDEST)/site-packages -f \\\n-\t\t-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages\n-\t-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \\\n-\t\t$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \\\n-\t\t-d $(LIBDEST)/site-packages -f \\\n-\t\t-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages\n-\t-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \\\n-\t\t$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt\n-\t-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \\\n-\t\t$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt\n \n # Create the PLATDIR source directory, if one wasn't distributed..\n $(srcdir)/Lib/$(PLATDIR):\n"
  },
  {
    "path": "packages/python2/Modules-pwdmodule.c.patch",
    "content": "diff -u -r ../Python-2.7.10/Modules/pwdmodule.c ./Modules/pwdmodule.c\n--- ../Python-2.7.10/Modules/pwdmodule.c\t2015-05-23 12:09:20.000000000 -0400\n+++ ./Modules/pwdmodule.c\t2015-09-16 17:42:37.197613340 -0400\n@@ -75,7 +75,7 @@\n #endif\n     PyStructSequence_SET_ITEM(v, setIndex++, _PyInt_FromUid(p->pw_uid));\n     PyStructSequence_SET_ITEM(v, setIndex++, _PyInt_FromGid(p->pw_gid));\n-#ifdef __VMS\n+#if defined (__VMS) || defined(__ANDROID__)\n     SETS(setIndex++, \"\");\n #else\n     SETS(setIndex++, p->pw_gecos);\n"
  },
  {
    "path": "packages/python2/Python-bltinmodule.c.patch",
    "content": "diff -u -r ../Python-2.7.10/Python/bltinmodule.c ./Python/bltinmodule.c\n--- ../Python-2.7.10/Python/bltinmodule.c\t2015-05-23 12:09:24.000000000 -0400\n+++ ./Python/bltinmodule.c\t2015-09-16 21:01:23.750245871 -0400\n@@ -22,7 +22,7 @@\n #elif defined(__APPLE__)\n const char *Py_FileSystemDefaultEncoding = \"utf-8\";\n #else\n-const char *Py_FileSystemDefaultEncoding = NULL; /* use default */\n+const char *Py_FileSystemDefaultEncoding = \"utf-8\"; /* use default */\n #endif\n \n /* Forward */\n"
  },
  {
    "path": "packages/python2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://python.org/\nTERMUX_PKG_DESCRIPTION=\"Python 2 programming language intended to enable clear programs\"\nTERMUX_PKG_LICENSE=\"PythonPL\"\n# lib/python3.4/lib-dynload/_ctypes.cpython-34m.so links to ffi.\n# openssl for ensurepip.\n# libbz2 for the bz2 module.\n# ncurses-ui-libs for the curses.panel module.\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses, readline, libffi, openssl, libbz2, libsqlite, gdbm, ncurses-ui-libs, libcrypt, zlib\"\nTERMUX_PKG_BREAKS=\"python2-dev\"\nTERMUX_PKG_REPLACES=\"python2-dev\"\n# Python.h includes crypt.h:\nTERMUX_PKG_HOSTBUILD=true\n\n_MAJOR_VERSION=2.7\nTERMUX_PKG_VERSION=${_MAJOR_VERSION}.17\nTERMUX_PKG_SHA256=4d43f033cdbd0aa7b7023c81b0e986fd11e653b5248dac9144d508f11812ba41\nTERMUX_PKG_SRCURL=https://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz\n\n# The flag --with(out)-pymalloc (disable/enable specialized mallocs) is enabled by default and causes m suffix versions of python.\n# Set ac_cv_func_wcsftime=no to avoid errors such as \"character U+ca0025 is not in range [U+0000; U+10ffff]\"\n# when executing e.g. \"from time import time, strftime, localtime; print(strftime(str('%Y-%m-%d %H:%M'), localtime()))\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_func_wcsftime=no\"\n# Avoid trying to include <sys/timeb.h> which does not exist on android-21:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_ftime=no\"\n# Avoid trying to use AT_EACCESS which is not defined:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_faccessat=no\"\n# The gethostbyname_r function does not exist on device libc:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_gethostbyname_r=no\"\n# Do not assume getaddrinfo is buggy when cross compiling:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_buggy_getaddrinfo=no\"\n# Fix https://github.com/termux/termux-packages/issues/2236:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_little_endian_double=yes\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --build=$TERMUX_BUILD_TUPLE --with-system-ffi --without-ensurepip\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --enable-unicode=ucs4\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/smtpd.py\nbin/python\nbin/python-config\nshare/man/man1/python.1\nbin/idle*\nlib/python${_MAJOR_VERSION}/idlelib\nlib/python${_MAJOR_VERSION}/lib-tk\nlib/python${_MAJOR_VERSION}/test\nlib/python${_MAJOR_VERSION}/*/test\nlib/python${_MAJOR_VERSION}/*/tests\n\"\n\ntermux_step_host_build() {\n\t# We need a host-built Parser/pgen binary, copied into cross-compile build in termux_step_post_configure() below\n\t$TERMUX_PKG_SRCDIR/configure\n\tmake Parser/pgen\n\t# We need a python$_MAJOR_VERSION binary to be picked up by configure check:\n\tmake\n\trm -f python$_MAJOR_VERSION # Remove symlink if already exists to get a newer timestamp\n\tln -s python python$_MAJOR_VERSION\n}\n\ntermux_step_post_configure() {\n\tcp $TERMUX_PKG_HOSTBUILD_DIR/Parser/pgen $TERMUX_PKG_BUILDDIR/Parser/pgen\n\ttouch -d \"next hour\" $TERMUX_PKG_BUILDDIR/Parser/pgen\n}\n\ntermux_step_pre_configure() {\n\t# Put the host-built python in path:\n\texport TERMUX_ORIG_PATH=$PATH\n\texport PATH=$TERMUX_PKG_HOSTBUILD_DIR:$PATH\n\n\t# Needed when building with clang, as setup.py only probes\n\t# gcc for include paths when finding headers for determining\n\t# if extension modules should be built (specifically, the\n\t# zlib extension module is not built without this):\n\tCPPFLAGS+=\" -I$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include\"\n\tLDFLAGS+=\" -L$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib\"\n\tif [ $TERMUX_ARCH = x86_64 ]; then LDFLAGS+=64; fi\n}\n\ntermux_step_post_make_install() {\n\t# Avoid file clashes with the python (3) package:\n\t(cd $TERMUX_PREFIX/bin\n\t mv 2to3 2to3-${_MAJOR_VERSION}\n\t mv pydoc pydoc${_MAJOR_VERSION}\n\t ln -sf pydoc${_MAJOR_VERSION} pydoc2)\n\t# Restore path which termux_step_host_build messed with\n\texport PATH=$TERMUX_ORIG_PATH\n}\n\ntermux_step_post_massage() {\n\t# Verify that desired modules have been included:\n\tfor module in _ssl bz2 zlib _curses _sqlite3; do\n\t\tif [ ! -f lib/python${_MAJOR_VERSION}/lib-dynload/${module}.so ]; then\n\t\t\ttermux_error_exit \"Python module library $module not built\"\n\t\tfi\n\tdone\n}\n\ntermux_step_create_debscripts() {\n\t## POST INSTALL:\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"echo 'Setting up pip2...'\" >> postinst\n\t# Fix historical mistake which removed bin/pip2 but left site-packages/pip-*.dist-info,\n\t# which causes ensurepip to avoid installing pip due to already existing pip install:\n\techo \"if [ ! -f $TERMUX_PREFIX/bin/pip2 -a -d $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info ]; then rm -Rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/pip-*.dist-info ; fi\" >> postinst\n\t# Setup bin/pip2:\n\techo \"$TERMUX_PREFIX/bin/python2 -m ensurepip --upgrade --no-default-pip\" >> postinst\n\n\t## PRE RM:\n\t# Avoid running on update\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > prerm:\n\techo 'if [ $1 != \"remove\" ]; then exit 0; fi' >> prerm\n\t# Uninstall everything installed through pip:\n\techo \"pip2 freeze 2> /dev/null | xargs pip2 uninstall -y > /dev/null 2> /dev/null\" >> prerm\n\t# Cleanup *.pyc files\n\techo \"find $TERMUX_PREFIX/lib/python${_MAJOR_VERSION} -depth -name *.pyc -exec rm -rf {} +\" >> prerm\n\t# Remove contents of site-packages/ folder:\n\techo \"rm -Rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/*\" >> prerm\n\t# Remove pip and easy_install installed by ensurepip in postinst:\n\techo \"rm -f $TERMUX_PREFIX/bin/pip2* $TERMUX_PREFIX/bin/easy_install-2*\" >> prerm\n\n\techo \"exit 0\" >> postinst\n\techo \"exit 0\" >> prerm\n\tchmod 0755 postinst prerm\n}\n"
  },
  {
    "path": "packages/python2/configure.patch",
    "content": "diff -u -r ../Python-2.7.10/configure ./configure\n--- ../Python-2.7.10/configure\t2015-05-23 12:09:25.000000000 -0400\n+++ ./configure\t2015-10-20 09:54:55.481316335 -0400\n@@ -10310,7 +10310,7 @@\n _ACEOF\n if ac_fn_c_try_compile \"$LINENO\"; then :\n \n-$as_echo \"#define HAVE_LINK 1\" >>confdefs.h\n+# $as_echo \"#define HAVE_LINK 1\" >>confdefs.h\n \n    { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n $as_echo \"yes\" >&6; }\n"
  },
  {
    "path": "packages/python2/cryptmodule.c.patch",
    "content": "diff -u -r ../Python-2.7.11/Modules/cryptmodule.c ./Modules/cryptmodule.c\n--- ../Python-2.7.11/Modules/cryptmodule.c\t2015-12-05 14:47:14.000000000 -0500\n+++ ./Modules/cryptmodule.c\t2016-04-23 08:16:39.850613791 -0400\n@@ -4,6 +4,7 @@\n #include \"Python.h\"\n \n #include <sys/types.h>\n+#include <crypt.h>\n \n #ifdef __VMS\n #include <openssl/des.h>\n"
  },
  {
    "path": "packages/python2/fix-dlfcn.patch32",
    "content": "diff -Naur Python-2.7.2.orig/Lib/plat-linux2/DLFCN.py Python-2.7.2/Lib/plat-linux2/DLFCN.py\n--- Python-2.7.2.orig/Lib/plat-linux2/DLFCN.py\t2011-06-11 17:46:24.000000000 +0200\n+++ Python-2.7.2/Lib/plat-linux2/DLFCN.py\t2013-07-29 16:34:45.318131844 +0200\n@@ -74,10 +74,17 @@\n # Included from gnu/stubs.h\n \n # Included from bits/dlfcn.h\n+# PATCHED FOR ANDROID (the only supported symbols are):\n+# enum {\n+#  RTLD_NOW  = 0,\n+#  RTLD_LAZY = 1,\n+#  RTLD_LOCAL  = 0,\n+#  RTLD_GLOBAL = 2,\n+# };\n RTLD_LAZY = 0x00001\n-RTLD_NOW = 0x00002\n-RTLD_BINDING_MASK = 0x3\n-RTLD_NOLOAD = 0x00004\n-RTLD_GLOBAL = 0x00100\n+RTLD_NOW = 0x00000\n+RTLD_BINDING_MASK = 0x0\n+RTLD_NOLOAD = 0x00000\n+RTLD_GLOBAL = 0x00002\n RTLD_LOCAL = 0\n-RTLD_NODELETE = 0x01000\n+RTLD_NODELETE = 0x00000\n"
  },
  {
    "path": "packages/python2/fix-dlfcn.patch64",
    "content": "diff -Naur Python-2.7.2.orig/Lib/plat-linux2/DLFCN.py Python-2.7.2/Lib/plat-linux2/DLFCN.py\n--- Python-2.7.2.orig/Lib/plat-linux2/DLFCN.py\t2011-06-11 17:46:24.000000000 +0200\n+++ Python-2.7.2/Lib/plat-linux2/DLFCN.py\t2013-07-29 16:34:45.318131844 +0200\n@@ -74,10 +74,17 @@\n # Included from gnu/stubs.h\n \n # Included from bits/dlfcn.h\n+# PATCHED FOR ANDROID (the only supported symbols are):\n+# enum {\n+#  RTLD_NOW  = 0,\n+#  RTLD_LAZY = 1,\n+#  RTLD_LOCAL  = 0,\n+#  RTLD_GLOBAL = 2,\n+# };\n RTLD_LAZY = 0x00001\n-RTLD_NOW = 0x00002\n-RTLD_BINDING_MASK = 0x3\n-RTLD_NOLOAD = 0x00004\n-RTLD_GLOBAL = 0x00100\n+RTLD_NOW = 0x00002\n+RTLD_BINDING_MASK = 0x0\n+RTLD_NOLOAD = 0x00000\n+RTLD_GLOBAL = 0x00100\n RTLD_LOCAL = 0\n-RTLD_NODELETE = 0x01000\n+RTLD_NODELETE = 0x00000\n"
  },
  {
    "path": "packages/python2/fix-paths.patch",
    "content": "diff -uNr Python-2.7.13/Lib/aifc.py Python-2.7.13.mod/Lib/aifc.py\n--- Python-2.7.13/Lib/aifc.py\t2016-12-17 22:05:05.000000000 +0200\n+++ Python-2.7.13.mod/Lib/aifc.py\t2017-09-15 14:39:33.972798330 +0300\n@@ -960,7 +960,7 @@\n if __name__ == '__main__':\n     import sys\n     if not sys.argv[1:]:\n-        sys.argv.append('/usr/demos/data/audio/bach.aiff')\n+        sys.argv.append('@TERMUX_PREFIX@/demos/data/audio/bach.aiff')\n     fn = sys.argv[1]\n     f = open(fn, 'r')\n     try:\ndiff -uNr Python-2.7.13/Lib/mailcap.py Python-2.7.13.mod/Lib/mailcap.py\n--- Python-2.7.13/Lib/mailcap.py\t2016-12-17 22:05:06.000000000 +0200\n+++ Python-2.7.13.mod/Lib/mailcap.py\t2017-09-15 14:48:24.432797951 +0300\n@@ -44,7 +44,8 @@\n             # Don't bother with getpwuid()\n             home = '.' # Last resort\n         mailcaps = [home + '/.mailcap', '/etc/mailcap',\n-                '/usr/etc/mailcap', '/usr/local/etc/mailcap']\n+                '/usr/etc/mailcap', '/usr/local/etc/mailcap',\n+                '@TERMUX_PREFIX@/etc/mailcap']\n     return mailcaps\n \n \ndiff -uNr Python-2.7.13/Lib/mimetypes.py Python-2.7.13.mod/Lib/mimetypes.py\n--- Python-2.7.13/Lib/mimetypes.py\t2016-12-17 22:05:06.000000000 +0200\n+++ Python-2.7.13.mod/Lib/mimetypes.py\t2017-09-15 14:22:15.642799073 +0300\n@@ -47,6 +47,7 @@\n     \"/usr/local/lib/netscape/mime.types\",\n     \"/usr/local/etc/httpd/conf/mime.types\",     # Apache 1.2\n     \"/usr/local/etc/mime.types\",                # Apache 1.3\n+    \"@TERMUX_PREFIX@/etc/mime.types\",           # Termux\n     ]\n \n inited = False\ndiff -uNr Python-2.7.13/Lib/posixpath.py Python-2.7.13.mod/Lib/posixpath.py\n--- Python-2.7.13/Lib/posixpath.py\t2016-12-17 22:05:06.000000000 +0200\n+++ Python-2.7.13.mod/Lib/posixpath.py\t2017-09-15 14:47:13.762798002 +0300\n@@ -32,7 +32,7 @@\n extsep = '.'\n sep = '/'\n pathsep = ':'\n-defpath = ':/bin:/usr/bin'\n+defpath = ':@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets'\n altsep = None\n devnull = '/dev/null'\n \ndiff -uNr Python-2.7.13/Lib/uuid.py Python-2.7.13.mod/Lib/uuid.py\n--- Python-2.7.13/Lib/uuid.py\t2016-12-17 22:05:06.000000000 +0200\n+++ Python-2.7.13.mod/Lib/uuid.py\t2017-09-15 14:46:19.442798040 +0300\n@@ -296,7 +296,7 @@\n def _popen(command, args):\n     import os\n     path = os.environ.get(\"PATH\", os.defpath).split(os.pathsep)\n-    path.extend(('/sbin', '/usr/sbin'))\n+    path.extend(('@TERMUX_PREFIX@/bin', '@TERMUX_PREFIX@/bin/applets'))\n     for dir in path:\n         executable = os.path.join(dir, command)\n         if (os.path.exists(executable) and\n"
  },
  {
    "path": "packages/python2/setup.py.patch",
    "content": "diff -u -r ../Python-2.7.10/setup.py ./setup.py\n--- ../Python-2.7.10/setup.py\t2015-05-23 12:09:25.000000000 -0400\n+++ ./setup.py\t2015-11-07 17:34:53.020310751 -0500\n@@ -294,6 +294,9 @@\n                           (ext.name, sys.exc_info()[1]))\n             self.failed.append(ext.name)\n             return\n+\n+\treturn # Skip import check which does not work when cross compiling\n+\n         # Workaround for Mac OS X: The Carbon-based modules cannot be\n         # reliably imported into a command-line Python\n         if 'Carbon' in ext.extra_link_args:\n@@ -674,7 +677,8 @@\n \n         # Lance Ellinghaus's syslog module\n         # syslog daemon interface\n-        exts.append( Extension('syslog', ['syslogmodule.c']) )\n+        # Termux: Add 'log' android library since we use android logging:\n+        exts.append( Extension('syslog', ['syslogmodule.c'], libraries=['log']) )\n \n         # George Neville-Neil's timing module:\n         # Deprecated in PEP 4 http://www.python.org/peps/pep-0004.html\n"
  },
  {
    "path": "packages/qalc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://qalculate.github.io/\nTERMUX_PKG_DESCRIPTION=\"Powerful and easy to use command line calculator\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.8.1\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SRCURL=https://github.com/Qalculate/libqalculate/releases/download/v$TERMUX_PKG_VERSION/libqalculate-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=a901be570bbfad80f1fccb1839ef2d03f6f2b7a02b051df35d5b687a08396105\nTERMUX_PKG_DEPENDS=\"libc++, libiconv, libcurl, libmpfr, libxml2, readline, libgmp, zlib\"\nTERMUX_PKG_BREAKS=\"qalc-dev\"\nTERMUX_PKG_REPLACES=\"qalc-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--without-icu\"\n"
  },
  {
    "path": "packages/qalc/util.cc.patch",
    "content": "--- ../libqalculate-2.0.0/libqalculate/util.cc\t2017-08-27 20:37:20.000000000 +0200\n+++ ./libqalculate/util.cc\t2017-08-30 21:33:31.235484528 +0200\n@@ -771,8 +771,8 @@\n }\n \n void Thread::enableAsynchronousCancel() {\n-\tpthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n-\tpthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);\n+\t//pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n+\t//pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);\n }\n \n void *Thread::doRun(void *data) {\n@@ -795,7 +795,8 @@\n \n bool Thread::cancel() {\n \tif(!running) return true;\n-\trunning = pthread_cancel(m_thread) != 0;\n+\t//running = pthread_cancel(m_thread) != 0;\n+\trunning = pthread_kill(m_thread, 0) != 0;\n \treturn !running;\n }\n \n"
  },
  {
    "path": "packages/qpdf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://qpdf.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Content-Preserving PDF Transformation System\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=9.1.0\nTERMUX_PKG_SRCURL=https://github.com/qpdf/qpdf/releases/download/release-qpdf-$TERMUX_PKG_VERSION/qpdf-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3abbbb7907f2e750336b9c97e67b6e806aca91ab537402ec080656d63940ed79\nTERMUX_PKG_DEPENDS=\"libc++, libjpeg-turbo, zlib\"\nTERMUX_PKG_BREAKS=\"qpdf-dev\"\nTERMUX_PKG_REPLACES=\"qpdf-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-random=/dev/urandom\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/quickjs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://bellard.org/quickjs/\nTERMUX_PKG_DESCRIPTION=\"QuickJS is a small and embeddable Javascript engine\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2019.10.27\nTERMUX_PKG_SRCURL=https://bellard.org/quickjs/quickjs-${TERMUX_PKG_VERSION//./-}.tar.xz\nTERMUX_PKG_SHA256=51cdca4eb7851d2eb8b28d442dfaa36213920171a0cf0ebc046802369434a176\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"CROSS_PREFIX=${TERMUX_HOST_PLATFORM}- CONFIG_CLANG=y CONFIG_DEFAULT_AR=y -W run-test262 -W run-test262-bn prefix=$TERMUX_PREFIX\"\n"
  },
  {
    "path": "packages/radare2/5d76b9ff992b1b7dd64b1ccb89afa40318ff25fa.patch",
    "content": "From 5d76b9ff992b1b7dd64b1ccb89afa40318ff25fa Mon Sep 17 00:00:00 2001\nFrom: Johannes <johannes.brechtmann@gmail.com>\nDate: Fri, 1 Nov 2019 02:54:48 +0100\nSubject: [PATCH] fix linux x86 build (#15395)\n\n---\n libr/debug/p/native/linux/linux_debug.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/libr/debug/p/native/linux/linux_debug.c b/libr/debug/p/native/linux/linux_debug.c\nindex be131eb16f..861bf63224 100644\n--- a/libr/debug/p/native/linux/linux_debug.c\n+++ b/libr/debug/p/native/linux/linux_debug.c\n@@ -874,13 +874,13 @@ int linux_reg_read(RDebug *dbg, int type, ut8 *buf, int size) {\n \t\t\tstruct user_fpxregs_struct fpxregs;\n \t\t\tret1 = r_debug_ptrace (dbg, PTRACE_GETFPXREGS, pid, NULL, &fpxregs);\n \t\t\tif (ret1 == 0) {\n-\t\t\t\tif (showfpu) print_fpu ((void *)&fpxregs, ret1);\n+\t\t\t\tif (showfpu) print_fpu ((void *)&fpxregs);\n \t\t\t\tif (sizeof(fpxregs) < size) size = sizeof(fpxregs);\n \t\t\t\tmemcpy (buf, &fpxregs, size);\n \t\t\t\treturn sizeof(fpxregs);\n \t\t\t} else {\n \t\t\t\tret1 = r_debug_ptrace (dbg, PTRACE_GETFPREGS, pid, NULL, &fpregs);\n-\t\t\t\tif (showfpu) print_fpu ((void *)&fpregs, ret1);\n+\t\t\t\tif (showfpu) print_fpu ((void *)&fpregs);\n \t\t\t\tif (ret1 != 0) return false;\n \t\t\t\tif (sizeof(fpregs) < size) size = sizeof(fpregs);\n \t\t\t\tmemcpy (buf, &fpregs, size);\n@@ -888,7 +888,7 @@ int linux_reg_read(RDebug *dbg, int type, ut8 *buf, int size) {\n \t\t\t}\n #else\n \t\t\tret1 = r_debug_ptrace (dbg, PTRACE_GETFPREGS, pid, NULL, &fpregs);\n-\t\t\tif (showfpu) print_fpu ((void *)&fpregs, 1);\n+\t\t\tif (showfpu) print_fpu ((void *)&fpregs);\n \t\t\tif (ret1 != 0) return false;\n \t\t\tif (sizeof (fpregs) < size) size = sizeof(fpregs);\n \t\t\tmemcpy (buf, &fpregs, size);\n"
  },
  {
    "path": "packages/radare2/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://rada.re\nTERMUX_PKG_DESCRIPTION=\"Advanced Hexadecimal Editor\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=4.0.0\nTERMUX_PKG_SHA256=7621e38558917dc4b469acf2aa33d7cab6414420a0a1d205c55b9c96423e9cee\nTERMUX_PKG_SRCURL=https://github.com/radare/radare2/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libuv\"\nTERMUX_PKG_BREAKS=\"radare2-dev\"\nTERMUX_PKG_REPLACES=\"radare2-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-compiler=termux-host\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# Unset CPPFLAGS to avoid -I$TERMUX_PREFIX/include. This is because\n\t# radare2 build will put it's own -I flags after ours, which causes\n\t# problems due to name clashes (binutils header files).\n\tunset CPPFLAGS\n\n\t# If this variable is not set, then build will fail on linking with 'pthread'\n\texport ANDROID=1\n\n\texport OBJCOPY=$TERMUX_HOST_PLATFORM-objcopy\n\n\t# Remove old libs which may mess with new build:\n\trm -f $TERMUX_PREFIX/lib/libr_*\n}\n"
  },
  {
    "path": "packages/radare2/f639c3b6a17a57c9a0fa1790811eff27dd124b59.patch",
    "content": "From f639c3b6a17a57c9a0fa1790811eff27dd124b59 Mon Sep 17 00:00:00 2001\nFrom: radare <pancake@nopcode.org>\nDate: Wed, 30 Oct 2019 13:04:25 +0100\nSubject: [PATCH] Fix build for 32bit Linux systems ##build (#15384)\n\n---\n libr/debug/p/native/linux/linux_debug.c | 88 ++++++++++++-------------\n 1 file changed, 43 insertions(+), 45 deletions(-)\n\ndiff --git a/libr/debug/p/native/linux/linux_debug.c b/libr/debug/p/native/linux/linux_debug.c\nindex ebdac31873..be131eb16f 100644\n--- a/libr/debug/p/native/linux/linux_debug.c\n+++ b/libr/debug/p/native/linux/linux_debug.c\n@@ -716,11 +716,10 @@ RList *linux_thread_list(int pid, RList *list) {\n \tr_cons_printf (\"foo = 0x%04lx          \\n\", (fpregs).foo);\\\n \tr_cons_printf (\"fos = 0x%04lx              \", (fpregs).fos)\n \n-void print_fpu (void *f){\n-#if __x86_64__ || __i386__\n+static void print_fpu(void *f){\n+#if __x86_64__\n \tint i,j;\n \tstruct user_fpregs_struct fpregs = *(struct user_fpregs_struct *)f;\n-#if __x86_64__\n #if __ANDROID__\n \tPRINT_FPU (fpregs);\n \tfor (i = 0;i < 8; i++) {\n@@ -761,48 +760,47 @@ void print_fpu (void *f){\n \t}\n #endif // __ANDROID__\n #elif __i386__\n-\tif (!r) {\n-#if !__ANDROID__\n-\t\tstruct user_fpxregs_struct fpxregs = *(struct user_fpxregs_struct*)f;\n-\t\tr_cons_printf (\"---- x86-32 ----\\n\");\n-\t\tr_cons_printf (\"cwd = 0x%04x  ; control   \", fpxregs.cwd);\n-\t\tr_cons_printf (\"swd = 0x%04x  ; status\\n\", fpxregs.swd);\n-\t\tr_cons_printf (\"twd = 0x%04x \", fpxregs.twd);\n-\t\tr_cons_printf (\"fop = 0x%04x\\n\", fpxregs.fop);\n-\t\tr_cons_printf (\"fip = 0x%08x\\n\", (ut32)fpxregs.fip);\n-\t\tr_cons_printf (\"fcs = 0x%08x\\n\", (ut32)fpxregs.fcs);\n-\t\tr_cons_printf (\"foo = 0x%08x\\n\", (ut32)fpxregs.foo);\n-\t\tr_cons_printf (\"fos = 0x%08x\\n\", (ut32)fpxregs.fos);\n-\t\tr_cons_printf (\"mxcsr = 0x%08x\\n\", (ut32)fpxregs.mxcsr);\n-\t\tfor(i = 0; i < 8; i++) {\n-\t\t\tut32 *a = (ut32*)(&fpxregs.xmm_space);\n-\t\t\tut64 *b = (ut64 *)(&fpxregs.st_space[i * 4]);\n-\t\t\tut32 *c = (ut32*)&fpxregs.st_space;\n-\t\t\tfloat *f = (float *)&fpxregs.st_space;\n-\t\t\ta = a + (i * 4);\n-\t\t\tc = c + (i * 4);\n-\t\t\tf = f + (i * 4);\n-\t\t\tr_cons_printf (\"xmm%d = %08x %08x %08x %08x   \", i, (int)a[0],\n-\t\t\t\t(int)a[1], (int)a[2], (int)a[3] );\n-\t\t\tr_cons_printf (\"st%d = %0.3lg (0x%016\"PFMT64x\") | %0.3f (0x%08x) | \"\\\n-\t\t\t\t\"%0.3f (0x%08x)\\n\", i,\n-\t\t\t\t(double)*((double*)(&fpxregs.st_space[i*4])), b[0],\n-\t\t\t\tf[0], c[0], f[1], c[1]);\n-\t\t}\n-#endif // !__ANDROID__\n-\t} else {\n-\t\tr_cons_printf (\"---- x86-32-noxmm ----\\n\");\n-\t\tPRINT_FPU_NOXMM (fpregs);\n-\t\tfor(i = 0; i < 8; i++) {\n-\t\t\tut64 *b = (ut64 *)(&fpregs.st_space[i*4]);\n-\t\t\tdouble *d = (double*)b;\n-\t\t\tut32 *c = (ut32*)&fpregs.st_space;\n-\t\t\tfloat *f = (float *)&fpregs.st_space;\n-\t\t\tc = c + (i * 4);\n-\t\t\tf = f + (i * 4);\n-\t\t\tr_cons_printf (\"st%d = %0.3lg (0x%016\"PFMT64x\") | %0.3f (0x%08x) | \"\\\n-\t\t\t\t\"%0.3f (0x%08x)\\n\", i, d[0], b[0], f[0], c[0], f[1], c[1]);\n-\t\t}\n+\tint i,j;\n+#if __ANDROID__\n+\tstruct user_fpxregs_struct fpxregs = *(struct user_fpxregs_struct*)f;\n+\tr_cons_printf (\"---- x86-32 ----\\n\");\n+\tr_cons_printf (\"cwd = 0x%04x  ; control   \", fpxregs.cwd);\n+\tr_cons_printf (\"swd = 0x%04x  ; status\\n\", fpxregs.swd);\n+\tr_cons_printf (\"twd = 0x%04x \", fpxregs.twd);\n+\tr_cons_printf (\"fop = 0x%04x\\n\", fpxregs.fop);\n+\tr_cons_printf (\"fip = 0x%08x\\n\", (ut32)fpxregs.fip);\n+\tr_cons_printf (\"fcs = 0x%08x\\n\", (ut32)fpxregs.fcs);\n+\tr_cons_printf (\"foo = 0x%08x\\n\", (ut32)fpxregs.foo);\n+\tr_cons_printf (\"fos = 0x%08x\\n\", (ut32)fpxregs.fos);\n+\tr_cons_printf (\"mxcsr = 0x%08x\\n\", (ut32)fpxregs.mxcsr);\n+\tfor(i = 0; i < 8; i++) {\n+\t\tut32 *a = (ut32*)(&fpxregs.xmm_space);\n+\t\tut64 *b = (ut64 *)(&fpxregs.st_space[i * 4]);\n+\t\tut32 *c = (ut32*)&fpxregs.st_space;\n+\t\tfloat *f = (float *)&fpxregs.st_space;\n+\t\ta = a + (i * 4);\n+\t\tc = c + (i * 4);\n+\t\tf = f + (i * 4);\n+\t\tr_cons_printf (\"xmm%d = %08x %08x %08x %08x   \", i, (int)a[0],\n+\t\t\t(int)a[1], (int)a[2], (int)a[3] );\n+\t\tr_cons_printf (\"st%d = %0.3lg (0x%016\"PFMT64x\") | %0.3f (0x%08x) | \"\\\n+\t\t\t\"%0.3f (0x%08x)\\n\", i,\n+\t\t\t(double)*((double*)(&fpxregs.st_space[i*4])), b[0],\n+\t\t\tf[0], c[0], f[1], c[1]);\n+\t}\n+#else\n+\tstruct user_fpregs_struct fpregs = *(struct user_fpregs_struct *)f;\n+\tr_cons_printf (\"---- x86-32-noxmm ----\\n\");\n+\tPRINT_FPU_NOXMM (fpregs);\n+\tfor(i = 0; i < 8; i++) {\n+\t\tut64 *b = (ut64 *)(&fpregs.st_space[i*4]);\n+\t\tdouble *d = (double*)b;\n+\t\tut32 *c = (ut32*)&fpregs.st_space;\n+\t\tfloat *f = (float *)&fpregs.st_space;\n+\t\tc = c + (i * 4);\n+\t\tf = f + (i * 4);\n+\t\tr_cons_printf (\"st%d = %0.3lg (0x%016\"PFMT64x\") | %0.3f (0x%08x) | \"\\\n+\t\t\t\"%0.3f (0x%08x)\\n\", i, d[0], b[0], f[0], c[0], f[1], c[1]);\n \t}\n #endif\n #else\n"
  },
  {
    "path": "packages/radare2/libr-core-cconfig.c.patch",
    "content": "diff -uNr radare2-3.9.0/libr/core/cconfig.c radare2-3.9.0.mod/libr/core/cconfig.c\n--- radare2-3.9.0/libr/core/cconfig.c\t2019-09-17 16:31:23.000000000 +0300\n+++ radare2-3.9.0.mod/libr/core/cconfig.c\t2019-09-18 16:12:01.379864195 +0300\n@@ -2794,7 +2794,7 @@\n \t\tchar *h = r_sys_getenv (R_SYS_HOME);\n \t\tif (h) {\n \t\t\tif (!strcmp (h, \"/\")) {\n-\t\t\t\tr_sys_setenv (R_SYS_HOME, \"/data/local/tmp\");\n+\t\t\t\tr_sys_setenv (R_SYS_HOME, \"@TERMUX_ANDROID_HOME@\");\n \t\t\t}\n \t\t\tfree (h);\n \t\t}\n@@ -3212,7 +3212,7 @@\n \t\tfree (path);\n \t}\n \tSETCB (\"dir.source\", \"\", &cb_dirsrc, \"Path to find source files\");\n-\tSETPREF (\"dir.types\", \"/usr/include\", \"Default path to look for cparse type files\");\n+\tSETPREF (\"dir.types\", \"@TERMUX_PREFIX@/include\", \"Default path to look for cparse type files\");\n \tSETPREF (\"dir.libs\", \"\", \"Specify path to find libraries to load when bin.libs=true\");\n \tp = r_sys_getenv (R_SYS_HOME);\n \tSETCB (\"dir.home\", p, &cb_dirhome, \"Path for the home directory\");\n@@ -3220,11 +3220,7 @@\n \tp = r_sys_getenv (R_SYS_TMP);\n \tSETCB (\"dir.tmp\", p, &cb_dirtmp, \"Path of the tmp directory\");\n \tfree (p);\n-#if __ANDROID__\n-\tSETPREF (\"dir.projects\", \"/data/data/org.radare.radare2installer/radare2/projects\", \"Default path for projects\");\n-#else\n \tSETPREF (\"dir.projects\", R_JOIN_2_PATHS (\"~\", R2_HOME_PROJECTS), \"Default path for projects\");\n-#endif\n \tSETCB (\"dir.zigns\", R_JOIN_2_PATHS (\"~\", R2_HOME_ZIGNS), &cb_dirzigns, \"Default path for zignatures (see zo command)\");\n \tSETPREF (\"stack.reg\", \"SP\", \"Which register to use as stack pointer in the visual debug\");\n \tSETPREF (\"stack.bytes\", \"true\", \"Show bytes instead of words in stack\");\n@@ -3362,9 +3358,8 @@\n #else\n \tif (r_file_exists (\"/usr/bin/openURL\")) { // iOS ericautils\n \t\tr_config_set (cfg, \"http.browser\", \"/usr/bin/openURL\");\n-\t} else if (r_file_exists (\"/system/bin/toolbox\")) {\n-\t\tr_config_set (cfg, \"http.browser\",\n-\t\t\t\t\"LD_LIBRARY_PATH=/system/lib am start -a android.intent.action.VIEW -d\");\n+\t} else if (r_file_exists (\"@TERMUX_PREFIX@/bin/termux-open\")) {\n+\t\tr_config_set (cfg, \"http.browser\", \"@TERMUX_PREFIX@/bin/termux-open\");\n \t} else if (r_file_exists (\"/usr/bin/xdg-open\")) {\n \t\tr_config_set (cfg, \"http.browser\", \"xdg-open\");\n \t} else if (r_file_exists (\"/usr/bin/open\")) {\n@@ -3378,11 +3373,7 @@\n \tSETPREF (\"http.index\", \"index.html\", \"Main html file to check in directory\");\n \tSETPREF (\"http.bind\", \"localhost\", \"Server address\");\n \tSETPREF (\"http.homeroot\", R_JOIN_2_PATHS (\"~\", R2_HOME_WWWROOT), \"http home root directory\");\n-#if __ANDROID__\n-\tSETPREF (\"http.root\", \"/data/data/org.radare.radare2installer/www\", \"http root directory\");\n-#else\n \tSETPREF (\"http.root\", R2_WWWROOT, \"http root directory\");\n-#endif\n \tSETPREF (\"http.port\", \"9090\", \"HTTP server port\");\n \tSETPREF (\"http.maxport\", \"9999\", \"Last HTTP server port\");\n \tSETPREF (\"http.ui\", \"m\", \"Default webui (enyo, m, p, t)\");\n"
  },
  {
    "path": "packages/radare2/libr-include-r_magic.h.patch",
    "content": "diff -uNr radare2-2.0.0/libr/include/r_magic.h radare2-2.0.0.mod/libr/include/r_magic.h\n--- radare2-2.0.0/libr/include/r_magic.h\t2017-10-09 18:05:53.000000000 +0300\n+++ radare2-2.0.0.mod/libr/include/r_magic.h\t2017-10-11 16:23:00.721073712 +0300\n@@ -12,7 +12,7 @@\n R_LIB_VERSION_HEADER(r_magic);\n \n #ifndef MAGICFILE\n-#define MAGICFILE \"/etc/magic\"\n+#define MAGICFILE \"@TERMUX_PREFIX@/etc/magic\"\n #endif\n \n #define R_MAGIC_PATH R2_PREFIX \"/share/radare2/\" R2_VERSION \"/magic\"\n"
  },
  {
    "path": "packages/radare2/libr-util-diff.c.patch",
    "content": "diff -uNr radare2-3.2.1/libr/util/diff.c radare2-3.2.1.mod/libr/util/diff.c\n--- radare2-3.2.1/libr/util/diff.c\t2019-01-08 18:14:43.000000000 +0200\n+++ radare2-3.2.1.mod/libr/util/diff.c\t2019-03-02 03:17:18.566391827 +0200\n@@ -145,7 +145,7 @@\n \tchar* err = NULL;\n \tchar* out = NULL;\n \tint out_len;\n-\t(void)r_sys_cmd_str_full (\"/usr/bin/diff -u .a .b\", NULL, &out, &out_len, &err);\n+\t(void)r_sys_cmd_str_full (\"@TERMUX_PREFIX@/bin/diff -u .a .b\", NULL, &out, &out_len, &err);\n \tr_file_rm (\".a\");\n \tr_file_rm (\".b\");\n \tfree (err);\n"
  },
  {
    "path": "packages/radare2/libr-util-file.c.patch",
    "content": "diff -u -r ../radare2-2.1.0/libr/util/file.c ./libr/util/file.c\n--- ../radare2-2.1.0/libr/util/file.c\t2017-11-27 13:31:04.000000000 +0100\n+++ ./libr/util/file.c\t2017-11-27 20:11:09.415987429 +0100\n@@ -986,7 +986,7 @@\n \t}\n \tif (!path) {\n #if __ANDROID__\n-\t\tpath = strdup (\"/data/data/org.radare.radare2installer/radare2/tmp\");\n+\t\tpath = strdup (\"@TERMUX_PREFIX@/tmp\");\n #else\n \t\tpath = strdup (\"/tmp\");\n #endif\n"
  },
  {
    "path": "packages/radare2/libr-util-sandbox.c.patch",
    "content": "diff -uNr radare2-3.2.1/libr/util/sandbox.c radare2-3.2.1.mod/libr/util/sandbox.c\n--- radare2-3.2.1/libr/util/sandbox.c\t2019-01-08 18:14:43.000000000 +0200\n+++ radare2-3.2.1.mod/libr/util/sandbox.c\t2019-03-02 02:42:52.796061199 +0200\n@@ -154,7 +154,7 @@\n \t\treturn system (x);\n #endif\n \t}\n-\treturn execl (\"/bin/sh\", \"sh\", \"-c\", x, (const char*)NULL);\n+\treturn execl (\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", x, (const char*)NULL);\n #else\n \t#include <spawn.h>\n \tif (n && !strchr (x, '|')) {\n"
  },
  {
    "path": "packages/radare2/mk-termux-host.mk.patch",
    "content": "diff -u -r ../radare2-2.4.0/mk/termux-host.mk ./mk/termux-host.mk\n--- ../radare2-2.4.0/mk/termux-host.mk\t2018-03-05 17:12:35.000000000 +0000\n+++ ./mk/termux-host.mk\t2018-03-07 10:00:57.076202764 +0000\n@@ -3,6 +3,7 @@\n #RANLIB=ndk-ranlib\n USERCC=gcc -fPIC -fPIE\n CC_AR=${AR} -r ${LIBAR}\n+PARTIALLD=${LD} -r --whole-archive\n \n ONELIB=0\n OSTYPE=android\n"
  },
  {
    "path": "packages/radare2/sys-ldconfig.sh.patch",
    "content": "diff -uNr radare2-3.9.0/sys/ldconfig.sh radare2-3.9.0.mod/sys/ldconfig.sh\n--- radare2-3.9.0/sys/ldconfig.sh\t2019-09-17 16:31:23.000000000 +0300\n+++ radare2-3.9.0.mod/sys/ldconfig.sh\t2019-09-18 16:13:09.246804787 +0300\n@@ -1,4 +1,5 @@\n #!/bin/sh\n+exit 0\n LD=/etc/ld.so.conf.d\n if test -w $LD ; then\n \tif type ldconfig > /dev/null 2>&1 ; then\n"
  },
  {
    "path": "packages/ragel/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.colm.net/open-source/ragel/\nTERMUX_PKG_DESCRIPTION=\"Compiles finite state machines from regular languages into executable C, C++, Objective-C, or D code\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=6.10\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://www.colm.net/files/ragel/ragel-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f\nTERMUX_PKG_DEPENDS=\"libc++\"\n"
  },
  {
    "path": "packages/ranger/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://ranger.github.io/\nTERMUX_PKG_DESCRIPTION=\"File manager with VI key bindings\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.9.2\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/ranger/ranger/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=49a2d8dc5fa7b1c0cac0fa72d4ad704fc7107dee36cb9feb325a42754774d363\nTERMUX_PKG_DEPENDS=\"python, file\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make() {\n\techo Skipping make step...\n}\n\ntermux_step_make_install() {\n\tpython3.8 setup.py install --prefix=$TERMUX_PREFIX --force\n}\n\ntermux_step_post_massage() {\n\tfind . -path '*/__pycache__*' -delete\n}\n"
  },
  {
    "path": "packages/ranger/ranger-core-actions.py.patch",
    "content": "diff -u -r ../ranger-1.9.2/ranger/core/actions.py ./ranger/core/actions.py\n--- ../ranger-1.9.2/ranger/core/actions.py\t2018-09-09 19:51:55.000000000 +0000\n+++ ./ranger/core/actions.py\t2018-09-15 19:52:46.949144012 +0000\n@@ -7,7 +7,7 @@\n \n import codecs\n import os\n-from os import link, symlink, listdir, stat\n+from os import symlink, listdir, stat\n from os.path import join, isdir, realpath, exists\n import re\n import shlex\n@@ -1513,7 +1513,7 @@\n         for fobj in self.copy_buffer:\n             new_name = next_available_filename(fobj.basename)\n             try:\n-                link(fobj.path, join(self.fm.thisdir.path, new_name))\n+                symlink(fobj.path, join(self.fm.thisdir.path, new_name))\n             except OSError as ex:\n                 self.notify('Failed to paste hardlink: View log for more info',\n                             bad=True, exception=ex)\n@@ -1538,7 +1538,7 @@\n         else:\n             if not exists(target_path) \\\n                     or stat(source_path).st_ino != stat(target_path).st_ino:\n-                link(source_path,\n+                symlink(source_path,\n                      next_available_filename(target_path))\n \n     def paste(self, overwrite=False, append=False):\n"
  },
  {
    "path": "packages/ranger/ranger.patch",
    "content": "diff -u -r ../ranger-1.7.0/ranger/config/commands.py ./ranger/config/commands.py\n--- ../ranger-1.7.0/ranger/config/commands.py\t2015-04-13 18:25:24.000000000 -0400\n+++ ./ranger/config/commands.py\t2015-04-25 04:11:34.899100939 -0400\n@@ -868,7 +868,7 @@\n         script_was_edited = (script_content != cmdfile.read())\n \n         # Do the renaming\n-        self.fm.run(['/bin/sh', cmdfile.name], flags='w')\n+        self.fm.run(['@TERMUX_PREFIX@/bin/sh', cmdfile.name], flags='w')\n         cmdfile.close()\n \n         # Retag the files, but only if the script wasn't changed during review,\ndiff -u -r ../ranger-1.7.0/ranger/ext/rifle.py ./ranger/ext/rifle.py\n--- ../ranger-1.7.0/ranger/ext/rifle.py\t2015-04-13 18:25:24.000000000 -0400\n+++ ./ranger/ext/rifle.py\t2015-04-25 04:10:19.259100887 -0400\n@@ -341,7 +341,7 @@\n                 if 'r' in flags:\n                     prefix = ['sudo', '-E', 'su', '-mc']\n                 else:\n-                    prefix = ['/bin/sh', '-c']\n+                    prefix = ['@TERMUX_PREFIX@/bin/sh', '-c']\n \n                 cmd = prefix + [command]\n                 if 't' in flags:\n"
  },
  {
    "path": "packages/rclone/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://rclone.org/\nTERMUX_PKG_DESCRIPTION=\"rsync for cloud storage\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.50.2\nTERMUX_PKG_SRCURL=https://github.com/rclone/rclone/releases/download/v${TERMUX_PKG_VERSION}/rclone-v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=6dd8998a72514d3820d241ae46dc609c0305b742aee3db6aaf6017b46c996091\n\ntermux_step_make_install() {\n\tcd $TERMUX_PKG_SRCDIR\n\n\ttermux_setup_golang\n\n\tmkdir -p .gopath/src/github.com/rclone\n\tln -sf \"$PWD\" .gopath/src/github.com/rclone/rclone\n\texport GOPATH=\"$PWD/.gopath\"\n\n\t# google.golang.org/grpc/internal/syscall does not build with GO111MODULE=on\n\t# Remove when possible\n\texport GO111MODULE=off\n\tgo build -v -o rclone\n\n\t# XXX: Fix read-only files which prevents removal of src dir.\n\tchmod u+w -R .\n\n\tcp rclone $TERMUX_PREFIX/bin/rclone\n\tmkdir -p $TERMUX_PREFIX/share/man/man1/\n\tcp rclone.1 $TERMUX_PREFIX/share/man/man1/\n}\n"
  },
  {
    "path": "packages/rcs/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/s/rcs\nTERMUX_PKG_DESCRIPTION=\"The GNU Revision Control System\n The Revision Control System (RCS) manages multiple\n revisions of files. RCS automates the storing, retrieval,\n logging, identification, and merging of revisions. RCS is\n useful for text that is revised frequently, for example\n programs, documentation, graphics, papers, and form letters.\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=5.9.4\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://gnu.uberglobalmirror.com/rcs/rcs-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_SHA256=063d5a0d7da1821754b80c639cdae2c82b535c8ff4131f75dc7bbf0cd63a5dff\nTERMUX_PKG_DEPENDS=\"diffutils\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_path_DIFF=$TERMUX_PREFIX/bin/diff \\\nac_cv_path_DIFF3=$TERMUX_PREFIX/bin/diff3\"\n"
  },
  {
    "path": "packages/rcs/noreturn.patch",
    "content": "From 260704a9164dd34cf7128d6b1e88075ffa3be054 Mon Sep 17 00:00:00 2001\nFrom: Thien-Thi Nguyen <ttn@gnu.org>\nDate: Thu, 18 Jun 2015 19:25:53 +0000\nSubject: [C slog] Move ‘exiting’ to beginning of func decl.\n\nApparently, ‘gcc --std=c11’ does not abide the ‘exiting’\nattribute appearing at the end of the func decl.\nReported by Romain Francoise.\nSee also <https://bugs.debian.org/778100>.\n\n* src/b-complain.h (generic_fatal, fatal_syntax, fatal_sys)\n* src/b-fb.h (Ierror, Oerror)\n* src/base.h (unexpected_EOF, thank_you_and_goodnight):\nMove ‘exiting’ attribute to beginning of func decl.\n---\ndiff --git a/src/b-complain.h b/src/b-complain.h\nindex 0ffd157..ea0ffc5 100644\n--- a/src/b-complain.h\n+++ b/src/b-complain.h\n@@ -32,12 +32,14 @@ extern void generic_warn (char const *who, char const *fmt, ...)\n   printf_string (2, 3);\n extern void generic_error (char const *who, char const *fmt, ...)\n   printf_string (2, 3);\n+exiting\n extern void generic_fatal (char const *who, char const *fmt, ...)\n-  printf_string (2, 3) exiting;\n+  printf_string (2, 3);\n+exiting\n extern void fatal_syntax (size_t lno, char const *fmt, ...)\n-  printf_string (2, 3) exiting;\n-extern void fatal_sys (char const *who)\n-  exiting;\n+  printf_string (2, 3);\n+exiting\n+extern void fatal_sys (char const *who);\n \n /* Idioms.  Here, prefix P stands for \"program\" (general operation);\n    M for \"manifestation\"; R for \"repository\".  */\ndiff --git a/src/b-fb.h b/src/b-fb.h\nindex c9850e7..bf5eaf8 100644\n--- a/src/b-fb.h\n+++ b/src/b-fb.h\n@@ -21,9 +21,11 @@\n */\n \n extern int change_mode (int fd, mode_t mode);\n-extern void Ierror (void) exiting;\n+exiting\n+extern void Ierror (void);\n extern void testIerror (FILE *f);\n-extern void Oerror (void) exiting;\n+exiting\n+extern void Oerror (void);\n extern void testOerror (FILE *o);\n extern FILE *fopen_safer (char const *filename, char const *type);\n extern void Ozclose (FILE **p);\ndiff --git a/src/base.h b/src/base.h\nindex 163ee09..5e7a9f8 100644\n--- a/src/base.h\n+++ b/src/base.h\n@@ -755,8 +755,8 @@ int dorewrite (bool lockflag, int changed);\n int donerewrite (int changed, time_t newRCStime);\n void ORCSclose (void);\n void ORCSerror (void);\n-void unexpected_EOF (void)\n-  exiting;\n+exiting\n+void unexpected_EOF (void);\n void initdiffcmd (struct diffcmd *dc);\n int getdiffcmd (struct fro *finfile, bool delimiter,\n                 FILE *foutfile, struct diffcmd *dc);\n@@ -831,8 +831,8 @@ char const *date2str (char const date[datesize],\n                       char datebuf[datesize + zonelenmax]);\n \n /* rcsutil */\n-void thank_you_and_goodnight (int const how)\n-  exiting;\n+exiting\n+void thank_you_and_goodnight (int const how);\n /* These are for ‘thank_you_and_goodnight’.  */\n #define TYAG_ORCSERROR     (1 << 3)\n #define TYAG_DIRTMPUNLINK  (1 << 2)\n--\ncgit v0.9.0.2\n"
  },
  {
    "path": "packages/readline/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=\"https://tiswww.case.edu/php/chet/readline/rltop.html\"\nTERMUX_PKG_DESCRIPTION=\"Library that allow users to edit command lines as they are typed in\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses\"\nTERMUX_PKG_BREAKS=\"bash (<< 5.0), readline-dev\"\nTERMUX_PKG_REPLACES=\"readline-dev\"\n_MAIN_VERSION=8.0\n_PATCH_VERSION=1\nTERMUX_PKG_VERSION=$_MAIN_VERSION.$_PATCH_VERSION\nTERMUX_PKG_SHA256=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/readline/readline-${_MAIN_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-curses --enable-multibyte bash_cv_wcwidth_broken=no\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"SHLIB_LIBS=-lncursesw\"\nTERMUX_PKG_CONFFILES=\"etc/inputrc\"\n\ntermux_step_pre_configure() {\n\tdeclare -A PATCH_CHECKSUMS\n\tPATCH_CHECKSUMS[001]=d8e5e98933cf5756f862243c0601cb69d3667bb33f2c7b751fe4e40b2c3fd069\n\tfor PATCH_NUM in $(seq -f '%03g' ${_PATCH_VERSION}); do\n\t\tPATCHFILE=$TERMUX_PKG_CACHEDIR/readline_patch_${PATCH_NUM}.patch\n\t\ttermux_download \\\n\t\t\t\"http://mirrors.kernel.org/gnu/readline/readline-$_MAIN_VERSION-patches/readline${_MAIN_VERSION/./}-$PATCH_NUM\" \\\n\t\t\t$PATCHFILE \\\n\t\t\t${PATCH_CHECKSUMS[$PATCH_NUM]}\n\t\tpatch -p0 -i $PATCHFILE\n\tdone\n\n\tCFLAGS+=\" -fexceptions\"\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/lib/pkgconfig\n\tcp readline.pc $TERMUX_PREFIX/lib/pkgconfig/\n\n\tmkdir -p $TERMUX_PREFIX/etc\n\tcp $TERMUX_PKG_BUILDER_DIR/inputrc $TERMUX_PREFIX/etc/\n}\n"
  },
  {
    "path": "packages/readline/inputrc",
    "content": "# Be 8 bit clean.\nset input-meta on\nset output-meta on\n\n# some defaults / modifications for the emacs mode\n$if mode=emacs\n\n# allow the use of the Home/End keys\n\"\\e[1~\": beginning-of-line\n\"\\e[2~\": quoted-insert\n\n# allow the use of the Delete/Insert keys\n\"\\e[3~\": delete-char\n\"\\e[4~\": end-of-line\n\n# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving \n\"\\e[1;5C\": forward-word\n\"\\e[1;5D\": backward-word\n\"\\e[5C\": forward-word\n\"\\e[5D\": backward-word\n\n\"\\e[8~\": end-of-line\n\n$endif\n"
  },
  {
    "path": "packages/readline/rlconf.h.patch",
    "content": "--- readline-8.0/rlconf.h\t2017-02-21 20:55:30.000000000 +0530\n+++ readline-8.0-mod/rlconf.h\t2019-02-20 20:45:45.583654990 +0530\n@@ -43,7 +43,7 @@\n #define DEFAULT_INPUTRC \"~/.inputrc\"\n \n /* The ultimate last-ditch filename for an init file -- system-wide. */\n-#define SYS_INPUTRC \"/etc/inputrc\"\n+#define SYS_INPUTRC \"@TERMUX_PREFIX@/etc/inputrc\"\n \n /* If defined, expand tabs to spaces. */\n #define DISPLAY_TABS\n"
  },
  {
    "path": "packages/redir/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/troglobit/redir\nTERMUX_PKG_DESCRIPTION=\"TCP port redirector for UNIX\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.3\nTERMUX_PKG_SHA256=7ce53ac52a24c1b3279b994bfffbd429c44df2db10a4b1a0f54e108604fdae6e\nTERMUX_PKG_SRCURL=https://github.com/troglobit/redir/releases/download/v$TERMUX_PKG_VERSION/redir-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/applications share/pixmaps\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-llog\"\n}\n"
  },
  {
    "path": "packages/redir/redir.c.patch",
    "content": "diff -u -r ../redir-3.2/redir.c ./redir.c\n--- ../redir-3.2/redir.c\t2018-03-10 12:21:06.000000000 +0100\n+++ ./redir.c\t2018-06-26 05:34:44.517378133 +0200\n@@ -184,6 +184,29 @@\n \treturn code;\n }\n \n+#ifdef __ANDROID__\n+typedef struct _code {\n+\tchar *c_name;\n+\tint c_val;\n+} CODE;\n+\n+CODE prioritynames[] =\n+  {\n+    { \"alert\", LOG_ALERT },\n+    { \"crit\", LOG_CRIT },\n+    { \"debug\", LOG_DEBUG },\n+    { \"emerg\", LOG_EMERG },\n+    { \"err\", LOG_ERR },\n+    { \"error\", LOG_ERR },\n+    { \"info\", LOG_INFO },\n+    { \"notice\", LOG_NOTICE },\n+    { \"panic\", LOG_EMERG },\n+    { \"warn\", LOG_WARNING },\n+    { \"warning\", LOG_WARNING },\n+    { NULL, -1 }\n+  };\n+#endif\n+\n static int loglvl(char *level)\n {\n \tint i;\n"
  },
  {
    "path": "packages/redis/bio.c.patch",
    "content": "--- ../../build/redis/cache/redis-3.2.8/src/bio.c\t2017-02-12 16:14:57.000000000 +0100\n+++ ./src/bio.c\t2017-03-02 22:46:52.999274254 +0100\n@@ -151,8 +151,8 @@\n \n     /* Make the thread killable at any time, so that bioKillThreads()\n      * can work reliably. */\n-    pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n-    pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);\n+    //pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);\n+    //pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);\n \n     pthread_mutex_lock(&bio_mutex[type]);\n     /* Block SIGALRM so we are sure that only the main thread will\n@@ -213,15 +213,19 @@\n     int err, j;\n \n     for (j = 0; j < BIO_NUM_OPS; j++) {\n-        if (pthread_cancel(bio_threads[j]) == 0) {\n-            if ((err = pthread_join(bio_threads[j],NULL)) != 0) {\n-                serverLog(LL_WARNING,\n-                    \"Bio thread for job type #%d can be joined: %s\",\n-                        j, strerror(err));\n-            } else {\n-                serverLog(LL_WARNING,\n-                    \"Bio thread for job type #%d terminated\",j);\n-            }\n-        }\n+        pthread_kill(bio_threads[j], 0);\n+        serverLog(LL_WARNING,\n+            \"Bio thread for job type #%d terminated\",j);\n+\n+        //if (pthread_cancel(bio_threads[j]) == 0) {\n+        //    if ((err = pthread_join(bio_threads[j],NULL)) != 0) {\n+        //        serverLog(LL_WARNING,\n+        //            \"Bio thread for job type #%d can be joined: %s\",\n+        //                j, strerror(err));\n+        //    } else {\n+        //        serverLog(LL_WARNING,\n+        //            \"Bio thread for job type #%d terminated\",j);\n+        //    }\n+        //}\n     }\n }\n"
  },
  {
    "path": "packages/redis/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://redis.io/\nTERMUX_PKG_DESCRIPTION=\"In-memory data structure store used as a database, cache and message broker\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=5.0.7\nTERMUX_PKG_SRCURL=http://download.redis.io/releases/redis-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=61db74eabf6801f057fd24b590232f2f337d422280fd19486eca03be87d3a82b\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_CONFFILES=\"etc/redis.conf\"\n\ntermux_step_pre_configure() {\n\texport PREFIX=$TERMUX_PREFIX\n\texport USE_JEMALLOC=no\n\n\tif [ $TERMUX_ARCH = \"i686\" ]; then\n\t\tsed -i 's/FINAL_LIBS=-lm/FINAL_LIBS=-llog -lm -latomic/' $TERMUX_PKG_SRCDIR/src/Makefile\n\telse\n\t\tsed -i 's/FINAL_LIBS=-lm/FINAL_LIBS=-llog -lm/' $TERMUX_PKG_SRCDIR/src/Makefile\n\tfi\n}\n\ntermux_step_post_make_install() {\n\tinstall -Dm600 $TERMUX_PKG_SRCDIR/redis.conf $TERMUX_PREFIX/etc/redis.conf\n}\n"
  },
  {
    "path": "packages/redis/config.h.patch",
    "content": "--- ../../build/redis/cache/redis-3.2.8/src/config.h\t2017-02-12 16:14:57.000000000 +0100\n+++ ./src/config.h\t2017-03-02 22:42:23.207883845 +0100\n@@ -96,7 +96,7 @@\n \n /* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use\n  * the plain fsync() call. */\n-#ifdef __linux__\n+#ifdef __android__\n #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)\n #if (LINUX_VERSION_CODE >= 0x020611 && __GLIBC_PREREQ(2, 6))\n #define HAVE_SYNC_FILE_RANGE 1\n"
  },
  {
    "path": "packages/redis/redis.conf.patch",
    "content": "diff -u -r ../redis-5.0.0/redis.conf ./redis.conf\n--- ../redis-5.0.0/redis.conf\t2018-10-17 15:31:39.000000000 +0000\n+++ ./redis.conf\t2018-10-18 17:33:32.672423453 +0000\n@@ -98,7 +98,7 @@\n # will silently truncate it to the value of /proc/sys/net/core/somaxconn so\n # make sure to raise both the value of somaxconn and tcp_max_syn_backlog\n # in order to get the desired effect.\n-tcp-backlog 511\n+tcp-backlog 127\n \n # Unix socket.\n #\n@@ -528,7 +528,7 @@\n ################################### CLIENTS ####################################\n \n # Set the max number of connected clients at the same time. By default\n-# this limit is set to 10000 clients, however if the Redis server is not\n+# this limit is set to 512 clients, however if the Redis server is not\n # able to configure the process file limit to allow for the specified limit\n # the max number of allowed clients is set to the current file limit\n # minus 32 (as Redis reserves a few file descriptors for internal uses).\n@@ -536,7 +536,7 @@\n # Once the limit is reached Redis will close all the new connections sending\n # an error 'max number of clients reached'.\n #\n-# maxclients 10000\n+# maxclients 512\n \n ############################## MEMORY MANAGEMENT ################################\n \n"
  },
  {
    "path": "packages/redis/src-Makefile.patch",
    "content": "diff -u -r ../redis-5.0.0/src/Makefile ./src/Makefile\n--- ../redis-5.0.0/src/Makefile\t2018-10-17 15:31:39.000000000 +0000\n+++ ./src/Makefile\t2018-10-18 17:20:36.811751940 +0000\n@@ -100,7 +100,7 @@\n else\n \t# All the other OSes (notably Linux)\n \tFINAL_LDFLAGS+= -rdynamic\n-\tFINAL_LIBS+=-ldl -pthread -lrt\n+\tFINAL_LIBS+=-ldl\n endif\n endif\n endif\n"
  },
  {
    "path": "packages/redis/src-server.h.patch",
    "content": "diff -u -r ../redis-5.0.0/src/server.h ./src/server.h\n--- ../redis-5.0.0/src/server.h\t2018-10-17 15:31:39.000000000 +0000\n+++ ./src/server.h\t2018-10-18 17:32:04.424841206 +0000\n@@ -84,7 +84,7 @@\n #define CONFIG_MAX_HZ            500\n #define MAX_CLIENTS_PER_CLOCK_TICK 200          /* HZ is adapted based on that. */\n #define CONFIG_DEFAULT_SERVER_PORT        6379  /* TCP port. */\n-#define CONFIG_DEFAULT_TCP_BACKLOG       511    /* TCP listen backlog. */\n+#define CONFIG_DEFAULT_TCP_BACKLOG       127    /* TCP listen backlog. */\n #define CONFIG_DEFAULT_CLIENT_TIMEOUT       0   /* Default client timeout: infinite */\n #define CONFIG_DEFAULT_DBNUM     16\n #define CONFIG_MAX_LINE    1024\n@@ -100,7 +100,7 @@\n #define AOF_READ_DIFF_INTERVAL_BYTES (1024*10)\n #define CONFIG_DEFAULT_SLOWLOG_LOG_SLOWER_THAN 10000\n #define CONFIG_DEFAULT_SLOWLOG_MAX_LEN 128\n-#define CONFIG_DEFAULT_MAX_CLIENTS 10000\n+#define CONFIG_DEFAULT_MAX_CLIENTS 512\n #define CONFIG_AUTHPASS_MAX_LEN 512\n #define CONFIG_DEFAULT_SLAVE_PRIORITY 100\n #define CONFIG_DEFAULT_REPL_TIMEOUT 60\n"
  },
  {
    "path": "packages/remind/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://dianne.skoll.ca/projects/remind/\nTERMUX_PKG_DESCRIPTION=\"Sophisticated calendar and alarm program\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.1.17\nTERMUX_PKG_SHA256=c955c196ffd368720fc4af91823f88d66a47be8d28736f279918ab64a460fe51\nTERMUX_PKG_SRCURL=https://dianne.skoll.ca/projects/remind/download/remind-0${TERMUX_PKG_VERSION:0:1}.0${TERMUX_PKG_VERSION:2:1}.${TERMUX_PKG_VERSION:4:2}.tar.gz\nTERMUX_PKG_DEPENDS=\"libandroid-glob\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/tkremind share/man/man1/tkremind.1 bin/cm2rem.tcl share/man/man1/cm2rem.1\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n"
  },
  {
    "path": "packages/resolv-conf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://man7.org/linux/man-pages/man5/resolv.conf.5.html\nTERMUX_PKG_DESCRIPTION=\"Resolver configuration file\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_VERSION=1.2\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_CONFFILES=\"etc/resolv.conf\"\n\ntermux_step_make_install() {\n\t_RESOLV_CONF=$TERMUX_PREFIX/etc/resolv.conf\n\tprintf \"nameserver 8.8.8.8\\nnameserver 8.8.4.4\" > $_RESOLV_CONF\n}\n"
  },
  {
    "path": "packages/restic/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://restic.net/\nTERMUX_PKG_DESCRIPTION=\"Fast, secure, efficient backup program\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.9.6\n# Use a snapshot to fix building with go 1.13:\n#TERMUX_PKG_SRCURL=https://github.com/restic/restic/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SRCURL=https://github.com/restic/restic/archive/604b18aa7426148a55f76307ca729e829ff6b61d.zip\nTERMUX_PKG_SHA256=e1d8c977c541d9503a6aba643cf10896f0de488a20db96f162a3e91a4e9def70\nTERMUX_PKG_SUGGESTS=\"openssh, rclone\"\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/github.com/restic\n\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/restic/restic\n\tcd \"$GOPATH\"/src/github.com/restic/restic\n\n\t(\n\t\t# Separately building for host so we can generate manpages.\n\t\tunset GOOS GOARCH CGO_LDFLAGS\n\t\tunset CC CXX CFLAGS CXXFLAGS LDFLAGS\n\t\tgo build -ldflags \"-X 'main.version=${TERMUX_PKG_VERSION}'\" ./cmd/...\n\t\t./restic generate --man doc/man\n\t\trm -f ./restic\n\t)\n\n\tgo build -ldflags \"-X 'main.version=${TERMUX_PKG_VERSION}'\" ./cmd/...\n}\n\ntermux_step_make_install() {\n\tcd \"$GOPATH\"/src/github.com/restic/restic\n\tinstall -Dm700 restic \"$TERMUX_PREFIX\"/bin/restic\n\tinstall -Dm600 -t \"$TERMUX_PREFIX/share/man/man1/\" doc/man/*.1\n}\n"
  },
  {
    "path": "packages/rgbds/Makefile.patch",
    "content": "diff -u -r ../rgbds-0.3.8/Makefile ./Makefile\n--- ../rgbds-0.3.8/Makefile\t2018-12-10 23:19:36.000000000 +0000\n+++ ./Makefile\t2019-03-10 21:52:48.763105448 +0000\n@@ -11,7 +11,7 @@\n Q\t\t:= @\n PREFIX\t\t:= /usr/local\n bindir\t\t:= ${PREFIX}/bin\n-mandir\t\t:= ${PREFIX}/man\n+mandir\t\t:= ${PREFIX}/share/man\n STRIP\t\t:= -s\n BINMODE\t\t:= 555\n MANMODE\t\t:= 444\n@@ -29,7 +29,6 @@\n WARNFLAGS\t:= -Wall\n \n # Overridable CFLAGS\n-CFLAGS\t\t:= -g\n # Non-overridable CFLAGS\n REALCFLAGS\t:= ${CFLAGS} ${WARNFLAGS} -std=c99 -D_POSIX_C_SOURCE=200809L \\\n \t\t   -Iinclude -DBUILD_VERSION_STRING=\\\"${VERSION_STRING}\\\"\n"
  },
  {
    "path": "packages/rgbds/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://rednex.github.io/rgbds/\nTERMUX_PKG_DESCRIPTION=\"Rednex Game Boy Development System\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.3.9\nTERMUX_PKG_SHA256=e58af4aa548b2a6f799da8db6ea951e2dbbc7a70a56b7539a0eea80e2b0dbbf3\nTERMUX_PKG_SRCURL=https://github.com/rednex/rgbds/releases/download/v${TERMUX_PKG_VERSION}/rgbds-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libpng, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"PREFIX=${TERMUX_PREFIX} Q= STRIP=\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $LDFLAGS\"\n}\n"
  },
  {
    "path": "packages/rhash/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/rhash/RHash\nTERMUX_PKG_DESCRIPTION=\"Console utility for calculation and verification of magnet links and a wide range of hash sums\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.3.8\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=be536a56acfefc87dbc8b1db30fc639020e41edf05518185ea98630e3df7c04c\nTERMUX_PKG_BREAKS=\"rhash-dev\"\nTERMUX_PKG_REPLACES=\"rhash-dev\"\nTERMUX_PKG_SRCURL=https://github.com/rhash/RHash/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_CONFLICTS=\"librhash, rhash-dev\"\nTERMUX_PKG_REPLACES=\"librhash, rhash-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-static --enable-lib-static --enable-lib-shared\"\n\ntermux_step_make() {\n\tCFLAGS=\"-DOPENSSL_RUNTIME $CPPFLAGS $CFLAGS\"\n\tmake -j $TERMUX_MAKE_PROCESSES \\\n\t\tADDCFLAGS=\"$CFLAGS\" \\\n\t\tADDLDFLAGS=\"$LDFLAGS\"\n}\n\ntermux_step_make_install() {\n\tmake install install-pkg-config\n\tmake -C librhash install-lib-headers\n\n\tln -sf $TERMUX_PREFIX/lib/librhash.so.0 $TERMUX_PREFIX/lib/librhash.so\n}\n"
  },
  {
    "path": "packages/rhash/configure.patch",
    "content": "diff -u -r ../RHash-1.3.6/configure ./configure\n--- ../RHash-1.3.6/configure\t2018-03-14 02:42:17.000000000 +0100\n+++ ./configure\t2018-04-22 21:56:37.741263688 +0200\n@@ -193,8 +193,7 @@\n     BUILD_EXTRA_LDFLAGS=$(get_opt_value $OPT)\n     ;;\n   *)\n-      echo \"unknown option $OPT\"\n-      exit 1\n+      echo \"WARNING: unknown option $OPT\"\n       ;;\n   esac\n   shift\n"
  },
  {
    "path": "packages/rhash/librhash-byte_order.h.patch",
    "content": "diff -u -r ../RHash-1.3.6/librhash/byte_order.h ./librhash/byte_order.h\n--- ../RHash-1.3.6/librhash/byte_order.h\t2018-03-14 02:42:17.000000000 +0100\n+++ ./librhash/byte_order.h\t2018-04-22 21:55:52.997763406 +0200\n@@ -14,6 +14,10 @@\n #endif\n \n \n+#ifdef __ANDROID__\n+# include <sys/endian.h>\n+#endif\n+\n #ifdef __cplusplus\n extern \"C\" {\n #endif\n"
  },
  {
    "path": "packages/rhash/parse_cmdline.c.patch",
    "content": "diff -uNr RHash-1.3.8/parse_cmdline.c RHash-1.3.8.mod/parse_cmdline.c\n--- RHash-1.3.8/parse_cmdline.c\t2019-02-04 06:05:28.000000000 +0200\n+++ RHash-1.3.8.mod/parse_cmdline.c\t2019-03-01 20:33:22.425704712 +0200\n@@ -547,7 +547,7 @@\n static const char* find_conf_file(void)\n {\n #ifndef SYSCONFDIR\n-# define SYSCONFDIR \"/etc\"\n+# define SYSCONFDIR \"@TERMUX_PREFIX@/etc\"\n #endif\n #define CONFIG_FILENAME \"rhashrc\"\n\n"
  },
  {
    "path": "packages/ripgrep/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/BurntSushi/ripgrep\nTERMUX_PKG_DESCRIPTION=\"Search tool like grep and The Silver Searcher\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=11.0.2\nTERMUX_PKG_SHA256=0983861279936ada8bc7a6d5d663d590ad34eb44a44c75c2d6ccd0ab33490055\nTERMUX_PKG_SRCURL=https://github.com/BurntSushi/ripgrep/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_make_install() {\n\t# Install man page:\n\tmkdir -p $TERMUX_PREFIX/share/man/man1/\n\tcp $(find . -name rg.1) $TERMUX_PREFIX/share/man/man1/\n\n\t# Install bash completion script:\n\tmkdir -p $TERMUX_PREFIX/share/bash-completion/completions/\n\tcp $(find . -name rg.bash) $TERMUX_PREFIX/share/bash-completion/completions/rg\n\n\t# Install fish completion script:\n\tmkdir -p $TERMUX_PREFIX/share/fish/completions/\n\tcp $(find . -name rg.fish) $TERMUX_PREFIX/share/fish/completions/\n\n\t# Install zsh completion script:\n\tmkdir -p $TERMUX_PREFIX/share/zsh/site-functions/\n\tcp complete/_rg $TERMUX_PREFIX/share/zsh/site-functions/\n}\n"
  },
  {
    "path": "packages/rlwrap/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/hanslub42/rlwrap\nTERMUX_PKG_DESCRIPTION=\"Wrapper using readline to enable editing of keyboard input for commands\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.43\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://fossies.org/linux/privat/rlwrap-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=4ed39d0399a82942e2edc9feed6e7736f898c58d531d47ce543a063c17f41f22\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_grantpt=yes\nac_cv_func_unlockpt=yes\nac_cv_lib_util_openpty=no\nptyttylib_cv_ptys=STREAMS\n\"\nTERMUX_PKG_DEPENDS=\"ncurses, readline\"\n"
  },
  {
    "path": "packages/rlwrap/fix-hardcoded-paths.patch",
    "content": "diff -uNr rlwrap-0.43/src/rlwrap.h rlwrap-0.43.mod/src/rlwrap.h\n--- rlwrap-0.43/src/rlwrap.h\t2017-03-02 16:09:14.000000000 +0200\n+++ rlwrap-0.43.mod/src/rlwrap.h\t2017-09-14 16:53:27.022854383 +0300\n@@ -515,7 +515,7 @@\n \n #include \"malloc_debug.h\" /* malloc_debug.{c,h} not ready for prime time */\n \n-#define DEBUG_FILENAME \"/tmp/rlwrap.debug\"\n+#define DEBUG_FILENAME \"@TERMUX_PREFIX@/tmp/rlwrap.debug\"\n #define KA_BOOM  {char *p = (char *) 1; *p = 'c';} /* dump core right here  */ \n #define KA_SCRUNCH {volatile int x=1, y=0; x = x/y;} /* force a SIGFPE */\n #define KA_SCREECH kill(getpid(),SIGTRAP);        /* enter the debugger - use it to set (conditional) breakpoints from within C code: if (condition) KA_SCREECH; */\ndiff -uNr rlwrap-0.43/src/utils.c rlwrap-0.43.mod/src/utils.c\n--- rlwrap-0.43/src/utils.c\t2017-03-02 21:57:51.000000000 +0200\n+++ rlwrap-0.43.mod/src/utils.c\t2017-09-14 16:53:58.962854360 +0300\n@@ -306,7 +306,7 @@\n \n \n int open_unique_tempfile(const char *suffix, char **tmpfile_name) {\n-  char **tmpdirs = list4(getenv(\"TMPDIR\"), getenv(\"TMP\"), getenv(\"TEMP\"), \"/tmp\");\n+  char **tmpdirs = list4(getenv(\"TMPDIR\"), getenv(\"TMP\"), getenv(\"TEMP\"), \"@TERMUX_PREFIX@/tmp\");\n   char *tmpdir = first_of(tmpdirs);\n   int tmpfile_fd;\n \n"
  },
  {
    "path": "packages/rlwrap/ptytty.c.patch",
    "content": "diff -u -r ../rlwrap-0.41/src/ptytty.c ./src/ptytty.c\n--- ../rlwrap-0.41/src/ptytty.c\t2014-05-18 13:03:25.000000000 +0200\n+++ ./src/ptytty.c\t2014-07-16 12:39:03.777342023 +0200\n@@ -41,9 +41,6 @@\n #ifdef HAVE_SYS_IOCTL_H\n # include <sys/ioctl.h>\n #endif\n-#if defined(PTYS_ARE_PTMX) && !defined(__CYGWIN32__)\n-# include <sys/stropts.h>       /* for I_PUSH */\n-#endif\n \n \n \n"
  },
  {
    "path": "packages/root-repo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-root-packages\nTERMUX_PKG_DESCRIPTION=\"Package repository containing programs for rooted devices\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=1.5\nTERMUX_PKG_DEPENDS=\"termux-keyring\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/apt/sources.list.d\n\techo \"deb https://dl.bintray.com/grimler/termux-root-packages-24 root stable\" > $TERMUX_PREFIX/etc/apt/sources.list.d/root.list\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"echo Downloading updated package list ...\" >> postinst\n\techo \"apt update\" >> postinst\n\techo \"exit 0\" >> postinst\n}\n"
  },
  {
    "path": "packages/rsync/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://rsync.samba.org/\nTERMUX_PKG_DESCRIPTION=\"Utility that provides fast incremental file transfer\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=3.1.3\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://rsync.samba.org/ftp/rsync/src/rsync-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0\nTERMUX_PKG_DEPENDS=\"libiconv, libpopt, openssh | dropbear, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--with-rsyncd-conf=$TERMUX_PREFIX/etc/rsyncd.conf\n--with-included-zlib=no\n--disable-xattr-support\n--disable-debug\n\"\n\ntermux_step_pre_configure() {\n\tCFLAGS=\"$CFLAGS -llog\" # for syslog\n}\n"
  },
  {
    "path": "packages/rsync/rsync-3.1.3_lib_getpass.c.patch",
    "content": "diff -uNr rsync-3.1.3/lib/getpass.c rsync-3.1.3.mod/lib/getpass.c\n--- rsync-3.1.3/lib/getpass.c\t2013-05-20 01:01:29.000000000 +0300\n+++ rsync-3.1.3.mod/lib/getpass.c\t2018-08-16 13:29:02.517996377 +0300\n@@ -23,6 +23,7 @@\n \n #include \"rsync.h\"\n \n+#ifndef HAVE_GETPASS\n char *getpass(const char *prompt)\n {\n \tstatic char password[256];\n@@ -70,3 +71,4 @@\n \n \treturn NULL;\n }\n+#endif\n"
  },
  {
    "path": "packages/rsync/rsync.h.patch",
    "content": "diff -uNr rsync-3.1.3/rsync.h rsync-3.1.3.mod/rsync.h\n--- rsync-3.1.3/rsync.h\t2018-01-15 20:58:31.000000000 +0200\n+++ rsync-3.1.3.mod/rsync.h\t2019-03-01 22:40:29.926940976 +0200\n@@ -29,7 +29,7 @@\n /* RSYNCD_SYSCONF is now set in config.h */\n #define RSYNCD_USERCONF \"rsyncd.conf\"\n \n-#define DEFAULT_LOCK_FILE \"/var/run/rsyncd.lock\"\n+#define DEFAULT_LOCK_FILE \"@TERMUX_PREFIX@/var/run/rsyncd.lock\"\n #define URL_PREFIX \"rsync://\"\n \n #define SYMLINK_PREFIX \"/rsyncd-munged/\"  /* This MUST have a trailing slash! */\n"
  },
  {
    "path": "packages/rtmpdump/Makefile.patch",
    "content": "diff -u -r ../rtmpdump-2.4/librtmp/Makefile ./librtmp/Makefile\n--- ../rtmpdump-2.4/librtmp/Makefile\t2011-07-11 20:24:33.000000000 -0400\n+++ ./librtmp/Makefile\t2016-09-26 10:28:04.467062011 -0400\n@@ -1,20 +1,14 @@\n VERSION=v2.4\n \n-prefix=/usr/local\n-\n incdir=$(prefix)/include/librtmp\n bindir=$(prefix)/bin\n libdir=$(prefix)/lib\n-mandir=$(prefix)/man\n+mandir=$(prefix)/share/man\n BINDIR=$(DESTDIR)$(bindir)\n INCDIR=$(DESTDIR)$(incdir)\n LIBDIR=$(DESTDIR)$(libdir)\n MANDIR=$(DESTDIR)$(mandir)\n \n-CC=$(CROSS_COMPILE)gcc\n-LD=$(CROSS_COMPILE)ld\n-AR=$(CROSS_COMPILE)ar\n-\n SYS=posix\n CRYPTO=OPENSSL\n #CRYPTO=GNUTLS\n@@ -67,8 +61,8 @@\n \n DEF=-DRTMPDUMP_VERSION=\\\"$(VERSION)\\\" $(CRYPTO_DEF) $(XDEF)\n OPT=-O2\n-CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF)\n-LDFLAGS=$(XLDFLAGS)\n+CFLAGS+=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT) $(SO_DEF)\n+LDFLAGS+=$(XLDFLAGS)\n \n \n OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o\ndiff -u -r ../rtmpdump-2.4/Makefile ./Makefile\n--- ../rtmpdump-2.4/Makefile\t2011-07-11 20:24:33.000000000 -0400\n+++ ./Makefile\t2016-09-26 10:54:28.163216901 -0400\n@@ -1,10 +1,5 @@\n VERSION=v2.4\n \n-prefix=/usr/local\n-\n-CC=$(CROSS_COMPILE)gcc\n-LD=$(CROSS_COMPILE)ld\n-\n SYS=posix\n #SYS=mingw\n \n@@ -21,12 +16,12 @@\n \n DEF=-DRTMPDUMP_VERSION=\\\"$(VERSION)\\\" $(CRYPTO_DEF) $(XDEF)\n OPT=-O2\n-CFLAGS=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT)\n-LDFLAGS=-Wall $(XLDFLAGS)\n+CFLAGS+=-Wall $(XCFLAGS) $(INC) $(DEF) $(OPT)\n+LDFLAGS+=-Wall $(XLDFLAGS)\n \n bindir=$(prefix)/bin\n sbindir=$(prefix)/sbin\n-mandir=$(prefix)/man\n+mandir=$(prefix)/share/man\n \n BINDIR=$(DESTDIR)$(bindir)\n SBINDIR=$(DESTDIR)$(sbindir)\n@@ -38,7 +33,7 @@\n LIB_RTMP=-Llibrtmp -lrtmp\n LIBS=$(LIB_RTMP) $(CRYPTO_LIB) $(LIBS_$(SYS)) $(XLIBS)\n \n-THREADLIB_posix=-lpthread\n+THREADLIB_posix=\n THREADLIB_darwin=-lpthread\n THREADLIB_mingw=\n THREADLIB=$(THREADLIB_$(SYS))\n"
  },
  {
    "path": "packages/rtmpdump/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://rtmpdump.mplayerhq.hu/\nTERMUX_PKG_DESCRIPTION=\"Small dumper for media content streamed over the RTMP protocol\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\n# NOTE: Special handling of unofficial support for openssl 1.1 from\n# https://gitlab.com/JudgeZarbi/RTMPDump-OpenSSL-1.1\nTERMUX_PKG_VERSION=2.4\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://gitlab.com/JudgeZarbi/RTMPDump-OpenSSL-1.1/-/archive/019592918b0f961104eaf71b56c1db0fa26ed497/RTMPDump-OpenSSL-1.1-019592918b0f961104eaf71b56c1db0fa26ed497.tar.bz2\nTERMUX_PKG_SHA256=42978d5b1cfe9fe4e01305f81c183935056a6c1ad46b9cd2e582f9147196fa87\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"openssl, zlib\"\nTERMUX_PKG_BREAKS=\"rtmpdump-dev\"\nTERMUX_PKG_REPLACES=\"rtmpdump-dev\"\nTERMUX_PKG_MAINTAINER=\"Pierre Rudloff @Rudloff\"\n"
  },
  {
    "path": "packages/ruby/Makefile.in.patch",
    "content": "diff -u -r ../ruby-2.3.0/Makefile.in ./Makefile.in\n--- ../ruby-2.3.0/Makefile.in\t2015-12-19 20:15:12.000000000 -0500\n+++ ./Makefile.in\t2015-12-25 15:58:35.632836837 -0500\n@@ -240,7 +240,7 @@\n $(LIBRUBY_SO):\n \t\t@-$(PRE_LIBRUBY_UPDATE)\n \t\t$(ECHO) linking shared-library $@\n-\t\t$(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@\n+\t\t$(Q) $(LDSHARED) $(LDFLAGS) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@\n \t\t-$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)ruby_static_id_*' \\\n \t\t\t-L '$(SYMBOL_PREFIX)*_threadptr_*' $@\n \t\t$(Q) $(POSTLINK)\n"
  },
  {
    "path": "packages/ruby/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.ruby-lang.org/\nTERMUX_PKG_DESCRIPTION=\"Dynamic programming language with a focus on simplicity and productivity\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\n_MAJOR_VERSION=2.6\nTERMUX_PKG_VERSION=${_MAJOR_VERSION}.5\nTERMUX_PKG_SHA256=d5d6da717fd48524596f9b78ac5a2eeb9691753da5c06923a6c31190abe01a62\nTERMUX_PKG_SRCURL=https://cache.ruby-lang.org/pub/ruby/${_MAJOR_VERSION}/ruby-${TERMUX_PKG_VERSION}.tar.xz\n# libbffi is used by the fiddle extension module:\nTERMUX_PKG_DEPENDS=\"libandroid-support, libffi, libgmp, readline, openssl, libyaml, zlib\"\nTERMUX_PKG_BREAKS=\"ruby-dev\"\nTERMUX_PKG_REPLACES=\"ruby-dev\"\n# Needed to fix compilation on android:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_func_setgroups=no ac_cv_func_setresuid=no ac_cv_func_setreuid=no --enable-rubygems\"\n# The gdbm module seems to be very little used:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --without-gdbm\"\n# Do not link in libcrypt.so if available (now in disabled-packages):\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_lib_crypt_crypt=no\"\n# Fix DEPRECATED_TYPE macro clang compatibility:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" rb_cv_type_deprecated=x\"\n# getresuid(2) does not work on ChromeOS - https://github.com/termux/termux-app/issues/147:\n# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_getresuid=no\"\n\ntermux_step_pre_configure() {\n\tif [ \"$TERMUX_ARCH_BITS\" = 32 ]; then\n\t\t# process.c:function timetick2integer: error: undefined reference to '__mulodi4'\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" rb_cv_builtin___builtin_mul_overflow=no\"\n\tfi\n}\n\ntermux_step_make_install() {\n\tmake install\n\tmake uninstall # remove possible remains to get fresh timestamps\n\tmake install\n\n\tlocal RBCONFIG=$TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/rbconfig.rb\n\n\t# Fix absolute paths to executables:\n\tperl -p -i -e 's/^.*CONFIG\\[\"INSTALL\"\\].*$/  CONFIG[\"INSTALL\"] = \"install -c\"/' $RBCONFIG\n\tperl -p -i -e 's/^.*CONFIG\\[\"PKG_CONFIG\"\\].*$/  CONFIG[\"PKG_CONFIG\"] = \"pkg-config\"/' $RBCONFIG\n\tperl -p -i -e 's/^.*CONFIG\\[\"MAKEDIRS\"\\].*$/  CONFIG[\"MAKEDIRS\"] = \"mkdir -p\"/' $RBCONFIG\n\tperl -p -i -e 's/^.*CONFIG\\[\"MKDIR_P\"\\].*$/  CONFIG[\"MKDIR_P\"] = \"mkdir -p\"/' $RBCONFIG\n\tperl -p -i -e 's/^.*CONFIG\\[\"EGREP\"\\].*$/  CONFIG[\"EGREP\"] = \"grep -E\"/' $RBCONFIG\n\tperl -p -i -e 's/^.*CONFIG\\[\"GREP\"\\].*$/  CONFIG[\"GREP\"] = \"grep\"/' $RBCONFIG\n}\n\ntermux_step_post_massage() {\n\tif [ ! -f $TERMUX_PREFIX/lib/ruby/${_MAJOR_VERSION}.0/${TERMUX_HOST_PLATFORM}/readline.so ]; then\n\t\techo \"Error: The readline extension was not built\"\n\tfi\n}\n"
  },
  {
    "path": "packages/ruby/ext-etc-etc.c.patch",
    "content": "diff -u -r ../ruby-2.4.0/ext/etc/etc.c ./ext/etc/etc.c\n--- ../ruby-2.4.0/ext/etc/etc.c\t2016-06-02 14:21:42.000000000 +0200\n+++ ./ext/etc/etc.c\t2017-01-18 04:18:25.912737382 +0100\n@@ -651,7 +651,7 @@\n     if (!len) return Qnil;\n     tmpdir = rb_w32_conv_from_wchar(path, rb_filesystem_encoding());\n #else\n-    const char default_tmp[] = \"/tmp\";\n+    const char default_tmp[] = \"@TERMUX_PREFIX@/tmp\";\n     const char *tmpstr = default_tmp;\n     size_t tmplen = strlen(default_tmp);\n # if defined _CS_DARWIN_USER_TEMP_DIR\n"
  },
  {
    "path": "packages/ruby/ext-syslog-extconf.rb.patch",
    "content": "diff -u -r ../ruby-2.4.1/ext/syslog/extconf.rb ./ext/syslog/extconf.rb\n--- ../ruby-2.4.1/ext/syslog/extconf.rb\t2015-12-16 06:31:54.000000000 +0100\n+++ ./ext/syslog/extconf.rb\t2017-04-26 22:52:43.683243769 +0200\n@@ -7,5 +7,6 @@\n have_header(\"syslog.h\") &&\n   have_func(\"openlog\") &&\n   have_func(\"setlogmask\") &&\n+  have_library(\"log\", \"__android_log_write\") &&\n   create_makefile(\"syslog\")\n \n"
  },
  {
    "path": "packages/ruby/fix-paths.patch",
    "content": "diff -uNr ruby-2.4.2/addr2line.c ruby-2.4.2.mod/addr2line.c\n--- ruby-2.4.2/addr2line.c\t2016-10-18 18:09:08.000000000 +0300\n+++ ruby-2.4.2.mod/addr2line.c\t2017-09-15 12:00:56.242805138 +0300\n@@ -451,7 +451,7 @@\n     /* Ideally we should check 4 paths to follow gnu_debuglink,\n        but we handle only one case for now as this format is used\n        by some linux distributions. See GDB's info for detail. */\n-    static const char global_debug_dir[] = \"/usr/lib/debug\";\n+    static const char global_debug_dir[] = \"@TERMUX_PREFIX@/lib/debug\";\n     const size_t global_debug_dir_len = sizeof(global_debug_dir) - 1;\n     char *p;\n \ndiff -uNr ruby-2.4.2/dln_find.c ruby-2.4.2.mod/dln_find.c\n--- ruby-2.4.2/dln_find.c\t2016-06-02 19:52:15.000000000 +0300\n+++ ruby-2.4.2.mod/dln_find.c\t2017-09-15 12:00:28.522805158 +0300\n@@ -72,6 +72,10 @@\n \n     if (!path) {\n \tpath =\n+        \"@TERMUX_PREFIX@/bin\" PATH_SEP\n+        \"@TERMUX_PREFIX@/bin/applets\" PATH_SEP\n+        \"/system/xbin\" PATH_SEP\n+        \"/system/bin\" PATH_SEP\n \t    \"/usr/local/bin\" PATH_SEP\n \t    \"/usr/ucb\" PATH_SEP\n \t    \"/usr/bin\" PATH_SEP\ndiff -uNr ruby-2.4.2/lib/drb/gw.rb ruby-2.4.2.mod/lib/drb/gw.rb\n--- ruby-2.4.2/lib/drb/gw.rb\t2015-12-16 07:07:31.000000000 +0200\n+++ ruby-2.4.2.mod/lib/drb/gw.rb\t2017-09-15 12:06:04.592804917 +0300\n@@ -99,8 +99,8 @@\n \n front = DRb::GW.new\n \n-s1 = DRb::DRbServer.new('drbunix:/tmp/gw_b_a', front)\n-s2 = DRb::DRbServer.new('drbunix:/tmp/gw_b_c', front)\n+s1 = DRb::DRbServer.new('drbunix:@TERMUX_PREFIX@/tmp/gw_b_a', front)\n+s2 = DRb::DRbServer.new('drbunix:@TERMUX_PREFIX@/tmp/gw_b_c', front)\n \n s1.thread.join\n s2.thread.join\n@@ -131,9 +131,9 @@\n require 'foo'\n \n obj = Foo.new('a')\n-DRb.start_service(\"drbunix:/tmp/gw_a\", obj)\n+DRb.start_service(\"drbunix:@TERMUX_PREFIX@/tmp/gw_a\", obj)\n \n-robj = DRbObject.new_with_uri('drbunix:/tmp/gw_b_a')\n+robj = DRbObject.new_with_uri('drbunix:@TERMUX_PREFIX@/tmp/gw_b_a')\n robj[:a] = obj\n \n DRb.thread.join\n@@ -146,9 +146,9 @@\n \n foo = Foo.new('c', nil)\n \n-DRb.start_service(\"drbunix:/tmp/gw_c\", nil)\n+DRb.start_service(\"drbunix:@TERMUX_PREFIX@/tmp/gw_c\", nil)\n \n-robj = DRbObject.new_with_uri(\"drbunix:/tmp/gw_b_c\")\n+robj = DRbObject.new_with_uri(\"drbunix:@TERMUX_PREFIX@/tmp/gw_b_c\")\n \n puts \"c->b\"\n a = robj[:a]\ndiff -uNr ruby-2.4.2/lib/mkmf.rb ruby-2.4.2.mod/lib/mkmf.rb\n--- ruby-2.4.2/lib/mkmf.rb\t2017-09-15 11:42:55.362805911 +0300\n+++ ruby-2.4.2.mod/lib/mkmf.rb\t2017-09-15 13:57:38.032800130 +0300\n@@ -1551,7 +1551,7 @@\n     if path ||= ENV['PATH']\n       path = path.split(File::PATH_SEPARATOR)\n     else\n-      path = %w[/usr/local/bin /usr/ucb /usr/bin /bin]\n+      path = %w[@TERMUX_PREFIX@/bin @TERMUX_PREFIX@/bin/applets /system/xbin /system/bin /usr/local/bin /usr/ucb /usr/bin /bin]\n     end\n     file = nil\n     path.each do |dir|\ndiff -uNr ruby-2.4.2/lib/resolv.rb ruby-2.4.2.mod/lib/resolv.rb\n--- ruby-2.4.2/lib/resolv.rb\t2016-11-24 01:57:30.000000000 +0200\n+++ ruby-2.4.2.mod/lib/resolv.rb\t2017-09-15 13:49:49.152800465 +0300\n@@ -172,7 +172,7 @@\n       require 'win32/resolv'\n       DefaultFileName = Win32::Resolv.get_hosts_path\n     rescue LoadError\n-      DefaultFileName = '/etc/hosts'\n+      DefaultFileName = '@TERMUX_PREFIX@/etc/hosts'\n     end\n \n     ##\n@@ -957,7 +957,7 @@\n         return { :nameserver => nameserver, :search => search, :ndots => ndots }\n       end\n \n-      def Config.default_config_hash(filename=\"/etc/resolv.conf\")\n+      def Config.default_config_hash(filename=\"@TERMUX_PREFIX@/etc/resolv.conf\")\n         if File.exist? filename\n           config_hash = Config.parse_resolv_conf(filename)\n         else\ndiff -uNr ruby-2.4.2/lib/webrick/config.rb ruby-2.4.2.mod/lib/webrick/config.rb\n--- ruby-2.4.2/lib/webrick/config.rb\t2016-12-07 14:59:48.000000000 +0200\n+++ ruby-2.4.2.mod/lib/webrick/config.rb\t2017-09-15 12:03:02.402805048 +0300\n@@ -35,7 +35,7 @@\n       :Logger         => nil,   # default: WEBrick::Log.new\n       :ServerSoftware => \"WEBrick/#{WEBrick::VERSION} \" +\n                          \"(Ruby/#{RUBY_VERSION}/#{RUBY_RELEASE_DATE})\",\n-      :TempDir        => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp',\n+      :TempDir        => ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'@TERMUX_PREFIX@/tmp',\n       :DoNotListen    => false,\n       :StartCallback  => nil,\n       :StopCallback   => nil,\n"
  },
  {
    "path": "packages/ruby/lib-rubygems-install_update_options.rb.patch",
    "content": "diff -u -r ../ruby-2.4.0/lib/rubygems/install_update_options.rb ./lib/rubygems/install_update_options.rb\n--- ../ruby-2.4.0/lib/rubygems/install_update_options.rb\t2016-04-06 08:01:14.000000000 +0200\n+++ ./lib/rubygems/install_update_options.rb\t2017-01-31 22:48:03.877466602 +0100\n@@ -232,7 +232,7 @@\n   # Default options for the gem install command.\n \n   def install_update_defaults_str\n-    '--document=rdoc,ri --wrappers'\n+    '--document=rdoc,ri --wrappers,--env-shebang'\n   end\n \n end\n"
  },
  {
    "path": "packages/ruby/lib-tmpdir.rb.patch",
    "content": "diff -u -r ../ruby-2.4.0/lib/tmpdir.rb ./lib/tmpdir.rb\n--- ../ruby-2.4.0/lib/tmpdir.rb\t2016-02-26 03:11:14.000000000 +0100\n+++ ./lib/tmpdir.rb\t2017-01-18 04:13:47.675833299 +0100\n@@ -13,7 +13,7 @@\n \n class Dir\n \n-  @@systmpdir ||= defined?(Etc.systmpdir) ? Etc.systmpdir : '/tmp'\n+  @@systmpdir ||= defined?(Etc.systmpdir) ? Etc.systmpdir : '@TERMUX_PREFIX@/tmp'\n \n   ##\n   # Returns the operating system's temporary file path.\n@@ -23,7 +23,7 @@\n       @@systmpdir.dup\n     else\n       tmp = nil\n-      [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.'].each do |dir|\n+      [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '@TERMUX_PREFIX@/tmp', '.'].each do |dir|\n         next if !dir\n         dir = File.expand_path(dir)\n         if stat = File.stat(dir) and stat.directory? and stat.writable? and\n@@ -120,7 +120,7 @@\n \n     def create(basename, tmpdir=nil, max_try: nil, **opts)\n       if $SAFE > 0 and tmpdir.tainted?\n-        tmpdir = '/tmp'\n+        tmpdir = '@TERMUX_PREFIX@/tmp'\n       else\n         tmpdir ||= tmpdir()\n       end\n"
  },
  {
    "path": "packages/ruby/mkmf.rb.patch",
    "content": "diff -u -r ../ruby-2.4.1/lib/mkmf.rb ./lib/mkmf.rb\n--- ../ruby-2.4.1/lib/mkmf.rb\t2017-03-11 19:46:17.000000000 +0100\n+++ ./lib/mkmf.rb\t2017-08-21 01:04:18.918432148 +0200\n@@ -500,7 +500,7 @@\n     if $universal and (arch_flag = conf['ARCH_FLAG']) and !arch_flag.empty?\n       conf['ARCH_FLAG'] = arch_flag.gsub(/(?:\\G|\\s)-arch\\s+\\S+/, '')\n     end\n-    RbConfig::expand(\"$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}\",\n+    RbConfig::expand(\"$(CPP) #$INCFLAGS #$CPPFLAGS #{opt} #{CONFTEST_C} #{outfile}\",\n                      conf)\n   end\n \n@@ -1894,7 +1894,7 @@\n     vpath = $VPATH.dup\n     CONFIG[\"hdrdir\"] ||= $hdrdir\n     mk << %{\n-SHELL = /bin/sh\n+SHELL = @TERMUX_PREFIX@/bin/sh\n \n # V=0 quiet, V=1 verbose.  other values don't work.\n V = 0\n"
  },
  {
    "path": "packages/ruby/process.c.patch",
    "content": "diff -u -r ../ruby-2.6.1/process.c ./process.c\n--- ../ruby-2.6.1/process.c\t2018-12-22 10:23:06.000000000 +0000\n+++ ./process.c\t2019-02-16 09:27:04.713434722 +0000\n@@ -1569,9 +1569,9 @@\n     *argv = (char *)prog;\n     *--argv = (char *)\"sh\";\n     if (envp)\n-        execve(\"/bin/sh\", argv, envp); /* async-signal-safe */\n+        execve(\"@TERMUX_PREFIX@/bin/sh\", argv, envp); /* async-signal-safe */\n     else\n-        execv(\"/bin/sh\", argv); /* async-signal-safe (since SUSv4) */\n+        execv(\"@TERMUX_PREFIX@/bin/sh\", argv); /* async-signal-safe (since SUSv4) */\n }\n \n #else\n@@ -1639,9 +1639,9 @@\n     }\n #else\n     if (envp_str)\n-        execle(\"/bin/sh\", \"sh\", \"-c\", str, (char *)NULL, RB_IMEMO_TMPBUF_PTR(envp_str)); /* async-signal-safe */\n+        execle(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", str, (char *)NULL, RB_IMEMO_TMPBUF_PTR(envp_str)); /* async-signal-safe */\n     else\n-        execl(\"/bin/sh\", \"sh\", \"-c\", str, (char *)NULL); /* async-signal-safe (since SUSv4) */\n+        execl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", str, (char *)NULL); /* async-signal-safe (since SUSv4) */\n #endif\t/* _WIN32 */\n     return errno;\n }\n@@ -1744,7 +1744,7 @@\n     if (status == -1 && errno == ENOEXEC) {\n \t*argv = (char *)prog;\n \t*--argv = (char *)\"sh\";\n-\tstatus = spawnv(P_NOWAIT, \"/bin/sh\", (const char **)argv);\n+\tstatus = spawnv(P_NOWAIT, \"@TERMUX_PREFIX@/bin/sh\", (const char **)argv);\n \tafter_exec();\n \tif (status == -1) errno = ENOEXEC;\n     }\n@@ -1782,7 +1782,7 @@\n \n     char *shell = dln_find_exe_r(\"sh\", 0, fbuf, sizeof(fbuf));\n     before_exec();\n-    status = spawnl(P_NOWAIT, (shell ? shell : \"/bin/sh\"), \"sh\", \"-c\", str, (char*)NULL);\n+    status = spawnl(P_NOWAIT, (shell ? shell : \"@TERMUX_PREFIX@/bin/sh\"), \"sh\", \"-c\", str, (char*)NULL);\n     after_exec();\n     return status;\n }\n"
  },
  {
    "path": "packages/ruby/pty.c.patch",
    "content": "diff -u -r ../ruby-2.4.0/ext/pty/pty.c ./ext/pty/pty.c\n--- ../ruby-2.4.0/ext/pty/pty.c\t2016-04-29 21:12:52.000000000 -0400\n+++ ./ext/pty/pty.c\t2017-01-13 07:15:02.848063672 -0500\n@@ -164,7 +164,7 @@\n     char\t\terrbuf[32];\n \n     if (argc == 0) {\n-\tconst char *shellname = \"/bin/sh\";\n+\tconst char *shellname = \"@TERMUX_PREFIX@/bin/sh\";\n \n \tif ((p = getenv(\"SHELL\")) != NULL) {\n \t    shellname = p;\n"
  },
  {
    "path": "packages/ruby/ruby-ri.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"share/ri share/man/man1/ri.1.gz bin/ri\"\nTERMUX_SUBPKG_DESCRIPTION=\"Ruby documentation index\"\nTERMUX_SUBPKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/ruby/src-signal.c.patch",
    "content": "REG_RSP is an enum value in the NDK so cannot be ifdef checked.\n\ndiff -u -r ../ruby-2.3.1/signal.c ./signal.c\n--- ../ruby-2.3.1/signal.c\t2015-11-23 19:17:11.000000000 -0500\n+++ ./signal.c\t2016-06-17 17:15:18.947494468 -0400\n@@ -771,7 +771,7 @@\n {\n     const DEFINE_MCONTEXT_PTR(mctx, ctx);\n # if defined __linux__\n-#   if defined REG_RSP\n+#   if defined __x86_64__\n     const greg_t sp = mctx->gregs[REG_RSP];\n #   else\n     const greg_t sp = mctx->gregs[REG_ESP];\n"
  },
  {
    "path": "packages/ruby/tests/default_encoding_isutf8.sh",
    "content": "assert_equals '#<Encoding:UTF-8>' $(ruby -e 'p Encoding.default_external')\n"
  },
  {
    "path": "packages/ruby/tests/extension_modules_installed.sh",
    "content": "ruby -e \"require 'readline'\"\nruby -e \"require 'openssl'\"\n"
  },
  {
    "path": "packages/ruby/tool-rbinstall.rb.patch",
    "content": "--- /home/vagrant/ruby-2.5.0/tool/rbinstall.rb\t2017-10-30 05:45:20.000000000 +0000\n+++ src/tool/rbinstall.rb\t2018-02-14 18:53:42.498522407 +0000\n@@ -731,7 +731,7 @@\n end\n \n def install_default_gem(dir, srcdir)\n-  gem_dir = Gem.default_dir\n+  gem_dir = \"@TERMUX_PREFIX@/lib/ruby/gems/2.6.0\"\n   directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)\n   prepare \"default gems from #{dir}\", gem_dir, directories\n \n@@ -765,7 +765,7 @@\n end\n \n install?(:ext, :comm, :gem, :'bundled-gems') do\n-  gem_dir = Gem.default_dir\n+  gem_dir = \"@TERMUX_PREFIX@/lib/ruby/gems/2.6.0\"\n   directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)\n   prepare \"bundled gems\", gem_dir, directories\n   install_dir = with_destdir(gem_dir)\n"
  },
  {
    "path": "packages/rust/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.rust-lang.org/\nTERMUX_PKG_DESCRIPTION=\"Systems programming language focused on safety, speed and concurrency\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Kevin Cotugno @kcotugno\"\nTERMUX_PKG_VERSION=1.39.0\nTERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-$TERMUX_PKG_VERSION-src.tar.xz\nTERMUX_PKG_SHA256=4b0dbb356070687a606034f71dc032b783bbf8b5d3f9fff39f2c1fbc4f171c29\nTERMUX_PKG_DEPENDS=\"libc++, clang, openssl, lld, zlib, libllvm\"\n\ntermux_step_configure() {\n\ttermux_setup_cmake\n\ttermux_setup_rust\n\n\t# it breaks building rust tools without doing this because it tries to find\n\t# ../lib from bin location:\n\t# this is about to get ugly but i have to make sure a rustc in a proper bin lib\n\t# configuration is used otherwise it fails a long time into the build...\n\t# like 30 to 40 + minutes ... so lets get it right\n\n\t# upstream only tests build ver one version behind $TERMUX_PKG_VERSION\n\trustup install 1.38.0\n\texport PATH=$HOME/.rustup/toolchains/1.38.0-x86_64-unknown-linux-gnu/bin:$PATH\n\tlocal RUSTC=$(which rustc)\n\tlocal CARGO=$(which cargo)\n\n\tsed \"s%\\\\@TERMUX_PREFIX\\\\@%$TERMUX_PREFIX%g\" \\\n\t\t$TERMUX_PKG_BUILDER_DIR/config.toml \\\n\t\t| sed \"s%\\\\@TERMUX_STANDALONE_TOOLCHAIN\\\\@%$TERMUX_STANDALONE_TOOLCHAIN%g\" \\\n\t\t| sed \"s%\\\\@triple\\\\@%$CARGO_TARGET_NAME%g\" \\\n\t\t| sed \"s%\\\\@RUSTC\\\\@%$RUSTC%g\" \\\n\t\t| sed \"s%\\\\@CARGO\\\\@%$CARGO%g\" \\\n\t\t> config.toml\n\n\tlocal env_host=$(printf $CARGO_TARGET_NAME | tr a-z A-Z | sed s/-/_/g)\n\texport LD_LIBRARY_PATH=$TERMUX_PKG_BUILDDIR/build/x86_64-unknown-linux-gnu/stage2/lib\n\texport ${env_host}_OPENSSL_DIR=$TERMUX_PREFIX\n\texport X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu\n\texport X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include\n\texport PKG_CONFIG_ALLOW_CROSS=1\n\t# for backtrace-sys\n\texport CC_x86_64_unknown_linux_gnu=gcc\n\texport CFLAGS_x86_64_unknown_linux_gnu=\"-O2\"\n\tunset CC CXX CPP LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS PKG_CONFIG AR RANLIB\n\t# rust checks libs in PREFIX/lib because both host and target are x86_64. It then can't libc.so and libdl.so because rust program doesn't know\n\t# where those are. Putting them temporarly in $PREFIX/lib prevents that failure\n\tif [ $TERMUX_ARCH = \"x86_64\" ]; then\n\t\tcp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/x86_64-linux-android/$TERMUX_PKG_API_LEVEL/libc.so $TERMUX_PREFIX/lib/\n\t\tcp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/x86_64-linux-android/$TERMUX_PKG_API_LEVEL/libdl.so $TERMUX_PREFIX/lib/\n\tfi\n}\n\ntermux_step_make() {\n\treturn 0;\n}\ntermux_step_make_install() {\n\t$TERMUX_PKG_SRCDIR/x.py dist --stage 2 --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown || true\n\t$TERMUX_PKG_SRCDIR/x.py install --stage 2 --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown\n\tcd \"$TERMUX_PREFIX/lib\"\n\trm -f libc.so libdl.so\n\tln -sf rustlib/$CARGO_TARGET_NAME/lib/*.so .\n\tln -sf $TERMUX_PREFIX/bin/lld $TERMUX_PREFIX/bin/rust-lld\n\n\tcd \"$TERMUX_PREFIX/lib/rustlib\"\n\trm -rf components \\\n\t\tinstall.log \\\n\t\tuninstall.sh \\\n\t\trust-installer-version \\\n\t\tmanifest-* \\\n\t\tx86_64-unknown-linux-gnu\n}\n"
  },
  {
    "path": "packages/rust/config.toml",
    "content": "# See documentation at\n# https://github.com/rust-lang/rust/blob/master/config.toml.example\n\n[llvm]\nlink-shared = true\n\n[build]\nhost = [\"@triple@\"]\ntarget = [\"@triple@\", \"wasm32-unknown-unknown\"]\nrustc = \"@RUSTC@\"\ncargo = \"@CARGO@\"\n\npython = \"python2.7\"\nextended = true\nsanitizers = false\n\ntools = [\"cargo\", \"analysis\", \"clippy-driver\" ]\n\n[install]\nprefix = \"@TERMUX_PREFIX@\"\nsysconfdir = \"etc\"\n\n[rust]\noptimize = true\ndebug = false\ncodegen-units = 0\njemalloc = false\nchannel = \"stable\"\nrpath = false\n\n[target.x86_64-unknown-linux-gnu]\nllvm-config = \"/usr/bin/llvm-config-8\"\n\n[target.@triple@]\nandroid-ndk = \"@TERMUX_STANDALONE_TOOLCHAIN@\"\nllvm-config = \"@TERMUX_PREFIX@/bin/llvm-config\"\n\n[dist]\nsrc-tarball = false\n#missing-tools = true\n"
  },
  {
    "path": "packages/rust/os-tmpdir.patch",
    "content": "--- ../rustc-1.29.2-src/src/libstd/sys/unix/os.rs\t2018-10-19 14:12:31.000000000 -0700\n+++ ./src/libstd/sys/unix/os.rs\t2018-10-19 14:11:20.000000000 -0700\n@@ -488,7 +488,7 @@\n pub fn temp_dir() -> PathBuf {\n     ::env::var_os(\"TMPDIR\").map(PathBuf::from).unwrap_or_else(|| {\n         if cfg!(target_os = \"android\") {\n-            PathBuf::from(\"/data/local/tmp\")\n+            PathBuf::from(\"@TERMUX_PREFIX@/tmp\")\n         } else {\n             PathBuf::from(\"/tmp\")\n         }\n"
  },
  {
    "path": "packages/rust/rust-std-wasm32.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"rust std for wasm32-unknown-unknown target\"\nTERMUX_SUBPKG_PLATFORM_INDEPENDENT=true\nTERMUX_SUBPKG_INCLUDE=\"lib/rustlib/wasm32-unknown-unknown\"\nTERMUX_SUBPKG_REVISION=$TERMUX_PKG_REVISION\n"
  },
  {
    "path": "packages/rust/src-librustc_llvm-build.rs.patch",
    "content": "diff -u -r ../rustc-1.34.1-src/src/librustc_llvm/build.rs ./src/librustc_llvm/build.rs\n--- ../rustc-1.34.1-src/src/librustc_llvm/build.rs\t2019-04-24 21:07:08.000000000 +0000\n+++ ./src/librustc_llvm/build.rs\t2019-05-05 20:56:34.090330174 +0000\n@@ -244,6 +244,8 @@\n         \"c++\"\n     } else if target.contains(\"darwin\") {\n         \"c++\"\n+    } else if target.contains(\"android\") {\n+        \"c++_shared\"\n     } else if target.contains(\"netbsd\") && llvm_static_stdcpp.is_some() {\n         // NetBSD uses a separate library when relocation is required\n         \"stdc++_pic\"\n"
  },
  {
    "path": "packages/samefile/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.schweikhardt.net/samefile/\nTERMUX_PKG_DESCRIPTION=\"Finds files with identical contents, independent of file name\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.15\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://www.schweikhardt.net/samefile-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=26d322e3445ff7273867332311c33a90c8ef037cbd6b19d9468e1742833ea4b6\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/sc/Makefile.patch",
    "content": "--- Makefile\t2018-02-23 05:27:24.471990919 +0000\n+++ src/Makefile\t2018-02-23 05:45:28.024744930 +0000\n@@ -20,13 +20,13 @@\n # packaging this with an O/S, for example, you'll probably want to change\n # this to /usr.  Otherwise, /usr/local is probably more appropriate, unless\n # you're replacing the vendor-supplied version.\n-prefix=/usr\n+prefix=@TERMUX_PREFIX@\n \n # This is where the install step puts it.\n EXDIR=${prefix}/bin\n \n # This is where the man page goes.\n-MANDIR=${prefix}/man/man1\n+MANDIR=${prefix}/share/man/man1\n MANEXT=1\n MANMODE=644\n \n@@ -331,13 +331,14 @@\n \n #########################################\n # Use this for Linux\n-CC=gcc\n+# CC=gcc\n # Only use -Wall for testing, since it produces warnings that are of no\n # real effect on the reliability of the program, but may concern some\n # people who don't understand them.\n #CFLAGS=-DSYSV3 -O2 -Wall -pipe\n-CFLAGS=-DSYSV3 -O2 -pipe\n-LIB=-lm -lncurses\n+# CFLAGS=-DSYSV3 -O2 -pipe\n+\n+LIB=-L$(prefix)/lib -lm -lncurses\n \n # All of the source files\n SRC=Makefile abbrev.c cmds.c color.c crypt.c eres.sed frame.c format.c gram.y \\\n@@ -500,15 +501,15 @@\n \n $(EXDIR)/$(name): $(name)\n \tcp $(name) $(EXDIR)\n-\tstrip $(EXDIR)/$(name)\n+\t$(STRIP) $(EXDIR)/$(name)\n \n $(EXDIR)/$(name)qref: $(name)qref\n \tcp $(name)qref $(EXDIR)\n-\tstrip $(EXDIR)/$(name)qref\n+\t$(STRIP) $(EXDIR)/$(name)qref\n \n $(EXDIR)/p$(name): p$(name)\n \tcp p$(name) $(EXDIR)\n-\tstrip $(EXDIR)/p$(name)\n+\t$(STRIP) $(EXDIR)/p$(name)\n \n $(LIBDIR)/tutorial: tutorial.sc $(LIBDIR)\n \t-mkdir -p $(LIBDIR)/plugins\n"
  },
  {
    "path": "packages/sc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=\"http://www.ibiblio.org/pub/Linux/apps/financial/spreadsheet/!INDEX.html\"\nTERMUX_PKG_DESCRIPTION=\"A vi-like spreadsheet calculator\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=7.16\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=http://www.ibiblio.org/pub/Linux/apps/financial/spreadsheet/sc-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=1997a00b6d82d189b65f6fd2a856a34992abc99e50d9ec463bbf1afb750d1765\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"SIMPLE=-DSIMPLE\"\n\ntermux_step_post_configure () {\n\tCFLAGS+=\" -I$TERMUX_PREFIX/include\"\n}\n"
  },
  {
    "path": "packages/sc/cmds.c.patch",
    "content": "--- cmds.c\t2018-02-23 05:38:39.654230131 +0000\n+++ src/cmds.c\t2018-02-23 05:39:23.222435074 +0000\n@@ -2861,12 +2861,12 @@\n \tif ((plugin = findplugin(p+1, 'w')) != NULL) {\n \t    if (!plugin_exists(plugin, strlen(plugin), save + 1)) {\n \t\terror(\"plugin not found\");\n-\t\treturn;\n+\t\treturn 1;\n \t    }\n \t    *save = '|';\n \t    if ((strlen(save) + strlen(fname) + 20) > PATHLEN) {\n \t\terror(\"Path too long\");\n-\t\treturn;\n+\t\treturn 1;\n \t    }\n \t    sprintf(save + strlen(save), \" %s%d:\", coltoa(c0), r0);\n \t    sprintf(save + strlen(save), \"%s%d \\\"%s\\\"\", coltoa(cn), rn, fname);\n@@ -2981,12 +2981,12 @@\n \tif ((plugin = findplugin(p+1, 'r')) != NULL) {\n \t    if (!(plugin_exists(plugin, strlen(plugin), save + 1))) {\n \t\terror(\"plugin not found\");\n-\t\treturn;\n+\t\treturn 1;\n \t    }\n \t    *save = '|';\n \t    if ((strlen(save) + strlen(fname) + 2) > PATHLEN) {\n \t\terror(\"Path too long\");\n-\t\treturn;\n+\t\treturn 1;\n \t    }\n \t    sprintf(save + strlen(save), \" \\\"%s\\\"\", fname);\n \t    eraseflg = 0;\n"
  },
  {
    "path": "packages/sc-im/Makefile.patch",
    "content": "--- src/Makefile\t2018-02-23 06:49:41.666712787 +0000\n+++ src/src/Makefile\t2018-02-23 06:49:53.650717771 +0000\n@@ -2,7 +2,7 @@\n name = scim\n \n # The base directory where everything should be installed.\n-prefix  = /usr/local\n+prefix  = @TERMUX_PREFIX@\n \n EXDIR   = $(prefix)/bin\n HELPDIR = $(prefix)/share/$(name)\n@@ -13,10 +13,11 @@\n \n # Change these to your liking or use `make CC=gcc` etc\n #CC   = cc\n-#YACC = bison -y\n+YACC = bison -y\n #SED  = sed\n \n LDLIBS += -lm\n+LDLIBS += -landroid-support\n \n CFLAGS += -Wall -g\n CFLAGS += -DNCURSES\n@@ -166,6 +167,9 @@\n gram.c : gram.y\n \t$(YACC) -d $<\n \n+gram.y :\n+\t$(YACC) gram.y\n+\n pvmtbl.o: sc.h pvmtbl.c\n \t$(CC) ${CFLAGS} -c -DPSC pvmtbl.c\n \n"
  },
  {
    "path": "packages/sc-im/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/andmarti1424/sc-im\nTERMUX_PKG_DESCRIPTION=\"An improved version of sc, a spreadsheet calculator\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.7.0\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/andmarti1424/sc-im/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=87225918cb6f52bbc068ee6b12eaf176c7c55ba9739b29ca08cb9b6699141cad\nTERMUX_PKG_DEPENDS=\"libandroid-support, libzip, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_configure() {\n\tCFLAGS+=\" $CPPFLAGS -I$TERMUX_PREFIX/include/libandroid-support\"\n\tcp -rf src/* .\n}\n"
  },
  {
    "path": "packages/sc-im/cmds_command.c.patch",
    "content": "--- cmds_command.c\t2018-02-23 06:39:28.313538544 +0000\n+++ src/src/cmds_command.c\t2018-02-23 06:39:49.702839355 +0000\n@@ -46,7 +46,6 @@\n #include <wchar.h>\n #include <stdlib.h>\n #include <ctype.h>         // for isprint()\n-#include <wordexp.h>\n #include \"sc.h\"            // for rescol\n #include \"conf.h\"\n #include \"cmds_command.h\"\n@@ -73,6 +72,23 @@\n #include \"undo.h\"\n #endif\n \n+#define WRDE_NOCMD 0\n+\n+typedef struct {\n+\tsize_t we_wordc;\n+\tchar **we_wordv;\n+\tsize_t we_offs;\n+} wordexp_t;\n+\n+static inline int wordexp(const char *c, wordexp_t *w, int _i)\n+{\n+\treturn -1;\n+}\n+\n+static inline void wordfree(wordexp_t *__wordexp)\n+{\n+}\n+\n extern char * rev;\n extern struct dictionary * user_conf_d;\n \n"
  },
  {
    "path": "packages/sc-im/cmds_normal.c.patch",
    "content": "diff -uNr sc-im-0.7.0/src/cmds_normal.c sc-im-0.7.0.mod/src/cmds_normal.c\n--- sc-im-0.7.0/src/cmds_normal.c\t2017-12-13 19:48:59.000000000 +0200\n+++ sc-im-0.7.0.mod/src/cmds_normal.c\t2019-01-30 21:58:28.431965657 +0200\n@@ -89,6 +89,11 @@\n  * \\return none\n  */\n \n+#ifdef USELOCALE\n+#include <locale.h>\n+#include <langinfo.h>\n+#endif\n+\n void do_normalmode(struct block * buf) {\n     int bs = get_bufsize(buf);\n     struct ent * e;\n@@ -227,8 +232,6 @@\n         case ctl('d'):                      // set date format using current locate D_FMT format\n             {\n         #ifdef USELOCALE\n-            #include <locale.h>\n-            #include <langinfo.h>\n             char * loc = NULL;\n             char * f = NULL;\n             loc = setlocale(LC_TIME, \"\");\n"
  },
  {
    "path": "packages/sc-im/cmds_visual.c.patch",
    "content": "diff -uNr sc-im-0.7.0/src/cmds_visual.c sc-im-0.7.0.mod/src/cmds_visual.c\n--- sc-im-0.7.0/src/cmds_visual.c\t2017-12-13 19:48:59.000000000 +0200\n+++ sc-im-0.7.0.mod/src/cmds_visual.c\t2019-01-30 22:00:04.705760754 +0200\n@@ -141,6 +141,10 @@\n  * \\return none\n  */\n \n+#ifdef USELOCALE\n+#include <locale.h>\n+#include <langinfo.h>\n+#endif\n void do_visualmode(struct block * buf) {\n     // we are moving (previous to a 'C-o' keypress)\n     if (moving == TRUE) {\n@@ -400,8 +404,6 @@\n     // datefmt with locale D_FMT format\n     } else if (buf->value == ctl('d')) {\n         #ifdef USELOCALE\n-            #include <locale.h>\n-            #include <langinfo.h>\n             char * loc = NULL;\n             char * f = NULL;\n             loc = setlocale(LC_TIME, \"\");\n"
  },
  {
    "path": "packages/sc-im/file.c.patch",
    "content": "--- file.c\t2018-02-23 06:39:56.329524606 +0000\n+++ src/src/file.c\t2018-02-23 06:40:14.550410296 +0000\n@@ -53,7 +53,6 @@\n #include <unistd.h>\n #include <wchar.h>\n #include <sys/wait.h>\n-#include <wordexp.h>\n \n #include \"conf.h\"\n #include \"maps.h\"\n@@ -82,6 +81,23 @@\n extern int pthread_exists;\n #endif\n \n+#define WRDE_NOCMD 0\n+\n+typedef struct {\n+\tsize_t we_wordc;\n+\tchar **we_wordv;\n+\tsize_t we_offs;\n+} wordexp_t;\n+\n+static inline int wordexp(const char *c, wordexp_t *w, int _i)\n+{\n+\treturn -1;\n+}\n+\n+static inline void wordfree(wordexp_t *__wordexp)\n+{\n+}\n+\n /**\n  * \\brief Erase the database (tbl, etc.)\n  *\n"
  },
  {
    "path": "packages/sc-im/main.c.patch",
    "content": "--- main.c\t2018-02-23 06:41:58.248538336 +0000\n+++ src/src/main.c\t2018-02-23 06:42:28.433438297 +0000\n@@ -60,7 +60,6 @@\n #include <fcntl.h>   // for F_GETFL O_NONBLOCK F_SETFL\n #include <locale.h>\n #include <wchar.h>\n-#include <wordexp.h>\n #include <sys/ioctl.h> // for ioctl\n \n #include \"main.h\"\n@@ -90,6 +89,23 @@\n #include \"lua.h\"\n #endif\n \n+#define WRDE_NOCMD 0\n+\n+typedef struct {\n+\tsize_t we_wordc;\n+\tchar **we_wordv;\n+\tsize_t we_offs;\n+} wordexp_t;\n+\n+static inline int wordexp(const char *c, wordexp_t *w, int _i)\n+{\n+\treturn -1;\n+}\n+\n+static inline void wordfree(wordexp_t *__wordexp)\n+{\n+}\n+\n int currow = 0; /**< Current row of the selected cell. */\n int curcol = 0; /**< Current column of the selected cell. */\n int lastrow = 0;\n"
  },
  {
    "path": "packages/science-repo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/science-packages\nTERMUX_PKG_DESCRIPTION=\"Package repository containing science software\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=1.0\nTERMUX_PKG_DEPENDS=\"termux-keyring\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/apt/sources.list.d\n\techo \"deb https://dl.bintray.com/grimler/science-packages-24 science stable\" > $TERMUX_PREFIX/etc/apt/sources.list.d/science.list\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"echo Downloading updated package list ...\" >> postinst\n\techo \"apt update\" >> postinst\n\techo \"exit 0\" >> postinst\n}\n"
  },
  {
    "path": "packages/screen/attacher.c.patch",
    "content": "--- ../cache/screen-4.4.0/attacher.c\t2016-06-19 19:41:03.000000000 +0000\n+++ ./attacher.c\t2016-12-20 06:59:46.351839178 +0000\n@@ -921,7 +933,6 @@\n #endif\n \n   debug(\"screen_builtin_lck looking in gcos field\\n\");\n-  strncpy(fullname, ppp->pw_gecos, sizeof(fullname) - 9);\n   fullname[sizeof(fullname) - 9] = 0;\n \n   if ((cp1 = index(fullname, ',')) != NULL)\n"
  },
  {
    "path": "packages/screen/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/screen/\nTERMUX_PKG_DESCRIPTION=\"Terminal multiplexer with VT100/ANSI terminal emulation\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.7.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/screen/screen-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=da775328fa783bd2a787d722014dbd99c6093effc11f337827604c2efc5d20c1\nTERMUX_PKG_DEPENDS=\"ncurses, libcrypt\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-socket-dir\n--enable-colors256\n--with-ssl=openssl\n\"\n\ntermux_step_pre_configure() {\n\t# Run autoreconf since we have patched configure.ac\n\tautoconf\n\tCFLAGS+=\" -DGETUTENT\"\n\texport LIBS=\"-lcrypt -llog\"\n}\n\ntermux_step_post_configure() {\n\techo '#define HAVE_SVR4_PTYS 1' >> $TERMUX_PKG_BUILDDIR/config.h\n\techo 'mousetrack on' > \"$TERMUX_PREFIX/etc/screenrc\"\n}\n"
  },
  {
    "path": "packages/screen/config.h.in.patch",
    "content": "diff -u -r ../screen-4.5.1/config.h.in ./config.h.in\n--- ../screen-4.5.1/config.h.in\t2017-02-25 16:36:04.156952072 +0100\n+++ ./config.h.in\t2017-04-24 23:19:53.515909451 +0200\n@@ -192,7 +192,9 @@\n  * If screen is installed with permissions to update /etc/utmp (such\n  * as if it is installed set-uid root), define UTMPOK.\n  */\n-#define UTMPOK\n+#ifndef __ANDROID__\n+# define UTMPOK\n+#endif\n \n /* Set LOGINDEFAULT to one (1)\n  * if you want entries added to /etc/utmp by default, else set it to\n"
  },
  {
    "path": "packages/screen/fileio.c.patch",
    "content": "diff -u -r ../screen-4.5.1/fileio.c ./fileio.c\n--- ../screen-4.5.1/fileio.c\t2017-02-25 16:35:35.132808149 +0100\n+++ ./fileio.c\t2017-04-24 23:26:50.355204362 +0200\n@@ -721,8 +721,8 @@\n #ifdef SIGPIPE\n       signal(SIGPIPE, SIG_DFL);\n #endif\n-      execl(\"/bin/sh\", \"sh\", \"-c\", cmd, (char *)0);\n-      Panic(errno, \"/bin/sh\");\n+      execl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", cmd, (char *)0);\n+      Panic(errno, \"@TERMUX_PREFIX@/bin/sh\");\n     default:\n       break;\n   }\n"
  },
  {
    "path": "packages/screen/misc.c.patch",
    "content": "--- ../cache/screen-4.4.0/misc.c\t2016-06-19 19:41:03.000000000 +0000\n+++ ./misc.c\t2016-12-20 03:13:04.387236649 +0000\n@@ -37,7 +37,6 @@\n #ifdef SVR4\n # include <sys/resource.h>\n #endif\n-\n extern struct layer *flayer;\n \n extern int eff_uid, real_uid;\n@@ -379,6 +378,8 @@\n #endif /* SVR4 */\n #if defined(SYSV) && defined(NOFILE) && !defined(ISC)\n   f = NOFILE;\n+#elif defined(__ANDROID__)\n+  f = sysconf(_SC_OPEN_MAX);\n #else /* SYSV && !ISC */\n   f = getdtablesize();\n #endif /* SYSV && !ISC */\n"
  },
  {
    "path": "packages/screen/no-setuid.patch",
    "content": "diff -uNr screen-4.7.0/Makefile.in screen-4.7.0.mod/Makefile.in\n--- screen-4.7.0/Makefile.in\t2019-10-02 01:07:59.000000000 +0300\n+++ screen-4.7.0.mod/Makefile.in\t2019-10-14 02:12:59.469022341 +0300\n@@ -65,13 +65,13 @@\n \ttermcap.c input.c attacher.c pty.c process.c display.c comm.c \\\n \tkmapdef.c acls.c braille.c braille_tsi.c logfile.c layer.c \\\n \tsched.c teln.c nethack.c encoding.c canvas.c layout.c viewport.c \\\n-\tlist_display.c list_generic.c list_window.c\n+\tlist_display.c list_generic.c list_window.c setuid.c\n OFILES=\tscreen.o ansi.o fileio.o mark.o misc.o resize.o socket.o \\\n \tsearch.o tty.o term.o window.o utmp.o loadav.o putenv.o help.o \\\n \ttermcap.o input.o attacher.o pty.o process.o display.o comm.o \\\n \tkmapdef.o acls.o braille.o braille_tsi.o logfile.o layer.o \\\n \tlist_generic.o list_display.o list_window.o \\\n-\tsched.o teln.o nethack.o encoding.o canvas.o layout.o viewport.o\n+\tsched.o teln.o nethack.o encoding.o canvas.o layout.o viewport.o setuid.o\n \n all:\tscreen\n \ndiff -uNr screen-4.7.0/setuid.c screen-4.7.0.mod/setuid.c\n--- screen-4.7.0/setuid.c\t1970-01-01 03:00:00.000000000 +0300\n+++ screen-4.7.0.mod/setuid.c\t2019-10-14 02:14:35.810387228 +0300\n@@ -0,0 +1,25 @@\n+#include <pwd.h>\n+\n+int setuid(uid_t uid) {\n+\treturn 0;\n+}\n+\n+int setgid(gid_t gid) {\n+\treturn 0;\n+}\n+\n+int seteuid(gid_t gid) {\n+\treturn 0;\n+}\n+\n+int setegid(gid_t gid) {\n+\treturn 0;\n+}\n+\n+int setresuid(uid_t ruid, uid_t euid, uid_t suid) {\n+\treturn 0;\n+}\n+\n+int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {\n+\treturn 0;\n+}\n"
  },
  {
    "path": "packages/screen/os.h.patch",
    "content": "--- ../cache/screen-4.4.0/os.h\t2016-06-19 19:41:03.000000000 +0000\n+++ ./os.h\t2016-12-20 02:03:49.513365234 +0000\n@@ -129,15 +129,17 @@\n #ifdef SYSV\n # define index strchr\n # define rindex strrchr\n+#ifndef __ANDROID__\n # define bzero(poi,len) memset(poi,0,len)\n+#endif \n # define bcmp memcmp\n # define killpg(pgrp,sig) kill( -(pgrp), sig)\n #endif\n-\n #ifndef HAVE_GETCWD\n # define getcwd(b,l) getwd(b)\n #endif\n \n+#ifndef __ANDROID__\n #ifndef USEBCOPY\n # ifdef USEMEMMOVE\n #  define bcopy(s,d,len) memmove(d,s,len)\n@@ -150,6 +152,8 @@\n #  endif\n # endif\n #endif\n+#endif\n+\n \n #if defined(HAVE_SETRESUID) && !defined(HAVE_SETREUID)\n # define setreuid(ruid, euid) setresuid(ruid, euid, -1)\n"
  },
  {
    "path": "packages/screen/osdef.h.in.patch",
    "content": "--- ../cache/screen-4.4.0/osdef.h.in\t2016-06-19 19:41:03.000000000 +0000\n+++ ./osdef.h.in\t2016-12-20 06:56:21.153724184 +0000\n@@ -133,8 +133,9 @@\n extern char *getwd __P((char *));\n extern char *getenv __P((char *));\n extern time_t time __P((time_t *));\n-\n+#ifndef __ANDROID__\n extern char *getpass __P((char *));\n+#endif\n extern char *getlogin __P((void));\n extern char *ttyname __P((int));\n \n"
  },
  {
    "path": "packages/screen/screen.h.patch",
    "content": "--- ../cache/screen-4.4.0/screen.h\t2016-06-19 19:41:03.000000000 +0000\n+++ ./screen.h\t2016-12-20 04:29:51.331170619 +0000\n@@ -104,9 +104,9 @@\n #define MAXHISTHEIGHT\t\t3000\n #define DEFAULTHISTHEIGHT\t100\n #if defined(NAME_MAX) && NAME_MAX < 16\n-# define DEFAULT_BUFFERFILE     \"/tmp/screen-xchg\"\n+# define DEFAULT_BUFFERFILE     \"@TERMUX_PREFIX@/tmp/screen-xchg\"\n #else\n-# define DEFAULT_BUFFERFILE\t\"/tmp/screen-exchange\"\n+# define DEFAULT_BUFFERFILE\t\"@TERMUX_PREFIX@/tmp/screen-exchange\"\n #endif\n \n \n"
  },
  {
    "path": "packages/screen/utmp.c.patch",
    "content": "--- ../cache/screen-4.4.0/utmp.c\t2016-06-19 19:41:03.000000000 +0000\n+++ ./utmp.c\t2016-12-20 04:10:53.775426042 +0000\n@@ -33,11 +33,13 @@\n #include \"config.h\"\n #include \"screen.h\"\n #include \"extern.h\"\n-\n+#include \"os.h\"\n #ifdef HAVE_UTEMPTER\n #include <utempter.h>\n #endif\n-\n+#ifdef __ANDROID__\n+#define DEAD_PROCESS 8\n+#endif\n \n extern struct display *display;\n #ifdef CAREFULUTMP\n@@ -94,11 +96,12 @@\n static int  initutmp __P((void));\n static void setutent __P((void));\n #endif\n+#ifndef __ANDROID__\n #if defined(linux) && defined(GETUTENT)\n static struct utmp *xpututline __P((struct utmp *utmp));\n # define pututline xpututline\n #endif\n-\n+#endif\n \n static int utmpok;\n static char UtmpName[] = UTMPFILE;\n@@ -558,7 +561,6 @@\n   bzero((char *)&u, sizeof(u));\n   strncpy(u.ut_line, slot, sizeof(u.ut_line));\n   setutent();\n-  return getutline(&u);\n }\n \n static int\n@@ -872,7 +874,7 @@\n   return *retbuf ? retbuf : NULL;\n }\n # endif /* BUGGYGETLOGIN */\n-\n+#ifndef __ANDROID__\n #if defined(linux) && defined(GETUTENT)\n # undef pututline\n \n@@ -890,4 +892,5 @@\n   return u->ut_type == u2->ut_type ? u : 0;\n }\n #endif\n+#endif\n \n"
  },
  {
    "path": "packages/screen/window.c.patch",
    "content": "diff -u -r ../screen-4.7.0/window.c ./window.c\n--- ../screen-4.7.0/window.c\t2019-10-01 22:08:00.000000000 +0000\n+++ ./window.c\t2019-10-02 19:42:56.044224400 +0000\n@@ -112,9 +112,9 @@\n \n int VerboseCreate = 0;\t\t/* XXX move this to user.h */\n \n-char DefaultShell[] = \"/bin/sh\";\n+char DefaultShell[] = \"@TERMUX_PREFIX@/bin/login\";\n #ifndef HAVE_EXECVPE\n-static char DefaultPath[] = \":/usr/ucb:/bin:/usr/bin\";\n+static char DefaultPath[] = \":@TERMUX_PREFIX@/bin\";\n #endif\n \n /* keep this in sync with the structure definition in window.h */\n"
  },
  {
    "path": "packages/screenfetch/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/KittyKatt/screenFetch\nTERMUX_PKG_DESCRIPTION=\"Bash Screenshot Information Tool\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_DEPENDS=\"bash\"\nTERMUX_PKG_VERSION=3.9.1\nTERMUX_PKG_SRCURL=https://github.com/KittyKatt/screenFetch/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=aa97dcd2a8576ae18de6c16c19744aae1573a3da7541af4b98a91930a30a3178\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_MAINTAINER=\"Pierre Rudloff @Rudloff\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n    install screenfetch-dev ${TERMUX_PREFIX}/bin/screenfetch\n    install screenfetch.1 ${TERMUX_PREFIX}/share/man/man1/\n}\n"
  },
  {
    "path": "packages/screenfetch/screenfetch-dev.patch",
    "content": "diff -u -r ../screenFetch-3.9.0/screenfetch-dev ./screenfetch-dev\n--- ../screenFetch-3.9.0/screenfetch-dev\t2019-09-28 09:52:10.000000000 +0000\n+++ ./screenfetch-dev\t2019-10-06 08:11:06.979812728 +0000\n@@ -1566,7 +1566,7 @@\n \t\t\thwmonfile=\"\"\n \t\t\t[ -e \"$dir/name\" ] && hwmonfile=$dir/name\n \t\t\t[ -e \"$dir/device/name\" ] && hwmonfile=$dir/device/name\n-\t\t\t[ -n \"$hwmonfile\" ] && if grep -q 'coretemp' \"$hwmonfile\"; then\n+\t\t\t[ -n \"$hwmonfile\" ] && [ -r \"$hwmonfile\" ] && if grep -q 'coretemp' \"$hwmonfile\"; then\n \t\t\t\tthermal=\"$dir/temp1_input\"\n \t\t\t\tbreak\n \t\t\tfi\n"
  },
  {
    "path": "packages/scrypt/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tarsnap.com/scrypt.html\nTERMUX_PKG_DESCRIPTION=\"scrypt KDF library and file encryption tool\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_VERSION=1.3.0\nTERMUX_PKG_SRCURL=https://www.tarsnap.com/scrypt/scrypt-1.2.1.tgz\nTERMUX_PKG_SHA256=4621f5e7da2f802e20850436219370092e9fcda93bd598f6d4236cce33f4c577\nTERMUX_PKG_DEPENDS=\"openssl\"\n"
  },
  {
    "path": "packages/sdcv/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://dushistov.github.io/sdcv/\nTERMUX_PKG_DESCRIPTION=\"StarDict Console Version\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.5.2\nTERMUX_PKG_REVISION=10\nTERMUX_PKG_SRCURL=https://github.com/Dushistov/sdcv/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=ec08dc084a0748d5a89df01a20bbf294f09b0366295cd418000f15d2e043c4f7\nTERMUX_PKG_DEPENDS=\"glib, libc++, readline, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DENABLE_NLS=off\"\n"
  },
  {
    "path": "packages/sdcv/src-mapfile.hpp.patch",
    "content": "diff -uNr sdcv-0.5.2/src/mapfile.hpp sdcv-0.5.2.mod/src/mapfile.hpp\n--- sdcv-0.5.2/src/mapfile.hpp\t2017-08-16 10:14:23.000000000 +0300\n+++ sdcv-0.5.2.mod/src/mapfile.hpp\t2019-01-20 17:11:14.779052646 +0200\n@@ -6,6 +6,7 @@\n \n #ifdef HAVE_MMAP\n #include <fcntl.h>\n+#include <unistd.h>\n #include <sys/mman.h>\n #include <sys/types.h>\n #endif\n"
  },
  {
    "path": "packages/seafile-client/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://seafile.com\nTERMUX_PKG_DESCRIPTION=\"Seafile is a file syncing and sharing software with file encryption and group sharing\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=7.0.4\nTERMUX_PKG_SRCURL=https://github.com/haiwen/seafile/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=d33d6de57b9dc8083aecde78abbd00684f7cda6a36ec8fd00749c7c8236a2a8e\nTERMUX_PKG_DEPENDS=\"ccnet, libcurl\"\nTERMUX_PKG_BREAKS=\"seafile-client-dev\"\nTERMUX_PKG_REPLACES=\"seafile-client-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n\texport CPPFLAGS=\"-I$TERMUX_PKG_SRCDIR/lib $CPPFLAGS\"\n}\n\ntermux_step_post_configure() {\n\t# the package has trouble to prepare some headers\n\tcd $TERMUX_PKG_SRCDIR/lib\n\tpython $TERMUX_PREFIX/bin/searpc-codegen.py $TERMUX_PKG_SRCDIR/lib/rpc_table.py\n}\n"
  },
  {
    "path": "packages/seafile-client/configure.ac.patch",
    "content": "--- ../seafile/configure.ac\t2018-04-28 11:32:08.357388789 +0200\n+++ ./configure.ac\t2018-04-28 11:33:03.093385829 +0200\n@@ -75,7 +75,7 @@\n   fi\n fi\n \n-AC_CHECK_LIB(pthread, pthread_create, [echo \"found library pthread\"], AC_MSG_ERROR([*** Unable to find pthread library]), )\n+#AC_CHECK_LIB(pthread, pthread_create, [echo \"found library pthread\"], AC_MSG_ERROR([*** Unable to find pthread library]), )\n AC_CHECK_LIB(sqlite3, sqlite3_open,[echo \"found library sqlite3\"] , AC_MSG_ERROR([*** Unable to find sqlite3 library]), )\n \n dnl Do we need to use AX_LIB_SQLITE3 to check sqlite?\n@@ -134,6 +134,8 @@\n   LIB_CRYPT32=\n fi\n \n+LIB_RESOLV=\"\"\n+\n AC_SUBST(LIB_WS32)\n AC_SUBST(LIB_GDI32)\n AC_SUBST(LIB_RT)\n"
  },
  {
    "path": "packages/seccure/Makefile.patch",
    "content": "diff -uNr seccure-0.5/Makefile seccure-0.5.mod/Makefile\n--- seccure-0.5/Makefile\t2014-08-11 15:46:47.000000000 +0300\n+++ seccure-0.5.mod/Makefile\t2019-02-13 02:22:01.521088395 +0200\n@@ -1,5 +1,5 @@\n-CFLAGS = -O2 -Wall -Wextra -std=c89 -pedantic -D_POSIX_C_SOURCE=200112 # -D NOBEEP\n-LIBS = -lgcrypt\n+CFLAGS += $(CPPFLAGS) -Wall -Wextra -std=c89 -pedantic -D_POSIX_C_SOURCE=200112 # -D NOBEEP\n+LIBS = $(LDFLAGS) -lgcrypt\n \n default: binaries # doc\n \n@@ -31,7 +31,6 @@\n seccure-key: seccure.o numtheory.o ecc.o serialize.o protocol.o curves.o aes256ctr.o\n \t$(CC) $(CFLAGS) -o seccure-key seccure.o numtheory.o ecc.o \\\n \tcurves.o serialize.o protocol.o aes256ctr.o $(LIBS)\n-\tstrip seccure-key\n \n seccure-encrypt: seccure-key\n \tln -f seccure-key seccure-encrypt\n"
  },
  {
    "path": "packages/seccure/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://point-at-infinity.org/seccure/\nTERMUX_PKG_DESCRIPTION=\"SECCURE Elliptic Curve Crypto Utility for Reliable Encryption\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.5\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=http://point-at-infinity.org/seccure/seccure-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=6566ce4afea095f83690b93078b910ca5b57b581ebc60e722f6e3fe8e098965b\nTERMUX_PKG_DEPENDS=\"libgcrypt\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake seccure-key\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 seccure-key \"$TERMUX_PREFIX\"/bin/\n\tinstall -Dm600 seccure.1 \"$TERMUX_PREFIX\"/share/man/man1/\n\n\tfor i in encrypt decrypt sign verify signcrypt veridec dh; do\n\t\tln -sfr \"$TERMUX_PREFIX\"/bin/seccure-key \"$TERMUX_PREFIX\"/bin/seccure-${i}\n\t\tln -sfr \"$TERMUX_PREFIX\"/share/man/man1/seccure.1 \"$TERMUX_PREFIX\"/share/man/man1/seccure-${i}.1\n\tdone\n\tunset i\n}\n"
  },
  {
    "path": "packages/secure-delete/000-from-debian.patch",
    "content": "diff -uNr secure-delete-3.1/Makefile secure-delete-3.1.mod/Makefile\n--- secure-delete-3.1/Makefile\t2003-10-29 23:07:06.000000000 +0200\n+++ secure-delete-3.1.mod/Makefile\t2019-01-31 02:39:41.391298344 +0200\n@@ -1,19 +1,19 @@\n CC=gcc\n-OPT=-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE\n+OPT=$(CFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE\n #OPT=-Wall -D_DEBUG_ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE\n-INSTALL_DIR=/usr/local/bin\n+INSTALL_DIR=$(prefix)/bin\n MAN_DIR=/usr/local/man\n DOC_DIR=/usr/share/doc/secure_delete\n OPT_MOD=-D__KERNEL__ -DMODULE -fomit-frame-pointer -fno-strict-aliasing -pipe -mpreferred-stack-boundary=2\n #LD_MOD=-r\n \n-all: sdel-lib.o srm sfill sswap smem sdel-mod.o\n-\t@echo\n-\t@echo \"A Puritan is someone who is deathly afraid that someone, somewhere, is\"\n-\t@echo \"having fun.\"\n-\t@echo\n-\t@echo \"I hope YOU have fun!\"\n-\t@echo\n+all: sdel-lib.o srm sfill sswap smem\n+#\t@echo\n+#\t@echo \"A Puritan is someone who is deathly afraid that someone, somewhere, is\"\n+#\t@echo \"having fun.\"\n+#\t@echo\n+#\t@echo \"I hope YOU have fun!\"\n+#\t@echo\n \n sdel-mod.o: sdel-mod.c\n \t$(CC) $(OPT) $(OPT_MOD) $(LD_MOD) -I/lib/modules/`uname -r`/build/include -c sdel-mod.c\n@@ -23,32 +23,28 @@\n \n srm: srm.c\n \t$(CC) ${OPT} -o srm srm.c sdel-lib.o\n-\t-strip srm\n sfill: sfill.c\n \t$(CC) ${OPT} -o sfill sfill.c sdel-lib.o\n-\t-strip sfill\n sswap: sswap.c\n \t$(CC) ${OPT} -o sswap sswap.c sdel-lib.o\n-\t-strip sswap\n smem: smem.c\n \t$(CC) ${OPT} -o smem smem.c sdel-lib.o\n-\t-strip smem\n \n clean:\n \trm -f sfill srm sswap smem sdel sdel-lib.o sdel-mod.o core *~\n \n install: all\n \tmkdir -p -m 755 ${INSTALL_DIR} 2> /dev/null\n-\trm -f sdel && ln -s srm sdel\n-\tcp -f sdel srm sfill sswap smem the_cleaner.sh ${INSTALL_DIR}\n-\tchmod 711 ${INSTALL_DIR}/srm ${INSTALL_DIR}/sfill ${INSTALL_DIR}/sswap ${INSTALL_DIR}/smem ${INSTALL_DIR}/the_cleaner.sh\n-\tmkdir -p -m 755 ${MAN_DIR}/man1 2> /dev/null\n-\tcp -f srm.1 sfill.1 sswap.1 smem.1 ${MAN_DIR}/man1\n-\tchmod 644 ${MAN_DIR}/man1/srm.1 ${MAN_DIR}/man1/sfill.1 ${MAN_DIR}/man1/sswap.1 ${MAN_DIR}/man1/smem.1\n-\tmkdir -p -m 755 ${DOC_DIR} 2> /dev/null\n-\tcp -f CHANGES FILES README secure_delete.doc usenix6-gutmann.doc ${DOC_DIR}\n-\t-test -e sdel-mod.o && cp -f sdel-mod.o /lib/modules/`uname -r`/kernel/drivers/char\n+#\trm -f sdel && ln -s srm sdel\n+\tcp -f srm sfill sswap smem ${INSTALL_DIR}\n+\tchmod 711 ${INSTALL_DIR}/srm ${INSTALL_DIR}/sfill ${INSTALL_DIR}/sswap ${INSTALL_DIR}/smem \n+#\tmkdir -p -m 755 ${MAN_DIR}/man1 2> /dev/null\n+#\tcp -f srm.1 sfill.1 sswap.1 smem.1 ${MAN_DIR}/man1\n+#\tchmod 644 ${MAN_DIR}/man1/srm.1 ${MAN_DIR}/man1/sfill.1 ${MAN_DIR}/man1/sswap.1 ${MAN_DIR}/man1/smem.1\n+#\tmkdir -p -m 755 ${DOC_DIR} 2> /dev/null\n+#\tcp -f CHANGES FILES README secure_delete.doc usenix6-gutmann.doc ${DOC_DIR}\n+#\t-test -e sdel-mod.o && cp -f sdel-mod.o /lib/modules/`uname -r`/kernel/drivers/char\n #\t@-test '!' -e sdel-mod.o -a `uname -s` = 'Linux' && echo \"type \\\"make sdel-mod install\\\" to compile and install the Linux loadable kernel module for secure delete\"\n-\t@echo\n-\t@echo \"If men could get pregnant, abortion would be a sacrament.\"\n-\t@echo\n+#\t@echo\n+#\t@echo \"If men could get pregnant, abortion would be a sacrament.\"\n+#\t@echo\ndiff -uNr secure-delete-3.1/sfill.1 secure-delete-3.1.mod/sfill.1\n--- secure-delete-3.1/sfill.1\t2003-05-05 16:36:09.000000000 +0300\n+++ secure-delete-3.1.mod/sfill.1\t2019-01-31 02:39:41.391298344 +0200\n@@ -16,7 +16,7 @@\n is designed to delete data which lies on available diskspace on mediums\n in a secure manner which can not be recovered by thiefs, law enforcement\n or other threats.\n-The wipe algorythm is based on the paper \"Secure Deletion of Data from\n+The wipe algorithm is based on the paper \"Secure Deletion of Data from\n Magnetic and Solid-State Memory\" presented at the 6th Usenix Security\n Symposium by Peter Gutmann, one of the leading civilian cryptographers.\n .PP\n@@ -59,7 +59,7 @@\n and a final mode with random values.\n .TP\n .B \\-l\n--l for a second time lessons the security even more: only one random pass\n+\\-l for a second time lessons the security even more: only one random pass\n is written.\n .TP\n .B \\-v\n@@ -130,5 +130,5 @@\n (1),\n .I sswap\n (1),\n-.I smem\n+.I sdmem\n (1)\ndiff -uNr secure-delete-3.1/smem.1 secure-delete-3.1.mod/smem.1\n--- secure-delete-3.1/smem.1\t2003-05-05 16:36:16.000000000 +0300\n+++ secure-delete-3.1.mod/smem.1\t2019-01-31 02:39:41.391298344 +0200\n@@ -3,16 +3,16 @@\n .if n .sp\n .if t .sp 0.4\n ..\n-.TH SMEM 1\n+.TH SDMEM 1\n \n .SH NAME\n-smem \\- secure memory wiper (secure_deletion toolkit)\n+sdmem \\- secure memory wiper (secure_deletion toolkit)\n \n .SH SYNOPSIS\n-.B smem [-f] [-l] [-l] [-v]\n+.B sdmem [-f] [-l] [-l] [-v]\n \n .SH DESCRIPTION\n-.I smem\n+.I sdmem\n is designed to delete data which may lie still in your memory (RAM)\n in a secure manner which can not be recovered by thiefs, law enforcement\n or other threats.\n@@ -24,7 +24,7 @@\n .PP\n The\n .I secure data deletion\n-process of smem goes like this:\n+process of sdmem goes like this:\n .PP\n .TP\n .B *\n@@ -51,20 +51,26 @@\n and a final random one.\n .TP\n .B \\-l\n--l for a second time lessons the security even more: only one pass with\n+\\-l for a second time lessons the security even more: only one pass with\n 0x00 is written.\n .TP\n .B \\-v\n verbose mode\n .PP\n \n+.SH NOTE\n+.TP\n+This utility was originally called\n+.I smem\n+but was renamed for debian to avoid name clashes with another package.\n+\n .SH BEWARE\n .TP\n .B SLOW\n-Wiping the memory is very slow. You might use smem with the -ll option. (tip)\n+Wiping the memory is very slow. You might use sdmem with the \\-ll option. (tip)\n .TP\n .B BETA!\n-.I smem\n+.I sdmem\n is still beta.\n \n .PP\n@@ -84,7 +90,7 @@\n can be obtained from \n .I http://www.thc.org\n .Sp\n-.I smem\n+.I sdmem\n and the\n .I secure_deletion package\n is (C) 1997-2003 by van Hauser / THC (vh@thc.org)\ndiff -uNr secure-delete-3.1/srm.1 secure-delete-3.1.mod/srm.1\n--- secure-delete-3.1/srm.1\t2003-05-05 16:36:23.000000000 +0300\n+++ secure-delete-3.1.mod/srm.1\t2019-01-31 02:39:41.391298344 +0200\n@@ -55,7 +55,7 @@\n .TP\n .B \\-d\n ignore the two special dot files . and .. on the commandline. (so you can\n-execute it like \"srm -d .* *\")\n+execute it like \"srm \\-d .* *\")\n .TP\n .B \\-f\n fast (and insecure mode): no /dev/urandom, no synchronize mode.\n@@ -65,7 +65,7 @@\n and a final mode random values.\n .TP\n .B \\-l\n--l for a second time lessons the security even more: only one random pass\n+\\-l for a second time lessons the security even more: only one random pass\n is written.\n .TP\n .B \\-r\n@@ -95,7 +95,7 @@\n which comes with the\n .I secure_deletion package\n to ensure to wipe also the free diskspace. However, If already a small\n-file aquired a block with your precious data, no tool known to me can help\n+file acquired a block with your precious data, no tool known to me can help\n you here. For a secure deletion of the swap space\n .I sswap\n is available.\n@@ -136,5 +136,5 @@\n (1),\n .I sswap\n (1),\n-.I smem\n+.I sdmem\n (1)\ndiff -uNr secure-delete-3.1/srm.c secure-delete-3.1.mod/srm.c\n--- secure-delete-3.1/srm.c\t2003-10-31 01:17:19.000000000 +0200\n+++ secure-delete-3.1.mod/srm.c\t2019-01-31 02:39:41.391298344 +0200\n@@ -110,7 +110,7 @@\n \t        if ( (filestat.st_dev != controlstat.st_dev) || (filestat.st_ino != controlstat.st_ino) ) {\n \t            fprintf(stderr, \"Race found! (directory %s became a link)\\n\", filename);\n \t        } else {\n-  \t            if ((dir = opendir (\".\")) != NULL) {\n+  \t            if ((dir = opendir (\".\")) < 0) {\n \t                (void) chmod(\".\", 0700); /* ignore permission errors */\n \t                dir = opendir (\".\");\n \t            }\n@@ -166,8 +166,10 @@\n             return 3;\n         }\n \n-        if (sdel_overwrite(mode, fd, 0, bufsize, filestat.st_size > 0 ? filestat.st_size : 1, zero) == 0)\n+        if (sdel_overwrite(mode, fd, 0, bufsize, filestat.st_size > 0 ? filestat.st_size : 1, zero) == 0) {\n+            close(fd);\n             return sdel_unlink(filename, 0, 1, slow);\n+\t\t}\n     } /* end IS_REG() */\n     else {\n         if (S_ISDIR(filestat.st_mode)) {\ndiff -uNr secure-delete-3.1/sswap.1 secure-delete-3.1.mod/sswap.1\n--- secure-delete-3.1/sswap.1\t2003-05-05 16:36:31.000000000 +0300\n+++ secure-delete-3.1.mod/sswap.1\t2019-01-31 02:39:41.391298344 +0200\n@@ -49,7 +49,7 @@\n a final mode with random values.\n .TP\n .B \\-l\n--l for a second time lessons the security even more: only one pass with\n+\\-l for a second time lessons the security even more: only one pass with\n random values is written.\n .TP\n .B \\-v\n@@ -106,5 +106,5 @@\n (1),\n .I sfill\n (1),\n-.I smem\n+.I sdmem\n (1)\n"
  },
  {
    "path": "packages/secure-delete/001-makefile-cc.patch",
    "content": "diff -uNr secure-delete-3.1/Makefile secure-delete-3.1.mod/Makefile\n--- secure-delete-3.1/Makefile\t2019-01-31 02:43:09.911882461 +0200\n+++ secure-delete-3.1.mod/Makefile\t2019-01-31 02:43:29.125266812 +0200\n@@ -1,4 +1,4 @@\n-CC=gcc\n+CC ?= gcc\n OPT=$(CFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE\n #OPT=-Wall -D_DEBUG_ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE\n INSTALL_DIR=$(prefix)/bin\n"
  },
  {
    "path": "packages/secure-delete/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.thc.org/\nTERMUX_PKG_DESCRIPTION=\"Secure file, disk, swap, memory erasure utilities\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.1\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=http://deb.debian.org/debian/pool/main/s/secure-delete/secure-delete_$TERMUX_PKG_VERSION.orig.tar.gz\nTERMUX_PKG_SHA256=78af201401e6dc159298cb5430c28996a8bdc278391d942d1fe454534540ee3c\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake -j1 CC=\"$CC\"\n}\n\ntermux_step_make_install() {\n\tmake install INSTALL_DIR=\"$TERMUX_PREFIX/bin\"\n\tinstall -Dm600 -t \"$TERMUX_PREFIX\"/share/man/man1 sfill.1 smem.1 srm.1 sswap.1\n}\n"
  },
  {
    "path": "packages/sed/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/sed/\nTERMUX_PKG_DESCRIPTION=\"GNU stream editor for filtering/transforming text\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=4.8\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/sed/sed-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=f79b0cfea71b37a8eeec8490db6c5f7ae7719c35587f21edb0617f370eeff633\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -D__USE_FORTIFY_LEVEL=2\"\n}\n\ntermux_step_post_configure() {\n\ttouch -d \"next hour\" $TERMUX_PKG_SRCDIR/doc/sed.1\n}\n"
  },
  {
    "path": "packages/sensible-utils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://packages.debian.org/sid/sensible-utils\nTERMUX_PKG_DESCRIPTION=\"Small utilities used by programs to sensibly select and spawn an appropriate browser, editor, or pager\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.0.12\nTERMUX_PKG_SHA256=99ba2ebf8c57447c69d426b99b84ff9dc817be0bc4988ec6890a14558c529e2e\nTERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/s/sensible-utils/sensible-utils_${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_prog_PO4A=/bin/echo\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/serf/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://serf.apache.org/\nTERMUX_PKG_DESCRIPTION=\"High performance C-based HTTP client library\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.3.9\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://archive.apache.org/dist/serf/serf-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc\nTERMUX_PKG_DEPENDS=\"apr, apr-util, openssl, libuuid, libexpat, zlib\"\nTERMUX_PKG_BREAKS=\"serf-dev\"\nTERMUX_PKG_REPLACES=\"serf-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tscons APR=$TERMUX_PREFIX \\\n\t      APU=$TERMUX_PREFIX \\\n\t      CC=$(which $CC) \\\n\t      CFLAGS=\"$CFLAGS\" \\\n\t      CPPFLAGS=\"$CPPFLAGS -std=c11\" \\\n\t      LINKFLAGS=\"$LDFLAGS\" \\\n\t      OPENSSL=$TERMUX_PREFIX \\\n\t      PREFIX=$TERMUX_PREFIX \\\n\t      install\n\t# Avoid specifying -lcrypt:\n\tperl -p -i -e 's/-lcrypt //' $TERMUX_PREFIX/lib/pkgconfig/serf-1.pc\n}\n"
  },
  {
    "path": "packages/serf/sconstruct.patch",
    "content": "diff -u -r ../serf-1.3.9/SConstruct ./SConstruct\n--- ../serf-1.3.9/SConstruct\t2015-09-17 08:46:24.000000000 -0400\n+++ ./SConstruct\t2016-09-26 10:32:22.315215335 -0400\n@@ -155,6 +155,7 @@\n env = Environment(variables=opts,\n                   tools=('default', 'textfile',),\n                   CPPPATH=['.', ],\n+\t\t  PLATFORM='posix'\n                   )\n \n env.Append(BUILDERS = {\n@@ -216,7 +217,7 @@\n # from current_version, so don't use the PATCH level to avoid that build and\n # runtime patch levels have to be identical.\n if sys.platform != 'sunos5':\n-  env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0)\n+  env['SHLIBSUFFIX'] = '.so'\n \n LIBNAME = 'libserf-%d' % (MAJOR,)\n if sys.platform != 'win32':\n"
  },
  {
    "path": "packages/sharutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/sharutils/\nTERMUX_PKG_DESCRIPTION=\"Utilities for packaging and unpackaging shell archives\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=4.15.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/sharutils/sharutils-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=2b05cff7de5d7b646dc1669bc36c35fdac02ac6ae4b6c19cb3340d87ec553a9a\nTERMUX_PKG_DEPENDS=\"libandroid-support\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_header_spawn_h=no\n\"\n"
  },
  {
    "path": "packages/sharutils/config.h.in.patch",
    "content": "diff -u -r ../sharutils-4.15.2/config.h.in ./config.h.in\n--- ../sharutils-4.15.2/config.h.in\t2015-05-30 15:35:30.000000000 +0000\n+++ ./config.h.in\t2017-07-07 00:21:39.657093948 +0000\n@@ -4,6 +4,8 @@\n \n #define SHARUTILS_CONFIG_H 1\n \n+#include <libintl.h>\n+\n /* Define if building universal (internal helper macro) */\n #undef AC_APPLE_UNIVERSAL_BUILD\n \n"
  },
  {
    "path": "packages/shellharden/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/anordal/shellharden\nTERMUX_PKG_DESCRIPTION=\"The corrective bash syntax highlighter\"\nTERMUX_PKG_LICENSE=\"MPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=4.1.1\nTERMUX_PKG_SRCURL=https://github.com/anordal/shellharden/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=7d7ac3443f35eb74abfc78fa67db2947d60b7d0782f225f55d6eefafcf294c7c\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$TERMUX_PKG_SRCDIR/target/$CARGO_TARGET_NAME\"/release/shellharden \\\n\t\t\"$TERMUX_PREFIX\"/bin/\n}\n"
  },
  {
    "path": "packages/silversearcher-ag/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://geoff.greer.fm/ag/\nTERMUX_PKG_DESCRIPTION=\"Fast grep-like program, alternative to ack-grep\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=2.2.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=d9621a878542f3733b5c6e71c849b9d1a830ed77cb1a1f6c2ea441d4b0643170\nTERMUX_PKG_SRCURL=http://geoff.greer.fm/ag/releases/the_silver_searcher-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"pcre, liblzma, zlib\"\n"
  },
  {
    "path": "packages/sl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/mtoyoda/sl\nTERMUX_PKG_DESCRIPTION=\"Tool curing your bad habit of mistyping\"\nTERMUX_PKG_LICENSE=\"custom\"\nTERMUX_PKG_VERSION=5.02\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/mtoyoda/sl/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=1e5996757f879c81f202a18ad8e982195cf51c41727d3fea4af01fdcbbb5563a\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_LICENSE_FILE=\"LICENSE\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tinstall sl $TERMUX_PREFIX/bin/\n\tcp sl.1 $TERMUX_PREFIX/share/man/man1\n}\n"
  },
  {
    "path": "packages/sl/makefile.patch",
    "content": "diff -u -r ../sl-5.01/Makefile ./Makefile\n--- ../sl-5.01/Makefile\t2014-04-16 07:12:46.000000000 +0200\n+++ ./Makefile\t2014-07-01 07:29:30.000000000 +0200\n@@ -6,8 +6,5 @@\n #\tLast Modified: 2014/03/31\n #==========================================\n \n-CC=gcc\n-CFLAGS=-O\n-\n sl: sl.c sl.h\n-\t$(CC) $(CFLAGS) -o sl sl.c -lncurses\n+\t$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o sl sl.c -lncurses\n"
  },
  {
    "path": "packages/socat/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.dest-unreach.org/socat/\nTERMUX_PKG_DESCRIPTION=\"Relay for bidirectional data transfer between two independent data channels\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_DEPENDS=\"openssl, readline\"\nTERMUX_PKG_VERSION=1.7.3.3\nTERMUX_PKG_SHA256=8cc0eaee73e646001c64adaab3e496ed20d4d729aaaf939df2a761e99c674372\nTERMUX_PKG_SRCURL=http://www.dest-unreach.org/socat/download/socat-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_header_resolv_h=no ac_cv_c_compiler_gnu=yes ac_compiler_gnu=yes\" # sc_cv_sys_crdly_shift=9 sc_cv_sys_csize_shift=4 sc_cv_sys_tabdly_shift=11\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-llog\"\n}\n"
  },
  {
    "path": "packages/socat/dont_use_resolv_h.patch",
    "content": "diff -u -r ../socat-1.7.2.3/configure ./configure\n--- ../socat-1.7.2.3/configure\t2013-03-25 17:46:09.000000000 +0100\n+++ ./configure\t2014-02-19 01:01:02.000000000 +0100\n@@ -3884,7 +3884,7 @@\n done\n \n \n-for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h\n+for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h\n do :\n   as_ac_Header=`$as_echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\n ac_fn_c_check_header_compile \"$LINENO\" \"$ac_header\" \"$as_ac_Header\" \"#ifdef HAVE_SYS_TYPES_H\n"
  },
  {
    "path": "packages/socat/no-o_append.patch",
    "content": "diff -uNr socat-1.7.3.2/xio-gopen.c socat-1.7.3.2.mod/xio-gopen.c\n--- socat-1.7.3.2/xio-gopen.c\t2017-01-06 23:51:24.000000000 +0200\n+++ socat-1.7.3.2.mod/xio-gopen.c\t2018-12-31 14:22:34.046949870 +0200\n@@ -33,12 +33,7 @@\n    }\n    st_mode = result;\n \n-   if (exists) {\n-      /* file (or at least named entry) exists */\n-      if ((xioflags&XIO_ACCMODE) != XIO_RDONLY) {\n-\t openflags |= O_APPEND;\n-      }\n-   } else {\n+   if (!exists) {\n       openflags |= O_CREAT;\n    }\n \n"
  },
  {
    "path": "packages/socat/openpty.c.patch",
    "content": "diff -N -u -r ../socat-1.7.2.4/openpty.c ./openpty.c\n--- ../socat-1.7.2.4/openpty.c\t1970-01-01 01:00:00.000000000 +0100\n+++ ./openpty.c\t2014-07-15 15:23:08.731170078 +0200\n@@ -0,0 +1,71 @@\n+/* Copyright (C) 1998, 1999, 2004 Free Software Foundation, Inc.\n+   This file is part of the GNU C Library.\n+   Contributed by Zack Weinberg <zack@rabi.phys.columbia.edu>, 1998.\n+\n+   The GNU C Library is free software; you can redistribute it and/or\n+   modify it under the terms of the GNU Lesser General Public\n+   License as published by the Free Software Foundation; either\n+   version 2.1 of the License, or (at your option) any later version.\n+\n+   The GNU C Library is distributed in the hope that it will be useful,\n+   but WITHOUT ANY WARRANTY; without even the implied warranty of\n+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+   Lesser General Public License for more details.\n+\n+   You should have received a copy of the GNU Lesser General Public\n+   License along with the GNU C Library; if not, write to the Free\n+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n+   02111-1307 USA.  */\n+\n+#include <errno.h>\n+#include <fcntl.h>\n+#include <limits.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <termios.h>\n+#include <unistd.h>\n+#include <sys/types.h>\n+#include <sys/ioctl.h>\n+\n+#define _PATH_DEVPTMX \"/dev/ptmx\"\n+\n+int openpty (int *amaster, int *aslave, char *name, struct termios *termp,\n+\t\tstruct winsize *winp)\n+{\n+\tchar buf[PATH_MAX];\n+\tint master, slave;\n+\n+\tmaster = open(_PATH_DEVPTMX, O_RDWR);\n+\tif (master == -1)\n+\t\treturn -1;\n+\n+\tif (grantpt(master))\n+\t\tgoto fail;\n+\n+\tif (unlockpt(master))\n+\t\tgoto fail;\n+\n+\tif (ptsname_r(master, buf, sizeof buf))\n+\t\tgoto fail;\n+\n+\tslave = open(buf, O_RDWR | O_NOCTTY);\n+\tif (slave == -1)\n+\t\tgoto fail;\n+\n+\t/* XXX Should we ignore errors here?  */\n+\tif (termp)\n+\t\ttcsetattr(slave, TCSAFLUSH, termp);\n+\tif (winp)\n+\t\tioctl(slave, TIOCSWINSZ, winp);\n+\n+\t*amaster = master;\n+\t*aslave = slave;\n+\tif (name != NULL)\n+\t\tstrcpy(name, buf);\n+\n+\treturn 0;\n+\n+fail:\n+\tclose(master);\n+\treturn -1;\n+}\n"
  },
  {
    "path": "packages/sox/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://sox.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Command line utility for converting between and applying effects to various audio files formats\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_VERSION=14.4.2\nTERMUX_PKG_REVISION=16\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/sox/sox/${TERMUX_PKG_VERSION}/sox-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c\nTERMUX_PKG_DEPENDS=\"file, libao, libpng, libmp3lame, libvorbis, libandroid-glob, libflac, libid3tag, libmad, pulseaudio, opusfile, libsndfile, zlib\"\nTERMUX_PKG_BREAKS=\"sox-dev\"\nTERMUX_PKG_REPLACES=\"sox-dev\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n\tCPPFLAGS+=\" -D_FSTDIO\"\n}\n"
  },
  {
    "path": "packages/speexdsp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://speex.org/\nTERMUX_PKG_DESCRIPTION=\"Speex audio processing library\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.2.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/speex/speexdsp-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=682042fc6f9bee6294ec453f470dadc26c6ff29b9c9e9ad2ffc1f4312fd64771\nTERMUX_PKG_BREAKS=\"speexdsp-dev\"\nTERMUX_PKG_REPLACES=\"speexdsp-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-neon\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"share/doc/speexdsp/manual.pdf\"\n"
  },
  {
    "path": "packages/spiped/Makefile.patch",
    "content": "diff --git a/Makefile b/Makefile\nindex ff07626..da5105e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3,7 +3,6 @@\n PROGS=\t\tspiped spipe\n TESTS=\t\ttests/nc-client tests/nc-server tests/valgrind\n BINDIR_DEFAULT=\t/usr/local/bin\n-CFLAGS_DEFAULT=\t-O2\n \n all: cpusupport-config.h\n \texport CFLAGS=\"$${CFLAGS:-${CFLAGS_DEFAULT}}\";\t\\\ndiff --git a/spipe/Makefile b/spipe/Makefile\nindex c55db18..ed2bee5 100644\n--- a/spipe/Makefile\n+++ b/spipe/Makefile\n@@ -4,14 +4,13 @@ PROG=spipe\n MAN1=spipe.1\n SRCS=main.c pushbits.c proto_conn.c proto_crypt.c proto_handshake.c proto_pipe.c sha256.c elasticarray.c ptrheap.c timerqueue.c asprintf.c entropy.c getopt.c insecure_memzero.c monoclock.c noeintr.c sock.c warnp.c cpusupport_x86_aesni.c events_immediate.c events_network.c events_network_selectstats.c events_timer.c events.c network_connect.c network_read.c network_write.c crypto_aes.c crypto_aes_aesni.c crypto_aesctr.c crypto_dh.c crypto_dh_group14.c crypto_entropy.c crypto_verify_bytes.c\n IDIRS=-I../proto -I../libcperciva/alg -I../libcperciva/datastruct -I../libcperciva/util -I../libcperciva/cpusupport -I../libcperciva/events -I../libcperciva/network -I../libcperciva/crypto\n-LDADD_REQ=-lcrypto -lpthread\n+LDADD_REQ=-lcrypto\n \n all:\t${PROG}\n \n install:${PROG}\n \tmkdir -p ${BINDIR}\n \tcp ${PROG} ${BINDIR}/_inst.${PROG}.$$$$_ &&\t\\\n-\t    strip ${BINDIR}/_inst.${PROG}.$$$$_ &&\t\\\n \t    chmod 0555 ${BINDIR}/_inst.${PROG}.$$$$_ && \\\n \t    mv -f ${BINDIR}/_inst.${PROG}.$$$$_ ${BINDIR}/${PROG}\n \tif ! [ -z \"${MAN1DIR}\" ]; then\t\t\t\\\ndiff --git a/spiped/Makefile b/spiped/Makefile\nindex 99f0b47..fdcf0ca 100644\n--- a/spiped/Makefile\n+++ b/spiped/Makefile\n@@ -4,14 +4,13 @@ PROG=spiped\n MAN1=spiped.1\n SRCS=main.c dispatch.c proto_conn.c proto_crypt.c proto_handshake.c proto_pipe.c sha256.c elasticarray.c ptrheap.c timerqueue.c dnsthread.c graceful_shutdown.c asprintf.c daemonize.c entropy.c getopt.c insecure_memzero.c monoclock.c noeintr.c sock.c sock_util.c warnp.c cpusupport_x86_aesni.c events_immediate.c events_network.c events_network_selectstats.c events_timer.c events.c network_accept.c network_connect.c network_read.c network_write.c crypto_aes.c crypto_aes_aesni.c crypto_aesctr.c crypto_dh.c crypto_dh_group14.c crypto_entropy.c crypto_verify_bytes.c\n IDIRS=-I../proto -I../libcperciva/alg -I../libcperciva/datastruct -I../lib/dnsthread -I../lib/util -I../libcperciva/util -I../libcperciva/cpusupport -I../libcperciva/events -I../libcperciva/network -I../libcperciva/crypto\n-LDADD_REQ=-lcrypto -lpthread\n+LDADD_REQ=-lcrypto\n \n all:\t${PROG}\n \n install:${PROG}\n \tmkdir -p ${BINDIR}\n \tcp ${PROG} ${BINDIR}/_inst.${PROG}.$$$$_ &&\t\\\n-\t    strip ${BINDIR}/_inst.${PROG}.$$$$_ &&\t\\\n \t    chmod 0555 ${BINDIR}/_inst.${PROG}.$$$$_ && \\\n \t    mv -f ${BINDIR}/_inst.${PROG}.$$$$_ ${BINDIR}/${PROG}\n \tif ! [ -z \"${MAN1DIR}\" ]; then\t\t\t\\\n@@ -27,7 +26,7 @@ clean:\n \trm -f ${PROG} ${SRCS:.c=.o}\n \n ${PROG}:${SRCS:.c=.o}\n-\t${CC} -o ${PROG} ${SRCS:.c=.o} ${LDADD_EXTRA} ${LDADD_REQ} ${LDADD_POSIX}\n+\t${CC} -o ${PROG} ${SRCS:.c=.o} -L${TERMUX_PREFIX}/lib ${LDADD_EXTRA} ${LDADD_REQ} ${LDADD_POSIX}\n \n main.o: main.c ../libcperciva/util/asprintf.h ../libcperciva/util/daemonize.h ../libcperciva/events/events.h ../libcperciva/util/getopt.h ../lib/util/graceful_shutdown.h ../libcperciva/util/parsenum.h ../libcperciva/util/sock.h ../libcperciva/util/warnp.h dispatch.h ../proto/proto_crypt.h ../libcperciva/crypto/crypto_dh.h\n \t${CC} ${CFLAGS} ${CFLAGS_POSIX} -D_POSIX_C_SOURCE=200809L -DCPUSUPPORT_CONFIG_FILE=\\\"cpusupport-config.h\\\"  -I.. ${IDIRS} -c main.c -o main.o\n"
  },
  {
    "path": "packages/spiped/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tarsnap.com/spiped.html\nTERMUX_PKG_DESCRIPTION=\"a utility for creating symmetrically encrypted and authenticated pipes between socket addresses\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.6.0\nTERMUX_PKG_REVISION=8\nTERMUX_PKG_SRCURL=https://github.com/Tarsnap/spiped/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=c80a49b131aeb017c06dcc10e2461c25a333e1e32ed99a0bb6af169014306815\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make () {\n\tCFLAGS+=\" $CPPFLAGS\"\n\tenv LDADD_EXTRA=\"$LDFLAGS\" \\\n\t\tmake -j \"$TERMUX_MAKE_PROCESSES\" BINDIR=\"$TERMUX_PREFIX/bin\" \\\n\t\t\tMAN1DIR=\"$TERMUX_PREFIX/share/man/man1\"\n}\n\ntermux_step_make_install() {\n\tmake install BINDIR=\"$TERMUX_PREFIX/bin\" \\\n\t\tMAN1DIR=\"$TERMUX_PREFIX/share/man/man1\"\n}\n"
  },
  {
    "path": "packages/squid/CpuAffinitySet.cc.patch",
    "content": "--- ./src/CpuAffinitySet.cc\t2016-10-10 01:28:01.000000000 +0530\n+++ ../CpuAffinitySet.cc\t2016-12-07 22:53:47.745146503 +0530\n@@ -37,7 +37,7 @@\n     } else {\n         cpu_set_t cpuSet;\n         memcpy(&cpuSet, &theCpuSet, sizeof(cpuSet));\n-        (void) CPU_AND(&cpuSet, &cpuSet, &theOrigCpuSet);\n+        CPU_AND(&cpuSet, &cpuSet, &theOrigCpuSet);\n         if (CPU_COUNT(&cpuSet) <= 0) {\n             debugs(54, DBG_IMPORTANT, \"ERROR: invalid CPU affinity for process \"\n                    \"PID \" << getpid() << \", may be caused by an invalid core in \"\n"
  },
  {
    "path": "packages/squid/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.squid-cache.org\nTERMUX_PKG_DESCRIPTION=\"Full-featured Web proxy cache server\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=4.9\nTERMUX_PKG_SRCURL=http://squid.mirror.globo.tech/archive/4/squid-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=1cb1838c6683b0568a3a4050f4ea2fc1eaa5cbba6bdf7d57f7258c7cd7b41fa1\nTERMUX_PKG_DEPENDS=\"libc++, libcrypt, libxml2, libltdl, openssl, resolv-conf\"\n\n# disk-io uses XSI message queue which are not available on Android.\n# Option 'cache_dir' will be unusable.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_lib_sasl2_sasl_errstring=no\nac_cv_dbopen_libdb=no\nsquid_cv_gnu_atomics=yes\n--datarootdir=$TERMUX_PREFIX/share/squid\n--libexecdir=$TERMUX_PREFIX/libexec/squid\n--mandir=$TERMUX_PREFIX/share/man\n--sysconfdir=$TERMUX_PREFIX/etc/squid\n--with-logdir=$TERMUX_PREFIX/var/log/squid\n--with-pidfile=$TERMUX_PREFIX/var/run/squid.pid\n--disable-external-acl-helpers\n--disable-strict-error-checking\n--enable-auth\n--enable-auth-basic\n--enable-auth-digest\n--enable-auth-negotiate\n--enable-auth-ntlm\n--enable-delay-pools\n--enable-linux-netfilter\n--enable-removal-policies=\"lru,heap\"\n--enable-snmp\n--disable-disk-io\n--disable-storeio\n--enable-translation\n--with-dl\n--with-openssl\n--with-size-optimizations\n--without-gnutls\n--without-libnettle\n--without-mit-krb5\n--with-maxfd=256\n\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS=\"$LDFLAGS -llog\"\n\n\t# needed for building cf_gen\n\texport BUILDCXX=g++\n\t# else it picks up our cross CXXFLAGS\n\texport BUILDCXXFLAGS=' '\n}\n\ntermux_step_post_make_install() {\n\tlocal _SQUID_LOGDIR=$TERMUX_PREFIX/var/logs\n\tmkdir -p $_SQUID_LOGDIR\n\techo \"Squid logs here by default\" > $_SQUID_LOGDIR/README.squid\n}\n\ntermux_step_post_massage() {\n\t# Ensure that necessary directories exist, otherwise squid fill fail.\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/cache/squid\"\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/log/squid\"\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/run\"\n}\n"
  },
  {
    "path": "packages/squid/dns_internal.cc.patch",
    "content": "diff -uNr squid-4.8/src/dns_internal.cc squid-4.8.mod/src/dns_internal.cc\n--- squid-4.8/src/dns_internal.cc\t2019-07-09 22:05:20.000000000 +0300\n+++ squid-4.8.mod/src/dns_internal.cc\t2019-09-23 15:39:36.373673900 +0300\n@@ -52,7 +52,7 @@\n #define REG_VXD_MSTCP \"SYSTEM\\\\CurrentControlSet\\\\Services\\\\VxD\\\\MSTCP\"\n #endif\n #ifndef _PATH_RESCONF\n-#define _PATH_RESCONF \"/etc/resolv.conf\"\n+#define _PATH_RESCONF \"@TERMUX_PREFIX@/etc/resolv.conf\"\n #endif\n #ifndef NS_DEFAULTPORT\n #define NS_DEFAULTPORT 53\n@@ -1610,7 +1610,7 @@\n #if _SQUID_WINDOWS_\n         debugs(78, DBG_IMPORTANT, \"Please check your TCP-IP settings or /etc/resolv.conf file\");\n #else\n-        debugs(78, DBG_IMPORTANT, \"Please check your /etc/resolv.conf file\");\n+        debugs(78, DBG_IMPORTANT, \"Please check your @TERMUX_PREFIX@/etc/resolv.conf file\");\n #endif\n \n         debugs(78, DBG_IMPORTANT, \"or use the 'dns_nameservers' option in squid.conf.\");\n"
  },
  {
    "path": "packages/squid/src-esi-VarState.cc.patch",
    "content": "diff -uNr squid-4.8/src/esi/VarState.cc squid-4.8.mod/src/esi/VarState.cc\n--- squid-4.8/src/esi/VarState.cc\t2019-07-09 22:05:20.000000000 +0300\n+++ squid-4.8.mod/src/esi/VarState.cc\t2019-09-23 17:31:10.292888618 +0300\n@@ -150,7 +150,7 @@\n {\n     char const *t;\n     int len;\n-    t = index(s,'/');\n+    t = strchr(s,'/');\n \n     if (!t || !*(++t))\n         return xstrdup(\"\");\n@@ -328,12 +328,12 @@\n \n         if ((t = strstr (s, \"MSIE\"))) {\n             browser = ESI_BROWSER_MSIE;\n-            t = index (t, ' ');\n+            t = strchr (t, ' ');\n \n             if (!t)\n                 browserversion = xstrdup(\"\");\n             else {\n-                t1 = index(t, ';');\n+                t1 = strchr(t, ';');\n \n                 if (!t1)\n                     browserversion = xstrdup(t + 1);\n"
  },
  {
    "path": "packages/squid/sys-stat.h.patch",
    "content": "--- ./src/log/ModStdio.cc\t2017-06-01 19:19:00.000000000 +0530\n+++ ../ModStdio.cc\t2017-06-29 22:32:43.806756794 +0530\n@@ -18,6 +18,7 @@\n #include \"SquidConfig.h\"\n \n #include <cerrno>\n+#include <sys/stat.h>\n \n typedef struct {\n     int fd;\n--- ./src/debug.cc\t2017-06-01 19:19:00.000000000 +0530\n+++ ../debug.cc\t2017-06-29 22:36:58.160488863 +0530\n@@ -17,6 +17,8 @@\n /* for shutting_down flag in xassert() */\n #include \"globals.h\"\n \n+#include <sys/stat.h>\n+\n char *Debug::debugOptions = NULL;\n int Debug::override_X = 0;\n int Debug::log_stderr = -1;\n"
  },
  {
    "path": "packages/sshpass/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/sshpass/\nTERMUX_PKG_DESCRIPTION=\"Noninteractive ssh password provider\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.06\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/sshpass/sshpass/${TERMUX_PKG_VERSION}/sshpass-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60\n"
  },
  {
    "path": "packages/ssss/Makefile.patch",
    "content": "diff -uNr ssss-0.5/Makefile ssss-0.5.mod/Makefile\n--- ssss-0.5/Makefile\t2006-01-15 13:10:01.000000000 +0200\n+++ ssss-0.5.mod/Makefile\t2019-02-13 02:11:26.317857778 +0200\n@@ -1,8 +1,7 @@\n-all: ssss-split ssss-combine ssss.1 ssss.1.html\n+all: ssss-split\n \n ssss-split: ssss.c\n-\t$(CC) -W -Wall -O2 -lgmp -o ssss-split ssss.c\n-\tstrip ssss-split\n+\t$(CC) -W -Wall -DNOMLOCK $(CPPFLAGS) $(CFLAGS) -o ssss-split ssss.c $(LDFLAGS) -lgmp\n \n ssss-combine: ssss-split\n \tln -f ssss-split ssss-combine\n"
  },
  {
    "path": "packages/ssss/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://point-at-infinity.org/ssss/\nTERMUX_PKG_DESCRIPTION=\"Simple command-line implementation of Shamir's Secret Sharing Scheme\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.5\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=http://point-at-infinity.org/ssss/ssss-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=5d165555105606b8b08383e697fc48cf849f51d775f1d9a74817f5709db0f995\nTERMUX_PKG_DEPENDS=\"libgmp\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tinstall -Dm700 ssss-split \"$TERMUX_PREFIX\"/bin/\n\tln -sfr \"$TERMUX_PREFIX\"/bin/ssss-split $TERMUX_PREFIX/bin/ssss-combine\n\n\tmkdir -p \"$TERMUX_PREFIX\"/share/man/man1/\n\tinstall -Dm600 \\\n\t\t\"$TERMUX_PKG_BUILDER_DIR\"/ssss.1 \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/\n\tln -sfr \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/ssss.1 \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/ssss-combine.1\n\tln -sfr \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/ssss.1 \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/ssss-split.1\n}\n"
  },
  {
    "path": "packages/ssss/ssss.1",
    "content": ".TH ssss 1 User Manuals\n.SH NAME\nssss \\- Split and Combine Secrets using Shamir's Secret Sharing Scheme.\n.SH SYNOPSIS\n\\fBssss-split -t \\fIthreshold\\fB -n \\fIshares\\fB [-w \\fItoken\\fB] [-s \\fIlevel\\fB] [-x] [-q] [-Q] [-D] [-v]\n\nssss-combine -t \\fIthreshold\\fB [-x] [-q] [-Q] [-D] [-v]\n\\f1\n.SH DESCRIPTION\nssss is an implementation of Shamir's Secret Sharing Scheme. The program suite does both: the generation of shares for a known secret, and the reconstruction of a secret using user-provided shares.\n.SH COMMANDS\n\\fBssss-split\\f1: prompt the user for a secret and generate a set of corresponding shares.\n\n\\fBssss-combine\\f1: read in a set of shares and reconstruct the secret.\n.SH OPTIONS\n.TP\n\\fB-t \\fIthreshold\\fB\\f1\nSpecify the number of shares necessary to reconstruct the secret.\n.TP\n\\fB-n \\fIshares\\fB\\f1\nSpecify the number of shares to be generated.\n.TP\n\\fB-w \\fItoken\\fB\\f1\nText token to name shares in order to avoid confusion in case one utilizes secret sharing to protect several independent secrets. The generated shares are prefixed by these tokens.\n.TP\n\\fB-s \\fIlevel\\fB\\f1\nEnforce the scheme's security level (in bits). This option implies an upper bound for the length of the shared secret (shorter secrets are padded). Only multiples of 8 in the range from 8 to 1024 are allowed. If this option is ommitted (or the value given is 0) the security level is chosen automatically depending on the secret's length. The security level directly determines the length of the shares.\n.TP\n\\fB-x\\f1\nHex mode: use hexadecimal digits in place of ASCII characters for I/O. This is useful if one wants to protect binary data, like block cipher keys.\n.TP\n\\fB-q\\f1\nQuiet mode: disable all unnecessary output. Useful in scripts. \n.TP\n\\fB-Q\\f1\nExtra quiet mode: like \\fB-q\\f1, but also suppress warnings.\n.TP\n\\fB-D\\f1\nDisable the diffusion layer added in version 0.2. This option is needed when shares are combined that where generated with ssss version 0.1.\n.TP\n\\fB-v\\f1\nPrint version information.\n.SH EXAMPLE\nIn case you want to protect your login password with a set of ten shares in such a way that any three of them can reconstruct the password, you simply run the command \n\nssss-split -t 3 -n 10 -w passwd \n\nTo reconstruct the password pass three of the generated shares (in any order) to \n\nssss-combine -t 3 \n.SH NOTES\nTo protect a secret larger than 1024 bits a hybrid technique has to be applied: encrypt the secret with a block cipher and apply secret sharing to just the key. Among others openssl and gpg can do the encryption part: \n\nopenssl bf -e < file.plain > file.encrypted \n\ngpg -c < file.plain > file.encrypted \n.SH SECURITY\n\\fBssss\\f1 tries to lock its virtual address space into RAM for privacy reasons. But this may fail for two reasons: either the current uid doesn't permit page locking, or the RLIMIT_MEMLOCK is set too low. After printing a warning message \\fBssss\\f1 will run even without obtaining the desired mlock. \n.SH AUTHOR\nThis software (v0.5) was written in 2006 by B. Poettering (ssss AT point-at-infinity.org). Find the newest version of ssss on the project's homepage: \\fBhttp://point-at-infinity.org/ssss/\\f1. \n.SH FURTHER READING\n\\fBhttp://en.wikipedia.org/wiki/Secret_sharing\\f1\n"
  },
  {
    "path": "packages/stag/Makefile.patch",
    "content": "--- stag/Makefile\t2016-08-31 15:10:57.847902802 +0200\n+++ Makefile\t2016-08-31 15:09:34.507902834 +0200\n@@ -1,5 +1,5 @@\n CC ?= gcc\n-CFLAGS=-Wall -Werror -Wextra -std=c99 -pedantic -Wno-unused-parameter\n+CFLAGS+=-Wall -Werror -Wextra -std=c99 -pedantic -Wno-unused-parameter\n # D_BSD_SOURCE for strsep\n LIBS=-lncurses -lm -D_DEFAULT_SOURCE\n PREFIX ?= /usr/local\n"
  },
  {
    "path": "packages/stag/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/seenaburns/stag\nTERMUX_PKG_DESCRIPTION=\"Streaming bar graphs. For stats and stuff.\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_VERSION=1.0.0\nTERMUX_PKG_SRCURL=https://github.com/seenaburns/stag/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=391574e6aa12856d5a598a374e3a40a38cbab6ef9d769c0d59af8411b4fbecb6\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $CPPFLAGS\"\n\tCFLAGS+=\" $LDFLAGS\"\n}\n"
  },
  {
    "path": "packages/stag/stag.c.patch",
    "content": "--- stag/stag.c\t2016-08-31 15:03:32.627902972 +0200\n+++ stag.c\t2016-08-31 15:18:34.487902628 +0200\n@@ -87,7 +87,7 @@\n   \n \n   // Read options\n-  char opt;\n+  signed char opt;\n   int option_index = 0;\n   struct option long_options[] =\n   {\n"
  },
  {
    "path": "packages/starship/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://starship.rs\nTERMUX_PKG_DESCRIPTION=\"A minimal, blazing fast, and extremely customizable prompt for any shell\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_VERSION=0.27.0\nTERMUX_PKG_SRCURL=https://github.com/starship/starship/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=af1c4dd9b211a6271709c2cd2bbc81745d63907981474ff59084864dfd2bcf3a\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--no-default-features\"\n\ntermux_step_pre_configure() {\n\tmkdir -p $TERMUX_PKG_TMPDIR/include\n\tcp $TERMUX_PREFIX/include/zlib.h $TERMUX_PKG_TMPDIR/include \n\tcp $TERMUX_PREFIX/include/zconf.h $TERMUX_PKG_TMPDIR/include\n#\tcp -r $TERMUX_PREFIX/include/openssl $TERMUX_PKG_TMPDIR/include\n\tCFLAGS+=\" -I$TERMUX_PKG_TMPDIR/include\"\n}\n"
  },
  {
    "path": "packages/steghide/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://steghide.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Embeds a message in a file by replacing some of the least significant bits\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.5.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/steghide/steghide-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=78069b7cfe9d1f5348ae43f918f06f91d783c2b3ff25af021e6a312cf541b47b\nTERMUX_PKG_DEPENDS=\"libjpeg-turbo, libmcrypt, libmhash, zlib\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_file__dev_random=yes\nac_cv_file__dev_urandom=yes\n--mandir=$TERMUX_PREFIX/share/man\n\"\n"
  },
  {
    "path": "packages/steghide/gcc-4.2.patch",
    "content": "diff -Naur steghide-0.5.1.orig/src/AuData.h steghide-0.5.1.new/src/AuData.h\n--- steghide-0.5.1.orig/src/AuData.h\t2003-09-28 11:30:29.000000000 -0400\n+++ steghide-0.5.1.new/src/AuData.h\t2007-06-28 17:22:44.000000000 -0400\n@@ -26,22 +26,30 @@\n \n // AuMuLawAudioData\n typedef AudioDataImpl<AuMuLaw,BYTE> AuMuLawAudioData ;\n+template<>\n inline BYTE AuMuLawAudioData::readValue (BinaryIO* io) const { return (io->read8()) ; }\n+template<>\n inline void AuMuLawAudioData::writeValue (BinaryIO* io, BYTE v) const { io->write8(v) ; }\n \n // AuPCM8AudioData\n typedef AudioDataImpl<AuPCM8,SBYTE> AuPCM8AudioData ;\n+template<>\n inline SBYTE AuPCM8AudioData::readValue (BinaryIO* io) const { return ((SBYTE) io->read8()) ; }\n+template<>\n inline void AuPCM8AudioData::writeValue (BinaryIO* io, SBYTE v) const { io->write8((BYTE) v) ; }\n \n // AuPCM16AudioData\n typedef AudioDataImpl<AuPCM16,SWORD16> AuPCM16AudioData ;\n+template<>\n inline SWORD16 AuPCM16AudioData::readValue (BinaryIO* io) const { return ((SWORD16) io->read16_be()) ; }\n+template<>\n inline void AuPCM16AudioData::writeValue (BinaryIO* io, SWORD16 v) const { io->write16_be((UWORD16) v) ; }\n \n // AuPCM32AudioData\n typedef AudioDataImpl<AuPCM32,SWORD32> AuPCM32AudioData ;\n+template<>\n inline SWORD32 AuPCM32AudioData::readValue (BinaryIO* io) const { return ((SWORD32) io->read32_be()) ; }\n+template<>\n inline void AuPCM32AudioData::writeValue (BinaryIO* io, SWORD32 v) const { io->write32_be((UWORD32) v) ; }\n \n #endif // ndef SH_AUDATA_H\ndiff -Naur steghide-0.5.1.orig/src/AuSampleValues.cc steghide-0.5.1.new/src/AuSampleValues.cc\n--- steghide-0.5.1.orig/src/AuSampleValues.cc\t2003-09-28 11:30:30.000000000 -0400\n+++ steghide-0.5.1.new/src/AuSampleValues.cc\t2007-06-28 17:23:52.000000000 -0400\n@@ -21,17 +21,25 @@\n #include \"AuSampleValues.h\"\n \n // AuMuLawSampleValue\n+template<>\n const BYTE AuMuLawSampleValue::MinValue = 0 ;\n+template<>\n const BYTE AuMuLawSampleValue::MaxValue = BYTE_MAX ;\n \n // AuPCM8SampleValue\n+template<>\n const SBYTE AuPCM8SampleValue::MinValue = SBYTE_MIN ;\n+template<>\n const SBYTE AuPCM8SampleValue::MaxValue = SBYTE_MAX ;\n \n // AuPCM16SampleValue\n+template<>\n const SWORD16 AuPCM16SampleValue::MinValue = SWORD16_MIN ;\n+template<>\n const SWORD16 AuPCM16SampleValue::MaxValue = SWORD16_MAX ;\n \n // AuPCM32SampleValue\n+template<>\n const SWORD32 AuPCM32SampleValue::MinValue = SWORD32_MIN ;\n+template<>\n const SWORD32 AuPCM32SampleValue::MaxValue = SWORD32_MAX ;\ndiff -Naur steghide-0.5.1.orig/src/MHashPP.cc steghide-0.5.1.new/src/MHashPP.cc\n--- steghide-0.5.1.orig/src/MHashPP.cc\t2003-10-05 06:17:50.000000000 -0400\n+++ steghide-0.5.1.new/src/MHashPP.cc\t2007-06-28 17:22:44.000000000 -0400\n@@ -120,7 +120,7 @@\n \n std::string MHashPP::getAlgorithmName (hashid id)\n {\n-\tchar *name = mhash_get_hash_name (id) ;\n+\tchar *name = (char *) mhash_get_hash_name (id) ;\n \tstd::string retval ;\n \tif (name == NULL) {\n \t\tretval = std::string (\"<algorithm not found>\") ;\n"
  },
  {
    "path": "packages/steghide/libtool-fix.patch",
    "content": "diff -uNr steghide-0.5.1/src/Makefile.in steghide-0.5.1.mod/src/Makefile.in\n--- steghide-0.5.1/src/Makefile.in\t2003-10-15 11:01:29.000000000 +0300\n+++ steghide-0.5.1.mod/src/Makefile.in\t2019-07-01 15:51:46.023373760 +0300\n@@ -190,7 +190,7 @@\n WavPCMSampleValue.cc error.cc main.cc msg.cc SMDConstructionHeuristic.cc\n \n localedir = $(datadir)/locale\n-LIBTOOL = $(SHELL) libtool\n+LIBTOOL = $(SHELL) /usr/bin/libtool\n MAINTAINERCLEANFILES = Makefile.in\n subdir = src\n mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs\n@@ -278,7 +278,7 @@\n \t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n \t$(AM_CXXFLAGS) $(CXXFLAGS)\n CXXLD = $(CXX)\n-CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \\\n+CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \\\n \t$(AM_LDFLAGS) $(LDFLAGS) -o $@\n DIST_SOURCES = $(steghide_SOURCES)\n HEADERS = $(noinst_HEADERS)\n"
  },
  {
    "path": "packages/steghide/steghide-climits.patch",
    "content": "diff -ruN steghide-0.5.1.orig/src/Graph.cc steghide-0.5.1/src/Graph.cc\n--- steghide-0.5.1.orig/src/Graph.cc\t2003-10-11 23:54:26.000000000 +0200\n+++ steghide-0.5.1/src/Graph.cc\t2008-12-14 14:23:27.000000000 +0100\n@@ -22,6 +22,7 @@\n #include <list>\n #include <map>\n #include <vector>\n+#include <climits>\n \n #include \"BitString.h\"\n #include \"CvrStgFile.h\"\n"
  },
  {
    "path": "packages/steghide/steghide-gcc6.patch",
    "content": "--- steghide-0.5.1/src/Arguments.h.orig\t2018-06-09 11:04:48.795952519 +0000\n+++ steghide-0.5.1/src/Arguments.h\t2018-06-09 11:00:57.239290249 +0000\n@@ -100,7 +100,7 @@\n \tstatic const VERBOSITY\tDefault_Verbosity = NORMAL ;\n \tstatic const unsigned long\tDefault_Radius = 0 ; // there is no default radius for all file formats\n \tstatic const unsigned int\tMax_Algorithm = 3 ;\n-\tstatic const float\t\tDefault_Goal = 100.0 ;\n+\tstatic constexpr float\t\tDefault_Goal = 100.0 ;\n \tstatic const DEBUGCOMMAND\tDefault_DebugCommand = NONE ;\n \tstatic const bool\t\tDefault_Check = false ;\n \tstatic const unsigned int\tDefault_DebugLevel = 0 ;\n--- steghide-0.5.1/src/ProgressOutput.h.orig\t2018-06-09 11:01:44.662622682 +0000\n+++ steghide-0.5.1/src/ProgressOutput.h\t2018-06-09 11:01:57.755955767 +0000\n@@ -64,7 +64,7 @@\n \t **/\n \tvoid done (float rate, float avgweight = NoAvgWeight) const ;\n \n-\tstatic const float NoAvgWeight = -1.0 ;\n+\tstatic constexpr float NoAvgWeight = -1.0 ;\n \n \tprotected:\n \tstd::string vcompose (const char *msgfmt, va_list ap) const ;\n"
  },
  {
    "path": "packages/stfl/001-makefile.patch",
    "content": "diff -uNr stfl-0.24/Makefile stfl-0.24.mod/Makefile\n--- stfl-0.24/Makefile\t2015-02-12 15:14:33.000000000 +0200\n+++ stfl-0.24.mod/Makefile\t2019-08-16 15:05:15.360298872 +0300\n@@ -20,9 +20,12 @@\n \n include Makefile.cfg\n \n-export CC = gcc -pthread\n-export CFLAGS += -I. -Wall -Os -ggdb -D_GNU_SOURCE -fPIC\n-export LDLIBS += -lncursesw\n+CC ?= gcc\n+AR ?= ar\n+RANLIB ?= ranlib\n+\n+CFLAGS += -Wall -D_GNU_SOURCE -fPIC -I.\n+LDLIBS += -lncursesw\n \n SONAME  := libstfl.so.0\n VERSION := 0.24\n@@ -34,12 +37,12 @@\n libstfl.a: public.o base.o parser.o dump.o style.o binding.o iconv.o \\\n            $(patsubst %.c,%.o,$(wildcard widgets/*.c))\n \trm -f $@\n-\tar qc $@ $^\n-\tranlib $@\n+\t$(AR) qc $@ $^\n+\t$(RANLIB) $@\n \n libstfl.so.$(VERSION): public.o base.o parser.o dump.o style.o binding.o iconv.o \\\n                        $(patsubst %.c,%.o,$(wildcard widgets/*.c))\n-\t$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $(LDLIBS) $^\n+\t$(CC) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $(LDLIBS) $^\n \n clean:\n \trm -f libstfl.a example core core.* *.o Makefile.deps\n@@ -65,6 +68,7 @@\n \tinstall -m 644 stfl.pc $(DESTDIR)$(prefix)/$(libdir)/pkgconfig/\n \tinstall -m 644 libstfl.so.$(VERSION) $(DESTDIR)$(prefix)/$(libdir)\n \tln -fs libstfl.so.$(VERSION) $(DESTDIR)$(prefix)/$(libdir)/libstfl.so\n+\tln -fs libstfl.so.$(VERSION) $(DESTDIR)$(prefix)/$(libdir)/libstfl.so.0\n \n stfl.pc: stfl.pc.in\n \tsed 's,@VERSION@,$(VERSION),g' < $< | sed 's,@PREFIX@,$(prefix),g' > $@\ndiff -uNr stfl-0.24/Makefile.cfg stfl-0.24.mod/Makefile.cfg\n--- stfl-0.24/Makefile.cfg\t2009-05-31 21:20:39.000000000 +0300\n+++ stfl-0.24.mod/Makefile.cfg\t2019-08-16 15:20:06.621673157 +0300\n@@ -20,7 +20,6 @@\n \n export libdir ?= lib\n export prefix ?= /usr/local\n-export DESTDIR ?= /\n \n ifneq ($(shell spl-config --cflags 2>/dev/null),)\n FOUND_SPL = 1\n"
  },
  {
    "path": "packages/stfl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.clifford.at/stfl\nTERMUX_PKG_DESCRIPTION=\"Structured Terminal Forms Language/Library\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.24\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=http://www.clifford.at/stfl/stfl-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=d4a7aa181a475aaf8a8914a8ccb2a7ff28919d4c8c0f8a061e17a0c36869c090\nTERMUX_PKG_DEPENDS=\"libandroid-support, libiconv, ncurses\"\nTERMUX_PKG_BREAKS=\"stfl-dev\"\nTERMUX_PKG_REPLACES=\"stfl-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\tCC+=\" $CPPFLAGS\"\n\texport LDLIBS=\"-liconv\"\n}\n"
  },
  {
    "path": "packages/stow/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/stow/\nTERMUX_PKG_DESCRIPTION=\"Tool for managing the installation of multiple software packages into a single directory\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.3.1\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/stow-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=09d5d99671b78537fd9b2c0b39a5e9761a7a0e979f6fdb7eabfa58ee45f03d4b\nTERMUX_PKG_DEPENDS=\"perl\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/strace/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://strace.io/\nTERMUX_PKG_DESCRIPTION=\"Debugging utility to monitor system calls and signals received\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=5.4\nTERMUX_PKG_SRCURL=https://github.com/strace/strace/releases/download/v$TERMUX_PKG_VERSION/strace-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=f7d00514d51290b6db78ad7a9de709baf93caa5981498924cbc9a744cfd2a741\nTERMUX_PKG_RM_AFTER_INSTALL=bin/strace-graph # This is a perl script\n# Without st_cv_m32_mpers=no the build fails if gawk is installed.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nst_cv_m32_mpers=no\n--enable-mpers=no\n--without-libdw\n\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -Dfputs_unlocked=fputs\"\n}\n"
  },
  {
    "path": "packages/strace/ipc_msgctl.c.patch",
    "content": "diff -uNr strace-4.24/ipc_msgctl.c strace-4.24.mod/ipc_msgctl.c\n--- strace-4.24/ipc_msgctl.c\t2017-05-22 20:33:51.000000000 +0300\n+++ strace-4.24.mod/ipc_msgctl.c\t2018-10-03 01:14:05.344818748 +0300\n@@ -75,7 +75,9 @@\n \t\t\tbreak;\n \t\t}\n \n+#ifndef __ANDROID__\n \t\ttprintf(\", key=%u\", (unsigned) msqid_ds.msg_perm.__key);\n+#endif\n \t\tprintuid(\", cuid=\", msqid_ds.msg_perm.cuid);\n \t\tprintuid(\", cgid=\", msqid_ds.msg_perm.cgid);\n \t\ttprints(\"}\");\n"
  },
  {
    "path": "packages/strace/ipc_shmctl.c.patch",
    "content": "diff -uNr strace-4.24/ipc_shmctl.c strace-4.24.mod/ipc_shmctl.c\n--- strace-4.24/ipc_shmctl.c\t2017-05-22 20:33:51.000000000 +0300\n+++ strace-4.24.mod/ipc_shmctl.c\t2018-10-03 01:14:05.348152107 +0300\n@@ -75,7 +75,9 @@\n \t\t\tbreak;\n \t\t}\n \n+#ifndef __ANDROID__\n \t\ttprintf(\", key=%u\", (unsigned) shmid_ds.shm_perm.__key);\n+#endif\n \t\tprintuid(\", cuid=\", shmid_ds.shm_perm.cuid);\n \t\tprintuid(\", cgid=\", shmid_ds.shm_perm.cgid);\n \t\ttprints(\"}\");\n"
  },
  {
    "path": "packages/strace/strace.c.patch",
    "content": "diff -uNr strace-4.24/strace.c strace-4.24.mod/strace.c\n--- strace-4.24/strace.c\t2018-07-11 03:00:57.000000000 +0300\n+++ strace-4.24.mod/strace.c\t2018-10-03 01:15:15.105370170 +0300\n@@ -442,11 +442,7 @@\n static void\n swap_uid(void)\n {\n-\tint euid = geteuid(), uid = getuid();\n-\n-\tif (euid != uid && setreuid(euid, uid) < 0) {\n-\t\tperror_msg_and_die(\"setreuid\");\n-\t}\n+    return;\n }\n \n static FILE *\n@@ -1182,25 +1178,6 @@\n \t\t}\n \t}\n \n-\tif (username != NULL) {\n-\t\t/*\n-\t\t * It is important to set groups before we\n-\t\t * lose privileges on setuid.\n-\t\t */\n-\t\tif (initgroups(username, run_gid) < 0) {\n-\t\t\tperror_msg_and_die(\"initgroups\");\n-\t\t}\n-\t\tif (setregid(run_gid, params->run_egid) < 0) {\n-\t\t\tperror_msg_and_die(\"setregid\");\n-\t\t}\n-\t\tif (setreuid(run_uid, params->run_euid) < 0) {\n-\t\t\tperror_msg_and_die(\"setreuid\");\n-\t\t}\n-\t} else if (geteuid() != 0)\n-\t\tif (setreuid(run_uid, run_uid) < 0) {\n-\t\t\tperror_msg_and_die(\"setreuid\");\n-\t\t}\n-\n \tif (!daemonized_tracer) {\n \t\t/*\n \t\t * Induce a ptrace stop. Tracer (our parent)\n"
  },
  {
    "path": "packages/stunnel/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.stunnel.org/\nTERMUX_PKG_DESCRIPTION=\"Socket wrapper which can provide TLS support to ordinary applications\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=5.56\nTERMUX_PKG_SRCURL=https://www.stunnel.org/downloads/stunnel-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=7384bfb356b9a89ddfee70b5ca494d187605bb516b4fff597e167f97e2236b22\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-shared --with-ssl=$TERMUX_PREFIX --disable-fips\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/stunnel3 share/man/man8/stunnel.*.8\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -llog\"\n}\n"
  },
  {
    "path": "packages/subversion/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://subversion.apache.org\nTERMUX_PKG_DESCRIPTION=\"Centralized version control system characterized by its simplicity\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.13.0\nTERMUX_PKG_SHA256=bc50ce2c3faa7b1ae9103c432017df98dfd989c4239f9f8270bb3a314ed9e5bd\nTERMUX_PKG_SRCURL=https://www.apache.org/dist/subversion/subversion-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_DEPENDS=\"apr, apr-util, serf, libexpat, libsqlite, liblz4, utf8proc, zlib\"\nTERMUX_PKG_BREAKS=\"subversion-dev\"\nTERMUX_PKG_REPLACES=\"subversion-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nsvn_cv_pycfmt_apr_int64_t=UNUSED_REMOVE_AFTER_NEXT_UPDATE\n--without-sasl\n--without-libmagic\n\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -std=c11\"\n}\n"
  },
  {
    "path": "packages/subversion/configure.patch",
    "content": "diff -u -r ../subversion-1.8.5/configure ./configure\n--- ../subversion-1.8.5/configure\t2013-11-15 02:07:12.000000000 +0100\n+++ ./configure\t2014-02-12 08:43:44.000000000 +0100\n@@ -18377,10 +18377,7 @@\n   { $as_echo \"$as_me:${as_lineno-$LINENO}: checking for Mach-O dynamic module iteration functions\" >&5\n $as_echo_n \"checking for Mach-O dynamic module iteration functions... \" >&6; }\n   if test \"$cross_compiling\" = yes; then :\n-  { { $as_echo \"$as_me:${as_lineno-$LINENO}: error: in \\`$ac_pwd':\" >&5\n-$as_echo \"$as_me: error: in \\`$ac_pwd':\" >&2;}\n-as_fn_error $? \"cannot run test program while cross compiling\n-See \\`config.log' for more details\" \"$LINENO\" 5; }\n+  echo no\n else\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n /* end confdefs.h.  */\n"
  },
  {
    "path": "packages/subversion/no_setlocale.patch",
    "content": "setlocale(3) returns NULL and does nothing on Android, no point in giving error message.\n\ndiff -u -r ../subversion-1.8.5/subversion/libsvn_subr/cmdline.c ./subversion/libsvn_subr/cmdline.c\n--- ../subversion-1.8.5/subversion/libsvn_subr/cmdline.c\t2013-10-10 06:02:04.000000000 +0200\n+++ ./subversion/libsvn_subr/cmdline.c\t2014-02-12 09:30:54.000000000 +0100\n@@ -162,6 +162,7 @@\n   /* C programs default to the \"C\" locale. But because svn is supposed\n      to be i18n-aware, it should inherit the default locale of its\n      environment.  */\n+#ifndef __ANDROID__\n   if (!setlocale(LC_ALL, \"\")\n       && !setlocale(LC_CTYPE, \"\"))\n     {\n@@ -191,6 +192,7 @@\n                   progname, progname, *env_var, env_val, progname);\n         }\n     }\n+#endif\n \n   /* Initialize the APR subsystem, and register an atexit() function\n      to Uninitialize that subsystem at program exit. */\n"
  },
  {
    "path": "packages/swi-prolog/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://swi-prolog.org/\nTERMUX_PKG_DESCRIPTION=\"Most popular and complete prolog implementation\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_VERSION=8.1.16\nTERMUX_PKG_SRCURL=http://www.swi-prolog.org/download/devel/src/swipl-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=0a9b9389702c39f0ae498056fa6563efde7fed85fe5dc754c9f201398d61672a\nTERMUX_PKG_DEPENDS=\"libarchive, libcrypt, libgmp, libjpeg-turbo, libyaml, ncurses, ncurses-ui-libs, pcre, readline, ossp-uuid, zlib\"\nTERMUX_PKG_FORCE_CMAKE=true\nTERMUX_PKG_HOSTBUILD=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DINSTALL_DOCUMENTATION=OFF\n-DUSE_GMP=ON\n-DSWIPL_NATIVE_FRIEND=${TERMUX_PKG_HOSTBUILD_DIR}\n-DPOSIX_SHELL=${TERMUX_PREFIX}/bin/sh\n-DSWIPL_TMP_DIR=${TERMUX_PREFIX}/tmp\n-DSWIPL_INSTALL_IN_LIB=ON\n-DSWIPL_PACKAGES_BDB=OFF\n-DSWIPL_PACKAGES_ODBC=OFF\n-DSWIPL_PACKAGES_QT=OFF\n-DSWIPL_PACKAGES_X=OFF\n-DINSTALL_TESTS=ON\n-DBUILD_TESTING=ON\n-DSYSTEM_CACERT_FILENAME=${TERMUX_PREFIX}/etc/tls/cert.pem\"\n\n# We do this to produce:\n# a native host build to produce\n# boot<nn>.prc, INDEX.pl, ssl cetificate tests,\n# SWIPL_NATIVE_FRIEND tells SWI-Prolog to use\n# this build for the artifacts needed to build the\n# Android version\ntermux_step_host_build() {\n\ttermux_setup_cmake\n\ttermux_setup_ninja\n\n\tif [ $TERMUX_ARCH_BITS = 32 ]; then\n\t\texport LDFLAGS=-m32\n\t\texport CFLAGS=-m32\n\t\texport CXXFLAGS=-m32\n\t\tCMAKE_EXTRA_DEFS=\"-DCMAKE_LIBRARY_PATH=/usr/lib/i386-linux-gnu\"\n\telse\n\t\tCMAKE_EXTRA_DEFS=\"\"\n\tfi\n\n\tcmake \"$TERMUX_PKG_SRCDIR\"          \\\n\t\t-G \"Ninja\"                      \\\n\t\t$CMAKE_EXTRA_DEFS               \\\n\t\t-DINSTALL_DOCUMENTATION=OFF     \\\n\t\t-DSWIPL_PACKAGES=ON             \\\n\t\t-DUSE_GMP=OFF                   \\\n\t\t-DBUILD_TESTING=ON              \\\n\t\t-DSWIPL_SHARED_LIB=OFF          \\\n\t\t-DSWIPL_PACKAGES_BDB=OFF        \\\n\t\t-DSWIPL_PACKAGES_ODBC=OFF       \\\n\t\t-DSWIPL_PACKAGES_QT=OFF         \\\n\t\t-DSWIPL_PACKAGES_X=OFF\n\tninja\n\n\tunset LDFLAGS\n\tunset CFLAGS\n\tunset CXXFLAGS\n}\n\ntermux_step_post_make_install() {\n\t# Remove host build because future builds may be\n\t# of a different word size (e.g. 32bit or 64bit)\n\trm -rf \"$TERMUX_PKG_HOSTBUILD_DIR\"\n}\n"
  },
  {
    "path": "packages/swig/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://swig.org\nTERMUX_PKG_DESCRIPTION=\"Generate scripting interfaces to C/C++ code\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=4.0.1\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/swig/swig-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=7a00b4d0d53ad97a14316135e2d702091cd5f193bb58bcfcd8bc59d41e7887a9\nTERMUX_PKG_DEPENDS=\"libc++, pcre, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/syncthing/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://syncthing.net/\nTERMUX_PKG_DESCRIPTION=\"Decentralized file synchronization\"\nTERMUX_PKG_LICENSE=\"MPL-2.0\"\nTERMUX_PKG_VERSION=1.3.2\nTERMUX_PKG_SHA256=0de3096bd307d6f845a236100e6dc3096145c51d852443b57cd2c5a9a138537b\nTERMUX_PKG_SRCURL=https://github.com/syncthing/syncthing/releases/download/v${TERMUX_PKG_VERSION}/syncthing-source-v${TERMUX_PKG_VERSION}.tar.gz\n\ntermux_step_make(){\n\ttermux_setup_golang\n\n\t# The build.sh script doesn't with our compiler\n\t# so small adjustments to file locations are needed\n\t# so the build.go is fine.\n\tmkdir -p go/src/github.com/syncthing/syncthing\n\tcp $TERMUX_PKG_SRCDIR/vendor/* ./go/src/ -r\n\tcp $TERMUX_PKG_SRCDIR/*  go/src/github.com/syncthing/syncthing -r\n\n\t# Set gopath so dependencies are built as in go get etc.\n\texport GOPATH=$(pwd)/go\n\n\tcd go/src/github.com/syncthing/syncthing\n\n\t# Unset GOARCH so building build.go is works.\n\texport GO_ARCH=$GOARCH\n\texport _CC=$CC\n\tunset GOOS GOARCH CC\n\t\n\t# Now file structure is same as go get etc.\n\tgo build build.go\n\texport CC=$_CC\n\t./build -goos android \\\n\t\t-goarch $GO_ARCH \\\n\t\t-no-upgrade \\\n\t\t-version v$TERMUX_PKG_VERSION \\\n\t\tbuild\n}\n\ntermux_step_make_install() {\n\tcp go/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/\n\n\tfor section in 1 5 7; do\n\t\tlocal MANDIR=$PREFIX/share/man/man$section\n\t\tmkdir -p $MANDIR\n\t\tcp $TERMUX_PKG_SRCDIR/man/*.$section $MANDIR\n\tdone\n}\n"
  },
  {
    "path": "packages/taglib/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://taglib.github.io/\nTERMUX_PKG_DESCRIPTION=\"A Library for reading and editing the meta-data of several popular audio formats.\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0, MPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.11.1\nTERMUX_PKG_REVISION=9\nTERMUX_PKG_SRCURL=http://taglib.github.io/releases/taglib-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=b6d1a5a610aae6ff39d93de5efd0fdc787aa9e9dc1e7026fa4c961b26563526b\nTERMUX_PKG_DEPENDS=\"zlib\"\nTERMUX_PKG_BUILD_DEPENDS=\"boost\"\nTERMUX_PKG_BREAKS=\"taglib-dev\"\nTERMUX_PKG_REPLACES=\"taglib-dev\"\nTERMUX_PKG_INCLUDE_IN_DEVPACKAGE=\"bin/taglib-config\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DBUILD_SHARED_LIBS=ON\n-DWITH_MP4=ON\n-DWITH_ASF=ON\"\n"
  },
  {
    "path": "packages/tar/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/tar/\nTERMUX_PKG_DESCRIPTION=\"GNU tar for manipulating tar archives\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.32\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/tar/tar-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=d0d3ae07f103323be809bc3eac0dcc386d52c5262499fe05511ac4788af1fdd8\nTERMUX_PKG_DEPENDS=\"libandroid-glob, libiconv\"\nTERMUX_PKG_ESSENTIAL=true\n\n# When cross-compiling configure guesses that d_ino in struct dirent only exists\n# if triplet matches linux*-gnu*, so we force set it explicitly:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"gl_cv_struct_dirent_d_ino=yes\"\n# this needed to disable tar's implementation of mkfifoat() so it is possible\n# to use own implementation (see patch 'mkfifoat.patch').\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_mkfifoat=yes\"\n\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -D__USE_FORTIFY_LEVEL=0\"\n\tLDFLAGS+=\" -landroid-glob\"\n}\n"
  },
  {
    "path": "packages/tar/gnu-stdio-impl.h.patch",
    "content": "diff -u -r ../tar-1.31/gnu/stdio-impl.h ./gnu/stdio-impl.h\n--- ../tar-1.31/gnu/stdio-impl.h\t2019-01-02 18:16:01.000000000 +0000\n+++ ./gnu/stdio-impl.h\t2019-01-03 00:26:16.683764235 +0000\n@@ -60,7 +60,7 @@\n #  define _flags pub._flags\n #  define _r pub._r\n #  define _w pub._w\n-# elif defined __ANDROID__ /* Android */\n+# elif defined __ANDROID_BUT_THIS_IS_BROKEN__ /* Android */\n   /* Up to this commit from 2015-10-12\n      <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>\n      the innards of FILE were public, and fp_ub could be defined like for OpenBSD,\n"
  },
  {
    "path": "packages/tar/gnu-vasnprintf.c.patch",
    "content": "diff -uNr tar-1.32/gnu/vasnprintf.c tar-1.32.mod/gnu/vasnprintf.c\n--- tar-1.32/gnu/vasnprintf.c\t2019-01-02 20:16:02.000000000 +0200\n+++ tar-1.32.mod/gnu/vasnprintf.c\t2019-11-29 15:26:53.996809645 +0200\n@@ -4874,7 +4874,7 @@\n # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))        \\\n          && !defined __UCLIBC__)                                            \\\n         || (defined __APPLE__ && defined __MACH__)                          \\\n-        || (defined _WIN32 && ! defined __CYGWIN__))\n+        || (defined _WIN32 && ! defined __CYGWIN__) || defined(__ANDROID__))\n                 fbp[1] = '%';\n                 fbp[2] = 'n';\n                 fbp[3] = '\\0';\n"
  },
  {
    "path": "packages/tar/src-system.c.patch",
    "content": "diff -u -r ../tar-1.29/src/system.c ./src/system.c\n--- ../tar-1.29/src/system.c\t2016-04-14 04:23:45.000000000 -0400\n+++ ./src/system.c\t2016-08-20 17:14:29.885111362 -0400\n@@ -29,12 +29,12 @@\n {\n   char *argv[4];\n \n-  argv[0] = (char *) \"/bin/sh\";\n+  argv[0] = (char *) \"@TERMUX_PREFIX@/bin/sh\";\n   argv[1] = (char *) \"-c\";\n   argv[2] = (char *) cmd;\n   argv[3] = NULL;\n \n-  execv (\"/bin/sh\", argv);\n+  execv (\"@TERMUX_PREFIX@/bin/sh\", argv);\n   exec_fatal (cmd);\n }\n \n@@ -203,7 +203,7 @@\n   pid_t child;\n   const char *shell = getenv (\"SHELL\");\n   if (! shell)\n-    shell = \"/bin/sh\";\n+    shell = \"@TERMUX_PREFIX@/bin/sh\";\n   child = xfork ();\n   if (child == 0)\n     {\n"
  },
  {
    "path": "packages/tar/tmpdir-path.patch",
    "content": "diff -uNr tar-1.31/gnu/tempname.c tar-1.31.mod/gnu/tempname.c\n--- tar-1.31/gnu/tempname.c\t2019-01-02 20:16:01.000000000 +0200\n+++ tar-1.31.mod/gnu/tempname.c\t2019-03-01 18:31:05.035530338 +0200\n@@ -32,7 +32,7 @@\n\n #include <stdio.h>\n #ifndef P_tmpdir\n-# define P_tmpdir \"/tmp\"\n+# define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n #endif\n #ifndef TMP_MAX\n # define TMP_MAX 238328\n@@ -147,8 +147,8 @@\n     {\n       if (direxists (P_tmpdir))\n         dir = P_tmpdir;\n-      else if (strcmp (P_tmpdir, \"/tmp\") != 0 && direxists (\"/tmp\"))\n-        dir = \"/tmp\";\n+      else if (strcmp (P_tmpdir, \"@TERMUX_PREFIX@/tmp\") != 0 && direxists (\"@TERMUX_PREFIX@/tmp\"))\n+        dir = \"@TERMUX_PREFIX@/tmp\";\n       else\n         {\n           __set_errno (ENOENT);\ndiff -uNr tar-1.31/src/xheader.c tar-1.31.mod/src/xheader.c\n--- tar-1.31/src/xheader.c\t2019-01-02 20:07:48.000000000 +0200\n+++ tar-1.31.mod/src/xheader.c\t2019-03-01 18:31:18.538927987 +0200\n@@ -387,7 +387,7 @@\n       size_t len;\n       const char *tmp = getenv (\"TMPDIR\");\n       if (!tmp)\n-\ttmp = \"/tmp\";\n+\ttmp = \"@TERMUX_PREFIX@/tmp\";\n       len = strlen (tmp) + sizeof (GLOBAL_HEADER_TEMPLATE); /* Includes nul */\n       globexthdr_name = xmalloc (len);\n       strcpy(globexthdr_name, tmp);\n"
  },
  {
    "path": "packages/tasksh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://taskwarrior.org\nTERMUX_PKG_DESCRIPTION=\"Shell command wrapping Taskwarrior commands\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.2.0\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://taskwarrior.org/download/tasksh-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=6e42f949bfd7fbdde4870af0e7b923114cc96c4344f82d9d924e984629e21ffd\nTERMUX_PKG_DEPENDS=\"libc++, readline, taskwarrior, libandroid-glob\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n\n"
  },
  {
    "path": "packages/taskwarrior/CMakeLists.txt.patch",
    "content": "diff -u -r ../task-2.5.1/CMakeLists.txt ./CMakeLists.txt\n--- ../task-2.5.1/CMakeLists.txt\t2016-02-24 23:18:11.000000000 +0100\n+++ ./CMakeLists.txt\t2017-01-15 23:14:01.677031016 +0100\n@@ -43,10 +43,6 @@\n  message (FATAL_ERROR \"C++11 support missing. Try upgrading your C++ compiler. If you have a good reason for using an outdated compiler, please let us know at support@taskwarrior.org.\")\n endif (_HAS_CXX11)\n \n-if (${CMAKE_CXX_COMPILER_ID} STREQUAL \"Clang\")\n-  set (_CXX11_FLAGS \"${_CXX11_FLAGS} -stdlib=libc++\")\n-endif (${CMAKE_CXX_COMPILER_ID} STREQUAL \"Clang\")\n-\n if (${CMAKE_SYSTEM_NAME} MATCHES \"Linux\")\n   set (LINUX true)\n elseif (${CMAKE_SYSTEM_NAME} MATCHES \"Darwin\")\n"
  },
  {
    "path": "packages/taskwarrior/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://taskwarrior.org\nTERMUX_PKG_DESCRIPTION=\"Utility for managing your TODO list\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.5.1\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SRCURL=https://taskwarrior.org/download/task-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=d87bcee58106eb8a79b850e9abc153d98b79e00d50eade0d63917154984f2a15\nTERMUX_PKG_DEPENDS=\"libc++, libgnutls, libuuid, libandroid-glob\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n\n"
  },
  {
    "path": "packages/tcl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tcl.tk/\nTERMUX_PKG_DESCRIPTION=\"Powerful but easy to learn dynamic programming language\"\nTERMUX_PKG_LICENSE=\"custom\"\nTERMUX_PKG_LICENSE_FILE=\"license.terms\"\nTERMUX_PKG_VERSION=8.6.10\nTERMUX_PKG_SHA256=5196dbf6638e3df8d5c87b5815c8c2b758496eb6f0e41446596c9a4e638d87ed\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/tcl/Tcl/${TERMUX_PKG_VERSION}/tcl${TERMUX_PKG_VERSION}-src.tar.gz\nTERMUX_PKG_DEPENDS=\"libsqlite, zlib\"\nTERMUX_PKG_BREAKS=\"tcl-dev, tcl-static\"\nTERMUX_PKG_REPLACES=\"tcl-dev, tcl-static\"\nTERMUX_PKG_NO_STATICSPLIT=true\nTERMUX_PKG_REVISION=1\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_memcmp_working=yes\nac_cv_func_memcmp=yes\nac_cv_func_strtod=yes\nac_cv_func_strtoul=yes\ntcl_cv_strstr_unbroken=ok\ntcl_cv_strtod_buggy=ok\ntcl_cv_strtod_unbroken=ok\ntcl_cv_strtoul_unbroken=ok\n--disable-rpath\n--enable-man-symlinks\n--mandir=$TERMUX_PREFIX/share/man\n\"\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_SRCDIR=$TERMUX_PKG_SRCDIR/unix\n\tCFLAGS+=\" -DBIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD\"\n}\n\ntermux_step_post_make_install() {\n\t# expect needs private headers\n\tmake install-private-headers\n\tlocal _MAJOR_VERSION=${TERMUX_PKG_VERSION:0:3}\n\tcd $TERMUX_PREFIX/bin\n\tln -f -s tclsh$_MAJOR_VERSION tclsh\n\n\t# Hack to use system libsqlite (https://www.sqlite.org/howtocompile.html#tcl)\n\t# since --with-system-sqlite fails to build:\n\tlocal NEW_LIBDIR=$TERMUX_PREFIX/lib/tcl$_MAJOR_VERSION/sqlite\n\tmkdir -p $NEW_LIBDIR\n\t$CC $CFLAGS $CPPFLAGS $LDFLAGS \\\n\t\t-DUSE_SYSTEM_SQLITE=1 \\\n\t\t-o $NEW_LIBDIR/libtclsqlite3.so \\\n\t\t-shared \\\n\t\t$TERMUX_PREFIX/src/libsqlite/tclsqlite3.c \\\n\t\t-ltcl$_MAJOR_VERSION -lsqlite3\n\tlocal LIBSQLITE_VERSION=$($PKG_CONFIG --modversion sqlite3)\n\techo \"package ifneeded sqlite3 $LIBSQLITE_VERSION [list load [file join \\$dir libtclsqlite3.so] Sqlite3]\" > \\\n\t\t$NEW_LIBDIR/pkgIndex.tcl\n\n\t# Needed to install $TERMUX_PKG_LICENSE_FILE.\n\tTERMUX_PKG_SRCDIR=$(dirname \"$TERMUX_PKG_SRCDIR\")\n\n\t#avoid conflict with perl\n\tmv $TERMUX_PREFIX/share/man/man3/Thread.3 $TERMUX_PREFIX/share/man/man3/Tcl_Thread.3\n}\n"
  },
  {
    "path": "packages/tcsh/Makefile.in.patch",
    "content": "diff -u -r ../tcsh-TCSH6_21_00/Makefile.in ./Makefile.in\n--- ../tcsh-TCSH6_21_00/Makefile.in\t2019-05-08 18:39:28.000000000 +0000\n+++ ./Makefile.in\t2019-05-11 21:18:26.577655692 +0000\n@@ -447,7 +447,7 @@\n \n gethost:  gethost.c sh.err.h tc.const.h sh.h\n \trm -f gethost\n-\t${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} $(srcdir)/gethost.c\n+\t${CC_FOR_GETHOST} -o gethost -I. -I$(srcdir) $(srcdir)/gethost.c\n \n tc.defs.c:\tgethost host.defs\n \t@rm -f $@.tmp\n"
  },
  {
    "path": "packages/tcsh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tcsh.org\nTERMUX_PKG_DESCRIPTION=\"TENEX C Shell, an enhanced version of Berkeley csh\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=6.22.02\nTERMUX_PKG_SRCURL=https://github.com/tcsh-org/tcsh/archive/TCSH${TERMUX_PKG_VERSION//./_}.tar.gz\nTERMUX_PKG_SHA256=f4f1ba643a5b36718f80709dadf81ded65356e3c82d3f548c68f57e9f61295b6\nTERMUX_PKG_DEPENDS=\"ncurses, libcrypt\"\n"
  },
  {
    "path": "packages/tcsh/sh.h.patch",
    "content": "diff -u -r ../tcsh-TCSH6_21_00/sh.h ./sh.h\n--- ../tcsh-TCSH6_21_00/sh.h\t2019-05-08 18:39:28.000000000 +0000\n+++ ./sh.h\t2019-05-11 21:11:35.458175126 +0000\n@@ -91,6 +91,8 @@\n \n #define TMP_TEMPLATE \".XXXXXX\"\n \n+#include <wctype.h>\n+\n #ifdef SHORT_STRINGS\n # ifdef WIDE_STRINGS\n #include <wchar.h>\n"
  },
  {
    "path": "packages/teckit/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://scripts.sil.org/teckitdownloads\nTERMUX_PKG_DESCRIPTION=\"TECkit is a library for encoding conversion\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=2.5.9\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/silnrsi/teckit/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=9c9f77ed40e2fcfbbb82e88b78fee2233c58e2ecfd3f3201bfa4b13ea6b5c970\nTERMUX_PKG_DEPENDS=\"libc++, zlib\"\nTERMUX_PKG_BREAKS=\"teckit-dev\"\nTERMUX_PKG_REPLACES=\"teckit-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_lib_expat_XML_ExpatVersion=no\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/tergent/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/aeolwyr/tergent\nTERMUX_PKG_DESCRIPTION=\"An ssh-agent implementation for Termux that uses Android Keystore as its backend\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.1.1\nTERMUX_PKG_SRCURL=https://github.com/aeolwyr/tergent/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=b16e5ba1a9333d6e14b94d8cf3f5ad27d3af124f6f2bbebb0eca62ac95783281\nTERMUX_PKG_DEPENDS=\"termux-api\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/termimage/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/nabijaczleweli/termimage\nTERMUX_PKG_DESCRIPTION=\"Terminal image viewer\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.4.0\nTERMUX_PKG_SRCURL=https://github.com/nabijaczleweli/termimage/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=7150002d743bda8fe1192397b5931cd8d0c42fbf92d7d7f83237148be2715c57\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/termux-am/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/TermuxAm\nTERMUX_PKG_DESCRIPTION=\"Android Oreo-compatible am command reimplementation\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Michal Bednarski @michalbednarski\"\nTERMUX_PKG_VERSION=0.3\nTERMUX_PKG_SHA256=3abfaca319f59fa769480c33d50e2ee1ff73122eac7c658f9e2a66a2da29ebb7\nTERMUX_PKG_SRCURL=https://github.com/termux/TermuxAm/archive/v$TERMUX_PKG_VERSION.zip\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_CONFLICTS=\"termux-tools (<< 0.51)\"\n\ntermux_step_make() {\n\t# Download and use a new enough gradle version to avoid the process hanging after running:\n\ttermux_download \\\n\t\thttps://services.gradle.org/distributions/gradle-5.4-bin.zip \\\n\t\t$TERMUX_PKG_CACHEDIR/gradle-5.4-bin.zip \\\n\t\tc8c17574245ecee9ed7fe4f6b593b696d1692d1adbfef425bef9b333e3a0e8de\n\tmkdir $TERMUX_PKG_TMPDIR/gradle\n\tunzip -q $TERMUX_PKG_CACHEDIR/gradle-5.4-bin.zip -d $TERMUX_PKG_TMPDIR/gradle\n\n\t# Avoid spawning the gradle daemon due to org.gradle.jvmargs\n\t# being set (https://github.com/gradle/gradle/issues/1434):\n\trm gradle.properties\n\n\texport ANDROID_HOME\n\texport GRADLE_OPTS=\"-Dorg.gradle.daemon=false -Xmx1536m\"\n\n\t$TERMUX_PKG_TMPDIR/gradle/gradle-5.4/bin/gradle \\\n\t\t:app:assembleRelease\n}\n\ntermux_step_make_install() {\n\tcp $TERMUX_PKG_SRCDIR/am-libexec-packaged $TERMUX_PREFIX/bin/am\n\tmkdir -p $TERMUX_PREFIX/libexec/termux-am\n\tcp $TERMUX_PKG_SRCDIR/app/build/outputs/apk/release/app-release-unsigned.apk $TERMUX_PREFIX/libexec/termux-am/am.apk\n}\n"
  },
  {
    "path": "packages/termux-api/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://wiki.termux.com/wiki/Termux:API\nTERMUX_PKG_DESCRIPTION=\"Termux API commands (install also the Termux:API app)\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=0.47\nTERMUX_PKG_SHA256=f0ce46c3f39d609d64e38d1ad292f233251760032bdf313ce8547c2f551f43c3\nTERMUX_PKG_SRCURL=https://github.com/termux/termux-api-package/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"bash\"\n"
  },
  {
    "path": "packages/termux-apt-repo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-apt-repo\nTERMUX_PKG_DESCRIPTION=\"Script to create Termux apt repositories\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.4\nTERMUX_PKG_SHA256=54ea18d06d234d18ab8f7b264c4bd045651eb7908fa3850974b6560c7fb34af3\nTERMUX_PKG_SRCURL=https://github.com/termux/termux-apt-repo/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n# binutils for ar:\nTERMUX_PKG_DEPENDS=\"binutils, python, tar\"\n"
  },
  {
    "path": "packages/termux-auth/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-auth\nTERMUX_PKG_DESCRIPTION=\"Password authentication library and utility for Termux\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/termux/termux-auth/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=fd6fab1808b1e98dc865c47db8b4719f887273f95fe0f4dad26af016c28fa915\nTERMUX_PKG_DEPENDS=\"openssl\"\nTERMUX_PKG_BREAKS=\"termux-auth-dev\"\nTERMUX_PKG_REPLACES=\"termux-auth-dev\"\n"
  },
  {
    "path": "packages/termux-create-package/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-create-package\nTERMUX_PKG_DESCRIPTION=\"Utility to create Termux packages\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.7\nTERMUX_PKG_SHA256=e318edf152b01b19306b9f591104e50c6131f08db50694aa16ddade196400f5f\nTERMUX_PKG_SRCURL=https://github.com/termux/termux-create-package/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"python\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tcp termux-create-package $TERMUX_PREFIX/bin/termux-create-package\n}\n"
  },
  {
    "path": "packages/termux-elf-cleaner/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-elf-cleaner\nTERMUX_PKG_DESCRIPTION=\"Cleaner of ELF files for Android\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\n# NOTE: The termux-elf-cleaner.cpp file is used by build-package.sh\n#       to create a native binary. Bumping this version will need\n#       updating the checksum used there.\nTERMUX_PKG_VERSION=1.7\nTERMUX_PKG_SRCURL=https://github.com/termux/termux-elf-cleaner/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=cf74cabfcf5c22e0308074e6683ca7efa14f1a3c801d1656b96e38ff7301ae0b\nTERMUX_PKG_DEPENDS=\"libc++\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/termux-exec/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/termux-exec\nTERMUX_PKG_DESCRIPTION=\"An execve() wrapper to make /bin and /usr/bin shebangs work\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.4\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/termux/termux-exec/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=9a8d42d211a7d461d61dcd4e3ef984014c2c2c696cfd6394bae389af13572627\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/termux-keyring/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux\nTERMUX_PKG_DESCRIPTION=\"GPG public keys for the official Termux repositories\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=1.2\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/apt/trusted.gpg.d\n\n\t# Maintainer-specific keys.\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/grimler.gpg $TERMUX_PREFIX/etc/apt/trusted.gpg.d/\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/xeffyr.gpg $TERMUX_PREFIX/etc/apt/trusted.gpg.d/\n\n\t# Key for automatic builds (via CI).\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/termux-autobuilds.gpg $TERMUX_PREFIX/etc/apt/trusted.gpg.d/\n}\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/AGPL-V3.txt",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/Apache-2.0.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/Artistic-License-2.0.txt",
    "content": "\t\t\t The \"Artistic License\"\n\n\t\t\t\tPreamble\n\nThe intent of this document is to state the conditions under which a\nPackage may be copied, such that the Copyright Holder maintains some\nsemblance of artistic control over the development of the package,\nwhile giving the users of the package the right to use and distribute\nthe Package in a more-or-less customary fashion, plus the right to make\nreasonable modifications.\n\nDefinitions:\n\n\t\"Package\" refers to the collection of files distributed by the\n\tCopyright Holder, and derivatives of that collection of files\n\tcreated through textual modification.\n\n\t\"Standard Version\" refers to such a Package if it has not been\n\tmodified, or has been modified in accordance with the wishes\n\tof the Copyright Holder as specified below.\n\n\t\"Copyright Holder\" is whoever is named in the copyright or\n\tcopyrights for the package.\n\n\t\"You\" is you, if you're thinking about copying or distributing\n\tthis Package.\n\n\t\"Reasonable copying fee\" is whatever you can justify on the\n\tbasis of media cost, duplication charges, time of people involved,\n\tand so on.  (You will not be required to justify it to the\n\tCopyright Holder, but only to the computing community at large\n\tas a market that must bear the fee.)\n\n\t\"Freely Available\" means that no fee is charged for the item\n\titself, though there may be fees involved in handling the item.\n\tIt also means that recipients of the item may redistribute it\n\tunder the same conditions they received it.\n\n1. You may make and give away verbatim copies of the source form of the\nStandard Version of this Package without restriction, provided that you\nduplicate all of the original copyright notices and associated disclaimers.\n\n2. You may apply bug fixes, portability fixes and other modifications\nderived from the Public Domain or from the Copyright Holder.  A Package\nmodified in such a way shall still be considered the Standard Version.\n\n3. You may otherwise modify your copy of this Package in any way, provided\nthat you insert a prominent notice in each changed file stating how and\nwhen you changed that file, and provided that you do at least ONE of the\nfollowing:\n\n    a) place your modifications in the Public Domain or otherwise make them\n    Freely Available, such as by posting said modifications to Usenet or\n    an equivalent medium, or placing the modifications on a major archive\n    site such as uunet.uu.net, or by allowing the Copyright Holder to include\n    your modifications in the Standard Version of the Package.\n\n    b) use the modified Package only within your corporation or organization.\n\n    c) rename any non-standard executables so the names do not conflict\n    with standard executables, which must also be provided, and provide\n    a separate manual page for each non-standard executable that clearly\n    documents how it differs from the Standard Version.\n\n    d) make other distribution arrangements with the Copyright Holder.\n\n4. You may distribute the programs of this Package in object code or\nexecutable form, provided that you do at least ONE of the following:\n\n    a) distribute a Standard Version of the executables and library files,\n    together with instructions (in the manual page or equivalent) on where\n    to get the Standard Version.\n\n    b) accompany the distribution with the machine-readable source of\n    the Package with your modifications.\n\n    c) give non-standard executables non-standard names, and clearly\n    document the differences in manual pages (or equivalent), together\n    with instructions on where to get the Standard Version.\n\n    d) make other distribution arrangements with the Copyright Holder.\n\n5. You may charge a reasonable copying fee for any distribution of this\nPackage.  You may charge any fee you choose for support of this\nPackage.  You may not charge a fee for this Package itself.  However,\nyou may distribute this Package in aggregate with other (possibly\ncommercial) programs as part of a larger (possibly commercial) software\ndistribution provided that you do not advertise this Package as a\nproduct of your own.  You may embed this Package's interpreter within\nan executable of yours (by linking); this shall be construed as a mere\nform of aggregation, provided that the complete Standard Version of the\ninterpreter is so embedded.\n\n6. The scripts and library files supplied as input to or produced as\noutput from the programs of this Package do not automatically fall\nunder the copyright of this Package, but belong to whoever generated\nthem, and may be sold commercially, and may be aggregated with this\nPackage.  If such scripts or library files are aggregated with this\nPackage via the so-called \"undump\" or \"unexec\" methods of producing a\nbinary executable image, then distribution of such an image shall\nneither be construed as a distribution of this Package nor shall it\nfall under the restrictions of Paragraphs 3 and 4, provided that you do\nnot represent such an executable image as a Standard Version of this\nPackage.\n\n7. C subroutines (or comparably compiled subroutines in other\nlanguages) supplied by you and linked into this Package in order to\nemulate subroutines and variables of the language defined by this\nPackage shall not be considered part of this Package, but are the\nequivalent of input as in Paragraph 6, provided these subroutines do\nnot change the language in any way that would cause it to fail the\nregression tests for the language.\n\n8. Aggregation of this Package with a commercial distribution is always\npermitted provided that the use of this Package is embedded; that is,\nwhen no overt attempt is made to make this Package's interfaces visible\nto the end user of the commercial distribution.  Such use shall not be\nconstrued as a distribution of this Package.\n\n9. The name of the Copyright Holder may not be used to endorse or promote\nproducts derived from this software without specific prior written permission.\n\n10. THIS PACKAGE IS PROVIDED \"AS IS\" AND WITHOUT ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED\nWARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n\n\t\t\t\tThe End\n\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/BSD 2-Clause.txt",
    "content": "Copyright (c) <year>, <copyright holder>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nThe views and conclusions contained in the software and documentation are those\nof the authors and should not be interpreted as representing official policies,\neither expressed or implied, of the <project name> project.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/BSD 3-Clause.txt",
    "content": "Copyright (c) <year>, <copyright holder>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n    * Neither the name of the <organization> nor the\n      names of its contributors may be used to endorse or promote products\n      derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/BSD.txt",
    "content": "Copyright (c) <year>, <copyright holder>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the distribution.\n3. All advertising materials mentioning features or use of this software\n   must display the following acknowledgement:\n   This product includes software developed by the <organization>.\n4. Neither the name of the <organization> nor the\n   names of its contributors may be used to endorse or promote products\n   derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/BSL-1.0.txt",
    "content": "Permission is hereby granted, free of charge, to any person or organization\nobtaining a copy of the software and accompanying documentation covered by\nthis license (the \"Software\") to use, reproduce, display, distribute,\nexecute, and transmit the Software, and to prepare derivative works of the\nSoftware, and to permit third-parties to whom the Software is furnished to\ndo so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including\nthe above license grant, this restriction and the following disclaimer,\nmust be included in all copies of the Software, in whole or in part, and\nall derivative works of the Software, unless such copies or derivative\nworks are solely in the form of machine-executable object code generated by\na source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\nSHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\nFOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/CC0-1.0.txt",
    "content": "Creative Commons Legal Code\n\nCC0 1.0 Universal\n\n    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE\n    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN\n    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS\n    INFORMATION ON AN \"AS-IS\" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES\n    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS\n    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM\n    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED\n    HEREUNDER.\n\nStatement of Purpose\n\nThe laws of most jurisdictions throughout the world automatically confer\nexclusive Copyright and Related Rights (defined below) upon the creator\nand subsequent owner(s) (each and all, an \"owner\") of an original work of\nauthorship and/or a database (each, a \"Work\").\n\nCertain owners wish to permanently relinquish those rights to a Work for\nthe purpose of contributing to a commons of creative, cultural and\nscientific works (\"Commons\") that the public can reliably and without fear\nof later claims of infringement build upon, modify, incorporate in other\nworks, reuse and redistribute as freely as possible in any form whatsoever\nand for any purposes, including without limitation commercial purposes.\nThese owners may contribute to the Commons to promote the ideal of a free\nculture and the further production of creative, cultural and scientific\nworks, or to gain reputation or greater distribution for their Work in\npart through the use and efforts of others.\n\nFor these and/or other purposes and motivations, and without any\nexpectation of additional consideration or compensation, the person\nassociating CC0 with a Work (the \"Affirmer\"), to the extent that he or she\nis an owner of Copyright and Related Rights in the Work, voluntarily\nelects to apply CC0 to the Work and publicly distribute the Work under its\nterms, with knowledge of his or her Copyright and Related Rights in the\nWork and the meaning and intended legal effect of CC0 on those rights.\n\n1. Copyright and Related Rights. A Work made available under CC0 may be\nprotected by copyright and related or neighboring rights (\"Copyright and\nRelated Rights\"). Copyright and Related Rights include, but are not\nlimited to, the following:\n\n  i. the right to reproduce, adapt, distribute, perform, display,\n     communicate, and translate a Work;\n ii. moral rights retained by the original author(s) and/or performer(s);\niii. publicity and privacy rights pertaining to a person's image or\n     likeness depicted in a Work;\n iv. rights protecting against unfair competition in regards to a Work,\n     subject to the limitations in paragraph 4(a), below;\n  v. rights protecting the extraction, dissemination, use and reuse of data\n     in a Work;\n vi. database rights (such as those arising under Directive 96/9/EC of the\n     European Parliament and of the Council of 11 March 1996 on the legal\n     protection of databases, and under any national implementation\n     thereof, including any amended or successor version of such\n     directive); and\nvii. other similar, equivalent or corresponding rights throughout the\n     world based on applicable law or treaty, and any national\n     implementations thereof.\n\n2. Waiver. To the greatest extent permitted by, but not in contravention\nof, applicable law, Affirmer hereby overtly, fully, permanently,\nirrevocably and unconditionally waives, abandons, and surrenders all of\nAffirmer's Copyright and Related Rights and associated claims and causes\nof action, whether now known or unknown (including existing as well as\nfuture claims and causes of action), in the Work (i) in all territories\nworldwide, (ii) for the maximum duration provided by applicable law or\ntreaty (including future time extensions), (iii) in any current or future\nmedium and for any number of copies, and (iv) for any purpose whatsoever,\nincluding without limitation commercial, advertising or promotional\npurposes (the \"Waiver\"). Affirmer makes the Waiver for the benefit of each\nmember of the public at large and to the detriment of Affirmer's heirs and\nsuccessors, fully intending that such Waiver shall not be subject to\nrevocation, rescission, cancellation, termination, or any other legal or\nequitable action to disrupt the quiet enjoyment of the Work by the public\nas contemplated by Affirmer's express Statement of Purpose.\n\n3. Public License Fallback. Should any part of the Waiver for any reason\nbe judged legally invalid or ineffective under applicable law, then the\nWaiver shall be preserved to the maximum extent permitted taking into\naccount Affirmer's express Statement of Purpose. In addition, to the\nextent the Waiver is so judged Affirmer hereby grants to each affected\nperson a royalty-free, non transferable, non sublicensable, non exclusive,\nirrevocable and unconditional license to exercise Affirmer's Copyright and\nRelated Rights in the Work (i) in all territories worldwide, (ii) for the\nmaximum duration provided by applicable law or treaty (including future\ntime extensions), (iii) in any current or future medium and for any number\nof copies, and (iv) for any purpose whatsoever, including without\nlimitation commercial, advertising or promotional purposes (the\n\"License\"). The License shall be deemed effective as of the date CC0 was\napplied by Affirmer to the Work. Should any part of the License for any\nreason be judged legally invalid or ineffective under applicable law, such\npartial invalidity or ineffectiveness shall not invalidate the remainder\nof the License, and in such case Affirmer hereby affirms that he or she\nwill not (i) exercise any of his or her remaining Copyright and Related\nRights in the Work or (ii) assert any associated claims and causes of\naction with respect to the Work, in either case contrary to Affirmer's\nexpress Statement of Purpose.\n\n4. Limitations and Disclaimers.\n\n a. No trademark or patent rights held by Affirmer are waived, abandoned,\n    surrendered, licensed or otherwise affected by this document.\n b. Affirmer offers the Work as-is and makes no representations or\n    warranties of any kind concerning the Work, express, implied,\n    statutory or otherwise, including without limitation warranties of\n    title, merchantability, fitness for a particular purpose, non\n    infringement, or the absence of latent or other defects, accuracy, or\n    the present or absence of errors, whether or not discoverable, all to\n    the greatest extent permissible under applicable law.\n c. Affirmer disclaims responsibility for clearing rights of other persons\n    that may apply to the Work or any use thereof, including without\n    limitation any person's Copyright and Related Rights in the Work.\n    Further, Affirmer disclaims responsibility for obtaining any necessary\n    consents, permissions or other rights required for any use of the\n    Work.\n d. Affirmer understands and acknowledges that Creative Commons is not a\n    party to this document and has no duty or obligation with respect to\n    this CC0 or use of the Work.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/CeCILL-2.1.txt",
    "content": "\n  CeCILL FREE SOFTWARE LICENSE AGREEMENT\n\nVersion 2.1 dated 2013-06-21\n\n\n    Notice\n\nThis Agreement is a Free Software license agreement that is the result\nof discussions between its authors in order to ensure compliance with\nthe two main principles guiding its drafting:\n\n  * firstly, compliance with the principles governing the distribution\n    of Free Software: access to source code, broad rights granted to users,\n  * secondly, the election of a governing law, French law, with which it\n    is conformant, both as regards the law of torts and intellectual\n    property law, and the protection that it offers to both authors and\n    holders of the economic rights over software.\n\nThe authors of the CeCILL (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) \nlicense are: \n\nCommissariat  l'nergie atomique et aux nergies alternatives - CEA, a\npublic scientific, technical and industrial research establishment,\nhaving its principal place of business at 25 rue Leblanc, immeuble Le\nPonant D, 75015 Paris, France.\n\nCentre National de la Recherche Scientifique - CNRS, a public scientific\nand technological establishment, having its principal place of business\nat 3 rue Michel-Ange, 75794 Paris cedex 16, France.\n\nInstitut National de Recherche en Informatique et en Automatique -\nInria, a public scientific and technological establishment, having its\nprincipal place of business at Domaine de Voluceau, Rocquencourt, BP\n105, 78153 Le Chesnay cedex, France.\n\n\n    Preamble\n\nThe purpose of this Free Software license agreement is to grant users\nthe right to modify and redistribute the software governed by this\nlicense within the framework of an open source distribution model.\n\nThe exercising of this right is conditional upon certain obligations for\nusers so as to preserve this status for all subsequent redistributions.\n\nIn consideration of access to the source code and the rights to copy,\nmodify and redistribute granted by the license, users are provided only\nwith a limited warranty and the software's author, the holder of the\neconomic rights, and the successive licensors only have limited liability.\n\nIn this respect, the risks associated with loading, using, modifying\nand/or developing or reproducing the software by the user are brought to\nthe user's attention, given its Free Software status, which may make it\ncomplicated to use, with the result that its use is reserved for\ndevelopers and experienced professionals having in-depth computer\nknowledge. Users are therefore encouraged to load and test the\nsuitability of the software as regards their requirements in conditions\nenabling the security of their systems and/or data to be ensured and,\nmore generally, to use and operate it in the same conditions of\nsecurity. This Agreement may be freely reproduced and published,\nprovided it is not altered, and that no provisions are either added or\nremoved herefrom.\n\nThis Agreement may apply to any or all software for which the holder of\nthe economic rights decides to submit the use thereof to its provisions.\n\nFrequently asked questions can be found on the official website of the\nCeCILL licenses family (http://www.cecill.info/index.en.html) for any \nnecessary clarification.\n\n\n    Article 1 - DEFINITIONS\n\nFor the purpose of this Agreement, when the following expressions\ncommence with a capital letter, they shall have the following meaning:\n\nAgreement: means this license agreement, and its possible subsequent\nversions and annexes.\n\nSoftware: means the software in its Object Code and/or Source Code form\nand, where applicable, its documentation, \"as is\" when the Licensee\naccepts the Agreement.\n\nInitial Software: means the Software in its Source Code and possibly its\nObject Code form and, where applicable, its documentation, \"as is\" when\nit is first distributed under the terms and conditions of the Agreement.\n\nModified Software: means the Software modified by at least one\nContribution.\n\nSource Code: means all the Software's instructions and program lines to\nwhich access is required so as to modify the Software.\n\nObject Code: means the binary files originating from the compilation of\nthe Source Code.\n\nHolder: means the holder(s) of the economic rights over the Initial\nSoftware.\n\nLicensee: means the Software user(s) having accepted the Agreement.\n\nContributor: means a Licensee having made at least one Contribution.\n\nLicensor: means the Holder, or any other individual or legal entity, who\ndistributes the Software under the Agreement.\n\nContribution: means any or all modifications, corrections, translations,\nadaptations and/or new functions integrated into the Software by any or\nall Contributors, as well as any or all Internal Modules.\n\nModule: means a set of sources files including their documentation that\nenables supplementary functions or services in addition to those offered\nby the Software.\n\nExternal Module: means any or all Modules, not derived from the\nSoftware, so that this Module and the Software run in separate address\nspaces, with one calling the other when they are run.\n\nInternal Module: means any or all Module, connected to the Software so\nthat they both execute in the same address space.\n\nGNU GPL: means the GNU General Public License version 2 or any\nsubsequent version, as published by the Free Software Foundation Inc.\n\nGNU Affero GPL: means the GNU Affero General Public License version 3 or\nany subsequent version, as published by the Free Software Foundation Inc.\n\nEUPL: means the European Union Public License version 1.1 or any\nsubsequent version, as published by the European Commission.\n\nParties: mean both the Licensee and the Licensor.\n\nThese expressions may be used both in singular and plural form.\n\n\n    Article 2 - PURPOSE\n\nThe purpose of the Agreement is the grant by the Licensor to the\nLicensee of a non-exclusive, transferable and worldwide license for the\nSoftware as set forth in Article 5 <#scope> hereinafter for the whole\nterm of the protection granted by the rights over said Software.\n\n\n    Article 3 - ACCEPTANCE\n\n3.1 The Licensee shall be deemed as having accepted the terms and\nconditions of this Agreement upon the occurrence of the first of the\nfollowing events:\n\n  * (i) loading the Software by any or all means, notably, by\n    downloading from a remote server, or by loading from a physical medium;\n  * (ii) the first time the Licensee exercises any of the rights granted\n    hereunder.\n\n3.2 One copy of the Agreement, containing a notice relating to the\ncharacteristics of the Software, to the limited warranty, and to the\nfact that its use is restricted to experienced users has been provided\nto the Licensee prior to its acceptance as set forth in Article 3.1\n<#accepting> hereinabove, and the Licensee hereby acknowledges that it\nhas read and understood it.\n\n\n    Article 4 - EFFECTIVE DATE AND TERM\n\n\n      4.1 EFFECTIVE DATE\n\nThe Agreement shall become effective on the date when it is accepted by\nthe Licensee as set forth in Article 3.1 <#accepting>.\n\n\n      4.2 TERM\n\nThe Agreement shall remain in force for the entire legal term of\nprotection of the economic rights over the Software.\n\n\n    Article 5 - SCOPE OF RIGHTS GRANTED\n\nThe Licensor hereby grants to the Licensee, who accepts, the following\nrights over the Software for any or all use, and for the term of the\nAgreement, on the basis of the terms and conditions set forth hereinafter.\n\nBesides, if the Licensor owns or comes to own one or more patents\nprotecting all or part of the functions of the Software or of its\ncomponents, the Licensor undertakes not to enforce the rights granted by\nthese patents against successive Licensees using, exploiting or\nmodifying the Software. If these patents are transferred, the Licensor\nundertakes to have the transferees subscribe to the obligations set\nforth in this paragraph.\n\n\n      5.1 RIGHT OF USE\n\nThe Licensee is authorized to use the Software, without any limitation\nas to its fields of application, with it being hereinafter specified\nthat this comprises:\n\n 1. permanent or temporary reproduction of all or part of the Software\n    by any or all means and in any or all form.\n\n 2. loading, displaying, running, or storing the Software on any or all\n    medium.\n\n 3. entitlement to observe, study or test its operation so as to\n    determine the ideas and principles behind any or all constituent\n    elements of said Software. This shall apply when the Licensee\n    carries out any or all loading, displaying, running, transmission or\n    storage operation as regards the Software, that it is entitled to\n    carry out hereunder.\n\n\n      5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS\n\nThe right to make Contributions includes the right to translate, adapt,\narrange, or make any or all modifications to the Software, and the right\nto reproduce the resulting software.\n\nThe Licensee is authorized to make any or all Contributions to the\nSoftware provided that it includes an explicit notice that it is the\nauthor of said Contribution and indicates the date of the creation thereof.\n\n\n      5.3 RIGHT OF DISTRIBUTION\n\nIn particular, the right of distribution includes the right to publish,\ntransmit and communicate the Software to the general public on any or\nall medium, and by any or all means, and the right to market, either in\nconsideration of a fee, or free of charge, one or more copies of the\nSoftware by any means.\n\nThe Licensee is further authorized to distribute copies of the modified\nor unmodified Software to third parties according to the terms and\nconditions set forth hereinafter.\n\n\n        5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION\n\nThe Licensee is authorized to distribute true copies of the Software in\nSource Code or Object Code form, provided that said distribution\ncomplies with all the provisions of the Agreement and is accompanied by:\n\n 1. a copy of the Agreement,\n\n 2. a notice relating to the limitation of both the Licensor's warranty\n    and liability as set forth in Articles 8 and 9,\n\nand that, in the event that only the Object Code of the Software is\nredistributed, the Licensee allows effective access to the full Source\nCode of the Software for a period of at least three years from the\ndistribution of the Software, it being understood that the additional\nacquisition cost of the Source Code shall not exceed the cost of the\ndata transfer.\n\n\n        5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE\n\nWhen the Licensee makes a Contribution to the Software, the terms and\nconditions for the distribution of the resulting Modified Software\nbecome subject to all the provisions of this Agreement.\n\nThe Licensee is authorized to distribute the Modified Software, in\nsource code or object code form, provided that said distribution\ncomplies with all the provisions of the Agreement and is accompanied by:\n\n 1. a copy of the Agreement,\n\n 2. a notice relating to the limitation of both the Licensor's warranty\n    and liability as set forth in Articles 8 and 9,\n\nand, in the event that only the object code of the Modified Software is\nredistributed,\n\n 3. a note stating the conditions of effective access to the full source\n    code of the Modified Software for a period of at least three years\n    from the distribution of the Modified Software, it being understood\n    that the additional acquisition cost of the source code shall not\n    exceed the cost of the data transfer.\n\n\n        5.3.3 DISTRIBUTION OF EXTERNAL MODULES\n\nWhen the Licensee has developed an External Module, the terms and\nconditions of this Agreement do not apply to said External Module, that\nmay be distributed under a separate license agreement.\n\n\n        5.3.4 COMPATIBILITY WITH OTHER LICENSES\n\nThe Licensee can include a code that is subject to the provisions of one\nof the versions of the GNU GPL, GNU Affero GPL and/or EUPL in the\nModified or unmodified Software, and distribute that entire code under\nthe terms of the same version of the GNU GPL, GNU Affero GPL and/or EUPL.\n\nThe Licensee can include the Modified or unmodified Software in a code\nthat is subject to the provisions of one of the versions of the GNU GPL,\nGNU Affero GPL and/or EUPL and distribute that entire code under the\nterms of the same version of the GNU GPL, GNU Affero GPL and/or EUPL.\n\n\n    Article 6 - INTELLECTUAL PROPERTY\n\n\n      6.1 OVER THE INITIAL SOFTWARE\n\nThe Holder owns the economic rights over the Initial Software. Any or\nall use of the Initial Software is subject to compliance with the terms\nand conditions under which the Holder has elected to distribute its work\nand no one shall be entitled to modify the terms and conditions for the\ndistribution of said Initial Software.\n\nThe Holder undertakes that the Initial Software will remain ruled at\nleast by this Agreement, for the duration set forth in Article 4.2 <#term>.\n\n\n      6.2 OVER THE CONTRIBUTIONS\n\nThe Licensee who develops a Contribution is the owner of the\nintellectual property rights over this Contribution as defined by\napplicable law.\n\n\n      6.3 OVER THE EXTERNAL MODULES\n\nThe Licensee who develops an External Module is the owner of the\nintellectual property rights over this External Module as defined by\napplicable law and is free to choose the type of agreement that shall\ngovern its distribution.\n\n\n      6.4 JOINT PROVISIONS\n\nThe Licensee expressly undertakes:\n\n 1. not to remove, or modify, in any manner, the intellectual property\n    notices attached to the Software;\n\n 2. to reproduce said notices, in an identical manner, in the copies of\n    the Software modified or not.\n\nThe Licensee undertakes not to directly or indirectly infringe the\nintellectual property rights on the Software of the Holder and/or\nContributors, and to take, where applicable, vis--vis its staff, any\nand all measures required to ensure respect of said intellectual\nproperty rights of the Holder and/or Contributors.\n\n\n    Article 7 - RELATED SERVICES\n\n7.1 Under no circumstances shall the Agreement oblige the Licensor to\nprovide technical assistance or maintenance services for the Software.\n\nHowever, the Licensor is entitled to offer this type of services. The\nterms and conditions of such technical assistance, and/or such\nmaintenance, shall be set forth in a separate instrument. Only the\nLicensor offering said maintenance and/or technical assistance services\nshall incur liability therefor.\n\n7.2 Similarly, any Licensor is entitled to offer to its licensees, under\nits sole responsibility, a warranty, that shall only be binding upon\nitself, for the redistribution of the Software and/or the Modified\nSoftware, under terms and conditions that it is free to decide. Said\nwarranty, and the financial terms and conditions of its application,\nshall be subject of a separate instrument executed between the Licensor\nand the Licensee.\n\n\n    Article 8 - LIABILITY\n\n8.1 Subject to the provisions of Article 8.2, the Licensee shall be\nentitled to claim compensation for any direct loss it may have suffered\nfrom the Software as a result of a fault on the part of the relevant\nLicensor, subject to providing evidence thereof.\n\n8.2 The Licensor's liability is limited to the commitments made under\nthis Agreement and shall not be incurred as a result of in particular:\n(i) loss due the Licensee's total or partial failure to fulfill its\nobligations, (ii) direct or consequential loss that is suffered by the\nLicensee due to the use or performance of the Software, and (iii) more\ngenerally, any consequential loss. In particular the Parties expressly\nagree that any or all pecuniary or business loss (i.e. loss of data,\nloss of profits, operating loss, loss of customers or orders,\nopportunity cost, any disturbance to business activities) or any or all\nlegal proceedings instituted against the Licensee by a third party,\nshall constitute consequential loss and shall not provide entitlement to\nany or all compensation from the Licensor.\n\n\n    Article 9 - WARRANTY\n\n9.1 The Licensee acknowledges that the scientific and technical\nstate-of-the-art when the Software was distributed did not enable all\npossible uses to be tested and verified, nor for the presence of\npossible defects to be detected. In this respect, the Licensee's\nattention has been drawn to the risks associated with loading, using,\nmodifying and/or developing and reproducing the Software which are\nreserved for experienced users.\n\nThe Licensee shall be responsible for verifying, by any or all means,\nthe suitability of the product for its requirements, its good working\norder, and for ensuring that it shall not cause damage to either persons\nor properties.\n\n9.2 The Licensor hereby represents, in good faith, that it is entitled\nto grant all the rights over the Software (including in particular the\nrights set forth in Article 5 <#scope>).\n\n9.3 The Licensee acknowledges that the Software is supplied \"as is\" by\nthe Licensor without any other express or tacit warranty, other than\nthat provided for in Article 9.2 <#good-faith> and, in particular,\nwithout any warranty as to its commercial value, its secured, safe,\ninnovative or relevant nature.\n\nSpecifically, the Licensor does not warrant that the Software is free\nfrom any error, that it will operate without interruption, that it will\nbe compatible with the Licensee's own equipment and software\nconfiguration, nor that it will meet the Licensee's requirements.\n\n9.4 The Licensor does not either expressly or tacitly warrant that the\nSoftware does not infringe any third party intellectual property right\nrelating to a patent, software or any other property right. Therefore,\nthe Licensor disclaims any and all liability towards the Licensee\narising out of any or all proceedings for infringement that may be\ninstituted in respect of the use, modification and redistribution of the\nSoftware. Nevertheless, should such proceedings be instituted against\nthe Licensee, the Licensor shall provide it with technical and legal\nexpertise for its defense. Such technical and legal expertise shall be\ndecided on a case-by-case basis between the relevant Licensor and the\nLicensee pursuant to a memorandum of understanding. The Licensor\ndisclaims any and all liability as regards the Licensee's use of the\nname of the Software. No warranty is given as regards the existence of\nprior rights over the name of the Software or as regards the existence\nof a trademark.\n\n\n    Article 10 - TERMINATION\n\n10.1 In the event of a breach by the Licensee of its obligations\nhereunder, the Licensor may automatically terminate this Agreement\nthirty (30) days after notice has been sent to the Licensee and has\nremained ineffective.\n\n10.2 A Licensee whose Agreement is terminated shall no longer be\nauthorized to use, modify or distribute the Software. However, any\nlicenses that it may have granted prior to termination of the Agreement\nshall remain valid subject to their having been granted in compliance\nwith the terms and conditions hereof.\n\n\n    Article 11 - MISCELLANEOUS\n\n\n      11.1 EXCUSABLE EVENTS\n\nNeither Party shall be liable for any or all delay, or failure to\nperform the Agreement, that may be attributable to an event of force\nmajeure, an act of God or an outside cause, such as defective\nfunctioning or interruptions of the electricity or telecommunications\nnetworks, network paralysis following a virus attack, intervention by\ngovernment authorities, natural disasters, water damage, earthquakes,\nfire, explosions, strikes and labor unrest, war, etc.\n\n11.2 Any failure by either Party, on one or more occasions, to invoke\none or more of the provisions hereof, shall under no circumstances be\ninterpreted as being a waiver by the interested Party of its right to\ninvoke said provision(s) subsequently.\n\n11.3 The Agreement cancels and replaces any or all previous agreements,\nwhether written or oral, between the Parties and having the same\npurpose, and constitutes the entirety of the agreement between said\nParties concerning said purpose. No supplement or modification to the\nterms and conditions hereof shall be effective as between the Parties\nunless it is made in writing and signed by their duly authorized\nrepresentatives.\n\n11.4 In the event that one or more of the provisions hereof were to\nconflict with a current or future applicable act or legislative text,\nsaid act or legislative text shall prevail, and the Parties shall make\nthe necessary amendments so as to comply with said act or legislative\ntext. All other provisions shall remain effective. Similarly, invalidity\nof a provision of the Agreement, for any reason whatsoever, shall not\ncause the Agreement as a whole to be invalid.\n\n\n      11.5 LANGUAGE\n\nThe Agreement is drafted in both French and English and both versions\nare deemed authentic.\n\n\n    Article 12 - NEW VERSIONS OF THE AGREEMENT\n\n12.1 Any person is authorized to duplicate and distribute copies of this\nAgreement.\n\n12.2 So as to ensure coherence, the wording of this Agreement is\nprotected and may only be modified by the authors of the License, who\nreserve the right to periodically publish updates or new versions of the\nAgreement, each with a separate number. These subsequent versions may\naddress new issues encountered by Free Software.\n\n12.3 Any Software distributed under a given version of the Agreement may\nonly be subsequently distributed under the same version of the Agreement\nor a subsequent version, subject to the provisions of Article 5.3.4\n<#compatibility>.\n\n\n    Article 13 - GOVERNING LAW AND JURISDICTION\n\n13.1 The Agreement is governed by French law. The Parties agree to\nendeavor to seek an amicable solution to any disagreements or disputes\nthat may arise during the performance of the Agreement.\n\n13.2 Failing an amicable solution within two (2) months as from their\noccurrence, and unless emergency proceedings are necessary, the\ndisagreements or disputes shall be referred to the Paris Courts having\njurisdiction, by the more diligent Party.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/EPL-1.0.txt",
    "content": "Eclipse Public License - v 1.0\n\nTHE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC\nLICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM\nCONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\n\n   1. DEFINITIONS\n\n   \"Contribution\" means:\n\na) in the case of the initial Contributor, the initial code and documentation\ndistributed under this Agreement, and\n\n      b) in the case of each subsequent Contributor:\n\n         i) changes to the Program, and\n\n         ii) additions to the Program;\n\nwhere such changes and/or additions to the Program originate from and are\ndistributed by that particular Contributor. A Contribution 'originates' from\na Contributor if it was added to the Program by such Contributor itself or\nanyone acting on such Contributor's behalf. Contributions do not include additions\nto the Program which: (i) are separate modules of software distributed in\nconjunction with the Program under their own license agreement, and (ii) are\nnot derivative works of the Program.\n\n   \"Contributor\" means any person or entity that distributes the Program.\n\n\"Licensed Patents\" mean patent claims licensable by a Contributor which are\nnecessarily infringed by the use or sale of its Contribution alone or when\ncombined with the Program.\n\n\"Program\" means the Contributions distributed in accordance with this Agreement.\n\n\"Recipient\" means anyone who receives the Program under this Agreement, including\nall Contributors.\n\n   2. GRANT OF RIGHTS\n\na) Subject to the terms of this Agreement, each Contributor hereby grants\nRecipient a non-exclusive, worldwide, royalty-free copyright license to reproduce,\nprepare derivative works of, publicly display, publicly perform, distribute\nand sublicense the Contribution of such Contributor, if any, and such derivative\nworks, in source code and object code form.\n\nb) Subject to the terms of this Agreement, each Contributor hereby grants\nRecipient a non-exclusive, worldwide, royalty-free patent license under Licensed\nPatents to make, use, sell, offer to sell, import and otherwise transfer the\nContribution of such Contributor, if any, in source code and object code form.\nThis patent license shall apply to the combination of the Contribution and\nthe Program if, at the time the Contribution is added by the Contributor,\nsuch addition of the Contribution causes such combination to be covered by\nthe Licensed Patents. The patent license shall not apply to any other combinations\nwhich include the Contribution. No hardware per se is licensed hereunder.\n\nc) Recipient understands that although each Contributor grants the licenses\nto its Contributions set forth herein, no assurances are provided by any Contributor\nthat the Program does not infringe the patent or other intellectual property\nrights of any other entity. Each Contributor disclaims any liability to Recipient\nfor claims brought by any other entity based on infringement of intellectual\nproperty rights or otherwise. As a condition to exercising the rights and\nlicenses granted hereunder, each Recipient hereby assumes sole responsibility\nto secure any other intellectual property rights needed, if any. For example,\nif a third party patent license is required to allow Recipient to distribute\nthe Program, it is Recipient's responsibility to acquire that license before\ndistributing the Program.\n\nd) Each Contributor represents that to its knowledge it has sufficient copyright\nrights in its Contribution, if any, to grant the copyright license set forth\nin this Agreement.\n\n   3. REQUIREMENTS\n\nA Contributor may choose to distribute the Program in object code form under\nits own license agreement, provided that:\n\n      a) it complies with the terms and conditions of this Agreement; and\n\n      b) its license agreement:\n\ni) effectively disclaims on behalf of all Contributors all warranties and\nconditions, express and implied, including warranties or conditions of title\nand non-infringement, and implied warranties or conditions of merchantability\nand fitness for a particular purpose;\n\nii) effectively excludes on behalf of all Contributors all liability for damages,\nincluding direct, indirect, special, incidental and consequential damages,\nsuch as lost profits;\n\niii) states that any provisions which differ from this Agreement are offered\nby that Contributor alone and not by any other party; and\n\niv) states that source code for the Program is available from such Contributor,\nand informs licensees how to obtain it in a reasonable manner on or through\na medium customarily used for software exchange.\n\n   When the Program is made available in source code form:\n\n      a) it must be made available under this Agreement; and\n\nb) a copy of this Agreement must be included with each copy of the Program.\n\nContributors may not remove or alter any copyright notices contained within\nthe Program.\n\nEach Contributor must identify itself as the originator of its Contribution,\nif any, in a manner that reasonably allows subsequent Recipients to identify\nthe originator of the Contribution.\n\n   4. COMMERCIAL DISTRIBUTION\n\nCommercial distributors of software may accept certain responsibilities with\nrespect to end users, business partners and the like. While this license is\nintended to facilitate the commercial use of the Program, the Contributor\nwho includes the Program in a commercial product offering should do so in\na manner which does not create potential liability for other Contributors.\nTherefore, if a Contributor includes the Program in a commercial product offering,\nsuch Contributor (\"Commercial Contributor\") hereby agrees to defend and indemnify\nevery other Contributor (\"Indemnified Contributor\") against any losses, damages\nand costs (collectively \"Losses\") arising from claims, lawsuits and other\nlegal actions brought by a third party against the Indemnified Contributor\nto the extent caused by the acts or omissions of such Commercial Contributor\nin connection with its distribution of the Program in a commercial product\noffering. The obligations in this section do not apply to any claims or Losses\nrelating to any actual or alleged intellectual property infringement. In order\nto qualify, an Indemnified Contributor must: a) promptly notify the Commercial\nContributor in writing of such claim, and b) allow the Commercial Contributor\nto control, and cooperate with the Commercial Contributor in, the defense\nand any related settlement negotiations. The Indemnified Contributor may participate\nin any such claim at its own expense.\n\nFor example, a Contributor might include the Program in a commercial product\noffering, Product X. That Contributor is then a Commercial Contributor. If\nthat Commercial Contributor then makes performance claims, or offers warranties\nrelated to Product X, those performance claims and warranties are such Commercial\nContributor's responsibility alone. Under this section, the Commercial Contributor\nwould have to defend claims against the other Contributors related to those\nperformance claims and warranties, and if a court requires any other Contributor\nto pay any damages as a result, the Commercial Contributor must pay those\ndamages.\n\n   5. NO WARRANTY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON\nAN \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS\nOR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF\nTITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\nEach Recipient is solely responsible for determining the appropriateness of\nusing and distributing the Program and assumes all risks associated with its\nexercise of rights under this Agreement, including but not limited to the\nrisks and costs of program errors, compliance with applicable laws, damage\nto or loss of data, programs or equipment, and unavailability or interruption\nof operations.\n\n   6. DISCLAIMER OF LIABILITY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY\nCONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION\nLOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY\nWAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS\nGRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\n   7. GENERAL\n\nIf any provision of this Agreement is invalid or unenforceable under applicable\nlaw, it shall not affect the validity or enforceability of the remainder of\nthe terms of this Agreement, and without further action by the parties hereto,\nsuch provision shall be reformed to the minimum extent necessary to make such\nprovision valid and enforceable.\n\nIf Recipient institutes patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Program itself\n(excluding combinations of the Program with other software or hardware) infringes\nsuch Recipient's patent(s), then such Recipient's rights granted under Section\n2(b) shall terminate as of the date such litigation is filed.\n\nAll Recipient's rights under this Agreement shall terminate if it fails to\ncomply with any of the material terms or conditions of this Agreement and\ndoes not cure such failure in a reasonable period of time after becoming aware\nof such noncompliance. If all Recipient's rights under this Agreement terminate,\nRecipient agrees to cease use and distribution of the Program as soon as reasonably\npracticable. However, Recipient's obligations under this Agreement and any\nlicenses granted by Recipient relating to the Program shall continue and survive.\n\nEveryone is permitted to copy and distribute copies of this Agreement, but\nin order to avoid inconsistency the Agreement is copyrighted and may only\nbe modified in the following manner. The Agreement Steward reserves the right\nto publish new versions (including revisions) of this Agreement from time\nto time. No one other than the Agreement Steward has the right to modify this\nAgreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse\nFoundation may assign the responsibility to serve as the Agreement Steward\nto a suitable separate entity. Each new version of the Agreement will be given\na distinguishing version number. The Program (including Contributions) may\nalways be distributed subject to the version of the Agreement under which\nit was received. In addition, after a new version of the Agreement is published,\nContributor may elect to distribute the Program (including its Contributions)\nunder the new version. Except as expressly stated in Sections 2(a) and 2(b)\nabove, Recipient receives no rights or licenses to the intellectual property\nof any Contributor under this Agreement, whether expressly, by implication,\nestoppel or otherwise. All rights in the Program not expressly granted under\nthis Agreement are reserved.\n\nThis Agreement is governed by the laws of the State of New York and the intellectual\nproperty laws of the United States of America. No party to this Agreement\nwill bring a legal action under this Agreement more than one year after the\ncause of action arose. Each party waives its rights to a jury trial in any\nresulting litigation.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/EPL-2.0.txt",
    "content": "Eclipse Public License - v 2.0\n\n    THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE\n    PUBLIC LICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION\n    OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\n\n1. DEFINITIONS\n\n\"Contribution\" means:\n\n  a) in the case of the initial Contributor, the initial content\n     Distributed under this Agreement, and\n\n  b) in the case of each subsequent Contributor:\n     i) changes to the Program, and\n     ii) additions to the Program;\n  where such changes and/or additions to the Program originate from\n  and are Distributed by that particular Contributor. A Contribution\n  \"originates\" from a Contributor if it was added to the Program by\n  such Contributor itself or anyone acting on such Contributor's behalf.\n  Contributions do not include changes or additions to the Program that\n  are not Modified Works.\n\n\"Contributor\" means any person or entity that Distributes the Program.\n\n\"Licensed Patents\" mean patent claims licensable by a Contributor which\nare necessarily infringed by the use or sale of its Contribution alone\nor when combined with the Program.\n\n\"Program\" means the Contributions Distributed in accordance with this\nAgreement.\n\n\"Recipient\" means anyone who receives the Program under this Agreement\nor any Secondary License (as applicable), including Contributors.\n\n\"Derivative Works\" shall mean any work, whether in Source Code or other\nform, that is based on (or derived from) the Program and for which the\neditorial revisions, annotations, elaborations, or other modifications\nrepresent, as a whole, an original work of authorship.\n\n\"Modified Works\" shall mean any work in Source Code or other form that\nresults from an addition to, deletion from, or modification of the\ncontents of the Program, including, for purposes of clarity any new file\nin Source Code form that contains any contents of the Program. Modified\nWorks shall not include works that contain only declarations,\ninterfaces, types, classes, structures, or files of the Program solely\nin each case in order to link to, bind by name, or subclass the Program\nor Modified Works thereof.\n\n\"Distribute\" means the acts of a) distributing or b) making available\nin any manner that enables the transfer of a copy.\n\n\"Source Code\" means the form of a Program preferred for making\nmodifications, including but not limited to software source code,\ndocumentation source, and configuration files.\n\n\"Secondary License\" means either the GNU General Public License,\nVersion 2.0, or any later versions of that license, including any\nexceptions or additional permissions as identified by the initial\nContributor.\n\n2. GRANT OF RIGHTS\n\n  a) Subject to the terms of this Agreement, each Contributor hereby\n  grants Recipient a non-exclusive, worldwide, royalty-free copyright\n  license to reproduce, prepare Derivative Works of, publicly display,\n  publicly perform, Distribute and sublicense the Contribution of such\n  Contributor, if any, and such Derivative Works.\n\n  b) Subject to the terms of this Agreement, each Contributor hereby\n  grants Recipient a non-exclusive, worldwide, royalty-free patent\n  license under Licensed Patents to make, use, sell, offer to sell,\n  import and otherwise transfer the Contribution of such Contributor,\n  if any, in Source Code or other form. This patent license shall\n  apply to the combination of the Contribution and the Program if, at\n  the time the Contribution is added by the Contributor, such addition\n  of the Contribution causes such combination to be covered by the\n  Licensed Patents. The patent license shall not apply to any other\n  combinations which include the Contribution. No hardware per se is\n  licensed hereunder.\n\n  c) Recipient understands that although each Contributor grants the\n  licenses to its Contributions set forth herein, no assurances are\n  provided by any Contributor that the Program does not infringe the\n  patent or other intellectual property rights of any other entity.\n  Each Contributor disclaims any liability to Recipient for claims\n  brought by any other entity based on infringement of intellectual\n  property rights or otherwise. As a condition to exercising the\n  rights and licenses granted hereunder, each Recipient hereby\n  assumes sole responsibility to secure any other intellectual\n  property rights needed, if any. For example, if a third party\n  patent license is required to allow Recipient to Distribute the\n  Program, it is Recipient's responsibility to acquire that license\n  before distributing the Program.\n\n  d) Each Contributor represents that to its knowledge it has\n  sufficient copyright rights in its Contribution, if any, to grant\n  the copyright license set forth in this Agreement.\n\n  e) Notwithstanding the terms of any Secondary License, no\n  Contributor makes additional grants to any Recipient (other than\n  those set forth in this Agreement) as a result of such Recipient's\n  receipt of the Program under the terms of a Secondary License\n  (if permitted under the terms of Section 3).\n\n3. REQUIREMENTS\n\n3.1 If a Contributor Distributes the Program in any form, then:\n\n  a) the Program must also be made available as Source Code, in\n  accordance with section 3.2, and the Contributor must accompany\n  the Program with a statement that the Source Code for the Program\n  is available under this Agreement, and informs Recipients how to\n  obtain it in a reasonable manner on or through a medium customarily\n  used for software exchange; and\n\n  b) the Contributor may Distribute the Program under a license\n  different than this Agreement, provided that such license:\n     i) effectively disclaims on behalf of all other Contributors all\n     warranties and conditions, express and implied, including\n     warranties or conditions of title and non-infringement, and\n     implied warranties or conditions of merchantability and fitness\n     for a particular purpose;\n\n     ii) effectively excludes on behalf of all other Contributors all\n     liability for damages, including direct, indirect, special,\n     incidental and consequential damages, such as lost profits;\n\n     iii) does not attempt to limit or alter the recipients' rights\n     in the Source Code under section 3.2; and\n\n     iv) requires any subsequent distribution of the Program by any\n     party to be under a license that satisfies the requirements\n     of this section 3.\n\n3.2 When the Program is Distributed as Source Code:\n\n  a) it must be made available under this Agreement, or if the\n  Program (i) is combined with other material in a separate file or\n  files made available under a Secondary License, and (ii) the initial\n  Contributor attached to the Source Code the notice described in\n  Exhibit A of this Agreement, then the Program may be made available\n  under the terms of such Secondary Licenses, and\n\n  b) a copy of this Agreement must be included with each copy of\n  the Program.\n\n3.3 Contributors may not remove or alter any copyright, patent,\ntrademark, attribution notices, disclaimers of warranty, or limitations\nof liability (\"notices\") contained within the Program from any copy of\nthe Program which they Distribute, provided that Contributors may add\ntheir own appropriate notices.\n\n4. COMMERCIAL DISTRIBUTION\n\nCommercial distributors of software may accept certain responsibilities\nwith respect to end users, business partners and the like. While this\nlicense is intended to facilitate the commercial use of the Program,\nthe Contributor who includes the Program in a commercial product\noffering should do so in a manner which does not create potential\nliability for other Contributors. Therefore, if a Contributor includes\nthe Program in a commercial product offering, such Contributor\n(\"Commercial Contributor\") hereby agrees to defend and indemnify every\nother Contributor (\"Indemnified Contributor\") against any losses,\ndamages and costs (collectively \"Losses\") arising from claims, lawsuits\nand other legal actions brought by a third party against the Indemnified\nContributor to the extent caused by the acts or omissions of such\nCommercial Contributor in connection with its distribution of the Program\nin a commercial product offering. The obligations in this section do not\napply to any claims or Losses relating to any actual or alleged\nintellectual property infringement. In order to qualify, an Indemnified\nContributor must: a) promptly notify the Commercial Contributor in\nwriting of such claim, and b) allow the Commercial Contributor to control,\nand cooperate with the Commercial Contributor in, the defense and any\nrelated settlement negotiations. The Indemnified Contributor may\nparticipate in any such claim at its own expense.\n\nFor example, a Contributor might include the Program in a commercial\nproduct offering, Product X. That Contributor is then a Commercial\nContributor. If that Commercial Contributor then makes performance\nclaims, or offers warranties related to Product X, those performance\nclaims and warranties are such Commercial Contributor's responsibility\nalone. Under this section, the Commercial Contributor would have to\ndefend claims against the other Contributors related to those performance\nclaims and warranties, and if a court requires any other Contributor to\npay any damages as a result, the Commercial Contributor must pay\nthose damages.\n\n5. NO WARRANTY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT\nPERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN \"AS IS\"\nBASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR\nIMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF\nTITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR\nPURPOSE. Each Recipient is solely responsible for determining the\nappropriateness of using and distributing the Program and assumes all\nrisks associated with its exercise of rights under this Agreement,\nincluding but not limited to the risks and costs of program errors,\ncompliance with applicable laws, damage to or loss of data, programs\nor equipment, and unavailability or interruption of operations.\n\n6. DISCLAIMER OF LIABILITY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT\nPERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS\nSHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST\nPROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE\nEXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n7. GENERAL\n\nIf any provision of this Agreement is invalid or unenforceable under\napplicable law, it shall not affect the validity or enforceability of\nthe remainder of the terms of this Agreement, and without further\naction by the parties hereto, such provision shall be reformed to the\nminimum extent necessary to make such provision valid and enforceable.\n\nIf Recipient institutes patent litigation against any entity\n(including a cross-claim or counterclaim in a lawsuit) alleging that the\nProgram itself (excluding combinations of the Program with other software\nor hardware) infringes such Recipient's patent(s), then such Recipient's\nrights granted under Section 2(b) shall terminate as of the date such\nlitigation is filed.\n\nAll Recipient's rights under this Agreement shall terminate if it\nfails to comply with any of the material terms or conditions of this\nAgreement and does not cure such failure in a reasonable period of\ntime after becoming aware of such noncompliance. If all Recipient's\nrights under this Agreement terminate, Recipient agrees to cease use\nand distribution of the Program as soon as reasonably practicable.\nHowever, Recipient's obligations under this Agreement and any licenses\ngranted by Recipient relating to the Program shall continue and survive.\n\nEveryone is permitted to copy and distribute copies of this Agreement,\nbut in order to avoid inconsistency the Agreement is copyrighted and\nmay only be modified in the following manner. The Agreement Steward\nreserves the right to publish new versions (including revisions) of\nthis Agreement from time to time. No one other than the Agreement\nSteward has the right to modify this Agreement. The Eclipse Foundation\nis the initial Agreement Steward. The Eclipse Foundation may assign the\nresponsibility to serve as the Agreement Steward to a suitable separate\nentity. Each new version of the Agreement will be given a distinguishing\nversion number. The Program (including Contributions) may always be\nDistributed subject to the version of the Agreement under which it was\nreceived. In addition, after a new version of the Agreement is published,\nContributor may elect to Distribute the Program (including its\nContributions) under the new version.\n\nExcept as expressly stated in Sections 2(a) and 2(b) above, Recipient\nreceives no rights or licenses to the intellectual property of any\nContributor under this Agreement, whether expressly, by implication,\nestoppel or otherwise. All rights in the Program not expressly granted\nunder this Agreement are reserved. Nothing in this Agreement is intended\nto be enforceable by any entity that is not a Contributor or Recipient.\nNo third-party beneficiary rights are created under this Agreement.\n\nExhibit A - Form of Secondary Licenses Notice\n\n\"This Source Code may also be made available under the following \nSecondary Licenses when the conditions for such availability set forth \nin the Eclipse Public License, v. 2.0 are satisfied: {name license(s),\nversion(s), and exceptions or additional permissions here}.\"\n\n  Simply including a copy of this Agreement, including this Exhibit A\n  is not sufficient to license the Source Code under Secondary Licenses.\n\n  If it is not possible or desirable to put the notice in a particular\n  file, then You may include the notice in a location (such as a LICENSE\n  file in a relevant directory) where a recipient would be likely to\n  look for such a notice.\n\n  You may add additional accurate notices of copyright ownership.\n\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/GPL-2.0.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicense is intended to guarantee your freedom to share and change free\nsoftware--to make sure the software is free for all its users.  This\nGeneral Public License applies to most of the Free Software\nFoundation's software and to any other program whose authors commit to\nusing it.  (Some other Free Software Foundation software is covered by\nthe GNU Lesser General Public License instead.)  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if you\ndistribute copies of the software, or if you modify it.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must give the recipients all the rights that\nyou have.  You must make sure that they, too, receive or can get the\nsource code.  And you must show them these terms so they know their\nrights.\n\n  We protect your rights with two steps: (1) copyright the software, and\n(2) offer you this license which gives you legal permission to copy,\ndistribute and/or modify the software.\n\n  Also, for each author's protection and ours, we want to make certain\nthat everyone understands that there is no warranty for this free\nsoftware.  If the software is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original, so\nthat any problems introduced by others will not reflect on the original\nauthors' reputations.\n\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that redistributors of a free\nprogram will individually obtain patent licenses, in effect making the\nprogram proprietary.  To prevent this, we have made it clear that any\npatent must be licensed for everyone's free use or not licensed at all.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                    GNU GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License applies to any program or other work which contains\na notice placed by the copyright holder saying it may be distributed\nunder the terms of this General Public License.  The \"Program\", below,\nrefers to any such program or work, and a \"work based on the Program\"\nmeans either the Program or any derivative work under copyright law:\nthat is to say, a work containing the Program or a portion of it,\neither verbatim or with modifications and/or translated into another\nlanguage.  (Hereinafter, translation is included without limitation in\nthe term \"modification\".)  Each licensee is addressed as \"you\".\n\nActivities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning the Program is not restricted, and the output from the Program\nis covered only if its contents constitute a work based on the\nProgram (independent of having been made by running the Program).\nWhether that is true depends on what the Program does.\n\n  1. You may copy and distribute verbatim copies of the Program's\nsource code as you receive it, in any medium, provided that you\nconspicuously and appropriately publish on each copy an appropriate\ncopyright notice and disclaimer of warranty; keep intact all the\nnotices that refer to this License and to the absence of any warranty;\nand give any other recipients of the Program a copy of this License\nalong with the Program.\n\nYou may charge a fee for the physical act of transferring a copy, and\nyou may at your option offer warranty protection in exchange for a fee.\n\n  2. You may modify your copy or copies of the Program or any portion\nof it, thus forming a work based on the Program, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) You must cause the modified files to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    b) You must cause any work that you distribute or publish, that in\n    whole or in part contains or is derived from the Program or any\n    part thereof, to be licensed as a whole at no charge to all third\n    parties under the terms of this License.\n\n    c) If the modified program normally reads commands interactively\n    when run, you must cause it, when started running for such\n    interactive use in the most ordinary way, to print or display an\n    announcement including an appropriate copyright notice and a\n    notice that there is no warranty (or else, saying that you provide\n    a warranty) and that users may redistribute the program under\n    these conditions, and telling the user how to view a copy of this\n    License.  (Exception: if the Program itself is interactive but\n    does not normally print such an announcement, your work based on\n    the Program is not required to print an announcement.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may copy and distribute the Program (or a work based on it,\nunder Section 2) in object code or executable form under the terms of\nSections 1 and 2 above provided that you also do one of the following:\n\n    a) Accompany it with the complete corresponding machine-readable\n    source code, which must be distributed under the terms of Sections\n    1 and 2 above on a medium customarily used for software interchange; or,\n\n    b) Accompany it with a written offer, valid for at least three\n    years, to give any third party, for a charge no more than your\n    cost of physically performing source distribution, a complete\n    machine-readable copy of the corresponding source code, to be\n    distributed under the terms of Sections 1 and 2 above on a medium\n    customarily used for software interchange; or,\n\n    c) Accompany it with the information you received as to the offer\n    to distribute corresponding source code.  (This alternative is\n    allowed only for noncommercial distribution and only if you\n    received the program in object code or executable form with such\n    an offer, in accord with Subsection b above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it.  For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable.  However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  4. You may not copy, modify, sublicense, or distribute the Program\nexcept as expressly provided under this License.  Any attempt\notherwise to copy, modify, sublicense or distribute the Program is\nvoid, and will automatically terminate your rights under this License.\nHowever, parties who have received copies, or rights, from you under\nthis License will not have their licenses terminated so long as such\nparties remain in full compliance.\n\n  5. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Program or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Program (or any work based on the\nProgram), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Program or works based on it.\n\n  6. Each time you redistribute the Program (or any work based on the\nProgram), the recipient automatically receives a license from the\noriginal licensor to copy, distribute or modify the Program subject to\nthese terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\n  7. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Program at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Program by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system, which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  8. If the distribution and/or use of the Program is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Program under this License\nmay add an explicit geographical distribution limitation excluding\nthose countries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  9. The Free Software Foundation may publish revised and/or new versions\nof the General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Program\nspecifies a version number of this License which applies to it and \"any\nlater version\", you have the option of following the terms and conditions\neither of that version or of any later version published by the Free\nSoftware Foundation.  If the Program does not specify a version number of\nthis License, you may choose any version ever published by the Free Software\nFoundation.\n\n  10. If you wish to incorporate parts of the Program into other free\nprograms whose distribution conditions are different, write to the author\nto ask for permission.  For software which is copyrighted by the Free\nSoftware Foundation, write to the Free Software Foundation; we sometimes\nmake exceptions for this.  Our decision will be guided by the two goals\nof preserving the free status of all derivatives of our free software and\nof promoting the sharing and reuse of software generally.\n\n                            NO WARRANTY\n\n  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\nFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\nOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\nPROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\nOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\nTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\nPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\nREPAIR OR CORRECTION.\n\n  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\nREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\nINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\nOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\nTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\nYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\nPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software; you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation; either version 2 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License along\n    with this program; if not, write to the Free Software Foundation, Inc.,\n    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\nAlso add information on how to contact you by electronic and paper mail.\n\nIf the program is interactive, make it output a short notice like this\nwhen it starts in an interactive mode:\n\n    Gnomovision version 69, Copyright (C) year name of author\n    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, the commands you use may\nbe called something other than `show w' and `show c'; they could even be\nmouse-clicks or menu items--whatever suits your program.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the program, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n  `Gnomovision' (which makes passes at compilers) written by James Hacker.\n\n  <signature of Ty Coon>, 1 April 1989\n  Ty Coon, President of Vice\n\nThis General Public License does not permit incorporating your program into\nproprietary programs.  If your program is a subroutine library, you may\nconsider it more useful to permit linking proprietary applications with the\nlibrary.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/GPL-3.0.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/ISC.txt",
    "content": "Copyright (c) [year], [fullname]\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/ImageMagick.txt",
    "content": "Before we get to the text of the license, lets just review what the license says in simple terms:\n\nIt allows you to:\n\n  * freely download and use ImageMagick software, in whole or in part, for personal, company internal, or commercial purposes;\n  * use ImageMagick software in packages or distributions that you create;\n  * link against a library under a different license;\n  * link code under a different license against a library under this license;\n  * merge code into a work under a different license;\n  * extend patent grants to any code using code under this license;\n  * and extend patent protection.\n\nIt forbids you to:\n\n  * redistribute any piece of ImageMagick-originated software without proper attribution;\n  * use any marks owned by ImageMagick Studio LLC in any way that might state or imply that ImageMagick Studio LLC endorses your distribution;\n  * use any marks owned by ImageMagick Studio LLC in any way that might state or imply that you created the ImageMagick software in question.\n\nIt requires you to:\n\n  * include a copy of the license in any redistribution you may make that includes ImageMagick software;\n  * provide clear attribution to ImageMagick Studio LLC for any distributions that include ImageMagick software.\n\nIt does not require you to:\n\n  * include the source of the ImageMagick software itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it;\n  * submit changes that you make to the software back to the ImageMagick Studio LLC (though such feedback is encouraged).\n\nA few other clarifications include:\n\n  * ImageMagick is freely available without charge;\n  * you may include ImageMagick on a DVD as long as you comply with the terms of the license;\n  * you can give modified code away for free or sell it under the terms of the ImageMagick license or distribute the result under a different license, but you need to acknowledge the use of the ImageMagick software;\n  * the license is compatible with the GPL V3.\n  * when exporting the ImageMagick software, review its export classification.\n\nTerms and Conditions for Use, Reproduction, and Distribution\n\nThe legally binding and authoritative terms and conditions for use, reproduction, and distribution of ImageMagick follow:\n\nCopyright 1999-2019 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available.\n\n1. Definitions.\n\nLicense shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\nLicensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\nLegal Entity shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, control means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\nYou (or Your) shall mean an individual or Legal Entity exercising permissions granted by this License.\n\nSource form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\nObject form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\nWork shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\nDerivative Works shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\nContribution shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution.\n\nContributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n  * You must give any other recipients of the Work or Derivative Works a copy of this License; and\n  * You must cause any modified files to carry prominent notices stating that You changed the files; and\n  * You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n  * If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\nYou may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.\n\nHow to Apply the License to your Work\n\nTo apply the ImageMagick License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information (don't include the brackets). The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the ImageMagick License (the \"License\"); you may not use\n   this file except in compliance with the License.  You may obtain a copy\n   of the License at\n\n     https://imagemagick.org/script/license.php\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the\n   License for the specific language governing permissions and limitations\n   under the License.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/LGPL-2.0.txt",
    "content": "                  GNU LIBRARY GENERAL PUBLIC LICENSE\n                       Version 2, June 1991\n\n Copyright (C) 1991 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the library GPL.  It is\n numbered 2 because it goes with version 2 of the ordinary GPL.]\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Library General Public License, applies to some\nspecially designated Free Software Foundation software, and to any\nother libraries whose authors decide to use it.  You can use it for\nyour libraries, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthis service if you wish), that you receive source code or can get it\nif you want it, that you can change the software or use pieces of it\nin new free programs; and that you know you can do these things.\n\n  To protect your rights, we need to make restrictions that forbid\nanyone to deny you these rights or to ask you to surrender the rights.\nThese restrictions translate to certain responsibilities for you if\nyou distribute copies of the library, or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link a program with the library, you must provide\ncomplete object files to the recipients so that they can relink them\nwith the library, after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  Our method of protecting your rights has two steps: (1) copyright\nthe library, and (2) offer you this license which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  Also, for each distributor's protection, we want to make certain\nthat everyone understands that there is no warranty for this free\nlibrary.  If the library is modified by someone else and passed on, we\nwant its recipients to know that what they have is not the original\nversion, so that any problems introduced by others will not reflect on\nthe original authors' reputations.\n\f\n  Finally, any free program is threatened constantly by software\npatents.  We wish to avoid the danger that companies distributing free\nsoftware will individually obtain patent licenses, thus in effect\ntransforming the program into proprietary software.  To prevent this,\nwe have made it clear that any patent must be licensed for everyone's\nfree use or not licensed at all.\n\n  Most GNU software, including some libraries, is covered by the ordinary\nGNU General Public License, which was designed for utility programs.  This\nlicense, the GNU Library General Public License, applies to certain\ndesignated libraries.  This license is quite different from the ordinary\none; be sure to read it in full, and don't assume that anything in it is\nthe same as in the ordinary license.\n\n  The reason we have a separate public license for some libraries is that\nthey blur the distinction we usually make between modifying or adding to a\nprogram and simply using it.  Linking a program with a library, without\nchanging the library, is in some sense simply using the library, and is\nanalogous to running a utility program or application program.  However, in\na textual and legal sense, the linked executable is a combined work, a\nderivative of the original library, and the ordinary General Public License\ntreats it as such.\n\n  Because of this blurred distinction, using the ordinary General\nPublic License for libraries did not effectively promote software\nsharing, because most developers did not use the libraries.  We\nconcluded that weaker conditions might promote sharing better.\n\n  However, unrestricted linking of non-free programs would deprive the\nusers of those programs of all benefit from the free status of the\nlibraries themselves.  This Library General Public License is intended to\npermit developers of non-free programs to use free libraries, while\npreserving your freedom as a user of such programs to change the free\nlibraries that are incorporated in them.  (We have not seen how to achieve\nthis as regards changes in header files, but we have achieved it as regards\nchanges in the actual functions of the Library.)  The hope is that this\nwill lead to faster development of free libraries.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, while the latter only\nworks together with the library.\n\n  Note that it is possible for a library to be covered by the ordinary\nGeneral Public License rather than by this special one.\n\f\n                  GNU LIBRARY GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library which\ncontains a notice placed by the copyright holder or other authorized\nparty saying it may be distributed under the terms of this Library\nGeneral Public License (also called \"this License\").  Each licensee is\naddressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n  \n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\f\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\f\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\f\n  6. As an exception to the Sections above, you may also compile or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    c) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    d) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe source code distributed need not include anything that is normally\ndistributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\f\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties to\nthis License.\n\f\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Library General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\f\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                            NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\f\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Library General Public\n    License as published by the Free Software Foundation; either\n    version 2 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Library General Public License for more details.\n\n    You should have received a copy of the GNU Library General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/LGPL-2.1.txt",
    "content": "                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations below.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n\f\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it becomes\na de-facto standard.  To achieve this, non-free programs must be\nallowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n\f\n                  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control compilation\nand installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n\n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\f\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n\f\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n\f\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at\n    least three years, to give the same user the materials\n    specified in Subsection 6a, above, for a charge no more\n    than the cost of performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n\f\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n\f\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under any\nparticular circumstance, the balance of the section is intended to apply,\nand the section as a whole is intended to apply in other circumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License may add\nan explicit geographical distribution limitation excluding those countries,\nso that distribution is permitted only in or among countries not thus\nexcluded.  In such case, this License incorporates the limitation as if\nwritten in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n\f\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                            NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n\f\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms of the\nordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.  It is\nsafest to attach them to the start of each source file to most effectively\nconvey the exclusion of warranty; and each file should have at least the\n\"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or your\nschool, if any, to sign a \"copyright disclaimer\" for the library, if\nnecessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/LGPL-3.0.txt",
    "content": "                   GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n  This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n  0. Additional Definitions.\n\n  As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n  \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n  An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n  A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library.  The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n  The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n  The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n  1. Exception to Section 3 of the GNU GPL.\n\n  You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n  2. Conveying Modified Versions.\n\n  If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n   a) under this License, provided that you make a good faith effort to\n   ensure that, in the event an Application does not supply the\n   function or data, the facility still operates, and performs\n   whatever part of its purpose remains meaningful, or\n\n   b) under the GNU GPL, with none of the additional permissions of\n   this License applicable to that copy.\n\n  3. Object Code Incorporating Material from Library Header Files.\n\n  The object code form of an Application may incorporate material from\na header file that is part of the Library.  You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n   a) Give prominent notice with each copy of the object code that the\n   Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the object code with a copy of the GNU GPL and this license\n   document.\n\n  4. Combined Works.\n\n  You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n   a) Give prominent notice with each copy of the Combined Work that\n   the Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the Combined Work with a copy of the GNU GPL and this license\n   document.\n\n   c) For a Combined Work that displays copyright notices during\n   execution, include the copyright notice for the Library among\n   these notices, as well as a reference directing the user to the\n   copies of the GNU GPL and this license document.\n\n   d) Do one of the following:\n\n       0) Convey the Minimal Corresponding Source under the terms of this\n       License, and the Corresponding Application Code in a form\n       suitable for, and under terms that permit, the user to\n       recombine or relink the Application with a modified version of\n       the Linked Version to produce a modified Combined Work, in the\n       manner specified by section 6 of the GNU GPL for conveying\n       Corresponding Source.\n\n       1) Use a suitable shared library mechanism for linking with the\n       Library.  A suitable mechanism is one that (a) uses at run time\n       a copy of the Library already present on the user's computer\n       system, and (b) will operate properly with a modified version\n       of the Library that is interface-compatible with the Linked\n       Version.\n\n   e) Provide Installation Information, but only if you would otherwise\n   be required to provide such information under section 6 of the\n   GNU GPL, and only to the extent that such information is\n   necessary to install and execute a modified version of the\n   Combined Work produced by recombining or relinking the\n   Application with a modified version of the Linked Version. (If\n   you use option 4d0, the Installation Information must accompany\n   the Minimal Corresponding Source and Corresponding Application\n   Code. If you use option 4d1, you must provide the Installation\n   Information in the manner specified by section 6 of the GNU GPL\n   for conveying Corresponding Source.)\n\n  5. Combined Libraries.\n\n  You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n   a) Accompany the combined library with a copy of the same work based\n   on the Library, uncombined with any other library facilities,\n   conveyed under the terms of this License.\n\n   b) Give prominent notice with the combined library that part of it\n   is a work based on the Library, and explaining where to find the\n   accompanying uncombined form of the same work.\n\n  6. Revised Versions of the GNU Lesser General Public License.\n\n  The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n  Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n  If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/Libpng.txt",
    "content": "COPYRIGHT NOTICE, DISCLAIMER, and LICENSE\n=========================================\n\nPNG Reference Library License version 2\n---------------------------------------\n\n * Copyright (c) 1995-2019 The PNG Reference Library Authors.\n * Copyright (c) 2018-2019 Cosmin Truta.\n * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.\n * Copyright (c) 1996-1997 Andreas Dilger.\n * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n\nThe software is supplied \"as is\", without warranty of any kind,\nexpress or implied, including, without limitation, the warranties\nof merchantability, fitness for a particular purpose, title, and\nnon-infringement.  In no event shall the Copyright owners, or\nanyone distributing the software, be liable for any damages or\nother liability, whether in contract, tort or otherwise, arising\nfrom, out of, or in connection with the software, or the use or\nother dealings in the software, even if advised of the possibility\nof such damage.\n\nPermission is hereby granted to use, copy, modify, and distribute\nthis software, or portions hereof, for any purpose, without fee,\nsubject to the following restrictions:\n\n 1. The origin of this software must not be misrepresented; you\n    must not claim that you wrote the original software.  If you\n    use this software in a product, an acknowledgment in the product\n    documentation would be appreciated, but is not required.\n\n 2. Altered source versions must be plainly marked as such, and must\n    not be misrepresented as being the original software.\n\n 3. This Copyright notice may not be removed or altered from any\n    source or altered source distribution.\n\n\nPNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)\n-----------------------------------------------------------------------\n\nlibpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are\nCopyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are\nderived from libpng-1.0.6, and are distributed according to the same\ndisclaimer and license as libpng-1.0.6 with the following individuals\nadded to the list of Contributing Authors:\n\n    Simon-Pierre Cadieux\n    Eric S. Raymond\n    Mans Rullgard\n    Cosmin Truta\n    Gilles Vollant\n    James Yu\n    Mandar Sahastrabuddhe\n    Google Inc.\n    Vadim Barkov\n\nand with the following additions to the disclaimer:\n\n    There is no warranty against interference with your enjoyment of\n    the library or against infringement.  There is no warranty that our\n    efforts or the library will fulfill any of your particular purposes\n    or needs.  This library is provided with all faults, and the entire\n    risk of satisfactory quality, performance, accuracy, and effort is\n    with the user.\n\nSome files in the \"contrib\" directory and some configure-generated\nfiles that are distributed with libpng have other copyright owners, and\nare released under other open source licenses.\n\nlibpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are\nCopyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from\nlibpng-0.96, and are distributed according to the same disclaimer and\nlicense as libpng-0.96, with the following individuals added to the\nlist of Contributing Authors:\n\n    Tom Lane\n    Glenn Randers-Pehrson\n    Willem van Schaik\n\nlibpng versions 0.89, June 1996, through 0.96, May 1997, are\nCopyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,\nand are distributed according to the same disclaimer and license as\nlibpng-0.88, with the following individuals added to the list of\nContributing Authors:\n\n    John Bowler\n    Kevin Bracey\n    Sam Bushell\n    Magnus Holmgren\n    Greg Roelofs\n    Tom Tanner\n\nSome files in the \"scripts\" directory have other copyright owners,\nbut are released under this license.\n\nlibpng versions 0.5, May 1995, through 0.88, January 1996, are\nCopyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n\nFor the purposes of this copyright and license, \"Contributing Authors\"\nis defined as the following set of individuals:\n\n    Andreas Dilger\n    Dave Martindale\n    Guy Eric Schalnat\n    Paul Schmidt\n    Tim Wegner\n\nThe PNG Reference Library is supplied \"AS IS\".  The Contributing\nAuthors and Group 42, Inc. disclaim all warranties, expressed or\nimplied, including, without limitation, the warranties of\nmerchantability and of fitness for any purpose.  The Contributing\nAuthors and Group 42, Inc. assume no liability for direct, indirect,\nincidental, special, exemplary, or consequential damages, which may\nresult from the use of the PNG Reference Library, even if advised of\nthe possibility of such damage.\n\nPermission is hereby granted to use, copy, modify, and distribute this\nsource code, or portions hereof, for any purpose, without fee, subject\nto the following restrictions:\n\n 1. The origin of this source code must not be misrepresented.\n\n 2. Altered versions must be plainly marked as such and must not\n    be misrepresented as being the original source.\n\n 3. This Copyright notice may not be removed or altered from any\n    source or altered source distribution.\n\nThe Contributing Authors and Group 42, Inc. specifically permit,\nwithout fee, and encourage the use of this source code as a component\nto supporting the PNG file format in commercial products.  If you use\nthis source code in a product, acknowledgment is not required but would\nbe appreciated.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/MIT.txt",
    "content": "Copyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/MPL-2.0.txt",
    "content": "Mozilla Public License Version 2.0 \n\n1. Definitions\n\n     1.1. \"Contributor\" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.\n\n     1.2. \"Contributor Version\" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution.\n\n     1.3. \"Contribution\" means Covered Software of a particular Contributor.\n\n     1.4. \"Covered Software\" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.\n\n     1.5. \"Incompatible With Secondary Licenses\" means\n\n          (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or\n\n          (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.\n\n     1.6. \"Executable Form\" means any form of the work other than Source Code Form.\n\n     1.7. \"Larger Work\" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.\n\n     1.8. \"License\" means this document.\n\n     1.9. \"Licensable\" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.\n\n     1.10. \"Modifications\" means any of the following:\n\n          (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or\n\n          (b) any new file in Source Code Form that contains any Covered Software.\n\n     1.11. \"Patent Claims\" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.\n\n     1.12. \"Secondary License\" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.\n\n     1.13. \"Source Code Form\" means the form of the work preferred for making modifications.\n\n     1.14. \"You\" (or \"Your\") means an individual or a legal entity exercising rights under this License. For legal entities, \"You\" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, \"control\" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.\n\n2. License Grants and Conditions \n\n     2.1. Grants\n     Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:\n\n          (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and\n\n          (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.\n\n     2.2. Effective Date\n     The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.\n\n     2.3. Limitations on Grant Scope\n     The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:\n\n          (a) for any code that a Contributor has removed from Covered Software; or\n\n          (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or\n\n          (c) under Patent Claims infringed by Covered Software in the absence of its Contributions.\n\n     This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).\n\n     2.4. Subsequent Licenses\n     No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).\n\n     2.5. Representation\n     Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.\n\n     2.6. Fair Use\n     This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.\n\n     2.7. Conditions\n     Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.\n\n3. Responsibilities\n\n     3.1. Distribution of Source Form\n     All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form.\n\n     3.2. Distribution of Executable Form\n     If You distribute Covered Software in Executable Form then:\n\n          (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and\n\n          (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License.\n\n     3.3. Distribution of a Larger Work\n     You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).\n\n     3.4. Notices\n     You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.\n \n     3.5. Application of Additional Terms\n     You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.\n\n4. Inability to Comply Due to Statute or Regulation \nIf it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.\n\n5. Termination \n\n     5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.\n\n     5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.\n\n     5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.\n\n6. Disclaimer of Warranty \nCovered Software is provided under this License on an \"as is\" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. \n\n7. Limitation of Liability \nUnder no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. \n\n8. Litigation \nAny litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims.\n\n9. Miscellaneous \nThis License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.\n\n10. Versions of the License \n\n     10.1. New Versions\n     Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.\n\n     10.2. Effect of New Versions\n     You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.\n\n     10.3. Modified Versions\n     If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).\n\n     10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses\n     If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.\n\nExhibit A - Source Code Form License Notice \n\n     This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\nIf it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.\n\nYou may add additional accurate notices of copyright ownership.\n\nExhibit B - \"Incompatible With Secondary Licenses\" Notice \n\n     This Source Code Form is \"Incompatible With Secondary Licenses\", as defined by the Mozilla Public License, v. 2.0.\n\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/NCSA.txt",
    "content": "University of Illinois/NCSA Open Source License \n\nCopyright (c) [year] [fullname]. All rights reserved. \n\nDeveloped by: [project] \n              [fullname] \n              [projecturl]\n                  \nPermission is hereby granted, free of charge, to any person \nobtaining a copy of this software and associated documentation files \n(the \"Software\"), to deal with the Software without restriction, \nincluding without limitation the rights to use, copy, modify, merge,\npublish, distribute, sublicense, and/or sell copies of the Software, \nand to permit persons to whom the Software is furnished to do so, \nsubject to the following conditions:\n\n* Redistributions of source code must retain the above copyright notice, \n  this list of conditions and the following disclaimers.\n\n* Redistributions in binary form must reproduce the above copyright \n  notice, this list of conditions and the following disclaimers in the \n  documentation and/or other materials provided with the distribution.\n\n* Neither the names of [fullname], [project] nor the names of its \n  contributors may be used to endorse or promote products derived from\n  this Software without specific prior written permission.\n  \nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS \nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nCONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH\nTHE SOFTWARE.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/Nethack.txt",
    "content": "                    NETHACK GENERAL PUBLIC LICENSE\n                    (Copyright 1989 M. Stephenson)\n\n               (Based on the BISON general public license,\n                   copyright 1988 Richard M. Stallman)\n\n Everyone is permitted to copy and distribute verbatim copies of this\n license, but changing it is not allowed.  You can also use this wording to\n make the terms for other programs.\n\n  The license agreements of most software companies keep you at the mercy of\nthose companies.  By contrast, our general public license is intended to give\neveryone the right to share NetHack.  To make sure that you get the rights we\nwant you to have, we need to make restrictions that forbid anyone to deny you\nthese rights or to ask you to surrender the rights.  Hence this license\nagreement.\n\n  Specifically, we want to make sure that you have the right to give away\ncopies of NetHack, that you receive source code or else can get it if you\nwant it, that you can change NetHack or use pieces of it in new free\nprograms, and that you know you can do these things.\n\n  To make sure that everyone has such rights, we have to forbid you to\ndeprive anyone else of these rights.  For example, if you distribute copies\nof NetHack, you must give the recipients all the rights that you have.  You\nmust make sure that they, too, receive or can get the source code.  And you\nmust tell them their rights.\n\n  Also, for our own protection, we must make certain that everyone finds out\nthat there is no warranty for NetHack.  If NetHack is modified by someone\nelse and passed on, we want its recipients to know that what they have is\nnot what we distributed.\n\n  Therefore we (Mike Stephenson and other holders of NetHack copyrights) make\nthe following terms which say what you must do to be allowed to distribute or\nchange NetHack.\n\n\n                        COPYING POLICIES\n\n  1. You may copy and distribute verbatim copies of NetHack source code as\nyou receive it, in any medium, provided that you keep intact the notices on\nall files that refer to copyrights, to this License Agreement, and to the\nabsence of any warranty; and give any other recipients of the NetHack\nprogram a copy of this License Agreement along with the program.\n\n  2. You may modify your copy or copies of NetHack or any portion of it, and\ncopy and distribute such modifications under the terms of Paragraph 1 above\n(including distributing this License Agreement), provided that you also do the\nfollowing:\n\n    a) cause the modified files to carry prominent notices stating that you\n    changed the files and the date of any change; and\n\n    b) cause the whole of any work that you distribute or publish, that in\n    whole or in part contains or is a derivative of NetHack or any part\n    thereof, to be licensed at no charge to all third parties on terms\n    identical to those contained in this License Agreement (except that you\n    may choose to grant more extensive warranty protection to some or all\n    third parties, at your option)\n\n    c) You may charge a distribution fee for the physical act of\n    transferring a copy, and you may at your option offer warranty protection\n    in exchange for a fee.\n\n  3. You may copy and distribute NetHack (or a portion or derivative of it,\nunder Paragraph 2) in object code or executable form under the terms of\nParagraphs 1 and 2 above provided that you also do one of the following:\n\n    a) accompany it with the complete machine-readable source code, which\n    must be distributed under the terms of Paragraphs 1 and 2 above; or,\n\n    b) accompany it with full information as to how to obtain the complete\n    machine-readable source code from an appropriate archive site.  (This\n    alternative is allowed only for noncommercial distribution.)\n\nFor these purposes, complete source code means either the full source\ndistribution as originally released over Usenet or updated copies of the\nfiles in this distribution used to create the object code or executable.\n\n  4. You may not copy, sublicense, distribute or transfer NetHack except as\nexpressly provided under this License Agreement.  Any attempt otherwise to\ncopy, sublicense, distribute or transfer NetHack is void and your rights to\nuse the program under this License agreement shall be automatically\nterminated.  However, parties who have received computer software programs\nfrom you with this License Agreement will not have their licenses terminated\nso long as such parties remain in full compliance.\n\n\nStated plainly:  You are permitted to modify NetHack, or otherwise use parts\nof NetHack, provided that you comply with the conditions specified above;\nin particular, your modified NetHack or program containing parts of NetHack\nmust remain freely available as provided in this License Agreement.  In\nother words, go ahead and share NetHack, but don't try to stop anyone else\nfrom sharing it farther.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/OpenLDAP.txt",
    "content": "The OpenLDAP Public License\n  Version 2.8, 17 August 2003\n\nRedistribution and use of this software and associated documentation\n(\"Software\"), with or without modification, are permitted provided\nthat the following conditions are met:\n\n1. Redistributions in source form must retain copyright statements\n   and notices,\n\n2. Redistributions in binary form must reproduce applicable copyright\n   statements and notices, this list of conditions, and the following\n   disclaimer in the documentation and/or other materials provided\n   with the distribution, and\n\n3. Redistributions must contain a verbatim copy of this document.\n\nThe OpenLDAP Foundation may revise this license from time to time.\nEach revision is distinguished by a version number.  You may use\nthis Software under terms of this license revision or under the\nterms of any subsequent revision of the license.\n\nTHIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS\nCONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,\nINCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT\nSHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)\nOR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,\nINCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\nLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\nANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.\n\nThe names of the authors and copyright holders must not be used in\nadvertising or otherwise to promote the sale, use or other dealing\nin this Software without specific, written prior permission.  Title\nto copyright in this Software shall at all times remain with copyright\nholders.\n\nOpenLDAP is a registered trademark of the OpenLDAP Foundation.\n\nCopyright 1999-2003 The OpenLDAP Foundation, Redwood City,\nCalifornia, USA.  All Rights Reserved.  Permission to copy and\ndistribute verbatim copies of this document is granted.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/PHP-3.0.txt",
    "content": "--------------------------------------------------------------------\n                  The PHP License, version 3.0\nCopyright (c) 1999 - 2006 The PHP Group. All rights reserved.\n--------------------------------------------------------------------\n\nRedistribution and use in source and binary forms, with or without\nmodification, is permitted provided that the following conditions\nare met:\n\n  1. Redistributions of source code must retain the above copyright\n     notice, this list of conditions and the following disclaimer.\n\n  2. Redistributions in binary form must reproduce the above copyright\n     notice, this list of conditions and the following disclaimer in\n     the documentation and/or other materials provided with the\n     distribution.\n\n  3. The name \"PHP\" must not be used to endorse or promote products\n     derived from this software without prior written permission. For\n     written permission, please contact group@php.net.\n\n  4. Products derived from this software may not be called \"PHP\", nor\n     may \"PHP\" appear in their name, without prior written permission\n     from group@php.net.  You may indicate that your software works in\n     conjunction with PHP by saying \"Foo for PHP\" instead of calling\n     it \"PHP Foo\" or \"phpfoo\"\n\n  5. The PHP Group may publish revised and/or new versions of the\n     license from time to time. Each version will be given a\n     distinguishing version number.\n     Once covered code has been published under a particular version\n     of the license, you may always continue to use it under the terms\n     of that version. You may also choose to use such covered code\n     under the terms of any subsequent version of the license\n     published by the PHP Group. No one other than the PHP Group has\n     the right to modify the terms applicable to covered code created\n     under this License.\n\n  6. Redistributions of any form whatsoever must retain the following\n     acknowledgment:\n     \"This product includes PHP, freely available from\n     <http://www.php.net/>\".\n\nTHIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND\nANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP\nDEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\nINDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\nHOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\nOF THE POSSIBILITY OF SUCH DAMAGE.\n\n--------------------------------------------------------------------\n\nThis software consists of voluntary contributions made by many\nindividuals on behalf of the PHP Group.\n\nThe PHP Group can be contacted via Email at group@php.net.\n\nFor more information on the PHP Group and the PHP project,\nplease see <http://www.php.net>.\n\nThis product includes the Zend Engine, freely available at\n<http://www.zend.com>.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/Public Domain.txt",
    "content": "Creative Commons Legal Code\n\nCC0 1.0 Universal\n\n    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE\n    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN\n    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS\n    INFORMATION ON AN \"AS-IS\" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES\n    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS\n    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM\n    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED\n    HEREUNDER.\n\nStatement of Purpose\n\nThe laws of most jurisdictions throughout the world automatically confer\nexclusive Copyright and Related Rights (defined below) upon the creator\nand subsequent owner(s) (each and all, an \"owner\") of an original work of\nauthorship and/or a database (each, a \"Work\").\n\nCertain owners wish to permanently relinquish those rights to a Work for\nthe purpose of contributing to a commons of creative, cultural and\nscientific works (\"Commons\") that the public can reliably and without fear\nof later claims of infringement build upon, modify, incorporate in other\nworks, reuse and redistribute as freely as possible in any form whatsoever\nand for any purposes, including without limitation commercial purposes.\nThese owners may contribute to the Commons to promote the ideal of a free\nculture and the further production of creative, cultural and scientific\nworks, or to gain reputation or greater distribution for their Work in\npart through the use and efforts of others.\n\nFor these and/or other purposes and motivations, and without any\nexpectation of additional consideration or compensation, the person\nassociating CC0 with a Work (the \"Affirmer\"), to the extent that he or she\nis an owner of Copyright and Related Rights in the Work, voluntarily\nelects to apply CC0 to the Work and publicly distribute the Work under its\nterms, with knowledge of his or her Copyright and Related Rights in the\nWork and the meaning and intended legal effect of CC0 on those rights.\n\n1. Copyright and Related Rights. A Work made available under CC0 may be\nprotected by copyright and related or neighboring rights (\"Copyright and\nRelated Rights\"). Copyright and Related Rights include, but are not\nlimited to, the following:\n\n  i. the right to reproduce, adapt, distribute, perform, display,\n     communicate, and translate a Work;\n ii. moral rights retained by the original author(s) and/or performer(s);\niii. publicity and privacy rights pertaining to a person's image or\n     likeness depicted in a Work;\n iv. rights protecting against unfair competition in regards to a Work,\n     subject to the limitations in paragraph 4(a), below;\n  v. rights protecting the extraction, dissemination, use and reuse of data\n     in a Work;\n vi. database rights (such as those arising under Directive 96/9/EC of the\n     European Parliament and of the Council of 11 March 1996 on the legal\n     protection of databases, and under any national implementation\n     thereof, including any amended or successor version of such\n     directive); and\nvii. other similar, equivalent or corresponding rights throughout the\n     world based on applicable law or treaty, and any national\n     implementations thereof.\n\n2. Waiver. To the greatest extent permitted by, but not in contravention\nof, applicable law, Affirmer hereby overtly, fully, permanently,\nirrevocably and unconditionally waives, abandons, and surrenders all of\nAffirmer's Copyright and Related Rights and associated claims and causes\nof action, whether now known or unknown (including existing as well as\nfuture claims and causes of action), in the Work (i) in all territories\nworldwide, (ii) for the maximum duration provided by applicable law or\ntreaty (including future time extensions), (iii) in any current or future\nmedium and for any number of copies, and (iv) for any purpose whatsoever,\nincluding without limitation commercial, advertising or promotional\npurposes (the \"Waiver\"). Affirmer makes the Waiver for the benefit of each\nmember of the public at large and to the detriment of Affirmer's heirs and\nsuccessors, fully intending that such Waiver shall not be subject to\nrevocation, rescission, cancellation, termination, or any other legal or\nequitable action to disrupt the quiet enjoyment of the Work by the public\nas contemplated by Affirmer's express Statement of Purpose.\n\n3. Public License Fallback. Should any part of the Waiver for any reason\nbe judged legally invalid or ineffective under applicable law, then the\nWaiver shall be preserved to the maximum extent permitted taking into\naccount Affirmer's express Statement of Purpose. In addition, to the\nextent the Waiver is so judged Affirmer hereby grants to each affected\nperson a royalty-free, non transferable, non sublicensable, non exclusive,\nirrevocable and unconditional license to exercise Affirmer's Copyright and\nRelated Rights in the Work (i) in all territories worldwide, (ii) for the\nmaximum duration provided by applicable law or treaty (including future\ntime extensions), (iii) in any current or future medium and for any number\nof copies, and (iv) for any purpose whatsoever, including without\nlimitation commercial, advertising or promotional purposes (the\n\"License\"). The License shall be deemed effective as of the date CC0 was\napplied by Affirmer to the Work. Should any part of the License for any\nreason be judged legally invalid or ineffective under applicable law, such\npartial invalidity or ineffectiveness shall not invalidate the remainder\nof the License, and in such case Affirmer hereby affirms that he or she\nwill not (i) exercise any of his or her remaining Copyright and Related\nRights in the Work or (ii) assert any associated claims and causes of\naction with respect to the Work, in either case contrary to Affirmer's\nexpress Statement of Purpose.\n\n4. Limitations and Disclaimers.\n\n a. No trademark or patent rights held by Affirmer are waived, abandoned,\n    surrendered, licensed or otherwise affected by this document.\n b. Affirmer offers the Work as-is and makes no representations or\n    warranties of any kind concerning the Work, express, implied,\n    statutory or otherwise, including without limitation warranties of\n    title, merchantability, fitness for a particular purpose, non\n    infringement, or the absence of latent or other defects, accuracy, or\n    the present or absence of errors, whether or not discoverable, all to\n    the greatest extent permissible under applicable law.\n c. Affirmer disclaims responsibility for clearing rights of other persons\n    that may apply to the Work or any use thereof, including without\n    limitation any person's Copyright and Related Rights in the Work.\n    Further, Affirmer disclaims responsibility for obtaining any necessary\n    consents, permissions or other rights required for any use of the\n    Work.\n d. Affirmer understands and acknowledges that Creative Commons is not a\n    party to this document and has no duty or obligation with respect to\n    this CC0 or use of the Work.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/PythonPL.txt",
    "content": "1. This LICENSE AGREEMENT is between the Python Software Foundation\n(\"PSF\"), and the Individual or Organization (\"Licensee\") accessing and\notherwise using this software (\"Python\") in source or binary form and\nits associated documentation.\n\n2. Subject to the terms and conditions of this License Agreement, PSF hereby\ngrants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,\nanalyze, test, perform and/or display publicly, prepare derivative works,\ndistribute, and otherwise use Python alone or in any derivative version,\nprovided, however, that PSF's License Agreement and PSF's notice of copyright,\ni.e., \"Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,\n2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation;\nAll Rights Reserved\" are retained in Python alone or in any derivative version\nprepared by Licensee.\n\n3. In the event Licensee prepares a derivative work that is based on\nor incorporates Python or any part thereof, and wants to make\nthe derivative work available to others as provided herein, then\nLicensee hereby agrees to include in any such work a brief summary of\nthe changes made to Python.\n\n4. PSF is making Python available to Licensee on an \"AS IS\"\nbasis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR\nIMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND\nDISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS\nFOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT\nINFRINGE ANY THIRD PARTY RIGHTS.\n\n5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON\nFOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS\nA RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,\nOR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.\n\n6. This License Agreement will automatically terminate upon a material\nbreach of its terms and conditions.\n\n7. Nothing in this License Agreement shall be deemed to create any\nrelationship of agency, partnership, or joint venture between PSF and\nLicensee.  This License Agreement does not grant permission to use PSF\ntrademarks or trade name in a trademark sense to endorse or promote\nproducts or services of Licensee, or any third party.\n\n8. By copying, installing or otherwise using Python, Licensee\nagrees to be bound by the terms and conditions of this License\nAgreement.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/Unlicense.txt",
    "content": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to <http://unlicense.org>\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/VIM License.txt",
    "content": "*uganda.txt*    For Vim version 7.2.  Last change: 2008 Jun 21\n\n\n\t\t  VIM REFERENCE MANUAL    by Bram Moolenaar\n\n\n\n\t\t\t*uganda* *Uganda* *copying* *copyright* *license*\nSUMMARY\n\n\t\t\t\t\t\t\t\t*iccf* *ICCF*\nVim is Charityware.  You can use and copy it as much as you like, but you are\nencouraged to make a donation for needy children in Uganda.  Please see |kcc|\nbelow or visit the ICCF web site, available at these URLs:\n\n\thttp://iccf-holland.org/\n\thttp://www.vim.org/iccf/\n\thttp://www.iccf.nl/\n\nYou can also sponsor the development of Vim.  Vim sponsors can vote for\nfeatures.  See |sponsor|.  The money goes to Uganda anyway.\n\nThe Open Publication License applies to the Vim documentation, see\n|manual-copyright|.\n\n\nVIM LICENSE\n\nI)  There are no restrictions on distributing unmodified copies of Vim except\n    that they must include this license text.  You can also distribute\n    unmodified parts of Vim, likewise unrestricted except that they must\n    include this license text.  You are also allowed to include executables\n    that you made from the unmodified Vim sources, plus your own usage\n    examples and Vim scripts.\n\nII) It is allowed to distribute a modified (or extended) version of Vim,\n    including executables and/or source code, when the following four\n    conditions are met:\n    1) This license text must be included unmodified.\n    2) The modified Vim must be distributed in one of the following five ways:\n       a) If you make changes to Vim yourself, you must clearly describe in\n\t  the distribution how to contact you.  When the maintainer asks you\n\t  (in any way) for a copy of the modified Vim you distributed, you\n\t  must make your changes, including source code, available to the\n\t  maintainer without fee.  The maintainer reserves the right to\n\t  include your changes in the official version of Vim.  What the\n\t  maintainer will do with your changes and under what license they\n\t  will be distributed is negotiable.  If there has been no negotiation\n\t  then this license, or a later version, also applies to your changes.\n\tThe current maintainer is Bram Moolenaar <Bram@vim.org>. If this \n\t  changes it will be announced in appropriate places (most likely\n\t  vim.sf.net, www.vim.org and/or comp.editors).  When it is completely\n\t  impossible to contact the maintainer, the obligation to send him\n\t  your changes ceases.  Once the maintainer has confirmed that he has\n\t  received your changes they will not have to be sent again.\n       b) If you have received a modified Vim that was distributed as\n\t  mentioned under a) you are allowed to further distribute it\n\t  unmodified, as mentioned at I).  If you make additional changes the\n\t  text under a) applies to those changes.\n       c) Provide all the changes, including source code, with every copy of\n\t  the modified Vim you distribute.  This may be done in the form of a\n\t  context diff.  You can choose what license to use for new code you\n\t  add.  The changes and their license must not restrict others from\n\t  making their own changes to the official version of Vim.\n       d) When you have a modified Vim which includes changes as mentioned\n\t  under c), you can distribute it without the source code for the\n\t  changes if the following three conditions are met:\n\t  - The license that applies to the changes permits you to distribute\n\t    the changes to the Vim maintainer without fee or restriction, and\n\t    permits the Vim maintainer to include the changes in the official\n\t    version of Vim without fee or restriction.\n\t  - You keep the changes for at least three years after last\n\t    distributing the corresponding modified Vim.  When the maintainer\n\t    or someone who you distributed the modified Vim to asks you (in\n\t    any way) for the changes within this period, you must make them\n\t    available to him.\n\t  - You clearly describe in the distribution how to contact you.  This\n\t    contact information must remain valid for at least three years\n\t    after last distributing the corresponding modified Vim, or as long\n\t    as possible.\n       e) When the GNU General Public License (GPL) applies to the changes,\n\t  you can distribute the modified Vim under the GNU GPL version 2 or\n\t  any later version.\n    3) A message must be added, at least in the output of the \":version\"\n       command and in the intro screen, such that the user of the modified Vim\n       is able to see that it was modified.  When distributing as mentioned\n       under 2)e) adding the message is only required for as far as this does\n       not conflict with the license used for the changes.\n    4) The contact information as required under 2)a) and 2)d) must not be\n       removed or changed, except that the person himself can make\n       corrections.\n\nIII) If you distribute a modified version of Vim, you are encouraged to use\n     the Vim license for your changes and make them available to the\n     maintainer, including the source code.  The preferred way to do this is\n     by e-mail or by uploading the files to a server and e-mailing the URL.\n     If the number of changes is small (e.g., a modified Makefile) e-mailing a\n     context diff will do.  The e-mail address to be used is\n<maintainer@vim.org> \n\nIV)  It is not allowed to remove this license from the distribution of the Vim\n     sources, parts of it or from a modified version.  You may use this\n     license for previous Vim releases instead of the license that they came\n     with, at your option.\n\n\nNote:\n\n- If you are happy with Vim, please express that by reading the rest of this\n  file and consider helping needy children in Uganda.\n\n- If you want to support further Vim development consider becoming a\n  |sponsor|.  The money goes to Uganda anyway.\n\n- According to Richard Stallman the Vim license is GNU GPL compatible.\n  A few minor changes have been made since he checked it, but that should not\n  make a difference.\n\n- If you link Vim with a library that goes under the GNU GPL, this limits\n  further distribution to the GNU GPL.  Also when you didn't actually change\n  anything in Vim.\n\n- Once a change is included that goes under the GNU GPL, this forces all\n  further changes to also be made under the GNU GPL or a compatible license.\n\n- If you distribute a modified version of Vim, you can include your name and\n  contact information with the \"--with-modified-by\" configure argument or the\n  MODIFIED_BY define.\n\n==============================================================================\n\nKibaale Children's Centre\t\t*kcc* *Kibaale*  *charity*\n\nKibaale Children's Centre (KCC) is located in Kibaale, a small town in the\nsouth of Uganda, near Tanzania, in East Africa.  The area is known as Rakai\nDistrict.  The population is mostly farmers.  Although people are poor, there\nis enough food.  But this district is suffering from AIDS more than any other\npart of the world.  Some say that it started there.  Estimations are that 10\nto 30% of the Ugandans are infected with HIV.  Because parents die, there are\nmany orphans.  In this district about 60,000 children have lost one or both\nparents, out of a population of 350,000.  And this is still continuing.\n\nThe children need a lot of help.  The KCC is working hard to provide the needy\nwith food, medical care and education.  Food and medical care to keep them\nhealthy now, and education so that they can take care of themselves in the\nfuture.  KCC works on a Christian base, but help is given to children of any\nreligion.\n\nThe key to solving the problems in this area is education.  This has been\nneglected in the past years with president Idi Amin and the following civil\nwars.  Now that the government is stable again, the children and parents have\nto learn how to take care of themselves and how to avoid infections.  There is\nalso help for people who are ill and hungry, but the primary goal is to\nprevent people from getting ill and to teach them how to grow healthy food.\n\nMost of the orphans are living in an extended family.  An uncle or older\nsister is taking care of them.  Because these families are big and the income\n(if any) is low, a child is lucky if it gets healthy food.  Clothes, medical\ncare and schooling is beyond its reach.  To help these needy children, a\nsponsorship program was put into place.  A child can be financially adopted.\nFor a few dollars a month KCC sees to it that the child gets indispensable\nitems, is healthy, goes to school and KCC takes care of anything else that\nneeds to be done for the child and the family that supports it.\n\nBesides helping the child directly, the environment where the child grows up\nneeds to be improved.  KCC helps schools to improve their teaching methods.\nThere is a demonstration school at the centre and teacher trainings are given.\nHealth workers are being trained, hygiene education is carried out and\nhouseholds are stimulated to build a proper latrine.  I helped setting up a\nproduction site for cement slabs.  These are used to build a good latrine.\nThey are sold below cost price.\n\nThere is a small clinic at the project, which provides children and their\nfamily with medical help.  When needed, transport to a hospital is offered.\nImmunization programs are carried out and help is provided when an epidemic is\nbreaking out (measles and cholera have been a problem).\n\n\t\t\t\t\t\t\t*donate*\nSummer 1994 to summer 1995 I spent a whole year at the centre, working as a\nvolunteer.  I have helped to expand the centre and worked in the area of water\nand sanitation.  I learned that the help that the KCC provides really helps.\nWhen I came back to Holland, I wanted to continue supporting KCC.  To do this\nI'm raising funds and organizing the sponsorship program.  Please consider one\nof these possibilities:\n\n1.  Sponsor a child in primary school: 17 euro a month (or more).\n2.  Sponsor a child in secondary school: 25 euro a month (or more).\n3.  Sponsor the clinic: Any amount a month or quarter\n4.  A one-time donation\n\nCompared with other organizations that do child sponsorship the amounts are\nvery low.  This is because the money goes directly to the centre.  Less than\n5% is used for administration.  This is possible because this is a small\norganization that works with volunteers.  If you would like to sponsor a\nchild, you should have the intention to do this for at least one year.\n\nHow do you know that the money will be spent right?  First of all you have my\npersonal guarantee as the author of Vim.  I trust the people that are working\nat the centre, I know them personally.  Further more, the centre is\nco-sponsored and inspected by World Vision, Save the Children Fund and\nInternational Child Care Fund.  The centre is visited about once a year to\ncheck the progress (at our own cost).  I have visited the centre myself in\n1996, 1998, 2000, 2001 and 2003.  The visit reports are on the ICCF web site.\n\nIf you have any further questions, send me e-mail: <Bram@vim.org>. \n\nThe address of the centre is:\n\t\t\tKibaale Children's Centre\n\t\t\tp.o. box 1658\n\t\t\tMasaka, Uganda, East Africa\n\n\nSending money:\t\t\t\t\t\t*iccf-donations*\n\nCheck the ICCF web site for the latest information!  See |iccf| for the URL.\n\n\nUSA:\t\tThe methods mentioned below can be used.\n\t\tSending a check to the Nehemiah Group Outreach Society (NGOS)\n\t\tis no longer possible, unfortunately. We are looking for\n\t\tanother way to get you an IRS tax receipt. \n\t\tFor sponsoring a child contact KCF in Canada (see below). US\n\t\tchecks can be sent to them to lower banking costs.\n\nCanada:\t\tContact Kibaale Children's Fund (KCF) in Surrey, Canada.  They\n\t\ttake care of the Canadian sponsors for the children in\n\t\tKibaale.  KCF forwards 100% of the money to the project in\n\t\tUganda.  You can send them a one time donation directly.\n\t\tPlease send me a note so that I know what has been donated\n\t\tbecause of Vim.  Ask KCF for information about sponsorship.\n\t\t\tKibaale Children's Fund c/o Pacific Academy\n\t\t\t10238-168 Street\n\t\t\tSurrey, B.C. V4N 1Z4\n\t\t\tCanada\n\t\t\tPhone: 604-581-5353\n\t\tIf you make a donation to Kibaale Children's Fund (KCF) you\n\t\twill receive a tax receipt which can be submitted with your\n\t\ttax return.\n\nHolland:\tTransfer to the account of \"Stichting ICCF Holland\" in Venlo.\n\t\tThis will allow for tax deduction if you live in Holland.\n\t\t\tPostbank, nr. 4548774\n\nGermany:\tIt is possible to make donations that allow for a tax return.\n\t\tCheck the ICCF web site for the latest information:\n\thttp://iccf-holland.org/germany.html\n\nWorld:\t\tUse a postal money order.  That should be possible from any\n\t\tcountry, mostly from the post office.  Use this name (which is\n\t\tin my passport): \"Abraham Moolenaar\".  Use Euro for the\n\t\tcurrency if possible.\n\nEurope:\t\tUse a bank transfer if possible.  Your bank should have a form\n\t\tthat you can use for this.  See \"Others\" below for the swift\n\t\tcode and IBAN number.\n\t\tAny other method should work.  Ask for information about\n\t\tsponsorship.\n\nCredit Card:\tYou can use PayPal to send money with a Credit card.  This is\n\t\tthe most widely used Internet based payment system.  It's\n\t\treally simple to use.  Use this link to find more info:\n\t\t    https://www.paypal.com/en_US/mrb/pal=XAC62PML3GF8Q\n\t\tThe e-mail address for sending the money to is:\n\tBram@iccf-holland.org \n\t\tFor amounts above 400 Euro ($500) sending a check is\n\t\tpreferred.\n\nOthers:\t\tTransfer to one of these accounts if possible:\n\t\t    Postbank, account 4548774\n\t\t\t\tSwift code: INGB NL 2A\n\t\t\t\tIBAN: NL47 PSTB 0004 5487 74\n\t\t\tunder the name \"stichting ICCF Holland\", Venlo\n\t\t    If that doesn't work:\n\t\t    Rabobank Venlo, account 3765.05.117\n\t\t\t\tSwift code: RABO NL 2U\n\t\t\tunder the name \"Bram Moolenaar\", Venlo\n\t\tOtherwise, send a check in euro or US dollars to the address\n\t\tbelow.  Minimal amount: $70 (my bank does not accept smaller\n\t\tamounts for foreign check, sorry)\n\nAddress to send checks to:\n\t\t\tstichting ICCF Holland\n\t\t\tBram Moolenaar\n\t\t\tFinsterruetihof 1\n\t\t\t8134 Adliswil\n\t\t\tSwitzerland\n\nThis address is expected to be valid for a long time.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/WTFPL.txt",
    "content": "            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n                    Version 2, December 2004\n\n Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>\n\n Everyone is permitted to copy and distribute verbatim or modified\n copies of this license document, and changing it is allowed as long\n as the name is changed.\n\n            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. You just DO WHAT THE FUCK YOU WANT TO.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/ZLIB.txt",
    "content": "Copyright (c) <''year''> <''copyright holders''>\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\n   claim that you wrote the original software. If you use this software\n   in a product, an acknowledgment in the product documentation would be\n   appreciated but is not required.\n2. Altered source versions must be plainly marked as such, and must not be\n   misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n"
  },
  {
    "path": "packages/termux-licenses/LICENSES/wxWindows.txt",
    "content": "              wxWindows Library Licence, Version 3.1\n              ======================================\n\nCopyright (c) 1998-2005 Julian Smart, Robert Roebling et al\n\nEveryone is permitted to copy and distribute verbatim copies\nof this licence document, but changing it is not allowed.\n\n                     WXWINDOWS LIBRARY LICENCE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\nThis library is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Library General Public Licence as published by\nthe Free Software Foundation; either version 2 of the Licence, or (at your\noption) any later version.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT\nANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public\nLicence for more details.\n\nYou should have received a copy of the GNU Library General Public Licence\nalong with this software, usually in a file named COPYING.LIB.  If not,\nwrite to the Free Software Foundation, Inc., 51 Franklin Street, Fifth\nFloor, Boston, MA 02110-1301 USA.\n\nEXCEPTION NOTICE\n\n1. As a special exception, the copyright holders of this library give\npermission for additional uses of the text contained in this release of the\nlibrary as licenced under the wxWindows Library Licence, applying either\nversion 3.1 of the Licence, or (at your option) any later version of the\nLicence as published by the copyright holders of version 3.1 of the Licence\ndocument.\n\n2. The exception is that you may use, copy, link, modify and distribute\nunder your own terms, binary object code versions of works based on the\nLibrary.\n\n3. If you copy code from files distributed under the terms of the GNU\nGeneral Public Licence or the GNU Library General Public Licence into a\ncopy of this library, as this licence permits, the exception does not apply\nto the code that you add in this way.  To avoid misleading anyone as to the\nstatus of such modified files, you must delete this exception notice from\nsuch code and/or adjust the licensing conditions notice accordingly.\n\n4. If you write modifications of your own for this library, it is your\nchoice whether to permit this exception to apply to your modifications.  If\nyou do not wish that, you must delete the exception notice from such code\nand/or adjust the licensing conditions notice accordingly.\n"
  },
  {
    "path": "packages/termux-licenses/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://termux.com\nTERMUX_PKG_DESCRIPTION=\"Contains LICENSE files for common licenses\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.0\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_ESSENTIAL=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/LICENSES\n\tfor LICENSE in \"$TERMUX_PKG_BUILDER_DIR/LICENSES/*.txt\"; do\n\t\tcp -f $LICENSE $TERMUX_PREFIX/share/LICENSES/\n\tdone\n}\n"
  },
  {
    "path": "packages/termux-services/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/Neo-Oli/termux-services/\nTERMUX_PKG_DESCRIPTION=\"Service daemon for Termux\"\nTERMUX_PKG_VERSION=0.0.5\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_SRCURL=https://github.com/termux/termux-services/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=0d2c08b28a4f97c6d50bea9d1d21d599a16be031ad95573e078f6bd864ccdd1e\nTERMUX_PKG_DEPENDS=\"busybox, coreutils\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/termux-tools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://termux.com/\nTERMUX_PKG_DESCRIPTION=\"Basic system tools for Termux\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=0.74\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_ESSENTIAL=true\nTERMUX_PKG_CONFLICTS=\"procps (<< 3.3.15-2)\"\nTERMUX_PKG_SUGGESTS=\"termux-api\"\nTERMUX_PKG_CONFFILES=\"etc/motd\"\n\n# Some of these packages are not dependencies and used only to ensure\n# that core packages are installed after upgrading (we removed busybox\n# from essentials).\nTERMUX_PKG_DEPENDS=\"bzip2, coreutils, curl, dash, diffutils, findutils, gawk, grep, gzip, less, procps, psmisc, sed, tar, termux-am, termux-exec, xz-utils\"\n\n# Optional packages that are distributed as part of bootstrap archives.\nTERMUX_PKG_RECOMMENDS=\"ed, dos2unix, inetutils, net-tools, patch, unzip, util-linux\"\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/bin/applets\n\t# Remove LD_LIBRARY_PATH from environment to avoid conflicting\n\t# with system libraries that system binaries may link against:\n\tfor tool in df getprop logcat mount ping ping6 ip pm settings top umount; do\n\t\tWRAPPER_FILE=$TERMUX_PREFIX/bin/$tool\n\t\techo '#!/bin/sh' > $WRAPPER_FILE\n\t\techo 'unset LD_LIBRARY_PATH LD_PRELOAD' >> $WRAPPER_FILE\n\t\t# Some tools require having /system/bin/app_process in the PATH,\n\t\t# at least am&pm on a Nexus 6p running Android 6.0:\n\t\techo -n 'PATH=$PATH:/system/bin ' >> $WRAPPER_FILE\n\t\techo \"exec /system/bin/$tool \\\"\\$@\\\"\" >> $WRAPPER_FILE\n\t\tchmod +x $WRAPPER_FILE\n\tdone\n\n\tfor script in chsh dalvikvm login pkg su termux-fix-shebang termux-info \\\n\t\ttermux-open termux-open-url termux-reload-settings termux-setup-storage \\\n\t\ttermux-wake-lock termux-wake-unlock; do\n\t\t\tinstall -Dm700 $TERMUX_PKG_BUILDER_DIR/$script $TERMUX_PREFIX/bin/$script\n\t\t\tperl -p -i -e \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" $TERMUX_PREFIX/bin/$script\n\tdone\n\n\tinstall -Dm600 $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd\n\tln -sfr $TERMUX_PREFIX/bin/termux-open $TERMUX_PREFIX/bin/xdg-open\n}\n"
  },
  {
    "path": "packages/termux-tools/chsh",
    "content": "#!/bin/sh\n\nset -e -u\n\nshow_usage () {\n\techo \"usage: chsh [-s shell]\"\n\techo \"Change the login shell.\"\n}\n\nset_shell () {\n\tif [ \"$1\" = login ]; then\n\t\techo \"login is not a valid shell\"\n\t\texit 1\n\tfi\n\tmkdir -p $HOME/.termux\n\tNEW_SHELL=@TERMUX_PREFIX@/bin/$1\n\tif test -x $NEW_SHELL -a ! -d $NEW_SHELL; then\n\t\tln -f -s $NEW_SHELL $HOME/.termux/shell\n\telse\n\t\techo \"$NEW_SHELL is not an executable file!\"\n\tfi\n}\n\nO=`getopt -l help -- hs: \"$@\"`\neval set -- \"$O\"\nwhile true; do\n\tcase \"$1\" in\n\t\t-h|--help) show_usage; exit 0;;\n\t\t-s) set_shell $2; exit 0;;\n\t\t--)\tshift; break;;\n\t\t*)\techo Error; show_usage; exit 1;;\n\tesac\ndone\n\nDEFAULT_SHELL=bash\nif [ ! -x @TERMUX_PREFIX@/bin/$DEFAULT_SHELL ]; then DEFAULT_SHELL=ash; fi\n\necho Changing the login shell\necho Enter the new value, or press ENTER for the default\nprintf \"        Login Shell [$DEFAULT_SHELL]: \"\nread shell\n\nif [ -z \"$shell\" ]; then shell=$DEFAULT_SHELL; fi\nset_shell $shell\n"
  },
  {
    "path": "packages/termux-tools/dalvikvm",
    "content": "#!/bin/sh\n\n# There needs to be a folder at $ANDROID_DATA/dalvik-cache\nexport ANDROID_DATA=@TERMUX_PREFIX@/var/android/\nmkdir -p $ANDROID_DATA/dalvik-cache\n\nunset LD_LIBRARY_PATH LD_PRELOAD\nexec /system/bin/dalvikvm -Djava.io.tmpdir=@TERMUX_PREFIX@/tmp \"$@\"\n"
  },
  {
    "path": "packages/termux-tools/login",
    "content": "#!/bin/sh\n\nif [ $# = 0 ] && [ -f @TERMUX_PREFIX@/etc/motd ] && [ ! -f ~/.hushlogin ] && [ -z \"$TERMUX_HUSHLOGIN\" ]; then\n\tcat @TERMUX_PREFIX@/etc/motd\nelse\n\t# This variable shouldn't be kept set.\n\tunset TERMUX_HUSHLOGIN\nfi\n\nif [ -G ~/.termux/shell ]; then\n\texport SHELL=\"`realpath ~/.termux/shell`\"\nelse\n\tfor file in @TERMUX_PREFIX@/bin/bash @TERMUX_PREFIX@/bin/sh /system/bin/sh; do\n\t\tif [ -x $file ]; then\n\t\t\texport SHELL=$file\n\t\t\tbreak\n\t\tfi\n\tdone\nfi\n\nif [ -f @TERMUX_PREFIX@/lib/libtermux-exec.so ]; then\n\texport LD_PRELOAD=@TERMUX_PREFIX@/lib/libtermux-exec.so\n\t$SHELL -c \"busybox true\" > /dev/null 2>&1 || unset LD_PRELOAD\nfi\n\nif [ -n \"$TERM\" ]; then\n\texec \"$SHELL\" -l \"$@\"\nelse\n\texec \"$SHELL\" \"$@\"\nfi\n"
  },
  {
    "path": "packages/termux-tools/motd",
    "content": "\nWelcome to Andronix!\n\nDiscord:      https://discord.gg/kjdff\nTelegram:     https://t.me/andronixApp\n\nThis is the command line that Andronix utilizes. This is forked from Termux and modified to automate things on Andronix. All the basic packages are already included with the bootstrap and using pkg or apt is not allowed since we are not using the official Termux repositories but you can search for packages and manually install them from-\n\nPackages - https://dl.bintray.com/andronixapp/termux-packages-24"
  },
  {
    "path": "packages/termux-tools/pkg",
    "content": "#!/bin/sh\nset -e -u\n\nshow_help() {\n\techo 'Usage: pkg command [arguments]'\n\techo ''\n\techo 'A tool for managing packages. Commands:'\n\techo ''\n\techo '  files <packages>'\n\techo '  install <packages>'\n\techo '  list-all'\n\techo '  list-installed'\n\techo '  reinstall <packages>'\n\techo '  search <query>'\n\techo '  show <packages>'\n\techo '  uninstall <packages>'\n\techo '  upgrade'\n\texit 1\n}\n\ncheck_pkgcache() {\n\tif [ -z \"$(find @TERMUX_PREFIX@/var/cache/apt/pkgcache.bin -mmin -5)\" ]; then\n\t\tapt update\n\tfi\n}\n\nif [ $# = 0 ]; then\n\tshow_help\nfi\n\nCMD=\"$1\"\nshift 1\n\ncase \"$CMD\" in\n\tf*) dpkg -L \"$@\";;\n\th*) show_help;;\n\tadd|i*) check_pkgcache; apt install \"$@\";;\n\tlist-a*) apt list \"$@\";;\n\tlist-i*) apt list --installed \"$@\";;\n\trei*) apt install --reinstall \"$@\";;\n\tse*) check_pkgcache; apt search \"$@\";;\n\tsh*) apt show \"$@\";;\n\tun*|rem*|rm|del*) apt remove \"$@\";;\n\tup*) apt update; apt full-upgrade \"$@\";;\n\t*) echo \"Unknown command: '$CMD' (run 'pkg help' for usage information)\"; exit 1;;\nesac\n"
  },
  {
    "path": "packages/termux-tools/su",
    "content": "#!/bin/sh\n\nunset LD_LIBRARY_PATH LD_PRELOAD\n\nfor p in /sbin/su /system/sbin/su /system/bin/su /system/xbin/su /su/bin/su /magisk/.core/bin/su\ndo\n\tif [ -x $p ]; then\n\t\t# The su tool may require programs in PATH:\n\t\tPATH=/sbin:/sbin/su:/su/bin:/su/xbin:/system/bin:/system/xbin \\\n\t\t\texec $p \"$@\"\n\tfi\ndone\n\necho \"No su program found on this device. Termux\"\necho \"does not supply tools for rooting, see e.g.\"\necho \"http://www.androidcentral.com/root for\"\necho \"information about rooting Android.\"\nexit 1\n"
  },
  {
    "path": "packages/termux-tools/termux-fix-shebang",
    "content": "#!/bin/sh\n\nif [ $# = 0 -o \"$1\" = \"-h\" ]; then\n\techo 'usage: termux-fix-shebang <files>'\n\techo 'Rewrite shebangs in specified files for running under Termux,'\n\techo 'which is done by rewriting #!*/bin/binary to #!@TERMUX_PREFIX@/bin/binary.'\n\texit 1\nfi\n\nfor file in \"$@\"; do\n\tsed -i -E \"1 s@^#\\!(.*)/[sx]?bin/(.*)@#\\!@TERMUX_PREFIX@/bin/\\2@\" \"$(realpath \"${file}\")\"\ndone\n"
  },
  {
    "path": "packages/termux-tools/termux-info",
    "content": "#!/bin/bash\n\nif [ \"$#\" != \"0\" ]; then\n\techo 'usage: termux-info'\n\techo 'Provides information about Termux, and the current system. Helpful for debugging.'\n\texit\nfi\n\nupdates() {\n\tlocal updatable\n\n\tif [ \"$(id -u)\" = \"0\" ]; then\n\t\techo \"Running as root. Cannot check package updates.\"\n\telse\n\t\tapt update >/dev/null 2>&1\n\t\tupdatable=$(apt list --upgradable 2>/dev/null | tail -n +2)\n\n\t\tif [ -z \"$updatable\" ];then\n\t\t\techo \"All packages up to date\"\n\t\telse\n\t\t\techo \"$updatable\"\n\t\tfi\n\tfi\n}\n\nrepo_subscriptions() {\n\tlocal main_sources\n\tmain_sources=$(grep -P '^\\s*deb\\s' \"@TERMUX_PREFIX@/etc/apt/sources.list\")\n\n\tif [ -n \"$main_sources\" ]; then\n\t\techo \"# sources.list\"\n\t\techo \"$main_sources\"\n\tfi\n\n\tlocal filename repo_package supl_sources\n\twhile read -r filename; do\n\t\trepo_package=$(dpkg -S \"$filename\" 2>/dev/null | cut -d : -f 1)\n\t\tsupl_sources=$(grep -P '^\\s*deb\\s' \"$filename\")\n\n\t\tif [ -n \"$supl_sources\" ]; then\n\t\t\tif [ -n \"$repo_package\" ]; then\n\t\t\t\techo \"# $repo_package (sources.list.d/$(basename \"$filename\"))\"\n\t\t\telse\n\t\t\t\techo \"# sources.list.d/$(basename \"$filename\")\"\n\t\t\tfi\n\t\t\techo \"$supl_sources\"\n\t\tfi\n\tdone < <(find \"@TERMUX_PREFIX@/etc/apt/sources.list.d\" -maxdepth 1 ! -type d)\n}\n\noutput=\"Packages CPU architecture:\n$(dpkg --print-architecture)\nSubscribed repositories:\n$(repo_subscriptions)\nUpdatable packages:\n$(updates)\nAndroid version:\n$(getprop ro.build.version.release)\nKernel build information:\n$(uname -a)\nDevice manufacturer:\n$(getprop ro.product.manufacturer)\nDevice model:\n$(getprop ro.product.model)\"\necho \"$output\"\n\nif [ -n \"$(command -v termux-clipboard-set)\" ]; then\n\t# Copy to clipboard (requires termux-api)\n\t# use timeout in case termux-api is installed but the termux:api app is missing\n\techo \"$output\" | timeout 3 termux-clipboard-set 2>/dev/null\n\ttimeout 3 termux-toast \"Information has been copied to the clipboard\" 2>/dev/null\nfi\n\nexit 0\n"
  },
  {
    "path": "packages/termux-tools/termux-open",
    "content": "#!/bin/sh\nset -e -u\n\nSCRIPTNAME=termux-open\nshow_usage () {\n    echo \"Usage: $SCRIPTNAME [options] path-or-url\"\n    echo \"Open a file or URL in an external app.\"\n    echo \"  --send               if the file should be shared for sending\"\n    echo \"  --view               if the file should be shared for viewing (default)\"\n    echo \"  --chooser            if an app chooser should always be shown\"\n    echo \"  --content-type type  specify the content type to use\"\n    exit 0\n}\n\nTEMP=`busybox getopt \\\n     -n $SCRIPTNAME \\\n     -o h \\\n     --long send,view,chooser,content-type:,help\\\n     -- \"$@\"`\neval set -- \"$TEMP\"\n\nACTION=android.intent.action.VIEW\nEXTRAS=\"\"\nwhile true; do\n\tcase \"$1\" in\n\t\t--send) ACTION=\"android.intent.action.SEND\"; shift;;\n\t\t--view) ACTION=\"android.intent.action.VIEW\"; shift;;\n\t\t--chooser) EXTRAS=\"$EXTRAS --ez chooser true\"; shift;;\n\t\t--content-type) EXTRAS=\"$EXTRAS --es content-type $2\"; shift 2;;\n\t\t-h | --help) show_usage;;\n\t\t--) shift; break ;;\n\tesac\ndone\nif [ $# != 1 ]; then\n\tshow_usage\nfi\n\nFILE=\"$1\"\nif [ -f \"$FILE\" ]; then\n\tFILE=$(realpath \"$FILE\")\nfi\n\nam broadcast --user 0 \\\n\t-a $ACTION \\\n\t-n com.termux/com.termux.app.TermuxOpenReceiver \\\n\t$EXTRAS \\\n\t-d \"$FILE\" \\\n\t> /dev/null\n\n"
  },
  {
    "path": "packages/termux-tools/termux-open-url",
    "content": "#!/bin/sh\n\nif [ $# != 1 ]; then\n\techo 'usage: termux-open-url <url>'\n\techo 'Open an URL for viewing.'\n\texit 1\nfi\n\nam start --user 0 -a android.intent.action.VIEW -d $1 > /dev/null\n"
  },
  {
    "path": "packages/termux-tools/termux-reload-settings",
    "content": "#!/bin/sh\n\nif [ \"$#\" != \"0\" ]; then\n\techo 'usage: termux-reload-settings'\n\techo 'Use without arguments to reload settings after modifying any of:'\n\techo '  ~/.termux/colors.properties'\n\techo '  ~/.termux/font.ttf '\n\techo '  ~/.termux/termux.properties'\n\texit\nfi\n\nam broadcast --user 0 -a com.termux.app.reload_style com.termux > /dev/null\n"
  },
  {
    "path": "packages/termux-tools/termux-setup-storage",
    "content": "#!/bin/sh\n\nif [ \"$#\" != \"0\" ]; then\n\techo 'usage: termux-setup-storage'\n\techo 'Use without arguments to ensure storage permission granted'\n\techo 'and symlinks to storage available in $HOME/storage'\n\texit\nfi\n\nam broadcast --user 0 \\\n\t\t --es studio.com.techriz.andronix.reload_style storage \\\n\t\t -a studio.com.techriz.andronix.reload_style studio.com.techriz.andronix > /dev/null"
  },
  {
    "path": "packages/termux-tools/termux-wake-lock",
    "content": "#!/bin/sh\n\nif [ $# != 0 ]; then\n\techo 'usage: termux-wake-lock'\n\techo 'Acquire the Termux wake lock to prevent the CPU from sleeping.'\n\texit 1\nfi\n\nam startservice \\\n\t--user 0 \\\n\t-a com.termux.service_wake_lock \\\n\tcom.termux/com.termux.app.TermuxService \\\n\t> /dev/null\n"
  },
  {
    "path": "packages/termux-tools/termux-wake-unlock",
    "content": "#!/bin/sh\n\nif [ $# != 0 ]; then\n\techo 'usage: termux-wake-unlock'\n\techo 'Release the Termux wake lock to allow the CPU to sleep.'\n\texit 1\nfi\n\nam startservice \\\n\t--user 0 \\\n\t-a com.termux.service_wake_unlock \\\n\tcom.termux/com.termux.app.TermuxService \\\n\t> /dev/null\n"
  },
  {
    "path": "packages/teseq/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/teseq/\nTERMUX_PKG_DESCRIPTION=\"Tool for analyzing control characters and terminal control sequences\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.1.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/teseq/teseq-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=230d2b4a587542284c415b33557a27774f5ad1580ed9db272bcd1e2034ea0589\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"teseq_cv_vsnprintf_works=yes\"\n"
  },
  {
    "path": "packages/tesseract/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/tesseract-ocr/tesseract\nTERMUX_PKG_DESCRIPTION=\"Tesseract is probably the most accurate open source OCR engine available\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=4.1.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/tesseract-ocr/tesseract/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=5c5ed5f1a76888dc57a83704f24ae02f8319849f5c4cf19d254296978a1a1961\nTERMUX_PKG_DEPENDS=\"libc++, libtool, libuuid, leptonica, libandroid-glob\"\nTERMUX_PKG_BREAKS=\"tesseract-dev\"\nTERMUX_PKG_REPLACES=\"tesseract-dev\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-landroid-glob\"\n\n\t# http://blog.matt-swain.com/post/26419042500/installing-tesseract-ocr-on-mac-os-x-lion\n\texport LIBLEPT_HEADERSDIR=${TERMUX_PREFIX}/include/leptonica\n\n\tperl -p -i -e 's|ADD_RT], true|ADD_RT], false|g' configure.ac\n\t./autogen.sh\n}\n\ntermux_step_post_make_install() {\n\t# download english trained data\n\tcd \"${TERMUX_PREFIX}/share/tessdata\"\n\trm -f eng.*\n\n\tlocal checksums\n\tdeclare -A checksums\n\tchecksums[cube.bigrams]=64adf2cc0b2a6705368aa357224d1a6739035d5fe892cd0cc457016df5b4280f\n\tchecksums[cube.fold]=2b229895623934b493fe69c51fcc387295d91af8b4e43cc51748b3d269a95eed\n\tchecksums[cube.lm]=a6f769245b0a55f42a3ce157cd19d96828483c3384c6483433ed83579ea16e36\n\tchecksums[cube.nn]=8f345f1c19772dd71a5214bc94175ccf647c003ab77e4143fde48f11bf3cb0ef\n\tchecksums[cube.params]=c2aa2854951bd823d89cc86d53a6d9712a6a885de6fbaf650ff3df48bfed85d7\n\tchecksums[cube.size]=e5f95de7e2754eb2df03451885277ca4573b3770816043ae2e2f09d1f7232604\n\tchecksums[cube.word-freq]=8d612bef20ae3052fce0b8650575a80d87c94d772ec6d1f0c6a1ad591586ea44\n\tchecksums[tesseract_cube.nn]=196bedc8a5bc8c30361c2c9518f648b45b498759cb6041827ff6fbfb8da2a8d1\n\tchecksums[traineddata]=c0515c9f1e0c79e1069fcc05c2b2f6a6841fb5e1082d695db160333c1154f06d\n\n\tmkdir -p $TERMUX_PKG_CACHEDIR/tessdata\n\n\ttermux_download \\\n\t\thttps://raw.githubusercontent.com/tesseract-ocr/tessdata/4.0.0/eng.traineddata \\\n\t\t$TERMUX_PKG_CACHEDIR/tessdata/eng.traineddata \\\n\t\tdaa0c97d651c19fba3b25e81317cd697e9908c8208090c94c3905381c23fc047\n\tcp $TERMUX_PKG_CACHEDIR/tessdata/eng.traineddata .\n}\n"
  },
  {
    "path": "packages/texinfo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/texinfo/\nTERMUX_PKG_DESCRIPTION=\"Documentation system for on-line information and printed output\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=6.7\nTERMUX_PKG_SHA256=988403c1542d15ad044600b909997ba3079b10e03224c61188117f3676b02caa\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/texinfo/texinfo-${TERMUX_PKG_VERSION}.tar.xz\n# gawk is used by texindex:\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses, perl, gawk\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-perl-xs\"\n"
  },
  {
    "path": "packages/texinfo/texindex-texindex.in.patch",
    "content": "Use gawk regardless of what was picked up during build.\n\ndiff -u -r ../texinfo-6.5/texindex/texindex.in ./texindex/texindex.in\n--- ../texinfo-6.5/texindex/texindex.in\t2016-02-06 12:21:52.000000000 +0000\n+++ ./texindex/texindex.in\t2018-07-12 07:29:20.427030482 +0000\n@@ -44,7 +44,7 @@\n #\n # else use configured value for awk.\n if test -z \"$awk_binary\"; then\n-  awk_binary=\"@AWK@\"\n+  awk_binary=gawk\n fi\n #\n # that should never be empty, but just in case, else fall back to plain\n"
  },
  {
    "path": "packages/texlive/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/\nTERMUX_PKG_DESCRIPTION=\"TeX Live is a distribution of the TeX typesetting system.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=20190410\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/texlive-${TERMUX_PKG_VERSION}-texmf.tar.xz\nTERMUX_PKG_SHA256=c2ec974abc98b91995969e7871a0b56dbc80dd8508113ffcff6923e912c4c402\nTERMUX_PKG_DEPENDS=\"perl, texlive-bin (>= 20190410)\"\nTERMUX_PKG_CONFLICTS=\"texlive (<< 20170524-5), texlive-bin (<< 20190410), texlive-tlmgr (<< 20190410)\"\nTERMUX_PKG_REPLACES=\"texlive-bin (<< 20190410), texlive-tlmgr (<< 20190410)\"\nTERMUX_PKG_RECOMMENDS=\"texlive-tlmgr\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_HAS_DEBUG=false\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTL_ROOT=$TERMUX_PREFIX/share/texlive\nTL_BINDIR=$TERMUX_PREFIX/bin\n\ntermux_step_post_extract_package() {\n\tcd $TERMUX_PKG_CACHEDIR\n\ttermux_download ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/install-tl-unx.tar.gz \\\n\t\t\tinstall-tl-unx.tar.gz \\\n\t\t\t44aa41b5783e345b7021387f19ac9637ff1ce5406a59754230c666642dfe7750\n\ttar -xf install-tl-unx.tar.gz\n\tmv install-tl-*/install-tl \\\n\t   install-tl-*/LICENSE.CTAN \\\n\t   install-tl-*/LICENSE.TL \\\n\t   install-tl-*/release-texlive.txt \\\n\t   install-tl-*/tlpkg \\\n\t   $TERMUX_PKG_SRCDIR/\n\n\t# Download texlive.tlpdb, parse to get file lists and include in texlive-full.\n\ttermux_download ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/texlive-${TERMUX_PKG_VERSION}-tlpdb-full.tar.gz \\\n\t\t\ttexlive-${TERMUX_PKG_VERSION}-tlpdb-full.tar.gz \\\n\t\t\t4c93a5c7d28df63c6dd7f767822e5dacf9290a0dff4990663e283b6e2d8d1918\n\n\ttar xf texlive-${TERMUX_PKG_VERSION}-tlpdb-full.tar.gz\n\tmv texlive.tlpdb $TERMUX_PKG_TMPDIR\n}\n\ntermux_step_make() {\n\tsed -i \"s% RELOC/% texmf-dist/%g\" $TERMUX_PKG_TMPDIR/texlive.tlpdb\n\tmkdir -p $TL_ROOT\n\tcp -r $TERMUX_PKG_BUILDDIR/* $TL_ROOT/\n\tperl -I$TL_ROOT/tlpkg/ $TL_ROOT/texmf-dist/scripts/texlive/mktexlsr.pl $TL_ROOT/texmf-dist\n\tmkdir -p $TL_ROOT/tlpkg\n\tcp $TERMUX_PKG_TMPDIR/texlive.tlpdb $TL_ROOT/tlpkg/\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/bash\" > postinst\n\techo \"mktexlsr $TL_ROOT/texmf-var\" >> postinst\n\techo \"texlinks\" >> postinst\n\techo \"echo ''\" >> postinst\n\techo \"echo Welcome to TeX Live!\" >> postinst\n\techo \"echo ''\" >> postinst\n\techo \"echo 'TeX Live is a joint project of the TeX user groups around the world;'\" >> postinst\n\techo \"echo 'please consider supporting it by joining the group best for you.'\" >> postinst\n\techo \"echo 'The list of groups is available on the web at http://tug.org/usergroups.html.'\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n\n\t# Remove all files installed through tlmgr on removal\n\techo \"#!$TERMUX_PREFIX/bin/bash\" > prerm\n\techo 'if [ $1 != \"remove\" ]; then exit 0; fi' >> prerm\n\techo \"echo Running texlinks --unlink\" >> prerm\n\techo \"texlinks --unlink\" >> prerm\n\techo \"echo Removing texmf-dist\" >> prerm\n\techo \"rm -rf $TL_ROOT/texmf-dist\" >> prerm\n\techo \"echo Removing texmf-var and tlpkg\" >> prerm\n\techo \"rm -rf $TL_ROOT/{texmf-var,tlpkg/{texlive.tlpdb.*,tlpobj,backups}}\" >> prerm\n\techo \"exit 0\" >> prerm\n\tchmod 0755 prerm\n}\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nshare/texlive/install-tl\nshare/texlive/texmf-dist/scripts/texlive/uninstall-win32.pl\nshare/texlive/texmf-dist/scripts/texlive/uninstq.vbs\nshare/texlive/texmf-dist/scripts/texlive/tlmgr.pl\nshare/texlive/texmf-dist/scripts/texlive/tlmgrgui.pl\nshare/texlive/tlpkg/gpg\nshare/texlive/tlpkg/installer\nshare/texlive/tlpkg/tltcl\nshare/texlive/tlpkg/translations\nshare/texlive/texmf-dist/doc\nshare/texlive/texmf-dist/source\n\"\n\n# Here are all the files in collection-wintools: (single quotes due to share/texlive/tlpkg/dviout/UTILITY/dvi$pdf.bat)\nTERMUX_PKG_RM_AFTER_INSTALL+='\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/pdldoc.tex\nshare/texlive/tlpkg/dviout/DOC/cmode1.png\nshare/texlive/texmf-dist/doc/support/wintools/pdfseparate.pdf\nshare/texlive/texmf-dist/doc/support/wintools/fc-query.pdf\nshare/texlive/texmf-dist/doc/support/tlaunch/figures/tlaunch_rug.png\nshare/texlive/tlpkg/dviout/GRAPHIC/TPIC/tpicdoc.tex\nshare/texlive/tlpkg/dviout/dviout.cnt\nshare/texlive/tlpkg/dviout/par/p4to1e.pgm\nshare/texlive/tlpkg/dviout/DOC/niko.bmp\nshare/texlive/tlpkg/dviout/GRAPHIC/COLOR/color.tex\nshare/texlive/bin/win32/luajitlatex.exe\nshare/texlive/tlpkg/dviout/DOC/dviouttipse.html\nshare/texlive/tlpkg/dviout/SAMPLE/slisamp2.tex\nshare/texlive/tlpkg/dviout/DOC/cmode2.png\nshare/texlive/tlpkg/dviout/DOC/seru.bmp\nshare/texlive/bin/win32/type1afm.exe\nshare/texlive/tlpkg/dviout/bmc.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/sample1.ps\nshare/texlive/tlpkg/dviout/par/HG-GyouSho.par\nshare/texlive/tlpkg/dviout/DOC/cmode.html\nshare/texlive/texmf-dist/doc/support/wintools/pdftoppm.pdf\nshare/texlive/texmf-dist/doc/support/wintools/fc-pattern.pdf\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/starbrst.ps\nshare/texlive/texmf-dist/doc/support/wintools/pdfdetach.pdf\nshare/texlive/bin/win32/png22pnm.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/lasersys.lp3\nshare/texlive/tlpkg/dviout/DOC/cmode6.png\nshare/texlive/tlpkg/dviout/CreateBB.exe\nshare/texlive/tlpkg/dviout/par/p4to1.pgm\nshare/texlive/texmf-dist/scripts/tlaunch/tlaunchmode.pl\nshare/texlive/texmf-dist/doc/support/tlaunch/figures/tlaunch_window.png\nshare/texlive/tlpkg/dviout/FONT/winttf.zip\nshare/texlive/tlpkg/dviout/GRAPHIC/LATEX2E/dviout.dtx\nshare/texlive/tlpkg/dviout/GRAPHIC/PBM/pbmf.sty\nshare/texlive/texmf-dist/doc/support/wintools/zip.pdf\nshare/texlive/tlpkg/dviout/convedit.exe\nshare/texlive/tlpkg/dviout/par/TTfont.par\nshare/texlive/tlpkg/dviout/SAMPLE/slisamp4.tex\nshare/texlive/bin/win32/tiff2png.exe\nshare/texlive/tlpkg/dviout/DOC/lminus.bmp\nshare/texlive/bin/win32/pdftotext.exe\nshare/texlive/tlpkg/dviout/SPECIAL/demo.tex\nshare/texlive/tlpkg/dviout/SPECIAL/src.mac\nshare/texlive/tlpkg/dviout/par/dvipskdl.par\nshare/texlive/tlpkg/dviout/par/p12wait.pgm\nshare/texlive/bin/win32/tif22pnm.exe\nshare/texlive/tlpkg/dviout/par/Hidemaru.par\nshare/texlive/tlpkg/dviout/UTILITY/test_b5.tex\nshare/texlive/tlpkg/dviout/par/DF-GyouSho.par\nshare/texlive/bin/win32/gzip.exe\nshare/texlive/bin/win32/tomac.exe\nshare/texlive/texmf-dist/doc/support/wintools/pdftohtml.pdf\nshare/texlive/tlpkg/dviout/par/PKfont.par\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/file241b.p98\nshare/texlive/texmf-dist/doc/support/wintools/fc-cache.pdf\nshare/texlive/tlpkg/dviout/DOC/fpage.bmp\nshare/texlive/tlpkg/dviout/par/p4to1e0.pgm\nshare/texlive/texmf-dist/doc/support/wintools/fc-match.pdf\nshare/texlive/bin/win32/tlaunch.exe\nshare/texlive/tlpkg/dviout/DOC/dviouttips.html\nshare/texlive/tlpkg/dviout/UTILITY/test_b5e.tex\nshare/texlive/texmf-dist/doc/support/wintools/pdfimages.pdf\nshare/texlive/tlpkg/dviout/GRAPHIC/TPIC/linetest.tex\nshare/texlive/tlpkg/dviout/UTILITY/dvioute.vfn\nshare/texlive/tlpkg/dviout/DOC/dvioutQA.html\nshare/texlive/bin/win32/bitmap2eps.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/LATEX2E/dviout.ins\nshare/texlive/texmf-dist/doc/support/wintools/fc-scan.pdf\nshare/texlive/tlpkg/dviout/UTILITY/template\nshare/texlive/bin/win32/pdffonts.exe\nshare/texlive/tlpkg/dviout/par/p4n0.pgm\nshare/texlive/tlpkg/dviout/install.par\nshare/texlive/texmf-dist/scripts/bitmap2eps/bitmap2eps.vbs\nshare/texlive/texmf-dist/doc/support/wintools/pdftops.pdf\nshare/texlive/tlpkg/dviout/GRAPHIC/LATEX2E/color.cfg\nshare/texlive/tlpkg/dviout/map/morisawa.map\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/spec.lp3\nshare/texlive/tlpkg/dviout/SAMPLE/slisampl.tex\nshare/texlive/bin/win32/bmeps.exe\nshare/texlive/tlpkg/dviout/DOC/tex_instchk.html\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/gssub.exe\nshare/texlive/tlpkg/dviout/SPECIAL/srctex.cfg\nshare/texlive/texmf-dist/doc/support/wintools/pdftocairo.pdf\nshare/texlive/tlpkg/dviout/DOC/hyper.bmp\nshare/texlive/tlpkg/dviout/par/HG-KaiSho-PRO.par\nshare/texlive/tlpkg/dviout/DOC/present.html\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/epsfdoc.tex\nshare/texlive/tlpkg/dviout/DOC/testtex.bat\nshare/texlive/tlpkg/dviout/par/p4to10.pgm\nshare/texlive/texmf-dist/web2c/tlaunch.ini\nshare/texlive/tlpkg/dviout/GRAPHIC/bmc/bmc.txt\nshare/texlive/tlpkg/dviout/SAMPLE/sample.txt\nshare/texlive/texmf-dist/doc/support/tlaunch/Changes\nshare/texlive/bin/win32/pdfseparate.exe\nshare/texlive/bin/win32/pdfimages.exe\nshare/texlive/tlpkg/dviout/readme.txt\nshare/texlive/bin/win32/pdfsig.exe\nshare/texlive/tlpkg/dviout/HYPERTEX/input9.tex\nshare/texlive/tlpkg/dviout/GRAPHIC/LATEX2E/readme\nshare/texlive/tlpkg/dviout/DOC/mspmin.png\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/picbox.tex\nshare/texlive/tlpkg/dviout/history.txt\nshare/texlive/tlpkg/dviout/DOC/kappa.bmp\nshare/texlive/tlpkg/dviout/UTILITY/template.pks\nshare/texlive/tlpkg/dviout/SPECIAL/presen.sty\nshare/texlive/tlpkg/dviout/rawprt.exe\nshare/texlive/bin/win32/pdftops.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/bmc/createbb.pdf\nshare/texlive/tlpkg/dviout/map/gtfonts.map\nshare/texlive/texmf-dist/doc/support/tlaunch/README\nshare/texlive/tlpkg/dviout/DOC/le.bmp\nshare/texlive/tlpkg/dviout/CFG/prtsrc.zip\nshare/texlive/tlpkg/dviout/00readme.txt\nshare/texlive/bin/win32/todos.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/bmc/ifbmc.spi\nshare/texlive/tlpkg/dviout/UTILITY/test_org.tex\nshare/texlive/tlpkg/dviout/UTILITY/dviout1.vfn\nshare/texlive/tlpkg/dviout/map/mojikyo.map\nshare/texlive/bin/win32/aftopl.exe\nshare/texlive/bin/win32/png2bmp.exe\nshare/texlive/bin/win32/unzip.exe\nshare/texlive/tlpkg/dviout/dvispce.txt\nshare/texlive/tlpkg/dviout/par/WinShell.par\nshare/texlive/tlpkg/dviout/HYPERTEX/hyperdvi.tex\nshare/texlive/bin/win32/zip.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/lips3.gpd\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/pssample.tex\nshare/texlive/tlpkg/dviout/UTILITY/template.pk0\nshare/texlive/tlpkg/dviout/par/dvicut.par\nshare/texlive/tlpkg/dviout/par/dvipdfmr.par\nshare/texlive/tlpkg/dviout/propw.exe\nshare/texlive/bin/win32/djpeg.exe\nshare/texlive/texmf-dist/doc/support/wintools/fc-list.pdf\nshare/texlive/tlpkg/dviout/par/EJ-Embed.par\nshare/texlive/tlpkg/dviout/par/J-Embed.par\nshare/texlive/tlpkg/dviout/install.txt\nshare/texlive/tlpkg/dviout/par/fontpath.par\nshare/texlive/tlpkg/dviout/FONT/exjfonts.zip\nshare/texlive/tlpkg/dviout/SPECIAL/srcspecial.mac\nshare/texlive/tlpkg/dviout/par/E-noTT.par\nshare/texlive/tlpkg/dviout/DOC/dvi2.bmp\nshare/texlive/tlpkg/dviout/CFG/prtcfg.zip\nshare/texlive/tlpkg/dviout/dvispc.txt\nshare/texlive/texmf-dist/doc/support/wintools/pdfinfo.pdf\nshare/texlive/bin/win32/dviout.exe\nshare/texlive/tlpkg/dviout/map/ttfexp.map\nshare/texlive/bin/win32/gunzip.exe\nshare/texlive/tlpkg/dviout/par/dvipdfmxv.par\nshare/texlive/tlpkg/dviout/DOC/bpage.bmp\nshare/texlive/tlpkg/dviout/DOC/lplus.bmp\nshare/texlive/tlpkg/dviout/HYPERTEX/input8.tex\nshare/texlive/texmf-dist/doc/support/wintools/unzip.pdf\nshare/texlive/tlpkg/dviout/DOC/tex_dvioutw.html\nshare/texlive/bin/win32/tlaunchmode.exe\nshare/texlive/tlpkg/dviout/FONT/ReadMe.txt\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/sample2.ps\nshare/texlive/tlpkg/dviout/GRAPHIC/bmc/exbmc.xpi\nshare/texlive/tlpkg/dviout/par/Macro0.par\nshare/texlive/tlpkg/dviout/par/hiragino.par\nshare/texlive/tlpkg/dviout/par/default.par\nshare/texlive/bin/win32/pdfunite.exe\nshare/texlive/tlpkg/dviout/par/E-TT.par\nshare/texlive/tlpkg/dviout/CFG/newcfg.txt\nshare/texlive/tlpkg/dviout/par/p4to1o0.pgm\nshare/texlive/tlpkg/dviout/optcfg.exe\nshare/texlive/tlpkg/dviout/DOC/hung.png\nshare/texlive/tlpkg/dviout/srctex.exe\nshare/texlive/tlpkg/dviout/DOC/option.bmp\nshare/texlive/tlpkg/dviout/dviadd.exe\nshare/texlive/texmf-dist/doc/support/tlaunch/tlaunch.pdf\nshare/texlive/tlpkg/dviout/par/jvar.par\nshare/texlive/tlpkg/dviout/par/wintex.par\nshare/texlive/tlpkg/dviout/par/bakoma.par\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/sample3.ps\nshare/texlive/tlpkg/dviout/HYPERTEX/inputxy.tex\nshare/texlive/tlpkg/dviout/SPECIAL/dviout.sty\nshare/texlive/tlpkg/dviout/etfdump.exe\nshare/texlive/texmf-dist/doc/support/tlaunch/figures/custom_ed.png\nshare/texlive/tlpkg/dviout/par/E-Embed.par\nshare/texlive/tlpkg/dviout/par/dvispcat.par\nshare/texlive/bin/win32/bmp2png.exe\nshare/texlive/tlpkg/dviout/DOC/search.bmp\nshare/texlive/tlpkg/dviout/GRAPHIC/PS/sample0.ps\nshare/texlive/tlpkg/dviout/SAMPLE/slisamp3.tex\nshare/texlive/tlpkg/dviout/dvioute.chm\nshare/texlive/tlpkg/dviout/map/pttfonts.map\nshare/texlive/tlpkg/dviout/GRAPHIC/TPIC/tpic_ext.doc\nshare/texlive/tlpkg/dviout/par/WinJFont.par\nshare/texlive/tlpkg/dviout/DOC/newmin.png\nshare/texlive/tlpkg/dviout/par/p4to1v.pgm\nshare/texlive/tlpkg/dviout/par/dvipskdis.par\nshare/texlive/tlpkg/dviout/dviout.chm\nshare/texlive/tlpkg/dviout/dvioute.cnt\nshare/texlive/tlpkg/dviout/map/japanese.map\nshare/texlive/tlpkg/dviout/GRAPHIC/TPIC/rtexampl.tex\nshare/texlive/tlpkg/dviout/DOC/dvi.html\nshare/texlive/tlpkg/dviout/HYPERTEX/myhyper.sty\nshare/texlive/tlpkg/dviout/dviout.exe\nshare/texlive/tlpkg/dviout/rawprt.txt\nshare/texlive/texmf-dist/doc/support/wintools/pdfunite.pdf\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/lasersys.tex\nshare/texlive/bin/win32/jbig2.exe\nshare/texlive/tlpkg/dviout/PTEX/naochan!.tex\nshare/texlive/tlpkg/dviout/par/dvipskpdf.par\nshare/texlive/texmf-dist/doc/support/tlaunch/rug.zip\nshare/texlive/tlpkg/dviout/par/p24wait.pgm\nshare/texlive/bin/win32/cjpeg.exe\nshare/texlive/tlpkg/dviout/par/p4to1o.pgm\nshare/texlive/tlpkg/dviout/par/dvipsk.par\nshare/texlive/texmf-dist/doc/support/tlaunch/COPYING\nshare/texlive/tlpkg/dviout/DOC/print.bmp\nshare/texlive/tlpkg/dviout/par/p4n.pgm\nshare/texlive/tlpkg/dviout/par/dvipdfm.par\nshare/texlive/tlpkg/dviout/par/quitpresen.par\nshare/texlive/tlpkg/dviout/GRAPHIC/LATEX2E/graphics.cfg\nshare/texlive/texmf-dist/doc/support/wintools/fc-validate.pdf\nshare/texlive/tlpkg/dviout/GRAPHIC/LATEX2E/readme.eng\nshare/texlive/tlpkg/dviout/GRAPHIC/bmc/ifbmc.txt\nshare/texlive/bin/win32/tounix.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/PDL/spec.tex\nshare/texlive/tlpkg/dviout/HYPERTEX/input7.tex\nshare/texlive/texmf-dist/doc/support/wintools/pdffonts.pdf\nshare/texlive/tlpkg/dviout/DOC/serd.bmp\nshare/texlive/texmf-dist/doc/support/wintools/fc-cat.pdf\nshare/texlive/tlpkg/dviout/HYPERTEX/keyin.sty\nshare/texlive/tlpkg/dviout/chkfont.txt\nshare/texlive/tlpkg/dviout/map/ttfonts.map\nshare/texlive/bin/win32/pdftoppm.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/LATEX2E/dviout.def\nshare/texlive/tlpkg/dviout/par/quit.par\nshare/texlive/tlpkg/dviout/gen_pk\nshare/texlive/tlpkg/dviout/files.txt\nshare/texlive/tlpkg/dviout/dvispc.exe\nshare/texlive/bin/win32/pdfinfo.exe\nshare/texlive/tlpkg/dviout/par/dvispcal.par\nshare/texlive/tlpkg/dviout/par/texhelp.par\nshare/texlive/texmf-dist/doc/support/wintools/pdftotext.pdf\nshare/texlive/texmf-dist/doc/support/wintools/gzip.pdf\nshare/texlive/texmf-dist/doc/support/wintools/pdfsig.pdf\nshare/texlive/tlpkg/dviout/HYPERTEX/hyper2.tex\nshare/texlive/bin/win32/pdftocairo.exe\nshare/texlive/tlpkg/dviout/SAMPLE/sample.tex\nshare/texlive/tlpkg/dviout/par/dvipskprn.par\nshare/texlive/tlpkg/dviout/UTILITY/dviout0.par\nshare/texlive/tlpkg/dviout/SPECIAL/ophook.sty\nshare/texlive/tlpkg/dviout/par/dvispcap.par\nshare/texlive/tlpkg/dviout/SPECIAL/presen.txt\nshare/texlive/bin/win32/pdfdetach.exe\nshare/texlive/tlpkg/dviout/par/presen.par\nshare/texlive/tlpkg/dviout/par/dvispcs.par\nshare/texlive/tlpkg/dviout/UTILITY/test_a4.tex\nshare/texlive/tlpkg/dviout/DOC/cmode3.png\nshare/texlive/tlpkg/dviout/par/dvipskeps.par\nshare/texlive/tlpkg/dviout/HYPERTEX/input.tex\nshare/texlive/tlpkg/dviout/chkfont.exe\nshare/texlive/tlpkg/dviout/ttindex.exe\nshare/texlive/tlpkg/dviout/GRAPHIC/PBM/pbmf.doc\nshare/texlive/tlpkg/dviout/UTILITY/null.vfn\nshare/texlive/texmf-dist/doc/support/tlaunch/tlaunch.tex\nshare/texlive/bin/win32/pdftohtml.exe\nshare/texlive/tlpkg/dviout/par/dvipdfms.par\nshare/texlive/tlpkg/dviout/UTILITY/dvi$pdf.bat\nshare/texlive/bin/win32/texview.exe\nshare/texlive/tlpkg/dviout/UTILITY/dviout0.vfn\nshare/texlive/bin/win32/sam2p.exe\nshare/texlive/tlpkg/dviout/propw0.txt'\n"
  },
  {
    "path": "packages/texlive/check_for_conflicts.py",
    "content": "#!/usr/bin/python3\n##\n##  Tiny script to check if all texlive's subpackages contain conflicting files\n##\n##  Copyright (C) 2019 Henrik Grimler\n##\n##  This program is free software: you can redistribute it and/or modify\n##  it under the terms of the GNU General Public License as published by\n##  the Free Software Foundation, either version 3 of the License, or\n##  (at your option) any later version.\n##\n##  This program is distributed in the hope that it will be useful,\n##  but WITHOUT ANY WARRANTY; without even the implied warranty of\n##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n##  GNU General Public License for more details.\n##\n##  You should have received a copy of the GNU General Public License\n##  along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\n\nwith open(\"collections.txt\", \"r\") as f:\n    pkgs = f.read().split(\"\\n\")\n\nfiles = {}\nfor pkg in pkgs:\n    if pkg:\n        with open(\"collection-\"+pkg+\".txt\", \"r\") as f:\n            files[pkg] = f.readlines()\n\nl = len(pkgs)-1\nfor i in range(0,l):\n    for k in range(i+1,l):\n        Diff = set(files[pkgs[i]]).intersection(files[pkgs[k]])\n        if Diff:\n            print(\"\\n\"+pkgs[i]+\" \"+pkgs[k])\n            print(Diff)\n"
  },
  {
    "path": "packages/texlive/fmtutil.cnf.patch",
    "content": "--- ./texmf-dist/web2c/fmtutil.cnf.orig\t2019-03-23 02:25:33.000000000 +0100\n+++ ./texmf-dist/web2c/fmtutil.cnf\t2019-11-16 23:15:23.708911302 +0100\n@@ -39,7 +39,7 @@\n #\n # from aleph:\n aleph aleph - *aleph.ini\n-lamed aleph language.dat *lambda.ini\n+#! lamed aleph language.dat *lambda.ini\n #\n # from amstex:\n amstex pdftex - -translate-file=cp227.tcx *amstex.ini\n@@ -64,11 +64,11 @@\n pdfcsplain luatex - -etex csplain.ini\n #\n # from eplain:\n-eplain pdftex language.dat -translate-file=cp227.tcx *eplain.ini\n+#! eplain pdftex language.dat -translate-file=cp227.tcx *eplain.ini\n #\n # from jadetex:\n-jadetex pdftex language.dat *jadetex.ini\n-pdfjadetex pdftex language.dat *pdfjadetex.ini\n+#! jadetex pdftex language.dat *jadetex.ini\n+#! pdfjadetex pdftex language.dat *pdfjadetex.ini\n #\n # from latex-bin:\n latex pdftex language.dat -translate-file=cp227.tcx *latex.ini\n@@ -83,7 +83,7 @@\n # from luatex:\n luatex luatex language.def,language.dat.lua luatex.ini\n dviluatex luatex language.def,language.dat.lua dviluatex.ini\n-luajittex luajittex language.def,language.dat.lua luatex.ini\n+#! luajittex luajittex language.def,language.dat.lua luatex.ini\n #\n # from metafont:\n mf mf-nowin - -translate-file=cp227.tcx mf.ini\n@@ -109,11 +109,11 @@\n pdfetex pdftex language.def -translate-file=cp227.tcx *pdfetex.ini\n #\n # from platex:\n-platex eptex language.dat *platex.ini\n+#! platex eptex language.dat *platex.ini\n #\n # from ptex:\n ptex ptex - ptex.ini\n-eptex eptex language.def *eptex.ini\n+#! eptex eptex language.def *eptex.ini\n #\n # from tex:\n tex tex - tex.ini\n@@ -122,16 +122,16 @@\n texsis pdftex - -translate-file=cp227.tcx texsis.ini\n #\n # from uplatex:\n-uplatex euptex language.dat *uplatex.ini\n+#! uplatex euptex language.dat *uplatex.ini\n #\n # from uptex:\n uptex uptex - uptex.ini\n-euptex euptex language.def *euptex.ini\n+#! euptex euptex language.def *euptex.ini\n #\n # from xetex:\n xetex xetex language.def -etex xetex.ini\n xelatex xetex language.dat -etex xelatex.ini\n #\n # from xmltex:\n-xmltex pdftex language.dat *xmltex.ini\n-pdfxmltex pdftex language.dat *pdfxmltex.ini\n+#! xmltex pdftex language.dat *xmltex.ini\n+#! pdfxmltex pdftex language.dat *pdfxmltex.ini\n"
  },
  {
    "path": "packages/texlive/parse_tlpdb.py",
    "content": "#!/usr/bin/python3\n##\n##  Script to parse texlive.tlpdb and get list of files in a package\n##\n##  Copyright (C) 2019 Henrik Grimler\n##\n##  This program is free software: you can redistribute it and/or modify\n##  it under the terms of the GNU General Public License as published by\n##  the Free Software Foundation, either version 3 of the License, or\n##  (at your option) any later version.\n##\n##  This program is distributed in the hope that it will be useful,\n##  but WITHOUT ANY WARRANTY; without even the implied warranty of\n##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n##  GNU General Public License for more details.\n##\n##  You should have received a copy of the GNU General Public License\n##  along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\ndef parse_tlpdb_to_dict(tlpdb_path):\n    \"\"\"Reads given tlpdb database and creates dict with packages and their dependencies and files\n    \"\"\"\n\n    with open(tlpdb_path, \"r\") as f:\n        packages = f.read().split(\"\\n\\n\")\n\n    pkg_dict = {}\n    for pkg in packages:\n        if not pkg == \"\":\n            pkg_lines = pkg.split(\"\\n\")\n            pkg_name = pkg_lines[0].split(\" \")[1]\n            # We only care about getting all the files so only check for \"depend\" and files\n            pkg_dict[pkg_name] = {\"depends\" : [], \"files\" : []}\n            for line in pkg_lines:\n                line_description = line.split(\" \")[0]\n                if line_description == \"\":\n                    pkg_dict[pkg_name][\"files\"].append(line.split(\" \")[1])\n                elif line_description == \"depend\":\n                    pkg_dict[pkg_name][\"depends\"].append(line.split(\" \")[1])\n    return pkg_dict\n\ndef get_files_in_package(package, files_in_package, visited_pkgs, visit_collections=False):\n    \"\"\"Prints files in package and then run itself on each dependency. Doesn't visit collections unless argument visit_collections=True is passed.\n    \"\"\"\n    for f in pkg_dict[package][\"files\"]:\n        files_in_package.append(f)\n    for dep in pkg_dict[package][\"depends\"]:\n        # skip arch dependent packages, which we lack since we build our own binaries:\n        if not dep.split(\".\")[-1] == \"ARCH\":\n            # skip collections unless explicitly told to go through them\n            if not dep.split(\"-\")[0] == \"collection\" or visit_collections:\n                # avoid duplicates:\n                if not dep in visited_pkgs:\n                    visited_pkgs.append(dep)\n                    files_in_package, visited_pkgs = get_files_in_package(dep, files_in_package, visited_pkgs)\n    return files_in_package, visited_pkgs\n\ndef Files(*args, **kwargs):\n    \"\"\"Wrapper around function get_files. Prepends \"collection-\" to package unless prepend_collection=False is passed. Also uses visit_collections=False per default.\n    \"\"\"\n    prefix = \"collection-\"\n    bool_visit_collections = False\n    for k,v in kwargs.items():\n        if k == \"prepend_collection\" and not v:\n            prefix = \"\"\n        elif k == \"visit_collections\" and v:\n            bool_visit_collections = True\n\n    files = []\n    for pkg in args[0]:\n        files += get_files_in_package(prefix+pkg, [], [], visit_collections=bool_visit_collections)[0]\n    return files\n\ndef get_conflicting_pkgs(package):\n    \"\"\"Returns list of packages that contain some files that are also found in 'package'.\n    These packages should be listed as dependencies.\n    \"\"\"\n    if package in [\"basic\", \"fontsrecommended\", \"games\", \"luatex\",\n                   \"music\", \"plaingeneric\", \"publishers\", \"texworks\", \"wintools\"]:\n        return []\n    elif package in [\"latex\", \"langeuropean\", \"langenglish\", \"langfrench\",\n                     \"langgerman\", \"binextra\", \"fontutils\", \"langarabic\",\n                     \"langgreek\", \"langitalian\", \"langother\", \"langpolish\",\n                     \"langportuguese\", \"langspanish\", \"metapost\"]:\n        return [\"basic\"]\n    elif package == \"langczechslovak\":\n        return [\"basic\", \"latex\", \"fontsextra\", \"luatex\"]\n    elif package == \"langcyrillic\":\n        return [\"basic\", \"latex\", \"fontsextra\", \"fontsrecommended\",\n                \"langgreek\", \"latexrecommended\"]\n    elif package == \"formatsextra\":\n        return [\"basic\", \"latex\", \"langcyrillic\", \"mathscience\",\n                \"fontsrecommended\", \"plaingeneric\"]\n    elif package == \"context\":\n        return [\"basic\", \"latex\", \"mathscience\", \"fontsrecommended\",\n                \"metapost\", \"xetex\"]\n    elif package == \"langjapanese\":\n        return [\"basic\", \"latex\", \"langcjk\", \"langchinese\"]\n    elif package == \"langchinese\":\n        return [\"basic\", \"langcjk\", \"fontutils\"]\n    elif package == \"bibtexextra\":\n        return [\"basic\", \"binextra\"]\n    elif package == \"langcjk\":\n        return [\"basic\", \"langother\"]\n    elif package == \"latexrecommended\":\n        return [\"basic\", \"fontsrecommended\", \"latexextra\", \"pictures\", \"plaingeneric\"]\n    elif package == \"mathscience\":\n        return [\"basic\", \"langgreek\"]\n    elif package == \"langkorean\":\n        return [\"langjapanese\", \"langcjk\", \"latexrecommended\"]\n    elif package == \"latexextra\":\n        return [\"fontsextra\"]\n    elif package == \"humanities\":\n        return [\"latexextra\"]\n    elif package == \"pictures\":\n        return [\"latexextra\"]\n    elif package == \"fontsextra\":\n        return [\"plaingeneric\"]\n    elif package == \"pstricks\":\n        return [\"plaingeneric\"]\n    elif package == \"xetex\":\n        return [\"latex\"]\n    else:\n        raise ValueError(sys.argv[1]+\" isn't a known package name\")\n\n\nimport sys\ntlpdb = sys.argv[2]\npkg_dict = parse_tlpdb_to_dict(tlpdb)\n\nif len(sys.argv) > 2 and sys.argv[-1] == \"print_names\":\n    \"\"\"Generate dependencies to put into TERMUX_SUBPKG_DEPENDS\"\"\"\n    # Strip latex, basic, dehyph-exptl and hyphen-afrikaans since those are part of termux package \"texlive\"\n    pkgs_in_texlive = [\"latex\", \"basic\", \"dehyph-exptl\", \"hyphen-afrikaans\"]\n    dependencies = [\"texlive-\"+pkg for pkg in get_conflicting_pkgs(sys.argv[1]) if not pkg in pkgs_in_texlive]\n    if len(dependencies) > 0:\n        print(\"texlive, \"+\", \".join(dependencies))\n    else:\n        print(\"texlive\")\nelse:\n    \"\"\"Print files which should be included in the subpackage\"\"\"\n    print(\"\\n\".join([\"share/texlive/\"+line for line in\n                     list( set(Files([sys.argv[1]])) - set(Files(get_conflicting_pkgs(sys.argv[1]))) )]))\n"
  },
  {
    "path": "packages/texlive/texlive-bibtexextra.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-bibtexextra\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-binextra\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py bibtexextra $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-binextra.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-binextra\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py binextra $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-context.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-context\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-mathscience, texlive-fontsrecommended, texlive-metapost, texlive-xetex\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py context $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-fontsextra.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-fontsextra\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-plaingeneric\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py fontsextra $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-fontsrecommended.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-fontsrecommended\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py fontsrecommended $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-fontutils.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-fontutils\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py fontutils $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-formatsextra.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-formatsextra\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-langcyrillic, texlive-mathscience, texlive-fontsrecommended, texlive-plaingeneric\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py formatsextra $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-full.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive-full, meta package that depends on all texlive-collections\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-binextra, texlive-context, texlive-fontsextra, texlive-fontsrecommended, texlive-fontutils, texlive-formatsextra, texlive-games, texlive-humanities, texlive-langarabic, texlive-langchinese, texlive-langcjk, texlive-langcyrillic, texlive-langczechslovak, texlive-langenglish, texlive-langeuropean, texlive-langfrench, texlive-langgerman, texlive-langgreek, texlive-langitalian, texlive-langjapanese, texlive-langkorean, texlive-langother, texlive-langpolish, texlive-langportuguese, texlive-langspanish, texlive-latexextra, texlive-latexrecommended, texlive-luatex, texlive-mathscience, texlive-metapost, texlive-music, texlive-pictures, texlive-plaingeneric, texlive-pstricks, texlive-publishers, texlive-xetex\"\nTERMUX_SUBPKG_CONFLICTS=\"texlive-tlmgr\"\nTERMUX_SUBPKG_INCLUDE=\"share/texlive/tlpkg/texlive.tlpdb\"\n"
  },
  {
    "path": "packages/texlive/texlive-games.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-games\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py games $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-humanities.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-humanities\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-latexextra\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py humanities $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langarabic.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langarabic\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langarabic $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langchinese.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langchinese\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-langcjk, texlive-fontutils\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langchinese $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langcjk.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langcjk\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-langother\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langcjk $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langcyrillic.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langcyrillic\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-fontsextra, texlive-fontsrecommended, texlive-langgreek, texlive-latexrecommended\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langcyrillic $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langczechslovak.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langczechslovak\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-fontsextra, texlive-luatex\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langczechslovak $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langenglish.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langenglish\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langenglish $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langeuropean.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langeuropean\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langeuropean $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langfrench.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langfrench\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langfrench $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langgerman.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langgerman\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langgerman $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langgreek.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langgreek\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langgreek $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langitalian.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langitalian\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langitalian $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langjapanese.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langjapanese\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-langcjk, texlive-langchinese\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langjapanese $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langkorean.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langkorean\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-langjapanese, texlive-langcjk, texlive-latexrecommended\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langkorean $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langother.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langother\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langother $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langpolish.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langpolish\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langpolish $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langportuguese.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langportuguese\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langportuguese $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-langspanish.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-langspanish\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py langspanish $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-latexextra.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-latexextra\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-fontsextra\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py latexextra $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-latexrecommended.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-latexrecommended\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-fontsrecommended, texlive-latexextra, texlive-pictures, texlive-plaingeneric\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py latexrecommended $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-luatex.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-luatex\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py luatex $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-mathscience.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-mathscience\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-langgreek\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py mathscience $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-metapost.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-metapost\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py metapost $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-music.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-music\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py music $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-pictures.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-pictures\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-latexextra\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py pictures $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-plaingeneric.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-plaingeneric\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py plaingeneric $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-pstricks.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-pstricks\"\nTERMUX_SUBPKG_DEPENDS=\"texlive-plaingeneric\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py pstricks $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-publishers.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-publishers\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py publishers $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texlive-xetex.subpackage.sh",
    "content": "TERMUX_SUBPKG_DESCRIPTION=\"Texlive's collection-xetex\"\nTERMUX_SUBPKG_INCLUDE=$(python3 $TERMUX_SCRIPTDIR/packages/texlive/parse_tlpdb.py xetex $TERMUX_PKG_TMPDIR/texlive.tlpdb)\nTERMUX_SUBPKG_CONFLICTS=\"texlive-bin (<< 20190410), texlive (<< 20190410)\"\n"
  },
  {
    "path": "packages/texlive/texmf.cnf.patch",
    "content": "--- ./texmf-dist/web2c/texmf.cnf.orig\t2019-03-25 23:15:36.000000000 +0100\n+++ ./texmf-dist/web2c/texmf.cnf\t2019-11-16 22:20:04.812702472 +0100\n@@ -58,7 +58,7 @@\n % SELFAUTOPARENT (its grandparent = /usr/local/texlive/YYYY), and\n % SELFAUTOGRANDPARENT (its great-grandparent = /usr/local/texlive).\n % Sorry for the off-by-one-generation names.\n-TEXMFROOT = $SELFAUTOPARENT\n+TEXMFROOT = $SELFAUTODIR/share/texlive\n \n % The main tree of distributed packages and programs:\n TEXMFDIST = $TEXMFROOT/texmf-dist\n@@ -68,7 +68,7 @@\n TEXMFMAIN = $TEXMFDIST\n \n % Local additions to the distribution trees.\n-TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local\n+TEXMFLOCAL = $TEXMFROOT/texmf-local\n \n % TEXMFSYSVAR, where *-sys store cached runtime data.\n TEXMFSYSVAR = $TEXMFROOT/texmf-var\n@@ -538,6 +538,9 @@\n $SELFAUTODIR/share/texmf-local/web2c,\\\n $SELFAUTODIR/share/texmf-dist/web2c,\\\n $SELFAUTODIR/share/texmf/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf-local/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf-dist/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf/web2c,\\\n $SELFAUTODIR/texmf-local/web2c,\\\n $SELFAUTODIR/texmf-dist/web2c,\\\n $SELFAUTODIR/texmf/web2c,\\\n"
  },
  {
    "path": "packages/texlive/web2c-texmf.cnf",
    "content": "--- ../texmf.cnf.orig\t2018-04-30 17:07:05.796733785 +0000\n+++ ./texk/kpathsea/texmf.cnf\t2018-04-30 17:36:18.883441637 +0000\n@@ -58,7 +58,7 @@\n % SELFAUTOPARENT (its grandparent = /usr/local/texlive/YYYY), and\n % SELFAUTOGRANDPARENT (its great-grandparent = /usr/local/texlive).\n % Sorry for the off-by-one-generation names.\n-TEXMFROOT = $SELFAUTOPARENT\n+TEXMFROOT = $SELFAUTODIR/share/texlive\n \n % The main tree of distributed packages and programs:\n TEXMFDIST = $TEXMFROOT/texmf-dist\n@@ -68,7 +68,7 @@\n TEXMFMAIN = $TEXMFDIST\n \n % Local additions to the distribution trees.\n-TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local\n+TEXMFLOCAL = $TEXMFROOT/texmf-local\n \n % TEXMFSYSVAR, where *-sys store cached runtime data.\n TEXMFSYSVAR = $TEXMFROOT/texmf-var\n@@ -524,6 +524,9 @@\n $SELFAUTODIR/share/texmf-local/web2c,\\\n $SELFAUTODIR/share/texmf-dist/web2c,\\\n $SELFAUTODIR/share/texmf/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf-local/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf-dist/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf/web2c,\\\n $SELFAUTODIR/texmf-local/web2c,\\\n $SELFAUTODIR/texmf-dist/web2c,\\\n $SELFAUTODIR/texmf/web2c,\\\n"
  },
  {
    "path": "packages/texlive-bin/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/\nTERMUX_PKG_DESCRIPTION=\"TeX Live is a distribution of the TeX typesetting system. This package contains architecture dependent binaries.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=20190410\nTERMUX_PKG_REVISION=7\nTERMUX_PKG_SRCURL=https://github.com/TeX-Live/texlive-source/archive/build-svn50882.tar.gz\nTERMUX_PKG_SHA256=a7462f8e29163faa52ad2ac658727b60f95241449832f1a4dac8d8a406d18233\nTERMUX_PKG_DEPENDS=\"libc++, libiconv, freetype, libpng, libgd, libgmp, libmpfr, libicu, liblua, poppler, libgraphite, harfbuzz, harfbuzz-icu, teckit, libpixman, libcairo, zlib\"\n# libpcre, glib, fonconfig are dependencies to libcairo. pkg-config gives an error if they are missing\n# libuuid, libxml2 are needed by fontconfig\nTERMUX_PKG_BUILD_DEPENDS=\"icu-devtools, pcre, glib, fontconfig, libuuid, libxml2\"\nTERMUX_PKG_BREAKS=\"texlive (<< 20180414), texlive-bin-dev\"\nTERMUX_PKG_REPLACES=\"texlive (<< 20170524-3), texlive-bin-dev\"\nTERMUX_PKG_RECOMMENDS=\"texlive\"\nTERMUX_PKG_HOSTBUILD=true\n\nTL_ROOT=$TERMUX_PREFIX/share/texlive\nTL_BINDIR=$TERMUX_PREFIX/bin\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nRANLIB=ranlib\n--mandir=$TERMUX_PREFIX/share/man\n--infodir=$TERMUX_PREFIX/share/info\n--datarootdir=$TL_ROOT\n--build=$TERMUX_BUILD_TUPLE\n--enable-ttfdump=no\n--enable-makeindexk=yes\n--enable-makejvf=no\n--enable-mendexk=no\n--enable-musixtnt=no\n--enable-ps2pk=no\n--enable-seetexk=no\n--enable-gregorio=no\n--disable-native-texlive-build\n--disable-bibtexu\n--disable-dvisvgm\n--disable-dialog\n--disable-psutils\n--disable-multiplatform\n--disable-t1utils\n--enable-luatex\n--disable-luajittex\n--disable-mflua\n--disable-mfluajit\n--disable-xz\n--disable-pmx\n--without-texinfo\n--without-xdvipdfmx\n--without-texi2html\n--with-system-cairo\n--with-system-graphite2\n--with-system-harfbuzz\n--with-system-gd\n--with-system-gmp\n--with-system-icu\n--with-system-mpfr\n--with-system-poppler\n--with-system-zlib\n--with-system-xpdf\n--with-system-lua\n--with-system-teckit\n--without-x\n--with-banner-add=/Termux\"\n\n# These files are provided by texlive:\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/tlmgr\nbin/man\nshare/texlive/texmf-dist/web2c/mktex.opt\nshare/texlive/texmf-dist/web2c/mktexdir.opt\nshare/texlive/texmf-dist/web2c/mktexnam.opt\nshare/texlive/texmf-dist/web2c/fmtutil.cnf\nshare/texlive/texmf-dist/web2c/mktexdir\nshare/texlive/texmf-dist/web2c/mktexnam\nshare/texlive/texmf-dist/web2c/mktexupd\nshare/texlive/texmf-dist/web2c/texmf.cnf\nshare/texlive/texmf-dist/fonts\nshare/texlive/texmf-dist/doc\nshare/texlive/texmf-dist/dvips\nshare/texlive/texmf-dist/dvipdfmx\nshare/texlive/texmf-dist/texconfig\nshare/texlive/texmf-dist/bibtex\nshare/texlive/texmf-dist/scripts\nshare/texlive/texmf-dist/ttf2pk\nshare/texlive/texmf-dist/source\nshare/texlive/texmf-dist/chktex\nshare/texlive/texmf-dist/hbf2gf\"\n\ntermux_step_host_build() {\n\tmkdir -p auxdir/auxsub\n\tmkdir -p texk/kpathsea\n\tmkdir -p texk/web2c\n\n\tcd $TERMUX_PKG_HOSTBUILD_DIR/auxdir/auxsub\n\t$TERMUX_PKG_SRCDIR/auxdir/auxsub/configure\n\tmake\n\n\tcd $TERMUX_PKG_HOSTBUILD_DIR/texk/kpathsea\n\t$TERMUX_PKG_SRCDIR/texk/kpathsea/configure\n\n\tcd $TERMUX_PKG_HOSTBUILD_DIR/texk/web2c\n\t$TERMUX_PKG_SRCDIR/texk/web2c/configure --without-x\n\tmake tangle\n\tmake ctangle\n\tmake tie\n\tmake otangle\n}\n\ntermux_step_pre_configure() {\n\t# When building against libicu 59.1 or later we need c++11:\n\tCXXFLAGS+=\" -std=c++11\"\n\texport TANGLE=$TERMUX_PKG_HOSTBUILD_DIR/texk/web2c/tangle\n\texport TANGLEBOOT=$TERMUX_PKG_HOSTBUILD_DIR/texk/web2c/tangleboot\n\texport CTANGLE=$TERMUX_PKG_HOSTBUILD_DIR/texk/web2c/ctangle\n\texport CTANGLEBOOT=$TERMUX_PKG_HOSTBUILD_DIR/texk/web2c/ctangleboot\n\texport TIE=$TERMUX_PKG_HOSTBUILD_DIR/texk/web2c/tie\n\texport OTANGLE=$TERMUX_PKG_HOSTBUILD_DIR/texk/web2c/.libs/otangle\n\t# otangle is linked against libkpathsea but can't find it, so we use LD_LIBRARY_PATH\n\texport LD_LIBRARY_PATH=$TERMUX_PKG_HOSTBUILD_DIR/texk/kpathsea/.libs\n\n\tfind \"$TERMUX_PKG_SRCDIR\"/texk/web2c/luatexdir -type f -exec sed -i \\\n\t     -e 's|gTrue|true|g' \\\n\t     -e 's|gFalse|false|g' \\\n\t     -e 's|GBool|bool|g' \\\n\t     -e 's|getCString|c_str|g' \\\n\t     -e 's|Guint|unsigned int|g' \\\n\t     -e 's|Guchar|unsigned char|g' \\\n\t     {} +\n\n\t# These files are from upstream master:\n\tcp \"$TERMUX_PKG_BUILDER_DIR\"/pdftoepdf-poppler0.76.0.cc \"$TERMUX_PKG_SRCDIR\"/texk/web2c/pdftexdir/pdftoepdf.cc # commit 473d82b\n\tcp \"$TERMUX_PKG_BUILDER_DIR\"/pdftosrc-poppler0.76.0.cc \"$TERMUX_PKG_SRCDIR\"/texk/web2c/pdftexdir/pdftosrc.cc # commit 473d82b\n}\n"
  },
  {
    "path": "packages/texlive-bin/pdftoepdf-poppler0.76.0.cc",
    "content": "/*\nCopyright 1996-2017 Han The Thanh, <thanh@pdftex.org>\n\nThis file is part of pdfTeX.\n\npdfTeX is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\npdfTeX is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/*\nThis is based on the patch texlive-poppler-0.59.patch <2017-09-19> at\nhttps://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk\nby Arch Linux. A little modifications are made to avoid a crash for\nsome kind of pdf images, such as figure_missing.pdf in gnuplot.\nThe poppler should be 0.76.0 or newer versions.\nPOPPLER_VERSION should be defined.\n*/\n\n/* Do this early in order to avoid a conflict between\n   MINGW32 <rpcndr.h> defining 'boolean' as 'unsigned char' and\n   <kpathsea/types.h> defining Pascal's boolean as 'int'.\n*/\n#include <w2c/config.h>\n#include <kpathsea/lib.h>\n\n#include <stdlib.h>\n#include <math.h>\n#include <stddef.h>\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n\n#ifdef POPPLER_VERSION\n#include <dirent.h>\n#include <poppler-config.h>\n#include <goo/GooString.h>\n#include <goo/gmem.h>\n#include <goo/gfile.h>\n#define GString GooString\n#else\n#error POPPLER_VERSION should be defined.\n#endif\n#include <assert.h>\n\n#include \"Object.h\"\n#include \"Stream.h\"\n#include \"Array.h\"\n#include \"Dict.h\"\n#include \"XRef.h\"\n#include \"Catalog.h\"\n#include \"Link.h\"\n#include \"Page.h\"\n#include \"GfxFont.h\"\n#include \"PDFDoc.h\"\n#include \"GlobalParams.h\"\n#include \"Error.h\"\n\n// This file is mostly C and not very much C++; it's just used to interface\n// the functions of xpdf, which are written in C++.\n\nextern \"C\" {\n#include <pdftexdir/ptexmac.h>\n#include <pdftexdir/pdftex-common.h>\n\n// These functions from pdftex.web gets declared in pdftexcoerce.h in the\n// usual web2c way, but we cannot include that file here because C++\n// does not allow it.\nextern int getpdfsuppresswarningpagegroup(void);\nextern integer getpdfsuppressptexinfo(void);\nextern integer zround(double);\n}\n\n// The prefix \"PTEX\" for the PDF keys is special to pdfTeX;\n// this has been registered with Adobe by Hans Hagen.\n\n#define pdfkeyprefix \"PTEX\"\n\n#define MASK_SUPPRESS_PTEX_FULLBANNER 0x01\n#define MASK_SUPPRESS_PTEX_FILENAME   0x02\n#define MASK_SUPPRESS_PTEX_PAGENUMBER 0x04\n#define MASK_SUPPRESS_PTEX_INFODICT   0x08\n\n// When copying the Resources of the selected page, all objects are copied\n// recusively top-down. Indirect objects however are not fetched during\n// copying, but get a new object number from pdfTeX and then will be\n// appended into a linked list. Duplicates are checked and removed from the\n// list of indirect objects during appending.\n\nenum InObjType {\n    objFont,\n    objFontDesc,\n    objOther\n};\n\nstruct InObj {\n    Ref ref;                    // ref in original PDF\n    InObjType type;             // object type\n    InObj *next;                // next entry in list of indirect objects\n    int num;                    // new object number in output PDF\n    fd_entry *fd;               // pointer to /FontDescriptor object structure\n    int enc_objnum;             // Encoding for objFont\n    int written;                // has it been written to output PDF?\n};\n\nstruct UsedEncoding {\n    int enc_objnum;\n    GfxFont *font;\n    UsedEncoding *next;\n};\n\nstatic InObj *inObjList;\nstatic UsedEncoding *encodingList;\nstatic bool isInit = false;\n\n// --------------------------------------------------------------------\n// Maintain list of open embedded PDF files\n// --------------------------------------------------------------------\n\nstruct PdfDocument {\n    char *file_name;\n    PDFDoc *doc;\n    XRef *xref;\n    InObj *inObjList;\n    int occurences;             // number of references to the document; the doc can be\n    // deleted when this is negative\n    PdfDocument *next;\n};\n\nstatic PdfDocument *pdfDocuments = 0;\n\nstatic XRef *xref = 0;\n\n// Returns pointer to PdfDocument record for PDF file.\n// Creates a new record if it doesn't exist yet.\n// xref is made current for the document.\n\nstatic PdfDocument *find_add_document(char *file_name)\n{\n    PdfDocument *p = pdfDocuments;\n    while (p && strcmp(p->file_name, file_name) != 0)\n        p = p->next;\n    if (p) {\n        xref = p->xref;\n        (p->occurences)++;\n        return p;\n    }\n    p = new PdfDocument;\n    p->file_name = xstrdup(file_name);\n    p->xref = xref = 0;\n    p->occurences = 0;\n    GString *docName = new GString(p->file_name);\n    p->doc = new PDFDoc(docName);       // takes ownership of docName\n    if (!p->doc->isOk() || !p->doc->okToPrint()) {\n        pdftex_fail(\"xpdf: reading PDF image failed\");\n    }\n    p->inObjList = 0;\n    p->next = pdfDocuments;\n    pdfDocuments = p;\n    return p;\n}\n\n// Deallocate a PdfDocument with all its resources\n\nstatic void delete_document(PdfDocument * pdf_doc)\n{\n    PdfDocument **p = &pdfDocuments;\n    while (*p && *p != pdf_doc)\n        p = &((*p)->next);\n    // should not happen:\n    if (!*p)\n        return;\n    // unlink from list\n    *p = pdf_doc->next;\n    // free pdf_doc's resources\n    InObj *r, *n;\n    for (r = pdf_doc->inObjList; r != 0; r = n) {\n        n = r->next;\n        delete r;\n    }\n    xref = pdf_doc->xref;\n    delete pdf_doc->doc;\n    xfree(pdf_doc->file_name);\n    delete pdf_doc;\n}\n\n// --------------------------------------------------------------------\n\nstatic int addEncoding(GfxFont * gfont)\n{\n    UsedEncoding *n;\n    n = new UsedEncoding;\n    n->next = encodingList;\n    encodingList = n;\n    n->font = gfont;\n    n->enc_objnum = pdfnewobjnum();\n    return n->enc_objnum;\n}\n\n#define addFont(ref, fd, enc_objnum) \\\n        addInObj(objFont, ref, fd, enc_objnum)\n\n// addFontDesc is only used to avoid writing the original FontDescriptor\n// from the PDF file.\n\n#define addFontDesc(ref, fd) \\\n        addInObj(objFontDesc, ref, fd, 0)\n\n#define addOther(ref) \\\n        addInObj(objOther, ref, 0, 0)\n\nstatic int addInObj(InObjType type, Ref ref, fd_entry * fd, int e)\n{\n    InObj *p, *q, *n = new InObj;\n    if (ref.num == 0)\n        pdftex_fail(\"PDF inclusion: invalid reference\");\n    n->ref = ref;\n    n->type = type;\n    n->next = 0;\n    n->fd = fd;\n    n->enc_objnum = e;\n    n->written = 0;\n    if (inObjList == 0)\n        inObjList = n;\n    else {\n        for (p = inObjList; p != 0; p = p->next) {\n            if (p->ref.num == ref.num && p->ref.gen == ref.gen) {\n                delete n;\n                return p->num;\n            }\n            q = p;\n        }\n        // it is important to add new objects at the end of the list,\n        // because new objects are being added while the list is being\n        // written out.\n        q->next = n;\n    }\n    if (type == objFontDesc)\n        n->num = get_fd_objnum(fd);\n    else\n        n->num = pdfnewobjnum();\n    return n->num;\n}\n\n#if 0 /* unusewd */\nstatic int getNewObjectNumber(Ref ref)\n{\n    InObj *p;\n    if (inObjList == 0) {\n        pdftex_fail(\"No objects copied yet\");\n    } else {\n        for (p = inObjList; p != 0; p = p->next) {\n            if (p->ref.num == ref.num && p->ref.gen == ref.gen) {\n                return p->num;\n            }\n        }\n        pdftex_fail(\"Object not yet copied: %i %i\", ref.num, ref.gen);\n    }\n#ifdef _MSC_VER\n    /* Never reached, but without __attribute__((noreturn)) for pdftex_fail()\n       MSVC 5.0 requires an int return value.  */\n    return -60000;\n#endif\n}\n#endif\n\nstatic void copyObject(Object *);\n\nstatic void copyName(char *s)\n{\n    pdf_puts(\"/\");\n    for (; *s != 0; s++) {\n        if (isdigit(*s) || isupper(*s) || islower(*s) || *s == '_' ||\n            *s == '.' || *s == '-' || *s == '+')\n            pdfout(*s);\n        else\n            pdf_printf(\"#%.2X\", *s & 0xFF);\n    }\n}\n\nstatic void copyDictEntry(Object * obj, int i)\n{\n    Object obj1;\n    copyName((char *)obj->dictGetKey(i));\n    pdf_puts(\" \");\n    obj1 = obj->dictGetValNF(i).copy();\n    copyObject(&obj1);\n    pdf_puts(\"\\n\");\n}\n\nstatic void copyDict(Object * obj)\n{\n    int i, l;\n    if (!obj->isDict())\n        pdftex_fail(\"PDF inclusion: invalid dict type <%s>\",\n                    obj->getTypeName());\n    for (i = 0, l = obj->dictGetLength(); i < l; ++i)\n        copyDictEntry(obj, i);\n}\n\nstatic void copyFontDict(Object * obj, InObj * r)\n{\n    int i, l;\n    char *key;\n    if (!obj->isDict())\n        pdftex_fail(\"PDF inclusion: invalid dict type <%s>\",\n                    obj->getTypeName());\n    pdf_puts(\"<<\\n\");\n    assert(r->type == objFont); // FontDescriptor is in fd_tree\n    for (i = 0, l = obj->dictGetLength(); i < l; ++i) {\n        key = (char *)obj->dictGetKey(i);\n        if (strncmp(\"FontDescriptor\", key, strlen(\"FontDescriptor\")) == 0\n            || strncmp(\"BaseFont\", key, strlen(\"BaseFont\")) == 0\n            || strncmp(\"Encoding\", key, strlen(\"Encoding\")) == 0)\n            continue;           // skip original values\n        copyDictEntry(obj, i);\n    }\n    // write new FontDescriptor, BaseFont, and Encoding\n    pdf_printf(\"/FontDescriptor %d 0 R\\n\", get_fd_objnum(r->fd));\n    pdf_printf(\"/BaseFont %d 0 R\\n\", get_fn_objnum(r->fd));\n    pdf_printf(\"/Encoding %d 0 R\\n\", r->enc_objnum);\n    pdf_puts(\">>\");\n}\n\nstatic void copyStream(Stream * str)\n{\n    int c, c2 = 0;\n    str->reset();\n    while ((c = str->getChar()) != EOF) {\n        pdfout(c);\n        c2 = c;\n    }\n    pdflastbyte = c2;\n}\n\nstatic void copyProcSet(Object * obj)\n{\n    int i, l;\n    Object procset;\n    if (!obj->isArray())\n        pdftex_fail(\"PDF inclusion: invalid ProcSet array type <%s>\",\n                    obj->getTypeName());\n    pdf_puts(\"/ProcSet [ \");\n    for (i = 0, l = obj->arrayGetLength(); i < l; ++i) {\n        procset = obj->arrayGetNF(i).copy();\n        if (!procset.isName())\n            pdftex_fail(\"PDF inclusion: invalid ProcSet entry type <%s>\",\n                        procset.getTypeName());\n        copyName((char *)procset.getName());\n        pdf_puts(\" \");\n    }\n    pdf_puts(\"]\\n\");\n}\n\n#define REPLACE_TYPE1C true\n\nstatic bool embeddableFont(Object * fontdesc)\n{\n    Object fontfile, ffsubtype;\n\n    if (!fontdesc->isDict())\n        return false;\n    fontfile = fontdesc->dictLookup(\"FontFile\");\n    if (fontfile.isStream())\n        return true;\n    if (REPLACE_TYPE1C) {\n        fontfile = fontdesc->dictLookup(\"FontFile3\");\n        if (!fontfile.isStream())\n            return false;\n        ffsubtype = fontfile.streamGetDict()->lookup(\"Subtype\");\n        return ffsubtype.isName() && !strcmp(ffsubtype.getName(), \"Type1C\");\n    }\n    return false;\n}\n\nstatic void copyFont(char *tag, Object * fontRef)\n{\n    Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset,\n        stemV;\n    GfxFont *gfont;\n    fd_entry *fd;\n    fm_entry *fontmap;\n    // Check whether the font has already been embedded before analysing it.\n    InObj *p;\n    Ref ref = fontRef->getRef();\n    for (p = inObjList; p; p = p->next) {\n        if (p->ref.num == ref.num && p->ref.gen == ref.gen) {\n            copyName(tag);\n            pdf_printf(\" %d 0 R \", p->num);\n            return;\n        }\n    }\n    // Only handle included Type1 (and Type1C) fonts; anything else will be copied.\n    // Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true.\n    fontdict = fontRef->fetch(xref);\n    fontdesc = Object(objNull);\n    if (fontdict.isDict()) {\n        subtype = fontdict.dictLookup(\"Subtype\");\n        basefont = fontdict.dictLookup(\"BaseFont\");\n        fontdescRef = fontdict.dictLookupNF(\"FontDescriptor\").copy();\n        if (fontdescRef.isRef()) {\n            fontdesc = fontdescRef.fetch(xref);\n        }\n    }\n    if (!fixedinclusioncopyfont && fontdict.isDict()\n        && subtype.isName()\n        && !strcmp(subtype.getName(), \"Type1\")\n        && basefont.isName()\n        && fontdescRef.isRef()\n        && fontdesc.isDict()\n        && embeddableFont(&fontdesc)\n        && (fontmap = lookup_fontmap((char *)basefont.getName())) != NULL) {\n        // round /StemV value, since the PDF input is a float\n        // (see Font Descriptors in PDF reference), but we only store an\n        // integer, since we don't want to change the struct.\n        stemV = fontdesc.dictLookup(\"StemV\");\n        fd = epdf_create_fontdescriptor(fontmap, zround(stemV.getNum()));\n        charset = fontdesc.dictLookup(\"CharSet\");\n        if (!charset.isNull() &&\n            charset.isString() && is_subsetable(fontmap))\n            epdf_mark_glyphs(fd, (char *)charset.getString()->c_str());\n        else\n            embed_whole_font(fd);\n        addFontDesc(fontdescRef.getRef(), fd);\n        copyName(tag);\n        gfont = GfxFont::makeFont(xref, tag, fontRef->getRef(),\n                                  fontdict.getDict());\n        pdf_printf(\" %d 0 R \", addFont(fontRef->getRef(), fd,\n                                       addEncoding(gfont)));\n    } else {\n        copyName(tag);\n        pdf_puts(\" \");\n        copyObject(fontRef);\n    }\n}\n\nstatic void copyFontResources(Object * obj)\n{\n    Object fontRef;\n    int i, l;\n    if (!obj->isDict())\n        pdftex_fail(\"PDF inclusion: invalid font resources dict type <%s>\",\n                    obj->getTypeName());\n    pdf_puts(\"/Font << \");\n    for (i = 0, l = obj->dictGetLength(); i < l; ++i) {\n        fontRef = obj->dictGetValNF(i).copy();\n        if (fontRef.isRef())\n            copyFont((char *)obj->dictGetKey(i), &fontRef);\n        else if (fontRef.isDict()) {   // some programs generate pdf with embedded font object\n            copyName((char *)obj->dictGetKey(i));\n            pdf_puts(\" \");\n            copyObject(&fontRef);\n        }\n        else\n            pdftex_fail(\"PDF inclusion: invalid font in reference type <%s>\",\n                        fontRef.getTypeName());\n    }\n    pdf_puts(\">>\\n\");\n}\n\nstatic void copyOtherResources(Object * obj, char *key)\n{\n    // copies all other resources (write_epdf handles Fonts and ProcSets),\n\n    // if Subtype is present, it must be a name\n    if (strcmp(\"Subtype\", key) == 0) {\n        if (!obj->isName()) {\n            pdftex_warn(\"PDF inclusion: Subtype in Resources dict is not a name\"\n                        \" (key '%s', type <%s>); ignored.\",\n                        key, obj->getTypeName());\n            return;\n        }\n    } else if (!obj->isDict()) {\n        //FIXME: Write the message only to the log file\n        pdftex_warn(\"PDF inclusion: invalid other resource which is no dict\"\n                    \" (key '%s', type <%s>); ignored.\",\n                    key, obj->getTypeName());\n        return;\n    }\n    copyName(key);\n    pdf_puts(\" \");\n    copyObject(obj);\n}\n\n// Function onverts double to string; very small and very large numbers\n// are NOT converted to scientific notation.\n// n must be a number or real conforming to the implementation limits\n// of PDF as specified in appendix C.1 of the PDF Ref.\n// These are:\n// maximum value of ints is +2^32\n// maximum value of reals is +2^15\n// smalles values of reals is 1/(2^16)\n\nstatic char *convertNumToPDF(double n)\n{\n    static const int precision = 6;\n    static const int fact = (int) 1E6;  // must be 10^precision\n    static const double epsilon = 0.5E-6;       // 2epsilon must be 10^-precision\n    static char buf[64];\n    // handle very small values: return 0\n    if (fabs(n) < epsilon) {\n        buf[0] = '0';\n        buf[1] = '\\0';\n    } else {\n        char ints[64];\n        int bindex = 0, sindex = 0;\n        int ival, fval;\n        // handle the sign part if n is negative\n        if (n < 0) {\n            buf[bindex++] = '-';\n            n = -n;\n        }\n        n += epsilon;           // for rounding\n        // handle the integer part, simply with sprintf\n        ival = (int) floor(n);\n        n -= ival;\n        sprintf(ints, \"%d\", ival);\n        while (ints[sindex] != 0)\n            buf[bindex++] = ints[sindex++];\n        // handle the fractional part up to 'precision' digits\n        fval = (int) floor(n * fact);\n        if (fval) {\n            // set a dot\n            buf[bindex++] = '.';\n            sindex = bindex + precision;\n            buf[sindex--] = '\\0';\n            // fill up trailing zeros with the string terminator NULL\n            while (((fval % 10) == 0) && (sindex >= bindex)) {\n                buf[sindex--] = '\\0';\n                fval /= 10;\n            }\n            // fill up the fractional part back to front\n            while (sindex >= bindex) {\n                buf[sindex--] = (fval % 10) + '0';\n                fval /= 10;\n            }\n        } else\n            buf[bindex++] = 0;\n    }\n    return (char *) buf;\n}\n\nstatic void copyObject(Object * obj)\n{\n    Object obj1;\n    int i, l, c;\n    Ref ref;\n    char *p;\n    GString *s;\n    if (obj->isBool()) {\n        pdf_printf(\"%s\", obj->getBool()? \"true\" : \"false\");\n    } else if (obj->isInt()) {\n        pdf_printf(\"%i\", obj->getInt());\n    } else if (obj->isReal()) {\n        pdf_printf(\"%s\", convertNumToPDF(obj->getReal()));\n    } else if (obj->isNum()) {\n        pdf_printf(\"%s\", convertNumToPDF(obj->getNum()));\n    } else if (obj->isString()) {\n        s = (GooString *)obj->getString();\n        p = (char *)s->c_str();\n        l = s->getLength();\n        if (strlen(p) == (unsigned int) l) {\n            pdf_puts(\"(\");\n            for (; *p != 0; p++) {\n                c = (unsigned char) *p;\n                if (c == '(' || c == ')' || c == '\\\\')\n                    pdf_printf(\"\\\\%c\", c);\n                else if (c < 0x20 || c > 0x7F)\n                    pdf_printf(\"\\\\%03o\", c);\n                else\n                    pdfout(c);\n            }\n            pdf_puts(\")\");\n        } else {\n            pdf_puts(\"<\");\n            for (i = 0; i < l; i++) {\n                c = s->getChar(i) & 0xFF;\n                pdf_printf(\"%.2x\", c);\n            }\n            pdf_puts(\">\");\n        }\n    } else if (obj->isName()) {\n        copyName((char *)obj->getName());\n    } else if (obj->isNull()) {\n        pdf_puts(\"null\");\n    } else if (obj->isArray()) {\n        pdf_puts(\"[\");\n        for (i = 0, l = obj->arrayGetLength(); i < l; ++i) {\n            obj1 = obj->arrayGetNF(i).copy();\n            if (!obj1.isName())\n                pdf_puts(\" \");\n            copyObject(&obj1);\n        }\n        pdf_puts(\"]\");\n    } else if (obj->isDict()) {\n        pdf_puts(\"<<\\n\");\n        copyDict(obj);\n        pdf_puts(\">>\");\n    } else if (obj->isStream()) {\n        pdf_puts(\"<<\\n\");\n        copyDict(obj->getStream()->getDictObject());\n        pdf_puts(\">>\\n\");\n        pdf_puts(\"stream\\n\");\n        copyStream(obj->getStream()->getUndecodedStream());\n        pdf_puts(\"\\nendstream\");\n    } else if (obj->isRef()) {\n        ref = obj->getRef();\n        if (ref.num == 0) {\n            pdftex_fail\n                (\"PDF inclusion: reference to invalid object\"\n                 \" (is the included pdf broken?)\");\n        } else\n            pdf_printf(\"%d 0 R\", addOther(ref));\n    } else {\n        pdftex_fail(\"PDF inclusion: type <%s> cannot be copied\",\n                    obj->getTypeName());\n    }\n}\n\nstatic void writeRefs()\n{\n    InObj *r;\n    for (r = inObjList; r != 0; r = r->next) {\n        if (!r->written) {\n            r->written = 1;\n            Object obj1 = xref->fetch(r->ref.num, r->ref.gen);\n            if (r->type == objFont) {\n                assert(!obj1.isStream());\n                pdfbeginobj(r->num, 2);         // \\pdfobjcompresslevel = 2 is for this\n                copyFontDict(&obj1, r);\n                pdf_puts(\"\\n\");\n                pdfendobj();\n            } else if (r->type != objFontDesc) {        // /FontDescriptor is written via write_fontdescriptor()\n                if (obj1.isStream())\n                    pdfbeginobj(r->num, 0);\n                else\n                    pdfbeginobj(r->num, 2);     // \\pdfobjcompresslevel = 2 is for this\n                copyObject(&obj1);\n                pdf_puts(\"\\n\");\n                pdfendobj();\n            }\n        }\n    }\n}\n\nstatic void writeEncodings()\n{\n    UsedEncoding *r, *n;\n    char *glyphNames[256], *s;\n    int i;\n    for (r = encodingList; r != 0; r = r->next) {\n        for (i = 0; i < 256; i++) {\n            if (r->font->isCIDFont()) {\n                pdftex_fail\n                    (\"PDF inclusion: CID fonts are not supported\"\n                     \" (try to disable font replacement to fix this)\");\n            }\n            if ((s = (char *)((Gfx8BitFont *) r->font)->getCharName(i)) != 0)\n                glyphNames[i] = s;\n            else\n                glyphNames[i] = notdef;\n        }\n        epdf_write_enc(glyphNames, r->enc_objnum);\n    }\n    for (r = encodingList; r != 0; r = n) {\n        n = r->next;\n#ifdef POPPLER_VERSION\n        r->font->decRefCnt();\n#else\n#error POPPLER_VERSION should be defined.\n#endif\n        delete r;\n    }\n}\n\n// get the pagebox according to the pagebox_spec\nstatic const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)\n{\n    if (pagebox_spec == pdfboxspecmedia)\n        return page->getMediaBox();\n    else if (pagebox_spec == pdfboxspeccrop)\n        return page->getCropBox();\n    else if (pagebox_spec == pdfboxspecbleed)\n        return page->getBleedBox();\n    else if (pagebox_spec == pdfboxspectrim)\n        return page->getTrimBox();\n    else if (pagebox_spec == pdfboxspecart)\n        return page->getArtBox();\n    else\n        pdftex_fail(\"PDF inclusion: unknown value of pagebox spec (%i)\",\n                    (int) pagebox_spec);\n    return page->getMediaBox(); // to make the compiler happy\n}\n\n\n// Reads various information about the PDF and sets it up for later inclusion.\n// This will fail if the PDF version of the PDF is higher than\n// minor_pdf_version_wanted or page_name is given and can not be found.\n// It makes no sense to give page_name _and_ page_num.\n// Returns the page number.\n\nint\nread_pdf_info(char *image_name, char *page_name, int page_num,\n              int pagebox_spec, int minor_pdf_version_wanted,\n              int pdf_inclusion_errorlevel)\n{\n    PdfDocument *pdf_doc;\n    Page *page;\n    const PDFRectangle *pagebox;\n#ifdef POPPLER_VERSION\n    int pdf_major_version_found, pdf_minor_version_found;\n#else\n#error POPPLER_VERSION should be defined.\n#endif\n    // initialize\n    if (!isInit) {\n        globalParams = new GlobalParams();\n        globalParams->setErrQuiet(false);\n        isInit = true;\n    }\n    // open PDF file\n    pdf_doc = find_add_document(image_name);\n    epdf_doc = (void *) pdf_doc;\n\n    // check PDF version\n    // this works only for PDF 1.x -- but since any versions of PDF newer\n    // than 1.x will not be backwards compatible to PDF 1.x, pdfTeX will\n    // then have to changed drastically anyway.\n#ifdef POPPLER_VERSION\n    pdf_major_version_found = pdf_doc->doc->getPDFMajorVersion();\n    pdf_minor_version_found = pdf_doc->doc->getPDFMinorVersion();\n    if ((pdf_major_version_found > 1)\n     || (pdf_minor_version_found > minor_pdf_version_wanted)) {\n        const char *msg =\n            \"PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed\";\n        if (pdf_inclusion_errorlevel > 0) {\n            pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);\n        } else if (pdf_inclusion_errorlevel < 0) {\n            ; /* do nothing */\n        } else { /* = 0, give warning */\n            pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);\n        }\n    }\n#else\n#error POPPLER_VERSION should be defined.\n#endif\n    epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages();\n    if (page_name) {\n        // get page by name\n        GString name(page_name);\n        LinkDest *link = pdf_doc->doc->findDest(&name);\n        if (link == 0 || !link->isOk())\n            pdftex_fail(\"PDF inclusion: invalid destination <%s>\", page_name);\n        Ref ref = link->getPageRef();\n        page_num = pdf_doc->doc->getCatalog()->findPage(ref);\n        if (page_num == 0)\n            pdftex_fail(\"PDF inclusion: destination is not a page <%s>\",\n                        page_name);\n        delete link;\n    } else {\n        // get page by number\n        if (page_num <= 0 || page_num > epdf_num_pages)\n            pdftex_fail(\"PDF inclusion: required page does not exist <%i>\",\n                        epdf_num_pages);\n    }\n    // get the required page\n    page = pdf_doc->doc->getCatalog()->getPage(page_num);\n\n    // get the pagebox (media, crop...) to use.\n    pagebox = get_pagebox(page, pagebox_spec);\n    if (pagebox->x2 > pagebox->x1) {\n        epdf_orig_x = pagebox->x1;\n        epdf_width = pagebox->x2 - pagebox->x1;\n    } else {\n        epdf_orig_x = pagebox->x2;\n        epdf_width = pagebox->x1 - pagebox->x2;\n    }\n    if (pagebox->y2 > pagebox->y1) {\n        epdf_orig_y = pagebox->y1;\n        epdf_height = pagebox->y2 - pagebox->y1;\n    } else {\n        epdf_orig_y = pagebox->y2;\n        epdf_height = pagebox->y1 - pagebox->y2;\n    }\n\n    // get page rotation\n    epdf_rotate = page->getRotate() % 360;\n    if (epdf_rotate < 0)\n        epdf_rotate += 360;\n\n    // page group\n    if (page->getGroup() != NULL)\n        epdf_has_page_group = 1;    // only flag that page group is present;\n                                    // the actual object number will be\n                                    // generated in pdftex.web\n    else\n        epdf_has_page_group = 0;    // no page group present\n\n    pdf_doc->xref = pdf_doc->doc->getXRef();\n    return page_num;\n}\n\n// writes the current epf_doc.\n// Here the included PDF is copied, so most errors that can happen during PDF\n// inclusion will arise here.\n\nvoid write_epdf(void)\n{\n    Page *page;\n    Ref *pageRef;\n    Dict *pageDict;\n    Object contents, obj1, obj2, pageObj, dictObj;\n    Object groupDict;\n    bool writeSepGroup = false;\n    Object info;\n    char *key;\n    char s[256];\n    int i, l;\n    int rotate;\n    double scale[6] = { 0, 0, 0, 0, 0, 0 };\n    bool writematrix = false;\n    int suppress_ptex_info = getpdfsuppressptexinfo();\n    static const char *pageDictKeys[] = {\n        \"LastModified\",\n        \"Metadata\",\n        \"PieceInfo\",\n        \"SeparationInfo\",\n//         \"Group\",\n//         \"Resources\",\n        NULL\n    };\n\n    PdfDocument *pdf_doc = (PdfDocument *) epdf_doc;\n    (pdf_doc->occurences)--;\n    xref = pdf_doc->xref;\n    inObjList = pdf_doc->inObjList;\n    encodingList = 0;\n    page = pdf_doc->doc->getCatalog()->getPage(epdf_selected_page);\n    pageRef = pdf_doc->doc->getCatalog()->getPageRef(epdf_selected_page);\n    pageObj = xref->fetch(pageRef->num, pageRef->gen);\n    pageDict = pageObj.getDict();\n    rotate = page->getRotate();\n    const PDFRectangle *pagebox;\n    // write the Page header\n    pdf_puts(\"/Type /XObject\\n\");\n    pdf_puts(\"/Subtype /Form\\n\");\n    pdf_puts(\"/FormType 1\\n\");\n\n    // write additional information\n    if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_FILENAME) == 0) {\n        pdf_printf(\"/%s.FileName (%s)\\n\", pdfkeyprefix,\n                   convertStringToPDFString(pdf_doc->file_name,\n                                            strlen(pdf_doc->file_name)));\n    }\n    if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_PAGENUMBER) == 0) {\n        pdf_printf(\"/%s.PageNumber %i\\n\", pdfkeyprefix, (int) epdf_selected_page);\n    }\n    if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_INFODICT) == 0) {\n        info = pdf_doc->doc->getDocInfoNF().copy();\n        if (info.isRef()) {\n            // the info dict must be indirect (PDF Ref p. 61)\n            pdf_printf(\"/%s.InfoDict \", pdfkeyprefix);\n            pdf_printf(\"%d 0 R\\n\", addOther(info.getRef()));\n        }\n    }\n    // get the pagebox (media, crop...) to use.\n    pagebox = get_pagebox(page, epdf_page_box);\n\n    // handle page rotation\n    if (rotate != 0) {\n        if (rotate % 90 == 0) {\n            // this handles only the simple case: multiple of 90s but these\n            // are the only values allowed according to the reference\n            // (v1.3, p. 78).\n            // the image is rotated around its center.\n            // the /Rotate key is clockwise while the matrix is\n            // counterclockwise :-%\n            tex_printf(\", page is rotated %d degrees\", rotate);\n            switch (rotate) {\n            case 90:\n                scale[1] = -1;\n                scale[2] = 1;\n                scale[4] = pagebox->x1 - pagebox->y1;\n                scale[5] = pagebox->y1 + pagebox->x2;\n                writematrix = true;\n                break;\n            case 180:\n                scale[0] = scale[3] = -1;\n                scale[4] = pagebox->x1 + pagebox->x2;\n                scale[5] = pagebox->y1 + pagebox->y2;\n                writematrix = true;\n                break;          // width and height are exchanged\n            case 270:\n                scale[1] = 1;\n                scale[2] = -1;\n                scale[4] = pagebox->x1 + pagebox->y2;\n                scale[5] = pagebox->y1 - pagebox->x1;\n                writematrix = true;\n                break;\n            }\n            if (writematrix) {  // The matrix is only written if the image is rotated.\n                sprintf(s, \"/Matrix [%.8f %.8f %.8f %.8f %.8f %.8f]\\n\",\n                        scale[0],\n                        scale[1], scale[2], scale[3], scale[4], scale[5]);\n                pdf_puts(stripzeros(s));\n            }\n        }\n    }\n\n    sprintf(s, \"/BBox [%.8f %.8f %.8f %.8f]\\n\",\n            pagebox->x1, pagebox->y1, pagebox->x2, pagebox->y2);\n    pdf_puts(stripzeros(s));\n\n    // Metadata validity check (as a stream it must be indirect)\n    dictObj = pageDict->lookupNF(\"Metadata\").copy();\n    if (!dictObj.isNull() && !dictObj.isRef())\n        pdftex_warn(\"PDF inclusion: /Metadata must be indirect object\");\n\n    // copy selected items in Page dictionary except Resources & Group\n    for (i = 0; pageDictKeys[i] != NULL; i++) {\n        dictObj = pageDict->lookupNF(pageDictKeys[i]).copy();\n        if (!dictObj.isNull()) {\n            pdf_newline();\n            pdf_printf(\"/%s \", pageDictKeys[i]);\n            copyObject(&dictObj); // preserves indirection\n        }\n    } \n\n    // handle page group\n    dictObj = pageDict->lookupNF(\"Group\").copy();\n    if (!dictObj.isNull()) {\n        if (pdfpagegroupval == 0) { \n            // another pdf with page group was included earlier on the\n            // same page; copy the Group entry as is.  See manual for\n            // info on why this is a warning.\n            if (getpdfsuppresswarningpagegroup() == 0) {\n                pdftex_warn\n    (\"PDF inclusion: multiple pdfs with page group included in a single page\");\n            }\n            pdf_newline();\n            pdf_puts(\"/Group \");\n            copyObject(&dictObj);\n        } else {\n            // write Group dict as a separate object, since the Page dict also refers to it\n            dictObj = pageDict->lookup(\"Group\");\n            if (!dictObj.isDict())\n                pdftex_fail(\"PDF inclusion: /Group dict missing\");\n            writeSepGroup = true;\n/*\nThis part is only a single line\n            groupDict = Object(page->getGroup());\nin the original patch. In this case, however, pdftex crashes at\n\"delete pdf_doc->doc\" in \"delete_document()\" for inclusion of some\nkind of pdf images, for example, figure_missing.pdf in gnuplot.\nA change\n            groupDict = Object(page->getGroup()).copy();\ndoes not improve the situation.\nThe changes below seem to work fine. \n*/\n// begin modification\n            groupDict = pageDict->lookup(\"Group\");\n            const Dict& dic1 = page->getGroup();\n            const Dict& dic2 = groupDict.getDict();\n            // replace dic2 in groupDict with dic1\n            l = dic2.getLength();\n            for (i = 0; i < l; i++) {\n                groupDict.dictRemove(dic2.getKey(i));\n            }\n            l = dic1.getLength();\n            for (i = 0; i < l; i++) {\n                groupDict.dictAdd((const char *)copyString(dic1.getKey(i)),\n                                  dic1.getValNF(i).copy());\n            }\n// end modification\n            pdf_printf(\"/Group %ld 0 R\\n\", (long)pdfpagegroupval);\n        }\n    }\n\n    // write the Resources dictionary\n    if (page->getResourceDict() == NULL) {\n        // Resources can be missing (files without them have been spotted\n        // in the wild); in which case the /Resouces of the /Page will be used.\n        // \"This practice is not recommended\".\n        pdftex_warn\n            (\"PDF inclusion: /Resources missing. 'This practice is not recommended' (PDF Ref)\");\n    } else {\n        Object *obj1 = page->getResourceDictObject();\n        if (!obj1->isDict())\n            pdftex_fail(\"PDF inclusion: invalid resources dict type <%s>\",\n                        obj1->getTypeName());\n        pdf_newline();\n        pdf_puts(\"/Resources <<\\n\");\n        for (i = 0, l = obj1->dictGetLength(); i < l; ++i) {\n            obj2 = obj1->dictGetVal(i);\n            key = (char *)obj1->dictGetKey(i);\n            if (strcmp(\"Font\", key) == 0)\n                copyFontResources(&obj2);\n            else if (strcmp(\"ProcSet\", key) == 0)\n                copyProcSet(&obj2);\n            else\n                copyOtherResources(&obj2, (char *)key);\n        }\n        pdf_puts(\">>\\n\");\n    }\n\n    // write the page contents\n    contents = page->getContents();\n    if (contents.isStream()) {\n\n        // Variant A: get stream and recompress under control\n        // of \\pdfcompresslevel\n        //\n        // pdfbeginstream();\n        // copyStream(contents->getStream());\n        // pdfendstream();\n\n        // Variant B: copy stream without recompressing\n        //\n        obj1 = contents.streamGetDict()->lookup(\"F\");\n        if (!obj1.isNull()) {\n            pdftex_fail(\"PDF inclusion: Unsupported external stream\");\n        }\n        obj1 = contents.streamGetDict()->lookup(\"Length\");\n        assert(!obj1.isNull());\n        pdf_puts(\"/Length \");\n        copyObject(&obj1);\n        pdf_puts(\"\\n\");\n        obj1 = contents.streamGetDict()->lookup(\"Filter\");\n        if (!obj1.isNull()) {\n            pdf_puts(\"/Filter \");\n            copyObject(&obj1);\n            pdf_puts(\"\\n\");\n            obj1 = contents.streamGetDict()->lookup(\"DecodeParms\");\n            if (!obj1.isNull()) {\n                pdf_puts(\"/DecodeParms \");\n                copyObject(&obj1);\n                pdf_puts(\"\\n\");\n            }\n        }\n        pdf_puts(\">>\\nstream\\n\");\n        copyStream(contents.getStream()->getUndecodedStream());\n        pdfendstream();\n    } else if (contents.isArray()) {\n        pdfbeginstream();\n        for (i = 0, l = contents.arrayGetLength(); i < l; ++i) {\n            Object contentsobj = contents.arrayGet(i);\n            copyStream(contentsobj.getStream());\n            if (i < l - 1)\n                pdf_newline();  // add a newline after each stream except the last\n        }\n        pdfendstream();\n    } else {                    // the contents are optional, but we need to include an empty stream\n        pdfbeginstream();\n        pdfendstream();\n    }\n\n    // write out all indirect objects\n    writeRefs();\n\n    // write out all used encodings (and delete list)\n    writeEncodings();\n\n    // write the Group dict if needed\n    if (writeSepGroup) {\n        pdfbeginobj(pdfpagegroupval, 2);\n        copyObject(&groupDict);\n        pdf_puts(\"\\n\");\n        pdfendobj();\n        pdfpagegroupval = 0;    // only the 1st included pdf on a page gets its\n                                // Group included in the Page dict\n    }\n\n    // save object list, xref\n    pdf_doc->inObjList = inObjList;\n    pdf_doc->xref = xref;\n}\n\n// Called when an image has been written and it's resources in image_tab are\n// freed and it's not referenced anymore.\n\nvoid epdf_delete()\n{\n    PdfDocument *pdf_doc = (PdfDocument *) epdf_doc;\n    xref = pdf_doc->xref;\n    if (pdf_doc->occurences < 0) {\n        delete_document(pdf_doc);\n    }\n}\n\n// Called when PDF embedding system is finalized.\n// Now deallocate all remaining PdfDocuments.\n\nvoid epdf_check_mem()\n{\n    if (isInit) {\n        PdfDocument *p, *n;\n        for (p = pdfDocuments; p; p = n) {\n            n = p->next;\n            delete_document(p);\n        }\n        // see above for globalParams\n        delete globalParams;\n    }\n}\n"
  },
  {
    "path": "packages/texlive-bin/pdftosrc-poppler0.76.0.cc",
    "content": "/*\nCopyright 1996-2017 Han The Thanh, <thanh@pdftex.org>\n\nThis file is part of pdfTeX.\n\npdfTeX is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\npdfTeX is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along\nwith this program.  If not, see <http://www.gnu.org/licenses/>.\n*/\n\n/*\nThis is based on the patch texlive-poppler-0.59.patch <2017-09-19> at\nhttps://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk\nby Arch Linux. The poppler should be 0.76.0 or newer versions.\nPOPPLER_VERSION should be defined.\n*/\n\n#include <w2c/config.h>\n\n#include <stdlib.h>\n#include <stddef.h>\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n\n#ifdef POPPLER_VERSION\n#define GString GooString\n#define xpdfVersion POPPLER_VERSION\n#include <dirent.h>\n#include <goo/GooString.h>\n#include <goo/gmem.h>\n#include <goo/gfile.h>\n#else\n#error POPPLER_VERSION should be defined.\n#endif\n#include <assert.h>\n\n#include \"Object.h\"\n#include \"Stream.h\"\n#include \"Lexer.h\"\n#include \"Parser.h\"\n#include \"Array.h\"\n#include \"Dict.h\"\n#include \"XRef.h\"\n#include \"Catalog.h\"\n#include \"Page.h\"\n#include \"GfxFont.h\"\n#include \"PDFDoc.h\"\n#include \"GlobalParams.h\"\n#include \"Error.h\"\n\nstatic XRef *xref = 0;\n\nint main(int argc, char *argv[])\n{\n    char *p, buf[1024];\n    PDFDoc *doc;\n    GString *fileName;\n    Stream *s;\n    Object srcStream, srcName, catalogDict;\n    FILE *outfile;\n    char *outname;\n    int objnum = 0, objgen = 0;\n    bool extract_xref_table = false;\n    int c;\n    fprintf(stderr, \"pdftosrc version %s\\n\", xpdfVersion);\n    if (argc < 2) {\n        fprintf(stderr,\n                \"Usage: pdftosrc <PDF-file> [<stream-object-number>]\\n\");\n        exit(1);\n    }\n    fileName = new GString(argv[1]);\n    globalParams = new GlobalParams();\n    doc = new PDFDoc(fileName);\n    if (!doc->isOk()) {\n        fprintf(stderr, \"Invalid PDF file\\n\");\n        exit(1);\n    }\n    if (argc >= 3) {\n        objnum = atoi(argv[2]);\n        if (argc >= 4)\n            objgen = atoi(argv[3]);\n    }\n    xref = doc->getXRef();\n    catalogDict = xref->getCatalog();\n    if (!catalogDict.isDict(\"Catalog\")) {\n        fprintf(stderr, \"No Catalog found\\n\");\n        exit(1);\n    }\n    srcStream = Object(objNull);\n    if (objnum == 0) {\n        srcStream = catalogDict.dictLookup(\"SourceObject\");\n        static char const_SourceFile[] = \"SourceFile\";\n        if (!srcStream.isStream(const_SourceFile)) {\n            fprintf(stderr, \"No SourceObject found\\n\");\n            exit(1);\n        }\n        srcName = srcStream.getStream()->getDict()->lookup(\"SourceName\");\n        if (!srcName.isString()) {\n            fprintf(stderr, \"No SourceName found\\n\");\n            exit(1);\n        }\n        outname = (char *)srcName.getString()->c_str();\n        // We cannot free srcName, as objname shares its string.\n        // srcName.free();\n    } else if (objnum > 0) {\n        srcStream = xref->fetch(objnum, objgen);\n        if (!srcStream.isStream()) {\n            fprintf(stderr, \"Not a Stream object\\n\");\n            exit(1);\n        }\n        sprintf(buf, \"%s\", fileName->c_str());\n        if ((p = strrchr(buf, '.')) == 0)\n            p = strchr(buf, 0);\n        if (objgen == 0)\n            sprintf(p, \".%i\", objnum);\n        else\n            sprintf(p, \".%i+%i\", objnum, objgen);\n        outname = buf;\n    } else {                    // objnum < 0 means we are extracting the XRef table\n        extract_xref_table = true;\n        sprintf(buf, \"%s\", fileName->c_str());\n        if ((p = strrchr(buf, '.')) == 0)\n            p = strchr(buf, 0);\n        sprintf(p, \".xref\");\n        outname = buf;\n    }\n    if (!(outfile = fopen(outname, \"wb\"))) {\n        fprintf(stderr, \"Cannot open file \\\"%s\\\" for writing\\n\", outname);\n        exit(1);\n    }\n    if (extract_xref_table) {\n        int size = xref->getNumObjects();\n        int i;\n        for (i = 0; i < size; i++) {\n            if (xref->getEntry(i)->offset == 0xffffffff)\n                break;\n        }\n        size = i;\n        fprintf(outfile, \"xref\\n\");\n        fprintf(outfile, \"0 %i\\n\", size);\n        for (i = 0; i < size; i++) {\n            XRefEntry *e = xref->getEntry(i);\n            if (e->type != xrefEntryCompressed)\n                fprintf(outfile, \"%.10lu %.5i %s\\n\",\n                        (long unsigned) e->offset, e->gen,\n                        (e->type == xrefEntryFree ? \"f\" : \"n\"));\n            else {              // e->offset is the object number of the object stream\n                Stream *str;\n                Lexer *lexer;\n                Parser *parser;\n                Object objStr, obj1, obj2;\n                int nObjects, first, n;\n                int localOffset = 0;\n                unsigned int firstOffset;\n\n                objStr = xref->fetch(e->offset, 0);\n                assert(objStr.isStream());\n                obj1 = objStr.streamGetDict()->lookup(\"N\");\n                nObjects = obj1.getInt();\n                obj1 = objStr.streamGetDict()->lookup(\"First\");\n                first = obj1.getInt();\n                firstOffset = objStr.getStream()->getBaseStream()->getStart() + first;\n\n                // parse the header: object numbers and offsets\n                objStr.streamReset();\n                str = new EmbedStream(objStr.getStream(), Object(objNull), true, first);\n                parser = new Parser(xref, str, false);\n                for (n = 0; n < nObjects; ++n) {\n                    obj1 = parser->getObj();\n                    obj2 = parser->getObj();\n                    if (n == e->gen)\n                        localOffset = obj2.getInt();\n                }\n                while (str->getChar() != EOF) ;\n                delete parser;\n\n                fprintf(outfile, \"%.10lu 00000 n\\n\",\n                        (long unsigned)(firstOffset + localOffset));\n            }\n        }\n    } else {\n        s = srcStream.getStream();\n        s->reset();\n        while ((c = s->getChar()) != EOF)\n            fputc(c, outfile);\n    }\n    if (objnum == 0)\n        fprintf(stderr, \"Source file extracted to %s\\n\", outname);\n    else if (objnum > 0)\n        fprintf(stderr, \"Stream object extracted to %s\\n\", outname);\n    else\n        fprintf(stderr, \"Cross-reference table extracted to %s\\n\", outname);\n    fclose(outfile);\n    delete doc;\n    delete globalParams;\n}\n"
  },
  {
    "path": "packages/texlive-bin/texk-kpathsea-texmf.cnf.patch",
    "content": "--- ../texmf.cnf.orig\t2018-04-30 17:07:05.796733785 +0000\n+++ ./texk/kpathsea/texmf.cnf\t2018-04-30 17:36:18.883441637 +0000\n@@ -58,7 +58,7 @@\n % SELFAUTOPARENT (its grandparent = /usr/local/texlive/YYYY), and\n % SELFAUTOGRANDPARENT (its great-grandparent = /usr/local/texlive).\n % Sorry for the off-by-one-generation names.\n-TEXMFROOT = $SELFAUTOPARENT\n+TEXMFROOT = $SELFAUTODIR/share/texlive\n \n % The main tree of distributed packages and programs:\n TEXMFDIST = $TEXMFROOT/texmf-dist\n@@ -68,7 +68,7 @@\n TEXMFMAIN = $TEXMFDIST\n \n % Local additions to the distribution trees.\n-TEXMFLOCAL = $SELFAUTOGRANDPARENT/texmf-local\n+TEXMFLOCAL = $TEXMFROOT/texmf-local\n \n % TEXMFSYSVAR, where *-sys store cached runtime data.\n TEXMFSYSVAR = $TEXMFROOT/texmf-var\n@@ -524,6 +524,9 @@\n $SELFAUTODIR/share/texmf-local/web2c,\\\n $SELFAUTODIR/share/texmf-dist/web2c,\\\n $SELFAUTODIR/share/texmf/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf-local/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf-dist/web2c,\\\n+$SELFAUTODIR/share/texlive/texmf/web2c,\\\n $SELFAUTODIR/texmf-local/web2c,\\\n $SELFAUTODIR/texmf-dist/web2c,\\\n $SELFAUTODIR/texmf/web2c,\\\n"
  },
  {
    "path": "packages/texlive-bin/texk-web2c-luatexdir-luaffi-ffi.h.patch",
    "content": "--- ./texk/web2c/luatexdir/luaffi/ffi.h\t2017-11-17 14:32:47.517562104 +0000\n+++ ../ffi.h\t2017-11-17 14:32:26.333562953 +0000\n@@ -42,7 +42,7 @@\n #include <sys/mman.h>\n #endif\n \n-#if ( defined( _WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__))\n+#if ( defined( _WIN32) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__ANDROID__))\n /* We should include something equivalent to */\n /* complex.h                                 */\n #else\n"
  },
  {
    "path": "packages/texlive-bin/xetex-poppler-fixes.patch",
    "content": "From 729755bcb60695221cb368202822fc3181197ef7 Mon Sep 17 00:00:00 2001\nFrom: Akira Kakuto <kakuto@fuk.kindai.ac.jp>\nDate: Mon, 22 Oct 2018 04:01:42 +0000\nSubject: [PATCH] cast types to support new poppler\n\ngit-svn-id: svn://tug.org/texlive/trunk/Build/source@48969 c570f23f-e606-0410-a88d-b1316a301751\n---\n texk/web2c/xetexdir/ChangeLog    |  4 ++++\n texk/web2c/xetexdir/pdfimage.cpp | 10 +++++-----\n 2 files changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/texk/web2c/xetexdir/pdfimage.cpp b/texk/web2c/xetexdir/pdfimage.cpp\nindex fc3e32693..8a38f1ee5 100644\n--- a/texk/web2c/xetexdir/pdfimage.cpp\n+++ b/texk/web2c/xetexdir/pdfimage.cpp\n@@ -82,19 +82,19 @@ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box)\n \tswitch (pdf_box) {\n \t\tdefault:\n \t\tcase pdfbox_crop:\n-\t\t\tr = page->getCropBox();\n+\t\t\tr = (PDFRectangle *)page->getCropBox();\n \t\t\tbreak;\n \t\tcase pdfbox_media:\n-\t\t\tr = page->getMediaBox();\n+\t\t\tr = (PDFRectangle *)page->getMediaBox();\n \t\t\tbreak;\n \t\tcase pdfbox_bleed:\n-\t\t\tr = page->getBleedBox();\n+\t\t\tr = (PDFRectangle *)page->getBleedBox();\n \t\t\tbreak;\n \t\tcase pdfbox_trim:\n-\t\t\tr = page->getTrimBox();\n+\t\t\tr = (PDFRectangle *)page->getTrimBox();\n \t\t\tbreak;\n \t\tcase pdfbox_art:\n-\t\t\tr = page->getArtBox();\n+\t\t\tr = (PDFRectangle *)page->getArtBox();\n \t\t\tbreak;\n \t}\n \n"
  },
  {
    "path": "packages/texlive-bin/zziplib_disable_have_dirent.patch",
    "content": "--- a/libs/zziplib/config.h.in\t2013-09-09 10:31:11.000000000 +0200\n+++ l/libs/zziplib/config.h.in\t2016-12-20 20:17:28.906466862 +0100\n@@ -12,9 +12,7 @@\n /* Define to 1 if you have the <direct.h> header file. */\n #undef HAVE_DIRECT_H\n \n-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.\n-   */\n-#undef HAVE_DIRENT_H\n+\n \n /* Define to 1 if you have the <fnmatch.h> header file. */\n #undef HAVE_FNMATCH_H\n"
  },
  {
    "path": "packages/texlive-tlmgr/TLConfig.pm.patch",
    "content": "--- src/tlpkg/TeXLive/TLConfig.pm\t2016-04-21 19:08:52.000000000 +0000\n+++ ../TLConfig.pm\t2017-05-30 13:18:48.030712610 +0000\n@@ -165,13 +165,13 @@\n     [ \"b\", 1, \"postcode\",\n       \"Run postinst code blobs\" ],\n   \"sys_bin\" =>\n-    [ \"p\", \"/usr/local/bin\", \"sys_bin\",\n+    [ \"p\", \"@TERMUX_PREFIX@/bin\", \"sys_bin\",\n       \"Destination for symlinks for binaries\" ],\n   \"sys_info\" =>\n-    [ \"p\", \"/usr/local/share/info\", \"sys_info\",\n+    [ \"p\", \"@TERMUX_PREFIX@/share/info\", \"sys_info\",\n       \"Destination for symlinks for info docs\" ],\n   \"sys_man\" =>\n-    [ \"p\", \"/usr/local/share/man\", \"sys_man\",\n+    [ \"p\", \"@TERMUX_PREFIX@/share/man\", \"sys_man\",\n       \"Destination for symlinks for man pages\" ],\n   \"w32_multi_user\" =>\n     [ \"b\", 1, \"multiuser\",\n"
  },
  {
    "path": "packages/texlive-tlmgr/TLUtils.pm.patch",
    "content": "--- src/tlpkg/TeXLive/TLUtils.pm\t2016-05-16 00:33:33.000000000 +0000\n+++ ../TLUtils.pm\t2017-05-30 14:09:38.505466432 +0000\n@@ -228,7 +228,7 @@\n       # We cannot rely on #! in config.guess but have to call /bin/sh\n       # explicitly because sometimes the 'noexec' flag is set in\n       # /etc/fstab for ISO9660 file systems.\n-      chomp (my $guessed_platform = `/bin/sh '$config_guess'`);\n+      chomp (my $guessed_platform = `@TERMUX_PREFIX@/bin/sh '$config_guess'`);\n \n       # For example, if the disc or reader has hardware problems.\n       die \"$0: could not run $config_guess, cannot proceed, sorry\"\n"
  },
  {
    "path": "packages/texlive-tlmgr/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/tlmgr.html\nTERMUX_PKG_DESCRIPTION=\"TeX Lives package manager\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Henrik Grimler @Grimler91\"\nTERMUX_PKG_VERSION=20190410\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/install-tl-unx.tar.gz\nTERMUX_PKG_SHA256=44aa41b5783e345b7021387f19ac9637ff1ce5406a59754230c666642dfe7750\nTERMUX_PKG_DEPENDS=\"perl, wget, gnupg (>= 2.2.9-1), xz-utils, texlive (>= 20190410)\"\nTERMUX_PKG_CONFFILES=\"share/texlive/tlpkg/texlive.tlpdb\"\nTERMUX_PKG_CONFLICTS=\"texlive (<< 20180414-1)\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTL_ROOT=$TERMUX_PREFIX/share/texlive\nTL_BINDIR=$TERMUX_PREFIX/bin\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n}\n\ntermux_step_make() {\n\tmkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/web2c}\n\tcp -r $TERMUX_PKG_BUILDDIR/* $TL_ROOT/\n\tcp $TERMUX_PKG_BUILDER_DIR/texlive.tlpdb $TL_ROOT/tlpkg/\n}\n\ntermux_step_post_make_install() {\n\t# Replace tlmgr link with a small wrapper that prevents error on \"tlmgr update --self\"\n\trm -rf $TL_BINDIR/tlmgr\n\tln -sf ../share/texlive/texmf-dist/scripts/texlive/tlmgr.pl $TL_BINDIR/tlmgr.ln\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > $TL_BINDIR/tlmgr\n\techo \"termux-fix-shebang $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl\" >> $TL_BINDIR/tlmgr\n\techo \"sed -i 's%\\`kpsewhich -var-value=SELFAUTOPARENT\\`);%\\`kpsewhich -var-value=TEXMFROOT\\`);%g' $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl\" >> $TL_BINDIR/tlmgr\n\techo \"sed -i 's%TEXMFROOT = \\$SELFAUTOPARENT%TEXMFROOT = \\$SELFAUTODIR/share/texlive%g' $TL_ROOT/texmf-dist/web2c/texmf.cnf\" >> $TL_BINDIR/tlmgr\n\techo \"sed -i '\"'s@`/bin/sh@`'$TERMUX_PREFIX\"/bin/sh@g' ${TL_ROOT}/tlpkg/TeXLive/TLUtils.pm\" >> $TL_BINDIR/tlmgr\n\techo 'tlmgr.ln \"$@\"' >> $TL_BINDIR/tlmgr\n\tchmod 0744 $TL_BINDIR/tlmgr\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/bash\" > postinst\n\techo \"mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/{web2c,tex/generic/config}}\" >> postinst\n\techo \"export TMPDIR=$TERMUX_PREFIX/tmp\" >> postinst\n\techo \"echo Updating tlmgr\" >> postinst\n\techo \"tlmgr update --self\" >> postinst\n\techo \"echo Generating language files and setting up symlinks\" >> postinst\n\techo \"tlmgr -q generate language\" >> postinst\n\techo \"exit 0\" >> postinst\n\tchmod 0755 postinst\n\t# Don't remove installed stuff on removal, do that in the pkg texlive instead.\n}\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nshare/texlive/LICENSE.TL\nshare/texlive/LICENSE.CTAN\nshare/texlive/release-texlive.txt\nshare/texlive/install-tl\nshare/texlive/tlpkg/TeXLive\nshare/texlive/texmf-dist/scripts/texlive/uninstall-win32.pl\nshare/texlive/texmf-dist/scripts/texlive/uninstq.vbs\nshare/texlive/texmf-dist/scripts/texlive/tlmgr-gui.pl\nshare/texlive/texmf-dist/web2c\nshare/texlive/tlpkg/installer/COPYING.MinGW-runtime.txt\nshare/texlive/tlpkg/installer/install-menu-perltk.pl\nshare/texlive/tlpkg/installer/install-menu-text.pl\nshare/texlive/tlpkg/installer/install-menu-wizard.pl\nshare/texlive/tlpkg/installer/install-tl.html\nshare/texlive/tlpkg/installer/installer-options.txt\nshare/texlive/tlpkg/installer/texlive.png\nshare/texlive/tlpkg/installer/tl-cmd.bat\nshare/texlive/tlpkg/installer/tl-tray-menu.ini\nshare/texlive/tlpkg/installer/tracked-install.pl\nshare/texlive/tlpkg/installer/wget\nshare/texlive/tlpkg/installer/xz\"\n"
  },
  {
    "path": "packages/texlive-tlmgr/texlive.tlpdb",
    "content": "name 00texlive.config\ncategory Package\ndepend minrelease/2016\ndepend release/2018\n\nname 00texlive.installation\ncategory TLCore\ndepend opt_location:http://ftp.acc.umu.se/mirror/CTAN/systems/texlive/tlnet\ndepend opt_autobackup:1\ndepend opt_install_srcfiles:0\ndepend opt_sys_man:/data/data/com.termux/files/usr/share/man\ndepend opt_post_code:1\ndepend opt_file_assocs:0\ndepend opt_generate_updmap:0\ndepend opt_sys_info:/data/data/com.termux/files/usr/share/info\ndepend opt_w32_multi_user:0\ndepend opt_create_formats:1\ndepend opt_sys_bin:/data/data/com.termux/files/usr/bin\ndepend opt_install_docfiles:0\ndepend opt_backupdir:tlpkg/backups\ndepend opt_desktop_integration:0\ndepend setting_available_architectures:custom\n\nname ae\ncategory Package\nrevision 15878\nshortdesc Virtual fonts for T1 encoded CMR-fonts\nlongdesc A set of virtual fonts which emulates T1 coded fonts using the\nlongdesc standard CM fonts. The package name, AE fonts, supposedly\nlongdesc stands for \"Almost European\". The main use of the package was\nlongdesc to produce PDF files using Adobe Type 1 versions of the CM\nlongdesc fonts instead of bitmapped EC fonts. Note that direct\nlongdesc substitutes for the bitmapped EC fonts are now available, via\nlongdesc the CM-super, Latin Modern and (in a restricted way) CM-LGC\nlongdesc font sets.\ncontainersize 57260\ncontainerchecksum a7b76d3ac96778aaa572b534f7cf2179ce89f90c67fae167754b89842ea25d20e83daaf9898bd15c97a65e83eea6a9c39affb64134c52af099d2a0496f17b591\ndoccontainersize 7736\ndoccontainerchecksum 556e1cb096c22c673c10d9eae7302ef266080027db5a357042e02fd4052813ec77ca62c78526f68940ed4ef2d9a4e7049ef11917ab489cd8f1296475f273e5da\nsrccontainersize 19976\nsrccontainerchecksum 644a3b28a39014f35789dafdb34bf90db598ceaa4440d04ad972abd1f79c6c3595e778cb40760d9231bcc3c13f1ffdba2c5b8f2e30569d51dd91e8a5fe2b83ee\nrunfiles size=157\n texmf-dist/fonts/tfm/public/ae/aeb10.tfm\n texmf-dist/fonts/tfm/public/ae/aebx10.tfm\n texmf-dist/fonts/tfm/public/ae/aebx12.tfm\n texmf-dist/fonts/tfm/public/ae/aebx5.tfm\n texmf-dist/fonts/tfm/public/ae/aebx6.tfm\n texmf-dist/fonts/tfm/public/ae/aebx7.tfm\n texmf-dist/fonts/tfm/public/ae/aebx8.tfm\n texmf-dist/fonts/tfm/public/ae/aebx9.tfm\n texmf-dist/fonts/tfm/public/ae/aebxsl10.tfm\n texmf-dist/fonts/tfm/public/ae/aebxti10.tfm\n texmf-dist/fonts/tfm/public/ae/aecsc10.tfm\n texmf-dist/fonts/tfm/public/ae/aeitt10.tfm\n texmf-dist/fonts/tfm/public/ae/aer10.tfm\n texmf-dist/fonts/tfm/public/ae/aer12.tfm\n texmf-dist/fonts/tfm/public/ae/aer17.tfm\n texmf-dist/fonts/tfm/public/ae/aer5.tfm\n texmf-dist/fonts/tfm/public/ae/aer6.tfm\n texmf-dist/fonts/tfm/public/ae/aer7.tfm\n texmf-dist/fonts/tfm/public/ae/aer8.tfm\n texmf-dist/fonts/tfm/public/ae/aer9.tfm\n texmf-dist/fonts/tfm/public/ae/aesl10.tfm\n texmf-dist/fonts/tfm/public/ae/aesl12.tfm\n texmf-dist/fonts/tfm/public/ae/aesl8.tfm\n texmf-dist/fonts/tfm/public/ae/aesl9.tfm\n texmf-dist/fonts/tfm/public/ae/aesltt10.tfm\n texmf-dist/fonts/tfm/public/ae/aess10.tfm\n texmf-dist/fonts/tfm/public/ae/aess12.tfm\n texmf-dist/fonts/tfm/public/ae/aess17.tfm\n texmf-dist/fonts/tfm/public/ae/aess8.tfm\n texmf-dist/fonts/tfm/public/ae/aess9.tfm\n texmf-dist/fonts/tfm/public/ae/aessbx10.tfm\n texmf-dist/fonts/tfm/public/ae/aessdc10.tfm\n texmf-dist/fonts/tfm/public/ae/aessi10.tfm\n texmf-dist/fonts/tfm/public/ae/aessi12.tfm\n texmf-dist/fonts/tfm/public/ae/aessi17.tfm\n texmf-dist/fonts/tfm/public/ae/aessi8.tfm\n texmf-dist/fonts/tfm/public/ae/aessi9.tfm\n texmf-dist/fonts/tfm/public/ae/aetcsc10.tfm\n texmf-dist/fonts/tfm/public/ae/aeti10.tfm\n texmf-dist/fonts/tfm/public/ae/aeti12.tfm\n texmf-dist/fonts/tfm/public/ae/aeti7.tfm\n texmf-dist/fonts/tfm/public/ae/aeti8.tfm\n texmf-dist/fonts/tfm/public/ae/aeti9.tfm\n texmf-dist/fonts/tfm/public/ae/aett10.tfm\n texmf-dist/fonts/tfm/public/ae/aett12.tfm\n texmf-dist/fonts/tfm/public/ae/aett8.tfm\n texmf-dist/fonts/tfm/public/ae/aett9.tfm\n texmf-dist/fonts/tfm/public/ae/laess8.tfm\n texmf-dist/fonts/tfm/public/ae/laessb8.tfm\n texmf-dist/fonts/tfm/public/ae/laessi8.tfm\n texmf-dist/fonts/vf/public/ae/aeb10.vf\n texmf-dist/fonts/vf/public/ae/aebx10.vf\n texmf-dist/fonts/vf/public/ae/aebx12.vf\n texmf-dist/fonts/vf/public/ae/aebx5.vf\n texmf-dist/fonts/vf/public/ae/aebx6.vf\n texmf-dist/fonts/vf/public/ae/aebx7.vf\n texmf-dist/fonts/vf/public/ae/aebx8.vf\n texmf-dist/fonts/vf/public/ae/aebx9.vf\n texmf-dist/fonts/vf/public/ae/aebxsl10.vf\n texmf-dist/fonts/vf/public/ae/aebxti10.vf\n texmf-dist/fonts/vf/public/ae/aecsc10.vf\n texmf-dist/fonts/vf/public/ae/aeitt10.vf\n texmf-dist/fonts/vf/public/ae/aer10.vf\n texmf-dist/fonts/vf/public/ae/aer12.vf\n texmf-dist/fonts/vf/public/ae/aer17.vf\n texmf-dist/fonts/vf/public/ae/aer5.vf\n texmf-dist/fonts/vf/public/ae/aer6.vf\n texmf-dist/fonts/vf/public/ae/aer7.vf\n texmf-dist/fonts/vf/public/ae/aer8.vf\n texmf-dist/fonts/vf/public/ae/aer9.vf\n texmf-dist/fonts/vf/public/ae/aesl10.vf\n texmf-dist/fonts/vf/public/ae/aesl12.vf\n texmf-dist/fonts/vf/public/ae/aesl8.vf\n texmf-dist/fonts/vf/public/ae/aesl9.vf\n texmf-dist/fonts/vf/public/ae/aesltt10.vf\n texmf-dist/fonts/vf/public/ae/aess10.vf\n texmf-dist/fonts/vf/public/ae/aess12.vf\n texmf-dist/fonts/vf/public/ae/aess17.vf\n texmf-dist/fonts/vf/public/ae/aess8.vf\n texmf-dist/fonts/vf/public/ae/aess9.vf\n texmf-dist/fonts/vf/public/ae/aessbx10.vf\n texmf-dist/fonts/vf/public/ae/aessdc10.vf\n texmf-dist/fonts/vf/public/ae/aessi10.vf\n texmf-dist/fonts/vf/public/ae/aessi12.vf\n texmf-dist/fonts/vf/public/ae/aessi17.vf\n texmf-dist/fonts/vf/public/ae/aessi8.vf\n texmf-dist/fonts/vf/public/ae/aessi9.vf\n texmf-dist/fonts/vf/public/ae/aetcsc10.vf\n texmf-dist/fonts/vf/public/ae/aeti10.vf\n texmf-dist/fonts/vf/public/ae/aeti12.vf\n texmf-dist/fonts/vf/public/ae/aeti7.vf\n texmf-dist/fonts/vf/public/ae/aeti8.vf\n texmf-dist/fonts/vf/public/ae/aeti9.vf\n texmf-dist/fonts/vf/public/ae/aett10.vf\n texmf-dist/fonts/vf/public/ae/aett12.vf\n texmf-dist/fonts/vf/public/ae/aett8.vf\n texmf-dist/fonts/vf/public/ae/aett9.vf\n texmf-dist/fonts/vf/public/ae/laess8.vf\n texmf-dist/fonts/vf/public/ae/laessb8.vf\n texmf-dist/fonts/vf/public/ae/laessi8.vf\n texmf-dist/tex/latex/ae/ae.sty\n texmf-dist/tex/latex/ae/aecompl.sty\n texmf-dist/tex/latex/ae/omlaer.fd\n texmf-dist/tex/latex/ae/omsaer.fd\n texmf-dist/tex/latex/ae/ot1aer.fd\n texmf-dist/tex/latex/ae/ot1aess.fd\n texmf-dist/tex/latex/ae/ot1aett.fd\n texmf-dist/tex/latex/ae/ot1laess.fd\n texmf-dist/tex/latex/ae/ot1laett.fd\n texmf-dist/tex/latex/ae/t1aer.fd\n texmf-dist/tex/latex/ae/t1aess.fd\n texmf-dist/tex/latex/ae/t1aett.fd\n texmf-dist/tex/latex/ae/t1laess.fd\n texmf-dist/tex/latex/ae/t1laett.fd\ncatalogue-also zefonts aeguill\ncatalogue-ctan /fonts/ae\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics font font-virtual font-t1enc\ncatalogue-version 1.4\n\nname amscls\ncategory Package\nrevision 46099\nshortdesc AMS document classes for LaTeX\nlongdesc This bundle contains three AMS classes, amsart (for writing\nlongdesc articles for the AMS), amsbook (for books) and amsproc (for\nlongdesc proceedings), together with some supporting material. This\nlongdesc material forms one branch of what was originally the AMS-LaTeX\nlongdesc distribution. The other branch, amsmath, is now maintained and\nlongdesc distributed separately. The user documentation can be found in\nlongdesc the package amscls-doc.\ncontainersize 32216\ncontainerchecksum 672f485ff78fc120e77f76c6cea5992f0e189dc3209ae2182a645ba462de4c878fb0cb482d55fce292eb118b86946d4f41016258c854e654c0cb45d49a6ca55d\ndoccontainersize 1152188\ndoccontainerchecksum 151c103d620548d4dcfae4c1a4310da3752fd580f3e1ee6347983c00df34ab3ead6d41fdf926fa6cc36304ab1909781c133ec8b183a17d5d4d3d97b13c79a58c\nsrccontainersize 76380\nsrccontainerchecksum 5fff9777b88908a7c82cd32b968432ac3afcac598b3e3c8c82a5220a99b5b3cf6e34225c99427b34affbff0e82ed9bee034f116a047f1e7cd2e73fdbb60e55e2\nrunfiles size=79\n texmf-dist/bibtex/bst/amscls/amsalpha.bst\n texmf-dist/bibtex/bst/amscls/amsplain.bst\n texmf-dist/tex/latex/amscls/amsart.cls\n texmf-dist/tex/latex/amscls/amsbook.cls\n texmf-dist/tex/latex/amscls/amsbooka.sty\n texmf-dist/tex/latex/amscls/amsdtx.cls\n texmf-dist/tex/latex/amscls/amsldoc.cls\n texmf-dist/tex/latex/amscls/amsmidx.sty\n texmf-dist/tex/latex/amscls/amsproc.cls\n texmf-dist/tex/latex/amscls/amsthm.sty\n texmf-dist/tex/latex/amscls/upref.sty\ncatalogue-also amslatex amscls-doc\ncatalogue-ctan /macros/latex/required/amscls\ncatalogue-date 2017-12-19 13:29:33 +0100\ncatalogue-license lppl1.3c\ncatalogue-topics class maths\ncatalogue-version 2.20.4\n\nname amsfonts\ncategory Package\nrevision 29208\nshortdesc TeX fonts from the American Mathematical Society\nlongdesc An extended set of fonts for use in mathematics, including:\nlongdesc extra mathematical symbols; blackboard bold letters (uppercase\nlongdesc only); fraktur letters; subscript sizes of bold math italic and\nlongdesc bold Greek letters; subscript sizes of large symbols such as\nlongdesc sum and product; added sizes of the Computer Modern small caps\nlongdesc font; cyrillic fonts (from the University of Washington); Euler\nlongdesc mathematical fonts. All fonts are provided as Adobe Type 1\nlongdesc files, and all except the Euler fonts are provided as Metafont\nlongdesc source. The distribution also includes the canonical Type 1\nlongdesc versions of the Computer Modern family of fonts. Basic LaTeX\nlongdesc support for the symbol fonts is provided by amsfonts.sty, with\nlongdesc names of individual symbols defined in amssymb.sty. The Euler\nlongdesc fonts are supported by separate packages; details can be found\nlongdesc in the documentation.\nexecute addMixedMap cm.map\nexecute addMixedMap cmextra.map\nexecute addMixedMap cyrillic.map\nexecute addMap      euler.map\nexecute addMixedMap latxfont.map\nexecute addMixedMap symbols.map\ncontainersize 3626440\ncontainerchecksum 8f492d3b5a0969543ef11d5f7edd76e9b3c5976cfd31cee976e0929cbbb4587f16b27fc161e168c013061991e1f7730df906c181027f13732639e02a983d9abf\ndoccontainersize 1162512\ndoccontainerchecksum 3bda6d839835dace02209e897be9648df59c6e4f11fc1be7f7e78646edac14c5f86482953f839a2afd1015877345aeca11d5a5bb03963b9b519230fcd50f3623\nsrccontainersize 49120\nsrccontainerchecksum 21fddd7a206265c5a9167b0d9f192c27f74cd10b49c0bf1d1a1e4d8534196155784c312707fe4294b8e6a1f1064c3f5cd76ea1907ce51a65088bfa2c9dc78bac\nrunfiles size=1879\n texmf-dist/fonts/afm/public/amsfonts/cm/cmb10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbsy10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbx10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbx12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbx5.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbx6.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbx7.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbx8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbx9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbxsl10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmbxti10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmcsc10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmdunh10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmex10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmff10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmfi10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmfib8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cminch.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmitt10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmi10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmi12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmi5.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmi6.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmi7.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmi8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmi9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmmib10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr17.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr5.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr6.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr7.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmr9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsl10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsl12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsl8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsl9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsltt10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmss10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmss12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmss17.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmss8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmss9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssbx10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssdc10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssi10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssi12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssi17.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssi8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssi9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssq8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmssqi8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsy10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsy5.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsy6.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsy7.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsy8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmsy9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtcsc10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtex10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtex8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtex9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmti10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmti12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmti7.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmti8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmti9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtt10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtt12.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtt8.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmtt9.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmu10.afm\n texmf-dist/fonts/afm/public/amsfonts/cm/cmvtt10.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmbsy5.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmbsy6.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmbsy7.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmbsy8.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmbsy9.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmcsc8.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmcsc9.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmex7.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmex8.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmex9.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmmib5.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmmib6.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmmib7.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmmib8.afm\n texmf-dist/fonts/afm/public/amsfonts/cmextra/cmmib9.afm\n texmf-dist/fonts/afm/public/amsfonts/cyrillic/wncyb10.afm\n texmf-dist/fonts/afm/public/amsfonts/cyrillic/wncyi10.afm\n texmf-dist/fonts/afm/public/amsfonts/cyrillic/wncyr10.afm\n texmf-dist/fonts/afm/public/amsfonts/cyrillic/wncysc10.afm\n texmf-dist/fonts/afm/public/amsfonts/cyrillic/wncyss10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/euex10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/euex7.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/euex8.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/euex9.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eufb10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eufb5.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eufb7.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eufm10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eufm5.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eufm7.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eurb10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eurb5.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eurb7.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eurm10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eurm5.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eurm7.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eusb10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eusb5.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eusb7.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eusm10.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eusm5.afm\n texmf-dist/fonts/afm/public/amsfonts/euler/eusm7.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lasy10.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lasy5.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lasy6.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lasy7.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lasy8.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lasy9.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lasyb10.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lcircle1.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lcirclew.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lcmss8.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lcmssb8.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/lcmssi8.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/line10.afm\n texmf-dist/fonts/afm/public/amsfonts/latxfont/linew10.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msam10.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msam5.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msam6.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msam7.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msam8.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msam9.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msbm10.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msbm5.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msbm6.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msbm7.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msbm8.afm\n texmf-dist/fonts/afm/public/amsfonts/symbols/msbm9.afm\n texmf-dist/fonts/map/dvips/amsfonts/cm.map\n texmf-dist/fonts/map/dvips/amsfonts/cmextra.map\n texmf-dist/fonts/map/dvips/amsfonts/cyrillic.map\n texmf-dist/fonts/map/dvips/amsfonts/euler.map\n texmf-dist/fonts/map/dvips/amsfonts/latxfont.map\n texmf-dist/fonts/map/dvips/amsfonts/symbols.map\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmbsy5.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmbsy6.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmbsy7.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmbsy8.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmbsy9.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmcsc8.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmcsc9.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmex7.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmex8.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmex9.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmmib5.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmmib6.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmmib7.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmmib8.mf\n texmf-dist/fonts/source/public/amsfonts/cmextra/cmmib9.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrcsc.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrfont.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrilu.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrital.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrmax.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrpunc.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrspl.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrspu.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrti.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/serb.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/serbspu.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyb10.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyb5.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyb6.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyb7.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyb8.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyb9.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyi10.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyi5.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyi6.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyi7.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyi8.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyi9.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyr10.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyr5.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyr6.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyr7.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyr8.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyr9.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncysc10.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyss10.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyss8.mf\n texmf-dist/fonts/source/public/amsfonts/cyrillic/wncyss9.mf\n texmf-dist/fonts/source/public/amsfonts/dummy/dummy.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/amsya.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/amsyb.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/asymbols.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/bsymbols.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msam10.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msam5.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msam6.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msam7.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msam8.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msam9.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msbm10.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msbm5.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msbm6.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msbm7.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msbm8.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/msbm9.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/xbbase.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/xbbold.mf\n texmf-dist/fonts/source/public/amsfonts/symbols/xbcaps.mf\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmbsy5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmbsy6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmbsy7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmbsy8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmbsy9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmcsc8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmcsc9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmmib5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmmib6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmmib7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmmib8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmmib9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyb10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyb5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyb6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyb7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyb8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyb9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyi10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyi5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyi6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyi7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyi8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyi9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyr10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyr5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyr6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyr7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyr8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyr9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncysc10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyss10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyss8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/cyrillic/wncyss9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/dummy/dummy.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/euex10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/euex7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/euex8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/euex9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufb10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufb5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufb6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufb7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufb8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufb9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufm10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufm5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufm6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufm7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufm8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eufm9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurb10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurb5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurb6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurb7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurb8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurb9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurm10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurm5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurm6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurm7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurm8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eurm9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusb10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusb5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusb6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusb7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusb8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusb9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusm10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusm5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusm6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusm7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusm8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/euler/eusm9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msam5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msam6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msam7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msam8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msam9.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm5.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm6.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm7.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm8.tfm\n texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm9.tfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmb10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmb10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbsy10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbsy10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx5.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx5.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx6.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx6.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbx9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbxsl10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbxsl10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbxti10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmbxti10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmcsc10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmcsc10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmdunh10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmdunh10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmff10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmff10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmfi10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmfi10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmfib8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmfib8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cminch.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cminch.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmitt10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmitt10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi5.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi5.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi6.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi6.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmi9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmib10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmmib10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr5.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr5.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr6.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmr9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsl9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsltt10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsltt10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss17.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss17.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmss9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssbx10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssbx10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssdc10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssdc10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi17.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi17.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssi9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssq8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssq8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssqi8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmssqi8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy5.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy5.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy6.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy6.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmsy9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtcsc10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtcsc10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtex10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtex10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtex8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtex8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtex9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtex9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmti9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt12.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt12.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmtt9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmu10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmu10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cm/cmvtt10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cm/cmvtt10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy5.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy5.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy6.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy6.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmbsy9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmcsc8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmcsc8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmcsc9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmcsc9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmex7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmex7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmex8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmex8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmex9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmex9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib5.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib5.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib6.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib6.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib7.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib7.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib8.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib8.pfm\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib9.pfb\n texmf-dist/fonts/type1/public/amsfonts/cmextra/cmmib9.pfm\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyb10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyb10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyi10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyi10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyr10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyr10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncysc10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncysc10.pfm\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyss10.pfb\n texmf-dist/fonts/type1/public/amsfonts/cyrillic/wncyss10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/euex10.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/euex10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/euex7.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/euex7.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/euex8.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/euex8.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/euex9.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/euex9.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eufb10.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eufb10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eufb5.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eufb5.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eufb7.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eufb7.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eufm10.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eufm10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eufm5.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eufm5.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eufm7.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eufm7.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eurb10.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eurb10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eurb5.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eurb5.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eurb7.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eurb7.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eurm10.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eurm10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eurm5.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eurm5.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eurm7.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eurm7.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eusb10.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eusb10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eusb5.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eusb5.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eusb7.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eusb7.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eusm10.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eusm10.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eusm5.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eusm5.pfm\n texmf-dist/fonts/type1/public/amsfonts/euler/eusm7.pfb\n texmf-dist/fonts/type1/public/amsfonts/euler/eusm7.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy10.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy10.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy5.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy5.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy6.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy6.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy7.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy7.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy8.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy8.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy9.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasy9.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasyb10.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lasyb10.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcircle1.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcircle1.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcirclew.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcirclew.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcmss8.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcmss8.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcmssb8.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcmssb8.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcmssi8.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/lcmssi8.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/line10.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/line10.pfm\n texmf-dist/fonts/type1/public/amsfonts/latxfont/linew10.pfb\n texmf-dist/fonts/type1/public/amsfonts/latxfont/linew10.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam10.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam10.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam5.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam5.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam6.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam6.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam7.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam7.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam8.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam8.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam9.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msam9.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm10.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm10.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm5.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm5.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm6.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm6.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm7.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm7.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm8.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm8.pfm\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm9.pfb\n texmf-dist/fonts/type1/public/amsfonts/symbols/msbm9.pfm\n texmf-dist/tex/latex/amsfonts/amsfonts.sty\n texmf-dist/tex/latex/amsfonts/amssymb.sty\n texmf-dist/tex/latex/amsfonts/cmmib57.sty\n texmf-dist/tex/latex/amsfonts/eucal.sty\n texmf-dist/tex/latex/amsfonts/eufrak.sty\n texmf-dist/tex/latex/amsfonts/euscript.sty\n texmf-dist/tex/latex/amsfonts/ueuex.fd\n texmf-dist/tex/latex/amsfonts/ueuf.fd\n texmf-dist/tex/latex/amsfonts/ueur.fd\n texmf-dist/tex/latex/amsfonts/ueus.fd\n texmf-dist/tex/latex/amsfonts/umsa.fd\n texmf-dist/tex/latex/amsfonts/umsb.fd\n texmf-dist/tex/plain/amsfonts/amssym.def\n texmf-dist/tex/plain/amsfonts/amssym.tex\n texmf-dist/tex/plain/amsfonts/cyracc.def\ncatalogue-ctan /fonts/amsfonts\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license ofl\ncatalogue-topics font font-maths font-symbol-maths font-bbd font-type1 font-mf\ncatalogue-version 3.04\n\nname amsmath\ncategory Package\nrevision 47349\ncatalogue latex-amsmath\nshortdesc AMS mathematical facilities for LaTeX\nlongdesc The package provides the principal packages in the AMS-LaTeX\nlongdesc distribution. It adapts for use in LaTeX most of the\nlongdesc mathematical features found in AMS-TeX; it is highly\nlongdesc recommended as an adjunct to serious mathematical typesetting\nlongdesc in LaTeX. When amsmath is loaded, AMS-LaTeX packages amsbsy\nlongdesc (for bold symbols), amsopn (for operator names) and amstext\nlongdesc (for text embedded in mathematics) are also loaded. amsmath is\nlongdesc part of the LaTeX required distribution; however, several\nlongdesc contributed packages add still further to its appeal; examples\nlongdesc are empheq, which provides functions for decorating and\nlongdesc highlighting mathematics, and ntheorem, for specifying theorem\nlongdesc (and similar) definitions.\ncontainersize 29872\ncontainerchecksum 30a89596017610a04cc3d8ac133f7ce2ecc90de1a9f1dc20a89a7be018f54737b56e8c56677dc3f687c710d2a818d24c22948e94c842aaab308137185567a493\ndoccontainersize 2319920\ndoccontainerchecksum 8fa29173d38c542821a6ea806e546ca717b3ef5da3c19265c8a10c416d00c8efa59e32f3e14106402f7123122882c383898859879881c833c966444e9a528195\nsrccontainersize 63452\nsrccontainerchecksum 2276048a9be00669865c488314420084b14e89ac0e96177b138897f746227dfcee13eff71ff4bd1670a4ad660a11dc603ec5e1ea94d88ba7c1d75c349182a7ef\nrunfiles size=48\n texmf-dist/tex/latex/amsmath/amsbsy.sty\n texmf-dist/tex/latex/amsmath/amscd.sty\n texmf-dist/tex/latex/amsmath/amsgen.sty\n texmf-dist/tex/latex/amsmath/amsmath.sty\n texmf-dist/tex/latex/amsmath/amsopn.sty\n texmf-dist/tex/latex/amsmath/amstex.sty\n texmf-dist/tex/latex/amsmath/amstext.sty\n texmf-dist/tex/latex/amsmath/amsxtra.sty\ncatalogue-also nath mathtools\ncatalogue-ctan /macros/latex/required/amsmath\ncatalogue-date 2018-04-06 22:52:03 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics maths\n\nname auto-pst-pdf-lua\ncategory Package\nrevision 47028\nshortdesc Using LuaLaTeX together with PostScript code\nlongdesc This package is a slightly modified version of auto-pst-pdf by\nlongdesc Will Robertson, which itself is a wrapper for pst-pdf by Rolf\nlongdesc Niepraschk. The package allows the use of LuaLaTeX together\nlongdesc with PostScript related code, eg. PSTricks. It depends on\nlongdesc ifpdf, ifluatex, ifplatform, and xkeyval.\ncontainersize 2512\ncontainerchecksum 445db94035bc1804849bbd9b460a2d50918506c0483e9b996fec0cbfa7ce2ef1672d2310d6910a974565fb978a902e0393b17a3da6b8384538f3bed6e233cd2d\ndoccontainersize 69088\ndoccontainerchecksum 1f0dd8df25eb07dd4956185850cbf8f7bb4f845b0da43da77933dd5af3ecbf05d305858e23abefae6ccd239309d28e526ee43e771d1d4a40d2e79c973f07a205\nrunfiles size=2\n texmf-dist/tex/latex/auto-pst-pdf-lua/auto-pst-pdf-lua.sty\ncatalogue-ctan /macros/latex/contrib/auto-pst-pdf-lua\ncatalogue-date 2018-03-19 09:17:38 +0100\ncatalogue-license lppl1.3c\ncatalogue-topics graphics-epspdf\ncatalogue-version 0.02\n\nname babel\ncategory Package\nrevision 47497\nshortdesc Multilingual support for Plain TeX or LaTeX\nlongdesc The package manages culturally-determined typographical (and\nlongdesc other) rules, and hyphenation patterns for a wide range of\nlongdesc languages. A document may select a single language to be\nlongdesc supported, or it may select several, in which case the document\nlongdesc may switch from one language to another in a variety of ways.\nlongdesc Babel uses contributed configuration files that provide the\nlongdesc detail of what has to be done for each language. Users of XeTeX\nlongdesc may alternatively use polyglossia instead of Babel.\ncontainersize 142164\ncontainerchecksum bfe1a75c744b0960ae410d82645ab0f9cd11b8022d4169dc0325672c6f5fb6e1d961932cec40dd199f813bdf5e5729c574170e9866362842e590f788ecf7ab05\ndoccontainersize 653960\ndoccontainerchecksum 240704932c75c6d332f18c1819448377c55528b736baf48c1478049dac2539aac023c68c6ad82ce764c20a511e34332c902ddf304504a1a4f0a767c23da22fb4\nsrccontainersize 588260\nsrccontainerchecksum 57e1297a4edf6277c572c4ec69ac6f13ecaaf5d92ef35a0c90f81dcc93be3e7bcc37e5e0707c1f84480fec40773fa60bc744eeeb168415b9b69859cdf2a72585\nrunfiles size=798\n texmf-dist/makeindex/babel/bbglo.ist\n texmf-dist/makeindex/babel/bbind.ist\n texmf-dist/tex/generic/babel/UKenglish.sty\n texmf-dist/tex/generic/babel/USenglish.sty\n texmf-dist/tex/generic/babel/afrikaans.sty\n texmf-dist/tex/generic/babel/albanian.sty\n texmf-dist/tex/generic/babel/american.sty\n texmf-dist/tex/generic/babel/austrian.sty\n texmf-dist/tex/generic/babel/babel-bidi-basic-r.lua\n texmf-dist/tex/generic/babel/babel-bidi-basic.lua\n texmf-dist/tex/generic/babel/babel-bidi.lua\n texmf-dist/tex/generic/babel/babel.def\n texmf-dist/tex/generic/babel/babel.sty\n texmf-dist/tex/generic/babel/bahasa.sty\n texmf-dist/tex/generic/babel/bahasam.sty\n texmf-dist/tex/generic/babel/basque.sty\n texmf-dist/tex/generic/babel/blplain.tex\n texmf-dist/tex/generic/babel/bplain.tex\n texmf-dist/tex/generic/babel/breton.sty\n texmf-dist/tex/generic/babel/british.sty\n texmf-dist/tex/generic/babel/bulgarian.sty\n texmf-dist/tex/generic/babel/catalan.sty\n texmf-dist/tex/generic/babel/croatian.sty\n texmf-dist/tex/generic/babel/czech.sty\n texmf-dist/tex/generic/babel/danish.sty\n texmf-dist/tex/generic/babel/dutch.sty\n texmf-dist/tex/generic/babel/english.sty\n texmf-dist/tex/generic/babel/esperanto.sty\n texmf-dist/tex/generic/babel/estonian.sty\n texmf-dist/tex/generic/babel/finnish.sty\n texmf-dist/tex/generic/babel/francais.sty\n texmf-dist/tex/generic/babel/galician.sty\n texmf-dist/tex/generic/babel/germanb.sty\n texmf-dist/tex/generic/babel/greek.sty\n texmf-dist/tex/generic/babel/hebrew.sty\n texmf-dist/tex/generic/babel/hyphen.cfg\n texmf-dist/tex/generic/babel/icelandic.sty\n texmf-dist/tex/generic/babel/interlingua.sty\n texmf-dist/tex/generic/babel/irish.sty\n texmf-dist/tex/generic/babel/italian.sty\n texmf-dist/tex/generic/babel/latin.sty\n texmf-dist/tex/generic/babel/locale/README-locale\n texmf-dist/tex/generic/babel/locale/af/babel-af.ini\n texmf-dist/tex/generic/babel/locale/af/babel-afrikaans.tex\n texmf-dist/tex/generic/babel/locale/agq/babel-aghem.tex\n texmf-dist/tex/generic/babel/locale/agq/babel-agq.ini\n texmf-dist/tex/generic/babel/locale/ak/babel-ak.ini\n texmf-dist/tex/generic/babel/locale/ak/babel-akan.tex\n texmf-dist/tex/generic/babel/locale/am/babel-am.ini\n texmf-dist/tex/generic/babel/locale/am/babel-amharic.tex\n texmf-dist/tex/generic/babel/locale/ar/babel-ar-DZ.ini\n texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.ini\n texmf-dist/tex/generic/babel/locale/ar/babel-ar-MA.log\n texmf-dist/tex/generic/babel/locale/ar/babel-ar-SY.ini\n texmf-dist/tex/generic/babel/locale/ar/babel-ar.ini\n texmf-dist/tex/generic/babel/locale/ar/babel-arabic-algeria.tex\n texmf-dist/tex/generic/babel/locale/ar/babel-arabic-dz.tex\n texmf-dist/tex/generic/babel/locale/ar/babel-arabic-ma.tex\n texmf-dist/tex/generic/babel/locale/ar/babel-arabic-morocco.tex\n texmf-dist/tex/generic/babel/locale/ar/babel-arabic-sy.tex\n texmf-dist/tex/generic/babel/locale/ar/babel-arabic-syria.tex\n texmf-dist/tex/generic/babel/locale/ar/babel-arabic.tex\n texmf-dist/tex/generic/babel/locale/as/babel-as.ini\n texmf-dist/tex/generic/babel/locale/as/babel-assamese.tex\n texmf-dist/tex/generic/babel/locale/asa/babel-asa.ini\n texmf-dist/tex/generic/babel/locale/asa/babel-asu.tex\n texmf-dist/tex/generic/babel/locale/ast/babel-ast.ini\n texmf-dist/tex/generic/babel/locale/ast/babel-asturian.tex\n texmf-dist/tex/generic/babel/locale/az/babel-az-Cyrl.ini\n texmf-dist/tex/generic/babel/locale/az/babel-az-Latn.ini\n texmf-dist/tex/generic/babel/locale/az/babel-az.ini\n texmf-dist/tex/generic/babel/locale/az/babel-azerbaijani-cyrillic.tex\n texmf-dist/tex/generic/babel/locale/az/babel-azerbaijani-cyrl.tex\n texmf-dist/tex/generic/babel/locale/az/babel-azerbaijani-latin.tex\n texmf-dist/tex/generic/babel/locale/az/babel-azerbaijani-latn.tex\n texmf-dist/tex/generic/babel/locale/az/babel-azerbaijani.tex\n texmf-dist/tex/generic/babel/locale/bas/babel-bas.ini\n texmf-dist/tex/generic/babel/locale/bas/babel-basaa.tex\n texmf-dist/tex/generic/babel/locale/be/babel-be.ini\n texmf-dist/tex/generic/babel/locale/be/babel-belarusian.tex\n texmf-dist/tex/generic/babel/locale/bem/babel-bem.ini\n texmf-dist/tex/generic/babel/locale/bem/babel-bemba.tex\n texmf-dist/tex/generic/babel/locale/bez/babel-bena.tex\n texmf-dist/tex/generic/babel/locale/bez/babel-bez.ini\n texmf-dist/tex/generic/babel/locale/bg/babel-bg.ini\n texmf-dist/tex/generic/babel/locale/bg/babel-bulgarian.tex\n texmf-dist/tex/generic/babel/locale/bm/babel-bambara.tex\n texmf-dist/tex/generic/babel/locale/bm/babel-bm.ini\n texmf-dist/tex/generic/babel/locale/bn/babel-bengali.tex\n texmf-dist/tex/generic/babel/locale/bn/babel-bn.ini\n texmf-dist/tex/generic/babel/locale/bo/babel-bo.ini\n texmf-dist/tex/generic/babel/locale/bo/babel-tibetan.tex\n texmf-dist/tex/generic/babel/locale/br/babel-br.ini\n texmf-dist/tex/generic/babel/locale/br/babel-breton.tex\n texmf-dist/tex/generic/babel/locale/brx/babel-bodo.tex\n texmf-dist/tex/generic/babel/locale/brx/babel-brx.ini\n texmf-dist/tex/generic/babel/locale/bs/babel-bosnian-cyrillic.tex\n texmf-dist/tex/generic/babel/locale/bs/babel-bosnian-cyrl.tex\n texmf-dist/tex/generic/babel/locale/bs/babel-bosnian-latin.tex\n texmf-dist/tex/generic/babel/locale/bs/babel-bosnian-latn.tex\n texmf-dist/tex/generic/babel/locale/bs/babel-bosnian.tex\n texmf-dist/tex/generic/babel/locale/bs/babel-bs-Cyrl.ini\n texmf-dist/tex/generic/babel/locale/bs/babel-bs-Latn.ini\n texmf-dist/tex/generic/babel/locale/bs/babel-bs.ini\n texmf-dist/tex/generic/babel/locale/ca/babel-ca.ini\n texmf-dist/tex/generic/babel/locale/ca/babel-catalan.tex\n texmf-dist/tex/generic/babel/locale/ce/babel-ce.ini\n texmf-dist/tex/generic/babel/locale/ce/babel-chechen.tex\n texmf-dist/tex/generic/babel/locale/cgg/babel-cgg.ini\n texmf-dist/tex/generic/babel/locale/cgg/babel-chiga.tex\n texmf-dist/tex/generic/babel/locale/chr/babel-cherokee.tex\n texmf-dist/tex/generic/babel/locale/chr/babel-chr.ini\n texmf-dist/tex/generic/babel/locale/ckb/babel-centralkurdish.tex\n texmf-dist/tex/generic/babel/locale/ckb/babel-ckb.ini\n texmf-dist/tex/generic/babel/locale/cs/babel-cs.ini\n texmf-dist/tex/generic/babel/locale/cs/babel-czech.tex\n texmf-dist/tex/generic/babel/locale/cy/babel-cy.ini\n texmf-dist/tex/generic/babel/locale/cy/babel-welsh.tex\n texmf-dist/tex/generic/babel/locale/da/babel-da.ini\n texmf-dist/tex/generic/babel/locale/da/babel-danish.tex\n texmf-dist/tex/generic/babel/locale/dav/babel-dav.ini\n texmf-dist/tex/generic/babel/locale/dav/babel-taita.tex\n texmf-dist/tex/generic/babel/locale/de/babel-austrian.tex\n texmf-dist/tex/generic/babel/locale/de/babel-de-AT.ini\n texmf-dist/tex/generic/babel/locale/de/babel-de-CH.ini\n texmf-dist/tex/generic/babel/locale/de/babel-de.ini\n texmf-dist/tex/generic/babel/locale/de/babel-german-at.tex\n texmf-dist/tex/generic/babel/locale/de/babel-german-austria.tex\n texmf-dist/tex/generic/babel/locale/de/babel-german-ch.tex\n texmf-dist/tex/generic/babel/locale/de/babel-german-switzerland.tex\n texmf-dist/tex/generic/babel/locale/de/babel-german.tex\n texmf-dist/tex/generic/babel/locale/de/babel-nswissgerman.tex\n texmf-dist/tex/generic/babel/locale/de/babel-swissgerman.tex\n texmf-dist/tex/generic/babel/locale/dje/babel-dje.ini\n texmf-dist/tex/generic/babel/locale/dje/babel-zarma.tex\n texmf-dist/tex/generic/babel/locale/dsb/babel-dsb.ini\n texmf-dist/tex/generic/babel/locale/dsb/babel-dsb.log\n texmf-dist/tex/generic/babel/locale/dsb/babel-lowersorbian.tex\n texmf-dist/tex/generic/babel/locale/dsb/babel-lsorbian.tex\n texmf-dist/tex/generic/babel/locale/dua/babel-dua.ini\n texmf-dist/tex/generic/babel/locale/dua/babel-duala.tex\n texmf-dist/tex/generic/babel/locale/dyo/babel-dyo.ini\n texmf-dist/tex/generic/babel/locale/dyo/babel-jolafonyi.tex\n texmf-dist/tex/generic/babel/locale/dz/babel-dz.ini\n texmf-dist/tex/generic/babel/locale/dz/babel-dzongkha.tex\n texmf-dist/tex/generic/babel/locale/ebu/babel-ebu.ini\n texmf-dist/tex/generic/babel/locale/ebu/babel-embu.tex\n texmf-dist/tex/generic/babel/locale/ee/babel-ee.ini\n texmf-dist/tex/generic/babel/locale/ee/babel-ewe.tex\n texmf-dist/tex/generic/babel/locale/el/babel-el.ini\n texmf-dist/tex/generic/babel/locale/el/babel-greek.tex\n texmf-dist/tex/generic/babel/locale/en/babel-american.tex\n texmf-dist/tex/generic/babel/locale/en/babel-australian.tex\n texmf-dist/tex/generic/babel/locale/en/babel-british.tex\n texmf-dist/tex/generic/babel/locale/en/babel-canadian.tex\n texmf-dist/tex/generic/babel/locale/en/babel-en-AU.ini\n texmf-dist/tex/generic/babel/locale/en/babel-en-CA.ini\n texmf-dist/tex/generic/babel/locale/en/babel-en-GB.ini\n texmf-dist/tex/generic/babel/locale/en/babel-en-NZ.ini\n texmf-dist/tex/generic/babel/locale/en/babel-en-US.ini\n texmf-dist/tex/generic/babel/locale/en/babel-en.ini\n texmf-dist/tex/generic/babel/locale/en/babel-english-au.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-australia.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-ca.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-canada.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-gb.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-newzealand.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-nz.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-unitedkingdom.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-unitedstates.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english-us.tex\n texmf-dist/tex/generic/babel/locale/en/babel-english.tex\n texmf-dist/tex/generic/babel/locale/en/babel-newzealand.tex\n texmf-dist/tex/generic/babel/locale/en/babel-ukenglish.tex\n texmf-dist/tex/generic/babel/locale/en/babel-usenglish.tex\n texmf-dist/tex/generic/babel/locale/eo/babel-eo.ini\n texmf-dist/tex/generic/babel/locale/eo/babel-esperanto.tex\n texmf-dist/tex/generic/babel/locale/es/babel-es-MX.ini\n texmf-dist/tex/generic/babel/locale/es/babel-es.ini\n texmf-dist/tex/generic/babel/locale/es/babel-mexican.tex\n texmf-dist/tex/generic/babel/locale/es/babel-spanish-mexico.tex\n texmf-dist/tex/generic/babel/locale/es/babel-spanish-mx.tex\n texmf-dist/tex/generic/babel/locale/es/babel-spanish.tex\n texmf-dist/tex/generic/babel/locale/et/babel-estonian.tex\n texmf-dist/tex/generic/babel/locale/et/babel-et.ini\n texmf-dist/tex/generic/babel/locale/eu/babel-basque.tex\n texmf-dist/tex/generic/babel/locale/eu/babel-eu.ini\n texmf-dist/tex/generic/babel/locale/ewo/babel-ewo.ini\n texmf-dist/tex/generic/babel/locale/ewo/babel-ewondo.tex\n texmf-dist/tex/generic/babel/locale/fa/babel-fa.ini\n texmf-dist/tex/generic/babel/locale/fa/babel-persian.tex\n texmf-dist/tex/generic/babel/locale/ff/babel-ff.ini\n texmf-dist/tex/generic/babel/locale/ff/babel-fulah.tex\n texmf-dist/tex/generic/babel/locale/fi/babel-fi.ini\n texmf-dist/tex/generic/babel/locale/fi/babel-finnish.tex\n texmf-dist/tex/generic/babel/locale/fil/babel-fil.ini\n texmf-dist/tex/generic/babel/locale/fil/babel-filipino.tex\n texmf-dist/tex/generic/babel/locale/fo/babel-faroese.tex\n texmf-dist/tex/generic/babel/locale/fo/babel-fo.ini\n texmf-dist/tex/generic/babel/locale/fr/babel-fr-BE.ini\n texmf-dist/tex/generic/babel/locale/fr/babel-fr-CA.ini\n texmf-dist/tex/generic/babel/locale/fr/babel-fr-CH.ini\n texmf-dist/tex/generic/babel/locale/fr/babel-fr-LU.ini\n texmf-dist/tex/generic/babel/locale/fr/babel-fr.ini\n texmf-dist/tex/generic/babel/locale/fr/babel-french-be.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french-belgium.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french-ca.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french-canada.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french-ch.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french-lu.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french-luxembourg.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french-switzerland.tex\n texmf-dist/tex/generic/babel/locale/fr/babel-french.tex\n texmf-dist/tex/generic/babel/locale/fur/babel-friulian.tex\n texmf-dist/tex/generic/babel/locale/fur/babel-fur.ini\n texmf-dist/tex/generic/babel/locale/fy/babel-fy.ini\n texmf-dist/tex/generic/babel/locale/fy/babel-westernfrisian.tex\n texmf-dist/tex/generic/babel/locale/ga/babel-ga.ini\n texmf-dist/tex/generic/babel/locale/ga/babel-irish.tex\n texmf-dist/tex/generic/babel/locale/gd/babel-gd.ini\n texmf-dist/tex/generic/babel/locale/gd/babel-scottishgaelic.tex\n texmf-dist/tex/generic/babel/locale/gl/babel-galician.tex\n texmf-dist/tex/generic/babel/locale/gl/babel-gl.ini\n texmf-dist/tex/generic/babel/locale/gsw/babel-gsw.ini\n texmf-dist/tex/generic/babel/locale/gu/babel-gu.ini\n texmf-dist/tex/generic/babel/locale/gu/babel-gujarati.tex\n texmf-dist/tex/generic/babel/locale/guz/babel-gusii.tex\n texmf-dist/tex/generic/babel/locale/guz/babel-guz.ini\n texmf-dist/tex/generic/babel/locale/gv/babel-gv.ini\n texmf-dist/tex/generic/babel/locale/gv/babel-manx.tex\n texmf-dist/tex/generic/babel/locale/ha/babel-ha-GH.ini\n texmf-dist/tex/generic/babel/locale/ha/babel-ha-NE.ini\n texmf-dist/tex/generic/babel/locale/ha/babel-ha.ini\n texmf-dist/tex/generic/babel/locale/ha/babel-hausa-gh.tex\n texmf-dist/tex/generic/babel/locale/ha/babel-hausa-ghana.tex\n texmf-dist/tex/generic/babel/locale/ha/babel-hausa-ne.tex\n texmf-dist/tex/generic/babel/locale/ha/babel-hausa-niger.tex\n texmf-dist/tex/generic/babel/locale/ha/babel-hausa.tex\n texmf-dist/tex/generic/babel/locale/haw/babel-haw.ini\n texmf-dist/tex/generic/babel/locale/haw/babel-hawaiian.tex\n texmf-dist/tex/generic/babel/locale/he/babel-he.ini\n texmf-dist/tex/generic/babel/locale/he/babel-hebrew.tex\n texmf-dist/tex/generic/babel/locale/hi/babel-hi.ini\n texmf-dist/tex/generic/babel/locale/hi/babel-hi.log\n texmf-dist/tex/generic/babel/locale/hi/babel-hindi.tex\n texmf-dist/tex/generic/babel/locale/hr/babel-croatian.tex\n texmf-dist/tex/generic/babel/locale/hr/babel-hr.ini\n texmf-dist/tex/generic/babel/locale/hsb/babel-hsb.ini\n texmf-dist/tex/generic/babel/locale/hsb/babel-uppersorbian.tex\n texmf-dist/tex/generic/babel/locale/hsb/babel-usorbian.tex\n texmf-dist/tex/generic/babel/locale/hu/babel-hu.ini\n texmf-dist/tex/generic/babel/locale/hu/babel-hungarian.tex\n texmf-dist/tex/generic/babel/locale/hy/babel-armenian.tex\n texmf-dist/tex/generic/babel/locale/hy/babel-hy.ini\n texmf-dist/tex/generic/babel/locale/ia/babel-ia.ini\n texmf-dist/tex/generic/babel/locale/ia/babel-interlingua.tex\n texmf-dist/tex/generic/babel/locale/id/babel-id.ini\n texmf-dist/tex/generic/babel/locale/id/babel-indonesian.tex\n texmf-dist/tex/generic/babel/locale/ig/babel-ig.ini\n texmf-dist/tex/generic/babel/locale/ig/babel-igbo.tex\n texmf-dist/tex/generic/babel/locale/ii/babel-ii.ini\n texmf-dist/tex/generic/babel/locale/ii/babel-sichuanyi.tex\n texmf-dist/tex/generic/babel/locale/is/babel-icelandic.tex\n texmf-dist/tex/generic/babel/locale/is/babel-is.ini\n texmf-dist/tex/generic/babel/locale/it/babel-it.ini\n texmf-dist/tex/generic/babel/locale/it/babel-italian.tex\n texmf-dist/tex/generic/babel/locale/ja/babel-ja.ini\n texmf-dist/tex/generic/babel/locale/ja/babel-japanese.tex\n texmf-dist/tex/generic/babel/locale/jgo/babel-jgo.ini\n texmf-dist/tex/generic/babel/locale/jgo/babel-ngomba.tex\n texmf-dist/tex/generic/babel/locale/jmc/babel-jmc.ini\n texmf-dist/tex/generic/babel/locale/jmc/babel-machame.tex\n texmf-dist/tex/generic/babel/locale/ka/babel-georgian.tex\n texmf-dist/tex/generic/babel/locale/ka/babel-ka.ini\n texmf-dist/tex/generic/babel/locale/kab/babel-kab.ini\n texmf-dist/tex/generic/babel/locale/kab/babel-kabyle.tex\n texmf-dist/tex/generic/babel/locale/kam/babel-kam.ini\n texmf-dist/tex/generic/babel/locale/kam/babel-kamba.tex\n texmf-dist/tex/generic/babel/locale/kde/babel-kde.ini\n texmf-dist/tex/generic/babel/locale/kde/babel-makonde.tex\n texmf-dist/tex/generic/babel/locale/kea/babel-kabuverdianu.tex\n texmf-dist/tex/generic/babel/locale/kea/babel-kea.ini\n texmf-dist/tex/generic/babel/locale/khq/babel-khq.ini\n texmf-dist/tex/generic/babel/locale/khq/babel-koyrachiini.tex\n texmf-dist/tex/generic/babel/locale/ki/babel-ki.ini\n texmf-dist/tex/generic/babel/locale/ki/babel-kikuyu.tex\n texmf-dist/tex/generic/babel/locale/kk/babel-kazakh.tex\n texmf-dist/tex/generic/babel/locale/kk/babel-kk.ini\n texmf-dist/tex/generic/babel/locale/kkj/babel-kako.tex\n texmf-dist/tex/generic/babel/locale/kkj/babel-kkj.ini\n texmf-dist/tex/generic/babel/locale/kl/babel-kalaallisut.tex\n texmf-dist/tex/generic/babel/locale/kl/babel-kl.ini\n texmf-dist/tex/generic/babel/locale/kln/babel-kalenjin.tex\n texmf-dist/tex/generic/babel/locale/kln/babel-kln.ini\n texmf-dist/tex/generic/babel/locale/km/babel-khmer.tex\n texmf-dist/tex/generic/babel/locale/km/babel-km.ini\n texmf-dist/tex/generic/babel/locale/kn/babel-kannada.tex\n texmf-dist/tex/generic/babel/locale/kn/babel-kn.ini\n texmf-dist/tex/generic/babel/locale/ko/babel-ko.ini\n texmf-dist/tex/generic/babel/locale/ko/babel-korean.tex\n texmf-dist/tex/generic/babel/locale/kok/babel-kok.ini\n texmf-dist/tex/generic/babel/locale/kok/babel-konkani.tex\n texmf-dist/tex/generic/babel/locale/ks/babel-kashmiri.tex\n texmf-dist/tex/generic/babel/locale/ks/babel-ks.ini\n texmf-dist/tex/generic/babel/locale/ksb/babel-ksb.ini\n texmf-dist/tex/generic/babel/locale/ksb/babel-shambala.tex\n texmf-dist/tex/generic/babel/locale/ksf/babel-bafia.tex\n texmf-dist/tex/generic/babel/locale/ksf/babel-ksf.ini\n texmf-dist/tex/generic/babel/locale/ksh/babel-colognian.tex\n texmf-dist/tex/generic/babel/locale/ksh/babel-ksh.ini\n texmf-dist/tex/generic/babel/locale/kw/babel-cornish.tex\n texmf-dist/tex/generic/babel/locale/kw/babel-kw.ini\n texmf-dist/tex/generic/babel/locale/ky/babel-ky.ini\n texmf-dist/tex/generic/babel/locale/ky/babel-kyrgyz.tex\n texmf-dist/tex/generic/babel/locale/lag/babel-lag.ini\n texmf-dist/tex/generic/babel/locale/lag/babel-langi.tex\n texmf-dist/tex/generic/babel/locale/lb/babel-lb.ini\n texmf-dist/tex/generic/babel/locale/lb/babel-luxembourgish.tex\n texmf-dist/tex/generic/babel/locale/lg/babel-ganda.tex\n texmf-dist/tex/generic/babel/locale/lg/babel-lg.ini\n texmf-dist/tex/generic/babel/locale/lkt/babel-lakota.tex\n texmf-dist/tex/generic/babel/locale/lkt/babel-lkt.ini\n texmf-dist/tex/generic/babel/locale/ln/babel-lingala.tex\n texmf-dist/tex/generic/babel/locale/ln/babel-ln.ini\n texmf-dist/tex/generic/babel/locale/lo/babel-lao.tex\n texmf-dist/tex/generic/babel/locale/lo/babel-lo.ini\n texmf-dist/tex/generic/babel/locale/lrc/babel-lrc.ini\n texmf-dist/tex/generic/babel/locale/lrc/babel-northernluri.tex\n texmf-dist/tex/generic/babel/locale/lt/babel-lithuanian.tex\n texmf-dist/tex/generic/babel/locale/lt/babel-lt.ini\n texmf-dist/tex/generic/babel/locale/lu/babel-lu.ini\n texmf-dist/tex/generic/babel/locale/lu/babel-lubakatanga.tex\n texmf-dist/tex/generic/babel/locale/luo/babel-luo.ini\n texmf-dist/tex/generic/babel/locale/luo/babel-luo.tex\n texmf-dist/tex/generic/babel/locale/luy/babel-luy.ini\n texmf-dist/tex/generic/babel/locale/luy/babel-luyia.tex\n texmf-dist/tex/generic/babel/locale/lv/babel-latvian.tex\n texmf-dist/tex/generic/babel/locale/lv/babel-lv.ini\n texmf-dist/tex/generic/babel/locale/mas/babel-mas.ini\n texmf-dist/tex/generic/babel/locale/mas/babel-masai.tex\n texmf-dist/tex/generic/babel/locale/mer/babel-mer.ini\n texmf-dist/tex/generic/babel/locale/mer/babel-meru.tex\n texmf-dist/tex/generic/babel/locale/mfe/babel-mfe.ini\n texmf-dist/tex/generic/babel/locale/mfe/babel-morisyen.tex\n texmf-dist/tex/generic/babel/locale/mg/babel-malagasy.tex\n texmf-dist/tex/generic/babel/locale/mg/babel-mg.ini\n texmf-dist/tex/generic/babel/locale/mgh/babel-makhuwameetto.tex\n texmf-dist/tex/generic/babel/locale/mgh/babel-mgh.ini\n texmf-dist/tex/generic/babel/locale/mgo/babel-meta.tex\n texmf-dist/tex/generic/babel/locale/mgo/babel-mgo.ini\n texmf-dist/tex/generic/babel/locale/mk/babel-macedonian.tex\n texmf-dist/tex/generic/babel/locale/mk/babel-mk.ini\n texmf-dist/tex/generic/babel/locale/ml/babel-malayalam.tex\n texmf-dist/tex/generic/babel/locale/ml/babel-ml.ini\n texmf-dist/tex/generic/babel/locale/mn/babel-mn.ini\n texmf-dist/tex/generic/babel/locale/mn/babel-mongolian.tex\n texmf-dist/tex/generic/babel/locale/mr/babel-marathi.tex\n texmf-dist/tex/generic/babel/locale/mr/babel-mr.ini\n texmf-dist/tex/generic/babel/locale/ms/babel-malay-bn.tex\n texmf-dist/tex/generic/babel/locale/ms/babel-malay-brunei.tex\n texmf-dist/tex/generic/babel/locale/ms/babel-malay-sg.tex\n texmf-dist/tex/generic/babel/locale/ms/babel-malay-singapore.tex\n texmf-dist/tex/generic/babel/locale/ms/babel-malay.tex\n texmf-dist/tex/generic/babel/locale/ms/babel-ms-BN.ini\n texmf-dist/tex/generic/babel/locale/ms/babel-ms-SG.ini\n texmf-dist/tex/generic/babel/locale/ms/babel-ms.ini\n texmf-dist/tex/generic/babel/locale/mt/babel-maltese.tex\n texmf-dist/tex/generic/babel/locale/mt/babel-mt.ini\n texmf-dist/tex/generic/babel/locale/mua/babel-mua.ini\n texmf-dist/tex/generic/babel/locale/mua/babel-mundang.tex\n texmf-dist/tex/generic/babel/locale/my/babel-burmese.tex\n texmf-dist/tex/generic/babel/locale/my/babel-my.ini\n texmf-dist/tex/generic/babel/locale/mzn/babel-mazanderani.tex\n texmf-dist/tex/generic/babel/locale/mzn/babel-mzn.ini\n texmf-dist/tex/generic/babel/locale/naq/babel-nama.tex\n texmf-dist/tex/generic/babel/locale/naq/babel-naq.ini\n texmf-dist/tex/generic/babel/locale/nb/babel-nb.ini\n texmf-dist/tex/generic/babel/locale/nb/babel-norsk.tex\n texmf-dist/tex/generic/babel/locale/nb/babel-norwegianbokmal.tex\n texmf-dist/tex/generic/babel/locale/nd/babel-nd.ini\n texmf-dist/tex/generic/babel/locale/nd/babel-northndebele.tex\n texmf-dist/tex/generic/babel/locale/ne/babel-ne.ini\n texmf-dist/tex/generic/babel/locale/ne/babel-nepali.tex\n texmf-dist/tex/generic/babel/locale/nl/babel-dutch.tex\n texmf-dist/tex/generic/babel/locale/nl/babel-nl.ini\n texmf-dist/tex/generic/babel/locale/nmg/babel-kwasio.tex\n texmf-dist/tex/generic/babel/locale/nmg/babel-nmg.ini\n texmf-dist/tex/generic/babel/locale/nn/babel-nn.ini\n texmf-dist/tex/generic/babel/locale/nn/babel-norwegiannynorsk.tex\n texmf-dist/tex/generic/babel/locale/nn/babel-nynorsk.tex\n texmf-dist/tex/generic/babel/locale/nnh/babel-ngiemboon.tex\n texmf-dist/tex/generic/babel/locale/nnh/babel-nnh.ini\n texmf-dist/tex/generic/babel/locale/nus/babel-nuer.tex\n texmf-dist/tex/generic/babel/locale/nus/babel-nus.ini\n texmf-dist/tex/generic/babel/locale/nyn/babel-nyankole.tex\n texmf-dist/tex/generic/babel/locale/nyn/babel-nyn.ini\n texmf-dist/tex/generic/babel/locale/oc/babel-oc.ini\n texmf-dist/tex/generic/babel/locale/oc/babel-occitan.tex\n texmf-dist/tex/generic/babel/locale/om/babel-om.ini\n texmf-dist/tex/generic/babel/locale/om/babel-oromo.tex\n texmf-dist/tex/generic/babel/locale/or/babel-or.ini\n texmf-dist/tex/generic/babel/locale/or/babel-oriya.tex\n texmf-dist/tex/generic/babel/locale/os/babel-os.ini\n texmf-dist/tex/generic/babel/locale/os/babel-ossetic.tex\n texmf-dist/tex/generic/babel/locale/pa/babel-pa-Arab.ini\n texmf-dist/tex/generic/babel/locale/pa/babel-pa-Guru.ini\n texmf-dist/tex/generic/babel/locale/pa/babel-pa.ini\n texmf-dist/tex/generic/babel/locale/pa/babel-punjabi-arab.tex\n texmf-dist/tex/generic/babel/locale/pa/babel-punjabi-arabic.tex\n texmf-dist/tex/generic/babel/locale/pa/babel-punjabi-gurmukhi.tex\n texmf-dist/tex/generic/babel/locale/pa/babel-punjabi-guru.tex\n texmf-dist/tex/generic/babel/locale/pa/babel-punjabi.tex\n texmf-dist/tex/generic/babel/locale/pl/babel-pl.ini\n texmf-dist/tex/generic/babel/locale/pl/babel-polish.tex\n texmf-dist/tex/generic/babel/locale/pms/babel-piedmontese.tex\n texmf-dist/tex/generic/babel/locale/pms/babel-pms.ini\n texmf-dist/tex/generic/babel/locale/ps/babel-pashto.tex\n texmf-dist/tex/generic/babel/locale/ps/babel-ps.ini\n texmf-dist/tex/generic/babel/locale/pt/babel-brazilian.tex\n texmf-dist/tex/generic/babel/locale/pt/babel-portuguese-br.tex\n texmf-dist/tex/generic/babel/locale/pt/babel-portuguese-brazil.tex\n texmf-dist/tex/generic/babel/locale/pt/babel-portuguese-portugal.tex\n texmf-dist/tex/generic/babel/locale/pt/babel-portuguese-pt.tex\n texmf-dist/tex/generic/babel/locale/pt/babel-portuguese.tex\n texmf-dist/tex/generic/babel/locale/pt/babel-pt-BR.ini\n texmf-dist/tex/generic/babel/locale/pt/babel-pt-PT.ini\n texmf-dist/tex/generic/babel/locale/pt/babel-pt.ini\n texmf-dist/tex/generic/babel/locale/qu/babel-qu.ini\n texmf-dist/tex/generic/babel/locale/qu/babel-quechua.tex\n texmf-dist/tex/generic/babel/locale/rm/babel-rm.ini\n texmf-dist/tex/generic/babel/locale/rm/babel-romansh.tex\n texmf-dist/tex/generic/babel/locale/rn/babel-rn.ini\n texmf-dist/tex/generic/babel/locale/rn/babel-rundi.tex\n texmf-dist/tex/generic/babel/locale/ro/babel-ro.ini\n texmf-dist/tex/generic/babel/locale/ro/babel-romanian.tex\n texmf-dist/tex/generic/babel/locale/rof/babel-rof.ini\n texmf-dist/tex/generic/babel/locale/rof/babel-rombo.tex\n texmf-dist/tex/generic/babel/locale/ru/babel-ru.ini\n texmf-dist/tex/generic/babel/locale/ru/babel-russian.tex\n texmf-dist/tex/generic/babel/locale/rw/babel-kinyarwanda.tex\n texmf-dist/tex/generic/babel/locale/rw/babel-rw.ini\n texmf-dist/tex/generic/babel/locale/rwk/babel-rwa.tex\n texmf-dist/tex/generic/babel/locale/rwk/babel-rwk.ini\n texmf-dist/tex/generic/babel/locale/sah/babel-sah.ini\n texmf-dist/tex/generic/babel/locale/sah/babel-sakha.tex\n texmf-dist/tex/generic/babel/locale/saq/babel-samburu.tex\n texmf-dist/tex/generic/babel/locale/saq/babel-saq.ini\n texmf-dist/tex/generic/babel/locale/sbp/babel-sangu.tex\n texmf-dist/tex/generic/babel/locale/sbp/babel-sbp.ini\n texmf-dist/tex/generic/babel/locale/se/babel-northernsami.tex\n texmf-dist/tex/generic/babel/locale/se/babel-samin.tex\n texmf-dist/tex/generic/babel/locale/se/babel-se.ini\n texmf-dist/tex/generic/babel/locale/seh/babel-seh.ini\n texmf-dist/tex/generic/babel/locale/seh/babel-sena.tex\n texmf-dist/tex/generic/babel/locale/ses/babel-koyraborosenni.tex\n texmf-dist/tex/generic/babel/locale/ses/babel-ses.ini\n texmf-dist/tex/generic/babel/locale/sg/babel-sango.tex\n texmf-dist/tex/generic/babel/locale/sg/babel-sg.ini\n texmf-dist/tex/generic/babel/locale/shi/babel-shi-Latn.ini\n texmf-dist/tex/generic/babel/locale/shi/babel-shi-Tfng.ini\n texmf-dist/tex/generic/babel/locale/shi/babel-shi.ini\n texmf-dist/tex/generic/babel/locale/shi/babel-tachelhit-latin.tex\n texmf-dist/tex/generic/babel/locale/shi/babel-tachelhit-latn.tex\n texmf-dist/tex/generic/babel/locale/shi/babel-tachelhit-tfng.tex\n texmf-dist/tex/generic/babel/locale/shi/babel-tachelhit-tifinagh.tex\n texmf-dist/tex/generic/babel/locale/shi/babel-tachelhit.tex\n texmf-dist/tex/generic/babel/locale/si/babel-si.ini\n texmf-dist/tex/generic/babel/locale/si/babel-sinhala.tex\n texmf-dist/tex/generic/babel/locale/sk/babel-sk.ini\n texmf-dist/tex/generic/babel/locale/sk/babel-slovak.tex\n texmf-dist/tex/generic/babel/locale/sl/babel-sl.ini\n texmf-dist/tex/generic/babel/locale/sl/babel-slovene.tex\n texmf-dist/tex/generic/babel/locale/sl/babel-slovenian.tex\n texmf-dist/tex/generic/babel/locale/smn/babel-inarisami.tex\n texmf-dist/tex/generic/babel/locale/smn/babel-smn.ini\n texmf-dist/tex/generic/babel/locale/sn/babel-shona.tex\n texmf-dist/tex/generic/babel/locale/sn/babel-sn.ini\n texmf-dist/tex/generic/babel/locale/so/babel-so.ini\n texmf-dist/tex/generic/babel/locale/so/babel-somali.tex\n texmf-dist/tex/generic/babel/locale/sq/babel-albanian.tex\n texmf-dist/tex/generic/babel/locale/sq/babel-sq.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrillic-bosniaherzegovina.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrillic-kosovo.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrillic-montenegro.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrillic.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrl-ba.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrl-me.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrl-xk.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-cyrl.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latin-bosniaherzegovina.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latin-kosovo.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latin-montenegro.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latin.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latn-ba.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latn-me.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latn-xk.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian-latn.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-serbian.tex\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Cyrl-BA.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Cyrl-ME.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Cyrl-XK.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Cyrl.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Latn-BA.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Latn-ME.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Latn-XK.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr-Latn.ini\n texmf-dist/tex/generic/babel/locale/sr/babel-sr.ini\n texmf-dist/tex/generic/babel/locale/sv/babel-sv.ini\n texmf-dist/tex/generic/babel/locale/sv/babel-swedish.tex\n texmf-dist/tex/generic/babel/locale/sw/babel-sw.ini\n texmf-dist/tex/generic/babel/locale/sw/babel-swahili.tex\n texmf-dist/tex/generic/babel/locale/ta/babel-ta.ini\n texmf-dist/tex/generic/babel/locale/ta/babel-tamil.tex\n texmf-dist/tex/generic/babel/locale/te/babel-te.ini\n texmf-dist/tex/generic/babel/locale/te/babel-telugu.tex\n texmf-dist/tex/generic/babel/locale/teo/babel-teo.ini\n texmf-dist/tex/generic/babel/locale/teo/babel-teso.tex\n texmf-dist/tex/generic/babel/locale/th/babel-th.ini\n texmf-dist/tex/generic/babel/locale/th/babel-thai.tex\n texmf-dist/tex/generic/babel/locale/ti/babel-ti.ini\n texmf-dist/tex/generic/babel/locale/ti/babel-tigrinya.tex\n texmf-dist/tex/generic/babel/locale/tk/babel-tk.ini\n texmf-dist/tex/generic/babel/locale/tk/babel-turkmen.tex\n texmf-dist/tex/generic/babel/locale/to/babel-to.ini\n texmf-dist/tex/generic/babel/locale/to/babel-tongan.tex\n texmf-dist/tex/generic/babel/locale/tr/babel-tr.ini\n texmf-dist/tex/generic/babel/locale/tr/babel-turkish.tex\n texmf-dist/tex/generic/babel/locale/twq/babel-tasawaq.tex\n texmf-dist/tex/generic/babel/locale/twq/babel-twq.ini\n texmf-dist/tex/generic/babel/locale/tzm/babel-centralatlastamazight.tex\n texmf-dist/tex/generic/babel/locale/tzm/babel-tzm.ini\n texmf-dist/tex/generic/babel/locale/ug/babel-ug.ini\n texmf-dist/tex/generic/babel/locale/ug/babel-uyghur.tex\n texmf-dist/tex/generic/babel/locale/uk/babel-uk.ini\n texmf-dist/tex/generic/babel/locale/uk/babel-ukrainian.tex\n texmf-dist/tex/generic/babel/locale/ur/babel-ur.ini\n texmf-dist/tex/generic/babel/locale/ur/babel-urdu.tex\n texmf-dist/tex/generic/babel/locale/uz/babel-uz-Arab.ini\n texmf-dist/tex/generic/babel/locale/uz/babel-uz-Cyrl.ini\n texmf-dist/tex/generic/babel/locale/uz/babel-uz-Latn.ini\n texmf-dist/tex/generic/babel/locale/uz/babel-uz.ini\n texmf-dist/tex/generic/babel/locale/uz/babel-uzbek-arab.tex\n texmf-dist/tex/generic/babel/locale/uz/babel-uzbek-arabic.tex\n texmf-dist/tex/generic/babel/locale/uz/babel-uzbek-cyrillic.tex\n texmf-dist/tex/generic/babel/locale/uz/babel-uzbek-cyrl.tex\n texmf-dist/tex/generic/babel/locale/uz/babel-uzbek-latin.tex\n texmf-dist/tex/generic/babel/locale/uz/babel-uzbek-latn.tex\n texmf-dist/tex/generic/babel/locale/uz/babel-uzbek.tex\n texmf-dist/tex/generic/babel/locale/vai/babel-vai-Latn.ini\n texmf-dist/tex/generic/babel/locale/vai/babel-vai-Vaii.ini\n texmf-dist/tex/generic/babel/locale/vai/babel-vai-latin.tex\n texmf-dist/tex/generic/babel/locale/vai/babel-vai-latn.tex\n texmf-dist/tex/generic/babel/locale/vai/babel-vai-vai.tex\n texmf-dist/tex/generic/babel/locale/vai/babel-vai-vaii.tex\n texmf-dist/tex/generic/babel/locale/vai/babel-vai.ini\n texmf-dist/tex/generic/babel/locale/vai/babel-vai.tex\n texmf-dist/tex/generic/babel/locale/vi/babel-vi.ini\n texmf-dist/tex/generic/babel/locale/vi/babel-vietnam.tex\n texmf-dist/tex/generic/babel/locale/vi/babel-vietnamese.tex\n texmf-dist/tex/generic/babel/locale/vun/babel-vun.ini\n texmf-dist/tex/generic/babel/locale/vun/babel-vunjo.tex\n texmf-dist/tex/generic/babel/locale/wae/babel-wae.ini\n texmf-dist/tex/generic/babel/locale/wae/babel-walser.tex\n texmf-dist/tex/generic/babel/locale/xog/babel-soga.tex\n texmf-dist/tex/generic/babel/locale/xog/babel-xog.ini\n texmf-dist/tex/generic/babel/locale/yav/babel-yangben.tex\n texmf-dist/tex/generic/babel/locale/yav/babel-yav.ini\n texmf-dist/tex/generic/babel/locale/yi/babel-yi.ini\n texmf-dist/tex/generic/babel/locale/yi/babel-yiddish.tex\n texmf-dist/tex/generic/babel/locale/yo/babel-yo.ini\n texmf-dist/tex/generic/babel/locale/yo/babel-yoruba.tex\n texmf-dist/tex/generic/babel/locale/yue/babel-cantonese.tex\n texmf-dist/tex/generic/babel/locale/yue/babel-yue.ini\n texmf-dist/tex/generic/babel/locale/zgh/babel-standardmoroccantamazight.tex\n texmf-dist/tex/generic/babel/locale/zgh/babel-zgh.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-hans-hk.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-hans-mo.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-hans-sg.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-hans.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-hant-hk.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-hant-mo.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-hant.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-simplified-hongkongsarchina.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-simplified-macausarchina.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-simplified-singapore.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-simplified.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-traditional-hongkongsarchina.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-traditional-macausarchina.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese-traditional.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-chinese.tex\n texmf-dist/tex/generic/babel/locale/zh/babel-zh-Hans-HK.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-zh-Hans-MO.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-zh-Hans-SG.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-zh-Hans.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-zh-Hant-HK.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-zh-Hant-MO.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-zh-Hant.ini\n texmf-dist/tex/generic/babel/locale/zh/babel-zh.ini\n texmf-dist/tex/generic/babel/locale/zu/babel-zu.ini\n texmf-dist/tex/generic/babel/locale/zu/babel-zulu.tex\n texmf-dist/tex/generic/babel/lsorbian.sty\n texmf-dist/tex/generic/babel/luababel.def\n texmf-dist/tex/generic/babel/magyar.sty\n texmf-dist/tex/generic/babel/naustrian.sty\n texmf-dist/tex/generic/babel/ngermanb.sty\n texmf-dist/tex/generic/babel/nil.ldf\n texmf-dist/tex/generic/babel/norsk.sty\n texmf-dist/tex/generic/babel/plain.def\n texmf-dist/tex/generic/babel/polish.sty\n texmf-dist/tex/generic/babel/portuges.sty\n texmf-dist/tex/generic/babel/romanian.sty\n texmf-dist/tex/generic/babel/russianb.sty\n texmf-dist/tex/generic/babel/samin.sty\n texmf-dist/tex/generic/babel/scottish.sty\n texmf-dist/tex/generic/babel/serbian.sty\n texmf-dist/tex/generic/babel/slovak.sty\n texmf-dist/tex/generic/babel/slovene.sty\n texmf-dist/tex/generic/babel/spanish.sty\n texmf-dist/tex/generic/babel/swedish.sty\n texmf-dist/tex/generic/babel/switch.def\n texmf-dist/tex/generic/babel/turkish.sty\n texmf-dist/tex/generic/babel/txtbabel.def\n texmf-dist/tex/generic/babel/ukraineb.sty\n texmf-dist/tex/generic/babel/usorbian.sty\n texmf-dist/tex/generic/babel/welsh.sty\n texmf-dist/tex/generic/babel/xebabel.def\ncatalogue-ctan /macros/latex/required/babel/base\ncatalogue-date 2018-04-25 18:33:11 +0200\ncatalogue-license lppl1.3\ncatalogue-topics multilingual\ncatalogue-version 3.19\n\nname babel-english\ncategory Package\nrevision 44495\nshortdesc Babel support for English\nlongdesc The package provides the language definition file for support\nlongdesc of English in babel. Care is taken to select british\nlongdesc hyphenation patterns for British English and Australian text,\nlongdesc and default ('american') patterns for Canadian and USA text.\ncontainersize 3040\ncontainerchecksum 4f1109e6a4b7733e67081e17540495e96d34204e90c9c8ae250e380bcb92509d551418abebdb315f2650776f024d1e2553e7f56d39e5a02eca1bc90a92dd7cc9\ndoccontainersize 130652\ndoccontainerchecksum 2e2e89cfb258b47e04fc821d352543b53af526194a05b010a3b20775b8054772412f89bc1dc05f24ef73153a3edff97a1c6c0d329cdce1f8ccf0a9c1e9966d2d\nsrccontainersize 6256\nsrccontainerchecksum 898dec50b72091756a130dce305b512e8660a31fd22839e7a1f12ba4ed24fbac833b3f7ba11c6771ada3ec14229152a9d61ac8e398d86fd3b5eb6a9c6a0f7858\nrunfiles size=9\n texmf-dist/tex/generic/babel-english/UKenglish.ldf\n texmf-dist/tex/generic/babel-english/USenglish.ldf\n texmf-dist/tex/generic/babel-english/american.ldf\n texmf-dist/tex/generic/babel-english/australian.ldf\n texmf-dist/tex/generic/babel-english/british.ldf\n texmf-dist/tex/generic/babel-english/canadian.ldf\n texmf-dist/tex/generic/babel-english/english.ldf\n texmf-dist/tex/generic/babel-english/newzealand.ldf\ncatalogue-ctan /macros/latex/contrib/babel-contrib/english\ncatalogue-date 2017-06-07 05:21:27 +0200\ncatalogue-license lppl1.3\ncatalogue-topics english multilingual-addon\ncatalogue-version 3.3r\n\nname babelbib\ncategory Package\nrevision 25245\nshortdesc Multilingual bibliographies\nlongdesc This package enables to generate multilingual bibliographies in\nlongdesc cooperation with babel. Two approaches are possible: Each\nlongdesc citation may be written in another language, or the whole\nlongdesc bibliography can be typeset in a language chosen by the user.\nlongdesc In addition, the package supports commands to change the\nlongdesc typography of the bibliographies.\ncontainersize 26128\ncontainerchecksum 30f2c61fdcf0caa8d5fec88fe2d09ab2f47d6120b2560dc271110fe71288763cdc131f09433010bb256d98fd7507f5afcd29b9c8800edcea316377d5c7aa58ee\ndoccontainersize 1242044\ndoccontainerchecksum adeb18ec220c01ec40e1221da48b0a4b3f8d936fb5926caa3a5817a2253351866df5003e6b8fcc9cab9201ae7fb055a2c7061f90cfb4191e6ef0aef772ed0797\nrunfiles size=209\n texmf-dist/bibtex/bst/babelbib/bababbr3-fl.bst\n texmf-dist/bibtex/bst/babelbib/bababbr3-lf.bst\n texmf-dist/bibtex/bst/babelbib/bababbr3.bst\n texmf-dist/bibtex/bst/babelbib/bababbrv-fl.bst\n texmf-dist/bibtex/bst/babelbib/bababbrv-lf.bst\n texmf-dist/bibtex/bst/babelbib/bababbrv.bst\n texmf-dist/bibtex/bst/babelbib/babalpha-fl.bst\n texmf-dist/bibtex/bst/babelbib/babalpha-lf.bst\n texmf-dist/bibtex/bst/babelbib/babalpha.bst\n texmf-dist/bibtex/bst/babelbib/babamspl.bst\n texmf-dist/bibtex/bst/babelbib/babplai3-fl.bst\n texmf-dist/bibtex/bst/babelbib/babplai3-lf.bst\n texmf-dist/bibtex/bst/babelbib/babplai3.bst\n texmf-dist/bibtex/bst/babelbib/babplain-fl.bst\n texmf-dist/bibtex/bst/babelbib/babplain-lf.bst\n texmf-dist/bibtex/bst/babelbib/babplain.bst\n texmf-dist/bibtex/bst/babelbib/babunsrt-fl.bst\n texmf-dist/bibtex/bst/babelbib/babunsrt-lf.bst\n texmf-dist/bibtex/bst/babelbib/babunsrt.bst\n texmf-dist/tex/latex/babelbib/afrikaans.bdf\n texmf-dist/tex/latex/babelbib/babelbib.sty\n texmf-dist/tex/latex/babelbib/bahasa.bdf\n texmf-dist/tex/latex/babelbib/catalan.bdf\n texmf-dist/tex/latex/babelbib/croatian.bdf\n texmf-dist/tex/latex/babelbib/czech.bdf\n texmf-dist/tex/latex/babelbib/danish.bdf\n texmf-dist/tex/latex/babelbib/dutch.bdf\n texmf-dist/tex/latex/babelbib/english.bdf\n texmf-dist/tex/latex/babelbib/esperanto.bdf\n texmf-dist/tex/latex/babelbib/finnish.bdf\n texmf-dist/tex/latex/babelbib/french.bdf\n texmf-dist/tex/latex/babelbib/galician.bdf\n texmf-dist/tex/latex/babelbib/german.bdf\n texmf-dist/tex/latex/babelbib/greek.bdf\n texmf-dist/tex/latex/babelbib/italian.bdf\n texmf-dist/tex/latex/babelbib/norsk.bdf\n texmf-dist/tex/latex/babelbib/portuguese.bdf\n texmf-dist/tex/latex/babelbib/romanian.bdf\n texmf-dist/tex/latex/babelbib/russian.bdf\n texmf-dist/tex/latex/babelbib/serbian.bdf\n texmf-dist/tex/latex/babelbib/spanish.bdf\n texmf-dist/tex/latex/babelbib/swedish.bdf\ncatalogue-ctan /biblio/bibtex/contrib/babelbib\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1\ncatalogue-topics bibtex-sty multilingual\ncatalogue-version 1.31\n\nname bibtex\ncategory Package\nrevision 47198\nshortdesc Process bibliographies for LaTeX, etc\nlongdesc BibTeX allows the user to store his citation data in generic\nlongdesc form, while printing citations in a document in the form\nlongdesc specified by a BibTeX style, to be specified in the document\nlongdesc itself (one often needs a LaTeX citation-style package, such as\nlongdesc natbib as well). BibTeX itself is an ASCII-only program; there\nlongdesc is, however, a version that copes with 8-bit character sets.\nlongdesc However, BibTeX's facilities rapidly run out as one moves away\nlongdesc from simple ASCII (for example, in the various national sorting\nlongdesc rules for languages expressed in different parts of ISO-8859 --\nlongdesc the \"ISO Latin\" series). For more flexibility, the user is\nlongdesc urged to consider using biber with BibLaTeX to typeset its\nlongdesc output.\ndepend kpathsea\ndepend bibtex.ARCH\ncontainersize 14848\ncontainerchecksum 0939809e12ff25e750a9ec85e1f13c810209a9beb8cdcdb1923c1c718d7177e4398d3772c9fc773d0970a2806af912f39bb341d8fb6a51637e62db9ad19bb8d1\ndoccontainersize 398188\ndoccontainerchecksum 99409261c7655f0759b17d3203283505f3791a2fe7bb3ae875a8d583250aaf16ff38f853a9d7c213cde17222b5ceef0dc3ac58b8abe7df56913f8107f77f07ba\nrunfiles size=51\n texmf-dist/bibtex/bib/base/xampl.bib\n texmf-dist/bibtex/bst/base/abbrv.bst\n texmf-dist/bibtex/bst/base/acm.bst\n texmf-dist/bibtex/bst/base/alpha.bst\n texmf-dist/bibtex/bst/base/apalike.bst\n texmf-dist/bibtex/bst/base/ieeetr.bst\n texmf-dist/bibtex/bst/base/plain.bst\n texmf-dist/bibtex/bst/base/siam.bst\n texmf-dist/bibtex/bst/base/unsrt.bst\n texmf-dist/tex/generic/bibtex/apalike.sty\n texmf-dist/tex/generic/bibtex/apalike.tex\ncatalogue-ctan /biblio/bibtex/base\ncatalogue-date 2017-11-06 18:34:04 +0100\ncatalogue-license knuth\ncatalogue-topics biblio\ncatalogue-version 0.99d\n\nname carlisle\ncategory Package\nrevision 18258\nshortdesc David Carlisle's small packages\nlongdesc Many of David Carlisle's more substantial packages stand on\nlongdesc their own, or as part of the LaTeX latex-tools set; this set\nlongdesc contains: Making dotless 'j' characters for fonts that don't\nlongdesc have them; Fix marks in 2-column output; A method for combining\nlongdesc the capabilities of longtable and tabularx; A proforma for\nlongdesc building personalised LaTeX formats; A jiffy to suppress page\nlongdesc numbers; An environment for including Plain TeX in LaTeX\nlongdesc documents; A jiffy to remove counters from other counters'\nlongdesc reset lists; A package to rescale fonts to arbitrary sizes; A\nlongdesc jiffy to create 'slashed' characters for physicists; and An\nlongdesc environment for including HTML in LaTeX documents.\ncontainersize 11324\ncontainerchecksum c562befbd172b552f498dfa5bf814eb252b8b0577755ec3de3d1caf13b41a7df2eed9b31da1c1633084ed614dfdbff05a9e97989c65331e62b4e6fb65465c802\ndoccontainersize 20352\ndoccontainerchecksum b16ae7ae8a71ad1a1335b8dce7738505797382cf3f78605330d994eacbc644d6c25ba87056a854d11759400ca5fd52b2b7d524b9dcdff66e89e4198ba0e39042\nsrccontainersize 2884\nsrccontainerchecksum 6e6ed0563c0d0a55d40e88c73645a844a09714f190a6d1a0105713220d0b0898b2024ba0113b2552c42e2dbb9295dc35e198613885abb4da0e662c6b378027cc\nrunfiles size=11\n texmf-dist/tex/latex/carlisle/dotlessj.sty\n texmf-dist/tex/latex/carlisle/ltxtable.sty\n texmf-dist/tex/latex/carlisle/mylatex.ltx\n texmf-dist/tex/latex/carlisle/plain.sty\n texmf-dist/tex/latex/carlisle/remreset.sty\n texmf-dist/tex/latex/carlisle/scalefnt.sty\n texmf-dist/tex/latex/carlisle/slashed.sty\ncatalogue-ctan /macros/latex/contrib/carlisle\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics collection\n\nname checkcites\ncategory Package\nrevision 45131\nshortdesc Check citation commands in a document\nlongdesc The package provides a lua script written for the sole purpose\nlongdesc of detecting undefined and unused references from LaTeX\nlongdesc auxiliary or bibliography files.\ndepend checkcites.ARCH\ncontainersize 5308\ncontainerchecksum b7c2ed45a32ebf117546ab44565e30eca0d3496f89df6deb50b1cd83ee43052b266fc07dc1638c365d5599d678f10a067b222c04d4a2075c2d8d1a02b57aa5c1\ndoccontainersize 224688\ndoccontainerchecksum 88c46aa667f8c385a4d668d0be68e40d21f6df64f33a9ae9d6c0e8fb8e653bb004c270ba2c6ac7fdc7c3b555947353f09501ee5b48fb8ecd63ec7ccdc369a602\nrunfiles size=6\n texmf-dist/scripts/checkcites/checkcites.lua\ncatalogue-ctan /support/checkcites\ncatalogue-date 2017-08-25 17:01:28 +0200\ncatalogue-license lppl1.3\ncatalogue-topics debug-supp\ncatalogue-version 2.0\n\nname chickenize\ncategory Package\nrevision 45083\nshortdesc Use lua callbacks for \"interesting\" textual effects\nlongdesc The package allows manipulations of any LuaTeX document (it is\nlongdesc known to work with Plain LuaTeX and LuaLaTeX). Most of the\nlongdesc package's functions are merely for fun or educational use, but\nlongdesc some functions (for example, colorstretch for visualising the\nlongdesc badness and font expansion of each line, and letterspaceadjust\nlongdesc doing what its name says) could be useful in a \"normal\" LuaTeX\nlongdesc document.\ncontainersize 11316\ncontainerchecksum 56a3a02fb791aacd83d26627c710dd9928270d8fe803984607e6d0735253083ab37b24cb1879c5ce1fc6e09a4d5194e466a5a6a262b463ebc3d019150bd4d3a6\ndoccontainersize 191532\ndoccontainerchecksum 5168fd820e4a376ec363511dc114469091e1ec9675b874a74ebefe4a387c9870edcf4a25f7f561de21d76e8d3d4f788d054eb28937f711a75f611d3ccbc4186b\nsrccontainersize 28780\nsrccontainerchecksum 0f01520d20c1e0510ba02a83654528a045f24638205abae4be38fcb0e03c3691c03f2ef876042c9138937e0c1b8c27032c4e94892e9cb1940f9aa8cee3cd870c\nrunfiles size=13\n texmf-dist/tex/luatex/chickenize/chickenize.lua\n texmf-dist/tex/luatex/chickenize/chickenize.sty\n texmf-dist/tex/luatex/chickenize/chickenize.tex\ncatalogue-ctan /macros/luatex/generic/chickenize\ncatalogue-date 2017-08-19 23:03:49 +0200\ncatalogue-license lppl1.3\ncatalogue-topics typesetting games luatex\ncatalogue-version 0.2.5\n\nname cm\ncategory Package\nrevision 45811\nshortdesc Computer Modern fonts\nlongdesc Knuth's final iteration of his re-interpretation of a c.19\nlongdesc Modern-style font from Monotype. The family is comprehensive,\nlongdesc offering both sans and roman styles, and a monospaced font,\nlongdesc together with mathematics fonts closely integrated with the\nlongdesc mathematical facilities of TeX itself. The base fonts are\nlongdesc distributed as Metafont source, but autotraced PostScript Type\nlongdesc 1 versions are available (one version in the AMS fonts\nlongdesc distribution, and also the BaKoMa distribution). The Computer\nlongdesc Modern fonts have inspired many later families, notably the\nlongdesc European Computer Modern and the Latin Modern families.\nexecute addMixedMap cmtext-bsr-interpolated.map\ncontainersize 238104\ncontainerchecksum 7504a2edcd495ced18dba96b0a7e90e7f0cbee7cf4da54cec75dabe910eb5ae5079f5a6be93422ff52b0459abbf66cf744e1498a05c6703d668582761e13a0ec\ndoccontainersize 2500\ndoccontainerchecksum 4b3b04c6015e3e5ed787e4cadab6e4d5467eca8d0586427a58a9e540fa58da39a8d91d5bb798142828981405232dd483cbd1102083c904c0ed86f6ba6bac7ca7\nrunfiles size=340\n texmf-dist/fonts/map/dvips/cm/cmtext-bsr-interpolated.map\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmbx10.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmex10.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmmi10.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmmi7.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr10.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr12.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr17.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr6.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr7.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmr8.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmsl10.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmsy10.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmsy7.pk\n texmf-dist/fonts/pk/ljfour/public/cm/dpi600/cmti10.pk\n texmf-dist/fonts/source/public/cm/accent.mf\n texmf-dist/fonts/source/public/cm/bigacc.mf\n texmf-dist/fonts/source/public/cm/bigdel.mf\n texmf-dist/fonts/source/public/cm/bigop.mf\n texmf-dist/fonts/source/public/cm/calu.mf\n texmf-dist/fonts/source/public/cm/cmb10.mf\n texmf-dist/fonts/source/public/cm/cmbase.mf\n texmf-dist/fonts/source/public/cm/cmbsy10.mf\n texmf-dist/fonts/source/public/cm/cmbx10.mf\n texmf-dist/fonts/source/public/cm/cmbx12.mf\n texmf-dist/fonts/source/public/cm/cmbx5.mf\n texmf-dist/fonts/source/public/cm/cmbx6.mf\n texmf-dist/fonts/source/public/cm/cmbx7.mf\n texmf-dist/fonts/source/public/cm/cmbx8.mf\n texmf-dist/fonts/source/public/cm/cmbx9.mf\n texmf-dist/fonts/source/public/cm/cmbxsl10.mf\n texmf-dist/fonts/source/public/cm/cmbxti10.mf\n texmf-dist/fonts/source/public/cm/cmcsc10.mf\n texmf-dist/fonts/source/public/cm/cmdunh10.mf\n texmf-dist/fonts/source/public/cm/cmex10.mf\n texmf-dist/fonts/source/public/cm/cmff10.mf\n texmf-dist/fonts/source/public/cm/cmfi10.mf\n texmf-dist/fonts/source/public/cm/cmfib8.mf\n texmf-dist/fonts/source/public/cm/cminch.mf\n texmf-dist/fonts/source/public/cm/cmitt10.mf\n texmf-dist/fonts/source/public/cm/cmmi10.mf\n texmf-dist/fonts/source/public/cm/cmmi12.mf\n texmf-dist/fonts/source/public/cm/cmmi5.mf\n texmf-dist/fonts/source/public/cm/cmmi6.mf\n texmf-dist/fonts/source/public/cm/cmmi7.mf\n texmf-dist/fonts/source/public/cm/cmmi8.mf\n texmf-dist/fonts/source/public/cm/cmmi9.mf\n texmf-dist/fonts/source/public/cm/cmmib10.mf\n texmf-dist/fonts/source/public/cm/cmplain.mf\n texmf-dist/fonts/source/public/cm/cmr10.mf\n texmf-dist/fonts/source/public/cm/cmr12.mf\n texmf-dist/fonts/source/public/cm/cmr17.mf\n texmf-dist/fonts/source/public/cm/cmr5.mf\n texmf-dist/fonts/source/public/cm/cmr6.mf\n texmf-dist/fonts/source/public/cm/cmr7.mf\n texmf-dist/fonts/source/public/cm/cmr8.mf\n texmf-dist/fonts/source/public/cm/cmr9.mf\n texmf-dist/fonts/source/public/cm/cmsl10.mf\n texmf-dist/fonts/source/public/cm/cmsl12.mf\n texmf-dist/fonts/source/public/cm/cmsl8.mf\n texmf-dist/fonts/source/public/cm/cmsl9.mf\n texmf-dist/fonts/source/public/cm/cmsltt10.mf\n texmf-dist/fonts/source/public/cm/cmss10.mf\n texmf-dist/fonts/source/public/cm/cmss12.mf\n texmf-dist/fonts/source/public/cm/cmss17.mf\n texmf-dist/fonts/source/public/cm/cmss8.mf\n texmf-dist/fonts/source/public/cm/cmss9.mf\n texmf-dist/fonts/source/public/cm/cmssbx10.mf\n texmf-dist/fonts/source/public/cm/cmssdc10.mf\n texmf-dist/fonts/source/public/cm/cmssi10.mf\n texmf-dist/fonts/source/public/cm/cmssi12.mf\n texmf-dist/fonts/source/public/cm/cmssi17.mf\n texmf-dist/fonts/source/public/cm/cmssi8.mf\n texmf-dist/fonts/source/public/cm/cmssi9.mf\n texmf-dist/fonts/source/public/cm/cmssq8.mf\n texmf-dist/fonts/source/public/cm/cmssqi8.mf\n texmf-dist/fonts/source/public/cm/cmsy10.mf\n texmf-dist/fonts/source/public/cm/cmsy5.mf\n texmf-dist/fonts/source/public/cm/cmsy6.mf\n texmf-dist/fonts/source/public/cm/cmsy7.mf\n texmf-dist/fonts/source/public/cm/cmsy8.mf\n texmf-dist/fonts/source/public/cm/cmsy9.mf\n texmf-dist/fonts/source/public/cm/cmtcsc10.mf\n texmf-dist/fonts/source/public/cm/cmtex10.mf\n texmf-dist/fonts/source/public/cm/cmtex8.mf\n texmf-dist/fonts/source/public/cm/cmtex9.mf\n texmf-dist/fonts/source/public/cm/cmti10.mf\n texmf-dist/fonts/source/public/cm/cmti12.mf\n texmf-dist/fonts/source/public/cm/cmti7.mf\n texmf-dist/fonts/source/public/cm/cmti8.mf\n texmf-dist/fonts/source/public/cm/cmti9.mf\n texmf-dist/fonts/source/public/cm/cmtt10.mf\n texmf-dist/fonts/source/public/cm/cmtt12.mf\n texmf-dist/fonts/source/public/cm/cmtt8.mf\n texmf-dist/fonts/source/public/cm/cmtt9.mf\n texmf-dist/fonts/source/public/cm/cmu10.mf\n texmf-dist/fonts/source/public/cm/cmvtt10.mf\n texmf-dist/fonts/source/public/cm/comlig.mf\n texmf-dist/fonts/source/public/cm/csc.mf\n texmf-dist/fonts/source/public/cm/cscspu.mf\n texmf-dist/fonts/source/public/cm/greekl.mf\n texmf-dist/fonts/source/public/cm/greeku.mf\n texmf-dist/fonts/source/public/cm/itald.mf\n texmf-dist/fonts/source/public/cm/italig.mf\n texmf-dist/fonts/source/public/cm/itall.mf\n texmf-dist/fonts/source/public/cm/italms.mf\n texmf-dist/fonts/source/public/cm/italp.mf\n texmf-dist/fonts/source/public/cm/italsp.mf\n texmf-dist/fonts/source/public/cm/mathex.mf\n texmf-dist/fonts/source/public/cm/mathit.mf\n texmf-dist/fonts/source/public/cm/mathsy.mf\n texmf-dist/fonts/source/public/cm/olddig.mf\n texmf-dist/fonts/source/public/cm/punct.mf\n texmf-dist/fonts/source/public/cm/roman.mf\n texmf-dist/fonts/source/public/cm/romand.mf\n texmf-dist/fonts/source/public/cm/romanl.mf\n texmf-dist/fonts/source/public/cm/romanp.mf\n texmf-dist/fonts/source/public/cm/romanu.mf\n texmf-dist/fonts/source/public/cm/romlig.mf\n texmf-dist/fonts/source/public/cm/romms.mf\n texmf-dist/fonts/source/public/cm/romspl.mf\n texmf-dist/fonts/source/public/cm/romspu.mf\n texmf-dist/fonts/source/public/cm/romsub.mf\n texmf-dist/fonts/source/public/cm/sym.mf\n texmf-dist/fonts/source/public/cm/symbol.mf\n texmf-dist/fonts/source/public/cm/texset.mf\n texmf-dist/fonts/source/public/cm/textit.mf\n texmf-dist/fonts/source/public/cm/title.mf\n texmf-dist/fonts/source/public/cm/tset.mf\n texmf-dist/fonts/source/public/cm/tsetsl.mf\n texmf-dist/fonts/source/public/cm/white_setup.mf\n texmf-dist/fonts/tfm/public/cm/cmb10.tfm\n texmf-dist/fonts/tfm/public/cm/cmbsy10.tfm\n texmf-dist/fonts/tfm/public/cm/cmbx10.tfm\n texmf-dist/fonts/tfm/public/cm/cmbx12.tfm\n texmf-dist/fonts/tfm/public/cm/cmbx5.tfm\n texmf-dist/fonts/tfm/public/cm/cmbx6.tfm\n texmf-dist/fonts/tfm/public/cm/cmbx7.tfm\n texmf-dist/fonts/tfm/public/cm/cmbx8.tfm\n texmf-dist/fonts/tfm/public/cm/cmbx9.tfm\n texmf-dist/fonts/tfm/public/cm/cmbxsl10.tfm\n texmf-dist/fonts/tfm/public/cm/cmbxti10.tfm\n texmf-dist/fonts/tfm/public/cm/cmcsc10.tfm\n texmf-dist/fonts/tfm/public/cm/cmdunh10.tfm\n texmf-dist/fonts/tfm/public/cm/cmex10.tfm\n texmf-dist/fonts/tfm/public/cm/cmff10.tfm\n texmf-dist/fonts/tfm/public/cm/cmfi10.tfm\n texmf-dist/fonts/tfm/public/cm/cmfib8.tfm\n texmf-dist/fonts/tfm/public/cm/cminch.tfm\n texmf-dist/fonts/tfm/public/cm/cmitt10.tfm\n texmf-dist/fonts/tfm/public/cm/cmmi10.tfm\n texmf-dist/fonts/tfm/public/cm/cmmi12.tfm\n texmf-dist/fonts/tfm/public/cm/cmmi5.tfm\n texmf-dist/fonts/tfm/public/cm/cmmi6.tfm\n texmf-dist/fonts/tfm/public/cm/cmmi7.tfm\n texmf-dist/fonts/tfm/public/cm/cmmi8.tfm\n texmf-dist/fonts/tfm/public/cm/cmmi9.tfm\n texmf-dist/fonts/tfm/public/cm/cmmib10.tfm\n texmf-dist/fonts/tfm/public/cm/cmr10.tfm\n texmf-dist/fonts/tfm/public/cm/cmr12.tfm\n texmf-dist/fonts/tfm/public/cm/cmr17.tfm\n texmf-dist/fonts/tfm/public/cm/cmr5.tfm\n texmf-dist/fonts/tfm/public/cm/cmr6.tfm\n texmf-dist/fonts/tfm/public/cm/cmr7.tfm\n texmf-dist/fonts/tfm/public/cm/cmr8.tfm\n texmf-dist/fonts/tfm/public/cm/cmr9.tfm\n texmf-dist/fonts/tfm/public/cm/cmsl10.tfm\n texmf-dist/fonts/tfm/public/cm/cmsl12.tfm\n texmf-dist/fonts/tfm/public/cm/cmsl8.tfm\n texmf-dist/fonts/tfm/public/cm/cmsl9.tfm\n texmf-dist/fonts/tfm/public/cm/cmsltt10.tfm\n texmf-dist/fonts/tfm/public/cm/cmss10.tfm\n texmf-dist/fonts/tfm/public/cm/cmss12.tfm\n texmf-dist/fonts/tfm/public/cm/cmss17.tfm\n texmf-dist/fonts/tfm/public/cm/cmss8.tfm\n texmf-dist/fonts/tfm/public/cm/cmss9.tfm\n texmf-dist/fonts/tfm/public/cm/cmssbx10.tfm\n texmf-dist/fonts/tfm/public/cm/cmssdc10.tfm\n texmf-dist/fonts/tfm/public/cm/cmssi10.tfm\n texmf-dist/fonts/tfm/public/cm/cmssi12.tfm\n texmf-dist/fonts/tfm/public/cm/cmssi17.tfm\n texmf-dist/fonts/tfm/public/cm/cmssi8.tfm\n texmf-dist/fonts/tfm/public/cm/cmssi9.tfm\n texmf-dist/fonts/tfm/public/cm/cmssq8.tfm\n texmf-dist/fonts/tfm/public/cm/cmssqi8.tfm\n texmf-dist/fonts/tfm/public/cm/cmsy10.tfm\n texmf-dist/fonts/tfm/public/cm/cmsy5.tfm\n texmf-dist/fonts/tfm/public/cm/cmsy6.tfm\n texmf-dist/fonts/tfm/public/cm/cmsy7.tfm\n texmf-dist/fonts/tfm/public/cm/cmsy8.tfm\n texmf-dist/fonts/tfm/public/cm/cmsy9.tfm\n texmf-dist/fonts/tfm/public/cm/cmtcsc10.tfm\n texmf-dist/fonts/tfm/public/cm/cmtex10.tfm\n texmf-dist/fonts/tfm/public/cm/cmtex8.tfm\n texmf-dist/fonts/tfm/public/cm/cmtex9.tfm\n texmf-dist/fonts/tfm/public/cm/cmti10.tfm\n texmf-dist/fonts/tfm/public/cm/cmti12.tfm\n texmf-dist/fonts/tfm/public/cm/cmti7.tfm\n texmf-dist/fonts/tfm/public/cm/cmti8.tfm\n texmf-dist/fonts/tfm/public/cm/cmti9.tfm\n texmf-dist/fonts/tfm/public/cm/cmtt10.tfm\n texmf-dist/fonts/tfm/public/cm/cmtt12.tfm\n texmf-dist/fonts/tfm/public/cm/cmtt8.tfm\n texmf-dist/fonts/tfm/public/cm/cmtt9.tfm\n texmf-dist/fonts/tfm/public/cm/cmu10.tfm\n texmf-dist/fonts/tfm/public/cm/cmvtt10.tfm\ncatalogue-ctan /fonts/cm\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license knuth\ncatalogue-topics font font-mf font-proportional font-mono font-cm\n\nname collection-basic\ncategory Collection\nrevision 45851\nshortdesc Essential programs and files\nlongdesc These files are regarded as basic for any TeX system, covering\nlongdesc plain TeX macros, Computer Modern fonts, and configuration for\nlongdesc common drivers; no LaTeX.\ndepend texlive.infra\ndepend amsfonts\ndepend bibtex\ndepend cm\ndepend dvipdfmx\ndepend dvips\ndepend enctex\ndepend etex\ndepend etex-pkg\ndepend glyphlist\ndepend graphics-def\ndepend gsftopk\ndepend hyph-utf8\ndepend hyphen-base\ndepend ifluatex\ndepend ifxetex\ndepend knuth-lib\ndepend knuth-local\ndepend kpathsea\ndepend lua-alt-getopt\ndepend luatex\ndepend makeindex\ndepend metafont\ndepend mflogo\ndepend mfware\ndepend pdftex\ndepend plain\ndepend tetex\ndepend tex\ndepend tex-ini-files\ndepend texlive-common\ndepend texlive-docindex\ndepend texlive-en\ndepend texlive-msg-translations\ndepend texlive-scripts\ndepend unicode-data\ndepend updmap-map\ndepend xdvi\ncontainersize 620\ncontainerchecksum 5f97f97e8d6bd356fb2211961e58904188d7518b4de0fa7a5a84cf96eed2e8c7629617cef1bc53d92e2a670152d573c6680d3cc7ce6e08bd343fc1063f2a8101\n\nname collection-latex\ncategory Collection\nrevision 41614\nshortdesc LaTeX fundamental packages\nlongdesc These packages are either mandated by the core LaTeX team, or\nlongdesc very widely used and strongly recommended in practice.\ndepend collection-basic\ndepend ae\ndepend amscls\ndepend amsmath\ndepend babel\ndepend babel-english\ndepend babelbib\ndepend carlisle\ndepend colortbl\ndepend fancyhdr\ndepend fix2col\ndepend geometry\ndepend graphics\ndepend graphics-cfg\ndepend hyperref\ndepend latex\ndepend latex-bin\ndepend latex-fonts\ndepend latexconfig\ndepend ltxmisc\ndepend mfnfss\ndepend mptopdf\ndepend natbib\ndepend oberdiek\ndepend pslatex\ndepend psnfss\ndepend pspicture\ndepend tools\ndepend url\ncontainersize 524\ncontainerchecksum 3db8bef953d336d22c67c49b0b1172b00f76621a97f7744345d0f9214ee84d83dea9190e666c49a649b1eb576c9b50210fcea7297dc555afd3fc4c83efcbc016\n\nname collection-luatex\ncategory Collection\nrevision 47011\nshortdesc LuaTeX packages\nlongdesc Packages for LuaTeX, a Unicode-aware extension of pdfTeX, using\nlongdesc Lua as an embedded scripting and extension language.\nlongdesc http://luatex.org/\ndepend collection-basic\ndepend auto-pst-pdf-lua\ndepend checkcites\ndepend chickenize\ndepend combofont\ndepend cstypo\ndepend ctablestack\ndepend enigma\ndepend fontloader-luaotfload\ndepend interpreter\ndepend lua-visual-debug\ndepend lua2dox\ndepend luacode\ndepend luahyphenrules\ndepend luaindex\ndepend luainputenc\ndepend luaintro\ndepend lualatex-doc\ndepend lualatex-math\ndepend lualibs\ndepend luamplib\ndepend luaotfload\ndepend luapackageloader\ndepend luatex85\ndepend luatexbase\ndepend luatexko\ndepend luatextra\ndepend luaxml\ndepend nodetree\ndepend odsfile\ndepend placeat\ndepend plantuml\ndepend selnolig\ndepend spelling\ndepend typewriter\ncontainersize 596\ncontainerchecksum 873b96c669902cfb6af188de8e9405fd326372f2934cf722b54284cae40e2254f25d57b867c5c3331900017bc9d8c647efe6bcb68d48d412c2c81ed5682b93eb\n\nname colortbl\ncategory Package\nrevision 29803\nshortdesc Add colour to LaTeX tables\nlongdesc The package allows rows and columns to be coloured, and even\nlongdesc individual cells.\ncontainersize 3208\ncontainerchecksum 3c3416466feaa6b35056de0263a3dc098ac0e432c0f424a086d042e38319fd3643731dcab5ea0bd6480f095b7ee510625459617d53ae03528d019a40d0d6e2cf\ndoccontainersize 554116\ndoccontainerchecksum 04a4e339b610470d812e4fd22cd72136e525abb727193e4143850ffae248315c8b5bfbe1909a51277f923ef7676f4f3c05013b1932a3df154d0511ebc355694d\nsrccontainersize 11240\nsrccontainerchecksum 9f42128126ac15fea101acd7ed153a134ca1729f059aae6ac003c929f34608e6c8e46251030db6669c4b4e84e3d0ed89d0b54a740a9ff1b88bb8d70191a8746e\nrunfiles size=3\n texmf-dist/tex/latex/colortbl/colortbl.sty\ncatalogue-also xcolor\ncatalogue-ctan /macros/latex/contrib/colortbl\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics colour table\ncatalogue-version 1.0a\n\nname combofont\ncategory Package\nrevision 44746\nshortdesc Add NFSS-declarations of combo fonts to LuaLaTeX documents\nlongdesc This highly experimental package can be used to add\nlongdesc NFSS-declarations of combo fonts to LuaLaTeX documents. This\nlongdesc package may disappear without notice, e.g. if luaotfload\nlongdesc changes in a way so that it no longer works, or if LuaTeX\nlongdesc changes, or if fontspec itself includes the code. It is also\nlongdesc possible that the package's syntax and commands may change in\nlongdesc an incompatible way. So if you use it in a production\nlongdesc environment: You have been warned.\ncontainersize 1656\ncontainerchecksum 5b2a1df350a23d6a8fa06f7c8820a65b20ce3baa36606f4d46020e6c3cad58dd4c5d1c16a4f36e3e789cd41d422ff8a4849c8faee0c384ec779b7e97be7a8aa7\ndoccontainersize 92336\ndoccontainerchecksum 18cbb6692855c1304e46cb19867a86c8c476cdac5c8d6ab5e171987cda4a82f74147b898d00f550650f2a11ecbe4019f1c19dc8b1a1c398eacfd025f44498056\nrunfiles size=1\n texmf-dist/tex/lualatex/combofont/combofont.sty\ncatalogue-ctan /macros/luatex/latex/combofont\ncatalogue-date 2017-07-03 18:05:12 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics luatex font-mgmt\ncatalogue-version 0.2\n\nname cstypo\ncategory Package\nrevision 41986\nshortdesc Czech typography rules enforced through LuaTeX hooks\nlongdesc This package provides macros that enforce basic Czech\nlongdesc typography rules through Lua hooks available in LuaTeX.\ncontainersize 2028\ncontainerchecksum 53832f712de55b05e1f2a5af7ada9b7d64743e202581a166b49ca01b2f0152d4fa3f546fcc399f33d0e44eef0869a1095eceb27ed098352dd91e047b29ae032c\ndoccontainersize 104248\ndoccontainerchecksum 4d5f05d51386e80cb5ec170b35cb28780d89f0daa0c16a0cf333b6dbdea4763f9b546a3ed228db1123d078430d5ae1d01b9c402c43ee22f49f05675c91c18211\nrunfiles size=4\n texmf-dist/tex/lualatex/cstypo/cstypo.sty\n texmf-dist/tex/luatex/cstypo/cstypo-tex.tex\n texmf-dist/tex/luatex/cstypo/cstypo.lua\ncatalogue-ctan /macros/luatex/generic/cstypo\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license mit\ncatalogue-topics luatex czech\ncatalogue-version 0.03\n\nname ctablestack\ncategory Package\nrevision 38514\nshortdesc Catcode table stable support\nlongdesc This package provides a method for defining category code table\nlongdesc stacks in LuaTeX. It builds on code provided by the 2015/10/01\nlongdesc release of LaTeX2e (also available as ltluatex.sty for plain\nlongdesc users). It is required by the luatexbase package (v1.0 onward)\nlongdesc which uses ctablestack to provide a back-compatibility form of\nlongdesc this concept.\ncontainersize 1128\ncontainerchecksum dfb5fd4e62c04311bf41c17d06395f5693c0232840bead53a41cf0898ba2704da68d6caf4cbe796fb728f189a57072f36433a51edc0fd9d1013a70f4906797ae\ndoccontainersize 151908\ndoccontainerchecksum d27e0392ffb1a4daf718ec780540d22b7f3ed3dc6e488f37583ef9fc06697309f7abd93e55832c50cc50e87a950dcc9cd602e0270d4b9fde9db6cbed59cf131c\nsrccontainersize 2520\nsrccontainerchecksum 083b381a0dc2b83dff0e71f475fa35dd60e9e62106a75c3537381e6b25c41155cdabfd6f5a07da1ad9d58f34d33052f24e212421b11e377c309c261454072e7b\nrunfiles size=1\n texmf-dist/tex/luatex/ctablestack/ctablestack.sty\ncatalogue-ctan /macros/luatex/generic/ctablestack\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics luatex\ncatalogue-version 1.0\n\nname dvipdfmx\ncategory TLCore\nrevision 47198\nshortdesc An extended version of dvipdfm\nlongdesc Dvipdfmx (formerly dvipdfm-cjk) is a development of dvipdfm\nlongdesc created to support multi-byte character encodings and large\nlongdesc character sets for East Asian languages. Dvipdfmx, if \"called\"\nlongdesc with the name dvipdfm, operates in a \"dvipdfm compatibility\"\nlongdesc mode, so that users of the both packages need only keep one\nlongdesc executable. A secondary design goal is to support as many \"PDF\"\nlongdesc features as does pdfTeX. There being no documentation as such,\nlongdesc users are advised to consult the documentation of dvipdfm (as\nlongdesc well, of course, as the package Readme. The current version of\nlongdesc the package is no longer maintained on CTAN as a separate\nlongdesc entity; development now takes place within the TeX Live\nlongdesc framework, and it is no longer available as a separate package.\nlongdesc For download, support, and other information, please see TeX\nlongdesc Live.\ndepend glyphlist\ndepend dvipdfmx.ARCH\npostaction script file=tlpkg/tlpostcode/dvipdfmx.pl\ncontainersize 26676\ncontainerchecksum 905da1daca59bf732906e75b28f765ae707b1394347165fed64dff94df3c2e0cda174579215bbbef403ff6278adc4061754e1e69aee3d3de2c282682deb0f15d\ndoccontainersize 3030808\ndoccontainerchecksum d5f90e19898a14a8fb549445ec8ec19323d61b7d74e132e0dc49b54a5ad0f9ae0fdc138519c247886fc84c8f033a3bfa92318609a342afbe60dee64cac6814b3\nrunfiles size=40\n texmf-dist/dvipdfmx/dvipdfmx.cfg\n texmf-dist/fonts/cmap/dvipdfmx/EUC-UCS2\n texmf-dist/fonts/cmap/dvipdfmx/README\n texmf-dist/fonts/cmap/dvipdfmx/UTF8-UCS2\n texmf-dist/fonts/map/dvipdfmx/cid-x.map\n texmf-dist/fonts/map/dvipdfmx/ckx.map\n tlpkg/tlpostcode/dvipdfmx.pl\ncatalogue-ctan /obsolete/dviware/dvipdfmx\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license gpl\ncatalogue-topics dvi-pdf\n\nname dvips\ncategory TLCore\nrevision 47198\nshortdesc A DVI to PostScript driver\nlongdesc This package has been withdrawn from CTAN, and bundled into the\nlongdesc distributions' package sets. Development now takes place within\nlongdesc the TeX Live framework, and it is no longer available as a\nlongdesc separate package. For download, support, and other information,\nlongdesc please see TeX Live.\ndepend dvips.ARCH\ncontainersize 34364\ncontainerchecksum d5475ffb0fce54cde01b786b64e3b8cc34f3582576b442c3e4b2e24b4e6a298b8ad4e5e5361a97aae9c96bf8e86fe7dc23dfff161e5b27b597ee25a9b1fa0c78\ndoccontainersize 512240\ndoccontainerchecksum d88380d5d37c0cbca45c3c1cda0b4d6e437c9961f34e34055466deba423a590a28ac3e9e8cbb65f318506a36188eccf8fd6880657e66687557ea95a623c9597b\nrunfiles size=93\n texmf-dist/dvips/base/color.pro\n texmf-dist/dvips/base/crop.pro\n texmf-dist/dvips/base/finclude.pro\n texmf-dist/dvips/base/hps.pro\n texmf-dist/dvips/base/resolution400.ps\n texmf-dist/dvips/base/special.pro\n texmf-dist/dvips/base/tex.pro\n texmf-dist/dvips/base/texc.pro\n texmf-dist/dvips/base/texps.pro\n texmf-dist/dvips/config/alt-rule.pro\n texmf-dist/dvips/config/canonex.cfg\n texmf-dist/dvips/config/config.bakoma\n texmf-dist/dvips/config/config.canonex\n texmf-dist/dvips/config/config.cx\n texmf-dist/dvips/config/config.deskjet\n texmf-dist/dvips/config/config.dvired\n texmf-dist/dvips/config/config.epson\n texmf-dist/dvips/config/config.ibmvga\n texmf-dist/dvips/config/config.ljfour\n texmf-dist/dvips/config/config.luc\n texmf-dist/dvips/config/config.mbn\n texmf-dist/dvips/config/config.mga\n texmf-dist/dvips/config/config.mirrorprint\n texmf-dist/dvips/config/config.ot2\n texmf-dist/dvips/config/config.ps\n texmf-dist/dvips/config/config.qms\n texmf-dist/dvips/config/config.toshiba\n texmf-dist/dvips/config/config.unms\n texmf-dist/dvips/config/config.xyp\n texmf-dist/dvips/config/cx.cfg\n texmf-dist/dvips/config/deskjet.cfg\n texmf-dist/dvips/config/dfaxhigh.cfg\n texmf-dist/dvips/config/dvired.cfg\n texmf-dist/dvips/config/epson.cfg\n texmf-dist/dvips/config/ibmvga.cfg\n texmf-dist/dvips/config/ljfour.cfg\n texmf-dist/dvips/config/qms.cfg\n texmf-dist/dvips/config/toshiba.cfg\n texmf-dist/fonts/enc/dvips/base/6w.enc\n texmf-dist/fonts/enc/dvips/base/7t.enc\n texmf-dist/fonts/enc/dvips/base/8a.enc\n texmf-dist/fonts/enc/dvips/base/8r.enc\n texmf-dist/fonts/enc/dvips/base/ad.enc\n texmf-dist/fonts/enc/dvips/base/ansinew.enc\n texmf-dist/fonts/enc/dvips/base/asex.enc\n texmf-dist/fonts/enc/dvips/base/asexp.enc\n texmf-dist/fonts/enc/dvips/base/dc.enc\n texmf-dist/fonts/enc/dvips/base/dvips.enc\n texmf-dist/fonts/enc/dvips/base/ec.enc\n texmf-dist/fonts/enc/dvips/base/extex.enc\n texmf-dist/fonts/enc/dvips/base/funky.enc\n texmf-dist/fonts/enc/dvips/base/odvips.enc\n texmf-dist/fonts/enc/dvips/base/q-cs-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-ec-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-l7x-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-qx-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-rm-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-t2a-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-t2b-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-t2c-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-t5-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-texnansi-uni.enc\n texmf-dist/fonts/enc/dvips/base/q-ts1-uni.enc\n texmf-dist/fonts/enc/dvips/base/qx.enc\n texmf-dist/fonts/enc/dvips/base/stormex.enc\n texmf-dist/fonts/enc/dvips/base/tex256.enc\n texmf-dist/fonts/enc/dvips/base/texmext.enc\n texmf-dist/fonts/enc/dvips/base/texmital.enc\n texmf-dist/fonts/enc/dvips/base/texmsym.enc\n texmf-dist/fonts/enc/dvips/base/texnansx.enc\n texmf-dist/tex/generic/dvips/blackdvi.sty\n texmf-dist/tex/generic/dvips/blackdvi.tex\n texmf-dist/tex/generic/dvips/colordvi.sty\n texmf-dist/tex/generic/dvips/colordvi.tex\n texmf-dist/tex/generic/dvips/rotate.sty\n texmf-dist/tex/generic/dvips/rotate.tex\ncatalogue-ctan /obsolete/dviware/dvips\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license other-free\ncatalogue-topics dvi-print\n\nname enctex\ncategory Package\nrevision 34957\nshortdesc A TeX extension that translates input on its way into TeX\nlongdesc EncTeX is (another) TeX extension, written at the change-file\nlongdesc level. It provides means of translating input on the way into\nlongdesc TeX. It allows, for example, translation of multibyte\nlongdesc sequences, such as utf-8 encoding.\ncontainersize 23720\ncontainerchecksum ad7b5cb9ca57e4db7322eeae184f9cb0a63da9577552bba97917941b5b6516db832bb4661cd96fd7f5b10b8ff0c3575e7d6cdb1f8442bcf022be33f734f55dd9\ndoccontainersize 253856\ndoccontainerchecksum 726ad5443f5813a4cdea85ae73e7bd5763230e25c3f0ef5c5caafe8c817811848212369d099451b20db4611cd2a6b496cf8c54d911a511e6a484e844739b795b\nrunfiles size=62\n texmf-dist/tex/generic/enctex/1250-csf.tex\n texmf-dist/tex/generic/enctex/1250-il2.tex\n texmf-dist/tex/generic/enctex/1250-latex.tex\n texmf-dist/tex/generic/enctex/1250-t1.tex\n texmf-dist/tex/generic/enctex/852-csf.tex\n texmf-dist/tex/generic/enctex/852-il2.tex\n texmf-dist/tex/generic/enctex/852-latex.tex\n texmf-dist/tex/generic/enctex/852-t1.tex\n texmf-dist/tex/generic/enctex/csfmacro.tex\n texmf-dist/tex/generic/enctex/enc-u.tex\n texmf-dist/tex/generic/enctex/encmacro.tex\n texmf-dist/tex/generic/enctex/il2-1250.tex\n texmf-dist/tex/generic/enctex/il2-852.tex\n texmf-dist/tex/generic/enctex/il2-csf.tex\n texmf-dist/tex/generic/enctex/il2-kam.tex\n texmf-dist/tex/generic/enctex/il2-t1.tex\n texmf-dist/tex/generic/enctex/kam-csf.tex\n texmf-dist/tex/generic/enctex/kam-il2.tex\n texmf-dist/tex/generic/enctex/kam-latex.tex\n texmf-dist/tex/generic/enctex/kam-t1.tex\n texmf-dist/tex/generic/enctex/mixcodes.tex\n texmf-dist/tex/generic/enctex/noprefnt.tex\n texmf-dist/tex/generic/enctex/plain-1250-cs.tex\n texmf-dist/tex/generic/enctex/plain-852-cs.tex\n texmf-dist/tex/generic/enctex/plain-il2-cs.tex\n texmf-dist/tex/generic/enctex/plain-kam-cs.tex\n texmf-dist/tex/generic/enctex/plain-utf8-cs.tex\n texmf-dist/tex/generic/enctex/plain-utf8-ec.tex\n texmf-dist/tex/generic/enctex/polyset.tex\n texmf-dist/tex/generic/enctex/t1macro.tex\n texmf-dist/tex/generic/enctex/utf8-csf.tex\n texmf-dist/tex/generic/enctex/utf8-t1.tex\n texmf-dist/tex/generic/enctex/utf8cseq.tex\n texmf-dist/tex/generic/enctex/utf8lat1.tex\n texmf-dist/tex/generic/enctex/utf8lata.tex\n texmf-dist/tex/generic/enctex/utf8math.tex\n texmf-dist/tex/generic/enctex/utf8off.tex\n texmf-dist/tex/generic/enctex/utf8raw.tex\n texmf-dist/tex/generic/enctex/utf8unkn.tex\n texmf-dist/tex/generic/enctex/utf8warn.tex\ncatalogue-ctan /systems/enctex\ncatalogue-date 2018-01-06 12:14:59 +0100\ncatalogue-license gpl\ncatalogue-topics engine\n\nname enigma\ncategory Package\nrevision 29802\nshortdesc Encrypt documents with a three rotor Enigma\nlongdesc The package provides historical encryption (Enigma cipher) for\nlongdesc LuaTeX-based formats.\ncontainersize 18332\ncontainerchecksum 5777966b33c524be97ab68d96307d20a1337128be3191f89de171903f629b91d3584204433665af367a90db3a2df8af23f418efd7810d5478476016ab7950815\ndoccontainersize 266516\ndoccontainerchecksum a0dd09dd0d59ad965d75d7c1f71bfd14f9fcb8c5447e8cd38ae21f813aabf153bb05d80525187d6d0f4e6af9747e3bf5c94d85005976210b9efe1f38253eaeac\nrunfiles size=19\n texmf-dist/scripts/context/lua/third/enigma/mtx-t-enigma.lua/mtx-t-enigma.lua\n texmf-dist/tex/context/third/enigma/t-enigma.mkv/t-enigma.mkvi\n texmf-dist/tex/generic/enigma/enigma.lua\n texmf-dist/tex/latex/enigma/enigma.sty\n texmf-dist/tex/plain/enigma/enigma.tex\ncatalogue-ctan /macros/luatex/generic/enigma\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license bsd\ncatalogue-topics security luatex\ncatalogue-version 0.1\n\nname etex\ncategory Package\nrevision 37057\nshortdesc An extended version of TeX, from the NTS project\nlongdesc An extended version of TeX (which is capable of running as if\nlongdesc it were TeX unmodified). E-TeX has been specified by the LaTeX\nlongdesc team as the engine for the development of LaTeX2e, in the\nlongdesc immediate future; as a result, LaTeX programmers may (in all\nlongdesc current TeX distributions) assume e-TeX functionality. The\nlongdesc pdftex engine directly incorporates the e-TeX extensions. The\nlongdesc development source for e-TeX is the TeX Live source repository.\ncontainersize 11468\ncontainerchecksum cf1c7ed52510440f58daa4dd9fbc8e29e1cea1468e6b43c35e5a34555ce63e5914cd281673ba6551fcb52cdbb6b38f33219e0b1c79ba8e342d1a9c4664a7774d\ndoccontainersize 189776\ndoccontainerchecksum be1daf0be87cfd94c42f59cd4a09d86e617b642038b42faa62dbc171b7518ae87699398a17b61f6df22e3bf9dc06cc71cbb662f800727764dd18de78c4e5974c\nrunfiles size=11\n texmf-dist/fonts/source/public/etex/xbmc10.mf\n texmf-dist/fonts/tfm/public/etex/xbmc10.tfm\n texmf-dist/tex/plain/etex/etex.src\n texmf-dist/tex/plain/etex/etexdefs.lib\ncatalogue-ctan /obsolete/systems/e-tex\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license knuth\ncatalogue-topics engine\n\nname etex-pkg\ncategory Package\nrevision 41784\nshortdesc E-TeX support package\nlongdesc The package provides support for LaTeX documents to use many of\nlongdesc the extensions offered by e-TeX; in particular, it modifies\nlongdesc LaTeX's register allocation macros to make use of the extended\nlongdesc register range. The etextools package provides macros that make\nlongdesc more sophisticated use of e-TeX's facilities.\ncontainersize 6028\ncontainerchecksum 3b9f06f5d621a5f080dae7626ffc6cbbf2cb8eaab0b12d2e5c8fdc7747fa9fccdaf2a9df42e60c3622ba317814b5ba244b1e809657c7e6b57d325a0b489b82e5\ndoccontainersize 604\ndoccontainerchecksum c66818ca5375fbc768533ec6bec0e1002c501f49221f0822636d810641abd5b6a8a63913dcecc5b9b82ee7dd70d417ace208f8a7d9c1fd4aaa22a64be46138b8\nrunfiles size=5\n texmf-dist/tex/latex/etex-pkg/etex.sty\ncatalogue-also elocalloc\ncatalogue-ctan /macros/latex/contrib/etex-pkg\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license lppl1.3\ncatalogue-topics macro-supp\ncatalogue-version 2.7\n\nname fancyhdr\ncategory Package\nrevision 44730\nshortdesc Extensive control of page headers and footers in LaTeX2e\nlongdesc The package provides extensive facilities, both for\nlongdesc constructing headers and footers, and for controlling their use\nlongdesc (for example, at times when LaTeX would automatically change\nlongdesc the heading style in use).\ncontainersize 4044\ncontainerchecksum 065139f8347fa49c973c46b0853b257f551ef5ac80b19e7feab726cce583d34fcaef279615e097b34c31cd04e85ef677adb300299a2dee13b93395e59e55bd23\ndoccontainersize 401824\ndoccontainerchecksum cf97543a5e43315a8e58c69b76b65b5449993948f9d72231134f80f477d30aca01b32b290023bdf45b64d0e18b459aad4e40d801919e5761052b81e81a9f7863\nrunfiles size=5\n texmf-dist/tex/latex/fancyhdr/extramarks.sty\n texmf-dist/tex/latex/fancyhdr/fancyhdr.sty\n texmf-dist/tex/latex/fancyhdr/fancyheadings.sty\ncatalogue-also titleps\ncatalogue-ctan /macros/latex/contrib/fancyhdr\ncatalogue-date 2017-06-30 08:34:13 +0200\ncatalogue-license lppl\ncatalogue-topics page-hf\ncatalogue-version 3.9a\n\nname fix2col\ncategory Package\nrevision 38770\nshortdesc Fix miscellaneous two column mode features\nlongdesc OBSOLETE: do not use in new documents. This package will do\nlongdesc nothing in LaTeX formats after 2015/01/01 as the fixes that it\nlongdesc implements were incorporated into the fixltx2e package, which\nlongdesc is itself obsolete as since the 2015/01/01 release these fixes\nlongdesc are in the LaTeX format itself. Fix mark handling so that\nlongdesc \\firstmark is taken from the first column if that column has\nlongdesc any marks at all; keep two column floats like figure* in\nlongdesc sequence with single column floats like figure.\ncontainersize 2688\ncontainerchecksum fb4f181d182c8d3be5ecdd90dcdbadfc54318a404ed5498e6f8fbbd509693cab1ca66c5cd7d2830a8f5718195cd852e3808516bcea5b49bde15b4208ba51dd61\ndoccontainersize 212644\ndoccontainerchecksum 4a1582896f707571e7ff9686fe99e2d77ce20269f1dee25529710cea23148618cc24d4cbacebe0741740fcecbed8a3c8e0d2ee0bc5310b660e973b34dcab0aec\nsrccontainersize 6364\nsrccontainerchecksum e220c6bb620dee018ac7fe6cda9bdd2fa814b81689e3d6330b954c4a108cb2cc6ac2141edeab23cbef313d2a38193eb625212b5fdef919b7e49c83edbb8b5fb1\nrunfiles size=2\n texmf-dist/tex/latex/fix2col/fix2col.sty\ncatalogue-ctan /macros/latex/contrib/fix2col\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics typesetting macro-supp\ncatalogue-version 0.04\n\nname fontloader-luaotfload\ncategory Package\nrevision 45090\nshortdesc Alternative fontloaders for luaotfload\nlongdesc The package offers a few alternative fontloaders that can be\nlongdesc used with luaotfload to access some new features.\ncontainersize 154816\ncontainerchecksum 117c5686944084d6cfc8e8713b879a10a4cab9f9118bc214fc8285da6d8c0318998d8b6283d4c6fc8cf7cbf2c0186fde08349d7fef73564bba9fd317144d6c4f\ndoccontainersize 124540\ndoccontainerchecksum 892956c741dd836abf30fde246232af886d80e73b451154cde3bda949195ab8f541f6c84db23136d34a604f387b1314f8df10cce49d9b5269ff91c6f00911790\nrunfiles size=620\n texmf-dist/tex/luatex/fontloader-luaotfload/fontloader-2017-02-11-stix.lua\n texmf-dist/tex/luatex/fontloader-luaotfload/fontloader-reference-2017-07-28.lua\n texmf-dist/tex/luatex/fontloader-luaotfload/fontloader-reference-2017-08-18.lua\ncatalogue-ctan /macros/luatex/generic/fontloader-luaotfload\ncatalogue-date 2017-08-23 04:45:59 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics font-use luatex\ncatalogue-version 1.0\n\nname geometry\ncategory Package\nrevision 47106\nshortdesc Flexible and complete interface to document dimensions\nlongdesc The package provides an easy and flexible user interface to\nlongdesc customize page layout, implementing auto-centering and\nlongdesc auto-balancing mechanisms so that the users have only to give\nlongdesc the least description for the page layout. For example, if you\nlongdesc want to set each margin 2cm without header space, what you need\nlongdesc is just \\usepackage[margin=2cm,nohead]{geometry}. The package\nlongdesc knows about all the standard paper sizes, so that the user need\nlongdesc not know what the nominal 'real' dimensions of the paper are,\nlongdesc just its standard name (such as a4, letter, etc.). An important\nlongdesc feature is the package's ability to communicate the paper size\nlongdesc it's set up to the output (whether via DVI \\specials or via\nlongdesc direct interaction with pdf(La)TeX).\ncontainersize 8660\ncontainerchecksum 5e8945b98510e02bafeacb5c77f80108f47415a3bcd4934c3c9a7c7d27b270991d65864d28f7e3172365c93637b96b1a329b76c921f23818362e087a63596609\ndoccontainersize 447276\ndoccontainerchecksum 6d433eb7d4bb63f9ac7b06801696440d6e935ca4aeddde8a257af91e050d5b638415e59b3717307270a7d61930d23139168f853bbe1a2feefdedb9f38b9625fe\nsrccontainersize 32452\nsrccontainerchecksum 63c14911d6bb33e5f2150b532c287d5230c8749375e8a25d2203b7641dc2092a3a1a7c36a00f534eb25c61d1ac2cdb3e45940fe589907663158924c636a6cab3\nrunfiles size=11\n texmf-dist/tex/latex/geometry/geometry.sty\ncatalogue-also vmargin typearea\ncatalogue-ctan /macros/latex/contrib/geometry\ncatalogue-date 2018-03-24 22:12:56 +0100\ncatalogue-license lppl\ncatalogue-topics geometry\ncatalogue-version 5.7\n\nname glyphlist\ncategory Package\nrevision 45696\nshortdesc Adobe Glyph List and TeX extensions\nlongdesc Map between traditional Adobe glyph names and Unicode points,\nlongdesc maintained by Adobe. The additional texglyphlist.txt is\nlongdesc maintained as part of lcdf-typetools.\ncontainersize 24724\ncontainerchecksum 493d1d5af92fda0bc44228e3001b39e3675a9a9d367fdd95fd210fb34b8a0802ec84ccdc121bc139f70350d905c5587b489d9afdeb49e63a0c585a55bf396bcb\nrunfiles size=24\n texmf-dist/fonts/map/glyphlist/glyphlist.txt\n texmf-dist/fonts/map/glyphlist/pdfglyphlist.txt\n texmf-dist/fonts/map/glyphlist/texglyphlist.txt\n\nname graphics\ncategory Package\nrevision 47350\ncatalogue latex-graphics\nshortdesc The LaTeX standard graphics bundle\nlongdesc This is a collection of LaTeX packages for: producing colour\nlongdesc including graphics (eg PostScript) files rotation and scaling\nlongdesc of text in LaTeX documents. It comprises the packages color,\nlongdesc graphics, graphicx, trig, epsfig, keyval, and lscape.\ndepend graphics-cfg\ncontainersize 14556\ncontainerchecksum 5f11bab21969a5ea2fd6419315ce75016147d6c2b19cde5fc62b14b2c4442df2078ea504484b8d55f9f9f9aa34955ad767775b80fd33d3aca2a959ab8e762ec3\ndoccontainersize 1998240\ndoccontainerchecksum a1cca357a00fe2478db4409e34b89535c371416746f225a0392007e1d6b1798e74dc144b0dd2be4d3e80184993bcf8c0fee415810c61223c0c50801b829bcc3d\nsrccontainersize 50988\nsrccontainerchecksum df668bc141aa225e2fc7449f0eebe2d415773338a78aaba2d0e84409b247f0f7dc5b5e70fda9b415b6babcccb138f22b12625457b61954c3e7791b8203264c5f\nrunfiles size=31\n texmf-dist/tex/latex/graphics/color.sty\n texmf-dist/tex/latex/graphics/dvipdf.def\n texmf-dist/tex/latex/graphics/dvipsnam.def\n texmf-dist/tex/latex/graphics/dvipsone.def\n texmf-dist/tex/latex/graphics/dviwin.def\n texmf-dist/tex/latex/graphics/emtex.def\n texmf-dist/tex/latex/graphics/epsfig.sty\n texmf-dist/tex/latex/graphics/graphics.sty\n texmf-dist/tex/latex/graphics/graphicx.sty\n texmf-dist/tex/latex/graphics/keyval.sty\n texmf-dist/tex/latex/graphics/lscape.sty\n texmf-dist/tex/latex/graphics/pctex32.def\n texmf-dist/tex/latex/graphics/pctexhp.def\n texmf-dist/tex/latex/graphics/pctexps.def\n texmf-dist/tex/latex/graphics/pctexwin.def\n texmf-dist/tex/latex/graphics/rotating.sty\n texmf-dist/tex/latex/graphics/tcidvi.def\n texmf-dist/tex/latex/graphics/trig.sty\n texmf-dist/tex/latex/graphics/truetex.def\ncatalogue-ctan /macros/latex/required/graphics\ncatalogue-date 2018-04-07 07:05:08 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics collection\n\nname graphics-cfg\ncategory Package\nrevision 41448\nshortdesc Sample configuration files for LaTeX color and graphics\nlongdesc This bundle includes color.cfg and graphics.cfg files that set\nlongdesc default \"driver\" options for the color and graphics packages.\nlongdesc It contains support for defaulting the new LuaTeX option which\nlongdesc was added to graphics and color in the 2016-02-01 release. The\nlongdesc LuaTeX option is only used for LuaTeX versions from 0.87, older\nlongdesc versions use the pdfTeX option as before.\ncontainersize 1124\ncontainerchecksum de5503498e2da72de1eb8c17e3e182a237dc08b821325a1cb99a291a119a68884d0ff5b9bc48401918a5574e020e59d7719f23588ee7df1a0a4c2e0f3afb64d1\ndoccontainersize 876\ndoccontainerchecksum a8b6caf61ddfc74817b92124dc4ac77f652be325af9e6caf76b5f1f3e9b41b7c13ebda9cb7cde8afd4a227acbafd26d420fc819fe85d4a6d9583546baf3b1847\nrunfiles size=2\n texmf-dist/tex/latex/graphics-cfg/color.cfg\n texmf-dist/tex/latex/graphics-cfg/graphics.cfg\ncatalogue-also color graphics\ncatalogue-ctan /macros/latex/contrib/graphics-cfg\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license pd\ncatalogue-topics graphics colour\n\nname graphics-def\ncategory Package\nrevision 46267\nshortdesc Colour and graphics option files\nlongdesc This bundle is a combined distribution consisting of dvips.def,\nlongdesc pdftex.def, luatex.def, xetex.def, dvipdfmx.def, and\nlongdesc dvisvgm.def driver option files for the LaTeX graphics and\nlongdesc color packages. It is hoped that by combining their source\nlongdesc repositories at https://github.com/latex3/graphics-def it will\nlongdesc be easier to coordinate updates.\ncontainersize 9632\ncontainerchecksum c38f88cb97cca4c9410fdc35933e6ebc4aa54863d38ab78e07797f88eeebe6a8ef6dba74e2ab92c49114d72b72d4889d4a9b56f51c8ba7402caa0b3bcf721b76\ndoccontainersize 608\ndoccontainerchecksum 6b98fc05aa919f65259a2b5fd659174cae036697b3b5c1fc4a446ebd861c0b641c7c4f6498d960191197aba270f242f282f13a86042771b69b7275f30ffe26a5\nrunfiles size=21\n texmf-dist/tex/latex/graphics-def/dvipdfmx.def\n texmf-dist/tex/latex/graphics-def/dvips.def\n texmf-dist/tex/latex/graphics-def/dvisvgm.def\n texmf-dist/tex/latex/graphics-def/luatex.def\n texmf-dist/tex/latex/graphics-def/pdftex.def\n texmf-dist/tex/latex/graphics-def/xetex.def\ncatalogue-ctan /macros/latex/contrib/graphics-def\ncatalogue-date 2018-01-09 10:47:08 +0100\ncatalogue-license lppl1.3c\ncatalogue-topics graphics-drv\n\nname gsftopk\ncategory TLCore\nrevision 47198\nshortdesc Convert \"Ghostscript fonts\" to PK files\nlongdesc Designed for use with xdvi and dvips this utility converts\nlongdesc Adobe Type 1 fonts to PK bitmap format. It should not\nlongdesc ordinarily be much used nowadays, since both its target\nlongdesc applications are now capable of dealing with Type 1 fonts,\nlongdesc direct.\ndepend gsftopk.ARCH\ncontainersize 3428\ncontainerchecksum d60ff1257c2f00d12173593648b3e1d7f9c9ea043ef16b5486a039083f9b74e6129d48a71efbdc8f1f0a7adf74ac59e13c971c96e6d97cc7c8cf4cc0093be61a\ndoccontainersize 27524\ndoccontainerchecksum e3ef7876b48c4ea9afa5dda8a72ecbd83cf32600eac87890e44c42e77557c05e386f96cfcd00ba31e527deabdb41c84b22b5b297d0ac08dd9121ac3b9b724efd\nrunfiles size=2\n texmf-dist/dvips/gsftopk/render.ps\ncatalogue-ctan /fonts/utilities/gsftopk\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license gpl\ncatalogue-topics font-cvt\ncatalogue-version 1.19.2\n\nname hyperref\ncategory Package\nrevision 46583\nshortdesc Extensive support for hypertext in LaTeX\nlongdesc The hyperref package is used to handle cross-referencing\nlongdesc commands in LaTeX to produce hypertext links in the document.\nlongdesc The package provides backends for the \\special set defined for\nlongdesc HyperTeX DVI processors; for embedded pdfmark commands for\nlongdesc processing by Acrobat Distiller (dvips and Y&Y's dvipsone); for\nlongdesc Y&Y's dviwindo; for PDF control within pdfTeX and dvipdfm; for\nlongdesc TeX4ht; and for VTeX's pdf and HTML backends. The package is\nlongdesc distributed with the backref and nameref packages, which make\nlongdesc use of the facilities of hyperref. The package depends on the\nlongdesc author's kvoptions, ltxcmds and refcount packages.\ncontainersize 107996\ncontainerchecksum 57de3bac579742122b753b73b7f875244b1de5f918e4f7b604b2f263b197ae8fb0dd340aaec825cc7c1829a4b377b3489f81a769c39139ef1148eec1c4da1996\ndoccontainersize 3396884\ndoccontainerchecksum 8c285c95494dbb3992136e80683b51d7a2eedd164de3e5297968a8cfa4bc3c045017ee4c9202fad4f0aa307c69de5fb63de757ffe873725532048741308f90eb\nsrccontainersize 435096\nsrccontainerchecksum 6e7f2ee07d2d6d9056f7ff91c7399b9d87eda045107cdb73b4a5cda4c5483b386fcc4348622d27dc8f82ea70ad339d58f1a3836bbda1d18a6cc1255f84fb8fef\nrunfiles size=235\n texmf-dist/tex/latex/hyperref/backref.sty\n texmf-dist/tex/latex/hyperref/hdvipdfm.def\n texmf-dist/tex/latex/hyperref/hdvips.def\n texmf-dist/tex/latex/hyperref/hdvipson.def\n texmf-dist/tex/latex/hyperref/hdviwind.def\n texmf-dist/tex/latex/hyperref/hluatex.def\n texmf-dist/tex/latex/hyperref/hpdftex.def\n texmf-dist/tex/latex/hyperref/htex4ht.cfg\n texmf-dist/tex/latex/hyperref/htex4ht.def\n texmf-dist/tex/latex/hyperref/htexture.def\n texmf-dist/tex/latex/hyperref/hvtex.def\n texmf-dist/tex/latex/hyperref/hvtexhtm.def\n texmf-dist/tex/latex/hyperref/hvtexmrk.def\n texmf-dist/tex/latex/hyperref/hxetex.def\n texmf-dist/tex/latex/hyperref/hylatex.ltx\n texmf-dist/tex/latex/hyperref/hyperref.sty\n texmf-dist/tex/latex/hyperref/hypertex.def\n texmf-dist/tex/latex/hyperref/minitoc-hyper.sty\n texmf-dist/tex/latex/hyperref/nameref.sty\n texmf-dist/tex/latex/hyperref/nohyperref.sty\n texmf-dist/tex/latex/hyperref/ntheorem-hyper.sty\n texmf-dist/tex/latex/hyperref/pd1enc.def\n texmf-dist/tex/latex/hyperref/pdfmark.def\n texmf-dist/tex/latex/hyperref/psdextra.def\n texmf-dist/tex/latex/hyperref/puarenc.def\n texmf-dist/tex/latex/hyperref/puenc.def\n texmf-dist/tex/latex/hyperref/puvnenc.def\n texmf-dist/tex/latex/hyperref/xr-hyper.sty\ncatalogue-ctan /macros/latex/contrib/hyperref\ncatalogue-date 2018-02-07 05:35:51 +0100\ncatalogue-license lppl1.3\ncatalogue-topics hyper pdf-feat\ncatalogue-version 6.86b\n\nname hyph-utf8\ncategory Package\nrevision 47422\nshortdesc Hyphenation patterns expressed in UTF-8\nlongdesc Modern native UTF-8 engines such as XeTeX and LuaTeX need\nlongdesc hyphenation patterns in UTF-8 format, whereas older systems\nlongdesc require hyphenation patterns in the 8-bit encoding of the font\nlongdesc in use (such encodings are codified in the LaTeX scheme with\nlongdesc names like OT1, T2A, TS1, OML, LY1, etc). The present package\nlongdesc offers a collection of conversions of existing patterns to\nlongdesc UTF-8 format, together with converters for use with 8-bit fonts\nlongdesc in older systems. Since hyphenation patterns for Knuthian-style\nlongdesc TeX systems are only read at iniTeX time, it is hoped that the\nlongdesc UTF-8 patterns, with their converters, will completely supplant\nlongdesc the older patterns.\ncontainersize 15956\ncontainerchecksum 3232a96e27f7fd1932106f883688a00a5eb09531fd886bdc8cd755b094b1ce5a1aca2268c496751857d32ccf8745db3ad469d271227a21b05900a169c86a9e1d\ndoccontainersize 267296\ndoccontainerchecksum 8cf1f1d2843b5208d692b1c2c839c86f7c25b2798b948615d0f1c6147f8e6a229ea9be3c09cd5c323408aaf212f6d76c9e1b5b8e2cf2b17ddbf833bdcd449b79\nsrccontainersize 32204\nsrccontainerchecksum fd5334d49d3efee5a62fc059bbfca6af9de84dc6b1acb02ea037320883b223cec8a8d521b708c6efbacfcfeffbd57f518b2127631ef15958a58d055cf0736820\nrunfiles size=25\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-ec.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-il2.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-il3.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-l7x.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-lmc.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-lth.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-qx.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-t2a.tex\n texmf-dist/tex/generic/hyph-utf8/conversions/conv-utf8-t8m.tex\n texmf-dist/tex/luatex/hyph-utf8/etex.src\n texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua\ncatalogue-also dehyph-exptl\ncatalogue-ctan /language/hyph-utf8\ncatalogue-date 2018-04-08 20:29:51 +0200\ncatalogue-license other-free\ncatalogue-topics hyphenation\n\nname hyphen-base\ncategory TLCore\nrevision 47260\nshortdesc core hyphenation support files\nlongdesc Includes Knuth's original hyphen.tex, zerohyph.tex to disable\nlongdesc hyphenation, language.us which starts the autogenerated files\nlongdesc language.dat and language.def (and default versions of those),\nlongdesc etc.\ncontainersize 22380\ncontainerchecksum 7f64cbf85d9db7ece292be2679135092dd84333e464e4ebdfd74cb89e91ca4111d5dbcc94d5ff2137048687092ff3629d8cdcb499b2fec921e0912f10e4f304c\nrunfiles size=24\n texmf-dist/tex/generic/config/language.dat\n texmf-dist/tex/generic/config/language.dat.lua\n texmf-dist/tex/generic/config/language.def\n texmf-dist/tex/generic/config/language.us\n texmf-dist/tex/generic/config/language.us.def\n texmf-dist/tex/generic/config/language.us.lua\n texmf-dist/tex/generic/hyphen/dumyhyph.tex\n texmf-dist/tex/generic/hyphen/hyphen.tex\n texmf-dist/tex/generic/hyphen/hypht1.tex\n texmf-dist/tex/generic/hyphen/zerohyph.tex\n\nname ifluatex\ncategory Package\nrevision 47293\nshortdesc Provides the \\ifluatex switch\nlongdesc The package looks for LuaTeX regardless of its mode and\nlongdesc provides the switch \\ifluatex; it works with Plain TeX or\nlongdesc LaTeX. The package is part of the oberdiek bundle.\ncontainersize 2384\ncontainerchecksum 6edf3ce2c2e6dd730f4ff856ba8e14c3ca508937b1ee180a1d6e0ced5b054053ab1f668e214b39f3c0241aace25adba3c4da13c2cd96bd7ebe3c6dde311f5ea8\ndoccontainersize 116556\ndoccontainerchecksum bd73f656f49af92b2dbaa5f3cf973e8bc83f3edd738ae48408fce369e8c0810c06db0c9f9d3264e503928f54cc3534693a1f87c79d869b9d813d3b5c80869e33\nsrccontainersize 7440\nsrccontainerchecksum 7597c857ac659e0e62f2d96114ea9c82a4e5893a2565d4eb5669a3b537ba440ea7a919bcad5c5ec0c659953bff726decbf866e3b0ad96d558f351477ec9e7e91\nrunfiles size=2\n texmf-dist/tex/generic/oberdiek/ifluatex.sty\ncatalogue-ctan /macros/latex/contrib/oberdiek/ifluatex.dtx\ncatalogue-date 2018-01-06 12:14:59 +0100\ncatalogue-license lppl1.3\ncatalogue-topics env-query\ncatalogue-version 1.4\n\nname ifxetex\ncategory Package\nrevision 19685\nshortdesc Am I running under XeTeX?\nlongdesc A simple package which provides an \\ifxetex conditional, so\nlongdesc that other code can determine that it is running under XeTeX.\nlongdesc The package requires the e-TeX extensions to the TeX primitive\nlongdesc set.\ncontainersize 1192\ncontainerchecksum 5c7193adbbccb2659dcf382537eb4940c73f6727846ac3944c8803a7d5fb269e6e42cc276a914b5bcc11d18436e9bbb9aad503dbacbe6f6aa93c5465f7341b29\ndoccontainersize 165748\ndoccontainerchecksum 412d2b0c1bd2aa6d4e3960c150b9b812e8fc0a7052225ded2afc8ed4af1f55d8f51b3ef0504183b622198ec647f9b437c073682311c6e7b05a495348b577c1c3\nsrccontainersize 2264\nsrccontainerchecksum 63edb47d3ef4554c7753c8b7db74499dab4bd90dde460c26bed0c837b4a8f8bb6f0736f7ff03226fb3ccc1f2375d3db4d7e2dfabdca0f88b6401c509c36a43db\nrunfiles size=1\n texmf-dist/tex/generic/ifxetex/ifxetex.sty\ncatalogue-also ifpdf ifvtex ifluatex\ncatalogue-ctan /macros/generic/ifxetex\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics env-query\ncatalogue-version 0.6\n\nname interpreter\ncategory Package\nrevision 27232\nshortdesc Translate input files on the fly\nlongdesc The package preprocesses input files to a Lua(La)TeX run, on\nlongdesc the fly. The user defines Lua regular expressions to search for\nlongdesc patterns and modify input lines (or entire paragraphs)\nlongdesc accordingly, before TeX reads the material. In this way,\nlongdesc documents may be prepared in a non-TeX language (e.g., some\nlongdesc lightweight markup language) and turned into 'proper' TeX for\nlongdesc processing. The source of the documentation is typed in such a\nlongdesc lightweight language and is thus easily readable in a text\nlongdesc editor (the PDF file is also available, of course); the\nlongdesc transformation to TeX syntax via Interpreter's functions is\nlongdesc explained in the documentation itself. Interpreter is\nlongdesc implemented using the author's gates (lua version), and works\nlongdesc for plain TeX and LaTeX, but not ConTeXt.\ncontainersize 6224\ncontainerchecksum f24c8cf2dec52960c3acff13322e585cc53c7d631f72aa047ecd8c4c9707f8bf37c3cc347f8b0d290e50e34a5a6187d6036d9ce74077a7cd8da96430f04c0b46\ndoccontainersize 122136\ndoccontainerchecksum bc5261408545ff66066e67b0292e7178d86498b4f4a7a6d03e45d374ee03eae7d2869379e87aede3d710585ff9e905e7a2acf76b86ffde257ca91943972a249b\nrunfiles size=8\n texmf-dist/tex/luatex/interpreter/interpreter.lua\n texmf-dist/tex/luatex/interpreter/interpreter.sty\n texmf-dist/tex/luatex/interpreter/interpreter.tex\ncatalogue-ctan /macros/luatex/generic/interpreter\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics foreign-import macro-supp luatex\ncatalogue-version 1.2\n\nname knuth-lib\ncategory Package\nrevision 35820\nshortdesc A small library of Metafont sources\nlongdesc The collection of core TeX and Metafont macro files from DEK,\nlongdesc including the plain format, plain base, and the MF logo fonts.\ncontainersize 30400\ncontainerchecksum f85a1042504d410f7f3368c939d126fe08af3510d148c5e9401fe946075c71e91c1f980f0cb734708cdb37213cbe21b3b6eac6d9618e21002af9bf88f262488c\nrunfiles size=47\n texmf-dist/fonts/source/public/knuth-lib/3test.mf\n texmf-dist/fonts/source/public/knuth-lib/6test.mf\n texmf-dist/fonts/source/public/knuth-lib/expr.mf\n texmf-dist/fonts/source/public/knuth-lib/grayf.mf\n texmf-dist/fonts/source/public/knuth-lib/io.mf\n texmf-dist/fonts/source/public/knuth-lib/logo.mf\n texmf-dist/fonts/source/public/knuth-lib/logo10.mf\n texmf-dist/fonts/source/public/knuth-lib/logo8.mf\n texmf-dist/fonts/source/public/knuth-lib/logo9.mf\n texmf-dist/fonts/source/public/knuth-lib/logobf10.mf\n texmf-dist/fonts/source/public/knuth-lib/logosl10.mf\n texmf-dist/fonts/source/public/knuth-lib/manfnt.mf\n texmf-dist/fonts/source/public/knuth-lib/null.mf\n texmf-dist/fonts/source/public/knuth-lib/rtest.mf\n texmf-dist/fonts/source/public/knuth-lib/slant.mf\n texmf-dist/fonts/source/public/knuth-lib/test.mf\n texmf-dist/fonts/source/public/knuth-lib/waits.mf\n texmf-dist/fonts/source/public/knuth-lib/ztest.mf\n texmf-dist/fonts/tfm/public/knuth-lib/logo10.tfm\n texmf-dist/fonts/tfm/public/knuth-lib/logo8.tfm\n texmf-dist/fonts/tfm/public/knuth-lib/logo9.tfm\n texmf-dist/fonts/tfm/public/knuth-lib/logobf10.tfm\n texmf-dist/fonts/tfm/public/knuth-lib/logosl10.tfm\n texmf-dist/fonts/tfm/public/knuth-lib/manfnt.tfm\n texmf-dist/tex/generic/knuth-lib/null.tex\n texmf-dist/tex/plain/knuth-lib/manmac.tex\n texmf-dist/tex/plain/knuth-lib/mftmac.tex\n texmf-dist/tex/plain/knuth-lib/story.tex\n texmf-dist/tex/plain/knuth-lib/testfont.tex\n texmf-dist/tex/plain/knuth-lib/webmac.tex\ncatalogue-ctan /systems/knuth/dist/lib\ncatalogue-date 2017-01-28 13:27:32 +0100\ncatalogue-license knuth\ncatalogue-topics collection\n\nname knuth-local\ncategory Package\nrevision 38627\nshortdesc Knuth's local information\nlongdesc A collection of experimental programs and developments based\nlongdesc on, or complementary to, the matter in his distribution\nlongdesc directories.\ncontainersize 23048\ncontainerchecksum 7dea5d292c44c4ce60576ae9bcb7a5cc5b6739994f635b6cace0494c2c1a77561e9695e24296b30db83990481a665a581a97182c89a8656374bb80c0ef4e4309\nrunfiles size=52\n texmf-dist/fonts/source/public/knuth-local/black.mf\n texmf-dist/fonts/source/public/knuth-local/blackaps.mf\n texmf-dist/fonts/source/public/knuth-local/blackimagen.mf\n texmf-dist/fonts/source/public/knuth-local/blacklino.mf\n texmf-dist/fonts/source/public/knuth-local/blacklj.mf\n texmf-dist/fonts/source/public/knuth-local/domino.mf\n texmf-dist/fonts/source/public/knuth-local/gray.mf\n texmf-dist/fonts/source/public/knuth-local/grayaps.mf\n texmf-dist/fonts/source/public/knuth-local/grayimagen.mf\n texmf-dist/fonts/source/public/knuth-local/grayimagen3.mf\n texmf-dist/fonts/source/public/knuth-local/grayimagenlight.mf\n texmf-dist/fonts/source/public/knuth-local/graylj.mf\n texmf-dist/fonts/source/public/knuth-local/local.mf\n texmf-dist/fonts/source/public/knuth-local/logod10.mf\n texmf-dist/fonts/source/public/knuth-local/logosl9.mf\n texmf-dist/fonts/source/public/knuth-local/mfman.mf\n texmf-dist/fonts/source/public/knuth-local/oneone.mf\n texmf-dist/fonts/source/public/knuth-local/random.mf\n texmf-dist/fonts/source/public/knuth-local/slantaps4.mf\n texmf-dist/fonts/source/public/knuth-local/slantimagen4.mf\n texmf-dist/fonts/source/public/knuth-local/slantimagen6.mf\n texmf-dist/fonts/source/public/knuth-local/slantlino4.mf\n texmf-dist/fonts/source/public/knuth-local/slantlj4.mf\n texmf-dist/fonts/source/public/knuth-local/snfont.mf\n texmf-dist/fonts/tfm/public/knuth-local/domino.tfm\n texmf-dist/fonts/tfm/public/knuth-local/logod10.tfm\n texmf-dist/fonts/tfm/public/knuth-local/logosl9.tfm\n texmf-dist/fonts/tfm/public/knuth-local/random.tfm\n texmf-dist/fonts/tfm/public/knuth-local/snfont.tfm\n texmf-dist/mft/knuth-local/e.mft\n texmf-dist/tex/plain/knuth-local/xepsf.tex\ncatalogue-ctan /systems/knuth/local\ncatalogue-date 2017-01-28 12:48:42 +0100\ncatalogue-license knuth\ncatalogue-topics collection\n\nname kpathsea\ncategory TLCore\nrevision 47198\nshortdesc Path searching library for TeX-related files\nlongdesc Kpathsea is a library and utility programs which provide path\nlongdesc searching facilities for TeX file types, including the\nlongdesc self-locating feature required for movable installations,\nlongdesc layered on top of a general search mechanism. It is not\nlongdesc distributed separately, but rather is released and maintained\nlongdesc as part of the TeX live sources.\ndepend kpathsea.ARCH\ncontainersize 31112\ncontainerchecksum 1ad1b9e35afff278c20501532b46a492755bae9e6aa2d9eb653e2427eb16ec84e5dd026ddb473cd3aeca9c938d0a0cb408d5922401d6833174a0ed36f11c10ca\ndoccontainersize 1144688\ndoccontainerchecksum 6ce377c29a0155ecfb1ae0c1596e7b098b320d5708b310492fb38f87a032fbda349a4e1f14edab9914adfd1922cfc6cef6e0524ab3296606184105e34037fc24\nrunfiles size=51\n texmf-dist/web2c/amiga-pl.tcx\n texmf-dist/web2c/cp1250cs.tcx\n texmf-dist/web2c/cp1250pl.tcx\n texmf-dist/web2c/cp1250t1.tcx\n texmf-dist/web2c/cp227.tcx\n texmf-dist/web2c/cp852-cs.tcx\n texmf-dist/web2c/cp852-pl.tcx\n texmf-dist/web2c/cp8bit.tcx\n texmf-dist/web2c/empty.tcx\n texmf-dist/web2c/fmtutil.cnf\n texmf-dist/web2c/il1-t1.tcx\n texmf-dist/web2c/il2-cs.tcx\n texmf-dist/web2c/il2-pl.tcx\n texmf-dist/web2c/il2-t1.tcx\n texmf-dist/web2c/kam-cs.tcx\n texmf-dist/web2c/kam-t1.tcx\n texmf-dist/web2c/macce-pl.tcx\n texmf-dist/web2c/macce-t1.tcx\n texmf-dist/web2c/maz-pl.tcx\n texmf-dist/web2c/mktex.cnf\n texmf-dist/web2c/mktex.opt\n texmf-dist/web2c/mktexdir\n texmf-dist/web2c/mktexdir.opt\n texmf-dist/web2c/mktexnam\n texmf-dist/web2c/mktexnam.opt\n texmf-dist/web2c/mktexupd\n texmf-dist/web2c/natural.tcx\n texmf-dist/web2c/tcvn-t5.tcx\n texmf-dist/web2c/texmf.cnf\n texmf-dist/web2c/viscii-t5.tcx\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license lgpl\ncatalogue-topics sys-supp\n\nname latex\ncategory Package\nrevision 47500\nshortdesc A TeX macro package that defines LaTeX\nlongdesc LaTeX is a widely-used macro package for TeX, providing many\nlongdesc basic document formating commands extended by a wide range of\nlongdesc packages. It is a development of Leslie Lamport's LaTeX 2.09,\nlongdesc and superseded the older system in June 1994. The basic\nlongdesc distribution is catalogued separately, at latex-base; apart\nlongdesc from a large set of contributed packages and third-party\nlongdesc documentation (elsewhere on the archive), the distribution\nlongdesc includes: - a bunch of required packages, which LaTeX authors\nlongdesc are \"entitled to assume\" will be present on any system running\nlongdesc LaTeX; and - a minimal set of documentation detailing\nlongdesc differences from the 'old' version of LaTeX in the areas of\nlongdesc user commands, font selection and control, class and package\nlongdesc writing, font encodings, configuration options and modification\nlongdesc of LaTeX. For downloading details, see the linked catalogue\nlongdesc entries above.\ndepend luatex\ndepend pdftex\ndepend latexconfig\ndepend latex-fonts\ncontainersize 156488\ncontainerchecksum b4a40196d97fcef346467ae7f2d07228dfd4f33245022f20f9a8f1a793ce727c4fb535c5332482eac47c35515c4a64f33a74daa9d2f2c2372b5f4f2d65d2a868\ndoccontainersize 14412108\ndoccontainerchecksum a956cd96a729d616713343109337cdf2eb536a24bd072b1a05ad33f8719e8181baa2d54d7daa950b5eb985d790f849d44389bc1283fd30b8e31249e1f946cc75\nsrccontainersize 528044\nsrccontainerchecksum e74c0a7a7e8a6d21eca7ac2127b8acdd7b436dd4d115ff6ce563e91c9b3eb0d31a814edd481f7e7eda9d1d2778d16c8d81b67d005d1f9804cade9908e9560ae1\nrunfiles size=409\n texmf-dist/makeindex/latex/gglo.ist\n texmf-dist/makeindex/latex/gind.ist\n texmf-dist/tex/latex/base/alltt.sty\n texmf-dist/tex/latex/base/ansinew.def\n texmf-dist/tex/latex/base/applemac.def\n texmf-dist/tex/latex/base/article.cls\n texmf-dist/tex/latex/base/article.sty\n texmf-dist/tex/latex/base/ascii.def\n texmf-dist/tex/latex/base/bezier.sty\n texmf-dist/tex/latex/base/bk10.clo\n texmf-dist/tex/latex/base/bk11.clo\n texmf-dist/tex/latex/base/bk12.clo\n texmf-dist/tex/latex/base/book.cls\n texmf-dist/tex/latex/base/book.sty\n texmf-dist/tex/latex/base/cp1250.def\n texmf-dist/tex/latex/base/cp1252.def\n texmf-dist/tex/latex/base/cp1257.def\n texmf-dist/tex/latex/base/cp437.def\n texmf-dist/tex/latex/base/cp437de.def\n texmf-dist/tex/latex/base/cp850.def\n texmf-dist/tex/latex/base/cp852.def\n texmf-dist/tex/latex/base/cp858.def\n texmf-dist/tex/latex/base/cp865.def\n texmf-dist/tex/latex/base/decmulti.def\n texmf-dist/tex/latex/base/doc.sty\n texmf-dist/tex/latex/base/docstrip.tex\n texmf-dist/tex/latex/base/exscale.sty\n texmf-dist/tex/latex/base/fix-cm.sty\n texmf-dist/tex/latex/base/fixltx2e.sty\n texmf-dist/tex/latex/base/flafter.sty\n texmf-dist/tex/latex/base/fleqn.clo\n texmf-dist/tex/latex/base/fleqn.sty\n texmf-dist/tex/latex/base/fltrace.sty\n texmf-dist/tex/latex/base/fontenc.sty\n texmf-dist/tex/latex/base/fontmath.cfg\n texmf-dist/tex/latex/base/fontmath.ltx\n texmf-dist/tex/latex/base/fonttext.cfg\n texmf-dist/tex/latex/base/fonttext.ltx\n texmf-dist/tex/latex/base/graphpap.sty\n texmf-dist/tex/latex/base/hyphen.ltx\n texmf-dist/tex/latex/base/idx.tex\n texmf-dist/tex/latex/base/ifthen.sty\n texmf-dist/tex/latex/base/inputenc.sty\n texmf-dist/tex/latex/base/lablst.tex\n texmf-dist/tex/latex/base/latex.ltx\n texmf-dist/tex/latex/base/latex209.def\n texmf-dist/tex/latex/base/latexrelease.sty\n texmf-dist/tex/latex/base/latexsym.sty\n texmf-dist/tex/latex/base/latin1.def\n texmf-dist/tex/latex/base/latin10.def\n texmf-dist/tex/latex/base/latin2.def\n texmf-dist/tex/latex/base/latin3.def\n texmf-dist/tex/latex/base/latin4.def\n texmf-dist/tex/latex/base/latin5.def\n texmf-dist/tex/latex/base/latin9.def\n texmf-dist/tex/latex/base/lcyenc.dfu\n texmf-dist/tex/latex/base/leqno.clo\n texmf-dist/tex/latex/base/leqno.sty\n texmf-dist/tex/latex/base/letter.cls\n texmf-dist/tex/latex/base/letter.sty\n texmf-dist/tex/latex/base/ltluatex.lua\n texmf-dist/tex/latex/base/ltluatex.tex\n texmf-dist/tex/latex/base/ltnews.cls\n texmf-dist/tex/latex/base/ltxcheck.tex\n texmf-dist/tex/latex/base/ltxdoc.cls\n texmf-dist/tex/latex/base/ltxguide.cls\n texmf-dist/tex/latex/base/ly1enc.dfu\n texmf-dist/tex/latex/base/macce.def\n texmf-dist/tex/latex/base/makeidx.sty\n texmf-dist/tex/latex/base/minimal.cls\n texmf-dist/tex/latex/base/newlfont.sty\n texmf-dist/tex/latex/base/next.def\n texmf-dist/tex/latex/base/nfssfont.tex\n texmf-dist/tex/latex/base/oldlfont.sty\n texmf-dist/tex/latex/base/omlcmm.fd\n texmf-dist/tex/latex/base/omlcmr.fd\n texmf-dist/tex/latex/base/omlenc.def\n texmf-dist/tex/latex/base/omllcmm.fd\n texmf-dist/tex/latex/base/omscmr.fd\n texmf-dist/tex/latex/base/omscmsy.fd\n texmf-dist/tex/latex/base/omsenc.def\n texmf-dist/tex/latex/base/omsenc.dfu\n texmf-dist/tex/latex/base/omslcmsy.fd\n texmf-dist/tex/latex/base/omxcmex.fd\n texmf-dist/tex/latex/base/omxlcmex.fd\n texmf-dist/tex/latex/base/openbib.sty\n texmf-dist/tex/latex/base/ot1cmdh.fd\n texmf-dist/tex/latex/base/ot1cmfib.fd\n texmf-dist/tex/latex/base/ot1cmfr.fd\n texmf-dist/tex/latex/base/ot1cmr.fd\n texmf-dist/tex/latex/base/ot1cmss.fd\n texmf-dist/tex/latex/base/ot1cmtt.fd\n texmf-dist/tex/latex/base/ot1cmvtt.fd\n texmf-dist/tex/latex/base/ot1enc.def\n texmf-dist/tex/latex/base/ot1enc.dfu\n texmf-dist/tex/latex/base/ot1lcmss.fd\n texmf-dist/tex/latex/base/ot1lcmtt.fd\n texmf-dist/tex/latex/base/ot2enc.dfu\n texmf-dist/tex/latex/base/ot4enc.def\n texmf-dist/tex/latex/base/preload.cfg\n texmf-dist/tex/latex/base/preload.ltx\n texmf-dist/tex/latex/base/proc.cls\n texmf-dist/tex/latex/base/proc.sty\n texmf-dist/tex/latex/base/report.cls\n texmf-dist/tex/latex/base/report.sty\n texmf-dist/tex/latex/base/sample2e.tex\n texmf-dist/tex/latex/base/sfonts.def\n texmf-dist/tex/latex/base/shortvrb.sty\n texmf-dist/tex/latex/base/showidx.sty\n texmf-dist/tex/latex/base/size10.clo\n texmf-dist/tex/latex/base/size11.clo\n texmf-dist/tex/latex/base/size12.clo\n texmf-dist/tex/latex/base/slides.cls\n texmf-dist/tex/latex/base/slides.def\n texmf-dist/tex/latex/base/slides.sty\n texmf-dist/tex/latex/base/small2e.tex\n texmf-dist/tex/latex/base/syntonly.sty\n texmf-dist/tex/latex/base/t1cmdh.fd\n texmf-dist/tex/latex/base/t1cmfib.fd\n texmf-dist/tex/latex/base/t1cmfr.fd\n texmf-dist/tex/latex/base/t1cmr.fd\n texmf-dist/tex/latex/base/t1cmss.fd\n texmf-dist/tex/latex/base/t1cmtt.fd\n texmf-dist/tex/latex/base/t1cmvtt.fd\n texmf-dist/tex/latex/base/t1enc.def\n texmf-dist/tex/latex/base/t1enc.dfu\n texmf-dist/tex/latex/base/t1enc.sty\n texmf-dist/tex/latex/base/t1lcmss.fd\n texmf-dist/tex/latex/base/t1lcmtt.fd\n texmf-dist/tex/latex/base/t2aenc.dfu\n texmf-dist/tex/latex/base/t2benc.dfu\n texmf-dist/tex/latex/base/t2cenc.dfu\n texmf-dist/tex/latex/base/testpage.tex\n texmf-dist/tex/latex/base/texsys.cfg\n texmf-dist/tex/latex/base/textcomp.sty\n texmf-dist/tex/latex/base/tracefnt.sty\n texmf-dist/tex/latex/base/ts1cmr.fd\n texmf-dist/tex/latex/base/ts1cmss.fd\n texmf-dist/tex/latex/base/ts1cmtt.fd\n texmf-dist/tex/latex/base/ts1cmvtt.fd\n texmf-dist/tex/latex/base/ts1enc.def\n texmf-dist/tex/latex/base/ts1enc.dfu\n texmf-dist/tex/latex/base/tuenc.def\n texmf-dist/tex/latex/base/tulmdh.fd\n texmf-dist/tex/latex/base/tulmr.fd\n texmf-dist/tex/latex/base/tulmss.fd\n texmf-dist/tex/latex/base/tulmssq.fd\n texmf-dist/tex/latex/base/tulmtt.fd\n texmf-dist/tex/latex/base/tulmvtt.fd\n texmf-dist/tex/latex/base/ucmr.fd\n texmf-dist/tex/latex/base/ucmss.fd\n texmf-dist/tex/latex/base/ucmtt.fd\n texmf-dist/tex/latex/base/ulasy.fd\n texmf-dist/tex/latex/base/ullasy.fd\n texmf-dist/tex/latex/base/utf8.def\n texmf-dist/tex/latex/base/utf8enc.dfu\n texmf-dist/tex/latex/base/x2enc.dfu\ncatalogue-date 2018-04-24 18:20:06 +0200\ncatalogue-license lppl1.3\ncatalogue-topics format\ncatalogue-version PL3\n\nname latex-bin\ncategory TLCore\nrevision 47496\nshortdesc LaTeX executables and man pages\ndepend latex\ndepend babel\ndepend cm\ndepend hyphen-base\ndepend latex-fonts\ndepend tex-ini-files\ndepend latexconfig\ndepend unicode-data\ndepend latex-bin.ARCH\nexecute AddFormat name=latex engine=pdftex           patterns=language.dat           options=\"-translate-file=cp227.tcx *latex.ini\"           fmttriggers=babel,cm,hyphen-base,latex,latex-fonts,tex-ini-files,latexconfig\nexecute AddFormat name=pdflatex engine=pdftex           patterns=language.dat           options=\"-translate-file=cp227.tcx *pdflatex.ini\"           fmttriggers=babel,cm,hyphen-base,latex,latex-fonts,tex-ini-files,latexconfig\nexecute AddFormat name=dvilualatex engine=luatex           patterns=language.dat,language.dat.lua           options=\"dvilualatex.ini\"           fmttriggers=babel,cm,hyphen-base,latex,latex-fonts,tex-ini-files,unicode-data\nexecute AddFormat name=lualatex engine=luatex           patterns=language.dat,language.dat.lua           options=\"lualatex.ini\"           fmttriggers=babel,cm,hyphen-base,latex,latex-fonts,tex-ini-files,unicode-data\nexecute AddFormat name=luajitlatex mode=disabled engine=luajittex           patterns=language.dat,language.dat.lua           options=\"lualatex.ini\"           fmttriggers=babel,cm,hyphen-base,latex,latex-fonts,tex-ini-files,unicode-data\ncontainersize 516\ncontainerchecksum cf7c32b1c4cca136803cf755d9e9f165b8c4e68e95468c0324a15d8202e40a15ef73c06e87eafba6f668bd28de4fcc90a1d84bef021e6d73d82a34e7703c4b47\ndoccontainersize 20328\ndoccontainerchecksum 7e30b7cbdae6aa91e1a3509dbc8d1b2c3ff5ee1f42c283574d227aa531e012cbbb9403fec6be34fb68f2441de9592293cd148c2b852524bc363777d979f083ea\n\nname latex-fonts\ncategory Package\nrevision 28888\nshortdesc A collection of fonts used in LaTeX distributions\nlongdesc This is a collection of fonts for use with standard LaTeX\nlongdesc packages and classes. It includes 'invisible' fonts (for use\nlongdesc with the slides class), line and circle fonts (for use in the\nlongdesc picture environment) and 'LaTeX symbol' fonts. For full support\nlongdesc of a LaTeX installation, some Computer Modern font variants\nlongdesc cmbsy(6-9), cmcsc(8,9), cmex(7-9) and cmmib(5-9) from the\nlongdesc amsfonts distribution, are also necessary. The fonts are\nlongdesc available as Metafont source, and metric (tfm) files are also\nlongdesc provided. Most of the fonts are also available in Adobe Type 1\nlongdesc format, in the amsfonts distribution.\ncontainersize 17948\ncontainerchecksum ce52b60862fd61367d4951db1852db7e0f4f7922580680b3560bea1df065d2a6792ca5ca9647c2cb6cc5e2bbeff44c410dacf6d468a58e9a2620004b4f6cef62\ndoccontainersize 1124\ndoccontainerchecksum 2c9d67d0b9521680e839f14b7e30469c00824c8ed68856aa63a56f21c2ddc1cc8dbd69a001e989b5ce331eddb66b12f0ad1d391f75b94f5a491ba77e796d6c9e\nrunfiles size=61\n texmf-dist/fonts/source/public/latex-fonts/circle.mf\n texmf-dist/fonts/source/public/latex-fonts/icmcsc10.mf\n texmf-dist/fonts/source/public/latex-fonts/icmex10.mf\n texmf-dist/fonts/source/public/latex-fonts/icmmi8.mf\n texmf-dist/fonts/source/public/latex-fonts/icmsy8.mf\n texmf-dist/fonts/source/public/latex-fonts/icmtt8.mf\n texmf-dist/fonts/source/public/latex-fonts/ilasy8.mf\n texmf-dist/fonts/source/public/latex-fonts/ilcmss8.mf\n texmf-dist/fonts/source/public/latex-fonts/ilcmssb8.mf\n texmf-dist/fonts/source/public/latex-fonts/ilcmssi8.mf\n texmf-dist/fonts/source/public/latex-fonts/lasy.mf\n texmf-dist/fonts/source/public/latex-fonts/lasy10.mf\n texmf-dist/fonts/source/public/latex-fonts/lasy5.mf\n texmf-dist/fonts/source/public/latex-fonts/lasy6.mf\n texmf-dist/fonts/source/public/latex-fonts/lasy7.mf\n texmf-dist/fonts/source/public/latex-fonts/lasy8.mf\n texmf-dist/fonts/source/public/latex-fonts/lasy9.mf\n texmf-dist/fonts/source/public/latex-fonts/lasyb10.mf\n texmf-dist/fonts/source/public/latex-fonts/lcircle10.mf\n texmf-dist/fonts/source/public/latex-fonts/lcirclew10.mf\n texmf-dist/fonts/source/public/latex-fonts/lcmss8.mf\n texmf-dist/fonts/source/public/latex-fonts/lcmssb8.mf\n texmf-dist/fonts/source/public/latex-fonts/lcmssi8.mf\n texmf-dist/fonts/source/public/latex-fonts/line.mf\n texmf-dist/fonts/source/public/latex-fonts/line10.mf\n texmf-dist/fonts/source/public/latex-fonts/linew10.mf\n texmf-dist/fonts/source/public/latex-fonts/sroman.mf\n texmf-dist/fonts/source/public/latex-fonts/sromanu.mf\n texmf-dist/fonts/tfm/public/latex-fonts/icmcsc10.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/icmex10.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/icmmi8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/icmsy8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/icmtt8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/ilasy8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/ilcmss8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/ilcmssb8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/ilcmssi8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lasy10.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lasy5.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lasy6.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lasy7.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lasy8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lasy9.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lasyb10.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lcircle10.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lcirclew10.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lcmss8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lcmssb8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/lcmssi8.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/line10.tfm\n texmf-dist/fonts/tfm/public/latex-fonts/linew10.tfm\ncatalogue-ctan /fonts/latex\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics font font-symbol font-mf\n\nname latexconfig\ncategory Package\nrevision 45777\nshortdesc configuration files for LaTeX-related formats\ncontainersize 4776\ncontainerchecksum c61085460eb52dad4b8e77b4cd1454eac2514da6747a4fd64ebb2493f27a47ddf3d1de1b28276d49f9936cb2876dabe836e6f7bf0a250cea9e484ea65fe83276\nrunfiles size=10\n texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg\n texmf-dist/tex/latex/latexconfig/hyperref.cfg\n texmf-dist/tex/latex/latexconfig/latex.ini\n texmf-dist/tex/latex/latexconfig/lualatex-patch-kernel.tex\n texmf-dist/tex/latex/latexconfig/lualatex-reset-codes.tex\n texmf-dist/tex/latex/latexconfig/lualatexiniconfig.tex\n texmf-dist/tex/latex/latexconfig/lualatexquotejobname.lua\n texmf-dist/tex/latex/latexconfig/lualatexquotejobname.tex\n texmf-dist/tex/latex/latexconfig/mllatex.ini\n texmf-dist/tex/latex/latexconfig/pdflatex.ini\n\nname ltxmisc\ncategory Package\nrevision 21927\nshortdesc Miscellaneous LaTeX packages, etc\ncontainersize 15380\ncontainerchecksum d7b93ae125998ac4448b698ba142a930cde58424379ccd3752de1261b61536b2e87d15dfd159eac6e62d7cc8611806a8bd5d7e9565252a9d18d0eb2bf5183134\nrunfiles size=17\n texmf-dist/tex/latex/ltxmisc/abstbook.cls\n texmf-dist/tex/latex/ltxmisc/beletter.cls\n texmf-dist/tex/latex/ltxmisc/bibcheck.sty\n texmf-dist/tex/latex/ltxmisc/concrete.sty\n texmf-dist/tex/latex/ltxmisc/flashcard.cls\n texmf-dist/tex/latex/ltxmisc/iagproc.cls\n texmf-dist/tex/latex/ltxmisc/linsys.sty\n texmf-dist/tex/latex/ltxmisc/mitpress.sty\n texmf-dist/tex/latex/ltxmisc/thrmappendix.sty\n texmf-dist/tex/latex/ltxmisc/topcapt.sty\n texmf-dist/tex/latex/ltxmisc/vrbexin.sty\ncatalogue-ctan /macros/latex/contrib/misc\ncatalogue-date 2016-06-18 16:48:54 +0200\ncatalogue-license collection\ncatalogue-topics collection\n\nname lua-alt-getopt\ncategory Package\nrevision 29349\nshortdesc Process application arguments the same way as getopt_long\nlongdesc lua_altgetopt is a MIT-licensed module for Lua, for processing\nlongdesc application arguments in the same way as BSD/GNU getopt_long(3)\nlongdesc functions do. This module is made available for lua script\nlongdesc writers to have consistent command line parsing routines.\ncontainersize 1992\ncontainerchecksum 85c5f1ba68f9fc874b025a7ebd63501419b1df332fbe456e49560effbe4f386abc641481a91a35e66617f7e7357f45a5d605876efa0e3fd680d4a4699c0e7cf1\ndoccontainersize 3312\ndoccontainerchecksum 311a04ef22af0e2bcab6166ff3d257f76e7c39244cbe81742009a97466e5230d69a574e98976db5ac585baf3e3d13c0e6b2cfdebb119e6db2acc6e8aba0169b3\nrunfiles size=1\n texmf-dist/scripts/lua-alt-getopt/alt_getopt.lua\ncatalogue-ctan /support/lua/lua-alt-getopt\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license mit\ncatalogue-topics lua-supp\ncatalogue-version 0.7.0\n\nname lua-visual-debug\ncategory Package\nrevision 41387\nshortdesc Visual debugging with LuaLaTeX\nlongdesc The package uses lua code to provide visible indications of\nlongdesc boxes, glues, kerns and penalties in the PDF output. The\nlongdesc package is known to work in LaTeX and Plain TeX documents.\ncontainersize 3240\ncontainerchecksum d5cfbc328ea50720eca067e9cfe436d8908df0acf50b48539b8f875bf735f79c376aa9b1936304aad46c3f37048efa668f10ed91549fc3aec68d98942ce0237a\ndoccontainersize 388908\ndoccontainerchecksum 6d8ecfc56d263086fabd8cd12452c45547f5f872275ea6cc6dd5ddd1ac74449e8f903ba77ac0ab2d4f7b9bdcfce16efffa031bac1dced7e67022a7b81684825b\nrunfiles size=3\n texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.lua\n texmf-dist/tex/luatex/lua-visual-debug/lua-visual-debug.sty\ncatalogue-ctan /macros/luatex/generic/lua-visual-debug\ncatalogue-date 2016-12-18 09:43:24 +0100\ncatalogue-license mit\ncatalogue-topics debug-supp luatex\ncatalogue-version 0.5\n\nname lua2dox\ncategory Package\nrevision 29349\nshortdesc Auto-documentation of lua code\nlongdesc The package extends the well-known C-like language autodoc\nlongdesc tool, doxygen, to read and document lua code. In use, you edit\nlongdesc and test your code and periodically run the autodoc tool to\nlongdesc update the documentation, which may be viewed via an html\nlongdesc browser. Autodoc tools can read the code well enough to find\nlongdesc function/... declarations and document them. If the code also\nlongdesc contains appropriatly formatted \"magic comments\", the tool can\nlongdesc use them to supplement the documentation. The package is a\nlongdesc first prototype of a planned TeX2DoX tool (in development),\nlongdesc which will process joint (La)TeX/lua documents.\ndepend lua2dox.ARCH\ncontainersize 7580\ncontainerchecksum 7f94a474c26a50b50eb9d26082a174f526272fbe39d8a2d4e2afedfac7cfdf1adadbc2fa69d029ae92463fdb9db86f36bbd5d54538f14df933c697c8a85fbf4c\ndoccontainersize 505632\ndoccontainerchecksum e1be1ffaeca1cd4830c2ee0636aaa4d596ef2cf63fcc54a84a3db7f36d53af01b571c15f26650d4ca35b523957b281818b94f4a8a36ab5e89f7afc49f4480512\nrunfiles size=7\n texmf-dist/scripts/lua2dox/lua.def\n texmf-dist/scripts/lua2dox/lua2dox.lua\n texmf-dist/scripts/lua2dox/lua2dox_filter\ncatalogue-ctan /web/lua2dox\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics litprog\ncatalogue-version 0.2\n\nname luacode\ncategory Package\nrevision 25193\nshortdesc Helper for executing lua code from within TeX\nlongdesc Executing Lua code from within TeX with directlua can sometimes\nlongdesc be tricky: there is no easy way to use the percent character,\nlongdesc counting backslashes may be hard, and Lua comments don't work\nlongdesc the way you expect. The package provides the \\luaexec command\nlongdesc and the luacode(*) environments to help with these problems.\ncontainersize 2188\ncontainerchecksum 2e135a1af37d2f239a972ed407415b49c39d2930c29f02f17283452d2683ce33fa695d3709137be6fe952c3dda6bde0ff3ee5007b2b6aca90f686effcbebe206\ndoccontainersize 412316\ndoccontainerchecksum 3cc13b412ec06725e4e624f6a033d431793da1c04e3cae3166ea495ccba903a52d224d518d039787adbf71f4e6190c1edec2134ee895d7f98423b656257eaf4a\nsrccontainersize 9012\nsrccontainerchecksum 5bc71c17e2a85fcba64b1b768464ad58bb253f826323ae2f95d0bd1e7650fe45f8fc9f13f9b4849ef172ad3caba0f2e83c934a6b8a0ce2bc3987fdb188c22cca\nrunfiles size=2\n texmf-dist/tex/lualatex/luacode/luacode.sty\ncatalogue-ctan /macros/luatex/latex/luacode\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics lua-supp luatex\ncatalogue-version 1.2a\n\nname luahyphenrules\ncategory Package\nrevision 42670\nshortdesc Loading patterns in LuaLaTeX with language.dat\nlongdesc Preloading hyphenation patterns (or 'hyphen rules.) into any\nlongdesc format based upon LuaTeX is not required in LuaTeX and recent\nlongdesc releases of babel don't do it anyway. This package is addressed\nlongdesc to those who just want to select the languages and load their\nlongdesc patterns by means of `language.dat` without loading `babel`.\ncontainersize 2388\ncontainerchecksum 2cf947482acb36ed99138de97304c4dc9ac929f6bf6bd0f32319d35ad2741ef03dd93da804ec331a6d3a1011cac4a105003a8028eaf1c041a7fc520ba27ceb3f\ndoccontainersize 39052\ndoccontainerchecksum f181a3c3147ece62ef0088ac815079ff2a2648a89969f3c2555b150d387a35d7d5b42a78a95a0efd90c4d6c6ab0b4427bae24d320b1435ce3a74a715cd79b716\nrunfiles size=2\n texmf-dist/tex/lualatex/luahyphenrules/luahyphenrules.sty\ncatalogue-ctan /macros/luatex/latex/luahyphenrules\ncatalogue-date 2016-12-17 05:41:03 +0100\ncatalogue-license lppl1.3\ncatalogue-topics hyphenation luatex\ncatalogue-version 1.0\n\nname luaindex\ncategory Package\nrevision 25882\nshortdesc Create index using LuaLaTeX\nlongdesc Luaindex provides (yet another) index processor, written in\nlongdesc Lua.\ncontainersize 4488\ncontainerchecksum 60c0ccd42590fc29d2ea99a70ce1ace05ccea8608edc48a65732d3062554d3d8ca866c7aab30e14752a312243bc131b9e06f045b68c8a3d631428a432af8abcd\ndoccontainersize 160880\ndoccontainerchecksum af008a80e9906a5e3a6532f201066b3d57cfc9436eea8844d3f5a2f6d15dbaa100f99bec9f09528eeaf1ed29944a4de96cc9346d8bef772963de13861c0eb9f0\nsrccontainersize 13392\nsrccontainerchecksum 5733006ee58becd0e14351b9b67d0b32b6f332d5b86ba6b7c51d1f1bb360f1377aa9545c7918d53802606700ebe93eea2e581913feaee700b84eafde33952bb8\nrunfiles size=6\n texmf-dist/scripts/luaindex/luaindex.lua\n texmf-dist/tex/lualatex/luaindex/luaindex.sty\ncatalogue-ctan /macros/luatex/latex/luaindex\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics index\ncatalogue-version 0.1b\n\nname luainputenc\ncategory Package\nrevision 20491\nshortdesc Replacing inputenc for use in LuaTeX\nlongdesc LuaTeX operates by default in UTF-8 input; thus LaTeX documents\nlongdesc that need 8-bit character-sets need special treatment. (In\nlongdesc fact, LaTeX documents using UTF-8 with \"traditional\" --\nlongdesc 256-glyph -- fonts also need support from this package.) The\nlongdesc package, therefore, replaces the LaTeX standard inputenc for\nlongdesc use under LuaTeX. With a current LuaTeX,the package has the\nlongdesc same behaviour with LuaTeX as inputenc has under pdfTeX.\ncontainersize 4996\ncontainerchecksum a626c9f0c1ea5037758886399183773e3b746d3fbcfcb886c7c875eff69d6c25c449ff363342fe526785fa246139a25401feea8a5d2018dcb610f44132abf6d0\ndoccontainersize 405668\ndoccontainerchecksum 959d2ca40ba73c3c42d8ee3b37c05b05accb1f9bc1430e09c93c1f3077664d8b6d2fdf24d40e153c314437b0ce161a24d75609e199c917f4ad90b5a1c8357cb6\nsrccontainersize 12404\nsrccontainerchecksum fbf4557582a25ae71c510db06d14cc131a7db99369bbac19ce68eede61aef6f41a1add200dc4660b2bc2b48e2eb64c1b861b1b6dce9b4f7683ffa54cfd011004\nrunfiles size=8\n texmf-dist/tex/lualatex/luainputenc/luainputenc.lua\n texmf-dist/tex/lualatex/luainputenc/luainputenc.sty\n texmf-dist/tex/lualatex/luainputenc/lutf8.def\n texmf-dist/tex/lualatex/luainputenc/lutf8x.def\ncatalogue-ctan /macros/luatex/latex/luainputenc\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license pd\ncatalogue-topics inputenc luatex\ncatalogue-version 0.973\n\nname luaintro\ncategory Package\nrevision 35490\nshortdesc Examples from the book \"Einfuhrung in LuaTeX und LuaLaTeX\"\nlongdesc The bundle provides source of all the examples published in the\nlongdesc German book \"Einfuhrung in LuaTeX und LuaLaTeX\", published by\nlongdesc Lehmans Media and DANTE, Berlin.\ncontainersize 468\ncontainerchecksum 61494892635c6ccc928de914280a826582e26254e82b75e4713c6d7f209f58a4259c980715b09dd3ce1287822b5f34e2229db12e92abf4bd38befab565da1877\ndoccontainersize 30296\ndoccontainerchecksum fd566b874716888c0135cc7464382cfea65be4539e029d36c1020536046f94160d6637a86ed44e31e7e8da6c60eee092138e4d8567aa613eebfd8c37c6927f6e\ncatalogue-ctan /info/examples/luaintro\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics book-ex\ncatalogue-version 0.03\n\nname lualatex-doc\ncategory Package\nrevision 30473\nshortdesc A guide to use of LaTeX with LuaTeX\nlongdesc The document is a map/guide to the world of LuaLaTeX. Coverage\nlongdesc supports both new users and package developers. Apart from the\nlongdesc introductory material, the document gathers information from\nlongdesc several sources, and offers links to others.\ncontainersize 508\ncontainerchecksum 076b23f336857c0c60baf7390314241abfc76ef244e77cddd4e8702e049863ce08b2464767a7ceaa1343b7dfac906222d9d4099baa42c4339e126b9357a988f4\ndoccontainersize 112928\ndoccontainerchecksum cccde093698749307035cf673477b8ca9d052c0d11af2a4396c07dd5fb135d278febbee35ee6e2294c49d0e123589ffd8dc6e5d5fe38c23dcc2cc850f43b1128\nsrccontainersize 15184\nsrccontainerchecksum 5ea811c91d4de834cefcec7fedaa5bc33173e8bfc060d4fa74c21119e556244e3be7d8e71ea120559fb508078f8e843fbdf3a72f06e2b5c0e8d01c0bc44cbca4\ncatalogue-ctan /info/luatex/lualatex-doc\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license fdl\ncatalogue-topics luatex-doc\n\nname lualatex-math\ncategory Package\nrevision 44621\nshortdesc Fixes for mathematics-related LuaLaTeX issues\nlongdesc The package patches a few commands of the LaTeX2e kernel and\nlongdesc the amsmath and mathtools packages to be more compatible with\nlongdesc the LuaTeX engine. It is only meaningful for LuaLaTeX documents\nlongdesc containing mathematical formulas, and does not exhibit any new\nlongdesc functionality. The fixes are mostly moved from the unicode-math\nlongdesc package to this package since they are not directly related to\nlongdesc Unicode mathematics typesetting.\ncontainersize 3056\ncontainerchecksum 98b88213f0a8c8e7e1d4941e7692771ebd5d29f0d1bdd077ee7a55cb348689ca8820f227209af76d05bf9f13a826353791726fc15d4cdc71b8bc703d23d48e33\ndoccontainersize 185040\ndoccontainerchecksum 3f65fe029c7ca74ba3480f80187b05d52c4946d00c08ff57f9d0358ed85c6158103030ecdee0975345aaa94edb1df039f91fab327a1bd5f7d6e524988ddf587b\nsrccontainersize 8804\nsrccontainerchecksum e210ae76fdb8275476f7f8a9b9258c4f7e89928eff1070e3c4bfa85dc3db2c722434c630d3deba759ddb75afac601aca18beb0cffd2d32dcc111bd24fadf2d4a\nrunfiles size=3\n texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua\n texmf-dist/tex/lualatex/lualatex-math/lualatex-math.sty\ncatalogue-ctan /macros/luatex/latex/lualatex-math\ncatalogue-date 2017-06-16 19:05:48 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics maths luatex\ncatalogue-version 1.7\n\nname lualibs\ncategory Package\nrevision 43153\nshortdesc Additional Lua functions for LuaTeX macro programmers\nlongdesc Lualibs is a collection of Lua modules useful for general\nlongdesc programming. The bundle is based on lua modules shipped with\nlongdesc ConTeXt, and made available in this bundle for use independent\nlongdesc of ConTeXt.\ncontainersize 73696\ncontainerchecksum e5ece99d5f6b3539ecccb2f7506d9cc7d89d5e9bfcad767db548f673875d3360a7ce778a1cc61a3467cd3ba21904a413f7109d47dec00bb7100ba3f78effbc08\ndoccontainersize 93584\ndoccontainerchecksum f84375704094796a308dd63e2a0ffd090449f3e15758516d835d384d448af9b87008e0871eaf0a303afd6a36804368286c3cb051c5a3514e668294f9b8904302\nsrccontainersize 11420\nsrccontainerchecksum 82f33f896713f85ba672b56309ecb2198cd5a7a3e35707eee2e6cded65b44154098281e46f04d4b9069a54e55bd84147c8c950e62e4a7846ab6e1d445a5527f2\nrunfiles size=113\n texmf-dist/tex/luatex/lualibs/lualibs-basic.lua\n texmf-dist/tex/luatex/lualibs/lualibs-boolean.lua\n texmf-dist/tex/luatex/lualibs/lualibs-compat.lua\n texmf-dist/tex/luatex/lualibs/lualibs-dir.lua\n texmf-dist/tex/luatex/lualibs/lualibs-extended.lua\n texmf-dist/tex/luatex/lualibs/lualibs-file.lua\n texmf-dist/tex/luatex/lualibs/lualibs-function.lua\n texmf-dist/tex/luatex/lualibs/lualibs-gzip.lua\n texmf-dist/tex/luatex/lualibs/lualibs-io.lua\n texmf-dist/tex/luatex/lualibs/lualibs-lpeg.lua\n texmf-dist/tex/luatex/lualibs/lualibs-lua.lua\n texmf-dist/tex/luatex/lualibs/lualibs-math.lua\n texmf-dist/tex/luatex/lualibs/lualibs-md5.lua\n texmf-dist/tex/luatex/lualibs/lualibs-number.lua\n texmf-dist/tex/luatex/lualibs/lualibs-os.lua\n texmf-dist/tex/luatex/lualibs/lualibs-package.lua\n texmf-dist/tex/luatex/lualibs/lualibs-set.lua\n texmf-dist/tex/luatex/lualibs/lualibs-string.lua\n texmf-dist/tex/luatex/lualibs/lualibs-table.lua\n texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua\n texmf-dist/tex/luatex/lualibs/lualibs-unicode.lua\n texmf-dist/tex/luatex/lualibs/lualibs-url.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-deb.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-dim.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-fil.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-jsn.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-lua.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-prs.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-sta.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-sto.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-tab.lua\n texmf-dist/tex/luatex/lualibs/lualibs-util-tpl.lua\n texmf-dist/tex/luatex/lualibs/lualibs.lua\ncatalogue-ctan /macros/luatex/generic/lualibs\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license gpl2\ncatalogue-topics lua-supp luatex\ncatalogue-version 2.5\n\nname luamplib\ncategory Package\nrevision 47336\nshortdesc Use LuaTeX's built-in MetaPost interpreter\nlongdesc The package enables the user to specify MetaPost diagrams\nlongdesc (which may include colour specifications from the color or\nlongdesc xcolor packages) into a document, using LuaTeX's built-in\nlongdesc MetaPost library. The facility is only available in PDF mode.\ncontainersize 11920\ncontainerchecksum d8fe732e2d931744f4deb4864253622eb67a8b5172b0dcbc904e5acbc7f0721776cf1fcf20cfa934deffec4996b5ee1b330342771677225a81cab5daf7da3249\ndoccontainersize 165096\ndoccontainerchecksum fcc10d7dc5a817767ab290d95be448321fbf4165a494f33ad9d0db72bc31abead701e796d834b8321941eeabd931101388cd4fcd3e8703c25c6f9ef2cfee510f\nsrccontainersize 25352\nsrccontainerchecksum e4b0f920d4328c7d352038b230ee9562ffb9526ae3159cb0e60c3ea11f213083470febf80c3b3c22aab9e71925c9fea081f79b28215bade77d9a23e9a14a3ec6\nrunfiles size=12\n texmf-dist/tex/luatex/luamplib/luamplib.lua\n texmf-dist/tex/luatex/luamplib/luamplib.sty\ncatalogue-ctan /macros/luatex/generic/luamplib\ncatalogue-date 2018-04-06 08:25:06 +0200\ncatalogue-license gpl2\ncatalogue-topics mp-use graphics-in-tex luatex\ncatalogue-version 2.12.3\n\nname luaotfload\ncategory Package\nrevision 47444\nshortdesc OpenType 'loader' for Plain TeX and LaTeX\nlongdesc The package adopts the TrueType/OpenType Font loader code\nlongdesc provided in ConTeXt, and adapts it to use in Plain TeX and\nlongdesc LaTeX. It works under LuaLaTeX only.\ndepend lualibs\ndepend luaotfload.ARCH\ncontainersize 441624\ncontainerchecksum 07d85e222d32a4860d855c68b7f8b3c4c1f30211714c609ee65352d077ba633b76a157ff277017831080566861be8499f7a613d4b3c67e9b17389663f019776f\ndoccontainersize 331728\ndoccontainerchecksum 557a462d62a52bfc05a8687fc0444dd11244bf0cb9c94f4aa56c50ab8388573e5ffbbcf60a04660b962b16afc80ce25cd01dc428c6f659a132f37f31863e2282\nsrccontainersize 36536\nsrccontainerchecksum 8a2cab7e23027949a696cd104796d059e51b4b2bc70f57f6f75007b5f496be5ffe1ef2aea9fb70fc08d630e0df0b447ece6575059f3b7a38f58ef493ef73bfee\nrunfiles size=1248\n texmf-dist/scripts/luaotfload/luaotfload-tool.lua\n texmf-dist/scripts/luaotfload/mkcharacters\n texmf-dist/scripts/luaotfload/mkglyphlist\n texmf-dist/scripts/luaotfload/mkimport\n texmf-dist/scripts/luaotfload/mkstatus\n texmf-dist/scripts/luaotfload/mktests\n texmf-dist/tex/luatex/luaotfload/fontloader-2017-02-11.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-basics-gen.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-basics-nod.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-basics.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-data-con.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-afk.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-cff.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-cid.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-con.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-def.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-dsp.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-gbn.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-ini.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-lua.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-map.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-ocl.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-one.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-onr.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-osd.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-ota.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-otc.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-oti.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-otj.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-otl.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-oto.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-otr.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-ots.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-oup.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-tfm.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-font-ttf.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-fonts-demo-vf-1.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-fonts-enc.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-fonts-ext.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-fonts-syn.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-fonts.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-fonts.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-l-boolean.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-file.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-function.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-io.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-lpeg.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-lua.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-math.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-string.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-l-table.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-languages.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-languages.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-math.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-math.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-mplib.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-mplib.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-plain.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-preprocessor-test.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-preprocessor.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-preprocessor.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-reference.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-swiglib-test.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-swiglib-test.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-swiglib.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-swiglib.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-test.tex\n texmf-dist/tex/luatex/luaotfload/fontloader-util-fil.lua\n texmf-dist/tex/luatex/luaotfload/fontloader-util-str.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-blacklist.cnf\n texmf-dist/tex/luatex/luaotfload/luaotfload-characters.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-colors.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-database.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-diagnostics.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-glyphlist.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-letterspace.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-log.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-parsers.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-resolvers.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload-status.lua\n texmf-dist/tex/luatex/luaotfload/luaotfload.sty\ncatalogue-ctan /macros/luatex/generic/luaotfload\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license gpl2\ncatalogue-topics font-use luatex\ncatalogue-version 2.8-fix-2\n\nname luapackageloader\ncategory Package\nrevision 44865\nshortdesc Allow LuaTeX to load external Lua packages\nlongdesc This package allows LuaTeX to load packages from the default\nlongdesc package.path and package.cpath locations. This could be useful\nlongdesc to load external Lua modules, including modules installed via\nlongdesc LuaRocks. This package requires ifluatex.\ncontainersize 1660\ncontainerchecksum b55830386d6855d54480a937cd70b46b2421d41e67f08e2ff7f0ff9dd3c98d609c1a2a61d4531a187d542e567f3b6304162ecf3efcb4b6b51d6fa63441ce6d96\ndoccontainersize 35468\ndoccontainerchecksum f32580f23a3beb4b4b182982eca8f7080a2767cf7b4d8a6e0cbfe8989f01174a70a1395e218cd2c7fa9f30aa82391a84010f656d2e3683a8e55ef49b0ca35a54\nrunfiles size=2\n texmf-dist/tex/luatex/luapackageloader/luapackageloader.lua\n texmf-dist/tex/luatex/luapackageloader/luapackageloader.sty\ncatalogue-ctan /macros/luatex/generic/luapackageloader\ncatalogue-date 2017-06-07 05:22:03 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics luatex lua-supp use-lua\ncatalogue-version 0.1\n\nname luatex\ncategory TLCore\nrevision 47235\nshortdesc The LuaTeX engine\nlongdesc LuaTeX is an extended version of pdfTeX using Lua as an\nlongdesc embedded scripting language. The LuaTeX project's main\nlongdesc objective is to provide an open and configurable variant of TeX\nlongdesc while at the same time offering downward compatibility. LuaTeX\nlongdesc uses Unicode (as UTF-8) as its default input encoding, and is\nlongdesc able to use modern (OpenType) fonts (for both text and\nlongdesc mathematics). It should be noted that LuaTeX is still under\nlongdesc development; its specification has been declared stable, but\nlongdesc absolute stability may not in practice be assumed. Source code\nlongdesc is available from ctan:/systems/texlive/source.\ndepend cm\ndepend etex\ndepend hyphen-base\ndepend knuth-lib\ndepend plain\ndepend tex-ini-files\ndepend unicode-data\ndepend luatex.ARCH\nexecute AddFormat name=luatex engine=luatex options=\"luatex.ini\"   patterns=language.def,language.dat.lua   fmttriggers=cm,etex,hyphen-base,knuth-lib,plain,tex-ini-files,unicode-data\nexecute AddFormat name=dviluatex engine=luatex options=\"dviluatex.ini\"   patterns=language.def,language.dat.lua   fmttriggers=cm,etex,hyphen-base,knuth-lib,plain,tex-ini-files,unicode-data\nexecute AddFormat name=luajittex engine=luajittex options=\"luatex.ini\"   patterns=language.def,language.dat.lua   fmttriggers=cm,etex,hyphen-base,knuth-lib,plain,tex-ini-files,unicode-data\ncontainersize 12856\ncontainerchecksum a9adc65694661ca9f012c7012f36c04616676465c89d40bbf779617b933bfb1672e4183f956109a352dbefef6730340d19e0c782ce2220febbda9fe86c724e2b\ndoccontainersize 1312548\ndoccontainerchecksum 3ed90c0ea5e11b5afb5bf7062084512a90e436c83f5583bc0a04c55fc2d3d9a3abe3d685706e82698a27a95131ee0adc0e3da7778e5a533cff62dac8e4bce500\nrunfiles size=37\n texmf-dist/tex/generic/config/luatex-unicode-letters.tex\n texmf-dist/tex/generic/config/luatexiniconfig.tex\n texmf-dist/web2c/texmfcnf.lua\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license gpl2\ncatalogue-topics engine\n\nname luatex85\ncategory Package\nrevision 41456\nshortdesc pdfTeX aliases for LuaTeX\nlongdesc The package provides emulation of pdfTeX primitives for LuaTeX\nlongdesc v0.85+.\ncontainersize 1740\ncontainerchecksum 5366f13010df9a7ea224d825252a126a9dd560af373f9359dbc87d3398c50ed040852e43c5953bfc767f4a49accaaa8333a42b8a3d661e7df69e3a9fc2f13e79\ndoccontainersize 171136\ndoccontainerchecksum 6353689e7f50779d2969082d11ed33649ec8ae2d75dce18b7016b40df33bee21e0a261eaa25c719d06f5ccab2f1b3fab97b924b2cd939a7dd79568db2ea0c331\nsrccontainersize 3780\nsrccontainerchecksum 6de2565880374c7b7a3534652c5203e0b61e6a8b1ae865f9e2dc636f31864f069f5d9bf280ddb36064834b5ccb6cbabcf6fa7511206d6d50f197a7af09ad9bdb\nrunfiles size=2\n texmf-dist/tex/generic/luatex85/luatex85.sty\ncatalogue-ctan /macros/generic/luatex85\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics lua-supp\ncatalogue-version 1.4\n\nname luatexbase\ncategory Package\nrevision 38550\nshortdesc Basic resource management for LuaTeX code\nlongdesc The LaTeX kernel (LaTeX2e 2015/10/01 onward) builds in support\nlongdesc for LuaTeX functionality, also available as ltluatex.tex for\nlongdesc users of plain TeX and those with older LaTeX kernel\nlongdesc implementations. This support is based on ideas taken from the\nlongdesc original luatexbase package, but there are interface\nlongdesc differences. This 'stub' package provides a compatibility layer\nlongdesc to allow existing packages to upgrade smoothly to the new\nlongdesc support structure.\ncontainersize 3496\ncontainerchecksum e0de4aac88b8558ce85f27cd4a659b0373f0e122a5ced943c83140f722b6415437ec39a9a809402d31802340de7dd22669cf03236b8ef18ff343adbdc615ef95\ndoccontainersize 263748\ndoccontainerchecksum cb2d91f48716999a3facef7b3cb162b50ba217b640f2954783acdd6ebe3f739c6f776353b4e4440f0a4f84efc9b457e0d35190be421733cfdbbf0cad2835eafb\nsrccontainersize 8440\nsrccontainerchecksum deb8fbe9b572898613d77d581a9cd0a2e6c88480dd55169ec8a04995b06c81f90f2bae8811b4fd05c484bf9009a831044b0c460a9a40223be9cb6fef3939f19a\nrunfiles size=11\n texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty\n texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty\n texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty\n texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty\n texmf-dist/tex/luatex/luatexbase/luatexbase-mcb.sty\n texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.sty\n texmf-dist/tex/luatex/luatexbase/luatexbase-regs.sty\n texmf-dist/tex/luatex/luatexbase/luatexbase.loader.lua\n texmf-dist/tex/luatex/luatexbase/luatexbase.sty\ncatalogue-ctan /macros/luatex/generic/luatexbase\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics luatex\ncatalogue-version 1.3\n\nname luatexko\ncategory Package\nrevision 47337\nshortdesc Typeset Korean with Lua(La)TeX\nlongdesc This is a Lua(La)TeX macro package that supports typesetting\nlongdesc Korean documents including Old Hangul texts. As LuaTeX has\nlongdesc opened up access to almost all the hidden routines of TeX\nlongdesc engine, users can obtain more beautiful outcome using this\nlongdesc package rather than other Hangul macros operating on other\nlongdesc engines. LuaTeX version 0.79+ and luaotfload package version\nlongdesc 2.4+ are required for this package to run. This package also\nlongdesc requires both cjk-ko and xetexko packages for its full\nlongdesc functionality.\ncontainersize 23868\ncontainerchecksum 19e84bcba059507b4009c0f718361f465c59edf77c09da6b218261d7bd72e7e98c39fc2356f483100c5fcb396c361fbd7bfcf50647d913244f01dbdc62cbf116\ndoccontainersize 237288\ndoccontainerchecksum f49beaa18c1890655d034c3b1f01a76b8c0ba3993d8da8a16512438acdf021d063e467b9e49d6be31520892663dc4cbf64b2750d950ee20cc27be258d9666b3c\nrunfiles size=32\n texmf-dist/tex/luatex/luatexko/luatexko-core.sty\n texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua\n texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua\n texmf-dist/tex/luatex/luatexko/luatexko.lua\n texmf-dist/tex/luatex/luatexko/luatexko.sty\ncatalogue-ctan /macros/luatex/generic/luatexko\ncatalogue-date 2018-04-06 08:40:35 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics luatex korean\ncatalogue-version 1.19\n\nname luatextra\ncategory Package\nrevision 20747\nshortdesc Additional macros for Plain TeX and LaTeX in LuaTeX\nlongdesc The package provides a coherent extended programming\nlongdesc environment for use with LuaTeX. It loads packages fontspec,\nlongdesc luatexbase and lualibs, and provides additional user-level\nlongdesc features and goodies. The package is under development, and its\nlongdesc specification may be expected to change.\ncontainersize 1024\ncontainerchecksum 1eff6622beac9c02553dc50a8f408b1e9f345418bacd644f5ea3015285de817303550b4dfa63e302360de307ce23adff029cbd5e52b69fdecdf08b4ceffa81f7\ndoccontainersize 317304\ndoccontainerchecksum 62e14aa6b6f907314573169c673b81f7ea9ccf3c6db8f3de42bdce181205625dffcec4794b3f4ccb0e28832148f9e63032d67577ab156a44fb6fceab346ac0e4\nsrccontainersize 3484\nsrccontainerchecksum 26e291db8699108bb8b44dfc7bafe82f36af4cbc9ce3e9ab5d6723bb5cde7dc0eb8abdabb2a442dc065c8e6620818247b67d37a54e1a0d85958ccd1d58262e62\nrunfiles size=1\n texmf-dist/tex/lualatex/luatextra/luatextra.sty\ncatalogue-ctan /macros/luatex/latex/luatextra\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license pd\ncatalogue-topics luatex\ncatalogue-version 1.0.1\n\nname luaxml\ncategory Package\nrevision 46768\nshortdesc Lua library for reading and serialising XML files\nlongdesc This is a redistribution of a pure lua xml library, LuaXML\nlongdesc (this version supports Lua 5.3). The library was originally\nlongdesc distributed as part of the odsfile package, but is made\nlongdesc available separately in the hope that it can be useful for\nlongdesc other projects.\ncontainersize 27284\ncontainerchecksum cf0bc6dcf0492a22dcc5d9d949f50798e0482231f341543cb9128f547f1983225c772ca75ebbe4e0d9b36c69c147a59a605476f19925e98099728f35cc49169f\ndoccontainersize 102012\ndoccontainerchecksum 0c7f7460998a66ab58592c9b60c1dc132b157cc3825761a61b020244459c8ea750a321b5bb8064787ed7e375c4055e2faddf9dc9cc2e55d35a85dce36fe81c19\nrunfiles size=30\n texmf-dist/tex/luatex/luaxml/luaxml-cssquery.lua\n texmf-dist/tex/luatex/luaxml/luaxml-domobject.lua\n texmf-dist/tex/luatex/luaxml/luaxml-entities.lua\n texmf-dist/tex/luatex/luaxml/luaxml-mod-handler.lua\n texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua\n texmf-dist/tex/luatex/luaxml/luaxml-namedentities.lua\n texmf-dist/tex/luatex/luaxml/luaxml-parse-query.lua\n texmf-dist/tex/luatex/luaxml/luaxml-pretty.lua\n texmf-dist/tex/luatex/luaxml/luaxml-stack.lua\n texmf-dist/tex/luatex/luaxml/luaxml-testxml.lua\ncatalogue-ctan /macros/luatex/generic/luaxml\ncatalogue-date 2018-02-28 19:44:02 +0100\ncatalogue-license other-free\ncatalogue-topics foreign-import luatex\ncatalogue-version 0.1b\n\nname makeindex\ncategory Package\nrevision 47198\ncatalogue makeindexk\nshortdesc Makeindex development sources\nlongdesc The package contains the development sources of makeindex, as\nlongdesc derived from the texlive subversion repository.\ndepend makeindex.ARCH\ncontainersize 4628\ncontainerchecksum 2c0afe8d9e5d03187ae8ee6b0b023f727577b84d369d31dd5e1a1980a059f75866b752aae8c5067ca968c2c6c6b5a6fb9f11010c8c8ba9f2aac9191a6647c5d7\ndoccontainersize 465972\ndoccontainerchecksum 7feb700df902f8c5d66eb491121218fdb9eb04077a7c208706af3281a81c53ace56cac1080627ff10db939a66a7077dbd637b61642ba5e7256adbbb5b0ea2826\nrunfiles size=9\n texmf-dist/makeindex/base/din.ist\n texmf-dist/makeindex/base/icase.ist\n texmf-dist/makeindex/base/latex.ist\n texmf-dist/makeindex/base/math.ist\n texmf-dist/makeindex/base/mkind.ist\n texmf-dist/makeindex/base/puncts.ist\n texmf-dist/makeindex/base/tex.ist\n texmf-dist/tex/plain/makeindex/idxmac.tex\ncatalogue-ctan /indexing/makeindexk\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license other-free\ncatalogue-topics index\n\nname metafont\ncategory Package\nrevision 47198\nshortdesc A system for specifying fonts\nlongdesc The program takes a semi-algorithmic specification of a font,\nlongdesc and produces a bitmap font (whose properties are defined by a\nlongdesc set of parameters of the target device), and a set metrics for\nlongdesc use by TeX. The bitmap output may be converted into a format\nlongdesc directly usable by a device driver, etc., by the tools provided\nlongdesc in the parallel mfware distribution. (Third parties have\nlongdesc developed tools to convert the bitmap output to outline fonts.)\nlongdesc The distribution includes the source of Knuth's Metafont book;\nlongdesc this source is there to read, as an example of writing TeX --\nlongdesc it should not be processed without Knuth's direct permission.\ndepend kpathsea\ndepend metafont.ARCH\nexecute AddFormat name=mf engine=mf-nowin           options=\"-translate-file=cp227.tcx mf.ini\"\ncontainersize 33496\ncontainerchecksum 46ab9e77136fe7680143d20296b0a3f80188f3bf3f03d5642c32edcc6b286b3161e282f281e386977db4ef228035fa8f73beb7f7344cbe51edbf0be6afba5def\ndoccontainersize 52768\ndoccontainerchecksum 1124acbe6c8b85728e70a67c65fca671a855aa3c3bee4e37d64c180b06be582e6fba7eee3c1c2c3263f71159144b514c5e5166f18e5228b0084a7417807f7936\nrunfiles size=36\n texmf-dist/metafont/base/mf.mf\n texmf-dist/metafont/base/plain.mf\n texmf-dist/metafont/config/cmmf.ini\n texmf-dist/metafont/config/mf.ini\n texmf-dist/metafont/misc/mode2dpi.mf\n texmf-dist/metafont/misc/mode2dpixy.mf\n texmf-dist/metafont/misc/modename.mf\n texmf-dist/metafont/misc/modes.mf\n texmf-dist/metafont/misc/ps2mfbas.mf\ncatalogue-also metapost\ncatalogue-ctan /systems/knuth/dist/mf\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license knuth\ncatalogue-topics font-devel font-proc\ncatalogue-version 2.7182818\n\nname mflogo\ncategory Package\nrevision 42428\nshortdesc LaTeX support for Metafont logo fonts\nlongdesc LaTeX package and font definition file to access the Knuthian\nlongdesc mflogo fonts described in 'The Metafontbook' and to typeset\nlongdesc Metafont logos in LaTeX documents.\ncontainersize 1600\ncontainerchecksum 1c8418186762593c91bbdec30b9f5b8705e4cf4dfbdd01c7f0e20d70b9c6717bc099eb6add34679c8a9e44c72dd15b7319fed4031deabcf2c3716fd242cd7c87\ndoccontainersize 239456\ndoccontainerchecksum 0d94bad751d9c78cf5cbabee8b29a6f43bc96f4ecea82d47ff2f1392b923b1ca2fd0a55cabed63e2cc3e8ac1d6e76fd2d992335c849b699819bd4a395db6e107\nsrccontainersize 5728\nsrccontainerchecksum d685801dbe3720b8e497d2d20c6a3a87448d3df571f6769cb58552bb983a41458de3631b845a0560630605d22407bb44a932c8ff4b75a2bdcb7596e121570b63\nrunfiles size=4\n texmf-dist/fonts/source/public/mflogo/logosl8.mf\n texmf-dist/fonts/tfm/public/mflogo/logosl8.tfm\n texmf-dist/tex/latex/mflogo/mflogo.sty\n texmf-dist/tex/latex/mflogo/ulogo.fd\ncatalogue-ctan /macros/latex/contrib/mflogo\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics font-supp\ncatalogue-version 2.0\n\nname mfnfss\ncategory Package\nrevision 46036\nshortdesc Packages to typeset oldgerman and pandora fonts in LaTeX\nlongdesc This bundle contains two packages: - oldgerm, a package to\nlongdesc typeset with old german fonts designed by Yannis Haralambous. -\nlongdesc pandora, a package to typeset with Pandora fonts designed by\nlongdesc Neena Billawala. Note that support for the Pandora fonts is\nlongdesc also available via the pandora-latex package.\ncontainersize 2108\ncontainerchecksum cbe438e051415adcba7c17aa2ab75267b64cb5c9e7af0a25c1d87c228e9e1ff2e8f302a57acf1c1ce4b18d31aa589079a731bfc09f8d46d81cc1cb030b9496b1\ndoccontainersize 448320\ndoccontainerchecksum 75700dff90fbe52e3ce98a063ae1000da099e7a7acce29da30880b8b92e6b4b82271e2686e85bfd8d36dbf99718735b36abcb04eb50d7bbc94eb3bbaa576359a\nsrccontainersize 17540\nsrccontainerchecksum efc94553641acc572b9f7f6d5ce77ec65971144cb0f05dff4cac3337e3bd8f2d23fcf18e0921a1b801ce5b854b1e79665b9124876e27ae7d1ed2c7fa77bb9cd0\nrunfiles size=8\n texmf-dist/tex/latex/mfnfss/oldgerm.sty\n texmf-dist/tex/latex/mfnfss/ot1panr.fd\n texmf-dist/tex/latex/mfnfss/ot1pss.fd\n texmf-dist/tex/latex/mfnfss/pandora.sty\n texmf-dist/tex/latex/mfnfss/uyfrak.fd\n texmf-dist/tex/latex/mfnfss/uygoth.fd\n texmf-dist/tex/latex/mfnfss/uyinit.fd\n texmf-dist/tex/latex/mfnfss/uyswab.fd\ncatalogue-ctan /macros/latex/contrib/mfnfss\ncatalogue-date 2017-12-10 23:04:16 +0100\ncatalogue-license lppl\ncatalogue-topics font-supp\n\nname mfware\ncategory TLCore\nrevision 47198\nshortdesc Supporting tools for use with Metafont\nlongdesc A collection of programs (as web source) for processing the\nlongdesc output of Metafont.\ndepend mfware.ARCH\ncontainersize 3120\ncontainerchecksum 6b0bf98a6b6420259a4456237ca3a02c4b0586e051555ae27f27afdd1e21da1e54b9f46034cecb920423a54af9c46e02234a517175933d1806bc105ab15d35ca\ndoccontainersize 101464\ndoccontainerchecksum 7447a7719590d9a6cd39f846ce29d22e768b0b7c0272ed9cc349ba41ea8c0d31d78ddfb04808383e7e810644a0b00dbfa308401f0142ae1e36a792380961bb3e\nrunfiles size=4\n texmf-dist/mft/base/README\n texmf-dist/mft/base/cmbase.mft\n texmf-dist/mft/base/mplain.mft\n texmf-dist/mft/base/plain.mft\ncatalogue-ctan /systems/knuth/dist/mfware\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license knuth\ncatalogue-topics collection\n\nname mptopdf\ncategory Package\nrevision 45678\nshortdesc mpost to PDF, native MetaPost graphics inclusion\nlongdesc The mptopdf script does standalone conversion from mpost to\nlongdesc PDF, using the supp-* and syst-* files.  They also allow native\nlongdesc MetaPost graphics inclusion in LaTeX (via pdftex.def) and\nlongdesc ConTeXt.  They can be used independently of the rest of\nlongdesc ConTeXt, yet are maintained as part of it.  So in TeX Live we\nlongdesc pull them out to this separate package for the benefit of LaTeX\nlongdesc users who do not install the rest of ConTeXt.  This can be\nlongdesc found on CTAN in macros/pdftex/graphics.\ndepend plain\ndepend mptopdf.ARCH\nexecute AddFormat name=mptopdf engine=pdftex           options=\"-translate-file=cp227.tcx mptopdf.tex\"           fmttriggers=plain\ncontainersize 38420\ncontainerchecksum 8cc056d2beb65777bcb98e8914a41a1bf7c35c942e9af89410cd9af32530d2bd62b39466b27a429d5856441c6f74040a9d85c59d72e5fab9ee03b044e1f2d51f\ndoccontainersize 13572\ndoccontainerchecksum 67ad71ab2c84f87d1256b1fe3fc054083cff530f91136bc7e03ae9e3e05c177170397be07efa4fd3755b71d7716b75d182d99fc3e234318717b4160b1117b3e0\nrunfiles size=43\n texmf-dist/scripts/context/perl/mptopdf.pl\n texmf-dist/scripts/context/stubs/mswin/mptopdf.exe\n texmf-dist/tex/context/base/mkii/supp-mis.mkii\n texmf-dist/tex/context/base/mkii/supp-mpe.mkii\n texmf-dist/tex/context/base/mkii/supp-pdf.mkii\n texmf-dist/tex/context/base/mkii/syst-tex.mkii\n texmf-dist/tex/generic/context/mptopdf/mptopdf.tex\n\nname natbib\ncategory Package\nrevision 20668\nshortdesc Flexible bibliography support\nlongdesc The bundle provides a package that implements both author-year\nlongdesc and numbered references, as well as much detailed of support\nlongdesc for other bibliography use. Also Provided are versions of the\nlongdesc standard BibTeX styles that are compatible with\nlongdesc natbib--plainnat, unsrtnat, abbrnat. The bibliography styles\nlongdesc produced by custom-bib are designed from the start to be\nlongdesc compatible with natbib.\ncontainersize 16604\ncontainerchecksum f6963760f4b2b025c36a4dc89aefae1d4ea50f56a5da51b22a37004d585fca5d2184ab917373dda9770877fa0a06b83f62ada1564dceb141bd414f2d0abcf43a\ndoccontainersize 423612\ndoccontainerchecksum c98df2529a88f3277f9245ef8666dc415927053f172d3988480d32314e717dcb32516aaace87a9e6213824d4de14054f81f87b7117d9c91f1aaa7a2d9c74341d\nsrccontainersize 64128\nsrccontainerchecksum 484408436bc66654c81d5471048bc55987201ae84c9d453541a5d0ee4b6e00071d14712f3a8d89c0b9348e76e41140557ab0c70442d6840db00594c32ad3eb56\nrunfiles size=33\n texmf-dist/bibtex/bst/natbib/abbrvnat.bst\n texmf-dist/bibtex/bst/natbib/plainnat.bst\n texmf-dist/bibtex/bst/natbib/unsrtnat.bst\n texmf-dist/tex/latex/natbib/bibentry.sty\n texmf-dist/tex/latex/natbib/natbib.sty\ncatalogue-ctan /macros/latex/contrib/natbib\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics bibtex-supp\ncatalogue-version 8.31b\n\nname nodetree\ncategory Package\nrevision 43011\nshortdesc Visualize node lists in a tree view\nlongdesc nodetree is a development package that visualizes the structure\nlongdesc of node lists. nodetree shows its debug informations in the\nlongdesc console output when you compile a LuaTeX file. It uses a\nlongdesc similar visual representation for node lists as the UNIX tree\nlongdesc command for a folder structure.\ncontainersize 5368\ncontainerchecksum 5db2ec9d7e9abf425613fd305828c745d8f9947d12063a1209c15b82cc4bcdb3969c5a4e8ec39091bbc9b154e29971ae84eb3de971f883bcf32cee5fba3975ce\ndoccontainersize 371936\ndoccontainerchecksum 404470cb8bddf82ab245a6b31e12a0c9b7bd0d80e0c2f7b479b1f06ebd9f7be52adcb52660e8f68a13ffbcefddbdd280cec44e3163351d1b7d3be507fd339abd\nsrccontainersize 11112\nsrccontainerchecksum 8a8c54af6ff57d314ac31f9e3d7145d799dc977df681d2a293bbb018054cd1e165215e16e4296e100732e4462d944e4bc9a7222d5e56cc0664731e6169b40b21\nrunfiles size=7\n texmf-dist/tex/luatex/nodetree/nodetree.lua\n texmf-dist/tex/luatex/nodetree/nodetree.sty\n texmf-dist/tex/luatex/nodetree/nodetree.tex\ncatalogue-ctan /macros/luatex/generic/nodetree\ncatalogue-date 2018-01-07 12:06:50 +0100\ncatalogue-license lppl1.3\ncatalogue-topics lua-supp\ncatalogue-version 1.2\n\nname oberdiek\ncategory Package\nrevision 47293\nshortdesc A bundle of packages submitted by Heiko Oberdiek\nlongdesc The bundle comprises packages to provide: accsupp: better\nlongdesc accessibility support for PDF files; aliascnt: 'alias\nlongdesc counters'; alphalph: multiple-alphabetic counting\nlongdesc (a...z,aa...zz,... -- up to the full extent of a TeX counter);\nlongdesc askinclude: replaces \\includeonly by an interactive user\nlongdesc interface; atbegshi: a modern reimplementation of package\nlongdesc everyshi; atenddvi: provides \\AtEndDvi command; attachfile2:\nlongdesc attach files to PDF files; atveryend: hooks the very end of a\nlongdesc document; auxhook: stick stuff at the start of the .aux file;\nlongdesc bigintcalc: expandable arithmetic operations with big integers\nlongdesc that can exceed TeX's number limits; bitset: defines and\nlongdesc implements the data type bit set, a vector of bits; bmpsize:\nlongdesc get bitmap size and resolution data; bookmark: alternative\nlongdesc bookmark (outline) organization for package hyperref;\nlongdesc catchfile: collects the contents of a file and puts it in a\nlongdesc macro; centernot: a horizontally-centred \\not symbol; chemarr:\nlongdesc extensible chemists' reaction arrows; classlist: record\nlongdesc information about document class(es) used; colonequals: poor\nlongdesc man's mathematical relation symbols; dvipscol: dvips colour\nlongdesc stack management; embedfile: embed files in PDF documents;\nlongdesc engord: define counter-printing operations producing English\nlongdesc ordinals; eolgrab: collect arguments delimited by end of line;\nlongdesc epstopdf: conversion to epstopdf on the fly; etexcmds: adds a\nlongdesc prefix to eTeX's commands, to avoid conflicts with existing\nlongdesc macros; flags: setting and clearing flags in bit fields and\nlongdesc converting the bit field into a decimal number; gettitlestring:\nlongdesc clean up the string containing the title of a section, etc.;\nlongdesc grfext: macros for adding and reordering the list of graphics\nlongdesc file extensions recognised by the graphics package; grffile:\nlongdesc extend file name processing in the latex-graphics bundle;\nlongdesc hosub: build collections of packages; holtxdoc: extra\nlongdesc documentation macros; hologo: bookmark-enabled logos; hopatch:\nlongdesc safely apply package patches; hycolor: implements the color\nlongdesc option stuff that is used by packages hyperref and bookmark;\nlongdesc hypbmsec: bookmarks in sectioning commands; hypcap: anjusting\nlongdesc anchors of captions; hypdestopt: optimising hyperref's pdfTeX\nlongdesc driver destinations; hypdoc: hyper-references in the LaTeX\nlongdesc standard doc package; hypgotoe: experimental package for links\nlongdesc to embedded files; hyphsubst: substitute hyphenation patterns;\nlongdesc ifdraft: switch for option draft; iflang: provides expandable\nlongdesc checks for the current language; ifluatex: looks for LuaTeX\nlongdesc regardless of its mode and provides the switch \\ifluatex;\nlongdesc ifpdf: provides the \\ifpdf switch; ifvtex: provides the \\ifvtex\nlongdesc switch; infwarerr: provides a complete set of macros for\nlongdesc informations, warnings and error messages with support for\nlongdesc plain TeX; inputenx: enhanced handling of input encoding;\nlongdesc intcalc: provides expandable arithmetic operations with\nlongdesc integers; kvdefinekeys: define key-value keys in the same\nlongdesc manner as keyval; kvoptions: use package options in key value\nlongdesc format ; kvsetkeys: a variant of the \\setkeys command;\nlongdesc letltxmacro: Let assignment for LaTeX macros; listingsutf8:\nlongdesc (partially) extends the listings package to UTF-8 encoding;\nlongdesc ltxcmds: exports some utility macros from the LaTeX kernel into\nlongdesc a separate namespace and also provides them for other formats\nlongdesc such as plain-TeX; luacolor: implements colour support based on\nlongdesc LuaTeX's node attributes; luatex: utilises new and extended\nlongdesc features and resources that LuaTeX provides; magicnum: allows\nlongdesc to access magic numbers by a hierarchical name system;\nlongdesc makerobust: make a command robust; pagegrid: prints a page grid\nlongdesc in the background; pagesel: select pages of a document for\nlongdesc output; pdfcolfoot: using pdfTeX's color stack for footnotes;\nlongdesc pdfcol: macros for setting and maintaining new color stacks;\nlongdesc pdfcolmk: pdfTeX COLour MarK -- fake a pdfTeX colour stack\nlongdesc using marks (not needed for pdfTeX 1.40.0 and later);\nlongdesc pdfcolparallel: fixes colour problems in package parallel;\nlongdesc pdfcolparcolumns: fixes colour problems in package parcolumns;\nlongdesc pdfcrypt: setting PDF encryption; pdfescape: pdfTeX's escape\nlongdesc features using TeX or e-TeX; pdflscape: landscape pages in PDF;\nlongdesc pdfrender: control PDF rendering modes; pdftexcmds: provide\nlongdesc pdfTeX primitives missing in LuaTeX; picture: dimens for\nlongdesc picture macros; pmboxdraw: poor man's box drawing characters;\nlongdesc protecteddef: define a command that protected against\nlongdesc expansion; refcount: using the numeric values of references;\nlongdesc rerunfilecheck: checksum based rerun checks on auxiliary files;\nlongdesc resizegather: automatically resize overly large equations;\nlongdesc rotchiffre: performs simple rotation cyphers; scrindex:\nlongdesc redefines environment 'theindex' of package 'index', if a class\nlongdesc from KOMA-Script is loaded; selinput: select the input encoding\nlongdesc by specifying pairs of input characters and their glyph names;\nlongdesc setouterhbox: set \\hbox in outer horizontal mode; settobox:\nlongdesc getting box sizes; soulutf8: extends package soul and adds some\nlongdesc support for UTF-8; stackrel: extensions of the \\stackrel\nlongdesc command; stampinclude: selects the files for \\include by\nlongdesc inspecting the timestamp of the .aux file(s); stringenc:\nlongdesc provides \\StringEncodingConvert for converting a string between\nlongdesc different encodings; tabularht: tabulars with height\nlongdesc specification; tabularkv: key value interface for tabular\nlongdesc parameters; telprint: print German telephone numbers;\nlongdesc thepdfnumber: canonical numbers for use in PDF files and\nlongdesc elsewhere; transparent: using a color stack for transparency\nlongdesc with pdftex; twoopt: commands with two optional arguments;\nlongdesc uniquecounter: provides unlimited unique counter; zref: a\nlongdesc proposed new reference system. Each of the packages is\nlongdesc represented by two files, a .dtx (documented source) and a PDF\nlongdesc file; the .ins file necessary for installation is extracted by\nlongdesc running the .dtx file with Plain TeX.\ncontainersize 226464\ncontainerchecksum 750a6b5df16d34265fe21bdad99a3493074c81e4a0d055cbd3df6e95ea3bb80d4a40980697cc759f52d1bdee59f88d2a3db3afd907c8fdb3032ee4a25363f475\ndoccontainersize 14273268\ndoccontainerchecksum 28366d4dbccaf9d62bb1f1d8905101e2d81d37bebe1aa5484faf9081a1a32518ae6fe7058dd433ad189256bda96f01aaf7f9a9ee28c24c1cdb9707fdc3ba027c\nsrccontainersize 504020\nsrccontainerchecksum f34e5a0872dc5a3c93715ac7df080becba318bb48047b0b331753559f43e7d9e20b891a1d33f6d5d3a78772bb755d565b201b3e0b79ab883ffa413738adb4679\nrunfiles size=703\n texmf-dist/bibtex/bib/oberdiek/oberdiek-bundle.bib\n texmf-dist/bibtex/bib/oberdiek/oberdiek-source.bib\n texmf-dist/scripts/oberdiek/luacolor-pre065.lua\n texmf-dist/scripts/oberdiek/luacolor.lua\n texmf-dist/scripts/oberdiek/magicnum.lua\n texmf-dist/scripts/oberdiek/oberdiek.luacolor-pre065.lua\n texmf-dist/scripts/oberdiek/oberdiek.luacolor.lua\n texmf-dist/scripts/oberdiek/oberdiek.luatex.lua\n texmf-dist/scripts/oberdiek/oberdiek.magicnum.lua\n texmf-dist/scripts/oberdiek/oberdiek.pdftexcmds.lua\n texmf-dist/scripts/oberdiek/pdfatfi.pl\n texmf-dist/scripts/oberdiek/pdftexcmds.lua\n texmf-dist/tex/generic/oberdiek/alphalph.sty\n texmf-dist/tex/generic/oberdiek/atbegshi.sty\n texmf-dist/tex/generic/oberdiek/bigintcalc.sty\n texmf-dist/tex/generic/oberdiek/bitset.sty\n texmf-dist/tex/generic/oberdiek/catchfile.sty\n texmf-dist/tex/generic/oberdiek/embedfile.sty\n texmf-dist/tex/generic/oberdiek/engord.sty\n texmf-dist/tex/generic/oberdiek/eolgrab.sty\n texmf-dist/tex/generic/oberdiek/etexcmds.sty\n texmf-dist/tex/generic/oberdiek/fibnum.sty\n texmf-dist/tex/generic/oberdiek/gettitlestring.sty\n texmf-dist/tex/generic/oberdiek/hobsub-generic.sty\n texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty\n texmf-dist/tex/generic/oberdiek/hobsub.sty\n texmf-dist/tex/generic/oberdiek/hologo.sty\n texmf-dist/tex/generic/oberdiek/hyphsubst.sty\n texmf-dist/tex/generic/oberdiek/iflang.sty\n texmf-dist/tex/generic/oberdiek/ifpdf.sty\n texmf-dist/tex/generic/oberdiek/ifvtex.sty\n texmf-dist/tex/generic/oberdiek/infwarerr.sty\n texmf-dist/tex/generic/oberdiek/intcalc.sty\n texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty\n texmf-dist/tex/generic/oberdiek/kvsetkeys.sty\n texmf-dist/tex/generic/oberdiek/ltxcmds.sty\n texmf-dist/tex/generic/oberdiek/luatex-loader.sty\n texmf-dist/tex/generic/oberdiek/luatex.sty\n texmf-dist/tex/generic/oberdiek/magicnum.sty\n texmf-dist/tex/generic/oberdiek/mleftright.sty\n texmf-dist/tex/generic/oberdiek/pdfcol.sty\n texmf-dist/tex/generic/oberdiek/pdfcrypt.sty\n texmf-dist/tex/generic/oberdiek/pdfescape.sty\n texmf-dist/tex/generic/oberdiek/pdfrender.sty\n texmf-dist/tex/generic/oberdiek/pdftexcmds.sty\n texmf-dist/tex/generic/oberdiek/protecteddef.sty\n texmf-dist/tex/generic/oberdiek/rotchiffre.sty\n texmf-dist/tex/generic/oberdiek/se-ascii-print.def\n texmf-dist/tex/generic/oberdiek/se-ascii.def\n texmf-dist/tex/generic/oberdiek/se-clean7bit.def\n texmf-dist/tex/generic/oberdiek/se-cp1250.def\n texmf-dist/tex/generic/oberdiek/se-cp1251.def\n texmf-dist/tex/generic/oberdiek/se-cp1252.def\n texmf-dist/tex/generic/oberdiek/se-cp1257.def\n texmf-dist/tex/generic/oberdiek/se-cp437.def\n texmf-dist/tex/generic/oberdiek/se-cp850.def\n texmf-dist/tex/generic/oberdiek/se-cp852.def\n texmf-dist/tex/generic/oberdiek/se-cp855.def\n texmf-dist/tex/generic/oberdiek/se-cp858.def\n texmf-dist/tex/generic/oberdiek/se-cp865.def\n texmf-dist/tex/generic/oberdiek/se-cp866.def\n texmf-dist/tex/generic/oberdiek/se-dec-mcs.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-1.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-10.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-11.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-13.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-14.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-15.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-16.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-2.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-3.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-4.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-5.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-6.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-7.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-8.def\n texmf-dist/tex/generic/oberdiek/se-iso-8859-9.def\n texmf-dist/tex/generic/oberdiek/se-koi8-r.def\n texmf-dist/tex/generic/oberdiek/se-mac-centeuro.def\n texmf-dist/tex/generic/oberdiek/se-mac-cyrillic.def\n texmf-dist/tex/generic/oberdiek/se-mac-roman.def\n texmf-dist/tex/generic/oberdiek/se-nextstep.def\n texmf-dist/tex/generic/oberdiek/se-pdfdoc.def\n texmf-dist/tex/generic/oberdiek/se-utf16le.def\n texmf-dist/tex/generic/oberdiek/se-utf32be.def\n texmf-dist/tex/generic/oberdiek/se-utf32le.def\n texmf-dist/tex/generic/oberdiek/se-utf8.def\n texmf-dist/tex/generic/oberdiek/setouterhbox.sty\n texmf-dist/tex/generic/oberdiek/soulutf8.sty\n texmf-dist/tex/generic/oberdiek/stringenc.sty\n texmf-dist/tex/generic/oberdiek/telprint.sty\n texmf-dist/tex/generic/oberdiek/thepdfnumber.sty\n texmf-dist/tex/generic/oberdiek/uniquecounter.sty\n texmf-dist/tex/latex/oberdiek/accsupp-dvipdfm.def\n texmf-dist/tex/latex/oberdiek/accsupp-dvips.def\n texmf-dist/tex/latex/oberdiek/accsupp-luatex.def\n texmf-dist/tex/latex/oberdiek/accsupp-pdftex.def\n texmf-dist/tex/latex/oberdiek/accsupp.sty\n texmf-dist/tex/latex/oberdiek/aliascnt.sty\n texmf-dist/tex/latex/oberdiek/askinclude.sty\n texmf-dist/tex/latex/oberdiek/atenddvi.sty\n texmf-dist/tex/latex/oberdiek/atfi-dvipdfmx.def\n texmf-dist/tex/latex/oberdiek/atfi-dvips.def\n texmf-dist/tex/latex/oberdiek/atfi-pdftex.def\n texmf-dist/tex/latex/oberdiek/attachfile2.sty\n texmf-dist/tex/latex/oberdiek/atveryend.sty\n texmf-dist/tex/latex/oberdiek/auxhook.sty\n texmf-dist/tex/latex/oberdiek/bkm-dvipdfm.def\n texmf-dist/tex/latex/oberdiek/bkm-dvips.def\n texmf-dist/tex/latex/oberdiek/bkm-dvipsone.def\n texmf-dist/tex/latex/oberdiek/bkm-pdftex.def\n texmf-dist/tex/latex/oberdiek/bkm-textures.def\n texmf-dist/tex/latex/oberdiek/bkm-vtex.def\n texmf-dist/tex/latex/oberdiek/bmpsize-base.sty\n texmf-dist/tex/latex/oberdiek/bmpsize-dvipdfm.def\n texmf-dist/tex/latex/oberdiek/bmpsize-dvipdfmx.def\n texmf-dist/tex/latex/oberdiek/bmpsize-dvips.def\n texmf-dist/tex/latex/oberdiek/bmpsize-test.tex\n texmf-dist/tex/latex/oberdiek/bmpsize.sty\n texmf-dist/tex/latex/oberdiek/bookmark.sty\n texmf-dist/tex/latex/oberdiek/centernot.sty\n texmf-dist/tex/latex/oberdiek/chemarr.sty\n texmf-dist/tex/latex/oberdiek/classlist.sty\n texmf-dist/tex/latex/oberdiek/colonequals.sty\n texmf-dist/tex/latex/oberdiek/dtx-attach.sty\n texmf-dist/tex/latex/oberdiek/dvipscol.sty\n texmf-dist/tex/latex/oberdiek/enparen.sty\n texmf-dist/tex/latex/oberdiek/epstopdf-base.sty\n texmf-dist/tex/latex/oberdiek/epstopdf.sty\n texmf-dist/tex/latex/oberdiek/flags.sty\n texmf-dist/tex/latex/oberdiek/grfext.sty\n texmf-dist/tex/latex/oberdiek/grffile.sty\n texmf-dist/tex/latex/oberdiek/holtxdoc.sty\n texmf-dist/tex/latex/oberdiek/hopatch.sty\n texmf-dist/tex/latex/oberdiek/hycolor.sty\n texmf-dist/tex/latex/oberdiek/hypbmsec.sty\n texmf-dist/tex/latex/oberdiek/hypcap.sty\n texmf-dist/tex/latex/oberdiek/hypdestopt.sty\n texmf-dist/tex/latex/oberdiek/hypdoc.sty\n texmf-dist/tex/latex/oberdiek/hypgotoe.sty\n texmf-dist/tex/latex/oberdiek/ifdraft.sty\n texmf-dist/tex/latex/oberdiek/inputenx.sty\n texmf-dist/tex/latex/oberdiek/ix-alias.def\n texmf-dist/tex/latex/oberdiek/ix-math.def\n texmf-dist/tex/latex/oberdiek/ix-name.def\n texmf-dist/tex/latex/oberdiek/ix-slot.def\n texmf-dist/tex/latex/oberdiek/ix-uc.def\n texmf-dist/tex/latex/oberdiek/ix-utf8enc.dfu\n texmf-dist/tex/latex/oberdiek/kvoptions-patch.sty\n texmf-dist/tex/latex/oberdiek/kvoptions.sty\n texmf-dist/tex/latex/oberdiek/letltxmacro.sty\n texmf-dist/tex/latex/oberdiek/listingsutf8.sty\n texmf-dist/tex/latex/oberdiek/luacolor.sty\n texmf-dist/tex/latex/oberdiek/makerobust.sty\n texmf-dist/tex/latex/oberdiek/pagegrid.sty\n texmf-dist/tex/latex/oberdiek/pagesel.sty\n texmf-dist/tex/latex/oberdiek/pdfcolfoot.sty\n texmf-dist/tex/latex/oberdiek/pdfcolmk.sty\n texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty\n texmf-dist/tex/latex/oberdiek/pdfcolparcolumns.sty\n texmf-dist/tex/latex/oberdiek/pdflscape.sty\n texmf-dist/tex/latex/oberdiek/picture.sty\n texmf-dist/tex/latex/oberdiek/pmboxdraw.sty\n texmf-dist/tex/latex/oberdiek/pmboxdrawenc.dfu\n texmf-dist/tex/latex/oberdiek/refcount.sty\n texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty\n texmf-dist/tex/latex/oberdiek/resizegather.sty\n texmf-dist/tex/latex/oberdiek/scrindex.sty\n texmf-dist/tex/latex/oberdiek/selinput.sty\n texmf-dist/tex/latex/oberdiek/settobox.sty\n texmf-dist/tex/latex/oberdiek/stackrel.sty\n texmf-dist/tex/latex/oberdiek/stampinclude.sty\n texmf-dist/tex/latex/oberdiek/tabularht.sty\n texmf-dist/tex/latex/oberdiek/tabularkv.sty\n texmf-dist/tex/latex/oberdiek/transparent.sty\n texmf-dist/tex/latex/oberdiek/twoopt.sty\n texmf-dist/tex/latex/oberdiek/x-ascii.def\n texmf-dist/tex/latex/oberdiek/x-atarist.def\n texmf-dist/tex/latex/oberdiek/x-cp1250.def\n texmf-dist/tex/latex/oberdiek/x-cp1251.def\n texmf-dist/tex/latex/oberdiek/x-cp1252.def\n texmf-dist/tex/latex/oberdiek/x-cp1255.def\n texmf-dist/tex/latex/oberdiek/x-cp1257.def\n texmf-dist/tex/latex/oberdiek/x-cp437.def\n texmf-dist/tex/latex/oberdiek/x-cp850.def\n texmf-dist/tex/latex/oberdiek/x-cp852.def\n texmf-dist/tex/latex/oberdiek/x-cp855.def\n texmf-dist/tex/latex/oberdiek/x-cp858.def\n texmf-dist/tex/latex/oberdiek/x-cp865.def\n texmf-dist/tex/latex/oberdiek/x-cp866.def\n texmf-dist/tex/latex/oberdiek/x-dec-mcs.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-1.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-10.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-13.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-14.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-15.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-16.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-2.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-3.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-4.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-5.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-8.def\n texmf-dist/tex/latex/oberdiek/x-iso-8859-9.def\n texmf-dist/tex/latex/oberdiek/x-koi8-r.def\n texmf-dist/tex/latex/oberdiek/x-mac-centeuro.def\n texmf-dist/tex/latex/oberdiek/x-mac-cyrillic.def\n texmf-dist/tex/latex/oberdiek/x-mac-roman.def\n texmf-dist/tex/latex/oberdiek/x-nextstep.def\n texmf-dist/tex/latex/oberdiek/x-verbatim.def\n texmf-dist/tex/latex/oberdiek/xcolor-patch.sty\n texmf-dist/tex/latex/oberdiek/zref-abspage.sty\n texmf-dist/tex/latex/oberdiek/zref-abspos.sty\n texmf-dist/tex/latex/oberdiek/zref-base.sty\n texmf-dist/tex/latex/oberdiek/zref-counter.sty\n texmf-dist/tex/latex/oberdiek/zref-dotfill.sty\n texmf-dist/tex/latex/oberdiek/zref-env.sty\n texmf-dist/tex/latex/oberdiek/zref-hyperref.sty\n texmf-dist/tex/latex/oberdiek/zref-lastpage.sty\n texmf-dist/tex/latex/oberdiek/zref-marks.sty\n texmf-dist/tex/latex/oberdiek/zref-nextpage.sty\n texmf-dist/tex/latex/oberdiek/zref-pageattr.sty\n texmf-dist/tex/latex/oberdiek/zref-pagelayout.sty\n texmf-dist/tex/latex/oberdiek/zref-perpage.sty\n texmf-dist/tex/latex/oberdiek/zref-runs.sty\n texmf-dist/tex/latex/oberdiek/zref-savepos.sty\n texmf-dist/tex/latex/oberdiek/zref-thepage.sty\n texmf-dist/tex/latex/oberdiek/zref-titleref.sty\n texmf-dist/tex/latex/oberdiek/zref-totpages.sty\n texmf-dist/tex/latex/oberdiek/zref-user.sty\n texmf-dist/tex/latex/oberdiek/zref-xr.sty\n texmf-dist/tex/latex/oberdiek/zref.sty\ncatalogue-ctan /macros/latex/contrib/oberdiek\ncatalogue-date 2018-04-04 05:59:58 +0200\ncatalogue-license lppl1.3\ncatalogue-topics collection\n\nname odsfile\ncategory Package\nrevision 38449\nshortdesc Read OpenDocument Spreadsheet documents as LaTeX tables\nlongdesc The distribution includes a package and a lua library that can\nlongdesc together read OpenDocument spreadsheet documents as LaTeX\nlongdesc tables. Cells in the tables may be processed by LaTeX macros,\nlongdesc so that (for example) the package may be used for drawing some\nlongdesc plots. The package uses lua's zip library.\ncontainersize 4976\ncontainerchecksum e8f2e4ae565f5800dddf048f8cdee5d7c007b0b442758936ec37f62f0b531db8bdd00e502a5040cdbd56e6a3b928c5aaa7337422a6d7d54aec7ceaa5036a0f62\ndoccontainersize 272360\ndoccontainerchecksum f58037561f782430061fe5a440f06f74b0354ad0931bc32108bf43a26fa44324077fb84e8068f8623e611c1af8139737aa4ee42b779aefdb046ff88b5de6ec85\nrunfiles size=4\n texmf-dist/tex/lualatex/odsfile/odsfile.lua\n texmf-dist/tex/lualatex/odsfile/odsfile.sty\ncatalogue-ctan /macros/luatex/latex/odsfile\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics foreign-import table luatex\ncatalogue-version 0.6\n\nname pdftex\ncategory TLCore\nrevision 47199\nshortdesc A TeX extension for direct creation of PDF\nlongdesc An extension of TeX which can be configured to directly\nlongdesc generate PDF documents instead of DVI. All current free TeX\nlongdesc distributions including TeX Live, MacTeX and MiKTeX include\nlongdesc pdfTeX (Plain TeX) and pdfLaTeX (LaTeX). ConTeXt was originally\nlongdesc designed around use of pdfTeX, though nowadays it is focused on\nlongdesc LuaTeX).\ndepend kpathsea\ndepend cm\ndepend etex\ndepend hyphen-base\ndepend knuth-lib\ndepend plain\ndepend tex-ini-files\ndepend pdftex.ARCH\nexecute AddFormat name=pdftex engine=pdftex patterns=language.def           options=\"-translate-file=cp227.tcx *pdfetex.ini\"           fmttriggers=cm,etex,hyphen-base,knuth-lib,plain,tex-ini-files\nexecute AddFormat name=etex engine=pdftex patterns=language.def           options=\"-translate-file=cp227.tcx *etex.ini\"           fmttriggers=cm,etex,hyphen-base,knuth-lib,plain\nexecute AddFormat name=pdfetex engine=pdftex patterns=language.def           options=\"-translate-file=cp227.tcx *pdfetex.ini\"           fmttriggers=cm,etex,hyphen-base,knuth-lib,plain,tex-ini-files\nexecute addMap dummy-space.map\ncontainersize 36700\ncontainerchecksum b449d76cc5048241e67f5de19206a3a947a77d68126bc57f2c49b8374f04782555ebca6c93b4d7fea25c75cb6b2b7bbdbaad6b9dd2e3209f1d20659c251e6a0b\ndoccontainersize 1491928\ndoccontainerchecksum ef1ebb01323140f78d7d49089b3ca33538b13d2431b146607083baad039637db2392576ee1c09e3f28dface3deb77d03ed67818622798b6a9a8b7a60ed5641ba\nrunfiles size=65\n texmf-dist/fonts/map/dvips/dummy-space/dummy-space.map\n texmf-dist/fonts/tfm/public/pdftex/dummy-space.tfm\n texmf-dist/fonts/type1/public/pdftex/dummy-space.pfb\n texmf-dist/scripts/simpdftex/simpdftex\n texmf-dist/tex/generic/config/pdftex-dvi.tex\n texmf-dist/tex/generic/pdftex/glyphtounicode.tex\n texmf-dist/tex/generic/pdftex/pdfcolor.tex\ncatalogue-date 2017-11-29 01:13:44 +0100\ncatalogue-license gpl\ncatalogue-topics engine\n\nname placeat\ncategory Package\nrevision 45145\nshortdesc Absolute content positioning\nlongdesc The package provides commands so that the user of LuaLaTeX may\nlongdesc position arbitrary content at any position specified by\nlongdesc absolute coordinates on the page. The package draws a grid on\nlongdesc each page of the document, to aid positioning (the grid may be\nlongdesc disabled, for 'final copy' using the command \\placeatsetup).\ncontainersize 3972\ncontainerchecksum 5bc3ebafc77719bdc477a1848cfad1288820c592944fccca284d3cb1b671fcda59b229ab93447a3ec3c40e2e99b6b7ec612943c48917e5c3628cdbfef8647168\ndoccontainersize 95556\ndoccontainerchecksum c12a7202c55f4bca9c05ef7c74e315b6f71d270eddbd39cd9d50ff882e0a4a12001e81aa8fed37bfe4c4300d8f7a0525efe49e11beaff604db5ef6a6d949b05d\nsrccontainersize 11932\nsrccontainerchecksum 4990186a44675eb67dd27e6b1deeaa73e3e948071e550a236342ed709ebb3acb31409266fb3d1e85566e3f8b59fe3ba44cdd21fd23ea958e1f1836e89b0466b1\nrunfiles size=4\n texmf-dist/scripts/placeat/placeat.lua\n texmf-dist/tex/lualatex/placeat/placeat.sty\ncatalogue-also textpos\ncatalogue-ctan /macros/luatex/latex/placeat\ncatalogue-date 2017-08-26 23:16:20 +0200\ncatalogue-license lppl1.3\ncatalogue-topics layout luatex\ncatalogue-version 0.1d1\n\nname plain\ncategory Package\nrevision 43076\nshortdesc The Plain TeX format\nlongdesc Contains files used to build the Plain TeX format, as described\nlongdesc in the TeXbook, together with various supporting files (some\nlongdesc also discussed in the book).\ncontainersize 60724\ncontainerchecksum bb95609bc13886773500fa0338f277625ee72b81e71aa7def3e3ccd97b8b9aed58fe0949d3843fecc96b531a1ac42f33aecad8df8bfecf46dc7b24ae46b5444b\nrunfiles size=336\n texmf-dist/makeindex/plain/plaintex.ist\n texmf-dist/tex/plain/base/fontchart.tex\n texmf-dist/tex/plain/base/gkpmac.tex\n texmf-dist/tex/plain/base/letter.tex\n texmf-dist/tex/plain/base/list-latin.tex\n texmf-dist/tex/plain/base/list.tex\n texmf-dist/tex/plain/base/llist.tex\n texmf-dist/tex/plain/base/mptmac.tex\n texmf-dist/tex/plain/base/picmac.tex\n texmf-dist/tex/plain/base/plain.tex\n texmf-dist/tex/plain/base/wlist.tex\n texmf-dist/tex/plain/config/aleph.ini\n texmf-dist/tex/plain/config/bplain.ini\n texmf-dist/tex/plain/config/etex.ini\n texmf-dist/tex/plain/config/omega.ini\n texmf-dist/tex/plain/config/pdfbplain.ini\n texmf-dist/tex/plain/config/pdfetex.ini\n texmf-dist/tex/plain/config/pdftexmagfix.tex\n texmf-dist/tex/plain/config/tex.ini\n texmf-dist/tex/plain/config/unicode-letters.def\ncatalogue-ctan /macros/plain/base\ncatalogue-date 2016-11-06 05:33:39 +0100\ncatalogue-license knuth\ncatalogue-topics format\ncatalogue-version 3.141592653\n\nname plantuml\ncategory Package\nrevision 47089\nshortdesc Support for rendering UML diagrams using the syntax and tool of PlantUML\nlongdesc The package provides support for rendering UML diagrams using\nlongdesc the syntax and tools of PlantUML. The PlantUML syntax is very\nlongdesc short and thus enables quickly specifying UML diagrams. Using\nlongdesc dot, PlantUML layouts the diagrams.\ncontainersize 2092\ncontainerchecksum 47c64285d249ae26e592fe7f21004f01bb8cef2be1cad8f88fd80246dd58c572184677bea0a53f33303ad768956cb1e4c764e2e50511e2cc8aa3140eeba1059b\ndoccontainersize 65404\ndoccontainerchecksum cd80be78d82ae2aefe8d295bc9d1963e224234b94fe02472ac185a5459966a85c9313d06248a51560910a4a1925e91fc3f169426156d4d86a1dd3f2173090916\nrunfiles size=2\n texmf-dist/tex/lualatex/plantuml/plantuml.lua\n texmf-dist/tex/lualatex/plantuml/plantuml.sty\ncatalogue-ctan /macros/luatex/latex/plantuml\ncatalogue-date 2018-03-22 22:24:14 +0100\ncatalogue-license lppl1.3c\ncatalogue-topics uml luatex use-lua\ncatalogue-version 0.2.2\n\nname pslatex\ncategory Package\nrevision 16416\nshortdesc Use PostScript fonts by default\nlongdesc A small package that makes LaTeX default to 'standard'\nlongdesc PostScript fonts. It is basically a merger of the times and the\nlongdesc (obsolete) mathptm packages from the psnfss suite. You must\nlongdesc have installed standard LaTeX and the psnfss PostScript fonts\nlongdesc to use this package. The main novel feature is that the pslatex\nlongdesc package tries to compensate for the visual differences between\nlongdesc the Adobe fonts by scaling Helvetica by 90%, and 'condensing'\nlongdesc Courier (i.e. scaling horizontally) by 85%. The package is\nlongdesc supplied with a (unix) shell file for a 'pslatex' command that\nlongdesc allows standard LaTeX documents to be processed, without\nlongdesc needing to edit the file. Note that current psnfss uses a\nlongdesc different technique for scaling Helvetica, and treats Courier\nlongdesc as a lost cause (there are better free fixed-width available\nlongdesc now, than there were when pslatex was designed). As a result,\nlongdesc pslatex is widely considered obsolete.\ncontainersize 5752\ncontainerchecksum 173ba887f379e2a0966531812e47074caa36f80e8011ed79f8bdbdb5e8fdf2e63761a8d9ab26592213d18c7f97e86f489c25b0d0ec523851bab15999d95c5f3d\nsrccontainersize 1192\nsrccontainerchecksum b816114a455848329b7a96afeeb47a6b7cca9b5ca186bd96b2875a50b5db4503eb8ea0cf7f970480a37cfc020bc779ed9e294aba4ce716b42d53343134e42fc4\nrunfiles size=9\n texmf-dist/fonts/map/dvips/pslatex/pcrr8rn.map\n texmf-dist/fonts/tfm/public/pslatex/pcrr7tn.tfm\n texmf-dist/fonts/tfm/public/pslatex/pcrr8rn.tfm\n texmf-dist/fonts/tfm/public/pslatex/pcrr8tn.tfm\n texmf-dist/fonts/vf/public/pslatex/pcrr7tn.vf\n texmf-dist/fonts/vf/public/pslatex/pcrr8tn.vf\n texmf-dist/tex/latex/pslatex/pslatex.sty\ncatalogue-ctan /macros/latex/contrib/pslatex\ncatalogue-date 2018-01-06 12:14:59 +0100\ncatalogue-license lppl\ncatalogue-topics font-supp obsolete\n\nname psnfss\ncategory Package\nrevision 33946\nshortdesc Font support for common PostScript fonts\nlongdesc Font definition files, macros and font metrics for\nlongdesc freely-available Adobe Type 1 fonts. The font set consists of\nlongdesc the 'LaserWriter 35' set (originally 'freely available' because\nlongdesc embedded in PostScript printers), and a variety of other free\nlongdesc fonts, together with some additions. Note that while many of\nlongdesc the fonts are available in PostScript (and other) printers,\nlongdesc most publishers require fonts embedded in documents, which\nlongdesc requires that you have the fonts in your TeX system.\nlongdesc Fortunately, there are free versions of the fonts from URW\nlongdesc (available in the URW base5 bundle). The base set of text fonts\nlongdesc covered by PSNFSS are: AvantGarde, Bookman, Courier, Helvetica,\nlongdesc New Century Schoolbook, Palatino, Symbol, Times Roman and Zapf\nlongdesc Dingbats. In addition, the fonts Bitstream Charter and Adobe\nlongdesc Utopia are covered (those fonts were contributed to the Public\nlongdesc Domain by their commercial foundries). Separate packages are\nlongdesc provided to load each font for use as main text font. The\nlongdesc packages helvet (which allows Helvetica to be loaded with its\nlongdesc size scaled to something more nearly appropriate for its use as\nlongdesc a Sans-Serif font to match Times) and pifont (which provides\nlongdesc the means to select single glyphs from symbol fonts) are\nlongdesc tailored to special requirements of their fonts. Mathematics\nlongdesc are covered by the mathptmx package, which constructs passable\nlongdesc mathematics from a combination of Times Roman, Symbol and some\nlongdesc glyphs from Computer Modern, and by Pazo Math (optionally\nlongdesc extended with the fpl small-caps and old-style figures fonts)\nlongdesc which uses Palatino as base font, with the mathpazo fonts. The\nlongdesc bundle as a whole is part of the LaTeX 'required' set of\nlongdesc packages.\ndepend graphics\nexecute addMap charter.map\nexecute addMap fpls.map\nexecute addMap pazo.map\nexecute addMap utopia.map\ncontainersize 11944\ncontainerchecksum 2551573cb39bcf09c394d25e63cdd4ca89958c9109117e16d8c354631d0309f177f5a52d8cebf5bc22d022441212825f70a849b60337e4290fa440526667d503\ndoccontainersize 484764\ndoccontainerchecksum d7e3606176ab1f18a388b3e58a4ef56076caa243391175f2337f18deb2e6cfc2b90bad8ca085802468bcaa2fed624bf70cc1e30aa13d7df11c453f8c6261bcc4\nsrccontainersize 16472\nsrccontainerchecksum b44bc333700d91673e69830be9d3ae07f6d27ff2cb61464d94982029ab755553bb2065a26dac3c344aacc1ab8caaf420b9b8eb157ad96354a844bce734a2c351\nrunfiles size=110\n texmf-dist/fonts/map/dvips/psnfss/charter.map\n texmf-dist/fonts/map/dvips/psnfss/fpls.map\n texmf-dist/fonts/map/dvips/psnfss/pazo.map\n texmf-dist/fonts/map/dvips/psnfss/psnfss.map\n texmf-dist/fonts/map/dvips/psnfss/utopia.map\n texmf-dist/tex/latex/psnfss/8rbch.fd\n texmf-dist/tex/latex/psnfss/8rpag.fd\n texmf-dist/tex/latex/psnfss/8rpbk.fd\n texmf-dist/tex/latex/psnfss/8rpcr.fd\n texmf-dist/tex/latex/psnfss/8rphv.fd\n texmf-dist/tex/latex/psnfss/8rpnc.fd\n texmf-dist/tex/latex/psnfss/8rppl.fd\n texmf-dist/tex/latex/psnfss/8rptm.fd\n texmf-dist/tex/latex/psnfss/8rput.fd\n texmf-dist/tex/latex/psnfss/8rpzc.fd\n texmf-dist/tex/latex/psnfss/avant.sty\n texmf-dist/tex/latex/psnfss/bookman.sty\n texmf-dist/tex/latex/psnfss/chancery.sty\n texmf-dist/tex/latex/psnfss/charter.sty\n texmf-dist/tex/latex/psnfss/courier.sty\n texmf-dist/tex/latex/psnfss/helvet.sty\n texmf-dist/tex/latex/psnfss/mathpazo.sty\n texmf-dist/tex/latex/psnfss/mathpple.sty\n texmf-dist/tex/latex/psnfss/mathptm.sty\n texmf-dist/tex/latex/psnfss/mathptmx.sty\n texmf-dist/tex/latex/psnfss/newcent.sty\n texmf-dist/tex/latex/psnfss/omlbch.fd\n texmf-dist/tex/latex/psnfss/omlpag.fd\n texmf-dist/tex/latex/psnfss/omlpbk.fd\n texmf-dist/tex/latex/psnfss/omlpcr.fd\n texmf-dist/tex/latex/psnfss/omlphv.fd\n texmf-dist/tex/latex/psnfss/omlpnc.fd\n texmf-dist/tex/latex/psnfss/omlppl.fd\n texmf-dist/tex/latex/psnfss/omlptm.fd\n texmf-dist/tex/latex/psnfss/omlptmcm.fd\n texmf-dist/tex/latex/psnfss/omlput.fd\n texmf-dist/tex/latex/psnfss/omlpzc.fd\n texmf-dist/tex/latex/psnfss/omlzplm.fd\n texmf-dist/tex/latex/psnfss/omlzpple.fd\n texmf-dist/tex/latex/psnfss/omlztmcm.fd\n texmf-dist/tex/latex/psnfss/omsbch.fd\n texmf-dist/tex/latex/psnfss/omspag.fd\n texmf-dist/tex/latex/psnfss/omspbk.fd\n texmf-dist/tex/latex/psnfss/omspcr.fd\n texmf-dist/tex/latex/psnfss/omsphv.fd\n texmf-dist/tex/latex/psnfss/omspnc.fd\n texmf-dist/tex/latex/psnfss/omsppl.fd\n texmf-dist/tex/latex/psnfss/omsptm.fd\n texmf-dist/tex/latex/psnfss/omsput.fd\n texmf-dist/tex/latex/psnfss/omspzc.fd\n texmf-dist/tex/latex/psnfss/omspzccm.fd\n texmf-dist/tex/latex/psnfss/omszplm.fd\n texmf-dist/tex/latex/psnfss/omszpple.fd\n texmf-dist/tex/latex/psnfss/omsztmcm.fd\n texmf-dist/tex/latex/psnfss/omxpsycm.fd\n texmf-dist/tex/latex/psnfss/omxzplm.fd\n texmf-dist/tex/latex/psnfss/omxzpple.fd\n texmf-dist/tex/latex/psnfss/omxztmcm.fd\n texmf-dist/tex/latex/psnfss/ot1bch.fd\n texmf-dist/tex/latex/psnfss/ot1pag.fd\n texmf-dist/tex/latex/psnfss/ot1pbk.fd\n texmf-dist/tex/latex/psnfss/ot1pcr.fd\n texmf-dist/tex/latex/psnfss/ot1phv.fd\n texmf-dist/tex/latex/psnfss/ot1pnc.fd\n texmf-dist/tex/latex/psnfss/ot1ppl.fd\n texmf-dist/tex/latex/psnfss/ot1pplj.fd\n texmf-dist/tex/latex/psnfss/ot1pplx.fd\n texmf-dist/tex/latex/psnfss/ot1ptm.fd\n texmf-dist/tex/latex/psnfss/ot1ptmcm.fd\n texmf-dist/tex/latex/psnfss/ot1put.fd\n texmf-dist/tex/latex/psnfss/ot1pzc.fd\n texmf-dist/tex/latex/psnfss/ot1zplm.fd\n texmf-dist/tex/latex/psnfss/ot1zpple.fd\n texmf-dist/tex/latex/psnfss/ot1ztmcm.fd\n texmf-dist/tex/latex/psnfss/palatino.sty\n texmf-dist/tex/latex/psnfss/pifont.sty\n texmf-dist/tex/latex/psnfss/t1bch.fd\n texmf-dist/tex/latex/psnfss/t1pag.fd\n texmf-dist/tex/latex/psnfss/t1pbk.fd\n texmf-dist/tex/latex/psnfss/t1pcr.fd\n texmf-dist/tex/latex/psnfss/t1phv.fd\n texmf-dist/tex/latex/psnfss/t1pnc.fd\n texmf-dist/tex/latex/psnfss/t1ppl.fd\n texmf-dist/tex/latex/psnfss/t1pplj.fd\n texmf-dist/tex/latex/psnfss/t1pplx.fd\n texmf-dist/tex/latex/psnfss/t1ptm.fd\n texmf-dist/tex/latex/psnfss/t1put.fd\n texmf-dist/tex/latex/psnfss/t1pzc.fd\n texmf-dist/tex/latex/psnfss/times.sty\n texmf-dist/tex/latex/psnfss/ts1bch.fd\n texmf-dist/tex/latex/psnfss/ts1pag.fd\n texmf-dist/tex/latex/psnfss/ts1pbk.fd\n texmf-dist/tex/latex/psnfss/ts1pcr.fd\n texmf-dist/tex/latex/psnfss/ts1phv.fd\n texmf-dist/tex/latex/psnfss/ts1pnc.fd\n texmf-dist/tex/latex/psnfss/ts1ppl.fd\n texmf-dist/tex/latex/psnfss/ts1pplj.fd\n texmf-dist/tex/latex/psnfss/ts1pplx.fd\n texmf-dist/tex/latex/psnfss/ts1ptm.fd\n texmf-dist/tex/latex/psnfss/ts1put.fd\n texmf-dist/tex/latex/psnfss/ts1pzc.fd\n texmf-dist/tex/latex/psnfss/ufplm.fd\n texmf-dist/tex/latex/psnfss/ufplmbb.fd\n texmf-dist/tex/latex/psnfss/upsy.fd\n texmf-dist/tex/latex/psnfss/upzd.fd\n texmf-dist/tex/latex/psnfss/utopia.sty\ncatalogue-also psnfssx\ncatalogue-ctan /macros/latex/required/psnfss\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics font-supp font-use\ncatalogue-version 9.2a\n\nname pspicture\ncategory Package\nrevision 15878\nshortdesc PostScript picture support\nlongdesc A replacement for LaTeX's picture macros, that uses PostScript\nlongdesc \\special commands. The package is now largely superseded by\nlongdesc pict2e.\ncontainersize 1800\ncontainerchecksum 2f13b2ce8eab934634dbe3f4414127e6fb8e651262eec011dd6e5679e402912816b9b9dd47baf82b9fcbb96afb35d2de6e59809d0f84a44b7a1d179bcc0fbdbe\ndoccontainersize 42620\ndoccontainerchecksum 56fe13db8d57f87f7168fd06c7dad3039bf8e368076a03fa5a5f494174110325532d7169e25792f87c039597c84fd8dc06f056af9e499d21145869526e1331ac\nsrccontainersize 6032\nsrccontainerchecksum 4edbf3ed5df16af062fe8456a2923d4c11d1d6bb928418eb5be096ea6f9b10d446351269c1cdad5a5f72955b0d14f23ea2256d05e124500db9a61e5f35ab2811\nrunfiles size=2\n texmf-dist/dvips/pspicture/pspicture.ps\n texmf-dist/tex/latex/pspicture/pspicture.sty\ncatalogue-ctan /macros/latex/contrib/pspicture\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics graphics-in-tex obsolete\n\nname scheme-basic\ncategory Scheme\nrevision 25923\nshortdesc basic scheme (plain and latex)\nrelocated 1\nlongdesc This is the basic TeX Live scheme: it is a small set of files\nlongdesc sufficient to typeset plain TeX or LaTeX documents in\nlongdesc PostScript or PDF, using the Computer Modern fonts.  This\nlongdesc scheme corresponds to collection-basic and collection-latex.\ndepend collection-basic\ndepend collection-latex\ncontainersize 440\ncontainerchecksum 2250810241ac6f92713342a7b4dd3cf1deade2ad6ef65552eb9b987f340d952589fb941270c881eb07c2e97a861db47f57e16777ebf81142155f3dfd4dd6d5be\n\nname scheme-infraonly\ncategory Scheme\nrevision 41515\nshortdesc infrastructure-only scheme (no TeX at all)\nrelocated 1\nlongdesc This is the TeX Live scheme for infrastructure only, with no\nlongdesc TeX engines at all.  It is useful for automated testing, where\nlongdesc the actual programs and packages to be tested are installed\nlongdesc separately afterwards, with tlmgr install.\ndepend texlive.infra\ndepend kpathsea\ndepend hyphen-base\ndepend tetex\ncontainersize 460\ncontainerchecksum 3aa8d9b098cb6a84e6c864589387a19032c6badd2eb1fa1920ab3477d2d5ac8179e1cc38cda032bb183dc3a284c7afd23d825e337e375c54777de32437439cba\n\nname scheme-minimal\ncategory Scheme\nrevision 13822\nshortdesc minimal scheme (plain only)\nrelocated 1\nlongdesc This is the minimal TeX Live scheme, with support for only\nlongdesc plain TeX. (No LaTeX macros.)  LuaTeX is included because Lua\nlongdesc scripts are used in TeX Live infrastructure.  This scheme\nlongdesc corresponds exactly to collection-basic.\ndepend collection-basic\ncontainersize 428\ncontainerchecksum a63f63a14bf5b3e12dfb49ece263f8fd797b71d0c88dca2df00cb988bf32cc662978d0abfd669cc616a3216ec021b38d62de39902d853de27087219faa5aa66b\n\nname selnolig\ncategory Package\nrevision 38721\nshortdesc Selectively disable typographic ligatures\nlongdesc The package suppresses typographic ligatures selectively, i.e.,\nlongdesc based on predefined search patterns. The search patterns focus\nlongdesc on ligatures deemed inappropriate because they span morpheme\nlongdesc boundaries. For example, the word shelfful, which is mentioned\nlongdesc in the TeXbook as a word for which the ff ligature might be\nlongdesc inappropriate, is automatically typeset as shelf\\/ful rather\nlongdesc than as shel{ff}ul. For English and German language documents,\nlongdesc the package provides extensive rules for the selective\nlongdesc suppression of so-called \"common\" ligatures. These comprise the\nlongdesc ff, fi, fl, ffi, and ffl ligatures as well as the ft and fft\nlongdesc ligatures. Other f-ligatures, such as fb, fh, fj and fk, are\nlongdesc suppressed globally, while exceptions are made for names and\nlongdesc words of non-English/German origin, such as Kafka and fjord.\nlongdesc For English language documents, the package further provides\nlongdesc ligature suppression macros for a number of so-called\nlongdesc \"discretionary\" or \"rare\" ligatures such as ct, st, and sp. The\nlongdesc package requires use of a recent LuaLaTeX format (for example\nlongdesc those from TeX Live 2012 or 2013, or MiKTeX 2.9).\ncontainersize 53992\ncontainerchecksum c267f6c6b3095566d444c99adebfb4da58a39fe5870ebf63f5f717ea71f3285e363ae995cb474023764c19bf7fb02b676ffffe956a5e3151b9f7314ff335f159\ndoccontainersize 509884\ndoccontainerchecksum 0a91e2b1b91b33a6a363c7633ad8371ddeab0f16bdabfd895105d7a08a67a7cd8d3b6fd01fd3e2a053d5ca2051160b14d5fedbb0864fee7e532833d9ae5cd040\nrunfiles size=59\n texmf-dist/tex/lualatex/selnolig/selnolig-english-hyphex.sty\n texmf-dist/tex/lualatex/selnolig/selnolig-english-patterns.sty\n texmf-dist/tex/lualatex/selnolig/selnolig-german-hyphex.sty\n texmf-dist/tex/lualatex/selnolig/selnolig-german-patterns.sty\n texmf-dist/tex/lualatex/selnolig/selnolig.lua\n texmf-dist/tex/lualatex/selnolig/selnolig.sty\ncatalogue-ctan /macros/luatex/latex/selnolig\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics typesetting luatex\ncatalogue-version 0.302\n\nname spelling\ncategory Package\nrevision 30715\nshortdesc Support for spell-checking of LuaTeX documents\nlongdesc The package aids spell-checking of TeX documents compiled with\nlongdesc the LuaTeX engine. It can give visual feedback in PDF output\nlongdesc similar to WYSIWYG word processors. The package relies on an\nlongdesc external spell-checker application to check spelling of a text\nlongdesc file and to output a list of bad spellings. The package should\nlongdesc work with most spell-checkers, even dumb, TeX-unaware ones.\ncontainersize 14064\ncontainerchecksum 7b1329685e8b9f6af5ff42d364d538fc73fa86cc3999dd78ab14779a9b7ab799dcbd648ac6c9be37b58209738f6bc511afc9dc2638d4cd837bd70d5d6bb159b6\ndoccontainersize 142556\ndoccontainerchecksum 9154c23cfe92fe0c084feae557e552c9bb4ac0e25bb6f3988ebaf63f99a9ef8a976d96a9fbd7e1332de9e5df4d9274e560bff801070a3bac2c827509f393ae2c\nrunfiles size=19\n texmf-dist/scripts/spelling/spelling-main.lua\n texmf-dist/scripts/spelling/spelling-recurse.lua\n texmf-dist/scripts/spelling/spelling-stage-1.lua\n texmf-dist/scripts/spelling/spelling-stage-2.lua\n texmf-dist/scripts/spelling/spelling-stage-3.lua\n texmf-dist/scripts/spelling/spelling-stage-4.lua\n texmf-dist/tex/luatex/spelling/spelling.sty\ncatalogue-ctan /macros/luatex/generic/spelling\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl1.3\ncatalogue-topics luatex spell\ncatalogue-version 0.41\n\nname tetex\ncategory TLCore\nrevision 47198\nshortdesc scripts and files originally from teTeX\nlongdesc Includes both core utilities such as fmtutil and updmap, and\nlongdesc rarely-used programs such as allec and dvi2fax. Some\nlongdesc functionality is now better provided by tlmgr, such as\nlongdesc texconfig and texlinks, but everything here is still supported.\ndepend tetex.ARCH\nexecute addMap mathpple.map\ncontainersize 71040\ncontainerchecksum 080523d1b65393d5b24df3494c4b246a1f56fc6eee9df662e898c229ef2874ed8e9a994935b51f6becc9d1c70af013513764762aaa7a32bd14c55d56e9eb1729\ndoccontainersize 525292\ndoccontainerchecksum db698b29cbb1e503f4e49a853c105cf9c39574446ec5eee4cd79d67e8591c59c7322421cd7aa90f514091a0b372083048f18a24a7f26129cbebd6d462ca1e431\nrunfiles size=126\n texmf-dist/dvips/tetex/config.builtin35\n texmf-dist/dvips/tetex/config.dfaxhigh\n texmf-dist/dvips/tetex/config.dfaxlo\n texmf-dist/dvips/tetex/config.download35\n texmf-dist/dvips/tetex/config.gsftopk\n texmf-dist/dvips/tetex/config.maxmem\n texmf-dist/dvips/tetex/config.outline\n texmf-dist/dvips/tetex/config.pdf\n texmf-dist/dvips/tetex/config.pk\n texmf-dist/dvips/tetex/config.www\n texmf-dist/fonts/enc/dvips/tetex/09fbbfac.enc\n texmf-dist/fonts/enc/dvips/tetex/0ef0afca.enc\n texmf-dist/fonts/enc/dvips/tetex/10037936.enc\n texmf-dist/fonts/enc/dvips/tetex/1b6d048e.enc\n texmf-dist/fonts/enc/dvips/tetex/71414f53.enc\n texmf-dist/fonts/enc/dvips/tetex/74afc74c.enc\n texmf-dist/fonts/enc/dvips/tetex/aae443f0.enc\n texmf-dist/fonts/enc/dvips/tetex/b6a4d7c7.enc\n texmf-dist/fonts/enc/dvips/tetex/bbad153f.enc\n texmf-dist/fonts/enc/dvips/tetex/d9b29452.enc\n texmf-dist/fonts/enc/dvips/tetex/f7b6d320.enc\n texmf-dist/fonts/enc/dvips/tetex/mtex.enc\n texmf-dist/fonts/map/dvips/tetex/Makefile\n texmf-dist/fonts/map/dvips/tetex/README\n texmf-dist/fonts/map/dvips/tetex/base14flags.ltx\n texmf-dist/fonts/map/dvips/tetex/base14flags.tex\n texmf-dist/fonts/map/dvips/tetex/dvipdfm35.map\n texmf-dist/fonts/map/dvips/tetex/dvips35.map\n texmf-dist/fonts/map/dvips/tetex/mathpple.map\n texmf-dist/fonts/map/dvips/tetex/pdftex35.map\n texmf-dist/fonts/map/dvips/tetex/ps2pk35.map\n texmf-dist/scripts/texlive/allcm.sh\n texmf-dist/scripts/texlive/allneeded.sh\n texmf-dist/scripts/texlive/dvi2fax.sh\n texmf-dist/scripts/texlive/dvired.sh\n texmf-dist/scripts/texlive/fmtutil-sys.sh\n texmf-dist/scripts/texlive/fmtutil-user.sh\n texmf-dist/scripts/texlive/fmtutil.pl\n texmf-dist/scripts/texlive/kpsetool.sh\n texmf-dist/scripts/texlive/kpsewhere.sh\n texmf-dist/scripts/texlive/mktexlsr.pl\n texmf-dist/scripts/texlive/texconfig-dialog.sh\n texmf-dist/scripts/texlive/texconfig-sys.sh\n texmf-dist/scripts/texlive/texconfig.sh\n texmf-dist/scripts/texlive/texlinks.sh\n texmf-dist/scripts/texlive/updmap-sys.sh\n texmf-dist/scripts/texlive/updmap-user.sh\n texmf-dist/scripts/texlive/updmap.pl\n texmf-dist/texconfig/README\n texmf-dist/texconfig/g/generic\n texmf-dist/texconfig/tcfmgr\n texmf-dist/texconfig/tcfmgr.map\n texmf-dist/texconfig/v/vt100\n texmf-dist/texconfig/x/xterm\n texmf-dist/web2c/updmap.cfg\ncatalogue-ctan /obsolete/systems/unix/teTeX\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license other-free\ncatalogue-topics distribution obsolete\ncatalogue-version 3.0\n\nname tex\ncategory TLCore\nrevision 47198\nshortdesc A sophisticated typesetting engine\nlongdesc TeX is a typesetting system that incorporates a macro\nlongdesc processor. A TeX source document specifies or incorporates a\nlongdesc number of macro definitions that instruct the TeX engine how to\nlongdesc typeset the document. The TeX engine also uses font metrics\nlongdesc generated by Metafont, or by any of several other mechanisms\nlongdesc that incorporate fonts from other sources into an environment\nlongdesc suitable for TeX. TeX has been, and continues, a basis and an\nlongdesc inspiration for several other programs, including e-TeX and\nlongdesc PDFTeX. The distribution includes the source of Knuth's TeX\nlongdesc book; this source is there to read, as an example of writing\nlongdesc TeX -- it should not be processed without Knuth's direct\nlongdesc permission.\ndepend kpathsea\ndepend plain\ndepend cm\ndepend hyphen-base\ndepend knuth-lib\ndepend tex.ARCH\nexecute AddFormat name=tex engine=tex options=\"tex.ini\"   fmttriggers=cm,hyphen-base,knuth-lib,plain\ncontainersize 840\ncontainerchecksum e93cb703b1dd10686dff459b507e15d178f42ef039593d072513b5fbb05bd5df94f2cfb0a0f2f489b84877048d8abe12ef7918c0b4cad7993cb5d67825cf1017\ndoccontainersize 43436\ndoccontainerchecksum 0d3426c18101a8f54725ad9b86602f6570035bcd985b2a3ac1b43bccff3f41c4f59a5504ee9e00bda89cbfcf5caf67ae093cd6577e851ee8026f6070ec28f45b\ncatalogue-ctan /systems/knuth/dist/tex\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license knuth\ncatalogue-topics engine\ncatalogue-version 3.14159265\n\nname tex-ini-files\ncategory Package\nrevision 40533\nshortdesc Model TeX format creation files\nlongdesc This bundle provides a collection of model .ini files for\nlongdesc creating TeX formats. These files are commonly used to\nlongdesc introduced distribution-dependent variations in formats. They\nlongdesc are also used to allow existing format source files to be used\nlongdesc with newer engines, for example to adapt the plain e-TeX source\nlongdesc file to work with XeTeX and LuaTeX.\ncontainersize 3268\ncontainerchecksum e14801a4b274049097ddccc7f25b24e31d11b4d17c894027ff5fd9b680b2d8b8c153ab4c617e59ac581a3e2836da72b63b6ef14d7a0452fd25bcc5718b1c98cc\ndoccontainersize 1336\ndoccontainerchecksum 2cf0815a1db1b2d531b0cb897929ea8ea75dc443430719657152beb2ddebc1916bc4045ee1cbe268773c766d0c0d8f1ed4f9bbadc14e8254178a7a76cd0e7525\nrunfiles size=8\n texmf-dist/tex/generic/tex-ini-files/dvilualatex.ini\n texmf-dist/tex/generic/tex-ini-files/dviluatex.ini\n texmf-dist/tex/generic/tex-ini-files/lualatex.ini\n texmf-dist/tex/generic/tex-ini-files/luatex.ini\n texmf-dist/tex/generic/tex-ini-files/luatexconfig.tex\n texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex\n texmf-dist/tex/generic/tex-ini-files/xelatex.ini\n texmf-dist/tex/generic/tex-ini-files/xetex.ini\ncatalogue-ctan /macros/generic/tex-ini-files\ncatalogue-date 2016-11-05 08:51:03 +0100\ncatalogue-license pd\ncatalogue-topics latex3\n\nname texlive-common\ncategory TLCore\nrevision 47105\nshortdesc TeX Live documentation (common elements)\npostaction shortcut type=menu name=\"TeX Live documentation\" \tcmd=TEXDIR/texmf-dist/doc/texlive/index.html\ncontainersize 348\ncontainerchecksum 55daf13056d3f75047fecea3ad0cba05bbfa342d54d8914ca6df7494e14e297d9380c22d6aafbbe76d86a79edd4b20aef55ff38fd2f4c6d64a6277bf90729825\ndoccontainersize 229548\ndoccontainerchecksum fa44cd5aba2db8502f41b2ac1c061bc235a9edc14aed22a3d789c5e6c78bf736069d67dd6eda4dddabeefa78010c844c197bfdfa3e76e18b874ec1c63712cd5b\n\nname texlive-docindex\ncategory TLCore\nrevision 47479\nshortdesc top-level TeX Live doc.html, etc.\nlongdesc These files are regenerated as needed, which is often, so we\nlongdesc make them a separate package.  See the tl-update-auto script\nlongdesc for the process.\ncontainersize 109804\ncontainerchecksum 05f3563b8b56825b6565c5f135f8a4d9d9c2de6c3688b16c4089bb125600e058eb9aadcf0f75d0507dbba52f22cdd9c87c8eefde60dc09df8c3fc1104a9ba9cd\ndoccontainersize 130312\ndoccontainerchecksum 428e4526eaa211987796d10c10851c3cbeafe8c93ea99e0f43431bff7c44bf6accc0f3a0d7cb2e0ef9629ddd4727fe1857501e9ee2c0d3fd31ac2219b2ad3c75\nrunfiles size=270\n texmf-dist/scripts/texlive/var/texcatalogue.keywords\n\nname texlive-en\ncategory TLCore\nrevision 47434\nshortdesc TeX Live manual (English)\ncontainersize 276\ncontainerchecksum b67e7110d2e49f8cec0e1d05b208166854d7a0d61575a1b23ff880360be62c96b03a524e5521cbbd148bf79da59c6e82f84ee395e99ec9687e9eef669724ec9f\ndoccontainersize 1595640\ndoccontainerchecksum 4bdb2bb5f14fb8a1a752dadb8e85465a1ea8fe4871f05d4b10d77fa7a0af24bdcea0d199b8fdead629c2e0fc5724f81187bc46d0ef9c63ad9b30652425fb9fca\n\nname texlive-msg-translations\ncategory TLCore\nrevision 47433\nshortdesc translations of the TeX Live installer and TeX Live Manager\nlongdesc This package contains the translated messages of the TeX Live\nlongdesc installer and TeX Live Manager.  For information on creating or\nlongdesc updating translations, see\nlongdesc http://tug.org/texlive/doc.html#install-tl-xlate.\ncontainersize 111700\ncontainerchecksum 8b8aa861c22d853a38d2aca9c1a350b2e109508cf750f6511f8ee29a4be7142bf3f10c6c5da707e2e4fea2cbf8645b6503efae634889ff644d3d76410e2dd05a\nrunfiles size=287\n tlpkg/translations/README\n tlpkg/translations/cs.po\n tlpkg/translations/de.po\n tlpkg/translations/es.po\n tlpkg/translations/fr.po\n tlpkg/translations/it.po\n tlpkg/translations/ja.po\n tlpkg/translations/messages.pot\n tlpkg/translations/nl.po\n tlpkg/translations/pl.po\n tlpkg/translations/pt_BR.po\n tlpkg/translations/ru.po\n tlpkg/translations/sk.po\n tlpkg/translations/sl.po\n tlpkg/translations/sr.po\n tlpkg/translations/translators\n tlpkg/translations/uk.po\n tlpkg/translations/vi.po\n tlpkg/translations/zh_CN.po\n tlpkg/translations/zh_TW.po\n\nname texlive-scripts\ncategory TLCore\nrevision 47481\nshortdesc TeX Live infrastructure programs\nlongdesc Includes install-tl, tl-portable, rungs, etc.; not needed for\nlongdesc tlmgr to run but still ours.  Not included in tlcritical.\ndepend texlive.infra\ndepend texlive-scripts.ARCH\npostaction shortcut type=menu name=\"TeX Live command-line\"   cmd=TEXDIR/tlpkg/installer/tl-cmd.bat\ncontainersize 67112\ncontainerchecksum e4c4f73640a7e00516e502c3b605a3f19a51f7fe22f8b5f64e2e259d46faa3f1ecf6ee0050f6e7a98ce869e087baf74e5d0389c4f3cf8c3b47a74db68b33f1f5\ndoccontainersize 51096\ndoccontainerchecksum 79590ecfa314da2aaaa64268821bfea31ed4ef4831ba608ff5f27f6f6839cb4868915439bf9bef06d212b2ef648712a8187409853dcc955bbfd3cd5dca8aa8c7\nrunfiles size=69\n install-tl\n texmf-dist/scripts/texlive/lua/texlive/getopt.tlu\n texmf-dist/scripts/texlive/lua/texlive/tlpdb.tlu\n texmf-dist/scripts/texlive/lua/texlive/utils.tlu\n texmf-dist/scripts/texlive/rungs.tlu\n texmf-dist/scripts/texlive/test-tlpdb.tlu\n texmf-dist/scripts/texlive/texconf.tlu\n tlpkg/installer/ctan-mirrors.pl\n tlpkg/installer/install-menu-perltk.pl\n tlpkg/installer/install-menu-text.pl\n tlpkg/installer/install-menu-wizard.pl\n tlpkg/installer/texlive.png\n\nname texlive.infra\ncategory TLCore\nrevision 47457\nshortdesc basic TeX Live infrastructure\nlongdesc This package contains the files needed to get the TeX Live\nlongdesc tools (notably tlmgr) running: perl modules, xz binaries, plus\nlongdesc (sometimes) tar and wget.  These files end up in the standalone\nlongdesc install packages, and in the tlcritical repository.\ndepend texlive.infra.ARCH\npostaction shortcut type=menu name=\"TeX Live Manager\"              cmd=TEXDIR/bin/win32/tlmgr-gui.exe\ncontainersize 208728\ncontainerchecksum 4e987122d1dcc5f7e3f354ba52e784d81a702a5701f2e79d6cbe6c59e288f07b2d5c162bbfb4e48d993f06e9f16c5004eea7de20ded5b7c3dab1f4884ec408f9\ndoccontainersize 173800\ndoccontainerchecksum 2bcd8c5dc1ca4fd26b57dcf9d0e41f10ed9fd011118b1e2a46511d9fba21bf85752431b99e551a0cd6b1cbdd7431f863351001a90960a7c4ab60c22f5d436aa4\nrunfiles size=241\n LICENSE.CTAN\n LICENSE.TL\n release-texlive.txt\n texmf-dist/scripts/texlive/tlmgr.pl\n texmf-dist/scripts/texlive/tlmgrgui.pl\n texmf-dist/scripts/texlive/uninstall-win32.pl\n texmf-dist/web2c/fmtutil-hdr.cnf\n texmf-dist/web2c/updmap-hdr.cfg\n tlpkg/TeXLive/TLConfFile.pm\n tlpkg/TeXLive/TLConfig.pm\n tlpkg/TeXLive/TLCrypto.pm\n tlpkg/TeXLive/TLDownload.pm\n tlpkg/TeXLive/TLPDB.pm\n tlpkg/TeXLive/TLPOBJ.pm\n tlpkg/TeXLive/TLPSRC.pm\n tlpkg/TeXLive/TLPaper.pm\n tlpkg/TeXLive/TLTREE.pm\n tlpkg/TeXLive/TLUtils.pm\n tlpkg/TeXLive/TLWinGoo.pm\n tlpkg/TeXLive/TeXCatalogue.pm\n tlpkg/TeXLive/trans.pl\n tlpkg/gpg/pubring.gpg\n tlpkg/gpg/random_seed\n tlpkg/gpg/secring.gpg\n tlpkg/gpg/trustdb.gpg\n tlpkg/installer/config.guess\n\nname tools\ncategory Package\nrevision 47500\ncatalogue latex-tools\nshortdesc The LaTeX standard tools bundle\nlongdesc A collection of (variously) simple tools provided as part of\nlongdesc the LaTeX required tools distribution, comprising the packages:\nlongdesc afterpage, array, bm, calc, dcolumn, delarray, enumerate,\nlongdesc fileerr, fontsmpl, ftnright, hhline, indentfirst, layout,\nlongdesc longtable, multicol, rawfonts, showkeys, somedefs, tabularx,\nlongdesc theorem, trace, varioref, verbatim, xr, and xspace.\ncontainersize 39560\ncontainerchecksum e966c0df66e9a318df553d7ab06d21cbc26dc1ee2dea4763140d06b65b89cdbe79b209668bc40aa374c040ed390d292e58dca76090c6d7178192fda3ec237cc9\ndoccontainersize 5176984\ndoccontainerchecksum e0ee731117776ebe568dcfe55ef97bc7b533fe1c49347a74994ac0b8ed6b0ec8bcad0beceb40bd21731b0cad8741674101933658183627bb50930ff0c64dd41f\nsrccontainersize 219136\nsrccontainerchecksum 1b8f98ea1db5545b3ac246bad8349fa5fea6d2c71d9e606bb4dd1f0faed61a1f539af9dad6cbdef2d74f626032fb7d202df5fce374316a79b3e1a77d13bb57d7\nrunfiles size=86\n texmf-dist/tex/latex/tools/afterpage.sty\n texmf-dist/tex/latex/tools/array.sty\n texmf-dist/tex/latex/tools/bm.sty\n texmf-dist/tex/latex/tools/calc.sty\n texmf-dist/tex/latex/tools/dcolumn.sty\n texmf-dist/tex/latex/tools/delarray.sty\n texmf-dist/tex/latex/tools/e.tex\n texmf-dist/tex/latex/tools/enumerate.sty\n texmf-dist/tex/latex/tools/fontsmpl.sty\n texmf-dist/tex/latex/tools/fontsmpl.tex\n texmf-dist/tex/latex/tools/ftnright.sty\n texmf-dist/tex/latex/tools/h.tex\n texmf-dist/tex/latex/tools/hhline.sty\n texmf-dist/tex/latex/tools/indentfirst.sty\n texmf-dist/tex/latex/tools/layout.sty\n texmf-dist/tex/latex/tools/longtable.sty\n texmf-dist/tex/latex/tools/multicol-2017-04-11.sty\n texmf-dist/tex/latex/tools/multicol.sty\n texmf-dist/tex/latex/tools/q.tex\n texmf-dist/tex/latex/tools/r.tex\n texmf-dist/tex/latex/tools/rawfonts.sty\n texmf-dist/tex/latex/tools/s.tex\n texmf-dist/tex/latex/tools/shellesc.sty\n texmf-dist/tex/latex/tools/showkeys.sty\n texmf-dist/tex/latex/tools/somedefs.sty\n texmf-dist/tex/latex/tools/tabularx.sty\n texmf-dist/tex/latex/tools/thb.sty\n texmf-dist/tex/latex/tools/thc.sty\n texmf-dist/tex/latex/tools/thcb.sty\n texmf-dist/tex/latex/tools/theorem.sty\n texmf-dist/tex/latex/tools/thm.sty\n texmf-dist/tex/latex/tools/thmb.sty\n texmf-dist/tex/latex/tools/thp.sty\n texmf-dist/tex/latex/tools/trace.sty\n texmf-dist/tex/latex/tools/varioref.sty\n texmf-dist/tex/latex/tools/verbatim.sty\n texmf-dist/tex/latex/tools/verbtest.tex\n texmf-dist/tex/latex/tools/x.tex\n texmf-dist/tex/latex/tools/xr.sty\n texmf-dist/tex/latex/tools/xspace.sty\ncatalogue-ctan /macros/latex/required/tools\ncatalogue-date 2018-04-24 21:20:38 +0200\ncatalogue-license lppl1.3\ncatalogue-topics collection\n\nname typewriter\ncategory Package\nrevision 46641\nshortdesc Typeset with a randomly variable monospace font\nlongdesc The typewriter package uses the OpenType Computer Modern\nlongdesc Unicode Typewriter font, together with a LuaTeX virtual font\nlongdesc setup that introduces random variability in grey level and\nlongdesc angle of each character. It was originally an answer to a\nlongdesc question on stackexchange.\ncontainersize 25208\ncontainerchecksum b378d6f4c342fe5eaee25778fd040003c9fbf2c6d63f9e5d17aa5bbc067488b67175af4e20de8fa7f87fe009d43b3b95f768907a207b74250552be6396e4984a\ndoccontainersize 101052\ndoccontainerchecksum 0c1f8af962e9a351b20b1000f170394ae7f310a8219be8381744c2ceaa171f926ac96bffbf5b781308925b21c264551c2eba1fd5735b5d85011468120d5d38e7\nrunfiles size=63\n texmf-dist/tex/lualatex/typewriter/typewriter.sty\ncatalogue-also ransom manuscript\ncatalogue-ctan /macros/luatex/latex/typewriter\ncatalogue-date 2018-02-14 13:01:28 +0100\ncatalogue-license lppl\ncatalogue-topics typesetting\ncatalogue-version 1.1\n\nname unicode-data\ncategory Package\nrevision 44711\nshortdesc Unicode data and loaders for TeX\nlongdesc This bundle provides generic access to Unicode Consortium data\nlongdesc for TeX use. It contains a set of text files provided by the\nlongdesc Unicode Consortium which are currently all from Unicode 8.0.0,\nlongdesc with the exception of MathClass.txt which is not currently part\nlongdesc of the Unicode Character Database. Accompanying these source\nlongdesc data are generic TeX loader files allowing this data to be used\nlongdesc as part of TeX runs, in particular in building format files.\nlongdesc Currently there are two loader files: one for general character\nlongdesc set up and one for initialising XeTeX character classes as has\nlongdesc been carried out to date by unicode-letters.tex. The source\nlongdesc data are distributed in accordance with the license stipulated\nlongdesc by the Unicode Consortium. The bundle as a whole is\nlongdesc co-ordinated by the LaTeX3 Project as a general resource for\nlongdesc TeX users.\ncontainersize 225172\ncontainerchecksum 0e81ae042bc7e502a87ebdd72862842004b0bf81d2cafce147d00ec6b617e09e0200f39b048087ca6ea474e11228c4f1bb7f5572b315dd4ed0a237c8ca2a6036\ndoccontainersize 3440\ndoccontainerchecksum 9ae3319e7ad5d59b47212bb3c9df9d761333fded010a447d81c792e4878cb28a4fad7ab3f613df5347ed215a0539bbbd3546079de4afcb8546f768ceffb2d36a\nrunfiles size=556\n texmf-dist/tex/generic/unicode-data/CaseFolding.txt\n texmf-dist/tex/generic/unicode-data/EastAsianWidth.txt\n texmf-dist/tex/generic/unicode-data/LineBreak.txt\n texmf-dist/tex/generic/unicode-data/MathClass-15.txt\n texmf-dist/tex/generic/unicode-data/SpecialCasing.txt\n texmf-dist/tex/generic/unicode-data/UnicodeData.txt\n texmf-dist/tex/generic/unicode-data/load-unicode-data.tex\n texmf-dist/tex/generic/unicode-data/load-unicode-math-classes.tex\n texmf-dist/tex/generic/unicode-data/load-unicode-xetex-classes.tex\ncatalogue-ctan /macros/generic/unicode-data\ncatalogue-date 2017-06-27 20:46:53 +0200\ncatalogue-license lppl1.3c\ncatalogue-topics latex3 unicode\ncatalogue-version 1.6\n\nname updmap-map\ncategory Package\nrevision 46957\nshortdesc auto-generated font map files\nlongdesc These map files are regenerated every time a new font is added.\nlongdesc There is no need to rebuild formats or update binaries because\nlongdesc of such updates, hence this separate package.\ncontainersize 181484\ncontainerchecksum d04cb1c90c24e42240325a7f68eca2a2aca340a91e5b79ec7e93fb960e113d7e1dd74227532f4ec233bb43cf157a7375658417dcfcaa20525dce8f47bcffd8ae\nrunfiles size=4578\n texmf-dist/fonts/map/dvipdfmx/updmap/kanjix.map\n texmf-dist/fonts/map/dvips/updmap/builtin35.map\n texmf-dist/fonts/map/dvips/updmap/download35.map\n texmf-dist/fonts/map/dvips/updmap/ps2pk.map\n texmf-dist/fonts/map/dvips/updmap/psfonts.map\n texmf-dist/fonts/map/dvips/updmap/psfonts_pk.map\n texmf-dist/fonts/map/dvips/updmap/psfonts_t1.map\n texmf-dist/fonts/map/pdftex/updmap/pdftex.map\n texmf-dist/fonts/map/pdftex/updmap/pdftex_dl14.map\n texmf-dist/fonts/map/pdftex/updmap/pdftex_ndl14.map\n\nname url\ncategory Package\nrevision 32528\nshortdesc Verbatim with URL-sensitive line breaks\nlongdesc The command \\url is a form of verbatim command that allows\nlongdesc linebreaks at certain characters or combinations of characters,\nlongdesc accepts reconfiguration, and can usually be used in the\nlongdesc argument to another command. (The \\urldef command provides\nlongdesc robust commands that serve in cases when \\url doesn't work in\nlongdesc an argument.) The command is intended for email addresses,\nlongdesc hypertext links, directories/paths, etc., which normally have\nlongdesc no spaces, so by default the package ignores spaces in its\nlongdesc argument. However, a package option \"allows spaces\", which is\nlongdesc useful for operating systems where spaces are a common part of\nlongdesc file names.\ncontainersize 5536\ncontainerchecksum 71d250915fb64e6b2486edbcec98040b510668d05678d2486acf35108e86b58f4079d154b4713d9f313cfe874507abf684cce3d3b744df43fe96df56a12ae498\ndoccontainersize 266848\ndoccontainerchecksum fc8794ac8a58dfa17b2e54782edd90a8698d2a87db3b0fede21dd476693ebda20d7478687ca0a72d1c5beb8a9d6ecce961521305d0eb4ff26f78ab3e53ec79f2\nrunfiles size=4\n texmf-dist/tex/latex/url/url.sty\ncatalogue-also path\ncatalogue-ctan /macros/latex/contrib/url\ncatalogue-date 2016-06-24 19:18:15 +0200\ncatalogue-license lppl\ncatalogue-topics verbatim\ncatalogue-version 3.4\n\nname xdvi\ncategory TLCore\nrevision 47340\nshortdesc A DVI previewer for the X Window System\nlongdesc The canonical previewer for use on Unix and other X-windows\nlongdesc based systems. The distribution has been integrated with that\nlongdesc of xdvik (no longer separately available), so that it will\nlongdesc build with web2c \"out of the box\". It is included in TeX Live.\ndepend xdvi.ARCH\ncontainersize 6820\ncontainerchecksum c0c5598e3683dcf6e9eb435f7a9a6d3065c79738b697d67ddc42a8ceca56a72d94f98ff06415d5c044f971b3f4f9bc58006db0b90f67d2c6b0bb2cc3138f5f08\ndoccontainersize 172000\ndoccontainerchecksum c28f70bab7e44e3b20358beb24a420227e1cb90511619d45fd04db81a2e126452acbf2e75eeaf04bfb70c6aca8a51bc1f64594ae153124d394bd14074ea5c18f\nrunfiles size=9\n texmf-dist/dvips/xdvi/config.xdvi\n texmf-dist/xdvi/XDvi\n texmf-dist/xdvi/pixmap/toolbar.xpm\n texmf-dist/xdvi/pixmap/toolbar2.xpm\ncatalogue-ctan /dviware/xdvi\ncatalogue-date 2017-04-18 05:31:40 +0200\ncatalogue-license other-free\ncatalogue-topics previewer\ncatalogue-version 22.87.03\n\n"
  },
  {
    "path": "packages/tidy/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.html-tidy.org/\nTERMUX_PKG_DESCRIPTION=\"A tool to tidy down your HTML code to a clean style\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=5.7.28\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/htacg/tidy-html5/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=5caa2c769204f506e24ea4986a45abe23f71d14f0fe968314f20065f342ffdba\nTERMUX_PKG_DEPENDS=\"libxslt\"\nTERMUX_PKG_BREAKS=\"tidy-dev\"\nTERMUX_PKG_REPLACES=\"tidy-dev\"\nTERMUX_PKG_HOSTBUILD=true\n\ntermux_step_host_build() {\n\t## Host build required to generate man pages.\n\ttermux_setup_cmake\n\tcmake \"$TERMUX_PKG_SRCDIR\" && make\n}\n\ntermux_step_post_make_install() {\n\tinstall -Dm600 \\\n\t\t\"$TERMUX_PKG_HOSTBUILD_DIR\"/tidy.1 \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/\n}\n"
  },
  {
    "path": "packages/tidy/disable-target-manpages.patch",
    "content": "diff -uNr tidy-html5/CMakeLists.txt tidy-html5.mod/CMakeLists.txt\n--- tidy-html5/CMakeLists.txt\t2018-04-27 16:33:51.000000000 +0300\n+++ tidy-html5.mod/CMakeLists.txt\t2019-01-20 18:53:15.625486585 +0200\n@@ -472,62 +472,6 @@\n \n \n #################################################\n-# Create man pages\n-#################################################\n-\n-if (UNIX AND SUPPORT_CONSOLE_APP)\n-    find_program( XSLTPROC_FOUND xsltproc )\n-    if (XSLTPROC_FOUND)\n-        ## NOTE: man name must match exe ie currently `${LIB_NAME}.1` not `tidy.1`\n-        ## also could use `manpath` command output to determine target install path\n-        set(TIDY_MANFILE ${LIB_NAME}.1)\n-        message(STATUS \"*** Generating man ${TIDY_MANFILE} custom commands...\")\n-        set(TIDY1XSL ${CMAKE_CURRENT_BINARY_DIR}/tidy1.xsl)\n-        set(TIDYHELP ${CMAKE_CURRENT_BINARY_DIR}/tidy-help.xml)\n-        set(TIDYCONFIG ${CMAKE_CURRENT_BINARY_DIR}/tidy-config.xml)\n-        add_custom_target(man ALL DEPENDS \"${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}\")\n-        \n-        ## Populate the @VARIABLES@ in the input file.\n-        configure_file(\n-            ${CMAKE_CURRENT_SOURCE_DIR}/man/tidy1.xsl.in\n-            ${TIDY1XSL}\n-        )\n- \n-        # Run the built EXE to generate xml output .\n-        add_custom_command(\n-            TARGET man\n-            COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-help > ${TIDYHELP}\n-            COMMENT \"Generate ${TIDYHELP}\"\n-            VERBATIM\n-        )\n-\n-        # Run the built EXE to generate more xml output.\n-        add_custom_command(\n-            TARGET man\n-            COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-config > ${TIDYCONFIG}\n-            COMMENT \"Generate ${TIDYCONFIG}\"\n-            VERBATIM\n-        )\n-\n-        # Run xsltproc to generate the install files.\n-        add_custom_command(\n-            TARGET man\n-            DEPENDS ${TIDYHELP}\n-            COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_CURRENT_BINARY_DIR}/${TIDY_MANFILE}\n-            COMMENT \"Generate ${TIDY_MANFILE}\"\n-            VERBATIM\n-        )\n-\n-        install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TIDY_MANFILE} DESTINATION ${MAN_INSTALL_DIR})\n-\n-    else ()\n-        message(STATUS \"*** NOTE: xsltproc NOT FOUND! Can NOT generate man page.\")\n-        message(STATUS \"*** You need to install xsltproc in your system.\")\n-    endif ()\n-endif ()\n-\n-\n-#################################################\n # Create MSI,EXE, DMG, DEB/RPM\n #   TODO: Check each of these builds\n #################################################\n"
  },
  {
    "path": "packages/tig/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://jonas.github.io/tig/\nTERMUX_PKG_DESCRIPTION=\"Ncurses-based text-mode interface for git\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.5.0\nTERMUX_PKG_SHA256=ff537c67af9201e7e7276ce8a0ff9961e9d9c6a8a78790f5817124bd7755aef4\nTERMUX_PKG_SRCURL=https://github.com/jonas/tig/releases/download/tig-$TERMUX_PKG_VERSION/tig-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses, git, libandroid-support\"\n\ntermux_step_post_make_install() {\n\tmake -j 1 install-doc\n}\n"
  },
  {
    "path": "packages/timewarrior/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://taskwarrior.org/docs/timewarrior/\nTERMUX_PKG_DESCRIPTION=\"Command-line time tracker\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.2.0\nTERMUX_PKG_SRCURL=https://github.com/GothenburgBitFactory/timewarrior/releases/download/v$TERMUX_PKG_VERSION/timew-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=2c4d153105a32536ae328038246ebd846a5abd96df7ed29c11100866eaed8e3c\nTERMUX_PKG_DEPENDS=\"libandroid-glob, libc++\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n\n"
  },
  {
    "path": "packages/timewarrior/cmake-CXXSniffer.cmake.patch",
    "content": "diff -u -r ../timew-1.0.0/cmake/CXXSniffer.cmake ./cmake/CXXSniffer.cmake\n--- ../timew-1.0.0/cmake/CXXSniffer.cmake\t2016-08-17 23:22:31.000000000 +0200\n+++ ./cmake/CXXSniffer.cmake\t2017-01-15 18:34:29.424793652 +0100\n@@ -22,6 +22,8 @@\n \n if (${CMAKE_SYSTEM_NAME} MATCHES \"Linux\")\n   set (LINUX true)\n+elseif (${CMAKE_SYSTEM_NAME} MATCHES \"Android\")\n+  set (LINUX true)\n elseif (${CMAKE_SYSTEM_NAME} MATCHES \"Darwin\")\n   set (DARWIN true)\n   set (_CXX11_FLAGS \"${_CXX11_FLAGS} -stdlib=libc++\")\n"
  },
  {
    "path": "packages/timewarrior/src-CMakeLists.txt.patch",
    "content": "diff -u -r ../timew-1.0.0/src/CMakeLists.txt ./src/CMakeLists.txt\n--- ../timew-1.0.0/src/CMakeLists.txt\t2016-08-17 17:23:15.000000000 -0400\n+++ ./src/CMakeLists.txt\t2016-09-05 17:53:00.643967527 -0400\n@@ -1,4 +1,5 @@\n cmake_minimum_required (VERSION 2.8)\n+include_directories(SYSTEM \"@TERMUX_PREFIX@/include\")\n include_directories (${CMAKE_SOURCE_DIR}\n                      ${CMAKE_SOURCE_DIR}/src\n                      ${CMAKE_SOURCE_DIR}/src/commands\n"
  },
  {
    "path": "packages/tintin++/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://tintin.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Classic text-based MUD client\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=2.01.92\nTERMUX_PKG_SRCURL=https://sourceforge.net/projects/tintin/files/tintin-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3386d49810f2dbc162f890f26bb81e3807af34753d7a4ead64cc40e845cba845\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_file__dev_ptmx=no\"\nTERMUX_PKG_DEPENDS=\"pcre, libgnutls, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_extract_package() {\n\tTERMUX_PKG_SRCDIR+=\"/src\"\n\tTERMUX_PKG_BUILDDIR=\"$TERMUX_PKG_SRCDIR\"\n}\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" $CPPFLAGS\"\n}\n"
  },
  {
    "path": "packages/tintin++/src-system.c.patch",
    "content": "diff -uNr tt/src/system.c tt.mod/src/system.c\n--- src/system.c\t2019-11-03 01:01:58.000000000 +0100\n+++ src/system.c\t2019-11-13 23:17:14.053972425 +0100\n@@ -73,7 +73,7 @@\n \t\tcase 0:\n \t\t\tsprintf(temp, \"exec %s\", arg2);\n \t\t\targv[2] = temp;\n-\t\t\texecv(\"/bin/sh\", argv);\n+\t\t\texecv(\"@TERMUX_PREFIX@/bin/sh\", argv);\n \t\t\tbreak;\n \n \t\tdefault:\n"
  },
  {
    "path": "packages/tinyproxy/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://tinyproxy.github.io/\nTERMUX_PKG_DESCRIPTION=\"Light-weight HTTP proxy daemon for POSIX operating systems\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.10.0\nTERMUX_PKG_SHA256=59be87689c415ba0d9c9bc6babbdd3df3b372d60b21e526b118d722dbc995682\nTERMUX_PKG_SRCURL=https://github.com/tinyproxy/tinyproxy/releases/download/${TERMUX_PKG_VERSION}/tinyproxy-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-regexcheck\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-llog\"\n}\n\ntermux_step_post_massage() {\n\tmkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/log/$TERMUX_PKG_NAME\n\tmkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var/run/$TERMUX_PKG_NAME\n\tfind $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/var -exec chmod -f u+w,g-rwx,o-rwx \\{\\} \\;\n}\n"
  },
  {
    "path": "packages/tinyproxy/child.c.patch",
    "content": "--- ../tinyproxy-1.8.4/src/child.c\t2015-12-07 14:19:00.000000000 +0000\n+++ ./src/child.c\t2018-08-21 21:56:40.448440799 +0000\n@@ -75,7 +75,7 @@\n \n static void _child_lock_init (void)\n {\n-        char lock_file[] = \"/tmp/tinyproxy.servers.lock.XXXXXX\";\n+        char lock_file[] = \"@TERMUX_PREFIX@/tmp/tinyproxy.servers.lock.XXXXXX\";\n \n         /* Only allow u+rw bits. This may be required for some versions\n          * of glibc so that mkstemp() doesn't make us vulnerable.\n"
  },
  {
    "path": "packages/tinyproxy/configure.patch",
    "content": "diff -u -r ../tinyproxy-1.10.0/configure ./configure\n--- ../tinyproxy-1.10.0/configure\t2018-09-01 02:11:56.000000000 +0000\n+++ ./configure\t2018-09-06 19:43:34.813647036 +0000\n@@ -5991,7 +5991,7 @@\n done\n \n \n-DESIRED_FLAGS=\"-fdiagnostics-show-option -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wfloat-equal -Wundef -Wformat=2 -Wlogical-op -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Waggregate-return -Winit-self -Wpacked --std=c89 -ansi -Wno-overlength-strings -Wno-long-long -Wno-overlength-strings -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-qual -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common\"\n+DESIRED_FLAGS=\"-fdiagnostics-show-option -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wfloat-equal -Wundef -Wformat=2 -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Waggregate-return -Winit-self -Wpacked -std=gnu99 -Wno-overlength-strings -Wno-long-long -Wno-overlength-strings -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-qual -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common\"\n \n if test -n \"${MAINTAINER_MODE_FALSE}\"; then\n    DESIRED_FLAGS=\"-Werror $DESIRED_FLAGS\"\n"
  },
  {
    "path": "packages/tinyproxy/heap.c.patch",
    "content": "--- ../tinyproxy-1.8.4/src/heap.c\t2015-12-07 14:19:00.000000000 +0000\n+++ ./src/heap.c\t2018-08-21 21:58:46.821559832 +0000\n@@ -109,9 +109,9 @@\n {\n         int fd;\n         void *ptr;\n-        char buffer[32];\n+        char buffer[128];\n \n-        static const char *shared_file = \"/tmp/tinyproxy.shared.XXXXXX\";\n+        static const char *shared_file = \"@TERMUX_PREFIX@/tmp/tinyproxy.shared.XXXXXX\";\n \n         assert (size > 0);\n \n"
  },
  {
    "path": "packages/tinyscheme/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://tinyscheme.sourceforge.net/home.html\nTERMUX_PKG_DESCRIPTION=\"Very small scheme implementation\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=1.41\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/tinyscheme/tinyscheme/tinyscheme-1.41/tinyscheme-1.41.tar.gz\nTERMUX_PKG_SHA256=eac0103494c755192b9e8f10454d9f98f2bbd4d352e046f7b253439a3f991999\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tAR+=\" crs\"\n\tLD=$CC\n}\n\ntermux_step_post_make_install() {\n\tmkdir -p $TERMUX_PREFIX/share/tinyscheme/\n\tcp $TERMUX_PKG_SRCDIR/init.scm $TERMUX_PREFIX/share/tinyscheme/\n}\n"
  },
  {
    "path": "packages/tinyscheme/makefile.patch",
    "content": "diff -u -r ../tinyscheme-1.41/makefile ./makefile\n--- ../tinyscheme-1.41/makefile\t2013-04-14 16:08:33.000000000 -0400\n+++ ./makefile\t2016-02-03 07:50:01.896212523 -0500\n@@ -18,7 +18,6 @@\n #AR= echo\n \n # Unix, generally\n-CC = gcc -fpic -pedantic\n DEBUG=-g -Wall -Wno-char-subscripts -O\n Osuf=o\n SOsuf=so\n@@ -27,11 +26,8 @@\n LIBPREFIX=lib\n OUT = -o $@\n RM= -rm -f\n-AR= ar crs\n \n # Linux\n-LD = gcc\n-LDFLAGS = -shared\n DEBUG=-g -Wno-char-subscripts -O\n SYS_LIBS= -ldl -lm\n PLATFORM_FEATURES= -DSUN_DL=1\n@@ -77,7 +73,7 @@\n \t$(LD) $(LDFLAGS) $(OUT) $(OBJS) $(SYS_LIBS)\n \n scheme$(EXE_EXT): $(OBJS)\n-\t$(CC) -o $@ $(DEBUG) $(OBJS) $(SYS_LIBS)\n+\t$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(DEBUG) $(OBJS) $(SYS_LIBS)\n \n $(STATICLIBTARGET): $(OBJS)\n \t$(AR) $@ $(OBJS)\n@@ -96,3 +92,6 @@\n tags: TAGS\n TAGS: $(TAGS_SRCS)\n \tetags $(TAGS_SRCS)\n+\n+install: scheme\n+\tcp scheme @TERMUX_PREFIX@/bin/tinyscheme\n"
  },
  {
    "path": "packages/tinyscheme/schema.c.patch",
    "content": "diff -u -r ../tinyscheme-1.41/scheme.c ./scheme.c\n--- ../tinyscheme-1.41/scheme.c\t2013-04-14 16:08:33.000000000 -0400\n+++ ./scheme.c\t2016-02-03 08:22:19.137873950 -0500\n@@ -101,7 +101,7 @@\n #endif\n \n #ifndef InitFile\n-# define InitFile \"init.scm\"\n+# define InitFile \"@TERMUX_PREFIX@/share/tinyscheme/init.scm\"\n #endif\n \n #ifndef FIRST_CELLSEGS\n"
  },
  {
    "path": "packages/tk/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://tcl.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"A windowing toolkit for use with tcl\"\nTERMUX_PKG_LICENSE=\"custom\"\nTERMUX_PKG_LICENSE_FILE=\"license.terms\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=8.6.9.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/sourceforge/tcl/tk${TERMUX_PKG_VERSION}-src.tar.gz\nTERMUX_PKG_SHA256=8fcbcd958a8fd727e279f4cac00971eee2ce271dc741650b1fc33375fb74ebb4\nTERMUX_PKG_DEPENDS=\"fontconfig, libx11, libxft, libxss, tcl\"\nTERMUX_PKG_NO_STATICSPLIT=true\nTERMUX_PKG_MAKE_INSTALL_TARGET=\"install install-private-headers\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--enable-threads\n--enable-64bit\n\"\n\ntermux_step_pre_configure() {\n\tTERMUX_PKG_SRCDIR+=\"/unix\"\n}\n\ntermux_step_post_make_install() {\n\tln -sfr \"$TERMUX_PREFIX/bin/wish${TERMUX_PKG_VERSION:0:3}\" \\\n\t\t\"$TERMUX_PREFIX\"/bin/wish\n\tln -sfr \"$TERMUX_PREFIX/lib/libtk${TERMUX_PKG_VERSION:0:3}.so\" \\\n\t\t\"$TERMUX_PREFIX\"/lib/libtk.so\n\n\tcd \"$TERMUX_PKG_SRCDIR\"/../\n\n\tfor dir in compat generic generic/ttk unix; do\n\t\tinstall -dm755 \"$TERMUX_PREFIX/include/tk-private/$dir\"\n\t\tinstall -m644 -t \"$TERMUX_PREFIX/include/tk-private/$dir\" \"$dir\"/*.h\n\tdone\n}\n"
  },
  {
    "path": "packages/tk/no-hardlinks.patch",
    "content": "diff -uNr tk8.6.9/unix/installManPage tk8.6.9.mod/unix/installManPage\n--- tk8.6.9/unix/installManPage\t2018-11-18 00:33:44.000000000 +0200\n+++ tk8.6.9.mod/unix/installManPage\t2019-11-17 16:16:48.449560198 +0200\n@@ -109,7 +109,7 @@\n \tchmod 444 $Dir/$First\n \t$Gzip $Dir/$First\n     else\n-\tln $SymOrLoc$First$Gz $Dir/$Target$Gz\n+\tln -sfr $SymOrLoc$First$Gz $Dir/$Target$Gz\n     fi\n done\n \n"
  },
  {
    "path": "packages/tmate/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://tmate.io\nTERMUX_PKG_DESCRIPTION=\"Terminal multiplexer with instant terminal sharing\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.4.0\nTERMUX_PKG_SRCURL=https://github.com/tmate-io/tmate/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=62b61eb12ab394012c861f6b48ba0bc04ac8765abca13bdde5a4d9105cb16138\nTERMUX_PKG_DEPENDS=\"libandroid-support, libevent, libmsgpack, libssh, ncurses\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-static\"\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -DIOV_MAX=1024\"\n\n\t./autogen.sh\n}\n"
  },
  {
    "path": "packages/tmate/tmux.h.patch",
    "content": "diff -u -r ../tmate-2.2.1/tmux.h ./tmux.h\n--- ../tmate-2.2.1/tmux.h\t2016-03-28 23:30:07.000000000 -0400\n+++ ./tmux.h\t2016-08-26 16:57:50.901952193 -0400\n@@ -53,7 +53,7 @@\n struct tmuxproc;\n \n /* Default global configuration file. */\n-#define TMUX_CONF \"/etc/tmux.conf\"\n+#define TMUX_CONF \"@TERMUX_PREFIX@/etc/tmux.conf\"\n \n /*\n  * Minimum layout cell size, NOT including separator line. The scroll region\n"
  },
  {
    "path": "packages/tmux/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://tmux.github.io/\nTERMUX_PKG_DESCRIPTION=\"Terminal multiplexer\"\nTERMUX_PKG_LICENSE=\"BSD\"\n# Link against libandroid-support for wcwidth(), see https://github.com/termux/termux-packages/issues/224\nTERMUX_PKG_DEPENDS=\"ncurses, libevent, libandroid-support, libandroid-glob\"\nTERMUX_PKG_VERSION=3.0a\nTERMUX_PKG_SRCURL=https://github.com/tmux/tmux/releases/download/${TERMUX_PKG_VERSION}/tmux-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=4ad1df28b4afa969e59c08061b45082fdc49ff512f30fc8e43217d7b0e5f8db9\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-static\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\nTERMUX_PKG_CONFFILES=\"etc/tmux.conf\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -landroid-glob\"\n}\n\ntermux_step_post_make_install() {\n\tcp $TERMUX_PKG_BUILDER_DIR/tmux.conf $TERMUX_PREFIX/etc/tmux.conf\n\n\tmkdir -p $TERMUX_PREFIX/share/bash-completion/completions\n\ttermux_download \\\n\t\thttps://raw.githubusercontent.com/imomaliev/tmux-bash-completion/homebrew_1.0.0/completions/tmux \\\n\t\t$TERMUX_PREFIX/share/bash-completion/completions/tmux \\\n\t\t05e79fc1ecb27637dc9d6a52c315b8f207cf010cdcee9928805525076c9020ae\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"mkdir -p $TERMUX_PREFIX/var/run\" >> postinst\n}\n"
  },
  {
    "path": "packages/tmux/compat-imsg.c.patch",
    "content": "diff -u -r ../tmux-2.4/compat/imsg.c ./compat/imsg.c\n--- ../tmux-2.4/compat/imsg.c\t2017-04-19 14:49:29.000000000 +0200\n+++ ./compat/imsg.c\t2017-04-22 02:21:48.592932564 +0200\n@@ -73,7 +73,7 @@\n again:\n \tif (getdtablecount() + imsg_fd_overhead +\n \t    (int)((CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int))\n-\t    >= getdtablesize()) {\n+\t    >= sysconf(_SC_OPEN_MAX)) {\n \t\terrno = EAGAIN;\n \t\tfree(ifd);\n \t\treturn (-1);\n"
  },
  {
    "path": "packages/tmux/compat-setproctitle.c.patch",
    "content": "diff -u -r ../tmux-2.5/compat/setproctitle.c ./compat/setproctitle.c\n--- ../tmux-2.5/compat/setproctitle.c\t2017-04-28 15:43:11.000000000 +0200\n+++ ./compat/setproctitle.c\t2017-07-02 11:16:40.393826133 +0200\n@@ -18,6 +18,9 @@\n \n #include <stdarg.h>\n #include <string.h>\n+#ifdef __ANDROID__\n+# include <stdlib.h> /* For getprogname() */\n+#endif\n \n #include \"compat.h\"\n \n"
  },
  {
    "path": "packages/tmux/configure.patch",
    "content": "We actually do want tmux.conf to go into ${prefix}/etc,\nsince the real /etc is not writeable on Android.\n\ndiff -u -r ../tmux-1.9a/configure ./configure\n--- ../tmux-1.9a/configure\t2014-02-22 21:56:15.000000000 +0100\n+++ ./configure\t2014-02-24 08:50:16.000000000 +0100\n@@ -4011,7 +4011,7 @@\n \n \n # Default tmux.conf goes in /etc not ${prefix}/etc.\n-test \"$sysconfdir\" = '${prefix}/etc' && sysconfdir=/etc\n+#test \"$sysconfdir\" = '${prefix}/etc' && sysconfdir=/etc\n \n # Check for various headers. Alternatives included from compat.h.\n \n"
  },
  {
    "path": "packages/tmux/socket-path.patch",
    "content": "--- ../tmux.c.orig\t2019-08-24 20:23:15.576000965 +0200\n+++ ./tmux.c\t2019-08-24 22:11:56.316981911 +0200\n@@ -121,7 +121,7 @@\n \tif ((s = getenv(\"TMUX_TMPDIR\")) != NULL && *s != '\\0')\n \t\txasprintf(&base, \"%s/tmux-%ld\", s, (long)uid);\n \telse\n-\t\txasprintf(&base, \"%s/tmux-%ld\", _PATH_TMP, (long)uid);\n+\t\txasprintf(&base, \"%s/tmux-%ld\", \"@TERMUX_PREFIX@/var/run\", (long)uid);\n \tif (realpath(base, resolved) == NULL &&\n \t    strlcpy(resolved, base, sizeof resolved) >= sizeof resolved) {\n \t\terrno = ERANGE;\n"
  },
  {
    "path": "packages/tmux/tmux.conf",
    "content": "set -g mouse on\n"
  },
  {
    "path": "packages/toilet/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://caca.zoy.org/wiki/toilet\nTERMUX_PKG_DESCRIPTION=\"FIGlet-compatible display of large colourful characters in text mode\"\nTERMUX_PKG_LICENSE=\"WTFPL\"\nTERMUX_PKG_VERSION=0.3\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=http://fossies.org/linux/privat/toilet-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=89d4b530c394313cc3f3a4e07a7394fa82a6091f44df44dfcd0ebcb3300a81de\nTERMUX_PKG_DEPENDS=\"libcaca\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/tokei/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/XAMPPRocky/tokei\nTERMUX_PKG_DESCRIPTION=\"A blazingly fast CLOC (Count Lines Of Code) program\"\nTERMUX_PKG_LICENSE=\"Apache-2.0, MIT\"\nTERMUX_PKG_VERSION=10.1.0\nTERMUX_PKG_SRCURL=https://github.com/XAMPPRocky/tokei/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=86b741d32850b267dcaaad244de8b821b0bd64678b83428b0150820bd963e697\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--features all\"\n\ntermux_step_post_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$TERMUX_PKG_SRCDIR/target/$CARGO_TARGET_NAME\"/release/tokei \\\n\t\t\"$TERMUX_PREFIX\"/bin/tokei\n}\n"
  },
  {
    "path": "packages/tor/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.torproject.org\nTERMUX_PKG_DESCRIPTION=\"The Onion Router anonymizing overlay network\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=0.4.1.6\nTERMUX_PKG_SRCURL=https://www.torproject.org/dist/tor-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=2a88524ce426079fb9b828bc1b789f2c8ade3ed53c130851102debc3518bed71\nTERMUX_PKG_DEPENDS=\"libevent, openssl, liblzma, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-zstd --disable-unittests\"\nTERMUX_PKG_CONFFILES=\"etc/tor/torrc var/service/tor/run var/service/tor/log/run\"\n\ntermux_step_pre_configure() {\n\texport LIBS=\"-llog\"\n}\n\ntermux_step_post_make_install() {\n\t# use default config\n\tmv \"$TERMUX_PREFIX/etc/tor/torrc.sample\" \"$TERMUX_PREFIX/etc/tor/torrc\"\n\n\t# Setup tor service script\n\tmkdir -p $TERMUX_PREFIX/var/service\n\tcd $TERMUX_PREFIX/var/service\n\tmkdir -p tor/log\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > tor/run\n\techo 'exec tor 2>&1' >> tor/run\n\tchmod +x tor/run\n\ttouch tor/down\n\tln -sf $PREFIX/share/termux-services/svlogger tor/log/run\n}\n"
  },
  {
    "path": "packages/tor/src-app-main-main.c.patch",
    "content": "diff -u -r ../tor-0.3.5.7/src/app/main/main.c ./src/app/main/main.c\n--- ../tor-0.3.5.7/src/app/main/main.c\t2018-12-18 18:56:22.000000000 +0000\n+++ ./src/app/main/main.c\t2019-01-10 20:29:38.187975263 +0000\n@@ -1044,7 +1044,7 @@\n   OPEN(\"/dev/srandom\");\n   OPEN(\"/dev/urandom\");\n   OPEN(\"/dev/random\");\n-  OPEN(\"/etc/hosts\");\n+  OPEN(\"@TERMUX_PREFIX@/etc/hosts\");\n   OPEN(\"/proc/meminfo\");\n \n   if (options->BridgeAuthoritativeDir)\n@@ -1057,7 +1057,7 @@\n     sandbox_cfg_allow_open_filename(&cfg,\n                                 tor_strdup(options->ServerDNSResolvConfFile));\n   else\n-    sandbox_cfg_allow_open_filename(&cfg, tor_strdup(\"/etc/resolv.conf\"));\n+    sandbox_cfg_allow_open_filename(&cfg, tor_strdup(\"@TERMUX_PREFIX@/etc/resolv.conf\"));\n \n   for (i = 0; i < 2; ++i) {\n     if (get_torrc_fname(i)) {\n@@ -1223,7 +1223,7 @@\n     OPEN_DATADIR_SUFFIX(\"hashed-fingerprint\", \".tmp\");\n     OPEN_DATADIR_SUFFIX(\"router-stability\", \".tmp\");\n \n-    OPEN(\"/etc/resolv.conf\");\n+    OPEN(\"@TERMUX_PREFIX@/etc/resolv.conf\");\n \n     RENAME_SUFFIX(\"fingerprint\", \".tmp\");\n     RENAME_KEYDIR_SUFFIX(\"secret_onion_key_ntor\", \".tmp\");\n"
  },
  {
    "path": "packages/tor/src-feature-relay-dns.c.patch",
    "content": "diff -u -r ../tor-0.3.5.7/src/feature/relay/dns.c ./src/feature/relay/dns.c\n--- ../tor-0.3.5.7/src/feature/relay/dns.c\t2019-01-04 02:34:43.000000000 +0000\n+++ ./src/feature/relay/dns.c\t2019-01-10 20:30:51.361418430 +0000\n@@ -1377,7 +1377,7 @@\n   conf_fname = options->ServerDNSResolvConfFile;\n #ifndef _WIN32\n   if (!conf_fname)\n-    conf_fname = \"/etc/resolv.conf\";\n+    conf_fname = \"@TERMUX_PREFIX@/etc/resolv.conf\";\n #endif\n   flags = DNS_OPTIONS_ALL;\n \n@@ -1408,9 +1408,9 @@\n #if defined(DNS_OPTION_HOSTSFILE) && defined(USE_LIBSECCOMP)\n     if (flags & DNS_OPTION_HOSTSFILE) {\n       flags ^= DNS_OPTION_HOSTSFILE;\n-      log_debug(LD_FS, \"Loading /etc/hosts\");\n+      log_debug(LD_FS, \"Loading @TERMUX_PREFIX@/etc/hosts\");\n       evdns_base_load_hosts(the_evdns_base,\n-          sandbox_intern_string(\"/etc/hosts\"));\n+          sandbox_intern_string(\"@TERMUX_PREFIX@/etc/hosts\"));\n     }\n #endif /* defined(DNS_OPTION_HOSTSFILE) && defined(USE_LIBSECCOMP) */\n     log_info(LD_EXIT, \"Parsing resolver configuration in '%s'\", conf_fname);\n"
  },
  {
    "path": "packages/torsocks/Makefile.am.patch",
    "content": "diff -u -r ../torsocks-2.3.0/Makefile.am ./Makefile.am\n--- ../torsocks-2.3.0/Makefile.am\t2018-11-19 15:42:40.000000000 +0000\n+++ ./Makefile.am\t2018-11-21 22:42:40.280616653 +0000\n@@ -1,6 +1,6 @@\n ACLOCAL_AMFLAGS = -I config\n \n-SUBDIRS = src doc tests extras\n+SUBDIRS = src doc extras\n \n dist_doc_DATA = ChangeLog\n \n"
  },
  {
    "path": "packages/torsocks/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/dgoulet/torsocks\nTERMUX_PKG_DESCRIPTION=\"Wrapper to safely torify applications\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.3.0\nTERMUX_PKG_SHA256=817c143e8a9d217f41a223a85139c6ca28e1b99556c547fcdb4c72dbc170b6c9\nTERMUX_PKG_SRCURL=https://github.com/dgoulet/torsocks/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"tor\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n}\n\n"
  },
  {
    "path": "packages/torsocks/configure.ac.patch",
    "content": "diff -u -r ../torsocks-2.2.0/configure.ac ./configure.ac\n--- ../torsocks-2.2.0/configure.ac\t2016-10-18 12:44:01.000000000 -0400\n+++ ./configure.ac\t2016-12-20 23:35:32.966335918 -0500\n@@ -121,6 +121,7 @@\n AC_MSG_CHECKING(file name of the C library)\n AS_CASE([$host_os],\n \t[darwin*], [libc_name=\"libSystem.dylib\"],\n+\t[*linux-android*], [libc_name=\"libc.so\"],\n \t[linux*|kfreebsd*-gnu|freebsd*],\n \t[\n \t\tlibc_name=`ldd /usr/bin/yes | grep 'libc\\.' | cut -d ' ' -f 1 | tr -d '\\t'`\n"
  },
  {
    "path": "packages/torsocks/src-common-compat.h.patch",
    "content": "diff -u -r ../torsocks-2.3.0/src/common/compat.h ./src/common/compat.h\n--- ../torsocks-2.3.0/src/common/compat.h\t2018-11-19 15:42:40.000000000 +0000\n+++ ./src/common/compat.h\t2018-11-21 22:39:33.390432043 +0000\n@@ -129,6 +129,9 @@\n #ifndef __NR_memfd_create\n #define __NR_memfd_create -19\n #endif\n+#ifndef __NR_clone\n+#define __NR_clone -19\n+#endif\n \n #define TSOCKS_NR_SOCKET    __NR_socket\n #define TSOCKS_NR_CONNECT   __NR_connect\n@@ -149,6 +152,7 @@\n #define TSOCKS_NR_CLOCK_GETTIME __NR_clock_gettime\n #define TSOCKS_NR_FORK      __NR_fork\n #define TSOCKS_NR_MEMFD_CREATE __NR_memfd_create\n+#define TSOCKS_NR_CLONE     __NR_clone\n \n /*\n  * Despite glibc providing wrappers for these calls for a long time\n"
  },
  {
    "path": "packages/torsocks/src-common-config-file.h.patch",
    "content": "diff -u -r ../torsocks-2.2.0/src/common/config-file.h ./src/common/config-file.h\n--- ../torsocks-2.2.0/src/common/config-file.h\t2016-10-18 12:44:01.000000000 -0400\n+++ ./src/common/config-file.h\t2016-12-20 21:18:35.084929826 -0500\n@@ -21,6 +21,10 @@\n #define CONFIG_FILE_H\n \n #include <netinet/in.h>\n+#ifdef __ANDROID__\n+/* For in_addr_t. */\n+#include <arpa/inet.h>\n+#endif\n \n #include \"connection.h\"\n #include \"socks5.h\"\n"
  },
  {
    "path": "packages/torsocks/src-lib-gethostbyname.c.patch",
    "content": "--- ./src/lib/gethostbyname.c\t2016-10-18 22:14:01.000000000 +0530\n+++ ../gethostbyname.c\t2016-12-22 10:14:38.497288603 +0530\n@@ -74,7 +74,7 @@\n \n \t/* Man page specifies that it can either be an hostname or IPv4 address.\n \t * If it's an address, go with it else try to resolve it through Tor. */\n-\tif (utils_is_address_ipv4(name)) {\n+\tif (utils_is_address_ipv4(name) == 1) {\n \t\tif (inet_pton(AF_INET, name, &ip) <= 0) {\n \t\t\tgoto error;\n \t\t}\n"
  },
  {
    "path": "packages/torsocks/src-lib-syscall.c.patch",
    "content": "diff -u -r ../torsocks-2.3.0/src/lib/syscall.c ./src/lib/syscall.c\n--- ../torsocks-2.3.0/src/lib/syscall.c\t2018-11-19 15:42:40.000000000 +0000\n+++ ./src/lib/syscall.c\t2018-11-21 22:37:53.867404833 +0000\n@@ -437,6 +437,24 @@\n \n \treturn tsocks_libc_syscall(TSOCKS_NR_MEMFD_CREATE, name, flags);\n }\n+\n+/*\n+ *  * Handle clone(2) syscall.\n+ *   */\n+static LIBC_SYSCALL_RET_TYPE handle_clone(va_list args)\n+{\n+\tint (*fn)(void*);\n+\tvoid* child_stack;\n+\tint flags;\n+\tvoid* arg;\n+\n+\tfn = va_arg(args, __typeof__(fn));\n+\tchild_stack = va_arg(args, __typeof__(child_stack));\n+\tflags = va_arg(args, __typeof__(flags));\n+\targ = va_arg(args, __typeof__(arg));\n+\n+        return tsocks_libc_syscall(TSOCKS_NR_CLONE, fn, child_stack, flags, arg);\n+}\n #endif /* __linux__ */\n \n /*\n@@ -558,6 +576,9 @@\n \tcase TSOCKS_NR_MEMFD_CREATE:\n \t\tret = handle_memfd_create(args);\n \t\tbreak;\n+\tcase TSOCKS_NR_CLONE:\n+\t\tret = handle_clone(args);\n+\t\tbreak;\n #endif /* __linux__ */\n \tdefault:\n \t\t/*\n"
  },
  {
    "path": "packages/toxic/Makefile.patch",
    "content": "diff -u -r ../toxic-0.8.3/Makefile ./Makefile\n--- ../toxic-0.8.3/Makefile\t2018-10-30 22:03:44.000000000 +0000\n+++ ./Makefile\t2018-11-01 02:21:19.464155263 +0000\n@@ -20,9 +20,6 @@\n \n # Check on wich system we are running\n UNAME_S = $(shell uname -s)\n-ifeq ($(UNAME_S), Linux)\n-LDFLAGS += -ldl -lrt\n-endif\n ifeq ($(UNAME_S), OpenBSD)\n LIBS := $(filter-out ncursesw, $(LIBS))\n LDFLAGS += -lncursesw\n"
  },
  {
    "path": "packages/toxic/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/JFreegman/toxic\nTERMUX_PKG_DESCRIPTION=\"A command line client for Tox\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.8.3\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=97f26ba2c257c10439fd2ff280ca90c37ed225d86f46740a08f02ff2e4459e0e\nTERMUX_PKG_SRCURL=https://github.com/JFreegman/toxic/archive/v${TERMUX_PKG_VERSION}/toxic-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"c-toxcore, libconfig, libcurl, libqrencode, ncurses, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake \\\n\t\tPREFIX=\"${TERMUX_PREFIX}\" \\\n\t\tCC=\"${CC}\" \\\n\t\tPKG_CONFIG=\"${PKG_CONFIG}\" \\\n\t\tUSER_CFLAGS=\"${CFLAGS}\" \\\n\t\tUSER_LDFLAGS=\"${LDFLAGS}\"\n}\n\ntermux_step_make_install() {\n\tmake PREFIX=\"${TERMUX_PREFIX}\" install\n}\n"
  },
  {
    "path": "packages/toxic/cfg-checks-audio.mk.patch",
    "content": "Do not try to use audio even if openal-soft has been built.\n\ndiff -u -r ../toxic-0.8.2/cfg/checks/audio.mk ./cfg/checks/audio.mk\n--- ../toxic-0.8.2/cfg/checks/audio.mk\t2018-02-27 23:46:56.000000000 +0000\n+++ ./cfg/checks/audio.mk\t2018-08-21 11:10:53.212956416 +0000\n@@ -8,7 +8,7 @@\n endif\n \n # Check if we can build audio support\n-CHECK_AUDIO_LIBS = $(shell $(PKG_CONFIG) --exists $(AUDIO_LIBS) || echo -n \"error\")\n+CHECK_AUDIO_LIBS = $(shell echo -n \"error\")\n ifneq ($(CHECK_AUDIO_LIBS), error)\n     LIBS += $(AUDIO_LIBS)\n     CFLAGS += $(AUDIO_CFLAGS)\n"
  },
  {
    "path": "packages/tracepath/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/iputils/iputils\nTERMUX_PKG_DESCRIPTION=\"Tool to trace the network path to a remote host\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=20190709\nTERMUX_PKG_SRCURL=https://github.com/iputils/iputils/archive/s${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=a15720dd741d7538dd2645f9f516d193636ae4300ff7dbc8bfca757bf166490a\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\treturn\n}\n\ntermux_step_make() {\n\treturn\n}\n\ntermux_step_make_install() {\n\tCPPFLAGS+=\" -DPACKAGE_VERSION=\\\"$TERMUX_PKG_VERSION\\\" -DHAVE_ERROR_H\"\n\t$CC $CFLAGS $CPPFLAGS $LDFLAGS -o $TERMUX_PREFIX/bin/tracepath iputils_common.c tracepath.c\n\n\tlocal MANDIR=$TERMUX_PREFIX/share/man/man8\n\tmkdir -p $MANDIR\n\tcd $TERMUX_PKG_SRCDIR/doc\n\txsltproc \\\n\t\t--stringparam man.output.quietly 1 \\\n\t\t--stringparam funcsynopsis.style ansi \\\n\t\t--stringparam man.th.extra1.suppress 1 \\\n\t\t--stringparam iputils.version $TERMUX_PKG_VERSION \\\n\t\tcustom-man.xsl \\\n\t\ttracepath.xml\n\tcp tracepath.8 $MANDIR/\n\n\t# Setup traceroute as an alias for tracepath, since traceroute\n\t# requires root which most Termux user does not have, and tracepath\n\t# is probably good enough for most:\n\t(cd $TERMUX_PREFIX/bin && ln -f -s tracepath traceroute)\n\t(cd $MANDIR && ln -f -s tracepath.8 traceroute.8)\n}\n"
  },
  {
    "path": "packages/tracepath/tracepath.c.patch",
    "content": "diff -uNr iputils-s20190515/tracepath.c iputils-s20190515.mod/tracepath.c\n--- iputils-s20190515/tracepath.c\t2019-05-15 23:14:10.000000000 +0300\n+++ iputils-s20190515.mod/tracepath.c\t2019-05-21 14:22:16.131807826 +0300\n@@ -12,6 +12,7 @@\n #include <arpa/inet.h>\n #include <errno.h>\n #include <limits.h>\n+#include <time.h>\n #include <netdb.h>\n #include <netinet/in.h>\n #include <resolv.h>\n@@ -57,6 +58,8 @@\n # define IPV6_PMTUDISC_DO\t3\n #endif\n \n+#define IPUTILS_VERSION(_prog) \"%s from iputils %s\\n\", _prog, PACKAGE_VERSION\n+\n enum {\n \tMAX_PROBES = 10,\n \n"
  },
  {
    "path": "packages/translate-shell/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.soimort.org/translate-shell\nTERMUX_PKG_DESCRIPTION=\"Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.\"\nTERMUX_PKG_LICENSE=\"Public Domain\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.9.6.11\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://github.com/soimort/translate-shell/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=589505248212726dff2b3e8828514036491f019fcee8657c0d94bb1a5dac6c5b\nTERMUX_PKG_DEPENDS=\"bash, curl, gawk, less, rlwrap\"\n# hunspell - spell checking\n# mpv - text-to-speech functionality\nTERMUX_PKG_RECOMMENDS=\"hunspell, mpv\"\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"PREFIX=$TERMUX_PREFIX\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/transmission/arpa_inet_h.patch",
    "content": "diff -u -r ../transmission-2.82/third-party/libnatpmp/getgateway.h ./third-party/libnatpmp/getgateway.h\n--- ../transmission-2.82/third-party/libnatpmp/getgateway.h\t2013-08-09 04:47:55.000000000 +0200\n+++ ./third-party/libnatpmp/getgateway.h\t2014-01-28 23:57:43.000000000 +0100\n@@ -40,6 +40,8 @@\n #endif\n #include \"declspec.h\"\n \n+#include <arpa/inet.h>\n+\n /* getdefaultgateway() :\n  * return value :\n  *    0 : success\ndiff -u -r ../transmission-2.82/third-party/libnatpmp/natpmp.c ./third-party/libnatpmp/natpmp.c\n--- ../transmission-2.82/third-party/libnatpmp/natpmp.c\t2013-08-09 04:47:55.000000000 +0200\n+++ ./third-party/libnatpmp/natpmp.c\t2014-01-28 23:56:20.000000000 +0100\n@@ -53,6 +53,8 @@\n #include \"natpmp.h\"\n #include \"getgateway.h\"\n \n+#include <arpa/inet.h>\n+\n LIBSPEC int initnatpmp(natpmp_t * p, int forcegw, in_addr_t forcedgw)\n {\n #ifdef WIN32\ndiff -u -r ../transmission-2.82/third-party/libnatpmp/natpmp.h ./third-party/libnatpmp/natpmp.h\n--- ../transmission-2.82/third-party/libnatpmp/natpmp.h\t2013-08-09 04:47:55.000000000 +0200\n+++ ./third-party/libnatpmp/natpmp.h\t2014-01-28 23:58:05.000000000 +0100\n@@ -51,6 +51,8 @@\n #include <netinet/in.h>\n #endif\n \n+#include <arpa/inet.h>\n+\n typedef struct {\n \tint s;\t/* socket */\n \tin_addr_t gateway;\t/* default gateway (IPv4) */\n"
  },
  {
    "path": "packages/transmission/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://transmissionbt.com/\nTERMUX_PKG_DESCRIPTION=\"Easy, lean and powerful BitTorrent client\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=2.94\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/transmission/transmission/archive/${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=440c2fd0f89b1ab59d8a4b79ecd7bffd61bc000e36fb5b6c8e88142a4fadbb1f\nTERMUX_PKG_DEPENDS=\"libcurl, libevent, miniupnpc, openssl\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-gtk --enable-lightweight --cache-file=termux_configure.cache\"\nTERMUX_PKG_CONFFILES=\"var/service/transmission/run var/service/transmission/log/run\"\n\ntermux_step_pre_configure() {\n\t./autogen.sh\n\t# liblog for android logging in syslog hack:\n\tLDFLAGS+=\" -llog\"\n\n\techo \"ac_cv_func_getmntent=no\" >> termux_configure.cache\n\techo \"ac_cv_search_getmntent=false\" >> termux_configure.cache\n\tchmod a-w termux_configure.cache\n}\n\ntermux_step_post_make_install() {\n\t# Setup transmission service script\n\tmkdir -p $TERMUX_PREFIX/var/service\n\tcd $TERMUX_PREFIX/var/service\n\tmkdir -p transmission/log\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > transmission/run\n\techo 'mkdir -p ~/torrent/torrent-files' >> transmission/run\n\techo 'mkdir -p ~/torrent/download' >> transmission/run\n\techo 'exec transmission-daemon \\' >> transmission/run\n\techo '    -f \\' >> transmission/run\n\techo '    -c ~/torrent/torrent-files \\' >> transmission/run\n\techo '    -w ~/torrent/download \\' >> transmission/run\n\techo '    2>&1' >> transmission/run\n\tchmod +x transmission/run\n\ttouch transmission/down\n\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > transmission/log/run\n\techo 'mkdir -p \"$LOGDIR/sv/transmission\"' >> transmission/log/run\n\techo 'exec svlogd \"$LOGDIR/sv/transmission\"' >> transmission/log/run\n\tchmod +x transmission/log/run\n}\n"
  },
  {
    "path": "packages/transmission/libtransmission-fdlimit.c.patch",
    "content": "diff -u -r ../transmission-2.92/libtransmission/fdlimit.c ./libtransmission/fdlimit.c\n--- ../transmission-2.92/libtransmission/fdlimit.c\t2015-10-23 21:35:22.638234970 -0400\n+++ ./libtransmission/fdlimit.c\t2016-03-07 20:32:58.075869242 -0500\n@@ -11,6 +11,7 @@\n #include <errno.h>\n #include <inttypes.h>\n #include <string.h>\n+#include <sys/select.h>\n \n #ifndef _WIN32\n  #include <sys/time.h> /* getrlimit */\n"
  },
  {
    "path": "packages/transmission/miniwget_min.patch",
    "content": "diff -u -r ../transmission-2.82/third-party/miniupnp/miniwget.c ./third-party/miniupnp/miniwget.c\n--- ../transmission-2.82/third-party/miniupnp/miniwget.c\t2013-08-09 04:47:50.000000000 +0200\n+++ ./third-party/miniupnp/miniwget.c\t2014-02-10 17:08:34.000000000 +0100\n@@ -42,7 +42,7 @@\n  * during the connect() call */\n #define MINIUPNPC_IGNORE_EINTR\n #endif /* #else _WIN32 */\n-#if defined(__sun) || defined(sun)\n+#if defined(__sun) || defined(sun) || defined __ANDROID__\n #define MIN(x,y) (((x)<(y))?(x):(y))\n #endif\n \n"
  },
  {
    "path": "packages/transmission/no_locale.patch",
    "content": "diff -u -r ../transmission-2.82/libtransmission/utils.c ./libtransmission/utils.c\n--- ../transmission-2.82/libtransmission/utils.c\t2013-08-09 04:45:40.000000000 +0200\n+++ ./libtransmission/utils.c\t2014-01-29 00:08:31.000000000 +0100\n@@ -1412,7 +1412,7 @@\n   char buf[128];\n   const int max_precision = (int) log10 (1.0 / DBL_EPSILON) - 1;\n   tr_snprintf (buf, sizeof (buf), \"%.*f\", max_precision, x);\n-  if ((pt = strstr (buf, localeconv ()->decimal_point)))\n+  if ((pt = strstr (buf, \".\")))\n     pt[precision ? precision+1 : 0] = '\\0';\n   return atof (buf);\n }\n"
  },
  {
    "path": "packages/transmission/no_quota.patch",
    "content": "diff -u -r ../transmission-2.82/libtransmission/platform-quota.c ./libtransmission/platform-quota.c\n--- ../transmission-2.82/libtransmission/platform-quota.c\t2013-08-09 04:45:44.000000000 +0200\n+++ ./libtransmission/platform-quota.c\t2014-02-10 17:07:13.000000000 +0100\n@@ -22,7 +22,7 @@\n   #include <ufs/ufs/quota.h> /* quotactl() */\n  #elif defined (__sun)\n   #include <sys/fs/ufs_quota.h> /* quotactl */\n- #else\n+ #elif !defined(__ANDROID__)\n   #include <sys/quota.h> /* quotactl() */\n  #endif\n  #ifdef HAVE_GETMNTENT\n@@ -71,7 +71,9 @@\n static const char *\n getdev (const char * path)\n {\n-#ifdef HAVE_GETMNTENT\n+#ifdef __ANDROID__\n+  return NULL;\n+#elif defined(HAVE_GETMNTENT)\n \n   FILE * fp;\n \n@@ -122,8 +124,9 @@\n static const char *\n getfstype (const char * device)\n {\n-\n-#ifdef HAVE_GETMNTENT\n+#ifdef __ANDROID__\n+  return NULL;\n+#elif defined(HAVE_GETMNTENT)\n \n   FILE * fp;\n #ifdef __sun\n@@ -198,6 +201,9 @@\n static int64_t\n getquota (const char * device)\n {\n+#ifdef __ANDROID__\n+  return -1;\n+#else\n   struct dqblk dq;\n   int64_t limit;\n   int64_t freespace;\n@@ -258,6 +264,7 @@\n #endif\n   /* something went wrong */\n   return -1;\n+#endif\n }\n \n #ifdef HAVE_XQM\n"
  },
  {
    "path": "packages/tree/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://mama.indstate.edu/users/ice/tree/\nTERMUX_PKG_DESCRIPTION=\"Recursive directory lister producing a depth indented listing of files\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Gert Scholten @gscholt\"\nTERMUX_PKG_VERSION=1.8.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=715d5d4b434321ce74706d0dd067505bb60c5ea83b5f0b3655dae40aa6f9b7c2\nTERMUX_PKG_SRCURL=http://mama.indstate.edu/users/ice/tree/src/tree-${TERMUX_PKG_VERSION}.tgz\nTERMUX_PKG_DEPENDS=\"libandroid-support\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\tmake \\\n\t\tCC=\"$CC\" \\\n\t\tCFLAGS=\"$CFLAGS $CPPFLAGS -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64\" \\\n\t\tLDFLAGS=\"$LDFLAGS\" \\\n\t\tOBJS=\"file.o tree.o unix.o html.o xml.o json.o hash.o color.o strverscmp.o\"\n}\n\ntermux_step_make_install() {\n\tmake install \\\n\t\tprefix=\"$TERMUX_PREFIX\" \\\n\t\tMANDIR=\"$TERMUX_PREFIX/share/man/man1\"\n}\n"
  },
  {
    "path": "packages/tree/tree.c.patch",
    "content": "diff -u -r ../tree-1.7.0/tree.c ./tree.c\n--- ../tree-1.7.0/tree.c\t2014-04-23 17:38:24.000000000 -0400\n+++ ./tree.c\t2016-03-23 10:54:14.212468421 -0400\n@@ -112,7 +112,7 @@\n   }\n \n /* Until I get rid of this hack, make it linux/cygwin/HP nonstop only: */\n-#if defined (LINUX) || defined (CYGWIN) || defined (__TANDEM)\n+#if defined (LINUX) || defined (CYGWIN) || defined (__TANDEM) || defined (__ANDROID__)\n   mb_cur_max = (int)MB_CUR_MAX;\n #else\n   mb_cur_max = 1;\n"
  },
  {
    "path": "packages/tsocks/00_patch_from_1.8beta5-9.2.patch",
    "content": "Description: Debian has carried this patch since 1.8beta5-9.2 release,\n I extracted it from upstream's source we distribute and keep it as patch\n I claim no ownership\nLast-update: 2016-11-07\nOrigin: vendor\n\ndiff --git a/parser.c b/parser.c\nindex 5b6d123..81245c8 100644\n--- a/parser.c\n+++ b/parser.c\n@@ -6,10 +6,13 @@\n \n #include <netinet/in.h>\n #include <sys/socket.h>\n+#include <sys/types.h>\n #include <arpa/inet.h>\n+#include <pwd.h>\n #include <string.h>\n #include <stdio.h>\n #include <stdlib.h>\n+#include <unistd.h>\n #include <errno.h>\n #include <config.h>\n #include \"common.h\"\n@@ -48,12 +51,11 @@ int read_config (char *filename, struct parsedfile *config) {\n \n \t/* If a filename wasn't provided, use the default */\n \tif (filename == NULL) {\n-\t\tstrncpy(line, CONF_FILE, sizeof(line) - 1);\n-\t\t/* Insure null termination */\n-\t\tline[sizeof(line) - 1] = (char) 0;\n-\t\tfilename = line;\n+\t\tfilename = find_config(line);\n \t}\n \n+\tshow_msg(MSGDEBUG, \"using %s as configuration file\\n\", line);\n+\n \t/* Read the configuration file */\n \tif ((conf = fopen(filename, \"r\")) == NULL) {\n \t\tshow_msg(MSGERR, \"Could not open socks configuration file \"\ndiff --git a/tsocks.8 b/tsocks.8\nindex e056460..9e46070 100644\n--- a/tsocks.8\n+++ b/tsocks.8\n@@ -34,13 +34,13 @@ manual page.\n \n .BR tsocks\n is a library to allow transparent SOCKS proxying. It wraps the normal\n-connect() function. When a connection is attempted, it consults the \n-configuration file (which is defined at configure time but defaults to \n-/etc/tsocks.conf) and determines if the IP address specified is local. If \n-it is not, the library redirects the connection to a SOCKS server\n-specified in the configuration file. It then negotiates that connection\n-with the SOCKS server and passes the connection back to the calling\n-program. \n+connect() function. When a connection is attempted, it consults the\n+configuration file (which is defined at configure time but defaults to\n+~/.tsocks.conf and if that file cannot be accessed, to /etc/tsocks.conf)\n+and determines if the IP address specified is local. If it is not, the\n+library redirects the connection to a SOCKS server specified in the\n+configuration file. It then negotiates that connection with the SOCKS\n+server and passes the connection back to the calling program.\n \n .BR tsocks \n is designed for use in machines which are firewalled from then\n@@ -59,7 +59,7 @@ Some configuration options can be specified at run time using environment\n variables as follows: \n \n .TP\n-.I TSOCKS_CONFFILE\n+.I TSOCKS_CONF_FILE\n This environment variable overrides the default location of the tsocks \n configuration file. This variable is not honored if the program tsocks\n is embedded in is setuid. In addition this environment variable can\ndiff --git a/tsocks.c b/tsocks.c\nindex 9cfdfff..0a16712 100644\n--- a/tsocks.c\n+++ b/tsocks.c\n@@ -289,11 +289,13 @@ int connect(CONNECT_SIGNATURE) {\n    show_msg(MSGDEBUG, \"Picked server %s for connection\\n\",\n             (path->address ? path->address : \"(Not Provided)\"));\n    if (path->address == NULL) {\n-      if (path == &(config->defaultserver)) \n+      if (path == &(config->defaultserver)) {\n          show_msg(MSGERR, \"Connection needs to be made \"\n                           \"via default server but \"\n                           \"the default server has not \"\n-                          \"been specified\\n\");\n+                          \"been specified. Falling back to direct connection.\\n\");\n+                          return(realconnect(__fd, __addr, __len));\n+   }\n       else \n          show_msg(MSGERR, \"Connection needs to be made \"\n                           \"via path specified at line \"\ndiff --git a/tsocks.conf.5 b/tsocks.conf.5\nindex ea7a3b3..a2a7959 100644\n--- a/tsocks.conf.5\n+++ b/tsocks.conf.5\n@@ -126,6 +126,15 @@ specified in the current path block should be used to access any IPs in the\n range 150.0.0.0 to 150.255.255.255 when the connection request is for ports\n 80-1024.\n \n+.TP\n+.I fallback\n+This directive allows to fall back to direct connection if no default\n+server present in the configuration and fallback = yes.\n+If fallback = no or not specified and there is no default server, the \n+tsocks gives an error message and aborts.\n+This parameter protects the user against accidentally establishing\n+unwanted unsockified (ie. direct) connection.\n+\n .SH UTILITIES\n tsocks comes with two utilities that can be useful in creating and verifying\n the tsocks configuration file. \n"
  },
  {
    "path": "packages/tsocks/01_symbolexport.patch",
    "content": "#! /bin/sh /usr/share/dpatch/dpatch-run\n## 01_symbolexport.dpatch by Nico Golde <nion@debian.org>\n##\n## All lines beginning with `## DP:' are a description of the patch.\n## DP: No description.\n\n--- a/common.c\n+++ b/common.c\n@@ -25,7 +25,8 @@ char logfilename[256];    /* Name of fil\n FILE *logfile = NULL;     /* File to which messages should be logged */\n int logstamp = 0;         /* Timestamp (and pid stamp) messages */\n \n-unsigned int resolve_ip(char *host, int showmsg, int allownames) {\n+unsigned int __attribute__ ((visibility (\"hidden\")))\n+resolve_ip(char *host, int showmsg, int allownames) {\n \tstruct hostent *new;\n \tunsigned int\thostaddr;\n \tstruct in_addr *ip;\n@@ -64,7 +65,8 @@ unsigned int resolve_ip(char *host, int\n /*             be logged instead of to standard error           */\n /*  timestamp - This indicates that messages should be prefixed */\n /*              with timestamps (and the process id)            */\n-void set_log_options(int level, char *filename, int timestamp) {\n+void __attribute__ ((visibility (\"hidden\")))\n+set_log_options(int level, char *filename, int timestamp) {\n \n    loglevel = level;\n    if (loglevel < MSGERR)\n@@ -78,7 +80,8 @@ void set_log_options(int level, char *fi\n    logstamp = timestamp;\n }\n \n-void show_msg(int level, char *fmt, ...) {\n+void __attribute__ ((visibility (\"hidden\")))\n+show_msg(int level, char *fmt, ...) {\n \tva_list ap;\n \tint saveerr;\n \textern char *progname;\n--- a/parser.c\n+++ b/parser.c\n@@ -36,7 +36,8 @@ static int handle_defuser(struct parsedf\n static int handle_defpass(struct parsedfile *, int, char *);\n static int make_netent(char *value, struct netent **ent);\n \n-int read_config (char *filename, struct parsedfile *config) {\n+int __attribute__ ((visibility (\"hidden\")))\n+read_config (char *filename, struct parsedfile *config) {\n \tFILE *conf;\n \tchar line[MAXLINE];\n \tint rc = 0;\n@@ -579,7 +580,8 @@ int make_netent(char *value, struct nete\n \treturn(0);\n }\n \n-int is_local(struct parsedfile *config, struct in_addr *testip) {\n+int __attribute__ ((visibility (\"hidden\")))\n+is_local(struct parsedfile *config, struct in_addr *testip) {\n         struct netent *ent;\n \n \tfor (ent = (config->localnets); ent != NULL; ent = ent -> next) {\n@@ -593,7 +595,8 @@ int is_local(struct parsedfile *config,\n }\n \n /* Find the appropriate server to reach an ip */\n-int pick_server(struct parsedfile *config, struct serverent **ent, \n+int __attribute__ ((visibility (\"hidden\")))\n+pick_server(struct parsedfile *config, struct serverent **ent, \n                 struct in_addr *ip, unsigned int port) {\n \tstruct netent *net;\t\n    char ipbuf[64];\n@@ -637,7 +640,8 @@ int pick_server(struct parsedfile *confi\n /* the start pointer is set to be NULL. The difference between      */\n /* standard strsep and this function is that this one will          */\n /* set *separator to the character separator found if it isn't null */\n-char *strsplit(char *separator, char **text, const char *search) {\n+char __attribute__ ((visibility (\"hidden\")))\n+*strsplit(char *separator, char **text, const char *search) {\n    int len;\n    char *ret;\n \n"
  },
  {
    "path": "packages/tsocks/02_hyphenfix.patch",
    "content": "#! /bin/sh /usr/share/dpatch/dpatch-run\n## 02_hyphenfix.dpatch by Nico Golde <nion@debian.org>\n##\n## All lines beginning with `## DP:' are a description of the patch.\n## DP: No description.\n\n--- a/tsocks.8\n+++ b/tsocks.8\n@@ -13,11 +13,11 @@ Set LD_PRELOAD to load the library then\n The syntax to force preload of the library for different shells is\n specified below:\n  \n-Bash, Ksh and Bourne shell -\n+Bash, Ksh and Bourne shell \\-\n \n export LD_PRELOAD=/lib/libtsocks.so\n \n-C Shell - \n+C Shell \\- \n \n setenv LD_PRELOAD=/lib/libtsocks.so\n \n@@ -52,7 +52,7 @@ the SOCKSified TCP/IP stacks seen on oth\n Most arguments to\n .BR tsocks\n are provided in the configuration file (the location of which is defined\n-at configure time by the --with-conf=<file> argument but defaults to\n+at configure time by the \\-\\-with\\-conf=<file> argument but defaults to\n /etc/tsocks.conf). The structure of this file is documented in tsocks.conf(8)\n \n Some configuration options can be specified at run time using environment\n@@ -63,7 +63,7 @@ variables as follows:\n This environment variable overrides the default location of the tsocks \n configuration file. This variable is not honored if the program tsocks\n is embedded in is setuid. In addition this environment variable can\n-be compiled out of tsocks with the --disable-envconf argument to \n+be compiled out of tsocks with the \\-\\-disable\\-envconf argument to \n configure at build time\n \n .TP\n@@ -73,10 +73,10 @@ generated by tsocks (debug output is gen\n standard error). If this variable is not present by default the logging \n level is set to 0 which indicates that only error messages should be output. \n Setting it to higher values will cause tsocks to generate more messages \n-describing what it is doing. If set to -1 tsocks will output absolutely no \n+describing what it is doing. If set to \\-1 tsocks will output absolutely no \n error or debugging messages. This is only needed if tsocks output interferes \n with a program it is embedded in. Message output can be permanently compiled \n-out of tsocks by specifying the --disable-debug option to configure at \n+out of tsocks by specifying the \\-\\-disable\\-debug option to configure at \n build time\n \n .TP\n@@ -85,7 +85,7 @@ This option can be used to redirect the\n be sent to standard error) to a file. This variable is not honored if the \n program tsocks is embedded in is setuid. For programs where tsocks output \n interferes with normal operation this option is generally better than \n-disabling messages (with TSOCKS_DEBUG = -1)\n+disabling messages (with TSOCKS_DEBUG = \\-1)\n \n .TP\n .I TSOCKS_USERNAME\n@@ -115,8 +115,8 @@ consult the INSTALL file for more inform\n .BR tsocks\n will generate error messages and print them to stderr when there are\n problems with the configuration file or the SOCKS negotiation with the\n-server if the TSOCKS_DEBUG environment variable is not set to -1 or and\n---disable-debug was not specified at compile time. This output may cause\n+server if the TSOCKS_DEBUG environment variable is not set to \\-1 or and\n+\\-\\-disable\\-debug was not specified at compile time. This output may cause\n some problems with programs that redirect standard error.\n \n .SS CAVEATS\n@@ -157,12 +157,12 @@ not. This introduces overhead and should\n .BR tsocks \n uses ELF dynamic loader features to intercept dynamic function calls from\n programs in which it is embedded.  As a result, it cannot trace the \n-actions of statically linked executables, non-ELF executables, or \n+actions of statically linked executables, non\\-ELF executables, or \n executables that make system calls directly with the system call trap or \n through the syscall() routine.\n \n .SH FILES\n-/etc/tsocks.conf - default tsocks configuration file\n+/etc/tsocks.conf \\- default tsocks configuration file\n \n .SH SEE ALSO\n tsocks.conf(5)\n--- a/tsocks.conf.5\n+++ b/tsocks.conf.5\n@@ -66,7 +66,7 @@ The following directives are used in the\n .I server\n The IP address of the SOCKS server (e.g \"server = 10.1.4.253\"). Only one\n server may be specified per path block, or one outside a path\n-block (to define the default server). Unless --disable-hostnames was \n+block (to define the default server). Unless \\-\\-disable\\-hostnames was \n specified to configure at compile time the server can be specified as \n a hostname (e.g \"server = socks.nec.com\") \n \n@@ -118,13 +118,13 @@ local, otherwise tsocks would need a SOC\n .TP\n .I reaches\n This directive is only valid inside a path block. Its parameter is formed\n-as IP[:startport[-endport]]/Subnet and it specifies a network (and a range\n+as IP[:startport[\\-endport]]/Subnet and it specifies a network (and a range\n of ports on that network) that can be accessed by the SOCKS server specified\n in this path block. For example, in a path block \"reaches =\n-150.0.0.0:80-1024/255.0.0.0\" indicates to tsocks that the SOCKS server \n+150.0.0.0:80\\-1024/255.0.0.0\" indicates to tsocks that the SOCKS server \n specified in the current path block should be used to access any IPs in the \n range 150.0.0.0 to 150.255.255.255 when the connection request is for ports\n-80-1024.\n+80\\-1024.\n \n .TP\n .I fallback\n@@ -155,12 +155,12 @@ the configuration to the screen in a for\n extremely useful in debugging problems.\n \n validateconf can read a configuration file from a location other than the \n-location specified at compile time with the -f <filename> command line \n+location specified at compile time with the \\-f <filename> command line \n option.\n \n Normally validateconf simply dumps the configuration read to the screen (in\n a nicely readable format), however it also has a useful 'test' mode. When\n-passed a hostname/ip on the command line like -t <hostname/ip>, validateconf \n+passed a hostname/ip on the command line like \\-t <hostname/ip>, validateconf \n determines which of the SOCKS servers specified in the configuration file \n would be used by tsocks to access the specified host. \n \n"
  },
  {
    "path": "packages/tsocks/03_fixloop.patch",
    "content": "#! /bin/sh /usr/share/dpatch/dpatch-run\n## 03_fixloop.dpatch by Nico Golde <nion@debian.org>\n##\n## All lines beginning with `## DP:' are a description of the patch.\n## DP: No description.\n\n--- a/tsocks.c\n+++ b/tsocks.c\n@@ -990,6 +990,10 @@ static int recv_buffer(struct connreq *c\n       if (rc > 0) {\n          conn->datadone += rc;\n          rc = 0;\n+      } else if (rc == 0) {\n+         show_msg(MSGDEBUG, \"Peer has shutdown but we only read %d of %d bytes.\\n\",\n+            conn->datadone, conn->datalen);\n+         rc = ENOTCONN; /* ENOTCONN seems like the most fitting error message */\n       } else {\n          if (errno != EWOULDBLOCK)\n             show_msg(MSGDEBUG, \"Read failed, %s\\n\", strerror(errno));\n"
  },
  {
    "path": "packages/tsocks/04_getpeername.patch",
    "content": "#! /bin/sh /usr/share/dpatch/dpatch-run\n## 04_getpeername.dpatch by Nico Golde <nion@debian.org>\n##\n## All lines beginning with `## DP:' are a description of the patch.\n## DP: No description.\n\n--- a/acconfig.h\n+++ b/acconfig.h\n@@ -43,6 +43,9 @@ allows socksified DNS */\n /* Prototype and function header for close function */\n #undef CLOSE_SIGNATURE\n \n+/* Prototype and function header for getpeername function */\n+#undef GETPEERNAME_SIGNATURE\n+\n /* Work out which function we have for conversion from string IPs to \n numerical ones */\n #undef HAVE_INET_ADDR\n--- a/config.h.in\n+++ b/config.h.in\n@@ -46,6 +46,9 @@ allows socksified DNS */\n /* Prototype and function header for close function */\n #undef CLOSE_SIGNATURE\n \n+/* Prototype and function header for close function */\n+#undef GETPEERNAME_SIGNATURE\n+\n /* Work out which function we have for conversion from string IPs to \n numerical ones */\n #undef HAVE_INET_ADDR\n--- a/configure\n+++ b/configure\n@@ -2225,14 +2225,60 @@ cat >> confdefs.h <<EOF\n EOF\n \n \n+\n+echo $ac_n \"checking for correct getpeername prototype\"\"... $ac_c\" 1>&6\n+echo \"configure:2231: checking for correct getpeername prototype\" >&5\n+PROTO=\n+PROTO1='int __fd, const struct sockaddr * __name, int *__namelen'\n+PROTO2='int __fd, const struct sockaddr_in * __name, socklen_t *__namelen'\n+PROTO3='int __fd, struct sockaddr * __name, socklen_t *__namelen'\n+PROTO4='int __fd, const struct sockaddr * __name, socklen_t *__namelen'\n+for testproto in \"${PROTO1}\" \\\n+                 \"${PROTO2}\" \\\n+                 \"${PROTO3}\" \\\n+                 \"${PROTO4}\" \n+do\n+  if test \"${PROTO}\" = \"\"; then\n+    cat > conftest.$ac_ext <<EOF\n+#line 2244 \"configure\"\n+#include \"confdefs.h\"\n+\n+      #include <sys/socket.h>\n+      int getpeername($testproto);\n+    \n+int main() {\n+\n+; return 0; }\n+EOF\n+if { (eval echo configure:2254: \\\"$ac_compile\\\") 1>&5; (eval $ac_compile) 2>&5; }; then\n+  rm -rf conftest*\n+  PROTO=\"$testproto\";\n+else\n+  echo \"configure: failed program was:\" >&5\n+  cat conftest.$ac_ext >&5\n+fi\n+rm -f conftest*\n+  fi\n+done\n+if test \"${PROTO}\" = \"\"; then\n+  { echo \"configure: error: \"no match found!\"\" 1>&2; exit 1; }\n+fi\n+echo \"$ac_t\"\"getpeername(${PROTO})\" 1>&6\n+cat >> confdefs.h <<EOF\n+#define GETPEERNAME_SIGNATURE ${PROTO}\n+EOF\n+\n+\n+\n+\n echo $ac_n \"checking for correct poll prototype\"\"... $ac_c\" 1>&6\n-echo \"configure:2230: checking for correct poll prototype\" >&5\n+echo \"configure:2276: checking for correct poll prototype\" >&5\n PROTO=\n for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' \n do\n   if test \"${PROTO}\" = \"\"; then\n     cat > conftest.$ac_ext <<EOF\n-#line 2236 \"configure\"\n+#line 2282 \"configure\"\n #include \"confdefs.h\"\n \n       #include <sys/poll.h>\n@@ -2242,7 +2288,7 @@ int main() {\n \n ; return 0; }\n EOF\n-if { (eval echo configure:2246: \\\"$ac_compile\\\") 1>&5; (eval $ac_compile) 2>&5; }; then\n+if { (eval echo configure:2292: \\\"$ac_compile\\\") 1>&5; (eval $ac_compile) 2>&5; }; then\n   rm -rf conftest*\n   PROTO=\"$testproto\";\n else\n--- a/configure.in\n+++ b/configure.in\n@@ -309,6 +309,34 @@ fi\n AC_MSG_RESULT([close(${PROTO})])\n AC_DEFINE_UNQUOTED(CLOSE_SIGNATURE, [${PROTO}])\n \n+\n+dnl Find the correct getpeername prototype on this machine \n+AC_MSG_CHECKING(for correct getpeername prototype)\n+PROTO=\n+PROTO1='int __fd, const struct sockaddr * __name, int *__namelen'\n+PROTO2='int __fd, const struct sockaddr_in * __name, socklen_t *__namelen'\n+PROTO3='int __fd, struct sockaddr * __name, socklen_t *__namelen'\n+PROTO4='int __fd, const struct sockaddr * __name, socklen_t *__namelen'\n+for testproto in \"${PROTO1}\" \\\n+                 \"${PROTO2}\" \\\n+                 \"${PROTO3}\" \\\n+                 \"${PROTO4}\" \n+do\n+  if test \"${PROTO}\" = \"\"; then\n+    AC_TRY_COMPILE([\n+      #include <sys/socket.h>\n+      int getpeername($testproto);\n+    ],,[PROTO=\"$testproto\";],)\n+  fi\n+done\n+if test \"${PROTO}\" = \"\"; then\n+  AC_MSG_ERROR(\"no match found!\")\n+fi\n+AC_MSG_RESULT([getpeername(${PROTO})])\n+AC_DEFINE_UNQUOTED(GETPEERNAME_SIGNATURE, [${PROTO}])\n+\n+\n+\n dnl Find the correct poll prototype on this machine \n AC_MSG_CHECKING(for correct poll prototype)\n PROTO=\n--- a/tsocks.c\n+++ b/tsocks.c\n@@ -62,6 +62,7 @@ static int (*realconnect)(CONNECT_SIGNAT\n static int (*realselect)(SELECT_SIGNATURE);\n static int (*realpoll)(POLL_SIGNATURE);\n static int (*realclose)(CLOSE_SIGNATURE);\n+static int (*realgetpeername)(GETPEERNAME_SIGNATURE);\n static struct parsedfile *config;\n static struct connreq *requests = NULL;\n static int suid = 0;\n@@ -73,6 +74,7 @@ int connect(CONNECT_SIGNATURE);\n int select(SELECT_SIGNATURE);\n int poll(POLL_SIGNATURE);\n int close(CLOSE_SIGNATURE);\n+int getpeername(GETPEERNAME_SIGNATURE);\n #ifdef USE_SOCKS_DNS\n int res_init(void);\n #endif\n@@ -109,14 +111,15 @@ void _init(void) {\n \t/* most programs that are run won't use our services, so     */\n \t/* we do our general initialization on first call            */\n \n-   /* Determine the logging level */\n-   suid = (getuid() != geteuid());\n+\t/* Determine the logging level */\n+\tsuid = (getuid() != geteuid());\n \n #ifndef USE_OLD_DLSYM\n \trealconnect = dlsym(RTLD_NEXT, \"connect\");\n \trealselect = dlsym(RTLD_NEXT, \"select\");\n \trealpoll = dlsym(RTLD_NEXT, \"poll\");\n \trealclose = dlsym(RTLD_NEXT, \"close\");\n+\trealgetpeername = dlsym(RTLD_NEXT, \"getpeername\");\n \t#ifdef USE_SOCKS_DNS\n \trealresinit = dlsym(RTLD_NEXT, \"res_init\");\n \t#endif\n@@ -125,14 +128,15 @@ void _init(void) {\n \trealconnect = dlsym(lib, \"connect\");\n \trealselect = dlsym(lib, \"select\");\n \trealpoll = dlsym(lib, \"poll\");\n+\trealgetpeername = dlsym(lib, \"getpeername\");\n \t#ifdef USE_SOCKS_DNS\n \trealresinit = dlsym(lib, \"res_init\");\n \t#endif\n-\tdlclose(lib);\t\n+\tdlclose(lib);\n \n \tlib = dlopen(LIBC, RTLD_LAZY);\n-   realclose = dlsym(lib, \"close\");\n-\tdlclose(lib);\t\n+\trealclose = dlsym(lib, \"close\");\n+\tdlclose(lib);\n #endif\n }\n \n@@ -350,8 +354,10 @@ int select(SELECT_SIGNATURE) {\n \n    /* If we're not currently managing any requests we can just \n     * leave here */\n-   if (!requests)\n+   if (!requests) {\n+      show_msg(MSGDEBUG, \"No requests waiting, calling real select\\n\");\n       return(realselect(n, readfds, writefds, exceptfds, timeout));\n+   }\n \n    get_environment();\n \n@@ -705,6 +711,50 @@ int close(CLOSE_SIGNATURE) {\n    return(rc);\n }\n \n+/* If we are not done setting up the connection yet, return\n+ * -1 and ENOTCONN, otherwise call getpeername\n+ *\n+ * This is necessary since some applications, when using non-blocking connect,\n+ * (like ircII) use getpeername() to find out if they are connected already.\n+ *\n+ * This results in races sometimes, where the client sends data to the socket\n+ * before we are done with the socks connection setup.  Another solution would\n+ * be to intercept send().\n+ * \n+ * This could be extended to actually set the peername to the peer the\n+ * client application has requested, but not for now.\n+ *\n+ * PP, Sat, 27 Mar 2004 11:30:23 +0100\n+ */\n+int getpeername(GETPEERNAME_SIGNATURE) {\n+   struct connreq *conn;\n+   int rc;\n+\n+    if (realgetpeername == NULL) {\n+        show_msg(MSGERR, \"Unresolved symbol: getpeername\\n\");\n+        return(-1);\n+    }\n+\n+   show_msg(MSGDEBUG, \"Call to getpeername for fd %d\\n\", __fd);\n+\n+\n+   rc = realgetpeername(__fd, __name, __namelen);\n+   if (rc == -1)\n+       return rc;\n+\n+   /* Are we handling this connect? */\n+   if ((conn = find_socks_request(__fd, 1))) {\n+       /* While we are at it, we might was well try to do something useful */\n+       handle_request(conn);\n+\n+       if (conn->state != DONE) {\n+           errno = ENOTCONN;\n+           return(-1);\n+       }\n+   }\n+   return rc;\n+}\n+\n static struct connreq *new_socks_request(int sockid, struct sockaddr_in *connaddr, \n                                          struct sockaddr_in *serveraddr, \n                                          struct serverent *path) {\n@@ -854,7 +904,7 @@ static int connect_server(struct connreq\n                     sizeof(conn->serveraddr));\n \n    show_msg(MSGDEBUG, \"Connect returned %d, errno is %d\\n\", rc, errno); \n-\tif (rc) {\n+   if (rc) {\n       if (errno != EINPROGRESS) {\n          show_msg(MSGERR, \"Error %d attempting to connect to SOCKS \"\n                   \"server (%s)\\n\", errno, strerror(errno));\n"
  },
  {
    "path": "packages/tsocks/05_config_in_home.patch",
    "content": "#! /bin/sh /usr/share/dpatch/dpatch-run\n## 05_config_in_home.dpatch by Reinhard Tartler <siretart@tauware.de>\n##\n## All lines beginning with `## DP:' are a description of the patch.\n## DP: Additionally search for the configuration file in user home directory\n\ndiff -urNad tsocks-1.8beta5~/parser.c tsocks-1.8beta5/parser.c\n--- tsocks-1.8beta5~/parser.c\t2008-03-03 14:05:14.000000000 +0100\n+++ tsocks-1.8beta5/parser.c\t2008-03-03 14:05:36.000000000 +0100\n@@ -36,6 +36,32 @@\n static int handle_defpass(struct parsedfile *, int, char *);\n static int make_netent(char *value, struct netent **ent);\n \n+char __attribute__ ((visibility (\"hidden\")))\n+*find_config(char *line) {\n+\tstruct passwd* pw;\n+\n+\terrno = 0;\n+\n+\tpw = getpwuid(getuid());\n+\tif (errno) {\n+\t\tperror(\"getpwuid\");\n+\t\treturn NULL;\n+\t}\n+\n+\t/* check for config in $HOME */\n+\tsnprintf(line, MAXLINE - 1, \"%s/.tsocks.conf\", pw->pw_dir);\n+\n+\tif (access(line, R_OK)) {\n+\t\tshow_msg(MSGDEBUG, \"Can't access %s, using \" CONF_FILE \" instead.\\n\", line);\n+\t\tstrncpy(line, CONF_FILE, MAXLINE - 1);\n+\t}\n+\n+\t/* Insure null termination */\n+\tline[MAXLINE - 1] = (char) 0;\n+\n+\treturn line;\n+}\n+\n int __attribute__ ((visibility (\"hidden\")))\n read_config (char *filename, struct parsedfile *config) {\n \tFILE *conf;\n"
  },
  {
    "path": "packages/tsocks/06_fallback.patch",
    "content": "#! /bin/sh /usr/share/dpatch/dpatch-run\n## 06_fallback.dpatch by Tamas SZERB <toma@rulez.org>\n##\n## All lines beginning with `## DP:' are a description of the patch.\n## DP: Establish direct connection instead of sockified if\n## DP: there is no default server specified and the\n## DP: fallback = yes.\n\n--- a/parser.h\n+++ b/parser.h\n@@ -33,6 +33,7 @@ struct parsedfile {\n    struct netent *localnets;\n    struct serverent defaultserver;\n    struct serverent *paths;\n+   int fallback;\n };\n \n /* Functions provided by parser module */\n--- a/parser.c\n+++ b/parser.c\n@@ -35,6 +35,7 @@ static int handle_local(struct parsedfil\n static int handle_defuser(struct parsedfile *, int, char *);\n static int handle_defpass(struct parsedfile *, int, char *);\n static int make_netent(char *value, struct netent **ent);\n+static int handle_fallback(struct parsedfile *, int, char *);\n \n char __attribute__ ((visibility (\"hidden\")))\n *find_config(char *line) {\n@@ -181,6 +182,8 @@ static int handle_line(struct parsedfile\n \t\t\t\thandle_defpass(config, lineno, words[2]);\n \t\t\t} else if (!strcmp(words[0], \"local\")) {\n \t\t\t\thandle_local(config, lineno, words[2]);\n+\t\t\t} else if (!strcmp(words[0], \"fallback\")) {\n+\t\t\t\thandle_fallback(config, lineno, words[2]);\n \t\t\t} else {\n \t\t\t\tshow_msg(MSGERR, \"Invalid pair type (%s) specified \"\n \t\t\t\t\t   \"on line %d in configuration file, \"\n@@ -512,6 +515,19 @@ static int handle_local(struct parsedfil\n \treturn(0);\n }\n \n+static int handle_fallback(struct parsedfile *config, int lineno, char *value) {\n+\tchar *v = strsplit(NULL, &value, \" \");\n+\tif (config->fallback !=0) {\n+\t\tshow_msg(MSGERR, \"Fallback may only be specified \"\n+\t\t\t\t\"once in configuration file.\\n\",\n+\t\t\t\tlineno, currentcontext->lineno);\n+\t} else {\n+\t\tif(!strcmp(v, \"yes\")) config->fallback = 1;\n+\t\tif(!strcmp(v, \"no\")) config->fallback = 0;\n+\t}\n+\treturn(0);\n+}\n+\n /* Construct a netent given a string like                             */\n /* \"198.126.0.1[:portno[-portno]]/255.255.255.0\"                      */\n int make_netent(char *value, struct netent **ent) {\n--- a/tsocks.c\n+++ b/tsocks.c\n@@ -294,11 +294,20 @@ int connect(CONNECT_SIGNATURE) {\n             (path->address ? path->address : \"(Not Provided)\"));\n    if (path->address == NULL) {\n       if (path == &(config->defaultserver)) {\n-         show_msg(MSGERR, \"Connection needs to be made \"\n-                          \"via default server but \"\n-                          \"the default server has not \"\n-                          \"been specified. Falling back to direct connection.\\n\");\n-                          return(realconnect(__fd, __addr, __len));\n+         if (config->fallback) {\n+            show_msg(MSGERR, \"Connection needs to be made \"\n+                             \"via default server but \"\n+                             \"the default server has not \"\n+                             \"been specified. Fallback is 'yes' so \"\n+                             \"Falling back to direct connection.\\n\");\n+            return(realconnect(__fd, __addr, __len));\n+         } else {\n+           show_msg(MSGERR, \"Connection needs to be made \"\n+                            \"via default server but \"\n+                            \"the default server has not \"\n+                            \"been specified. Fallback is 'no' so \"\n+                            \"coudln't establish the connection.\\n\");\n+         }\n    }\n       else \n          show_msg(MSGERR, \"Connection needs to be made \"\n--- a/tsocks.conf.5\n+++ b/tsocks.conf.5\n@@ -135,6 +135,15 @@ tsocks gives an error message and aborts\n This parameter protects the user against accidentally establishing\n unwanted unsockified (ie. direct) connection.\n \n+.TP\n+.I fallback\n+This directive allows to fall back to direct connection if no default\n+server present in the configuration and fallback = yes.\n+If fallback = no or not specified and there is no default server, the \n+tsocks gives an error message and aborts.\n+This parameter protects the user against accidentally establishing\n+unwanted unsockified (ie. direct) connection.\n+\n .SH UTILITIES\n tsocks comes with two utilities that can be useful in creating and verifying\n the tsocks configuration file. \n"
  },
  {
    "path": "packages/tsocks/07_tsocks-1.8_beta5-hostname-config-fix.patch",
    "content": "#! /bin/sh /usr/share/dpatch/dpatch-run\n## 07_tsocks-1.8_beta5-hostname-config-fix.patch by https://sourceforge.net/u/phobosk/profile/\n##\n## All lines beginning with `## DP:' are a description of the patch.\n## DP: Enable host name resolution on /etc/tsocks.conf at configure time,\n## DP: this was intended to be enabled in previous releases, but a bug in the configure script\n## DP: made it impossible\n## DP: Poor's man DEP3 headers\n## DP: Origin: https://sourceforge.net/p/tsocks/bugs/27/\n## DP: Last-Update: 2016-10-28\n\n--- tsocks-1.8.orig/configure.in\n+++ tsocks-1.8/configure.in\n@@ -171,8 +171,8 @@\n   AC_DEFINE(ALLOW_MSG_OUTPUT)\n fi\n \n-if test \"x${enable_hostnames}\" = \"x\"; then\n-  AC_DEFINE(HOSTNAMES)\n+if test \"${enable_hostnames}\" = \"yes\"; then\n+  AC_DEFINE(HOSTNAMES,1)\n fi\n \n if test \"${enable_socksdns}\" = \"yes\" -a \\\n"
  },
  {
    "path": "packages/tsocks/08_manpages-fixes.patch",
    "content": "Description: this patch fixes spelling and formating fixes on tsocks.conf(5)\n manpage\nLast-update: 2016-11-07\nOrigin: vendor\nAuthor: gustavo panizzo <gfa@zumbi.com.ar>\n\n--- a/tsocks.conf.5\n+++ b/tsocks.conf.5\n@@ -22,7 +22,7 @@ Obviously if a connection is not to a lo\n to be proxied over a SOCKS server. However, many installations have several\n different SOCKS servers to be used to access different internal (and external)\n networks. For this reason the configuration file allows the definition of \n-'paths' as well as a default SOCKS server. \n+\\'paths\\' as well as a default SOCKS server.\n \n Paths are declared as blocks in the configuration file. That is, they begin\n with a 'path {' line in the configuration file and end with a '}' line. Inside\n@@ -128,21 +128,15 @@ range 150.0.0.0 to 150.255.255.255 when\n \n .TP\n .I fallback\n-This directive allows to fall back to direct connection if no default\n+This directive allows one to fall back to direct connection if no default\n server present in the configuration and fallback = yes.\n If fallback = no or not specified and there is no default server, the \n tsocks gives an error message and aborts.\n This parameter protects the user against accidentally establishing\n unwanted unsockified (ie. direct) connection.\n \n-.TP\n-.I fallback\n-This directive allows to fall back to direct connection if no default\n-server present in the configuration and fallback = yes.\n-If fallback = no or not specified and there is no default server, the \n-tsocks gives an error message and aborts.\n-This parameter protects the user against accidentally establishing\n-unwanted unsockified (ie. direct) connection.\n+.SH CONFIGURATION FILE SEARCH ORDER\n+tsocks will search first for $HOME/.tsocks.conf then /etc/tsocks.conf\n \n .SH UTILITIES\n tsocks comes with two utilities that can be useful in creating and verifying\n"
  },
  {
    "path": "packages/tsocks/10_hardening.patch",
    "content": "Description: this patch enabled hardened build\nLast-update: 2016-11-07\nOrigin: vendor\nAuthor: gustavo panizzo <gfa@zumbi.com.ar>\n\nIndex: tsocks-1.8beta5+ds1/Makefile.in\n===================================================================\n--- tsocks-1.8beta5+ds1.orig/Makefile.in\n+++ tsocks-1.8beta5+ds1/Makefile.in\n@@ -28,6 +28,8 @@\n INSTALL = @INSTALL@\n INSTALL_DATA = @INSTALL_DATA@\n CFLAGS = @CFLAGS@\n+CPPFAGS = @CPPFLAGS@\n+LDFLAGS = @LDFLAGS@\n INCLUDES = -I.\n LIBS = @LIBS@\n SPECIALLIBS = @SPECIALLIBS@\n@@ -41,23 +43,23 @@\n all: ${TARGETS}\n \n ${VALIDATECONF}: ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o\n-\t${SHCC} ${CFLAGS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o ${LIBS}\n+\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o ${LIBS}\n \n ${INSPECT}: ${INSPECT}.c ${COMMON}.o\n-\t${SHCC} ${CFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS} \n+\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS}\n \n ${SAVE}: ${SAVE}.c\n-\t${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c\n+\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c\n \n ${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o\n-\t${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}\n+\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -Wl,-soname,libtsocks.so.1 -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}\n \tln -sf ${SHLIB} ${LIB_NAME}.so\n \n %.so: %.c\n-\t${SHCC} ${CFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@\n+\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@\n \n %.o: %.c\n-\t${SHCC} ${CFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@\n+\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${INCLUDES} -c ${CC_SWITCHES} $< -o $@\n \n install: ${TARGETS} installscript installlib installman\n \n"
  },
  {
    "path": "packages/tsocks/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://tsocks.sf.net\nTERMUX_PKG_DESCRIPTION=\"transparent network access through a SOCKS 4 or 5 proxy\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.8beta5\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/tsocks/tsocks/1.8%20beta%205/tsocks-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=849d7ef5af80d03e76cc05ed9fb8fa2bcc2b724b51ebfd1b6be11c7863f5b347\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\" --with-conf=$TERMUX_PREFIX/etc/tsocks.conf\"\n\ntermux_step_post_extract_package() {\n\tcp $TERMUX_PKG_SRCDIR/tsocks-1.8/* $TERMUX_PKG_SRCDIR/\n}\n\ntermux_step_pre_configure() {\n\tcp $TERMUX_PKG_SRCDIR/tsocks.conf.complex.example $TERMUX_PREFIX/etc/tsocks.conf\n}\n"
  },
  {
    "path": "packages/tsocks/configure.patch",
    "content": "diff --git a/configure b/configure\nindex 78e120d..80e5418 100755\n--- a/configure\n+++ b/configure\n@@ -53,11 +53,11 @@ datadir='${prefix}/share'\n sysconfdir='${prefix}/etc'\n sharedstatedir='${prefix}/com'\n localstatedir='${prefix}/var'\n-libdir='${exec_prefix}/lib'\n+libdir='${prefix}/lib'\n includedir='${prefix}/include'\n oldincludedir='/usr/include'\n infodir='${prefix}/info'\n-mandir='${prefix}/man'\n+mandir='${prefix}/share/man'\n \n # Initialize some other variables.\n subdirs=\n@@ -2137,7 +2137,7 @@ EOF\n echo $ac_n \"checking for correct connect prototype\"\"... $ac_c\" 1>&6\n echo \"configure:2139: checking for correct connect prototype\" >&5\n PROTO=\n-PROTO1='int __fd, const struct sockaddr * __addr, int len'\n+PROTO1='int __fd, const struct sockaddr * __addr, int __len'\n PROTO2='int __fd, const struct sockaddr_in * __addr, socklen_t __len'\n PROTO3='int __fd, struct sockaddr * __addr, int __len'\n PROTO4='int __fd, const struct sockaddr * __addr, socklen_t __len'\n@@ -2228,7 +2228,8 @@ EOF\n echo $ac_n \"checking for correct poll prototype\"\"... $ac_c\" 1>&6\n echo \"configure:2230: checking for correct poll prototype\" >&5\n PROTO=\n-for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' \n+# https://sourceforge.net/p/tsocks/support-requests/6/\n+for testproto in 'struct pollfd *ufds, nfds_t nfds, int timeout'\n do\n   if test \"${PROTO}\" = \"\"; then\n     cat > conftest.$ac_ext <<EOF\n"
  },
  {
    "path": "packages/tsocks/no-static-linking.patch",
    "content": "diff -uNr tsocks-1.8/Makefile.in tsocks-1.8.mod/Makefile.in\n--- tsocks-1.8/Makefile.in\t2019-08-16 03:45:14.838316083 +0300\n+++ tsocks-1.8.mod/Makefile.in\t2019-08-16 03:45:33.711794904 +0300\n@@ -49,7 +49,7 @@\n \t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ${LIBS}\n \n ${SAVE}: ${SAVE}.c\n-\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c\n+\t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -o ${SAVE} ${SAVE}.c\n \n ${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o\n \t${SHCC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${INCLUDES} -Wl,-soname,libtsocks.so.1 -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}\n"
  },
  {
    "path": "packages/tsocks/tsocks.c.patch",
    "content": "diff --git a/tsocks.c b/tsocks.c\nindex 9cfdfff..5518633 100644\n--- a/tsocks.c\n+++ b/tsocks.c\n@@ -682,6 +682,11 @@ int close(CLOSE_SIGNATURE) {\n    int rc;\n    struct connreq *conn;\n \n+    /*Sometimes this function seems to get called before _init has run*/\n+\tif (realclose == NULL) {\n+        _init();\n+    }\n+\n \tif (realclose == NULL) {\n \t\tshow_msg(MSGERR, \"Unresolved symbol: close\\n\");\n \t\treturn(-1);\n"
  },
  {
    "path": "packages/tsocks/tsocks.patch",
    "content": "diff --git a/tsocks b/tsocks\nindex 8380d9c..7d1df7a 100755\n--- a/tsocks\n+++ b/tsocks\n@@ -46,14 +46,14 @@ case \"$1\" in\n \ton)\n \t\tif [ -z \"$LD_PRELOAD\" ]\n \t\t\tthen\n-\t\t\t\texport LD_PRELOAD=\"/usr/lib/libtsocks.so\"\n+\t\t\t\texport LD_PRELOAD=\"$PREFIX/lib/libtsocks.so\"\n \t\t\telse\n-\t\t\t\techo $LD_PRELOAD | grep -q \"/usr/lib/libtsocks\\.so\" || \\\n-\t\t\t\texport LD_PRELOAD=\"/usr/lib/libtsocks.so $LD_PRELOAD\"\n+\t\t\t\techo $LD_PRELOAD | grep -q \"$PREFIX/lib/libtsocks\\.so\" || \\\n+\t\t\t\texport LD_PRELOAD=\"$PREFIX/lib/libtsocks.so $LD_PRELOAD\"\n \t\tfi\n \t;;\n \toff)\n-\t\texport LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\\/usr\\/lib\\/libtsocks.so \\?//'`\n+\t\texport LD_PRELOAD=`echo -n $LD_PRELOAD | sed \"s:$PREFIX/lib/libtsocks.so *::\"`\n \t\tif [ -z \"$LD_PRELOAD\" ]\n \t\t\tthen\n \t\t\t\tunset LD_PRELOAD\n@@ -68,15 +68,15 @@ case \"$1\" in\n \t*)\n \t\tif [ -z \"$LD_PRELOAD\" ]\n \t\tthen\n-\t\t\texport LD_PRELOAD=\"/usr/lib/libtsocks.so\"\n+\t\t\texport LD_PRELOAD=\"$PREFIX/lib/libtsocks.so\"\n \t\telse\n-\t\t\techo $LD_PRELOAD | grep -q \"/usr/lib/libtsocks\\.so\" || \\\n-\t\t\texport LD_PRELOAD=\"/usr/lib/libtsocks.so $LD_PRELOAD\"\n+\t\t\techo $LD_PRELOAD | grep -q \"$PREFIX/lib/libtsocks\\.so\" || \\\n+\t\t\texport LD_PRELOAD=\"$PREFIX/lib/libtsocks.so $LD_PRELOAD\"\n \t\tfi\n \n \t\tif [ $# = 0 ]\n \t\tthen\n-\t\t\t${SHELL:-/bin/sh}\n+\t\t\t${SHELL:-$PREFIX/bin/sh}\n \t\tfi\n \n \t\tif [ $# -gt 0 ]\n"
  },
  {
    "path": "packages/tsu/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/cswl/tsu\nTERMUX_PKG_DESCRIPTION=\"A su wrapper for Termux\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_VERSION=2.3\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_extract_package() {\n\tlocal CHECKED_OUT_FOLDER=$TERMUX_PKG_CACHEDIR/tsu-checkout-$TERMUX_PKG_VERSION\n\tif [ ! -d $CHECKED_OUT_FOLDER ]; then\n\t\tlocal TMP_CHECKOUT=$TERMUX_PKG_TMPDIR/tmp-checkout\n\t\trm -Rf $TMP_CHECKOUT\n\t\tmkdir -p $TMP_CHECKOUT\n\n\t\tgit clone --depth 1 \\\n\t\t\t--branch master \\\n\t\t\thttps://github.com/cswl/tsu.git \\\n\t\t\t$TMP_CHECKOUT\n\t\tcd $TMP_CHECKOUT\n\t\tgit fetch --all --tags --prune\n\t\tgit checkout \"tags/v$TERMUX_PKG_VERSION\" -b \"$TERMUX_PKG_VERSION\"\n\t\tmv $TMP_CHECKOUT $CHECKED_OUT_FOLDER\n\tfi\n\n\tmkdir $TERMUX_PKG_SRCDIR\n\tcd $TERMUX_PKG_SRCDIR\n\tcp -Rf $CHECKED_OUT_FOLDER/* .\n}\n\ntermux_step_make() {\n\t:\n}\n\ntermux_step_make_install() {\n\tcp tsu $TERMUX_PREFIX/bin/tsu\n\tchmod +x $TERMUX_PREFIX/bin/tsu\n\n\tcp tsudo $TERMUX_PREFIX/bin/tsudo\n\tchmod +x $TERMUX_PREFIX/bin/tsudo\n}\n"
  },
  {
    "path": "packages/tty-clock/Makefile.patch",
    "content": "diff --git a/Makefile b/Makefile\nindex 5028ee4..f3ce14f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -9,16 +9,8 @@ PREFIX ?= /usr/local\n INSTALLPATH = ${DESTDIR}${PREFIX}/bin\n MANPATH = ${DESTDIR}${PREFIX}/share/man/man1\n \n-ifeq ($(shell sh -c 'which ncurses5-config>/dev/null 2>/dev/null && echo y'), y)\n-\tCFLAGS += -Wall -g $$(ncurses5-config --cflags)\n-\tLDFLAGS += $$(ncurses5-config --libs)\n-else ifeq ($(shell sh -c 'which ncursesw5-config>/dev/null 2>/dev/null && echo y'), y)\n-\t\tCFLAGS += -Wall -g $$(ncursesw5-config --cflags)\n-\t\tLDFLAGS += $$(ncursesw5-config --libs)\n-else\n \tCFLAGS += -Wall -g $$(pkg-config --cflags ncurses)\n \tLDFLAGS += $$(pkg-config --libs ncurses)\n-endif\n \n tty-clock : ${SRC}\n \n"
  },
  {
    "path": "packages/tty-clock/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/xorg62/tty-clock\nTERMUX_PKG_DESCRIPTION=\"Simple terminal clock\"\nTERMUX_PKG_LICENSE=\"BSD 3-Clause\"\nTERMUX_PKG_VERSION=2.3\nTERMUX_PKG_MAINTAINER=\"Oliver Schmidhauser @Neo-Oli\"\nTERMUX_PKG_SRCURL=https://github.com/xorg62/tty-clock/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=343e119858db7d5622a545e15a3bbfde65c107440700b62f9df0926db8f57984\nTERMUX_PKG_DEPENDS=\"ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/ttyd/CMakeLists.txt.patch",
    "content": "diff -u -r ../ttyd-1.4.2/CMakeLists.txt ./CMakeLists.txt\n--- ../ttyd-1.4.2/CMakeLists.txt\t2018-09-12 04:18:04.000000000 +0000\n+++ ./CMakeLists.txt\t2018-09-14 19:21:53.229336188 +0000\n@@ -70,7 +70,7 @@\n list(APPEND SOURCE_FILES html.h)\n \n set(INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR} ${LIBWEBSOCKETS_INCLUDE_DIR} ${JSON-C_INCLUDE_DIR})\n-set(LINK_LIBS pthread ${OPENSSL_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARY})\n+set(LINK_LIBS ${OPENSSL_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARY})\n \n if(NOT APPLE)\n     list(APPEND LINK_LIBS util)\n"
  },
  {
    "path": "packages/ttyd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://tsl0922.github.io/ttyd/\nTERMUX_PKG_DESCRIPTION=\"Command-line tool for sharing terminal over the web\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.5.2\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=b5b62ec2ce08add0173e6d1dfdd879e55f02f9490043e89f389981a62e87d376\nTERMUX_PKG_SRCURL=https://github.com/tsl0922/ttyd/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"json-c, libwebsockets\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-DCMAKE_XXD=$TERMUX_PKG_TMPDIR/xxd\"\n\ntermux_step_pre_configure() {\n\ttermux_download \\\n\t\thttps://raw.githubusercontent.com/vim/vim/v8.1.0427/src/xxd/xxd.c \\\n\t\t$TERMUX_PKG_CACHEDIR/xxd.c \\\n\t\t021b38e02cd31951a80ef5185271d71f2def727eb8ff65b7a07aecfbd688b8e1\n\tgcc $TERMUX_PKG_CACHEDIR/xxd.c -o $TERMUX_PKG_TMPDIR/xxd\n}\n"
  },
  {
    "path": "packages/ttyd/src-utils.c.patch",
    "content": "diff -u -r ../ttyd-1.4.2/src/utils.c ./src/utils.c\n--- ../ttyd-1.4.2/src/utils.c\t2018-09-12 04:18:04.000000000 +0000\n+++ ./src/utils.c\t2018-09-14 19:18:03.508092637 +0000\n@@ -5,7 +5,7 @@\n #include <string.h>\n #include <signal.h>\n \n-#ifdef __linux__\n+#if defined(__linux__) && !defined(__ANDROID__)\n // https://github.com/karelzak/util-linux/blob/master/misc-utils/kill.c\n const char *sys_signame[NSIG] = {\n     \"zero\",  \"HUP\",  \"INT\",   \"QUIT\", \"ILL\",   \"TRAP\", \"ABRT\", \"UNUSED\",\n"
  },
  {
    "path": "packages/ttyrec/Makefile.patch",
    "content": "diff -u -r ../ttyrec-1.0.8/Makefile ./Makefile\n--- ../ttyrec-1.0.8/Makefile\t2006-06-11 17:52:50.000000000 +0200\n+++ ./Makefile\t2014-06-26 10:50:46.814230656 +0200\n@@ -1,5 +1,3 @@\n-CC = gcc\n-CFLAGS = -O2\n VERSION = 1.0.8\n \n TARGET = ttyrec ttyplay ttytime\n"
  },
  {
    "path": "packages/ttyrec/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://0xcc.net/ttyrec/\nTERMUX_PKG_DESCRIPTION=\"Terminal recorder and player\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.0.8\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=http://0xcc.net/ttyrec/ttyrec-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=ef5e9bf276b65bb831f9c2554cd8784bd5b4ee65353808f82b7e2aef851587ec\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\tCFLAGS+=\" -Dset_progname=setprogname $LDFLAGS\"\n}\n\ntermux_step_make_install() {\n\tcp ttyrec ttyplay ttytime $TERMUX_PREFIX/bin\n\tmkdir -p $TERMUX_PREFIX/share/man/man1\n\tcp ttyrec.1 ttyplay.1 ttytime.1 $TERMUX_PREFIX/share/man/man1\n}\n"
  },
  {
    "path": "packages/ttyrec/ttyrec.c.patch",
    "content": "diff -u -r ../ttyrec-1.0.8/ttyrec.c ./ttyrec.c\n--- ../ttyrec-1.0.8/ttyrec.c\t2006-06-11 17:52:50.000000000 +0200\n+++ ./ttyrec.c\t2014-06-26 11:01:31.614213029 +0200\n@@ -48,7 +48,7 @@\n #include <sys/ioctl.h>\n #include <sys/time.h>\n #include <sys/file.h>\n-#include <sys/signal.h>\n+#include <signal.h>\n #include <stdio.h>\n #include <time.h>\n #include <unistd.h>\n@@ -74,6 +74,35 @@\n #include <libutil.h>\n #endif\n \n+#ifdef __ANDROID__\n+#define HAVE_openpty\n+int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp)\n+{\n+       char buf[512];\n+       int master, slave;\n+\n+       master = open(\"/dev/ptmx\", O_RDWR);\n+       if (master == -1) return -1;\n+       if (grantpt(master) || unlockpt(master) || ptsname_r(master, buf, sizeof buf)) goto fail;\n+\n+       slave = open(buf, O_RDWR | O_NOCTTY);\n+       if (slave == -1) goto fail;\n+\n+       /* XXX Should we ignore errors here?  */\n+       if (termp) tcsetattr(slave, TCSAFLUSH, termp);\n+       if (winp) ioctl(slave, TIOCSWINSZ, winp);\n+\n+       *amaster = master;\n+       *aslave = slave;\n+       if (name != NULL) strcpy(name, buf);\n+       return 0;\n+\n+fail:\n+       close(master);\n+       return -1;\n+}\n+#endif\n+\n #if defined(SVR4) && !defined(CDEL)\n #if defined(_POSIX_VDISABLE)\n #define CDEL _POSIX_VDISABLE\n@@ -156,7 +185,7 @@\n \n \tshell = getenv(\"SHELL\");\n \tif (shell == NULL)\n-\t\tshell = \"/bin/sh\";\n+\t\tshell = \"@TERMUX_PREFIX@/bin/sh\";\n \n \tgetmaster();\n \tfixtty();\n@@ -203,11 +232,7 @@\n void\n finish()\n {\n-#if defined(SVR4)\n \tint status;\n-#else /* !SVR4 */\n-\tunion wait status;\n-#endif /* !SVR4 */\n \tregister int pid;\n \tregister int die = 0;\n \n"
  },
  {
    "path": "packages/tweego/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://bitbucket.org/tmedwards/tweego\nTERMUX_PKG_DESCRIPTION=\"A free command line compiler for Twine/Twee story formats\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.1.0\nTERMUX_PKG_SRCURL=https://github.com/tmedwards/tweego/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=73c2f00e6b19bd7339b2c431a32f51f4514f7b32130dd5738ece6efbf0664343\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/bitbucket.org/tmedwards\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/bitbucket.org/tmedwards/tweego\n\n\tcd \"$GOPATH\"/src/bitbucket.org/tmedwards/tweego\n\tgo get -d -v bitbucket.org/tmedwards/tweego\n\tgo build\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/src/bitbucket.org/tmedwards/tweego/tweego \\\n\t\t\"$TERMUX_PREFIX\"/bin/\n}"
  },
  {
    "path": "packages/uftrace/arm-clang-mcount-hook.patch",
    "content": "diff --git a/arch/arm/mcount.S b/arch/arm/mcount.S\nindex bbfc597..eb28831 100644\n--- a/arch/arm/mcount.S\n+++ b/arch/arm/mcount.S\n@@ -60,6 +60,26 @@ GLOBAL(__gnu_mcount_nc)\n \tbx\tip\n END(__gnu_mcount_nc)\n \n+/* for clang */\n+GLOBAL(mcount)\n+\tpush \t{r0-r3, lr}\n+\tands\tr3, lr, #1  /* check lr for ARM/THUMB detection */\n+\tadd\tr0, fp, #4  /* r0 points to pushed LR  */\n+\tbne\t1f\n+\tldr\tr1, [fp]    /* fp (=r11) might point to return address on ARM */\n+\tldr\tr2, [r0]\n+\tcmp\tr1, r2\n+\tmoveq\tr0, lr\n+1:\n+\tmov \tr1, lr      /* child ip */\n+\tmov\tr2, sp      /* mcount_args */\n+\n+\tbl \tmcount_entry\n+\n+\tpop \t{r0-r3, lr}\n+\tbx\tlr\n+END(mcount)\n+\n \n ENTRY(mcount_return)\n \tpush \t{r0-r3, lr, pc}  /* ensure 8-byte alignment */\n"
  },
  {
    "path": "packages/uftrace/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://uftrace.github.io/slide\nTERMUX_PKG_DESCRIPTION=\"Function (graph) tracer for user-space\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.9.3\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://github.com/namhyung/uftrace/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=d801d72e3cdd83c510aeecc5160482d879498cf08fffd21e64f84151001e18ea\nTERMUX_PKG_DEPENDS=\"capstone, libandroid-glob, libandroid-spawn, libelf, ncurses, python2\"\nTERMUX_PKG_BUILD_DEPENDS=\"argp\"\n\ntermux_step_pre_configure() {\n\t# uftrace uses custom configure script implementation, so we need to provide some flags\n\texport CFLAGS=\"${CFLAGS} -I${TERMUX_PREFIX}/include -DEFD_SEMAPHORE=1 -DEF_ARM_ABI_FLOAT_HARD=0x400 -w\"\n\texport LDFLAGS=\"${LDFLAGS} -Wl,--wrap=_Unwind_Resume -landroid-glob -largp\"\n\n\tif [ \"$TERMUX_ARCH\" = \"i686\" ]; then\n\t\texport ARCH=\"i386\"\n\telse\n\t\texport ARCH=\"$TERMUX_ARCH\"\n\tfi\n}\n"
  },
  {
    "path": "packages/uftrace/cmds-live.c.patch",
    "content": "+++ ./cmds/live.c\t2019-08-26 14:48:20.538152232 +0300\n@@ -97,7 +97,7 @@\n \n int command_live(int argc, char *argv[], struct opts *opts)\n {\n-\tchar template[32] = \"/tmp/uftrace-live-XXXXXX\";\n+\tchar template[128] = \"@TERMUX_PREFIX@/tmp/uftrace-live-XXXXXX\";\n \tint fd;\n \tstruct sigaction sa = {\n \t\t.sa_flags = SA_RESETHAND,\n"
  },
  {
    "path": "packages/uftrace/cmds-record.c.patch",
    "content": "diff -uNr uftrace-0.9.3/cmds/record.c uftrace-0.9.3.mod/cmds/record.c\n--- uftrace-0.9.3/cmds/record.c\t2019-07-13 17:25:47.000000000 +0300\n+++ uftrace-0.9.3.mod/cmds/record.c\t2019-09-03 15:29:17.756680758 +0300\n@@ -60,6 +60,65 @@\n static bool has_sched_event;\n static bool finish_received;\n \n+static int shm_unlink(const char *name) {\n+    size_t namelen;\n+    char *fname;\n+\n+    /* Construct the filename.  */\n+    while (name[0] == '/') ++name;\n+\n+    if (name[0] == '\\0') {\n+        /* The name \"/\" is not supported.  */\n+        errno = EINVAL;\n+        return -1;\n+    }\n+\n+    namelen = strlen(name);\n+    fname = (char *) alloca(sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1 + namelen + 1);\n+    memcpy(fname, \"@TERMUX_PREFIX@/tmp/\", sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1);\n+    memcpy(fname + sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1, name, namelen + 1);\n+\n+    return unlink(fname);\n+}\n+\n+static int shm_open(const char *name, int oflag, mode_t mode) {\n+    size_t namelen;\n+    char *fname;\n+    int fd;\n+\n+    /* Construct the filename.  */\n+    while (name[0] == '/') ++name;\n+\n+    if (name[0] == '\\0') {\n+        /* The name \"/\" is not supported.  */\n+        errno = EINVAL;\n+        return -1;\n+    }\n+\n+    namelen = strlen(name);\n+    fname = (char *) alloca(sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1 + namelen + 1);\n+    memcpy(fname, \"@TERMUX_PREFIX@/tmp/\", sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1);\n+    memcpy(fname + sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1, name, namelen + 1);\n+\n+    fd = open(fname, oflag, mode);\n+    if (fd != -1) {\n+        /* We got a descriptor.  Now set the FD_CLOEXEC bit.  */\n+        int flags = fcntl(fd, F_GETFD, 0);\n+        flags |= FD_CLOEXEC;\n+        flags = fcntl(fd, F_SETFD, flags);\n+\n+        if (flags == -1) {\n+            /* Something went wrong.  We cannot return the descriptor.  */\n+            int save_errno = errno;\n+            close(fd);\n+            fd = -1;\n+            errno = save_errno;\n+        }\n+    }\n+\n+    return fd;\n+}\n+\n static bool can_use_fast_libmcount(struct opts *opts)\n {\n \tif (debug)\n@@ -918,7 +977,7 @@\n \t\tsscanf(sl->id, \"/uftrace-%[^-]-%*d-%*d\", shmem_session);\n \t\tpr_dbg2(\"unlink for session: %s\\n\", shmem_session);\n \n-\t\tnum = scandir(\"/dev/shm/\", &shmem_bufs, filter_shmem, alphasort);\n+\t\tnum = scandir(\"@TERMUX_PREFIX@/tmp/\", &shmem_bufs, filter_shmem, alphasort);\n \t\tfor (i = 0; i < num; i++) {\n \t\t\tsid[0] = '/';\n \t\t\tmemcpy(&sid[1], shmem_bufs[i]->d_name, MSG_ID_SIZE);\n"
  },
  {
    "path": "packages/uftrace/disable-librt.patch",
    "content": "+++ ./Makefile\t2019-08-26 04:27:09.354957504 +0300\n@@ -53,7 +53,7 @@\n COMMON_CFLAGS := -D_GNU_SOURCE $(CFLAGS) $(CPPFLAGS)\n COMMON_CFLAGS += -iquote $(srcdir) -iquote $(objdir) -iquote $(srcdir)/arch/$(ARCH)\n #CFLAGS-DEBUG = -g -D_GNU_SOURCE $(CFLAGS_$@)\n-COMMON_LDFLAGS := -lrt -ldl -pthread -Wl,-z,noexecstack $(LDFLAGS)\n+COMMON_LDFLAGS := -ldl -pthread -Wl,-z,noexecstack $(LDFLAGS)\n ifneq ($(elfdir),)\n   COMMON_CFLAGS  += -I$(elfdir)/include\n   COMMON_LDFLAGS += -L$(elfdir)/lib\n"
  },
  {
    "path": "packages/uftrace/kernel.c.patch",
    "content": "+++ ./utils/kernel.c\t2019-08-26 05:01:08.580055352 +0300\n@@ -29,6 +29,42 @@\n \n #define TRACING_DIR  \"/sys/kernel/debug/tracing\"\n \n+int strverscmp(const char *l0, const char *r0)\n+{\n+\tconst unsigned char *l = (const void *)l0;\n+\tconst unsigned char *r = (const void *)r0;\n+\tsize_t i, dp, j;\n+\tint z = 1;\n+\n+\t/* Find maximal matching prefix and track its maximal digit\n+\t * suffix and whether those digits are all zeros. */\n+\tfor (dp=i=0; l[i]==r[i]; i++) {\n+\t\tint c = l[i];\n+\t\tif (!c) return 0;\n+\t\tif (!isdigit(c)) dp=i+1, z=1;\n+\t\telse if (c!='0') z=0;\n+\t}\n+\n+\tif (l[dp]!='0' && r[dp]!='0') {\n+\t\t/* If we're not looking at a digit sequence that began\n+\t\t * with a zero, longest digit string is greater. */\n+\t\tfor (j=i; isdigit(l[j]); j++)\n+\t\t\tif (!isdigit(r[j])) return 1;\n+\t\tif (isdigit(r[j])) return -1;\n+\t} else if (z && dp<i && (isdigit(l[i]) || isdigit(r[i]))) {\n+\t\t/* Otherwise, if common prefix of digit sequence is\n+\t\t * all zeros, digits order less than non-digits. */\n+\t\treturn (unsigned char)(l[i]-'0') - (unsigned char)(r[i]-'0');\n+\t}\n+\n+\treturn l[i] - r[i];\n+}\n+\n+static int versionsort(const struct dirent **a, const struct dirent **b)\n+{\n+\treturn strverscmp((*a)->d_name, (*b)->d_name);\n+}\n+\n static bool kernel_tracing_enabled;\n \n /* tree of executed kernel functions */\n"
  },
  {
    "path": "packages/uftrace/libmcount-record.c.patch",
    "content": "+++ ./libmcount/record.c\t2019-08-26 14:43:15.836981805 +0300\n@@ -23,6 +23,44 @@\n \n #define ARG_STR_MAX\t98\n \n+static int shm_open(const char *name, int oflag, mode_t mode) {\n+    size_t namelen;\n+    char *fname;\n+    int fd;\n+\n+    /* Construct the filename.  */\n+    while (name[0] == '/') ++name;\n+\n+    if (name[0] == '\\0') {\n+        /* The name \"/\" is not supported.  */\n+        errno = EINVAL;\n+        return -1;\n+    }\n+\n+    namelen = strlen(name);\n+    fname = (char *) alloca(sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1 + namelen + 1);\n+    memcpy(fname, \"@TERMUX_PREFIX@/tmp/\", sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1);\n+    memcpy(fname + sizeof(\"@TERMUX_PREFIX@/tmp/\") - 1, name, namelen + 1);\n+\n+    fd = open(fname, oflag, mode);\n+    if (fd != -1) {\n+        /* We got a descriptor.  Now set the FD_CLOEXEC bit.  */\n+        int flags = fcntl(fd, F_GETFD, 0);\n+        flags |= FD_CLOEXEC;\n+        flags = fcntl(fd, F_SETFD, flags);\n+\n+        if (flags == -1) {\n+            /* Something went wrong.  We cannot return the descriptor.  */\n+            int save_errno = errno;\n+            close(fd);\n+            fd = -1;\n+            errno = save_errno;\n+        }\n+    }\n+\n+    return fd;\n+}\n+\n static struct mcount_shmem_buffer *allocate_shmem_buffer(char *sess_id, size_t size,\n \t\t\t\t\t\t\t int tid, int idx)\n {\n"
  },
  {
    "path": "packages/uftrace/libmcount-wrap.c.patch",
    "content": "diff -uNr uftrace-0.9.3/libmcount/wrap.c uftrace-0.9.3.mod/libmcount/wrap.c\n--- uftrace-0.9.3/libmcount/wrap.c\t2019-07-13 17:25:47.000000000 +0300\n+++ uftrace-0.9.3.mod/libmcount/wrap.c\t2019-09-03 20:46:52.430226391 +0300\n@@ -216,7 +216,6 @@\n /*\n  * hooking functions\n  */\n-static int (*real_backtrace)(void **buffer, int sz);\n static void (*real_cxa_throw)(void *exc, void *type, void *dest);\n static void (*real_cxa_rethrow)(void);\n static void * (*real_cxa_begin_catch)(void *exc);\n@@ -241,7 +240,6 @@\n \n void mcount_hook_functions(void)\n {\n-\treal_backtrace\t\t= dlsym(RTLD_NEXT, \"backtrace\");\n \treal_cxa_throw\t\t= dlsym(RTLD_NEXT, \"__cxa_throw\");\n \treal_cxa_rethrow\t= dlsym(RTLD_NEXT, \"__cxa_rethrow\");\n \treal_cxa_begin_catch\t= dlsym(RTLD_NEXT, \"__cxa_begin_catch\");\n@@ -258,22 +256,7 @@\n \n __visible_default int backtrace(void **buffer, int sz)\n {\n-\tint ret;\n-\tstruct mcount_thread_data *mtdp;\n-\n-\tif (unlikely(real_backtrace == NULL))\n-\t\tmcount_hook_functions();\n-\n-\tmtdp = get_thread_data();\n-\tif (!check_thread_data(mtdp))\n-\t\tmcount_rstack_restore(mtdp);\n-\n-\tret = real_backtrace(buffer, sz);\n-\n-\tif (!check_thread_data(mtdp))\n-\t\tmcount_rstack_reset(mtdp);\n-\n-\treturn ret;\n+\treturn 0;\n }\n \n __visible_default void __cxa_throw(void *exception, void *type, void *dest)\n@@ -324,7 +307,8 @@\n \treal_cxa_rethrow();\n }\n \n-__visible_default void _Unwind_Resume(void *exception)\n+void __real__Unwind_Resume(void *exception);\n+__visible_default void __wrap__Unwind_Resume(void *exception)\n {\n \tstruct mcount_thread_data *mtdp;\n \n@@ -345,7 +329,7 @@\n \t\tmcount_rstack_restore(mtdp);\n \t}\n \n-\treal_unwind_resume(exception);\n+\t__real__Unwind_Resume(exception);\n }\n \n __visible_default void * __cxa_begin_catch(void *exception)\n"
  },
  {
    "path": "packages/uftrace/pr_warn.patch",
    "content": "+++ ./cmds/info.c\t2019-08-26 14:53:01.793449309 +0300\n@@ -1146,7 +1146,7 @@\n \n \tret = open_info_file(opts, &handle);\n \tif (ret < 0) {\n-\t\tpr_warn(\"cannot open record data: %s: %m\\n\", opts->dirname);\n+\t\tpr_warn(\"cannot open record data: %s: %s\\n\", opts->dirname, strerror(errno));\n \t\treturn -1;\n \t}\n \n+++ ./cmds/report.c\t2019-08-26 14:57:29.911809302 +0300\n@@ -1,6 +1,7 @@\n #include <stdio.h>\n #include <inttypes.h>\n #include <assert.h>\n+#include <errno.h>\n \n #include \"uftrace.h\"\n #include \"utils/utils.h\"\n@@ -523,7 +524,7 @@\n \treport_calc_avg(&base_tree);\n \n \tif (open_data_file(&dummy_opts, &data.handle) < 0) {\n-\t\tpr_warn(\"cannot open record data: %s: %m\\n\", opts->diff);\n+\t\tpr_warn(\"cannot open record data: %s: %s\\n\", opts->diff, strerror(errno));\n \t\tgoto out;\n \t}\n \n@@ -609,7 +610,7 @@\n \n \tret = open_data_file(opts, &handle);\n \tif (ret < 0) {\n-\t\tpr_warn(\"cannot open record data: %s: %m\\n\", opts->dirname);\n+\t\tpr_warn(\"cannot open record data: %s: %s\\n\", opts->dirname, strerror(errno));\n \t\treturn -1;\n \t}\n \n+++ ./cmds/dump.c\t2019-08-26 14:59:44.802869609 +0300\n@@ -5,6 +5,7 @@\n #include <time.h>\n #include <assert.h>\n #include <sys/stat.h>\n+#include <errno.h>\n \n #include \"uftrace.h\"\n #include \"version.h\"\n@@ -1582,7 +1583,7 @@\n \n \tret = open_data_file(opts, &handle);\n \tif (ret < 0) {\n-\t\tpr_warn(\"cannot open record data: %s: %m\\n\", opts->dirname);\n+\t\tpr_warn(\"cannot open record data: %s: %s\\n\", opts->dirname, strerror(errno));\n \t\treturn -1;\n \t}\n \n+++ ./cmds/replay.c\t2019-08-26 15:01:30.621223877 +0300\n@@ -4,6 +4,7 @@\n #include <inttypes.h>\n #include <stdio_ext.h>\n #include <assert.h>\n+#include <errno.h>\n \n #include \"uftrace.h\"\n #include \"utils/utils.h\"\n@@ -1111,7 +1112,7 @@\n \n \tret = open_data_file(opts, &handle);\n \tif (ret < 0) {\n-\t\tpr_warn(\"cannot open record data: %s: %m\\n\", opts->dirname);\n+\t\tpr_warn(\"cannot open record data: %s: %s\\n\", opts->dirname, strerror(errno));\n \t\treturn -1;\n \t}\n \n"
  },
  {
    "path": "packages/unicorn/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.unicorn-engine.org/\nTERMUX_PKG_DESCRIPTION=\"Unicorn is a lightweight multi-platform, multi-architecture CPU emulator framework.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.0.1\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/unicorn-engine/unicorn/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3a6a4f2b8c405ab009040ca43af8e4aa10ebe44d9c8b336aa36dc35df955017c\nTERMUX_PKG_BREAKS=\"unicorn-dev\"\nTERMUX_PKG_REPLACES=\"unicorn-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/unicorn/samples-Makefile.patch",
    "content": "diff --git a/samples/Makefile b/samples/Makefile\nindex 4724f17..8303ba5 100644\n--- a/samples/Makefile\n+++ b/samples/Makefile\n@@ -14,12 +14,12 @@ V ?= 0\n\n CFLAGS += -Wall -Werror -I../include\n\n-LDFLAGS += -L$(LIBDIR) -lunicorn -lpthread -lm\n+LDFLAGS += -L$(LIBDIR) -lunicorn -lm\n ifeq ($(UNAME_S), Linux)\n-LDFLAGS += -lrt\n+LDFLAGS +=\n endif\n\n-LDLIBS += -lpthread -lunicorn -lm\n+LDLIBS += -lunicorn -lm\n\n ifneq ($(CROSS),)\n CC = $(CROSS)gcc\n"
  },
  {
    "path": "packages/unifdef/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://dotat.at/prog/unifdef/\nTERMUX_PKG_DESCRIPTION=\"Remove #ifdef'ed lines\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.11\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://dotat.at/prog/unifdef/unifdef-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=e8483c05857a10cf2d5e45b9e8af867d95991fab0f9d3d8984840b810e132d98\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tmkdir -p \"$TERMUX_PREFIX\"/share/man/man1/\n\tinstall -Dm700 unifdef \"$TERMUX_PREFIX\"/bin/\n\tinstall -Dm600 unifdef.1 \"$TERMUX_PREFIX\"/share/man/man1/\n}\n"
  },
  {
    "path": "packages/units/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/units/\nTERMUX_PKG_DESCRIPTION=\"Converts between different systems of units\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.19\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/units/units-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=4262136bdfc152b63ff5a9b93a7d80ce18b5e8bebdcffddc932dda769e306556\nTERMUX_PKG_DEPENDS=\"readline, libandroid-support\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/units/units.h.patch.debug",
    "content": "--- ./units.h\t2017-02-09 21:43:12.000000000 +0000\n+++ ../units.h\t2018-03-21 20:22:04.544833906 +0000\n@@ -54,7 +54,7 @@\n #  ifdef NO_STRCHR\n #    define strchr(a,b) index((a),(b))\n #  else\n-     char *strchr();\n+     char __attribute__((overloadable)) *strchr();\n #  endif\n #endif /* !strchr */\n \n"
  },
  {
    "path": "packages/unrar/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.rarlab.com/\nTERMUX_PKG_DESCRIPTION=\"Tool for extracting files from .rar archives\"\nTERMUX_PKG_LICENSE=\"non-free\"\nTERMUX_PKG_LICENSE_FILE=\"license.txt\"\nTERMUX_PKG_VERSION=5.8.4\nTERMUX_PKG_SRCURL=https://www.rarlab.com/rar/unrarsrc-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=0b7cb2307ef7e65f631496376ce2fdf98b9b0f2136dc4467408ef63f3bf92f96\nTERMUX_PKG_DEPENDS=\"libandroid-support, libc++\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/unrar/makefile.patch",
    "content": "diff -u -r ../unrar/makefile ./makefile\n--- ../unrar/makefile\t2017-11-22 06:53:39.000000000 +0000\n+++ ./makefile\t2018-03-12 10:30:16.141557520 +0000\n@@ -2,14 +2,14 @@\n # Makefile for UNIX - unrar\n \n # Linux using GCC\n-CXX=c++\n-CXXFLAGS=-O2 -Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else\n-LIBFLAGS=-fPIC\n+CXX?=c++\n+CXXFLAGS?=-O2 -Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else\n+LIBFLAGS=$(LDFLAGS)\n DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP\n-STRIP=strip\n-AR=ar\n-LDFLAGS=-pthread\n-DESTDIR=/usr\n+STRIP?=strip\n+AR?=ar\n+LDFLAGS?=-pthread\n+DESTDIR=$(PREFIX)\n \n # Linux using LCC\n #CXX=lcc\n"
  },
  {
    "path": "packages/unrar/os.hpp.patch",
    "content": "diff -u -r ../unrar/os.hpp ./os.hpp\n--- ../unrar/os.hpp\t2017-06-10 13:59:52.000000000 +0000\n+++ ./os.hpp\t2017-06-12 00:11:04.591100580 +0000\n@@ -154,7 +154,7 @@\n #define SAVE_LINKS\n #endif\n \n-#if defined(__linux) || defined(__FreeBSD__)\n+#if (defined(__linux) && !defined(__ANDROID__)) || defined(__FreeBSD__)\n #include <sys/time.h>\n #define USE_LUTIMES\n #endif\n"
  },
  {
    "path": "packages/unstable-repo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/unstable-packages\nTERMUX_PKG_DESCRIPTION=\"Package repository containing new/unstable programs and libraries.\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.0\nTERMUX_PKG_DEPENDS=\"termux-keyring\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/apt/sources.list.d\n\techo \"deb https://dl.bintray.com/xeffyr/unstable-packages unstable main\" > $TERMUX_PREFIX/etc/apt/sources.list.d/unstable.list\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"echo Downloading updated package list ...\" >> postinst\n\techo \"apt update\" >> postinst\n\techo \"exit 0\" >> postinst\n}\n"
  },
  {
    "path": "packages/unzip/bugfix-crc32.patch",
    "content": "--- unzip60/extract.c\t2010-04-03 14:41:55 -0500\n+++ unzip60/extract.c\t2014-12-03 15:33:35 -0600\n@@ -1,5 +1,5 @@ \n /*\n-  Copyright (c) 1990-2009 Info-ZIP.  All rights reserved.\n+  Copyright (c) 1990-2014 Info-ZIP.  All rights reserved.\n \n   See the accompanying file LICENSE, version 2009-Jan-02 or later\n   (the contents of which are also included in unzip.h) for terms of use.\n@@ -298,6 +298,8 @@ \n #ifndef SFX\n    static ZCONST char Far InconsistEFlength[] = \"bad extra-field entry:\\n \\\n      EF block length (%u bytes) exceeds remaining EF data (%u bytes)\\n\";\n+   static ZCONST char Far TooSmallEFlength[] = \"bad extra-field entry:\\n \\\n+     EF block length (%u bytes) invalid (< %d)\\n\";\n    static ZCONST char Far InvalidComprDataEAs[] =\n      \" invalid compressed data for EAs\\n\";\n #  if (defined(WIN32) && defined(NTSD_EAS))\n@@ -2023,7 +2025,8 @@ \n         ebID = makeword(ef);\n         ebLen = (unsigned)makeword(ef+EB_LEN);\n \n-        if (ebLen > (ef_len - EB_HEADSIZE)) {\n+        if (ebLen > (ef_len - EB_HEADSIZE))\n+        {\n            /* Discovered some extra field inconsistency! */\n             if (uO.qflag)\n                 Info(slide, 1, ((char *)slide, \"%-22s \",\n@@ -2032,6 +2035,16 @@ \n               ebLen, (ef_len - EB_HEADSIZE)));\n             return PK_ERR;\n         }\n+        else if (ebLen < EB_HEADSIZE)\n+        {\n+            /* Extra block length smaller than header length. */\n+            if (uO.qflag)\n+                Info(slide, 1, ((char *)slide, \"%-22s \",\n+                  FnFilter1(G.filename)));\n+            Info(slide, 1, ((char *)slide, LoadFarString(TooSmallEFlength),\n+              ebLen, EB_HEADSIZE));\n+            return PK_ERR;\n+        }\n \n         switch (ebID) {\n             case EF_OS2:\n"
  },
  {
    "path": "packages/unzip/bugfix-csiz-underflow.patch",
    "content": "From: Kamil Dudka <kdudka@redhat.com>\nDate: Tue, 22 Sep 2015 18:52:23 +0200\nSubject: [PATCH] extract: prevent unsigned overflow on invalid input\nOrigin: other, https://bugzilla.redhat.com/attachment.cgi?id=1075942\nBug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1260944\n\nSuggested-by: Stefan Cornelius\n---\n extract.c | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\n--- a/extract.c\n+++ b/extract.c\n@@ -1257,8 +1257,17 @@\n         if (G.lrec.compression_method == STORED) {\n             zusz_t csiz_decrypted = G.lrec.csize;\n \n-            if (G.pInfo->encrypted)\n+            if (G.pInfo->encrypted) {\n+                if (csiz_decrypted < 12) {\n+                    /* handle the error now to prevent unsigned overflow */\n+                    Info(slide, 0x401, ((char *)slide,\n+                      LoadFarStringSmall(ErrUnzipNoFile),\n+                      LoadFarString(InvalidComprData),\n+                      LoadFarStringSmall2(Inflate)));\n+                    return PK_ERR;\n+                }\n                 csiz_decrypted -= 12;\n+            }\n             if (G.lrec.ucsize != csiz_decrypted) {\n                 Info(slide, 0x401, ((char *)slide,\n                   LoadFarStringSmall2(WrnStorUCSizCSizDiff),\n"
  },
  {
    "path": "packages/unzip/bugfix-cve20149636.patch",
    "content": "diff --git a/extract.c b/extract.c\nindex a0a4929..9ef80b3 100644\n--- a/extract.c\n+++ b/extract.c\n@@ -2214,6 +2214,7 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata)\n     ulg eb_ucsize;\n     uch *eb_ucptr;\n     int r;\n+    ush method;\n \n     if (compr_offset < 4)                /* field is not compressed: */\n         return PK_OK;                    /* do nothing and signal OK */\n@@ -2223,6 +2224,12 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata)\n          eb_size <= (compr_offset + EB_CMPRHEADLEN)))\n         return IZ_EF_TRUNC;               /* no compressed data! */\n \n+    method = makeword(eb + (EB_HEADSIZE + compr_offset));\n+    if ((method == STORED) && (eb_size != compr_offset + EB_CMPRHEADLEN + eb_ucsize))\n+        return PK_ERR;            /* compressed & uncompressed\n+                                   * should match in STORED\n+                                   * method */\n+\n     if (\n #ifdef INT_16BIT\n         (((ulg)(extent)eb_ucsize) != eb_ucsize) ||\n"
  },
  {
    "path": "packages/unzip/bugfix-empty-input.patch",
    "content": "From: Kamil Dudka <kdudka@redhat.com>\nDate: Mon, 14 Sep 2015 18:24:56 +0200\nSubject: fix infinite loop when extracting empty bzip2 data\nBug-Debian: https://bugs.debian.org/802160\nBug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1260944\nOrigin: other, https://bugzilla.redhat.com/attachment.cgi?id=1073339\n\n---\n extract.c | 6 ++++++\n 1 file changed, 6 insertions(+)\n\n--- a/extract.c\n+++ b/extract.c\n@@ -2728,6 +2728,12 @@\n     int repeated_buf_err;\n     bz_stream bstrm;\n \n+    if (G.incnt <= 0 && G.csize <= 0L) {\n+        /* avoid an infinite loop */\n+        Trace((stderr, \"UZbunzip2() got empty input\\n\"));\n+        return 2;\n+    }\n+\n #if (defined(DLL) && !defined(NO_SLIDE_REDIR))\n     if (G.redirect_slide)\n         wsize = G.redirect_size, redirSlide = G.redirect_buffer;\n"
  },
  {
    "path": "packages/unzip/bugfix-getZip64Data.patch",
    "content": "--- a/process.c\t2009-03-06 02:25:10.000000000 +0100\n+++ b/process.c\t2014-12-05 22:42:39.000000000 +0100\n@@ -1,5 +1,5 @@ \n /*\n-  Copyright (c) 1990-2009 Info-ZIP.  All rights reserved.\n+  Copyright (c) 1990-2014 Info-ZIP.  All rights reserved.\n \n   See the accompanying file LICENSE, version 2009-Jan-02 or later\n   (the contents of which are also included in unzip.h) for terms of use.\n@@ -1888,48 +1888,82 @@ int getZip64Data(__G__ ef_buf, ef_len)\n     and a 4-byte version of disk start number.\n     Sets both local header and central header fields.  Not terribly clever,\n     but it means that this procedure is only called in one place.\n+\n+    2014-12-05 SMS.\n+    Added checks to ensure that enough data are available before calling\n+    makeint64() or makelong().  Replaced various sizeof() values with\n+    simple (\"4\" or \"8\") constants.  (The Zip64 structures do not depend\n+    on our variable sizes.)  Error handling is crude, but we should now\n+    stay within the buffer.\n   ---------------------------------------------------------------------------*/\n \n+#define Z64FLGS 0xffff\n+#define Z64FLGL 0xffffffff\n+\n     if (ef_len == 0 || ef_buf == NULL)\n         return PK_COOL;\n \n     Trace((stderr,\"\\ngetZip64Data: scanning extra field of length %u\\n\",\n       ef_len));\n \n-    while (ef_len >= EB_HEADSIZE) {\n+    while (ef_len >= EB_HEADSIZE)\n+    {\n         eb_id = makeword(EB_ID + ef_buf);\n         eb_len = makeword(EB_LEN + ef_buf);\n \n-        if (eb_len > (ef_len - EB_HEADSIZE)) {\n-            /* discovered some extra field inconsistency! */\n+        if (eb_len > (ef_len - EB_HEADSIZE))\n+        {\n+            /* Extra block length exceeds remaining extra field length. */\n             Trace((stderr,\n               \"getZip64Data: block length %u > rest ef_size %u\\n\", eb_len,\n               ef_len - EB_HEADSIZE));\n             break;\n         }\n-        if (eb_id == EF_PKSZ64) {\n-\n+        if (eb_id == EF_PKSZ64)\n+        {\n           int offset = EB_HEADSIZE;\n \n-          if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){\n-            G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf);\n-            offset += sizeof(G.crec.ucsize);\n+          if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))\n+          {\n+            if (offset+ 8 > ef_len)\n+              return PK_ERR;\n+\n+            G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf);\n+            offset += 8;\n           }\n-          if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){\n-            G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf);\n-            offset += sizeof(G.crec.csize);\n+\n+          if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL))\n+          {\n+            if (offset+ 8 > ef_len)\n+              return PK_ERR;\n+\n+            G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf);\n+            offset += 8;\n           }\n-          if (G.crec.relative_offset_local_header == 0xffffffff){\n+\n+          if (G.crec.relative_offset_local_header == Z64FLGL)\n+          {\n+            if (offset+ 8 > ef_len)\n+              return PK_ERR;\n+\n             G.crec.relative_offset_local_header = makeint64(offset + ef_buf);\n-            offset += sizeof(G.crec.relative_offset_local_header);\n+            offset += 8;\n           }\n-          if (G.crec.disk_number_start == 0xffff){\n+\n+          if (G.crec.disk_number_start == Z64FLGS)\n+          {\n+            if (offset+ 4 > ef_len)\n+              return PK_ERR;\n+\n             G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf);\n-            offset += sizeof(G.crec.disk_number_start);\n+            offset += 4;\n           }\n+#if 0\n+          break;                /* Expect only one EF_PKSZ64 block. */\n+#endif /* 0 */\n         }\n \n-        /* Skip this extra field block */\n+        /* Skip this extra field block. */\n         ef_buf += (eb_len + EB_HEADSIZE);\n         ef_len -= (eb_len + EB_HEADSIZE);\n     }\n--- a/fileio.c\t2009-04-20 02:03:44.000000000 +0200\n+++ b/fileio.c\t2014-12-05 22:44:16.000000000 +0100\n@@ -176,6 +176,8 @@ static ZCONST char Far FilenameTooLongTr\n #endif\n static ZCONST char Far ExtraFieldTooLong[] =\n   \"warning:  extra field too long (%d).  Ignoring...\\n\";\n+static ZCONST char Far ExtraFieldCorrupt[] =\n+  \"warning:  extra field (type: 0x%04x) corrupt.  Continuing...\\n\";\n \n #ifdef WINDLL\n    static ZCONST char Far DiskFullQuery[] =\n@@ -2295,7 +2297,12 @@ int do_string(__G__ length, option)   /*\n             if (readbuf(__G__ (char *)G.extra_field, length) == 0)\n                 return PK_EOF;\n             /* Looks like here is where extra fields are read */\n-            getZip64Data(__G__ G.extra_field, length);\n+            if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)\n+            {\n+                Info(slide, 0x401, ((char *)slide,\n+                 LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));\n+                error = PK_WARN;\n+            }\n #ifdef UNICODE_SUPPORT\n             G.unipath_filename = NULL;\n             if (G.UzO.U_flag < 2) {\n"
  },
  {
    "path": "packages/unzip/bugfix-nextbyte-overflow.patch",
    "content": "From: Petr Stodulka <pstodulk@redhat.com>\nDate: Mon, 14 Sep 2015 18:23:17 +0200\nSubject: Upstream fix for heap overflow\nBug-Debian: https://bugs.debian.org/802162\nBug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1260944\nOrigin: https://bugzilla.redhat.com/attachment.cgi?id=1073002\nForwarded: yes\n\n---\n crypt.c | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\n--- a/crypt.c\n+++ b/crypt.c\n@@ -465,7 +465,17 @@\n     GLOBAL(pInfo->encrypted) = FALSE;\n     defer_leftover_input(__G);\n     for (n = 0; n < RAND_HEAD_LEN; n++) {\n-        b = NEXTBYTE;\n+        /* 2012-11-23 SMS.  (OUSPG report.)\n+         * Quit early if compressed size < HEAD_LEN.  The resulting\n+         * error message (\"unable to get password\") could be improved,\n+         * but it's better than trying to read nonexistent data, and\n+         * then continuing with a negative G.csize.  (See\n+         * fileio.c:readbyte()).\n+         */\n+        if ((b = NEXTBYTE) == (ush)EOF)\n+        {\n+            return PK_ERR;\n+        }\n         h[n] = (uch)b;\n         Trace((stdout, \" (%02x)\", h[n]));\n     }\n"
  },
  {
    "path": "packages/unzip/bugfix-overflow-fsize.patch",
    "content": "t a/list.c b/list.c\nindex f7359c3..4c3d703 100644\n--- a/list.c\n+++ b/list.c\n@@ -97,7 +97,7 @@ int list_files(__G)    /* return PK-type error code */\n {\n     int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL;\n #ifndef WINDLL\n-    char sgn, cfactorstr[10];\n+    char sgn, cfactorstr[13];\n     int longhdr=(uO.vflag>1);\n #endif\n     int date_format;\n@@ -339,7 +339,19 @@ int list_files(__G)    /* return PK-type error code */\n                 G.crec.compression_method == ENHDEFLATED) {\n                 methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];\n             } else if (methnum >= NUM_METHODS) {\n-                sprintf(&methbuf[4], \"%03u\", G.crec.compression_method);\n+                /* 2013-02-26 SMS.\n+                 * http://sourceforge.net/tracker/?func=detail\n+                 *  &aid=2861648&group_id=118012&atid=679786\n+                 * Unexpectedly large compression methods overflow\n+                 * &methbuf[].  Use the old, three-digit decimal format\n+                 * for values which fit.  Otherwise, sacrifice the\n+                 * colon, and use four-digit hexadecimal.\n+                 */\n+                if (G.crec.compression_method <= 999) {\n+                    sprintf( &methbuf[ 4], \"%03u\", G.crec.compression_method);\n+                } else {\n+                    sprintf( &methbuf[ 3], \"%04X\", G.crec.compression_method);\n+                }\n             }\n \n #if 0       /* GRR/Euro:  add this? */\n"
  },
  {
    "path": "packages/unzip/bugfix-test_compr_eb.patch",
    "content": "--- a/extract.c\t2009-03-14 02:32:52.000000000 +0100\n+++ b/extract.c\t2014-12-05 22:43:13.000000000 +0100\n@@ -2221,10 +2234,17 @@ static int test_compr_eb(__G__ eb, eb_si\n     if (compr_offset < 4)                /* field is not compressed: */\n         return PK_OK;                    /* do nothing and signal OK */\n \n+    /* Return no/bad-data error status if any problem is found:\n+     *    1. eb_size is too small to hold the uncompressed size\n+     *       (eb_ucsize).  (Else extract eb_ucsize.)\n+     *    2. eb_ucsize is zero (invalid).  2014-12-04 SMS.\n+     *    3. eb_ucsize is positive, but eb_size is too small to hold\n+     *       the compressed data header.\n+     */\n     if ((eb_size < (EB_UCSIZE_P + 4)) ||\n-        ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&\n-         eb_size <= (compr_offset + EB_CMPRHEADLEN)))\n-        return IZ_EF_TRUNC;               /* no compressed data! */\n+     ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||\n+     ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))\n+        return IZ_EF_TRUNC;             /* no/bad compressed data! */\n \n     if (\n #ifdef INT_16BIT\n"
  },
  {
    "path": "packages/unzip/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.info-zip.org/\nTERMUX_PKG_DESCRIPTION=\"Tools for working with zip files\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=6.0\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/infozip/unzip60.tar.gz\nTERMUX_PKG_SHA256=036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37\nTERMUX_PKG_DEPENDS=\"libbz2\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\tcp unix/Makefile Makefile\n}\n\ntermux_step_make() {\n\tCFLAGS+=\" $CPPFLAGS\"\n\tCFLAGS+=\" -DACORN_FTYPE_NFS\"\n\tCFLAGS+=\" -DWILD_STOP_AT_DIR\"\n\tCFLAGS+=\" -DLARGE_FILE_SUPPORT\"\n\tCFLAGS+=\" -DUNICODE_SUPPORT\"\n\tCFLAGS+=\" -DUNICODE_WCHAR\"\n\tCFLAGS+=\" -DUTF8_MAYBE_NATIVE\"\n\tCFLAGS+=\" -DNO_LCHMOD\"\n\tCFLAGS+=\" -DDATE_FORMAT=DF_YMD\"\n\tCFLAGS+=\" -DUSE_BZIP2\"\n\tCFLAGS+=\" -DNOMEMCPY\"\n\tCFLAGS+=\" -DNO_WORKING_ISPRINT\"\n\tCFLAGS+=\" -I.\"\n\n\tmake -f unix/Makefile prefix=$TERMUX_PREFIX D_USE_BZ2=-DUSE_BZIP2 \\\n\t\tL_BZ2=-lbz2 LF2=\"$LDFLAGS\" CC=\"$CC\" CF=\"$CFLAGS\" LD=\"$CC\" unzips\n}\n\ntermux_step_make_install() {\n\tmake -f unix/Makefile prefix=$TERMUX_PREFIX install\n}\n"
  },
  {
    "path": "packages/unzip/makefile.patch",
    "content": "diff -u -r ../unzip60/unix/Makefile ./unix/Makefile\n--- ../unzip60/unix/Makefile\t2009-01-18 17:41:18.000000000 -0500\n+++ ./unix/Makefile\t2015-07-08 21:06:39.896318954 -0400\n@@ -42,12 +42,8 @@\n # such as -DDOSWILD).\n \n # UnZip flags\n-CC = cc#\ttry using \"gcc\" target rather than changing this (CC and LD\n-LD = $(CC)#\tmust match, else \"unresolved symbol:  ___main\" is possible)\n-AS = as\n LOC = $(D_USE_BZ2) $(LOCAL_UNZIP)\n AF = $(LOC)\n-CFLAGS = -O\n CF_NOOPT = -I. -I$(IZ_BZIP2) -DUNIX $(LOC)\n CF = $(CFLAGS) $(CF_NOOPT)\n LFLAGS1 =\n@@ -121,9 +117,8 @@\n INSTALL_D = mkdir -p\n # on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate\n manext = 1\n-prefix = /usr/local\n BINDIR = $(prefix)/bin#\t\t\twhere to install executables\n-MANDIR = $(prefix)/man/man$(manext)#\twhere to install man pages\n+MANDIR = $(prefix)/share/man/man$(manext)#\twhere to install man pages\n INSTALLEDBIN = $(BINDIR)/funzip$E $(BINDIR)/unzip$E $(BINDIR)/unzipsfx$E \\\n \t$(BINDIR)/zipgrep$E $(BINDIR)/zipinfo$E\n INSTALLEDMAN = $(MANDIR)/funzip.$(manext) $(MANDIR)/unzip.$(manext) \\\n@@ -452,7 +447,7 @@\n \t$(INSTALL_PROGRAM) $(UNZIPS) $(BINDIR)\n \t$(INSTALL) unix/zipgrep $(BINDIR)\n \t$(RM) $(BINDIR)/zipinfo$E\n-\t$(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E\n+\t$(LN) -s $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E\n \t-$(INSTALL_D) $(MANDIR)\n \t$(INSTALL) man/funzip.1 $(MANDIR)/funzip.$(manext)\n \t$(INSTALL) man/unzip.1 $(MANDIR)/unzip.$(manext)\n"
  },
  {
    "path": "packages/unzip/unix-configure.patch",
    "content": "diff -u -r ../unzip60/unix/configure ./unix/configure\n--- ../unzip60/unix/configure\t2009-04-16 21:25:12.000000000 +0200\n+++ ./unix/configure\t2017-07-07 08:56:05.197092127 +0200\n@@ -379,72 +379,6 @@\n \n # Check for missing functions\n # add NO_'function_name' to flags if missing\n-for func in fchmod fchown lchown nl_langinfo\n-do\n-  echo Check for $func\n-  echo \"int main(){ $func(); return 0; }\" > conftest.c\n-  $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null\n-  [ $? -ne 0 ] && CFLAGSR=\"${CFLAGSR} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`\"\n-done\n-\n-# Check (seriously) for a working lchmod.\n-echo 'Check for lchmod'\n-temp_file=\"/tmp/unzip_test_$$\"\n-temp_link=\"link_$$\"\n-( echo '#include <unistd.h>' ; \\\n-  echo \"int main() { lchmod(\\\"${temp_file}\\\", 0666); }\" \\\n-) > conftest.c\n-ln -s \"${temp_link}\" \"${temp_file}\" && \\\n- $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null && \\\n- ./conftest\n-[ $? -ne 0 ] && CFLAGSR=\"${CFLAGSR} -DNO_LCHMOD\"\n-rm -f \"${temp_file}\"\n-\n-echo Check for memset\n-echo \"int main(){ char k; memset(&k,0,0); return 0; }\" > conftest.c\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-[ $? -ne 0 ] && CFLAGSR=\"${CFLAGSR} -DZMEM\"\n-\n-echo Check for errno declaration\n-cat > conftest.c << _EOF_\n-#include <errno.h>\n-main()\n-{\n-  errno = 0;\n-  return 0;\n-}\n-_EOF_\n-$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null\n-[ $? -ne 0 ] && CFLAGSR=\"${CFLAGSR} -DNO_ERRNO\"\n-\n-echo Check for directory libraries\n-cat > conftest.c << _EOF_\n-int main() { return closedir(opendir(\".\")); }\n-_EOF_\n-\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-if [ $? -ne 0 ]; then\n-  OPT=\"\"\n-  for lib in ndir dir ucb bsd BSD PW x dirent\n-  do\n-    $CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null\n-    [ $? -eq 0 ] && OPT=-l$lib && break\n-  done\n-  if [ ${OPT} ]; then\n-    LFLAGS2=\"${LFLAGS2} ${OPT}\"\n-  else\n-    CFLAGSR=\"${CFLAGSR} -DNO_DIR\"\n-  fi\n-fi\n-\n-# Dynix/ptx 1.3 needed this\n-echo Check for readlink\n-echo \"int main(){ return readlink(); }\" > conftest.c\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-if [ $? -ne 0 ]; then\n-  $CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null\n-  [ $? -eq 0 ] && LFLAGS2=\"${LFLAGS2} -lseq\"\n-fi\n \n echo Check for directory include file\n OPT=\"\"\n"
  },
  {
    "path": "packages/unzip/unzip.c.patch",
    "content": "diff -u -r ../unzip60/unzip.c ./unzip.c\n--- ../unzip60/unzip.c\t2009-04-16 18:26:52.000000000 +0000\n+++ ./unzip.c\t2019-01-27 06:36:11.933232400 +0000\n@@ -762,34 +762,7 @@\n     /* see if can use UTF-8 Unicode locale */\n # ifdef UTF8_MAYBE_NATIVE\n     {\n-        char *codeset;\n-#  if !(defined(NO_NL_LANGINFO) || defined(NO_LANGINFO_H))\n-        /* get the codeset (character set encoding) currently used */\n-#       include <langinfo.h>\n-\n-        codeset = nl_langinfo(CODESET);\n-#  else /* NO_NL_LANGINFO || NO_LANGINFO_H */\n-        /* query the current locale setting for character classification */\n-        codeset = setlocale(LC_CTYPE, NULL);\n-        if (codeset != NULL) {\n-            /* extract the codeset portion of the locale name */\n-            codeset = strchr(codeset, '.');\n-            if (codeset != NULL) ++codeset;\n-        }\n-#  endif /* ?(NO_NL_LANGINFO || NO_LANGINFO_H) */\n-        /* is the current codeset UTF-8 ? */\n-        if ((codeset != NULL) && (strcmp(codeset, \"UTF-8\") == 0)) {\n-            /* successfully found UTF-8 char coding */\n             G.native_is_utf8 = TRUE;\n-        } else {\n-            /* Current codeset is not UTF-8 or cannot be determined. */\n-            G.native_is_utf8 = FALSE;\n-        }\n-        /* Note: At least for UnZip, trying to change the process codeset to\n-         *       UTF-8 does not work.  For the example Linux setup of the\n-         *       UnZip maintainer, a successful switch to \"en-US.UTF-8\"\n-         *       resulted in garbage display of all non-basic ASCII characters.\n-         */\n     }\n # endif /* UTF8_MAYBE_NATIVE */\n \n"
  },
  {
    "path": "packages/utf8cpp/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/nemtrif/utfcpp\nTERMUX_PKG_DESCRIPTION=\"UTF8-CPP: UTF-8 with C++ in a Portable Way\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.3.5\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=f3ffe0ef6c02f48ebafe42369cbd741e844143baad27c13baad1cd14b863983d\nTERMUX_PKG_SRCURL=https://github.com/nemtrif/utfcpp/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\treturn 0;\n}\n\ntermux_step_make_install(){\n\tcp -r source/* $TERMUX_PREFIX/include/\n}\n"
  },
  {
    "path": "packages/utf8proc/Makefile.patch",
    "content": "diff -u -r ../utf8proc-2.1.0/Makefile ./Makefile\n--- ../utf8proc-2.1.0/Makefile\t2016-12-26 21:52:48.000000000 +0100\n+++ ./Makefile\t2018-04-17 00:01:15.028065400 +0200\n@@ -34,7 +34,7 @@\n endif\n \n # installation directories (for 'make install')\n-prefix=/usr/local\n+prefix?=/usr/local\n libdir=$(prefix)/lib\n includedir=$(prefix)/include\n \n"
  },
  {
    "path": "packages/utf8proc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/JuliaLang/utf8proc\nTERMUX_PKG_DESCRIPTION=\"Library for processing UTF-8 Unicode data\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=2.4.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=b2e5d547c1d94762a6d03a7e05cea46092aab68636460ff8648f1295e2cdfbd7\nTERMUX_PKG_BREAKS=\"utf8proc-dev\"\nTERMUX_PKG_REPLACES=\"utf8proc-dev\"\nTERMUX_PKG_SRCURL=https://github.com/JuliaLang/utf8proc/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\trm $TERMUX_PKG_SRCDIR/CMakeLists.txt\n}\n"
  },
  {
    "path": "packages/utfdecode/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/fornwall/utfdecode\nTERMUX_PKG_DESCRIPTION=\"Tool for decoding, encoding and debugging unicode\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.3.4\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/fornwall/utfdecode/releases/download/v$TERMUX_PKG_VERSION/utfdecode-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=5fd1473f6cf6bdedeb33569c3b0f6823aceda366c714f6a475e2d28767f99b5a\nTERMUX_PKG_DEPENDS=\"libc++\"\n"
  },
  {
    "path": "packages/util-linux/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://en.wikipedia.org/wiki/Util-linux\nTERMUX_PKG_DESCRIPTION=\"Miscellaneous system utilities\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.34\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://www.kernel.org/pub/linux/utils/util-linux/v${TERMUX_PKG_VERSION:0:4}/util-linux-${TERMUX_PKG_VERSION}.tar.xz\nTERMUX_PKG_SHA256=743f9d0c7252b6db246b659c1e1ce0bd45d8d4508b4dfa427bbb4a3e9b9f62b5\nTERMUX_PKG_DEPENDS=\"ncurses, libcrypt, zlib\"\nTERMUX_PKG_BREAKS=\"util-linux-dev\"\nTERMUX_PKG_REPLACES=\"util-linux-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_setns=yes\nac_cv_func_unshare=yes\n--disable-agetty\n--disable-ctrlaltdel\n--disable-eject\n--disable-fdformat\n--disable-ipcrm\n--disable-ipcs\n--disable-kill\n--disable-last\n--disable-libuuid\n--disable-logger\n--disable-mesg\n--disable-nologin\n--disable-pivot_root\n--disable-raw\n--disable-switch_root\n--disable-wall\n--disable-libmount\n--disable-lsmem\n--disable-chmem\n--disable-rfkill\n\"\n\ntermux_step_pre_configure() {\n\tif [ $TERMUX_ARCH_BITS = 64 ]; then\n\t\t# prlimit() is only available in 64-bit bionic.\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" ac_cv_func_prlimit=yes\"\n\tfi\n}\n"
  },
  {
    "path": "packages/util-linux/configure.patch",
    "content": "diff -u -r ../util-linux-2.28/configure ./configure\n--- ../util-linux-2.28/configure\t2016-04-12 06:34:01.936801023 -0400\n+++ ./configure\t2016-06-23 06:13:31.339362019 -0400\n@@ -24664,17 +24664,8 @@\n \n \n \n-  if test \"x$ul_default_estate\" != x; then\n-  enable_ipcmk=$ul_default_estate\n-  build_ipcmk=yes\n-  if test \"x$ul_default_estate\" = xno; then\n-    build_ipcmk=no\n-  fi\n-else\n-\n-  build_ipcmk=yes\n-  enable_ipcmk=yes\n-fi\n+  enable_ipcmk=no\n+  build_ipcmk=no\n \n  if test \"x$build_ipcmk\" = xyes; then\n   BUILD_IPCMK_TRUE=\n"
  },
  {
    "path": "packages/util-linux/fix-paths.patch",
    "content": "diff -uNr util-linux-2.34/include/pathnames.h util-linux-2.34.mod/include/pathnames.h\n--- util-linux-2.34/include/pathnames.h\t2019-06-06 13:38:50.260626816 +0300\n+++ util-linux-2.34.mod/include/pathnames.h\t2019-07-23 19:16:35.307804770 +0300\n@@ -198,4 +198,105 @@\n #define _PATH_DEV_RFKILL\t\"/dev/rfkill\"\n #define _PATH_SYS_RFKILL\t\"/sys/class/rfkill\"\n \n+// On Android (Termux) paths are different.\n+#if defined(__ANDROID__)\n+# undef _PATH_DEFPATH\n+# undef _PATH_DEFPATH_ROOT\n+# undef _PATH_HUSHLOGINS\n+# undef _PATH_NOLOGIN_TXT\n+# undef _PATH_MAILDIR\n+# undef _PATH_MOTDFILE\n+# undef _PATH_NOLOGIN\n+# undef _PATH_VAR_NOLOGIN\n+# undef _PATH_LOGIN\n+# undef _PATH_SHUTDOWN\n+# undef _PATH_POWEROFF\n+# undef _PATH_TERMCOLORS_DIR\n+# undef _PATH_PASSWD\n+# undef _PATH_GSHADOW\n+# undef _PATH_GROUP\n+# undef _PATH_SHADOW_PASSWD\n+# undef _PATH_SHELLS\n+# undef _PATH_BTMP\n+# undef _PATH_ISSUE\n+# undef _PATH_ISSUEDIR\n+# undef _PATH_OS_RELEASE_ETC\n+# undef _PATH_OS_RELEASE_USR\n+# undef _PATH_LOGINDEFS\n+# undef _PATH_WORDS\n+# undef _PATH_WORDS_ALT\n+# undef _PATH_FILESYSTEMS\n+# undef _PATH_MOUNTED\n+# undef _PATH_MNTTAB\n+# undef _PATH_DEV_LOOP\n+# undef _PATH_DEV_BYLABEL\n+# undef _PATH_DEV_BYUUID\n+# undef _PATH_DEV_BYID\n+# undef _PATH_DEV_BYPATH\n+# undef _PATH_DEV_BYPARTLABEL\n+# undef _PATH_DEV_BYPARTUUID\n+# undef _PATH_ADJTIME\n+\n+# define _PATH_DEFPATH         \"@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets\"\n+# define _PATH_DEFPATH_ROOT    _PATH_DEFPATH\n+\n+// Unused and not needed in Termux.\n+# define _PATH_HUSHLOGINS      \"@TERMUX_PREFIX@/etc/hushlogins\"\n+# define _PATH_NOLOGIN_TXT     \"@TERMUX_PREFIX@/etc/nologin.txt\"\n+# define _PATH_NOLOGIN         \"@TERMUX_PREFIX@/etc/nologin\"\n+# define _PATH_VAR_NOLOGIN     \"@TERMUX_PREFIX@/var/run/nologin\"\n+\n+# define _PATH_MAILDIR         \"@TERMUX_PREFIX@/var/spool/mail\"\n+# define _PATH_MOTDFILE        \"@TERMUX_PREFIX@/etc/motd\"\n+# define _PATH_LOGIN           \"@TERMUX_PREFIX@/bin/login\"\n+# define _PATH_SHUTDOWN        \"@TERMUX_PREFIX@/bin/shutdown\"\n+# define _PATH_POWEROFF        \"@TERMUX_PREFIX@/bin/poweroff\"\n+# define _PATH_TERMCOLORS_DIR  \"@TERMUX_PREFIX@/etc/\" _PATH_TERMCOLORS_DIRNAME\n+\n+// Termux doesn't support multiuser environment.\n+// Some Android versions support /etc/passwd and /etc/group but files\n+// /etc/shadow and /etc/gshadow are not supported.\n+# define _PATH_PASSWD          \"/system/etc/passwd\"\n+# define _PATH_GSHADOW         \"/system/etc/gshadow\"\n+# define _PATH_GROUP           \"/system/etc/group\"\n+# define _PATH_SHADOW_PASSWD   \"/system/etc/shadow\"\n+\n+// Ignored in Termux.\n+# define _PATH_SHELLS          \"@TERMUX_PREFIX@/etc/shells\"\n+\n+// btmp, (and utmp/wtmp) files are unsupported.\n+# define _PATH_BTMP            \"@TERMUX_PREFIX@/var/log/btmp\"\n+\n+# define _PATH_ISSUE           \"@TERMUX_PREFIX@/etc/issue\"\n+# define _PATH_ISSUEDIR        _PATH_ISSUE \".d\"\n+\n+// os release definition is not available in Termux.\n+# define _PATH_OS_RELEASE_ETC  \"@TERMUX_PREFIX@/etc/os-release\"\n+# define _PATH_OS_RELEASE_USR  \"@TERMUX_PREFIX@/lib/os-release\"\n+\n+// login configuration is unsupported.\n+# define _PATH_LOGINDEFS       \"@TERMUX_PREFIX@/etc/login.defs\"\n+\n+# define _PATH_WORDS           \"@TERMUX_PREFIX@/share/dict/words\"\n+# define _PATH_WORDS_ALT       \"@TERMUX_PREFIX@/share/dict/web2\"\n+\n+// Not available.\n+# define _PATH_FILESYSTEMS     \"@TERMUX_PREFIX@/etc/filesystems\"\n+\n+# define _PATH_MOUNTED         \"/proc/self/mounts\"\n+\n+// Not available.\n+# define _PATH_MNTTAB          \"@TERMUX_PREFIX@/etc/fstab\"\n+\n+# define _PATH_DEV_LOOP        \"/dev/block/loop\"\n+# define _PATH_DEV_BYLABEL     \"/dev/block/by-label\"\n+# define _PATH_DEV_BYUUID      \"/dev/block/by-uuid\"\n+# define _PATH_DEV_BYID        \"/dev/block/by-id\"\n+# define _PATH_DEV_BYPATH      \"/dev/block/by-path\"\n+# define _PATH_DEV_BYPARTLABEL \"/dev/block/by-name\"\n+# define _PATH_DEV_BYPARTUUID  \"/dev/block/by-partuuid\"\n+\n+# define _PATH_ADJTIME         \"@TERMUX_PREFIX@/etc/adjtime\"\n+#endif\n+\n #endif /* PATHNAMES_H */\ndiff -uNr util-linux-2.34/lib/exec_shell.c util-linux-2.34.mod/lib/exec_shell.c\n--- util-linux-2.34/lib/exec_shell.c\t2018-09-20 15:38:55.851404915 +0300\n+++ util-linux-2.34.mod/lib/exec_shell.c\t2019-07-23 19:16:35.311138086 +0300\n@@ -28,7 +28,7 @@\n \n #include \"exec_shell.h\"\n \n-#define DEFAULT_SHELL \"/bin/sh\"\n+#define DEFAULT_SHELL \"@TERMUX_PREFIX@/bin/sh\"\n \n void __attribute__((__noreturn__)) exec_shell(void)\n {\ndiff -uNr util-linux-2.34/lib/loopdev.c util-linux-2.34.mod/lib/loopdev.c\n--- util-linux-2.34/lib/loopdev.c\t2019-05-20 13:45:59.297373891 +0300\n+++ util-linux-2.34.mod/lib/loopdev.c\t2019-07-23 19:24:27.259011794 +0300\n@@ -105,13 +105,13 @@\n \t/* set new */\n \tif (device) {\n \t\tif (*device != '/') {\n-\t\t\tconst char *dir = _PATH_DEV;\n+\t\t\tconst char *dir = _PATH_DEV \"block/\";\n \n \t\t\t/* compose device name for /dev/loop<n> or /dev/loop/<n> */\n \t\t\tif (lc->flags & LOOPDEV_FL_DEVSUBDIR) {\n-\t\t\t\tif (strlen(device) < 5)\n+\t\t\t\tif (strlen(device) < 11)\n \t\t\t\t\treturn -1;\n-\t\t\t\tdevice += 4;\n+\t\t\t\tdevice += 10;\n \t\t\t\tdir = _PATH_DEV_LOOP \"/\";\t/* _PATH_DEV uses tailing slash */\n \t\t\t}\n \t\t\tsnprintf(lc->device, sizeof(lc->device), \"%s%s\",\ndiff -uNr util-linux-2.34/libblkid/src/blkidP.h util-linux-2.34.mod/libblkid/src/blkidP.h\n--- util-linux-2.34/libblkid/src/blkidP.h\t2019-04-10 14:28:20.589837335 +0300\n+++ util-linux-2.34.mod/libblkid/src/blkidP.h\t2019-07-23 19:16:35.311138086 +0300\n@@ -286,7 +286,7 @@\n #define BLKID_BIC_FL_CHANGED\t0x0004\t/* Cache has changed from disk */\n \n /* config file */\n-#define BLKID_CONFIG_FILE\t\"/etc/blkid.conf\"\n+#define BLKID_CONFIG_FILE\t\"@TERMUX_PREFIX@/etc/blkid.conf\"\n \n /* cache file on systemds with /run */\n #define BLKID_RUNTIME_TOPDIR\t\"/run\"\n@@ -294,7 +294,7 @@\n #define BLKID_CACHE_FILE\tBLKID_RUNTIME_DIR \"/blkid.tab\"\n \n /* old systems */\n-#define BLKID_CACHE_FILE_OLD\t\"/etc/blkid.tab\"\n+#define BLKID_CACHE_FILE_OLD\t\"@TERMUX_PREFIX@/etc/blkid.tab\"\n \n #define BLKID_PROBE_OK\t 0\n #define BLKID_PROBE_NONE 1\ndiff -uNr util-linux-2.34/libblkid/src/topology/dm.c util-linux-2.34.mod/libblkid/src/topology/dm.c\n--- util-linux-2.34/libblkid/src/topology/dm.c\t2019-02-22 12:17:43.709854171 +0200\n+++ util-linux-2.34.mod/libblkid/src/topology/dm.c\t2019-07-23 19:16:35.311138086 +0300\n@@ -30,9 +30,8 @@\n \t\tconst struct blkid_idmag *mag __attribute__((__unused__)))\n {\n \tconst char *paths[] = {\n-\t\t\"/usr/local/sbin/dmsetup\",\n-\t\t\"/usr/sbin/dmsetup\",\n-\t\t\"/sbin/dmsetup\"\n+\t\t\"@TERMUX_PREFIX@/bin/dmsetup\",\n+\t\t\"@TERMUX_PREFIX@/sbin/dmsetup\"\n \t};\n \tint dmpipe[] = { -1, -1 }, stripes, stripesize;\n \tconst char *cmd = NULL;\ndiff -uNr util-linux-2.34/libblkid/src/topology/lvm.c util-linux-2.34.mod/libblkid/src/topology/lvm.c\n--- util-linux-2.34/libblkid/src/topology/lvm.c\t2017-09-18 12:48:03.563891490 +0300\n+++ util-linux-2.34.mod/libblkid/src/topology/lvm.c\t2019-07-23 19:16:35.311138086 +0300\n@@ -36,9 +36,8 @@\n \t\tconst struct blkid_idmag *mag __attribute__((__unused__)))\n {\n \tconst char *paths[] = {\n-\t\t\"/usr/local/sbin/lvdisplay\",\n-\t\t\"/usr/sbin/lvdisplay\",\n-\t\t\"/sbin/lvdisplay\"\n+\t\t\"@TERMUX_PREFIX@/bin/lvdisplay\",\n+\t\t\"@TERMUX_PREFIX@/sbin/lvdisplay\"\n \t};\n \tint lvpipe[] = { -1, -1 }, stripes = 0, stripesize = 0;\n \tFILE *stream = NULL;\ndiff -uNr util-linux-2.34/libmount/src/cache.c util-linux-2.34.mod/libmount/src/cache.c\n--- util-linux-2.34/libmount/src/cache.c\t2019-02-22 12:17:43.714854129 +0200\n+++ util-linux-2.34.mod/libmount/src/cache.c\t2019-07-23 19:21:32.059762352 +0300\n@@ -632,7 +632,7 @@\n \t/* users assume backing file name rather than /dev/loopN in\n \t * output if the device has been initialized by mount(8).\n \t */\n-\tif (strncmp(pretty, \"/dev/loop\", 9) == 0) {\n+\tif (strncmp(pretty, \"/dev/block/loop\", 15) == 0) {\n \t\tstruct loopdev_cxt lc;\n \n \t\tif (loopcxt_init(&lc, 0) || loopcxt_set_device(&lc, pretty))\ndiff -uNr util-linux-2.34/libmount/src/context_loopdev.c util-linux-2.34.mod/libmount/src/context_loopdev.c\n--- util-linux-2.34/libmount/src/context_loopdev.c\t2019-02-22 12:17:43.715854121 +0200\n+++ util-linux-2.34.mod/libmount/src/context_loopdev.c\t2019-07-23 19:19:49.540220036 +0300\n@@ -129,7 +129,7 @@\n \n \t\trc = 0;\n \n-\t\tif (strncmp(src, \"/dev/loop\", 9) == 0) {\n+\t\tif (strncmp(src, \"/dev/block/loop\", 15) == 0) {\n \t\t\trc = loopdev_is_used((char *) src, bf, offset, 0, LOOPDEV_FL_OFFSET);\n \n \t\t} else if (opts && (cxt->user_mountflags & MNT_MS_LOOP) &&\ndiff -uNr util-linux-2.34/libmount/src/tab.c util-linux-2.34.mod/libmount/src/tab.c\n--- util-linux-2.34/libmount/src/tab.c\t2019-06-13 14:26:04.945525193 +0300\n+++ util-linux-2.34.mod/libmount/src/tab.c\t2019-07-23 19:20:49.923281905 +0300\n@@ -1758,7 +1758,7 @@\n \t\t\tint flags = 0;\n \n \t\t\tif (!mnt_fs_get_srcpath(fs) ||\n-\t\t\t    !startswith(mnt_fs_get_srcpath(fs), \"/dev/loop\"))\n+\t\t\t    !startswith(mnt_fs_get_srcpath(fs), \"/dev/block/loop\"))\n \t\t\t\tcontinue;\t/* does not look like loopdev */\n \n \t\t\tif (mnt_fs_get_option(fstab_fs, \"offset\", &val, &len) == 0) {\ndiff -uNr util-linux-2.34/libuuid/src/uuidd.h util-linux-2.34.mod/libuuid/src/uuidd.h\n--- util-linux-2.34/libuuid/src/uuidd.h\t2018-06-04 10:57:02.806445781 +0300\n+++ util-linux-2.34.mod/libuuid/src/uuidd.h\t2019-07-23 19:16:35.311138086 +0300\n@@ -38,7 +38,7 @@\n #define UUIDD_DIR\t\t_PATH_RUNSTATEDIR \"/uuidd\"\n #define UUIDD_SOCKET_PATH\tUUIDD_DIR \"/request\"\n #define UUIDD_PIDFILE_PATH\tUUIDD_DIR \"/uuidd.pid\"\n-#define UUIDD_PATH\t\t\"/usr/sbin/uuidd\"\n+#define UUIDD_PATH\t\t\"@TERMUX_PREFIX@/bin/uuidd\"\n \n #define UUIDD_OP_GETPID\t\t\t0\n #define UUIDD_OP_GET_MAXOP\t\t1\ndiff -uNr util-linux-2.34/libuuid/src/uuidP.h util-linux-2.34.mod/libuuid/src/uuidP.h\n--- util-linux-2.34/libuuid/src/uuidP.h\t2019-02-22 12:17:43.722854062 +0200\n+++ util-linux-2.34.mod/libuuid/src/uuidP.h\t2019-07-23 19:16:35.311138086 +0300\n@@ -37,7 +37,7 @@\n \n #include \"uuid.h\"\n \n-#define LIBUUID_CLOCK_FILE\t\"/var/lib/libuuid/clock.txt\"\n+#define LIBUUID_CLOCK_FILE\t\"@TERMUX_PREFIX@/var/lib/libuuid/clock.txt\"\n \n /*\n  * Offset between 15-Oct-1582 and 1-Jan-70\ndiff -uNr util-linux-2.34/login-utils/login.c util-linux-2.34.mod/login-utils/login.c\n--- util-linux-2.34/login-utils/login.c\t2019-05-27 12:53:09.756205982 +0300\n+++ util-linux-2.34.mod/login-utils/login.c\t2019-07-23 19:16:35.311138086 +0300\n@@ -1359,7 +1359,7 @@\n \n \t\tstrcpy(buff, \"exec \");\n \t\tstrcat(buff, pwd->pw_shell);\n-\t\tchildArgv[childArgc++] = \"/bin/sh\";\n+\t\tchildArgv[childArgc++] = \"@TERMUX_PREFIX@/bin/sh\";\n \t\tchildArgv[childArgc++] = \"-sh\";\n \t\tchildArgv[childArgc++] = \"-c\";\n \t\tchildArgv[childArgc++] = buff;\n@@ -1378,7 +1378,7 @@\n \n \texecvp(childArgv[0], childArgv + 1);\n \n-\tif (!strcmp(childArgv[0], \"/bin/sh\"))\n+\tif (!strcmp(childArgv[0], \"@TERMUX_PREFIX@/bin/sh\"))\n \t\twarn(_(\"couldn't exec shell script\"));\n \telse\n \t\twarn(_(\"no shell\"));\ndiff -uNr util-linux-2.34/login-utils/su-common.c util-linux-2.34.mod/login-utils/su-common.c\n--- util-linux-2.34/login-utils/su-common.c\t2019-04-24 13:44:31.858967658 +0300\n+++ util-linux-2.34.mod/login-utils/su-common.c\t2019-07-23 19:16:35.314471404 +0300\n@@ -96,7 +96,7 @@\n #define is_pam_failure(_rc)\t((_rc) != PAM_SUCCESS)\n \n /* The shell to run if none is given in the user's passwd entry.  */\n-#define DEFAULT_SHELL \"/bin/sh\"\n+#define DEFAULT_SHELL \"@TERMUX_PREFIX@/bin/sh\"\n \n /* The user to become if none is specified.  */\n #define DEFAULT_USER \"root\"\ndiff -uNr util-linux-2.34/login-utils/sulogin.c util-linux-2.34.mod/login-utils/sulogin.c\n--- util-linux-2.34/login-utils/sulogin.c\t2019-05-20 13:35:38.631791539 +0300\n+++ util-linux-2.34.mod/login-utils/sulogin.c\t2019-07-23 19:16:35.314471404 +0300\n@@ -743,7 +743,7 @@\n \t\tif (pwd->pw_shell[0])\n \t\t\tsu_shell = pwd->pw_shell;\n \t\telse\n-\t\t\tsu_shell = \"/bin/sh\";\n+\t\t\tsu_shell = \"@TERMUX_PREFIX@/bin/sh\";\n \t}\n \tif ((p = strrchr(su_shell, '/')) == NULL)\n \t\tp = su_shell;\n@@ -792,9 +792,9 @@\n \texecl(su_shell, shell, NULL);\n \twarn(_(\"failed to execute %s\"), su_shell);\n \n-\txsetenv(\"SHELL\", \"/bin/sh\", 1);\n-\texecl(\"/bin/sh\", profile ? \"-sh\" : \"sh\", NULL);\n-\twarn(_(\"failed to execute %s\"), \"/bin/sh\");\n+\txsetenv(\"SHELL\", \"@TERMUX_PREFIX@/bin/sh\", 1);\n+\texecl(\"@TERMUX_PREFIX@/bin/sh\", profile ? \"-sh\" : \"sh\", NULL);\n+\twarn(_(\"failed to execute %s\"), \"@TERMUX_PREFIX@/bin/sh\");\n }\n \n static void usage(void)\ndiff -uNr util-linux-2.34/misc-utils/whereis.c util-linux-2.34.mod/misc-utils/whereis.c\n--- util-linux-2.34/misc-utils/whereis.c\t2019-05-23 14:51:09.593338063 +0300\n+++ util-linux-2.34.mod/misc-utils/whereis.c\t2019-07-23 19:16:35.314471404 +0300\n@@ -97,82 +97,21 @@\n };\n \n static const char *bindirs[] = {\n-\t\"/usr/bin\",\n-\t\"/usr/sbin\",\n-\t\"/bin\",\n-\t\"/sbin\",\n-#if defined(MULTIARCHTRIPLET)\n-\t\"/lib/\" MULTIARCHTRIPLET,\n-\t\"/usr/lib/\" MULTIARCHTRIPLET,\n-\t\"/usr/local/lib/\" MULTIARCHTRIPLET,\n-#endif\n-\t\"/usr/lib\",\n-\t\"/usr/lib64\",\n-\t\"/etc\",\n-\t\"/usr/etc\",\n-\t\"/lib\",\n-\t\"/lib64\",\n-\t\"/usr/games\",\n-\t\"/usr/games/bin\",\n-\t\"/usr/games/lib\",\n-\t\"/usr/emacs/etc\",\n-\t\"/usr/lib/emacs/*/etc\",\n-\t\"/usr/TeX/bin\",\n-\t\"/usr/tex/bin\",\n-\t\"/usr/interviews/bin/LINUX\",\n-\n-\t\"/usr/X11R6/bin\",\n-\t\"/usr/X386/bin\",\n-\t\"/usr/bin/X11\",\n-\t\"/usr/X11/bin\",\n-\t\"/usr/X11R5/bin\",\n-\n-\t\"/usr/local/bin\",\n-\t\"/usr/local/sbin\",\n-\t\"/usr/local/etc\",\n-\t\"/usr/local/lib\",\n-\t\"/usr/local/games\",\n-\t\"/usr/local/games/bin\",\n-\t\"/usr/local/emacs/etc\",\n-\t\"/usr/local/TeX/bin\",\n-\t\"/usr/local/tex/bin\",\n-\t\"/usr/local/bin/X11\",\n-\n-\t\"/usr/contrib\",\n-\t\"/usr/hosts\",\n-\t\"/usr/include\",\n-\n-\t\"/usr/g++-include\",\n-\n-\t\"/usr/ucb\",\n-\t\"/usr/old\",\n-\t\"/usr/new\",\n-\t\"/usr/local\",\n-\t\"/usr/libexec\",\n-\t\"/usr/share\",\n-\n-\t\"/opt/*/bin\",\n+\t\"@TERMUX_PREFIX@/bin\",\n+\t\"@TERMUX_PREFIX@/bin/applets\",\n+\t\"/system/bin\",\n+\t\"/system/xbin\",\n \tNULL\n };\n \n static const char *mandirs[] = {\n-\t\"/usr/man/*\",\n-\t\"/usr/share/man/*\",\n-\t\"/usr/X386/man/*\",\n-\t\"/usr/X11/man/*\",\n-\t\"/usr/TeX/man/*\",\n-\t\"/usr/interviews/man/mann\",\n-\t\"/usr/share/info\",\n+\t\"@TERMUX_PREFIX@/share/man/*\",\n+\t\"@TERMUX_PREFIX@/share/info\",\n \tNULL\n };\n \n static const char *srcdirs[] = {\n-\t\"/usr/src/*\",\n-\t\"/usr/src/lib/libc/*\",\n-\t\"/usr/src/lib/libc/net/*\",\n-\t\"/usr/src/ucb/pascal\",\n-\t\"/usr/src/ucb/pascal/utilities\",\n-\t\"/usr/src/undoc\",\n+\t\"@TERMUX_PREFIX@/src\",\n \tNULL\n };\n \ndiff -uNr util-linux-2.34/sys-utils/setarch.c util-linux-2.34.mod/sys-utils/setarch.c\n--- util-linux-2.34/sys-utils/setarch.c\t2019-05-28 14:07:37.094903856 +0300\n+++ util-linux-2.34.mod/sys-utils/setarch.c\t2019-07-23 19:16:35.314471404 +0300\n@@ -328,7 +328,7 @@\n \t\t/* Don't use ifdef sparc here, we get \"Unrecognized architecture\"\n \t\t * error message later if necessary */\n \t\tif (strcmp(arch, \"sparc32bash\") == 0) {\n-\t\t\tshell = \"/bin/bash\";\n+\t\t\tshell = \"@TERMUX_PREFIX@/bin/bash\";\n \t\t\tshell_arg = \"\";\n \t\t\tgoto set_arch;\n \t\t}\n@@ -437,7 +437,7 @@\n \t\tverify_arch_domain(target, arch);\n \n \tif (!argc) {\n-\t\tshell = \"/bin/sh\";\n+\t\tshell = \"@TERMUX_PREFIX@/bin/sh\";\n \t\tshell_arg = \"-sh\";\n \t}\n \tif (verbose) {\ndiff -uNr util-linux-2.34/sys-utils/setpriv.c util-linux-2.34.mod/sys-utils/setpriv.c\n--- util-linux-2.34/sys-utils/setpriv.c\t2019-05-28 14:10:54.998680500 +0300\n+++ util-linux-2.34.mod/sys-utils/setpriv.c\t2019-07-23 19:16:35.314471404 +0300\n@@ -58,7 +58,7 @@\n #define SETPRIV_EXIT_PRIVERR 127\t/* how we exit when we fail to set privs */\n \n /* The shell to set SHELL env.variable if none is given in the user's passwd entry.  */\n-#define DEFAULT_SHELL \"/bin/sh\"\n+#define DEFAULT_SHELL \"@TERMUX_PREFIX@/bin/sh\"\n \n static gid_t get_group(const char *s, const char *err);\n \ndiff -uNr util-linux-2.34/text-utils/more.c util-linux-2.34.mod/text-utils/more.c\n--- util-linux-2.34/text-utils/more.c\t2019-04-24 12:02:03.133448736 +0300\n+++ util-linux-2.34.mod/text-utils/more.c\t2019-07-23 19:16:35.314471404 +0300\n@@ -1877,7 +1877,7 @@\n \n \t\t}\n \t\tif ((ctl->shell = getenv(\"SHELL\")) == NULL)\n-\t\t\tctl->shell = \"/bin/sh\";\n+\t\t\tctl->shell = \"@TERMUX_PREFIX@/bin/sh\";\n \t}\n \tctl->no_tty_in = tcgetattr(STDIN_FILENO, &ctl->output_tty);\n \ttcgetattr(STDERR_FILENO, &ctl->output_tty);\ndiff -uNr util-linux-2.34/text-utils/pg.c util-linux-2.34.mod/text-utils/pg.c\n--- util-linux-2.34/text-utils/pg.c\t2019-04-24 12:02:03.133448736 +0300\n+++ util-linux-2.34.mod/text-utils/pg.c\t2019-07-23 19:16:35.317804721 +0300\n@@ -1365,7 +1365,7 @@\n \t\t\t\t\t{\n \t\t\t\t\t\tconst char *sh = getenv(\"SHELL\");\n \t\t\t\t\t\tif (!sh)\n-\t\t\t\t\t\t\tsh = \"/bin/sh\";\n+\t\t\t\t\t\t\tsh = \"@TERMUX_PREFIX@/bin/sh\";\n \t\t\t\t\t\tif (!nobuf)\n \t\t\t\t\t\t\tfclose(fbuf);\n \t\t\t\t\t\tfclose(find);\n"
  },
  {
    "path": "packages/util-linux/lib-ismounted.c.patch",
    "content": "diff -u -r ../util-linux-2.29.2/lib/ismounted.c ./lib/ismounted.c\n--- ../util-linux-2.29.2/lib/ismounted.c\t2017-02-22 11:16:55.241092792 +0100\n+++ ./lib/ismounted.c\t2017-06-29 00:29:03.385122232 +0200\n@@ -143,7 +143,7 @@\n #endif /* __GNU__ */\n \t*mount_flags = MF_MOUNTED;\n \n-#ifdef MNTOPT_RO\n+#if defined(MNTOPT_RO) && !defined(__ANDROID__)\n \t/* Check to see if the ro option is set */\n \tif (hasmntopt(mnt, MNTOPT_RO))\n \t\t*mount_flags |= MF_READONLY;\n"
  },
  {
    "path": "packages/util-linux/sys-utils-ipcutils.c.patch",
    "content": "diff -uNr util-linux-2.33/sys-utils/ipcutils.c util-linux-2.33.mod/sys-utils/ipcutils.c\n--- util-linux-2.33/sys-utils/ipcutils.c\t2018-09-20 15:38:55.955404280 +0300\n+++ util-linux-2.33.mod/sys-utils/ipcutils.c\t2018-11-09 14:26:56.564588140 +0200\n@@ -18,6 +18,9 @@\n \n int ipc_msg_get_limits(struct ipc_limits *lim)\n {\n+#ifdef __ANDROID__\n+   return -1;\n+#else\n \tif (access(_PATH_PROC_IPC_MSGMNI, F_OK) == 0 &&\n \t    access(_PATH_PROC_IPC_MSGMNB, F_OK) == 0 &&\n \t    access(_PATH_PROC_IPC_MSGMAX, F_OK) == 0) {\n@@ -36,10 +39,14 @@\n \t}\n \n \treturn 0;\n+#endif\n }\n \n int ipc_sem_get_limits(struct ipc_limits *lim)\n {\n+#ifdef __ANDROID__\n+\treturn -1;\n+#else\n \tFILE *f;\n \tint rc = 0;\n \n@@ -65,10 +72,14 @@\n \t}\n \n \treturn 0;\n+#endif\n }\n \n int ipc_shm_get_limits(struct ipc_limits *lim)\n {\n+#ifdef __ANDROID__\n+\treturn -1;\n+#else\n \tlim->shmmin = SHMMIN;\n \n \tif (access(_PATH_PROC_IPC_SHMALL, F_OK) == 0 &&\n@@ -92,10 +103,14 @@\n \t}\n \n \treturn 0;\n+#endif\n }\n \n int ipc_shm_get_info(int id, struct shm_data **shmds)\n {\n+#ifdef __ANDROID__\n+\treturn -1;\n+#else\n \tFILE *f;\n \tint i = 0, maxid;\n \tchar buf[BUFSIZ];\n@@ -200,17 +215,23 @@\n \tif (i == 0)\n \t\tfree(*shmds);\n \treturn i;\n+#endif\n }\n \n void ipc_shm_free_info(struct shm_data *shmds)\n {\n+#ifdef __ANDROID__\n+\treturn;\n+#else\n \twhile (shmds) {\n \t\tstruct shm_data *next = shmds->next;\n \t\tfree(shmds);\n \t\tshmds = next;\n \t}\n+#endif\n }\n \n+#ifndef __ANDROID__\n static void get_sem_elements(struct sem_data *p)\n {\n \tsize_t i;\n@@ -241,9 +262,13 @@\n \t\t\terr(EXIT_FAILURE, _(\"%s failed\"), \"semctl(GETPID)\");\n \t}\n }\n+#endif\n \n int ipc_sem_get_info(int id, struct sem_data **semds)\n {\n+#ifdef __ANDROID__\n+\treturn -1;\n+#else\n \tFILE *f;\n \tint i = 0, maxid;\n \tstruct sem_data *p;\n@@ -338,20 +363,28 @@\n \tif (i == 0)\n \t\tfree(*semds);\n \treturn i;\n+#endif\n }\n \n void ipc_sem_free_info(struct sem_data *semds)\n {\n+#ifdef __ANDROID__\n+\treturn;\n+#else\n \twhile (semds) {\n \t\tstruct sem_data *next = semds->next;\n \t\tfree(semds->elements);\n \t\tfree(semds);\n \t\tsemds = next;\n \t}\n+#endif\n }\n \n int ipc_msg_get_info(int id, struct msg_data **msgds)\n {\n+#ifdef __ANDROID__\n+\treturn -1;\n+#else\n \tFILE *f;\n \tint i = 0, maxid;\n \tstruct msg_data *p;\n@@ -450,19 +483,27 @@\n \tif (i == 0)\n \t\tfree(*msgds);\n \treturn i;\n+#endif\n }\n \n void ipc_msg_free_info(struct msg_data *msgds)\n {\n+#ifdef __ANDROID__\n+\treturn;\n+#else\n \twhile (msgds) {\n \t\tstruct msg_data *next = msgds->next;\n \t\tfree(msgds);\n \t\tmsgds = next;\n \t}\n+#endif\n }\n \n void ipc_print_perms(FILE *f, struct ipc_stat *is)\n {\n+#ifdef __ANDROID__\n+\treturn;\n+#else\n \tstruct passwd *pw;\n \tstruct group *gr;\n \n@@ -487,11 +528,15 @@\n \t\tfprintf(f, \" %-10s\\n\", gr->gr_name);\n \telse\n \t\tfprintf(f, \" %-10u\\n\", is->gid);\n+#endif\n }\n \n void ipc_print_size(int unit, char *msg, uint64_t size, const char *end,\n \t\t    int width)\n {\n+#ifdef __ANDROID__\n+\treturn;\n+#else\n \tchar format[32];\n \n \tif (!msg)\n@@ -530,4 +575,5 @@\n \n \tif (end)\n \t\tprintf(\"%s\", end);\n+#endif\n }\n"
  },
  {
    "path": "packages/util-linux/sys-utils-ipcutils.h.patch",
    "content": "diff -u -r ../util-linux-2.29.2/sys-utils/ipcutils.h ./sys-utils/ipcutils.h\n--- ../util-linux-2.29.2/sys-utils/ipcutils.h\t2016-11-02 13:57:31.661167155 +0100\n+++ ./sys-utils/ipcutils.h\t2017-03-06 03:13:00.055879319 +0100\n@@ -5,8 +5,6 @@\n #include <stdlib.h>\n #include <sys/ipc.h>\n #include <sys/msg.h>\n-#include <sys/sem.h>\n-#include <sys/shm.h>\n #include <sys/types.h>\n #include <time.h>\n"
  },
  {
    "path": "packages/valac/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/Vala\nTERMUX_PKG_DESCRIPTION=\"C# like language for the GObject system\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Vishal Biswas @vishalbiswas\"\nTERMUX_PKG_VERSION=0.44.6\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://download.gnome.org/sources/vala/${TERMUX_PKG_VERSION:0:4}/vala-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=ab9f1756af7460aa1e39c9a7388f5492a4252a3cd9c76b02f2033f1dedcd793a\nTERMUX_PKG_DEPENDS=\"clang, glib, pkg-config\"\nTERMUX_PKG_BREAKS=\"valac-dev\"\nTERMUX_PKG_REPLACES=\"valac-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-cgraph=no\"\n\ntermux_step_post_make_install() {\n\tcd $TERMUX_PREFIX/lib\n\tln -s -f vala-${TERMUX_PKG_VERSION:0:4}/libvalaccodegen.so libvalaccodegen.so\n}\n"
  },
  {
    "path": "packages/valac/valadoc.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"bin/valadoc* lib/libvaladoc* lib/valadoc/ share/valadoc share/man/man1/valadoc*\"\nTERMUX_SUBPKG_DESCRIPTION=\"API documentation generator for vala\"\nTERMUX_SUBPKG_DEPENDS=\"graphviz\"\n"
  },
  {
    "path": "packages/valgrind/aarch64-setjmp.S",
    "content": "/*\n * Copyright (C) 2013 The Android Open Source Project\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *  * Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *  * Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#ifdef __aarch64__\n\n// Copied and simplified macros from bionic_asm.h.\n\n#define ENTRY(f) \\\n    .text; \\\n    .globl f; \\\n    .type f, @function; \\\n    f: \\\n    .cfi_startproc \\\n\n#define END(f) \\\n    .cfi_endproc; \\\n    .size f, .-f; \\\n\n// According to AARCH64 PCS document we need to save the following\n// registers:\n//\n// Core     x19 - x30, sp (see section 5.1.1)\n// VFP      d8 - d15 (see section 5.1.2)\n//\n// NOTE: All the registers saved here will have 64 bit values.\n//       AAPCS mandates that the higher part of q registers do not need to\n//       be saved by the callee.\n//\n// The internal structure of a jmp_buf is totally private.\n// Current layout (changes from release to release):\n//\n// word   name            description\n// 0      sigflag/cookie  setjmp cookie in top 31 bits, signal mask flag in low bit\n// 1      sigmask         signal mask (not used with _setjmp / _longjmp)\n// 2      core_base       base of core registers (x19-x30, sp)\n// 15     float_base      base of float registers (d8-d15)\n// 23     checksum        checksum of core registers\n// 24     reserved        reserved entries (room to grow)\n// 32\n\n// 'sigmask' and 'checksum' are not used in this simplified version for valgrind.\n\n#define _JB_SIGFLAG     0\n#define _JB_SIGMASK     (_JB_SIGFLAG + 1)\n#define _JB_X30_SP      (_JB_SIGMASK + 1)\n#define _JB_X28_X29     (_JB_X30_SP  + 2)\n#define _JB_X26_X27     (_JB_X28_X29 + 2)\n#define _JB_X24_X25     (_JB_X26_X27 + 2)\n#define _JB_X22_X23     (_JB_X24_X25 + 2)\n#define _JB_X20_X21     (_JB_X22_X23 + 2)\n#define _JB_X19         (_JB_X20_X21 + 2)\n#define _JB_D14_D15     (_JB_X19 + 1)\n#define _JB_D12_D13     (_JB_D14_D15 + 2)\n#define _JB_D10_D11     (_JB_D12_D13 + 2)\n#define _JB_D8_D9       (_JB_D10_D11 + 2)\n\n// int setjmp(jmp_buf env);\nENTRY(setjmp)\n  // Save core registers.\n  mov x10, sp\n  stp x30, x10, [x0, #(_JB_X30_SP  * 8)]\n  stp x28, x29, [x0, #(_JB_X28_X29 * 8)]\n  stp x26, x27, [x0, #(_JB_X26_X27 * 8)]\n  stp x24, x25, [x0, #(_JB_X24_X25 * 8)]\n  stp x22, x23, [x0, #(_JB_X22_X23 * 8)]\n  stp x20, x21, [x0, #(_JB_X20_X21 * 8)]\n  str x19,      [x0, #(_JB_X19     * 8)]\n\n  // Save floating point registers.\n  stp d14, d15, [x0, #(_JB_D14_D15 * 8)]\n  stp d12, d13, [x0, #(_JB_D12_D13 * 8)]\n  stp d10, d11, [x0, #(_JB_D10_D11 * 8)]\n  stp d8,  d9,  [x0, #(_JB_D8_D9   * 8)]\n\n  mov w0, #0\n  ret\nEND(setjmp)\n\n// void longjmp(jmp_buf env, int value);\nENTRY(longjmp)\n  // Restore core registers.\n  ldp x30, x10, [x0, #(_JB_X30_SP  * 8)]\n  ldp x28, x29, [x0, #(_JB_X28_X29 * 8)]\n  ldp x26, x27, [x0, #(_JB_X26_X27 * 8)]\n  ldp x24, x25, [x0, #(_JB_X24_X25 * 8)]\n  ldp x22, x23, [x0, #(_JB_X22_X23 * 8)]\n  ldp x20, x21, [x0, #(_JB_X20_X21 * 8)]\n  ldr x19,      [x0, #(_JB_X19     * 8)]\n  mov sp, x10\n\n  // Restore floating point registers.\n  ldp d14, d15, [x0, #(_JB_D14_D15 * 8)]\n  ldp d12, d13, [x0, #(_JB_D12_D13 * 8)]\n  ldp d10, d11, [x0, #(_JB_D10_D11 * 8)]\n  ldp d8,  d9,  [x0, #(_JB_D8_D9   * 8)]\n\n  // Set return value.\n  cmp w1, wzr\n  csinc w0, w1, wzr, ne\n  ret\nEND(longjmp)\n\n#endif  // __aarch64__\n"
  },
  {
    "path": "packages/valgrind/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://valgrind.org/\nTERMUX_PKG_DESCRIPTION=\"Instrumentation framework for building dynamic analysis tools\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=3.15.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1\nTERMUX_PKG_BREAKS=\"valgrind-dev\"\nTERMUX_PKG_REPLACES=\"valgrind-dev\"\nTERMUX_PKG_SRCURL=ftp://sourceware.org/pub/valgrind/valgrind-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-tmpdir=$TERMUX_PREFIX/tmp\"\n\ntermux_step_pre_configure() {\n\tif [ \"$TERMUX_ARCH\" == \"aarch64\" ]; then\n\t\tcp $TERMUX_PKG_BUILDER_DIR/aarch64-setjmp.S $TERMUX_PKG_SRCDIR\n\t\tautoreconf -if\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --enable-only64bit\"\n\telif [ \"$TERMUX_ARCH\" == \"arm\" ]; then\n\t\t# valgrind doesn't like arm; armv7 works, though.\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --host=armv7-linux-androideabi\"\n\t\t# http://lists.busybox.net/pipermail/buildroot/2013-November/082270.html:\n\t\t# \"valgrind uses inline assembly that is not Thumb compatible\":\n\t\tCFLAGS=${CFLAGS/-mthumb/}\n\tfi\n\n\tCFLAGS=${CFLAGS/-fstack-protector-strong/}\n}\n"
  },
  {
    "path": "packages/valgrind/coregrind-vgdb.c.patch",
    "content": "diff -u -r ../valgrind-3.15.0/coregrind/vgdb.c ./coregrind/vgdb.c\n--- ../valgrind-3.15.0/coregrind/vgdb.c\t2019-04-13 10:56:21.000000000 +0000\n+++ ./coregrind/vgdb.c\t2019-04-17 21:03:04.737363007 +0000\n@@ -682,10 +682,7 @@\n       sigpipe++;\n    } else if (signum == SIGALRM) {\n       sigalrm++;\n-#if defined(VGPV_arm_linux_android) \\\n-    || defined(VGPV_x86_linux_android) \\\n-    || defined(VGPV_mips32_linux_android) \\\n-    || defined(VGPV_arm64_linux_android)\n+#if defined(__ANDROID__)\n       /* Android has no pthread_cancel. As it also does not have\n          an invoker implementation, there is no need for cleanup action.\n          So, we just do nothing. */\n"
  },
  {
    "path": "packages/valgrind/coregrindmake.am.patch",
    "content": "--- ../cache/valgrind-3.13.0/coregrind/Makefile.am\t2017-05-31 15:14:31.000000000 +0000\n+++ ./coregrind/Makefile.am\t2018-08-19 00:35:33.162856194 +0000\n@@ -378,6 +378,7 @@\n \tm_dispatch/dispatch-amd64-darwin.S \\\n \tm_dispatch/dispatch-x86-solaris.S \\\n \tm_dispatch/dispatch-amd64-solaris.S \\\n+\t../aarch64-setjmp.S \\\n \tm_gdbserver/inferiors.c \\\n \tm_gdbserver/m_gdbserver.c \\\n \tm_gdbserver/regcache.c \\\n"
  },
  {
    "path": "packages/valgrind/dont-redefine-elf32_nhdr.patch",
    "content": "Binary files src/coregrind/m_coredump/.coredump-elf.c.swp and src2/coregrind/m_coredump/.coredump-elf.c.swp differ\ndiff -purN src/coregrind/m_coredump/coredump-elf.c src2/coregrind/m_coredump/coredump-elf.c\n--- src/coregrind/m_coredump/coredump-elf.c\t2016-06-09 19:42:06.566486519 +0000\n+++ src2/coregrind/m_coredump/coredump-elf.c\t2015-09-08 13:23:27.000000000 +0000\n@@ -135,18 +135,6 @@ static void fill_phdr(ESZ(Phdr) *phdr, c\n    phdr->p_align = VKI_PAGE_SIZE;\n }\n \n-#if defined(VGPV_arm_linux_android) || defined(VGPV_x86_linux_android) \\\n-    || defined(VGPV_mips32_linux_android)\n-/* Android's libc doesn't provide a definition for this.  Hence: */\n-typedef\n-   struct {\n-      Elf32_Word n_namesz;\n-      Elf32_Word n_descsz;\n-      Elf32_Word n_type;\n-   }\n-   Elf32_Nhdr;\n-#endif\n-\n struct note {\n    struct note *next;\n    ESZ(Nhdr) note;\n"
  },
  {
    "path": "packages/valgrind/libcsetjmp.h.patch",
    "content": "--- ../cache/valgrind-3.13.0/include/pub_tool_libcsetjmp.h\t2017-05-31 15:14:14.000000000 +0000\n+++ ./include/pub_tool_libcsetjmp.h\t2018-08-17 23:14:23.768384982 +0000\n@@ -120,6 +120,16 @@\n __attribute__((noreturn))\n void  VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));\n \n+\n+#elif defined(__ANDROID__) && defined(__aarch64__)\n+\n+/* Android clang/llvm has no __builtin_{setjmp,longjmp} for aarch64. */\n+/* Use the same setjmp/longjmp functions for both gcc and clang.     */\n+#define VG_MINIMAL_JMP_BUF(_name) jmp_buf _name\n+#define VG_MINIMAL_SETJMP(_env)   ((UWord)(setjmp((_env))))\n+#define VG_MINIMAL_LONGJMP(_env)  longjmp((_env),1)\n+\n+\n #elif defined(VGP_mips64_linux)\n \n #define VG_MINIMAL_JMP_BUF(_name)        ULong _name [168 / sizeof(ULong)]\n"
  },
  {
    "path": "packages/valgrind/memcheckmake.am.patch",
    "content": "--- ../cache/valgrind-3.13.0/memcheck/Makefile.am\t2017-05-31 15:14:03.000000000 +0000\n+++ ./memcheck/Makefile.am\t2018-08-19 00:20:49.488266235 +0000\n@@ -27,6 +27,7 @@\n \tmc_main.c \\\n \tmc_translate.c \\\n \tmc_machine.c \\\n+\t../aarch64-setjmp.S \\\n \tmc_errors.c\n \n memcheck_@VGCONF_ARCH_PRI@_@VGCONF_OS@_SOURCES      = \\\n"
  },
  {
    "path": "packages/valgrind/vg_preloaded.c.patch",
    "content": "--- ./coregrind/vg_preloaded.c.orig\t2019-05-08 23:37:08.483459377 +0000\n+++ ./coregrind/vg_preloaded.c\t2019-05-08 23:37:43.340001515 +0000\n@@ -61,7 +61,8 @@\n       && !defined(VGPV_arm_linux_android) \\\n       && !defined(VGPV_x86_linux_android) \\\n       && !defined(VGPV_mips32_linux_android) \\\n-      && !defined(VGPV_arm64_linux_android)\n+      && !defined(VGPV_arm64_linux_android) \\\n+      && !defined(VGPV_amd64_linux_android)\n \n    /* g++ mangled __gnu_cxx::__freeres yields -> _ZN9__gnu_cxx9__freeresEv */\n    extern void _ZN9__gnu_cxx9__freeresEv(void) __attribute__((weak));\n"
  },
  {
    "path": "packages/vcsh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/RichiH/vcsh\nTERMUX_PKG_DESCRIPTION=\"Config manager based on Git\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.20151229\nTERMUX_PKG_SHA256=ae069506b0490287aefa582ab4e6af1c7ebc4dca743b17d91e0c8d0327d7a3fa\nTERMUX_PKG_SRCURL=https://github.com/RichiH/vcsh/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"git\"\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\"all=\"\n"
  },
  {
    "path": "packages/vegeta/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/tsenart/vegeta\nTERMUX_PKG_DESCRIPTION=\"HTTP load testing tool\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=12.7.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/tsenart/vegeta/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=0e6882d2044e8dc1979f4cd2d96ccbfc47db8ac575f66ebf1020f98d702988a9\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/github.com/tsenart\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/tsenart/vegeta\n\n\tcd \"$GOPATH\"/src/github.com/tsenart/vegeta\n\tgo get -d -v github.com/tsenart/vegeta\n\tgo build\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/src/github.com/tsenart/vegeta/vegeta \\\n\t\t\"$TERMUX_PREFIX\"/bin/vegeta\n}\n"
  },
  {
    "path": "packages/vifm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://vifm.info/\nTERMUX_PKG_DESCRIPTION=\"File manager with vi like keybindings\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.10.1\nTERMUX_PKG_SHA256=f5e6add7b0c8221fc5eb5b60c7ea483a141769afea2167f1535d66785bb654ec\nTERMUX_PKG_SRCURL=https://github.com/vifm/vifm/archive/v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"ncurses, file\"\n\ntermux_step_pre_configure() {\n\tautoreconf -if\n\tif $TERMUX_DEBUG; then\n\t\t# Debug build fails with:\n\t\t# /home/builder/.termux-build/vifm/src/src/fops_common.c:745:27: error: 'umask' called with invalid mode\n\t\t#      saved_umask = umask(~0600);\n\t\texport CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}\n\tfi\n}\n"
  },
  {
    "path": "packages/vifm/cmd_completion.c.patch",
    "content": "--- ../cache/vifm-0.9/src/cmd_completion.c\t2017-06-18 14:31:25.000000000 +0000\n+++ ./src/cmd_completion.c\t2017-10-04 00:00:24.535121432 +0000\n@@ -1046,6 +1044,7 @@\n \tsize_t len;\n \n \tlen = strlen(str);\n+#ifndef __ANDROID__\n \tsetpwent();\n \twhile((pw = getpwent()) != NULL)\n \t{\n@@ -1054,6 +1053,7 @@\n \t\t\tvle_compl_add_match(pw->pw_name, \"\");\n \t\t}\n \t}\n+#endif\n \tvle_compl_finish_group();\n \tvle_compl_add_last_match(str);\n }\n@@ -1063,7 +1063,7 @@\n {\n \tstruct group *gr;\n \tsize_t len = strlen(str);\n-\n+#ifndef __ANDROID__\n \tsetgrent();\n \twhile((gr = getgrent()) != NULL)\n \t{\n@@ -1072,6 +1072,7 @@\n \t\t\tvle_compl_add_match(gr->gr_name, \"\");\n \t\t}\n \t}\n+#endif\n \tvle_compl_finish_group();\n \tvle_compl_add_last_match(str);\n }\n"
  },
  {
    "path": "packages/vifm/configure.ac.patch",
    "content": "diff -u -r ../vifm-0.9.1/configure.ac ./configure.ac\n--- ../vifm-0.9.1/configure.ac\t2018-02-05 10:40:02.000000000 +0000\n+++ ./configure.ac\t2018-02-06 13:53:38.873777524 +0000\n@@ -154,18 +154,11 @@\n AC_CHECK_FUNC([getcwd], [], [AC_MSG_ERROR([getcwd() function not found.])])\n AC_CHECK_FUNC([getenv], [], [AC_MSG_ERROR([getenv() function not found.])])\n AC_CHECK_FUNC([geteuid], [], [AC_MSG_ERROR([geteuid() function not found.])])\n-AC_CHECK_FUNC([getgrent], [], [AC_MSG_ERROR([getgrent() function not found.])])\n-AC_CHECK_FUNC([getgrgid], [], [AC_MSG_ERROR([getgrgid() function not found.])])\n-AC_CHECK_FUNC([getgrgid_r], [], [AC_MSG_ERROR([getgrgid_r() function not found.])])\n-AC_CHECK_FUNC([getgrnam], [], [AC_MSG_ERROR([getgrnam() function not found.])])\n if test -n \"$HAVE_MNTENT_H\" ; then\n     AC_CHECK_FUNC([getmntent], [], [AC_MSG_ERROR([getmntent() function not found.])])\n fi\n AC_CHECK_FUNC([getpid], [], [AC_MSG_ERROR([getpid() function not found.])])\n AC_CHECK_FUNC([getppid], [], [AC_MSG_ERROR([getppid() function not found.])])\n-AC_CHECK_FUNC([getpwent], [], [AC_MSG_ERROR([getpwent() function not found.])])\n-AC_CHECK_FUNC([getpwnam], [], [AC_MSG_ERROR([getpwnam() function not found.])])\n-AC_CHECK_FUNC([getpwuid], [], [AC_MSG_ERROR([getpwuid() function not found.])])\n AC_CHECK_FUNC([getpwuid_r], [], [AC_MSG_ERROR([getpwuid_r() function not found.])])\n AC_CHECK_FUNC([ioctl], [], [AC_MSG_ERROR([ioctl() function not found.])])\n AC_CHECK_FUNC([iswalnum], [], [AC_MSG_ERROR([iswalnum() function not found.])])\n@@ -201,13 +194,11 @@\n AC_CHECK_FUNC([rmdir], [], [AC_MSG_ERROR([rmdir() function not found.])])\n AC_CHECK_FUNC([select], [], [AC_MSG_ERROR([select() function not found.])])\n AC_CHECK_FUNC([setenv], [], [AC_MSG_ERROR([setenv() function not found.])])\n-AC_CHECK_FUNC([setgrent], [], [AC_MSG_ERROR([setgrent() function not found.])])\n AC_CHECK_FUNC([setlocale], [], [AC_MSG_ERROR([setlocale() function not found.])])\n if test -n \"$HAVE_MNTENT_H\" ; then\n     AC_CHECK_FUNC([setmntent], [], [AC_MSG_ERROR([setmntent() function not found.])])\n fi\n AC_CHECK_FUNC([setpgid], [], [AC_MSG_ERROR([setpgid() function not found.])])\n-AC_CHECK_FUNC([setpwent], [], [AC_MSG_ERROR([setpwent() function not found.])])\n AC_CHECK_FUNC([setsid], [], [AC_MSG_ERROR([setsid() function not found.])])\n AC_CHECK_FUNC([setvbuf], [], [AC_MSG_ERROR([setvbuf() function not found.])])\n AC_CHECK_FUNC([sigaction], [], [AC_MSG_ERROR([sigaction() function not found.])])\n@@ -384,18 +375,6 @@\n dnl from libc)\n AC_CHECK_LIB(m, pow, [LIBS=\"$LIBS -lm\"])\n \n-dnl Use pthread library\n-AX_CHECK_COMPILE_FLAG([-pthread], [\n-    TESTS_CFLAGS=\"$CFLAGS -pthread\"\n-    CFLAGS=\"$CFLAGS -pthread\"\n-    ], [\n-    AC_CHECK_LIB(pthread, pthread_create,\n-      [LIBS=\"$LIBS -lpthread\"\n-      AC_CHECK_HEADER([pthread.h], [], [AC_MSG_ERROR([pthread.h header not found.])])\n-      ],\n-      [AC_MSG_ERROR([libpthread not found])])\n-  ])\n-\n dnl Check for all required elements in pthread.h.\n AC_CHECK_FUNC([pthread_create], [], [AC_MSG_ERROR([pthread_create() function not found.])])\n AC_CHECK_FUNC([pthread_getspecific], [], [AC_MSG_ERROR([pthread_getspecific() function not found.])])\n"
  },
  {
    "path": "packages/vifm/file_info.c.patch",
    "content": "--- ../cache/vifm-0.9/src/modes/file_info.c\t2017-06-18 14:31:25.000000000 +0000\n+++ ./src/modes/file_info.c\t2017-10-03 23:51:20.005137148 +0000\n@@ -31,7 +31,7 @@\n #include <stdlib.h> /* free() */\n #include <string.h> /* strlen() */\n #include <time.h> /* tm localtime() strftime() */\n-\n+#include <sys/sysmacros.h>\n #include \"../cfg/config.h\"\n #include \"../compat/fs_limits.h\"\n #include \"../compat/os.h\"\n"
  },
  {
    "path": "packages/vifm/src-Makefile.am.patch",
    "content": "diff -uNr vifm-0.10.1/src/Makefile.am vifm-0.10.1.mod/src/Makefile.am\n--- vifm-0.10.1/src/Makefile.am\t2019-07-29 00:19:39.000000000 +0300\n+++ vifm-0.10.1.mod/src/Makefile.am\t2019-08-03 15:03:06.481245003 +0300\n@@ -44,7 +44,6 @@\n \t\t\t\t\t\t\t ../data/vifmrc-osx\n dist_pkgdata_SCRIPTS = ../data/vifm-media \\\n \t\t\t\t\t\t\t ../data/vifm-media-osx\n-nodist_pkgdata_DATA = ../data/vifm-help.txt\n \n bin_PROGRAMS = vifm\n \n"
  },
  {
    "path": "packages/vifm/src-registers.c.patch",
    "content": "diff -u -r ../vifm-0.10/src/registers.c ./src/registers.c\n--- ../vifm-0.10/src/registers.c\t2018-11-11 15:20:19.000000000 +0000\n+++ ./src/registers.c\t2018-11-17 21:30:58.649771651 +0000\n@@ -109,7 +109,7 @@\n  * not constant here only to allow enalbing a test mode with smaller values to\n  * test corner cases.\n  */\n-#ifdef __linux__\n+#if defined(__linux__) && !defined(__ANDROID__)\n /*\n  * On Linux a mmap call can map more bytes than the size of the underlying\n  * object. Thus the area mapped can be 128 MiB (very large) and the memory\n@@ -829,7 +829,7 @@\n regs_sync_enable_test_mode(void)\n {\n \tdebug_print_to_stdout = 1;\n-#ifdef __linux__\n+#if defined(__linux__) && !defined(__ANDROID__)\n \tshared_mmap_bytes     = 1024 * 32;\n \tshared_initial        = 1024 * 4;  /* still larger than metadata size */\n #else\n"
  },
  {
    "path": "packages/vifm/src-utils-path.c.patch",
    "content": "diff -u -r ../vifm-0.9.1/src/utils/path.c ./src/utils/path.c\n--- ../vifm-0.9.1/src/utils/path.c\t2018-02-05 11:40:02.000000000 +0100\n+++ ./src/utils/path.c\t2018-02-06 21:01:58.660741129 +0100\n@@ -784,7 +784,7 @@\n const char *\n get_tmpdir(void)\n {\n-\treturn env_get_one_of_def(\"/tmp/\", \"TMPDIR\", \"TEMP\", \"TEMPDIR\", \"TMP\",\n+\treturn env_get_one_of_def(\"@TERMUX_PREFIX@/tmp/\", \"TMPDIR\", \"TEMP\", \"TEMPDIR\", \"TMP\",\n \t\t\t(const char *)NULL);\n }\n \n"
  },
  {
    "path": "packages/vifm/src-utils-shmem_nix.c.patch",
    "content": "diff -u -r ../vifm-0.10/src/utils/shmem_nix.c ./src/utils/shmem_nix.c\n--- ../vifm-0.10/src/utils/shmem_nix.c\t2018-11-11 15:20:19.000000000 +0000\n+++ ./src/utils/shmem_nix.c\t2018-11-17 21:37:18.757403620 +0000\n@@ -41,6 +41,9 @@\n shmem_t *\n shmem_create(const char name[], size_t initial_size, size_t max_size)\n {\n+#ifdef __ANDROID__\n+\treturn NULL;\n+#else\n \tint error_other;\n \tint error_excl_already_exists;\n \tint error_normal_does_not_exist;\n@@ -135,21 +138,25 @@\n \t}\n \n \treturn shmem;\n+#endif\n }\n \n void\n shmem_destroy(shmem_t *shmem)\n {\n+#ifndef __ANDROID__\n \tif(shmem != NULL)\n \t{\n \t\tshm_unlink(shmem->name);\n \t\tshmem_free(shmem);\n \t}\n+#endif\n }\n \n void\n shmem_free(shmem_t *shmem)\n {\n+#ifndef __ANDROID__\n \tif(shmem == NULL)\n \t{\n \t\treturn;\n@@ -163,6 +170,7 @@\n \tclose(shmem->fd);\n \tfree(shmem->name);\n \tfree(shmem);\n+#endif\n }\n \n int\n"
  },
  {
    "path": "packages/vim/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.vim.org\nTERMUX_PKG_DESCRIPTION=\"Vi IMproved - enhanced vi editor\"\nTERMUX_PKG_LICENSE=\"VIM License\"\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses, vim-runtime\"\nTERMUX_PKG_RECOMMENDS=\"diffutils\"\n# vim should only be updated every 50 releases on multiples of 50.\n# Update both vim and vim-python to the same version in one PR.\nTERMUX_PKG_VERSION=8.1.2350\nTERMUX_PKG_SRCURL=\"https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz\"\nTERMUX_PKG_SHA256=e0d89b7cc58c4cd3baf0a060fddf3994b40c0a02d98d73fc248236122c080405\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nvim_cv_getcwd_broken=no\nvim_cv_memmove_handles_overlap=yes\nvim_cv_stat_ignores_slash=no\nvim_cv_terminfo=yes\nvim_cv_tgetent=zero\nvim_cv_toupper_broken=no\nvim_cv_tty_group=world\n--enable-gui=no\n--enable-multibyte\n--with-features=huge\n--without-x\n--with-tlib=ncursesw\n\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/rview\nbin/rvim\nbin/ex\nshare/man/man1/evim.1\nshare/icons\nshare/vim/vim81/spell/en.ascii*\nshare/vim/vim81/print\nshare/vim/vim81/tools\n\"\nTERMUX_PKG_CONFFILES=\"share/vim/vimrc\"\n\nTERMUX_PKG_CONFLICTS=\"vim-python\"\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tmake distclean\n\n\t# Remove eventually existing symlinks from previous builds so that they get re-created\n\tfor b in rview rvim ex view vimdiff; do rm -f $TERMUX_PREFIX/bin/$b; done\n\trm -f $TERMUX_PREFIX/share/man/man1/view.1\n}\n\ntermux_step_post_make_install() {\n\tcp $TERMUX_PKG_BUILDER_DIR/vimrc $TERMUX_PREFIX/share/vim/vimrc\n\n\t# Remove most tutor files:\n\tcp $TERMUX_PREFIX/share/vim/vim81/tutor/{tutor,tutor.vim,tutor.utf-8} $TERMUX_PKG_TMPDIR/\n\trm -f $TERMUX_PREFIX/share/vim/vim81/tutor/*\n\tcp $TERMUX_PKG_TMPDIR/{tutor,tutor.vim,tutor.utf-8} $TERMUX_PREFIX/share/vim/vim81/tutor/\n\n\tcd $TERMUX_PREFIX/bin\n\tln -f -s vim vi\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/vim 50\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/vim\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/vim/option.c.patch",
    "content": "diff -u -r ../vim-8.0.1750/src/option.c ./src/option.c\n--- ../vim-8.0.1750/src/option.c\t2018-04-23 21:29:48.000000000 +0200\n+++ ./src/option.c\t2018-04-26 22:18:46.227593576 +0200\n@@ -3413,7 +3413,7 @@\n #  ifdef MACOS_X\n \t\tp = (char_u *)\"/private/tmp\";\n #  else\n-\t\tp = (char_u *)\"/tmp\";\n+\t\tp = (char_u *)\"@TERMUX_PREFIX@/tmp\";\n #  endif\n \t    else\n # endif\n"
  },
  {
    "path": "packages/vim/os_unix.h.patch",
    "content": "diff -u -r ../vim-7.4.1049/src/os_unix.h ./src/os_unix.h\n--- ../vim-7.4.1049/src/os_unix.h\t2016-01-04 06:45:29.000000000 -0500\n+++ ./src/os_unix.h\t2016-01-04 11:23:21.698790120 -0500\n@@ -368,7 +368,7 @@\n # ifdef VMS\n #  define DFLT_DIR     \"./,sys$login:,tmp:\"\n # else\n-#  define DFLT_DIR     \".,~/tmp,/var/tmp,/tmp\" /* default for 'directory' */\n+#  define DFLT_DIR     \".,~/tmp,@TERMUX_PREFIX@/var/tmp,@TERMUX_PREFIX@/tmp\" /* default for 'directory' */\n # endif\n #endif\n \n"
  },
  {
    "path": "packages/vim/src-auto-configure.patch",
    "content": "diff -u -r ../vim-8.0.0675/src/auto/configure ./src/auto/configure\n--- ../vim-8.0.0675/src/auto/configure\t2017-06-25 16:03:37.000000000 +0000\n+++ ./src/auto/configure\t2017-07-07 12:34:53.459850309 +0000\n@@ -11426,6 +11426,7 @@\n $as_echo_n \"checking for tgetent()... \" >&6; }\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n /* end confdefs.h.  */\n+#include <termcap.h>\n \n int\n main ()\n"
  },
  {
    "path": "packages/vim/src-if_cscope.c.patch",
    "content": "diff -uNr vim-8.1.0050/src/if_cscope.c vim-8.1.0050.mod/src/if_cscope.c\n--- vim-8.1.0050/src/if_cscope.c\t2018-06-12 21:25:52.000000000 +0300\n+++ vim-8.1.0050.mod/src/if_cscope.c\t2018-06-19 20:32:38.661663690 +0300\n@@ -962,7 +962,7 @@\n \t    PERROR(_(\"cs_create_connection setpgid failed\"));\n #  endif\n # endif\n-\tif (execl(\"/bin/sh\", \"sh\", \"-c\", cmd, (char *)NULL) == -1)\n+\tif (execl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", cmd, (char *)NULL) == -1)\n \t    PERROR(_(\"cs_create_connection exec failed\"));\n \n \texit(127);\n"
  },
  {
    "path": "packages/vim/vim-runtime.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"share/vim/vim81\"\nTERMUX_SUBPKG_DESCRIPTION=\"Vi IMproved - Runtime files\"\nTERMUX_SUBPKG_PLATFORM_INDEPENDENT=true\n"
  },
  {
    "path": "packages/vim/vimrc",
    "content": "\" Ensure that <> notation works for the mappings that follow\nset nocompatible\n\n\" Scroll only one line for mouse wheel events to get smooth scrolling on touch screens\nmap <ScrollWheelUp> <C-Y>\nimap <ScrollWheelUp> <C-X><C-Y>\nmap <ScrollWheelDown> <C-E>\nimap <ScrollWheelDown> <C-X><C-E>\n\n\" As of version 8, vim enables the mouse by default - but only if no ~/.vimrc\n\" is found. Enable that unconditionally for Termux as it's useful with touch:\nset mouse=a\n\n\" sensible.vim - Defaults everyone can agree on\n\" Maintainer:   Tim Pope <http://tpo.pe/>\n\" Version:      1.2\n\nif exists('g:loaded_sensible') || &compatible\n  finish\nelse\n  let g:loaded_sensible = 'yes'\nendif\n\nif has('autocmd')\n  filetype plugin indent on\nendif\nif has('syntax') && !exists('g:syntax_on')\n  syntax enable\nendif\n\n\" Use :help 'option' to see the documentation for the given option.\n\nset autoindent\nset backspace=indent,eol,start\nset complete-=i\nset smarttab\n\nset nrformats-=octal\n\nif !has('nvim') && &ttimeoutlen == -1\n  set ttimeout\n  set ttimeoutlen=100\nendif\n\nset incsearch\n\" Use <C-L> to clear the highlighting of :set hlsearch.\nif maparg('<C-L>', 'n') ==# ''\n  nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>\nendif\n\nset laststatus=2\nset ruler\nset wildmenu\n\nif !&scrolloff\n  set scrolloff=1\nendif\nif !&sidescrolloff\n  set sidescrolloff=5\nendif\nset display+=lastline\n\nif &encoding ==# 'latin1' && has('gui_running')\n  set encoding=utf-8\nendif\n\nif &listchars ==# 'eol:$'\n  set listchars=tab:>\\ ,trail:-,extends:>,precedes:<,nbsp:+\nendif\n\nif v:version > 703 || v:version == 703 && has(\"patch541\")\n  set formatoptions+=j \" Delete comment character when joining commented lines\nendif\n\nif has('path_extra')\n  setglobal tags-=./tags tags-=./tags; tags^=./tags;\nendif\n\nif &shell =~# 'fish$' && (v:version < 704 || v:version == 704 && !has('patch276'))\n  set shell=/data/data/com.termux/files/usr/bin/env\\ bash\nendif\n\nset autoread\n\nif &history < 1000\n  set history=1000\nendif\nif &tabpagemax < 50\n  set tabpagemax=50\nendif\nif !empty(&viminfo)\n  set viminfo^=!\nendif\nset sessionoptions-=options\n\n\" Allow color schemes to do bright colors without forcing bold.\nif &t_Co == 8 && $TERM !~# '^linux\\|^Eterm'\n  set t_Co=16\nendif\n\n\" Load matchit.vim, but only if the user hasn't installed a newer version.\nif !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''\n  runtime! macros/matchit.vim\nendif\n\ninoremap <C-U> <C-G>u<C-U>\n\n\" vim:set ft=vim et sw=2:\n"
  },
  {
    "path": "packages/vim/vimtutor.patch",
    "content": "diff -u -r ../cache/vim-hg/src/vimtutor ./src/vimtutor\n--- ../cache/vim-hg/src/vimtutor\t2014-05-30 17:16:01.677978089 +0200\n+++ ./src/vimtutor\t2014-06-15 23:36:24.545163147 +0200\n@@ -24,7 +24,7 @@\n export xx\n \n # We need a temp file for the copy.  First try using a standard command.\n-tmp=\"${TMPDIR-/tmp}\"\n+tmp=\"${TMPDIR-@TERMUX_PREFIX@/tmp}\"\n TUTORCOPY=`mktemp $tmp/tutorXXXXXX || tempfile -p tutor || echo none`\n \n # If the standard commands failed then create a directory to put the copy in.\n"
  },
  {
    "path": "packages/vim/vterm_internal.h.patch",
    "content": "--- ../cache/vim-8.0.0979/src/libvterm/src/vterm_internal.h\t2017-08-20 18:21:23.000000000 +0000\n+++ ./src/libvterm/src/vterm_internal.h\t2017-08-21 03:25:48.637450794 +0000\n@@ -1,7 +1,7 @@\n #ifndef __VTERM_INTERNAL_H__\n #define __VTERM_INTERNAL_H__\n \n-#include \"vterm.h\"\n+#include \"../include/vterm.h\"\n \n #include <stdarg.h>\n \n"
  },
  {
    "path": "packages/vim-python/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.vim.org\nTERMUX_PKG_DESCRIPTION=\"Vi IMproved - enhanced vi editor\"\nTERMUX_PKG_LICENSE=\"VIM License\"\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses, vim-runtime, python\"\nTERMUX_PKG_RECOMMENDS=\"diffutils\"\n# vim should only be updated every 50 releases on multiples of 50.\n# Update both vim and vim-python to the same version in one PR.\nTERMUX_PKG_VERSION=8.1.2350\nTERMUX_PKG_SRCURL=\"https://github.com/vim/vim/archive/v${TERMUX_PKG_VERSION}.tar.gz\"\nTERMUX_PKG_SHA256=e0d89b7cc58c4cd3baf0a060fddf3994b40c0a02d98d73fc248236122c080405\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nvim_cv_getcwd_broken=no\nvim_cv_memmove_handles_overlap=yes\nvim_cv_stat_ignores_slash=no\nvim_cv_terminfo=yes\nvim_cv_tgetent=zero\nvim_cv_toupper_broken=no\nvim_cv_tty_group=world\n--enable-gui=no\n--enable-multibyte\n--with-features=huge\n--without-x\n--with-tlib=ncursesw\n\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_RM_AFTER_INSTALL=\"\nbin/rview\nbin/rvim\nbin/ex\nshare/man/man1/evim.1\nshare/icons\nshare/vim/vim81/spell/en.ascii*\nshare/vim/vim81/print\nshare/vim/vim81/tools\n\"\nTERMUX_PKG_CONFFILES=\"share/vim/vimrc\"\n\n# vim-python:\nTERMUX_PKG_CONFLICTS=\"vim\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\"\nvi_cv_path_python3_pfx=$TERMUX_PREFIX\nvi_cv_var_python3_abiflags=\nvi_cv_var_python3_version=3.8\n--enable-python3interp\n--with-python3-config-dir=$TERMUX_PREFIX/lib/python3.8/config-3.8/\n\"\nTERMUX_PKG_DESCRIPTION+=\" - with python support\"\n# Remove share/vim/vim81 which is in vim-runtime built as a subpackage of vim:\nTERMUX_PKG_RM_AFTER_INSTALL+=\" share/vim/vim81\"\ntermux_step_pre_configure() {\n\tCPPFLAGS+=\" -I${TERMUX_PREFIX}/include/python3.8\"\n}\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\tmake distclean\n\n\t# Remove eventually existing symlinks from previous builds so that they get re-created\n\tfor b in rview rvim ex view vimdiff; do rm -f $TERMUX_PREFIX/bin/$b; done\n\trm -f $TERMUX_PREFIX/share/man/man1/view.1\n}\n\ntermux_step_post_make_install() {\n\tcp $TERMUX_PKG_BUILDER_DIR/vimrc $TERMUX_PREFIX/share/vim/vimrc\n\n\t# Remove most tutor files:\n\tcp $TERMUX_PREFIX/share/vim/vim81/tutor/{tutor,tutor.vim,tutor.utf-8} $TERMUX_PKG_TMPDIR/\n\trm -f $TERMUX_PREFIX/share/vim/vim81/tutor/*\n\tcp $TERMUX_PKG_TMPDIR/{tutor,tutor.vim,tutor.utf-8} $TERMUX_PREFIX/share/vim/vim81/tutor/\n\n\tcd $TERMUX_PREFIX/bin\n\tln -f -s vim vi\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/vim 50\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/vim\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/vim-python/option.c.patch",
    "content": "diff -u -r ../vim-8.0.1750/src/option.c ./src/option.c\n--- ../vim-8.0.1750/src/option.c\t2018-04-23 21:29:48.000000000 +0200\n+++ ./src/option.c\t2018-04-26 22:18:46.227593576 +0200\n@@ -3413,7 +3413,7 @@\n #  ifdef MACOS_X\n \t\tp = (char_u *)\"/private/tmp\";\n #  else\n-\t\tp = (char_u *)\"/tmp\";\n+\t\tp = (char_u *)\"@TERMUX_PREFIX@/tmp\";\n #  endif\n \t    else\n # endif\n"
  },
  {
    "path": "packages/vim-python/os_unix.h.patch",
    "content": "diff -u -r ../vim-7.4.1049/src/os_unix.h ./src/os_unix.h\n--- ../vim-7.4.1049/src/os_unix.h\t2016-01-04 06:45:29.000000000 -0500\n+++ ./src/os_unix.h\t2016-01-04 11:23:21.698790120 -0500\n@@ -368,7 +368,7 @@\n # ifdef VMS\n #  define DFLT_DIR     \"./,sys$login:,tmp:\"\n # else\n-#  define DFLT_DIR     \".,~/tmp,/var/tmp,/tmp\" /* default for 'directory' */\n+#  define DFLT_DIR     \".,~/tmp,@TERMUX_PREFIX@/var/tmp,@TERMUX_PREFIX@/tmp\" /* default for 'directory' */\n # endif\n #endif\n \n"
  },
  {
    "path": "packages/vim-python/src-auto-configure.patch",
    "content": "diff -u -r ../vim-8.0.0675/src/auto/configure ./src/auto/configure\n--- ../vim-8.0.0675/src/auto/configure\t2017-06-25 16:03:37.000000000 +0000\n+++ ./src/auto/configure\t2017-07-07 12:34:53.459850309 +0000\n@@ -11426,6 +11426,7 @@\n $as_echo_n \"checking for tgetent()... \" >&6; }\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n /* end confdefs.h.  */\n+#include <termcap.h>\n \n int\n main ()\n"
  },
  {
    "path": "packages/vim-python/src-if_cscope.c.patch",
    "content": "diff -uNr vim-8.1.0050/src/if_cscope.c vim-8.1.0050.mod/src/if_cscope.c\n--- vim-8.1.0050/src/if_cscope.c\t2018-06-12 21:25:52.000000000 +0300\n+++ vim-8.1.0050.mod/src/if_cscope.c\t2018-06-19 20:32:38.661663690 +0300\n@@ -962,7 +962,7 @@\n \t    PERROR(_(\"cs_create_connection setpgid failed\"));\n #  endif\n # endif\n-\tif (execl(\"/bin/sh\", \"sh\", \"-c\", cmd, (char *)NULL) == -1)\n+\tif (execl(\"@TERMUX_PREFIX@/bin/sh\", \"sh\", \"-c\", cmd, (char *)NULL) == -1)\n \t    PERROR(_(\"cs_create_connection exec failed\"));\n \n \texit(127);\n"
  },
  {
    "path": "packages/vim-python/vimrc",
    "content": "\" Ensure that <> notation works for the mappings that follow\nset nocompatible\n\n\" Scroll only one line for mouse wheel events to get smooth scrolling on touch screens\nmap <ScrollWheelUp> <C-Y>\nimap <ScrollWheelUp> <C-X><C-Y>\nmap <ScrollWheelDown> <C-E>\nimap <ScrollWheelDown> <C-X><C-E>\n\n\" As of version 8, vim enables the mouse by default - but only if no ~/.vimrc\n\" is found. Enable that unconditionally for Termux as it's useful with touch:\nset mouse=a\n\n\" sensible.vim - Defaults everyone can agree on\n\" Maintainer:   Tim Pope <http://tpo.pe/>\n\" Version:      1.2\n\nif exists('g:loaded_sensible') || &compatible\n  finish\nelse\n  let g:loaded_sensible = 'yes'\nendif\n\nif has('autocmd')\n  filetype plugin indent on\nendif\nif has('syntax') && !exists('g:syntax_on')\n  syntax enable\nendif\n\n\" Use :help 'option' to see the documentation for the given option.\n\nset autoindent\nset backspace=indent,eol,start\nset complete-=i\nset smarttab\n\nset nrformats-=octal\n\nif !has('nvim') && &ttimeoutlen == -1\n  set ttimeout\n  set ttimeoutlen=100\nendif\n\nset incsearch\n\" Use <C-L> to clear the highlighting of :set hlsearch.\nif maparg('<C-L>', 'n') ==# ''\n  nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>\nendif\n\nset laststatus=2\nset ruler\nset wildmenu\n\nif !&scrolloff\n  set scrolloff=1\nendif\nif !&sidescrolloff\n  set sidescrolloff=5\nendif\nset display+=lastline\n\nif &encoding ==# 'latin1' && has('gui_running')\n  set encoding=utf-8\nendif\n\nif &listchars ==# 'eol:$'\n  set listchars=tab:>\\ ,trail:-,extends:>,precedes:<,nbsp:+\nendif\n\nif v:version > 703 || v:version == 703 && has(\"patch541\")\n  set formatoptions+=j \" Delete comment character when joining commented lines\nendif\n\nif has('path_extra')\n  setglobal tags-=./tags tags-=./tags; tags^=./tags;\nendif\n\nif &shell =~# 'fish$' && (v:version < 704 || v:version == 704 && !has('patch276'))\n  set shell=/data/data/com.termux/files/usr/bin/env\\ bash\nendif\n\nset autoread\n\nif &history < 1000\n  set history=1000\nendif\nif &tabpagemax < 50\n  set tabpagemax=50\nendif\nif !empty(&viminfo)\n  set viminfo^=!\nendif\nset sessionoptions-=options\n\n\" Allow color schemes to do bright colors without forcing bold.\nif &t_Co == 8 && $TERM !~# '^linux\\|^Eterm'\n  set t_Co=16\nendif\n\n\" Load matchit.vim, but only if the user hasn't installed a newer version.\nif !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''\n  runtime! macros/matchit.vim\nendif\n\ninoremap <C-U> <C-G>u<C-U>\n\n\" vim:set ft=vim et sw=2:\n"
  },
  {
    "path": "packages/vim-python/vimtutor.patch",
    "content": "diff -u -r ../cache/vim-hg/src/vimtutor ./src/vimtutor\n--- ../cache/vim-hg/src/vimtutor\t2014-05-30 17:16:01.677978089 +0200\n+++ ./src/vimtutor\t2014-06-15 23:36:24.545163147 +0200\n@@ -24,7 +24,7 @@\n export xx\n \n # We need a temp file for the copy.  First try using a standard command.\n-tmp=\"${TMPDIR-/tmp}\"\n+tmp=\"${TMPDIR-@TERMUX_PREFIX@/tmp}\"\n TUTORCOPY=`mktemp $tmp/tutorXXXXXX || tempfile -p tutor || echo none`\n \n # If the standard commands failed then create a directory to put the copy in.\n"
  },
  {
    "path": "packages/vim-python/vterm_internal.h.patch",
    "content": "--- ../cache/vim-8.0.0979/src/libvterm/src/vterm_internal.h\t2017-08-20 18:21:23.000000000 +0000\n+++ ./src/libvterm/src/vterm_internal.h\t2017-08-21 03:25:48.637450794 +0000\n@@ -1,7 +1,7 @@\n #ifndef __VTERM_INTERNAL_H__\n #define __VTERM_INTERNAL_H__\n \n-#include \"vterm.h\"\n+#include \"../include/vterm.h\"\n \n #include <stdarg.h>\n \n"
  },
  {
    "path": "packages/virustotal-cli/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/VirusTotal/vt-cli\nTERMUX_PKG_DESCRIPTION=\"Command line interface for VirusTotal\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.7.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/VirusTotal/vt-cli/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=39a566be0e2ee1102c0bd9d3ddefa4a0e423c9ffe02962d4a48897a875312c95\nTERMUX_PKG_BREAKS=\"vt-cli\"\nTERMUX_PKG_REPLACES=\"vt-cli\"\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/github.com/VirusTotal\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/VirusTotal/vt-cli\n\n\tcd \"$GOPATH\"/src/github.com/VirusTotal/vt-cli\n\n\tGOOS=linux GOARCH=amd64 CC=gcc LD=gcc \\\n\t\tgo get -u github.com/golang/dep/cmd/dep\n\t\"$GOPATH\"/bin/dep ensure\n\n\tgo build \\\n\t\t-ldflags \"-X github.com/VirusTotal/vt-cli/cmd.Version=$TERMUX_PKG_VERSION\" \\\n\t\t-o \"$TERMUX_PREFIX\"/bin/vt-cli \\\n\t\t./vt/main.go\n}\n\ntermux_step_make_install() {\n\tln -sfr \"$TERMUX_PREFIX\"/bin/vt-cli \"$TERMUX_PREFIX\"/bin/vt\n}\n"
  },
  {
    "path": "packages/vis/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.brain-dump.org/projects/vis/\nTERMUX_PKG_DESCRIPTION=\"Modern, legacy free, simple yet efficient vim-like editor\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.5\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/martanne/vis/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=77ea70ebc9c811d88e32199ef5b3ee9b834ac1e880fb61b6d2460f93f0587df5\nTERMUX_PKG_DEPENDS=\"liblua, libtermkey, lua-lpeg, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/vis/configure.patch",
    "content": "diff -uNr vis-0.5/configure vis-0.5.mod/configure\n--- vis-0.5/configure\t2018-03-25 20:55:55.000000000 +0300\n+++ vis-0.5.mod/configure\t2019-02-25 23:23:27.018873339 +0200\n@@ -422,60 +422,9 @@\n test \"$lpeg\" = \"yes\" && lua=yes\n \n if test \"$lua\" != \"no\" ; then\n-\n-\tprintf \"checking for liblua >= 5.2 ...\\n\"\n-\n-cat > \"$tmpc\" <<EOF\n-#include <lua.h>\n-#include <lualib.h>\n-#include <lauxlib.h>\n-\n-#if LUA_VERSION_NUM < 502\n-#error \"Need at least Lua 5.2\"\n-#endif\n-\n-int main(int argc, char *argv[]) {\n-\tlua_State *L = luaL_newstate();\n-\tluaL_openlibs(L);\n-\tlua_close(L);\n-\treturn 0;\n-}\n-EOF\n-\n-\tfor liblua in lua lua5.3 lua5.2 lua-5.3 lua-5.2 lua53 lua52; do\n-\t\tprintf \" checking for %s... \" \"$liblua\"\n-\n-\t\tif test \"$have_pkgconfig\" = \"yes\" ; then\n-\t\t\tCFLAGS_LUA=$(pkg-config --cflags $liblua 2>/dev/null)\n-\t\t\tLDFLAGS_LUA=$(pkg-config --libs $liblua 2>/dev/null)\n-\t\t\tif test $? -eq 0 && $CC $CFLAGS $CFLAGS_LUA \"$tmpc\" \\\n-\t\t\t\t$LDFLAGS $LDFLAGS_LUA -o \"$tmpo\" >/dev/null 2>&1 ; then\n-\t\t\t\tCONFIG_LUA=1\n-\t\t\t\tprintf \"yes\\n\"\n-\t\t\t\tbreak\n-\t\t\tfi\n-\t\tfi\n-\n-\t\tCFLAGS_LUA=\"\"\n-\t\tLDFLAGS_LUA=\"-l$liblua -lm -ldl\"\n-\n-\t\tif $CC $CFLAGS $CFLAGS_LUA \"$tmpc\" \\\n-\t\t\t$LDFLAGS $LDFLAGS_LUA -o \"$tmpo\" >/dev/null 2>&1 ; then\n-\t\t\tCONFIG_LUA=1\n-\t\t\tprintf \"yes\\n\"\n-\t\t\tbreak\n-\t\telse\n-\t\t\tprintf \"no\\n\"\n-\t\t\tCFLAGS_LUA=\"\"\n-\t\t\tLDFLAGS_LUA=\"\"\n-\t\tfi\n-\tdone\n-\n-\ttest \"$lua\" = \"yes\" -a $CONFIG_LUA -ne 1 && fail \"$0: cannot find liblua\"\n-\n-\tif test $CONFIG_LUA -eq 1; then\n-\t\tCFLAGS_LUA=\"$CFLAGS_LUA -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DLUA_COMPAT_ALL\"\n-\tfi\n+\tCONFIG_LUA=1\n+\tCFLAGS_LUA=\"-DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DLUA_COMPAT_ALL\"\n+\tLDFLAGS_LUA=\"-llua -lm\"\n fi\n \n CONFIG_LPEG=0\n"
  },
  {
    "path": "packages/vorbis-tools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.vorbis.com\nTERMUX_PKG_DESCRIPTION=\"Ogg Vorbis tools\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.4.0\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://downloads.xiph.org/releases/vorbis/vorbis-tools-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=a389395baa43f8e5a796c99daf62397e435a7e73531c9f44d9084055a05d22bc\n# libflac for flac support in oggenc:\nTERMUX_PKG_DEPENDS=\"libiconv, libvorbis, libflac, libogg\"\n\ntermux_step_pre_configure() {\n\tLDFLAGS+=\" -lm\"\n}\n"
  },
  {
    "path": "packages/vttest/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://invisible-island.net/vttest/\nTERMUX_PKG_DESCRIPTION=\"Program for testing the VT100 compatibility of terminal emulators\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=20190710\nTERMUX_PKG_SRCURL=https://invisible-mirror.net/archives/vttest/vttest-$TERMUX_PKG_VERSION.tgz\nTERMUX_PKG_SHA256=048b4078003c588ad2ee3202468576df7dee16914df0f663fc6dd5bb49526303\n"
  },
  {
    "path": "packages/vtutils/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/fornwall/vtutils\nTERMUX_PKG_DESCRIPTION=\"Utilities for testing and working with virtual terminals\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_VERSION=0.5\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/fornwall/vtutils/releases/download/v$TERMUX_PKG_VERSION/vtutils-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=ef0b11f9570697f53bcda7a61093f8d472afee2c8551b5b35e9b5b7c1539c2c6\nTERMUX_PKG_DEPENDS=\"libc++\"\n"
  },
  {
    "path": "packages/w3m/Makefile.in.patch",
    "content": "diff -u -r ../w3m-0.5.3/Makefile.in ./Makefile.in\n--- ../w3m-0.5.3/Makefile.in\t2011-01-04 04:22:18.000000000 -0500\n+++ ./Makefile.in\t2016-05-12 16:53:44.113699285 -0400\n@@ -176,8 +176,8 @@\n \t./mktable$(EXT) 100 functable.tab > $@\n \t-rm -f functable.tab\n \n-mktable$(EXT): mktable.o dummy.o Str.o hash.o myctype.o\n-\t$(CC) $(CFLAGS) -o mktable mktable.o dummy.o Str.o hash.o myctype.o $(LDFLAGS) $(LIBS) $(GC_LIBS)\n+mktable$(EXT): mktable.c Str.c hash.c myctype.c\n+\tgcc -isystem $(TERMUX_PKG_BUILDER_DIR) -o mktable mktable.c Str.c hash.c myctype.c\n \n $(BOOKMARKER): w3mbookmark.o dummy.o $(ALIB)\n \t$(CC) $(CFLAGS) -o $(BOOKMARKER) w3mbookmark.o dummy.o $(LDFLAGS) $(LIBS) $(EXT_LIBS)\n"
  },
  {
    "path": "packages/w3m/Str.h.patch",
    "content": "diff -u -r ../w3m-0.5.3-git20170102/Str.h ./Str.h\n--- ../w3m-0.5.3-git20170102/Str.h\t2017-01-02 13:43:38.000000000 +0100\n+++ ./Str.h\t2017-06-29 01:05:35.903835683 +0200\n@@ -17,6 +17,7 @@\n #define GC_STR_H\n #include <stdio.h>\n #include <string.h>\n+#include <strings.h>\n #ifdef __EMX__\n #define strcasecmp\tstricmp\n #define strncasecmp\tstrnicmp\n"
  },
  {
    "path": "packages/w3m/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://w3m.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Text based Web browser and pager\"\nTERMUX_PKG_LICENSE=\"BSD\"\nlocal _MAJOR_VERSION=0.5.3\nlocal _MINOR_VERSION=20190105\nTERMUX_PKG_VERSION=0.5.3.$_MINOR_VERSION\nTERMUX_PKG_REVISION=2\n# The upstream w3m project is dead, but every linux distribution uses\n# this maintained fork in debian:\nTERMUX_PKG_SRCURL=https://github.com/tats/w3m/archive/v${_MAJOR_VERSION}+git${_MINOR_VERSION}.tar.gz\nTERMUX_PKG_SHA256=0467bb5429b75749205a3f57b9f5e8abba49929272aeab6fce94ff17953f0784\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_DEPENDS=\"libgc, ncurses, openssl, zlib\"\nTERMUX_PKG_SUGGESTS=\"perl\"\n\n# ac_cv_func_bcopy=yes to avoid w3m defining it's own bcopy function, which\n# breaks 64-bit builds where NDK headers define bcopy as a macro:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"ac_cv_func_setpgrp_void=yes ac_cv_func_bcopy=yes\"\n\n#Overwrite the default /usr/bin/firefox with termux-open-url as default external browser. That way, pressing \"M\" on a URL will open a link in Androids default Browser.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --with-browser=termux-open-url\"\n#Overwrite the default editor to just vi, as the default was /usr/bin/vi.\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --with-editor=vi\"\n# Avoid trying to build w3mimg:\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --enable-image=no\"\n\n# For Makefile.in.patch:\nexport TERMUX_PKG_BUILDER_DIR\n"
  },
  {
    "path": "packages/w3m/gc.h",
    "content": "/* A stub for gc.h to avoid depending on libgc for\n   the host-built mktable program. */\n#define GC_INIT()\n#define GC_MALLOC(arg) malloc(arg)\n#define GC_malloc(arg) malloc(arg)\n#define GC_MALLOC_ATOMIC(arg) malloc(arg)\n\n#define GC_free(arg) free(arg)\n"
  },
  {
    "path": "packages/wcalc/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://w-calc.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Capable calculator\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.5\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/w-calc/wcalc-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=0e2c17c20f935328dcdc6cb4c06250a6732f9ee78adf7a55c01133960d6d28ee\nTERMUX_PKG_DEPENDS=\"flex,libmpfr,libgmp,readline\"\n"
  },
  {
    "path": "packages/weechat/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://weechat.org/\nTERMUX_PKG_DESCRIPTION=\"Fast, light and extensible IRC chat client\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=2.6\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://www.weechat.org/files/src/weechat-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=0b06e551e69018dbd4828113a56a9657a16cb787eb44bc83adf45424e65759d9\nTERMUX_PKG_DEPENDS=\"libiconv, ncurses, libgcrypt, libcurl, libgnutls, libandroid-support, zlib\"\nTERMUX_PKG_BREAKS=\"weechat-dev\"\nTERMUX_PKG_REPLACES=\"weechat-dev\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/weechat-curses share/man/man1/weechat-headless.1 share/icons\"\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n-DCA_FILE=$TERMUX_PREFIX/etc/tls/cert.pem\n-DENABLE_HEADLESS=OFF\n-DENABLE_LUA=ON\n-DENABLE_MAN=ON\n-DENABLE_PERL=ON\n-DENABLE_PYTHON3=ON\n-DENABLE_TCL=OFF\n-DMSGFMT_EXECUTABLE=$(which msgfmt)\n-DMSGMERGE_EXECUTABLE=$(which msgmerge)\n-DPKG_CONFIG_EXECUTABLE=$(which pkg-config)\n-DXGETTEXT_EXECUTABLE=$(which xgettext)\n\"\n"
  },
  {
    "path": "packages/weechat/cmake-FindPerl.cmake.patch",
    "content": "diff -u -r ../weechat-1.4/cmake/FindPerl.cmake ./cmake/FindPerl.cmake\n--- ../weechat-1.4/cmake/FindPerl.cmake\t2016-01-10 03:17:50.000000000 -0500\n+++ ./cmake/FindPerl.cmake\t2016-04-21 22:40:24.209760454 -0400\n@@ -28,57 +28,16 @@\n #  PERL_CFLAGS = perl compiler options for compiling\n #  PERL_LFLAGS = perl compiler options for linking\n \n-if(PERL_FOUND)\n-   # Already in cache, be silent\n-   set(PERL_FIND_QUIETLY TRUE)\n-endif()\n-\n-find_program(PERL_EXECUTABLE\n-  NAMES perl perl5\n-  PATHS /usr/bin /usr/local/bin /usr/pkg/bin\n-  )\n-\n-if(PERL_EXECUTABLE)\n-\n-  execute_process(\n-    COMMAND ${PERL_EXECUTABLE} -MConfig -e \"print \\\"\\$Config{archlibexp}/CORE\\\"\"\n-    OUTPUT_VARIABLE PERL_INTERNAL_DIR\n-    )\n-\n-  execute_process(\n-    COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ccopts\n-    OUTPUT_VARIABLE PERL_CFLAGS\n-    )\n-\n-  execute_process(\n-    COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ldopts\n-    OUTPUT_VARIABLE PERL_LFLAGS\n-    )\n-\n-  # remove the new lines from the output by replacing them with empty strings\n-  string(REPLACE \"\\n\" \"\" PERL_INTERNAL_DIR \"${PERL_INTERNAL_DIR}\")\n-  string(REPLACE \"\\n\" \"\" PERL_CFLAGS \"${PERL_CFLAGS}\")\n-  string(REPLACE \"\\n\" \"\" PERL_LFLAGS \"${PERL_LFLAGS}\")\n-\n-  find_path(PERL_INCLUDE_PATH\n-    NAMES perl.h\n-    PATHS ${PERL_INTERNAL_DIR}\n-    )\n-\n-  find_library(PERL_LIBRARY\n-    NAMES perl\n-    PATHS /usr/lib /usr/local/lib /usr/pkg/lib ${PERL_INTERNAL_DIR}\n-    )\n-\n-  if(PERL_LIBRARY AND PERL_INCLUDE_PATH)\n-    set(PERL_FOUND TRUE)\n-  endif()\n-\n-  mark_as_advanced(\n-    PERL_EXECUTABLE\n-    PERL_INCLUDE_PATH\n-    PERL_LIBRARY\n-    PERL_CFLAGS\n-    PERL_LFLAGS\n-    )\n-endif()\n+set(PERL_EXECUTABLE \"@TERMUX_PREFIX@/bin/perl\")\n+set(PERL_INCLUDE_PATH \"@TERMUX_PREFIX@/include/perl/\")\n+set(PERL_LIBRARY \"@TERMUX_PREFIX@/lib\")\n+set(PERL_LFLAGS \"-lperl\")\n+set(PERL_FOUND TRUE)\n+\n+mark_as_advanced(\n+  PERL_EXECUTABLE\n+  PERL_INCLUDE_PATH\n+  PERL_LIBRARY\n+  PERL_CFLAGS\n+  PERL_LFLAGS\n+)\n"
  },
  {
    "path": "packages/weechat/no-setuid.patch",
    "content": "diff --git a/src/core/hook/wee-hook-process.c b/src/core/hook/wee-hook-process.c\nindex 4bc80f997..7089e504b 100644\n--- a/src/core/hook/wee-hook-process.c\n+++ b/src/core/hook/wee-hook-process.c\n@@ -673,8 +673,6 @@ hook_process_run (struct t_hook *hook_process)\n             return;\n         /* child process */\n         case 0:\n-            rc = setuid (getuid ());\n-            (void) rc;\n             hook_process_child (hook_process);\n             /* never executed */\n             _exit (EXIT_SUCCESS);\ndiff --git a/src/core/wee-network.c b/src/core/wee-network.c\nindex 8dfe8ae11..f554b2444 100644\n--- a/src/core/wee-network.c\n+++ b/src/core/wee-network.c\n@@ -1759,8 +1759,6 @@ network_connect_with_fork (struct t_hook *hook_connect)\n             return;\n         /* child process */\n         case 0:\n-            rc = setuid (getuid ());\n-            (void) rc;\n             close (HOOK_CONNECT(hook_connect, child_read));\n             if (hook_socketpair_ok)\n                 close (HOOK_CONNECT(hook_connect, child_recv));\ndiff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c\nindex ac23ac619..182953084 100644\n--- a/src/plugins/xfer/xfer-network.c\n+++ b/src/plugins/xfer/xfer-network.c\n@@ -236,8 +236,6 @@ xfer_network_send_file_fork (struct t_xfer *xfer)\n             xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);\n             return;\n         case 0:  /* child process */\n-            rc = setuid (getuid ());\n-            (void) rc;\n             close (xfer->child_read);\n             switch (xfer->protocol)\n             {\n@@ -309,8 +307,6 @@ xfer_network_recv_file_fork (struct t_xfer *xfer)\n             xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);\n             return;\n         case 0:  /* child process */\n-            rc = setuid (getuid ());\n-            (void) rc;\n             close (xfer->child_read);\n             switch (xfer->protocol)\n             {\n"
  },
  {
    "path": "packages/weechat/src-core-wee-config.c.patch",
    "content": "Enable mouse support by default.\n\ndiff -u -r ../weechat-1.5/src/core/wee-config.c ./src/core/wee-config.c\n--- ../weechat-1.5/src/core/wee-config.c\t2016-05-01 06:50:12.000000000 -0400\n+++ ./src/core/wee-config.c\t2016-05-03 03:36:49.136508465 -0400\n@@ -2993,7 +2993,7 @@\n         weechat_config_file, ptr_section,\n         \"mouse\", \"boolean\",\n         N_(\"enable mouse support\"),\n-        NULL, 0, 0, \"off\", NULL, 0,\n+        NULL, 0, 0, \"on\", NULL, 0,\n         NULL, NULL, NULL,\n         &config_change_mouse, NULL, NULL,\n         NULL, NULL, NULL);\n"
  },
  {
    "path": "packages/weechat/src-core-weechat.c.patch",
    "content": "diff -u -r ../weechat-1.3/src/core/weechat.c ./src/core/weechat.c\n--- ../weechat-1.3/src/core/weechat.c\t2015-08-16 02:27:07.000000000 -0400\n+++ ./src/core/weechat.c\t2016-01-04 11:26:46.103203700 -0500\n@@ -613,7 +613,9 @@\n     textdomain (PACKAGE);\n #endif /* ENABLE_NLS */\n \n-#ifdef HAVE_LANGINFO_CODESET\n+#ifdef __ANDROID__\n+    weechat_local_charset = strdup (\"UTF-8\");\n+#elif defined(HAVE_LANGINFO_CODESET)\n     weechat_local_charset = strdup (nl_langinfo (CODESET));\n #else\n     weechat_local_charset = strdup (\"\");\n"
  },
  {
    "path": "packages/weechat/src-gui-curses-CMakeLists.txt.patch",
    "content": "diff -u -r ../weechat-1.1.1/src/gui/curses/CMakeLists.txt ./src/gui/curses/CMakeLists.txt\n--- ../weechat-1.1.1/src/gui/curses/CMakeLists.txt\t2015-01-25 02:40:23.000000000 -0500\n+++ ./src/gui/curses/CMakeLists.txt\t2015-05-05 14:18:28.743723739 -0400\n@@ -59,8 +59,6 @@\n   list(APPEND EXTRA_LIBS \"socket\" \"nsl\")\n endif()\n \n-list(APPEND EXTRA_LIBS \"pthread\")\n-\n if(ICONV_LIBRARY)\n   list(APPEND EXTRA_LIBS ${ICONV_LIBRARY})\n endif()\n"
  },
  {
    "path": "packages/weechat/weechat-lua-plugin.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/weechat/plugins/lua.so\"\nTERMUX_SUBPKG_DESCRIPTION=\"WeeChat Lua Plugin\"\nTERMUX_SUBPKG_DEPENDS=\"liblua\"\n"
  },
  {
    "path": "packages/weechat/weechat-perl-plugin.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/weechat/plugins/perl.so\"\nTERMUX_SUBPKG_DESCRIPTION=\"WeeChat Perl Plugin\"\nTERMUX_SUBPKG_DEPENDS=\"perl\"\n"
  },
  {
    "path": "packages/weechat/weechat-python-plugin.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/weechat/plugins/python.so\"\nTERMUX_SUBPKG_DESCRIPTION=\"WeeChat Python3 Plugin\"\nTERMUX_SUBPKG_DEPENDS=\"python\"\n"
  },
  {
    "path": "packages/weechat/weechat-python38.patch",
    "content": "From 7208b0ff915fef14431474a397157a847bfc8661 Mon Sep 17 00:00:00 2001\nFrom: Eli Schwartz <eschwartz@archlinux.org>\nDate: Sun, 10 Nov 2019 09:23:59 -0500\nSubject: [PATCH 1/3] cmake: vendor in a new version of FindPkgConfig\n\nThe current one is anciently ancient, and dates back to commit\n4d2925ef1c3dd5df288be55557358b60cbb0926e which vendored this \"for old\nversions of cmake\". Well, currently it just stops using new versions of\nFindPkgConfig, so we're stuck on the 2006 version from cmake 2.5.0.\n\nInstead of deleting it entirely (the minimum version of cmake is\ncurrently 3.0) make this vendored file continue to be useful by using it\nto vendor in the latest version of FindPkgConfig from cmake 3.16.0-rc3\nwith a bunch of useful improvements.\n---\n cmake/FindPkgConfig.cmake | 788 +++++++++++++++++++++++++++++---------\n 1 file changed, 600 insertions(+), 188 deletions(-)\n\ndiff --git a/cmake/FindPkgConfig.cmake b/cmake/FindPkgConfig.cmake\nindex 360415309..5162a44b3 100644\n--- a/cmake/FindPkgConfig.cmake\n+++ b/cmake/FindPkgConfig.cmake\n@@ -1,117 +1,60 @@\n-# - a pkg-config module for CMake\n-#\n-# Usage:\n-#   pkg_check_modules(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)\n-#     checks for all the given modules\n-#\n-#   pkg_search_module(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)\n-#     checks for given modules and uses the first working one\n-#\n-# When the 'REQUIRED' argument was set, macros will fail with an error\n-# when module(s) could not be found\n-#\n-# It sets the following variables:\n-#   PKG_CONFIG_FOUND         ... true iff pkg-config works on the system\n-#   PKG_CONFIG_EXECUTABLE    ... pathname of the pkg-config program\n-#   <PREFIX>_FOUND           ... set to 1 iff module(s) exist\n-#\n-# For the following variables two sets of values exist; first one is the\n-# common one and has the given PREFIX. The second set contains flags\n-# which are given out when pkgconfig was called with the '--static'\n-# option.\n-#   <XPREFIX>_LIBRARIES      ... only the libraries (w/o the '-l')\n-#   <XPREFIX>_LIBRARY_DIRS   ... the paths of the libraries (w/o the '-L')\n-#   <XPREFIX>_LDFLAGS        ... all required linker flags\n-#   <XPREFIX>_LDFLAGS_OTHER ... all other linker flags\n-#   <XPREFIX>_INCLUDE_DIRS   ... the '-I' preprocessor flags (w/o the '-I')\n-#   <XPREFIX>_CFLAGS         ... all required cflags\n-#   <XPREFIX>_CFLAGS_OTHER  ... the other compiler flags\n-#\n-#   <XPREFIX> = <PREFIX>        for common case\n-#   <XPREFIX> = <PREFIX>_STATIC for static linking\n-#\n-# There are some special variables whose prefix depends on the count\n-# of given modules. When there is only one module, <PREFIX> stays\n-# unchanged. When there are multiple modules, the prefix will be\n-# changed to <PREFIX>_<MODNAME>:\n-#   <XPREFIX>_VERSION    ... version of the module\n-#   <XPREFIX>_PREFIX     ... prefix-directory of the module\n-#   <XPREFIX>_INCLUDEDIR ... include-dir of the module\n-#   <XPREFIX>_LIBDIR     ... lib-dir of the module\n-#\n-#   <XPREFIX> = <PREFIX>  when |MODULES| == 1, else\n-#   <XPREFIX> = <PREFIX>_<MODNAME>\n-#\n-# A <MODULE> parameter can have the following formats:\n-#   {MODNAME}            ... matches any version\n-#   {MODNAME}>={VERSION} ... at least version <VERSION> is required\n-#   {MODNAME}={VERSION}  ... exactly version <VERSION> is required\n-#   {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>\n-#\n-# Examples\n-#   pkg_check_modules (GLIB2   glib-2.0)\n-#\n-#   pkg_check_modules (GLIB2   glib-2.0>=2.10)\n-#     requires at least version 2.10 of glib2 and defines e.g.\n-#       GLIB2_VERSION=2.10.3\n-#\n-#   pkg_check_modules (FOO     glib-2.0>=2.10 gtk+-2.0)\n-#     requires both glib2 and gtk2, and defines e.g.\n-#       FOO_glib-2.0_VERSION=2.10.3\n-#       FOO_gtk+-2.0_VERSION=2.8.20\n-#\n-#   pkg_check_modules (XRENDER REQUIRED xrender)\n-#     defines e.g.:\n-#       XRENDER_LIBRARIES=Xrender;X11\n-#       XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp\n-#\n-#   pkg_search_module (BAR     libxml-2.0 libxml2 libxml>=2)\n-\n-\n-# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>\n-#\n-# Redistribution and use, with or without modification, are permitted\n-# provided that the following conditions are met:\n-#\n-#    1. Redistributions must retain the above copyright notice, this\n-#       list of conditions and the following disclaimer.\n-#    2. The name of the author may not be used to endorse or promote\n-#       products derived from this software without specific prior\n-#       written permission.\n-#\n-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n-# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n-# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying\n+# file Copyright.txt or https://cmake.org/licensing for details.\n+\n+#[========================================[.rst:\n+FindPkgConfig\n+-------------\n+\n+A ``pkg-config`` module for CMake.\n+\n+Finds the ``pkg-config`` executable and adds the :command:`pkg_get_variable`,\n+:command:`pkg_check_modules` and :command:`pkg_search_module` commands. The\n+following variables will also be set:\n \n+``PKG_CONFIG_FOUND``\n+  if pkg-config executable was found\n+``PKG_CONFIG_EXECUTABLE``\n+  pathname of the pkg-config program\n+``PKG_CONFIG_VERSION_STRING``\n+  version of pkg-config (since CMake 2.8.8)\n+\n+#]========================================]\n \n ### Common stuff ####\n set(PKG_CONFIG_VERSION 1)\n-set(PKG_CONFIG_FOUND   0)\n \n+# find pkg-config, use PKG_CONFIG if set\n+if((NOT PKG_CONFIG_EXECUTABLE) AND (NOT \"$ENV{PKG_CONFIG}\" STREQUAL \"\"))\n+  set(PKG_CONFIG_EXECUTABLE \"$ENV{PKG_CONFIG}\" CACHE FILEPATH \"pkg-config executable\")\n+endif()\n find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC \"pkg-config executable\")\n mark_as_advanced(PKG_CONFIG_EXECUTABLE)\n \n-if(PKG_CONFIG_EXECUTABLE)\n-  set(PKG_CONFIG_FOUND 1)\n-endif(PKG_CONFIG_EXECUTABLE)\n+if (PKG_CONFIG_EXECUTABLE)\n+  execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --version\n+    OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING\n+    ERROR_QUIET\n+    OUTPUT_STRIP_TRAILING_WHITESPACE)\n+endif ()\n+\n+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)\n+find_package_handle_standard_args(PkgConfig\n+                                  REQUIRED_VARS PKG_CONFIG_EXECUTABLE\n+                                  VERSION_VAR PKG_CONFIG_VERSION_STRING)\n \n+# This is needed because the module name is \"PkgConfig\" but the name of\n+# this variable has always been PKG_CONFIG_FOUND so this isn't automatically\n+# handled by FPHSA.\n+set(PKG_CONFIG_FOUND \"${PKGCONFIG_FOUND}\")\n \n # Unsets the given variables\n macro(_pkgconfig_unset var)\n   set(${var} \"\" CACHE INTERNAL \"\")\n-endmacro(_pkgconfig_unset)\n+endmacro()\n \n macro(_pkgconfig_set var value)\n   set(${var} ${value} CACHE INTERNAL \"\")\n-endmacro(_pkgconfig_set)\n+endmacro()\n \n # Invokes pkgconfig, cleans up the result and sets variables\n macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)\n@@ -120,55 +63,311 @@ macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)\n   execute_process(\n     COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist}\n     OUTPUT_VARIABLE _pkgconfig_invoke_result\n-    RESULT_VARIABLE _pkgconfig_failed)\n+    RESULT_VARIABLE _pkgconfig_failed\n+    OUTPUT_STRIP_TRAILING_WHITESPACE)\n \n   if (_pkgconfig_failed)\n     set(_pkgconfig_${_varname} \"\")\n     _pkgconfig_unset(${_prefix}_${_varname})\n-  else(_pkgconfig_failed)\n-    string(REGEX REPLACE \"[\\r\\n]\"                  \" \" _pkgconfig_invoke_result \"${_pkgconfig_invoke_result}\")\n-    string(REGEX REPLACE \" +$\"                     \"\"  _pkgconfig_invoke_result \"${_pkgconfig_invoke_result}\")\n+  else()\n+    string(REGEX REPLACE \"[\\r\\n]\"       \" \" _pkgconfig_invoke_result \"${_pkgconfig_invoke_result}\")\n \n     if (NOT ${_regexp} STREQUAL \"\")\n       string(REGEX REPLACE \"${_regexp}\" \" \" _pkgconfig_invoke_result \"${_pkgconfig_invoke_result}\")\n-    endif(NOT ${_regexp} STREQUAL \"\")\n+    endif()\n \n     separate_arguments(_pkgconfig_invoke_result)\n \n     #message(STATUS \"  ${_varname} ... ${_pkgconfig_invoke_result}\")\n     set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result})\n     _pkgconfig_set(${_prefix}_${_varname} \"${_pkgconfig_invoke_result}\")\n-  endif(_pkgconfig_failed)\n-endmacro(_pkgconfig_invoke)\n+  endif()\n+endmacro()\n+\n+# Internal version of pkg_get_variable; expects PKG_CONFIG_PATH to already be set\n+function (_pkg_get_variable result pkg variable)\n+  _pkgconfig_invoke(\"${pkg}\" \"prefix\" \"result\" \"\" \"--variable=${variable}\")\n+  set(\"${result}\"\n+    \"${prefix_result}\"\n+    PARENT_SCOPE)\n+endfunction ()\n \n # Invokes pkgconfig two times; once without '--static' and once with\n # '--static'\n macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)\n   _pkgconfig_invoke(\"${_pkglist}\" ${_prefix}        ${_varname} \"${cleanup_regexp}\" ${ARGN})\n   _pkgconfig_invoke(\"${_pkglist}\" ${_prefix} STATIC_${_varname} \"${cleanup_regexp}\" --static  ${ARGN})\n-endmacro(_pkgconfig_invoke_dyn)\n+endmacro()\n \n # Splits given arguments into options and a package list\n-macro(_pkgconfig_parse_options _result _is_req)\n+macro(_pkgconfig_parse_options _result _is_req _is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global)\n   set(${_is_req} 0)\n+  set(${_is_silent} 0)\n+  set(${_no_cmake_path} 0)\n+  set(${_no_cmake_environment_path} 0)\n+  set(${_imp_target} 0)\n+  set(${_imp_target_global} 0)\n+  if(DEFINED PKG_CONFIG_USE_CMAKE_PREFIX_PATH)\n+    if(NOT PKG_CONFIG_USE_CMAKE_PREFIX_PATH)\n+      set(${_no_cmake_path} 1)\n+      set(${_no_cmake_environment_path} 1)\n+    endif()\n+  elseif(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1)\n+    set(${_no_cmake_path} 1)\n+    set(${_no_cmake_environment_path} 1)\n+  endif()\n \n   foreach(_pkg ${ARGN})\n     if (_pkg STREQUAL \"REQUIRED\")\n       set(${_is_req} 1)\n-    endif (_pkg STREQUAL \"REQUIRED\")\n-  endforeach(_pkg ${ARGN})\n+    endif ()\n+    if (_pkg STREQUAL \"QUIET\")\n+      set(${_is_silent} 1)\n+    endif ()\n+    if (_pkg STREQUAL \"NO_CMAKE_PATH\")\n+      set(${_no_cmake_path} 1)\n+    endif()\n+    if (_pkg STREQUAL \"NO_CMAKE_ENVIRONMENT_PATH\")\n+      set(${_no_cmake_environment_path} 1)\n+    endif()\n+    if (_pkg STREQUAL \"IMPORTED_TARGET\")\n+      set(${_imp_target} 1)\n+    endif()\n+    if (_pkg STREQUAL \"GLOBAL\")\n+      set(${_imp_target_global} 1)\n+    endif()\n+  endforeach()\n+\n+  if (${_imp_target_global} AND NOT ${_imp_target})\n+    message(SEND_ERROR \"the argument GLOBAL may only be used together with IMPORTED_TARGET\")\n+  endif()\n \n   set(${_result} ${ARGN})\n   list(REMOVE_ITEM ${_result} \"REQUIRED\")\n-endmacro(_pkgconfig_parse_options)\n+  list(REMOVE_ITEM ${_result} \"QUIET\")\n+  list(REMOVE_ITEM ${_result} \"NO_CMAKE_PATH\")\n+  list(REMOVE_ITEM ${_result} \"NO_CMAKE_ENVIRONMENT_PATH\")\n+  list(REMOVE_ITEM ${_result} \"IMPORTED_TARGET\")\n+  list(REMOVE_ITEM ${_result} \"GLOBAL\")\n+endmacro()\n+\n+# Add the content of a variable or an environment variable to a list of\n+# paths\n+# Usage:\n+#  - _pkgconfig_add_extra_path(_extra_paths VAR)\n+#  - _pkgconfig_add_extra_path(_extra_paths ENV VAR)\n+function(_pkgconfig_add_extra_path _extra_paths_var _var)\n+  set(_is_env 0)\n+  if(ARGC GREATER 2 AND _var STREQUAL \"ENV\")\n+    set(_var ${ARGV2})\n+    set(_is_env 1)\n+  endif()\n+  if(NOT _is_env)\n+    if(NOT \"${${_var}}\" STREQUAL \"\")\n+      list(APPEND ${_extra_paths_var} ${${_var}})\n+    endif()\n+  else()\n+    if(NOT \"$ENV{${_var}}\" STREQUAL \"\")\n+      file(TO_CMAKE_PATH \"$ENV{${_var}}\" _path)\n+      list(APPEND ${_extra_paths_var} ${_path})\n+      unset(_path)\n+    endif()\n+  endif()\n+  set(${_extra_paths_var} ${${_extra_paths_var}} PARENT_SCOPE)\n+endfunction()\n+\n+# scan the LDFLAGS returned by pkg-config for library directories and\n+# libraries, figure out the absolute paths of that libraries in the\n+# given directories\n+function(_pkg_find_libs _prefix _no_cmake_path _no_cmake_environment_path)\n+  unset(_libs)\n+  unset(_find_opts)\n+\n+  # set the options that are used as long as the .pc file does not provide a library\n+  # path to look into\n+  if(_no_cmake_path)\n+    list(APPEND _find_opts \"NO_CMAKE_PATH\")\n+  endif()\n+  if(_no_cmake_environment_path)\n+    list(APPEND _find_opts \"NO_CMAKE_ENVIRONMENT_PATH\")\n+  endif()\n+\n+  unset(_search_paths)\n+  foreach (flag IN LISTS ${_prefix}_LDFLAGS)\n+    if (flag MATCHES \"^-L(.*)\")\n+      list(APPEND _search_paths ${CMAKE_MATCH_1})\n+      continue()\n+    endif()\n+    if (flag MATCHES \"^-l(.*)\")\n+      set(_pkg_search \"${CMAKE_MATCH_1}\")\n+    else()\n+      continue()\n+    endif()\n+\n+    if(_search_paths)\n+        # Firstly search in -L paths\n+        find_library(pkgcfg_lib_${_prefix}_${_pkg_search}\n+                     NAMES ${_pkg_search}\n+                     HINTS ${_search_paths} NO_DEFAULT_PATH)\n+    endif()\n+    find_library(pkgcfg_lib_${_prefix}_${_pkg_search}\n+                 NAMES ${_pkg_search}\n+                 ${_find_opts})\n+    mark_as_advanced(pkgcfg_lib_${_prefix}_${_pkg_search})\n+    if(pkgcfg_lib_${_prefix}_${_pkg_search})\n+      list(APPEND _libs \"${pkgcfg_lib_${_prefix}_${_pkg_search}}\")\n+    else()\n+      list(APPEND _libs ${_pkg_search})\n+    endif()\n+  endforeach()\n+\n+  set(${_prefix}_LINK_LIBRARIES \"${_libs}\" PARENT_SCOPE)\n+endfunction()\n+\n+# create an imported target from all the information returned by pkg-config\n+function(_pkg_create_imp_target _prefix _imp_target_global)\n+  # only create the target if it is linkable, i.e. no executables\n+  if (NOT TARGET PkgConfig::${_prefix}\n+      AND ( ${_prefix}_INCLUDE_DIRS OR ${_prefix}_LINK_LIBRARIES OR ${_prefix}_LDFLAGS_OTHER OR ${_prefix}_CFLAGS_OTHER ))\n+    if(${_imp_target_global})\n+      set(_global_opt \"GLOBAL\")\n+    else()\n+      unset(_global_opt)\n+    endif()\n+    add_library(PkgConfig::${_prefix} INTERFACE IMPORTED ${_global_opt})\n+\n+    if(${_prefix}_INCLUDE_DIRS)\n+      set_property(TARGET PkgConfig::${_prefix} PROPERTY\n+                   INTERFACE_INCLUDE_DIRECTORIES \"${${_prefix}_INCLUDE_DIRS}\")\n+    endif()\n+    if(${_prefix}_LINK_LIBRARIES)\n+      set_property(TARGET PkgConfig::${_prefix} PROPERTY\n+                   INTERFACE_LINK_LIBRARIES \"${${_prefix}_LINK_LIBRARIES}\")\n+    endif()\n+    if(${_prefix}_LDFLAGS_OTHER)\n+      set_property(TARGET PkgConfig::${_prefix} PROPERTY\n+                   INTERFACE_LINK_OPTIONS \"${${_prefix}_LDFLAGS_OTHER}\")\n+    endif()\n+    if(${_prefix}_CFLAGS_OTHER)\n+      set_property(TARGET PkgConfig::${_prefix} PROPERTY\n+                   INTERFACE_COMPILE_OPTIONS \"${${_prefix}_CFLAGS_OTHER}\")\n+    endif()\n+  endif()\n+endfunction()\n+\n+# recalculate the dynamic output\n+# this is a macro and not a function so the result of _pkg_find_libs is automatically propagated\n+macro(_pkg_recalculate _prefix _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global)\n+  _pkg_find_libs(${_prefix} ${_no_cmake_path} ${_no_cmake_environment_path})\n+  if(${_imp_target})\n+    _pkg_create_imp_target(${_prefix} ${_imp_target_global})\n+  endif()\n+endmacro()\n+\n+###\n+macro(_pkg_set_path_internal)\n+  set(_extra_paths)\n+\n+  if(NOT _no_cmake_path)\n+    _pkgconfig_add_extra_path(_extra_paths CMAKE_PREFIX_PATH)\n+    _pkgconfig_add_extra_path(_extra_paths CMAKE_FRAMEWORK_PATH)\n+    _pkgconfig_add_extra_path(_extra_paths CMAKE_APPBUNDLE_PATH)\n+  endif()\n+\n+  if(NOT _no_cmake_environment_path)\n+    _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_PREFIX_PATH)\n+    _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_FRAMEWORK_PATH)\n+    _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_APPBUNDLE_PATH)\n+  endif()\n+\n+  if(NOT _extra_paths STREQUAL \"\")\n+    # Save the PKG_CONFIG_PATH environment variable, and add paths\n+    # from the CMAKE_PREFIX_PATH variables\n+    set(_pkgconfig_path_old \"$ENV{PKG_CONFIG_PATH}\")\n+    set(_pkgconfig_path \"${_pkgconfig_path_old}\")\n+    if(NOT _pkgconfig_path STREQUAL \"\")\n+      file(TO_CMAKE_PATH \"${_pkgconfig_path}\" _pkgconfig_path)\n+    endif()\n+\n+    # Create a list of the possible pkgconfig subfolder (depending on\n+    # the system\n+    set(_lib_dirs)\n+    if(NOT DEFINED CMAKE_SYSTEM_NAME\n+        OR (CMAKE_SYSTEM_NAME MATCHES \"^(Linux|kFreeBSD|GNU)$\"\n+            AND NOT CMAKE_CROSSCOMPILING))\n+      if(EXISTS \"/etc/debian_version\") # is this a debian system ?\n+        if(CMAKE_LIBRARY_ARCHITECTURE)\n+          list(APPEND _lib_dirs \"lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig\")\n+        endif()\n+      else()\n+        # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties\n+        get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)\n+        if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)\n+          list(APPEND _lib_dirs \"lib32/pkgconfig\")\n+        endif()\n+        get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)\n+        if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)\n+          list(APPEND _lib_dirs \"lib64/pkgconfig\")\n+        endif()\n+        get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)\n+        if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL \"ELF X32\")\n+          list(APPEND _lib_dirs \"libx32/pkgconfig\")\n+        endif()\n+      endif()\n+    endif()\n+    if(CMAKE_SYSTEM_NAME STREQUAL \"FreeBSD\" AND NOT CMAKE_CROSSCOMPILING)\n+      list(APPEND _lib_dirs \"libdata/pkgconfig\")\n+    endif()\n+    list(APPEND _lib_dirs \"lib/pkgconfig\")\n+    list(APPEND _lib_dirs \"share/pkgconfig\")\n+\n+    # Check if directories exist and eventually append them to the\n+    # pkgconfig path list\n+    foreach(_prefix_dir ${_extra_paths})\n+      foreach(_lib_dir ${_lib_dirs})\n+        if(EXISTS \"${_prefix_dir}/${_lib_dir}\")\n+          list(APPEND _pkgconfig_path \"${_prefix_dir}/${_lib_dir}\")\n+          list(REMOVE_DUPLICATES _pkgconfig_path)\n+        endif()\n+      endforeach()\n+    endforeach()\n+\n+    # Prepare and set the environment variable\n+    if(NOT _pkgconfig_path STREQUAL \"\")\n+      # remove empty values from the list\n+      list(REMOVE_ITEM _pkgconfig_path \"\")\n+      file(TO_NATIVE_PATH \"${_pkgconfig_path}\" _pkgconfig_path)\n+      if(UNIX)\n+        string(REPLACE \";\" \":\" _pkgconfig_path \"${_pkgconfig_path}\")\n+        string(REPLACE \"\\\\ \" \" \" _pkgconfig_path \"${_pkgconfig_path}\")\n+      endif()\n+      set(ENV{PKG_CONFIG_PATH} \"${_pkgconfig_path}\")\n+    endif()\n+\n+    # Unset variables\n+    unset(_lib_dirs)\n+    unset(_pkgconfig_path)\n+  endif()\n+endmacro()\n+\n+macro(_pkg_restore_path_internal)\n+  if(NOT _extra_paths STREQUAL \"\")\n+    # Restore the environment variable\n+    set(ENV{PKG_CONFIG_PATH} \"${_pkgconfig_path_old}\")\n+  endif()\n+\n+  unset(_extra_paths)\n+  unset(_pkgconfig_path_old)\n+endmacro()\n \n ###\n-macro(_pkg_check_modules_internal _is_required _is_silent _prefix)\n+macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global _prefix)\n   _pkgconfig_unset(${_prefix}_FOUND)\n   _pkgconfig_unset(${_prefix}_VERSION)\n   _pkgconfig_unset(${_prefix}_PREFIX)\n   _pkgconfig_unset(${_prefix}_INCLUDEDIR)\n   _pkgconfig_unset(${_prefix}_LIBDIR)\n+  _pkgconfig_unset(${_prefix}_MODULE_NAME)\n   _pkgconfig_unset(${_prefix}_LIBS)\n   _pkgconfig_unset(${_prefix}_LIBS_L)\n   _pkgconfig_unset(${_prefix}_LIBS_PATHS)\n@@ -193,83 +392,77 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)\n     # give out status message telling checked module\n     if (NOT ${_is_silent})\n       if (_pkg_check_modules_cnt EQUAL 1)\n-        message(STATUS \"checking for module '${_pkg_check_modules_list}'\")\n-      else(_pkg_check_modules_cnt EQUAL 1)\n-        message(STATUS \"checking for modules '${_pkg_check_modules_list}'\")\n-      endif(_pkg_check_modules_cnt EQUAL 1)\n-    endif(NOT ${_is_silent})\n+        message(STATUS \"Checking for module '${_pkg_check_modules_list}'\")\n+      else()\n+        message(STATUS \"Checking for modules '${_pkg_check_modules_list}'\")\n+      endif()\n+    endif()\n \n     set(_pkg_check_modules_packages)\n     set(_pkg_check_modules_failed)\n \n+    _pkg_set_path_internal()\n+\n     # iterate through module list and check whether they exist and match the required version\n     foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})\n       set(_pkg_check_modules_exist_query)\n \n       # check whether version is given\n-      if (_pkg_check_modules_pkg MATCHES \".*(>=|=|<=).*\")\n-        string(REGEX REPLACE \"(.*[^><])(>=|=|<=)(.*)\" \"\\\\1\" _pkg_check_modules_pkg_name \"${_pkg_check_modules_pkg}\")\n-        string(REGEX REPLACE \"(.*[^><])(>=|=|<=)(.*)\" \"\\\\2\" _pkg_check_modules_pkg_op   \"${_pkg_check_modules_pkg}\")\n-        string(REGEX REPLACE \"(.*[^><])(>=|=|<=)(.*)\" \"\\\\3\" _pkg_check_modules_pkg_ver  \"${_pkg_check_modules_pkg}\")\n-      else(_pkg_check_modules_pkg MATCHES \".*(>=|=|<=).*\")\n+      if (_pkg_check_modules_pkg MATCHES \"(.*[^><])(=|[><]=?)(.*)\")\n+        set(_pkg_check_modules_pkg_name \"${CMAKE_MATCH_1}\")\n+        set(_pkg_check_modules_pkg_op \"${CMAKE_MATCH_2}\")\n+        set(_pkg_check_modules_pkg_ver \"${CMAKE_MATCH_3}\")\n+      else()\n         set(_pkg_check_modules_pkg_name \"${_pkg_check_modules_pkg}\")\n         set(_pkg_check_modules_pkg_op)\n         set(_pkg_check_modules_pkg_ver)\n-      endif(_pkg_check_modules_pkg MATCHES \".*(>=|=|<=).*\")\n-\n-      # handle the operands\n-      if (_pkg_check_modules_pkg_op STREQUAL \">=\")\n-        list(APPEND _pkg_check_modules_exist_query --atleast-version)\n-      endif(_pkg_check_modules_pkg_op STREQUAL \">=\")\n-\n-      if (_pkg_check_modules_pkg_op STREQUAL \"=\")\n-        list(APPEND _pkg_check_modules_exist_query --exact-version)\n-      endif(_pkg_check_modules_pkg_op STREQUAL \"=\")\n-\n-      if (_pkg_check_modules_pkg_op STREQUAL \"<=\")\n-        list(APPEND _pkg_check_modules_exist_query --max-version)\n-      endif(_pkg_check_modules_pkg_op STREQUAL \"<=\")\n-\n-      # create the final query which is of the format:\n-      # * --atleast-version <version> <pkg-name>\n-      # * --exact-version <version> <pkg-name>\n-      # * --max-version <version> <pkg-name>\n-      # * --exists <pkg-name>\n-      if (_pkg_check_modules_pkg_op)\n-        list(APPEND _pkg_check_modules_exist_query \"${_pkg_check_modules_pkg_ver}\")\n-      else(_pkg_check_modules_pkg_op)\n-        list(APPEND _pkg_check_modules_exist_query --exists)\n-      endif(_pkg_check_modules_pkg_op)\n+      endif()\n \n       _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)\n       _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)\n       _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR)\n       _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR)\n \n-      list(APPEND _pkg_check_modules_exist_query \"${_pkg_check_modules_pkg_name}\")\n       list(APPEND _pkg_check_modules_packages    \"${_pkg_check_modules_pkg_name}\")\n \n+      # create the final query which is of the format:\n+      # * <pkg-name> > <version>\n+      # * <pkg-name> >= <version>\n+      # * <pkg-name> = <version>\n+      # * <pkg-name> <= <version>\n+      # * <pkg-name> < <version>\n+      # * --exists <pkg-name>\n+      list(APPEND _pkg_check_modules_exist_query --print-errors --short-errors)\n+      if (_pkg_check_modules_pkg_op)\n+        list(APPEND _pkg_check_modules_exist_query \"${_pkg_check_modules_pkg_name} ${_pkg_check_modules_pkg_op} ${_pkg_check_modules_pkg_ver}\")\n+      else()\n+        list(APPEND _pkg_check_modules_exist_query --exists)\n+        list(APPEND _pkg_check_modules_exist_query \"${_pkg_check_modules_pkg_name}\")\n+      endif()\n+\n       # execute the query\n       execute_process(\n         COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query}\n-        RESULT_VARIABLE _pkgconfig_retval)\n+        RESULT_VARIABLE _pkgconfig_retval\n+        ERROR_VARIABLE _pkgconfig_error\n+        ERROR_STRIP_TRAILING_WHITESPACE)\n \n       # evaluate result and tell failures\n       if (_pkgconfig_retval)\n         if(NOT ${_is_silent})\n-          message(STATUS \"  package '${_pkg_check_modules_pkg}' not found\")\n-        endif(NOT ${_is_silent})\n+          message(STATUS \"  ${_pkgconfig_error}\")\n+        endif()\n \n         set(_pkg_check_modules_failed 1)\n-      endif(_pkgconfig_retval)\n-    endforeach(_pkg_check_modules_pkg)\n+      endif()\n+    endforeach()\n \n     if(_pkg_check_modules_failed)\n       # fail when requested\n       if (${_is_required})\n-        message(SEND_ERROR \"A required package was not found\")\n-      endif (${_is_required})\n-    else(_pkg_check_modules_failed)\n+        message(FATAL_ERROR \"A required package was not found\")\n+      endif ()\n+    else()\n       # when we are here, we checked whether requested modules\n       # exist. Now, go through them and set variables\n \n@@ -281,17 +474,23 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)\n         # handle case when there is only one package required\n         if (pkg_count EQUAL 1)\n           set(_pkg_check_prefix \"${_prefix}\")\n-        else(pkg_count EQUAL 1)\n+        else()\n           set(_pkg_check_prefix \"${_prefix}_${_pkg_check_modules_pkg}\")\n-        endif(pkg_count EQUAL 1)\n+        endif()\n \n         _pkgconfig_invoke(${_pkg_check_modules_pkg} \"${_pkg_check_prefix}\" VERSION    \"\"   --modversion )\n-        _pkgconfig_invoke(${_pkg_check_modules_pkg} \"${_pkg_check_prefix}\" PREFIX     \"\"   --variable=prefix )\n-        _pkgconfig_invoke(${_pkg_check_modules_pkg} \"${_pkg_check_prefix}\" INCLUDEDIR \"\"   --variable=includedir )\n-        _pkgconfig_invoke(${_pkg_check_modules_pkg} \"${_pkg_check_prefix}\" LIBDIR     \"\"   --variable=libdir )\n-\n-        message(STATUS \"  found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}\")\n-      endforeach(_pkg_check_modules_pkg)\n+        pkg_get_variable(\"${_pkg_check_prefix}_PREFIX\" ${_pkg_check_modules_pkg} \"prefix\")\n+        pkg_get_variable(\"${_pkg_check_prefix}_INCLUDEDIR\" ${_pkg_check_modules_pkg} \"includedir\")\n+        pkg_get_variable(\"${_pkg_check_prefix}_LIBDIR\" ${_pkg_check_modules_pkg} \"libdir\")\n+        foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR)\n+          _pkgconfig_set(\"${_pkg_check_prefix}_${variable}\" \"${${_pkg_check_prefix}_${variable}}\")\n+        endforeach ()\n+          _pkgconfig_set(\"${_pkg_check_prefix}_MODULE_NAME\" \"${_pkg_check_modules_pkg}\")\n+\n+        if (NOT ${_is_silent})\n+          message(STATUS \"  Found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}\")\n+        endif ()\n+      endforeach()\n \n       # set variables which are combined for multiple modules\n       _pkgconfig_invoke_dyn(\"${_pkg_check_modules_packages}\" \"${_prefix}\" LIBRARIES           \"(^| )-l\" --libs-only-l )\n@@ -302,58 +501,271 @@ macro(_pkg_check_modules_internal _is_required _is_silent _prefix)\n       _pkgconfig_invoke_dyn(\"${_pkg_check_modules_packages}\" \"${_prefix}\" INCLUDE_DIRS        \"(^| )-I\" --cflags-only-I )\n       _pkgconfig_invoke_dyn(\"${_pkg_check_modules_packages}\" \"${_prefix}\" CFLAGS              \"\"        --cflags )\n       _pkgconfig_invoke_dyn(\"${_pkg_check_modules_packages}\" \"${_prefix}\" CFLAGS_OTHER        \"\"        --cflags-only-other )\n-    endif(_pkg_check_modules_failed)\n-  else(PKG_CONFIG_EXECUTABLE)\n+\n+      _pkg_recalculate(\"${_prefix}\" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global})\n+    endif()\n+\n+    _pkg_restore_path_internal()\n+  else()\n     if (${_is_required})\n       message(SEND_ERROR \"pkg-config tool not found\")\n-    endif (${_is_required})\n-  endif(PKG_CONFIG_EXECUTABLE)\n-endmacro(_pkg_check_modules_internal)\n+    endif ()\n+  endif()\n+endmacro()\n+\n+\n+#[========================================[.rst:\n+.. command:: pkg_check_modules\n+\n+  Checks for all the given modules, setting a variety of result variables in\n+  the calling scope.\n+\n+  .. code-block:: cmake\n+\n+    pkg_check_modules(<prefix>\n+                      [REQUIRED] [QUIET]\n+                      [NO_CMAKE_PATH]\n+                      [NO_CMAKE_ENVIRONMENT_PATH]\n+                      [IMPORTED_TARGET [GLOBAL]]\n+                      <moduleSpec> [<moduleSpec>...])\n+\n+  When the ``REQUIRED`` argument is given, the command will fail with an error\n+  if module(s) could not be found.\n \n-###\n-### User visible macros start here\n-###\n+  When the ``QUIET`` argument is given, no status messages will be printed.\n+\n+  By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or\n+  later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set to a\n+  boolean ``True`` value, then the :variable:`CMAKE_PREFIX_PATH`,\n+  :variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH` cache\n+  and environment variables will be added to the ``pkg-config`` search path.\n+  The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments\n+  disable this behavior for the cache variables and environment variables\n+  respectively.\n+\n+  The ``IMPORTED_TARGET`` argument will create an imported target named\n+  ``PkgConfig::<prefix>`` that can be passed directly as an argument to\n+  :command:`target_link_libraries`. The ``GLOBAL`` argument will make the\n+  imported target available in global scope.\n+\n+  Each ``<moduleSpec>`` can be either a bare module name or it can be a\n+  module name with a version constraint (operators ``=``, ``<``, ``>``,\n+  ``<=`` and ``>=`` are supported).  The following are examples for a module\n+  named ``foo`` with various constraints:\n+\n+  - ``foo`` matches any version.\n+  - ``foo<2`` only matches versions before 2.\n+  - ``foo>=3.1`` matches any version from 3.1 or later.\n+  - ``foo=1.2.3`` requires that foo must be exactly version 1.2.3.\n+\n+  The following variables may be set upon return.  Two sets of values exist:\n+  One for the common case (``<XXX> = <prefix>``) and another for the\n+  information ``pkg-config`` provides when called with the ``--static``\n+  option (``<XXX> = <prefix>_STATIC``).\n+\n+  ``<XXX>_FOUND``\n+    set to 1 if module(s) exist\n+  ``<XXX>_LIBRARIES``\n+    only the libraries (without the '-l')\n+  ``<XXX>_LINK_LIBRARIES``\n+    the libraries and their absolute paths\n+  ``<XXX>_LIBRARY_DIRS``\n+    the paths of the libraries (without the '-L')\n+  ``<XXX>_LDFLAGS``\n+    all required linker flags\n+  ``<XXX>_LDFLAGS_OTHER``\n+    all other linker flags\n+  ``<XXX>_INCLUDE_DIRS``\n+    the '-I' preprocessor flags (without the '-I')\n+  ``<XXX>_CFLAGS``\n+    all required cflags\n+  ``<XXX>_CFLAGS_OTHER``\n+    the other compiler flags\n+\n+  All but ``<XXX>_FOUND`` may be a :ref:`;-list <CMake Language Lists>` if the\n+  associated variable returned from ``pkg-config`` has multiple values.\n+\n+  There are some special variables whose prefix depends on the number of\n+  ``<moduleSpec>`` given.  When there is only one ``<moduleSpec>``,\n+  ``<YYY>`` will simply be ``<prefix>``, but if two or more ``<moduleSpec>``\n+  items are given, ``<YYY>`` will be ``<prefix>_<moduleName>``.\n+\n+  ``<YYY>_VERSION``\n+    version of the module\n+  ``<YYY>_PREFIX``\n+    prefix directory of the module\n+  ``<YYY>_INCLUDEDIR``\n+    include directory of the module\n+  ``<YYY>_LIBDIR``\n+    lib directory of the module\n+\n+  Examples:\n+\n+  .. code-block:: cmake\n+\n+    pkg_check_modules (GLIB2 glib-2.0)\n+\n+  Looks for any version of glib2.  If found, the output variable\n+  ``GLIB2_VERSION`` will hold the actual version found.\n+\n+  .. code-block:: cmake\n+\n+    pkg_check_modules (GLIB2 glib-2.0>=2.10)\n \n-###\n+  Looks for at least version 2.10 of glib2.  If found, the output variable\n+  ``GLIB2_VERSION`` will hold the actual version found.\n+\n+  .. code-block:: cmake\n+\n+    pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)\n+\n+  Looks for both glib2-2.0 (at least version 2.10) and any version of\n+  gtk2+-2.0.  Only if both are found will ``FOO`` be considered found.\n+  The ``FOO_glib-2.0_VERSION`` and ``FOO_gtk+-2.0_VERSION`` variables will be\n+  set to their respective found module versions.\n+\n+  .. code-block:: cmake\n+\n+    pkg_check_modules (XRENDER REQUIRED xrender)\n+\n+  Requires any version of ``xrender``.  Example output variables set by a\n+  successful call::\n+\n+    XRENDER_LIBRARIES=Xrender;X11\n+    XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp\n+#]========================================]\n macro(pkg_check_modules _prefix _module0)\n+  _pkgconfig_parse_options(_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global \"${_module0}\" ${ARGN})\n   # check cached value\n-  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})\n-    _pkgconfig_parse_options   (_pkg_modules _pkg_is_required \"${_module0}\" ${ARGN})\n-    _pkg_check_modules_internal(\"${_pkg_is_required}\" 0 \"${_prefix}\" ${_pkg_modules})\n+  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR\n+      (NOT \"${ARGN}\" STREQUAL \"\" AND NOT \"${__pkg_config_arguments_${_prefix}}\" STREQUAL \"${_module0};${ARGN}\") OR\n+      (    \"${ARGN}\" STREQUAL \"\" AND NOT \"${__pkg_config_arguments_${_prefix}}\" STREQUAL \"${_module0}\"))\n+    _pkg_check_modules_internal(\"${_pkg_is_required}\" \"${_pkg_is_silent}\" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global} \"${_prefix}\" ${_pkg_modules})\n \n     _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})\n-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})\n-endmacro(pkg_check_modules)\n+    if (${_prefix}_FOUND)\n+      _pkgconfig_set(__pkg_config_arguments_${_prefix} \"${_module0};${ARGN}\")\n+    endif()\n+  else()\n+    if (${_prefix}_FOUND)\n+      _pkg_recalculate(\"${_prefix}\" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global})\n+    endif()\n+  endif()\n+endmacro()\n \n-###\n+\n+#[========================================[.rst:\n+.. command:: pkg_search_module\n+\n+  The behavior of this command is the same as :command:`pkg_check_modules`,\n+  except that rather than checking for all the specified modules, it searches\n+  for just the first successful match.\n+\n+  .. code-block:: cmake\n+\n+    pkg_search_module(<prefix>\n+                      [REQUIRED] [QUIET]\n+                      [NO_CMAKE_PATH]\n+                      [NO_CMAKE_ENVIRONMENT_PATH]\n+                      [IMPORTED_TARGET [GLOBAL]]\n+                      <moduleSpec> [<moduleSpec>...])\n+\n+  If a module is found, the ``<prefix>_MODULE_NAME`` variable will contain the\n+  name of the matching module. This variable can be used if you need to run\n+  :command:`pkg_get_variable`.\n+\n+  Example:\n+\n+  .. code-block:: cmake\n+\n+    pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)\n+#]========================================]\n macro(pkg_search_module _prefix _module0)\n+  _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global \"${_module0}\" ${ARGN})\n   # check cached value\n   if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)\n     set(_pkg_modules_found 0)\n-    _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required \"${_module0}\" ${ARGN})\n \n-    message(STATUS \"checking for one of the modules '${_pkg_modules_alt}'\")\n+    if (NOT ${_pkg_is_silent})\n+      message(STATUS \"Checking for one of the modules '${_pkg_modules_alt}'\")\n+    endif ()\n \n     # iterate through all modules and stop at the first working one.\n     foreach(_pkg_alt ${_pkg_modules_alt})\n       if(NOT _pkg_modules_found)\n-        _pkg_check_modules_internal(0 1 \"${_prefix}\" \"${_pkg_alt}\")\n-      endif(NOT _pkg_modules_found)\n+        _pkg_check_modules_internal(0 1 ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global} \"${_prefix}\" \"${_pkg_alt}\")\n+      endif()\n \n       if (${_prefix}_FOUND)\n         set(_pkg_modules_found 1)\n-      endif(${_prefix}_FOUND)\n-    endforeach(_pkg_alt)\n+        break()\n+      endif()\n+    endforeach()\n \n     if (NOT ${_prefix}_FOUND)\n       if(${_pkg_is_required})\n         message(SEND_ERROR \"None of the required '${_pkg_modules_alt}' found\")\n-      endif(${_pkg_is_required})\n-    endif(NOT ${_prefix}_FOUND)\n+      endif()\n+    endif()\n \n     _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})\n-  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)\n-endmacro(pkg_search_module)\n+  elseif (${_prefix}_FOUND)\n+    _pkg_recalculate(\"${_prefix}\" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global})\n+  endif()\n+endmacro()\n+\n+#[========================================[.rst:\n+.. command:: pkg_get_variable\n+\n+  Retrieves the value of a pkg-config variable ``varName`` and stores it in the\n+  result variable ``resultVar`` in the calling scope.\n+\n+  .. code-block:: cmake\n+\n+    pkg_get_variable(<resultVar> <moduleName> <varName>)\n+\n+  If ``pkg-config`` returns multiple values for the specified variable,\n+  ``resultVar`` will contain a :ref:`;-list <CMake Language Lists>`.\n+\n+  For example:\n+\n+  .. code-block:: cmake\n+\n+    pkg_get_variable(GI_GIRDIR gobject-introspection-1.0 girdir)\n+#]========================================]\n+function (pkg_get_variable result pkg variable)\n+  _pkg_set_path_internal()\n+  _pkgconfig_invoke(\"${pkg}\" \"prefix\" \"result\" \"\" \"--variable=${variable}\")\n+  set(\"${result}\"\n+    \"${prefix_result}\"\n+    PARENT_SCOPE)\n+  _pkg_restore_path_internal()\n+endfunction ()\n+\n+\n+#[========================================[.rst:\n+Variables Affecting Behavior\n+^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n+\n+.. variable:: PKG_CONFIG_EXECUTABLE\n+\n+  This can be set to the path of the pkg-config executable.  If not provided,\n+  it will be set by the module as a result of calling :command:`find_program`\n+  internally.  The ``PKG_CONFIG`` environment variable can be used as a hint.\n+\n+.. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH\n+\n+  Specifies whether :command:`pkg_check_modules` and\n+  :command:`pkg_search_module` should add the paths in the\n+  :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH` and\n+  :variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables to the\n+  ``pkg-config`` search path.\n+\n+  If this variable is not set, this behavior is enabled by default if\n+  :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled\n+  otherwise.\n+#]========================================]\n+\n \n ### Local Variables:\n ### mode: cmake\n-- \n2.24.0\n\n\nFrom 6595743466a2f1f25cae3cc8ccdeb9e3ca509265 Mon Sep 17 00:00:00 2001\nFrom: Eli Schwartz <eschwartz@archlinux.org>\nDate: Sun, 10 Nov 2019 10:24:25 -0500\nSubject: [PATCH 2/3] python: use more idiomatic cmake pkg-config linking\n\ncmake documentation is absolutely atrocious, and I don't know why they\nmention all the wrong things to use, and the cargo cult of successfully\nwriting a cmake build definition (copy-pasting what works from other\nprojects) also uses all the wrong things. But it turns out it is\npossible to correctly link a PkgConfig target despite all that, at\nleast, *iff* you use cmake >= 3.13. I've chosen option 2, which is to\nvendor in cmake >= 3.13's FindPkgConfig module in the previous commit.\n\nUsing IMPORTED_TARGET GLOBAL in a pkg-config check will result in a\nproper linker target being created. For comparison, this is like using\nmeson's dependency() target, except meson forces you to do this by\ndefault. The result is that the build system's internal representation\nof how to link something, is used instead of manually passing build\nflags defined in variables.\n\nThis is an important distinction to make, because cmake does not have a\nlist datatype, and instead turns lists into strings separated by ';'\nwhich are indistinguishable from, like, strings which contain ';'\ncharacters. When you pass the resulting list-which-isn't-really-a-list\nto link an executable/library, you either need to preprocess the\nvariable to replace ';' with ' ' (just in case there are multiple\nelements) or use cmake functions which magically know to do this\nthemselves -- or at least, I assume there are cmake functions that\ncorrectly handle so-called \"lists\", or there would be no need for\n\"lists\" to exist.\n\nThe IMPORTED_TARGET will define a bunch of INTERFACE_* properties which\ndo seem to do exactly this. The resulting build definition should\nactually, correctly, link python, thereby fixing #1398 in a better way.\n---\n cmake/FindPython.cmake            | 4 ++--\n src/plugins/python/CMakeLists.txt | 9 +--------\n 2 files changed, 3 insertions(+), 10 deletions(-)\n\ndiff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake\nindex 2e71e4c57..9e68d867b 100644\n--- a/cmake/FindPython.cmake\n+++ b/cmake/FindPython.cmake\n@@ -31,7 +31,7 @@\n include(FindPkgConfig)\n \n if(ENABLE_PYTHON2)\n-    pkg_check_modules(PYTHON python2)\n+    pkg_check_modules(PYTHON python2 IMPORTED_TARGET GLOBAL)\n else()\n-    pkg_check_modules(PYTHON python3)\n+    pkg_check_modules(PYTHON python3 IMPORTED_TARGET GLOBAL)\n endif()\ndiff --git a/src/plugins/python/CMakeLists.txt b/src/plugins/python/CMakeLists.txt\nindex 2229e551a..5a963efed 100644\n--- a/src/plugins/python/CMakeLists.txt\n+++ b/src/plugins/python/CMakeLists.txt\n@@ -23,14 +23,7 @@ weechat-python-api.c weechat-python-api.h)\n set_target_properties(python PROPERTIES PREFIX \"\")\n \n if(PYTHON_FOUND)\n-  # There's a weird bug on FreeBSD: the value of PYTHON_LDFLAGS is\n-  # \"-L/usr/local/lib;-lpython3.6m\" instead of \"-L/usr/local/lib -lpython3.6m\".\n-  # This is a temporary hack to fix the value, waiting for a clean fix.\n-  string(REPLACE \";\" \" \" PYTHON_LDFLAGS \"${PYTHON_LDFLAGS}\")\n-\n-  include_directories(${PYTHON_INCLUDE_DIRS})\n-  set(CMAKE_MODULE_LINKER_FLAGS \"${CMAKE_MODULE_LINKER_FLAGS} ${PYTHON_LDFLAGS}\")\n-  target_link_libraries(python ${PYTHON_LIBRARIES} weechat_plugins_scripts coverage_config)\n+  target_link_libraries(python PkgConfig::PYTHON weechat_plugins_scripts coverage_config)\n endif()\n \n install(TARGETS python LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins)\n-- \n2.24.0\n\n\nFrom 318cabf69208849d7c565b4981aca31dfabac513 Mon Sep 17 00:00:00 2001\nFrom: Eli Schwartz <eschwartz@archlinux.org>\nDate: Sun, 10 Nov 2019 10:40:43 -0500\nSubject: [PATCH 3/3] build: support python 3.8\n\nIn python 3.8, in order to link to -lpython3.8, you need to use the\nexported pkg-config interface 'python3-embed' (or 'python3-config --libs\n--embed'), see https://bugs.python.org/issue36721 for details.\n---\n cmake/FindPython.cmake | 5 ++++-\n configure.ac           | 5 ++++-\n 2 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake\nindex 9e68d867b..9c818c1d7 100644\n--- a/cmake/FindPython.cmake\n+++ b/cmake/FindPython.cmake\n@@ -33,5 +33,8 @@ include(FindPkgConfig)\n if(ENABLE_PYTHON2)\n     pkg_check_modules(PYTHON python2 IMPORTED_TARGET GLOBAL)\n else()\n-    pkg_check_modules(PYTHON python3 IMPORTED_TARGET GLOBAL)\n+    pkg_check_modules(PYTHON python3-embed IMPORTED_TARGET GLOBAL)\n+    if(NOT PYTHON_FOUND)\n+        pkg_check_modules(PYTHON python3 IMPORTED_TARGET GLOBAL)\n+    endif()\n endif()\ndiff --git a/configure.ac b/configure.ac\nindex ea014a988..e026789c3 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -477,7 +477,10 @@ if test \"x$enable_python\" = \"xyes\" ; then\n     if test \"x$enable_python2\" = \"xyes\" ; then\n         PKG_CHECK_MODULES(PYTHON, [python2], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python2`], [PYTHON_FOUND=no])\n     else\n-        PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no])\n+        PKG_CHECK_MODULES(PYTHON, [python3-embed], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3-embed`], [PYTHON_FOUND=no])\n+        if test \"x$PYTHON_FOUND\" != \"xyes\"; then\n+            PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no])\n+        fi\n     fi\n     if test \"x$PYTHON_FOUND\" != \"xyes\" ; then\n         AC_MSG_WARN([\n-- \n2.24.0\n\n"
  },
  {
    "path": "packages/weechat/weechat-ruby-plugin.subpackage.sh",
    "content": "TERMUX_SUBPKG_INCLUDE=\"lib/weechat/plugins/ruby.so\"\nTERMUX_SUBPKG_DESCRIPTION=\"WeeChat Ruby Plugin\"\nTERMUX_SUBPKG_DEPENDS=\"ruby\"\n"
  },
  {
    "path": "packages/wget/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/wget/\nTERMUX_PKG_DESCRIPTION=\"Commandline tool for retrieving files using HTTP, HTTPS and FTP\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.20.3\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SHA256=69607ce8216c2d1126b7a872db594b3f21e511e660e07ca1f81be96650932abb\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/wget/wget-${TERMUX_PKG_VERSION}.tar.lz\nTERMUX_PKG_DEPENDS=\"libiconv, pcre2, openssl, libuuid, libandroid-support, libunistring, zlib\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_func_getpass=yes\nac_cv_header_spawn_h=no\n--disable-iri\n--with-ssl=openssl\n\"\n"
  },
  {
    "path": "packages/wget/lib-stdio-impl.h.patch",
    "content": "diff -u -r ../wget-1.20.2/lib/stdio-impl.h ./lib/stdio-impl.h\n--- ../wget-1.20.2/lib/stdio-impl.h\t2019-04-01 18:26:23.000000000 +0000\n+++ ./lib/stdio-impl.h\t2019-04-03 21:54:29.141765465 +0000\n@@ -60,7 +60,7 @@\n #  define _flags pub._flags\n #  define _r pub._r\n #  define _w pub._w\n-# elif defined __ANDROID__ /* Android */\n+# elif defined __ANDROID_BUT_THIS_IS_BROKEN__ /* Android */\n #  ifdef __LP64__\n #   define _gl_flags_file_t int\n #  else\n"
  },
  {
    "path": "packages/wget/tmpdir-path.patch",
    "content": "diff -uNr wget-1.20.1/lib/tempname.c wget-1.20.1.mod/lib/tempname.c\n--- wget-1.20.1/lib/tempname.c\t2018-12-26 22:08:19.000000000 +0200\n+++ wget-1.20.1.mod/lib/tempname.c\t2019-03-01 18:28:01.751293299 +0200\n@@ -32,7 +32,7 @@\n \n #include <stdio.h>\n #ifndef P_tmpdir\n-# define P_tmpdir \"/tmp\"\n+# define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n #endif\n #ifndef TMP_MAX\n # define TMP_MAX 238328\n@@ -147,8 +147,8 @@\n     {\n       if (direxists (P_tmpdir))\n         dir = P_tmpdir;\n-      else if (strcmp (P_tmpdir, \"/tmp\") != 0 && direxists (\"/tmp\"))\n-        dir = \"/tmp\";\n+      else if (strcmp (P_tmpdir, \"@TERMUX_PREFIX@/tmp\") != 0 && direxists (\"@TERMUX_PREFIX@/tmp\"))\n+        dir = \"@TERMUX_PREFIX@/tmp\";\n       else\n         {\n           __set_errno (ENOENT);\ndiff -uNr wget-1.20.1/lib/tmpdir.c wget-1.20.1.mod/lib/tmpdir.c\n--- wget-1.20.1/lib/tmpdir.c\t2018-12-26 22:08:19.000000000 +0200\n+++ wget-1.20.1.mod/lib/tmpdir.c\t2019-03-01 18:27:22.434424043 +0200\n@@ -36,7 +36,7 @@\n # ifdef _P_tmpdir /* native Windows */\n #  define P_tmpdir _P_tmpdir\n # else\n-#  define P_tmpdir \"/tmp\"\n+#  define P_tmpdir \"@TERMUX_PREFIX@/tmp\"\n # endif\n #endif\n \n@@ -130,8 +130,8 @@\n #endif\n       if (direxists (P_tmpdir))\n         dir = P_tmpdir;\n-      else if (strcmp (P_tmpdir, \"/tmp\") != 0 && direxists (\"/tmp\"))\n-        dir = \"/tmp\";\n+      else if (strcmp (P_tmpdir, \"@TERMUX_PREFIX@/tmp\") != 0 && direxists (\"@TERMUX_PREFIX@/tmp\"))\n+        dir = \"@TERMUX_PREFIX@/tmp\";\n       else\n         {\n           __set_errno (ENOENT);\n"
  },
  {
    "path": "packages/wireguard-tools/android.c.patch",
    "content": "diff -u -r ../WireGuard-0.0.20180802/src/tools/wg-quick/android.c ./src/tools/wg-quick/android.c\n--- ../WireGuard-0.0.20180802/src/tools/wg-quick/android.c\t2018-08-03 03:19:55.000000000 +0000\n+++ ./src/tools/wg-quick/android.c\t2018-08-05 23:42:23.137024693 +0000\n@@ -242,17 +252,17 @@\n \tif (!getuid())\n \t\treturn;\n \n-\targs[0] = \"su\";\n-\targs[1] = \"-p\";\n+\targs[0] = \"tsu\";\n+\targs[1] = \"-a\";\n \targs[2] = \"-c\";\n \tmemcpy(&args[3], argv, argc * sizeof(*args));\n \targs[argc + 3] = NULL;\n \n-\tprintf(\"[$] su -p -c \");\n+\tprintf(\"[$] tsu -a -c \");\n \tfor (int i = 0; i < argc; ++i)\n \t\tprintf(\"%s%c\", argv[i], i == argc - 1 ? '\\n' : ' ');\n \n-\texecvp(\"su\", args);\n+\texecvp(\"tsu\", args);\n \texit(errno);\n }\n \n"
  },
  {
    "path": "packages/wireguard-tools/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.wireguard.com\nTERMUX_PKG_DESCRIPTION=\"Tools for the WireGuard secure network tunnel\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.0.20191012\nTERMUX_PKG_SRCURL=https://git.zx2c4.com/WireGuard/snapshot/WireGuard-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=93573193c9c1c22fde31eb1729ad428ca39da77a603a3d81561a9816ccecfa8e\nTERMUX_PKG_DEPENDS=\"libmnl, tsu\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_MAKE_ARGS=\" -C src/tools WITH_BASHCOMPLETION=yes WITH_WGQUICK=no WITH_SYSTEMDUNITS=no\"\n\ntermux_step_post_make_install() {\n    cd src/tools/wg-quick\n    $CC $CFLAGS $LDFLAGS -DWG_CONFIG_SEARCH_PATHS=\"\\\"$TERMUX_ANDROID_HOME/.wireguard $TERMUX_PREFIX/etc/wireguard /data/misc/wireguard /data/data/com.wireguard.android/files\\\"\" -o wg-quick android.c\n    install -m 0755 wg-quick $TERMUX_PREFIX/bin\n}\n"
  },
  {
    "path": "packages/wol/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/wake-on-lan/\nTERMUX_PKG_DESCRIPTION=\"Program implementing Wake On LAN functionality\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=0.7.1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/wake-on-lan/wol/${TERMUX_PKG_VERSION}/wol-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=e0086c9b9811df2bdf763ec9016dfb1bcb7dba9fa6d7858725b0929069a12622\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--mandir=$TERMUX_PREFIX/share/man\"\nTERMUX_PKG_RM_AFTER_INSTALL=\"info/\"\n\ntermux_step_pre_configure() {\n\texport ac_cv_func_mmap_fixed_mapped=yes\n\texport jm_cv_func_working_malloc=yes\n\texport ac_cv_func_alloca_works=yes\n}\n"
  },
  {
    "path": "packages/wol/lib-getline.h.patch",
    "content": "diff -u -r ../wol-0.7.1/lib/getline.h ./lib/getline.h\n--- ../wol-0.7.1/lib/getline.h\t2002-03-11 12:55:36.000000000 -0500\n+++ ./lib/getline.h\t2016-02-05 16:14:45.530639085 -0500\n@@ -19,20 +19,4 @@\n \n # include <stdio.h>\n \n-# ifndef PARAMS\n-#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)\n-#   define PARAMS(Args) Args\n-#  else\n-#   define PARAMS(Args) ()\n-#  endif\n-# endif\n-\n-# if __GLIBC__ < 2\n-int\n-getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));\n-\n-int\n-getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));\n-# endif\n-\n #endif /* not GETLINE_H_ */\n"
  },
  {
    "path": "packages/wol/src-magic.c.patch",
    "content": "diff -u -r ../wol-0.7.1/src/magic.c ./src/magic.c\n--- ../wol-0.7.1/src/magic.c\t2003-08-12 16:45:22.000000000 +0000\n+++ ./src/magic.c\t2017-07-07 06:18:14.306649401 +0000\n@@ -114,7 +114,9 @@\n \tXFREE ((void *) m);\n }\n \n-\n+#ifdef __ANDROID__\n+extern int ether_hostton(const char *, struct ether_addr *);\n+#endif\n \n int\n magic_assemble (struct magic *magic_buf, const char *mac_str,\n"
  },
  {
    "path": "packages/wordgrinder/Makefile.patch",
    "content": "diff -uNr wordgrinder-0.7.2/Makefile wordgrinder-0.7.2.mod/Makefile\n--- wordgrinder-0.7.2/Makefile\t2018-11-29 21:12:27.000000000 +0200\n+++ wordgrinder-0.7.2.mod/Makefile\t2019-01-28 20:03:20.720358428 +0200\n@@ -86,7 +86,7 @@\n \n # Do you want your binaries stripped on installation?\n \n-WANT_STRIPPED_BINARIES ?= yes\n+WANT_STRIPPED_BINARIES ?= no\n \n # ===========================================================================\n #                       END OF CONFIGURATION OPTIONS\n"
  },
  {
    "path": "packages/wordgrinder/build.lua.patch",
    "content": "diff -uNr wordgrinder-0.7.2/build.lua wordgrinder-0.7.2.mod/build.lua\n--- wordgrinder-0.7.2/build.lua\t2018-11-29 21:12:27.000000000 +0200\n+++ wordgrinder-0.7.2.mod/build.lua\t2019-01-28 20:10:29.090884934 +0200\n@@ -496,11 +496,9 @@\n             if has_package(luapackage) then\n                 if want_frontend(\"x11\") then\n                     build_wordgrinder_binary(\"bin/xwordgrinder\", luapackage, \"x11\", buildstyle)\n-                    run_wordgrinder_tests(\"bin/xwordgrinder\", luapackage, \"x11\", buildstyle)\n                 end\n                 if want_frontend(\"curses\") then\n                     build_wordgrinder_binary(\"bin/wordgrinder\", luapackage, \"curses\", buildstyle)\n-                    run_wordgrinder_tests(\"bin/wordgrinder\", luapackage, \"curses\", buildstyle)\n                 end\n             end\n         end\n@@ -526,23 +524,14 @@\n         return binary\n     end\n \n-    local preferred_test\n     local preferred_curses\n     local preferred_x11\n     if want_frontend(\"curses\") then\n         preferred_curses = \"bin/wordgrinder-\"..package_name(LUA_PACKAGE)..\"-curses-release\"\n-        preferred_test = \"test-\"..package_name(LUA_PACKAGE)..\"-curses-debug\"\n-\n-        preferred_curses = strip_binary(preferred_curses)\n         install_file(\"755\", preferred_curses, DESTDIR..BINDIR..\"/wordgrinder\")\n     end\n     if want_frontend(\"x11\") then\n         preferred_x11 = \"bin/xwordgrinder-\"..package_name(LUA_PACKAGE)..\"-x11-release\"\n-        if not preferred_test then\n-            preferred_test = \"test-\"..package_name(LUA_PACKAGE)..\"-x11-debug\"\n-        end\n-\n-        preferred_x11 = strip_binary(preferred_x11)\n         install_file(\"755\", preferred_x11, DESTDIR..BINDIR..\"/xwordgrinder\")\n     end\n     install_file(\"644\", \"bin/wordgrinder.1\", DESTDIR..MANDIR..\"/man1/wordgrinder.1\")\n@@ -553,8 +542,7 @@\n     emit(\"  version = \", VERSION)\n \n     emit(\"build binaries: phony bin/wordgrinder.1 \", preferred_curses or \"\", \" \", preferred_x11 or \"\", \" \")\n-\temit(\"build tests: phony \", preferred_test)\n-    emit(\"build all: phony binaries tests\")\n+    emit(\"build all: phony binaries\")\n     emit(\"build install: phony all \", table.concat(installables, \" \"))\n     emit(\"build install-notests: phony binaries \", table.concat(installables, \" \"))\n end\n"
  },
  {
    "path": "packages/wordgrinder/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://cowlark.com/wordgrinder/\nTERMUX_PKG_DESCRIPTION=\"A Unicode-aware character cell word processor\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.7.2\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://github.com/davidgiven/wordgrinder/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=4e1bc659403f98479fe8619655f901c8c03eb87743374548b4d20a41d31d1dff\nTERMUX_PKG_DEPENDS=\"liblua, ncurses, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\ttermux_setup_ninja\n\tmake CC=gcc OBJDIR=\"$PWD/build\" \"$PWD\"/build/lua\n\tmake OBJDIR=\"$PWD/build\" LUA_PACKAGE=lua\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$TERMUX_PKG_SRCDIR\"/bin/wordgrinder-lua-curses-release \\\n\t\t\"$TERMUX_PREFIX\"/bin/wordgrinder\n\tinstall -Dm600 \\\n\t\t\"$TERMUX_PKG_SRCDIR\"/bin/wordgrinder.1 \\\n\t\t\"$TERMUX_PREFIX\"/share/man/man1/\n}\n"
  },
  {
    "path": "packages/wren/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://wren.io/\nTERMUX_PKG_DESCRIPTION=\"Small, fast, class-based concurrent scripting language\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.1.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://github.com/wren-lang/wren/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=ebf8687dfdb55997a3fc263d41f306c6f40d9562ccbd945d9c12c48795388eae\nTERMUX_PKG_DEPENDS=\"libuv\"\nTERMUX_PKG_BREAKS=\"wren-dev\"\nTERMUX_PKG_REPLACES=\"wren-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make_install() {\n\tinstall -Dm700 \"$TERMUX_PKG_SRCDIR\"/bin/wren \\\n\t\t\"$TERMUX_PREFIX\"/bin/wren\n\n\tinstall -Dm600 \"$TERMUX_PKG_SRCDIR\"/src/include/wren.h \\\n\t\t\"$TERMUX_PREFIX\"/include/wren.h\n\n\tinstall -Dm600 \"$TERMUX_PKG_SRCDIR\"/lib/libwren.so \\\n\t\t\"$TERMUX_PREFIX\"/lib/libwren.so\n}\n"
  },
  {
    "path": "packages/wren/libuv-sys-include.patch",
    "content": "diff -uNr wren-0.1.0/src/cli/vm.h wren-0.1.0.mod/src/cli/vm.h\n--- wren-0.1.0/src/cli/vm.h\t2016-05-21 20:53:05.000000000 +0300\n+++ wren-0.1.0.mod/src/cli/vm.h\t2019-07-01 21:53:28.116581394 +0300\n@@ -1,7 +1,7 @@\n #ifndef vm_h\n #define vm_h\n \n-#include \"uv.h\"\n+#include <uv.h>\n #include \"wren.h\"\n \n // Executes the Wren script at [path] in a new VM.\ndiff -uNr wren-0.1.0/src/module/io.c wren-0.1.0.mod/src/module/io.c\n--- wren-0.1.0/src/module/io.c\t2016-05-21 20:53:05.000000000 +0300\n+++ wren-0.1.0.mod/src/module/io.c\t2019-07-01 21:53:23.563209454 +0300\n@@ -1,7 +1,7 @@\n #include <stdlib.h>\n #include <string.h>\n \n-#include \"uv.h\"\n+#include <uv.h>\n \n #include \"scheduler.h\"\n #include \"vm.h\"\ndiff -uNr wren-0.1.0/src/module/scheduler.c wren-0.1.0.mod/src/module/scheduler.c\n--- wren-0.1.0/src/module/scheduler.c\t2016-05-21 20:53:05.000000000 +0300\n+++ wren-0.1.0.mod/src/module/scheduler.c\t2019-07-01 21:53:03.086368797 +0300\n@@ -1,7 +1,7 @@\n #include <stdlib.h>\n #include <string.h>\n \n-#include \"uv.h\"\n+#include <uv.h>\n \n #include \"scheduler.h\"\n #include \"wren.h\"\ndiff -uNr wren-0.1.0/src/module/timer.c wren-0.1.0.mod/src/module/timer.c\n--- wren-0.1.0/src/module/timer.c\t2016-05-21 20:53:05.000000000 +0300\n+++ wren-0.1.0.mod/src/module/timer.c\t2019-07-01 21:53:32.426617909 +0300\n@@ -1,7 +1,7 @@\n #include <stdlib.h>\n #include <string.h>\n \n-#include \"uv.h\"\n+#include <uv.h>\n \n #include \"scheduler.h\"\n #include \"vm.h\"\n"
  },
  {
    "path": "packages/wren/util-wren.mk.patch",
    "content": "diff -uNr wren-0.1.0/util/wren.mk wren-0.1.0.mod/util/wren.mk\n--- wren-0.1.0/util/wren.mk\t2016-05-21 20:53:05.000000000 +0300\n+++ wren-0.1.0.mod/util/wren.mk\t2019-07-01 21:55:56.761159939 +0300\n@@ -42,11 +42,11 @@\n # Mode configuration.\n ifeq ($(MODE),debug)\n \tWREN := wrend\n-\tC_OPTIONS += -O0 -DDEBUG -g\n+\tC_OPTIONS += -DDEBUG -g $(CFLAGS) $(CPPFLAGS)\n \tBUILD_DIR := $(BUILD_DIR)/debug\n else\n \tWREN += wren\n-\tC_OPTIONS += -O3\n+\tC_OPTIONS += $(CFLAGS) $(CPPFLAGS)\n \tBUILD_DIR := $(BUILD_DIR)/release\n endif\n \n@@ -106,8 +106,6 @@\n \t# Link in the right libraries needed by libuv on Windows and Linux.\n \tifeq ($(OS),mingw32)\n \t\tLIBUV_LIBS := -lws2_32 -liphlpapi -lpsapi -luserenv\n-\telse\n-\t\tLIBUV_LIBS := -lpthread -lrt\n \tendif\n endif\n \n@@ -119,13 +117,9 @@\n VM_OBJECTS     := $(addprefix $(BUILD_DIR)/vm/, $(notdir $(VM_SOURCES:.c=.o)))\n TEST_OBJECTS   := $(patsubst test/api/%.c, $(BUILD_DIR)/test/%.o, $(TEST_SOURCES))\n \n-LIBUV_DIR := deps/libuv\n-LIBUV     := build/libuv$(LIBUV_ARCH).a\n-\n # Flags needed to compile source files for the CLI, including the modules and\n # API tests.\n-CLI_FLAGS := -D_XOPEN_SOURCE=600 -Isrc/include -I$(LIBUV_DIR)/include \\\n-             -Isrc/cli -Isrc/module\n+CLI_FLAGS := -D_XOPEN_SOURCE=600 -Isrc/include -Isrc/cli -Isrc/module\n \n # Targets ---------------------------------------------------------------------\n \n@@ -148,11 +142,10 @@\n test: $(BUILD_DIR)/test/$(WREN)\n \n # Command-line interpreter.\n-bin/$(WREN): $(OPT_OBJECTS) $(CLI_OBJECTS) $(MODULE_OBJECTS) $(VM_OBJECTS) \\\n-\t\t$(LIBUV)\n+bin/$(WREN): $(OPT_OBJECTS) $(CLI_OBJECTS) $(MODULE_OBJECTS) $(VM_OBJECTS)\n \t@ printf \"%10s %-30s %s\\n\" $(CC) $@ \"$(C_OPTIONS)\"\n \t@ mkdir -p bin\n-\t@ $(CC) $(CFLAGS) $^ -o $@ -lm $(LIBUV_LIBS)\n+\t@ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) -lm -luv\n \n # Static library.\n lib/lib$(WREN).a: $(OPT_OBJECTS) $(VM_OBJECTS)\n@@ -168,21 +161,21 @@\n \n # Test executable.\n $(BUILD_DIR)/test/$(WREN): $(OPT_OBJECTS) $(MODULE_OBJECTS) $(TEST_OBJECTS) \\\n-\t\t$(VM_OBJECTS) $(BUILD_DIR)/cli/modules.o $(BUILD_DIR)/cli/vm.o $(LIBUV)\n+\t\t$(VM_OBJECTS) $(BUILD_DIR)/cli/modules.o $(BUILD_DIR)/cli/vm.o\n \t@ printf \"%10s %-30s %s\\n\" $(CC) $@ \"$(C_OPTIONS)\"\n \t@ mkdir -p $(BUILD_DIR)/test\n-\t@ $(CC) $(CFLAGS) $^ -o $@ -lm $(LIBUV_LIBS)\n+\t@ $(CC) $(CFLAGS) $^ -o $@ -lm -luv\n \n # CLI object files.\n $(BUILD_DIR)/cli/%.o: src/cli/%.c $(CLI_HEADERS) $(MODULE_HEADERS) \\\n-\t\t$(VM_HEADERS) $(LIBUV)\n+\t\t$(VM_HEADERS)\n \t@ printf \"%10s %-30s %s\\n\" $(CC) $< \"$(C_OPTIONS)\"\n \t@ mkdir -p $(BUILD_DIR)/cli\n \t@ $(CC) -c $(CFLAGS) $(CLI_FLAGS) -o $@ $(FILE_FLAG) $<\n \n # Module object files.\n $(BUILD_DIR)/module/%.o: src/module/%.c $(CLI_HEADERS) $(MODULE_HEADERS) \\\n-\t\t$(VM_HEADERS) $(LIBUV)\n+\t\t$(VM_HEADERS)\n \t@ printf \"%10s %-30s %s\\n\" $(CC) $< \"$(C_OPTIONS)\"\n \t@ mkdir -p $(BUILD_DIR)/module\n \t@ $(CC) -c $(CFLAGS) $(CLI_FLAGS) -o $@ $(FILE_FLAG) $<\n@@ -201,19 +194,11 @@\n \n # Test object files.\n $(BUILD_DIR)/test/%.o: test/api/%.c $(OPT_HEADERS) $(MODULE_HEADERS) \\\n-\t\t $(VM_HEADERS) $(TEST_HEADERS) $(LIBUV)\n+\t\t $(VM_HEADERS) $(TEST_HEADERS)\n \t@ printf \"%10s %-30s %s\\n\" $(CC) $< \"$(C_OPTIONS)\"\n \t@ mkdir -p $(dir $@)\n \t@ $(CC) -c $(CFLAGS) $(CLI_FLAGS) -o $@ $(FILE_FLAG) $<\n \n-# Download libuv.\n-$(LIBUV_DIR)/build/gyp/gyp: util/libuv.py\n-\t@ ./util/libuv.py download\n-\n-# Build libuv to a static library.\n-$(LIBUV): $(LIBUV_DIR)/build/gyp/gyp util/libuv.py\n-\t@ ./util/libuv.py build $(LIBUV_ARCH)\n-\n # Wren modules that get compiled into the binary as C strings.\n src/optional/wren_opt_%.wren.inc: src/optional/wren_opt_%.wren util/wren_to_c_string.py\n \t@ printf \"%10s %-30s %s\\n\" str $<\n"
  },
  {
    "path": "packages/wuzz/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/asciimoo/wuzz\nTERMUX_PKG_DESCRIPTION=\"Interactive command line tool for HTTP inspection\"\nTERMUX_PKG_LICENSE=\"AGPL-V3\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.4.0\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://github.com/asciimoo/wuzz/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=acf8e82481740d1403b744c58918b9089128d91c3c6edc15b76b6e1c97ead645\n\ntermux_step_make() {\n\ttermux_setup_golang\n\n\texport GOPATH=$TERMUX_PKG_BUILDDIR\n\tmkdir -p \"$GOPATH\"/src/github.com/asciimoo\n\tln -sf \"$TERMUX_PKG_SRCDIR\" \"$GOPATH\"/src/github.com/asciimoo/wuzz\n\n\tcd \"$GOPATH\"/src/github.com/asciimoo/wuzz\n\tgo get -d -v github.com/asciimoo/wuzz\n\tgo build\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \\\n\t\t\"$GOPATH\"/src/github.com/asciimoo/wuzz/wuzz \\\n\t\t\"$TERMUX_PREFIX\"/bin/wuzz\n}\n"
  },
  {
    "path": "packages/x11-repo/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/termux/x11-packages\nTERMUX_PKG_DESCRIPTION=\"Package repository containing X11 programs and libraries\"\nTERMUX_PKG_LICENSE=\"Apache-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=3.0\nTERMUX_PKG_DEPENDS=\"termux-keyring\"\nTERMUX_PKG_SKIP_SRC_EXTRACT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tmkdir -p $TERMUX_PREFIX/etc/apt/sources.list.d\n\techo \"deb https://dl.bintray.com/xeffyr/x11-packages x11 main\" > $TERMUX_PREFIX/etc/apt/sources.list.d/x11.list\n}\n\ntermux_step_create_debscripts() {\n\techo \"#!$TERMUX_PREFIX/bin/sh\" > postinst\n\techo \"echo Downloading updated package list ...\" >> postinst\n\techo \"apt update\" >> postinst\n\techo \"exit 0\" >> postinst\n}\n"
  },
  {
    "path": "packages/xcb-proto/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xcb.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"XML-XCB protocol descriptions\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.13\nTERMUX_PKG_REVISION=10\nTERMUX_PKG_SRCURL=https://xcb.freedesktop.org/dist/xcb-proto-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=7b98721e669be80284e9bbfeab02d2d0d54cd11172b72271e47a2fe875e2bde1\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\nTERMUX_PKG_CONFLICTS=\"xcbproto\"\nTERMUX_PKG_REPLACES=\"xcbproto\"\n"
  },
  {
    "path": "packages/xmlsec/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.aleksey.com/xmlsec/\nTERMUX_PKG_DESCRIPTION=\"XML Security Library\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=1.2.29\nTERMUX_PKG_SHA256=b1d1deba966019930f608d1f2b95c40ca3450f1393bcd3a3c001a8ba1d2839ab\nTERMUX_PKG_SRCURL=http://www.aleksey.com/xmlsec/download/xmlsec1-$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_DEPENDS=\"libxslt, openssl, libgcrypt, libgpg-error, libxml2\"\nTERMUX_PKG_BREAKS=\"xmlsec-dev\"\nTERMUX_PKG_REPLACES=\"xmlsec-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\n--disable-crypto-dl\n--without-gnutls\n\"\n"
  },
  {
    "path": "packages/xmlstarlet/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://xmlstar.sourceforge.net/\nTERMUX_PKG_DESCRIPTION=\"Command line XML toolkit\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_VERSION=1.6.1\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/xmlstar/xmlstarlet/${TERMUX_PKG_VERSION}/xmlstarlet-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=15d838c4f3375332fd95554619179b69e4ec91418a3a5296e7c631b7ed19e7ca\nTERMUX_PKG_DEPENDS=\"libxslt, libxml2\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--with-libxml-include-prefix=${TERMUX_PREFIX}/include/libxml2\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_make_install() {\n\tln -sfr $TERMUX_PREFIX/bin/xml $TERMUX_PREFIX/bin/xmlstarlet\n}\n"
  },
  {
    "path": "packages/xorg-util-macros/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X.Org Autotools macros\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.19.2\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/util/util-macros-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=d7e43376ad220411499a79735020f9d145fdc159284867e99467e0d771f3e712\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_post_make_install() {\n\tmkdir -p ${TERMUX_PREFIX}/lib/pkgconfig\n\tmv ${TERMUX_PREFIX}/share/pkgconfig/xorg-macros.pc ${TERMUX_PREFIX}/lib/pkgconfig/\n}\n"
  },
  {
    "path": "packages/xorg-util-macros/util-macros-1.19.1_xorg-macros.m4.in.patch",
    "content": "diff -uNr util-macros-1.19.1/xorg-macros.m4.in util-macros-1.19.1.mod/xorg-macros.m4.in\n--- util-macros-1.19.1/xorg-macros.m4.in\t2017-01-29 21:22:45.000000000 +0200\n+++ util-macros-1.19.1.mod/xorg-macros.m4.in\t2017-11-24 13:21:36.220629554 +0200\n@@ -58,7 +58,7 @@\n AC_DEFUN([XORG_PROG_RAWCPP],[\n AC_REQUIRE([AC_PROG_CPP])\n AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],\n-   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])\n+   [$PATH:/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/lib:/usr/bin:/usr/lib:/bin:/lib])\n \n # Check for flag to avoid builtin definitions - assumes unix is predefined,\n # which is not the best choice for supporting other OS'es, but covers most\n@@ -917,7 +917,7 @@\n        [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \\\n          ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],\n    [AC_MSG_ERROR([could not find m4 that supports -I option])],\n-   [$PATH:/usr/gnu/bin])])\n+   [$PATH:/data/data/com.termux/files/usr/bin:/usr/bin:/bin])])\n \n AC_SUBST([M4], [$ac_cv_path_M4])\n ]) # XORG_WITH_M4\n"
  },
  {
    "path": "packages/xorgproto/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X.Org X11 Protocol headers\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2019.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/archive/individual/proto/xorgproto-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=46ecd0156c561d41e8aa87ce79340910cdf38373b759e737fcbba5df508e7b8e\nTERMUX_PKG_DEPENDS=\"xorg-util-macros\"\nTERMUX_PKG_CONFLICTS=\"x11-proto\"\nTERMUX_PKG_REPLACES=\"x11-proto\"\nTERMUX_PKG_NO_DEVELSPLIT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"-Dlegacy=true\"\n\nTERMUX_PKG_RM_AFTER_INSTALL=\"\ninclude/X11/extensions/apple*\ninclude/X11/extensions/windows*\ninclude/X11/extensions/XKBgeom.h\nlib/pkgconfig/applewmproto.pc\nlib/pkgconfig/windowswmproto.pc\n\"\n\ntermux_step_pre_configure() {\n\t# Use meson instead of autotools.\n\trm -f \"$TERMUX_PKG_SRCDIR\"/configure\n}\n"
  },
  {
    "path": "packages/xorgproto/include-x11-Xos_r.h.patch",
    "content": "diff -uNr xorgproto-2019.1/include/X11/Xos_r.h xorgproto-2019.1.mod/include/X11/Xos_r.h\n--- xorgproto-2019.1/include/X11/Xos_r.h\t2019-06-20 06:13:03.000000000 +0300\n+++ xorgproto-2019.1.mod/include/X11/Xos_r.h\t2019-06-29 23:32:10.617173769 +0300\n@@ -248,7 +248,7 @@\n  */\n \n #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \\\n-    defined(__APPLE__) || defined(__DragonFly__)\n+    defined(__APPLE__) || defined(__DragonFly__) || defined(__ANDROID__)\n static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p)\n {\n    memcpy(&(p).pws, (p).pwp, sizeof(struct passwd));\n@@ -261,11 +261,7 @@\n    (p).len = strlen((p).pwp->pw_passwd);\n    strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd);\n \n-   (p).pws.pw_class = (p).pws.pw_passwd + (p).len + 1;\n-   (p).len = strlen((p).pwp->pw_class);\n-   strcpy((p).pws.pw_class, (p).pwp->pw_class);\n-\n-   (p).pws.pw_gecos = (p).pws.pw_class + (p).len + 1;\n+   (p).pws.pw_gecos = (p).pws.pw_passwd + (p).len + 1;\n    (p).len = strlen((p).pwp->pw_gecos);\n    strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos);\n \n"
  },
  {
    "path": "packages/xorgproto/include-x11-Xpoll.h.in.patch",
    "content": "diff -uNr xorgproto-2018.4/include/X11/Xpoll.h.in xorgproto-2018.4.mod/include/X11/Xpoll.h.in\n--- xorgproto-2018.4/include/X11/Xpoll.h.in\t2018-02-28 18:45:07.000000000 +0200\n+++ xorgproto-2018.4.mod/include/X11/Xpoll.h.in\t2018-09-28 13:19:06.115194995 +0300\n@@ -98,9 +98,10 @@\n \n #define __X_FDS_BITS @USE_FDS_BITS@\n \n-#ifndef __FDS_BITS\n-# define __FDS_BITS(p)  ((p)->__X_FDS_BITS)\n+#ifdef __FDS_BITS\n+# undef __FDS_BITS\n #endif\n+#define __FDS_BITS(p)  ((p)->__X_FDS_BITS)\n \n #define __XFDS_BITS(p, n) (__FDS_BITS(p))[n]\n \n"
  },
  {
    "path": "packages/xorgproto/meson.build.patch",
    "content": "diff -uNr xorgproto-2019.1/meson.build xorgproto-2019.1.mod/meson.build\n--- xorgproto-2019.1/meson.build\t2019-06-20 06:13:03.000000000 +0300\n+++ xorgproto-2019.1.mod/meson.build\t2019-06-29 22:00:10.215053101 +0300\n@@ -68,7 +68,7 @@\n         filebase : pc[0],\n         description : pc[0] + ' headers',\n         version : pc[1],\n-        install_dir : get_option('datadir') + '/pkgconfig',\n+        install_dir : '@TERMUX_PREFIX@/lib/pkgconfig',\n         subdirs : subdir,\n     )\n endforeach\n@@ -88,7 +88,7 @@\n             filebase : pc[0],\n             description : pc[0] + ' headers',\n             version : pc[1],\n-            install_dir : get_option('datadir') + '/pkgconfig'\n+            install_dir : '@TERMUX_PREFIX@/lib/pkgconfig'\n         )\n     endforeach\n endif\n"
  },
  {
    "path": "packages/xorriso/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/xorriso\nTERMUX_PKG_DESCRIPTION=\"Tool for creating ISO files.\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_VERSION=1.5.2\nTERMUX_PKG_SHA256=3b69f5c93ae7c40c5bbe4a847fa3963f5efc9c565551622f77121c5792fc17e7\nTERMUX_PKG_SRCURL=https://www.gnu.org/software/xorriso/xorriso-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_DEPENDS=\"libiconv, libandroid-support, readline, libbz2, zlib\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-jtethreads\"\n\ntermux_step_pre_configure() {\n\t./bootstrap\n}\n"
  },
  {
    "path": "packages/xorriso/pthread.patch",
    "content": "diff -ur src-o/configure src/configure\n--- src-o/configure\t2017-07-31 04:44:24.215397674 +0200\n+++ src/configure\t2017-07-31 04:45:19.667222873 +0200\n@@ -12719,7 +12719,7 @@\n fi\n \n \n-THREAD_LIBS=-lpthread\n+THREAD_LIBS=\n \n \n \ndiff -ur src-o/configure.ac src/configure.ac\n--- src-o/configure.ac\t2017-07-31 04:44:24.215397674 +0200\n+++ src/configure.ac\t2017-07-31 04:44:40.903346135 +0200\n@@ -113,7 +113,7 @@\n         ,\n         [#include <unistd.h>])\n \n-THREAD_LIBS=-lpthread\n+THREAD_LIBS=\n AC_SUBST(THREAD_LIBS)\n \n"
  },
  {
    "path": "packages/xtrans/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/\nTERMUX_PKG_DESCRIPTION=\"X transport library\"\nTERMUX_PKG_LICENSE=\"MIT\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=1.4.0\nTERMUX_PKG_REVISION=6\nTERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/xtrans-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=377c4491593c417946efcd2c7600d1e62639f7a8bbca391887e2c4679807d773\nTERMUX_PKG_NO_DEVELSPLIT=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_post_make_install() {\n\tmkdir -p ${TERMUX_PREFIX}/lib/pkgconfig\n\tmv ${TERMUX_PREFIX}/share/pkgconfig/xtrans.pc ${TERMUX_PREFIX}/lib/pkgconfig\n}\n"
  },
  {
    "path": "packages/xtrans/xtrans-1.3.5_Xtransutil.c.patch",
    "content": "diff -uNr xtrans-1.3.5/Xtransutil.c xtrans-1.3.5.mod/Xtransutil.c\n--- xtrans-1.3.5/Xtransutil.c\t2014-09-12 21:32:47.000000000 +0300\n+++ xtrans-1.3.5.mod/Xtransutil.c\t2018-06-15 19:15:52.525720899 +0300\n@@ -478,27 +478,6 @@\n \t}\n \t/* Dir doesn't exist. Try to create it */\n \n-#if !defined(WIN32) && !defined(__CYGWIN__)\n-\t/*\n-\t * 'sticky' bit requested: assume application makes\n-\t * certain security implications. If effective user ID\n-\t * is != 0: fail as we may not be able to meet them.\n-\t */\n-\tif (geteuid() != 0) {\n-\t    if (mode & 01000) {\n-\t\tprmsg(1, \"mkdir: ERROR: euid != 0,\"\n-\t\t      \"directory %s will not be created.\\n\",\n-\t\t      path);\n-#ifdef FAIL_HARD\n-\t\treturn -1;\n-#endif\n-\t    } else {\n-\t\tprmsg(1, \"mkdir: Cannot create %s with root ownership\\n\",\n-\t\t      path);\n-\t    }\n-\t}\n-#endif\n-\n #ifndef WIN32\n \tif (mkdir(path, mode) == 0) {\n \t    if (chmod(path, mode)) {\n@@ -521,14 +500,9 @@\n \n     } else {\n \tif (S_ISDIR(buf.st_mode)) {\n-\t    int updateOwner = 0;\n \t    int updateMode = 0;\n-\t    int updatedOwner = 0;\n \t    int updatedMode = 0;\n \t    int status = 0;\n-\t    /* Check if the directory's ownership is OK. */\n-\t    if (buf.st_uid != 0)\n-\t\tupdateOwner = 1;\n \n \t    /*\n \t     * Check if the directory's mode is OK.  An exact match isn't\n@@ -566,7 +540,7 @@\n \t     * directory's owner and mode.  Otherwise it isn't safe to attempt\n \t     * to do this.\n \t     */\n-\t    if (updateMode || updateOwner) {\n+\t    if (updateMode) {\n \t\tint fd = -1;\n \t\tstruct stat fbuf;\n \t\tif ((fd = open(path, O_RDONLY)) != -1) {\n@@ -588,8 +562,6 @@\n \t\t\tclose(fd);\n \t\t\treturn -1;\n \t\t    }\n-\t\t    if (updateOwner && fchown(fd, 0, 0) == 0)\n-\t\t\tupdatedOwner = 1;\n \t\t    if (updateMode && fchmod(fd, mode) == 0)\n \t\t\tupdatedMode = 1;\n \t\t    close(fd);\n@@ -597,20 +569,6 @@\n \t    }\n #endif\n \n-\t    if (updateOwner && !updatedOwner) {\n-#ifdef FAIL_HARD\n-\t\tif (status & FAIL_IF_NOT_ROOT) {\n-\t\t    prmsg(1, \"mkdir: ERROR: Owner of %s must be set to root\\n\",\n-\t\t\t  path);\n-\t\t    return -1;\n-\t\t}\n-#endif\n-#if !defined(__APPLE_CC__) && !defined(__CYGWIN__)\n-\t\tprmsg(1, \"mkdir: Owner of %s should be set to root\\n\",\n-\t\t      path);\n-#endif\n-\t    }\n-\n \t    if (updateMode && !updatedMode) {\n #ifdef FAIL_HARD\n \t\tif (status & FAIL_IF_NOMODE) {\n"
  },
  {
    "path": "packages/xtrans/xtrans-1.4.0_Xtranslcl.c.patch",
    "content": "diff -uNr xtrans-1.4.0/Xtranslcl.c xtrans-1.4.0.mod/Xtranslcl.c\n--- xtrans-1.4.0/Xtranslcl.c\t2019-03-16 23:30:31.000000000 +0200\n+++ xtrans-1.4.0.mod/Xtranslcl.c\t2019-05-19 00:54:20.390433328 +0300\n@@ -250,7 +250,7 @@\n #ifndef X11_t\n #define X_STREAMS_DIR\t\"/dev/X\"\n #else\n-#define X_STREAMS_DIR\t\"/tmp/.X11-pipe\"\n+#define X_STREAMS_DIR\t\"@TERMUX_PREFIX@/tmp/.X11-pipe\"\n #endif\n #endif\n \n@@ -260,7 +260,7 @@\n \n #define PTSNODENAME \"/dev/X/server.\"\n #ifdef __sun\n-#define NAMEDNODENAME \"/tmp/.X11-pipe/X\"\n+#define NAMEDNODENAME \"@TERMUX_PREFIX@/tmp/.X11-pipe/X\"\n #else\n #define NAMEDNODENAME \"/dev/X/Nserver.\"\n \n@@ -270,7 +270,7 @@\n #endif\n #if defined(XIM_t)\n #ifdef __sun\n-#define NAMEDNODENAME \"/tmp/.XIM-pipe/XIM\"\n+#define NAMEDNODENAME \"@TERMUX_PREFIX@/tmp/.XIM-pipe/XIM\"\n #else\n #define PTSNODENAME\t\"/dev/X/XIM.\"\n #define NAMEDNODENAME\t\"/dev/X/NXIM.\"\n@@ -280,7 +280,7 @@\n #endif\n #if defined(FS_t) || defined (FONT_t)\n #ifdef __sun\n-#define NAMEDNODENAME\t\"/tmp/.font-pipe/fs\"\n+#define NAMEDNODENAME\t\"@TERMUX_PREFIX@/tmp/.font-pipe/fs\"\n #else\n /*\n  * USL has already defined something here. We need to check with them\n@@ -294,7 +294,7 @@\n #endif\n #if defined(ICE_t)\n #ifdef __sun\n-#define NAMEDNODENAME\t\"/tmp/.ICE-pipe/\"\n+#define NAMEDNODENAME\t\"@TERMUX_PREFIX@/tmp/.ICE-pipe/\"\n #else\n #define PTSNODENAME\t\"/dev/X/ICE.\"\n #define NAMEDNODENAME\t\"/dev/X/NICE.\"\n@@ -304,7 +304,7 @@\n #endif\n #if defined(TEST_t)\n #ifdef __sun\n-#define NAMEDNODENAME\t\"/tmp/.Test-unix/test\"\n+#define NAMEDNODENAME\t\"@TERMUX_PREFIX@/tmp/.Test-unix/test\"\n #endif\n #define PTSNODENAME\t\"/dev/X/transtest.\"\n #define NAMEDNODENAME\t\"/dev/X/Ntranstest.\"\n"
  },
  {
    "path": "packages/xtrans/xtrans-1.4.0_Xtranssock.c.patch",
    "content": "diff -uNr xtrans-1.4.0/Xtranssock.c xtrans-1.4.0.mod/Xtranssock.c\n--- xtrans-1.4.0/Xtranssock.c\t2019-03-16 23:30:31.000000000 +0200\n+++ xtrans-1.4.0.mod/Xtranssock.c\t2019-05-19 00:52:00.404623112 +0300\n@@ -200,20 +200,20 @@\n \n \n #if defined(X11_t)\n-#define UNIX_PATH \"/tmp/.X11-unix/X\"\n-#define UNIX_DIR \"/tmp/.X11-unix\"\n+#define UNIX_PATH \"@TERMUX_PREFIX@/tmp/.X11-unix/X\"\n+#define UNIX_DIR \"@TERMUX_PREFIX@/tmp/.X11-unix\"\n #endif /* X11_t */\n #if defined(XIM_t)\n-#define UNIX_PATH \"/tmp/.XIM-unix/XIM\"\n-#define UNIX_DIR \"/tmp/.XIM-unix\"\n+#define UNIX_PATH \"@TERMUX_PREFIX@/tmp/.XIM-unix/XIM\"\n+#define UNIX_DIR \"@TERMUX_PREFIX@/tmp/.XIM-unix\"\n #endif /* XIM_t */\n #if defined(FS_t) || defined(FONT_t)\n-#define UNIX_PATH \"/tmp/.font-unix/fs\"\n-#define UNIX_DIR \"/tmp/.font-unix\"\n+#define UNIX_PATH \"@TERMUX_PREFIX@/tmp/.font-unix/fs\"\n+#define UNIX_DIR \"@TERMUX_PREFIX@/tmp/.font-unix\"\n #endif /* FS_t || FONT_t */\n #if defined(ICE_t)\n-#define UNIX_PATH \"/tmp/.ICE-unix/\"\n-#define UNIX_DIR \"/tmp/.ICE-unix\"\n+#define UNIX_PATH \"@TERMUX_PREFIX@/tmp/.ICE-unix/\"\n+#define UNIX_DIR \"@TERMUX_PREFIX@/tmp/.ICE-unix\"\n #endif /* ICE_t */\n \n \n"
  },
  {
    "path": "packages/xvidcore/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.xvid.org/\nTERMUX_PKG_DESCRIPTION=\"High performance and high quality MPEG-4 library\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.3.5\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0\nTERMUX_PKG_BREAKS=\"xvidcore-dev\"\nTERMUX_PKG_REPLACES=\"xvidcore-dev\"\nTERMUX_PKG_SRCURL=http://downloads.xvid.org/downloads/xvidcore-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_pre_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\trm -f $TERMUX_PREFIX/lib/libxvid*\n\texport TERMUX_PKG_BUILDDIR=$TERMUX_PKG_BUILDDIR/build/generic\n\texport TERMUX_PKG_SRCDIR=$TERMUX_PKG_BUILDDIR\n\n\tif [ $TERMUX_ARCH = i686 ]; then\n\t\t# Avoid text relocations:\n\t\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS+=\" --disable-assembly\"\n\tfi\n}\n\n"
  },
  {
    "path": "packages/yadm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/TheLocehiliosan/yadm\nTERMUX_PKG_DESCRIPTION=\"Yet Another Dotfiles Manager\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.1.0\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SRCURL=https://github.com/TheLocehiliosan/yadm/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=b3ce96a5ded1f32ee40eabfddbc6b89c2f4af1b9a0c9be3b1cfd64f7f101937f\nTERMUX_PKG_DEPENDS=\"git\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_make() {\n\t# Do not try to run 'make' as this causes\n\t# build failure.\n\treturn\n}\n\ntermux_step_make_install() {\n\tinstall -Dm700 \"$TERMUX_PKG_SRCDIR\"/yadm \"$TERMUX_PREFIX\"/bin/\n\tinstall -Dm600 \"$TERMUX_PKG_SRCDIR\"/yadm.1 \"$TERMUX_PREFIX\"/share/man/man1/\n}\n"
  },
  {
    "path": "packages/yajl/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://lloyd.github.io/yajl/\nTERMUX_PKG_DESCRIPTION=\"Yet Another JSON Library\"\nTERMUX_PKG_LICENSE=\"ISC\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=2.1.0\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://github.com/lloyd/yajl/archive/$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=3fb73364a5a30efe615046d07e6db9d09fd2b41c763c5f7d3bfb121cd5c5ac5a\nTERMUX_PKG_BREAKS=\"yajl-dev\"\nTERMUX_PKG_REPLACES=\"yajl-dev\"\nTERMUX_PKG_FORCE_CMAKE=true\n\ntermux_step_post_make_install() {\n\t# Fix location of 'yajl.pc'.\n\tmkdir -p \"${TERMUX_PREFIX}\"/lib/pkgconfig\n\tmv -f \\\n\t\t\"${TERMUX_PREFIX}\"/share/pkgconfig/yajl.pc \\\n\t\t\"${TERMUX_PREFIX}\"/lib/pkgconfig/yajl.pc\n}\n"
  },
  {
    "path": "packages/yarn/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://yarnpkg.com/\nTERMUX_PKG_DESCRIPTION=\"Fast, reliable, and secure dependency management\"\nTERMUX_PKG_LICENSE=\"BSD 2-Clause\"\nTERMUX_PKG_MAINTAINER=\"Pierre Rudloff @Rudloff\"\nTERMUX_PKG_VERSION=1.19.2\nTERMUX_PKG_SRCURL=https://yarnpkg.com/downloads/${TERMUX_PKG_VERSION}/yarn-v${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=2ed90e6aaf3988df5c75b6829b7c523754453a0b7134a9d0bf11161f927eae25\nTERMUX_PKG_DEPENDS=\"nodejs | nodejs-lts\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\ntermux_step_make_install() {\n\tcp -r . ${TERMUX_PREFIX}/share/yarn/\n\tln -f -s ../share/yarn/bin/yarn ${TERMUX_PREFIX}/bin/yarn\n}\n"
  },
  {
    "path": "packages/yasm/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://yasm.tortall.net/\nTERMUX_PKG_DESCRIPTION=\"Assembler supporting the x86 and AMD64 instruction sets\"\nTERMUX_PKG_LICENSE=\"LGPL-2.1\"\nTERMUX_PKG_VERSION=1.3.0\nTERMUX_PKG_REVISION=5\nTERMUX_PKG_SRCURL=https://www.tortall.net/projects/yasm/releases/yasm-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f\nTERMUX_PKG_DEPENDS=\"libiconv\"\nTERMUX_PKG_BREAKS=\"yasm-dev\"\nTERMUX_PKG_REPLACES=\"yasm-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--enable-nls\"\n"
  },
  {
    "path": "packages/zbar/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://zbar.sourceforge.net\nTERMUX_PKG_DESCRIPTION=\"Software suite for reading bar codes from various sources\"\nTERMUX_PKG_LICENSE=\"LGPL-2.0\"\nTERMUX_PKG_VERSION=0.10\nTERMUX_PKG_REVISION=10\nTERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/zbar/zbar/0.10/zbar-${TERMUX_PKG_VERSION}.tar.bz2\nTERMUX_PKG_SHA256=234efb39dbbe5cef4189cc76f37afbe3cfcfb45ae52493bfe8e191318bdbadc6\nTERMUX_PKG_DEPENDS=\"libiconv, imagemagick, libjpeg-turbo, zlib\"\nTERMUX_PKG_BREAKS=\"zbar-dev\"\nTERMUX_PKG_REPLACES=\"zbar-dev\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"--disable-pthread\n--disable-video --without-xshm --without-xv\n--without-x --without-gtk --without-qt\n--without-python --mandir=$TERMUX_PREFIX/share/man\"\n\ntermux_step_pre_configure() {\n\tautoconf\n}\n"
  },
  {
    "path": "packages/zbar/configure.ac.patch",
    "content": "diff -u -r ../zbar-0.10/configure.ac ./configure.ac\n--- ../zbar-0.10/configure.ac\t2009-10-23 14:16:44.000000000 -0400\n+++ ./configure.ac\t2016-05-03 09:00:57.495043230 -0400\n@@ -281,15 +281,7 @@\n ])])])\n    MAGICK_VERSION=`$PKG_CONFIG MagickWand --modversion`\n    AC_MSG_NOTICE([using ImageMagick version $MAGICK_VERSION])\n-\n-dnl double check ImageMagick install (bug #2582232)\n-   CPPFLAGS_save=\"$CPPFLAGS\"\n-   CPPFLAGS=\"$CPPFLAGS $MAGICK_CFLAGS\"\n-   AC_CHECK_HEADER([wand/MagickWand.h], [],\n-     [AC_MSG_FAILURE([ImageMagick package found but wand/MagickWand.h not installed?!\n-this is a problem with your ImageMagick install,\n-please resolve the inconsistency and try again...])])\n-   CPPFLAGS=\"$CPPFLAGS_save\"])\n+   ])\n \n AM_CONDITIONAL([HAVE_MAGICK], [test \"x$with_imagemagick\" = \"xyes\"])\n \n"
  },
  {
    "path": "packages/zbar/zbarimg.c.patch",
    "content": "diff -u -r ../zbar-0.10/zbarimg/zbarimg.c ./zbarimg/zbarimg.c\n--- ../zbar-0.10/zbarimg/zbarimg.c\t2009-10-23 14:16:44.000000000 -0400\n+++ ./zbarimg/zbarimg.c\t2016-05-03 08:54:42.053504890 -0400\n@@ -38,7 +38,7 @@\n #include <assert.h>\n \n #include <zbar.h>\n-#include <wand/MagickWand.h>\n+#include <ImageMagick-7/MagickWand/MagickWand.h>\n \n /* in 6.4.5.4 MagickGetImagePixels changed to MagickExportImagePixels.\n  * (still not sure this check is quite right...\n"
  },
  {
    "path": "packages/zile/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/zile/\nTERMUX_PKG_DESCRIPTION=\"Lightweight clone of the Emacs text editor\"\nTERMUX_PKG_LICENSE=\"GPL-3.0\"\nTERMUX_PKG_MAINTAINER=\"Iain Nicol @iainnicol\"\nTERMUX_PKG_VERSION=2.4.14\nTERMUX_PKG_REVISION=3\nTERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/zile/zile-${TERMUX_PKG_VERSION}.tar.gz\nTERMUX_PKG_SHA256=7a78742795ca32480f2bab697fd5e328618d9997d6f417cf1b14e9da9af26b74\nTERMUX_PKG_DEPENDS=\"libgc, ncurses\"\nTERMUX_PKG_BUILD_IN_SRC=true\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_header_spawn_h=no\n\"\n\ntermux_step_post_configure() {\n\t# zile uses help2man to build the zile.1 man page, which would require\n\t# a host build. To avoid that just copy a pre-built man page.\n\tcp $TERMUX_PKG_BUILDER_DIR/zile.1 $TERMUX_PKG_BUILDDIR/doc/zile.1\n\ttouch -d \"next hour\" $TERMUX_PKG_BUILDDIR/doc/zile.1*\n}\n\ntermux_step_create_debscripts() {\n\tcat <<- EOF > ./postinst\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" = \"configure\" ] || [ \"\\$1\" = \"abort-upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --install \\\n\t\t\t\t$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/zile 35\n\t\tfi\n\tfi\n\tEOF\n\n\tcat <<- EOF > ./prerm\n\t#!$TERMUX_PREFIX/bin/sh\n\tif [ \"\\$1\" != \"upgrade\" ]; then\n\t\tif [ -x \"$TERMUX_PREFIX/bin/update-alternatives\" ]; then\n\t\t\tupdate-alternatives --remove editor $TERMUX_PREFIX/bin/zile\n\t\tfi\n\tfi\n\tEOF\n}\n"
  },
  {
    "path": "packages/zile/configure-pthreads-no-weak.patch",
    "content": "diff -uNr zile-2.4.14/configure zile-2.4.14.mod/configure\n--- zile-2.4.14/configure\t2017-10-06 17:28:11.000000000 +0300\n+++ zile-2.4.14.mod/configure\t2019-08-16 18:37:49.584471922 +0300\n@@ -13977,7 +13977,7 @@\n           if test -n \"$LIBMULTITHREAD\" || test -n \"$LTLIBMULTITHREAD\"; then\n             if case \"$gl_cv_have_weak\" in *yes) true;; *) false;; esac; then\n \n-$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n+#$as_echo \"#define USE_POSIX_THREADS_WEAK 1\" >>confdefs.h\n \n               LIBTHREAD=\n               LTLIBTHREAD=\n"
  },
  {
    "path": "packages/zile/lib-vasnprintf.c.patch",
    "content": "diff -uNr zile-2.4.14/lib/vasnprintf.c zile-2.4.14.mod/lib/vasnprintf.c\n--- zile-2.4.14/lib/vasnprintf.c\t2017-10-06 00:00:15.000000000 +0300\n+++ zile-2.4.14.mod/lib/vasnprintf.c\t2019-11-19 21:04:35.375719251 +0200\n@@ -4872,7 +4872,7 @@\n # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))        \\\n          && !defined __UCLIBC__)                                            \\\n         || (defined __APPLE__ && defined __MACH__)                          \\\n-        || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))\n+        || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined(__ANDROID__))\n                 fbp[1] = '%';\n                 fbp[2] = 'n';\n                 fbp[3] = '\\0';\n"
  },
  {
    "path": "packages/zile/spawn.patch",
    "content": "Fixes compilation on 64-bit Android which has removed getdtablesize.\ndiff -u -r ../m4-1.4.17/lib/spawn_faction_addclose.c ./lib/spawn_faction_addclose.c\n--- ../m4-1.4.17/lib/spawn_faction_addclose.c\t2013-09-22 02:15:20.000000000 -0400\n+++ ./lib/spawn_faction_addclose.c\t2016-01-03 20:37:44.870178045 -0500\n@@ -37,7 +37,7 @@\n                                    int fd)\n #undef posix_spawn_file_actions_addclose\n {\n-  int maxfd = __sysconf (_SC_OPEN_MAX);\n+  int maxfd = sysconf (_SC_OPEN_MAX);\n \n   /* Test for the validity of the file descriptor.  */\n   if (fd < 0 || fd >= maxfd)\ndiff -u -r ../m4-1.4.17/lib/spawn_faction_adddup2.c ./lib/spawn_faction_adddup2.c\n--- ../m4-1.4.17/lib/spawn_faction_adddup2.c\t2013-09-22 02:15:20.000000000 -0400\n+++ ./lib/spawn_faction_adddup2.c\t2016-01-03 20:38:11.981753903 -0500\n@@ -37,7 +37,7 @@\n                                   int fd, int newfd)\n #undef posix_spawn_file_actions_adddup2\n {\n-  int maxfd = __sysconf (_SC_OPEN_MAX);\n+  int maxfd = sysconf (_SC_OPEN_MAX);\n \n   /* Test for the validity of the file descriptor.  */\n   if (fd < 0 || newfd < 0 || fd >= maxfd || newfd >= maxfd)\ndiff -u -r ../m4-1.4.17/lib/spawn_faction_addopen.c ./lib/spawn_faction_addopen.c\n--- ../m4-1.4.17/lib/spawn_faction_addopen.c\t2013-09-22 02:15:20.000000000 -0400\n+++ ./lib/spawn_faction_addopen.c\t2016-01-03 20:38:21.341607440 -0500\n@@ -38,7 +38,7 @@\n                                   mode_t mode)\n #undef posix_spawn_file_actions_addopen\n {\n-  int maxfd = __sysconf (_SC_OPEN_MAX);\n+  int maxfd = sysconf (_SC_OPEN_MAX);\n \n   /* Test for the validity of the file descriptor.  */\n   if (fd < 0 || fd >= maxfd)\n"
  },
  {
    "path": "packages/zile/zile.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.45.1.\n.TH ZILE \"1\" \"April 2014\" \"Zile 2.4.11\" \"User Commands\"\n.SH NAME\nZile \\- Zile Is Lossy Emacs\n.SH SYNOPSIS\n.B zile\n[\\fI\\,OPTION-OR-FILENAME\\/\\fR]...\n.SH DESCRIPTION\nZile is a lightweight Emacs clone that provides a subset of Emacs's\nfunctionality suitable for basic editing.\n.PP\nRun Zile, the lightweight Emacs clone.\n.PP\nInitialization options:\n.TP\n\\fB\\-\\-no\\-init\\-file\\fR, \\fB\\-q\\fR\ndo not load ~/.zile\n.TP\n\\fB\\-\\-funcall\\fR, \\fB\\-f\\fR FUNC\ncall Zile Lisp function FUNC with no arguments\n.TP\n\\fB\\-\\-load\\fR, \\fB\\-l\\fR FILE\nload Zile Lisp FILE using the load function\n.TP\n\\fB\\-\\-help\\fR\ndisplay this help message and exit\n.TP\n\\fB\\-\\-version\\fR\ndisplay version information and exit\n.PP\nAction options:\n.TP\nFILE\nvisit FILE using find\\-file\n.TP\n+LINE FILE\nvisit FILE using find\\-file, then go to line LINE\n.PP\nExit status is 0 if OK, 1 if it cannot start up, for example because\nof an invalid command-line argument, and 2 if it crashes or runs out\nof memory.\n.SH FILES\n~/.zile \\(em user's Zile init file\n.PP\n$PREFIX/share/zile/dotzile.sample \\(em which contains some useful\ncode for the init file.\n.SH AUTHOR\nZile was written by Sandro Sigala, David A. Capello and Reuben Thomas.\nThe Lisp interpreter is based on code by Scott Lawrence.\n.SH \"REPORTING BUGS\"\nReport bugs to bug\\-zile@gnu.org.\n.SH COPYRIGHT\nCopyright \\(co 2014 Free Software Foundation, Inc.\nGNU Zile comes with ABSOLUTELY NO WARRANTY.\nYou may redistribute copies of Zile\nunder the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING.\n.SH \"SEE ALSO\"\n.BR emacs (1)\n"
  },
  {
    "path": "packages/zip/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://www.info-zip.org/\nTERMUX_PKG_DESCRIPTION=\"Tools for working with zip files\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=3.0\nTERMUX_PKG_REVISION=2\nTERMUX_PKG_SRCURL=https://downloads.sourceforge.net/infozip/zip30.tar.gz\nTERMUX_PKG_SHA256=f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369\nTERMUX_PKG_DEPENDS=\"libandroid-support, libbz2\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_configure() {\n\tcp unix/Makefile Makefile\n}\n\ntermux_step_make() {\n\tLD=\"$CC $LDFLAGS\" CC=\"$CC $CFLAGS $CPPFLAGS $LDFLAGS\" make -j $TERMUX_MAKE_PROCESSES generic\n}\n"
  },
  {
    "path": "packages/zip/makefile.patch",
    "content": "diff -u -r ../zip30/unix/Makefile ./unix/Makefile\n--- ../zip30/unix/Makefile\t2008-05-07 08:33:56.000000000 +0200\n+++ ./unix/Makefile\t2014-05-28 01:20:58.000000000 +0200\n@@ -22,10 +22,7 @@\n LN = ln -s\n \n # (to use the GNU compiler, change cc to gcc in CC)\n-CC = cc\n BIND = $(CC)\n-AS = $(CC) -c\n-CPP = /lib/cpp\n E =\n \n # probably can change this to 'install' if you have it\n@@ -38,10 +35,9 @@\n MANFLAGS = 644\n \n # target directories - where to install executables and man pages to\n-prefix = /usr/local\n BINDIR = $(prefix)/bin\n MANEXT=1\n-MANDIR = $(prefix)/man/man$(MANEXT)\n+MANDIR = $(prefix)/share/man/man$(MANEXT)\n ZIPMANUAL = zip.txt\n ZIPMANUALcloak = zipcloak.txt\n ZIPMANUALnote = zipnote.txt\n@@ -58,7 +54,6 @@\n #   LFLAGS1   flags after output file spec, before obj file list\n #   LFLAGS2   flags after obj file list (libraries, etc)\n CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)\n-CFLAGS = -O2 $(CFLAGS_NOOPT)\n LFLAGS1 =\n LFLAGS2 = -s\n \n"
  },
  {
    "path": "packages/zip/unix-configure.patch",
    "content": "diff -u -r ../zip30/unix/configure ./unix/configure\n--- ../zip30/unix/configure\t2008-06-20 05:32:20.000000000 +0200\n+++ ./unix/configure\t2017-07-07 08:53:36.218772657 +0200\n@@ -509,83 +509,6 @@\n # Check for missing functions\n # add NO_'function_name' to flags if missing\n \n-for func in rmdir strchr strrchr rename mktemp mktime mkstemp\n-do\n-  echo Check for $func\n-  echo \"int main(){ $func(); return 0; }\" > conftest.c\n-  $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null\n-  [ $? -ne 0 ] && CFLAGS=\"${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`\"\n-done\n-\n-\n-echo Check for memset\n-echo \"int main(){ char k; memset(&k,0,0); return 0; }\" > conftest.c\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-[ $? -ne 0 ] && CFLAGS=\"${CFLAGS} -DZMEM\"\n-\n-\n-echo Check for memmove\n-cat > conftest.c << _EOF_\n-#include <string.h>\n-int main() { int a; int b = 0; memmove( &a, &b, sizeof( a)); return a; }\n-_EOF_\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-[ $? -ne 0 ] && CFLAGS=\"${CFLAGS} -DNEED_MEMMOVE\"\n-\n-\n-echo Check for strerror\n-cat > conftest.c << _EOF_\n-#include <string.h>\n-int main() { strerror( 0); return 0; }\n-_EOF_\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-[ $? -ne 0 ] && CFLAGS=\"${CFLAGS} -DNEED_STRERROR\"\n-\n-echo Check for errno declaration\n-cat > conftest.c << _EOF_\n-#include <errno.h>\n-main()\n-{\n-  errno = 0;\n-  return 0;\n-}\n-_EOF_\n-$CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null\n-[ $? -ne 0 ] && CFLAGS=\"${CFLAGS} -DNO_ERRNO\"\n-\n-\n-echo Check for directory libraries\n-cat > conftest.c << _EOF_\n-int main() { return closedir(opendir(\".\")); }\n-_EOF_\n-\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-if [ $? -ne 0 ]; then\n-  OPT=\"\"\n-  for lib in ndir dir ucb bsd BSD PW x dirent\n-  do\n-    $CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null\n-    [ $? -eq 0 ] && OPT=-l$lib && break\n-  done\n-  if [ ${OPT} ]; then\n-    LFLAGS2=\"${LFLAGS2} ${OPT}\"\n-  else\n-    CFLAGS=\"${CFLAGS} -DNO_DIR\"\n-  fi\n-fi\n-\n-\n-# Dynix/ptx 1.3 needed this\n-\n-echo Check for readlink\n-echo \"int main(){ return readlink(); }\" > conftest.c\n-$CC -o conftest conftest.c >/dev/null 2>/dev/null\n-if [ $? -ne 0 ]; then\n-  $CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null\n-  [ $? -eq 0 ] && LFLAGS2=\"${LFLAGS2} -lseq\"\n-fi\n-\n-\n echo Check for directory include file\n OPT=\"\"\n for inc in dirent.h sys/ndir.h ndir.h sys/dir.h\n"
  },
  {
    "path": "packages/zlib/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.zlib.net/\nTERMUX_PKG_DESCRIPTION=\"Compression library implementing the deflate compression method found in gzip and PKZIP\"\nTERMUX_PKG_LICENSE=\"ZLIB\"\nTERMUX_PKG_VERSION=1.2.11\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=https://www.zlib.net/zlib-$TERMUX_PKG_VERSION.tar.xz\nTERMUX_PKG_SHA256=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066\nTERMUX_PKG_BREAKS=\"ndk-sysroot (<< 19b-3), zlib-dev\"\nTERMUX_PKG_REPLACES=\"ndk-sysroot (<< 19b-3), zlib-dev\"\n\ntermux_step_configure() {\n     \"$TERMUX_PKG_SRCDIR/configure\" --prefix=$TERMUX_PREFIX\n}\n"
  },
  {
    "path": "packages/zsh/Src-exec.c.patch",
    "content": "diff -u -r ../zsh-5.6/Src/exec.c ./Src/exec.c\n--- ../zsh-5.6/Src/exec.c\t2018-09-03 14:58:01.000000000 +0000\n+++ ./Src/exec.c\t2018-09-04 21:31:29.499488209 +0000\n@@ -553,7 +553,7 @@\n \t\t    if (t0 == ct) {\n \t\t\targv[-1] = \"sh\";\n \t\t\twinch_unblock();\n-\t\t\texecve(\"/bin/sh\", argv - 1, newenvp);\n+\t\t\texecve(\"@TERMUX_PREFIX@/bin/sh\", argv - 1, newenvp);\n \t\t    }\n \t\t}\n \t    } else\n@@ -2739,9 +2739,12 @@\n     sigtrapped[SIGEXIT] = 0;\n #ifdef HAVE_NICE\n     /* Check if we should run background jobs at a lower priority. */\n-    if ((how & Z_ASYNC) && isset(BGNICE))\n-\tif (nice(5) < 0)\n+    if ((how & Z_ASYNC) && isset(BGNICE)) {\n+\terrno = 0;\n+\tnice(5);\n+\tif (errno != 0)\n \t    zwarn(\"nice(5) failed: %e\", errno);\n+    }\n #endif /* HAVE_NICE */\n \n     return 0;\n"
  },
  {
    "path": "packages/zsh/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://www.zsh.org\nTERMUX_PKG_DESCRIPTION=\"Shell with lots of features\"\nTERMUX_PKG_LICENSE=\"BSD\"\nTERMUX_PKG_VERSION=5.7.1\nTERMUX_PKG_REVISION=1\nTERMUX_PKG_SHA256=7260292c2c1d483b2d50febfa5055176bd512b32a8833b116177bf5f01e77ee8\nTERMUX_PKG_SRCURL=https://fossies.org/linux/misc/zsh-${TERMUX_PKG_VERSION}.tar.xz\n# Remove hard link to bin/zsh as Android does not support hard links:\nTERMUX_PKG_RM_AFTER_INSTALL=\"bin/zsh-${TERMUX_PKG_VERSION}\"\nTERMUX_PKG_DEPENDS=\"libandroid-support, ncurses, termux-tools, command-not-found, pcre\"\nTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\nac_cv_header_utmp_h=no\nac_cv_func_getpwuid=yes\n--disable-gdbm\n--enable-pcre\n--enable-etcdir=$TERMUX_PREFIX/etc\n\"\nTERMUX_PKG_CONFFILES=\"etc/zshrc\"\nTERMUX_PKG_BUILD_IN_SRC=true\n\ntermux_step_post_configure() {\n\t# Certain packages are not safe to build on device because their\n\t# build.sh script deletes specific files in $TERMUX_PREFIX.\n\tif $TERMUX_ON_DEVICE_BUILD; then\n\t\ttermux_error_exit \"Package '$TERMUX_PKG_NAME' is not safe for on-device builds.\"\n\tfi\n\n\t# INSTALL file: \"For a non-dynamic zsh, the default is to compile the complete, compctl, zle,\n\t# computil, complist, sched, # parameter, zleparameter and rlimits modules into the shell,\n\t# and you will need to edit config.modules to make any other modules available.\"\n\t# Since we build zsh non-dynamically (since dynamic loading doesn't work on Android when enabled),\n\t# we need to explicitly enable the additional modules we want.\n\t# - The files module is needed by `compinstall` (https://github.com/termux/termux-packages/issues/61).\n\t# - The regex module seems to be used by several extensions.\n\t# - The curses, socket and zprof modules was desired by BrainDamage on IRC (#termux).\n\t# - The deltochar and mathfunc modules is used by grml-zshrc (https://github.com/termux/termux-packages/issues/494).\n\t# - The system module is needed by zplug (https://github.com/termux/termux-packages/issues/659).\n\t# - The zpty module is needed by zsh-async (https://github.com/termux/termux-packages/issues/672).\n\t# - The stat module is needed by zui (https://github.com/termux/termux-packages/issues/2829).\n\t# - The mapfile module was requested in https://github.com/termux/termux-packages/issues/3116.\n\tfor module in files regex curses zprof socket system deltochar mathfunc zpty pcre stat mapfile; do\n\t\tperl -p -i -e \"s|${module}.mdd link=no|${module}.mdd link=static|\" $TERMUX_PKG_BUILDDIR/config.modules\n\tdone\n}\n\ntermux_step_post_make_install() {\n\t# /etc/zshrc - Run for interactive shells (http://zsh.sourceforge.net/Guide/zshguide02.html):\n\tsed \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|\" $TERMUX_PKG_BUILDER_DIR/etc-zshrc > $TERMUX_PREFIX/etc/zshrc\n\n\t# Remove zsh.new/zsh.old/zsh-$version if any exists:\n\trm -f $TERMUX_PREFIX/{zsh-*,zsh.*}\n}\n"
  },
  {
    "path": "packages/zsh/compaudit.patch",
    "content": "Do not try to grep through /etc/group.\n\ndiff -u -r ../zsh-5.0.7/Completion/compaudit ./Completion/compaudit\n--- ../zsh-5.0.7/Completion/compaudit\t2013-12-19 14:35:10.000000000 -0500\n+++ ./Completion/compaudit\t2015-05-16 07:49:13.324364960 -0400\n@@ -128,19 +128,20 @@\n # by NFS group sharing with an untrustworthy machine).  So we must assume\n # that this has not happened, and pick the best group.\n \n-if (( $#_i_wdirs )); then\n-  local GROUP GROUPMEM _i_pw _i_gid\n-  if ((UID == EUID )); then\n-    getent group $LOGNAME | IFS=: read GROUP _i_pw _i_gid GROUPMEM\n-  else\n-    getent group $EGID | IFS=: read GROUP _i_pw _i_gid GROUPMEM\n-  fi\n-\n-  if [[ $GROUP == $LOGNAME && ( -z $GROUPMEM || $GROUPMEM == $LOGNAME ) ]]\n-  then\n-    _i_wdirs=( ${^_i_wdirs}(N-f:g+w:^g:${GROUP}:,-f:o+w:,-^${_i_owners}) )\n-  fi\n-fi\n+# NOTE: Disabled by termux, compaudit.patch:\n+#if (( $#_i_wdirs )); then\n+#  local GROUP GROUPMEM _i_pw _i_gid\n+#  if ((UID == EUID )); then\n+#    getent group $LOGNAME | IFS=: read GROUP _i_pw _i_gid GROUPMEM\n+#  else\n+#    getent group $EGID | IFS=: read GROUP _i_pw _i_gid GROUPMEM\n+#  fi\n+#\n+#  if [[ $GROUP == $LOGNAME && ( -z $GROUPMEM || $GROUPMEM == $LOGNAME ) ]]\n+#  then\n+#    _i_wdirs=( ${^_i_wdirs}(N-f:g+w:^g:${GROUP}:,-f:o+w:,-^${_i_owners}) )\n+#  fi\n+#fi\n \n if [[ -f /etc/debian_version ]]\n then\n"
  },
  {
    "path": "packages/zsh/configure.patch",
    "content": "diff -u -r ../zsh-5.4.2/configure ./configure\n--- ../zsh-5.4.2/configure\t2017-06-30 22:36:56.000000000 +0200\n+++ ./configure\t2017-11-01 16:00:08.601290902 +0100\n@@ -2888,21 +2888,8 @@\n fi\n \n \n-if test X$sitefndir = X/usr/local/share/zsh/site-functions || \\\n-   test X$sitefndir = Xno\n-then fixed_sitefndir=''\n-elif test X$prefix != X/usr/local; then\n-  if test X$prefix = XNONE && test X$ac_default_prefix = X/usr/local; then\n-    if test X$tzsh_name != Xzsh\n-    then fixed_sitefndir=/usr/local/share/zsh/site-functions\n-    else fixed_sitefndir=''\n-    fi\n-  else fixed_sitefndir=/usr/local/share/zsh/site-functions\n-  fi\n-elif test X$tzsh_name != Xzsh\n-then fixed_sitefndir=/usr/local/share/zsh/site-functions\n-else fixed_sitefndir=''\n-fi\n+# Do not use /usr/local/share/zsh/site-functions (#1730):\n+fixed_sitefndir=''\n \n \n # Check whether --enable-function-subdirs was given.\n"
  },
  {
    "path": "packages/zsh/etc-zshrc",
    "content": ". @TERMUX_PREFIX@/etc/profile\ncommand_not_found_handler() {\n\t@TERMUX_PREFIX@/libexec/termux/command-not-found $1\n}\n#set nomatch so *.sh would not error if no file is available\nsetopt +o nomatch\n. @TERMUX_PREFIX@/etc/profile\nPS1='%# '\n"
  },
  {
    "path": "packages/zsh/src-init.c.patch",
    "content": "This call just slow things done noticably (and permission is denied).\n\ndiff -u -r ../zsh-5.0.8/Src/init.c ./Src/init.c\n--- ../zsh-5.0.8/Src/init.c\t2015-04-26 16:31:15.000000000 -0400\n+++ ./Src/init.c\t2015-07-11 17:51:00.761656735 -0400\n@@ -631,7 +631,7 @@\n init_shout(void)\n {\n     static char shoutbuf[BUFSIZ];\n-#if defined(JOB_CONTROL) && defined(TIOCSETD) && defined(NTTYDISC)\n+#if defined(JOB_CONTROL) && defined(TIOCSETD) && defined(NTTYDISC) && !defined(__ANDROID__)\n     int ldisc;\n #endif\n \n@@ -642,7 +642,7 @@\n \treturn;\n     }\n \n-#if defined(JOB_CONTROL) && defined(TIOCSETD) && defined(NTTYDISC)\n+#if defined(JOB_CONTROL) && defined(TIOCSETD) && defined(NTTYDISC) && !defined(__ANDROID__)\n     ldisc = NTTYDISC;\n     ioctl(SHTTY, TIOCSETD, (char *)&ldisc);\n #endif\n"
  },
  {
    "path": "packages/zsh/src-module.c.patch",
    "content": "diff -u -r ../zsh-5.1.1/Src/module.c ./Src/module.c\n--- ../zsh-5.1.1/Src/module.c\t2015-02-19 14:47:41.000000000 -0500\n+++ ./Src/module.c\t2015-11-24 18:38:12.383460402 -0500\n@@ -1496,8 +1496,10 @@\n #else\n # ifdef HAVE_DL_H\n #  include <dl.h>\n-#  define RTLD_LAZY BIND_DEFERRED\n-#  define RTLD_GLOBAL DYNAMIC_PATH\n+#  ifndef __ANDROID__\n+#   define RTLD_LAZY BIND_DEFERRED\n+#   define RTLD_GLOBAL DYNAMIC_PATH\n+#  endif\n # else\n #  include <sys/types.h>\n #  include <nlist.h>\n"
  },
  {
    "path": "packages/zsh/tmp_path.patch",
    "content": "diff -u -r ../zsh-5.0.5/config.h.in ./config.h.in\n--- ../zsh-5.0.5/config.h.in\t2013-11-30 00:28:56.000000000 +0100\n+++ ./config.h.in\t2014-02-03 02:21:35.000000000 +0100\n@@ -25,7 +25,7 @@\n #define DEFAULT_FCEDIT \"vi\"\n \n /* The default prefix for temporary files */\n-#define DEFAULT_TMPPREFIX \"/tmp/zsh\"\n+#define DEFAULT_TMPPREFIX \"@TERMUX_PREFIX@/tmp/zsh\"\n \n /***** end of user configuration section            *****/\n /***** shouldn't have to change anything below here *****/\n"
  },
  {
    "path": "packages/zstd/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=https://github.com/facebook/zstd\nTERMUX_PKG_DESCRIPTION=\"Zstandard compression.\"\nTERMUX_PKG_LICENSE=\"GPL-2.0\"\nTERMUX_PKG_VERSION=1.4.4\nTERMUX_PKG_SRCURL=https://github.com/facebook/zstd/archive/v$TERMUX_PKG_VERSION.tar.gz\nTERMUX_PKG_SHA256=a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8\nTERMUX_PKG_DEPENDS=\"liblzma, zlib\"\nTERMUX_PKG_BREAKS=\"zstd-dev\"\nTERMUX_PKG_REPLACES=\"zstd-dev\"\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "packages/zstd/no-timespec_get.patch",
    "content": "diff -u -r ../zstd-1.4.0/programs/timefn.c ./programs/timefn.c\n--- ../zstd-1.4.0/programs/timefn.c\t2019-04-16 22:37:24.000000000 +0000\n+++ ./programs/timefn.c\t2019-04-17 20:47:49.592167589 +0000\n@@ -84,7 +84,8 @@\n \n \n #elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */) \\\n-    && defined(TIME_UTC) /* C11 requires timespec_get, but FreeBSD 11 lacks it, while still claiming C11 compliance */\n+    && defined(TIME_UTC) /* C11 requires timespec_get, but FreeBSD 11 lacks it, while still claiming C11 compliance */ \\\n+    && !defined(__ANDROID__)\n \n #include <stdlib.h>   /* abort */\n #include <stdio.h>    /* perror */\ndiff -u -r ../zstd-1.4.0/programs/timefn.h ./programs/timefn.h\n--- ../zstd-1.4.0/programs/timefn.h\t2019-04-16 22:37:24.000000000 +0000\n+++ ./programs/timefn.h\t2019-04-17 20:47:28.716414556 +0000\n@@ -58,7 +58,8 @@\n     #define UTIL_TIME_INITIALIZER 0\n \n #elif (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */) \\\n-    && defined(TIME_UTC) /* C11 requires timespec_get, but FreeBSD 11 lacks it, while still claiming C11 compliance */\n+    && defined(TIME_UTC) /* C11 requires timespec_get, but FreeBSD 11 lacks it, while still claiming C11 compliance */ \\\n+    && !defined(__ANDROID__)\n \n     typedef struct timespec UTIL_time_t;\n     #define UTIL_TIME_INITIALIZER { 0, 0 }\n"
  },
  {
    "path": "packages/zsync/build.sh",
    "content": "TERMUX_PKG_HOMEPAGE=http://zsync.moria.org.uk/\nTERMUX_PKG_DESCRIPTION=\"A file transfer program to download files from remote web servers\"\nTERMUX_PKG_LICENSE=\"Artistic-License-2.0\"\nTERMUX_PKG_MAINTAINER=\"Leonid Plyushch <leonid.plyushch@gmail.com>\"\nTERMUX_PKG_VERSION=0.6.2\nTERMUX_PKG_REVISION=4\nTERMUX_PKG_SRCURL=http://zsync.moria.org.uk/download/zsync-$TERMUX_PKG_VERSION.tar.bz2\nTERMUX_PKG_SHA256=0b9d53433387aa4f04634a6c63a5efa8203070f2298af72a705f9be3dda65af2\nTERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "print.txt",
    "content": "    1  ls\n    2  printenv\n    3  cd packages\n    4  ls\n    5  cd\n    6  export TERMUX_ANDROID_HOME=/data/data/studio.com.techriz.andronix/files/home\n    7  export TERMUX_PREFIX=/data/data/studio.com.techriz.andronix/files/usr\n    8  export TERMUX_PKG_MAINTAINER=Prakhar Shukla @imprakharshukla\n    9  printenv\n   10  export TERMUX_PKG_MAINTAINER=\"Prakhar Shukla @imprakharshukla\"\n   11  printenv\n   12  ls packages\n   13  ls /packages\n   14  ls\n   15  cd termux-packages\n   16  ls packages\n   17  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   18  ls \n   19  rm debs\n   20  rm -rf debs\n   21  ls\n   22  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   23  cd /data/data/.built-packages\n   24  ls\n   25  rm *\n   26  ls\n   27  cd ..\n   28  cd\n   29  cd termux-packafes\n   30  cd termux-packages\n   31  ls\n   32  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   33  ./clean.sh\n   34  cd debs\n   35  ls\n   36  cd ..\n   37  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\\\n   38  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   39  exit\n   40  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   41  exit\n   42  printenv\n   43  export TERMUX_PKG_MAINTAINER=\"Prakhar Shukla @imprakharshukla\"\n   44  export TERMUX_ANDROID_HOME=/data/data/studio.com.techriz.andronix/files/home\n   45  export TERMUX_PREFIX=/data/data/studio.com.techriz.andronix/files/usr\n   46  printenv\n   47  ls\n   48  cd debs\n   49  ls\n   50  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   51  cd ..\n   52  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   53  ls packages\n   54  ls debs\n   55  ./build-package.sh proot wget openssh curl pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   56  cd pacakges\n   57  cd packages\n   58  ls\n   59  cd curl\n   60  cd ..\n   61  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   62  ls packages\n   63  ./build-package.sh gerp\n   64  ./build-package.sh grep\n   65  rm /data/data/.built-packages/grep\n   66  ./build-package.sh grep\n   67  sl debs\n   68  ls deb\n   69  ls\n   70  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed gerp -D\n   71  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep -D\n   72  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep\n   73  cd debs\n   74  ls\n   75  cd ..\n   76  lks\n   77  ls\n   78  ./clean.sh\n   79  printevn\n   80  printenv\n   81  ls\n   82  cd debs\n   83  ls\n   84  rm *\n   85  ls\n   86  cd\n   87  cd termux-packages\n   88  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep\n   89  rm /data/data/.built-packages/sed\n   90  rm /data/data/.built-packages/grep\n   91  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep\n   92  cd debs\n   93  ls\n   94  ls -l . | egrep -c '^-'\n   95  exit\n   96  cd debs\n   97  rm *\n   98  las\n   99  ls\n  100  cd ..\n  101  ls\n  102  bash clean.sh\n  103  nano init.sh\n  104  bash init.sh\n  105  nano init.sh\n  106  bash init.sh\n  107  printenv\n  108  export TERMUX_PREFIX=/data/data/studio.com.techriz.andronix/files/usr\n  109  export TERMUX_ANDROID_HOME=/data/data/studio.com.techriz.andronix/files/home\n  110  export TERMUX_PKG_MAINTAINER=\"Prakhar Shukla @imprakharshukla\"\n  111  printenv\n  112  ./build-package.sh bash\n  113  printenv\n  114  cd debs\n  115  ls\n  116  export BINTRAY_USERNAME=\"imprakharshukla\"\n  117  export BINTRAY_API_KEY=\"51f6c0180ce593af1354ed1bc6f47af449a94f8f\"\n  118  export BINTRAY_GPG_PASSPHRASE=\"Ultrakiller258\"\n  119  cd scripts\n  120  cd ..\n  121  cd scripts\n  122  ls\n  123  ./scripts/package_uploader.sh bash\n  124  ./package_uploader.sh bash\n  125  export BINTRAY_USERNAME=\"Andronix\"\n  126  ./package_uploader.sh bash\n  127  export BINTRAY_USERNAME=\"imprakharshukla\"\n  128  ./package_uploader.sh bash\n  129  cd ..\n  130  ./clean.sh\n  131  printenv\n  132  cd debs\n  133  rm *\n  134  ls\n  135  cd ..\n  136  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep\n  137  rm /data/data/.built-packages/sed\n  138  rm /data/data/.built-packages/grep\n  139  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep\n  140  ./package_uploader.sh\n  141  ./scripts/package_uploader.sh\n  142  ls\n  143  cd scripts\n  144  ls\n  145  nano /data/data/.built-packages\n  146  cd /data/data/.built-packages\n  147  ls\n  148  ./package_uploader.sh /data/data/.built-packages\n  149  ./scripts/package_uploader.sh /data/data/.built-packages\n  150  bash /scripts/package_uploader.sh /data/data/.built-packages\n  151  cd ..\n  152  cd\n  153  cd termux-packages\n  154  ls\n  155  cd scripts\n  156  bash /scripts/package_uploader.sh /data/data/.built-packages\n  157  ./package_uploader.sh /data/data/.built-packages\n  158  cd /data/data/.built-packages\n  159  ls\n  160  cd\n  161  cd termux-packages\n  162  cd scripts\n  163  ./package_uploader.sh apt gawk libassuan libgmp libnpth nano psmisc termux-exec bash glib libbz2 libgnutls ibogg ncurses pulseaudio termux-licenses ca-certificates gnupg libc++ libgpg-error libsndfile openssh pv termux-toolscommand-not-found grep libcurl libiconv libsoxr openssl readline tor coreutils gzip libdb libidn2 libsqlite pcre resolv-conf wget dash krb5 libedit libksba libtalloc pcre2 sed zlib diffutils          ldns libevent liblzma libtool pinentry speexdsp zshdos2unix less libffi libmpfr libunistring pkg-config tar dpkg libandroid-glob libflac libnettle libuuid procps termux-am findutils libandroid-support libgcrypt libnghttp2 libvorbis proot termux-auth\n  164  ls\n  165  cd ..\n  166  ls\n  167  ./build-all.sh\n  168  cd packages\n  169  ls\n  170  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep game-repo\n  171  cd ..\n  172  ./build-package.sh proot wget openssh pulseaudio bash tar nano apt pkg-config zsh pv dos2unix sed grep game-repo\n  173  ./package_uploader.sh game-repo\n  174  cd scripts\n  175  ./package_uploader.sh game-rep\n  176  ./package_uploader.sh game-repo\n  177  ./package_uploader.sh apt gawk libassuan libgmp libnpth nano psmisc termux-exec bash glib libbz2 libgnutls ibogg ncurses pulseaudio termux-licenses ca-certificates gnupg libc++ libgpg-error libsndfile openssh pv termux-toolscommand-not-found grep libcurl libiconv libsoxr openssl readline tor coreutils gzip libdb libidn2 libsqlite pcre resolv-conf wget dash krb5 libedit libksba libtalloc pcre2 sed zlib diffutils ldns libevent liblzma libtool pinentry speexdsp zshdos2unix less libffi libmpfr libunistring pkg-config tar dpkg libandroid-glob libflac libnettle libuuid procps termux-am findutils libandroid-support libgcrypt libnghttp2 libvorbis proot termux-auth\n  178  ./package_uploader.sh zsh dos2unix libogg\n  179  ./package_uploader.sh termux-keyring\n  180  ./build-all.sh\n  181  cd ..\n  182  ./build-all.sh\n  183  cd /data/data/.built-packages\n  184  ls\n  185  cd scripts\n  186  cd \n  187  cd termux-packages/scripts\n  188  ls\n  189  ./build-package.sh ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss\n  190  cd ..\n  191  ./build-package.sh ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss\n  192  cd termux-packages/scripts\n  193  cd scripts\n  194  ls\n  195  ./package_uploader.sh ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss\n  196  cd ..\n  197  cd packages\n  198  ls\n  199  cd ..\n  200  ls\n  201  ./build-package.sh inetutils\n  202  cd script\n  203  cd scripts\n  204  ./package_uploader inetutils\n  205  ls\n  206  ./build-package.sh util-linux\n  207  cd ..\n  208  ./build-package.sh util-linux\n  209  cd scripts\n  210  ./package_uploader.sh util-linux\n  211  cd .. && ./build-package.sh libcrypt\n  212  cd scripts && ./package_uploader.sh libcrypt\n  213  printenv\n  214  exit\n  215  source init_env.sh\n  216  printenv\n  217  cd package\n  218  cd packages\n  219  ls\n  220  cd ..\n  221  build-package.sh git hashdeep\n  222  build-packages.sh git hashdeep\n  223  ls\n  224  bash build-package.sh git hashdeep\n  225  cd scripts\n  226  ./package_uploader.sh util-linux\n  227  ./package_uploader.sh git hashdeep\n  228  cd ..\n  229  ./package_uploader.sh neofetch\n  230  bash build-package.sh neofetch\n  231  cd packages\n  232  ls\n  233  ./package_uploader.sh neofetch\n  234  cd ..\n  235  cd scripts\n  236  ./package_uploader.sh neofetch\n  237  cd ..\n  238  ./build-package.sh ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n  239  ./build-package.sh -a arm i686 x86_64 ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n  240  ./build-package.sh -a arm,i686,x86_64 ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n  241  ./build-package.sh -a arm ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n  242  history > print.txt\n"
  },
  {
    "path": "sample/build.sh",
    "content": "# Skeleton build.sh script for new package.\n# For reference about available fields, check the Termux Developer's Wiki page:\n# https://github.com/termux/termux-packages/wiki/Creating-new-package\n\nTERMUX_PKG_HOMEPAGE=\nTERMUX_PKG_DESCRIPTION=\"\"\nTERMUX_PKG_LICENSE=\"\"\nTERMUX_PKG_VERSION=\nTERMUX_PKG_SRCURL=\nTERMUX_PKG_SHA256=\n#TERMUX_PKG_DEPENDS=\"\"\n#TERMUX_PKG_BUILD_IN_SRC=true\n"
  },
  {
    "path": "sample/sample-sub.subpackage.sh",
    "content": "# Skeleton *.subpackage.sh script for new package.\n# Delete this file if package shouldn't be splitted, otherwise rename and fill\n# necessary fields.\n# More information available on the Termux Developer's Wiki page:\n# https://github.com/termux/termux-packages/wiki/Creating-new-package#writing-a-subpackage-script\n\nTERMUX_SUBPKG_DESCRIPTION=\"\"\nTERMUX_SUBPKG_INCLUDE=\"\"\n"
  },
  {
    "path": "scripts/Dockerfile",
    "content": "# Build with:\n#\tdocker build -t termux/package-builder .\n# Push to docker hub with:\n#\tdocker push termux/package-builder\n# This is done after changing this file or any of the\n# scripts/setup-{ubuntu,android-sdk}.sh setup scripts.\nFROM ubuntu:19.10\n\n# Fix locale to avoid warnings:\nENV LANG C.UTF-8\n\n# Needed for setup:\nCOPY ./setup-ubuntu.sh ./setup-android-sdk.sh ./properties.sh /tmp/\n\n# Setup needed packages and the Android SDK and NDK:\nRUN apt-get update && \\\n\tapt-get -yq upgrade && \\\n\tapt-get install -yq sudo && \\\n\tadduser --disabled-password --shell /bin/bash --gecos \"\" builder && \\\n\techo \"builder ALL=(root) NOPASSWD:ALL\" > /etc/sudoers.d/builder && \\\n\tchmod 0440 /etc/sudoers.d/builder && \\\n\tsu - builder -c /tmp/setup-ubuntu.sh && \\\n\tsu - builder -c /tmp/setup-android-sdk.sh && \\\n\t# Removed unused parts to make a smaller Docker image:\n\tapt-get clean && \\\n\trm -rf /var/lib/apt/lists/* && \\\n\tcd /home/builder/lib/android-ndk/ && \\\n\trm -Rf sources/cxx-stl/system && \\\n\tcd /home/builder/lib/android-sdk/tools && \\\n\trm -Rf emulator* lib* proguard templates\n\n# Switch User\nUSER builder:builder\n\n# We expect this to be mounted with '-v $PWD:/home/builder/termux-packages':\nWORKDIR /home/builder/termux-packages\n"
  },
  {
    "path": "scripts/Vagrantfile",
    "content": "# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\nVagrant.configure(\"2\") do |config|\n\n  config.vm.box = \"ubuntu/disco64\"\n\n  # use vagrant-disksize plugin to resize partition - https://github.com/sprotheroe/vagrant-disksize\n  config.disksize.size = '50GB'\n\n  config.vm.provider \"virtualbox\" do |vb|\n    # Customize the amount of memory on the VM\n    vb.memory = \"4096\"\n  end\n\n  # Share the root of the repo\n  config.vm.synced_folder \"../\", \"/home/vagrant/termux-packages\"\n  # Disable the default /vagrant share directory, as it shares the directory with the Vagrantfile in it, not the repo root\n  config.vm.synced_folder \".\", \"/vagrant\", disabled: true\n\n  # Filesystem needs to be resized\n  config.vm.provision \"shell\", inline: \"resize2fs /dev/sda1\", privileged: true\n\n  # Run environment setup scripts\n  config.vm.provision \"shell\", inline: \"cd /home/vagrant/termux-packages && ./scripts/setup-ubuntu.sh\", privileged: false\n  config.vm.provision \"shell\", inline: \"cd /home/vagrant/termux-packages && ./scripts/setup-android-sdk.sh\", privileged: false\n\n  # Fix permissions on the /data directory in order to allow the \"vagrant\" user to write to it\n  config.vm.provision \"shell\",\n    inline: \"chown -R vagrant /data\", privileged: true\n\n  # Tell the user how to use the VM\n  config.vm.post_up_message = \"Box has been provisioned! Use 'vagrant ssh' to enter the box. The repository root is available under '~/termux-packages'.\"\nend\n"
  },
  {
    "path": "scripts/apt-compare-versions",
    "content": "#!/usr/bin/env python3\n# apt-compare-versions: Simple script which takes two arguments and compares\n# their version according to apt rules. This can be used to verify the ordering\n# between two versions.\n#\n# Note that ~ (tilde) construct, which allows for beta and preview releases.\n# A version with ~ is considered earlier than one without, so 1.6~beta1 is\n# considered earlier than 1.6. If both versions contains ~ the version comparison\n# is made first on the part preceding the tilde, then the part coming after,\n# so 1.6~beta1 comes before 1.6~beta2.\n\nimport apt_pkg, sys\napt_pkg.init_system()\n\nif len(sys.argv) != 3:\n\tsys.exit('usage: apt-compare-versions <first-version> <second-version>')\n\nversion1 = sys.argv[1]\nversion2 = sys.argv[2]\n\ncomparison_result =  apt_pkg.version_compare(version1, version2)\nif comparison_result > 0:\n\toperator = ' > '\nelif comparison_result < 0:\n\toperator = ' < '\nelif comparison_result == 0:\n\toperator = ' == '\n\nprint(version1 + operator + version2)\n"
  },
  {
    "path": "scripts/build/ci/cirrus-ci_dispatcher.sh",
    "content": "#!/bin/bash\n##\n##  Determine modified packages and build/upload them.\n##\n\nset -e\n\n## Some packages should be excluded from auto builds.\nEXCLUDED_PACKAGES=\"texlive\"\n\n###############################################################################\n##\n##  Determining changes.\n##\n###############################################################################\n\nset +e\n\nREPO_DIR=$(realpath \"$(dirname \"$(realpath \"$0\")\")/../../../\")\ncd \"$REPO_DIR\" || {\n\techo \"[!] Failed to cd into '$REPO_DIR'.\"\n\texit 1\n}\n\n# Some environment variables are important for correct functionality\n# of this script.\nif [ -z \"$CIRRUS_CHANGE_IN_REPO\" ]; then\n\techo \"[!] CIRRUS_CHANGE_IN_REPO is not set.\"\n\texit 1\nfi\n\nif [ -n \"$CIRRUS_PR\" ] && [ -z \"$CIRRUS_BASE_SHA\" ]; then\n\techo \"[!] CIRRUS_BASE_SHA is not set.\"\n\texit 1\nfi\n\n# Process tag '%ci:no-build' that may be added as line to commit message.\n# Will force CI to exit with status 'passed' without performing build.\nif grep -qiP '^\\s*%ci:no-build\\s*$' <(git log --format=\"%B\" -n 1 \"$CIRRUS_CHANGE_IN_REPO\"); then\n\techo \"[!] Exiting with status 'passed' (tag '%ci:no-build' applied).\"\n\texit 0\nfi\n\n# Process tag '%ci:reset-backlog' that may be added as line to commit message.\n# Will force CI to build changes only for the current commit.\nif grep -qiP '^\\s*%ci:reset-backlog\\s*$' <(git log --format=\"%B\" -n 1 \"$CIRRUS_CHANGE_IN_REPO\"); then\n\techo \"[!] Building only last pushed commit (tag '%ci:reset-backlog' applied).\"\n\tunset CIRRUS_LAST_GREEN_CHANGE\n\tunset CIRRUS_BASE_SHA\nfi\n\nif [ -z \"$CIRRUS_PR\" ]; then\n\t# Changes determined from the last commit where CI finished with status\n\t# 'passed' (green) and the top commit.\n\tif [ -z \"$CIRRUS_LAST_GREEN_CHANGE\" ]; then\n\t\tGIT_CHANGES=\"$CIRRUS_CHANGE_IN_REPO\"\n\telse\n\t\tGIT_CHANGES=\"${CIRRUS_LAST_GREEN_CHANGE}..${CIRRUS_CHANGE_IN_REPO}\"\n\tfi\n\techo \"[*] Changes: $GIT_CHANGES\"\nelse\n\t# Changes in pull request are determined from commits between the\n\t# top commit of base branch and latest commit of PR's branch.\n\tGIT_CHANGES=\"${CIRRUS_BASE_SHA}..${CIRRUS_CHANGE_IN_REPO}\"\n\techo \"[*] Pull request: https://github.com/AndronixApp/termux-packages/pull/${CIRRUS_PR}\"\nfi\n\n# Determine changes from commit range.\nCHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r \"$GIT_CHANGES\" 2>/dev/null)\n\n# Modified packages.\nPACKAGE_NAMES=$(sed -nE 's@^packages/([^/]*)/build.sh@\\1@p' <<< \"$CHANGED_FILES\")\n\n# Docker scripts.\nDOCKER_SCRIPTS=$(grep -P '^scripts/(Dockerfile|properties.sh|setup-android-sdk.sh|setup-ubuntu.sh)$' <<< \"$CHANGED_FILES\")\n[ -n \"$DOCKER_SCRIPTS\" ] && DOCKER_IMAGE_UPDATE_NEEDED=true || DOCKER_IMAGE_UPDATE_NEEDED=false\n\nunset CHANGED_FILES\n\n## Filter deleted packages.\nfor pkg in $PACKAGE_NAMES; do\n\tif [ ! -d \"${REPO_DIR}/packages/${pkg}\" ]; then\n\t\tPACKAGE_NAMES=$(sed -E \"s/(^|\\s\\s*)${pkg}(\\$|\\s\\s*)/ /g\" <<< \"$PACKAGE_NAMES\")\n\tfi\ndone\n\n## Filter excluded packages.\nfor pkg in $EXCLUDED_PACKAGES; do\n\tPACKAGE_NAMES=$(sed -E \"s/(^|\\s\\s*)${pkg}(\\$|\\s\\s*)/ /g\" <<< \"$PACKAGE_NAMES\")\ndone\nunset pkg\n\n## Remove trailing spaces.\nPACKAGE_NAMES=$(sed 's/[[:blank:]]*$//' <<< \"$PACKAGE_NAMES\")\n\nset -e\n\n###############################################################################\n##\n##  Executing requested actions. Only one per script session.\n##\n###############################################################################\n\ncase \"$1\" in\n\t--update-docker)\n\t\tif $DOCKER_IMAGE_UPDATE_NEEDED; then\n\t\t\tif [ \"$CIRRUS_BRANCH\" != \"master\" ]; then\n\t\t\t\techo \"[!] Refusing to update docker image on non-master branch.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\tif [ -z \"$DOCKER_USERNAME\" ]; then\n\t\t\t\techo \"[!] Can't update docker image without Docker Hub user name.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\tif [ -z \"$DOCKER_PASSWORD\" ]; then\n\t\t\t\techo \"[!] Can't update docker image without Docker Hub password.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\tcd \"${REPO_DIR}/scripts\"\n\n\t\t\tdocker build --tag andronixapp/package-builder:latest .\n\t\t\tdocker login --username \"$DOCKER_USERNAME\" --password \"$DOCKER_PASSWORD\"\n\t\t\tdocker push andronixapp/package-builder:latest\n\t\telse\n\t\t\techo \"[*] No need to update docker image.\"\n\t\t\texit 0\n\t\tfi\n\t\t;;\n\t--upload)\n\t\tif [ -n \"$PACKAGE_NAMES\" ]; then\n\t\t\tif [ \"$CIRRUS_BRANCH\" != \"master\" ]; then\n\t\t\t\techo \"[!] Refusing to upload packages on non-master branch.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\tif [ -z \"$BINTRAY_API_KEY\" ]; then\n\t\t\t\techo \"[!] Can't upload packages without Bintray API key.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\tif [ -z \"$BINTRAY_GPG_PASSPHRASE\" ]; then\n\t\t\t\techo \"[!] Can't upload packages without GPG passphrase.\"\n\t\t\t\texit 1\n\t\t\tfi\n\n\t\t\techo \"[*] Uploading packages to Bintray:\"\n\t\t\t\"${REPO_DIR}/scripts/package_uploader.sh\" -p \"${PWD}/debs\" $PACKAGE_NAMES\n\t\telse\n\t\t\techo \"[*] No modified packages found.\"\n\t\t\texit 0\n\t\tfi\n\t\t;;\n\t*)\n\t\tif [ -n \"$PACKAGE_NAMES\" ]; then\n\t\t\techo \"[*] Building packages:\" $PACKAGE_NAMES\n\t\t\t./build-package.sh -a \"$TERMUX_ARCH\" -I $PACKAGE_NAMES\n\t\telse\n\t\t\techo \"[*] No modified packages found.\"\n\t\t\texit 0\n\t\tfi\n\t\t;;\nesac\n"
  },
  {
    "path": "scripts/build/configure/termux_step_configure.sh",
    "content": "termux_step_configure() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\tif [ \"$TERMUX_PKG_FORCE_CMAKE\" = \"false\" ] && [ -f \"$TERMUX_PKG_SRCDIR/configure\" ]; then\n\t\ttermux_step_configure_autotools\n\telif [ -f \"$TERMUX_PKG_SRCDIR/CMakeLists.txt\" ]; then\n\t\ttermux_step_configure_cmake\n\telif [ -f \"$TERMUX_PKG_SRCDIR/meson.build\" ]; then\n\t\ttermux_step_configure_meson\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/configure/termux_step_configure_autotools.sh",
    "content": "termux_step_configure_autotools() {\n\tif [ ! -e \"$TERMUX_PKG_SRCDIR/configure\" ]; then return; fi\n\n\tlocal ENABLE_STATIC=\"--enable-static\"\n\tif [ \"$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\" != \"${TERMUX_PKG_EXTRA_CONFIGURE_ARGS/--disable-static/}\" ]; then\n\t\tENABLE_STATIC=\"\"\n\tfi\n\n\tlocal DISABLE_NLS=\"--disable-nls\"\n\tif [ \"$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\" != \"${TERMUX_PKG_EXTRA_CONFIGURE_ARGS/--enable-nls/}\" ]; then\n\t\t# Do not --disable-nls if package explicitly enables it (for gettext itself)\n\t\tDISABLE_NLS=\"\"\n\tfi\n\n\tlocal ENABLE_SHARED=\"--enable-shared\"\n\tif [ \"$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\" != \"${TERMUX_PKG_EXTRA_CONFIGURE_ARGS/--disable-shared/}\" ]; then\n\t\tENABLE_SHARED=\"\"\n\tfi\n\n\tlocal HOST_FLAG=\"--host=$TERMUX_HOST_PLATFORM\"\n\tif [ \"$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\" != \"${TERMUX_PKG_EXTRA_CONFIGURE_ARGS/--host=/}\" ]; then\n\t\tHOST_FLAG=\"\"\n\tfi\n\n\tlocal LIBEXEC_FLAG=\"--libexecdir=$TERMUX_PREFIX/libexec\"\n\tif [ \"$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\" != \"${TERMUX_PKG_EXTRA_CONFIGURE_ARGS/--libexecdir=/}\" ]; then\n\t\tLIBEXEC_FLAG=\"\"\n\tfi\n\n\tlocal QUIET_BUILD=\n\tif [ \"$TERMUX_QUIET_BUILD\" = true ]; then\n\t\tQUIET_BUILD=\"--enable-silent-rules --silent --quiet\"\n\tfi\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\t# Some packages provides a $PKG-config script which some configure scripts pickup instead of pkg-config:\n\t\tmkdir \"$TERMUX_PKG_TMPDIR/config-scripts\"\n\t\tfor f in $TERMUX_PREFIX/bin/*config; do\n\t\t\ttest -f \"$f\" && cp \"$f\" \"$TERMUX_PKG_TMPDIR/config-scripts\"\n\t\tdone\n\t\texport PATH=$TERMUX_PKG_TMPDIR/config-scripts:$PATH\n\tfi\n\n\t# Avoid gnulib wrapping of functions when cross compiling. See\n\t# http://wiki.osdev.org/Cross-Porting_Software#Gnulib\n\t# https://gitlab.com/sortix/sortix/wikis/Gnulib\n\t# https://github.com/termux/termux-packages/issues/76\n\tlocal AVOID_GNULIB=\"\"\n\tAVOID_GNULIB+=\" ac_cv_func_nl_langinfo=yes\"\n\tAVOID_GNULIB+=\" ac_cv_func_calloc_0_nonnull=yes\"\n\tAVOID_GNULIB+=\" ac_cv_func_chown_works=yes\"\n\tAVOID_GNULIB+=\" ac_cv_func_getgroups_works=yes\"\n\tAVOID_GNULIB+=\" ac_cv_func_malloc_0_nonnull=yes\"\n\tAVOID_GNULIB+=\" ac_cv_func_posix_spawn=no\"\n\tAVOID_GNULIB+=\" ac_cv_func_posix_spawnp=no\"\n\tAVOID_GNULIB+=\" ac_cv_func_realloc_0_nonnull=yes\"\n\tAVOID_GNULIB+=\" am_cv_func_working_getline=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_dup2_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_fcntl_f_dupfd_cloexec=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_fcntl_f_dupfd_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_fnmatch_posix=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_getcwd_abort_bug=no\"\n\tAVOID_GNULIB+=\" gl_cv_func_getcwd_null=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_getcwd_path_max=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_getcwd_posix_signature=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_gettimeofday_clobber=no\"\n\tAVOID_GNULIB+=\" gl_cv_func_gettimeofday_posix_signature=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_link_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_lstat_dereferences_slashed_symlink=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_malloc_0_nonnull=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_memchr_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_mkdir_trailing_dot_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_mkdir_trailing_slash_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_mkfifo_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_mknod_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_realpath_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_select_detects_ebadf=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_snprintf_posix=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_snprintf_retval_c99=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_snprintf_truncation_c99=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_stat_dir_slash=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_stat_file_slash=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_strerror_0_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_strtold_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_symlink_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_tzset_clobber=no\"\n\tAVOID_GNULIB+=\" gl_cv_func_unlink_honors_slashes=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_unlink_honors_slashes=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_vsnprintf_posix=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_vsnprintf_zerosize_c99=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_wcwidth_works=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_working_getdelim=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_working_mkstemp=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_working_mktime=yes\"\n\tAVOID_GNULIB+=\" gl_cv_func_working_strerror=yes\"\n\tAVOID_GNULIB+=\" gl_cv_header_working_fcntl_h=yes\"\n\tAVOID_GNULIB+=\" gl_cv_C_locale_sans_EILSEQ=yes\"\n\n\t# NOTE: We do not want to quote AVOID_GNULIB as we want word expansion.\n\t# shellcheck disable=SC2086\n\tenv $AVOID_GNULIB \"$TERMUX_PKG_SRCDIR/configure\" \\\n\t\t--disable-dependency-tracking \\\n\t\t--prefix=$TERMUX_PREFIX \\\n\t\t--libdir=$TERMUX_PREFIX/lib \\\n\t\t--disable-rpath --disable-rpath-hack \\\n\t\t$HOST_FLAG \\\n\t\t$TERMUX_PKG_EXTRA_CONFIGURE_ARGS \\\n\t\t$DISABLE_NLS \\\n\t\t$ENABLE_SHARED \\\n\t\t$ENABLE_STATIC \\\n\t\t$LIBEXEC_FLAG \\\n\t\t$QUIET_BUILD\n}\n"
  },
  {
    "path": "scripts/build/configure/termux_step_configure_cmake.sh",
    "content": "termux_step_configure_cmake() {\n\ttermux_setup_cmake\n\n\tlocal BUILD_TYPE=MinSizeRel\n\t[ \"$TERMUX_DEBUG\" = \"true\" ] && BUILD_TYPE=Debug\n\n\tlocal CMAKE_PROC=$TERMUX_ARCH\n\ttest $CMAKE_PROC == \"arm\" && CMAKE_PROC='armv7-a'\n\tlocal MAKE_PROGRAM_PATH\n\tif [ \"$TERMUX_CMAKE_BUILD\" = Ninja ]; then\n\t\ttermux_setup_ninja\n\t\tMAKE_PROGRAM_PATH=$(command -v ninja)\n\telse\n\t\tMAKE_PROGRAM_PATH=$(command -v make)\n\tfi\n\n\tCXXFLAGS+=\" -fno-addrsig\"\n\tCFLAGS+=\" -fno-addrsig\"\n\n\tlocal CMAKE_ADDITIONAL_ARGS=()\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\tCXXFLAGS+=\" --target=$CCTERMUX_HOST_PLATFORM\"\n\t\tCFLAGS+=\" --target=$CCTERMUX_HOST_PLATFORM\"\n\t\tLDFLAGS+=\" --target=$CCTERMUX_HOST_PLATFORM\"\n\n\t\tCMAKE_ADDITIONAL_ARGS+=(\"-DCMAKE_CROSSCOMPILING=True\")\n\t\tCMAKE_ADDITIONAL_ARGS+=(\"-DCMAKE_LINKER=$TERMUX_STANDALONE_TOOLCHAIN/bin/$LD $LDFLAGS\")\n\t\tCMAKE_ADDITIONAL_ARGS+=(\"-DCMAKE_SYSTEM_NAME=Android\")\n\t\tCMAKE_ADDITIONAL_ARGS+=(\"-DCMAKE_SYSTEM_VERSION=$TERMUX_PKG_API_LEVEL\")\n\t\tCMAKE_ADDITIONAL_ARGS+=(\"-DCMAKE_SYSTEM_PROCESSOR=$CMAKE_PROC\")\n\t\tCMAKE_ADDITIONAL_ARGS+=(\"-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN\")\n\telse\n\t\tCMAKE_ADDITIONAL_ARGS+=(\"-DCMAKE_LINKER=$(command -v $LD) $LDFLAGS\")\n\tfi\n\n\t# XXX: CMAKE_{AR,RANLIB} needed for at least jsoncpp build to not\n\t# pick up cross compiled binutils tool in $TERMUX_PREFIX/bin:\n\tcmake -G \"$TERMUX_CMAKE_BUILD\" \"$TERMUX_PKG_SRCDIR\" \\\n\t\t-DCMAKE_AR=\"$(command -v $AR)\" \\\n\t\t-DCMAKE_UNAME=\"$(command -v uname)\" \\\n\t\t-DCMAKE_RANLIB=\"$(command -v $RANLIB)\" \\\n\t\t-DCMAKE_BUILD_TYPE=$BUILD_TYPE \\\n\t\t-DCMAKE_C_FLAGS=\"$CFLAGS $CPPFLAGS\" \\\n\t\t-DCMAKE_CXX_FLAGS=\"$CXXFLAGS $CPPFLAGS\" \\\n\t\t-DCMAKE_FIND_ROOT_PATH=$TERMUX_PREFIX \\\n\t\t-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \\\n\t\t-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \\\n\t\t-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \\\n\t\t-DCMAKE_INSTALL_PREFIX=$TERMUX_PREFIX \\\n\t\t-DCMAKE_MAKE_PROGRAM=$MAKE_PROGRAM_PATH \\\n\t\t-DCMAKE_SKIP_INSTALL_RPATH=ON \\\n\t\t-DCMAKE_USE_SYSTEM_LIBRARIES=True \\\n\t\t-DDOXYGEN_EXECUTABLE= \\\n\t\t-DBUILD_TESTING=OFF \\\n\t\t\"${CMAKE_ADDITIONAL_ARGS[@]}\" \\\n\t\t$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\n}\n"
  },
  {
    "path": "scripts/build/configure/termux_step_configure_meson.sh",
    "content": "termux_step_configure_meson() {\n\ttermux_setup_meson\n\tCC=gcc CXX=g++ CFLAGS= CXXFLAGS= CPPFLAGS= LDFLAGS= $TERMUX_MESON \\\n\t\t$TERMUX_PKG_SRCDIR \\\n\t\t$TERMUX_PKG_BUILDDIR \\\n\t\t--cross-file $TERMUX_MESON_CROSSFILE \\\n\t\t--prefix $TERMUX_PREFIX \\\n\t\t--libdir lib \\\n\t\t--buildtype minsize \\\n\t\t--strip \\\n\t\t$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\n}\n"
  },
  {
    "path": "scripts/build/setup/termux_setup_cmake.sh",
    "content": "termux_setup_cmake() {\n\tlocal TERMUX_CMAKE_MAJORVESION=3.15\n\tlocal TERMUX_CMAKE_MINORVERSION=5\n\tlocal TERMUX_CMAKE_VERSION=$TERMUX_CMAKE_MAJORVESION.$TERMUX_CMAKE_MINORVERSION\n\tlocal TERMUX_CMAKE_TARNAME=cmake-${TERMUX_CMAKE_VERSION}-Linux-x86_64.tar.gz\n\tlocal TERMUX_CMAKE_TARFILE=$TERMUX_PKG_TMPDIR/$TERMUX_CMAKE_TARNAME\n\tlocal TERMUX_CMAKE_FOLDER=$TERMUX_COMMON_CACHEDIR/cmake-$TERMUX_CMAKE_VERSION\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\tif [ ! -d \"$TERMUX_CMAKE_FOLDER\" ]; then\n\t\t\ttermux_download https://cmake.org/files/v$TERMUX_CMAKE_MAJORVESION/$TERMUX_CMAKE_TARNAME \\\n\t\t\t\t\"$TERMUX_CMAKE_TARFILE\" \\\n\t\t\t\t03cfd669d0f990040ec89bb63a3ae7f6d61fd17c1c4d5e7ec3d1a35fe1f043f0\n\t\t\trm -Rf \"$TERMUX_PKG_TMPDIR/cmake-${TERMUX_CMAKE_VERSION}-Linux-x86_64\"\n\t\t\ttar xf \"$TERMUX_CMAKE_TARFILE\" -C \"$TERMUX_PKG_TMPDIR\"\n\t\t\tmv \"$TERMUX_PKG_TMPDIR/cmake-${TERMUX_CMAKE_VERSION}-Linux-x86_64\" \\\n\t\t\t\t\"$TERMUX_CMAKE_FOLDER\"\n\t\tfi\n\n\t\texport PATH=$TERMUX_CMAKE_FOLDER/bin:$PATH\n\telse\n\t\tif [ \"$(dpkg-query -W -f '${db:Status-Status}\\n' cmake 2>/dev/null)\" != \"installed\" ]; then\n\t\t\techo \"Package 'cmake' is not installed.\"\n\t\t\techo \"You can install it with\"\n\t\t\techo\n\t\t\techo \"  pkg install cmake\"\n\t\t\techo\n\t\t\texit 1\n\t\tfi\n\tfi\n\n\texport CMAKE_INSTALL_ALWAYS=1\n}\n"
  },
  {
    "path": "scripts/build/setup/termux_setup_golang.sh",
    "content": "# Utility function for golang-using packages to setup a go toolchain.\ntermux_setup_golang() {\n\texport GOOS=android\n\texport CGO_ENABLED=1\n\texport GO_LDFLAGS=\"-extldflags=-pie\"\n\texport CGO_LDFLAGS=\"$LDFLAGS\"\n\texport CGO_CFLAGS=\"-I$TERMUX_PREFIX/include\"\n\tif [ \"$TERMUX_ARCH\" = \"arm\" ]; then\n\t\texport GOARCH=arm\n\t\texport GOARM=7\n\telif [ \"$TERMUX_ARCH\" = \"i686\" ]; then\n\t\texport GOARCH=386\n\t\texport GO386=sse2\n\telif [ \"$TERMUX_ARCH\" = \"aarch64\" ]; then\n\t\texport GOARCH=arm64\n\telif [ \"$TERMUX_ARCH\" = \"x86_64\" ]; then\n\t\texport GOARCH=amd64\n\telse\n\t\ttermux_error_exit \"Unsupported arch: $TERMUX_ARCH\"\n\tfi\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\tlocal TERMUX_GO_VERSION=go1.13.5\n\t\tlocal TERMUX_GO_PLATFORM=linux-amd64\n\n\t\tlocal TERMUX_BUILDGO_FOLDER=$TERMUX_COMMON_CACHEDIR/${TERMUX_GO_VERSION}\n\t\texport GOROOT=$TERMUX_BUILDGO_FOLDER\n\t\texport PATH=$GOROOT/bin:$PATH\n\n\t\tif [ -d \"$TERMUX_BUILDGO_FOLDER\" ]; then return; fi\n\n\t\tlocal TERMUX_BUILDGO_TAR=$TERMUX_COMMON_CACHEDIR/${TERMUX_GO_VERSION}.${TERMUX_GO_PLATFORM}.tar.gz\n\t\trm -Rf \"$TERMUX_COMMON_CACHEDIR/go\" \"$TERMUX_BUILDGO_FOLDER\"\n\t\ttermux_download https://storage.googleapis.com/golang/${TERMUX_GO_VERSION}.${TERMUX_GO_PLATFORM}.tar.gz \\\n\t\t\t\"$TERMUX_BUILDGO_TAR\" \\\n\t\t\t512103d7ad296467814a6e3f635631bd35574cab3369a97a323c9a585ccaa569\n\n\t\t( cd \"$TERMUX_COMMON_CACHEDIR\"; tar xf \"$TERMUX_BUILDGO_TAR\"; mv go \"$TERMUX_BUILDGO_FOLDER\"; rm \"$TERMUX_BUILDGO_TAR\" )\n\telse\n\t\tif [ \"$(dpkg-query -W -f '${db:Status-Status}\\n' golang 2>/dev/null)\" != \"installed\" ]; then\n\t\t\techo \"Package 'golang' is not installed.\"\n\t\t\techo \"You can install it with\"\n\t\t\techo\n\t\t\techo \"  pkg install golang\"\n\t\t\techo\n\t\t\techo \"or build it from source with\"\n\t\t\techo\n\t\t\techo \"  ./build-package.sh golang\"\n\t\t\techo\n\t\t\texit 1\n\t\tfi\n\n\t\texport GOROOT=\"$TERMUX_PREFIX/lib/go\"\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/setup/termux_setup_meson.sh",
    "content": "termux_setup_meson() {\n\ttermux_setup_ninja\n\tlocal MESON_VERSION=0.52.1\n\tlocal MESON_FOLDER=$TERMUX_COMMON_CACHEDIR/meson-$MESON_VERSION-v1\n\tif [ ! -d \"$MESON_FOLDER\" ]; then\n\t\tlocal MESON_TAR_NAME=meson-$MESON_VERSION.tar.gz\n\t\tlocal MESON_TAR_FILE=$TERMUX_PKG_TMPDIR/$MESON_TAR_NAME\n\t\tlocal MESON_TMP_FOLDER=$TERMUX_PKG_TMPDIR/meson-$MESON_VERSION\n\t\ttermux_download \\\n\t\t\t\"https://github.com/mesonbuild/meson/releases/download/$MESON_VERSION/meson-$MESON_VERSION.tar.gz\" \\\n\t\t\t\"$MESON_TAR_FILE\" \\\n\t\t\t0c277472e49950a5537e3de3e60c57b80dbf425788470a1a8ed27446128fc035\n\t\ttar xf \"$MESON_TAR_FILE\" -C \"$TERMUX_PKG_TMPDIR\"\n\t\t# Avoid meson stripping away DT_RUNPATH, see\n\t\t# (https://github.com/NetBSD/pkgsrc/commit/2fb2c013715a6374b4e2d1f8e9f2143e827f0f64\n\t\t# and https://github.com/mesonbuild/meson/issues/314):\n\t\tperl -p -i -e 's/self.fix_rpathtype_entry\\(new_rpath, DT_RUNPATH\\)//' \\\n\t\t\t$MESON_TMP_FOLDER/mesonbuild/scripts/depfixer.py\n\n\t\tmv \"$MESON_TMP_FOLDER\" \"$MESON_FOLDER\"\n\tfi\n\tTERMUX_MESON=\"$MESON_FOLDER/meson.py\"\n\tTERMUX_MESON_CROSSFILE=$TERMUX_PKG_TMPDIR/meson-crossfile-$TERMUX_ARCH.txt\n\tlocal MESON_CPU MESON_CPU_FAMILY\n\tif [ \"$TERMUX_ARCH\" = \"arm\" ]; then\n\t\tMESON_CPU_FAMILY=\"arm\"\n\t\tMESON_CPU=\"armv7\"\n\telif [ \"$TERMUX_ARCH\" = \"i686\" ]; then\n\t\tMESON_CPU_FAMILY=\"x86\"\n\t\tMESON_CPU=\"i686\"\n\telif [ \"$TERMUX_ARCH\" = \"x86_64\" ]; then\n\t\tMESON_CPU_FAMILY=\"x86_64\"\n\t\tMESON_CPU=\"x86_64\"\n\telif [ \"$TERMUX_ARCH\" = \"aarch64\" ]; then\n\t\tMESON_CPU_FAMILY=\"arm\"\n\t\tMESON_CPU=\"aarch64\"\n\telse\n\t\ttermux_error_exit \"Unsupported arch: $TERMUX_ARCH\"\n\tfi\n\n\tlocal CONTENT=\"\"\n\techo \"[binaries]\" > $TERMUX_MESON_CROSSFILE\n\techo \"ar = '$AR'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"c = '$CC'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"cpp = '$CXX'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"ld = '$LD'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"pkgconfig = '$PKG_CONFIG'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"strip = '$STRIP'\" >> $TERMUX_MESON_CROSSFILE\n\n\techo '' >> $TERMUX_MESON_CROSSFILE\n\techo \"[properties]\" >> $TERMUX_MESON_CROSSFILE\n\techo \"needs_exe_wrapper = true\" >> $TERMUX_MESON_CROSSFILE\n\n\techo -n \"c_args = [\" >> $TERMUX_MESON_CROSSFILE\n\tlocal word first=true\n\tfor word in $CFLAGS $CPPFLAGS; do\n\t\tif [ \"$first\" = \"true\" ]; then\n\t\t\tfirst=false\n\t\telse\n\t\t\techo -n \", \" >> $TERMUX_MESON_CROSSFILE\n\t\tfi\n\t\techo -n \"'$word'\" >> $TERMUX_MESON_CROSSFILE\n\tdone\n\techo ']' >> $TERMUX_MESON_CROSSFILE\n\n\techo -n \"cpp_args = [\" >> $TERMUX_MESON_CROSSFILE\n\tlocal word first=true\n\tfor word in $CXXFLAGS $CPPFLAGS; do\n\t\tif [ \"$first\" = \"true\" ]; then\n\t\t\tfirst=false\n\t\telse\n\t\t\techo -n \", \" >> $TERMUX_MESON_CROSSFILE\n\t\tfi\n\t\techo -n \"'$word'\" >> $TERMUX_MESON_CROSSFILE\n\tdone\n\techo ']' >> $TERMUX_MESON_CROSSFILE\n\n\tlocal property\n\tfor property in c_link_args cpp_link_args; do\n\t\techo -n \"$property = [\" >> $TERMUX_MESON_CROSSFILE\n\t\tfirst=true\n\t\tfor word in $LDFLAGS; do\n\t\t\tif [ \"$first\" = \"true\" ]; then\n\t\t\t\tfirst=false\n\t\t\telse\n\t\t\t\techo -n \", \" >> $TERMUX_MESON_CROSSFILE\n\t\t\tfi\n\t\t\techo -n \"'$word'\" >> $TERMUX_MESON_CROSSFILE\n\t\tdone\n\t\techo ']' >> $TERMUX_MESON_CROSSFILE\n\tdone\n\n\techo '' >> $TERMUX_MESON_CROSSFILE\n\techo \"[host_machine]\" >> $TERMUX_MESON_CROSSFILE\n\techo \"cpu_family = '$MESON_CPU_FAMILY'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"cpu = '$MESON_CPU'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"endian = 'little'\" >> $TERMUX_MESON_CROSSFILE\n\techo \"system = 'android'\" >> $TERMUX_MESON_CROSSFILE\n}\n"
  },
  {
    "path": "scripts/build/setup/termux_setup_ninja.sh",
    "content": "termux_setup_ninja() {\n\tlocal NINJA_VERSION=1.9.0\n\tlocal NINJA_FOLDER=$TERMUX_COMMON_CACHEDIR/ninja-$NINJA_VERSION\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\tif [ ! -x \"$NINJA_FOLDER/ninja\" ]; then\n\t\t\tmkdir -p \"$NINJA_FOLDER\"\n\t\t\tlocal NINJA_ZIP_FILE=$TERMUX_PKG_TMPDIR/ninja-$NINJA_VERSION.zip\n\t\t\ttermux_download https://github.com/ninja-build/ninja/releases/download/v$NINJA_VERSION/ninja-linux.zip \\\n\t\t\t\t\"$NINJA_ZIP_FILE\" \\\n\t\t\t\t1b1235f2b0b4df55ac6d80bbe681ea3639c9d2c505c7ff2159a3daf63d196305\n\t\t\tunzip \"$NINJA_ZIP_FILE\" -d \"$NINJA_FOLDER\"\n\t\t\tchmod 755 $NINJA_FOLDER/ninja\n\t\tfi\n\t\texport PATH=$NINJA_FOLDER:$PATH\n\telse\n\t\tlocal NINJA_PKG_VERSION=$(bash -c \". $TERMUX_SCRIPTDIR/packages/ninja/build.sh; echo \\$TERMUX_PKG_VERSION\")\n\t\tif ([ ! -e \"$TERMUX_BUILT_PACKAGES_DIRECTORY/ninja\" ] ||\n\t\t    [ \"$(cat \"$TERMUX_BUILT_PACKAGES_DIRECTORY/ninja\")\" != \"$NINJA_PKG_VERSION\" ]) &&\n\t\t   [ \"$(dpkg-query -W -f '${db:Status-Status}\\n' ninja 2>/dev/null)\" != \"installed\" ]; then\n\t\t\techo \"Package 'ninja' is not installed.\"\n\t\t\techo \"You can install it with\"\n\t\t\techo\n\t\t\techo \"  pkg install ninja\"\n\t\t\techo\n\t\t\techo \"or build it from source with\"\n\t\t\techo\n\t\t\techo \"  ./build-package.sh ninja\"\n\t\t\techo\n\t\t\texit 1\n\t\tfi\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/setup/termux_setup_protobuf.sh",
    "content": "termux_setup_protobuf() {\n\tlocal _PROTOBUF_VERSION=$(bash -c \". $TERMUX_SCRIPTDIR/packages/libprotobuf/build.sh; echo \\$TERMUX_PKG_VERSION\")\n\tlocal _PROTOBUF_ZIP=protoc-$_PROTOBUF_VERSION-linux-x86_64.zip\n\tlocal _PROTOBUF_FOLDER=$TERMUX_COMMON_CACHEDIR/protobuf-$_PROTOBUF_VERSION\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\tif [ ! -d \"$_PROTOBUF_FOLDER\" ]; then\n\t\t\ttermux_download \\\n\t\t\t\thttps://github.com/protocolbuffers/protobuf/releases/download/v$_PROTOBUF_VERSION/$_PROTOBUF_ZIP \\\n\t\t\t\t$TERMUX_PKG_TMPDIR/$_PROTOBUF_ZIP \\\n\t\t\t\t1102323cdaacd589e50b8b7770595f220f54d18a1d76ee3c445198f80ab865b8\n\n\t\t\trm -Rf \"$TERMUX_PKG_TMPDIR/protoc-$_PROTOBUF_VERSION-linux-x86_64\"\n\t\t\tunzip $TERMUX_PKG_TMPDIR/$_PROTOBUF_ZIP -d $TERMUX_PKG_TMPDIR/protobuf-$_PROTOBUF_VERSION\n\t\t\tmv \"$TERMUX_PKG_TMPDIR/protobuf-$_PROTOBUF_VERSION\" \\\n\t\t\t\t$_PROTOBUF_FOLDER\n\t\tfi\n\n\t\texport PATH=$_PROTOBUF_FOLDER/bin/:$PATH\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/setup/termux_setup_rust.sh",
    "content": "termux_setup_rust() {\n\tif [ $TERMUX_ARCH = \"arm\" ]; then\n\t\tCARGO_TARGET_NAME=armv7-linux-androideabi\n\telse\n\t\tCARGO_TARGET_NAME=$TERMUX_ARCH-linux-android\n\tfi\n\n\texport RUSTFLAGS=\"-C link-arg=-Wl,-rpath=$TERMUX_PREFIX/lib -C link-arg=-Wl,--enable-new-dtags\"\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ]; then\n\t\tif [ \"$(dpkg-query -W -f '${db:Status-Status}\\n' rust 2>/dev/null)\" != \"installed\" ]; then\n\t\t\techo \"Package 'rust' is not installed.\"\n\t\t\techo \"You can install it with\"\n\t\t\techo\n\t\t\techo \"  pkg install rust\"\n\t\t\techo\n\t\t\techo \"or build it from source with\"\n\t\t\techo\n\t\t\techo \"  ./build-package.sh rust\"\n\t\t\techo\n\t\t\techo \"Note that package 'rust' is known to be problematic for building on device.\"\n\t\t\texit 1\n\t\tfi\n\t\treturn\n\tfi\n\n\tlocal ENV_NAME=CARGO_TARGET_${CARGO_TARGET_NAME^^}_LINKER\n\tENV_NAME=${ENV_NAME//-/_}\n\texport $ENV_NAME=$CC\n\n\tcurl https://sh.rustup.rs -sSf > $TERMUX_PKG_TMPDIR/rustup.sh\n\n\tlocal _TOOLCHAIN_VERSION=$(bash -c \". $TERMUX_SCRIPTDIR/packages/rust/build.sh; echo \\$TERMUX_PKG_VERSION\")\n\n\tsh $TERMUX_PKG_TMPDIR/rustup.sh\t-y --default-toolchain $_TOOLCHAIN_VERSION\n\texport PATH=$HOME/.cargo/bin:$PATH\n\n\trustup target add $CARGO_TARGET_NAME\n}\n"
  },
  {
    "path": "scripts/build/termux_create_subpackages.sh",
    "content": "termux_create_subpackages() {\n\t# Sub packages:\n\tif [ \"$TERMUX_PKG_NO_STATICSPLIT\" = \"false\" ] && [[ -n $(shopt -s globstar; shopt -s nullglob; echo lib/**/*.a) ]]; then\n\t\t# Add virtual -static sub package if there are include files:\n\t\tlocal _STATIC_SUBPACKAGE_FILE=$TERMUX_PKG_TMPDIR/${TERMUX_PKG_NAME}-static.subpackage.sh\n\t\techo TERMUX_SUBPKG_INCLUDE=\\\"lib/**/*.a lib/**/*.la\\\" > \"$_STATIC_SUBPACKAGE_FILE\"\n\t\techo \"TERMUX_SUBPKG_DESCRIPTION=\\\"Static libraries for ${TERMUX_PKG_NAME}\\\"\" >> \"$_STATIC_SUBPACKAGE_FILE\"\n\tfi\n\n\t# Now build all sub packages\n\trm -Rf \"$TERMUX_TOPDIR/$TERMUX_PKG_NAME/subpackages\"\n\tfor subpackage in $TERMUX_PKG_BUILDER_DIR/*.subpackage.sh $TERMUX_PKG_TMPDIR/*subpackage.sh; do\n\t\ttest ! -f \"$subpackage\" && continue\n\t\tlocal SUB_PKG_NAME\n\t\tSUB_PKG_NAME=$(basename \"$subpackage\" .subpackage.sh)\n\t\t# Default value is same as main package, but sub package may override:\n\t\tlocal TERMUX_SUBPKG_PLATFORM_INDEPENDENT=$TERMUX_PKG_PLATFORM_INDEPENDENT\n\t\tlocal SUB_PKG_DIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/subpackages/$SUB_PKG_NAME\n\t\tlocal TERMUX_SUBPKG_ESSENTIAL=false\n\t\tlocal TERMUX_SUBPKG_BREAKS=\"\"\n\t\tlocal TERMUX_SUBPKG_DEPENDS=\"\"\n\t\tlocal TERMUX_SUBPKG_CONFLICTS=\"\"\n\t\tlocal TERMUX_SUBPKG_REPLACES=\"\"\n\t\tlocal TERMUX_SUBPKG_CONFFILES=\"\"\n\t\tlocal TERMUX_SUBPKG_DEPEND_ON_PARENT=\"\"\n\t\tlocal SUB_PKG_MASSAGE_DIR=$SUB_PKG_DIR/massage/$TERMUX_PREFIX\n\t\tlocal SUB_PKG_PACKAGE_DIR=$SUB_PKG_DIR/package\n\t\tmkdir -p \"$SUB_PKG_MASSAGE_DIR\" \"$SUB_PKG_PACKAGE_DIR\"\n\n\t\t# shellcheck source=/dev/null\n\t\tsource \"$subpackage\"\n\n\t\t# Allow globstar (i.e. './**/') patterns.\n\t\tshopt -s globstar\n\t\tfor includeset in $TERMUX_SUBPKG_INCLUDE; do\n\t\t\tlocal _INCLUDE_DIRSET\n\t\t\t_INCLUDE_DIRSET=$(dirname \"$includeset\")\n\t\t\ttest \"$_INCLUDE_DIRSET\" = \".\" && _INCLUDE_DIRSET=\"\"\n\n\t\t\tif [ -e \"$includeset\" ] || [ -L \"$includeset\" ]; then\n\t\t\t\t# Add the -L clause to handle relative symbolic links:\n\t\t\t\tmkdir -p \"$SUB_PKG_MASSAGE_DIR/$_INCLUDE_DIRSET\"\n\t\t\t\tmv \"$includeset\" \"$SUB_PKG_MASSAGE_DIR/$_INCLUDE_DIRSET\"\n\t\t\tfi\n\t\tdone\n\t\tshopt -u globstar\n\n\t\tlocal SUB_PKG_ARCH=$TERMUX_ARCH\n\t\t[ \"$TERMUX_SUBPKG_PLATFORM_INDEPENDENT\" = \"true\" ] && SUB_PKG_ARCH=all\n\n\t\tcd \"$SUB_PKG_DIR/massage\"\n\t\tlocal SUB_PKG_INSTALLSIZE\n\t\tSUB_PKG_INSTALLSIZE=$(du -sk . | cut -f 1)\n\t\ttar -cJf \"$SUB_PKG_PACKAGE_DIR/data.tar.xz\" .\n\n\t\tmkdir -p DEBIAN\n\t\tcd DEBIAN\n\n\t\tcat > control <<-HERE\n\t\t\tPackage: $SUB_PKG_NAME\n\t\t\tArchitecture: ${SUB_PKG_ARCH}\n\t\t\tInstalled-Size: ${SUB_PKG_INSTALLSIZE}\n\t\t\tMaintainer: $TERMUX_PKG_MAINTAINER\n\t\t\tVersion: $TERMUX_PKG_FULLVERSION\n\t\t\tHomepage: $TERMUX_PKG_HOMEPAGE\n\t\tHERE\n\n\t\tlocal PKG_DEPS_SPC=\" ${TERMUX_PKG_DEPENDS//,/} \"\n\n\t\tif [ -z \"$TERMUX_SUBPKG_DEPEND_ON_PARENT\" ] && [ \"${PKG_DEPS_SPC/ $SUB_PKG_NAME /}\" = \"$PKG_DEPS_SPC\" ]; then\n\t\t    TERMUX_SUBPKG_DEPENDS+=\", $TERMUX_PKG_NAME (= $TERMUX_PKG_FULLVERSION)\"\n\t\telif [ \"$TERMUX_SUBPKG_DEPEND_ON_PARENT\" = unversioned ]; then\n\t\t    TERMUX_SUBPKG_DEPENDS+=\", $TERMUX_PKG_NAME\"\n\t\telif [ \"$TERMUX_SUBPKG_DEPEND_ON_PARENT\" = deps ]; then\n\t\t    TERMUX_SUBPKG_DEPENDS+=\", $TERMUX_PKG_DEPENDS\"\n\t\tfi\n\n\t\t[ \"$TERMUX_SUBPKG_ESSENTIAL\" = \"true\" ] && echo \"Essential: yes\" >> control\n\t\ttest ! -z \"$TERMUX_SUBPKG_DEPENDS\" && echo \"Depends: ${TERMUX_SUBPKG_DEPENDS/#, /}\" >> control\n\t\ttest ! -z \"$TERMUX_SUBPKG_BREAKS\" && echo \"Breaks: $TERMUX_SUBPKG_BREAKS\" >> control\n\t\ttest ! -z \"$TERMUX_SUBPKG_CONFLICTS\" && echo \"Conflicts: $TERMUX_SUBPKG_CONFLICTS\" >> control\n\t\ttest ! -z \"$TERMUX_SUBPKG_REPLACES\" && echo \"Replaces: $TERMUX_SUBPKG_REPLACES\" >> control\n\t\techo \"Description: $TERMUX_SUBPKG_DESCRIPTION\" >> control\n\n\t\tfor f in $TERMUX_SUBPKG_CONFFILES; do echo \"$TERMUX_PREFIX/$f\" >> conffiles; done\n\n\t\ttar -czf \"$SUB_PKG_PACKAGE_DIR/control.tar.gz\" .\n\n\t\t# Create the actual .deb file:\n\t\tTERMUX_SUBPKG_DEBFILE=$TERMUX_DEBDIR/${SUB_PKG_NAME}${DEBUG}_${TERMUX_PKG_FULLVERSION}_${SUB_PKG_ARCH}.deb\n\t\ttest ! -f \"$TERMUX_COMMON_CACHEDIR/debian-binary\" && echo \"2.0\" > \"$TERMUX_COMMON_CACHEDIR/debian-binary\"\n\t\tar cr \"$TERMUX_SUBPKG_DEBFILE\" \\\n\t\t\t\t   \"$TERMUX_COMMON_CACHEDIR/debian-binary\" \\\n\t\t\t\t   \"$SUB_PKG_PACKAGE_DIR/control.tar.gz\" \\\n\t\t\t\t   \"$SUB_PKG_PACKAGE_DIR/data.tar.xz\"\n\n\t\t# Go back to main package:\n\t\tcd \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"\n\tdone\n}\n"
  },
  {
    "path": "scripts/build/termux_download.sh",
    "content": "termux_download() {\n\tif [ $# != 3 ]; then\n\t\ttermux_error_exit \"termux_download(): Invalid arguments - expected \\$URL \\$DESTINATION \\$CHECKSUM\"\n\tfi\n\tlocal URL=\"$1\"\n\tlocal DESTINATION=\"$2\"\n\tlocal CHECKSUM=\"$3\"\n\n\tif [ -f \"$DESTINATION\" ] && [ \"$CHECKSUM\" != \"SKIP_CHECKSUM\" ]; then\n\t\t# Keep existing file if checksum matches.\n\t\tlocal EXISTING_CHECKSUM\n\t\tEXISTING_CHECKSUM=$(sha256sum \"$DESTINATION\" | cut -f 1 -d ' ')\n\t\tif [ \"$EXISTING_CHECKSUM\" = \"$CHECKSUM\" ]; then return; fi\n\tfi\n\n\tlocal TMPFILE\n\tTMPFILE=$(mktemp \"$TERMUX_PKG_TMPDIR/download.$TERMUX_PKG_NAME.XXXXXXXXX\")\n\techo \"Downloading ${URL}\"\n\tlocal TRYMAX=6\n\tfor try in $(seq 1 $TRYMAX); do\n\t\tif curl -L --fail --retry 2 -o \"$TMPFILE\" \"$URL\"; then\n\t\t\tlocal ACTUAL_CHECKSUM\n\t\t\tACTUAL_CHECKSUM=$(sha256sum \"$TMPFILE\" | cut -f 1 -d ' ')\n\t\t\tif [ \"$CHECKSUM\" != \"SKIP_CHECKSUM\" ]; then\n\t\t\t\tif [ \"$CHECKSUM\" != \"$ACTUAL_CHECKSUM\" ]; then\n\t\t\t\t\t>&2 printf \"Wrong checksum for %s:\\nExpected: %s\\nActual:   %s\\n\" \\\n\t\t\t\t\t\t   \"$URL\" \"$CHECKSUM\" \"$ACTUAL_CHECKSUM\"\n\t\t\t\t\texit 1\n\t\t\t\tfi\n\t\t\telse\n\t\t\t\tprintf \"WARNING: No checksum check for %s:\\nActual: %s\\n\" \\\n\t\t\t\t       \"$URL\" \"$ACTUAL_CHECKSUM\"\n\t\t\tfi\n\t\t\tmv \"$TMPFILE\" \"$DESTINATION\"\n\t\t\treturn\n\t\telse\n\t\t\techo \"Download of $URL failed (attempt $try/$TRYMAX)\" 1>&2\n\t\t\tsleep 45\n\t\tfi\n\tdone\n\n\ttermux_error_exit \"Failed to download $URL\"\n}\n\n# Make script standalone executable as well as sourceable\nif [[ \"${BASH_SOURCE[0]}\" == \"${0}\" ]]; then\n\ttermux_download \"$@\"\nfi\n"
  },
  {
    "path": "scripts/build/termux_download_deb.sh",
    "content": "termux_download_deb() {\n\tlocal PACKAGE=$1\n\tlocal PACKAGE_ARCH=$2\n\tlocal VERSION=$3\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ]; then\n\t\tapt install -y \"${PACKAGE}=${VERSION}\"\n\t\treturn \"$?\"\n\tfi\n\n\tlocal DEB_FILE=${PACKAGE}_${VERSION}_${PACKAGE_ARCH}.deb\n\tPKG_HASH=\"\"\n\n\tfor idx in $(seq ${#TERMUX_REPO_URL[@]}); do\n\t\tlocal TERMUX_REPO_NAME=$(echo ${TERMUX_REPO_URL[$idx-1]} | sed -e 's%https://%%g' -e 's%http://%%g' -e 's%/%-%g')\n\t\tlocal PACKAGE_FILE_PATH=\"${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-${TERMUX_REPO_COMPONENT[$idx-1]}-Packages\"\n\t\tif [ -f \"${TERMUX_COMMON_CACHEDIR}-${PACKAGE_ARCH}/${PACKAGE_FILE_PATH}\" ]; then\n\t\t\tread -d \"\\n\" PKG_PATH PKG_HASH <<<$(./scripts/get_hash_from_file.py \"${TERMUX_COMMON_CACHEDIR}-${PACKAGE_ARCH}/$PACKAGE_FILE_PATH\" $PACKAGE $VERSION)\n\t\t\tif [ -n \"$PKG_HASH\" ]; then\n\t\t\t\tif [ ! \"$TERMUX_QUIET_BUILD\" = true ]; then\n\t\t\t\t\techo \"Found $PACKAGE in ${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}\"\n\t\t\t\tfi\n\t\t\t\tbreak\n\t\t\tfi\n\t\tfi\n\tdone\n\n\tif [ \"$PKG_HASH\" = \"\" ]; then\n\t\treturn 1\n\telse\n\t\ttermux_download ${TERMUX_REPO_URL[$idx-1]}/${PKG_PATH} \\\n\t\t\t\t$TERMUX_COMMON_CACHEDIR-$PACKAGE_ARCH/${DEB_FILE} \\\n\t\t\t\t$PKG_HASH\n\t\treturn 0\n\tfi\n}\n\n# Make script standalone executable as well as sourceable\nif [[ \"${BASH_SOURCE[0]}\" == \"${0}\" ]]; then\n\ttermux_download \"$@\"\nfi\n"
  },
  {
    "path": "scripts/build/termux_error_exit.sh",
    "content": "termux_error_exit() {\n\techo \"ERROR: $*\" 1>&2\n\texit 1\n}\n"
  },
  {
    "path": "scripts/build/termux_extract_dep_info.sh",
    "content": "termux_extract_dep_info() {\n\tPKG=$1\n\tPKG_DIR=$2\n\tif [ \"$PKG\" != \"$(basename ${PKG_DIR})\" ]; then\n\t\t# We are dealing with a subpackage\n\t\tTERMUX_ARCH=$(\n\t\t\t# set TERMUX_SUBPKG_PLATFORM_INDEPENDENT to parent package's value and override if needed\n\t\t\tTERMUX_PKG_PLATFORM_INDEPENDENT=false\n\t\t\tsource ${PKG_DIR}/build.sh\n\t\t\tTERMUX_SUBPKG_PLATFORM_INDEPENDENT=$TERMUX_PKG_PLATFORM_INDEPENDENT\n\t\t\tif [ \"$TERMUX_INSTALL_DEPS\" = \"false\" ] || [ \"$TERMUX_PKG_NO_STATICSPLIT\" = \"true\" ] || [ \"${PKG/-static/}-static\" != \"${PKG}\" ]; then\n\t\t\t\tsource ${PKG_DIR}/${PKG}.subpackage.sh\n\t\t\tfi\n\t\t\tif [ \"$TERMUX_SUBPKG_PLATFORM_INDEPENDENT\" = \"true\" ]; then\n\t\t\t\techo all\n\t\t\telse\n\t\t\t\techo $TERMUX_ARCH\n\t\t\tfi\n\t\t)\n\n\telif [ \"${PKG/-static/}-static\" == \"${PKG}\" ]; then\n\t\t# static lib package\n\t\tPKG=${PKG/-static/}\n\tfi\n\t(\n\t\t# Reset TERMUX_PKG_PLATFORM_INDEPENDENT and TERMUX_PKG_REVISION since these aren't\n\t\t# mandatory in a build.sh. Otherwise these will equal the main package's values for\n\t\t# deps that should have the default values\n\t\tTERMUX_PKG_PLATFORM_INDEPENDENT=false\n\t\tTERMUX_PKG_REVISION=\"0\"\n\t\tsource ${PKG_DIR}/build.sh\n\t\t[ \"$TERMUX_PKG_PLATFORM_INDEPENDENT\" = \"true\" ] && TERMUX_ARCH=all\n\t\tif [ \"$TERMUX_PKG_REVISION\" != \"0\" ] || [ \"$TERMUX_PKG_VERSION\" != \"${TERMUX_PKG_VERSION/-/}\" ]; then\n\t\t\tTERMUX_PKG_VERSION+=\"-$TERMUX_PKG_REVISION\"\n\t\tfi\n\t\techo ${TERMUX_ARCH} ${TERMUX_PKG_VERSION}\n\t)\n}\n\n# Make script standalone executable as well as sourceable\nif [[ \"${BASH_SOURCE[0]}\" == \"${0}\" ]]; then\n\ttermux_extract_dep_info \"$@\"\nfi\n"
  },
  {
    "path": "scripts/build/termux_get_repo_files.sh",
    "content": "termux_get_repo_files() {\n\t# Not needed for on-device builds.\n\t[ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ] && return\n\n\t# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will be created in build)\n\tmkdir -p \"$TERMUX_COMMON_CACHEDIR\" \\\n\t\t \"$TERMUX_COMMON_CACHEDIR-$TERMUX_ARCH\" \\\n\t\t \"$TERMUX_COMMON_CACHEDIR-all\" \\\n\t\t \"$TERMUX_DEBDIR\" \\\n\t\t \"$TERMUX_PKG_BUILDDIR\" \\\n\t\t \"$TERMUX_PKG_PACKAGEDIR\" \\\n\t\t \"$TERMUX_PKG_TMPDIR\" \\\n\t\t \"$TERMUX_PKG_CACHEDIR\" \\\n\t\t \"$TERMUX_PKG_MASSAGEDIR\" \\\n\t\t $TERMUX_PREFIX/{bin,etc,lib,libexec,share,tmp,include}\n\n\tif [ \"$TERMUX_INSTALL_DEPS\" = true ]; then\n\t\tif [ \"$TERMUX_NO_CLEAN\" = false ]; then\n\t\t\t# Remove all previously extracted/built files from $TERMUX_PREFIX:\n\t\t\trm -rf $TERMUX_PREFIX\n\t\t\trm -f $TERMUX_BUILT_PACKAGES_DIRECTORY/*\n\t\tfi\n\n\t\tfor idx in $(seq ${#TERMUX_REPO_URL[@]}); do\n\t\t\tlocal TERMUX_REPO_NAME=$(echo ${TERMUX_REPO_URL[$idx-1]} | sed -e 's%https://%%g' -e 's%http://%%g' -e 's%/%-%g')\n\t\t\tlocal RELEASE_FILE=${TERMUX_COMMON_CACHEDIR}/${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-Release\n\n\t\t\ttermux_download \"${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release\" \\\n\t\t\t\t\"$RELEASE_FILE\" SKIP_CHECKSUM\n\n\t\t\tfor arch in all $TERMUX_ARCH; do\n\t\t\t\tlocal PACKAGES_HASH=$(./scripts/get_hash_from_file.py ${RELEASE_FILE} $arch ${TERMUX_REPO_COMPONENT[$idx-1]})\n\t\t\t\t# If packages_hash = \"\" then the repo probably doesn't contain debs for $arch\n\t\t\t\tif [ -n \"$PACKAGES_HASH\" ]; then\n\t\t\t\t\ttermux_download \"${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/${TERMUX_REPO_COMPONENT[$idx-1]}/binary-$arch/Packages\" \\\n\t\t\t\t\t\t\t\"${TERMUX_COMMON_CACHEDIR}-$arch/${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-${TERMUX_REPO_COMPONENT[$idx-1]}-Packages\" \\\n\t\t\t\t\t\t\t$PACKAGES_HASH\n\t\t\t\tfi\n\t\t\tdone\n\t\tdone\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/termux_step_create_datatar.sh",
    "content": "termux_step_create_datatar() {\n\t# Create data tarball containing files to package:\n\tcd \"$TERMUX_PKG_MASSAGEDIR\"\n\n\tlocal HARDLINKS\n\tHARDLINKS=\"$(find . -type f -links +1)\"\n\tif [ -n \"$HARDLINKS\" ]; then\n\t\ttermux_error_exit \"Package contains hard links: $HARDLINKS\"\n\tfi\n\n\tif [ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ]; then\n\t\t# Metapackage doesn't have data inside.\n\t\trm -rf data\n\telse\n\t\tif [ \"$(find . -type f)\" = \"\" ]; then\n\t\t\ttermux_error_exit \"No files in package\"\n\t\tfi\n\tfi\n\n\ttar -cJf \"$TERMUX_PKG_PACKAGEDIR/data.tar.xz\" .\n}\n"
  },
  {
    "path": "scripts/build/termux_step_create_debfile.sh",
    "content": "termux_step_create_debfile() {\n\t# Get install size. This will be written as the \"Installed-Size\" deb field so is measured in 1024-byte blocks:\n\tlocal TERMUX_PKG_INSTALLSIZE\n\tTERMUX_PKG_INSTALLSIZE=$(du -sk . | cut -f 1)\n\n\t# From here on TERMUX_ARCH is set to \"all\" if TERMUX_PKG_PLATFORM_INDEPENDENT is set by the package\n\t[ \"$TERMUX_PKG_PLATFORM_INDEPENDENT\" = \"true\" ] && TERMUX_ARCH=all\n\n\tmkdir -p DEBIAN\n\tcat > DEBIAN/control <<-HERE\n\t\tPackage: $TERMUX_PKG_NAME\n\t\tArchitecture: ${TERMUX_ARCH}\n\t\tInstalled-Size: ${TERMUX_PKG_INSTALLSIZE}\n\t\tMaintainer: $TERMUX_PKG_MAINTAINER\n\t\tVersion: $TERMUX_PKG_FULLVERSION\n\t\tHomepage: $TERMUX_PKG_HOMEPAGE\n\tHERE\n\ttest ! -z \"$TERMUX_PKG_BREAKS\" && echo \"Breaks: $TERMUX_PKG_BREAKS\" >> DEBIAN/control\n\ttest ! -z \"$TERMUX_PKG_PRE_DEPENDS\" && echo \"Pre-Depends: $TERMUX_PKG_PRE_DEPENDS\" >> DEBIAN/control\n\ttest ! -z \"$TERMUX_PKG_DEPENDS\" && echo \"Depends: $TERMUX_PKG_DEPENDS\" >> DEBIAN/control\n\t[ \"$TERMUX_PKG_ESSENTIAL\" = \"true\" ] && echo \"Essential: yes\" >> DEBIAN/control\n\ttest ! -z \"$TERMUX_PKG_CONFLICTS\" && echo \"Conflicts: $TERMUX_PKG_CONFLICTS\" >> DEBIAN/control\n\ttest ! -z \"$TERMUX_PKG_RECOMMENDS\" && echo \"Recommends: $TERMUX_PKG_RECOMMENDS\" >> DEBIAN/control\n\ttest ! -z \"$TERMUX_PKG_REPLACES\" && echo \"Replaces: $TERMUX_PKG_REPLACES\" >> DEBIAN/control\n\ttest ! -z \"$TERMUX_PKG_PROVIDES\" && echo \"Provides: $TERMUX_PKG_PROVIDES\" >> DEBIAN/control\n\ttest ! -z \"$TERMUX_PKG_SUGGESTS\" && echo \"Suggests: $TERMUX_PKG_SUGGESTS\" >> DEBIAN/control\n\techo \"Description: $TERMUX_PKG_DESCRIPTION\" >> DEBIAN/control\n\n\t# Create DEBIAN/conffiles (see https://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html):\n\tfor f in $TERMUX_PKG_CONFFILES; do echo \"$TERMUX_PREFIX/$f\" >> DEBIAN/conffiles; done\n\n\t# Allow packages to create arbitrary control files.\n\t# XXX: Should be done in a better way without a function?\n\tcd DEBIAN\n\ttermux_step_create_debscripts\n\n\t# Create control.tar.gz\n\ttar -czf \"$TERMUX_PKG_PACKAGEDIR/control.tar.gz\" .\n\n\ttest ! -f \"$TERMUX_COMMON_CACHEDIR/debian-binary\" && echo \"2.0\" > \"$TERMUX_COMMON_CACHEDIR/debian-binary\"\n\tTERMUX_PKG_DEBFILE=$TERMUX_DEBDIR/${TERMUX_PKG_NAME}${DEBUG}_${TERMUX_PKG_FULLVERSION}_${TERMUX_ARCH}.deb\n\t# Create the actual .deb file:\n\tar cr \"$TERMUX_PKG_DEBFILE\" \\\n\t       \"$TERMUX_COMMON_CACHEDIR/debian-binary\" \\\n\t       \"$TERMUX_PKG_PACKAGEDIR/control.tar.gz\" \\\n\t       \"$TERMUX_PKG_PACKAGEDIR/data.tar.xz\"\n}\n"
  },
  {
    "path": "scripts/build/termux_step_extract_into_massagedir.sh",
    "content": "termux_step_extract_into_massagedir() {\n\tlocal TARBALL_ORIG=$TERMUX_PKG_PACKAGEDIR/${TERMUX_PKG_NAME}_orig.tar.gz\n\n\t# Build diff tar with what has changed during the build:\n\tcd $TERMUX_PREFIX\n\ttar -N \"$TERMUX_BUILD_TS_FILE\" \\\n\t\t--exclude='lib/libutil.so' \\\n\t\t-czf \"$TARBALL_ORIG\" .\n\n\t# Extract tar in order to massage it\n\tmkdir -p \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"\n\tcd \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"\n\ttar xf \"$TARBALL_ORIG\"\n\trm \"$TARBALL_ORIG\"\n}\n"
  },
  {
    "path": "scripts/build/termux_step_extract_package.sh",
    "content": "termux_step_extract_package() {\n\tif [ -z \"${TERMUX_PKG_SRCURL:=\"\"}\" ] || [ \"${TERMUX_PKG_SKIP_SRC_EXTRACT-false}\" = \"true\" ] || [ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ]; then\n\t\tmkdir -p \"$TERMUX_PKG_SRCDIR\"\n\t\treturn\n\tfi\n\tcd \"$TERMUX_PKG_TMPDIR\"\n\tlocal PKG_SRCURL=(${TERMUX_PKG_SRCURL[@]})\n\tlocal PKG_SHA256=(${TERMUX_PKG_SHA256[@]})\n\tif  [ ! ${#PKG_SRCURL[@]} == ${#PKG_SHA256[@]} ] && [ ! ${#PKG_SHA256[@]} == 0 ]; then\n\t\ttermux_error_exit \"Error: length of TERMUX_PKG_SRCURL isn't equal to length of TERMUX_PKG_SHA256.\"\n\tfi\n\t# STRIP=1 extracts archives straight into TERMUX_PKG_SRCDIR while STRIP=0 puts them in subfolders. zip has same behaviour per default\n\t# If this isn't desired then this can be fixed in termux_step_post_extract_package.\n\tlocal STRIP=1\n\tfor i in $(seq 0 $(( ${#PKG_SRCURL[@]}-1 ))); do\n\t\ttest \"$i\" -gt 0 && STRIP=0\n\t\tlocal filename\n\t\tfilename=$(basename \"${PKG_SRCURL[$i]}\")\n\t\tlocal file=\"$TERMUX_PKG_CACHEDIR/$filename\"\n\t\t# Allow TERMUX_PKG_SHA256 to be empty:\n\t\tset +u\n\t\ttermux_download \"${PKG_SRCURL[$i]}\" \"$file\" \"${PKG_SHA256[$i]}\"\n\t\tset -u\n\n\t\tlocal folder\n\t\tset +o pipefail\n\t\tif [ \"${file##*.}\" = zip ]; then\n\t\t\tfolder=$(unzip -qql \"$file\" | head -n1 | tr -s ' ' | cut -d' ' -f5-)\n\t\t\trm -Rf $folder\n\t\t\tunzip -q \"$file\"\n\t\t\tmv $folder \"$TERMUX_PKG_SRCDIR\"\n\t\telse\n\t\t\tmkdir -p \"$TERMUX_PKG_SRCDIR\"\n\t\t\ttar xf \"$file\" -C \"$TERMUX_PKG_SRCDIR\" --strip-components=$STRIP\n\t\tfi\n\t\tset -o pipefail\n\tdone\n}\n"
  },
  {
    "path": "scripts/build/termux_step_finish_build.sh",
    "content": "termux_step_finish_build() {\n\techo \"termux - build of '$TERMUX_PKG_NAME' done\"\n\ttest -t 1 && printf \"\\033]0;%s - DONE\\007\" \"$TERMUX_PKG_NAME\"\n\n\tmkdir -p \"$TERMUX_BUILT_PACKAGES_DIRECTORY\"\n\techo \"$TERMUX_PKG_FULLVERSION\" > \"$TERMUX_BUILT_PACKAGES_DIRECTORY/$TERMUX_PKG_NAME\"\n\n\texit 0\n}\n"
  },
  {
    "path": "scripts/build/termux_step_handle_buildarch.sh",
    "content": "termux_step_handle_buildarch() {\n\t[ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ] && return\n\n\t# If $TERMUX_PREFIX already exists, it may have been built for a different arch\n\tlocal TERMUX_ARCH_FILE=/data/TERMUX_ARCH\n\tif [ -f \"${TERMUX_ARCH_FILE}\" ]; then\n\t\tlocal TERMUX_PREVIOUS_ARCH\n\t\tTERMUX_PREVIOUS_ARCH=$(cat $TERMUX_ARCH_FILE)\n\t\tif [ \"$TERMUX_PREVIOUS_ARCH\" != \"$TERMUX_ARCH\" ]; then\n\t\t\tlocal TERMUX_DATA_BACKUPDIRS=$TERMUX_TOPDIR/_databackups\n\t\t\tmkdir -p \"$TERMUX_DATA_BACKUPDIRS\"\n\t\t\tlocal TERMUX_DATA_PREVIOUS_BACKUPDIR=$TERMUX_DATA_BACKUPDIRS/$TERMUX_PREVIOUS_ARCH\n\t\t\tlocal TERMUX_DATA_CURRENT_BACKUPDIR=$TERMUX_DATA_BACKUPDIRS/$TERMUX_ARCH\n\t\t\t# Save current /data (removing old backup if any)\n\t\t\tif test -e \"$TERMUX_DATA_PREVIOUS_BACKUPDIR\"; then\n\t\t\t\ttermux_error_exit \"Directory already exists\"\n\t\t\tfi\n\t\t\tif [ -d /data/data ]; then\n\t\t\t\tmv /data/data \"$TERMUX_DATA_PREVIOUS_BACKUPDIR\"\n\t\t\tfi\n\t\t\t# Restore new one (if any)\n\t\t\tif [ -d \"$TERMUX_DATA_CURRENT_BACKUPDIR\" ]; then\n\t\t\t\tmv \"$TERMUX_DATA_CURRENT_BACKUPDIR\" /data/data\n\t\t\tfi\n\t\tfi\n\tfi\n\n\t# Keep track of current arch we are building for.\n\techo \"$TERMUX_ARCH\" > $TERMUX_ARCH_FILE\n}\n"
  },
  {
    "path": "scripts/build/termux_step_handle_hostbuild.sh",
    "content": "termux_step_handle_hostbuild() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\t[ \"$TERMUX_PKG_HOSTBUILD\" = \"false\" ] && return\n\n\tcd \"$TERMUX_PKG_SRCDIR\"\n\tfor patch in $TERMUX_PKG_BUILDER_DIR/*.patch.beforehostbuild; do\n\t\ttest -f \"$patch\" && sed \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" \"$patch\" | patch --silent -p1\n\tdone\n\n\tlocal TERMUX_HOSTBUILD_MARKER=\"$TERMUX_PKG_HOSTBUILD_DIR/TERMUX_BUILT_FOR_$TERMUX_PKG_VERSION\"\n\tif [ ! -f \"$TERMUX_HOSTBUILD_MARKER\" ]; then\n\t\trm -Rf \"$TERMUX_PKG_HOSTBUILD_DIR\"\n\t\tmkdir -p \"$TERMUX_PKG_HOSTBUILD_DIR\"\n\t\tcd \"$TERMUX_PKG_HOSTBUILD_DIR\"\n\t\ttermux_step_host_build\n\t\ttouch \"$TERMUX_HOSTBUILD_MARKER\"\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/termux_step_host_build.sh",
    "content": "termux_step_host_build() {\n\t\"$TERMUX_PKG_SRCDIR/configure\" ${TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS}\n\tmake -j \"$TERMUX_MAKE_PROCESSES\"\n}\n"
  },
  {
    "path": "scripts/build/termux_step_install_license.sh",
    "content": "termux_step_install_license() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\tmkdir -p \"$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME\"\n\n\tif [ ! \"${TERMUX_PKG_LICENSE_FILE}\" = \"\" ]; then\n\t\tlocal LICENSE\n\t\tfor LICENSE in $TERMUX_PKG_LICENSE_FILE; do\n\t\t\tif [ ! -f \"$TERMUX_PKG_SRCDIR/$LICENSE\" ]; then\n\t\t\t\ttermux_error_exit \"$TERMUX_PKG_SRCDIR/$LICENSE does not exist\"\n\t\t\tfi\n\t\t\tcp -f \"${TERMUX_PKG_SRCDIR}/${LICENSE}\" \"${TERMUX_PREFIX}/share/doc/${TERMUX_PKG_NAME}\"/\n\t\tdone\n\telse\n\t\tlocal COUNTER=0\n\t\tlocal LICENSE\n\t\twhile read -r LICENSE; do\n\t\t\tif [ -f \"$TERMUX_SCRIPTDIR/packages/termux-licenses/LICENSES/${LICENSE}.txt\" ]; then\n\t\t\t\tif [[ $COUNTER -gt 0 ]]; then\n\t\t\t\t\tln -sf \"../../LICENSES/${LICENSE}.txt\" \"$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/LICENSE.${COUNTER}\"\n\t\t\t\telse\n\t\t\t\t\tln -sf \"../../LICENSES/${LICENSE}.txt\" \"$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/LICENSE\"\n\t\t\t\tfi\n\t\t\tfi\n\t\t\tCOUNTER=$((COUNTER + 1))\n\t\tdone < <(echo \"$TERMUX_PKG_LICENSE\" | sed \"s/,/\\n/g\")\n\n\t\tfor LICENSE in \"$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME\"/LICENSE*; do\n\t\t\tif [ \"$LICENSE\" = \"$TERMUX_PREFIX/share/doc/$TERMUX_PKG_NAME/LICENSE*\" ]; then\n\t\t\t\ttermux_error_exit \"No LICENSE file was installed for $TERMUX_PKG_NAME\"\n\t\t\tfi\n\t\tdone\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/termux_step_make.sh",
    "content": "termux_step_make() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\tlocal QUIET_BUILD=\n\tif [ \"$TERMUX_QUIET_BUILD\" = true ]; then\n\t\tQUIET_BUILD=\"-s\"\n\tfi\n\n\tif test -f build.ninja; then\n\t\tninja -w dupbuild=warn -j $TERMUX_MAKE_PROCESSES\n\telif ls ./*akefile &> /dev/null || [ ! -z \"$TERMUX_PKG_EXTRA_MAKE_ARGS\" ]; then\n\t\tif [ -z \"$TERMUX_PKG_EXTRA_MAKE_ARGS\" ]; then\n\t\t\tmake -j $TERMUX_MAKE_PROCESSES $QUIET_BUILD\n\t\telse\n\t\t\tmake -j $TERMUX_MAKE_PROCESSES $QUIET_BUILD ${TERMUX_PKG_EXTRA_MAKE_ARGS}\n\t\tfi\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/termux_step_make_install.sh",
    "content": "termux_step_make_install() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\tif test -f build.ninja; then\n\t\tninja -w dupbuild=warn -j $TERMUX_MAKE_PROCESSES install\n\telif ls ./*akefile &> /dev/null || [ -n \"$TERMUX_PKG_EXTRA_MAKE_ARGS\" ]; then\n\t\t: \"${TERMUX_PKG_MAKE_INSTALL_TARGET:=\"install\"}\"\n\t\t# Some packages have problem with parallell install, and it does not buy much, so use -j 1.\n\t\tif [ -z \"$TERMUX_PKG_EXTRA_MAKE_ARGS\" ]; then\n\t\t\tmake -j 1 ${TERMUX_PKG_MAKE_INSTALL_TARGET}\n\t\telse\n\t\t\tmake -j 1 ${TERMUX_PKG_EXTRA_MAKE_ARGS} ${TERMUX_PKG_MAKE_INSTALL_TARGET}\n\t\tfi\n\telif test -f Cargo.toml; then\n\t\ttermux_setup_rust\n\t\tcargo install \\\n\t\t\t--jobs $TERMUX_MAKE_PROCESSES \\\n\t\t\t--path . \\\n\t\t\t--force \\\n\t\t\t--target $CARGO_TARGET_NAME \\\n\t\t\t--root $TERMUX_PREFIX \\\n\t\t\t$TERMUX_PKG_EXTRA_CONFIGURE_ARGS\n\t\t# https://github.com/rust-lang/cargo/issues/3316:\n\t\trm $TERMUX_PREFIX/.crates.toml\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/termux_step_massage.sh",
    "content": "termux_step_massage() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\tcd \"$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX\"\n\n\t# Remove lib/charset.alias which is installed by gettext-using packages:\n\trm -f lib/charset.alias\n\n\t# Remove locale files we're not interested in::\n\trm -Rf share/locale\n\n\t# Remove old kept libraries (readline):\n\tfind . -name '*.old' -print0 | xargs -0 -r rm -f\n\n\t# Move over sbin to bin:\n\tfor file in sbin/*; do if test -f \"$file\"; then mv \"$file\" bin/; fi; done\n\n\t# Remove world permissions and make sure that user still have read-write permissions.\n\tchmod -Rf u+rw,g-rwx,o-rwx . || true\n\n\tif [ \"$TERMUX_DEBUG\" = \"false\" ]; then\n\t\t# Strip binaries. file(1) may fail for certain unusual files, so disable pipefail.\n\t\tset +e +o pipefail\n\t\tfind . \\( -path \"./bin/*\" -o -path \"./lib/*\" -o -path \"./libexec/*\" \\) -type f | \\\n\t\t\txargs -r file | grep -E \"ELF .+ (executable|shared object)\" | cut -f 1 -d : | \\\n\t\t\t\txargs -r \"$STRIP\" --strip-unneeded --preserve-dates\n\t\tset -e -o pipefail\n\tfi\n\n\t# Remove entries unsupported by Android's linker:\n\tfind . \\( -path \"./bin/*\" -o -path \"./lib/*\" -o -path \"./libexec/*\" \\) -type f -print0 | xargs -r -0 \"$TERMUX_ELF_CLEANER\"\n\n\t# Fix shebang paths:\n\twhile IFS= read -r -d '' file\n\tdo\n\t\thead -c 100 \"$file\" | grep -E \"^#\\!.*\\\\/bin\\\\/.*\" | grep -q -E -v \"^#\\! ?\\\\/system\" && \\\n\t\t\tsed --follow-symlinks -i -E \"1 s@^#\\!(.*)/bin/(.*)@#\\!$TERMUX_PREFIX/bin/\\2@\" \"$file\"\n\tdone < <(find -L . -type f -print0)\n\n\ttest ! -z \"$TERMUX_PKG_RM_AFTER_INSTALL\" && rm -Rf $TERMUX_PKG_RM_AFTER_INSTALL\n\n\tfind . -type d -empty -delete # Remove empty directories\n\n\tif [ -d share/man ]; then\n\t\t# Remove non-english man pages:\n\t\tfind share/man -mindepth 1 -maxdepth 1 -type d ! -name man\\* | xargs -r rm -rf\n\n\t\t# Compress man pages with gzip:\n\t\tfind share/man -type f ! -iname \\*.gz -print0 | xargs -r -0 gzip\n\n\t\t# Update man page symlinks, e.g. unzstd.1 -> zstd.1:\n\t\twhile IFS= read -r -d '' file\n\t\tdo\n\t\t\tlocal _link_value\n\t\t\t_link_value=$(readlink $file)\n\t\t\trm $file\n\t\t\tln -s $_link_value.gz $file.gz\n\t\tdone < <(find share/man -type l ! -iname \\*.gz -print0)\n\tfi\n\n\ttermux_create_subpackages\n\n\t# .. remove empty directories (NOTE: keep this last):\n\tfind . -type d -empty -delete\n}\n"
  },
  {
    "path": "scripts/build/termux_step_patch_package.sh",
    "content": "termux_step_patch_package() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\tcd \"$TERMUX_PKG_SRCDIR\"\n\tlocal DEBUG_PATCHES=\"\"\n\tif [ \"$TERMUX_DEBUG\" = \"true\" ]; then\n\t\tDEBUG_PATCHES=$(find $TERMUX_PKG_BUILDER_DIR -mindepth 1 -maxdepth 1 -name \\*.patch.debug)\n\tfi\n\t# Suffix patch with \".patch32\" or \".patch64\" to only apply for these bitnesses:\n\tshopt -s nullglob\n\tfor patch in $TERMUX_PKG_BUILDER_DIR/*.patch{$TERMUX_ARCH_BITS,} $DEBUG_PATCHES; do\n\t\ttest -f \"$patch\" && sed \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" \"$patch\" | \\\n\t\t\tsed \"s%\\@TERMUX_HOME\\@%${TERMUX_ANDROID_HOME}%g\" | \\\n\t\t\tpatch --silent -p1\n\tdone\n\tshopt -u nullglob\n}\n"
  },
  {
    "path": "scripts/build/termux_step_replace_guess_scripts.sh",
    "content": "termux_step_replace_guess_scripts() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\tcd \"$TERMUX_PKG_SRCDIR\"\n\tfind . -name config.sub -exec chmod u+w '{}' \\; -exec cp \"$TERMUX_SCRIPTDIR/scripts/config.sub\" '{}' \\;\n\tfind . -name config.guess -exec chmod u+w '{}' \\; -exec cp \"$TERMUX_SCRIPTDIR/scripts/config.guess\" '{}' \\;\n}\n"
  },
  {
    "path": "scripts/build/termux_step_setup_toolchain.sh",
    "content": "termux_step_setup_toolchain() {\n\t[ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] && return\n\n\texport CFLAGS=\"\"\n\texport LDFLAGS=\"-L${TERMUX_PREFIX}/lib\"\n\n\texport AS=$TERMUX_HOST_PLATFORM-clang\n\texport CC=$TERMUX_HOST_PLATFORM-clang\n\texport CXX=$TERMUX_HOST_PLATFORM-clang++\n\texport AR=$TERMUX_HOST_PLATFORM-ar\n\texport CPP=$TERMUX_HOST_PLATFORM-cpp\n\texport LD=$TERMUX_HOST_PLATFORM-ld\n\texport OBJCOPY=$TERMUX_HOST_PLATFORM-objcopy\n\texport OBJDUMP=$TERMUX_HOST_PLATFORM-objdump\n\texport RANLIB=$TERMUX_HOST_PLATFORM-ranlib\n\texport READELF=$TERMUX_HOST_PLATFORM-readelf\n\texport STRIP=$TERMUX_HOST_PLATFORM-strip\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\texport PATH=$TERMUX_STANDALONE_TOOLCHAIN/bin:$PATH\n\t\texport CC_FOR_BUILD=gcc\n\t\texport PKG_CONFIG=$TERMUX_STANDALONE_TOOLCHAIN/bin/${TERMUX_HOST_PLATFORM}-pkg-config\n\t\texport CCTERMUX_HOST_PLATFORM=$TERMUX_HOST_PLATFORM$TERMUX_PKG_API_LEVEL\n\t\tif [ $TERMUX_ARCH = arm ]; then\n\t\t\tCCTERMUX_HOST_PLATFORM=armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL\n\t\tfi\n\telse\n\t\texport CC_FOR_BUILD=$CC\n\t\t# Some build scripts use environment variable 'PKG_CONFIG', so\n\t\t# using this for on-device builds too.\n\t\texport PKG_CONFIG=pkg-config\n\tfi\n\n\tif [ \"$TERMUX_ARCH\" = \"arm\" ]; then\n\t\t# https://developer.android.com/ndk/guides/standalone_toolchain.html#abi_compatibility:\n\t\t# \"We recommend using the -mthumb compiler flag to force the generation of 16-bit Thumb-2 instructions\".\n\t\t# With r13 of the ndk ruby 2.4.0 segfaults when built on arm with clang without -mthumb.\n\t\tCFLAGS+=\" -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb\"\n\t\tLDFLAGS+=\" -march=armv7-a\"\n\telif [ \"$TERMUX_ARCH\" = \"i686\" ]; then\n\t\t# From $NDK/docs/CPU-ARCH-ABIS.html:\n\t\tCFLAGS+=\" -march=i686 -msse3 -mstackrealign -mfpmath=sse\"\n\telif [ \"$TERMUX_ARCH\" = \"aarch64\" ]; then\n\t\t:\n\telif [ \"$TERMUX_ARCH\" = \"x86_64\" ]; then\n\t\t:\n\telse\n\t\ttermux_error_exit \"Invalid arch '$TERMUX_ARCH' - support arches are 'arm', 'i686', 'aarch64', 'x86_64'\"\n\tfi\n\n\t# Android 7 started to support DT_RUNPATH (but not DT_RPATH).\n\tLDFLAGS+=\" -Wl,-rpath=$TERMUX_PREFIX/lib,--enable-new-dtags\"\n\n\t# Avoid linking extra (unneeded) libraries.\n\tLDFLAGS+=\" -Wl,--as-needed\"\n\n\t# Basic hardening.\n\tCFLAGS+=\" -fstack-protector-strong\"\n\tLDFLAGS+=\" -Wl,-z,relro,-z,now\"\n\n\tif [ \"$TERMUX_DEBUG\" = \"true\" ]; then\n\t\tCFLAGS+=\" -g3 -O1 -D_FORTIFY_SOURCE=2\"\n\telse\n\t\tCFLAGS+=\" -Oz\"\n\tfi\n\n\texport CXXFLAGS=\"$CFLAGS\"\n\texport CPPFLAGS=\"-I${TERMUX_PREFIX}/include\"\n\n\t# If libandroid-support is declared as a dependency, link to it explicitly:\n\tif [ \"$TERMUX_PKG_DEPENDS\" != \"${TERMUX_PKG_DEPENDS/libandroid-support/}\" ]; then\n\t\tLDFLAGS+=\" -landroid-support\"\n\tfi\n\n\texport ac_cv_func_getpwent=no\n\texport ac_cv_func_getpwnam=no\n\texport ac_cv_func_getpwuid=no\n\texport ac_cv_func_sigsetmask=no\n\texport ac_cv_c_bigendian=no\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ] && [ ! -d $TERMUX_STANDALONE_TOOLCHAIN ]; then\n\t\t# Do not put toolchain in place until we are done with setup, to avoid having a half setup\n\t\t# toolchain left in place if something goes wrong (or process is just aborted):\n\t\tlocal _TERMUX_TOOLCHAIN_TMPDIR=${TERMUX_STANDALONE_TOOLCHAIN}-tmp\n\t\trm -Rf $_TERMUX_TOOLCHAIN_TMPDIR\n\n\t\tlocal _NDK_ARCHNAME=$TERMUX_ARCH\n\t\tif [ \"$TERMUX_ARCH\" = \"aarch64\" ]; then\n\t\t\t_NDK_ARCHNAME=arm64\n\t\telif [ \"$TERMUX_ARCH\" = \"i686\" ]; then\n\t\t\t_NDK_ARCHNAME=x86\n\t\tfi\n\t\tcp $NDK/toolchains/llvm/prebuilt/linux-x86_64 $_TERMUX_TOOLCHAIN_TMPDIR -r\n\n\t\t# Remove android-support header wrapping not needed on android-21:\n\t\trm -Rf $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/local\n\n\t\t# Use gold by default to work around https://github.com/android-ndk/ndk/issues/148\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld.gold \\\n\t\t    $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld.gold \\\n\t\t    $_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld\n\n\t\t\t# Linker wrapper script to add '--exclude-libs libgcc.a', see\n\t\t\t# https://github.com/android-ndk/ndk/issues/379\n\t\t\t# https://android-review.googlesource.com/#/c/389852/\n\t\t\tlocal linker\n\t\t\tfor linker in ld ld.bfd ld.gold; do\n\t\t\t\tlocal wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker\n\t\t\t\tlocal real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker.real\n\t\t\t\tcp $wrap_linker $real_linker\n\t\t\t\techo '#!/bin/bash' > $wrap_linker\n\t\t\t\techo -n '$(dirname $0)/' >> $wrap_linker\n\t\t\t\techo -n $linker.real >> $wrap_linker\n\t\t\t\techo ' --exclude-libs libunwind.a --exclude-libs libgcc_real.a \"$@\"' >> $wrap_linker\n\t\t\tdone\n\t\tfor HOST_PLAT in aarch64-linux-android armv7a-linux-androideabi i686-linux-android x86_64-linux-android; do\n\n\t\t# Setup the cpp preprocessor:\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang++ \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp\n\t\tsed -i 's/clang/clang -E/' \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-gcc\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++ \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-gcc\n\t\tdone\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL-clang \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL-clang++ \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang++\n\t\tcp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi-cpp \\\n\t\t   $_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-cpp\n\n\t\tcd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot\n\t\tfor f in $TERMUX_SCRIPTDIR/ndk-patches/*.patch; do\n\t\t\tsed \"s%\\@TERMUX_PREFIX\\@%${TERMUX_PREFIX}%g\" \"$f\" | \\\n\t\t\t\tsed \"s%\\@TERMUX_HOME\\@%${TERMUX_ANDROID_HOME}%g\" | \\\n\t\t\t\tpatch --silent -p1;\n\t\tdone\n\t\t# ifaddrs.h: Added in android-24 unified headers, use a inline implementation for now.\n\t\t# libintl.h: Inline implementation gettext functions.\n\t\t# langinfo.h: Inline implementation of nl_langinfo().\n\t\tcp \"$TERMUX_SCRIPTDIR\"/ndk-patches/{ifaddrs.h,libintl.h,langinfo.h} usr/include\n\n\t\t# Remove <sys/capability.h> because it is provided by libcap.\n\t\t# Remove <sys/shm.h> from the NDK in favour of that from the libandroid-shmem.\n\t\t# Remove <sys/sem.h> as it doesn't work for non-root.\n\t\t# Remove <glob.h> as we currently provide it from libandroid-glob.\n\t\t# Remove <iconv.h> as it's provided by libiconv.\n\t\t# Remove <spawn.h> as it's only for future (later than android-27).\n\t\t# Remove <zlib.h> and <zconf.h> as we build our own zlib\n\t\trm usr/include/sys/{capability.h,shm.h,sem.h} usr/include/{glob.h,iconv.h,spawn.h,zlib.h,zconf.h}\n\n\t\tsed -i \"s/define __ANDROID_API__ __ANDROID_API_FUTURE__/define __ANDROID_API__ $TERMUX_PKG_API_LEVEL/\" \\\n\t\t\tusr/include/android/api-level.h\n\n\t\t$TERMUX_ELF_CLEANER usr/lib/*/*/*.so\n\n\t\tgrep -lrw $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/c++/v1 -e '<version>'   | xargs -n 1 sed -i 's/<version>/\\\"version\\\"/g'\n\t\tmv $_TERMUX_TOOLCHAIN_TMPDIR $TERMUX_STANDALONE_TOOLCHAIN\n\tfi\n\n\t# On Android 7, libutil functionality is provided by libc.\n\t# But many programs still may search for libutil.\n\tif [ ! -f $TERMUX_PREFIX/lib/libutil.so ]; then\n\t\tmkdir -p \"$TERMUX_PREFIX/lib\"\n\t\techo 'INPUT(-lc)' > $TERMUX_PREFIX/lib/libutil.so\n\tfi\n\n\texport PKG_CONFIG_LIBDIR=\"$TERMUX_PKG_CONFIG_LIBDIR\"\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\t# Create a pkg-config wrapper. We use path to host pkg-config to\n\t\t# avoid picking up a cross-compiled pkg-config later on.\n\t\tlocal _HOST_PKGCONFIG\n\t\t_HOST_PKGCONFIG=$(which pkg-config)\n\t\tmkdir -p $TERMUX_STANDALONE_TOOLCHAIN/bin \"$PKG_CONFIG_LIBDIR\"\n\t\tcat > \"$PKG_CONFIG\" <<-HERE\n\t\t\t#!/bin/sh\n\t\t\texport PKG_CONFIG_DIR=\n\t\t\texport PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR\n\t\t\texec $_HOST_PKGCONFIG \"\\$@\"\n\t\tHERE\n\t\tchmod +x \"$PKG_CONFIG\"\n\tfi\n}\n"
  },
  {
    "path": "scripts/build/termux_step_setup_variables.sh",
    "content": "termux_step_setup_variables() {\n\t: \"${TERMUX_MAKE_PROCESSES:=\"$(nproc)\"}\"\n\t: \"${TERMUX_TOPDIR:=\"$HOME/.termux-build\"}\"\n\t: \"${TERMUX_ARCH:=\"aarch64\"}\" # arm, aarch64, i686 or x86_64.\n\t: \"${TERMUX_PREFIX:=\"/data/data/com.termux/files/usr\"}\"\n\t: \"${TERMUX_ANDROID_HOME:=\"/data/data/com.termux/files/home\"}\"\n\t: \"${TERMUX_DEBUG:=\"false\"}\"\n\t: \"${TERMUX_PKG_API_LEVEL:=\"24\"}\"\n\t: \"${TERMUX_NO_CLEAN:=\"false\"}\"\n\t: \"${TERMUX_QUIET_BUILD:=\"false\"}\"\n\t: \"${TERMUX_DEBDIR:=\"${TERMUX_SCRIPTDIR}/debs\"}\"\n\t: \"${TERMUX_SKIP_DEPCHECK:=\"false\"}\"\n\t: \"${TERMUX_INSTALL_DEPS:=\"false\"}\"\n\t: \"${TERMUX_FORCE_BUILD:=\"false\"}\"\n\t: \"${TERMUX_PACKAGES_DIRECTORIES:=\"packages\"}\"\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ]; then\n\t\t# For on-device builds cross-compiling is not supported so we can\n\t\t# store information about built packages under $TERMUX_TOPDIR.\n\t\tTERMUX_BUILT_PACKAGES_DIRECTORY=\"$TERMUX_TOPDIR/.built-packages\"\n\n\t\t# These variables should not be configurable for on-device builds.\n\t\t# TERMUX_ARCH already set in build-package.sh\n\t\tTERMUX_PREFIX=\"/data/data/com.termux/files/usr\"\n\t\tTERMUX_ANDROID_HOME=\"/data/data/com.termux/files/home\"\n\t\tTERMUX_NO_CLEAN=\"true\"\n\n\t\t# On device builds are considered as unofficial.\n\t\t# Using device-specific value as default for maintainer field.\n\t\t: \"${TERMUX_PKG_MAINTAINER:=\"Termux ($(whoami))\"}\"\n\n\t\t# On-device builds without termux-exec are unsupported.\n\t\tif ! grep -q \"${TERMUX_PREFIX}/lib/libtermux-exec.so\" <<< \"${LD_PRELOAD-x}\"; then\n\t\t\ttermux_error_exit \"On-device builds without termux-exec are not supported.\"\n\t\tfi\n\telse\n\t\tTERMUX_BUILT_PACKAGES_DIRECTORY=\"/data/data/.built-packages\"\n\t\t: \"${TERMUX_PKG_MAINTAINER:=\"Fredrik Fornwall @fornwall\"}\"\n\tfi\n\n\tTERMUX_REPO_URL=(\n\t\thttps://dl.bintray.com/termux/termux-packages-24\n\t\thttps://dl.bintray.com/grimler/game-packages-24\n\t\thttps://dl.bintray.com/grimler/science-packages-24\n\t\thttps://dl.bintray.com/grimler/termux-root-packages-24\n\t\thttps://dl.bintray.com/xeffyr/unstable-packages\n\t\thttps://dl.bintray.com/xeffyr/x11-packages\n\t)\n\n\tTERMUX_REPO_DISTRIBUTION=(\n\t\tstable\n\t\tgames\n\t\tscience\n\t\troot\n\t\tunstable\n\t\tx11\n\t)\n\n\tTERMUX_REPO_COMPONENT=(\n\t\tmain\n\t\tstable\n\t\tstable\n\t\tstable\n\t\tmain\n\t\tmain\n\t)\n\n\tif [ \"x86_64\" = \"$TERMUX_ARCH\" ] || [ \"aarch64\" = \"$TERMUX_ARCH\" ]; then\n\t\tTERMUX_ARCH_BITS=64\n\telse\n\t\tTERMUX_ARCH_BITS=32\n\tfi\n\n\tTERMUX_HOST_PLATFORM=\"${TERMUX_ARCH}-linux-android\"\n\tif [ \"$TERMUX_ARCH\" = \"arm\" ]; then TERMUX_HOST_PLATFORM=\"${TERMUX_HOST_PLATFORM}eabi\"; fi\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ] && [ ! -d \"$NDK\" ]; then\n\t\ttermux_error_exit 'NDK not pointing at a directory!'\n\tfi\n\n\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ] && ! grep -s -q \"Pkg.Revision = $TERMUX_NDK_VERSION_NUM\" \"$NDK/source.properties\"; then\n\t\ttermux_error_exit \"Wrong NDK version - we need $TERMUX_NDK_VERSION\"\n\tfi\n\n\t# The build tuple that may be given to --build configure flag:\n\tTERMUX_BUILD_TUPLE=$(sh \"$TERMUX_SCRIPTDIR/scripts/config.guess\")\n\n\t# We do not put all of build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/ into PATH\n\t# to avoid stuff like arm-linux-androideabi-ld there to conflict with ones from\n\t# the standalone toolchain.\n\tTERMUX_D8=$ANDROID_HOME/build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/d8\n\n\tTERMUX_COMMON_CACHEDIR=\"$TERMUX_TOPDIR/_cache\"\n\tTERMUX_ELF_CLEANER=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner\n\n\texport prefix=${TERMUX_PREFIX}\n\texport PREFIX=${TERMUX_PREFIX}\n\n\tTERMUX_PKG_BUILDDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/build\n\tTERMUX_PKG_CACHEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/cache\n\tTERMUX_PKG_MASSAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/massage\n\tTERMUX_PKG_PACKAGEDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/package\n\tTERMUX_PKG_SRCDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/src\n\tTERMUX_PKG_SHA256=\"\"\n\tTERMUX_PKG_TMPDIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/tmp\n\tTERMUX_PKG_HOSTBUILD_DIR=$TERMUX_TOPDIR/$TERMUX_PKG_NAME/host-build\n\tTERMUX_PKG_PLATFORM_INDEPENDENT=false\n\tTERMUX_PKG_NO_STATICSPLIT=false\n\tTERMUX_PKG_REVISION=\"0\" # http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version\n\tTERMUX_PKG_EXTRA_CONFIGURE_ARGS=\"\"\n\tTERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS=\"\"\n\tTERMUX_PKG_EXTRA_MAKE_ARGS=\"\"\n\tTERMUX_PKG_BUILD_IN_SRC=false\n\tTERMUX_PKG_RM_AFTER_INSTALL=\"\"\n\tTERMUX_PKG_BREAKS=\"\" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps\n\tTERMUX_PKG_PRE_DEPENDS=\"\"\n\tTERMUX_PKG_DEPENDS=\"\"\n\tTERMUX_PKG_BUILD_DEPENDS=\"\"\n\tTERMUX_PKG_HOMEPAGE=\"\"\n\tTERMUX_PKG_DESCRIPTION=\"FIXME:Add description\"\n\tTERMUX_PKG_LICENSE_FILE=\"\" # Relative path from $TERMUX_PKG_SRCDIR to LICENSE file. It is installed to $TERMUX_PREFIX/share/$TERMUX_PKG_NAME.\n\tTERMUX_PKG_ESSENTIAL=false\n\tTERMUX_PKG_CONFLICTS=\"\" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts\n\tTERMUX_PKG_RECOMMENDS=\"\" # https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps\n\tTERMUX_PKG_SUGGESTS=\"\"\n\tTERMUX_PKG_REPLACES=\"\"\n\tTERMUX_PKG_PROVIDES=\"\" #https://www.debian.org/doc/debian-policy/#virtual-packages-provides\n\tTERMUX_PKG_CONFFILES=\"\"\n\t# Set if a host build should be done in TERMUX_PKG_HOSTBUILD_DIR:\n\tTERMUX_PKG_HOSTBUILD=false\n\tTERMUX_PKG_FORCE_CMAKE=false # if the package has autotools as well as cmake, then set this to prefer cmake\n\tTERMUX_CMAKE_BUILD=Ninja # Which cmake generator to use\n\tTERMUX_PKG_HAS_DEBUG=true # set to false if debug build doesn't exist or doesn't work, for example for python based packages\n\tTERMUX_PKG_METAPACKAGE=false\n\n\tunset CFLAGS CPPFLAGS LDFLAGS CXXFLAGS\n}\n"
  },
  {
    "path": "scripts/build/termux_step_start_build.sh",
    "content": "termux_step_start_build() {\n\t# shellcheck source=/dev/null\n\tsource \"$TERMUX_PKG_BUILDER_SCRIPT\"\n\n\tif [ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ]; then\n\t\t# Metapackage has no sources and therefore platform-independent.\n\t\tTERMUX_PKG_SKIP_SRC_EXTRACT=true\n\t\tTERMUX_PKG_PLATFORM_INDEPENDENT=true\n\tfi\n\n\tTERMUX_STANDALONE_TOOLCHAIN=\"$TERMUX_COMMON_CACHEDIR/android-r${TERMUX_NDK_VERSION}-api-${TERMUX_PKG_API_LEVEL}\"\n\t# Bump the below version if a change is made in toolchain setup to ensure\n\t# that everyone gets an updated toolchain:\n\tTERMUX_STANDALONE_TOOLCHAIN+=\"-v2\"\n\n\tif [ -n \"${TERMUX_PKG_BLACKLISTED_ARCHES:=\"\"}\" ] && [ \"$TERMUX_PKG_BLACKLISTED_ARCHES\" != \"${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}\" ]; then\n\t\techo \"Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH\"\n\t\texit 0\n\tfi\n\n\tTERMUX_PKG_FULLVERSION=$TERMUX_PKG_VERSION\n\tif [ \"$TERMUX_PKG_REVISION\" != \"0\" ] || [ \"$TERMUX_PKG_FULLVERSION\" != \"${TERMUX_PKG_FULLVERSION/-/}\" ]; then\n\t\t# \"0\" is the default revision, so only include it if the upstream versions contains \"-\" itself\n\t\tTERMUX_PKG_FULLVERSION+=\"-$TERMUX_PKG_REVISION\"\n\tfi\n\n\tif [ \"$TERMUX_DEBUG\" = \"true\" ]; then\n\t\tif [ \"$TERMUX_PKG_HAS_DEBUG\" = \"true\" ]; then\n\t\t\tDEBUG=\"-dbg\"\n\t\telse\n\t\t\techo \"Skipping building debug build for $TERMUX_PKG_NAME\"\n\t\t\texit 0\n\t\tfi\n\telse\n\t\tDEBUG=\"\"\n\tfi\n\n\tif [ \"$TERMUX_DEBUG\" = \"false\" ] && [ \"$TERMUX_FORCE_BUILD\" = \"false\" ]; then\n\t\tif [ -e \"$TERMUX_BUILT_PACKAGES_DIRECTORY/$TERMUX_PKG_NAME\" ] &&\n\t\t   [ \"$(cat \"$TERMUX_BUILT_PACKAGES_DIRECTORY/$TERMUX_PKG_NAME\")\" = \"$TERMUX_PKG_FULLVERSION\" ]; then\n\t\t\techo \"$TERMUX_PKG_NAME@$TERMUX_PKG_FULLVERSION built - skipping (rm $TERMUX_BUILT_PACKAGES_DIRECTORY/$TERMUX_PKG_NAME to force rebuild)\"\n\t\t\texit 0\n\t\telif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ] &&\n\t\t     [ \"$(dpkg-query -W -f '${db:Status-Status} ${Version}\\n' \"$TERMUX_PKG_NAME\" 2>/dev/null)\" = \"installed $TERMUX_PKG_FULLVERSION\" ]; then\n\t\t\techo \"$TERMUX_PKG_NAME@$TERMUX_PKG_FULLVERSION installed - skipping\"\n\t\t\texit 0\n\t\tfi\n\tfi\n\n\tif [ \"$TERMUX_SKIP_DEPCHECK\" = false ] && [ \"$TERMUX_INSTALL_DEPS\" = true ] && [ \"$TERMUX_PKG_METAPACKAGE\" = \"false\" ]; then\n\t\t# Download repo files\n\t\ttermux_get_repo_files\n\n\t\t# When doing build on device, ensure that apt lists are up-to-date.\n\t\t[ \"$TERMUX_ON_DEVICE_BUILD\" = \"true\" ] && apt update\n\n\t\t# Download dependencies\n\t\twhile read PKG PKG_DIR; do\n\t\t\tif [ -z $PKG ]; then\n\t\t\t\tcontinue\n\t\t\telif [ \"$PKG\" = \"ERROR\" ]; then\n\t\t\t\ttermux_error_exit \"Obtaining buildorder failed\"\n\t\t\tfi\n\t\t\t# llvm doesn't build if ndk-sysroot is installed:\n\t\t\tif [ \"$PKG\" = \"ndk-sysroot\" ]; then continue; fi\n\t\t\tread DEP_ARCH DEP_VERSION <<< $(termux_extract_dep_info $PKG \"${PKG_DIR}\")\n\n\t\t\tif [ ! \"$TERMUX_QUIET_BUILD\" = true ]; then\n\t\t\t\techo \"Downloading dependency $PKG@$DEP_VERSION if necessary...\"\n\t\t\tfi\n\n\t\t\tif [ -e \"$TERMUX_BUILT_PACKAGES_DIRECTORY/$PKG\" ]; then\n\t\t\t\tif [ \"$(cat \"$TERMUX_BUILT_PACKAGES_DIRECTORY/$PKG\")\" = \"$DEP_VERSION\" ]; then\n\t\t\t\t\tcontinue\n\t\t\t\tfi\n\t\t\tfi\n\n\t\t\tif ! termux_download_deb $PKG $DEP_ARCH $DEP_VERSION; then\n\t\t\t\techo \"Download of $PKG@$DEP_VERSION from $TERMUX_REPO_URL failed, building instead\"\n\t\t\t\tTERMUX_BUILD_IGNORE_LOCK=true ./build-package.sh -I \"${PKG_DIR}\"\n\t\t\t\tcontinue\n\t\t\telse\n\t\t\t\tif [ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ]; then\n\t\t\t\t\tif [ ! \"$TERMUX_QUIET_BUILD\" = true ]; then echo \"extracting $PKG...\"; fi\n\t\t\t\t\t(\n\t\t\t\t\t\tcd $TERMUX_COMMON_CACHEDIR-$DEP_ARCH\n\t\t\t\t\t\tar x ${PKG}_${DEP_VERSION}_${DEP_ARCH}.deb data.tar.xz\n\t\t\t\t\t\ttar -xf data.tar.xz --no-overwrite-dir -C /\n\t\t\t\t\t)\n\t\t\t\tfi\n\t\t\tfi\n\n\t\t\tmkdir -p $TERMUX_BUILT_PACKAGES_DIRECTORY\n\t\t\techo \"$DEP_VERSION\" > \"$TERMUX_BUILT_PACKAGES_DIRECTORY/$PKG\"\n\t\tdone<<<$(./scripts/buildorder.py -i \"$TERMUX_PKG_BUILDER_DIR\" $TERMUX_PACKAGES_DIRECTORIES || echo \"ERROR\")\n\telif [ \"$TERMUX_SKIP_DEPCHECK\" = false ] && [ \"$TERMUX_INSTALL_DEPS\" = false ] && [ \"$TERMUX_PKG_METAPACKAGE\" = \"false\" ]; then\n\t\t# Build dependencies\n\t\twhile read PKG PKG_DIR; do\n\t\t\tif [ -z $PKG ]; then\n\t\t\t\tcontinue\n\t\t\telif [ \"$PKG\" = \"ERROR\" ]; then\n\t\t\t\ttermux_error_exit \"Obtaining buildorder failed\"\n\t\t\tfi\n\t\t\techo \"Building dependency $PKG if necessary...\"\n\t\t\t# Built dependencies are put in the default TERMUX_DEBDIR instead of the specified one\n\t\t\tTERMUX_BUILD_IGNORE_LOCK=true ./build-package.sh -s \"${PKG_DIR}\"\n\t\tdone<<<$(./scripts/buildorder.py \"$TERMUX_PKG_BUILDER_DIR\" $TERMUX_PACKAGES_DIRECTORIES || echo \"ERROR\")\n\tfi\n\tif [ \"$TERMUX_INSTALL_DEPS\" == true ]  && [ \"$TERMUX_PKG_DEPENDS\" !=  \"${TERMUX_PKG_DEPENDS/libllvm/}\" ]; then\n                LLVM_DEFAULT_TARGET_TRIPLE=$TERMUX_HOST_PLATFORM\n        if [ $TERMUX_ARCH = \"arm\" ]; then\n                LLVM_TARGET_ARCH=ARM\n        elif [ $TERMUX_ARCH = \"aarch64\" ]; then\n                LLVM_TARGET_ARCH=AArch64\n        elif [ $TERMUX_ARCH = \"i686\" ]; then\n                 LLVM_TARGET_ARCH=X86\n        elif [ $TERMUX_ARCH = \"x86_64\" ]; then\n                LLVM_TARGET_ARCH=X86\n        fi\n        LIBLLVM_VERSION=$(grep  \"TERMUX_PKG_VERSION=\"  $TERMUX_SCRIPTDIR/packages/libllvm/build.sh | cut -c20- )\n\t\techo \"$LIBLLVM_VERSION\"\n                        sed $TERMUX_SCRIPTDIR/packages/libllvm/llvm-config.in \\\n                        -e \"s|@TERMUX_PKG_VERSION@|$LIBLLVM_VERSION|g\" \\\n                        -e \"s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g\" \\\n                        -e \"s|@TERMUX_PKG_SRCDIR@|$TERMUX_TOPDIR/libllvm/src|g\" \\\n                        -e \"s|@LLVM_TARGET_ARCH@|$LLVM_TARGET_ARCH|g\" \\\n                        -e \"s|@LLVM_DEFAULT_TARGET_TRIPLE@|$LLVM_DEFAULT_TARGET_TRIPLE|g\" \\\n                        -e \"s|@TERMUX_ARCH@|$TERMUX_ARCH|g\" > $TERMUX_PREFIX/bin/llvm-config\n                        chmod 755 $TERMUX_PREFIX/bin/llvm-config\n\tfi\n\t# Following directories may contain files with read-only permissions which\n\t# makes them undeletable. We need to fix that.\n\t[ -d \"$TERMUX_PKG_BUILDDIR\" ] && chmod +w -R \"$TERMUX_PKG_BUILDDIR\"\n\t[ -d \"$TERMUX_PKG_SRCDIR\" ] && chmod +w -R \"$TERMUX_PKG_SRCDIR\"\n\n\t# Cleanup old state:\n\trm -Rf \"$TERMUX_PKG_BUILDDIR\" \\\n\t\t\"$TERMUX_PKG_PACKAGEDIR\" \\\n\t\t\"$TERMUX_PKG_SRCDIR\" \\\n\t\t\"$TERMUX_PKG_TMPDIR\" \\\n\t\t\"$TERMUX_PKG_MASSAGEDIR\"\n\n\t# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will be created in build)\n\tmkdir -p \"$TERMUX_COMMON_CACHEDIR\" \\\n\t\t \"$TERMUX_DEBDIR\" \\\n\t\t \"$TERMUX_PKG_BUILDDIR\" \\\n\t\t \"$TERMUX_PKG_PACKAGEDIR\" \\\n\t\t \"$TERMUX_PKG_TMPDIR\" \\\n\t\t \"$TERMUX_PKG_CACHEDIR\" \\\n\t\t \"$TERMUX_PKG_MASSAGEDIR\" \\\n\t\t $TERMUX_PREFIX/{bin,etc,lib,libexec,share,share/LICENSES,tmp,include}\n\n\t# Make $TERMUX_PREFIX/bin/sh executable on the builder, so that build\n\t# scripts can assume that it works on both builder and host later on:\n\t[ \"$TERMUX_ON_DEVICE_BUILD\" = \"false\" ] && ln -sf /bin/sh \"$TERMUX_PREFIX/bin/sh\"\n\n\tlocal TERMUX_ELF_CLEANER_SRC=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner.cpp\n\tlocal TERMUX_ELF_CLEANER_VERSION\n\tTERMUX_ELF_CLEANER_VERSION=$(bash -c \". $TERMUX_SCRIPTDIR/packages/termux-elf-cleaner/build.sh; echo \\$TERMUX_PKG_VERSION\")\n\ttermux_download \\\n\t\t\"https://raw.githubusercontent.com/termux/termux-elf-cleaner/v$TERMUX_ELF_CLEANER_VERSION/termux-elf-cleaner.cpp\" \\\n\t\t\"$TERMUX_ELF_CLEANER_SRC\" \\\n\t\t35a4a88542352879ca1919e2e0a62ef458c96f34ee7ce3f70a3c9f74b721d77a\n\tif [ \"$TERMUX_ELF_CLEANER_SRC\" -nt \"$TERMUX_ELF_CLEANER\" ]; then\n\t\tg++ -std=c++11 -Wall -Wextra -pedantic -Os -D__ANDROID_API__=$TERMUX_PKG_API_LEVEL \\\n\t\t\t\"$TERMUX_ELF_CLEANER_SRC\" -o \"$TERMUX_ELF_CLEANER\"\n\tfi\n\n\tif [ \"$TERMUX_PKG_BUILD_IN_SRC\" = \"true\" ]; then\n\t\techo \"Building in src due to TERMUX_PKG_BUILD_IN_SRC being set to true\" > \"$TERMUX_PKG_BUILDDIR/BUILDING_IN_SRC.txt\"\n\t\tTERMUX_PKG_BUILDDIR=$TERMUX_PKG_SRCDIR\n\tfi\n\n\techo \"termux - building $TERMUX_PKG_NAME for arch $TERMUX_ARCH...\"\n\ttest -t 1 && printf \"\\033]0;%s...\\007\" \"$TERMUX_PKG_NAME\"\n\n\t# Avoid exporting PKG_CONFIG_LIBDIR until after termux_step_host_build.\n\texport TERMUX_PKG_CONFIG_LIBDIR=$TERMUX_PREFIX/lib/pkgconfig\n\n\t# Keep track of when build started so we can see what files have been created.\n\t# We start by sleeping so that any generated files above (such as zlib.pc) get\n\t# an older timestamp than the TERMUX_BUILD_TS_FILE.\n\tsleep 1\n\tTERMUX_BUILD_TS_FILE=$TERMUX_PKG_TMPDIR/timestamp_$TERMUX_PKG_NAME\n\ttouch \"$TERMUX_BUILD_TS_FILE\"\n}\n"
  },
  {
    "path": "scripts/buildorder.py",
    "content": "#!/usr/bin/env python3\n\"Script to generate a build order respecting package dependencies.\"\n\nimport os\nimport re\nimport sys\n\nfrom itertools import filterfalse\n\ndef unique_everseen(iterable, key=None):\n    \"\"\"List unique elements, preserving order. Remember all elements ever seen.\n    See https://docs.python.org/3/library/itertools.html#itertools-recipes\n    Examples:\n    unique_everseen('AAAABBBCCDAABBB') --> A B C D\n    unique_everseen('ABBCcAD', str.lower) --> A B C D\"\"\"\n    seen = set()\n    seen_add = seen.add\n    if key is None:\n        for element in filterfalse(seen.__contains__, iterable):\n            seen_add(element)\n            yield element\n    else:\n        for element in iterable:\n            k = key(element)\n            if k not in seen:\n                seen_add(k)\n                yield element\n\ndef die(msg):\n    \"Exit the process with an error message.\"\n    sys.exit('ERROR: ' + msg)\n\ndef parse_build_file_dependencies(path):\n    \"Extract the dependencies of a build.sh or *.subpackage.sh file.\"\n    dependencies = []\n\n    with open(path, encoding=\"utf-8\") as build_script:\n        for line in build_script:\n            if line.startswith( ('TERMUX_PKG_DEPENDS', 'TERMUX_PKG_BUILD_DEPENDS', 'TERMUX_SUBPKG_DEPENDS', 'TERMUX_PKG_DEVPACKAGE_DEPENDS') ):\n                dependencies_string = line.split('DEPENDS=')[1]\n                for char in \"\\\"'\\n\":\n                    dependencies_string = dependencies_string.replace(char, '')\n\n                # Split also on '|' to dependencies with '|', as in 'nodejs | nodejs-current':\n                for dependency_value in re.split(',|\\\\|', dependencies_string):\n                    # Replace parenthesis to ignore version qualifiers as in \"gcc (>= 5.0)\":\n                    dependency_value = re.sub(r'\\(.*?\\)', '', dependency_value).strip()\n\n                    dependencies.append(dependency_value)\n\n    return set(dependencies)\n\nclass TermuxPackage(object):\n    \"A main package definition represented by a directory with a build.sh file.\"\n    def __init__(self, dir_path, fast_build_mode):\n        self.dir = dir_path\n        self.name = os.path.basename(self.dir)\n\n        # search package build.sh\n        build_sh_path = os.path.join(self.dir, 'build.sh')\n        if not os.path.isfile(build_sh_path):\n            raise Exception(\"build.sh not found for package '\" + self.name + \"'\")\n\n        self.deps = parse_build_file_dependencies(build_sh_path)\n\n        if os.getenv('TERMUX_ON_DEVICE_BUILD') == \"true\":\n            always_deps = ['libc++']\n            for dependency_name in always_deps:\n                if dependency_name not in self.deps and self.name not in always_deps:\n                    self.deps.add(dependency_name)\n\n        # search subpackages\n        self.subpkgs = []\n\n        for filename in os.listdir(self.dir):\n            if not filename.endswith('.subpackage.sh'):\n                continue\n            subpkg = TermuxSubPackage(self.dir + '/' + filename, self)\n\n            self.subpkgs.append(subpkg)\n            self.deps.add(subpkg.name)\n            self.deps |= subpkg.deps\n\n        subpkg = TermuxSubPackage(self.dir + '/' + self.name + '-static' + '.subpackage.sh', self, virtual=True)\n        self.subpkgs.append(subpkg)\n\n        # Do not depend on itself\n        self.deps.discard(self.name)\n        # Do not depend on any sub package\n        if not fast_build_mode:\n            self.deps.difference_update([subpkg.name for subpkg in self.subpkgs])\n\n        self.needed_by = set()  # Populated outside constructor, reverse of deps.\n\n    def __repr__(self):\n        return \"<{} '{}'>\".format(self.__class__.__name__, self.name)\n\n    def recursive_dependencies(self, pkgs_map):\n        \"All the dependencies of the package, both direct and indirect.\"\n        result = []\n        for dependency_name in sorted(self.deps):\n            dependency_package = pkgs_map[dependency_name]\n            result += dependency_package.recursive_dependencies(pkgs_map)\n            result += [dependency_package]\n        return unique_everseen(result)\n\nclass TermuxSubPackage:\n    \"A sub-package represented by a ${PACKAGE_NAME}.subpackage.sh file.\"\n    def __init__(self, subpackage_file_path, parent, virtual=False):\n        if parent is None:\n            raise Exception(\"SubPackages should have a parent\")\n\n        self.name = os.path.basename(subpackage_file_path).split('.subpackage.sh')[0]\n        self.parent = parent\n        self.deps = set([parent.name])\n        if not virtual:\n            self.deps |= parse_build_file_dependencies(subpackage_file_path)\n        self.dir = parent.dir\n\n        self.needed_by = set()  # Populated outside constructor, reverse of deps.\n\n    def __repr__(self):\n        return \"<{} '{}' parent='{}'>\".format(self.__class__.__name__, self.name, self.parent)\n\n    def recursive_dependencies(self, pkgs_map):\n        \"\"\"All the dependencies of the subpackage, both direct and indirect.\n        Only relevant when building in fast-build mode\"\"\"\n        result = []\n        for dependency_name in sorted(self.deps):\n            if dependency_name == self.parent.name:\n                self.parent.deps.discard(self.name)\n            dependency_package = pkgs_map[dependency_name]\n            if dependency_package not in self.parent.subpkgs:\n                result += dependency_package.recursive_dependencies(pkgs_map)\n            result += [dependency_package]\n        return unique_everseen(result)\n\ndef read_packages_from_directories(directories, fast_build_mode):\n    \"\"\"Construct a map from package name to TermuxPackage.\n    Subpackages are mapped to the parent package if fast_build_mode is false.\"\"\"\n    pkgs_map = {}\n    all_packages = []\n\n    for package_dir in directories:\n        for pkgdir_name in sorted(os.listdir(package_dir)):\n            dir_path = package_dir + '/' + pkgdir_name\n            if os.path.isfile(dir_path + '/build.sh'):\n                new_package = TermuxPackage(package_dir + '/' + pkgdir_name, fast_build_mode)\n\n                if new_package.name in pkgs_map:\n                    die('Duplicated package: ' + new_package.name)\n                else:\n                    pkgs_map[new_package.name] = new_package\n                all_packages.append(new_package)\n\n                for subpkg in new_package.subpkgs:\n                    if subpkg.name in pkgs_map:\n                        die('Duplicated package: ' + subpkg.name)\n                    elif fast_build_mode:\n                        pkgs_map[subpkg.name] = subpkg\n                    else:\n                        pkgs_map[subpkg.name] = new_package\n                    all_packages.append(subpkg)\n\n    for pkg in all_packages:\n        for dependency_name in pkg.deps:\n            if dependency_name not in pkgs_map:\n                die('Package %s depends on non-existing package \"%s\"' % (pkg.name, dependency_name))\n            dep_pkg = pkgs_map[dependency_name]\n            if fast_build_mode or not isinstance(pkg, TermuxSubPackage):\n                dep_pkg.needed_by.add(pkg)\n    return pkgs_map\n\ndef generate_full_buildorder(pkgs_map):\n    \"Generate a build order for building all packages.\"\n    build_order = []\n\n    # List of all TermuxPackages without dependencies\n    leaf_pkgs = [pkg for name, pkg in pkgs_map.items() if not pkg.deps]\n\n    if not leaf_pkgs:\n        die('No package without dependencies - where to start?')\n\n    # Sort alphabetically:\n    pkg_queue = sorted(leaf_pkgs, key=lambda p: p.name)\n\n    # Topological sorting\n    visited = set()\n\n    # Tracks non-visited deps for each package\n    remaining_deps = {}\n    for name, pkg in pkgs_map.items():\n        remaining_deps[name] = set(pkg.deps)\n        for subpkg in pkg.subpkgs:\n            remaining_deps[subpkg.name] = set(subpkg.deps)\n\n    while pkg_queue:\n        pkg = pkg_queue.pop(0)\n        if pkg.name in visited:\n            continue\n\n        # print(\"Processing {}:\".format(pkg.name), pkg.needed_by)\n        visited.add(pkg.name)\n        build_order.append(pkg)\n\n        for other_pkg in sorted(pkg.needed_by, key=lambda p: p.name):\n            # Remove this pkg from deps\n            remaining_deps[other_pkg.name].discard(pkg.name)\n            # ... and all its subpackages\n            remaining_deps[other_pkg.name].difference_update(\n                [subpkg.name for subpkg in pkg.subpkgs]\n            )\n\n            if not remaining_deps[other_pkg.name]:  # all deps were already appended?\n                pkg_queue.append(other_pkg)  # should be processed\n\n    if set(pkgs_map.values()) != set(build_order):\n        print(\"ERROR: Cycle exists. Remaining: \")\n        for name, pkg in pkgs_map.items():\n            if pkg not in build_order:\n                print(name, remaining_deps[name])\n\n        sys.exit(1)\n\n    return build_order\n\ndef generate_target_buildorder(target_path, pkgs_map, fast_build_mode):\n    \"Generate a build order for building the dependencies of the specified package.\"\n    if target_path.endswith('/'):\n        target_path = target_path[:-1]\n\n    package_name = os.path.basename(target_path)\n    package = pkgs_map[package_name]\n    # Do not depend on any sub package\n    if fast_build_mode:\n        package.deps.difference_update([subpkg.name for subpkg in package.subpkgs])\n    return package.recursive_dependencies(pkgs_map)\n\ndef main():\n    \"Generate the build order either for all packages or a specific one.\"\n    import argparse\n\n    parser = argparse.ArgumentParser(description='Generate order in which to build dependencies for a package. Generates')\n    parser.add_argument('-i', default=False, action='store_true',\n                        help='Generate dependency list for fast-build mode. This includes subpackages in output since these can be downloaded.')\n    parser.add_argument('package', nargs='?',\n                        help='Package to generate dependency list for.')\n    parser.add_argument('package_dirs', nargs='*',\n                        help='Directories with packages. Can for example point to \"../x11-packages/packages/\". \"packages/\" is appended automatically.')\n    args = parser.parse_args()\n    fast_build_mode = args.i\n    package = args.package\n    packages_directories = args.package_dirs\n    if 'packages' not in packages_directories:\n        packages_directories.append('packages')\n\n    if not package:\n        full_buildorder = True\n    else:\n        full_buildorder = False\n\n    if fast_build_mode and full_buildorder:\n        die('-i mode does not work when building all packages')\n\n    if not full_buildorder:\n        packages_real_path = os.path.realpath('packages')\n        for path in packages_directories:\n            if not os.path.isdir(path):\n                die('Not a directory: ' + path)\n\n    if package:\n        if package[-1] == \"/\":\n            package = package[:-1]\n        if not os.path.isdir(package):\n            die('Not a directory: ' + package)\n        if not os.path.relpath(os.path.dirname(package), '.') in packages_directories:\n            packages_directories.insert(0, os.path.dirname(package))\n    pkgs_map = read_packages_from_directories(packages_directories, fast_build_mode)\n\n    if full_buildorder:\n        build_order = generate_full_buildorder(pkgs_map)\n    else:\n        build_order = generate_target_buildorder(package, pkgs_map, fast_build_mode)\n\n    for pkg in build_order:\n        print(\"%-30s %s\" % (pkg.name, pkg.dir))\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "scripts/check-built-packages.py",
    "content": "#!/usr/bin/env python3\n\nimport urllib.request\nfrom subprocess import Popen, PIPE\n\nversion_map = {}\nany_error = False\n\npipe = Popen('./scripts/list-versions.sh', stdout=PIPE)\nfor line in pipe.stdout:\n    (name, version) = line.decode().strip().split('=')\n    version_map[name] = version\n\ndef check_manifest(arch, manifest):\n    current_package = {}\n    for line in manifest:\n        if line.isspace():\n            package_name = current_package['Package']\n            package_version = current_package['Version']\n            if not package_name in version_map:\n                # Skip sub-package\n                continue\n            latest_version = version_map[package_name]\n            if package_version != latest_version:\n                print(f'{package_name}@{arch}: Expected {latest_version}, but was {package_version}')\n            current_package.clear()\n        elif not line.decode().startswith(' '):\n            parts = line.decode().split(':', 1)\n            current_package[parts[0].strip()] = parts[1].strip()\n\nfor arch in ['all', 'aarch64', 'arm', 'i686', 'x86_64']:\n    manifest_url = f'https://dl.bintray.com/termux/termux-packages-24/dists/stable/main/binary-{arch}/Packages'\n    with urllib.request.urlopen(manifest_url) as manifest:\n        check_manifest(arch, manifest)\n"
  },
  {
    "path": "scripts/check-pie.sh",
    "content": "#!/bin/sh\n# check-pie.sh - script to detect non-PIE binaries (which does not work on Android)\n\ncd /data/data/com.termux/files/usr/bin/\nfor file in *; do\n\tif readelf -h $file 2>/dev/null | grep -q 'Type:[[:space:]]*EXEC'; then\n\t\techo $file\n\tfi\ndone\n"
  },
  {
    "path": "scripts/check-versions.sh",
    "content": "#!/usr/bin/env bash\n# check-versions.sh - script to open packages in a browser for checking their versions\n\nOPEN=xdg-open\nif [ $(uname) = Darwin ]; then OPEN=open; fi\n\ncheck_package() { # path\n\tlocal path=$1\n\tlocal pkg=$(basename $path)\n\t. $path/build.sh\n\techo -n \"$pkg - $TERMUX_PKG_VERSION\"\n\tread\n\t$OPEN $TERMUX_PKG_HOMEPAGE\n}\n\n# Run each package in separate process since we include their environment variables:\nfor path in packages/*; do\n(\n\tcheck_package $path\n)\ndone\n"
  },
  {
    "path": "scripts/config.guess",
    "content": "#! /bin/sh\n# Attempt to guess a canonical system name.\n#   Copyright 1992-2017 Free Software Foundation, Inc.\n\ntimestamp='2017-01-01'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n#\n# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.\n#\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\n#\n# Please send patches to <config-patches@gnu.org>.\n\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION]\n\nOutput the configuration name of the system \\`$me' is run on.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.guess ($timestamp)\n\nOriginally written by Per Bothner.\nCopyright 1992-2017 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\" >&2\n       exit 1 ;;\n    * )\n       break ;;\n  esac\ndone\n\nif test $# != 0; then\n  echo \"$me: too many arguments$help\" >&2\n  exit 1\nfi\n\ntrap 'exit 1' 1 2 15\n\n# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n# compiler to aid in system detection is discouraged as it requires\n# temporary files to be created and, as you can see below, it is a\n# headache to deal with in a portable fashion.\n\n# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still\n# use `HOST_CC' if defined, but it is deprecated.\n\n# Portable tmp directory creation inspired by the Autoconf team.\n\nset_cc_for_build='\ntrap \"exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode\" 0 ;\ntrap \"rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1\" 1 2 13 15 ;\n: ${TMPDIR=/tmp} ;\n { tmp=`(umask 077 && mktemp -d \"$TMPDIR/cgXXXXXX\") 2>/dev/null` && test -n \"$tmp\" && test -d \"$tmp\" ; } ||\n { test -n \"$RANDOM\" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||\n { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo \"Warning: creating insecure temp directory\" >&2 ; } ||\n { echo \"$me: cannot create a temporary directory in $TMPDIR\" >&2 ; exit 1 ; } ;\ndummy=$tmp/dummy ;\ntmpfiles=\"$dummy.c $dummy.o $dummy.rel $dummy\" ;\ncase $CC_FOR_BUILD,$HOST_CC,$CC in\n ,,)    echo \"int x;\" > $dummy.c ;\n\tfor c in cc gcc c89 c99 ; do\n\t  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then\n\t     CC_FOR_BUILD=\"$c\"; break ;\n\t  fi ;\n\tdone ;\n\tif test x\"$CC_FOR_BUILD\" = x ; then\n\t  CC_FOR_BUILD=no_compiler_found ;\n\tfi\n\t;;\n ,,*)   CC_FOR_BUILD=$CC ;;\n ,*,*)  CC_FOR_BUILD=$HOST_CC ;;\nesac ; set_cc_for_build= ;'\n\n# This is needed to find uname on a Pyramid OSx when run in the BSD universe.\n# (ghazi@noc.rutgers.edu 1994-08-24)\nif (test -f /.attbin/uname) >/dev/null 2>&1 ; then\n\tPATH=$PATH:/.attbin ; export PATH\nfi\n\nUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown\nUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown\nUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown\nUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown\n\ncase \"${UNAME_SYSTEM}\" in\nLinux|GNU|GNU/*)\n\t# If the system lacks a compiler, then just pick glibc.\n\t# We could probably try harder.\n\tLIBC=gnu\n\n\teval $set_cc_for_build\n\tcat <<-EOF > $dummy.c\n\t#include <features.h>\n\t#if defined(__UCLIBC__)\n\tLIBC=uclibc\n\t#elif defined(__dietlibc__)\n\tLIBC=dietlibc\n\t#else\n\tLIBC=gnu\n\t#endif\n\tEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`\n\t;;\nesac\n\n# Note: order is significant - the case branches are not exclusive.\n\ncase \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" in\n    *:NetBSD:*:*)\n\t# NetBSD (nbsd) targets should (where applicable) match one or\n\t# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,\n\t# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently\n\t# switched to ELF, *-*-netbsd* would select the old\n\t# object file format.  This provides both forward\n\t# compatibility and a consistent mechanism for selecting the\n\t# object file format.\n\t#\n\t# Note: NetBSD doesn't particularly care about the vendor\n\t# portion of the name.  We always set it to \"unknown\".\n\tsysctl=\"sysctl -n hw.machine_arch\"\n\tUNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \\\n\t    /sbin/$sysctl 2>/dev/null || \\\n\t    /usr/sbin/$sysctl 2>/dev/null || \\\n\t    echo unknown)`\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    armeb) machine=armeb-unknown ;;\n\t    arm*) machine=arm-unknown ;;\n\t    sh3el) machine=shl-unknown ;;\n\t    sh3eb) machine=sh-unknown ;;\n\t    sh5el) machine=sh5le-unknown ;;\n\t    earmv*)\n\t\tarch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\\(armv[0-9]\\).*$,\\1,'`\n\t\tendian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\\(eb\\)$,\\1,p'`\n\t\tmachine=${arch}${endian}-unknown\n\t\t;;\n\t    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;\n\tesac\n\t# The Operating System including object format, if it has switched\n\t# to ELF recently (or will in the future) and ABI.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\tos=netbsdelf\n\t\t;;\n\t    arm*|i386|m68k|ns32k|sh3*|sparc|vax)\n\t\teval $set_cc_for_build\n\t\tif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t\t| grep -q __ELF__\n\t\tthen\n\t\t    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).\n\t\t    # Return netbsd for either.  FIX?\n\t\t    os=netbsd\n\t\telse\n\t\t    os=netbsdelf\n\t\tfi\n\t\t;;\n\t    *)\n\t\tos=netbsd\n\t\t;;\n\tesac\n\t# Determine ABI tags.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\texpr='s/^earmv[0-9]/-eabi/;s/eb$//'\n\t\tabi=`echo ${UNAME_MACHINE_ARCH} | sed -e \"$expr\"`\n\t\t;;\n\tesac\n\t# The OS release\n\t# Debian GNU/NetBSD machines have a different userland, and\n\t# thus, need a distinct triplet. However, they do not need\n\t# kernel version information, so it can be replaced with a\n\t# suitable tag, in the style of linux-gnu.\n\tcase \"${UNAME_VERSION}\" in\n\t    Debian*)\n\t\trelease='-gnu'\n\t\t;;\n\t    *)\n\t\trelease=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`\n\t\t;;\n\tesac\n\t# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:\n\t# contains redundant information, the shorter form:\n\t# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.\n\techo \"${machine}-${os}${release}${abi}\"\n\texit ;;\n    *:Bitrig:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}\n\texit ;;\n    *:OpenBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}\n\texit ;;\n    *:LibertyBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\\.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}\n\texit ;;\n    *:ekkoBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}\n\texit ;;\n    *:SolidBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}\n\texit ;;\n    macppc:MirBSD:*:*)\n\techo powerpc-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:MirBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:Sortix:*:*)\n\techo ${UNAME_MACHINE}-unknown-sortix\n\texit ;;\n    alpha:OSF1:*:*)\n\tcase $UNAME_RELEASE in\n\t*4.0)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`\n\t\t;;\n\t*5.*)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n\t\t;;\n\tesac\n\t# According to Compaq, /usr/sbin/psrinfo has been available on\n\t# OSF/1 and Tru64 systems produced since 1995.  I hope that\n\t# covers most systems running today.  This code pipes the CPU\n\t# types through head -n 1, so we only detect the type of CPU 0.\n\tALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \\(.*\\) processor.*$/\\1/p' | head -n 1`\n\tcase \"$ALPHA_CPU_TYPE\" in\n\t    \"EV4 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV4.5 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"LCA4 (21066/21068)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV5 (21164)\")\n\t\tUNAME_MACHINE=alphaev5 ;;\n\t    \"EV5.6 (21164A)\")\n\t\tUNAME_MACHINE=alphaev56 ;;\n\t    \"EV5.6 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca56 ;;\n\t    \"EV5.7 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca57 ;;\n\t    \"EV6 (21264)\")\n\t\tUNAME_MACHINE=alphaev6 ;;\n\t    \"EV6.7 (21264A)\")\n\t\tUNAME_MACHINE=alphaev67 ;;\n\t    \"EV6.8CB (21264C)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8AL (21264B)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8CX (21264D)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.9A (21264/EV69A)\")\n\t\tUNAME_MACHINE=alphaev69 ;;\n\t    \"EV7 (21364)\")\n\t\tUNAME_MACHINE=alphaev7 ;;\n\t    \"EV7.9 (21364A)\")\n\t\tUNAME_MACHINE=alphaev79 ;;\n\tesac\n\t# A Pn.n version is a patched version.\n\t# A Vn.n version is a released version.\n\t# A Tn.n version is a released field test version.\n\t# A Xn.n version is an unreleased experimental baselevel.\n\t# 1.2 uses \"1.2\" for uname -r.\n\techo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\t# Reset EXIT trap before exiting to avoid spurious non-zero exit code.\n\texitcode=$?\n\ttrap '' 0\n\texit $exitcode ;;\n    Alpha\\ *:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# Should we change UNAME_MACHINE based on the output of uname instead\n\t# of the specific Alpha model?\n\techo alpha-pc-interix\n\texit ;;\n    21064:Windows_NT:50:3)\n\techo alpha-dec-winnt3.5\n\texit ;;\n    Amiga*:UNIX_System_V:4.0:*)\n\techo m68k-unknown-sysv4\n\texit ;;\n    *:[Aa]miga[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-amigaos\n\texit ;;\n    *:[Mm]orph[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-morphos\n\texit ;;\n    *:OS/390:*:*)\n\techo i370-ibm-openedition\n\texit ;;\n    *:z/VM:*:*)\n\techo s390-ibm-zvmoe\n\texit ;;\n    *:OS400:*:*)\n\techo powerpc-ibm-os400\n\texit ;;\n    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)\n\techo arm-acorn-riscix${UNAME_RELEASE}\n\texit ;;\n    arm*:riscos:*:*|arm*:RISCOS:*:*)\n\techo arm-unknown-riscos\n\texit ;;\n    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)\n\techo hppa1.1-hitachi-hiuxmpp\n\texit ;;\n    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)\n\t# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.\n\tif test \"`(/bin/universe) 2>/dev/null`\" = att ; then\n\t\techo pyramid-pyramid-sysv3\n\telse\n\t\techo pyramid-pyramid-bsd\n\tfi\n\texit ;;\n    NILE*:*:*:dcosx)\n\techo pyramid-pyramid-svr4\n\texit ;;\n    DRS?6000:unix:4.0:6*)\n\techo sparc-icl-nx6\n\texit ;;\n    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)\n\tcase `/usr/bin/uname -p` in\n\t    sparc) echo sparc-icl-nx7; exit ;;\n\tesac ;;\n    s390x:SunOS:*:*)\n\techo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4H:SunOS:5.*:*)\n\techo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)\n\techo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)\n\techo i386-pc-auroraux${UNAME_RELEASE}\n\texit ;;\n    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)\n\teval $set_cc_for_build\n\tSUN_ARCH=i386\n\t# If there is a compiler, see if it is configured for 64-bit objects.\n\t# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.\n\t# This test works for both compilers.\n\tif [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t(CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\tgrep IS_64BIT_ARCH >/dev/null\n\t    then\n\t\tSUN_ARCH=x86_64\n\t    fi\n\tfi\n\techo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:6*:*)\n\t# According to config.sub, this is the proper way to canonicalize\n\t# SunOS6.  Hard to guess exactly what SunOS6 will be like, but\n\t# it's likely to be more like Solaris than SunOS4.\n\techo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:*:*)\n\tcase \"`/usr/bin/arch -k`\" in\n\t    Series*|S4*)\n\t\tUNAME_RELEASE=`uname -v`\n\t\t;;\n\tesac\n\t# Japanese Language versions have a version number like `4.1.3-JL'.\n\techo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`\n\texit ;;\n    sun3*:SunOS:*:*)\n\techo m68k-sun-sunos${UNAME_RELEASE}\n\texit ;;\n    sun*:*:4.2BSD:*)\n\tUNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`\n\ttest \"x${UNAME_RELEASE}\" = x && UNAME_RELEASE=3\n\tcase \"`/bin/arch`\" in\n\t    sun3)\n\t\techo m68k-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\t    sun4)\n\t\techo sparc-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\tesac\n\texit ;;\n    aushp:SunOS:*:*)\n\techo sparc-auspex-sunos${UNAME_RELEASE}\n\texit ;;\n    # The situation for MiNT is a little confusing.  The machine name\n    # can be virtually everything (everything which is not\n    # \"atarist\" or \"atariste\" at least should have a processor\n    # > m68000).  The system name ranges from \"MiNT\" over \"FreeMiNT\"\n    # to the lowercase version \"mint\" (or \"freemint\").  Finally\n    # the system name \"TOS\" denotes a system which is actually not\n    # MiNT.  But MiNT is downward compatible to TOS, so this should\n    # be no problem.\n    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)\n\techo m68k-milan-mint${UNAME_RELEASE}\n\texit ;;\n    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)\n\techo m68k-hades-mint${UNAME_RELEASE}\n\texit ;;\n    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)\n\techo m68k-unknown-mint${UNAME_RELEASE}\n\texit ;;\n    m68k:machten:*:*)\n\techo m68k-apple-machten${UNAME_RELEASE}\n\texit ;;\n    powerpc:machten:*:*)\n\techo powerpc-apple-machten${UNAME_RELEASE}\n\texit ;;\n    RISC*:Mach:*:*)\n\techo mips-dec-mach_bsd4.3\n\texit ;;\n    RISC*:ULTRIX:*:*)\n\techo mips-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    VAX*:ULTRIX*:*:*)\n\techo vax-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    2020:CLIX:*:* | 2430:CLIX:*:*)\n\techo clipper-intergraph-clix${UNAME_RELEASE}\n\texit ;;\n    mips:*:*:UMIPS | mips:*:*:RISCos)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n#ifdef __cplusplus\n#include <stdio.h>  /* for printf() prototype */\n\tint main (int argc, char *argv[]) {\n#else\n\tint main (argc, argv) int argc; char *argv[]; {\n#endif\n\t#if defined (host_mips) && defined (MIPSEB)\n\t#if defined (SYSTYPE_SYSV)\n\t  printf (\"mips-mips-riscos%ssysv\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_SVR4)\n\t  printf (\"mips-mips-riscos%ssvr4\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)\n\t  printf (\"mips-mips-riscos%sbsd\\n\", argv[1]); exit (0);\n\t#endif\n\t#endif\n\t  exit (-1);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c &&\n\t  dummyarg=`echo \"${UNAME_RELEASE}\" | sed -n 's/\\([0-9]*\\).*/\\1/p'` &&\n\t  SYSTEM_NAME=`$dummy $dummyarg` &&\n\t    { echo \"$SYSTEM_NAME\"; exit; }\n\techo mips-mips-riscos${UNAME_RELEASE}\n\texit ;;\n    Motorola:PowerMAX_OS:*:*)\n\techo powerpc-motorola-powermax\n\texit ;;\n    Motorola:*:4.3:PL8-*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:Power_UNIX:*:*)\n\techo powerpc-harris-powerunix\n\texit ;;\n    m88k:CX/UX:7*:*)\n\techo m88k-harris-cxux7\n\texit ;;\n    m88k:*:4*:R4*)\n\techo m88k-motorola-sysv4\n\texit ;;\n    m88k:*:3*:R3*)\n\techo m88k-motorola-sysv3\n\texit ;;\n    AViiON:dgux:*:*)\n\t# DG/UX returns AViiON for all architectures\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tif [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]\n\tthen\n\t    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \\\n\t       [ ${TARGET_BINARY_INTERFACE}x = x ]\n\t    then\n\t\techo m88k-dg-dgux${UNAME_RELEASE}\n\t    else\n\t\techo m88k-dg-dguxbcs${UNAME_RELEASE}\n\t    fi\n\telse\n\t    echo i586-dg-dgux${UNAME_RELEASE}\n\tfi\n\texit ;;\n    M88*:DolphinOS:*:*)\t# DolphinOS (SVR3)\n\techo m88k-dolphin-sysv3\n\texit ;;\n    M88*:*:R3*:*)\n\t# Delta 88k system running SVR3\n\techo m88k-motorola-sysv3\n\texit ;;\n    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)\n\techo m88k-tektronix-sysv3\n\texit ;;\n    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)\n\techo m68k-tektronix-bsd\n\texit ;;\n    *:IRIX*:*:*)\n\techo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`\n\texit ;;\n    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.\n\techo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id\n\texit ;;               # Note that: echo \"'`uname -s`'\" gives 'AIX '\n    i*86:AIX:*:*)\n\techo i386-ibm-aix\n\texit ;;\n    ia64:AIX:*:*)\n\tif [ -x /usr/bin/oslevel ] ; then\n\t\tIBM_REV=`/usr/bin/oslevel`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${UNAME_MACHINE}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:2:3)\n\tif grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\teval $set_cc_for_build\n\t\tsed 's/^\t\t//' << EOF >$dummy.c\n\t\t#include <sys/systemcfg.h>\n\n\t\tmain()\n\t\t\t{\n\t\t\tif (!__power_pc())\n\t\t\t\texit(1);\n\t\t\tputs(\"powerpc-ibm-aix3.2.5\");\n\t\t\texit(0);\n\t\t\t}\nEOF\n\t\tif $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`\n\t\tthen\n\t\t\techo \"$SYSTEM_NAME\"\n\t\telse\n\t\t\techo rs6000-ibm-aix3.2.5\n\t\tfi\n\telif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\techo rs6000-ibm-aix3.2.4\n\telse\n\t\techo rs6000-ibm-aix3.2\n\tfi\n\texit ;;\n    *:AIX:*:[4567])\n\tIBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`\n\tif /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then\n\t\tIBM_ARCH=rs6000\n\telse\n\t\tIBM_ARCH=powerpc\n\tfi\n\tif [ -x /usr/bin/lslpp ] ; then\n\t\tIBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |\n\t\t\t   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${IBM_ARCH}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:*:*)\n\techo rs6000-ibm-aix\n\texit ;;\n    ibmrt:4.4BSD:*|romp-ibm:BSD:*)\n\techo romp-ibm-bsd4.4\n\texit ;;\n    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and\n\techo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to\n\texit ;;                             # report: romp-ibm BSD 4.3\n    *:BOSX:*:*)\n\techo rs6000-bull-bosx\n\texit ;;\n    DPX/2?00:B.O.S.:*:*)\n\techo m68k-bull-sysv3\n\texit ;;\n    9000/[34]??:4.3bsd:1.*:*)\n\techo m68k-hp-bsd\n\texit ;;\n    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)\n\techo m68k-hp-bsd4.4\n\texit ;;\n    9000/[34678]??:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\tcase \"${UNAME_MACHINE}\" in\n\t    9000/31? )            HP_ARCH=m68000 ;;\n\t    9000/[34]?? )         HP_ARCH=m68k ;;\n\t    9000/[678][0-9][0-9])\n\t\tif [ -x /usr/bin/getconf ]; then\n\t\t    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`\n\t\t    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n\t\t    case \"${sc_cpu_version}\" in\n\t\t      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0\n\t\t      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1\n\t\t      532)                      # CPU_PA_RISC2_0\n\t\t\tcase \"${sc_kernel_bits}\" in\n\t\t\t  32) HP_ARCH=hppa2.0n ;;\n\t\t\t  64) HP_ARCH=hppa2.0w ;;\n\t\t\t  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20\n\t\t\tesac ;;\n\t\t    esac\n\t\tfi\n\t\tif [ \"${HP_ARCH}\" = \"\" ]; then\n\t\t    eval $set_cc_for_build\n\t\t    sed 's/^\t\t//' << EOF >$dummy.c\n\n\t\t#define _HPUX_SOURCE\n\t\t#include <stdlib.h>\n\t\t#include <unistd.h>\n\n\t\tint main ()\n\t\t{\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t    long bits = sysconf(_SC_KERNEL_BITS);\n\t\t#endif\n\t\t    long cpu  = sysconf (_SC_CPU_VERSION);\n\n\t\t    switch (cpu)\n\t\t\t{\n\t\t\tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n\t\t\tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n\t\t\tcase CPU_PA_RISC2_0:\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t\t    switch (bits)\n\t\t\t\t{\n\t\t\t\tcase 64: puts (\"hppa2.0w\"); break;\n\t\t\t\tcase 32: puts (\"hppa2.0n\"); break;\n\t\t\t\tdefault: puts (\"hppa2.0\"); break;\n\t\t\t\t} break;\n\t\t#else  /* !defined(_SC_KERNEL_BITS) */\n\t\t\t    puts (\"hppa2.0\"); break;\n\t\t#endif\n\t\t\tdefault: puts (\"hppa1.0\"); break;\n\t\t\t}\n\t\t    exit (0);\n\t\t}\nEOF\n\t\t    (CCOPTS=\"\" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`\n\t\t    test -z \"$HP_ARCH\" && HP_ARCH=hppa\n\t\tfi ;;\n\tesac\n\tif [ ${HP_ARCH} = hppa2.0w ]\n\tthen\n\t    eval $set_cc_for_build\n\n\t    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating\n\t    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler\n\t    # generating 64-bit code.  GNU and HP use different nomenclature:\n\t    #\n\t    # $ CC_FOR_BUILD=cc ./config.guess\n\t    # => hppa2.0w-hp-hpux11.23\n\t    # $ CC_FOR_BUILD=\"cc +DA2.0w\" ./config.guess\n\t    # => hppa64-hp-hpux11.23\n\n\t    if echo __LP64__ | (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) |\n\t\tgrep -q __LP64__\n\t    then\n\t\tHP_ARCH=hppa2.0w\n\t    else\n\t\tHP_ARCH=hppa64\n\t    fi\n\tfi\n\techo ${HP_ARCH}-hp-hpux${HPUX_REV}\n\texit ;;\n    ia64:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\techo ia64-hp-hpux${HPUX_REV}\n\texit ;;\n    3050*:HI-UX:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#include <unistd.h>\n\tint\n\tmain ()\n\t{\n\t  long cpu = sysconf (_SC_CPU_VERSION);\n\t  /* The order matters, because CPU_IS_HP_MC68K erroneously returns\n\t     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct\n\t     results, however.  */\n\t  if (CPU_IS_PA_RISC (cpu))\n\t    {\n\t      switch (cpu)\n\t\t{\n\t\t  case CPU_PA_RISC1_0: puts (\"hppa1.0-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC1_1: puts (\"hppa1.1-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC2_0: puts (\"hppa2.0-hitachi-hiuxwe2\"); break;\n\t\t  default: puts (\"hppa-hitachi-hiuxwe2\"); break;\n\t\t}\n\t    }\n\t  else if (CPU_IS_HP_MC68K (cpu))\n\t    puts (\"m68k-hitachi-hiuxwe2\");\n\t  else puts (\"unknown-hitachi-hiuxwe2\");\n\t  exit (0);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&\n\t\t{ echo \"$SYSTEM_NAME\"; exit; }\n\techo unknown-hitachi-hiuxwe2\n\texit ;;\n    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )\n\techo hppa1.1-hp-bsd\n\texit ;;\n    9000/8??:4.3bsd:*:*)\n\techo hppa1.0-hp-bsd\n\texit ;;\n    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)\n\techo hppa1.0-hp-mpeix\n\texit ;;\n    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )\n\techo hppa1.1-hp-osf\n\texit ;;\n    hp8??:OSF1:*:*)\n\techo hppa1.0-hp-osf\n\texit ;;\n    i*86:OSF1:*:*)\n\tif [ -x /usr/sbin/sysversion ] ; then\n\t    echo ${UNAME_MACHINE}-unknown-osf1mk\n\telse\n\t    echo ${UNAME_MACHINE}-unknown-osf1\n\tfi\n\texit ;;\n    parisc*:Lites*:*:*)\n\techo hppa1.1-hp-lites\n\texit ;;\n    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)\n\techo c1-convex-bsd\n\texit ;;\n    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)\n\tif getsysinfo -f scalar_acc\n\tthen echo c32-convex-bsd\n\telse echo c2-convex-bsd\n\tfi\n\texit ;;\n    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)\n\techo c34-convex-bsd\n\texit ;;\n    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)\n\techo c38-convex-bsd\n\texit ;;\n    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)\n\techo c4-convex-bsd\n\texit ;;\n    CRAY*Y-MP:*:*:*)\n\techo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*[A-Z]90:*:*:*)\n\techo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \\\n\t| sed -e 's/CRAY.*\\([A-Z]90\\)/\\1/' \\\n\t      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \\\n\t      -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*TS:*:*:*)\n\techo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*T3E:*:*:*)\n\techo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*SV1:*:*:*)\n\techo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    *:UNICOS/mp:*:*)\n\techo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)\n\tFUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n\techo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    5000:UNIX_System_V:4.*:*)\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`\n\techo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\\ Embedded/OS:*:*)\n\techo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}\n\texit ;;\n    sparc*:BSD/OS:*:*)\n\techo sparc-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:BSD/OS:*:*)\n\techo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:FreeBSD:*:*)\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tcase ${UNAME_PROCESSOR} in\n\t    amd64)\n\t\techo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n\t    *)\n\t\techo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;\n\tesac\n\texit ;;\n    i*:CYGWIN*:*)\n\techo ${UNAME_MACHINE}-pc-cygwin\n\texit ;;\n    *:MINGW64*:*)\n\techo ${UNAME_MACHINE}-pc-mingw64\n\texit ;;\n    *:MINGW*:*)\n\techo ${UNAME_MACHINE}-pc-mingw32\n\texit ;;\n    *:MSYS*:*)\n\techo ${UNAME_MACHINE}-pc-msys\n\texit ;;\n    i*:windows32*:*)\n\t# uname -m includes \"-pc\" on this system.\n\techo ${UNAME_MACHINE}-mingw32\n\texit ;;\n    i*:PW*:*)\n\techo ${UNAME_MACHINE}-pc-pw32\n\texit ;;\n    *:Interix*:*)\n\tcase ${UNAME_MACHINE} in\n\t    x86)\n\t\techo i586-pc-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    authenticamd | genuineintel | EM64T)\n\t\techo x86_64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    IA64)\n\t\techo ia64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\tesac ;;\n    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)\n\techo i${UNAME_MACHINE}-pc-mks\n\texit ;;\n    8664:Windows_NT:*)\n\techo x86_64-pc-mks\n\texit ;;\n    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we\n\t# UNAME_MACHINE based on the output of uname instead of i386?\n\techo i586-pc-interix\n\texit ;;\n    i*:UWIN*:*)\n\techo ${UNAME_MACHINE}-pc-uwin\n\texit ;;\n    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)\n\techo x86_64-unknown-cygwin\n\texit ;;\n    p*:CYGWIN*:*)\n\techo powerpcle-unknown-cygwin\n\texit ;;\n    prep*:SunOS:5.*:*)\n\techo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    *:GNU:*:*)\n\t# the GNU system\n\techo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`\n\texit ;;\n    *:GNU/*:*:*)\n\t# other systems with GNU libc and userland\n\techo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr \"[:upper:]\" \"[:lower:]\"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}\n\texit ;;\n    i*86:Minix:*:*)\n\techo ${UNAME_MACHINE}-pc-minix\n\texit ;;\n    aarch64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    aarch64_be:Linux:*:*)\n\tUNAME_MACHINE=aarch64_be\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    alpha:Linux:*:*)\n\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n\tesac\n\tobjdump --private-headers /bin/sh | grep -q ld.so.1\n\tif test \"$?\" = 0 ; then LIBC=gnulibc1 ; fi\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arc:Linux:*:* | arceb:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arm*:Linux:*:*)\n\teval $set_cc_for_build\n\tif echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t    | grep -q __ARM_EABI__\n\tthen\n\t    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\telse\n\t    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t| grep -q __ARM_PCS_VFP\n\t    then\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi\n\t    else\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf\n\t    fi\n\tfi\n\texit ;;\n    avr32*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    cris:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    crisv32:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    e2k:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    frv:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    hexagon:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    ia64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    k1om:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m32r*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m68*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    mips:Linux:*:* | mips64:Linux:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#undef CPU\n\t#undef ${UNAME_MACHINE}\n\t#undef ${UNAME_MACHINE}el\n\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n\tCPU=${UNAME_MACHINE}el\n\t#else\n\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n\tCPU=${UNAME_MACHINE}\n\t#else\n\tCPU=\n\t#endif\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`\n\ttest x\"${CPU}\" != x && { echo \"${CPU}-unknown-linux-${LIBC}\"; exit; }\n\t;;\n    mips64el:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    openrisc*:Linux:*:*)\n\techo or1k-unknown-linux-${LIBC}\n\texit ;;\n    or32:Linux:*:* | or1k*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    padre:Linux:*:*)\n\techo sparc-unknown-linux-${LIBC}\n\texit ;;\n    parisc64:Linux:*:* | hppa64:Linux:*:*)\n\techo hppa64-unknown-linux-${LIBC}\n\texit ;;\n    parisc:Linux:*:* | hppa:Linux:*:*)\n\t# Look for CPU level\n\tcase `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in\n\t  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;\n\t  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;\n\t  *)    echo hppa-unknown-linux-${LIBC} ;;\n\tesac\n\texit ;;\n    ppc64:Linux:*:*)\n\techo powerpc64-unknown-linux-${LIBC}\n\texit ;;\n    ppc:Linux:*:*)\n\techo powerpc-unknown-linux-${LIBC}\n\texit ;;\n    ppc64le:Linux:*:*)\n\techo powerpc64le-unknown-linux-${LIBC}\n\texit ;;\n    ppcle:Linux:*:*)\n\techo powerpcle-unknown-linux-${LIBC}\n\texit ;;\n    riscv32:Linux:*:* | riscv64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    s390:Linux:*:* | s390x:Linux:*:*)\n\techo ${UNAME_MACHINE}-ibm-linux-${LIBC}\n\texit ;;\n    sh64*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sh*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sparc:Linux:*:* | sparc64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    tile*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    vax:Linux:*:*)\n\techo ${UNAME_MACHINE}-dec-linux-${LIBC}\n\texit ;;\n    x86_64:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    xtensa*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:DYNIX/ptx:4*:*)\n\t# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.\n\t# earlier versions are messed up and put the nodename in both\n\t# sysname and nodename.\n\techo i386-sequent-sysv4\n\texit ;;\n    i*86:UNIX_SV:4.2MP:2.*)\n\t# Unixware is an offshoot of SVR4, but it has its own version\n\t# number series starting with 2...\n\t# I am not positive that other SVR4 systems won't match this,\n\t# I just have to hope.  -- rms.\n\t# Use sysv4.2uw... so that sysv4* matches it.\n\techo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}\n\texit ;;\n    i*86:OS/2:*:*)\n\t# If we were able to find `uname', then EMX Unix compatibility\n\t# is probably installed.\n\techo ${UNAME_MACHINE}-pc-os2-emx\n\texit ;;\n    i*86:XTS-300:*:STOP)\n\techo ${UNAME_MACHINE}-unknown-stop\n\texit ;;\n    i*86:atheos:*:*)\n\techo ${UNAME_MACHINE}-unknown-atheos\n\texit ;;\n    i*86:syllable:*:*)\n\techo ${UNAME_MACHINE}-pc-syllable\n\texit ;;\n    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)\n\techo i386-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    i*86:*DOS:*:*)\n\techo ${UNAME_MACHINE}-pc-msdosdjgpp\n\texit ;;\n    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)\n\tUNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\\/MP$//'`\n\tif grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then\n\t\techo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}\n\tfi\n\texit ;;\n    i*86:*:5:[678]*)\n\t# UnixWare 7.x, OpenUNIX and OpenServer 6.\n\tcase `/bin/uname -X | grep \"^Machine\"` in\n\t    *486*)\t     UNAME_MACHINE=i486 ;;\n\t    *Pentium)\t     UNAME_MACHINE=i586 ;;\n\t    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;\n\tesac\n\techo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}\n\texit ;;\n    i*86:*:3.2:*)\n\tif test -f /usr/options/cb.name; then\n\t\tUNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`\n\t\techo ${UNAME_MACHINE}-pc-isc$UNAME_REL\n\telif /bin/uname -X 2>/dev/null >/dev/null ; then\n\t\tUNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`\n\t\t(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486\n\t\t(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i586\n\t\t(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\t(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\techo ${UNAME_MACHINE}-pc-sco$UNAME_REL\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv32\n\tfi\n\texit ;;\n    pc:*:*:*)\n\t# Left here for compatibility:\n\t# uname -m prints for DJGPP always 'pc', but it prints nothing about\n\t# the processor, so we play safe by assuming i586.\n\t# Note: whatever this is, it MUST be the same as what config.sub\n\t# prints for the \"djgpp\" host, or else GDB configure will decide that\n\t# this is a cross-build.\n\techo i586-pc-msdosdjgpp\n\texit ;;\n    Intel:Mach:3*:*)\n\techo i386-pc-mach3\n\texit ;;\n    paragon:*:*:*)\n\techo i860-intel-osf1\n\texit ;;\n    i860:*:4.*:*) # i860-SVR4\n\tif grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then\n\t  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4\n\telse # Add other i860-SVR4 vendors below as they are discovered.\n\t  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4\n\tfi\n\texit ;;\n    mini*:CTIX:SYS*5:*)\n\t# \"miniframe\"\n\techo m68010-convergent-sysv\n\texit ;;\n    mc68k:UNIX:SYSTEM5:3.51m)\n\techo m68k-convergent-sysv\n\texit ;;\n    M680?0:D-NIX:5.3:*)\n\techo m68k-diab-dnix\n\texit ;;\n    M68*:*:R3V[5678]*:*)\n\ttest -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;\n    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)\n\tOS_REL=''\n\ttest -r /etc/.relid \\\n\t&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4; exit; } ;;\n    NCR*:*:4.2:* | MPRAS*:*:4.2:*)\n\tOS_REL='.3'\n\ttest -r /etc/.relid \\\n\t    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)\n\techo m68k-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    mc68030:UNIX_System_V:4.*:*)\n\techo m68k-atari-sysv4\n\texit ;;\n    TSUNAMI:LynxOS:2.*:*)\n\techo sparc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    rs6000:LynxOS:2.*:*)\n\techo rs6000-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)\n\techo powerpc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    SM[BE]S:UNIX_SV:*:*)\n\techo mips-dde-sysv${UNAME_RELEASE}\n\texit ;;\n    RM*:ReliantUNIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    RM*:SINIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    *:SINIX-*:*:*)\n\tif uname -p 2>/dev/null >/dev/null ; then\n\t\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\t\techo ${UNAME_MACHINE}-sni-sysv4\n\telse\n\t\techo ns32k-sni-sysv\n\tfi\n\texit ;;\n    PENTIUM:*:4.0*:*)\t# Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n\t\t\t# says <Richard.M.Bartel@ccMail.Census.GOV>\n\techo i586-unisys-sysv4\n\texit ;;\n    *:UNIX_System_V:4*:FTX*)\n\t# From Gerald Hewes <hewes@openmarket.com>.\n\t# How about differentiating between stratus architectures? -djm\n\techo hppa1.1-stratus-sysv4\n\texit ;;\n    *:*:*:FTX*)\n\t# From seanf@swdc.stratus.com.\n\techo i860-stratus-sysv4\n\texit ;;\n    i*86:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo ${UNAME_MACHINE}-stratus-vos\n\texit ;;\n    *:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo hppa1.1-stratus-vos\n\texit ;;\n    mc68*:A/UX:*:*)\n\techo m68k-apple-aux${UNAME_RELEASE}\n\texit ;;\n    news*:NEWS-OS:6*:*)\n\techo mips-sony-newsos6\n\texit ;;\n    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)\n\tif [ -d /usr/nec ]; then\n\t\techo mips-nec-sysv${UNAME_RELEASE}\n\telse\n\t\techo mips-unknown-sysv${UNAME_RELEASE}\n\tfi\n\texit ;;\n    BeBox:BeOS:*:*)\t# BeOS running on hardware made by Be, PPC only.\n\techo powerpc-be-beos\n\texit ;;\n    BeMac:BeOS:*:*)\t# BeOS running on Mac or Mac clone, PPC only.\n\techo powerpc-apple-beos\n\texit ;;\n    BePC:BeOS:*:*)\t# BeOS running on Intel PC compatible.\n\techo i586-pc-beos\n\texit ;;\n    BePC:Haiku:*:*)\t# Haiku running on Intel PC compatible.\n\techo i586-pc-haiku\n\texit ;;\n    x86_64:Haiku:*:*)\n\techo x86_64-unknown-haiku\n\texit ;;\n    SX-4:SUPER-UX:*:*)\n\techo sx4-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-5:SUPER-UX:*:*)\n\techo sx5-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-6:SUPER-UX:*:*)\n\techo sx6-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-7:SUPER-UX:*:*)\n\techo sx7-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8:SUPER-UX:*:*)\n\techo sx8-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8R:SUPER-UX:*:*)\n\techo sx8r-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-ACE:SUPER-UX:*:*)\n\techo sxace-nec-superux${UNAME_RELEASE}\n\texit ;;\n    Power*:Rhapsody:*:*)\n\techo powerpc-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Rhapsody:*:*)\n\techo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Darwin:*:*)\n\tUNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown\n\teval $set_cc_for_build\n\tif test \"$UNAME_PROCESSOR\" = unknown ; then\n\t    UNAME_PROCESSOR=powerpc\n\tfi\n\tif test `echo \"$UNAME_RELEASE\" | sed -e 's/\\..*//'` -le 10 ; then\n\t    if [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t\tif (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t    (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\t    grep IS_64BIT_ARCH >/dev/null\n\t\tthen\n\t\t    case $UNAME_PROCESSOR in\n\t\t\ti386) UNAME_PROCESSOR=x86_64 ;;\n\t\t\tpowerpc) UNAME_PROCESSOR=powerpc64 ;;\n\t\t    esac\n\t\tfi\n\t    fi\n\telif test \"$UNAME_PROCESSOR\" = i386 ; then\n\t    # Avoid executing cc on OS X 10.9, as it ships with a stub\n\t    # that puts up a graphical alert prompting to install\n\t    # developer tools.  Any system running Mac OS X 10.7 or\n\t    # later (Darwin 11 and later) is required to have a 64-bit\n\t    # processor. This is not true of the ARM version of Darwin\n\t    # that Apple uses in portable devices.\n\t    UNAME_PROCESSOR=x86_64\n\tfi\n\techo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}\n\texit ;;\n    *:procnto*:*:* | *:QNX:[0123456789]*:*)\n\tUNAME_PROCESSOR=`uname -p`\n\tif test \"$UNAME_PROCESSOR\" = x86; then\n\t\tUNAME_PROCESSOR=i386\n\t\tUNAME_MACHINE=pc\n\tfi\n\techo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}\n\texit ;;\n    *:QNX:*:4*)\n\techo i386-pc-qnx\n\texit ;;\n    NEO-?:NONSTOP_KERNEL:*:*)\n\techo neo-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSE-*:NONSTOP_KERNEL:*:*)\n\techo nse-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSR-?:NONSTOP_KERNEL:*:*)\n\techo nsr-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    *:NonStop-UX:*:*)\n\techo mips-compaq-nonstopux\n\texit ;;\n    BS2000:POSIX*:*:*)\n\techo bs2000-siemens-sysv\n\texit ;;\n    DS/*:UNIX_System_V:*:*)\n\techo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}\n\texit ;;\n    *:Plan9:*:*)\n\t# \"uname -m\" is not consistent, so use $cputype instead. 386\n\t# is converted to i386 for consistency with other x86\n\t# operating systems.\n\tif test \"$cputype\" = 386; then\n\t    UNAME_MACHINE=i386\n\telse\n\t    UNAME_MACHINE=\"$cputype\"\n\tfi\n\techo ${UNAME_MACHINE}-unknown-plan9\n\texit ;;\n    *:TOPS-10:*:*)\n\techo pdp10-unknown-tops10\n\texit ;;\n    *:TENEX:*:*)\n\techo pdp10-unknown-tenex\n\texit ;;\n    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)\n\techo pdp10-dec-tops20\n\texit ;;\n    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)\n\techo pdp10-xkl-tops20\n\texit ;;\n    *:TOPS-20:*:*)\n\techo pdp10-unknown-tops20\n\texit ;;\n    *:ITS:*:*)\n\techo pdp10-unknown-its\n\texit ;;\n    SEI:*:*:SEIUX)\n\techo mips-sei-seiux${UNAME_RELEASE}\n\texit ;;\n    *:DragonFly:*:*)\n\techo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit ;;\n    *:*VMS:*:*)\n\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\tcase \"${UNAME_MACHINE}\" in\n\t    A*) echo alpha-dec-vms ; exit ;;\n\t    I*) echo ia64-dec-vms ; exit ;;\n\t    V*) echo vax-dec-vms ; exit ;;\n\tesac ;;\n    *:XENIX:*:SysV)\n\techo i386-pc-xenix\n\texit ;;\n    i*86:skyos:*:*)\n\techo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`\n\texit ;;\n    i*86:rdos:*:*)\n\techo ${UNAME_MACHINE}-pc-rdos\n\texit ;;\n    i*86:AROS:*:*)\n\techo ${UNAME_MACHINE}-pc-aros\n\texit ;;\n    x86_64:VMkernel:*:*)\n\techo ${UNAME_MACHINE}-unknown-esx\n\texit ;;\n    amd64:Isilon\\ OneFS:*:*)\n\techo x86_64-unknown-onefs\n\texit ;;\nesac\n\ncat >&2 <<EOF\n$0: unable to guess system type\n\nThis script (version $timestamp), has failed to recognize the\noperating system you are using. If your script is old, overwrite\nconfig.guess and config.sub with the latest versions from:\n\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\nand\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\nIf $0 has already been updated, send the following data and any\ninformation you think might be pertinent to config-patches@gnu.org to\nprovide the necessary information to handle your system.\n\nconfig.guess timestamp = $timestamp\n\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`\n\nhostinfo               = `(hostinfo) 2>/dev/null`\n/bin/universe          = `(/bin/universe) 2>/dev/null`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`\n/bin/arch              = `(/bin/arch) 2>/dev/null`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n\nUNAME_MACHINE = ${UNAME_MACHINE}\nUNAME_RELEASE = ${UNAME_RELEASE}\nUNAME_SYSTEM  = ${UNAME_SYSTEM}\nUNAME_VERSION = ${UNAME_VERSION}\nEOF\n\nexit 1\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "scripts/config.sub",
    "content": "#! /bin/sh\n# Configuration validation subroutine script.\n#   Copyright 1992-2017 Free Software Foundation, Inc.\n\ntimestamp='2017-01-01'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n\n\n# Please send patches to <config-patches@gnu.org>.\n#\n# Configuration subroutine to validate and canonicalize a configuration type.\n# Supply the specified configuration type as an argument.\n# If it is invalid, we print an error message on stderr and exit with code 1.\n# Otherwise, we print the canonical config type on stdout and succeed.\n\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\n# This file is supposed to be the same for all GNU packages\n# and recognize all the CPU types, system types and aliases\n# that are meaningful with *any* GNU software.\n# Each package is responsible for reporting which valid configurations\n# it does not support.  The user should be able to distinguish\n# a failure to support a valid configuration from a meaningless\n# configuration.\n\n# The goal of this file is to map all the various variations of a given\n# machine specification into a single specification in the form:\n#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n# or in some cases, the newer four-part form:\n#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n# It is wrong to echo any other type of specification.\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS\n\nCanonicalize a configuration name.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.sub ($timestamp)\n\nCopyright 1992-2017 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\"\n       exit 1 ;;\n\n    *local*)\n       # First pass through any local machine types.\n       echo $1\n       exit ;;\n\n    * )\n       break ;;\n  esac\ndone\n\ncase $# in\n 0) echo \"$me: missing argument$help\" >&2\n    exit 1;;\n 1) ;;\n *) echo \"$me: too many arguments$help\" >&2\n    exit 1;;\nesac\n\n# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).\n# Here we must recognize all the valid KERNEL-OS combinations.\nmaybe_os=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\2/'`\ncase $maybe_os in\n  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \\\n  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \\\n  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \\\n  kopensolaris*-gnu* | cloudabi*-eabi* | \\\n  storm-chaos* | os2-emx* | rtmk-nova*)\n    os=-$maybe_os\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`\n    ;;\n  android-linux)\n    os=-linux-android\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`-unknown\n    ;;\n  *)\n    basic_machine=`echo $1 | sed 's/-[^-]*$//'`\n    if [ $basic_machine != $1 ]\n    then os=`echo $1 | sed 's/.*-/-/'`\n    else os=; fi\n    ;;\nesac\n\n### Let's recognize common machines as not being operating systems so\n### that things like config.sub decstation-3100 work.  We also\n### recognize some manufacturers as not being operating systems, so we\n### can provide default operating systems below.\ncase $os in\n\t-sun*os*)\n\t\t# Prevent following clause from handling this invalid input.\n\t\t;;\n\t-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \\\n\t-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \\\n\t-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \\\n\t-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\\\n\t-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \\\n\t-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \\\n\t-apple | -axis | -knuth | -cray | -microblaze*)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-bluegene*)\n\t\tos=-cnk\n\t\t;;\n\t-sim | -cisco | -oki | -wec | -winbond)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-scout)\n\t\t;;\n\t-wrs)\n\t\tos=-vxworks\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusos*)\n\t\tos=-chorusos\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusrdb)\n\t\tos=-chorusrdb\n\t\tbasic_machine=$1\n\t\t;;\n\t-hiux*)\n\t\tos=-hiuxwe2\n\t\t;;\n\t-sco6)\n\t\tos=-sco5v6\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5)\n\t\tos=-sco3.2v5\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco4)\n\t\tos=-sco3.2v4\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2.[4-9]*)\n\t\tos=`echo $os | sed -e 's/sco3.2./sco3.2v/'`\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2v[4-9]*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5v6*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco*)\n\t\tos=-sco3.2v2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-udk*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-isc)\n\t\tos=-isc2.2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-clix*)\n\t\tbasic_machine=clipper-intergraph\n\t\t;;\n\t-isc*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-lynx*178)\n\t\tos=-lynxos178\n\t\t;;\n\t-lynx*5)\n\t\tos=-lynxos5\n\t\t;;\n\t-lynx*)\n\t\tos=-lynxos\n\t\t;;\n\t-ptx*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`\n\t\t;;\n\t-windowsnt*)\n\t\tos=`echo $os | sed -e 's/windowsnt/winnt/'`\n\t\t;;\n\t-psos*)\n\t\tos=-psos\n\t\t;;\n\t-mint | -mint[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\nesac\n\n# Decode aliases for certain CPU-COMPANY combinations.\ncase $basic_machine in\n\t# Recognize the basic CPU types without company name.\n\t# Some are omitted here because they have special meanings below.\n\t1750a | 580 \\\n\t| a29k \\\n\t| aarch64 | aarch64_be \\\n\t| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \\\n\t| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \\\n\t| am33_2.0 \\\n\t| arc | arceb \\\n\t| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \\\n\t| avr | avr32 \\\n\t| ba \\\n\t| be32 | be64 \\\n\t| bfin \\\n\t| c4x | c8051 | clipper \\\n\t| d10v | d30v | dlx | dsp16xx \\\n\t| e2k | epiphany \\\n\t| fido | fr30 | frv | ft32 \\\n\t| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \\\n\t| hexagon \\\n\t| i370 | i860 | i960 | ia64 \\\n\t| ip2k | iq2000 \\\n\t| k1om \\\n\t| le32 | le64 \\\n\t| lm32 \\\n\t| m32c | m32r | m32rle | m68000 | m68k | m88k \\\n\t| maxq | mb | microblaze | microblazeel | mcore | mep | metag \\\n\t| mips | mipsbe | mipseb | mipsel | mipsle \\\n\t| mips16 \\\n\t| mips64 | mips64el \\\n\t| mips64octeon | mips64octeonel \\\n\t| mips64orion | mips64orionel \\\n\t| mips64r5900 | mips64r5900el \\\n\t| mips64vr | mips64vrel \\\n\t| mips64vr4100 | mips64vr4100el \\\n\t| mips64vr4300 | mips64vr4300el \\\n\t| mips64vr5000 | mips64vr5000el \\\n\t| mips64vr5900 | mips64vr5900el \\\n\t| mipsisa32 | mipsisa32el \\\n\t| mipsisa32r2 | mipsisa32r2el \\\n\t| mipsisa32r6 | mipsisa32r6el \\\n\t| mipsisa64 | mipsisa64el \\\n\t| mipsisa64r2 | mipsisa64r2el \\\n\t| mipsisa64r6 | mipsisa64r6el \\\n\t| mipsisa64sb1 | mipsisa64sb1el \\\n\t| mipsisa64sr71k | mipsisa64sr71kel \\\n\t| mipsr5900 | mipsr5900el \\\n\t| mipstx39 | mipstx39el \\\n\t| mn10200 | mn10300 \\\n\t| moxie \\\n\t| mt \\\n\t| msp430 \\\n\t| nds32 | nds32le | nds32be \\\n\t| nios | nios2 | nios2eb | nios2el \\\n\t| ns16k | ns32k \\\n\t| open8 | or1k | or1knd | or32 \\\n\t| pdp10 | pdp11 | pj | pjl \\\n\t| powerpc | powerpc64 | powerpc64le | powerpcle \\\n\t| pru \\\n\t| pyramid \\\n\t| riscv32 | riscv64 \\\n\t| rl78 | rx \\\n\t| score \\\n\t| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \\\n\t| sh64 | sh64le \\\n\t| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \\\n\t| sparcv8 | sparcv9 | sparcv9b | sparcv9v \\\n\t| spu \\\n\t| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \\\n\t| ubicom32 \\\n\t| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \\\n\t| visium \\\n\t| we32k \\\n\t| x86 | xc16x | xstormy16 | xtensa \\\n\t| z8k | z80)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\tc54x)\n\t\tbasic_machine=tic54x-unknown\n\t\t;;\n\tc55x)\n\t\tbasic_machine=tic55x-unknown\n\t\t;;\n\tc6x)\n\t\tbasic_machine=tic6x-unknown\n\t\t;;\n\tleon|leon[3-9])\n\t\tbasic_machine=sparc-$basic_machine\n\t\t;;\n\tm6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\tm88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)\n\t\t;;\n\tms1)\n\t\tbasic_machine=mt-unknown\n\t\t;;\n\n\tstrongarm | thumb | xscale)\n\t\tbasic_machine=arm-unknown\n\t\t;;\n\txgate)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\txscaleeb)\n\t\tbasic_machine=armeb-unknown\n\t\t;;\n\n\txscaleel)\n\t\tbasic_machine=armel-unknown\n\t\t;;\n\n\t# We use `pc' rather than `unknown'\n\t# because (1) that's what they normally are, and\n\t# (2) the word \"unknown\" tends to confuse beginning users.\n\ti*86 | x86_64)\n\t  basic_machine=$basic_machine-pc\n\t  ;;\n\t# Object if more than one company name word.\n\t*-*-*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\n\t# Recognize the basic CPU types with company name.\n\t580-* \\\n\t| a29k-* \\\n\t| aarch64-* | aarch64_be-* \\\n\t| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \\\n\t| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \\\n\t| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \\\n\t| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \\\n\t| avr-* | avr32-* \\\n\t| ba-* \\\n\t| be32-* | be64-* \\\n\t| bfin-* | bs2000-* \\\n\t| c[123]* | c30-* | [cjt]90-* | c4x-* \\\n\t| c8051-* | clipper-* | craynv-* | cydra-* \\\n\t| d10v-* | d30v-* | dlx-* \\\n\t| e2k-* | elxsi-* \\\n\t| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \\\n\t| h8300-* | h8500-* \\\n\t| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \\\n\t| hexagon-* \\\n\t| i*86-* | i860-* | i960-* | ia64-* \\\n\t| ip2k-* | iq2000-* \\\n\t| k1om-* \\\n\t| le32-* | le64-* \\\n\t| lm32-* \\\n\t| m32c-* | m32r-* | m32rle-* \\\n\t| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \\\n\t| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \\\n\t| microblaze-* | microblazeel-* \\\n\t| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \\\n\t| mips16-* \\\n\t| mips64-* | mips64el-* \\\n\t| mips64octeon-* | mips64octeonel-* \\\n\t| mips64orion-* | mips64orionel-* \\\n\t| mips64r5900-* | mips64r5900el-* \\\n\t| mips64vr-* | mips64vrel-* \\\n\t| mips64vr4100-* | mips64vr4100el-* \\\n\t| mips64vr4300-* | mips64vr4300el-* \\\n\t| mips64vr5000-* | mips64vr5000el-* \\\n\t| mips64vr5900-* | mips64vr5900el-* \\\n\t| mipsisa32-* | mipsisa32el-* \\\n\t| mipsisa32r2-* | mipsisa32r2el-* \\\n\t| mipsisa32r6-* | mipsisa32r6el-* \\\n\t| mipsisa64-* | mipsisa64el-* \\\n\t| mipsisa64r2-* | mipsisa64r2el-* \\\n\t| mipsisa64r6-* | mipsisa64r6el-* \\\n\t| mipsisa64sb1-* | mipsisa64sb1el-* \\\n\t| mipsisa64sr71k-* | mipsisa64sr71kel-* \\\n\t| mipsr5900-* | mipsr5900el-* \\\n\t| mipstx39-* | mipstx39el-* \\\n\t| mmix-* \\\n\t| mt-* \\\n\t| msp430-* \\\n\t| nds32-* | nds32le-* | nds32be-* \\\n\t| nios-* | nios2-* | nios2eb-* | nios2el-* \\\n\t| none-* | np1-* | ns16k-* | ns32k-* \\\n\t| open8-* \\\n\t| or1k*-* \\\n\t| orion-* \\\n\t| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \\\n\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \\\n\t| pru-* \\\n\t| pyramid-* \\\n\t| riscv32-* | riscv64-* \\\n\t| rl78-* | romp-* | rs6000-* | rx-* \\\n\t| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \\\n\t| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \\\n\t| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \\\n\t| sparclite-* \\\n\t| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \\\n\t| tahoe-* \\\n\t| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \\\n\t| tile*-* \\\n\t| tron-* \\\n\t| ubicom32-* \\\n\t| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \\\n\t| vax-* \\\n\t| visium-* \\\n\t| we32k-* \\\n\t| x86-* | x86_64-* | xc16x-* | xps100-* \\\n\t| xstormy16-* | xtensa*-* \\\n\t| ymp-* \\\n\t| z8k-* | z80-*)\n\t\t;;\n\t# Recognize the basic CPU types without company name, with glob match.\n\txtensa*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\t# Recognize the various machine names and aliases which stand\n\t# for a CPU type and a company and sometimes even an OS.\n\t386bsd)\n\t\tbasic_machine=i386-unknown\n\t\tos=-bsd\n\t\t;;\n\t3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)\n\t\tbasic_machine=m68000-att\n\t\t;;\n\t3b*)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\ta29khif)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tabacus)\n\t\tbasic_machine=abacus-unknown\n\t\t;;\n\tadobe68k)\n\t\tbasic_machine=m68010-adobe\n\t\tos=-scout\n\t\t;;\n\talliant | fx80)\n\t\tbasic_machine=fx80-alliant\n\t\t;;\n\taltos | altos3068)\n\t\tbasic_machine=m68k-altos\n\t\t;;\n\tam29k)\n\t\tbasic_machine=a29k-none\n\t\tos=-bsd\n\t\t;;\n\tamd64)\n\t\tbasic_machine=x86_64-pc\n\t\t;;\n\tamd64-*)\n\t\tbasic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tamdahl)\n\t\tbasic_machine=580-amdahl\n\t\tos=-sysv\n\t\t;;\n\tamiga | amiga-*)\n\t\tbasic_machine=m68k-unknown\n\t\t;;\n\tamigaos | amigados)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-amigaos\n\t\t;;\n\tamigaunix | amix)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-sysv4\n\t\t;;\n\tapollo68)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-sysv\n\t\t;;\n\tapollo68bsd)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-bsd\n\t\t;;\n\taros)\n\t\tbasic_machine=i386-pc\n\t\tos=-aros\n\t\t;;\n\tasmjs)\n\t\tbasic_machine=asmjs-unknown\n\t\t;;\n\taux)\n\t\tbasic_machine=m68k-apple\n\t\tos=-aux\n\t\t;;\n\tbalance)\n\t\tbasic_machine=ns32k-sequent\n\t\tos=-dynix\n\t\t;;\n\tblackfin)\n\t\tbasic_machine=bfin-unknown\n\t\tos=-linux\n\t\t;;\n\tblackfin-*)\n\t\tbasic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tbluegene*)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-cnk\n\t\t;;\n\tc54x-*)\n\t\tbasic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc55x-*)\n\t\tbasic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc6x-*)\n\t\tbasic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc90)\n\t\tbasic_machine=c90-cray\n\t\tos=-unicos\n\t\t;;\n\tcegcc)\n\t\tbasic_machine=arm-unknown\n\t\tos=-cegcc\n\t\t;;\n\tconvex-c1)\n\t\tbasic_machine=c1-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c2)\n\t\tbasic_machine=c2-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c32)\n\t\tbasic_machine=c32-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c34)\n\t\tbasic_machine=c34-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c38)\n\t\tbasic_machine=c38-convex\n\t\tos=-bsd\n\t\t;;\n\tcray | j90)\n\t\tbasic_machine=j90-cray\n\t\tos=-unicos\n\t\t;;\n\tcraynv)\n\t\tbasic_machine=craynv-cray\n\t\tos=-unicosmp\n\t\t;;\n\tcr16 | cr16-*)\n\t\tbasic_machine=cr16-unknown\n\t\tos=-elf\n\t\t;;\n\tcrds | unos)\n\t\tbasic_machine=m68k-crds\n\t\t;;\n\tcrisv32 | crisv32-* | etraxfs*)\n\t\tbasic_machine=crisv32-axis\n\t\t;;\n\tcris | cris-* | etrax*)\n\t\tbasic_machine=cris-axis\n\t\t;;\n\tcrx)\n\t\tbasic_machine=crx-unknown\n\t\tos=-elf\n\t\t;;\n\tda30 | da30-*)\n\t\tbasic_machine=m68k-da30\n\t\t;;\n\tdecstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)\n\t\tbasic_machine=mips-dec\n\t\t;;\n\tdecsystem10* | dec10*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops10\n\t\t;;\n\tdecsystem20* | dec20*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops20\n\t\t;;\n\tdelta | 3300 | motorola-3300 | motorola-delta \\\n\t      | 3300-motorola | delta-motorola)\n\t\tbasic_machine=m68k-motorola\n\t\t;;\n\tdelta88)\n\t\tbasic_machine=m88k-motorola\n\t\tos=-sysv3\n\t\t;;\n\tdicos)\n\t\tbasic_machine=i686-pc\n\t\tos=-dicos\n\t\t;;\n\tdjgpp)\n\t\tbasic_machine=i586-pc\n\t\tos=-msdosdjgpp\n\t\t;;\n\tdpx20 | dpx20-*)\n\t\tbasic_machine=rs6000-bull\n\t\tos=-bosx\n\t\t;;\n\tdpx2* | dpx2*-bull)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv3\n\t\t;;\n\te500v[12])\n\t\tbasic_machine=powerpc-unknown\n\t\tos=$os\"spe\"\n\t\t;;\n\te500v[12]-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=$os\"spe\"\n\t\t;;\n\tebmon29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-ebmon\n\t\t;;\n\telxsi)\n\t\tbasic_machine=elxsi-elxsi\n\t\tos=-bsd\n\t\t;;\n\tencore | umax | mmax)\n\t\tbasic_machine=ns32k-encore\n\t\t;;\n\tes1800 | OSE68k | ose68k | ose | OSE)\n\t\tbasic_machine=m68k-ericsson\n\t\tos=-ose\n\t\t;;\n\tfx2800)\n\t\tbasic_machine=i860-alliant\n\t\t;;\n\tgenix)\n\t\tbasic_machine=ns32k-ns\n\t\t;;\n\tgmicro)\n\t\tbasic_machine=tron-gmicro\n\t\tos=-sysv\n\t\t;;\n\tgo32)\n\t\tbasic_machine=i386-pc\n\t\tos=-go32\n\t\t;;\n\th3050r* | hiux*)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\th8300hms)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-hms\n\t\t;;\n\th8300xray)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-xray\n\t\t;;\n\th8500hms)\n\t\tbasic_machine=h8500-hitachi\n\t\tos=-hms\n\t\t;;\n\tharris)\n\t\tbasic_machine=m88k-harris\n\t\tos=-sysv3\n\t\t;;\n\thp300-*)\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp300bsd)\n\t\tbasic_machine=m68k-hp\n\t\tos=-bsd\n\t\t;;\n\thp300hpux)\n\t\tbasic_machine=m68k-hp\n\t\tos=-hpux\n\t\t;;\n\thp3k9[0-9][0-9] | hp9[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k2[0-9][0-9] | hp9k31[0-9])\n\t\tbasic_machine=m68000-hp\n\t\t;;\n\thp9k3[2-9][0-9])\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp9k6[0-9][0-9] | hp6[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k7[0-79][0-9] | hp7[0-79][0-9])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k78[0-9] | hp78[0-9])\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][13679] | hp8[0-9][13679])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][0-9] | hp8[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thppa-next)\n\t\tos=-nextstep3\n\t\t;;\n\thppaosf)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-osf\n\t\t;;\n\thppro)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-proelf\n\t\t;;\n\ti370-ibm* | ibm*)\n\t\tbasic_machine=i370-ibm\n\t\t;;\n\ti*86v32)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv32\n\t\t;;\n\ti*86v4*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv4\n\t\t;;\n\ti*86v)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv\n\t\t;;\n\ti*86sol2)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-solaris2\n\t\t;;\n\ti386mach)\n\t\tbasic_machine=i386-mach\n\t\tos=-mach\n\t\t;;\n\ti386-vsta | vsta)\n\t\tbasic_machine=i386-unknown\n\t\tos=-vsta\n\t\t;;\n\tiris | iris4d)\n\t\tbasic_machine=mips-sgi\n\t\tcase $os in\n\t\t    -irix*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-irix4\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tisi68 | isi)\n\t\tbasic_machine=m68k-isi\n\t\tos=-sysv\n\t\t;;\n\tleon-*|leon[3-9]-*)\n\t\tbasic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`\n\t\t;;\n\tm68knommu)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-linux\n\t\t;;\n\tm68knommu-*)\n\t\tbasic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tm88k-omron*)\n\t\tbasic_machine=m88k-omron\n\t\t;;\n\tmagnum | m3230)\n\t\tbasic_machine=mips-mips\n\t\tos=-sysv\n\t\t;;\n\tmerlin)\n\t\tbasic_machine=ns32k-utek\n\t\tos=-sysv\n\t\t;;\n\tmicroblaze*)\n\t\tbasic_machine=microblaze-xilinx\n\t\t;;\n\tmingw64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-mingw64\n\t\t;;\n\tmingw32)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\tmingw32ce)\n\t\tbasic_machine=arm-unknown\n\t\tos=-mingw32ce\n\t\t;;\n\tminiframe)\n\t\tbasic_machine=m68000-convergent\n\t\t;;\n\t*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\n\tmips3*-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`\n\t\t;;\n\tmips3*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown\n\t\t;;\n\tmonitor)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\tmorphos)\n\t\tbasic_machine=powerpc-unknown\n\t\tos=-morphos\n\t\t;;\n\tmoxiebox)\n\t\tbasic_machine=moxie-unknown\n\t\tos=-moxiebox\n\t\t;;\n\tmsdos)\n\t\tbasic_machine=i386-pc\n\t\tos=-msdos\n\t\t;;\n\tms1-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`\n\t\t;;\n\tmsys)\n\t\tbasic_machine=i686-pc\n\t\tos=-msys\n\t\t;;\n\tmvs)\n\t\tbasic_machine=i370-ibm\n\t\tos=-mvs\n\t\t;;\n\tnacl)\n\t\tbasic_machine=le32-unknown\n\t\tos=-nacl\n\t\t;;\n\tncr3000)\n\t\tbasic_machine=i486-ncr\n\t\tos=-sysv4\n\t\t;;\n\tnetbsd386)\n\t\tbasic_machine=i386-unknown\n\t\tos=-netbsd\n\t\t;;\n\tnetwinder)\n\t\tbasic_machine=armv4l-rebel\n\t\tos=-linux\n\t\t;;\n\tnews | news700 | news800 | news900)\n\t\tbasic_machine=m68k-sony\n\t\tos=-newsos\n\t\t;;\n\tnews1000)\n\t\tbasic_machine=m68030-sony\n\t\tos=-newsos\n\t\t;;\n\tnews-3600 | risc-news)\n\t\tbasic_machine=mips-sony\n\t\tos=-newsos\n\t\t;;\n\tnecv70)\n\t\tbasic_machine=v70-nec\n\t\tos=-sysv\n\t\t;;\n\tnext | m*-next )\n\t\tbasic_machine=m68k-next\n\t\tcase $os in\n\t\t    -nextstep* )\n\t\t\t;;\n\t\t    -ns2*)\n\t\t      os=-nextstep2\n\t\t\t;;\n\t\t    *)\n\t\t      os=-nextstep3\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tnh3000)\n\t\tbasic_machine=m68k-harris\n\t\tos=-cxux\n\t\t;;\n\tnh[45]000)\n\t\tbasic_machine=m88k-harris\n\t\tos=-cxux\n\t\t;;\n\tnindy960)\n\t\tbasic_machine=i960-intel\n\t\tos=-nindy\n\t\t;;\n\tmon960)\n\t\tbasic_machine=i960-intel\n\t\tos=-mon960\n\t\t;;\n\tnonstopux)\n\t\tbasic_machine=mips-compaq\n\t\tos=-nonstopux\n\t\t;;\n\tnp1)\n\t\tbasic_machine=np1-gould\n\t\t;;\n\tneo-tandem)\n\t\tbasic_machine=neo-tandem\n\t\t;;\n\tnse-tandem)\n\t\tbasic_machine=nse-tandem\n\t\t;;\n\tnsr-tandem)\n\t\tbasic_machine=nsr-tandem\n\t\t;;\n\top50n-* | op60c-*)\n\t\tbasic_machine=hppa1.1-oki\n\t\tos=-proelf\n\t\t;;\n\topenrisc | openrisc-*)\n\t\tbasic_machine=or32-unknown\n\t\t;;\n\tos400)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-os400\n\t\t;;\n\tOSE68000 | ose68000)\n\t\tbasic_machine=m68000-ericsson\n\t\tos=-ose\n\t\t;;\n\tos68k)\n\t\tbasic_machine=m68k-none\n\t\tos=-os68k\n\t\t;;\n\tpa-hitachi)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\tparagon)\n\t\tbasic_machine=i860-intel\n\t\tos=-osf\n\t\t;;\n\tparisc)\n\t\tbasic_machine=hppa-unknown\n\t\tos=-linux\n\t\t;;\n\tparisc-*)\n\t\tbasic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tpbd)\n\t\tbasic_machine=sparc-tti\n\t\t;;\n\tpbb)\n\t\tbasic_machine=m68k-tti\n\t\t;;\n\tpc532 | pc532-*)\n\t\tbasic_machine=ns32k-pc532\n\t\t;;\n\tpc98)\n\t\tbasic_machine=i386-pc\n\t\t;;\n\tpc98-*)\n\t\tbasic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium | p5 | k5 | k6 | nexgen | viac3)\n\t\tbasic_machine=i586-pc\n\t\t;;\n\tpentiumpro | p6 | 6x86 | athlon | athlon_*)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentiumii | pentium2 | pentiumiii | pentium3)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentium4)\n\t\tbasic_machine=i786-pc\n\t\t;;\n\tpentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)\n\t\tbasic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumpro-* | p6-* | 6x86-* | athlon-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium4-*)\n\t\tbasic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpn)\n\t\tbasic_machine=pn-gould\n\t\t;;\n\tpower)\tbasic_machine=power-ibm\n\t\t;;\n\tppc | ppcbe)\tbasic_machine=powerpc-unknown\n\t\t;;\n\tppc-* | ppcbe-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppcle | powerpclittle)\n\t\tbasic_machine=powerpcle-unknown\n\t\t;;\n\tppcle-* | powerpclittle-*)\n\t\tbasic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64)\tbasic_machine=powerpc64-unknown\n\t\t;;\n\tppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64le | powerpc64little)\n\t\tbasic_machine=powerpc64le-unknown\n\t\t;;\n\tppc64le-* | powerpc64little-*)\n\t\tbasic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tps2)\n\t\tbasic_machine=i386-ibm\n\t\t;;\n\tpw32)\n\t\tbasic_machine=i586-unknown\n\t\tos=-pw32\n\t\t;;\n\trdos | rdos64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-rdos\n\t\t;;\n\trdos32)\n\t\tbasic_machine=i386-pc\n\t\tos=-rdos\n\t\t;;\n\trom68k)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\trm[46]00)\n\t\tbasic_machine=mips-siemens\n\t\t;;\n\trtpc | rtpc-*)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\ts390 | s390-*)\n\t\tbasic_machine=s390-ibm\n\t\t;;\n\ts390x | s390x-*)\n\t\tbasic_machine=s390x-ibm\n\t\t;;\n\tsa29200)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tsb1)\n\t\tbasic_machine=mipsisa64sb1-unknown\n\t\t;;\n\tsb1el)\n\t\tbasic_machine=mipsisa64sb1el-unknown\n\t\t;;\n\tsde)\n\t\tbasic_machine=mipsisa32-sde\n\t\tos=-elf\n\t\t;;\n\tsei)\n\t\tbasic_machine=mips-sei\n\t\tos=-seiux\n\t\t;;\n\tsequent)\n\t\tbasic_machine=i386-sequent\n\t\t;;\n\tsh)\n\t\tbasic_machine=sh-hitachi\n\t\tos=-hms\n\t\t;;\n\tsh5el)\n\t\tbasic_machine=sh5le-unknown\n\t\t;;\n\tsh64)\n\t\tbasic_machine=sh64-unknown\n\t\t;;\n\tsparclite-wrs | simso-wrs)\n\t\tbasic_machine=sparclite-wrs\n\t\tos=-vxworks\n\t\t;;\n\tsps7)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv2\n\t\t;;\n\tspur)\n\t\tbasic_machine=spur-unknown\n\t\t;;\n\tst2000)\n\t\tbasic_machine=m68k-tandem\n\t\t;;\n\tstratus)\n\t\tbasic_machine=i860-stratus\n\t\tos=-sysv4\n\t\t;;\n\tstrongarm-* | thumb-*)\n\t\tbasic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tsun2)\n\t\tbasic_machine=m68000-sun\n\t\t;;\n\tsun2os3)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun2os4)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun3os3)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun3os4)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4os3)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun4os4)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4sol2)\n\t\tbasic_machine=sparc-sun\n\t\tos=-solaris2\n\t\t;;\n\tsun3 | sun3-*)\n\t\tbasic_machine=m68k-sun\n\t\t;;\n\tsun4)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tsun386 | sun386i | roadrunner)\n\t\tbasic_machine=i386-sun\n\t\t;;\n\tsv1)\n\t\tbasic_machine=sv1-cray\n\t\tos=-unicos\n\t\t;;\n\tsymmetry)\n\t\tbasic_machine=i386-sequent\n\t\tos=-dynix\n\t\t;;\n\tt3e)\n\t\tbasic_machine=alphaev5-cray\n\t\tos=-unicos\n\t\t;;\n\tt90)\n\t\tbasic_machine=t90-cray\n\t\tos=-unicos\n\t\t;;\n\ttile*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-linux-gnu\n\t\t;;\n\ttx39)\n\t\tbasic_machine=mipstx39-unknown\n\t\t;;\n\ttx39el)\n\t\tbasic_machine=mipstx39el-unknown\n\t\t;;\n\ttoad1)\n\t\tbasic_machine=pdp10-xkl\n\t\tos=-tops20\n\t\t;;\n\ttower | tower-32)\n\t\tbasic_machine=m68k-ncr\n\t\t;;\n\ttpf)\n\t\tbasic_machine=s390x-ibm\n\t\tos=-tpf\n\t\t;;\n\tudi29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tultra3)\n\t\tbasic_machine=a29k-nyu\n\t\tos=-sym1\n\t\t;;\n\tv810 | necv810)\n\t\tbasic_machine=v810-nec\n\t\tos=-none\n\t\t;;\n\tvaxv)\n\t\tbasic_machine=vax-dec\n\t\tos=-sysv\n\t\t;;\n\tvms)\n\t\tbasic_machine=vax-dec\n\t\tos=-vms\n\t\t;;\n\tvpp*|vx|vx-*)\n\t\tbasic_machine=f301-fujitsu\n\t\t;;\n\tvxworks960)\n\t\tbasic_machine=i960-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks68)\n\t\tbasic_machine=m68k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks29k)\n\t\tbasic_machine=a29k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tw65*)\n\t\tbasic_machine=w65-wdc\n\t\tos=-none\n\t\t;;\n\tw89k-*)\n\t\tbasic_machine=hppa1.1-winbond\n\t\tos=-proelf\n\t\t;;\n\txbox)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\txps | xps100)\n\t\tbasic_machine=xps100-honeywell\n\t\t;;\n\txscale-* | xscalee[bl]-*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`\n\t\t;;\n\tymp)\n\t\tbasic_machine=ymp-cray\n\t\tos=-unicos\n\t\t;;\n\tz8k-*-coff)\n\t\tbasic_machine=z8k-unknown\n\t\tos=-sim\n\t\t;;\n\tz80-*-coff)\n\t\tbasic_machine=z80-unknown\n\t\tos=-sim\n\t\t;;\n\tnone)\n\t\tbasic_machine=none-none\n\t\tos=-none\n\t\t;;\n\n# Here we handle the default manufacturer of certain CPU types.  It is in\n# some cases the only manufacturer, in others, it is the most popular.\n\tw89k)\n\t\tbasic_machine=hppa1.1-winbond\n\t\t;;\n\top50n)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\top60c)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\tromp)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\tmmix)\n\t\tbasic_machine=mmix-knuth\n\t\t;;\n\trs6000)\n\t\tbasic_machine=rs6000-ibm\n\t\t;;\n\tvax)\n\t\tbasic_machine=vax-dec\n\t\t;;\n\tpdp10)\n\t\t# there are many clones, so DEC is not a safe bet\n\t\tbasic_machine=pdp10-unknown\n\t\t;;\n\tpdp11)\n\t\tbasic_machine=pdp11-dec\n\t\t;;\n\twe32k)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\tsh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)\n\t\tbasic_machine=sh-unknown\n\t\t;;\n\tsparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tcydra)\n\t\tbasic_machine=cydra-cydrome\n\t\t;;\n\torion)\n\t\tbasic_machine=orion-highlevel\n\t\t;;\n\torion105)\n\t\tbasic_machine=clipper-highlevel\n\t\t;;\n\tmac | mpw | mac-mpw)\n\t\tbasic_machine=m68k-apple\n\t\t;;\n\tpmac | pmac-mpw)\n\t\tbasic_machine=powerpc-apple\n\t\t;;\n\t*-unknown)\n\t\t# Make sure to match an already-canonicalized machine name.\n\t\t;;\n\t*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\n\n# Here we canonicalize certain aliases for manufacturers.\ncase $basic_machine in\n\t*-digital*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`\n\t\t;;\n\t*-commodore*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`\n\t\t;;\n\t*)\n\t\t;;\nesac\n\n# Decode manufacturer-specific aliases for certain operating systems.\n\nif [ x\"$os\" != x\"\" ]\nthen\ncase $os in\n\t# First match some system type aliases\n\t# that might get confused with valid system types.\n\t# -solaris* is a basic system type, with this one exception.\n\t-auroraux)\n\t\tos=-auroraux\n\t\t;;\n\t-solaris1 | -solaris1.*)\n\t\tos=`echo $os | sed -e 's|solaris1|sunos4|'`\n\t\t;;\n\t-solaris)\n\t\tos=-solaris2\n\t\t;;\n\t-svr4*)\n\t\tos=-sysv4\n\t\t;;\n\t-unixware*)\n\t\tos=-sysv4.2uw\n\t\t;;\n\t-gnu/linux*)\n\t\tos=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`\n\t\t;;\n\t# First accept the basic system types.\n\t# The portable systems comes first.\n\t# Each alternative MUST END IN A *, to match a version number.\n\t# -sysv* is not here because it comes later, after sysvr4.\n\t-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \\\n\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\\\n\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \\\n\t      | -sym* | -kopensolaris* | -plan9* \\\n\t      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \\\n\t      | -aos* | -aros* | -cloudabi* | -sortix* \\\n\t      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \\\n\t      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \\\n\t      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \\\n\t      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \\\n\t      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \\\n\t      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \\\n\t      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \\\n\t      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \\\n\t      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \\\n\t      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n\t      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \\\n\t      | -linux-newlib* | -linux-musl* | -linux-uclibc* \\\n\t      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \\\n\t      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \\\n\t      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \\\n\t      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \\\n\t      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \\\n\t      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \\\n\t      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \\\n\t      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \\\n\t      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)\n\t# Remember, each alternative MUST END IN *, to match a version number.\n\t\t;;\n\t-qnx*)\n\t\tcase $basic_machine in\n\t\t    x86-* | i*86-*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-nto$os\n\t\t\t;;\n\t\tesac\n\t\t;;\n\t-nto-qnx*)\n\t\t;;\n\t-nto*)\n\t\tos=`echo $os | sed -e 's|nto|nto-qnx|'`\n\t\t;;\n\t-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \\\n\t      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \\\n\t      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)\n\t\t;;\n\t-mac*)\n\t\tos=`echo $os | sed -e 's|mac|macos|'`\n\t\t;;\n\t-linux-dietlibc)\n\t\tos=-linux-dietlibc\n\t\t;;\n\t-linux*)\n\t\tos=`echo $os | sed -e 's|linux|linux-gnu|'`\n\t\t;;\n\t-sunos5*)\n\t\tos=`echo $os | sed -e 's|sunos5|solaris2|'`\n\t\t;;\n\t-sunos6*)\n\t\tos=`echo $os | sed -e 's|sunos6|solaris3|'`\n\t\t;;\n\t-opened*)\n\t\tos=-openedition\n\t\t;;\n\t-os400*)\n\t\tos=-os400\n\t\t;;\n\t-wince*)\n\t\tos=-wince\n\t\t;;\n\t-osfrose*)\n\t\tos=-osfrose\n\t\t;;\n\t-osf*)\n\t\tos=-osf\n\t\t;;\n\t-utek*)\n\t\tos=-bsd\n\t\t;;\n\t-dynix*)\n\t\tos=-bsd\n\t\t;;\n\t-acis*)\n\t\tos=-aos\n\t\t;;\n\t-atheos*)\n\t\tos=-atheos\n\t\t;;\n\t-syllable*)\n\t\tos=-syllable\n\t\t;;\n\t-386bsd)\n\t\tos=-bsd\n\t\t;;\n\t-ctix* | -uts*)\n\t\tos=-sysv\n\t\t;;\n\t-nova*)\n\t\tos=-rtmk-nova\n\t\t;;\n\t-ns2 )\n\t\tos=-nextstep2\n\t\t;;\n\t-nsk*)\n\t\tos=-nsk\n\t\t;;\n\t# Preserve the version number of sinix5.\n\t-sinix5.*)\n\t\tos=`echo $os | sed -e 's|sinix|sysv|'`\n\t\t;;\n\t-sinix*)\n\t\tos=-sysv4\n\t\t;;\n\t-tpf*)\n\t\tos=-tpf\n\t\t;;\n\t-triton*)\n\t\tos=-sysv3\n\t\t;;\n\t-oss*)\n\t\tos=-sysv3\n\t\t;;\n\t-svr4)\n\t\tos=-sysv4\n\t\t;;\n\t-svr3)\n\t\tos=-sysv3\n\t\t;;\n\t-sysvr4)\n\t\tos=-sysv4\n\t\t;;\n\t# This must come after -sysvr4.\n\t-sysv*)\n\t\t;;\n\t-ose*)\n\t\tos=-ose\n\t\t;;\n\t-es1800*)\n\t\tos=-ose\n\t\t;;\n\t-xenix)\n\t\tos=-xenix\n\t\t;;\n\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\tos=-mint\n\t\t;;\n\t-aros*)\n\t\tos=-aros\n\t\t;;\n\t-zvmoe)\n\t\tos=-zvmoe\n\t\t;;\n\t-dicos*)\n\t\tos=-dicos\n\t\t;;\n\t-nacl*)\n\t\t;;\n\t-ios)\n\t\t;;\n\t-none)\n\t\t;;\n\t*)\n\t\t# Get rid of the `-' at the beginning of $os.\n\t\tos=`echo $os | sed 's/[^-]*-//'`\n\t\techo Invalid configuration \\`$1\\': system \\`$os\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\nelse\n\n# Here we handle the default operating systems that come with various machines.\n# The value should be what the vendor currently ships out the door with their\n# machine or put another way, the most popular os provided with the machine.\n\n# Note that if you're going to try to match \"-MANUFACTURER\" here (say,\n# \"-sun\"), then you have to tell the case statement up towards the top\n# that MANUFACTURER isn't an operating system.  Otherwise, code above\n# will signal an error saying that MANUFACTURER isn't an operating\n# system, and we'll never get to this point.\n\ncase $basic_machine in\n\tscore-*)\n\t\tos=-elf\n\t\t;;\n\tspu-*)\n\t\tos=-elf\n\t\t;;\n\t*-acorn)\n\t\tos=-riscix1.2\n\t\t;;\n\tarm*-rebel)\n\t\tos=-linux\n\t\t;;\n\tarm*-semi)\n\t\tos=-aout\n\t\t;;\n\tc4x-* | tic4x-*)\n\t\tos=-coff\n\t\t;;\n\tc8051-*)\n\t\tos=-elf\n\t\t;;\n\thexagon-*)\n\t\tos=-elf\n\t\t;;\n\ttic54x-*)\n\t\tos=-coff\n\t\t;;\n\ttic55x-*)\n\t\tos=-coff\n\t\t;;\n\ttic6x-*)\n\t\tos=-coff\n\t\t;;\n\t# This must come before the *-dec entry.\n\tpdp10-*)\n\t\tos=-tops20\n\t\t;;\n\tpdp11-*)\n\t\tos=-none\n\t\t;;\n\t*-dec | vax-*)\n\t\tos=-ultrix4.2\n\t\t;;\n\tm68*-apollo)\n\t\tos=-domain\n\t\t;;\n\ti386-sun)\n\t\tos=-sunos4.0.2\n\t\t;;\n\tm68000-sun)\n\t\tos=-sunos3\n\t\t;;\n\tm68*-cisco)\n\t\tos=-aout\n\t\t;;\n\tmep-*)\n\t\tos=-elf\n\t\t;;\n\tmips*-cisco)\n\t\tos=-elf\n\t\t;;\n\tmips*-*)\n\t\tos=-elf\n\t\t;;\n\tor32-*)\n\t\tos=-coff\n\t\t;;\n\t*-tti)\t# must be before sparc entry or we get the wrong os.\n\t\tos=-sysv3\n\t\t;;\n\tsparc-* | *-sun)\n\t\tos=-sunos4.1.1\n\t\t;;\n\tpru-*)\n\t\tos=-elf\n\t\t;;\n\t*-be)\n\t\tos=-beos\n\t\t;;\n\t*-haiku)\n\t\tos=-haiku\n\t\t;;\n\t*-ibm)\n\t\tos=-aix\n\t\t;;\n\t*-knuth)\n\t\tos=-mmixware\n\t\t;;\n\t*-wec)\n\t\tos=-proelf\n\t\t;;\n\t*-winbond)\n\t\tos=-proelf\n\t\t;;\n\t*-oki)\n\t\tos=-proelf\n\t\t;;\n\t*-hp)\n\t\tos=-hpux\n\t\t;;\n\t*-hitachi)\n\t\tos=-hiux\n\t\t;;\n\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n\t\tos=-sysv\n\t\t;;\n\t*-cbm)\n\t\tos=-amigaos\n\t\t;;\n\t*-dg)\n\t\tos=-dgux\n\t\t;;\n\t*-dolphin)\n\t\tos=-sysv3\n\t\t;;\n\tm68k-ccur)\n\t\tos=-rtu\n\t\t;;\n\tm88k-omron*)\n\t\tos=-luna\n\t\t;;\n\t*-next )\n\t\tos=-nextstep\n\t\t;;\n\t*-sequent)\n\t\tos=-ptx\n\t\t;;\n\t*-crds)\n\t\tos=-unos\n\t\t;;\n\t*-ns)\n\t\tos=-genix\n\t\t;;\n\ti370-*)\n\t\tos=-mvs\n\t\t;;\n\t*-next)\n\t\tos=-nextstep3\n\t\t;;\n\t*-gould)\n\t\tos=-sysv\n\t\t;;\n\t*-highlevel)\n\t\tos=-bsd\n\t\t;;\n\t*-encore)\n\t\tos=-bsd\n\t\t;;\n\t*-sgi)\n\t\tos=-irix\n\t\t;;\n\t*-siemens)\n\t\tos=-sysv4\n\t\t;;\n\t*-masscomp)\n\t\tos=-rtu\n\t\t;;\n\tf30[01]-fujitsu | f700-fujitsu)\n\t\tos=-uxpv\n\t\t;;\n\t*-rom68k)\n\t\tos=-coff\n\t\t;;\n\t*-*bug)\n\t\tos=-coff\n\t\t;;\n\t*-apple)\n\t\tos=-macos\n\t\t;;\n\t*-atari*)\n\t\tos=-mint\n\t\t;;\n\t*)\n\t\tos=-none\n\t\t;;\nesac\nfi\n\n# Here we handle the case where we know the os, and the CPU type, but not the\n# manufacturer.  We pick the logical manufacturer.\nvendor=unknown\ncase $basic_machine in\n\t*-unknown)\n\t\tcase $os in\n\t\t\t-riscix*)\n\t\t\t\tvendor=acorn\n\t\t\t\t;;\n\t\t\t-sunos*)\n\t\t\t\tvendor=sun\n\t\t\t\t;;\n\t\t\t-cnk*|-aix*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-beos*)\n\t\t\t\tvendor=be\n\t\t\t\t;;\n\t\t\t-hpux*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-mpeix*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-hiux*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-unos*)\n\t\t\t\tvendor=crds\n\t\t\t\t;;\n\t\t\t-dgux*)\n\t\t\t\tvendor=dg\n\t\t\t\t;;\n\t\t\t-luna*)\n\t\t\t\tvendor=omron\n\t\t\t\t;;\n\t\t\t-genix*)\n\t\t\t\tvendor=ns\n\t\t\t\t;;\n\t\t\t-mvs* | -opened*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-os400*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-ptx*)\n\t\t\t\tvendor=sequent\n\t\t\t\t;;\n\t\t\t-tpf*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-vxsim* | -vxworks* | -windiss*)\n\t\t\t\tvendor=wrs\n\t\t\t\t;;\n\t\t\t-aux*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-hms*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-mpw* | -macos*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\t\t\tvendor=atari\n\t\t\t\t;;\n\t\t\t-vos*)\n\t\t\t\tvendor=stratus\n\t\t\t\t;;\n\t\tesac\n\t\tbasic_machine=`echo $basic_machine | sed \"s/unknown/$vendor/\"`\n\t\t;;\nesac\n\necho $basic_machine$os\nexit\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "scripts/get_hash_from_file.py",
    "content": "#!/usr/bin/env python\n\nimport os, sys\n\ndef get_pkg_hash_from_Packages(Packages_file, package, version, hash=\"SHA256\"):\n    with open(Packages_file, 'r') as Packages:\n        package_list = Packages.read().split('\\n\\n')\n    for pkg in package_list:\n        if pkg.split('\\n')[0] == \"Package: \"+package:\n            for line in pkg.split('\\n'):\n                # Assuming Filename: comes before Version:\n                if line.startswith('Filename:'):\n                    print(line.split(\" \")[1] + \" \")\n                elif line.startswith('Version:'):\n                    if line != 'Version: '+version:\n                        # Seems the repo contains the wrong version, or several versions\n                        # We can't use this one so continue looking\n                        break\n                elif line.startswith(hash):\n                    print(line.split(\" \")[1])\n                    break\n\ndef get_Packages_hash_from_Release(Release_file, arch, component, hash=\"SHA256\"):\n    string_to_find = component+'/binary-'+arch+'/Packages'\n    with open(Release_file, 'r') as Release:\n        hash_list = Release.readlines()\n    for i in range(len(hash_list)):\n        if hash_list[i].startswith(hash+':'):\n            break\n    for j in range(i, len(hash_list)):\n        if string_to_find in hash_list[j].strip(' '):\n            print(hash_list[j].strip(' ').split(' ')[0])\n            break\n\nif __name__ == '__main__':\n    if len(sys.argv) < 2:\n        sys.exit('Too few arguments, I need the path to a Packages file, a package name and a version, or an InRelease file, an architecture and a component name. Exiting')\n\n    if sys.argv[1].endswith('Packages'):\n        get_pkg_hash_from_Packages(sys.argv[1], sys.argv[2], sys.argv[3])\n    elif sys.argv[1].endswith(('InRelease', 'Release')):\n        get_Packages_hash_from_Release(sys.argv[1], sys.argv[2], sys.argv[3])\n    else:\n        sys.exit(sys.argv[1]+' does not seem to be a path to a Packages or InRelease/Release file')\n"
  },
  {
    "path": "scripts/ldd",
    "content": "#!/bin/sh\n\nobjdump -x $@ | grep NEEDED | cut -c 24- | sort\n"
  },
  {
    "path": "scripts/lint-packages.sh",
    "content": "#!/usr/bin/env bash\n\nset -e -u\n\nREPO_DIR=$(realpath \"$(dirname \"$0\")/../\")\nPACKAGES_DIR=\"$REPO_DIR/packages\"\n\ncheck_package_license() {\n\tlocal pkg_licenses=$1\n\tlocal license\n\tlocal license_ok=true\n\n\tIFS=\",\"\n\tfor license in $pkg_licenses; do\n\t\tlicense=$(echo \"$license\" | sed -r 's/^\\s*(\\S+(\\s+\\S+)*)\\s*$/\\1/')\n\n\t\tcase \"$license\" in\n\t\t\tAFL-2.1|AFL-3.0|AGPL-V3|APL-1.0|APSL-2.0|Apache-1.0|Apache-1.1);;\n\t\t\tApache-2.0|Artistic-License-2.0|Attribution|BSD|\"BSD 2-Clause\");;\n\t\t\t\"BSD 3-Clause\"|\"BSD New\"|\"BSD Simplified\"|BSL-1.0|Bouncy-Castle);;\n\t\t\tCA-TOSL-1.1|CC0-1.0|CDDL-1.0|CDDL-1.1|CPAL-1.0|CPL-1.0|CPOL);;\n\t\t\tCPOL-1.02|CUAOFFICE-1.0|CeCILL-1|CeCILL-2|CeCILL-2.1|CeCILL-B);;\n\t\t\tCeCILL-C|Codehaus|Copyfree|Day|Day-Addendum|ECL2|EPL-1.0|EPL-2.0);;\n\t\t\tEUDATAGRID|EUPL-1.1|EUPL-1.2|Eiffel-2.0|Entessa-1.0);;\n\t\t\tFacebook-Platform|Fair|Frameworx-1.0|GPL-2.0|GPL-3.0|GPL-3.0-only);;\n\t\t\tGPL-3.0-or-later|Go|HSQLDB|Historical|IBMPL-1.0|IJG|IPAFont-1.0);;\n\t\t\tISC|IU-Extreme-1.1.1|ImageMagick|JA-SIG|JSON|JTidy|LGPL-2.0);;\n\t\t\tLGPL-2.1|LGPL-3.0|LPPL-1.0|Libpng|Lucent-1.02|MIT|MPL-2.0|MS-PL);;\n\t\t\tMS-RL|MirOS|Motosoto-0.9.1|Mozilla-1.1|Multics|NASA-1.3|NAUMEN);;\n\t\t\tNCSA|NOSL-3.0|NTP|NUnit-2.6.3|NUnit-Test-Adapter-2.6.3|Nethack);;\n\t\t\tNokia-1.0a|OCLC-2.0|OSL-3.0|OpenLDAP|OpenSSL|Openfont-1.1);;\n\t\t\tOpengroup|PHP-3.0|PostgreSQL|\"Public Domain\"|\"Public Domain - SUN\");;\n\t\t\tPythonPL|PythonSoftFoundation|QTPL-1.0|RPL-1.5|Real-1.0|RicohPL);;\n\t\t\tSUNPublic-1.0|Scala|SimPL-2.0|Sleepycat|Sybase-1.0|TMate|UPL-1.0);;\n\t\t\tUnicode-DFS-2015|Unlicense|UoI-NCSA|\"VIM License\"|VovidaPL-1.0|W3C);;\n\t\t\tWTFPL|Xnet|ZLIB|ZPL-2.0|wxWindows);;\n\n\t\t\t*)\n\t\t\t\tlicense_ok=false\n\t\t\t\tbreak\n\t\t\t\t;;\n\t\tesac\n\tdone\n\tIFS=$old_ifs\n\n\tif $license_ok; then\n\t\treturn 0\n\telse\n\t\treturn 1\n\tfi\n}\n\nlint_package() {\n\tlocal package_script\n\tlocal package_name\n\n\tpackage_script=$1\n\tpackage_name=$(basename \"$(dirname \"$package_script\")\")\n\n\techo \"================================================================\"\n\techo\n\techo \"Package: $package_name\"\n\techo\n\techo -n \"Syntax check: \"\n\n\tlocal syntax_errors\n\tsyntax_errors=$(bash -n \"$package_script\" 2>&1)\n\n\tif [ -n \"$syntax_errors\" ]; then\n\t\techo \"FAILED\"\n\t\techo\n\t\techo \"$syntax_errors\"\n\t\techo\n\n\t\treturn 1\n\telse\n\t\techo \"PASS\"\n\tfi\n\n\techo\n\n\t# Fields checking is done in subshell since we will source build.sh.\n\t(set +e +u\n\t\tlocal pkg_lint_error\n\n\t\t# Certain fields may be API-specific.\n\t\t# Using API 24 here.\n\t\tTERMUX_PKG_API_LEVEL=24\n\n\t\tif [ -f \"$REPO_DIR/scripts/properties.sh\" ]; then\n\t\t\t. \"$REPO_DIR/scripts/properties.sh\"\n\t\tfi\n\n\t\t. \"$package_script\"\n\n\t\tpkg_lint_error=false\n\n\t\techo -n \"TERMUX_PKG_HOMEPAGE: \"\n\t\tif [ -n \"$TERMUX_PKG_HOMEPAGE\" ]; then\n\t\t\tif ! grep -qP '^https://.+' <<< \"$TERMUX_PKG_HOMEPAGE\"; then\n\t\t\t\techo \"NON-HTTPS (acceptable)\"\n\t\t\telse\n\t\t\t\techo \"PASS\"\n\t\t\tfi\n\t\telse\n\t\t\techo \"NOT SET\"\n\t\t\tpkg_lint_error=true\n\t\tfi\n\n\t\techo -n \"TERMUX_PKG_DESCRIPTION: \"\n\t\tif [ -n \"$TERMUX_PKG_DESCRIPTION\" ]; then\n\t\t\tstr_length=$(($(wc -c <<< \"$TERMUX_PKG_DESCRIPTION\") - 1))\n\n\t\t\tif [ $str_length -gt 100 ]; then\n\t\t\t\techo \"TOO LONG (allowed: 100 characters max)\"\n\t\t\telse\n\t\t\t\techo \"PASS\"\n\t\t\tfi\n\n\t\t\tunset str_length\n\t\telse\n\t\t\techo \"NOT SET\"\n\t\t\tpkg_lint_error=true\n\t\tfi\n\n\t\techo -n \"TERMUX_PKG_LICENSE: \"\n\t\tif [ -n \"$TERMUX_PKG_LICENSE\" ]; then\n\t\t\tif [ \"$TERMUX_PKG_LICENSE\" = \"custom\" ]; then\n\t\t\t\techo \"CUSTOM\"\n\t\t\telif [ \"$TERMUX_PKG_LICENSE\" = \"non-free\" ]; then\n\t\t\t\techo \"NON-FREE\"\n\t\t\telse\n\t\t\t\tif check_package_license \"$TERMUX_PKG_LICENSE\"; then\n\t\t\t\t\techo \"PASS\"\n\t\t\t\telse\n\t\t\t\t\techo \"INVALID\"\n\t\t\t\t\tpkg_lint_error=true\n\t\t\t\tfi\n\t\t\tfi\n\t\telse\n\t\t\techo \"NOT SET\"\n\t\t\tpkg_lint_error=true\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_API_LEVEL\" ]; then\n\t\t\techo -n \"TERMUX_PKG_API_LEVEL: \"\n\n\t\t\tif grep -qP '^[1-9][0-9]$' <<< \"$TERMUX_PKG_API_LEVEL\"; then\n\t\t\t\tif [ $TERMUX_PKG_API_LEVEL -lt 24 ] || [ $TERMUX_PKG_API_LEVEL -gt 28 ]; then\n\t\t\t\t\techo \"INVALID (allowed: number in range 24 - 28)\"\n\t\t\t\t\tpkg_lint_error=true\n\t\t\t\telse\n\t\t\t\t\techo \"PASS\"\n\t\t\t\tfi\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: number in range 24 - 28)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\techo -n \"TERMUX_PKG_VERSION: \"\n\t\tif [ -n \"$TERMUX_PKG_VERSION\" ]; then\n\t\t\techo \"PASS\"\n\t\telse\n\t\t\techo \"NOT SET\"\n\t\t\tpkg_lint_error=true\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_REVISION\" ]; then\n\t\t\techo -n \"TERMUX_PKG_REVISION: \"\n\n\t\t\tif grep -qP '^[1-9](\\d{1,8})?$' <<< \"$TERMUX_PKG_REVISION\"; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: number in range 1 - 999999999)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_SKIP_SRC_EXTRACT\" ]; then\n\t\t\techo -n \"TERMUX_PKG_SKIP_SRC_EXTRACT: \"\n\n\t\t\tif [ \"$TERMUX_PKG_SKIP_SRC_EXTRACT\" = \"true\" ] || [ \"$TERMUX_PKG_SKIP_SRC_EXTRACT\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_SRCURL\" ]; then\n\t\t\techo -n \"TERMUX_PKG_SRCURL: \"\n\n\t\t\turls_ok=true\n\t\t\tfor url in \"${TERMUX_PKG_SRCURL[@]}\"; do\n\t\t\t\tif [ -n \"$url\" ]; then\n\t\t\t\t\tif ! grep -qP '^https://.+' <<< \"$url\"; then\n\t\t\t\t\t\techo \"NON-HTTPS (acceptable)\"\n\t\t\t\t\t\turls_ok=false\n\t\t\t\t\t\tbreak\n\t\t\t\t\tfi\n\t\t\t\telse\n\t\t\t\t\techo \"NOT SET (one of the array elements)\"\n\t\t\t\t\turls_ok=false\n\t\t\t\t\tpkg_lint_error=true\n\t\t\t\t\tbreak\n\t\t\t\tfi\n\t\t\tdone\n\t\t\tunset url\n\n\t\t\tif $urls_ok; then\n\t\t\t\techo \"PASS\"\n\t\t\tfi\n\t\t\tunset urls_ok\n\n\t\t\techo -n \"TERMUX_PKG_SHA256: \"\n\t\t\tif [ -n \"$TERMUX_PKG_SHA256\" ]; then\n\t\t\t\tif [ \"${#TERMUX_PKG_SRCURL[@]}\" -eq \"${#TERMUX_PKG_SHA256[@]}\" ]; then\n\t\t\t\t\tsha256_ok=true\n\n\t\t\t\t\tfor sha256 in \"${TERMUX_PKG_SHA256[@]}\"; do\n\t\t\t\t\t\tif ! grep -qP '^[0-9a-fA-F]{64}$' <<< \"${sha256}\" && [ \"$sha256\" != \"SKIP_CHECKSUM\" ]; then\n\t\t\t\t\t\t\techo \"MALFORMED (SHA-256 should contain 64 hexadecimal numbers)\"\n\t\t\t\t\t\t\tsha256_ok=false\n\t\t\t\t\t\t\tpkg_lint_error=true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tfi\n\t\t\t\t\tdone\n\t\t\t\t\tunset sha256\n\n\t\t\t\t\tif $sha256_ok; then\n\t\t\t\t\t\techo \"PASS\"\n\t\t\t\t\tfi\n\t\t\t\t\tunset sha256_ok\n\t\t\t\telse\n\t\t\t\t\techo \"LENGTHS OF 'TERMUX_PKG_SRCURL' AND 'TERMUX_PKG_SHA256' ARE NOT EQUAL\"\n\t\t\t\t\tpkg_lint_error=true\n\t\t\t\tfi\n\t\t\telse\n\t\t\t\techo \"NOT SET\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\telse\n\t\t\tif [ \"$TERMUX_PKG_SKIP_SRC_EXTRACT\" != \"true\" ] && ! declare -F termux_step_extract_package > /dev/null 2>&1; then\n\t\t\t\techo \"TERMUX_PKG_SRCURL: NOT SET (set TERMUX_PKG_SKIP_SRC_EXTRACT to 'true' if no sources downloaded)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_METAPACKAGE\" ]; then\n\t\t\techo -n \"TERMUX_PKG_METAPACKAGE: \"\n\n\t\t\tif [ \"$TERMUX_PKG_METAPACKAGE\" = \"true\" ] || [ \"$TERMUX_PKG_METAPACKAGE\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_ESSENTIAL\" ]; then\n\t\t\techo -n \"TERMUX_PKG_ESSENTIAL: \"\n\t\t\tif [ \"$TERMUX_PKG_ESSENTIAL\" = \"true\" ] || [ \"$TERMUX_PKG_ESSENTIAL\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_NO_STATICSPLIT\" ]; then\n\t\t\techo -n \"TERMUX_PKG_NO_STATICSPLIT: \"\n\n\t\t\tif [ \"$TERMUX_PKG_NO_STATICSPLIT\" = \"true\" ] || [ \"$TERMUX_PKG_NO_STATICSPLIT\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_BUILD_IN_SRC\" ]; then\n\t\t\techo -n \"TERMUX_PKG_BUILD_IN_SRC: \"\n\n\t\t\tif [ \"$TERMUX_PKG_BUILD_IN_SRC\" = \"true\" ] || [ \"$TERMUX_PKG_BUILD_IN_SRC\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_HAS_DEBUG\" ]; then\n\t\t\techo -n \"TERMUX_PKG_HAS_DEBUG: \"\n\n\t\t\tif [ \"$TERMUX_PKG_HAS_DEBUG\" = \"true\" ] || [ \"$TERMUX_PKG_HAS_DEBUG\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_PLATFORM_INDEPENDENT\" ]; then\n\t\t\techo -n \"TERMUX_PKG_PLATFORM_INDEPENDENT: \"\n\n\t\t\tif [ \"$TERMUX_PKG_PLATFORM_INDEPENDENT\" = \"true\" ] || [ \"$TERMUX_PKG_PLATFORM_INDEPENDENT\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_HOSTBUILD\" ]; then\n\t\t\techo -n \"TERMUX_PKG_HOSTBUILD: \"\n\n\t\t\tif [ \"$TERMUX_PKG_HOSTBUILD\" = \"true\" ] || [ \"$TERMUX_PKG_HOSTBUILD\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_FORCE_CMAKE\" ]; then\n\t\t\techo -n \"TERMUX_PKG_FORCE_CMAKE: \"\n\n\t\t\tif [ \"$TERMUX_PKG_FORCE_CMAKE\" = \"true\" ] || [ \"$TERMUX_PKG_FORCE_CMAKE\" = \"false\" ]; then\n\t\t\t\techo \"PASS\"\n\t\t\telse\n\t\t\t\techo \"INVALID (allowed: true / false)\"\n\t\t\t\tpkg_lint_error=true\n\t\t\tfi\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_RM_AFTER_INSTALL\" ]; then\n\t\t\techo -n \"TERMUX_PKG_RM_AFTER_INSTALL: \"\n\t\t\tfile_path_ok=true\n\n\t\t\twhile read -r file_path; do\n\t\t\t\t[ -z \"$file_path\" ] && continue\n\n\t\t\t\tif grep -qP '^(\\.\\.)?/' <<< \"$file_path\"; then\n\t\t\t\t\techo \"INVALID (file path should be relative to prefix)\"\n\t\t\t\t\tfile_path_ok=false\n\t\t\t\t\tpkg_lint_error=true\n\t\t\t\t\tbreak\n\t\t\t\tfi\n\t\t\tdone <<< \"$TERMUX_PKG_RM_AFTER_INSTALL\"\n\t\t\tunset file_path\n\n\t\t\tif $file_path_ok; then\n\t\t\t\techo \"PASS\"\n\t\t\tfi\n\t\t\tunset file_path_ok\n\t\tfi\n\n\t\tif [ -n \"$TERMUX_PKG_CONFFILES\" ]; then\n\t\t\techo -n \"TERMUX_PKG_CONFFILES: \"\n\t\t\tfile_path_ok=true\n\n\t\t\twhile read -r file_path; do\n\t\t\t\t[ -z \"$file_path\" ] && continue\n\n\t\t\t\tif grep -qP '^(\\.\\.)?/' <<< \"$file_path\"; then\n\t\t\t\t\techo \"INVALID (file path should be relative to prefix)\"\n\t\t\t\t\tfile_path_ok=false\n\t\t\t\t\tpkg_lint_error=true\n\t\t\t\t\tbreak\n\t\t\t\tfi\n\t\t\tdone <<< \"$TERMUX_PKG_CONFFILES\"\n\t\t\tunset file_path\n\n\t\t\tif $file_path_ok; then\n\t\t\t\techo \"PASS\"\n\t\t\tfi\n\t\t\tunset file_path_ok\n\t\tfi\n\n\t\tif $pkg_lint_error; then\n\t\t\texit 1\n\t\telse\n\t\t\texit 0\n\t\tfi\n\t)\n\n\tlocal ret=$?\n\n\techo\n\n\treturn \"$ret\"\n}\n\nlinter_main() {\n\tlocal package_counter=0\n\tlocal problems_found=false\n\tlocal package_script\n\n\tfor package_script in \"$@\"; do\n\t\tif ! lint_package \"$package_script\"; then\n\t\t\tproblems_found=true\n\t\t\tbreak\n\t\tfi\n\n\t\tpackage_counter=$((package_counter + 1))\n\tdone\n\n\tif $problems_found; then\n\t\techo \"================================================================\"\n\t\techo\n\t\techo \"A problem has been found in '$(realpath --relative-to=\"$REPO_DIR\" \"$package_script\")'.\"\n\t\techo \"Checked $package_counter packages before the first error was detected.\"\n\t\techo\n\t\techo \"================================================================\"\n\n\t\treturn 1\n\telse\n\t\techo \"================================================================\"\n\t\techo\n\t\techo \"Checked $package_counter packages.\"\n\t\techo \"Everything seems ok.\"\n\t\techo\n\t\techo \"================================================================\"\n\tfi\n\n\treturn 0\n}\n\nif [ $# -eq 0 ]; then\n\tlinter_main \"$PACKAGES_DIR\"/*/build.sh || exit 1\nelse\n\tlinter_main \"$@\" || exit 1\nfi\n"
  },
  {
    "path": "scripts/list-packages.sh",
    "content": "#!/bin/bash\n# list-packages.sh - tool to list all package with home pages and descriptions\n\nshow_package() {\n\t. $1/build.sh\n\tlocal pkg=$(basename $1)\n\techo \"$pkg($TERMUX_PKG_VERSION): $TERMUX_PKG_HOMEPAGE\"\n\techo \"       $TERMUX_PKG_DESCRIPTION\"\n}\n\nfor path in packages/*; do\n\t( show_package $path )\ndone\n"
  },
  {
    "path": "scripts/list-versions.sh",
    "content": "#!/usr/bin/env bash\n\n. scripts/properties.sh\n\ncheck_package() { # path\n\tlocal path=$1\n\tlocal pkg=$(basename $path)\n\tTERMUX_PKG_REVISION=0\n\tTERMUX_ARCH=aarch64\n\t. $path/build.sh\n\tif [ \"$TERMUX_PKG_REVISION\" != \"0\" ] || [ \"$TERMUX_PKG_VERSION\" != \"${TERMUX_PKG_VERSION/-/}\" ]; then\n\t\tTERMUX_PKG_VERSION+=\"-$TERMUX_PKG_REVISION\"\n\tfi\n\techo \"$pkg=$TERMUX_PKG_VERSION\"\n}\n\nfor path in packages/*; do\n(\n\tcheck_package $path\n)\ndone\n"
  },
  {
    "path": "scripts/package_uploader.sh",
    "content": "#!/usr/bin/env bash\n##\n##  Package uploader for Bintray.\n##\n##  Leonid Plyushch <leonid.plyushch@gmail.com> (C) 2019\n##\n##  This program is free software: you can redistribute it and/or modify\n##  it under the terms of the GNU General Public License as published by\n##  the Free Software Foundation, either version 3 of the License, or\n##  (at your option) any later version.\n##\n##  This program is distributed in the hope that it will be useful,\n##  but WITHOUT ANY WARRANTY; without even the implied warranty of\n##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n##  GNU General Public License for more details.\n##\n##  You should have received a copy of the GNU General Public License\n##  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n##\n\nset -o errexit\nset -o nounset\n\nTERMUX_PACKAGES_BASEDIR=$(realpath \"$(dirname \"$0\")/../\")\n\n# Verify that script is correctly installed to Termux repository.\nif [ ! -d \"$TERMUX_PACKAGES_BASEDIR/packages\" ]; then\n\techo \"[!] Cannot find directory 'packages'.\"\n\texit 1\nfi\n\n# Check dependencies.\nif [ -z \"$(command -v curl)\" ]; then\n\techo \"[!] Package 'curl' is not installed.\"\n\texit 1\nfi\nif [ -z \"$(command -v find)\" ]; then\n\techo \"[!] Package 'findutils' is not installed.\"\n\texit 1\nfi\nif [ -z \"$(command -v grep)\" ]; then\n\techo \"[!] Package 'grep' is not installed.\"\n\texit 1\nfi\nif [ -z \"$(command -v jq)\" ]; then\n\techo \"[!] Package 'jq' is not installed.\"\n\texit 1\nfi\n\n###################################################################\n\n# In this variable a package metadata will be stored.\ndeclare -gA PACKAGE_METADATA\n\n# Initialize default configuration.\nDEBFILES_DIR_PATH=\"$TERMUX_PACKAGES_BASEDIR/debs\"\nMETADATA_GEN_MODE=false\nPACKAGE_CLEANUP_MODE=false\nPACKAGE_DELETION_MODE=false\nSCRIPT_EMERG_EXIT=false\n\n# Special variable to force script to exit with error status\n# when everything finished. Should be set only when non-script\n# errors occur, e.g. curl request failure.\n#\n# Useful in case if there was an error when uploading packages\n# via CI/CD so packages are still uploaded where possible but\n# maintainers will be notified about error because pipeline\n# will be marked as \"failed\".\nSCRIPT_ERROR_EXIT=false\n\n# Bintray-specific configuration.\nBINTRAY_REPO_NAME=\"termux-packages-24\"\nBINTRAY_REPO_GITHUB=\"imprakharshukla/termux-packages\"\nBINTRAY_REPO_DISTRIBUTION=\"stable\"\nBINTRAY_REPO_COMPONENT=\"main\"\n\n# Bintray credentials that should be set as external environment\n# variables by user.\n: \"${BINTRAY_USERNAME:=\"\"}\"\n: \"${BINTRAY_API_KEY:=\"\"}\"\n: \"${BINTRAY_GPG_SUBJECT:=\"\"}\"\n: \"${BINTRAY_GPG_PASSPHRASE:=\"\"}\"\n\n# If BINTRAY_GPG_SUBJECT is not specified, then signing will be\n# done with gpg key of subject '$BINTRAY_USERNAME'.\nif [ -z \"$BINTRAY_GPG_SUBJECT\" ]; then\n\tBINTRAY_GPG_SUBJECT=\"$BINTRAY_USERNAME\"\nfi\n\n# Packages are built and uploaded for Termux organisation.\nBINTRAY_SUBJECT=\"andronixapp\"\n\n###################################################################\n\n## Print message to stderr.\n## Takes same arguments as command 'echo'.\nmsg() {\n\techo \"$@\" >&2\n}\n\n\n## Blocks terminal to prevent any user input.\n## Takes no arguments.\nblock_terminal() {\n\tstty -echo -icanon time 0 min 0 2>/dev/null || true\n\tstty quit undef susp undef 2>/dev/null || true\n}\n\n\n## Unblocks terminal blocked with block_terminal() function.\n## Takes no arguments.\nunblock_terminal() {\n\twhile read -r; do\n\t\ttrue;\n\tdone\n\tstty sane 2>/dev/null || true\n}\n\n\n## Process request for aborting script execution.\n## Used by signal trap.\n## Takes no arguments.\nrequest_emerg_exit() {\n\tSCRIPT_EMERG_EXIT=true\n}\n\n\n## Handle emergency exit requested by ctrl-c.\n## Takes no arguments.\nemergency_exit() {\n\tmsg\n\trecalculate_metadata\n\tmsg \"[!] Aborted by user.\"\n\tunblock_terminal\n\texit 1\n}\n\n\n## Dump everything from $PACKAGE_METADATA to json structure.\n## Takes no arguments.\njson_metadata_dump() {\n\tlocal old_ifs=$IFS\n\tlocal license\n\tlocal pkg_licenses=\"\"\n\n\tIFS=\",\"\n\tfor license in ${PACKAGE_METADATA['LICENSES']}; do\n\t\tpkg_licenses+=\"\\\"$(echo \"$license\" | sed -r 's/^\\s*(\\S+(\\s+\\S+)*)\\s*$/\\1/')\\\",\"\n\tdone\n\tpkg_licenses=${pkg_licenses%%,}\n\tIFS=$old_ifs\n\n\tcat <<- EOF\n\t{\n\t    \"name\": \"${PACKAGE_METADATA['NAME']}\",\n\t    \"desc\": \"${PACKAGE_METADATA['DESCRIPTION']}\",\n\t    \"version\": \"${PACKAGE_METADATA['VERSION_FULL']}\",\n\t    \"licenses\": [${pkg_licenses}],\n\t    \"vcs_url\": \"https://github.com/${BINTRAY_REPO_GITHUB}\",\n\t    \"website_url\": \"${PACKAGE_METADATA['WEBSITE_URL']}\",\n\t    \"issue_tracker_url\": \"https://github.com/${BINTRAY_REPO_GITHUB}/issues\",\n\t    \"github_repo\": \"${BINTRAY_REPO_GITHUB}\",\n\t    \"public_download_numbers\": \"true\",\n\t    \"public_stats\": \"false\"\n\t}\n\tEOF\n}\n\n\n## Request metadata recalculation and signing.\n## Takes no arguments.\nrecalculate_metadata() {\n\tlocal curl_response\n\tlocal http_status_code\n\tlocal api_response_message\n\n\tmsg -n \"[@] Requesting metadata recalculation... \"\n\tcurl_response=$(\n\t\tcurl \\\n\t\t\t--silent \\\n\t\t\t--user \"${BINTRAY_USERNAME}:${BINTRAY_API_KEY}\" \\\n\t\t\t--request POST \\\n\t\t\t--header \"Content-Type: application/json\" \\\n\t\t\t--data \"{\\\"subject\\\":\\\"${BINTRAY_GPG_SUBJECT}\\\",\\\"passphrase\\\":\\\"$BINTRAY_GPG_PASSPHRASE\\\"}\" \\\n\t\t\t--write-out \"|%{http_code}\" \\\n\t\t\t\"https://api.bintray.com/calc_metadata/${BINTRAY_SUBJECT}/${BINTRAY_REPO_NAME}/\"\n\t)\n\n\thttp_status_code=$(echo \"$curl_response\" | cut -d'|' -f2)\n\tapi_response_message=$(echo \"$curl_response\" | cut -d'|' -f1 | jq -r .message)\n\n\tif [ \"$http_status_code\" = \"202\" ]; then\n\t\tmsg \"done\"\n\telse\n\t\tmsg \"failure\"\n\t\tmsg \"[!] $api_response_message\"\n\t\tSCRIPT_ERROR_EXIT=true\n\tfi\n}\n\n\n## Request deletion of the specified package.\n## Takes only one argument - package name.\ndelete_package() {\n\tmsg -n \"   * ${1}: \"\n\n\tif $SCRIPT_EMERG_EXIT; then\n\t\temergency_exit\n\tfi\n\n\tlocal curl_response\n\tcurl_response=$(\n\t\tcurl \\\n\t\t\t--silent \\\n\t\t\t--user \"${BINTRAY_USERNAME}:${BINTRAY_API_KEY}\" \\\n\t\t\t--request DELETE \\\n\t\t\t--write-out \"|%{http_code}\" \\\n\t\t\t\"https://api.bintray.com/packages/${BINTRAY_SUBJECT}/${BINTRAY_REPO_NAME}/${1}\"\n\t)\n\n\tlocal http_status_code\n\thttp_status_code=$(\n\t\techo \"$curl_response\" | cut -d'|' -f2\n\t)\n\n\tlocal api_response_message\n\tapi_response_message=$(\n\t\techo \"$curl_response\" | cut -d'|' -f1 | jq -r .message\n\t)\n\n\tif [ \"$http_status_code\" = \"200\" ] || [ \"$http_status_code\" = \"404\" ]; then\n\t\tmsg \"success\"\n\telse\n\t\tmsg \"$api_response_message\"\n\t\tSCRIPT_ERROR_EXIT=true\n\tfi\n\n\tif $SCRIPT_EMERG_EXIT; then\n\t\temergency_exit\n\tfi\n}\n\n\n## Leave only the latest version of specified package and remove old ones.\n## Takes only one argument - package name.\ndelete_old_versions_from_package() {\n\tlocal package_versions\n\tlocal package_latest_version\n\tlocal curl_response\n\tlocal http_status_code\n\tlocal api_response_message\n\n\tif $SCRIPT_EMERG_EXIT; then\n\t\temergency_exit\n\tfi\n\n\tmsg -n \"    * ${1}: checking latest version... \"\n\tcurl_response=$(\n\t\tcurl \\\n\t\t\t--silent \\\n\t\t\t--user \"${BINTRAY_USERNAME}:${BINTRAY_API_KEY}\" \\\n\t\t\t--request GET \\\n\t\t\t--write-out \"|%{http_code}\" \\\n\t\t\t\"https://api.bintray.com/packages/${BINTRAY_SUBJECT}/${BINTRAY_REPO_NAME}/${1}\"\n\t)\n\n\thttp_status_code=$(echo \"$curl_response\" | cut -d'|' -f2)\n\tapi_response_message=$(echo \"$curl_response\" | cut -d'|' -f1 | jq -r .message)\n\n\tif [ \"$http_status_code\" = \"200\" ]; then\n\t\tpackage_latest_version=$(\n\t\t\techo \"$curl_response\" | cut -d'|' -f1 | jq -r .latest_version | \\\n\t\t\t\tsed 's/\\./\\\\./g'\n\t\t)\n\n\t\tpackage_versions=$(\n\t\t\techo \"$curl_response\" | cut -d'|' -f1 | jq -r '.versions[]' | \\\n\t\t\t\tgrep -v \"^$package_latest_version$\" || true\n\t\t)\n\telse\n\t\tmsg \"$api_response_message.\"\n\t\tSCRIPT_ERROR_EXIT=true\n\t\treturn 1\n\tfi\n\n\tif $SCRIPT_EMERG_EXIT; then\n\t\temergency_exit\n\tfi\n\n\tif [ -n \"$package_versions\" ]; then\n\t\tlocal old_version\n\t\tfor old_version in $package_versions; do\n\t\t\tif $SCRIPT_EMERG_EXIT; then\n\t\t\t\temergency_exit\n\t\t\tfi\n\n\t\t\tmsg -ne \"\\\\r\\\\e[2K    * ${1}: deleting '$old_version'... \"\n\t\t\tcurl_response=$(\n\t\t\t\tcurl \\\n\t\t\t\t\t--silent \\\n\t\t\t\t\t--user \"${BINTRAY_USERNAME}:${BINTRAY_API_KEY}\" \\\n\t\t\t\t\t--request DELETE \\\n\t\t\t\t\t--write-out \"|%{http_code}\" \\\n\t\t\t\t\t\"https://api.bintray.com/packages/${BINTRAY_SUBJECT}/${BINTRAY_REPO_NAME}/${1}/versions/${old_version}\"\n\t\t\t)\n\n\t\t\thttp_status_code=$(echo \"$curl_response\" | cut -d'|' -f2)\n\t\t\tapi_response_message=$(\n\t\t\t\techo \"$curl_response\" | cut -d'|' -f1 | jq -r .message\n\t\t\t)\n\n\t\t\tif [ \"$http_status_code\" != \"200\" ] && [ \"$http_status_code\" != \"404\" ]; then\n\t\t\t\tmsg \"$api_response_message\"\n\t\t\t\tSCRIPT_ERROR_EXIT=true\n\t\t\t\treturn 1\n\t\t\tfi\n\n\t\t\tif $SCRIPT_EMERG_EXIT; then\n\t\t\t\temergency_exit\n\t\t\tfi\n\t\tdone\n\tfi\n\n\tmsg -e \"\\\\r\\\\e[2K    * ${1}: success\"\n}\n\n\n## Upload the specified package. Will also create a new version entry\n## if required. When upload is done within the same version, already existing\n## *.deb files will not be replaced.\n##\n## Note that upload_package() detects right *.deb files by using naming scheme\n## defined in the build script. It does not care about actual content stored in\n## the package so the good advice is to never rename *.deb files once they built.\n##\n## Function takes only one argument - package name.\nupload_package() {\n\tlocal curl_response\n\tlocal http_status_code\n\tlocal api_response_message\n\n\tdeclare -A debfiles_catalog\n\n\tlocal arch\n\tfor arch in all aarch64 arm i686 x86_64; do\n\t\t# Regular package.\n\t\tif [ -f \"$DEBFILES_DIR_PATH/${1}_${PACKAGE_METADATA['VERSION_FULL']}_${arch}.deb\" ]; then\n\t\t\tdebfiles_catalog[\"${1}_${PACKAGE_METADATA['VERSION_FULL']}_${arch}.deb\"]=${arch}\n\t\tfi\n\n\t\t# Static library package.\n\t\tif [ -f \"$DEBFILES_DIR_PATH/${1}-static_${PACKAGE_METADATA['VERSION_FULL']}_${arch}.deb\" ]; then\n\t\t\tdebfiles_catalog[\"${1}-static_${PACKAGE_METADATA['VERSION_FULL']}_${arch}.deb\"]=${arch}\n\t\tfi\n\n\t\t# Discover subpackages.\n\t\tlocal file\n\t\tfor file in $(find \"$TERMUX_PACKAGES_BASEDIR/packages/${1}/\" -maxdepth 1 -type f -iname \\*.subpackage.sh | sort); do\n\t\t\tfile=$(basename \"$file\")\n\n\t\t\tif [ -f \"$DEBFILES_DIR_PATH/${file%%.subpackage.sh}_${PACKAGE_METADATA['VERSION_FULL']}_${arch}.deb\" ]; then\n\t\t\t\tdebfiles_catalog[\"${file%%.subpackage.sh}_${PACKAGE_METADATA['VERSION_FULL']}_${arch}.deb\"]=${arch}\n\t\t\tfi\n\t\tdone\n\tdone\n\n\t# Verify that our catalog is not empty.\n\tset +o nounset\n\tif [ ${#debfiles_catalog[@]} -eq 0 ]; then\n\t\tset -o nounset\n\t\tmsg \"    * ${1}: skipping because no files to upload.\"\n\t\tSCRIPT_ERROR_EXIT=true\n\t\treturn 1\n\tfi\n\tset -o nounset\n\n\tif $SCRIPT_EMERG_EXIT; then\n\t\temergency_exit\n\tfi\n\n\t# Create new entry for package.\n\tmsg -n \"    * ${1}: creating entry for version '${PACKAGE_METADATA['VERSION_FULL']}'... \"\n\tcurl_response=$(\n\t\tcurl \\\n\t\t\t--silent \\\n\t\t\t--user \"${BINTRAY_USERNAME}:${BINTRAY_API_KEY}\" \\\n\t\t\t--request POST \\\n\t\t\t--header \"Content-Type: application/json\" \\\n\t\t\t--data \"$(json_metadata_dump)\" \\\n\t\t\t--write-out \"|%{http_code}\" \\\n\t\t\t\"https://api.bintray.com/packages/${BINTRAY_SUBJECT}/${BINTRAY_REPO_NAME}\"\n\t)\n\n\thttp_status_code=$(echo \"$curl_response\" | cut -d'|' -f2)\n\tapi_response_message=$(echo \"$curl_response\" | cut -d'|' -f1 | jq -r .message)\n\n\tif [ \"$http_status_code\" != \"201\" ] && [ \"$http_status_code\" != \"409\" ]; then\n\t\tmsg \"$api_response_message\"\n\t\tSCRIPT_ERROR_EXIT=true\n\t\treturn 1\n\tfi\n\n\tif $SCRIPT_EMERG_EXIT; then\n\t\temergency_exit\n\tfi\n\n\tfor item in \"${!debfiles_catalog[@]}\"; do\n\t\tlocal package_arch=${debfiles_catalog[$item]}\n\n\t\tif $SCRIPT_EMERG_EXIT; then\n\t\t\temergency_exit\n\t\tfi\n\n\t\tmsg -ne \"\\\\r\\\\e[2K    * ${1}: uploading '$item'... \"\n\t\tcurl_response=$(\n\t\t\tcurl \\\n\t\t\t\t--silent \\\n\t\t\t\t--user \"${BINTRAY_USERNAME}:${BINTRAY_API_KEY}\" \\\n\t\t\t\t--request PUT \\\n\t\t\t\t--header \"X-Bintray-Debian-Distribution: $BINTRAY_REPO_DISTRIBUTION\" \\\n\t\t\t\t--header \"X-Bintray-Debian-Component: $BINTRAY_REPO_COMPONENT\" \\\n\t\t\t\t--header \"X-Bintray-Debian-Architecture: $package_arch\" \\\n\t\t\t\t--header \"X-Bintray-Package: ${1}\" \\\n\t\t\t\t--header \"X-Bintray-Version: ${PACKAGE_METADATA['VERSION_FULL']}\" \\\n\t\t\t\t--upload-file \"$DEBFILES_DIR_PATH/$item\" \\\n\t\t\t\t--write-out \"|%{http_code}\" \\\n\t\t\t\t\"https://api.bintray.com/content/${BINTRAY_SUBJECT}/${BINTRAY_REPO_NAME}/${package_arch}/${item}\"\n\t\t)\n\n\t\thttp_status_code=$(echo \"$curl_response\" | cut -d'|' -f2)\n\t\tapi_response_message=$(echo \"$curl_response\" | cut -d'|' -f1 | jq -r .message)\n\n\t\tif [ \"$http_status_code\" != \"201\" ] && [ \"$http_status_code\" != \"409\" ]; then\n\t\t\tmsg \"$api_response_message\"\n\t\t\tSCRIPT_ERROR_EXIT=true\n\t\t\treturn 1\n\t\tfi\n\n\t\tif $SCRIPT_EMERG_EXIT; then\n\t\t\temergency_exit\n\t\tfi\n\tdone\n\n\t# Publishing package only after uploading all it's files. This will prevent\n\t# spawning multiple metadata-generation jobs and will allow to sign metadata\n\t# with maintainer's key.\n\tmsg -ne \"\\\\r\\\\e[2K    * ${1}: publishing... \"\n\tcurl_response=$(\n\t\tcurl \\\n\t\t\t--silent \\\n\t\t\t--user \"${BINTRAY_USERNAME}:${BINTRAY_API_KEY}\" \\\n\t\t\t--request POST \\\n\t\t\t--header \"Content-Type: application/json\" \\\n\t\t\t--data \"{\\\"subject\\\":\\\"${BINTRAY_GPG_SUBJECT}\\\",\\\"passphrase\\\":\\\"$BINTRAY_GPG_PASSPHRASE\\\"}\" \\\n\t\t\t--write-out \"|%{http_code}\" \\\n\t\t\t\"https://api.bintray.com/content/${BINTRAY_SUBJECT}/${BINTRAY_REPO_NAME}/${1}/${PACKAGE_METADATA['VERSION_FULL']}/publish\"\n\t)\n\n\thttp_status_code=$(echo \"$curl_response\" | cut -d'|' -f2)\n\tapi_response_message=$(echo \"$curl_response\" | cut -d'|' -f1 | jq -r .message)\n\n\tif [ \"$http_status_code\" = \"200\" ]; then\n\t\tmsg -e \"\\\\r\\\\e[2K    * ${1}: success\"\n\telse\n\t\tmsg \"$api_response_message\"\n\t\tSCRIPT_ERROR_EXIT=true\n\t\treturn 1\n\tfi\n}\n\n\n## Extact value of specified variable from build.sh script.\n## Takes 2 arguments: package name, variable name.\nget_package_property() {\n\tlocal buildsh_path=\"$TERMUX_PACKAGES_BASEDIR/packages/$1/build.sh\"\n\tlocal extracted_value\n\n\textracted_value=$(\n\t\tset +o nounset\n\t\tset -o noglob\n\n\t\t# When sourcing external code, do not expose variables\n\t\t# with sensitive information.\n\t\tunset BINTRAY_API_KEY\n\t\tunset BINTRAY_GPG_PASSPHRASE\n\t\tunset BINTRAY_GPG_SUBJECT\n\t\tunset BINTRAY_SUBJECT\n\t\tunset BINTRAY_USERNAME\n\n\t\tif [ -e \"$TERMUX_PACKAGES_BASEDIR/scripts/properties.sh\" ]; then\n\t\t\t. \"$TERMUX_PACKAGES_BASEDIR/scripts/properties.sh\" 2>/dev/null\n\t\tfi\n\n\t\t. \"$buildsh_path\" 2>/dev/null\n\n\t\techo \"${!2}\"\n\n\t\tset +o noglob\n\t\tset -o nounset\n\t)\n\n\techo \"$extracted_value\"\n}\n\n\n## Execute desired action on specified packages.\n## Takes arbitrary amount of arguments - package names.\nprocess_packages() {\n\tlocal package_name\n\tlocal package_name_list\n\tlocal buildsh_path\n\n\tif $PACKAGE_CLEANUP_MODE; then\n\t\tmsg \"[@] Removing old versions:\"\n\telif $PACKAGE_DELETION_MODE; then\n\t\tmsg \"[@] Deleting packages from remote:\"\n\telif $METADATA_GEN_MODE; then\n\t\trecalculate_metadata\n\t\tmsg \"[@] Finished.\"\n\t\treturn 0\n\telse\n\t\tmsg \"[@] Uploading packages:\"\n\tfi\n\tmsg\n\n\tblock_terminal\n\n\t# Remove duplicates from the list of the package names.\n\treadarray -t package_name_list < <(printf '%s\\n' \"${@}\" | sort -u)\n\n\tfor package_name in \"${package_name_list[@]}\"; do\n\t\tif $SCRIPT_EMERG_EXIT; then\n\t\t\temergency_exit\n\t\tfi\n\n\t\tif $PACKAGE_DELETION_MODE; then\n\t\t\tdelete_package \"$package_name\" || continue\n\t\telse\n\t\t\tif [ ! -f \"$TERMUX_PACKAGES_BASEDIR/packages/$package_name/build.sh\" ]; then\n\t\t\t\tmsg \"    * ${package_name}: skipping because such package does not exist.\"\n\t\t\t\tSCRIPT_ERROR_EXIT=true\n\t\t\t\tcontinue\n\t\t\tfi\n\n\t\t\tPACKAGE_METADATA[\"NAME\"]=\"$package_name\"\n\n\t\t\tPACKAGE_METADATA[\"LICENSES\"]=$(get_package_property \"$package_name\" \"TERMUX_PKG_LICENSE\")\n\t\t\tif [ -z \"${PACKAGE_METADATA['LICENSES']}\" ]; then\n\t\t\t\tmsg \"    * ${package_name}: skipping because field 'TERMUX_PKG_LICENSE' is empty.\"\n\t\t\t\tSCRIPT_ERROR_EXIT=true\n\t\t\t\tcontinue\n\t\t\telif grep -qP '.*(custom|non-free).*' <(echo \"${PACKAGE_METADATA['LICENSES']}\"); then\n\t\t\t\tPACKAGE_METADATA[\"LICENSES\"]=\"\"\n\t\t\tfi\n\n\t\t\tPACKAGE_METADATA[\"DESCRIPTION\"]=$(get_package_property \"$package_name\" \"TERMUX_PKG_DESCRIPTION\")\n\t\t\tif [ -z \"${PACKAGE_METADATA['DESCRIPTION']}\" ]; then\n\t\t\t\tmsg \"    * ${package_name}: skipping because field 'TERMUX_PKG_DESCRIPTION' is empty.\"\n\t\t\t\tSCRIPT_ERROR_EXIT=true\n\t\t\t\tcontinue\n\t\t\tfi\n\n\t\t\tPACKAGE_METADATA[\"WEBSITE_URL\"]=$(get_package_property \"$package_name\" \"TERMUX_PKG_HOMEPAGE\")\n\t\t\tif [ -z \"${PACKAGE_METADATA['WEBSITE_URL']}\" ]; then\n\t\t\t\tmsg \"    * ${package_name}: skipping because field 'TERMUX_PKG_HOMEPAGE' is empty.\"\n\t\t\t\tSCRIPT_ERROR_EXIT=true\n\t\t\t\tcontinue\n\t\t\tfi\n\n\t\t\tPACKAGE_METADATA[\"VERSION\"]=$(get_package_property \"$package_name\" \"TERMUX_PKG_VERSION\")\n\t\t\tif [ -z \"${PACKAGE_METADATA['VERSION']}\" ]; then\n\t\t\t\tmsg \"    * ${package_name}: skipping because field 'TERMUX_PKG_VERSION' is empty.\"\n\t\t\t\tSCRIPT_ERROR_EXIT=true\n\t\t\t\tcontinue\n\t\t\tfi\n\n\t\t\tPACKAGE_METADATA[\"REVISION\"]=$(get_package_property \"$package_name\" \"TERMUX_PKG_REVISION\")\n\t\t\tif [ -n \"${PACKAGE_METADATA['REVISION']}\" ]; then\n\t\t\t\tPACKAGE_METADATA[\"VERSION_FULL\"]=\"${PACKAGE_METADATA['VERSION']}-${PACKAGE_METADATA['REVISION']}\"\n\t\t\telse\n\t\t\t\tif [ \"${PACKAGE_METADATA['VERSION']}\" != \"${PACKAGE_METADATA['VERSION']/-/}\" ]; then\n\t\t\t\t\tPACKAGE_METADATA[\"VERSION_FULL\"]=\"${PACKAGE_METADATA['VERSION']}-0\"\n\t\t\t\telse\n\t\t\t\t\tPACKAGE_METADATA[\"VERSION_FULL\"]=\"${PACKAGE_METADATA['VERSION']}\"\n\t\t\t\tfi\n\t\t\tfi\n\n\t\t\tif $PACKAGE_CLEANUP_MODE; then\n\t\t\t\tdelete_old_versions_from_package \"$package_name\" || continue\n\t\t\telse\n\t\t\t\tupload_package \"$package_name\" || continue\n\t\t\tfi\n\t\tfi\n\tdone\n\n\tif $SCRIPT_EMERG_EXIT; then\n\t\temergency_exit\n\tfi\n\n\tunblock_terminal\n\n\tmsg\n\tif $PACKAGE_CLEANUP_MODE || $PACKAGE_DELETION_MODE; then\n\t\trecalculate_metadata\n\tfi\n\tmsg \"[@] Finished.\"\n}\n\n\n## Just print information about usage.\n## Takes no arumnets.\nshow_usage() {\n\tmsg\n\tmsg \"Usage: package_uploader.sh [OPTIONS] [package name] ...\"\n\tmsg\n\tmsg \"A command line client for Bintray designed for managing\"\n\tmsg \"Termux *.deb packages.\"\n\tmsg\n\tmsg \"==========================================================\"\n\tmsg\n\tmsg \"Primarily indended to be used by CI systems for automatic\"\n\tmsg \"package uploads but it can be used for manual uploads too.\"\n\tmsg\n\tmsg \"Before using this script, check that you have all\"\n\tmsg \"necessary credentials for accessing repository.\"\n\tmsg\n\tmsg \"Credentials are specified via environment variables:\"\n\tmsg\n\tmsg \"  BINTRAY_USERNAME        - User name.\"\n\tmsg \"  BINTRAY_API_KEY         - User's API key.\"\n\tmsg \"  BINTRAY_GPG_SUBJECT     - Owner of GPG key.\"\n\tmsg \"  BINTRAY_GPG_PASSPHRASE  - GPG key passphrase.\"\n\tmsg\n\tmsg \"==========================================================\"\n\tmsg\n\tmsg \"Options:\"\n\tmsg\n\tmsg \"  -h, --help         Print this help.\"\n\tmsg\n\tmsg \"  -c, --cleanup      Action. Clean selected packages by\"\n\tmsg \"                     removing older versions from the remote.\"\n\tmsg\n\tmsg \"  -d, --delete       Action. Remove selected packages from\"\n\tmsg \"                     remote.\"\n\tmsg\n\tmsg \"  -r, --regenerate   Action. Request metadata recalculation\"\n\tmsg \"                     and signing on the remote.\"\n\tmsg\n\tmsg\n\tmsg \"  -p, --path [path]  Specify a directory containing *.deb\"\n\tmsg \"                     files ready for uploading.\"\n\tmsg \"                     Default is './debs'.\"\n\tmsg\n\tmsg \"==========================================================\"\n}\n\n###################################################################\n\ntrap request_emerg_exit INT\n\nwhile getopts \":-:hcdrp:\" opt; do\n\tcase \"$opt\" in\n\t\t-)\n\t\t\tcase \"$OPTARG\" in\n\t\t\t\thelp)\n\t\t\t\t\tshow_usage\n\t\t\t\t\texit 0\n\t\t\t\t\t;;\n\t\t\t\tcleanup)\n\t\t\t\t\tPACKAGE_CLEANUP_MODE=true\n\t\t\t\t\t;;\n\t\t\t\tdelete)\n\t\t\t\t\tPACKAGE_DELETION_MODE=true\n\t\t\t\t\t;;\n\t\t\t\tregenerate)\n\t\t\t\t\tMETADATA_GEN_MODE=true;\n\t\t\t\t\t;;\n\t\t\t\tpath)\n\t\t\t\t\tDEBFILES_DIR_PATH=\"${!OPTIND}\"\n\t\t\t\t\tOPTIND=$((OPTIND + 1))\n\n\t\t\t\t\tif [ -z \"$DEBFILES_DIR_PATH\" ]; then\n\t\t\t\t\t\tmsg \"[!] Option '--${OPTARG}' requires argument.\"\n\t\t\t\t\t\tshow_usage\n\t\t\t\t\t\texit 1\n\t\t\t\t\tfi\n\n\t\t\t\t\tif [ ! -d \"$DEBFILES_DIR_PATH\" ]; then\n\t\t\t\t\t\tmsg \"[!] Directory '$DEBFILES_DIR_PATH' does not exist.\"\n\t\t\t\t\t\tshow_usage\n\t\t\t\t\t\texit 1\n\t\t\t\t\tfi\n\t\t\t\t\t;;\n\t\t\t\t*)\n\t\t\t\t\tmsg \"[!] Invalid option '$OPTARG'.\"\n\t\t\t\t\tshow_usage\n\t\t\t\t\texit 1\n\t\t\t\t\t;;\n\t\t\tesac\n\t\t\t;;\n\t\th)\n\t\t\tshow_usage\n\t\t\texit 0\n\t\t\t;;\n\t\tc)\n\t\t\tPACKAGE_CLEANUP_MODE=true\n\t\t\t;;\n\t\td)\n\t\t\tPACKAGE_DELETION_MODE=true\n\t\t\t;;\n\t\tr)\n\t\t\tMETADATA_GEN_MODE=true\n\t\t\t;;\n\t\tp)\n\t\t\tDEBFILES_DIR_PATH=\"${OPTARG}\"\n\t\t\tif [ ! -d \"$DEBFILES_DIR_PATH\" ]; then\n\t\t\t\tmsg \"[!] Directory '$DEBFILES_DIR_PATH' does not exist.\"\n\t\t\t\tshow_usage\n\t\t\t\texit 1\n\t\t\tfi\n\t\t\t;;\n\t\t*)\n\t\t\tmsg \"[!] Invalid option '-${OPTARG}'.\"\n\t\t\tshow_usage\n\t\t\texit 1\n\t\t\t;;\n\tesac\ndone\nshift $((OPTIND - 1))\n\nif [ $# -lt 1 ] && ! $METADATA_GEN_MODE; then\n\tmsg \"[!] No packages specified.\"\n\tshow_usage\n\texit 1\nfi\n\n# These variables should never be changed.\nreadonly DEBFILES_DIR_PATH\nreadonly PACKAGE_DELETION_MODE\nreadonly PACKAGE_CLEANUP_MODE\nreadonly TERMUX_PACKAGES_BASEDIR\n\n# Check if no mutually exclusive options used.\nif $PACKAGE_CLEANUP_MODE && $METADATA_GEN_MODE; then\n\tmsg \"[!] Options '-c|--cleanup' and '-r|--regenerate' are mutually exclusive.\"\n\texit 1\nfi\nif $PACKAGE_CLEANUP_MODE && $PACKAGE_DELETION_MODE; then\n\tmsg \"[!] Options '-c|--cleanup' and '-d|--delete' are mutually exclusive.\"\n\texit 1\nfi\nif $PACKAGE_DELETION_MODE && $METADATA_GEN_MODE; then\n\tmsg \"[!] Options '-d|--delete' and '-r|--regenerate' are mutually exclusive.\"\n\texit 1\nfi\n\n# Without Bintray credentials this script is useless.\nif [ -z \"$BINTRAY_USERNAME\" ]; then\n\tmsg \"[!] Variable 'BINTRAY_USERNAME' is not set.\"\n\texit 1\nfi\nif [ -z \"$BINTRAY_API_KEY\" ]; then\n\tmsg \"[!] Variable 'BINTRAY_API_KEY' is not set.\"\n\texit 1\nfi\nif [ -z \"$BINTRAY_GPG_SUBJECT\" ]; then\n\tmsg \"[!] Variable 'BINTRAY_GPG_SUBJECT' is not set.\"\n\texit 1\nfi\n\nprocess_packages \"$@\"\n\nif $SCRIPT_ERROR_EXIT; then\n\texit 1\nelse\n\texit 0\nfi\n"
  },
  {
    "path": "scripts/print.txt",
    "content": "    1  source init_env.sh\n    2  printenv\n    3  ./build-package.sh -a x86_64 ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n    4  cd scripts\n    5  ./package-uploader.sh -a x86_64 ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n    6  ls\n    7  ./package_uploader.sh -a x86_64 ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n    8  ./package_uploader.sh -p ack-grep espeak jupp libmsgpack ncompress stag acr exa kakoune libnet ncurses starship algernon exiftool keybase libnettle ndk-multilib steghide antiword exiv2 keystone libnfs ndk-sysroot stfl apksigner fakeroot kona libnftnl ne stow apr fasd krb5 libnghttp2 net-tools strace apt fastmod kubectl libnl netsed swig aptly fcgi ldns libnpth ninja syncthing argp fcgiwrap less libogg nyancat tar arj fd leveldb liboggz ocrad teckit atomicparsley fdupes lhasa libopus oleo termimage attr fftw libandroid-glob libopusenc openal-soft termux-am autoconf figlet libandroid-shmem libpcap openssh termux-auth axel file libandroid-spawn libpipeline openssl termux-elf-cleaner bash findutils libandroid-support libpixman opusfile termux-exec binutils flex libassuan libpng ossp-uuid termux-keyring bison fortune libbsd libpopt p7zip termux-licenses blogc fsmon libbz2 libprotobuf par2 termux-tools bmon game-repo libc++ libsasl parallel teseq brotli gawk libcap libsigsegv patch timewarrior busybox gbt libcln libsndfile patchelf tinyproxy bvi gcal libconfig libsodium pcre tinyscheme c-ares gdbm libconfuse libsoxr pcre2 tmux c-toxcore geoip2-database  libcue libsqlite perl tokei ca-certificates getconf libcurl libtalloc pforth tor cabextract geth libdav1d libtermkey pick tracepath caddy gflags libdb libtiff pigz tree calcurse giflib libdispatch libtool pinentry tsocks capstone gifsicle libduktape libunibilium pkg-config tsu ccache git-lfs libedit libunistring  play-audio tty-clock cmark gkermit libelf libusb plzip ttyrec cmatrix glib libev libuuid potrace tweego codecrypt gnuit libevent libuv privoxy unicorn  colordiff gnupg libexif libvorbis procps unifdef command-not-found  google-glog libexpat libvpx progress unrar coreutils googletest libffi libvterm proot unstable-repo cowsay gotty libflac libwebp proxychains-ng unzip cppi gperf libgc libx264 psmisc utf8cpp crunch gpsbabel libgcrypt libx265 pulseaudio utf8proc cryptopp grep libgfshare libxapian pv utfdecode cscope gsl libgmp libxml2 pwgen valgrind ctags gtypist libgnutls libyaml qpdf vegeta cvs gumbo-parser libgpg-error libzmq quickjs vim daemonize gzip libgraphite libzopfli radare2 virustotal-cli darkhttpd hashdeep libiconv loksh ragel vttest dash help2man libicu lzip rclone vtutils dasm hexcurse libid3tag lzlib readline wget datamash hexedit libidn lzop redir wireguard-tools ddrescue hexyl libidn2 m4 redis wol debianutils heyu libisl make remind wren dialog hfsutils libjansson mbedtls resolv-conf wuzz dictd hoedown libjasper mdp restic x11-repo diffutils htop libjpeg-turbo memcached ripgrep xcb-proto direnv hugo libksba mg root-repo xorg-util-macros direvent hunspell-en-us libluajit micro samefile xorgproto diskus hunspell-ru liblz4 mime-support sc xtrans dos2unix hyperfine liblzma minicom science-repo xvidcore double-conversion indent liblzo miniupnpc secure-delete yajl doxygen inotify-tools libmaa mksh sed yasm dpkg ipcalc libmad mktorrent sensible-utils zile dtc ipfs libmaxminddb mlocate sharutils zip dte ired libmcrypt morse2ascii shellharden zlib dvtm jhead libmhash mpc silversearcher-ag zsh dx joe libmnl mtools sl zstd ecj jq libmp3lame multitail speexdsp zsync ed json-c libmpdclient nano sshpass erlang jsoncpp libmpfr ncdu ssss inetutils linux-utils git hashdeep\n    9  ./package_uploader.sh -p ack-grep,espeak,jupp,libmsgpack,ncompress,stag,acr,exa,kakoune,libnet,ncurses,starship,algernon,exiftool,keybase,libnettle,ndk-multilib,steghide,antiword,exiv2,keystone,libnfs,ndk-sysroot,stfl,apksigner,fakeroot,kona,libnftnl,ne,stow,apr,fasd,krb5,libnghttp2,net-tools,strace,apt,fastmod,kubectl,libnl,netsed,swig,aptly,fcgi,ldns,libnpth,ninja,syncthing,argp,fcgiwrap,less,libogg,nyancat,tar,arj,fd,leveldb,liboggz,ocrad,teckit,atomicparsley,fdupes,lhasa,libopus,oleo,termimage,attr,fftw,libandroid-glob,libopusenc,openal-soft,termux-am,autoconf,figlet,libandroid-shmem,libpcap,openssh,termux-auth,axel,file,libandroid-spawn,libpipeline,openssl,termux-elf-cleaner,bash,findutils,libandroid-support,libpixman,opusfile,termux-exec,binutils,flex,libassuan,libpng,ossp-uuid,termux-keyring,bison,fortune,libbsd,libpopt,p7zip,termux-licenses,blogc,fsmon,libbz2,libprotobuf,par2,termux-tools,bmon,game-repo,libc++,libsasl,parallel,teseq,brotli,gawk,libcap,libsigsegv,patch,timewarrior,busybox,gbt,libcln,libsndfile,patchelf,tinyproxy,bvi,gcal,libconfig,libsodium,pcre,tinyscheme,c-ares,gdbm,libconfuse,libsoxr,pcre2,tmux,c-toxcore,geoip2-database,,libcue,libsqlite,perl,tokei,ca-certificates,getconf,libcurl,libtalloc,pforth,tor,cabextract,geth,libdav1d,libtermkey,pick,tracepath,caddy,gflags,libdb,libtiff,pigz,tree,calcurse,giflib,libdispatch,libtool,pinentry,tsocks,capstone,gifsicle,libduktape,libunibilium,pkg-config,tsu,ccache,git-lfs,libedit,libunistring,,play-audio,tty-clock,cmark,gkermit,libelf,libusb,plzip,ttyrec,cmatrix,glib,libev,libuuid,potrace,tweego,codecrypt,gnuit,libevent,libuv,privoxy,unicorn,,colordiff,gnupg,libexif,libvorbis,procps,unifdef,command-not-found,,google-glog,libexpat,libvpx,progress,unrar,coreutils,googletest,libffi,libvterm,proot,unstable-repo,cowsay,gotty,libflac,libwebp,proxychains-ng,unzip,cppi,gperf,libgc,libx264,psmisc,utf8cpp,crunch,gpsbabel,libgcrypt,libx265,pulseaudio,utf8proc,cryptopp,grep,libgfshare,libxapian,pv,utfdecode,cscope,gsl,libgmp,libxml2,pwgen,valgrind,ctags,gtypist,libgnutls,libyaml,qpdf,vegeta,cvs,gumbo-parser,libgpg-error,libzmq,quickjs,vim,daemonize,gzip,libgraphite,libzopfli,radare2,virustotal-cli,darkhttpd,hashdeep,libiconv,loksh,ragel,vttest,dash,help2man,libicu,lzip,rclone,vtutils,dasm,hexcurse,libid3tag,lzlib,readline,wget,datamash,hexedit,libidn,lzop,redir,wireguard-tools,ddrescue,hexyl,libidn2,m4,redis,wol,debianutils,heyu,libisl,make,remind,wren,dialog,hfsutils,libjansson,mbedtls,resolv-conf,wuzz,dictd,hoedown,libjasper,mdp,restic,x11-repo,diffutils,htop,libjpeg-turbo,memcached,ripgrep,xcb-proto,direnv,hugo,libksba,mg,root-repo,xorg-util-macros,direvent,hunspell-en-us,libluajit,micro,samefile,xorgproto,diskus,hunspell-ru,liblz4,mime-support,sc,xtrans,dos2unix,hyperfine,liblzma,minicom,science-repo,xvidcore,double-conversion,indent,liblzo,miniupnpc,secure-delete,yajl,doxygen,inotify-tools,libmaa,mksh,sed,yasm,dpkg,ipcalc,libmad,mktorrent,sensible-utils,zile,dtc,ipfs,libmaxminddb,mlocate,sharutils,zip,dte,ired,libmcrypt,morse2ascii,shellharden,zlib,dvtm,jhead,libmhash,mpc,silversearcher-ag,zsh,dx,joe,libmnl,mtools,sl,zstd,ecj,jq,libmp3lame,multitail,speexdsp,zsync,ed,json-c,libmpdclient,nano,sshpass,erlang,jsoncpp,libmpfr,ncdu,ssss,inetutils,linux-utils,git,hashdeep\n   10  history > print.txt\n"
  },
  {
    "path": "scripts/properties.sh",
    "content": "TERMUX_ANDROID_BUILD_TOOLS_VERSION=29.0.2\nTERMUX_NDK_VERSION_NUM=20\nTERMUX_NDK_REVISION=\"\"\nTERMUX_NDK_VERSION=$TERMUX_NDK_VERSION_NUM$TERMUX_NDK_REVISION\n\ntest -f \"$HOME/.termuxrc\" && . \"$HOME/.termuxrc\"\n\n: \"${ANDROID_HOME:=\"${HOME}/lib/android-sdk\"}\"\n: \"${NDK:=\"${HOME}/lib/android-ndk\"}\"\n"
  },
  {
    "path": "scripts/run-docker.ps1",
    "content": "# PowerShell script to build Termux packages with Docker.\r\n#\r\n# Usage example:\r\n#\r\n# .\\scripts\\run-docker.ps1 ./build-package.sh -a arm libandroid-support\r\n\r\nSet-Variable -Name IMAGE_NAME -Value \"termux/package-builder\"\r\nSet-Variable -Name CONTAINER_NAME -Value \"termux-package-builder\"\r\n\r\nWrite-Output \"Running container ${CONTAINER_NAME} from image ${IMAGE_NAME}...\"\r\n\r\ndocker start $CONTAINER_NAME 2>&1 | Out-Null\r\n\r\nif (-Not $?) {\r\n    Write-Output \"Creating new container...\"\r\n    docker run `\r\n        --detach `\r\n        --name $CONTAINER_NAME `\r\n        --volume \"${PWD}:/home/builder/termux-packages\" `\r\n        --tty `\r\n        \"$IMAGE_NAME\"\r\n}\r\n\r\nif ($args.Count -eq 0) {\r\n    docker exec --interactive --tty --user builder $CONTAINER_NAME bash\r\n} else {\r\n    docker exec --interactive --tty --user builder $CONTAINER_NAME $args\r\n}\r\n"
  },
  {
    "path": "scripts/run-docker.sh",
    "content": "#!/bin/sh\nset -e -u\n\nHOME=/home/builder\nUNAME=$(uname)\nif [ \"$UNAME\" = Darwin ]; then\n\t# Workaround for mac readlink not supporting -f.\n\tREPOROOT=$PWD\nelse\n\tREPOROOT=\"$(dirname $(readlink -f $0))/../\"\nfi\n\n: ${TERMUX_BUILDER_IMAGE_NAME:=termux/package-builder}\n: ${CONTAINER_NAME:=termux-package-builder}\n\nUSER=builder\n\necho \"Running container '$CONTAINER_NAME' from image '$TERMUX_BUILDER_IMAGE_NAME'...\"\n\ndocker start $CONTAINER_NAME > /dev/null 2> /dev/null || {\n\techo \"Creating new container...\"\n\tdocker run \\\n\t\t--detach \\\n\t\t--name $CONTAINER_NAME \\\n\t\t--volume $REPOROOT:$HOME/termux-packages \\\n\t\t--tty \\\n\t\t$TERMUX_BUILDER_IMAGE_NAME\n    if [ \"$UNAME\" != Darwin ]; then\n\tif [ $(id -u) -ne 1000 -a $(id -u) -ne 0 ]\n\tthen\n\t\techo \"Changed builder uid/gid... (this may take a while)\"\n\t\tdocker exec --tty $CONTAINER_NAME sudo chown -R $(id -u) $HOME\n\t\tdocker exec --tty $CONTAINER_NAME sudo chown -R $(id -u) /data\n\t\tdocker exec --tty $CONTAINER_NAME sudo usermod -u $(id -u) builder\n\t\tdocker exec --tty $CONTAINER_NAME sudo groupmod -g $(id -g) builder\n\tfi\n    fi\n}\n\nif [ \"$#\" -eq  \"0\" ]; then\n\tdocker exec --interactive --tty $CONTAINER_NAME bash\nelse\n\tdocker exec --interactive --tty $CONTAINER_NAME $@\nfi\n\n\n"
  },
  {
    "path": "scripts/setup-android-sdk.sh",
    "content": "#!/bin/sh\nset -e -u\n\n# Install desired parts of the Android SDK:\n. $(cd \"$(dirname \"$0\")\"; pwd)/properties.sh\n\nANDROID_SDK_FILE=sdk-tools-linux-4333796.zip\nANDROID_SDK_SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9\nANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-Linux-x86_64.zip\nANDROID_NDK_SHA256=57435158f109162f41f2f43d5563d2164e4d5d0364783a9a6fab3ef12cb06ce0\n\nif [ ! -d $ANDROID_HOME ]; then\n\tmkdir -p $ANDROID_HOME\n\tcd $ANDROID_HOME/..\n\trm -Rf $(basename $ANDROID_HOME)\n\n\t# https://developer.android.com/studio/index.html#command-tools\n\t# The downloaded version below is 26.1.1.:\n\techo \"Downloading android sdk...\"\n\tcurl --fail --retry 3 \\\n\t\t-o tools.zip \\\n\t\thttps://dl.google.com/android/repository/${ANDROID_SDK_FILE}\n\techo \"${ANDROID_SDK_SHA256} tools.zip\" | sha256sum -c -\n\trm -Rf android-sdk\n\tunzip -q tools.zip -d android-sdk\n\trm tools.zip\nfi\n\nif [ ! -d $NDK ]; then\n\tmkdir -p $NDK\n\tcd $NDK/..\n\trm -Rf $(basename $NDK)\n\techo \"Downloading android ndk...\"\n\tcurl --fail --retry 3 -o ndk.zip \\\n\t\thttps://dl.google.com/android/repository/${ANDROID_NDK_FILE}\n\techo \"${ANDROID_NDK_SHA256} ndk.zip\" | sha256sum -c -\n\trm -Rf android-ndk-r$TERMUX_NDK_VERSION\n\tunzip -q ndk.zip\n\tmv android-ndk-r$TERMUX_NDK_VERSION $(basename $NDK)\n\trm ndk.zip\nfi\n\nyes | $ANDROID_HOME/tools/bin/sdkmanager --licenses\n\n# The android platforms are used in the ecj and apksigner packages:\nyes | $ANDROID_HOME/tools/bin/sdkmanager \"platform-tools\" \"build-tools;${TERMUX_ANDROID_BUILD_TOOLS_VERSION}\" \"platforms;android-28\" \"platforms;android-24\" \"platforms;android-21\"\n"
  },
  {
    "path": "scripts/setup-archlinux.sh",
    "content": "#!/bin/bash\nset -e -u\n\nPACKAGES=\"\"\nPACKAGES+=\" patch\"\nPACKAGES+=\" asciidoc\"\nPACKAGES+=\" asciidoctor\" # Used by weechat for man pages.\nPACKAGES+=\" automake\"\nPACKAGES+=\" bison\"\nPACKAGES+=\" clang\" # Used by golang, useful to have same compiler building.\nPACKAGES+=\" curl\" # Used for fetching sources.\nPACKAGES+=\" ed\" # Used by bc.\nPACKAGES+=\" flex\"\nPACKAGES+=\" gcc\" # Host C/C++ compiler.\nPACKAGES+=\" gettext\" # Provides 'msgfmt'.\nPACKAGES+=\" git\" # Used by the neovim build.\nPACKAGES+=\" gperf\" # Used by the fontconfig build.\nPACKAGES+=\" help2man\"\nPACKAGES+=\" intltool\" # Used by qalc build.\nPACKAGES+=\" glib2\" # Provides 'glib-genmarshal' which the glib build uses.\nPACKAGES+=\" libtool\"\nPACKAGES+=\" lzip\"\nPACKAGES+=\" python\"\nPACKAGES+=\" python2\"\nPACKAGES+=\" tar\"\nPACKAGES+=\" unzip\"\nPACKAGES+=\" m4\"\nPACKAGES+=\" pkgconf\"\nPACKAGES+=\" python-docutils\" # For rst2man, used by mpv.\nPACKAGES+=\" python-setuptools\" # Needed by at least asciinema.\nPACKAGES+=\" python-sphinx\" # Needed by notmuch man page generation.\nPACKAGES+=\" ruby\" # Needed to build ruby.\nPACKAGES+=\" scons\"\nPACKAGES+=\" texinfo\"\nPACKAGES+=\" xmlto\"\nPACKAGES+=\" expat\" # Needed by ghostscript.\nPACKAGES+=\" libjpeg-turbo\" # Needed by ghostscript.\nPACKAGES+=\" gawk\" # Needed by apr-util.\nPACKAGES+=\" openssl\"  # Needed to build rust.\nPACKAGES+=\" gnupg\" # Needed to verify downloaded debs.\nPACKAGES+=\" jq\" # Needed by bintray uploader script.\nPACKAGES+=\" lua\" # Needed to build luarocks package.\nPACKAGES+=\" python-recommonmark\" # Needed for LLVM-8 documentation.\nPACKAGES+=\" jre8-openjdk-headless\"\n\nsudo pacman -Syq --noconfirm $PACKAGES\n\nsudo mkdir -p /data/data/com.termux/files/usr\nsudo chown -R $(whoami) /data\n\necho \"Please also install ncurses5-compat-libs and makedepend packages from the AUR before continuing\"\n"
  },
  {
    "path": "scripts/setup-termux.sh",
    "content": "#!/data/data/com.termux/files/usr/bin/bash\n\n# Tier 1: requirements for the core build scripts in scripts/build/.\nPACKAGES=\"binutils-gold\"\t# Part of binutils which is dependency of clang.\nPACKAGES+=\" clang\"\t\t\t# Required to build termux-elf-cleaner as well as other\n\t\t\t\t\t\t\t# C/C++ packages.\nPACKAGES+=\" file\"\t\t\t# Used in termux_step_massage().\nPACKAGES+=\" lzip\"\t\t\t# Used by tar to extract *.tar.lz source archives.\nPACKAGES+=\" patch\"\t\t\t# Used for applying patches on source code.\nPACKAGES+=\" python\"\t\t\t# Used buildorder.py core script.\nPACKAGES+=\" unzip\"\t\t\t# Used to extract *.zip source archives.\n\n# Tier 2: requirements for building many other packages.\nPACKAGES+=\" asciidoc\"\nPACKAGES+=\" autoconf\"\nPACKAGES+=\" automake\"\nPACKAGES+=\" bc\"\nPACKAGES+=\" bison\"\nPACKAGES+=\" cmake\"\nPACKAGES+=\" ed\"\nPACKAGES+=\" flex\"\nPACKAGES+=\" gettext\"\nPACKAGES+=\" git\"\nPACKAGES+=\" golang\"\nPACKAGES+=\" gperf\"\nPACKAGES+=\" help2man\"\nPACKAGES+=\" libtool\"\nPACKAGES+=\" m4\"\nPACKAGES+=\" make\"\t\t\t# Used for all Makefile-based projects.\nPACKAGES+=\" ninja\"\t\t\t# Used by default to build all CMake projects.\nPACKAGES+=\" perl\"\nPACKAGES+=\" pkg-config\"\nPACKAGES+=\" protobuf\"\nPACKAGES+=\" python2\"\nPACKAGES+=\" rust\"\nPACKAGES+=\" texinfo\"\nPACKAGES+=\" valac\"\n\napt update\napt dist-upgrade -y\napt install -y $PACKAGES\n"
  },
  {
    "path": "scripts/setup-ubuntu.sh",
    "content": "#!/bin/bash\nset -e -u\n\nPACKAGES=\"\"\nPACKAGES+=\" asciidoc\"\nPACKAGES+=\" asciidoctor\" # Used by weechat for man pages.\nPACKAGES+=\" automake\"\nPACKAGES+=\" autopoint\"\nPACKAGES+=\" bison\"\nPACKAGES+=\" bsdmainutils\" # Provides 'hexdump' which is needed for building bitcoin package.\nPACKAGES+=\" curl\" # Used for fetching sources.\nPACKAGES+=\" ed\" # Used by bc\nPACKAGES+=\" flex\"\nPACKAGES+=\" g++-multilib\" # Used by nodejs build for 32-bit arches.\nPACKAGES+=\" gettext\" # Provides 'msgfmt' which the apt build uses.\nPACKAGES+=\" g++\"\nPACKAGES+=\" git\" # Used by the neovim build.\nPACKAGES+=\" gperf\" # Used by the fontconfig build.\nPACKAGES+=\" groff\" # Used by some packages like openldap\nPACKAGES+=\" help2man\"\nPACKAGES+=\" intltool\" # Used by qalc build.\nPACKAGES+=\" libdbus-1-dev\" # Used by dbus-glib build.\nPACKAGES+=\" libglib2.0-dev\" # Provides 'glib-genmarshal' which the glib build uses.\nPACKAGES+=\" libc-ares-dev\" # Used by host build part of nodejs v12.6.0+.\nPACKAGES+=\" libicu-dev\" # Used by host build part of nodejs v12.6.0+.\nPACKAGES+=\" libtool-bin\"\nPACKAGES+=\" libltdl-dev\"\nPACKAGES+=\" libsigsegv-dev\"\nPACKAGES+=\" libncurses5-dev\" # Used by mariadb for host build part.\nPACKAGES+=\" lzip\"\nPACKAGES+=\" python3.7\"\nPACKAGES+=\" tar\"\nPACKAGES+=\" unzip\"\nPACKAGES+=\" m4\"\nPACKAGES+=\" pandoc\" # For manpage generation for uftrace package.\nPACKAGES+=\" pkg-config\"\nPACKAGES+=\" python3.8\"\nPACKAGES+=\" python3-docutils\" # For rst2man, used by mpv.\nPACKAGES+=\" python3-setuptools\" # Needed by at least asciinema.\nPACKAGES+=\" python3-sphinx\" # Needed by notmuch man page generation.\nPACKAGES+=\" ruby\" # Needed to build ruby.\nPACKAGES+=\" scons\"\nPACKAGES+=\" texinfo\"\nPACKAGES+=\" xmlto\"\nPACKAGES+=\" libexpat1-dev\" # Needed by ghostscript\nPACKAGES+=\" libjpeg-dev\" # Needed by ghostscript\nPACKAGES+=\" gawk\" # Needed by apr-util\nPACKAGES+=\" libssl-dev\" # Needed to build Rust\nPACKAGES+=\" gnupg\" # Needed to verify downloaded .debs\nPACKAGES+=\" jq\" # Needed by bintray upload script.\nPACKAGES+=\" lua5.3\" # Needed to build luarocks package.\nPACKAGES+=\" python3-recommonmark\" # needed for llvm-8 documentation\nPACKAGES+=\" llvm-8-tools\" # so we don't build llvm for build\nPACKAGES+=\" valac\" # for ccnet\nPACKAGES+=\" openssl\" # Needed by swi-prolog\nPACKAGES+=\" zip\" # For smalltalk.\nPACKAGES+=\" libssl-dev:i386\" # Needed by swi-prolog 32-bit\nPACKAGES+=\" zlib1g-dev:i386\"\n\n# Allow 32-bit packages.\nsudo dpkg --add-architecture i386\nsudo apt-get -yq update\n\nsudo DEBIAN_FRONTEND=noninteractive \\\n\tapt-get install -yq --no-install-recommends $PACKAGES\n\n# Find and assign UBUNTU_VERSION\nif [[ `lsb_release -rs` == \"19.04\" ]]; then\n\tUBUNTU_VERSION=\"19.04.2\"\nelse\n\tUBUNTU_VERSION=\"18.10.1\"\nfi\n\n# Make openjdk 8 available:\ncurl -O http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk-headless_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb\ncurl -O http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb\ncurl -O http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb\ncurl -O http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb\nsudo dpkg -i openjdk-8-jre-headless_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb openjdk-8-jre_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb openjdk-8-jdk_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb openjdk-8-jdk-headless_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb || sudo apt install -f -y\nrm openjdk-8-jre-headless_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb openjdk-8-jre_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb openjdk-8-jdk_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb openjdk-8-jdk-headless_8u212-b03-0ubuntu1.\"$UBUNTU_VERSION\"_amd64.deb\n\nsudo mkdir -p /data/data/com.termux/files/usr\nsudo chown -R $(whoami) /data\n"
  },
  {
    "path": "scripts/test-runner.sh",
    "content": "#!/data/data/com.termux/files/usr/bin/bash\n\nif [ $# != 1 ]; then\n\techo \"Specify package to run tests for as only argument\"\n\texit 1\nfi\n\nPACKAGE=$1\nTEST_DIR=packages/$PACKAGE/tests\n\nif [ ! -d $TEST_DIR ]; then\n\techo \"ERROR: No tests folder for package $PACKAGE\"\n\texit 1\nfi\n\nNUM_TESTS=0\nNUM_FAILURES=0\n\nfor TEST_SCRIPT in $TEST_DIR/*; do\n\ttest -t 1 && printf \"\\033[32m\"\n\techo \"Running test ${TEST_SCRIPT}...\"\n\t(( NUM_TESTS += 1 ))\n\ttest -t 1 && printf \"\\033[31m\"\n\t(\n\t\tassert_equals() {\n\t\t\tFIRST=$1\n\t\t\tSECOND=$2\n\t\t\tif [ \"$FIRST\" != \"$SECOND\" ]; then\n\t\t\t\techo \"assertion failed - expected '$FIRST', got '$SECOND'\"\n\t\t\t\texit 1\n\t\t\tfi\n\t\t}\n\t\tset -e -u\n\t\t. $TEST_SCRIPT\n\t)\n\tif [ $? != 0 ]; then\n\t\t(( NUM_FAILURES += 1 ))\n\tfi\n\ttest -t 1 && printf \"\\033[0m\"\ndone\n\necho \"$NUM_TESTS tests run - $NUM_FAILURES failure(s)\"\n"
  },
  {
    "path": "scripts/update-docker.sh",
    "content": "#!/bin/sh\nset -e -u\n\nCONTAINER=termux-package-builder\nIMAGE=termux/package-builder\n\ndocker pull $IMAGE\n\nLATEST=$(docker inspect --format \"{{.Id}}\" $IMAGE)\nRUNNING=$(docker inspect --format \"{{.Image}}\" $CONTAINER)\n\nif [ $LATEST = $RUNNING ]; then\n\techo \"Image '$IMAGE' used in the container '$CONTAINER' is already up to date\"\nelse\n\techo \"Image '$IMAGE' used in the container '$CONTAINER' has been updated - removing the outdated container\"\n\tdocker stop $CONTAINER\n\tdocker rm -f $CONTAINER\nfi\n\n"
  }
]