Big news today https://groups.google.com/forum/#!msg/phantomjs/Jp4sDXrfmNg/I5J5TBFBDQAJ I think this also has the opportunity of a -bin ebuild based on http://phantomjs.org/download.html Reproducible: Always
Hello, This package has no maintainer so this bug may go unnoticed for a long time. Gentoo has a dedicated team[1] for assisting users in maintaining orphaned packages. If you are interested in maintaining this package, please contact proxy-maint@gentoo.org or join #gentoo-proxy-maint on Freenode IRC. [1]: https://wiki.gentoo.org/index.php?title=Project:Proxy_Maintainers Kind regards, Coacher.
I've created an ebuild for v2.1.1 in my overlay: https://github.com/rindeal/gentoo-overlay/blob/master/www-client/phantomjs/phantomjs-2.1.1.ebuild Currently it has these issues: - I've no idea what goes to RDEPEND/DEPEND. Mostly I tried to copy Debian, but still there are some differences - tests fail
I try this ebuild on host without Qt installed, phatnomjs-2.1.1 compiled fine. On desktop, with kde installed, I've got: >>> Emerging (1 of 1) www-client/phantomjs-2.1.1::horhe * phantomjs-2.1.1.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking phantomjs-2.1.1.tar.gz to /var/tmp/portage/www-client/phantomjs-2.1.1/work >>> Source unpacked in /var/tmp/portage/www-client/phantomjs-2.1.1/work >>> Preparing source in /var/tmp/portage/www-client/phantomjs-2.1.1/work/phantomjs-2.1.1 ... * Applying phantomjs-no-ghostdriver.patch ... [ ok ] * Applying phantomjs-qt-components.patch ... [ ok ] * Applying phantomjs-qt55-evaluateJavaScript.patch ... [ ok ] * Applying phantomjs-qt55-no-websecurity.patch ... [ ok ] * Applying phantomjs-qt55-print.patch ... [ ok ] >>> Source prepared. >>> Configuring source in /var/tmp/portage/www-client/phantomjs-2.1.1/work/phantomjs-2.1.1 ... >>> Source configured. >>> Compiling source in /var/tmp/portage/www-client/phantomjs-2.1.1/work/phantomjs-2.1.1 ... Skipping build of Qt Base Skipping build of Qt WebKit Configuring PhantomJS, please wait... Executing in /var/tmp/portage/www-client/phantomjs-2.1.1/work/phantomjs-2.1.1: /usr/lib64/qt5/bin/qmake -makefile QMAKE_AR=x86_64-pc-linux-gnu-ar cqs QMAKE_CC=x86_64-pc-linux-gnu-gcc QMAK_ELINK_C=x86_64-pc-linux-gnu-gcc QMAKE_LINK_C_SHLIB=x86_64-pc-linux-gnu-gcc QMAKE_CXX=x86_64-pc-linux-gnu-g++ QMAKE_LINK=x86_64-pc-linux-gnu-g++ QMAKE_LINK_SHLIB=x86_64-pc-linux-gnu-g++ QMAKE_OBJCOPY=x86_64-pc-linux-gnu-objcopy QMAKE_RANLIB= QMAKE_STRIP= QMAKE_CFLAGS=-O2 -march=native -pipe -fpeel-loops -fuse-linker-plugin -fuse-ld=gold -fvar-tracking-assignments -gdwarf-4 -flto QMAKE_CFLAGS_RELEASE= QMAKE_CFLAGS_DEBUG= QMAKE_CXXFLAGS=-O2 -march=native -pipe -fpeel-loops -fuse-linker-plugin -fuse-ld=gold -fvar-tracking-assignments -gdwarf-4 -flto QMAKE_CXXFLAGS_RELEASE= QMAKE_CXXFLAGS_DEBUG= QMAKE_LFLAGS=-Wl,-O1 -Wl,--as-needed QMAKE_LFLAGS_RELEASE= QMAKE_LFLAGS_DEBUG= Building PhantomJS, please wait... Executing in /var/tmp/portage/www-client/phantomjs-2.1.1/work/phantomjs-2.1.1: make -j 1 cd src/ && ( test -e Makefile.phantomjs || /usr/lib64/qt5/bin/qmake /var/tmp/portage/www-client/phantomjs-2.1.1/work/phantomjs-2.1.1/src/phantomjs.pro 'QMAKE_AR=x86_64-pc-linux-gnu-ar cqs' QMAKE_CC=x86_64-pc-linux-gnu-gcc QMAK_ELINK_C=x86_64-pc-linux-gnu-gcc QMAKE_LINK_C_SHLIB=x86_64-pc-linux-gnu-gcc QMAKE_CXX=x86_64-pc-linux-gnu-g++ QMAKE_LINK=x86_64-pc-linux-gnu-g++ QMAKE_LINK_SHLIB=x86_64-pc-linux-gnu-g++ QMAKE_OBJCOPY=x86_64-pc-linux-gnu-objcopy QMAKE_RANLIB= QMAKE_STRIP= 'QMAKE_CFLAGS=-O2 -march=native -pipe -fpeel-loops -fuse-linker-plugin -fuse-ld=gold -fvar-tracking-assignments -gdwarf-4 -flto' QMAKE_CFLAGS_RELEASE= QMAKE_CFLAGS_DEBUG= 'QMAKE_CXXFLAGS=-O2 -march=native -pipe -fpeel-loops -fuse-linker-plugin -fuse-ld=gold -fvar-tracking-assignments -gdwarf-4 -flto' QMAKE_CXXFLAGS_RELEASE= QMAKE_CXXFLAGS_DEBUG= 'QMAKE_LFLAGS=-Wl,-O1 -Wl,--as-needed' QMAKE_LFLAGS_RELEASE= QMAKE_LFLAGS_DEBUG= -o Makefile.phantomjs ) && make -f Makefile.phantomjs Project ERROR: This program can only be compiled with Qt 5.5.x. Makefile:42: recipe for target 'sub-src-phantomjs-pro-make_first-ordered' failed make: *** [sub-src-phantomjs-pro-make_first-ordered] Error 3 ERROR: Failed to build PhantomJS! Building PhantomJS failed. * ERROR: www-client/phantomjs-2.1.1::horhe failed (compile phase):
I suspect that should be invoked qmake from Qt5: /usr/lib64/qt5/bin/qmake and QT have to be qt-5.5 not qt-5.6.
I changed in src/phantomjs.pro: - if(!equals(QT_MAJOR_VERSION, 5)|!equals(QT_MINOR_VERSION, 5)) { + if(!equals(QT_MAJOR_VERSION, 5)|!greaterThan(QT_MINOR_VERSION, 5)) { and phantomjs compiled fine with Qt-5.6
(In reply to Marcin Mirosław from comment #5) > I changed in src/phantomjs.pro: > - if(!equals(QT_MAJOR_VERSION, 5)|!equals(QT_MINOR_VERSION, 5)) { > + if(!equals(QT_MAJOR_VERSION, 5)|!greaterThan(QT_MINOR_VERSION, 5)) { > > and phantomjs compiled fine with Qt-5.6 Marcin Mirosław given your contribution, do you have interest in proxy maintaining this package?
(In reply to Marcin Mirosław from comment #5) > I changed in src/phantomjs.pro: > - if(!equals(QT_MAJOR_VERSION, 5)|!equals(QT_MINOR_VERSION, 5)) { > + if(!equals(QT_MAJOR_VERSION, 5)|!greaterThan(QT_MINOR_VERSION, 5)) { > > and phantomjs compiled fine with Qt-5.6 Thanks, I've added it to the ebuild.
Sorry Ian, I don't not use phantomjs for myself, I don't how it works. I just have to upgrade it on server sometimes.
I found missing depend for USE=test: e.g. test? "${VIRTUALX_DEPEND}"
(In reply to Marcin Mirosław from comment #9) > I found missing depend for USE=test: > e.g. > test? "${VIRTUALX_DEPEND}" `test? ( $VIRTUALX_DEPEND )` is appended automagically
If it would be added automagically I didn't had to search why test phase fails with: >>> Test phase: www-client/phantomjs-2.1.1 * ERROR: www-client/phantomjs-2.1.1 failed (test phase): * (no error message) * * Call stack: * ebuild.sh, line 133: Called src_test * environment, line 3637: Called virtx '/usr/bin/python2.7' 'test/run-tests.py' * environment, line 4415: Called die * The specific snippet of code: * XVFB=$(type -p Xvfb) || die; :)
Then you're either using Gentoo Prefix or not using the up-to-date ebuild from my overlay. The DEPEND variable should look like this: ``` declare DEPEND="|| ( >=dev-lang/python-2.7.5-r2:2.7 ) >=dev-qt/qtcore-5.5 >=dev-qt/qtgui-5.5 >=dev-qt/qtnetwork-5.5 >=dev-qt/qtprintsupport-5.5 >=dev-qt/qtwebkit-5.5 >=dev-qt/qtwidgets-5.5 dev-libs/icu:= dev-libs/openssl:0 sys-libs/zlib media-libs/mesa media-libs/fontconfig media-libs/freetype media-libs/libpng:0= virtual/jpeg:0 x11-libs/libXext x11-libs/libX11 test? ( dev-lang/ruby ) test? ( !prefix? ( x11-base/xorg-server[xvfb] ) x11-apps/xhost )" ```
I copied directory www-client/phatnomjs/ and eclass/ to my overlay. When I added you overlay using layman indeed xorg-server[xvfb] is added to DEPEND. Sorry for noise.
Ideally we should build from upstream sources, and they should be versioned tarballs with a verifiable checksum. I will attach my initial go at an ebuild, it compiles but the resulting binary does not run. If the group of us can arrive at an ebuild in this style I am willing & able to maintain it. I regret that a collection of git checkouts, particularly with submodules, is unmaintainable. Because we are using this in headless mode where I work, I am trying to avoid any direct Qt or X server dependencies.
Created attachment 495204 [details] phantomjs-2.1.1.ebuild
Just to confirm, this uses Debian patches as scavenged by Jan "rindeal" Chren and is heavily inspired by his overlay work.
Created attachment 495206 [details, diff] phantomjs-qt-components.patch
Created attachment 495208 [details, diff] phantomjs-qt55-evaluateJavaScript.patch
Created attachment 495210 [details, diff] phantomjs-qt55-no-websecurity.patch
Created attachment 495212 [details, diff] phantomjs-qt55-print.patch
Created attachment 495256 [details] phantomjs-2.1.1.ebuild It looks like QT webkit 5.7.1 is tolerated, so increase the version. (The runtime failure mode remains unchanged)
Thanks Tony for taking care of this. I tried building it, which went fine, but afterwards it crashes: # phantomjs This application failed to start because it could not find or load the Qt platform plugin "phantom". Reinstalling the application may fix this problem. PhantomJS has crashed. Please read the bug reporting guide at <http://phantomjs.org/bug-reporting.html> and file a bug report. Aborted Portage 2.3.8 (python 2.7.13-final-0, default/linux/amd64/13.0, gcc-6.4.0, glibc-2.25-r5, 4.12.8-gentoo x86_64) ================================================================= System uname: Linux-4.12.8-gentoo-x86_64-Intel-R-_Core-TM-_i5-3570_CPU_@_3.40GHz-with-gentoo-2.4.1 KiB Mem: 16328808 total, 11289988 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Tue, 19 Sep 2017 00:45:02 +0000 Head commit of repository gentoo: 28a4e73e4cd039a9068d70003235c80dafcb98d0 sh bash 4.4_p12 ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1 app-shells/bash: 4.4_p12::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.24.2::gentoo dev-lang/python: 2.7.13::gentoo, 3.4.6::gentoo, 3.5.3::gentoo, 3.6.1-r1::gentoo dev-util/cmake: 3.8.1::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1-r2::gentoo sys-apps/openrc: 0.31.2::gentoo sys-apps/sandbox: 2.10-r4::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.11.6-r2::gentoo, 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15.1::gentoo sys-devel/binutils: 2.28.1::gentoo, 2.29::gentoo sys-devel/gcc: 6.4.0::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r4::gentoo sys-devel/make: 4.2.1-r1::gentoo sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.25-r5::gentoo ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-mtune=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/apache2-php7.1/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-mtune=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 modules multilib ncurses nptl openmp pam pcre readline seccomp session ssl tcpd unicode xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx f16c popcnt sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 xen pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" NGINX_MODULES_HTTP="access charset gzip limit_conn limit_req log proxy rewrite gunzip upstream_check stub_status" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-0 php7-1" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6" RUBY_TARGETS="ruby22 ruby23 ruby24" USERLAND="GNU" VIDEO_CARDS="intel i915 i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
(In reply to Tomáš Mózes from comment #22) > Thanks Tony for taking care of this. I tried building it, which went fine, > but afterwards it crashes: Indeed, if we can fix that one thing... there's hope.
Created attachment 495392 [details] phantomjs-strace.log
It looks like the phantomjs QPA plugin is some custom thing that's normally in their bundled sources. One can avoid it: sed -e "/qpa/d" -i build.py -i src/qt/preconfig.sh -i tools/preconfig.sh || die but there's a new error: This application failed to start because it could not find or load the Qt platform plugin "xcb". Reinstalling the application may fix this problem. PhantomJS has crashed. Please read the bug reporting guide at <http://phantomjs.org/bug-reporting.html> and file a bug report. Aborted why then does build.py pass -no-xcb?
so I assume it passes -no-xcb because it's relying on the custom phantomjs QPA plugin which doesn't exist in the Qt sources used in this ebuild. Anyway, after building with xcb, there's a new failure: QXcbConnection: Could not connect to display PhantomJS has crashed. Please read the bug reporting guide at <http://phantomjs.org/bug-reporting.html> and file a bug report. Aborted Running it under Xvfb: PhantomJS has crashed. Please read the bug reporting guide at <http://phantomjs.org/bug-reporting.html> and file a bug report. Floating point exception
Created attachment 495428 [details, diff] phantomjs-qt-qpa-platform-plugin.patch
Created attachment 495430 [details] phantomjs-2.1.1.ebuild This builds and runs, and I think we are about there. Proposal is to do an Asterisk-style patchball on the Gentoo mirrors. Could I have some testing please?
(In reply to Michael Palimaka (kensington) from comment #26) > so I assume it passes -no-xcb because it's relying on the custom phantomjs > QPA plugin which doesn't exist in the Qt sources used in this ebuild. You are correct, that was the missing link which is now added.
This is in the tree now, thank you to everyone who took the time to report issues, wrote overlay ebuilds & tested binaries. Any issues with this ebuild as a new bug please, not a comment on this one.