Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml install fail #31

Closed
dauuricus opened this issue Sep 4, 2021 · 2 comments
Closed

xml install fail #31

dauuricus opened this issue Sep 4, 2021 · 2 comments

Comments

@dauuricus
Copy link

dauuricus commented Sep 4, 2021

i can't install xml on Termux luarocks.

Installing https://luarocks.org/lua-requests-1.2-2.src.rock
Missing dependencies for lua-requests 1.2-2:
xml (not installed)
luasec >= 0.5.1, < 0.8-1 (1.0.2-1 installed)
lua-requests 1.2-2 depends on xml (not installed)
Installing https://luarocks.org/xml-1.1.3-1.src.rock
Error: Failed installing dependency: https://luarocks.org/xml-1.1.3-1.src.rock - Could not find library file for STDCPP
No file libstdc++.a in /data/data/com.termux/files/usr/local/lib
No file libstdc++.a in /data/data/com.termux/files/usr/local/lib64
No file libstdc++.so in /data/data/com.termux/files/usr/local/lib
No file libstdc++.so in /data/data/com.termux/files/usr/local/lib64
No file matching libstdc++.so.* in
/data/data/com.termux/files/usr/local/lib
No file matching libstdc++.so.* in
/data/data/com.termux/files/usr/local/lib64
No file libstdc++.a in /data/data/com.termux/files/usr/lib
No file libstdc++.a in /data/data/com.termux/files/usr/lib64
No file libstdc++.so in /data/data/com.termux/files/usr/lib
No file libstdc++.so in /data/data/com.termux/files/usr/lib64
No file matching libstdc++.so.* in /data/data/com.termux/files/usr/lib
No file matching libstdc++.so.* in /data/data/com.termux/files/usr/lib64

You may have to install STDCPP in your system and/or pass STDCPP_DIR or STDCPP_LIBDIR to the luarocks command.

Example: luarocks install xml STDCPP_DIR=/usr/local

termux has no stdc++
termux/termux-app#1846

I want to 'redirect' function on https, but i can't do in luasec.So I really want to know how to redirect https request on Lua lang programming.

I have no knowledge about c++ environment and luarocks recipe , so I tripped. I want to know how to make lua xml on termux or how to build lua xml except for using 'STDCPP'.


u0_a185@localhost ~ [1]> luarocks config
accept_unknown_fields = false
arch = "linux-aarch64"
cache_fail_timeout = 86400
cache_timeout = 60
check_certificates = false
cmake_generator = "Unix Makefiles"
config_files = {
   nearest = "/data/data/com.termux/files/home/.luarocks/config-5.3.lua",
   system = {
      file = "/data/data/com.termux/files/usr/etc/luarocks/config-5.3.lua",
      found = true
   },
   user = {
      file = "/data/data/com.termux/files/home/.luarocks/config-5.3.lua",
      found = true
   }
}
connection_timeout = 30
deploy_bin_dir = "/data/data/com.termux/files/usr/bin"
deploy_lib_dir = "/data/data/com.termux/files/usr/lib/lua/5.3"
deploy_lua_dir = "/data/data/com.termux/files/usr/share/lua/5.3"
deps_mode = "one"
disabled_servers = {}
export_path_separator = ":"
external_deps_dirs = {
   "/data/data/com.termux/files/usr/local",
   "/data/data/com.termux/files/usr"
}
external_deps_patterns = {
   bin = {
      "?"
   },
   include = {
      "?.h"
   },
   lib = {
      "lib?.a",
      "lib?.so",
      "lib?.so.*"
   }
}
external_deps_subdirs = {
   bin = "bin",
   include = "include",
   lib = {
      "lib",
      "lib64"
   }
}
external_lib_extension = "so"
fs_use_modules = true
gcc_rpath = true
home = "/data/data/com.termux/files/home"
home_tree = "/data/data/com.termux/files/home/.luarocks"
homeconfdir = "/data/data/com.termux/files/home/.luarocks"
hooks_enabled = true
lib_extension = "so"
lib_modules_path = "/lib/lua/5.3"
link_lua_explicitly = false
local_by_default = false
local_cache = "/data/data/com.termux/files/home/.cache/luarocks"
lua_extension = "lua"
lua_found = {
   lua_bindir = "/data/data/com.termux/files/usr/bin",
   lua_dir = "/data/data/com.termux/files/usr",
   lua_interpreter = "lua5.3",
   lua_version = "5.3"
}
lua_interpreter = "lua5.3"
lua_modules_path = "/share/lua/5.3"
lua_version = "5.3"
major_version = "3.1"
obj_extension = "o"
processor = "arm"
program_series = "3.1"
program_version = "3.1.3"
rocks_dir = "/data/data/com.termux/files/usr/lib/luarocks/rocks-5.3"
rocks_provided = {
   bit32 = "5.3-1",
   lua = "5.3-1",
   utf8 = "5.3-1"
}
rocks_provided_3_0 = {
   bit32 = "5.3-1",
   lua = "5.3-1",
   utf8 = "5.3-1"
}
rocks_servers = {
   {
      "https://luarocks.org",
      "https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/",
      "http://luafr.org/moonrocks/",
      "http://luarocks.logiceditor.com/rocks"
   }
}
rocks_subdir = "/lib/luarocks/rocks-5.3"
rocks_trees = {
   {
      name = "user",
      root = "/data/data/com.termux/files/home/.luarocks"
   },
   {
      name = "system",
      root = "/data/data/com.termux/files/usr"
   }
}
runtime_external_deps_patterns = {
   bin = {
      "?"
   },
   include = {
      "?.h"
   },
   lib = {
      "lib?.so",
      "lib?.so.*"
   }
}
runtime_external_deps_subdirs = {
   bin = "bin",
   include = "include",
   lib = {
      "lib",
      "lib64"
   }
}
static_lib_extension = "a"
sysconfdir = "/data/data/com.termux/files/usr/etc/luarocks"
target_cpu = "arm"
upload = {
   api_version = "1",
   server = "https://luarocks.org",
   tool_version = "1.0.0"
}
user_agent = "LuaRocks/3.1.3 linux-aarch64"
variables = {
   AR = "ar",
   BUNZIP2 = "bunzip2",
   CC = "gcc",
   CFLAGS = "-O2 -fPIC",
   CHMOD = "chmod",
   CMAKE = "cmake",
   CP = "cp",
   CURL = "curl",
   CURLNOCERTFLAG = "-k",
   CVS = "cvs",
   FIND = "find",
   GIT = "git",
   GPG = "gpg",
   GUNZIP = "gunzip",
   HG = "hg",
   ICACLS = "icacls",
   LD = "gcc",
   LIBFLAG = "-shared",
   LIB_EXTENSION = "so",
   LS = "ls",
   LUA = "/data/data/com.termux/files/usr/bin/lua5.3",
   LUALIB = "lua5.3",
   LUA_BINDIR = "/data/data/com.termux/files/usr/bin",
   LUA_DIR = "/data/data/com.termux/files/usr",
   LUA_INCDIR = "/data/data/com.termux/files/usr/include/lua5.3",
   MAKE = "make",
   MD5 = "md5",
   MD5SUM = "md5sum",
   MKDIR = "mkdir",
   MKTEMP = "mktemp",
   OBJ_EXTENSION = "o",
   OPENSSL = "openssl",
   PWD = "pwd",
   RANLIB = "ranlib",
   RM = "rm",
   RMDIR = "rmdir",
   ROCKS_TREE = "/data/data/com.termux/files/usr/lib/luarocks/rocks-5.3",
   RSYNC = "rsync",
   RSYNCFLAGS = "--exclude=.git -Oavz",
   SCP = "scp",
   SCRIPTS_DIR = "/data/data/com.termux/files/usr/bin",
   SEVENZ = "7z",
   SSCM = "sscm",
   SVN = "svn",
   TAR = "tar",
   TOUCH = "touch",
   UNZIP = "unzip -n",
   WGET = "wget",
   WGETNOCERTFLAG = "--no-check-certificate",
   ZIP = "zip"
}
version_check_on_fail = true
web_browser = "xdg-open"
wrapper_suffix = ""
@dauuricus
Copy link
Author

dauuricus commented Sep 5, 2021

Now I got GCC on termux

u0_a185@localhost ~ [1]> cd $PREFIX/../cctools-toolchain/bin/
u0_a185@localhost /d/d/c/f/c/bin> ls
addr2line                         c++      gcc-ar-10      ld
ar                                c++-10   gcc-nm         ld.bfd
arm-linux-androideabi-c++         c++filt  gcc-nm-10      lto-dump-10
arm-linux-androideabi-cpp         cpp      gcc-ranlib     nm
arm-linux-androideabi-g++         cpp-10   gcc-ranlib-10  objcopy
arm-linux-androideabi-gcc         elfedit  gcov-10        objdump
arm-linux-androideabi-gcc-ar      g++      gcov-dump-10   ranlib
arm-linux-androideabi-gcc-nm      g++-10   gcov-tool-10   readelf
arm-linux-androideabi-gcc-ranlib  gcc      gfortran       size
arm-linux-androideabi-gfortran    gcc-10   gfortran-10    strings
as                                gcc-ar   gprof          strip

u0_a185@localhost /d/d/c/f/c/bin [1]> cd $PREFIX/../cctools-toolchain/
u0_a185@localhost /d/d/c/f/cctools-toolchain> ls
aarch64-linux-android  arm-linux-androideabi  bin  include  lib  share
u0_a185@localhost /d/d/c/f/cctools-toolchain> cd $PREFIX/../cctools-toolchain/lib
u0_a185@localhost /d/d/c/f/c/lib> ls
armv7-a       libbfd.a          libgomp.a     libopcodes.a        libstdc++fs.a
bfd-plugins   libbfd.la         libgomp.la    libopcodes.la       libstdc++fs.la
gcc           libgfortran.a     libgomp.spec  libstdc++.a         libsupc++.a
libatomic.a   libgfortran.la    libobjc.a     libstdc++.a-gdb.py  libsupc++.la
libatomic.la  libgfortran.spec  libobjc.la    libstdc++.la        thumb

Rf.

https://android.stackexchange.com/questions/182130/use-gcc-compiler-in-termux#186223

.https://cctools.info/index.php/Termux_repository_with_cctools_packages_(gcc_with_fortran_support_etc)

and then I got error ...

u0_a185@localhost ~> luarocks install xml STDCPP_LIBDIR=$PREFIX/../cctools-toolchain/lib
Installing https://luarocks.org/xml-1.1.3-1.src.rock

gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c src/Parser.cpp -o src/Parser.o -Iinclude -Isrc/bind -Isrc/vendor
In file included from include/xml/Parser.h:33,
                 from src/Parser.cpp:1:
src/bind/dub/dub.h:32:10: fatal error: string.h: No such file or directory
   32 | #include <string.h>  // strlen strcmp
      |          ^~~~~~~~~~
compilation terminated.

Error: Build error: Failed compiling object src/Parser.o

@dauuricus
Copy link
Author

dauuricus commented Sep 5, 2021

OK.
done.

I just exit Termux, then login and try same defore.

~ $ fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
u0_a185@localhost ~> luarocks install xml STDCPP_LIBDIR=$PREFIX/../cctools-toolchain/lib
Installing https://luarocks.org/xml-1.1.3-1.src.rock

gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c src/Parser.cpp -o src/Parser.o -Iinclude -Isrc/bind -Isrc/vendor
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c src/bind/dub/dub.cpp -o src/bind/dub/dub.o -Iinclude -Isrc/bind -Isrc/vendor
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c src/bind/xml_Parser.cpp -o src/bind/xml_Parser.o -Iinclude -Isrc/bind -Isrc/vendor
gcc -O2 -fPIC -I/data/data/com.termux/files/usr/include/lua5.3 -c src/bind/xml_core.cpp -o src/bind/xml_core.o -Iinclude -Isrc/bind -Isrc/vendor
gcc -shared -o xml/core.so src/Parser.o src/bind/dub/dub.o src/bind/xml_Parser.o src/bind/xml_core.o -L/data/data/com.termux/files/usr/../cctools-toolchain/lib -Wl,-rpath,/data/data/com.termux/files/usr/../cctools-toolchain/lib -lstdc++
xml 1.1.3-1 is now installed in /data/data/com.termux/files/usr (license: MIT)

this is not good solution.

the solution is here.

lubyk/xml#16 (comment)

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

No branches or pull requests

1 participant