Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 563732

Summary: media-libs/imlib2 fails to build under musl
Product: Gentoo Linux Reporter: toast+misc
Component: Current packagesAssignee: Gentoo musl team <musl>
Status: RESOLVED FIXED    
Severity: normal CC: blueness, enlightenment+disabled, toast+misc
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702    
Attachments: add time.h to common.h for time_t on musl

Description toast+misc 2015-10-21 21:48:12 UTC
I'm seeing two problems.

1. src/lib/image.h is missing an #include <time.h> (as it uses time_t)
2. the PNG loader seems to assume setjmp is glibc-like

While a patch for the 1st problem is fairly simple (upstream bug report available here: https://phab.enlightenment.org/T2793), the second one needs a solution as well, thus the report here.
Comment 1 Felix Janda 2015-10-22 06:50:35 UTC
Why do you think that 2. is true? (How to reproduce the problem?)
Comment 2 toast+misc 2015-10-22 07:25:49 UTC
$ mkdir imlib2 && cd imlib2
$ wget http://downloads.sourceforge.net/project/enlightenment/imlib2-src/1.4.4/imlib2-1.4.4.tar.gz
$ tar xf imlib2-1.4.4.tar.gz
$ mkdir work && cd work
$ vim ../imlib2-1.4.4/src/lib/image.h # add an #include <time.h>
$ ../imlib2-1.4.4/configure --without-x
$ make

Output: http://sprunge.us/jTbi
I didn't look into this very deeply at all, but I do remember similar problems when I tried to port gnu pth (with setjmp)
Comment 3 toast+misc 2015-10-22 07:28:00 UTC
Actually, after taking a second look, it appears that there's some problem with how png_ptr is defined... Might look in deeper sometime this weekend.
Comment 4 Felix Janda 2015-10-23 17:16:08 UTC
Thanks for the test case! (I had no problem building current git and
thought that you were experiencing run time failures or build failures
with something dependent on imlib2.)

The second problem has nothing to do with musl and is fixed with the
commits 5983044ae479efc47f2b6130c865b9252f9e9174 and
d594895dbae9c6de4686e8e3e422bcba0dc4381f (in imlib2-1.4.5).

For the first problem, please prepare a patch and send it upstream
and here. (I think it's better to put the include into common.h.)
Comment 5 SpanKY gentoo-dev 2015-10-23 22:08:41 UTC
attach the patches/reports and i can push them upstream
Comment 6 toast+misc 2015-10-24 00:07:56 UTC
Any particular desired format for the patch? (e.g diff between old/new common.h ; or git-format-patch; etc)
Comment 7 SpanKY gentoo-dev 2015-10-24 06:06:16 UTC
git format-patch is fine
Comment 8 toast+misc 2015-10-25 03:44:05 UTC
Created attachment 415398 [details, diff]
add time.h to common.h for time_t on musl

Patch against HEAD of https://git.enlightenment.org/legacy/imlib2.git/
generated by `git format-patch origin`

Disregard PNG issue: already fixed upstream
Comment 9 toast+misc 2015-10-28 23:24:46 UTC
Link to upstream bug: https://phab.enlightenment.org/T2793
Comment 10 toast+misc 2015-11-01 20:53:36 UTC
Bug is now resolved upstream.

Hopefully a new release will come soon enough (and we can either stabilize, or notify users on the Project:Musl page).
Comment 11 SpanKY gentoo-dev 2015-11-02 20:06:42 UTC
(In reply to Chloe Kudryavtsev from comment #10)

please list the git sha1's that are needed to make imlib2-1.4.7 work

we don't really care about backporting to older versions
Comment 12 toast+misc 2015-11-02 21:16:12 UTC
My git install sees it as 521573b (currently: HEAD^^).
The relevant commit can be found here: https://git.enlightenment.org/legacy/imlib2.git/commit/?id=521573be219f27c7bfebb57d5b0b994fdb316721

Quickly checked and compiled: appears to be fine.