| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2012 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.17 2011/06/06 19:17:38 voyageur Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.27 2012/06/22 12:41:51 voyageur Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: gnustep-base.eclass |
5 | # @ECLASS: gnustep-base.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # GNUstep Herd <gnustep@gentoo.org> |
7 | # GNUstep Herd <gnustep@gentoo.org> |
| 8 | # @BLURB: Internal handling of GNUstep pacakges |
8 | # @BLURB: Internal handling of GNUstep pacakges |
| … | |
… | |
| 53 | # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this |
53 | # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this |
| 54 | # only removes a part of a path it's good that it bails out, as we want |
54 | # only removes a part of a path it's good that it bails out, as we want |
| 55 | # to know when they use some direct include. |
55 | # to know when they use some direct include. |
| 56 | ebegin "Cleaning paths from GNUmakefile" |
56 | ebegin "Cleaning paths from GNUmakefile" |
| 57 | sed -i \ |
57 | sed -i \ |
| 58 | -e 's|-I/usr/X11R6/include||g' \ |
58 | -e 's|-I/usr/X11R6/include/\?||g' \ |
| 59 | -e 's|-I/usr/include||g' \ |
59 | -e 's|-I/usr/include/\?||g' \ |
| 60 | -e 's|-L/usr/X11R6/lib||g' \ |
60 | -e 's|-L/usr/X11R6/lib/\?||g' \ |
| 61 | -e 's|-L/usr/lib||g' \ |
61 | -e 's|-L/usr/lib/\?||g' \ |
| 62 | GNUmakefile |
62 | GNUmakefile |
| 63 | eend $? |
63 | eend $? |
| 64 | fi |
64 | fi |
| 65 | } |
65 | } |
| 66 | |
66 | |
| … | |
… | |
| 119 | # Reset GNUstep variables |
119 | # Reset GNUstep variables |
| 120 | source "${GS_MAKEFILES}"/GNUstep-reset.sh |
120 | source "${GS_MAKEFILES}"/GNUstep-reset.sh |
| 121 | source "${GS_MAKEFILES}"/GNUstep.sh |
121 | source "${GS_MAKEFILES}"/GNUstep.sh |
| 122 | |
122 | |
| 123 | # Create compilation GNUstep.conf if it does not exist yet |
123 | # Create compilation GNUstep.conf if it does not exist yet |
| 124 | if [[ ! -f ${T}/GNUstep.conf ]]; then |
124 | if [[ ! -f ${WORKDIR}/GNUstep.conf ]]; then |
| 125 | cp "${EPREFIX}"/etc/GNUstep/GNUstep.conf "${T}" \ |
125 | cp "${EPREFIX}"/etc/GNUstep/GNUstep.conf "${WORKDIR}" \ |
| 126 | || die "GNUstep.conf copy failed" |
126 | || die "GNUstep.conf copy failed" |
| 127 | sed -e "s#\(GNUSTEP_USER_DIR=\).*#\1${T}#" \ |
127 | sed -e "s#\(GNUSTEP_USER_.*DIR.*=\)#\1${WORKDIR}/#" \ |
| 128 | -e "s#\(GNUSTEP_USER_DEFAULTS_DIR=\).*#\1${T}/Defaults#" \ |
|
|
| 129 | -i "${T}"/GNUstep.conf || die "GNUstep.conf sed failed" |
128 | -i "${WORKDIR}"/GNUstep.conf || die "GNUstep.conf sed failed" |
| 130 | fi |
129 | fi |
| 131 | |
130 | |
| 132 | |
131 | |
| 133 | if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then |
132 | if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then |
| 134 | # Set rpath in ldflags when available |
133 | # Set rpath in ldflags when available |
| … | |
… | |
| 144 | # Set up env vars for make operations |
143 | # Set up env vars for make operations |
| 145 | GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \ |
144 | GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \ |
| 146 | ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \ |
145 | ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \ |
| 147 | DESTDIR="${D}" \ |
146 | DESTDIR="${D}" \ |
| 148 | HOME="${T}" \ |
147 | HOME="${T}" \ |
| 149 | GNUSTEP_CONFIG_FILE="${T}"/GNUstep.conf \ |
148 | GNUSTEP_CONFIG_FILE="${WORKDIR}"/GNUstep.conf \ |
| 150 | GNUSTEP_USER_DIR="${T}" \ |
|
|
| 151 | GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \ |
|
|
| 152 | GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \ |
149 | GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \ |
| 153 | TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \ |
150 | TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \ |
| 154 | messages=yes \ |
151 | messages=yes ) |
| 155 | -j1 ) |
152 | |
|
|
153 | use doc \ |
|
|
154 | && GS_ENV=( "${GS_ENV[@]}" VARTEXFONTS="${T}"/fonts ) |
| 156 | |
155 | |
| 157 | use debug \ |
156 | use debug \ |
| 158 | && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \ |
157 | && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \ |
| 159 | || GS_ENV=( "${GS_ENV[@]}" "debug=no" ) |
158 | || GS_ENV=( "${GS_ENV[@]}" "debug=no" ) |
|
|
159 | |
|
|
160 | # About 20 gnustep packages still use EAPI 0 |
|
|
161 | if built_with_use --missing false gnustep-base/gnustep-make libobjc2; |
|
|
162 | then |
|
|
163 | # Set clang for packages that do not respect gnustep-make |
|
|
164 | # settings (gnustep-base's configure for example) |
|
|
165 | export CC=clang CXX=clang CPP="clang -E" LD="clang" |
|
|
166 | fi |
| 160 | |
167 | |
| 161 | return 0 |
168 | return 0 |
| 162 | fi |
169 | fi |
| 163 | die "gnustep-make not installed!" |
170 | die "gnustep-make not installed!" |
| 164 | } |
171 | } |
| … | |
… | |
| 185 | die "no Makefile found" |
192 | die "no Makefile found" |
| 186 | } |
193 | } |
| 187 | |
194 | |
| 188 | # Make and install docs using GNUstep Makefiles |
195 | # Make and install docs using GNUstep Makefiles |
| 189 | egnustep_doc() { |
196 | egnustep_doc() { |
| 190 | if [[ -d ./Documentation ]] ; then |
197 | if [[ -d "${S}"/Documentation ]] ; then |
| 191 | # Check documentation presence |
198 | # Check documentation presence |
| 192 | cd "${S}"/Documentation |
199 | pushd "${S}"/Documentation || die |
| 193 | if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then |
200 | if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then |
| 194 | emake "${GS_ENV[@]}" all || die "doc make failed" |
201 | emake "${GS_ENV[@]}" all || die "doc make failed" |
| 195 | emake "${GS_ENV[@]}" install || die "doc install failed" |
202 | emake "${GS_ENV[@]}" install || die "doc install failed" |
| 196 | fi |
203 | fi |
| 197 | cd .. |
204 | popd || die |
| 198 | fi |
205 | fi |
| 199 | } |
206 | } |
| 200 | |
207 | |
| 201 | egnustep_install_config() { |
208 | egnustep_install_config() { |
| 202 | [[ $(type -t gnustep_config_script) != "function" ]] && return 0 |
209 | [[ $(type -t gnustep_config_script) != "function" ]] && return 0 |