Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 392195 - app-office/lyx-2.0.1 on ~x86-macos
Summary: app-office/lyx-2.0.1 on ~x86-macos
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: x86 OS X
: Normal enhancement (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-27 15:31 UTC by MATSUI Tetsushi
Modified: 2012-04-25 18:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lyx-2.0.1 (edited ebuild) (lyx-2.0.1.ebuild,4.71 KB, text/plain)
2011-11-27 15:31 UTC, MATSUI Tetsushi
Details
lyx-2.0.1-macosx.patch (lyx-2.0.1-macosx.patch,329 bytes, patch)
2011-11-27 15:32 UTC, MATSUI Tetsushi
Details | Diff
lyx-2.0.1-lyxinclude.m4-macosx.patch (lyx-2.0.1-lyxinclude.m4-macosx.patch,393 bytes, patch)
2011-12-06 18:10 UTC, MATSUI Tetsushi
Details | Diff
lyx-2.0.2 (edited ebuild) (lyx-2.0.2.ebuild,4.84 KB, text/plain)
2011-12-06 18:22 UTC, MATSUI Tetsushi
Details
lyx-2.0.3 (edited ebuild) (lyx-2.0.3.ebuild,4.70 KB, text/plain)
2012-03-09 14:51 UTC, MATSUI Tetsushi
Details
ebuild diff (lyx-2.0.3.ebuild.diff,1.73 KB, text/plain)
2012-03-19 15:35 UTC, MATSUI Tetsushi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MATSUI Tetsushi 2011-11-27 15:31:51 UTC
Created attachment 293943 [details]
lyx-2.0.1 (edited ebuild)

With an effort, I can emerge lyx-2.0 on ~x86-macos.
So, I'd like to share it on the prefix tree.

These packages are DEPENDs of lyx simply ecopyable:
app-text/noweb
dev-tex/dvipost

I used a patch to configure and some edit on ebuild.
See the attachments.
Comment 1 MATSUI Tetsushi 2011-11-27 15:32:51 UTC
Created attachment 293945 [details, diff]
lyx-2.0.1-macosx.patch

patch against configure
Comment 2 Fabian Groffen gentoo-dev 2011-11-29 19:25:14 UTC
@tex: app-text/noweb needs ED in src_install, so an EAPI-bump to 3.  Is that ok with you if we do that to a revision bump?

@tex/aballier: Just to ack, the lyx configure patch (will be transformed in a .ac+ patch) is ok with you?
Comment 3 Fabian Groffen gentoo-dev 2011-11-29 21:08:10 UTC
(In reply to comment #2)
> Is that ok with you if we do that to a revision bump?

To elaborate on this, only if you think this is necessary.  I'd prefer not to bump since the change would be straightforward.
Comment 4 pavel sanda 2011-12-04 21:58:03 UTC
is there reason why not push your patch upstream instead of patching this only in gentoo? (the change needs to be done primarily at configure.ac)?
Comment 5 MATSUI Tetsushi 2011-12-05 13:07:55 UTC
(In reply to comment #4)
> is there reason why not push your patch upstream instead of patching this only
> in gentoo? (the change needs to be done primarily at configure.ac)?

Basically, there is no obstacle, but, you know, reporting to upstream is just one heavy step further.
Comment 6 MATSUI Tetsushi 2011-12-06 18:10:28 UTC
Created attachment 295005 [details, diff]
lyx-2.0.1-lyxinclude.m4-macosx.patch

A direct patch is not a good way to change configure.
This time, the patch is applied to one of its source, config/lyxinclude.m4.
Comment 7 MATSUI Tetsushi 2011-12-06 18:22:39 UTC
Created attachment 295007 [details]
lyx-2.0.2 (edited ebuild)

There appears app-office/lyx-2.0.2, thus I also update the ebuild of this bug.

Changes:
 1. patch for configure is changed as above, and it makes us introduce eautoconf.
 2. X-related packages are conditioned X? in COMMONDEPEND, since Qt on OS X does not depend on X.
Comment 8 pavel sanda 2011-12-06 22:46:23 UTC
i don't think this is the right direction.
we shouldn't keep specific patchsets unless they are just gentoo specific.
Comment 9 MATSUI Tetsushi 2011-12-07 00:26:56 UTC
I reported to upstream, too:
http://www.lyx.org/trac/ticket/7927
Comment 10 MATSUI Tetsushi 2011-12-07 00:29:57 UTC
(In reply to comment #8)
> i don't think this is the right direction.
> we shouldn't keep specific patchsets unless they are just gentoo specific.

Do you imagine a patch is always instantly accepted by upstream?
Comment 11 pavel sanda 2011-12-07 11:12:21 UTC
> I reported to upstream, too:

thanks.

>Do you imagine a patch is always instantly accepted by upstream?

:) not always and not instantly. however pretty good chances to get review from competent people here.
Comment 12 pavel sanda 2012-01-10 21:27:21 UTC
will be part of upstream 2.0.3
Comment 13 Alexis Ballier gentoo-dev 2012-03-01 11:48:29 UTC
(In reply to comment #12)
> will be part of upstream 2.0.3

its now in tree, so prefix team can go ahead and test it
Comment 14 MATSUI Tetsushi 2012-03-09 14:51:16 UTC
Created attachment 304737 [details]
lyx-2.0.3 (edited ebuild)

Changes from the previous:
1. thanks to the upstream, no OS X specific patch is applied
2. it uses ldflags-append instead of direct substitution to LDFLAGS
(3. changes in original ebuild from that of 2.0.2)
Comment 15 pavel sanda 2012-03-09 15:06:17 UTC
please can you comment on the changed line:
-       python_convert_shebangs -r 2 "${D}"/usr/share/${PN}
+       python_convert_shebangs -r 2 "${ED}"/usr/share/${PN}

(i quickly looked in Gentoo Development Guide and found no entry for "E")

otherwise looks good.
Comment 16 MATSUI Tetsushi 2012-03-09 15:31:53 UTC
(In reply to comment #15)
> please can you comment on the changed line:
> -       python_convert_shebangs -r 2 "${D}"/usr/share/${PN}
> +       python_convert_shebangs -r 2 "${ED}"/usr/share/${PN}
> 
> (i quickly looked in Gentoo Development Guide and found no entry for "E")
> 
> otherwise looks good.

ED is EPREFIXed D.
See 
Prefix Tech Doc:  http://www.gentoo.org/proj/en/gentoo-alt/prefix/techdocs.xml
EAPI 3:  http://devmanual.gentoo.org/ebuild-writing/eapi/index.html
Comment 17 pavel sanda 2012-03-09 15:36:45 UTC
Aha, thanks. Alexis, I'm fine with adding this to portage (should it be -r1? the changes look harmless...)
Comment 18 Alexis Ballier gentoo-dev 2012-03-09 16:00:13 UTC
(In reply to comment #17)
> Aha, thanks. Alexis, I'm fine with adding this to portage (should it be -r1?
> the changes look harmless...)

no it should not be -r1, but for me its not harmless:


- please attach diffs to gentoo-x86 ebuilds, its easier to review

now on the diff side:

-	x11-libs/libXrandr
-	x11-libs/libXcursor
-	x11-libs/libXrender
-	x11-libs/libXfixes
-	x11-libs/libXext
-	x11-libs/libSM
-	x11-libs/libICE
-	x11-libs/libX11
-	x11-libs/libXau
-	x11-libs/libXdmcp
+	X? (
+		x11-libs/libXrandr
+		x11-libs/libXcursor
+		x11-libs/libXrender
+		x11-libs/libXfixes
+		x11-libs/libXext
+		x11-libs/libSM
+		x11-libs/libICE
+		x11-libs/libX11
+		x11-libs/libXau
+		x11-libs/libXdmcp
+	)

where's that X useflag declared and used ?
does lyx use these or is it just qt ? (in the latter case, we can drop the dep)

-			dev-tex/latex2rtf
-			app-text/unrtf
-			dev-tex/html2latex
-		)
+		dev-tex/latex2rtf
+		app-text/unrtf
+		dev-tex/html2latex
+	)

unrelated change

+	if [[ ${CHOST} == *-darwin* ]]; then
+		append-ldflags "-framework Carbon -framework ApplicationServices -framework AppKit -framework Foundation"
+	fi
+

cant this be made at configure / makefile level ? vlc has been doing this for ages for example and i find that kind of special case in an ebuild ugly :)

@@ -121,7 +127,8 @@
 		$(use_with hunspell) \
 		$(use_with aspell) \
 		$(use_with enchant) \
-		--without-included-boost --disable-stdlib-debug
+		--without-included-boost --disable-stdlib-debug \
+		--with-packaging=posix
 }
 
probably ok

@@ -148,7 +155,7 @@
 	# fonts needed for proper math display, see also bug #15629
 	font_src_install
 
-	python_convert_shebangs -r 2 "${D}"/usr/share/${PN}
+	python_convert_shebangs -r 2 "${ED}"/usr/share/${PN}
 
 	if use hunspell ; then
 		dosym /usr/share/myspell /usr/share/lyx/dicts

ok
Comment 19 pavel sanda 2012-03-09 16:09:28 UTC
(In reply to comment #18)
> now on the diff side:
> 
> -	x11-libs/libXrandr
> -	x11-libs/libXcursor
> -	x11-libs/libXrender
> -	x11-libs/libXfixes
> -	x11-libs/libXext
> -	x11-libs/libSM
> -	x11-libs/libICE
> -	x11-libs/libX11
> -	x11-libs/libXau
> -	x11-libs/libXdmcp
> +	X? (
> +		x11-libs/libXrandr
> +		x11-libs/libXcursor
> +		x11-libs/libXrender
> +		x11-libs/libXfixes
> +		x11-libs/libXext
> +		x11-libs/libSM
> +		x11-libs/libICE
> +		x11-libs/libX11
> +		x11-libs/libXau
> +		x11-libs/libXdmcp
> +	)
> 
> where's that X useflag declared and used ?
> does lyx use these or is it just qt ? (in the latter case, we can drop the
> dep)

IIRC I took those from ldd lyx binary, so my interpretation was, that we directly need it. Mac reportedly doesn't use X, but some other libs are needed? 

> @@ -121,7 +127,8 @@
>  		$(use_with hunspell) \
>  		$(use_with aspell) \
>  		$(use_with enchant) \
> -		--without-included-boost --disable-stdlib-debug
> +		--without-included-boost --disable-stdlib-debug \
> +		--with-packaging=posix
>  }
>  
> probably ok

at least on linux side of the pond posix is taken by default. i guess this was needed since mac envi chooses macos packaging...
Comment 20 MATSUI Tetsushi 2012-03-09 17:03:01 UTC
I think the role of X related libraries is played by frameworks on OS X.
So let's talk about the last glitch.

> +	if [[ ${CHOST} == *-darwin* ]]; then
> +		append-ldflags "-framework Carbon -framework ApplicationServices
> -framework AppKit -framework Foundation"
> +	fi
> +
> 
> cant this be made at configure / makefile level ? vlc has been doing this
> for ages for example and i find that kind of special case in an ebuild ugly
> :)

I have tried to pass this via configure before, but haven't succeeded.
It means that if you don't like this approach, you have to write and send a patch to upstream.

It should be remarked that upstream expects LyX be built as an app on OS X, that is very different way to install a software than traditional unix.  On the other hand, Gentoo Prefix tries to mimic linux installation on every platform as far as possible.  The discrepancy has to be absorbed in somewhere, and just only one conditional clause is a good compromise, I suppose.
Comment 21 Alexis Ballier gentoo-dev 2012-03-09 17:54:28 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > now on the diff side:
> > 
> > -	x11-libs/libXrandr
> > -	x11-libs/libXcursor
> > -	x11-libs/libXrender
> > -	x11-libs/libXfixes
> > -	x11-libs/libXext
> > -	x11-libs/libSM
> > -	x11-libs/libICE
> > -	x11-libs/libX11
> > -	x11-libs/libXau
> > -	x11-libs/libXdmcp
> > +	X? (
> > +		x11-libs/libXrandr
> > +		x11-libs/libXcursor
> > +		x11-libs/libXrender
> > +		x11-libs/libXfixes
> > +		x11-libs/libXext
> > +		x11-libs/libSM
> > +		x11-libs/libICE
> > +		x11-libs/libX11
> > +		x11-libs/libXau
> > +		x11-libs/libXdmcp
> > +	)
> > 
> > where's that X useflag declared and used ?
> > does lyx use these or is it just qt ? (in the latter case, we can drop the
> > dep)
> 
> IIRC I took those from ldd lyx binary, so my interpretation was, that we
> directly need it. Mac reportedly doesn't use X, but some other libs are
> needed? 

hmm you shouldnt trust ldd for this :) it displays what libs will be loaded when running lyx, not what lyx itself actually needs
for example, if qt needs X on your system then it will display those X libs, however on macos things might be very different.

better check the build system for what is really needed and what not to get the deps optimal
Comment 22 Alexis Ballier gentoo-dev 2012-03-09 17:59:07 UTC
(In reply to comment #20)
> > +	if [[ ${CHOST} == *-darwin* ]]; then
> > +		append-ldflags "-framework Carbon -framework ApplicationServices
> > -framework AppKit -framework Foundation"
> > +	fi
> > +
> > 
> > cant this be made at configure / makefile level ? vlc has been doing this
> > for ages for example and i find that kind of special case in an ebuild ugly
> > :)
> 
> I have tried to pass this via configure before, but haven't succeeded.
> It means that if you don't like this approach, you have to write and send a
> patch to upstream.

please do send such a patch, i have no knowledge of macos, the only thing i know is that if you need to do this hack, this means lyx will not build out of the box, so it ought to be fixed rather that adding workarounds that will stay forever.
Comment 23 Alexis Ballier gentoo-dev 2012-03-09 18:16:52 UTC
(In reply to comment #22)
> please do send such a patch, i have no knowledge of macos, the only thing i
> know is that if you need to do this hack, this means lyx will not build out
> of the box, so it ought to be fixed rather that adding workarounds that will
> stay forever.

on the other hand, having a look at INSTALL.MacOSX is pretty instructive:

(d) When working without pkgconfig or pkgconfig fails to detect Carbon and Appkit frameworks

  Current pkgconfig from macports is able to detect the frameworks Qt4 is using.
   The build of LyX succeeds because the frameworks are added automatically to the linker options.
   If you need to add them yourself because of link errors, e. g.
      lyx Undefined symbols: "_FSPathMakeRef"...
   you have to verify the required frameworks with otool and add them to the LDFLAGS.

[...]

   Currently there are two different Qt4 builds available for download:
   * with Tiger support it's with Carbon. You have to add
   export LDFLAGS="$LDFLAGS -framework ApplicationServices -framework Carbon -framework AppKit"
   * with Cocoa framework without Tiger support you have to add
   export LDFLAGS="$LDFLAGS -framework ApplicationServices -framework Cocoa -framework AppKit"


so it seems the culprit is qt, right ?
Comment 24 pavel sanda 2012-03-12 11:52:51 UTC
(In reply to comment #21)
> > IIRC I took those from ldd lyx binary, so my interpretation was, that we
> > directly need it. Mac reportedly doesn't use X, but some other libs are
> > needed? 
> 
> hmm you shouldnt trust ldd for this :) it displays what libs will be loaded
> when running lyx, not what lyx itself actually needs
> for example, if qt needs X on your system then it will display those X libs,
> however on macos things might be very different.
> 
> better check the build system for what is really needed and what not to get
> the deps optimal

i just went through all libs in "X?" none of them is pulled by lyx directly - its mainly business of Qt deps... so we can get rid of those libX altogether at the end.
Comment 25 MATSUI Tetsushi 2012-03-14 16:18:03 UTC
My apology, the LDFLAGS hack has not been necessary for the current version.
I don't know what brought this change: lyx itself, Qt related ebuilds / eclasses or something.
Comment 26 pavel sanda 2012-03-18 20:54:24 UTC
can you please attach the final diff of the ebuild which work for you?
(X deps can be dropped as well as discussed above)
Comment 27 MATSUI Tetsushi 2012-03-19 15:35:22 UTC
Created attachment 305885 [details]
ebuild diff
Comment 28 pavel sanda 2012-03-19 22:52:27 UTC
Alexis, I think this is fine to go in.
Comment 29 Alexis Ballier gentoo-dev 2012-03-20 09:54:55 UTC
patch applied, without whitespace changes and keywords, I'll let the prefix team add their keywords as they like
Comment 30 Fabian Groffen gentoo-dev 2012-04-25 18:03:32 UTC
Thanks all for the work!  Keyworded at last!