--- /Users/tetsushi/Gentoo/usr/portage/app-editors/emacs/emacs-23.2.ebuild 2010-08-05 03:31:47.000000000 +0900 +++ emacs-23.2.ebuild 2010-12-12 01:09:28.000000000 +0900 @@ -28,7 +28,7 @@ LICENSE="GPL-3 FDL-1.3 BSD as-is MIT W3C unicode" SLOT="23" KEYWORDS="~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris" -IUSE="aqua alsa dbus gconf gif gpm gtk gzip-el hesiod jpeg kerberos m17n-lib motif png sound source svg tiff toolkit-scroll-bars X Xaw3d xft +xpm" +IUSE="alsa cocoa dbus gconf gif gpm gtk gzip-el hesiod jpeg kerberos m17n-lib motif png sound source svg tiff toolkit-scroll-bars X Xaw3d xft +xpm" RESTRICT="strip" RDEPEND="sys-libs/ncurses @@ -110,6 +110,11 @@ || die "unable to sed configure.in" fi + if use cocoa; then + epatch "${FILESDIR}/${P}-ns_appdirs.patch" \ + || die "ns* patch failed"; + fi + eautoreconf } @@ -137,11 +142,16 @@ myconf="${myconf} $(use_with sound)" fi - if use X && use aqua; then - die "the X and aqua USE-flags cannot be used together, please use one" - fi - - if use X; then + if use cocoa; then + einfo "Configuring to build with Cocoa support" + if use X; then + ewarn "cocoa USE-flag disables X." + ewarn "If you want to enable X, please set -cocoa." + fi + myconf="${myconf} --without-x" + myconf="${myconf} --with-ns" + myconf="${myconf} --disable-ns-self-contained" + elif use X; then myconf="${myconf} --with-x" myconf="${myconf} $(use_with gconf)" myconf="${myconf} $(use_with toolkit-scroll-bars)" @@ -183,20 +193,14 @@ && ewarn "USE flag \"${f}\" ignored (superseded by \"${tk}\")" tk="${tk}${tk:+ }${f}" done - elif use aqua; then - einfo "Configuring to build with Carbon support" - myconf="${myconf} --without-x" - myconf="${myconf} --with-carbon" - myconf="${myconf} --enable-carbon-app=${EPREFIX}/Applications/Gentoo" else myconf="${myconf} --without-x" - myconf="${myconf} --without-carbon" fi myconf="${myconf} $(use_with hesiod)" myconf="${myconf} $(use_with kerberos) $(use_with kerberos kerberos5)" myconf="${myconf} $(use_with gpm) $(use_with dbus)" - + # According to configure, this option is only used for GNU/Linux (x86_64 and # s390). For Gentoo Prefix we have to explicitly spell out the location # because $(get_libdir) returns a 32bit location on eg. RHEL. @@ -276,9 +280,13 @@ dodoc README BUGS || die "dodoc failed" - if use aqua; then - einfo "Emacs.app is in $EPREFIX/Applications/Gentoo." - einfo "You may want to copy or symlink it into /Applications by yourself." + if use cocoa; then + if [ ! -e "${ED}"/Applications/Gentoo ]; then + mkdir -p "${ED}"/Applications/Gentoo + fi + mv "${S}"/nextstep/Emacs.app "${ED}"/Applications/Gentoo/Emacs-${FULL_VERSION}.app + einfo "Emacs-${FULL_VERSION}.app is in $EPREFIX/Applications/Gentoo." + einfo "You may want to copy it into /Applications by yourself." fi }