Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 413447 | Differences between
and this patch

Collapse All | Expand All

(-)eselect-boost.old/eselect-boost-0.4.ebuild (-2 / +5 lines)
Lines 2-7 Link Here
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/app-admin/eselect-boost/eselect-boost-0.4.ebuild,v 1.1 2012/04/02 00:51:03 floppym Exp $
3
# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-boost/eselect-boost-0.4.ebuild,v 1.1 2012/04/02 00:51:03 floppym Exp $
4
4
5
EAPI="4"
6
5
inherit multilib
7
inherit multilib
6
8
7
DESCRIPTION="boost module for eselect"
9
DESCRIPTION="boost module for eselect"
Lines 10-25 SRC_URI="" Link Here
10
12
11
LICENSE="GPL-2"
13
LICENSE="GPL-2"
12
SLOT="0"
14
SLOT="0"
13
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
15
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~ia64-hpux ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
14
IUSE=""
16
IUSE=""
15
17
16
DEPEND=""
18
DEPEND=""
17
RDEPEND=">=app-admin/eselect-1.0.5"
19
RDEPEND=">=app-admin/eselect-1.0.5"
20
S="${WORKDIR}"
18
21
19
src_install() {
22
src_install() {
20
	local mdir="/usr/share/eselect/modules"
23
	local mdir="/usr/share/eselect/modules"
21
	dodir ${mdir}
24
	dodir ${mdir}
22
	sed -e "s|%LIBDIR%|$(get_libdir)|g" "${FILESDIR}/boost.eselect-${PVR}" > "${D}${mdir}/boost.eselect" || die "failed to install"
25
	sed -e "s|%LIBDIR%|$(get_libdir)|g" "${FILESDIR}/boost.eselect-${PVR}" > "${ED}${mdir}/boost.eselect" || die "failed to install"
23
26
24
	keepdir /etc/eselect/boost
27
	keepdir /etc/eselect/boost
25
	keepdir /usr/share/boost-eselect/profiles
28
	keepdir /usr/share/boost-eselect/profiles
(-)eselect-boost.old/files/boost.eselect-0.4 (-22 / +22 lines)
Lines 17-23 _suffices="|-debug" Link Here
17
find_targets() {
17
find_targets() {
18
	local f
18
	local f
19
	# use ls here to get a really empty set in case no boost is installed
19
	# use ls here to get a really empty set in case no boost is installed
20
	for d in $(ls -d "${ROOT}"/usr/share/boost-eselect/profiles/* 2>/dev/null) ; do
20
	for d in $(ls -d "${EROOT}"/usr/share/boost-eselect/profiles/* 2>/dev/null) ; do
21
		for p in "${d}"/* ; do
21
		for p in "${d}"/* ; do
22
			echo "boost-$(basename ${d})/$(basename ${p})"
22
			echo "boost-$(basename ${d})/$(basename ${p})"
23
		done
23
		done
Lines 28-34 remove_installation() { Link Here
28
	echo "Removing symlinks from old version"
28
	echo "Removing symlinks from old version"
29
29
30
	local link
30
	local link
31
	for link in "${ROOT}/usr/include/boost" "${ROOT}/usr/share/boostbook" ; do
31
	for link in "${EROOT}/usr/include/boost" "${EROOT}/usr/share/boostbook" ; do
32
		if [[ -L "${link}" ]] ; then
32
		if [[ -L "${link}" ]] ; then
33
			rm "${link}" || die -q "Couldn't remove \"${link}\" symlink"
33
			rm "${link}" || die -q "Couldn't remove \"${link}\" symlink"
34
		else
34
		else
Lines 36-50 remove_installation() { Link Here
36
		fi
36
		fi
37
	done
37
	done
38
38
39
	pushd "${ROOT}/usr/%LIBDIR%" 1>/dev/null
39
	pushd "${EROOT}/usr/%LIBDIR%" 1>/dev/null
40
	local lib
40
	local lib
41
	for lib in libboost_*.{a,so} ; do
41
	for lib in libboost_*.{a,so,dylib} ; do
42
		[[ -L "${lib}" && "${lib}" != libboost_*[[:digit:]]_[[:digit:]][[:digit:]]@(${_suffices}).@(a|so) ]] || continue
42
		[[ -L "${lib}" && "${lib}" != libboost_*[[:digit:]]_[[:digit:]][[:digit:]]@(${_suffices}).@(a|so|dylib) ]] || continue
43
		rm "${lib}" || die -q "Unable to remove \"/usr/%LIBDIR%/${lib}\" symlink"
43
		rm "${lib}" || die -q "Unable to remove \"/usr/%LIBDIR%/${lib}\" symlink"
44
	done
44
	done
45
	popd 1>/dev/null
45
	popd 1>/dev/null
46
46
47
	pushd "${ROOT}"/usr/bin 1>/dev/null
47
	pushd "${EROOT}"/usr/bin 1>/dev/null
48
	local tool
48
	local tool
49
	for tool in ${_boost_tools} ; do
49
	for tool in ${_boost_tools} ; do
50
		[[ -L "${tool}" ]] && ( rm "${tool}" || die -q "Unable to remove \"/usr/bin/${tool}\" symlink" )
50
		[[ -L "${tool}" ]] && ( rm "${tool}" || die -q "Unable to remove \"/usr/bin/${tool}\" symlink" )
Lines 53-59 remove_installation() { Link Here
53
53
54
	local python_module python_module_dir
54
	local python_module python_module_dir
55
	for python_module in mpi.py mpi_debug.py ; do
55
	for python_module in mpi.py mpi_debug.py ; do
56
		for python_module_dir in "${ROOT}"usr/%LIBDIR%/python*/site-packages ; do
56
		for python_module_dir in "${EROOT}"usr/lib/python*/site-packages ; do
57
			if [[ -e "${python_module_dir}/${python_module}" ]] ; then
57
			if [[ -e "${python_module_dir}/${python_module}" ]] ; then
58
				rm "${python_module_dir}/${python_module}" || die -q "Unable to remove \"${python_module_dir}/${python_module}\""
58
				rm "${python_module_dir}/${python_module}" || die -q "Unable to remove \"${python_module_dir}/${python_module}\""
59
			fi
59
			fi
Lines 62-68 remove_installation() { Link Here
62
62
63
	# Deprecated code for older versions of Boost.
63
	# Deprecated code for older versions of Boost.
64
	local mod="mpi.so"
64
	local mod="mpi.so"
65
	for moddir in "${ROOT}"/usr/%LIBDIR%/python*/site-packages ; do
65
	for moddir in "${EROOT}"/usr/lib/python*/site-packages ; do
66
		if [ -L "${moddir}/${mod}" ] ; then
66
		if [ -L "${moddir}/${mod}" ] ; then
67
			rm "${moddir}/${mod}" || die -q "Unable to remove \"${moddir}/${mod}\" symlink"
67
			rm "${moddir}/${mod}" || die -q "Unable to remove \"${moddir}/${mod}\" symlink"
68
		else
68
		else
Lines 77-86 remove_installation() { Link Here
77
		echo "from ${target_python_module} import *" > "${ROOT}${wrapper_python_module}" || die -q "Couldn't create wrapper python module \"$(pwd)/${wrapper_python_module}\""
77
		echo "from ${target_python_module} import *" > "${ROOT}${wrapper_python_module}" || die -q "Couldn't create wrapper python module \"$(pwd)/${wrapper_python_module}\""
78
	done
78
	done
79
79
80
	if [ -L "${ROOT}/etc/eselect/boost/active" ] ; then
80
	if [ -L "${EROOT}/etc/eselect/boost/active" ] ; then
81
		rm  "${ROOT}/etc/eselect/boost/active" || die -q "Unable to remove \"${ROOT}/etc/eselect/boost/active\" symlink"
81
		rm  "${EROOT}/etc/eselect/boost/active" || die -q "Unable to remove \"${EROOT}/etc/eselect/boost/active\" symlink"
82
	else
82
	else
83
		[[ -e "${ROOT}/etc/eselect/boost/active" ]] && die -q "\"${ROOT}/etc/eselect/boost/active\" exists and isn't a symlink"
83
		[[ -e "${EROOT}/etc/eselect/boost/active" ]] && die -q "\"${EROOT}/etc/eselect/boost/active\" exists and isn't a symlink"
84
	fi
84
	fi
85
}
85
}
86
86
Lines 95-104 set_installation() { Link Here
95
	version="${version/boost-}"
95
	version="${version/boost-}"
96
	version="${version/./_}"
96
	version="${version/./_}"
97
97
98
	cd "${ROOT}/etc/eselect/boost"
98
	cd "${EROOT}/etc/eselect/boost"
99
	ln -s "${ROOT}/usr/share/boost-eselect/profiles/${target//boost-}" active || die -q "Couldn't create symlink active -> /usr/share/boost-eselect/profiles/${target//boost-}/${profile}"
99
	ln -s "${EROOT}/usr/share/boost-eselect/profiles/${target//boost-}" active || die -q "Couldn't create symlink active -> /usr/share/boost-eselect/profiles/${target//boost-}/${profile}"
100
100
101
	. "${ROOT}/usr/share/boost-eselect/profiles/${target//boost-}"
101
	. "${EROOT}/usr/share/boost-eselect/profiles/${target//boost-}"
102
102
103
	for t in ${dirs} ${bins} ${libs} ; do
103
	for t in ${dirs} ${bins} ${libs} ; do
104
		[[ -e "${ROOT}${t}" ]] || die -q "\"${t}\" listed as target does not exist"
104
		[[ -e "${ROOT}${t}" ]] || die -q "\"${t}\" listed as target does not exist"
Lines 112-119 set_installation() { Link Here
112
	done
112
	done
113
113
114
	[[ -d "${ROOT}${includes}" ]] || die -q "\"${includes}\" does not exist"
114
	[[ -d "${ROOT}${includes}" ]] || die -q "\"${includes}\" does not exist"
115
	pushd "${ROOT}/usr/include" 1>/dev/null
115
	pushd "${EROOT}/usr/include" 1>/dev/null
116
	ln -s ${includes//\/usr\/include\/} boost || die -q "Couldn't create symlink \"/usr/include/boost\""
116
	ln -s ${includes#*/usr/include/} boost || die -q "Couldn't create symlink \"/usr/include/boost\""
117
	popd 1>/dev/null
117
	popd 1>/dev/null
118
118
119
	local python_module
119
	local python_module
Lines 144-151 do_show() { Link Here
144
	local include
144
	local include
145
145
146
	write_list_start "Current boost version:"
146
	write_list_start "Current boost version:"
147
	if [[ -L "${ROOT}"/usr/include/boost ]] ; then
147
	if [[ -L "${EROOT}"/usr/include/boost ]] ; then
148
		include=$(basename $(dirname $(canonicalise "${ROOT}"/usr/include/boost )))
148
		include=$(basename $(dirname $(canonicalise "${EROOT}"/usr/include/boost )))
149
		write_kv_list_entry "${include%/}" ""
149
		write_kv_list_entry "${include%/}" ""
150
	else
150
	else
151
		write_kv_list_entry "(unset)" ""
151
		write_kv_list_entry "(unset)" ""
Lines 163-170 do_list() { Link Here
163
	write_list_start "Available boost versions:"
163
	write_list_start "Available boost versions:"
164
	if [[ -n "${targets[@]}" ]] ; then
164
	if [[ -n "${targets[@]}" ]] ; then
165
		local i
165
		local i
166
		local active_slot=$(canonicalise "${ROOT}/etc/eselect/boost/active")
166
		local active_slot=$(canonicalise "${EROOT}/etc/eselect/boost/active")
167
		active_slot=${active_slot/"${ROOT}/usr/share/boost-eselect/profiles/"/boost-}
167
		active_slot=${active_slot/"${EROOT}/usr/share/boost-eselect/profiles/"/boost-}
168
		for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
168
		for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
169
			if [[ "${targets[${i}]}" == ${active_slot} ]] ; then
169
			if [[ "${targets[${i}]}" == ${active_slot} ]] ; then
170
				targets[${i}]="${targets[${i}]} $(highlight '*' )"
170
				targets[${i}]="${targets[${i}]} $(highlight '*' )"
Lines 217-224 do_update() { Link Here
217
	profile="default"
217
	profile="default"
218
218
219
	# extract profile if there's already one boost version selected
219
	# extract profile if there's already one boost version selected
220
	if [ -L "${ROOT}"/etc/eselect/boost/active ] ; then
220
	if [ -L "${EROOT}"/etc/eselect/boost/active ] ; then
221
		profile=$(basename $(canonicalise "${ROOT}/etc/eselect/boost/active"))
221
		profile=$(basename $(canonicalise "${EROOT}/etc/eselect/boost/active"))
222
	fi
222
	fi
223
223
224
	echo "Previously selected profile: ${profile}"
224
	echo "Previously selected profile: ${profile}"

Return to bug 413447