Hello,
It would be nice to have a headless browser: http://phantomjs.org/
Do you mean through npm? Me too :)
I tried to compile it myself, but don't know where to start.
This is a hard one as it builds its own Qt version. I started modifying the Qt build scripts, but it鈥檚 a real PITA.
Hi could you please give me the package name phantomjs in termux and how to to install it that would me helpfull
Hi Can any one Solve this Error
To ai tbm
I did'nt get it what is ai tbm ??
PLEASE include this package in Termux
maddalakum , it is in portuguese. "Tou(Estou) a铆 tbm(tamb茅m)" means something like "I am also like that" / "I also want to do that"
Ohh okay :)
I tried to build phantomjs 2.1.1 but gave up for now because I'm stuck with some QT-specific errors I don't understand.
Here is what I patched so far in case someone wants to take over:
diff --git a/build.py b/build.py
index bf06752d..e9ec3f0d 100755
--- a/build.py
+++ b/build.py
@@ -263,6 +263,7 @@ class PhantomJSBuilder(object):
"-no-dbus",
"-no-opengl",
"-no-audio-backend",
+ "-no-largefile",
"-D", "QT_NO_GRAPHICSVIEW",
"-D", "QT_NO_GRAPHICSEFFECT",
"-D", "QT_NO_STYLESHEET",
@@ -270,7 +271,11 @@ class PhantomJSBuilder(object):
"-D", "QT_NO_STYLE_CLEANLOOKS",
"-D", "QT_NO_STYLE_MOTIF",
"-D", "QT_NO_STYLE_PLASTIQUE",
- "-D", "QT_NO_PRINTPREVIEWDIALOG"
+ "-D", "QT_NO_PRINTPREVIEWDIALOG",
+ "-D", "Q_OS_ANDROID",
+ "-D", "_POSIX_THREAD_PRIORITY_SCHEDULING=-1",
+ "-I", "/data/data/com.termux/files/usr/include/libandroid-support",
+ "-l", "android-support"
]
configure.extend(self.platformQtConfigureOptions())
if self.options.qt_config:
[02:24 home ]$ pacman -Ss phantom
community/phantomjs 2.1.1-9
Headless WebKit with JavaScript API
Package seems to be available through https://sdrausty.github.io/TermuxArch/ on device.

So close. I tried the Arch version too. I am getting illegal instruction as an error. From what I'm reading, this has happened to other applications on the Pi due to compiling the wrong arm version instructions. This may be an error with he build script itself.
@bit-garden correct me if I'm wrong. You have installed Arch Linux in Termux, but phantomjs produces errors. Can you post a screenshot? Are these errors related to pip install or running phantomjs?
I don't have my phone at the moment for a screenshot. I did this the way you listed in your screenshot.
pacman -S phantomjs
It installed without errors, but when I tried to run it, it simply exited with a message Illegal instruction
It seems like a similar issue to this https://github.com/nodejs/node/issues/283 which could be the install script doesn't support the version of arm I'm on(nexus 6, should be armv7) or the script isn't detecting properly. When I get my phone back, I'll try a few things.
@Rudloff what errors? I'm working on Qt but tools are not working.
Did you try to cross compile?
For now, I only tried running phantomjs' build script from Termux itself.
I got errors about some QT classes missing although they were clearly in the QT source folder and I don't know enough about QT to debug this.
@maddalakum u can't use proot things outside of proot it means you can not run any Kali Linux program from outside so it is not error and should be close :)
Looks like there is a qt build for termux (https://github.com/termux/x11-packages/blob/master/packages/qt5-base/build.sh) so maybe at some point someone can port a build script for phantomjs
Looks like there is a qt build for termux (https://github.com/termux/x11-packages/blob/master/packages/qt5-base/build.sh) so maybe at some point someone can port a build script for phantomjs
Well, those patches are certainly useful, in getting a little further building this highly defective source.
After applying those patches, reminding the linker that -latomic does actually exist (contrary to what it would like you to think) in the .pri files, and having to use termux-fix-shebang to even be able to get the initial errors, I am left with this devastating malfunction:
ssl/qsslcertificate_openssl.cpp:63:30: error: member access into incomplete
type 'X509' (aka 'x509_st')
return qHashBits(x509->sha1_hash, SHA_DIGEST_LENGTH, seed);
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:120:16: note:
forward declaration of 'x509_st'
typedef struct x509_st X509;
^
ssl/qsslcertificate_openssl.cpp:87:68: error: member access into incomplete
type 'X509' (aka 'x509_st')
QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->...
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:120:16: note:
forward declaration of 'x509_st'
typedef struct x509_st X509;
^
ssl/qsslcertificate_openssl.cpp:96:45: error: member access into incomplete
type 'X509' (aka 'x509_st')
ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:120:16: note:
forward declaration of 'x509_st'
typedef struct x509_st X509;
^
ssl/qsslcertificate_openssl.cpp:232:32: error: member access into incomplete
type 'X509' (aka 'x509_st')
X509_PUBKEY *xkey = d->x509->cert_info->key;
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:120:16: note:
forward declaration of 'x509_st'
typedef struct x509_st X509;
^
ssl/qsslcertificate_openssl.cpp:236:29: error: member access into incomplete
type 'EVP_PKEY' (aka 'evp_pkey_st')
if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:93:16: note:
forward declaration of 'evp_pkey_st'
typedef struct evp_pkey_st EVP_PKEY;
^
ssl/qsslcertificate_openssl.cpp:240:36: error: member access into incomplete
type 'EVP_PKEY' (aka 'evp_pkey_st')
} else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA) {
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:93:16: note:
forward declaration of 'evp_pkey_st'
typedef struct evp_pkey_st EVP_PKEY;
^
ssl/qsslcertificate_openssl.cpp:245:36: error: member access into incomplete
type 'EVP_PKEY' (aka 'evp_pkey_st')
} else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_EC) {
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:93:16: note:
forward declaration of 'evp_pkey_st'
typedef struct evp_pkey_st EVP_PKEY;
^
ssl/qsslcertificate_openssl.cpp:250:36: error: member access into incomplete
type 'EVP_PKEY' (aka 'evp_pkey_st')
} else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) {
^
/data/data/com.termux/files/usr/include/openssl/ossl_typ.h:93:16: note:
forward declaration of 'evp_pkey_st'
typedef struct evp_pkey_st EVP_PKEY;
^
8 errors generated.
make[2]: *** [Makefile:21907: .obj/qsslcertificate_openssl.o] Error 1
make[2]: Leaving directory '/data/data/com.termux/files/home/phantomjs/src/qt/qtbase/src/network'
My research concludes that it is attempting to include a dead, no longer used version of openssl (1.0.0?), which is seemingly not available in the Termux repos.
There is a proposed solution here:
https://stackoverflow.com/questions/35488166/error-compiling-qt5-with-openssl-linked
But as a commenter noted, it does not indeed help.
Unless of course I applied said fix incorrectly, by adding:
LIBS += -L/data/data/com.termux/files/usr/include/openssl/ -lssl -lcrypto -l
to src/qt/qtbase/src/network/ssl/ssl.pri.
Do you fine people have any suggestions as to how to proceed?
Similar unresolved (and not replyable to) issue:
https://github.com/ariya/phantomjs/issues/15181#issue-270404412
pkg install phantomjs not locate
try to download but after extrating
phantomjs-2.1.1-linux-x86_64.tar.bz2
In termux i got files
Names
ChangeLog README.md examples
LICENSE.BSD bin third-party.txt
I am trying to run thirparty package with requirement phantomjs still showing same error kindly help
I am missing something
@droidhackhd You shouldnt use x86-64 packages on ARM devices, besides that I don't know what the issue is.
I was able to compile the latest dev version on Termux, after compiling libssl1.0.0s for it, and manually patching several source files.
Some of the patches for qt5 base were very helpful:
https://github.com/termux/x11-packages/tree/master/packages/qt5-base
Also, sed is your friend.
I could probably upload it as a repo or something if that would help anyone, but I'm not sure how well that works after you have compiled it?
@IamPARANOID
I could probably upload it as a repo or something if that would help anyone, but I'm not sure how well that works after you have compiled it?
I am interested, it would be great if you would upload it to a repo. I just hit my head on this, as many others have in the last 3+ years and probably many more will in the future.
@IamPARANOID I'm interested too.
So anyone got anything?
Most helpful comment
Looks like there is a qt build for termux (https://github.com/termux/x11-packages/blob/master/packages/qt5-base/build.sh) so maybe at some point someone can port a build script for phantomjs