1 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/x11-libs/openmotif/openmotif-2.3.3-r1.ebuild,v 1.16 2012/05/06 00:58:45 aballier Exp $ |
4 |
|
5 |
EAPI=4 |
6 |
|
7 |
inherit autotools eutils flag-o-matic multilib |
8 |
|
9 |
DESCRIPTION="Open Motif" |
10 |
HOMEPAGE="http://www.motifzone.net/" |
11 |
SRC_URI="ftp://ftp.ics.com/openmotif/${PV%.*}/${PV}/${P}.tar.gz" |
12 |
|
13 |
LICENSE="MOTIF MIT" |
14 |
SLOT="0" |
15 |
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
16 |
IUSE="doc examples jpeg png static-libs unicode xft" |
17 |
# license allows distribution only for "open source operating systems" |
18 |
RESTRICT="!kernel_linux? ( |
19 |
!kernel_FreeBSD? ( |
20 |
!kernel_Darwin? ( |
21 |
fetch bindist |
22 |
) ) )" |
23 |
|
24 |
RDEPEND="x11-libs/libXmu |
25 |
x11-libs/libXp |
26 |
unicode? ( virtual/libiconv ) |
27 |
xft? ( x11-libs/libXft ) |
28 |
jpeg? ( virtual/jpeg ) |
29 |
png? ( >=media-libs/libpng-1.4 )" |
30 |
DEPEND="${RDEPEND} |
31 |
sys-devel/flex |
32 |
|| ( dev-util/byacc sys-freebsd/freebsd-ubin ) |
33 |
x11-misc/xbitmaps" |
34 |
RDEPEND="${RDEPEND} |
35 |
doc? ( app-doc/openmotif-manual )" |
36 |
|
37 |
pkg_nofetch() { |
38 |
local line |
39 |
while read line; do einfo "${line}"; done <<-EOF |
40 |
From the Open Motif license: "The rights granted under this license are |
41 |
limited solely to distribution and sublicensing of the contribution(s) |
42 |
on, with, or for operating systems which are themselves open source |
43 |
programs. Contact The Open Group for a license allowing distribution and |
44 |
sublicensing of the original program on, with, or for operating systems |
45 |
which are not open source programs." |
46 |
|
47 |
If above conditions are fulfilled, you may download the file: |
48 |
${SRC_URI} |
49 |
and place it in ${DISTDIR}. |
50 |
EOF |
51 |
} |
52 |
|
53 |
src_prepare() { |
54 |
epatch "${FILESDIR}/${PN}-2.3.2-darwin.patch" |
55 |
epatch "${FILESDIR}/${PN}-2.3.2-sanitise-paths.patch" |
56 |
epatch "${FILESDIR}/${PN}-2.3.2-libpng14.patch" |
57 |
[[ ${CHOST} == *-solaris2.11 ]] \ |
58 |
&& epatch "${FILESDIR}/${PN}-2.3.2-solaris-2.11.patch" |
59 |
|
60 |
# disable compilation of demo binaries |
61 |
sed -i -e '/^SUBDIRS/{:x;/\\$/{N;bx;};s/[ \t\n\\]*demos//;}' Makefile.am |
62 |
|
63 |
# add X.Org vendor string to aliases for virtual bindings |
64 |
echo -e '"The X.Org Foundation"\t\t\t\t\tpc' >>bindings/xmbind.alias |
65 |
|
66 |
AT_M4DIR=. eautoreconf |
67 |
} |
68 |
|
69 |
src_configure() { |
70 |
# get around some LANG problems in make (#15119) |
71 |
LANG=C |
72 |
|
73 |
# bug #80421 |
74 |
filter-flags -ftracer |
75 |
|
76 |
# feel free to fix properly if you care |
77 |
append-flags -fno-strict-aliasing |
78 |
|
79 |
# For Solaris Xos_r.h :( |
80 |
[[ ${CHOST} == *-solaris2.11 ]] && append-flags -DNEED_XOS_R_H=1 |
81 |
|
82 |
if use !elibc_glibc && use !elibc_uclibc && use unicode; then |
83 |
# libiconv detection in configure script doesn't always work |
84 |
# http://bugs.motifzone.net/show_bug.cgi?id=1423 |
85 |
export LIBS="${LIBS} -liconv" |
86 |
fi |
87 |
|
88 |
# "bison -y" causes runtime crashes #355795 |
89 |
export YACC=byacc |
90 |
|
91 |
econf --with-x \ |
92 |
$(use_enable static-libs static) \ |
93 |
$(use_enable unicode utf8) \ |
94 |
$(use_enable xft) \ |
95 |
$(use_enable jpeg) \ |
96 |
$(use_enable png) |
97 |
} |
98 |
|
99 |
src_compile() { |
100 |
make clean # remove pre-made bison parsers |
101 |
emake -j1 MWMRCDIR="${EPREFIX}"/etc/X11/mwm |
102 |
} |
103 |
|
104 |
src_install() { |
105 |
emake -j1 DESTDIR="${D}" MWMRCDIR="${EPREFIX}"/etc/X11/mwm install |
106 |
|
107 |
# mwm default configs |
108 |
insinto /usr/share/X11/app-defaults |
109 |
newins "${FILESDIR}"/Mwm.defaults Mwm |
110 |
|
111 |
if use examples; then |
112 |
emake -j1 -C demos DESTDIR="${D}" install-data |
113 |
dodir /usr/share/doc/${PF}/demos |
114 |
mv "${ED}"/usr/share/Xm/* "${ED}"/usr/share/doc/${PF}/demos || die |
115 |
fi |
116 |
rm -rf "${ED}"/usr/share/Xm |
117 |
|
118 |
# don't install libtool archives |
119 |
rm -f "${ED}"/usr/$(get_libdir)/*.la |
120 |
|
121 |
dodoc BUGREPORT ChangeLog README RELEASE RELNOTES TODO |
122 |
} |
123 |
|
124 |
pkg_postinst() { |
125 |
local line |
126 |
while read line; do elog "${line}"; done <<-EOF |
127 |
From the Open Motif 2.3.0 (upstream) release notes: |
128 |
"Open Motif 2.3 is an updated version of 2.2. Any applications |
129 |
built against a previous 2.x release of Open Motif will be binary |
130 |
compatible with this release." |
131 |
|
132 |
If you have binary-only applications requiring libXm.so.3, you may |
133 |
therefore create a symlink from libXm.so.3 to libXm.so.4. |
134 |
Please note, however, that there will be no Gentoo support for this. |
135 |
Alternatively, you may install slot 2.2 of x11-libs/openmotif for |
136 |
the Open Motif 2.2 libraries. |
137 |
EOF |
138 |
} |