Re: NEW: devel/phantomjs

2013-12-11 Thread Stuart Henderson
On 2013/12/05 10:57, Francisco de Borja Lopez Rio wrote:
 On Wed, Dec 04, 2013 at 11:37:07AM +, Stuart Henderson wrote:
 
  MESSAGE should go; if every port which installed examples under
  share/examples/portname printed a message about it, installing or
  updating ports would be excessively noisy.
 
  BUILD_DEPENDS on print/freetype seems unlikely to be correct - this
  is a very old version providing libttf (which you don't have in WANTLIB).
  the usual freetype is in base (X) and provides libfreetype which is
  listed in WANTLIB.
 
  the #!/usr/bin/env bash lines should be replaced with proper paths
  rather than relying on the environment, I would use perl -pi -e
  's,^#!/usr/bin/env bash,#!${LOCALBASE}/bin/bash,' ${WRKSRC}/... for
  this.
 
  i'd add a comment next to the PARALLEL_BUILD line, e.g.
 
  # passed via environment rather than on the command line to make
  PARALLEL_BUILD =No
 
  NO_TEST is meant to indicate that there are no tests, not that there
  are tests which fail - so please remove the NO_TEST line, but it may be
  appropriate to add a comment noting the failures.
 
 
 All done, attached is the updated version of the port, which is also
 available here for download:
 
 http://codigo23.net/openbsd/ports/phantomjs.tar.gz

New tar.gz attached with minor changes: move category to www (devel is
very busy), tweak the license marker, add newline at EOF in DESCR,
and enable parallel builds for dpb.

This one is OK sthen@ if anybody would like to import it (or would
like to give me an OK to import)..

Build isn't *too* bad, about 45min on my laptop.



phantomjs.tgz
Description: application/tar-gz


Re: NEW: devel/phantomjs

2013-12-10 Thread Stuart Henderson
On 2013/12/09 18:54, Francisco de Borja Lopez Rio wrote:
 On Thu, Dec 05, 2013 at 10:57:32AM +0100, Francisco de Borja Lopez Rio wrote:
 
  All done, attached is the updated version of the port, which is also
  available here for download:
 
  http://codigo23.net/openbsd/ports/phantomjs.tar.gz
 
 
 Ok?
 
 --
 
 Do nothing which is of no use. - Miyamoto Musashi
 -
 Francisco de Borja Lopez Rio (bo...@codigo23.net)
 Soluciones Informaticas Codigo23 S.L.U.
 http://www.codigo23.net

I haven't had time to look at the revised version of this yet.



Re: NEW: devel/phantomjs

2013-12-09 Thread Francisco de Borja Lopez Rio
On Thu, Dec 05, 2013 at 10:57:32AM +0100, Francisco de Borja Lopez Rio wrote:

 All done, attached is the updated version of the port, which is also
 available here for download:

 http://codigo23.net/openbsd/ports/phantomjs.tar.gz


Ok?

--

Do nothing which is of no use. - Miyamoto Musashi
-
Francisco de Borja Lopez Rio (bo...@codigo23.net)
Soluciones Informaticas Codigo23 S.L.U.
http://www.codigo23.net


pgpTLJ6HGOblB.pgp
Description: PGP signature


Re: NEW: devel/phantomjs

2013-12-05 Thread Francisco de Borja Lopez Rio
On Wed, Dec 04, 2013 at 11:37:07AM +, Stuart Henderson wrote:

 MESSAGE should go; if every port which installed examples under
 share/examples/portname printed a message about it, installing or
 updating ports would be excessively noisy.

 BUILD_DEPENDS on print/freetype seems unlikely to be correct - this
 is a very old version providing libttf (which you don't have in WANTLIB).
 the usual freetype is in base (X) and provides libfreetype which is
 listed in WANTLIB.

 the #!/usr/bin/env bash lines should be replaced with proper paths
 rather than relying on the environment, I would use perl -pi -e
 's,^#!/usr/bin/env bash,#!${LOCALBASE}/bin/bash,' ${WRKSRC}/... for
 this.

 i'd add a comment next to the PARALLEL_BUILD line, e.g.

 # passed via environment rather than on the command line to make
 PARALLEL_BUILD =No

 NO_TEST is meant to indicate that there are no tests, not that there
 are tests which fail - so please remove the NO_TEST line, but it may be
 appropriate to add a comment noting the failures.


All done, attached is the updated version of the port, which is also
available here for download:

http://codigo23.net/openbsd/ports/phantomjs.tar.gz

Regards.

--

Do nothing which is of no use. - Miyamoto Musashi
-
Francisco de Borja Lopez Rio (bo...@codigo23.net)
Soluciones Informaticas Codigo23 S.L.U.
http://www.codigo23.net


phantomjs.tar.gz
Description: application/tar-gz


pgpHcbgS0G3h0.pgp
Description: PGP signature


Re: NEW: devel/phantomjs

2013-12-04 Thread Stuart Henderson
On 2013/12/04 10:58, Francisco de Borja Lopez Rio wrote:
 Ok, updated port attached.
 
 I've applied fixes for most of the feedback, except with some notes:
 
 On Wed, Nov 27, 2013 at 05:12:51PM +, Stuart Henderson wrote:
 
  ksh should work for this script, no? it also calls out to preconfig.sh
  which should also work with ksh, just patch the shebang lines.
 
 
 preconfig.sh does not run with ksh, lots of errors and I don't think it is
 worth the effort to replace it with a ksh-compatible version.
 
 Is it a big trouble to have bash as a build dependency here?
 
 
  I haven't tried building it yet, but I suspect it needs a NO_TEST=Yes too.
 
 
 I've added a do-test routine, but right now if you run the tests you will get
 some failures.
 
 I've been digging a bit, trying to run the tests in other platforms (FreeBSD 
 9,
 OSx 10.8) and tests didn't pass cleanly there neither, so... I added a
 NO_TEST=Yes for now, hopefully that will change in future releases.
 
 Regards.
 
 --
 
 Do nothing which is of no use. - Miyamoto Musashi
 -
 Francisco de Borja Lopez Rio (bo...@codigo23.net)
 Soluciones Informaticas Codigo23 S.L.U.
 http://www.codigo23.net



MESSAGE should go; if every port which installed examples under
share/examples/portname printed a message about it, installing or
updating ports would be excessively noisy.

BUILD_DEPENDS on print/freetype seems unlikely to be correct - this
is a very old version providing libttf (which you don't have in WANTLIB).
the usual freetype is in base (X) and provides libfreetype which is
listed in WANTLIB.

the #!/usr/bin/env bash lines should be replaced with proper paths
rather than relying on the environment, I would use perl -pi -e
's,^#!/usr/bin/env bash,#!${LOCALBASE}/bin/bash,' ${WRKSRC}/... for
this.

i'd add a comment next to the PARALLEL_BUILD line, e.g.

# passed via environment rather than on the command line to make
PARALLEL_BUILD =No

NO_TEST is meant to indicate that there are no tests, not that there
are tests which fail - so please remove the NO_TEST line, but it may be
appropriate to add a comment noting the failures.



Re: NEW: devel/phantomjs

2013-11-28 Thread Stuart Henderson
On 2013/11/28 08:50, Francisco de Borja Lopez Rio wrote:
 Yeah, completely forgot that the statically built binary will contain some
 GPLed stuff. Should it be PERMIT_PACKAGE_CDROM = No then?

No, it's ok to package, just the license marker in the comment needs updating.

 
   MAKE_ENV =  C_INCLUDE_PATH=/usr/X11R6/include/ \
   CPLUS_INCLUDE_PATH=/usr/X11R6/include/ \
  
  replace /usr/X11R6 with ${X11BASE}.
  
  add MAKEFLAGS=-j${MAKE_JOBS} to MAKE_ENV and set PARALLEL_BUILD = No.
  
 
 If we use the build.sh script, it automatically sets the JOBS number based
 on the OSTYPE (openbsd) and the number of cpu/cores.

Yes, and that is incorrect because it's outside of control of ports.
dpb controls the number of jobs to avoid more cores being used than are
available. If you rely on this automatic setting and have a 4-core
machine where dpb is already running 3 jobs, when it starts building
phantomjs it will be running 7 jobs in parallel, which is just going
to slow things down.

 As I understand, adding
 those MAKEFLAGS will let users decide how many JOBS will be used, right?

Users or dpb - yes.

 What about PARALLEL_BUILD? why should we set it to No for this port?

Because it has its own mechanism rather than using make -j

  I haven't tried building it yet, but I suspect it needs a NO_TEST=Yes too.
  
 
 It has regression tests:
 
 https://github.com/ariya/phantomjs/wiki/Test-Suite
 
 But maybe I have to add a custom do-test? entry in the Makefile to run them?

Yes, please.

  I share Landry's distaste at adding another copy of webkit and *especially*
  the extra copy of qt with all the patches that this brings... however I have
  heard that CasperJS (which runs on top of PhantomJS) is particularly useful
  for screenscraping some awkward sites (especially banks) so it could be a
  handy thing to have...
 
 Same here, as I've said, I don't like having to build against the bundled 
 copy 
 of the libraries.
 
 About phantomjs itself, this port came out of the necessity we have in a 
 project I'm working on, where we need it for integration tests of some 
 webapps.
 So, well, here we need it and after being able to build it I thought it would 
 be nice to have it in the ports collection for everybody else.
 
 -- 
 
 Do nothing which is of no use. - Miyamoto Musashi
 -
 Francisco de Borja Lopez Rio (bo...@codigo23.net)
 Soluciones Informaticas Codigo23 S.L.U.
 http://www.codigo23.net 
 




Re: NEW: devel/phantomjs

2013-11-28 Thread Vadim Zhukov
27.11.2013 19:38 пользователь Landry Breuil lan...@rhaalovely.net
написал:

 On Wed, Nov 27, 2013 at 04:19:30PM +0100, Francisco de Borja Lopez Rio
wrote:
  Hi everybody (first time writing to this list)
 
  Attached is a port for PhantomJS, a headless WebKit scriptable with a
  JavaScript API. It has fast and native support for various web
standards:
  DOM handling, CSS selector, JSON, Canvas, and SVG.
 
  Home page: http://phantomjs.org
 
  This is my first attempt to write a port for OpenBSD, so any feedback
will
  be really appreciated.
 
  Notes:
 
  - It requires qt4, webkit and some other libraries in order to build,
but
it only builds correctly against the versions provided in its own
tarball.
I tried for some time to build it against qt4 and webkit from ports,
but
it didn't work.

 Urgh. No. The horror.

 We dont need yet another copy of qt4 and webkit in the tree


IIRC, Alexey Suslikov and me both tried to make it use system qt4 and
failed - too significant changes to QtWebkit there.


NEW: devel/phantomjs

2013-11-27 Thread Francisco de Borja Lopez Rio
Hi everybody (first time writing to this list)

Attached is a port for PhantomJS, a headless WebKit scriptable with a 
JavaScript API. It has fast and native support for various web standards: 
DOM handling, CSS selector, JSON, Canvas, and SVG.

Home page: http://phantomjs.org

This is my first attempt to write a port for OpenBSD, so any feedback will
be really appreciated.

Notes:

- It requires qt4, webkit and some other libraries in order to build, but
  it only builds correctly against the versions provided in its own tarball.
  I tried for some time to build it against qt4 and webkit from ports, but
  it didn't work.

- In order to build the bundled qt4, before actually building phantomjs itself,
  I imported some patches from our x11/qt4 port

- Some of the .cpp source files use strcmp instead of strncmp, I'll try to work
  a bit more on this and send them some patches to fix it.

- I've tested the build procedure both in 5.4 and the latest snapshot, worked
  fine in both environments (in amd64, I couldn't test other archs as I don't 
have
  the hardware for it).

You can download the port from here too:

http://codigo23.net/openbsd/ports/phantomjs.tar.gz

Regards.

-- 

Do nothing which is of no use. - Miyamoto Musashi
-
Francisco de Borja Lopez Rio (bo...@codigo23.net)
Soluciones Informaticas Codigo23 S.L.U.
http://www.codigo23.net 



phantomjs.tar.gz
Description: application/tar-gz


pgpTHezL3pkC4.pgp
Description: PGP signature


Re: NEW: devel/phantomjs

2013-11-27 Thread Ted Unangst
On Wed, Nov 27, 2013 at 16:19, Francisco de Borja Lopez Rio wrote:

 - Some of the .cpp source files use strcmp instead of strncmp, I'll try to
 work
 a bit more on this and send them some patches to fix it.

Unless you're thinking of a different string function, strcmp isn't a
bad function.



Re: NEW: devel/phantomjs

2013-11-27 Thread Landry Breuil
On Wed, Nov 27, 2013 at 04:19:30PM +0100, Francisco de Borja Lopez Rio wrote:
 Hi everybody (first time writing to this list)
 
 Attached is a port for PhantomJS, a headless WebKit scriptable with a 
 JavaScript API. It has fast and native support for various web standards: 
 DOM handling, CSS selector, JSON, Canvas, and SVG.
 
 Home page: http://phantomjs.org
 
 This is my first attempt to write a port for OpenBSD, so any feedback will
 be really appreciated.
 
 Notes:
 
 - It requires qt4, webkit and some other libraries in order to build, but
   it only builds correctly against the versions provided in its own tarball.
   I tried for some time to build it against qt4 and webkit from ports, but
   it didn't work.

Urgh. No. The horror.

We dont need yet another copy of qt4 and webkit in the tree

Landry


pgpB5r8YWSU8b.pgp
Description: PGP signature


Re: NEW: devel/phantomjs

2013-11-27 Thread Francisco de Borja Lopez Rio
On Wed, Nov 27, 2013 at 10:37:23AM -0500, Ted Unangst wrote:
 On Wed, Nov 27, 2013 at 16:19, Francisco de Borja Lopez Rio wrote:
 
  - Some of the .cpp source files use strcmp instead of strncmp, I'll try to
  work
  a bit more on this and send them some patches to fix it.
 
 Unless you're thinking of a different string function, strcmp isn't a
 bad function.

Ok. Probably I need to understand first what an unsafe use of it means, as
mentioned in Security Recommendations in the porting page:

http://www.openbsd.org/porting.html#Security

Thanks!

-- 

Do nothing which is of no use. - Miyamoto Musashi
-
Francisco de Borja Lopez Rio (bo...@codigo23.net)
Soluciones Informaticas Codigo23 S.L.U.
http://www.codigo23.net 



pgpOfI9LSleXH.pgp
Description: PGP signature


Re: NEW: devel/phantomjs

2013-11-27 Thread Francisco de Borja Lopez Rio
On Wed, Nov 27, 2013 at 04:38:08PM +0100, Landry Breuil wrote:
 On Wed, Nov 27, 2013 at 04:19:30PM +0100, Francisco de Borja Lopez Rio wrote:
  Hi everybody (first time writing to this list)
  
  Attached is a port for PhantomJS, a headless WebKit scriptable with a 
  JavaScript API. It has fast and native support for various web standards: 
  DOM handling, CSS selector, JSON, Canvas, and SVG.
  
  Home page: http://phantomjs.org
  
  This is my first attempt to write a port for OpenBSD, so any feedback will
  be really appreciated.
  
  Notes:
  
  - It requires qt4, webkit and some other libraries in order to build, but
it only builds correctly against the versions provided in its own tarball.
I tried for some time to build it against qt4 and webkit from ports, but
it didn't work.
 
 Urgh. No. The horror.
 
 We dont need yet another copy of qt4 and webkit in the tree
 

I do agree, it is really disgusting that it does not build against our existing
ports for those. The phantomjs project encourages the use of the bundled libs,
and the author wrote something about it too:

http://ariya.ofilabs.com/2012/03/the-evolution-of-phantomjs-build-workflow.html

Personally, I'd like to get it to build against what we have in the ports tree,
maybe someone with a stronger background in qt4 could help a bit with it?


-- 

Do nothing which is of no use. - Miyamoto Musashi
-
Francisco de Borja Lopez Rio (bo...@codigo23.net)
Soluciones Informaticas Codigo23 S.L.U.
http://www.codigo23.net 



pgpWL38_SjqCj.pgp
Description: PGP signature


Re: NEW: devel/phantomjs

2013-11-27 Thread Stuart Henderson
On 2013/11/27 16:38, Landry Breuil wrote:
 We dont need yet another copy of qt4 and webkit in the tree

To be fair, we have a few copies of mozilla too :)



Re: NEW: devel/phantomjs

2013-11-27 Thread Landry Breuil
On Wed, Nov 27, 2013 at 04:32:30PM +, Stuart Henderson wrote:
 On 2013/11/27 16:38, Landry Breuil wrote:
  We dont need yet another copy of qt4 and webkit in the tree
 
 To be fair, we have a few copies of mozilla too :)

Yeah, but 4 of them should hit the attic as soon as the last users of
xulrunner 1.9 have been fixed (or disabled) to use 24.. :p

Landry



Re: NEW: devel/phantomjs

2013-11-27 Thread Ted Unangst
On Wed, Nov 27, 2013 at 16:47, Francisco de Borja Lopez Rio wrote:

 Ok. Probably I need to understand first what an unsafe use of it means, as
 mentioned in Security Recommendations in the porting page:
 
 http://www.openbsd.org/porting.html#Security

1. I don't think strcmp belongs in that last. strcmp only reads data.
If that's a problem, then the buffer overflow has already occurred.

2. I honestly don't understand what half of those issues are or how
we could possibly fix all the ports to avoid them. I think they're
mostly talking about setuid programs, but some of the bullet points
forget to mention that fact. Beware the dynamic loader? Are people
actually auditing every library to make sure it calls issetugid? Maybe
I'm just out of touch with how porting really works.



Re: NEW: devel/phantomjs

2013-11-27 Thread Stuart Henderson
 NAME =  phantomjs
 VERSION =   1.9.2
 PKGNAME =   ${NAME}-${VERSION}
 DISTNAME =  ${PKGNAME}-source
...
 WRKDIST =   ${WRKDIR}/${PKGNAME}

these can be replaced with:

PKGNAME =   phantomjs-1.9.2
EXTRACT_SUFX =  -source.zip

using ${NAME} all through the Makefile like you've done isn't really
done in the ports tree, and there's no value to setting VERSION separately

 HOMEPAGE =  http://phantomjs.org

trailing slash is preferable here

 # BSD License

not if it bundles Qt, it isn't..

 MAKE_ENV =  C_INCLUDE_PATH=/usr/X11R6/include/ \
 CPLUS_INCLUDE_PATH=/usr/X11R6/include/ \

replace /usr/X11R6 with ${X11BASE}.

add MAKEFLAGS=-j${MAKE_JOBS} to MAKE_ENV and set PARALLEL_BUILD = No.

 do-build:
 @cd ${WRKSRC}  env -i ${MAKE_ENV} \
 ${LOCALBASE}/bin/bash build.sh --confirm

ksh should work for this script, no? it also calls out to preconfig.sh
which should also work with ksh, just patch the shebang lines.

the first two of these lines should be copied to do-configure, and do-build
should be removed.

I haven't tried building it yet, but I suspect it needs a NO_TEST=Yes too.

I share Landry's distaste at adding another copy of webkit and *especially*
the extra copy of qt with all the patches that this brings... however I have
heard that CasperJS (which runs on top of PhantomJS) is particularly useful
for screenscraping some awkward sites (especially banks) so it could be a
handy thing to have...



Re: NEW: devel/phantomjs

2013-11-27 Thread Stuart Henderson
On 2013/11/27 11:56, Ted Unangst wrote:
 On Wed, Nov 27, 2013 at 16:47, Francisco de Borja Lopez Rio wrote:
 
  Ok. Probably I need to understand first what an unsafe use of it means, as
  mentioned in Security Recommendations in the porting page:
  
  http://www.openbsd.org/porting.html#Security
 
 1. I don't think strcmp belongs in that last. strcmp only reads data.
 If that's a problem, then the buffer overflow has already occurred.
 
 2. I honestly don't understand what half of those issues are or how
 we could possibly fix all the ports to avoid them. I think they're
 mostly talking about setuid programs, but some of the bullet points
 forget to mention that fact. Beware the dynamic loader? Are people
 actually auditing every library to make sure it calls issetugid? Maybe
 I'm just out of touch with how porting really works.
 

There are some useful bits in that page but it is fairly out of
date with current porting practises..

Main porting docs are in http://www.openbsd.org/faq/ports/, it would
be nice if someone had time to go through the out of date pages
like porting.html and move any remaining useful bits to faq/ports/,
then we can finally kill off porting.html etc. and replace them with
placeholders / meta refresh pages pointing people at the new pages..



Re: NEW: devel/phantomjs

2013-11-27 Thread Francisco de Borja Lopez Rio
Thanks a lot for the feedback Stuart. 

On Wed, Nov 27, 2013 at 05:12:51PM +, Stuart Henderson wrote:

  # BSD License
 
 not if it bundles Qt, it isn't..
 

Yeah, completely forgot that the statically built binary will contain some
GPLed stuff. Should it be PERMIT_PACKAGE_CDROM = No then?

  MAKE_ENV =  C_INCLUDE_PATH=/usr/X11R6/include/ \
  CPLUS_INCLUDE_PATH=/usr/X11R6/include/ \
 
 replace /usr/X11R6 with ${X11BASE}.
 
 add MAKEFLAGS=-j${MAKE_JOBS} to MAKE_ENV and set PARALLEL_BUILD = No.
 

If we use the build.sh script, it automatically sets the JOBS number based
on the OSTYPE (openbsd) and the number of cpu/cores. As I understand, adding
those MAKEFLAGS will let users decide how many JOBS will be used, right?

What about PARALLEL_BUILD? why should we set it to No for this port?

 
 I haven't tried building it yet, but I suspect it needs a NO_TEST=Yes too.
 

It has regression tests:

https://github.com/ariya/phantomjs/wiki/Test-Suite

But maybe I have to add a custom do-test? entry in the Makefile to run them?

 I share Landry's distaste at adding another copy of webkit and *especially*
 the extra copy of qt with all the patches that this brings... however I have
 heard that CasperJS (which runs on top of PhantomJS) is particularly useful
 for screenscraping some awkward sites (especially banks) so it could be a
 handy thing to have...

Same here, as I've said, I don't like having to build against the bundled copy 
of the libraries.

About phantomjs itself, this port came out of the necessity we have in a 
project I'm working on, where we need it for integration tests of some webapps.
So, well, here we need it and after being able to build it I thought it would 
be nice to have it in the ports collection for everybody else.

-- 

Do nothing which is of no use. - Miyamoto Musashi
-
Francisco de Borja Lopez Rio (bo...@codigo23.net)
Soluciones Informaticas Codigo23 S.L.U.
http://www.codigo23.net 



pgp0YTvSj3U4t.pgp
Description: PGP signature