/[gentoo-x86]/eclass/gnustep-base.eclass
Gentoo

Diff of /eclass/gnustep-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 Revision 1.16
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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.8 2008/10/03 14:59:42 voyageur Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnustep-base.eclass,v 1.16 2011/04/20 20:48:47 voyageur Exp $
4 4
5inherit eutils flag-o-matic 5# @ECLASS: gnustep-base.eclass
6 6# @MAINTAINER:
7# GNUstep Herd <gnustep@gentoo.org>
8# @BLURB: Internal handling of GNUstep pacakges
9# @DESCRIPTION:
7# Inner gnustep eclass, should only be inherited directly by gnustep-base 10# Inner gnustep eclass, should only be inherited directly by gnustep-base
8# packages 11# packages
9# 12
10# maintainer: GNUstep Herd <gnustep@gentoo.org> 13inherit eutils flag-o-matic
11 14
12# IUSE variables across all GNUstep packages 15# IUSE variables across all GNUstep packages
13# "debug": enable code for debugging 16# "debug": enable code for debugging
14# "doc": build and install documentation, if available 17# "doc": build and install documentation, if available
15IUSE="debug doc" 18IUSE="debug doc"
16 19
17# packages needed to build any base gnustep package 20# packages needed to build any base gnustep package
18GNUSTEP_CORE_DEPEND="virtual/libc
19 doc? ( virtual/texi2dvi =dev-tex/latex2html-2002* >=app-text/texi2html-1.64 )" 21GNUSTEP_CORE_DEPEND="doc? ( virtual/texi2dvi dev-tex/latex2html app-text/texi2html )"
20 22
21# Where to install GNUstep 23# New layout is used when ${EPREFIX}/usr/share/GNUstep/Makefiles exists
24# Where to install GNUstep (with old layout)
22GNUSTEP_PREFIX="/usr/GNUstep" 25GNUSTEP_PREFIX="${EPREFIX}/usr/GNUstep"
23 26
24# GNUstep environment array 27# GNUstep environment array
25typeset -a GS_ENV 28typeset -a GS_ENV
26 29
27# Ebuild function overrides 30# Ebuild function overrides
39 42
40gnustep-base_src_unpack() { 43gnustep-base_src_unpack() {
41 unpack ${A} 44 unpack ${A}
42 cd "${S}" 45 cd "${S}"
43 46
47 gnustep-base_src_prepare
48}
49
50gnustep-base_src_prepare() {
44 if [[ -f ./GNUmakefile ]] ; then 51 if [[ -f ./GNUmakefile ]] ; then
45 # Kill stupid includes that are simply overdone or useless on normal 52 # Kill stupid includes that are simply overdone or useless on normal
46 # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this 53 # Gentoo, but (may) cause major headaches on Prefixed Gentoo. If this
47 # 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
48 # to know when they use some direct include. 55 # to know when they use some direct include.
84} 91}
85 92
86gnustep-base_pkg_postinst() { 93gnustep-base_pkg_postinst() {
87 [[ $(type -t gnustep_config_script) != "function" ]] && return 0 94 [[ $(type -t gnustep_config_script) != "function" ]] && return 0
88 95
96 local SCRIPT_PATH
97 if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
98 SCRIPT_PATH="/usr/bin"
99 else
100 SCRIPT_PATH=${GNUSTEP_SYSTEM_TOOLS}/Gentoo
101 fi
89 elog "To use this package, as *user* you should run:" 102 elog "To use this package, as *user* you should run:"
90 elog " ${GNUSTEP_SYSTEM_TOOLS}/Gentoo/config-${PN}.sh" 103 elog " ${SCRIPT_PATH}/config-${PN}.sh"
91} 104}
92 105
93# Clean/reset an ebuild to the installed GNUstep environment 106# Clean/reset an ebuild to the installed GNUstep environment
94egnustep_env() { 107egnustep_env() {
95 # Get additional variables 108 # Get additional variables
96 GNUSTEP_SH_EXPORT_ALL_VARIABLES="true" 109 GNUSTEP_SH_EXPORT_ALL_VARIABLES="true"
97 110
98 if [[ -f ${GNUSTEP_PREFIX}/System/Library/Makefiles/GNUstep.sh ]] ; then 111 # Makefiles path
112 local GS_MAKEFILES
113 if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
114 GS_MAKEFILES=${EPREFIX}/usr/share/GNUstep/Makefiles
115 else
116 GS_MAKEFILES=${GNUSTEP_PREFIX}/System/Library/Makefiles
117 fi
118 if [[ -f ${GS_MAKEFILES}/GNUstep.sh ]] ; then
99 # Reset GNUstep variables 119 # Reset GNUstep variables
100 source "${GNUSTEP_PREFIX}"/System/Library/Makefiles/GNUstep-reset.sh 120 source "${GS_MAKEFILES}"/GNUstep-reset.sh
101 source "${GNUSTEP_PREFIX}"/System/Library/Makefiles/GNUstep.sh 121 source "${GS_MAKEFILES}"/GNUstep.sh
102 122
103 # Needed to run installed GNUstep apps in sandbox 123 # Needed to run installed GNUstep apps in sandbox
104 addpredict "/root/GNUstep" 124 addpredict "/root/GNUstep"
105 125
126 if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
106 # Set rpath in ldflags when available 127 # Set rpath in ldflags when available
107 case ${CHOST} in 128 case ${CHOST} in
108 *-linux-gnu|*-solaris*) 129 *-linux-gnu|*-solaris*)
109 is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \ 130 is-ldflagq -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" \
110 || append-ldflags \ 131 || append-ldflags \
111 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}" 132 -Wl,-rpath="${GNUSTEP_SYSTEM_LIBRARIES}"
112 ;; 133 ;;
113 esac 134 esac
135 fi
114 136
115 # Set up env vars for make operations 137 # Set up env vars for make operations
116 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \ 138 GS_ENV=( AUXILIARY_LDFLAGS="${LDFLAGS}" \
117 ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \ 139 ADDITIONAL_NATIVE_LIB_DIRS="${GNUSTEP_SYSTEM_LIBRARIES}" \
118 DESTDIR="${D}" \ 140 DESTDIR="${D}" \
121 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \ 143 GNUSTEP_USER_DEFAULTS_DIR="${T}"/Defaults \
122 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \ 144 GNUSTEP_INSTALLATION_DOMAIN=SYSTEM \
123 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \ 145 TAR_OPTIONS="${TAR_OPTIONS} --no-same-owner" \
124 messages=yes \ 146 messages=yes \
125 -j1 ) 147 -j1 )
126 # -j1 is needed as gnustep-make is not parallel-safe
127 148
128 use debug \ 149 use debug \
129 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \ 150 && GS_ENV=( "${GS_ENV[@]}" "debug=yes" ) \
130 || GS_ENV=( "${GS_ENV[@]}" "debug=no" ) 151 || GS_ENV=( "${GS_ENV[@]}" "debug=no" )
131 152
134 die "gnustep-make not installed!" 155 die "gnustep-make not installed!"
135} 156}
136 157
137# Make utilizing GNUstep Makefiles 158# Make utilizing GNUstep Makefiles
138egnustep_make() { 159egnustep_make() {
139 if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then 160 if [[ -f ./Makefile || -f ./makefile || -f ./GNUmakefile ]] ; then
140 emake ${*} "${GS_ENV[@]}" all || die "package make failed" 161 emake ${*} "${GS_ENV[@]}" all || die "package make failed"
141 return 0 162 return 0
142 fi 163 fi
143 die "no Makefile found" 164 die "no Makefile found"
144} 165}
145 166
146# Make-install utilizing GNUstep Makefiles 167# Make-install utilizing GNUstep Makefiles
147egnustep_install() { 168egnustep_install() {
169 if [[ ! -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
148 # avoid problems due to our "weird" prefix, make sure it exists 170 # avoid problems due to our "weird" prefix, make sure it exists
149 mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS} 171 mkdir -p "${D}"${GNUSTEP_SYSTEM_TOOLS}
172 fi
150 if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then 173 if [[ -f ./[mM]akefile || -f ./GNUmakefile ]] ; then
151 emake ${*} "${GS_ENV[@]}" install || die "package install failed" 174 emake ${*} "${GS_ENV[@]}" install || die "package install failed"
152 return 0 175 return 0
153 fi 176 fi
154 die "no Makefile found" 177 die "no Makefile found"
214 while read line ; do 237 while read line ; do
215 echo "${line}" >> "${T}"/${cfile} 238 echo "${line}" >> "${T}"/${cfile}
216 done 239 done
217 echo 'echo "done"' >> "${T}"/${cfile} 240 echo 'echo "done"' >> "${T}"/${cfile}
218 241
242 if [[ -d ${EPREFIX}/usr/share/GNUstep/Makefiles ]]; then
243 exeinto /usr/bin
244 else
219 exeinto ${GNUSTEP_SYSTEM_TOOLS}/Gentoo 245 exeinto ${GNUSTEP_SYSTEM_TOOLS#${EPREFIX}}/Gentoo
246 fi
220 doexe "${T}"/${cfile} 247 doexe "${T}"/${cfile}
221} 248}
222 249
223case ${EAPI:-0} in 250case ${EAPI:-0} in
224 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst ;; 251 0|1) EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst ;;
225 2) EXPORT_FUNCTIONS pkg_setup src_unpack src_configure src_compile src_install pkg_postinst ;; 252 *) EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile src_install pkg_postinst ;;
226esac 253esac

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20