Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#27518 closed submission (fixed)

webp port request

Reported by: Themanwithoutaplan Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), pascal.massimino@…
Port: webp

Description

Initial portfile for Google's webp project. Leptonica will be installed as a dependency and not from the Google tarball. Currently does not configure and paths need correcting for compilation. See related ticket on the Webp tracker.

http://code.google.com/p/webp/issues/detail?id=3

Attachments (4)

webp.tbz (1.3 KB) - added by Themanwithoutaplan 13 years ago.
Initial port
webp.tar.bz2 (1.9 KB) - added by ryandesign (Ryan Carsten Schmidt) 13 years ago.
revised portfile
webp-0.0.5.tar.bz2 (2.4 KB) - added by ryandesign (Ryan Carsten Schmidt) 13 years ago.
webp-0.0.5-1.tar.bz2 (2.4 KB) - added by ryandesign (Ryan Carsten Schmidt) 13 years ago.

Download all attachments as: .zip

Change History (29)

Changed 13 years ago by Themanwithoutaplan

Attachment: webp.tbz added

Initial port

comment:1 Changed 13 years ago by Themanwithoutaplan

From the install log

msg:main --->  Configuring webp
:debug:main Using compiler 'Mac OS X gcc 4.2'
:debug:configure configure phase started at Tue Nov 30 14:39:25 CET 2010
:debug:configure Executing org.macports.configure (webp)
:debug:configure Environment: CPATH='/opt/local/include' CFLAGS='-O2 -arch x86_64' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-O2 -arch x86_64' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.6' CXX='/usr/bin/g++-4.2' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_webp/work/.CC_PRINT_OPTIONS' F90FLAGS='-O2 -m64' LDFLAGS='-L/opt/local/lib -arch x86_64' OBJC='/usr/bin/gcc-4.2' FCFLAGS='-O2 -m64' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2 -arch x86_64' FFLAGS='-O2 -m64' CC_PRINT_OPTIONS='YES' CC='/usr/bin/gcc-4.2'
:debug:configure Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_webp/work/webp-leptonica-0.0.4" && ./configure --prefix=/opt/local'
:info:configure sh: line 0: cd: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_webp/work/webp-leptonica-0.0.4: No such file or directory
:info:configure shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_webp/work/webp-leptonica-0.0.4" && ./configure --prefix=/opt/local " returned error 1

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Summary: Support for webp graphicswebp port request

As I understand it, this requires #27511 to be resolved first.

comment:3 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

No, wait... this requires webp's patches to leptonica to be applied to the leptonica port first, right?

comment:4 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

The leptonica included in the webp source seems to be version "1.066" of 15 Sept 2010. This does not seem to correspond to either leptonica 1.66 of 3 Aug 2010 nor leptonica 1.67 of 8 Nov 2010 so I am having trouble generating a suitable patch that could be applied to the leptonica port. Get the webp developers to supply a patch to leptonica that we can apply, or get them to get their changes incorporated in the official leptonica software, then we can update to that version of leptonica.

Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: webp.tar.bz2 added

revised portfile

comment:5 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

I've attached a revised portfile, with patches that eliminate some seemingly ill-advised bits in webp's build process, which works, in the sense that the port builds and installs. I don't know if the software it installs actually works at all; if you can try it and let me know, that would be great. I assume it does not work at all since it links with the MacPorts leptonica which does not contain webp's patches.

comment:6 Changed 13 years ago by Themanwithoutaplan

Thanks very much for creating a usable Port! I can confirm that this now builds. You're right about the patching process: webp includes patche leptonica sources rather than just a patch. I'm trying to get this changed.

Even a binary built with the webp patched sources does not work properly: I get segfaults when using it!

re. "unified diff" - can I do this without having a checkout of MacPorts locally?

comment:7 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Sure, unified diffs are created by using the "diff -u" command. See the guide. I assume you're responding to my comment in #27511.

comment:8 Changed 13 years ago by Themanwithoutaplan

Yes, #27511 and elsewhere on the psycopg2 ports. Thanks again!

Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: webp-0.0.5.tar.bz2 added

comment:9 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

It seems from reading the continuation of the upstream bug report that they are either unable or unwilling at this point in time to integrate their leptonlib changes into the official leptonica source and are quite keen on having users build their modified version of leptonlib instead. So that is what the new webp 0.0.5 port I just attached to this ticket now does. It builds for me, but again I'm not sure if it works; can you check?

comment:10 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

I should add that this new port does not have a dependency on the leptonica port anymore (since it uses webp's modified leptonlib), but the build will fail if the leptonica port is installed and active. "sudo port deactivate leptonica" before trying to build webp @0.0.5. I'll see if I can fix this.

Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: webp-0.0.5-1.tar.bz2 added

comment:11 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Now here's the revised version that no longer has a problem with leptonica already being installed.

comment:12 Changed 13 years ago by Themanwithoutaplan

Thanks: compiles and installs fine. Do you also get segfaults when using it? If not I'd suggest adding it as a devel

comment:13 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

I had not tried to run it before (other than to see the usage message), but trying to actually convert an image now, yes, I do get a segmentation fault -- if webp was compiled for x86_64. If compiled for i386 instead (which you can accomplish by adding the line "supported_archs i386 ppc" to the portfile), it runs and produces an output file, but the file produced does not appear to be a valid webp file. It's twice the size of the original jpg (instead of 40% smaller as it should be), and it does not open in Firefox (which, thanks to the webp plugin, is able to view other webp images) nor can webpconv read it.

comment:14 Changed 13 years ago by Themanwithoutaplan

Reported to x86_64 problem upstream. Let's hope we just get a patchfile for leptonlib at some point. I noted from the recent leptonica upgrade reference to problems with the binaries. Wonder if this problem is related?

Thanks for the weppy tip - works fine in Opera as well.

comment:15 Changed 13 years ago by pascal.massimino@…

Cc: pascal.massimino@… added

Cc Me!

comment:16 in reply to:  description Changed 13 years ago by pascal.massimino@…

Replying to charlie.clark@…:

Initial portfile for Google's webp project. Leptonica will be installed as a dependency and not from the Google tarball. Currently does not configure and paths need correcting for compilation. See related ticket on the Webp tracker.

http://code.google.com/p/webp/issues/detail?id=3

Update from WebP team:

new standalone encoding library is out, independent of leptonica.

The announce is here: https://groups.google.com/a/webmproject.org/group/webp-discuss/browse_thread/thread/3a2784f36680f740

Source tree: http://www.webmproject.org/code/#libwebp_webp_image_library

It provides the 'cwebp' and 'dwebp' command-line tools.

For demo purpose, precompiled binaries for 10.5 and 10.6 are available for download here: http://code.google.com/p/webp/downloads/list

thanks!

comment:17 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Thank you for letting us know! I'll see if I can update the portfile and get this to work.

comment:18 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Very easy this time. Port added in r76480.

comment:19 in reply to:  18 Changed 13 years ago by pascal.massimino@…

Replying to ryandesign@…:

Very easy this time. Port added in r76480.

thanks! That was quick :)

comment:20 in reply to:  18 Changed 13 years ago by pascal.massimino@…

Replying to ryandesign@…:

Very easy this time. Port added in r76480.

Oh! One thing i see in: trunk/dports/graphics/webp/Portfile?rev=76480

=> you can remove the dependency on tiff in the depend_libs clause.
We no longer support this input type.

Thanks!
skal

comment:21 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Yeah, I meant to before committing, and did so in r76481.

comment:22 Changed 13 years ago by Themanwithoutaplan

Thanks for streamlining the build but I'm still getting a segmentation error if I try and convert anything. Unfortunately the error isn't being passed to a debugger so I can't provide the details. Is there a way to do this?

comment:23 in reply to:  22 Changed 13 years ago by pascal.massimino@…

Replying to charlie.clark@…:

Thanks for streamlining the build but I'm still getting a segmentation error if I try and convert anything. Unfortunately the error isn't being passed to a debugger so I can't provide the details. Is there a way to do this?

to get the error messages, can you try compiling the archive directly? it's http://webp.googlecode.com/files/libwebp-0.1.tar.gz

'port' is essentially doing a "./configure && make" here, so should be easy to repro...

thanks! skal

comment:24 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

I don't think there's any need to suggest the user to build the software by hand; the result would be the same as what MacPorts has already done.

If you encounter build errors and want to see what they are, type "port log webp". The logs are deleted upon a successful installation; if you want to keep logs even of successful builds, edit macports.conf and set "keeplogs" to "yes".

In Charlie's case, he said it built successfully, but crashed when running. Mac OS X saves crash logs to ~/Library/Logs/DiagnosticReports. Perhaps examining that log will help.

Ports do not usually build software with special debugging code enabled. But for purposes of diagnosing problems with webp, since it is new, I have added (in r76522) a +debug variant to webp; if you rebuild it with that variant, it will reduce the compiler optimization and add debugger information so that your crash logs will be more detailed (for example, including function line numbers) and you can run it through gdb if you want to poke at it further. At least, this should work; I have not tried it because it does not crash for me.

comment:25 Changed 13 years ago by Themanwithoutaplan

Sorry, it looks like I made a mistake and still had bits of previous builds in my system. 0.1 runs fine on my system. Binary commands cwebp to convert to webp and dwebp to convert from webp.

Probably still good idea to have a debug variant around until webp gets more stable.

Note: See TracTickets for help on using tickets.