Bug 213634 - lang/phantomjs: update to 2.1.1
Summary: lang/phantomjs: update to 2.1.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Felder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-20 00:39 UTC by ncrogers
Modified: 2017-01-29 19:12 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (feld)


Attachments
update to phantomjs-2.1.1 (16.56 KB, patch)
2017-01-27 06:14 UTC, h0rst
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ncrogers 2016-10-20 00:39:13 UTC
The latest stable version of phantomjs has been at 2.1.1 for quite some time now. My initial attempts to correctly modify the existing port Makefile for 2.0.0 have failed, since 2.1 no longer packages qt in the source. Are there plans to update the port?

Does the port need to be switched to somehow performing a git clone in order to checkout the qt submodule, or do we have to rely on the system qt now?
Comment 1 Mark Felder freebsd_committer 2016-10-20 19:17:24 UTC
(In reply to ncrogers from comment #0)

We can't do a git clone because the package is built in a jail with no internet access which is an intentional restriction. We could do a checkout and roll our own tarball and self-host that. That was my plan for attempting to update this port. I will look into it soon, but if you have progress in this area please let me know.
Comment 2 pete 2016-11-04 18:55:15 UTC
Adding reference to conversation with PhantomJS devs - recommendation is to wait until version 2.5:

https://github.com/ariya/phantomjs/issues/14597
Comment 3 Vick Khera 2017-01-06 19:22:06 UTC
Kind of related...

It seems to me that phantomjs usefulness is much diminished if it does not have access to actual fonts to render text. I need to also install webfonts package wherever I use it. Could webfonts be made a run dependency on the next update?

I build everything without X11 support to run on headless servers, so maybe that's why I don't automatically get the fonts.
Comment 4 pete 2017-01-06 19:26:50 UTC
(In reply to Vick Khera from comment #3)
I'll defer to the porters for this, but in my use-case we run it headless as well, although we don't require font rendering as part of our unit-test framework.  our primary use-case is to verify that SCSS is being compiled correctly and that our .js code is working as well.
Comment 5 Vick Khera 2017-01-06 19:42:12 UTC
actually, the xorg-fonts-truetype package provides nicer fonts than webfonts and also allows text to render.
Comment 6 pete 2017-01-09 00:36:53 UTC
Good news - looks like PhantomJS v2.5.0.  This includes the ability to build against system KDE which should make PhantomJS now build on FreeBSD.  I hope to test this locally tomorrow.

https://groups.google.com/forum/#!topic/phantomjs/AefOuwkgBh0
Comment 7 Mark Felder freebsd_committer 2017-01-09 18:33:19 UTC
I'll keep my eye on this PR. Glad to see this finally has made progress.
Comment 8 pete 2017-01-10 00:21:15 UTC
I have put some cycles into getting the phantomjs binary to build on 11-RELEASE.  Since upstream hasn't updated their build instructions I'm documenting what steps were required to get my build working locally:

- Current code lives in this Github repo:
https://github.com/ariya/phantomjs
https://github.com/ariya/phantomjs.git

- Check out "master" branch

- Install qt5 meta pkg and ensure that both "qmake" and "moc" exist under:
/usr/local/lib/qt5/bin/

- in root of repository run "qmake' to generate Makefile

- run "make"

There is a bug I am needing to dig into where this exception is thrown when building:

webpage.cpp:369:42: error: no member named 'WebSecurityEnabled' in 'QWebSettings'; did you
      mean 'WebAudioEnabled'?
    settings->setAttribute(QWebSettings::WebSecurityEnabled, phantomCfg->webSecurityEn...
                           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
                                         WebAudioEnabled
/usr/local/include/qt5/QtWebKit/qwebsettings.h:89:9: note: 'WebAudioEnabled' declared here
        WebAudioEnabled,


Applying this diff allows the code to compile, I'll research a proper fix for this shortly:

$ git diff
diff --git a/src/webpage.cpp b/src/webpage.cpp
index ac309c65..1d8283f9 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -366,7 +366,7 @@ WebPage::WebPage(QObject* parent, const QUrl& baseUrl)
     // attribute "WebSecurityEnabled" must be applied during the initializing
     // security context for Document instance. Setting up it later will not cause any effect
     QWebSettings* settings = m_customWebPage->settings();
-    settings->setAttribute(QWebSettings::WebSecurityEnabled, phantomCfg->webSecurityEnabled());
+    // settings->setAttribute(QWebSettings::WebSecurityEnabled, phantomCfg->webSecurityEnabled());

     m_mainFrame = m_customWebPage->mainFrame();
     m_currentFrame = m_mainFrame;
Comment 9 h0rst 2017-01-27 06:14:00 UTC
Created attachment 179343 [details]
update to phantomjs-2.1.1
Comment 10 h0rst 2017-01-27 06:16:29 UTC
Comment on attachment 179343 [details]
update to phantomjs-2.1.1

I tried to fix this port. Could anyone more experienced check this patch which compiles cleanly over here.
Comment 11 Mark Felder freebsd_committer 2017-01-29 19:12:04 UTC
Fantastic work. Thanks for your efforts!

Committed with minor changes.
Comment 12 commit-hook freebsd_committer 2017-01-29 19:12:06 UTC
A commit references this bug:

Author: feld
Date: Sun Jan 29 19:11:36 UTC 2017
New revision: 432793
URL: https://svnweb.freebsd.org/changeset/ports/432793

Log:
  lang/phantomjs: Update to 2.1.1

  PR:		213634

Changes:
  head/lang/phantomjs/Makefile
  head/lang/phantomjs/distinfo
  head/lang/phantomjs/files/patch-build.py
  head/lang/phantomjs/files/patch-build.sh
  head/lang/phantomjs/files/patch-configure
  head/lang/phantomjs/files/patch-src-phantomjs.pro
  head/lang/phantomjs/files/patch-src-qt-preconfig.sh
  head/lang/phantomjs/files/patch-src_qt_qtbase_configure
  head/lang/phantomjs/files/patch-src_qt_qtbase_src_3rdparty_icu__dependency.pri
  head/lang/phantomjs/files/patch-src_qt_qtbase_src_corelib_io_qstorageinfo__unix.cpp
  head/lang/phantomjs/files/patch-src_qt_qtbase_src_network_ssl_qsslcontext.cpp
  head/lang/phantomjs/files/patch-src_qt_qtbase_src_network_ssl_qsslsocket__openssl__symbols.cpp
  head/lang/phantomjs/files/patch-src_qt_qtbase_src_tools_qlalr_lalr.cpp