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

Collapse All | Expand All

(-)a/app-admin/eselect-clang/Manifest (+4 lines)
Line 0 Link Here
1
AUX clang.eselect-0.1 6673 SHA256 3fc476383588298fe469895cb3f5ff2b648db810e21fee62e24c8b6d52f3a09a SHA512 5f895eb7ba85f238ab222af22ce44925fb78b91ea3811a9c690d790c862bc4bd4b293acbdb962ef0570a5ddcd8de3f3196fc6dafdb91f56d9473145a8217e114 WHIRLPOOL 2cbcbdd9ce83ec3ade31b9ec806a97d726e6039912eb28d76b65765859f3b672f0bd2838f579c395dc91269df21b65a4be0138945bac36647abde4a256e8a167
2
EBUILD eselect-clang-0.1.ebuild 556 SHA256 a58ffb95db94693ea95d0f37c1c43f0a721ac07f689d75a0e411a36a84664487 SHA512 f2302a9dec6ec0bb2082d81405acb80d6548a899b7701e2682dddcd3d6fc2ec1ee7d1f4a4dca9a7a2f3f0bbff5b2dca546f64ab8d9b652dc2b5f786c61d2de0e WHIRLPOOL 2558c6503324f4f45bbad58be678eb05b6ba60d8874ed611a35bb107be7ec8a0cae7db28399f067a77540420f73568c476eab24a1789ba5a9da5f15d4fcee61c
3
MISC ChangeLog 0 SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 SHA512 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e WHIRLPOOL 19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3
4
MISC metadata.xml 139 SHA256 5cdc1888ebc8807b9a37b1d33429c61cabe7415a4f240e21a4c2ff8eca7a34ed SHA512 8be912ace7468a4396eb1da00a9785030a8ce35da4357a01591876a1056fd45e44da65de2af3e1eb0506ce6551714962c40c3ae5a3aefa2ad231de35af2519be WHIRLPOOL 620431014dd4fb752c3d46d11904ecb2c6d4525f5b4e30f4f778a3b74d3f7187ae4ccd856ebd7eabb48ce261b21849c732928fe647edce024a3fdc082d8f8630
(-)a/app-admin/eselect-clang/eselect-clang-0.1.ebuild (+26 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="2"
6
7
DESCRIPTION="Clang module for eselect"
8
HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
9
SRC_URI=""
10
11
LICENSE="GPL-2"
12
SLOT="0"
13
KEYWORDS="~amd64"
14
IUSE=""
15
16
# Need skel.bash lib
17
RDEPEND=">=app-admin/eselect-1.0.5"
18
DEPEND="${RDEPEND}
19
	!!sys-devel/clang:0"
20
21
src_install() {
22
	local MODULEDIR="/usr/share/eselect/modules"
23
	local MODULE="clang"
24
	insinto ${MODULEDIR}
25
	newins "${FILESDIR}"/${MODULE}.eselect-${PVR} ${MODULE}.eselect
26
}
(-)a/app-admin/eselect-clang/files/clang.eselect-0.1 (+246 lines)
Line 0 Link Here
1
# Copyright 2013 Gentoo Foundation
2
# Distributed under the terms of the GNU GPL version 2 or later
3
4
inherit config multilib
5
6
DESCRIPTION="Manage active Clang version"
7
MAINTAINER="eselect@gentoo.org"
8
VERSION="20130521"
9
10
B_PATH="${EROOT%/}/usr"
11
S_PATH="${EROOT%/}/usr/share/eselect-clang"
12
13
# Global Data
14
active_slot() {
15
    local link="${B_PATH}/bin/clang"
16
    if [[ -e "${link}" ]] ; then
17
        echo $(readlink -sf "${link}") | \
18
            sed -re 's#.*clang-([0-9]+(\.[0-9]+)?)$#\1#'
19
    fi
20
}
21
22
# Utility Functions
23
add_slot_suffix() {
24
    local file="$1"
25
    local slot="$2"
26
    local ext=""
27
    if [[ "${file}" =~ \. ]] ; then
28
        ext=".${file#*.}"
29
    fi
30
    local base="${file%%.*}"
31
    echo "${base}-${slot}${ext}"
32
}
33
34
### Linker Function ###
35
# Takes two arguments:
36
#   - Full path to versioned file (e.g. /usr/share/eselect-clang/slots/3.2/versioned)
37
#   - Slot to link (e.g. 3.2)
38
linker() {
39
    local versioned_file=$1
40
    local slot=$2
41
    if [[ -r ${versioned_file} ]] ; then
42
        local versioned=($(<"${versioned_file}"))
43
44
        local link_path
45
        for link_path in "${versioned[@]}" ; do
46
            link_path="${ROOT%/}/${link_path#/}"
47
            local link_dir=$(dirname "${link_path}")
48
            local link_name=$(basename "${link_path}")
49
            local rel_target=$(add_slot_suffix "${link_name}" "${slot}")
50
            local target="${link_dir}/${rel_target}"
51
52
            # For good measure, remove target before creating the symlink
53
            [[ -h ${link_path} ]] && rm -f "${link_path}"
54
            [[ -e ${link_path} ]] && \
55
                die -q "The target '${link_path}' still exists and could not be removed!"
56
57
            if [[ ! -e "${target}" ]] && [[ "${link_path}" == *man* ]] ; then
58
                local suffix=$(echo "${target}"* | sed 's/.*\.1//')
59
                if [[ "${suffix}" != "*" ]] ; then
60
                    rel_target="${rel_target}${suffix}"
61
                    link_path="${link_path}${suffix}"
62
                fi
63
            fi
64
65
            # Create relative links so that they work both here and inside the new
66
            # root if $ROOT is not "/".
67
            ln -s "${rel_target}" "${link_path}" || die -q "Unable to create link!"
68
        done
69
    fi
70
}
71
72
### Unlinker Function ###
73
# Takes one argument:
74
#   - Full path to versioned file (e.g. /usr/share/eselect-clang/slots/3.2/versioned)
75
unlinker() {
76
    local versioned_file=$1
77
78
    if [[ -r ${versioned_file} ]] ; then
79
        local versioned=($(<"${versioned_file}"))
80
81
        local link_path
82
        for link_path in "${versioned[@]}" ; do
83
            if [[ ! -e "${link_path}" ]] && [[ "${link_path}" == *man* ]] ; then
84
                local suffix=$(echo "${link_path}"* | sed 's/.*\.1//')
85
                if [[ "${suffix}" != "*" ]] ; then
86
                    link_path="${link_path}${suffix}"
87
                fi
88
            fi
89
90
            [[ -h "${ROOT%/}/${link_path}" ]] && \
91
                rm -f "${ROOT%/}/${link_path}"
92
            [[ -e "${ROOT%/}/${link_path}" ]] && \
93
                die -q "The target '${link_path}' still exists and could not be removed!"
94
        done
95
    fi
96
}
97
98
### Get Slots Function ###
99
# Find all available slots and return them.
100
get_slots() {
101
    echo $(find "${B_PATH}/bin/" -maxdepth 1 -type f \
102
        -regex '.*clang-[0-9][0-9]*\(\.[0-9][0-9]*\)?' | \
103
        sed -re 's#.*clang-([0-9]+(\.[0-9]+)?)$#\1#' | sort -n)
104
}
105
106
### List Action ###
107
describe_list() {
108
    echo "List available Clang slots."
109
}
110
111
do_list() {
112
    write_list_start "Available Clang slots"
113
114
    if $(is_output_mode brief) ; then
115
        echo $(get_slots)
116
    else
117
        local slot
118
        for slot in $(get_slots) ; do
119
            local ebuild=($(<"${S_PATH}/slots/${slot}/ebuild"))
120
121
            case "${slot}" in
122
                "$(active_slot)" ) write_kv_list_entry \
123
                    "$(highlight_marker ${slot})" "${ebuild}";;
124
                *                ) write_kv_list_entry \
125
                    "${slot}" "${ebuild}";;
126
            esac
127
        done
128
129
        [[ -z "${slot}" ]] && write_warning_msg "No slots available."
130
    fi
131
}
132
133
### Show Action ###
134
describe_show() {
135
    echo "Show which slot is currently active."
136
}
137
138
do_show() {
139
    local slot=$(active_slot)
140
    if [[ -n "${slot}" ]] ; then
141
        echo "${slot}"
142
    else
143
        echo "(none)"
144
    fi
145
}
146
147
### Set Action ###
148
describe_set() {
149
    echo "Create symbolic links for Clang libraries and applications."
150
}
151
152
do_set() {
153
    local slot=$1
154
    if [[ ! -e ${B_PATH}/bin/clang-${slot} ]] ; then
155
        die -q "Not a valid slot."
156
    fi
157
158
    echo -ne "Switching to Clang-${slot}... "
159
160
    # Remove the active links to start a fresh list
161
    local active=$(active_slot)
162
    if [[ -n "${active}" ]] ; then
163
        unlinker "${S_PATH}/slots/${active}/versioned"
164
    fi
165
166
    linker "${S_PATH}/slots/${slot}/versioned" ${slot}
167
    echo "done."
168
}
169
170
### Unset Action ###
171
describe_unset() {
172
    echo "Deselect the current or given slot."
173
}
174
175
do_unset() {
176
    local slot=${1:-$(active_slot)}
177
    if [[ -n ${slot} ]] && [[ ${slot} = $(active_slot) ]] ; then
178
        echo -n "Removing symlinks... "
179
        unlinker "${S_PATH}/slots/${slot}/versioned"
180
        echo "done."
181
        do_update
182
    else
183
        echo "Inactive slot selected. Nothing to do."
184
    fi
185
}
186
187
### Clear Action ###
188
describe_clear() {
189
    echo "Remove all active symlinks."
190
}
191
192
do_clear() {
193
    local slot=$(active_slot)
194
    if [[ -n ${slot} ]] ; then
195
        echo -n "Removing symlinks... "
196
        unlinker "${S_PATH}/slots/${slot}/versioned"
197
        echo "done."
198
    else
199
        echo "No slot selected. Nothing to do."
200
    fi
201
}
202
203
### Reset Action ###
204
describe_reset() {
205
    echo "Recreate symbolic links for currently active slot."
206
}
207
208
do_reset() {
209
    local slot=$(active_slot)
210
    [[ -z ${slot} ]] && die -q "No active slot to reset."
211
    do_clear
212
    do_set ${slot}
213
}
214
215
### Update Action ###
216
describe_update() {
217
    echo "Refreshes all symbolic links managed by this module"
218
}
219
220
do_update() {
221
    local slot=$(active_slot)
222
223
    local slots=($(get_slots))
224
    local index=${#slots[@]}
225
226
    # In case all slots have been unmerged
227
    if [[ ${index} -eq 0 ]] ; then
228
        if [[ -n ${slot} ]] ; then
229
            do_clear
230
        else
231
            write_warning_msg "No slots found! Nothing to do."
232
        fi
233
        return 0
234
    fi
235
236
    # Reset, otherwise set the highest slot available.
237
    if [[ -n ${slot} ]] && [[ ${slots[@]} =~ ${slot} ]] ; then
238
        do_set ${slot}
239
    else
240
        # best_version doesn't work here as pkg_postrm runs before the world
241
        # file is updated, thereby returning a false positive.
242
        do_set ${slots[$index-1]}
243
    fi
244
245
    do_action env update &> /dev/null
246
}
(-)a/app-admin/eselect-clang/metadata.xml (+4 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
</pkgmetadata>
(-)a/app-admin/eselect-llvm/Manifest (+4 lines)
Line 0 Link Here
1
AUX llvm.eselect-0.1 7181 SHA256 c9e193cefa346ba0a1fa5aa00e436fbc19f3808c8dad035896b23d494b298d34 SHA512 8eb68d5c81a2193b7e35003ecc5302a9b7ac7293b3ee53534c623d60298dab6200f336596aec69ff40759a38e900855d2ed32338bc228065e09e60a269455617 WHIRLPOOL 99386db902ab338be2ca2d2d27b6bead1048c6cd4cb8d0c1e24881acaaa78d8880536ce090de64ead3b3529388257a48cbb90c03b51998ec2f69dd0b15164725
2
EBUILD eselect-llvm-0.1.ebuild 553 SHA256 8e0e01e7769ecb63855716a2e659caf90d0904a2e3db484e888da701f2f5604e SHA512 6d9ecb4044eee516ccc176811d0bbe81455192bc02c0c4ad98f720bd2d215fec3b780e6b55f944543bf2126a2b2377d55b2beeda2f8da6c4dfbb9c0a972ff5f0 WHIRLPOOL 22f15a6bfe0f509275db93bd5da31c60951cb5db4e26995caa3c80f35817f8f3d6fd3acd19054ffd82a550e816060d5c8ced2a257d6a41dfcd36139ea284b576
3
MISC ChangeLog 0 SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 SHA512 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e WHIRLPOOL 19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3
4
MISC metadata.xml 139 SHA256 5cdc1888ebc8807b9a37b1d33429c61cabe7415a4f240e21a4c2ff8eca7a34ed SHA512 8be912ace7468a4396eb1da00a9785030a8ce35da4357a01591876a1056fd45e44da65de2af3e1eb0506ce6551714962c40c3ae5a3aefa2ad231de35af2519be WHIRLPOOL 620431014dd4fb752c3d46d11904ecb2c6d4525f5b4e30f4f778a3b74d3f7187ae4ccd856ebd7eabb48ce261b21849c732928fe647edce024a3fdc082d8f8630
(-)a/app-admin/eselect-llvm/eselect-llvm-0.1.ebuild (+26 lines)
Line 0 Link Here
1
# Copyright 1999-2013 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="2"
6
7
DESCRIPTION="LLVM module for eselect"
8
HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
9
SRC_URI=""
10
11
LICENSE="GPL-2"
12
SLOT="0"
13
KEYWORDS="~amd64"
14
IUSE=""
15
16
# Need skel.bash lib
17
RDEPEND=">=app-admin/eselect-1.0.5"
18
DEPEND="${RDEPEND}
19
	!!sys-devel/llvm:0"
20
21
src_install() {
22
	local MODULEDIR="/usr/share/eselect/modules"
23
	local MODULE="llvm"
24
	insinto ${MODULEDIR}
25
	newins "${FILESDIR}"/${MODULE}.eselect-${PVR} ${MODULE}.eselect
26
}
(-)a/app-admin/eselect-llvm/files/llvm.eselect-0.1 (+264 lines)
Line 0 Link Here
1
# Copyright 2013 Gentoo Foundation
2
# Distributed under the terms of the GNU GPL version 2 or later
3
4
inherit config multilib
5
6
DESCRIPTION="Manage active LLVM version"
7
MAINTAINER="eselect@gentoo.org"
8
VERSION="20130521"
9
10
B_PATH="${EROOT%/}/usr"
11
S_PATH="${EROOT%/}/usr/share/eselect-llvm"
12
13
# Global Data
14
active_slot() {
15
    local link="${B_PATH}/$(lib_dir)/llvm"
16
    if [[ -e "${link}" ]] ; then
17
        echo $(readlink -sf "${link}") | \
18
            sed -re 's#.*llvm-([0-9]+(\.[0-9]+)?)$#\1#'
19
    fi
20
}
21
22
lib_dir() {
23
    local lib_list=$(list_libdirs)
24
    if [[ ${lib_list} =~ .*lib64.* && \
25
        -n $(ls -d ${B_PATH}/lib64/llvm-*/lib64 2> /dev/null) ]] ; then
26
        echo "lib64"
27
    elif [[ ${lib_list} =~ .*lib32.* && \
28
        -n $(ls -d ${B_PATH}/lib32/llvm-*/lib32 2> /dev/null) ]] ; then
29
        echo "lib32"
30
    else
31
        echo "lib"
32
    fi
33
}
34
35
# Utility Functions
36
add_slot_suffix() {
37
    local file="$1"
38
    local slot="$2"
39
    local ext=""
40
    if [[ "${file}" =~ \. ]] ; then
41
        ext=".${file#*.}"
42
    fi
43
    local base="${file%%.*}"
44
    echo "${base}-${slot}${ext}"
45
}
46
47
### Linker Function ###
48
# Takes two arguments:
49
#   - Full path to versioned file (e.g. /usr/share/eselect-llvm/slots/3.2/versioned)
50
#   - Slot to link (e.g. 3.2)
51
linker() {
52
    local versioned_file=$1
53
    local slot=$2
54
    if [[ -r ${versioned_file} ]] ; then
55
        local versioned=($(<"${versioned_file}"))
56
57
        local link_path
58
        for link_path in "${versioned[@]}" ; do
59
            link_path="${ROOT%/}/${link_path#/}"
60
            local link_dir=$(dirname "${link_path}")
61
            local link_name=$(basename "${link_path}")
62
            local rel_target=$(add_slot_suffix "${link_name}" "${slot}")
63
            local target="${link_dir}/${rel_target}"
64
65
            # For good measure, remove target before creating the symlink
66
            [[ -h ${link_path} ]] && rm -f "${link_path}"
67
            [[ -e ${link_path} ]] && \
68
                die -q "The target '${link_path}' still exists and could not be removed!"
69
70
            if [[ ! -e "${target}" ]] && [[ "${link_path}" == *man* ]] ; then
71
                local suffix=$(echo "${target}"* | sed 's/.*\.1//')
72
                if [[ "${suffix}" != "*" ]] ; then
73
                    rel_target="${rel_target}${suffix}"
74
                    link_path="${link_path}${suffix}"
75
                fi
76
            fi
77
78
            # Create relative links so that they work both here and inside the new
79
            # root if $ROOT is not "/".
80
            ln -s "${rel_target}" "${link_path}" || die -q "Unable to create link!"
81
        done
82
    fi
83
}
84
85
### Unlinker Function ###
86
# Takes one argument:
87
#   - Full path to versioned file (e.g. /usr/share/eselect-llvm/slots/3.2/versioned)
88
unlinker() {
89
    local versioned_file=$1
90
91
    if [[ -r ${versioned_file} ]] ; then
92
        local versioned=($(<"${versioned_file}"))
93
94
        local link_path
95
        for link_path in "${versioned[@]}" ; do
96
            if [[ ! -e "${link_path}" ]] && [[ "${link_path}" == *man* ]] ; then
97
                local suffix=$(echo "${link_path}"* | sed 's/.*\.1//')
98
                if [[ "${suffix}" != "*" ]] ; then
99
                    link_path="${link_path}${suffix}"
100
                fi
101
            fi
102
103
            [[ -h "${ROOT%/}/${link_path}" ]] && \
104
                rm -f "${ROOT%/}/${link_path}"
105
            [[ -e "${ROOT%/}/${link_path}" ]] && \
106
                die -q "The target '${link_path}' still exists and could not be removed!"
107
        done
108
    fi
109
}
110
111
### Get Slots Function ###
112
# Find all available slots in the preferred lib_dir() and return them.
113
get_slots() {
114
    echo $(find "${B_PATH}/$(lib_dir)/" -maxdepth 1 -type d \
115
        -regex '.*llvm-[0-9][0-9]*\(\.[0-9][0-9]*\)?' | \
116
        sed -re 's#.*llvm-([0-9]+(\.[0-9]+)?)$#\1#' | sort -n)
117
}
118
119
### List Action ###
120
describe_list() {
121
    echo "List available LLVM slots."
122
}
123
124
do_list() {
125
    write_list_start "Available LLVM slots"
126
127
    if $(is_output_mode brief) ; then
128
        echo $(get_slots)
129
    else
130
        local slot
131
        for slot in $(get_slots) ; do
132
            local ebuild=($(<"${S_PATH}/slots/${slot}/ebuild"))
133
134
            case "${slot}" in
135
                "$(active_slot)" ) write_kv_list_entry \
136
                    "$(highlight_marker ${slot})" "${ebuild}";;
137
                *                ) write_kv_list_entry \
138
                    "${slot}" "${ebuild}";;
139
            esac
140
        done
141
142
        [[ -z "${slot}" ]] && write_warning_msg "No slots available."
143
    fi
144
}
145
146
### Show Action ###
147
describe_show() {
148
    echo "Show which slot is currently active."
149
}
150
151
do_show() {
152
    local slot=$(active_slot)
153
    if [[ -n "${slot}" ]] ; then
154
        echo "${slot}"
155
    else
156
        echo "(none)"
157
    fi
158
}
159
160
### Set Action ###
161
describe_set() {
162
    echo "Create symbolic links for LLVM libraries and applications."
163
}
164
165
do_set() {
166
    local slot=$1
167
    if [[ ! -d ${B_PATH}/$(lib_dir)/llvm-${slot} ]] ; then
168
        die -q "Not a valid slot."
169
    fi
170
171
    echo -ne "Switching to LLVM-${slot}... "
172
173
    # Remove the active links to start a fresh list
174
    local active=$(active_slot)
175
    if [[ -n "${active}" ]] ; then
176
        unlinker "${S_PATH}/slots/${active}/versioned"
177
    fi
178
179
    linker "${S_PATH}/slots/${slot}/versioned" ${slot}
180
    echo "done."
181
182
    local SLOT=$1
183
    if [[ ! -d ${B_PATH}/$(lib_dir)/llvm-${SLOT} ]] ; then
184
        die -q "Not a valid slot."
185
    fi
186
}
187
188
### Unset Action ###
189
describe_unset() {
190
    echo "Deselect the current or given slot."
191
}
192
193
do_unset() {
194
    local slot=${1:-$(active_slot)}
195
    if [[ -n ${slot} ]] && [[ ${slot} = $(active_slot) ]] ; then
196
        echo -n "Removing symlinks... "
197
        unlinker "${S_PATH}/slots/${slot}/versioned"
198
        echo "done."
199
        do_update
200
    else
201
        echo "Inactive slot selected. Nothing to do."
202
    fi
203
}
204
205
### Clear Action ###
206
describe_clear() {
207
    echo "Remove all active symlinks."
208
}
209
210
do_clear() {
211
    local slot=$(active_slot)
212
    if [[ -n ${slot} ]] ; then
213
        echo -n "Removing symlinks... "
214
        unlinker "${S_PATH}/slots/${slot}/versioned"
215
        echo "done."
216
    else
217
        echo "No slot selected. Nothing to do."
218
    fi
219
}
220
221
### Reset Action ###
222
describe_reset() {
223
    echo "Recreate symbolic links for currently active slot."
224
}
225
226
do_reset() {
227
    local slot=$(active_slot)
228
    [[ -z ${slot} ]] && die -q "No active slot to reset."
229
    do_clear
230
    do_set ${slot}
231
}
232
233
### Update Action ###
234
describe_update() {
235
    echo "Refreshes all symbolic links managed by this module"
236
}
237
238
do_update() {
239
    local slot=$(active_slot)
240
241
    local slots=($(get_slots))
242
    local index=${#slots[@]}
243
244
    # In case all slots have been unmerged
245
    if [[ ${index} -eq 0 ]] ; then
246
        if [[ -n ${slot} ]] ; then
247
            do_clear
248
        else
249
            write_warning_msg "No slots found! Nothing to do."
250
        fi
251
        return 0
252
    fi
253
254
    # Reset, otherwise set the highest slot available.
255
    if [[ -n ${slot} ]] && [[ ${slots[@]} =~ ${slot} ]] ; then
256
        do_set ${slot}
257
    else
258
        # best_version doesn't work here as pkg_postrm runs before the world
259
        # file is updated, thereby returning a false positive.
260
        do_set ${slots[$index-1]}
261
    fi
262
263
    do_action env update &> /dev/null
264
}
(-)a/app-admin/eselect-llvm/metadata.xml (+4 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
</pkgmetadata>
(-)a/sys-devel/clang/Manifest (-18 / +8 lines)
Lines 1-6 Link Here
1
-----BEGIN PGP SIGNED MESSAGE-----
2
Hash: SHA256
3
4
AUX cl-patches/clang-0001-Add-r600-TargetInfo.patch 2801 SHA256 619a510c819ee4033e00ce4e42ab9f73409346edc3bba6243c3d0868face826c SHA512 41159ce46525878fbead0a64582fd522d5643c4ce9841f7a1259d6fcee2c0382babf8f734bf47c0c32c8d9e54633c8e2d3eef67b85426ac4f873d47fd8dd6ac1 WHIRLPOOL 074aae16c6e23f7db036a3e13f4c8ba976d0f27adae2e05c957a10d1931098d04f766a0ac35bf1589541e710acd18370bdee18205f612fd7da4aab926e306ace
1
AUX cl-patches/clang-0001-Add-r600-TargetInfo.patch 2801 SHA256 619a510c819ee4033e00ce4e42ab9f73409346edc3bba6243c3d0868face826c SHA512 41159ce46525878fbead0a64582fd522d5643c4ce9841f7a1259d6fcee2c0382babf8f734bf47c0c32c8d9e54633c8e2d3eef67b85426ac4f873d47fd8dd6ac1 WHIRLPOOL 074aae16c6e23f7db036a3e13f4c8ba976d0f27adae2e05c957a10d1931098d04f766a0ac35bf1589541e710acd18370bdee18205f612fd7da4aab926e306ace
5
AUX cl-patches/clang-0002-r600-Add-some-target-builtins.patch 3535 SHA256 620411208e4609ac2b77412f31774b2d6fb7403b0d8fccd250a4d613cfc1a5ca SHA512 872156d6e4721b01aef05ac4c829f5635abd205c5f05dc66f20a9e59e7f8165464c55f730a0890af5220b917bc8ebede58e63ca401165e6cef77a8c2d0fd40ab WHIRLPOOL 8bd671a6cca645bae6d9888345319ed3f5476991716f0cf909435d988ed4c6db4b06d8b8e93e07baffe83b741fc58ea4dc67aac7203e7d4e2d71e71190e05cd7
2
AUX cl-patches/clang-0002-r600-Add-some-target-builtins.patch 3535 SHA256 620411208e4609ac2b77412f31774b2d6fb7403b0d8fccd250a4d613cfc1a5ca SHA512 872156d6e4721b01aef05ac4c829f5635abd205c5f05dc66f20a9e59e7f8165464c55f730a0890af5220b917bc8ebede58e63ca401165e6cef77a8c2d0fd40ab WHIRLPOOL 8bd671a6cca645bae6d9888345319ed3f5476991716f0cf909435d988ed4c6db4b06d8b8e93e07baffe83b741fc58ea4dc67aac7203e7d4e2d71e71190e05cd7
6
AUX cl-patches/clang-0003-r600-Add-read_global_size-and-read_local_size-builti.patch 1132 SHA256 cf9888b9bd13e5daff6c2806c4324c99a20c3ce16570e7e0d6776baeb512bc2c SHA512 cff65845acedd72c2066e568bdf7da9a5b2e5d98737b8bb99be1b2dceefd096470e17b86ee04795339ab7cebbc72ea54c465a9a3640d2daafce9ddad1d5444e7 WHIRLPOOL 054b159e7e4d07acfea74ff8b1f79acf1b29de300903d4ae69a0f9ce5ad77495ce772a5bd1ce244badd8fe3502b1e6f833353478ee68252bf616fc81d251a8a7
3
AUX cl-patches/clang-0003-r600-Add-read_global_size-and-read_local_size-builti.patch 1132 SHA256 cf9888b9bd13e5daff6c2806c4324c99a20c3ce16570e7e0d6776baeb512bc2c SHA512 cff65845acedd72c2066e568bdf7da9a5b2e5d98737b8bb99be1b2dceefd096470e17b86ee04795339ab7cebbc72ea54c465a9a3640d2daafce9ddad1d5444e7 WHIRLPOOL 054b159e7e4d07acfea74ff8b1f79acf1b29de300903d4ae69a0f9ce5ad77495ce772a5bd1ce244badd8fe3502b1e6f833353478ee68252bf616fc81d251a8a7
Lines 22-28 AUX clang-3.1-gentoo-freebsd-fix-lib-path.patch 1048 SHA256 e3475478acef91fcc484 Link Here
22
AUX clang-3.1-gentoo-runtime-gcc-detection-v3.patch 1457 SHA256 f4b22281d21e39bc4681519cec90243c0e50262ce56ae68b0a8d9e7d92ce0375 SHA512 81c582791f4b0b1ccfcf3e8c82fbb68312320c5287402236d8c6d2d76767bbba031094c26d2b7bd9581c473896b78dda5a6284c5a87726e1bc0c539ae9294763 WHIRLPOOL bb68797804c89f8797561964697a72a015daf2c951d92f490f8c83f38aac6f50ce1527f39b53ccc6a3d93f84ec8f868e40340a5472b9e7ee4c34ceaa4b9ca845
19
AUX clang-3.1-gentoo-runtime-gcc-detection-v3.patch 1457 SHA256 f4b22281d21e39bc4681519cec90243c0e50262ce56ae68b0a8d9e7d92ce0375 SHA512 81c582791f4b0b1ccfcf3e8c82fbb68312320c5287402236d8c6d2d76767bbba031094c26d2b7bd9581c473896b78dda5a6284c5a87726e1bc0c539ae9294763 WHIRLPOOL bb68797804c89f8797561964697a72a015daf2c951d92f490f8c83f38aac6f50ce1527f39b53ccc6a3d93f84ec8f868e40340a5472b9e7ee4c34ceaa4b9ca845
23
AUX clang-3.1-increase-parser-recursion-limit.patch 480 SHA256 8c2fce5bbbeac965e0f116533e06a58d1a67df545855b7513c1ab6189596f757 SHA512 20a6caf48c1960883ea43243395e47fc44ce3de162552af89660949374c16a4ec1c651e8bb073feb015a8c3c6684f7e76ead927d58fc8a1b1d606bf89325535d WHIRLPOOL b701661a1bfce3091b6f57c99a790638ee1ced9ff35860c91cf43adf96901f8ead8bd6e984e48fb49f5035e26bd43076e9947b8496f9c9ebc952104548dd690c
20
AUX clang-3.1-increase-parser-recursion-limit.patch 480 SHA256 8c2fce5bbbeac965e0f116533e06a58d1a67df545855b7513c1ab6189596f757 SHA512 20a6caf48c1960883ea43243395e47fc44ce3de162552af89660949374c16a4ec1c651e8bb073feb015a8c3c6684f7e76ead927d58fc8a1b1d606bf89325535d WHIRLPOOL b701661a1bfce3091b6f57c99a790638ee1ced9ff35860c91cf43adf96901f8ead8bd6e984e48fb49f5035e26bd43076e9947b8496f9c9ebc952104548dd690c
24
DIST cfe-3.3.src.tar.gz 9425539 SHA256 b1b55de4ab3a57d3e0331a83e0284610191c77d924e3446498d9113d08dfb996 SHA512 06773f43f7d3529f06edb029f7de398f06a700a0f2476e00c4727e70c291028221bfac23625dfd2c220d6ac91a21670848187a934b99a21801c695127371afcc WHIRLPOOL 8b97b527f19015dd3283b9e174615170e639793f64c635ccc4ee4d8216f8de759fd0121a8ef3513fa1c6ad19b31aa3529091ffb44a01ee858edfef400881596a
21
DIST cfe-3.3.src.tar.gz 9425539 SHA256 b1b55de4ab3a57d3e0331a83e0284610191c77d924e3446498d9113d08dfb996 SHA512 06773f43f7d3529f06edb029f7de398f06a700a0f2476e00c4727e70c291028221bfac23625dfd2c220d6ac91a21670848187a934b99a21801c695127371afcc WHIRLPOOL 8b97b527f19015dd3283b9e174615170e639793f64c635ccc4ee4d8216f8de759fd0121a8ef3513fa1c6ad19b31aa3529091ffb44a01ee858edfef400881596a
25
DIST clang-2.8.tgz 5666777 SHA256 ed83481553e6a39a8a2953e89630d881d87833506f096a90f18d93ec2bdee0c1
22
DIST clang-2.8.tgz 5666777 SHA256 ed83481553e6a39a8a2953e89630d881d87833506f096a90f18d93ec2bdee0c1 SHA512 938e6b32f8280ffc2b4354b3f5ee7c70ae671e05a5908ee54aa17ac7bef7835d73c318fe8a0ce8b1f657a803feee547c026c4a2239e3bfbf77f3a7c1d52479c3 WHIRLPOOL 132ed96b97989758996fea96f5b9f6cba1ee824df58cf61bd04f28e771fed639216b41c72c94c1fc52c9ccdf835436f06481cb5a27c7c8683e723515d58e80db
26
DIST clang-2.9.tgz 6243772 SHA256 70c41f3f782a71cbaa7bc8d6ea29fce4263ad3e8558dfecc6dc11cdef17909df SHA512 0046b716eae7c398a61fb733239f209b60bdd1817e6724730b9515e7ae765565a1e42a805cc06e6f1393d8254ebc845335b244aff825f3fcce551b958683d8f5 WHIRLPOOL 4c745b7c6a21035595307ba5e2d95c2262a5ca1d52cca413a822186b9d450fec384d514175cf384e35e7169ce41ac5152222fcc9cbee4af85695c78d7cd5492e
23
DIST clang-2.9.tgz 6243772 SHA256 70c41f3f782a71cbaa7bc8d6ea29fce4263ad3e8558dfecc6dc11cdef17909df SHA512 0046b716eae7c398a61fb733239f209b60bdd1817e6724730b9515e7ae765565a1e42a805cc06e6f1393d8254ebc845335b244aff825f3fcce551b958683d8f5 WHIRLPOOL 4c745b7c6a21035595307ba5e2d95c2262a5ca1d52cca413a822186b9d450fec384d514175cf384e35e7169ce41ac5152222fcc9cbee4af85695c78d7cd5492e
27
DIST clang-3.0.tar.gz 7240578 SHA256 b64e72da356d7c3428cfd7ac620d49ec042c84eaee13c26024879f555f4e126d SHA512 0a31a2600cd4555424259331e0762f7fceeb5d828e7792983b2f8ae92bb75b3dc92cf84474e047deb5d4dab46062b4ac6273e6079159052debb76ae69927e517 WHIRLPOOL 521169cc588520090423cd1a2fa639da84e119281bf8260ea4b7b24fd2d8627806a281ddbbba5c378a736fc31279e25f10c4d3a3c81abd2c202970079a949ba5
24
DIST clang-3.0.tar.gz 7240578 SHA256 b64e72da356d7c3428cfd7ac620d49ec042c84eaee13c26024879f555f4e126d SHA512 0a31a2600cd4555424259331e0762f7fceeb5d828e7792983b2f8ae92bb75b3dc92cf84474e047deb5d4dab46062b4ac6273e6079159052debb76ae69927e517 WHIRLPOOL 521169cc588520090423cd1a2fa639da84e119281bf8260ea4b7b24fd2d8627806a281ddbbba5c378a736fc31279e25f10c4d3a3c81abd2c202970079a949ba5
28
DIST clang-3.1.src.tar.gz 8158418 SHA256 ff63e215dcd3e2838ffdea38502f8d35bab17e487f3c3799579961e452d5a786 SHA512 14c033eda3e0c0a887a8410f6b6a1335e0f6bfa05950a903d302b06b95fd58b03894320e91e50fb4d330c5323be9e955d9054cee62d035e2753290354ea8f8cd WHIRLPOOL cdb578c287a417896d2d6fb297e96e44e8b951bad6e7d286b97bdd346b40dac6ffbb7015b39d69fa0f9e0994dede26612307b643f71480e3c8917199fe926357
25
DIST clang-3.1.src.tar.gz 8158418 SHA256 ff63e215dcd3e2838ffdea38502f8d35bab17e487f3c3799579961e452d5a786 SHA512 14c033eda3e0c0a887a8410f6b6a1335e0f6bfa05950a903d302b06b95fd58b03894320e91e50fb4d330c5323be9e955d9054cee62d035e2753290354ea8f8cd WHIRLPOOL cdb578c287a417896d2d6fb297e96e44e8b951bad6e7d286b97bdd346b40dac6ffbb7015b39d69fa0f9e0994dede26612307b643f71480e3c8917199fe926357
Lines 36-54 DIST llvm-3.0.tar.gz 10350539 SHA256 519eb11d3499ce99c6ffdb8718651fc91425ed7690e Link Here
36
DIST llvm-3.1.src.tar.gz 11077429 SHA256 1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab SHA512 fb941094601043e405ccc57473414ef92437b09c200e71614f93d8e93b2a58cca8d78c385be037e064b0711cd6268802c774ce4a40fc0ea17bf576305304d2aa WHIRLPOOL c5c72e139296e1c186131f991010f52f958063a4fcfcb1f8527b53a2aaa7edcaca70ab6cf86c25d08640dcf6d720a865fda7dc7eb06cf1ce9c23fd37b5d597ef
33
DIST llvm-3.1.src.tar.gz 11077429 SHA256 1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab SHA512 fb941094601043e405ccc57473414ef92437b09c200e71614f93d8e93b2a58cca8d78c385be037e064b0711cd6268802c774ce4a40fc0ea17bf576305304d2aa WHIRLPOOL c5c72e139296e1c186131f991010f52f958063a4fcfcb1f8527b53a2aaa7edcaca70ab6cf86c25d08640dcf6d720a865fda7dc7eb06cf1ce9c23fd37b5d597ef
37
DIST llvm-3.2.src.tar.gz 12275252 SHA256 125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343 SHA512 cc66171322dbbe40bcac0e0ea5b09df8ff52df63ded304f841f32f702270d6ab1512216413ee52498c3ebee8cd39c4cd23e3855d591944bc2ac0ae76f5be62cc WHIRLPOOL c3a39b2426293d0251b7769607ade873bb6bf8d54e7c8055773a9b75742bc8e39049fb71409a258c6f3d98775b78c280d4bfe4223ba91e5ed6ecae0eddf910e5
34
DIST llvm-3.2.src.tar.gz 12275252 SHA256 125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343 SHA512 cc66171322dbbe40bcac0e0ea5b09df8ff52df63ded304f841f32f702270d6ab1512216413ee52498c3ebee8cd39c4cd23e3855d591944bc2ac0ae76f5be62cc WHIRLPOOL c3a39b2426293d0251b7769607ade873bb6bf8d54e7c8055773a9b75742bc8e39049fb71409a258c6f3d98775b78c280d4bfe4223ba91e5ed6ecae0eddf910e5
38
DIST llvm-3.3.src.tar.gz 13602421 SHA256 68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578 SHA512 1b7f7c5e907a68f642dcbe48fdff9585cb1504022bc9d386f310ebe5d25103d0d5f7cf0abf19e0e3fd666970160a98c90033754e2b79b2fac0cf866c984f8038 WHIRLPOOL a89c0b470fde562a3402e7878b91bc0573d433ca0a60e62c9c46946d7948a4fb657b116b6bac032555e29c70d82c751876adb398fe240f5c8d0a9a2378ce1866
35
DIST llvm-3.3.src.tar.gz 13602421 SHA256 68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578 SHA512 1b7f7c5e907a68f642dcbe48fdff9585cb1504022bc9d386f310ebe5d25103d0d5f7cf0abf19e0e3fd666970160a98c90033754e2b79b2fac0cf866c984f8038 WHIRLPOOL a89c0b470fde562a3402e7878b91bc0573d433ca0a60e62c9c46946d7948a4fb657b116b6bac032555e29c70d82c751876adb398fe240f5c8d0a9a2378ce1866
39
EBUILD clang-2.8-r3.ebuild 6775 SHA256 2e356a45d80b276e8a349b7525f2526094ba03fe83ac9f49e7fb5136bd3a983d SHA512 c67e745804d7894597531328a30e6e0c171e34a1d6242f708d3f02dbb1c9383d94e9a9fbd641ca49a80959b454ddb1b6ca44289ce70eb674befde82c82c51c81 WHIRLPOOL faee8941ef6dcf173d9fa21ee3f01f4fb3d43377d5b7855138edd49388e411fbff519fffebaf65e2e2cd32071ebaea12f7c75a16c9dccb0e27c12b47a8229651
36
EBUILD clang-2.8-r3.ebuild 9342 SHA256 be5c9b3744f4dd52fad2307680c1c760d86a247b36e7edfe810e816c97a8a707 SHA512 220864b58327fe89b71023d520212d492fca8c12099dcdead247aa781db4f1fca42995adee91a86c1a99eb230278ba8a4ead8a3f18a542bf865dbad8d6a5de20 WHIRLPOOL 3adb25fbfc16982d183b2cc47e8c02048b56625d498431979f9114f5787e3c9ce08c18170594dc916aacff234384dcc15605a6bc1bc3f28ea3559557661a3874
40
EBUILD clang-2.9-r1.ebuild 6438 SHA256 00d9147d62dc19548c841243fccb3b81aa5abb32ba46480d528952dcd4756711 SHA512 b0d2862222e87c3cdcec18d80ff08ed369cd21a8f5ec76b32b03dcf4cb14f0876e4b8ebb3868ab537615c080ce8b2134b5148f4cfef648ef8f40e7cb7deaee04 WHIRLPOOL 7b39c433ff21e1c2ef39d988678c9cc068c298e84118c0a4e669b2f1d43e988fa65b8fd37d37311d4b1e2b7d9a6b762a3795ac8a8fccdb774c06d5b830d91c33
37
EBUILD clang-2.9-r1.ebuild 9005 SHA256 da220a5459ee7d6000d81560045ccc8a85ad36563e3485479b31f4fb6b4c9035 SHA512 9484131de34771e2d146b3b4d25661f124b660e706204f1ea8761d31b16b64b451c01447cba2de5ebe8d93cf858323066821535e887dfa2f69517978c280f889 WHIRLPOOL cebfd685bec788e56fe2e3816ff0172d714f4ca9c2708d6772e9cae68744fa3b22bc692d93bc11097b4f62fb17c6e18e14ae4c302803faee2c8a033dfc03cbbe
41
EBUILD clang-3.0-r4.ebuild 7166 SHA256 50fe174e45d88d5f1b31119600ae9c8f06f27b14b497d8eee4a1c805bcba92f3 SHA512 834247ed9475353da30946eeabd206a6164eddff8195b5a717fa1bf0e1760d910ee7e0943fe805f3c259a811c0f4514e5bb5aa272a049a195e9f12f68b554669 WHIRLPOOL a8432fb8a00f29a0cd7126f0d028866c893f07d2d92122d09d952caf1c62fdbb0eaa18faa230ecab4bea556252085db152e8c0a3ed6d3cd1adcf3d987cfb9a67
38
EBUILD clang-3.0-r4.ebuild 9741 SHA256 e33903b9080ab06233c01936e0449979513248c9078ce59767d20880763ac70d SHA512 88068bed026a61c5648aa3ef7954d4e9dc42f82df3a9dceb4362a76193ff25a3a1a00b19045a65ab79418b292d2e999f28e9f2cb097d39b239b9c3bdde4aa83b WHIRLPOOL 63807c537dd3d56b13686c811da8e5910b4b1fd9607e9be84ac47fdaf65cb7eed0e09675b3c8fd9fea4e2ab5723ba1afd55efac26575a04f51662740ede39171
42
EBUILD clang-3.1-r5.ebuild 6696 SHA256 4a4d884d8c37044fe7dc5f325e88f4733140997b3d2de64c0d6e35d9604c477f SHA512 2ba6057e08c8533fbaa45810f4d9588b57b20b08c9b99b8a53ed32b95d17a43ce13f15d81618e4cb3bc6cb4ded3c50fbba2a866a0d130a69a107195c90dc58ea WHIRLPOOL 890f64a0309c731e7784f5196ac3da602e204c65566412a398a8f9bd862d1b1e5337eae56fd309c1ffb9fc750741982481abcc13567973017df650c6e5dd1be8
39
EBUILD clang-3.1-r5.ebuild 9268 SHA256 7f932ebf8cc35e1361a2f59d4e41cdaa0d023553b732e0f7ad465f542156527e SHA512 60d8b1d764a1645e8458deb66a4d40018a626e8abc1251ca2befb1b98048f41360a61e93ac64fc82f005af0691ef69dcfca392fda915e0279b396bae73143b11 WHIRLPOOL 8b9256da5cf9a22618b77a25863a48e76c521e4fd4feaa929a6cefb279565d3ba4b08d5815854005f541255d5462a2234fbbd95c10b9b230e569d9393d73ab19
43
EBUILD clang-3.2.ebuild 6519 SHA256 35e962bcd5fea3f406e4b684aaa74bb1be4bdfcda63d963a9bbab604a858fe50 SHA512 20afd7ecc1af578ac3e1d9b6694c3d82d6d6591153496c5a1a07eeb4189f1e3be54d8b18006239ced612bd9d94912bdbc34706599383beff46fe4aca9ed93952 WHIRLPOOL 1fbef46523a62b049375445b4749d42ec93ddae4966a1dcf818b2e1e1e770a8cc67c00ed849fdb291ad29100a5f8b66236a6317b7ecf9bdab02826396be2d18e
40
EBUILD clang-3.2.ebuild 9365 SHA256 40060644a78d4f0b2f1b4264b8a77485ab94b6cbbfaa6db9d559968b5fcc9499 SHA512 3a48e5e7aaa348ab0b6655162b0541b67f5accd0b494094aceceb66466fb79ed78fa5d07fb2cbd386afcb6407592d9f92d35348f60c67e25d008900ffe1dacd2 WHIRLPOOL 656295d94399074f740a1ee5b22b61b510b5784c50dc9a9e47312d569de976eab915797d26a5d13683070cd2e55c2e1d14fbc9d9744bfa24db8b52d9897cae8e
44
EBUILD clang-3.3.ebuild 6916 SHA256 5bbaf90c57e9e10d2c325feec28466366fe1e8bac214f4e5d0291f6b7a1b534a SHA512 c4f2d747f07dc9c0b8b7366554c0fd51cede1eb8327b8529c534c3003f005efecdeacee7acb49521fc2fad3a90f62aa41b67fc1e51951fac52a3debe3f655da7 WHIRLPOOL e3ce031b19658760fa5ef0456ce356a1941dd8a98112e7aa0948aaa73ff3cb925607f689579f5c87bee961ab199f84e772638ea5a523500f60951509864d3478
41
EBUILD clang-3.3.ebuild 9758 SHA256 2efe64d4fc425a6ac444d886b8821923264f2202d2e8dbc088f979e2f0a5a1fc SHA512 9a031edda6a30a1c76c9f3e93bee03e978432e1b5fa39b6300b549910d7c0c19d336bc30dba300a9ccc4799a206cd60a4dca030ddc770a1bc6bf04b458e0e01b WHIRLPOOL e455c404e7eaa4fdf7a8fcfe57ba6837f21e035470c1c852b71e68ce42b39cf93370f6a4366e2f09881595f780073f869bfd3c054d9a02588299b140ba856839
45
EBUILD clang-9999.ebuild 5989 SHA256 a36d63cbefd5e7d6db8f39acdfed9754156810efc912626a221e2d1d3533992e SHA512 091f36174231f6a9d0a913cf9a0232829d55aa824319d78ec3370e6fbfce805bc76769cdc02dcdc54f2d5895f14da4a8c6ee7592d208556d38e501dc7822b660 WHIRLPOOL d16bc8d75c7cb53274bdc261ba415db56b69b4fc7c46feaca470060a2b7af8fb4abfa4a024d528a33f853611f1c165731afe0e36f435d088165348047113f4ff
42
EBUILD clang-9999.ebuild 9658 SHA256 4b054c2e41456e6f5b7fbd3c658ddbf14613fdc8c71fc60a01f64c0076995fff SHA512 96f790feda0bccec21b1377d44a3964941d59ed6f00777db6645647b16e8842b7e0fcf1318b28cf44ba72908d813006d55e99c986c015c78606be32dced34f4f WHIRLPOOL ec060c8c58cd407f3eb848e00b52fb75db6183e3c860070c2a3df5383caa70dfdd37c61edc5dc2239fcc6fcabb9cc33660c0a6f1a263be1ca8bd84bdd9ea0398
46
MISC ChangeLog 18021 SHA256 379d9f1da98a54c618426d53923e5f22c2f2235e1cee0722bdc16fd4c188aea6 SHA512 42798e7f7c197a70e8cfbd686319776a2b2d31b5c7ea5defc4c6b6c2d6120400dfc6dd34fa76183835daebca28b2da4fc125f1e327e1caa7dc4faa1ac3a10ce5 WHIRLPOOL 2218b9eddb6dcb3706c4f5a707b690fb12b44d8b76272b52b035ed1ea697c5ef61014870455e42291dde3d56cd8f24ef5da0f471442b01111cca2f6f31212374
43
MISC ChangeLog 18021 SHA256 379d9f1da98a54c618426d53923e5f22c2f2235e1cee0722bdc16fd4c188aea6 SHA512 42798e7f7c197a70e8cfbd686319776a2b2d31b5c7ea5defc4c6b6c2d6120400dfc6dd34fa76183835daebca28b2da4fc125f1e327e1caa7dc4faa1ac3a10ce5 WHIRLPOOL 2218b9eddb6dcb3706c4f5a707b690fb12b44d8b76272b52b035ed1ea697c5ef61014870455e42291dde3d56cd8f24ef5da0f471442b01111cca2f6f31212374
47
MISC metadata.xml 1522 SHA256 c0c8a45b9d836fac31adc4d76a2de92abf2c8d603b69146fc72e6c2484331f42 SHA512 b8780e7a635fa8c32c6cf73c842982d85a11f24daf8049bb3efb165808635875a2331072c01865df230b1dcac7135fcdf9fa7ea19ac46a35ac9f50ffaf4c5067 WHIRLPOOL 2bc088ce4d44c7d0d2673449116052d70ed7298afc14bc5cc460d5c60dda2c1df65a3cf89e8cd79e52e96414b2eb759dd95ed97055cfd41822a4b9f540fb662c
44
MISC metadata.xml 1522 SHA256 c0c8a45b9d836fac31adc4d76a2de92abf2c8d603b69146fc72e6c2484331f42 SHA512 b8780e7a635fa8c32c6cf73c842982d85a11f24daf8049bb3efb165808635875a2331072c01865df230b1dcac7135fcdf9fa7ea19ac46a35ac9f50ffaf4c5067 WHIRLPOOL 2bc088ce4d44c7d0d2673449116052d70ed7298afc14bc5cc460d5c60dda2c1df65a3cf89e8cd79e52e96414b2eb759dd95ed97055cfd41822a4b9f540fb662c
48
-----BEGIN PGP SIGNATURE-----
49
Version: GnuPG v2.0.20 (GNU/Linux)
50
51
iF4EAREIAAYFAlHA3R8ACgkQFYEBGcdFJfJddgD/SZOu7B+8xlR3sOWPuyd4y8f+
52
Zk6Pc99Hmt9jD6F64BkBAIMAmTjf7mrWyRmh43Owq7PuLLl+3T87GptzRmgH5or0
53
=t72i
54
-----END PGP SIGNATURE-----
(-)a/sys-devel/clang/clang-2.8-r3.ebuild (-7 / +110 lines)
Lines 2-8 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/sys-devel/clang/clang-2.8-r3.ebuild,v 1.8 2013/01/03 23:36:58 voyageur Exp $
3
# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.8-r3.ebuild,v 1.8 2013/01/03 23:36:58 voyageur Exp $
4
4
5
EAPI=3
5
EAPI=5
6
6
7
RESTRICT_PYTHON_ABIS="3.*"
7
RESTRICT_PYTHON_ABIS="3.*"
8
SUPPORT_PYTHON_ABIS="1"
8
SUPPORT_PYTHON_ABIS="1"
Lines 17-34 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tgz -> llvm-${PV}-r1.tgz Link Here
17
	http://llvm.org/releases/${PV}/${P}.tgz"
17
	http://llvm.org/releases/${PV}/${P}.tgz"
18
18
19
LICENSE="UoI-NCSA"
19
LICENSE="UoI-NCSA"
20
SLOT="0"
20
SLOT="${PV}"
21
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
21
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
22
IUSE="debug multitarget +static-analyzer system-cxx-headers test"
22
IUSE="debug multitarget +static-analyzer system-cxx-headers test"
23
23
24
# Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
24
# Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
25
DEPEND="static-analyzer? ( dev-lang/perl )"
25
DEPEND="static-analyzer? ( dev-lang/perl )"
26
RDEPEND="~sys-devel/llvm-${PV}[debug=,multitarget=]"
26
RDEPEND="sys-devel/llvm:${SLOT}=[debug=,multitarget=]
27
	app-admin/eselect-clang"
27
28
28
S="${WORKDIR}/llvm-${PV}"
29
S="${WORKDIR}/llvm-${PV}"
29
30
30
src_prepare() {
31
src_prepare() {
31
	mv "${WORKDIR}"/clang-${PV} "${S}"/tools/clang || die "clang source directory not found"
32
	mv "${WORKDIR}"/${P} "${S}"/tools/clang || die "clang source directory not found"
32
33
33
	# Same as llvm doc patches
34
	# Same as llvm doc patches
34
	epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch
35
	epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch
Lines 68-74 src_prepare() { Link Here
68
		-i Makefile.config.in || die "Makefile.config sed failed"
69
		-i Makefile.config.in || die "Makefile.config sed failed"
69
70
70
	einfo "Fixing rpath and CFLAGS"
71
	einfo "Fixing rpath and CFLAGS"
71
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
72
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/llvm-${SLOT}'@" \
72
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
73
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
73
		-i Makefile.rules || die "rpath sed failed"
74
		-i Makefile.rules || die "rpath sed failed"
74
}
75
}
Lines 153-166 src_install() { Link Here
153
154
154
		cd tools/scan-view || die "cd scan-view failed"
155
		cd tools/scan-view || die "cd scan-view failed"
155
		dobin scan-view
156
		dobin scan-view
157
	fi
158
159
	# Register slot for app-admin/eselect-clang
160
	local eselect_dir="/usr/share/eselect-clang/slots/${SLOT}"
161
	dodir "${eselect_dir}"
162
	eselect_dir="${ED}/${eselect_dir}"
163
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
164
165
	with_slot_suffix() {
166
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
167
		local ext=""
168
		if [[ "${file}" =~ \. ]] ; then
169
			ext=".${file#*.}"
170
		fi
171
		local base="${file%%.*}"
172
		echo "${base}-${SLOT}${ext}"
173
	}
174
175
	make_versioned() {
176
		local dir=$1
177
		local candidates=(${ED%/}/${dir})
178
		if [[ ! ${dir##*/} ]] ; then
179
			dir=${dir%/}
180
			candidates=( "${candidates}"* )
181
		else
182
			dir=$(dirname "${dir}")
183
		fi
184
185
		pushd ${ED%/}/${dir} >/dev/null || die
186
187
		local candidate
188
		for candidate in "${candidates[@]}" ; do
189
			if [[ -h "${candidate}" ]] ; then
190
				# Add slot suffix to symlink target
191
				local target=$(readlink -s "${candidate}")
192
				local slotted_target=$(with_slot_suffix "${target}")
193
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
194
					ln -sf "${slotted_target}" "${candidate}" \
195
						|| die "Could not update symlink"
196
				fi
197
			fi
198
199
			local base_name=$(basename "${candidate}")
200
			local slotted_name=$(with_slot_suffix "${base_name}")
201
			mv "${candidate}" "${ED}/${dir}/${slotted_name}" \
202
				|| die "Could not rename ${candidate} to ${slotted_name}"
203
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
204
		done
205
206
		popd >/dev/null || die
207
	}
208
209
	# Trailing slash => version the content
210
	# No trailing slash => version the directory itself
211
	local paths=(
212
		/usr/bin/
213
		/usr/$(get_libdir)/llvm
214
		/usr/include/
215
		/usr/share/clang
216
		/usr/share/man/man1/
217
	)
218
219
	local path
220
	for path in "${paths[@]}" ; do
221
		make_versioned "${path}"
222
	done
223
224
	if use static-analyzer ; then
225
		cd "${S}"/tools/clang/tools/scan-view || die "cd scan-view failed"
226
156
		install-scan-view() {
227
		install-scan-view() {
157
			insinto "$(python_get_sitedir)"/clang
228
			insinto "$(python_get_sitedir)"/clang
158
			doins Reporter.py Resources ScanView.py startfile.py
229
			doins Reporter.py Resources ScanView.py startfile.py
159
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
230
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
231
			make_versioned "$(python_get_sitedir)/clang"
160
		}
232
		}
161
		python_execute_function install-scan-view
233
		python_execute_function install-scan-view
162
	fi
234
	fi
163
235
236
	install_symlinks() {
237
		local dir=${ED%/}/${1#/}
238
		local category=$(basename "${dir}")
239
		local symlink_dir=${ED%/}/usr/$(get_libdir)/llvm-${SLOT}/${category}
240
		mkdir ${symlink_dir}
241
242
		local output
243
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
244
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
245
		done
246
	}
247
248
	# Expose clang binaries and includes to llvm-config
249
	install_symlinks /usr/bin/
250
	install_symlinks /usr/include/
251
164
	# Fix install_names on Darwin.  The build system is too complicated
252
	# Fix install_names on Darwin.  The build system is too complicated
165
	# to just fix this, so we correct it post-install
253
	# to just fix this, so we correct it post-install
166
	if [[ ${CHOST} == *-darwin* ]] ; then
254
	if [[ ${CHOST} == *-darwin* ]] ; then
Lines 186-192 src_install() { Link Here
186
}
274
}
187
275
188
pkg_postinst() {
276
pkg_postinst() {
189
	python_mod_optimize clang
277
	python_mod_optimize ${P}
278
279
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
280
		eselect ${PN} set ${SLOT}
281
	fi
282
190
	if use system-cxx-headers; then
283
	if use system-cxx-headers; then
191
		elog "C++ headers search path is hardcoded to the active gcc profile one"
284
		elog "C++ headers search path is hardcoded to the active gcc profile one"
192
		elog "If you change the active gcc profile, or update gcc to a new version,"
285
		elog "If you change the active gcc profile, or update gcc to a new version,"
Lines 198-203 pkg_postinst() { Link Here
198
	fi
291
	fi
199
}
292
}
200
293
294
pkg_prerm() {
295
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
296
		eselect ${PN} clear
297
	fi
298
}
299
201
pkg_postrm() {
300
pkg_postrm() {
202
	python_mod_cleanup clang
301
	python_mod_cleanup ${P}
302
303
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
304
		eselect ${PN} update
305
	fi
203
}
306
}
(-)a/sys-devel/clang/clang-2.9-r1.ebuild (-7 / +110 lines)
Lines 2-8 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/sys-devel/clang/clang-2.9-r1.ebuild,v 1.5 2013/01/03 23:36:58 voyageur Exp $
3
# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.9-r1.ebuild,v 1.5 2013/01/03 23:36:58 voyageur Exp $
4
4
5
EAPI=3
5
EAPI=5
6
6
7
RESTRICT_PYTHON_ABIS="3.*"
7
RESTRICT_PYTHON_ABIS="3.*"
8
SUPPORT_PYTHON_ABIS="1"
8
SUPPORT_PYTHON_ABIS="1"
Lines 16-33 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tgz Link Here
16
	http://llvm.org/releases/${PV}/${P}.tgz"
16
	http://llvm.org/releases/${PV}/${P}.tgz"
17
17
18
LICENSE="UoI-NCSA"
18
LICENSE="UoI-NCSA"
19
SLOT="0"
19
SLOT="${PV}"
20
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
20
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
21
IUSE="debug multitarget +static-analyzer +system-cxx-headers test"
21
IUSE="debug multitarget +static-analyzer +system-cxx-headers test"
22
22
23
# Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
23
# Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
24
DEPEND="static-analyzer? ( dev-lang/perl )"
24
DEPEND="static-analyzer? ( dev-lang/perl )"
25
RDEPEND="~sys-devel/llvm-${PV}[debug=,multitarget=]"
25
RDEPEND="sys-devel/llvm:${SLOT}=[debug=,multitarget=]
26
	app-admin/eselect-clang"
26
27
27
S="${WORKDIR}/llvm-${PV}"
28
S="${WORKDIR}/llvm-${PV}"
28
29
29
src_prepare() {
30
src_prepare() {
30
	mv "${WORKDIR}"/clang-${PV} "${S}"/tools/clang || die "clang source directory not found"
31
	mv "${WORKDIR}"/${P} "${S}"/tools/clang || die "clang source directory not found"
31
32
32
	# Workaround GCC versions' list (bug #377949)
33
	# Workaround GCC versions' list (bug #377949)
33
	epatch "${FILESDIR}"/${P}-gccversions.patch
34
	epatch "${FILESDIR}"/${P}-gccversions.patch
Lines 65-71 src_prepare() { Link Here
65
		-i Makefile.config.in || die "Makefile.config sed failed"
66
		-i Makefile.config.in || die "Makefile.config sed failed"
66
67
67
	einfo "Fixing rpath and CFLAGS"
68
	einfo "Fixing rpath and CFLAGS"
68
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
69
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/llvm-${SLOT}'@" \
69
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
70
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
70
		-i Makefile.rules || die "rpath sed failed"
71
		-i Makefile.rules || die "rpath sed failed"
71
}
72
}
Lines 142-155 src_install() { Link Here
142
143
143
		cd tools/scan-view || die "cd scan-view failed"
144
		cd tools/scan-view || die "cd scan-view failed"
144
		dobin scan-view
145
		dobin scan-view
146
	fi
147
148
	# Register slot for app-admin/eselect-clang
149
	local eselect_dir="/usr/share/eselect-clang/slots/${SLOT}"
150
	dodir "${eselect_dir}"
151
	eselect_dir="${ED}/${eselect_dir}"
152
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
153
154
	with_slot_suffix() {
155
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
156
		local ext=""
157
		if [[ "${file}" =~ \. ]] ; then
158
			ext=".${file#*.}"
159
		fi
160
		local base="${file%%.*}"
161
		echo "${base}-${SLOT}${ext}"
162
	}
163
164
	make_versioned() {
165
		local dir=$1
166
		local candidates=(${ED%/}/${dir})
167
		if [[ ! ${dir##*/} ]] ; then
168
			dir=${dir%/}
169
			candidates=( "${candidates}"* )
170
		else
171
			dir=$(dirname "${dir}")
172
		fi
173
174
		pushd ${ED%/}/${dir} >/dev/null || die
175
176
		local candidate
177
		for candidate in "${candidates[@]}" ; do
178
			if [[ -h "${candidate}" ]] ; then
179
				# Add slot suffix to symlink target
180
				local target=$(readlink -s "${candidate}")
181
				local slotted_target=$(with_slot_suffix "${target}")
182
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
183
					ln -sf "${slotted_target}" "${candidate}" \
184
						|| die "Could not update symlink"
185
				fi
186
			fi
187
188
			local base_name=$(basename "${candidate}")
189
			local slotted_name=$(with_slot_suffix "${base_name}")
190
			mv "${candidate}" "${ED}/${dir}/${slotted_name}" \
191
				|| die "Could not rename ${candidate} to ${slotted_name}"
192
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
193
		done
194
195
		popd >/dev/null || die
196
	}
197
198
	# Trailing slash => version the content
199
	# No trailing slash => version the directory itself
200
	local paths=(
201
		/usr/bin/
202
		/usr/$(get_libdir)/llvm
203
		/usr/include/
204
		/usr/share/clang
205
		/usr/share/man/man1/
206
	)
207
208
	local path
209
	for path in "${paths[@]}" ; do
210
		make_versioned "${path}"
211
	done
212
213
	if use static-analyzer ; then
214
		cd "${S}"/tools/clang/tools/scan-view || die "cd scan-view failed"
215
145
		install-scan-view() {
216
		install-scan-view() {
146
			insinto "$(python_get_sitedir)"/clang
217
			insinto "$(python_get_sitedir)"/clang
147
			doins Reporter.py Resources ScanView.py startfile.py
218
			doins Reporter.py Resources ScanView.py startfile.py
148
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
219
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
220
			make_versioned "$(python_get_sitedir)/clang"
149
		}
221
		}
150
		python_execute_function install-scan-view
222
		python_execute_function install-scan-view
151
	fi
223
	fi
152
224
225
	install_symlinks() {
226
		local dir=${ED%/}/${1#/}
227
		local category=$(basename "${dir}")
228
		local symlink_dir=${ED%/}/usr/$(get_libdir)/llvm-${SLOT}/${category}
229
		mkdir ${symlink_dir}
230
231
		local output
232
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
233
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
234
		done
235
	}
236
237
	# Expose clang binaries and includes to llvm-config
238
	install_symlinks /usr/bin/
239
	install_symlinks /usr/include/
240
153
	# Fix install_names on Darwin.  The build system is too complicated
241
	# Fix install_names on Darwin.  The build system is too complicated
154
	# to just fix this, so we correct it post-install
242
	# to just fix this, so we correct it post-install
155
	if [[ ${CHOST} == *-darwin* ]] ; then
243
	if [[ ${CHOST} == *-darwin* ]] ; then
Lines 175-181 src_install() { Link Here
175
}
263
}
176
264
177
pkg_postinst() {
265
pkg_postinst() {
178
	python_mod_optimize clang
266
	python_mod_optimize ${P}
267
268
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
269
		eselect ${PN} set ${SLOT}
270
	fi
271
179
	if use system-cxx-headers; then
272
	if use system-cxx-headers; then
180
		elog "C++ headers search path is hardcoded to the active gcc profile one"
273
		elog "C++ headers search path is hardcoded to the active gcc profile one"
181
		elog "If you change the active gcc profile, or update gcc to a new version,"
274
		elog "If you change the active gcc profile, or update gcc to a new version,"
Lines 187-192 pkg_postinst() { Link Here
187
	fi
280
	fi
188
}
281
}
189
282
283
pkg_prerm() {
284
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
285
		eselect ${PN} clear
286
	fi
287
}
288
190
pkg_postrm() {
289
pkg_postrm() {
191
	python_mod_cleanup clang
290
	python_mod_cleanup ${P}
291
292
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
293
		eselect ${PN} update
294
	fi
192
}
295
}
(-)a/sys-devel/clang/clang-3.0-r4.ebuild (-8 / +111 lines)
Lines 2-8 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/sys-devel/clang/clang-3.0-r4.ebuild,v 1.2 2013/01/03 23:36:58 voyageur Exp $
3
# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-3.0-r4.ebuild,v 1.2 2013/01/03 23:36:58 voyageur Exp $
4
4
5
EAPI=3
5
EAPI=5
6
6
7
RESTRICT_PYTHON_ABIS="3.*"
7
RESTRICT_PYTHON_ABIS="3.*"
8
SUPPORT_PYTHON_ABIS="1"
8
SUPPORT_PYTHON_ABIS="1"
Lines 16-32 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tar.gz Link Here
16
	http://llvm.org/releases/${PV}/${P}.tar.gz"
16
	http://llvm.org/releases/${PV}/${P}.tar.gz"
17
17
18
LICENSE="UoI-NCSA"
18
LICENSE="UoI-NCSA"
19
SLOT="0"
19
SLOT="${PV}"
20
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
20
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
21
IUSE="debug kernel_FreeBSD multitarget +static-analyzer system-cxx-headers test"
21
IUSE="debug kernel_FreeBSD multitarget +static-analyzer system-cxx-headers test"
22
22
23
DEPEND="static-analyzer? ( dev-lang/perl )"
23
DEPEND="static-analyzer? ( dev-lang/perl )"
24
RDEPEND="~sys-devel/llvm-${PV}[debug=,multitarget=]"
24
RDEPEND="sys-devel/llvm:${SLOT}=[debug=,multitarget=]
25
	app-admin/eselect-clang"
25
26
26
S=${WORKDIR}/llvm-${PV}.src
27
S=${WORKDIR}/llvm-${PV}.src
27
28
28
src_prepare() {
29
src_prepare() {
29
	mv "${WORKDIR}"/clang-${PV}.src "${S}"/tools/clang || die "clang source directory move failed"
30
	mv "${WORKDIR}"/${P}.src "${S}"/tools/clang || die "clang source directory move failed"
30
31
31
	# Same as llvm doc patches
32
	# Same as llvm doc patches
32
	epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch
33
	epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch
Lines 45-51 src_prepare() { Link Here
45
		-i tools/clang/tools/scan-build/scan-build \
46
		-i tools/clang/tools/scan-build/scan-build \
46
		|| die "scan-build sed failed"
47
		|| die "scan-build sed failed"
47
	# Set correct path for gold plugin
48
	# Set correct path for gold plugin
48
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \
49
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm-${SLOT}/#" \
49
		-i  tools/clang/lib/Driver/Tools.cpp \
50
		-i  tools/clang/lib/Driver/Tools.cpp \
50
		|| die "gold plugin path sed failed"
51
		|| die "gold plugin path sed failed"
51
	# Properly detect Gentoo's binutils-apple version (committed in trunk)
52
	# Properly detect Gentoo's binutils-apple version (committed in trunk)
Lines 62-68 src_prepare() { Link Here
62
		-i Makefile.config.in || die "Makefile.config sed failed"
63
		-i Makefile.config.in || die "Makefile.config sed failed"
63
64
64
	einfo "Fixing rpath and CFLAGS"
65
	einfo "Fixing rpath and CFLAGS"
65
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
66
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/llvm-${SLOT}'@" \
66
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
67
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
67
		-i Makefile.rules || die "rpath sed failed"
68
		-i Makefile.rules || die "rpath sed failed"
68
69
Lines 160-173 src_install() { Link Here
160
161
161
		cd tools/scan-view || die "cd scan-view failed"
162
		cd tools/scan-view || die "cd scan-view failed"
162
		dobin scan-view
163
		dobin scan-view
164
	fi
165
166
	# Register slot for app-admin/eselect-clang
167
	local eselect_dir="/usr/share/eselect-clang/slots/${SLOT}"
168
	dodir "${eselect_dir}"
169
	eselect_dir="${ED}/${eselect_dir}"
170
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
171
172
	with_slot_suffix() {
173
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
174
		local ext=""
175
		if [[ "${file}" =~ \. ]] ; then
176
			ext=".${file#*.}"
177
		fi
178
		local base="${file%%.*}"
179
		echo "${base}-${SLOT}${ext}"
180
	}
181
182
	make_versioned() {
183
		local dir=$1
184
		local candidates=(${ED%/}/${dir})
185
		if [[ ! ${dir##*/} ]] ; then
186
			dir=${dir%/}
187
			candidates=( "${candidates}"* )
188
		else
189
			dir=$(dirname "${dir}")
190
		fi
191
192
		pushd ${ED%/}/${dir} >/dev/null || die
193
194
		local candidate
195
		for candidate in "${candidates[@]}" ; do
196
			if [[ -h "${candidate}" ]] ; then
197
				# Add slot suffix to symlink target
198
				local target=$(readlink -s "${candidate}")
199
				local slotted_target=$(with_slot_suffix "${target}")
200
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
201
					ln -sf "${slotted_target}" "${candidate}" \
202
						|| die "Could not update symlink"
203
				fi
204
			fi
205
206
			local base_name=$(basename "${candidate}")
207
			local slotted_name=$(with_slot_suffix "${base_name}")
208
			mv "${candidate}" "${ED}/${dir}/${slotted_name}" \
209
				|| die "Could not rename ${candidate} to ${slotted_name}"
210
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
211
		done
212
213
		popd >/dev/null || die
214
	}
215
216
	# Trailing slash => version the content
217
	# No trailing slash => version the directory itself
218
	local paths=(
219
		/usr/bin/
220
		/usr/$(get_libdir)/llvm
221
		/usr/include/
222
		/usr/share/clang
223
		/usr/share/man/man1/
224
	)
225
226
	local path
227
	for path in "${paths[@]}" ; do
228
		make_versioned "${path}"
229
	done
230
231
	if use static-analyzer ; then
232
		cd "${S}"/tools/clang/tools/scan-view || die "cd scan-view failed"
233
163
		install-scan-view() {
234
		install-scan-view() {
164
			insinto "$(python_get_sitedir)"/clang
235
			insinto "$(python_get_sitedir)"/clang
165
			doins Reporter.py Resources ScanView.py startfile.py
236
			doins Reporter.py Resources ScanView.py startfile.py
166
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
237
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
238
			make_versioned "$(python_get_sitedir)/clang"
167
		}
239
		}
168
		python_execute_function install-scan-view
240
		python_execute_function install-scan-view
169
	fi
241
	fi
170
242
243
	install_symlinks() {
244
		local dir=${ED%/}/${1#/}
245
		local category=$(basename "${dir}")
246
		local symlink_dir=${ED%/}/usr/$(get_libdir)/llvm-${SLOT}/${category}
247
		mkdir ${symlink_dir}
248
249
		local output
250
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
251
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
252
		done
253
	}
254
255
	# Expose clang binaries and includes to llvm-config
256
	install_symlinks /usr/bin/
257
	install_symlinks /usr/include/
258
171
	# Fix install_names on Darwin.  The build system is too complicated
259
	# Fix install_names on Darwin.  The build system is too complicated
172
	# to just fix this, so we correct it post-install
260
	# to just fix this, so we correct it post-install
173
	if [[ ${CHOST} == *-darwin* ]] ; then
261
	if [[ ${CHOST} == *-darwin* ]] ; then
Lines 196-202 src_install() { Link Here
196
}
284
}
197
285
198
pkg_postinst() {
286
pkg_postinst() {
199
	python_mod_optimize clang
287
	python_mod_optimize ${P}
288
289
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
290
		eselect ${PN} set ${SLOT}
291
	fi
292
200
	if use system-cxx-headers; then
293
	if use system-cxx-headers; then
201
		elog "C++ headers search path is hardcoded to the active gcc profile one"
294
		elog "C++ headers search path is hardcoded to the active gcc profile one"
202
		elog "If you change the active gcc profile, or update gcc to a new version,"
295
		elog "If you change the active gcc profile, or update gcc to a new version,"
Lines 208-213 pkg_postinst() { Link Here
208
	fi
301
	fi
209
}
302
}
210
303
304
pkg_prerm() {
305
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
306
		eselect ${PN} clear
307
	fi
308
}
309
211
pkg_postrm() {
310
pkg_postrm() {
212
	python_mod_cleanup clang
311
	python_mod_cleanup ${P}
312
313
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
314
		eselect ${PN} update
315
	fi
213
}
316
}
(-)a/sys-devel/clang/clang-3.1-r5.ebuild (-8 / +108 lines)
Lines 2-8 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/sys-devel/clang/clang-3.1-r5.ebuild,v 1.4 2013/01/03 23:36:58 voyageur Exp $
3
# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-3.1-r5.ebuild,v 1.4 2013/01/03 23:36:58 voyageur Exp $
4
4
5
EAPI=4
5
EAPI=5
6
6
7
RESTRICT_PYTHON_ABIS="3.*"
7
RESTRICT_PYTHON_ABIS="3.*"
8
SUPPORT_PYTHON_ABIS="1"
8
SUPPORT_PYTHON_ABIS="1"
Lines 17-33 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz Link Here
17
	http://llvm.org/releases/${PV}/${P}.src.tar.gz"
17
	http://llvm.org/releases/${PV}/${P}.src.tar.gz"
18
18
19
LICENSE="UoI-NCSA"
19
LICENSE="UoI-NCSA"
20
SLOT="0"
20
SLOT="${PV}"
21
KEYWORDS="~amd64 ~arm ~x86 ~amd64-fbsd ~x64-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
21
KEYWORDS="~amd64 ~arm ~x86 ~amd64-fbsd ~x64-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
22
IUSE="debug kernel_FreeBSD multitarget +static-analyzer test"
22
IUSE="debug kernel_FreeBSD multitarget +static-analyzer test"
23
23
24
DEPEND="static-analyzer? ( dev-lang/perl )"
24
DEPEND="static-analyzer? ( dev-lang/perl )"
25
RDEPEND="~sys-devel/llvm-${PV}[debug=,multitarget=]"
25
RDEPEND="sys-devel/llvm:${SLOT}=[debug=,multitarget=]
26
	app-admin/eselect-clang"
26
27
27
S=${WORKDIR}/llvm-${PV}.src
28
S=${WORKDIR}/llvm-${PV}.src
28
29
29
src_prepare() {
30
src_prepare() {
30
	mv "${WORKDIR}"/clang-${PV}.src "${S}"/tools/clang \
31
	mv "${WORKDIR}"/${P}.src "${S}"/tools/clang \
31
		|| die "clang source directory move failed"
32
		|| die "clang source directory move failed"
32
	mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \
33
	mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \
33
		|| die "compiler-rt source directory move failed"
34
		|| die "compiler-rt source directory move failed"
Lines 50-56 src_prepare() { Link Here
50
		-i tools/clang/tools/scan-build/scan-build \
51
		-i tools/clang/tools/scan-build/scan-build \
51
		|| die "scan-build sed failed"
52
		|| die "scan-build sed failed"
52
	# Set correct path for gold plugin
53
	# Set correct path for gold plugin
53
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \
54
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm-${SLOT}/#" \
54
		-i  tools/clang/lib/Driver/Tools.cpp \
55
		-i  tools/clang/lib/Driver/Tools.cpp \
55
		|| die "gold plugin path sed failed"
56
		|| die "gold plugin path sed failed"
56
	# Specify python version
57
	# Specify python version
Lines 66-72 src_prepare() { Link Here
66
		-i Makefile.config.in || die "Makefile.config sed failed"
67
		-i Makefile.config.in || die "Makefile.config sed failed"
67
68
68
	einfo "Fixing rpath and CFLAGS"
69
	einfo "Fixing rpath and CFLAGS"
69
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
70
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/llvm-${SLOT}'@" \
70
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
71
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
71
		-i Makefile.rules || die "rpath sed failed"
72
		-i Makefile.rules || die "rpath sed failed"
72
73
Lines 160-173 src_install() { Link Here
160
161
161
		cd tools/scan-view || die "cd scan-view failed"
162
		cd tools/scan-view || die "cd scan-view failed"
162
		dobin scan-view
163
		dobin scan-view
164
	fi
165
166
	# Register slot for app-admin/eselect-clang
167
	local eselect_dir="/usr/share/eselect-clang/slots/${SLOT}"
168
	dodir "${eselect_dir}"
169
	eselect_dir="${ED}/${eselect_dir}"
170
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
171
172
	with_slot_suffix() {
173
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
174
		local ext=""
175
		if [[ "${file}" =~ \. ]] ; then
176
			ext=".${file#*.}"
177
		fi
178
		local base="${file%%.*}"
179
		echo "${base}-${SLOT}${ext}"
180
	}
181
182
	make_versioned() {
183
		local dir=$1
184
		local candidates=(${ED%/}/${dir})
185
		if [[ ! ${dir##*/} ]] ; then
186
			dir=${dir%/}
187
			candidates=( "${candidates}"* )
188
		else
189
			dir=$(dirname "${dir}")
190
		fi
191
192
		pushd ${ED%/}/${dir} >/dev/null || die
193
194
		local candidate
195
		for candidate in "${candidates[@]}" ; do
196
			if [[ -h "${candidate}" ]] ; then
197
				# Add slot suffix to symlink target
198
				local target=$(readlink -s "${candidate}")
199
				local slotted_target=$(with_slot_suffix "${target}")
200
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
201
					ln -sf "${slotted_target}" "${candidate}" \
202
						|| die "Could not update symlink"
203
				fi
204
			fi
205
206
			local base_name=$(basename "${candidate}")
207
			local slotted_name=$(with_slot_suffix "${base_name}")
208
			mv "${candidate}" "${ED}/${dir}/${slotted_name}" \
209
				|| die "Could not rename ${candidate} to ${slotted_name}"
210
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
211
		done
212
213
		popd >/dev/null || die
214
	}
215
216
	# Trailing slash => version the content
217
	# No trailing slash => version the directory itself
218
	local paths=(
219
		/usr/bin/
220
		/usr/$(get_libdir)/llvm
221
		/usr/include/
222
		/usr/share/clang
223
		/usr/share/man/man1/
224
	)
225
226
	local path
227
	for path in "${paths[@]}" ; do
228
		make_versioned "${path}"
229
	done
230
231
	if use static-analyzer ; then
232
		cd "${S}"/tools/clang/tools/scan-view || die "cd scan-view failed"
233
163
		install-scan-view() {
234
		install-scan-view() {
164
			insinto "$(python_get_sitedir)"/clang
235
			insinto "$(python_get_sitedir)"/clang
165
			doins Reporter.py Resources ScanView.py startfile.py
236
			doins Reporter.py Resources ScanView.py startfile.py
166
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
237
			touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py
238
			make_versioned "$(python_get_sitedir)/clang"
167
		}
239
		}
168
		python_execute_function install-scan-view
240
		python_execute_function install-scan-view
169
	fi
241
	fi
170
242
243
	install_symlinks() {
244
		local dir=${ED%/}/${1#/}
245
		local category=$(basename "${dir}")
246
		local symlink_dir=${ED%/}/usr/$(get_libdir)/llvm-${SLOT}/${category}
247
		mkdir ${symlink_dir}
248
249
		local output
250
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
251
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
252
		done
253
	}
254
255
	# Expose clang binaries and includes to llvm-config
256
	install_symlinks /usr/bin/
257
	install_symlinks /usr/include/
258
171
	# Fix install_names on Darwin.  The build system is too complicated
259
	# Fix install_names on Darwin.  The build system is too complicated
172
	# to just fix this, so we correct it post-install
260
	# to just fix this, so we correct it post-install
173
	if [[ ${CHOST} == *-darwin* ]] ; then
261
	if [[ ${CHOST} == *-darwin* ]] ; then
Lines 196-204 src_install() { Link Here
196
}
284
}
197
285
198
pkg_postinst() {
286
pkg_postinst() {
199
	python_mod_optimize clang
287
	python_mod_optimize ${P}
288
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
289
		eselect ${PN} set ${SLOT}
290
	fi
291
}
292
293
pkg_prerm() {
294
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
295
		eselect ${PN} clear
296
	fi
200
}
297
}
201
298
202
pkg_postrm() {
299
pkg_postrm() {
203
	python_mod_cleanup clang
300
	python_mod_cleanup ${P}
301
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
302
		eselect ${PN} update
303
	fi
204
}
304
}
(-)a/sys-devel/clang/clang-3.2.ebuild (-6 / +119 lines)
Lines 16-28 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz Link Here
16
	http://llvm.org/releases/${PV}/${P}.src.tar.gz"
16
	http://llvm.org/releases/${PV}/${P}.src.tar.gz"
17
17
18
LICENSE="UoI-NCSA"
18
LICENSE="UoI-NCSA"
19
SLOT="0"
19
SLOT="${PV}"
20
KEYWORDS="~amd64 ~arm ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
20
KEYWORDS="~amd64 ~arm ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
21
IUSE="debug kernel_FreeBSD multitarget python +static-analyzer test"
21
IUSE="debug kernel_FreeBSD multitarget python +static-analyzer test"
22
22
23
DEPEND="static-analyzer? ( dev-lang/perl )
23
DEPEND="static-analyzer? ( dev-lang/perl )
24
	${PYTHON_DEPS}"
24
	${PYTHON_DEPS}"
25
RDEPEND="~sys-devel/llvm-${PV}[debug=,multitarget=]
25
RDEPEND="sys-devel/llvm:${SLOT}=[debug=,multitarget=]
26
	app-admin/eselect-clang
26
	${PYTHON_DEPS}"
27
	${PYTHON_DEPS}"
27
28
28
S=${WORKDIR}/llvm-${PV}.src
29
S=${WORKDIR}/llvm-${PV}.src
Lines 53-59 src_prepare() { Link Here
53
		-i tools/clang/tools/scan-build/scan-build \
54
		-i tools/clang/tools/scan-build/scan-build \
54
		|| die "scan-build sed failed"
55
		|| die "scan-build sed failed"
55
	# Set correct path for gold plugin
56
	# Set correct path for gold plugin
56
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \
57
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm-${SLOT}/#" \
57
		-i  tools/clang/lib/Driver/Tools.cpp \
58
		-i  tools/clang/lib/Driver/Tools.cpp \
58
		|| die "gold plugin path sed failed"
59
		|| die "gold plugin path sed failed"
59
60
Lines 65-71 src_prepare() { Link Here
65
		-i Makefile.config.in || die "Makefile.config sed failed"
66
		-i Makefile.config.in || die "Makefile.config sed failed"
66
67
67
	einfo "Fixing rpath and CFLAGS"
68
	einfo "Fixing rpath and CFLAGS"
68
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
69
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/llvm-${SLOT}'@" \
69
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
70
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
70
		-i Makefile.rules || die "rpath sed failed"
71
		-i Makefile.rules || die "rpath sed failed"
71
72
Lines 147-157 src_install() { Link Here
147
		doins tools/scan-build/sorttable.js
148
		doins tools/scan-build/sorttable.js
148
	fi
149
	fi
149
150
151
	# Register slot for app-admin/eselect-clang
152
	local eselect_dir="/usr/share/eselect-clang/slots/${SLOT}"
153
	dodir "${eselect_dir}"
154
	eselect_dir="${ED}/${eselect_dir}"
155
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
156
157
	with_slot_suffix() {
158
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
159
		local ext=""
160
		if [[ "${file}" =~ \. ]] ; then
161
			ext=".${file#*.}"
162
		fi
163
		local base="${file%%.*}"
164
		echo "${base}-${SLOT}${ext}"
165
	}
166
167
	make_versioned() {
168
		local dir=$1
169
		local candidates=(${ED%/}/${dir})
170
		if [[ ! ${dir##*/} ]] ; then
171
			dir=${dir%/}
172
			candidates=( "${candidates}"* )
173
		else
174
			dir=$(dirname "${dir}")
175
		fi
176
177
		pushd ${ED%/}/${dir} >/dev/null || die
178
179
		local candidate
180
		for candidate in "${candidates[@]}" ; do
181
			if [[ -h "${candidate}" ]] ; then
182
				# Add slot suffix to symlink target
183
				local target=$(readlink -s "${candidate}")
184
				local slotted_target=$(with_slot_suffix "${target}")
185
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
186
					ln -sf "${slotted_target}" "${candidate}" \
187
						|| die "Could not update symlink"
188
				fi
189
			fi
190
191
			local base_name=$(basename "${candidate}")
192
			local slotted_name=$(with_slot_suffix "${base_name}")
193
			mv "${candidate}" "${ED}/${dir}/${slotted_name}" \
194
				|| die "Could not rename ${candidate} to ${slotted_name}"
195
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
196
		done
197
198
		popd >/dev/null || die
199
	}
200
201
	# Trailing slash => version the content
202
	# No trailing slash => version the directory itself
203
	local paths=(
204
		/usr/bin/
205
		/usr/$(get_libdir)/llvm
206
		/usr/include/
207
		/usr/share/clang
208
		/usr/share/man/man1/
209
	)
210
211
	local path
212
	for path in "${paths[@]}" ; do
213
		make_versioned "${path}"
214
	done
215
216
	python_doscript_versioned() {
217
		local path="$1"
218
		local file=$(basename "${path}")
219
220
		python_newscript "${path}" $(with_slot_suffix "${file}")
221
222
		local scriptroot=${python_scriptroot:-${DESTTREE%/}/bin}
223
		echo "${scriptroot%/}/${file}" >> "${eselect_dir}/versioned"
224
	}
225
150
	python_inst() {
226
	python_inst() {
151
		if use static-analyzer ; then
227
		if use static-analyzer ; then
152
			pushd tools/scan-view >/dev/null || die
228
			pushd tools/scan-view >/dev/null || die
153
229
154
			python_doscript scan-view
230
			python_doscript_versioned scan-view
155
231
156
			touch __init__.py || die
232
			touch __init__.py || die
157
			python_moduleinto clang
233
			python_moduleinto clang
Lines 169-179 src_install() { Link Here
169
			popd >/dev/null || die
245
			popd >/dev/null || die
170
		fi
246
		fi
171
247
248
		use static-analyzer || use python && \
249
			make_versioned "$(python_get_sitedir)/clang"
250
172
		# AddressSanitizer symbolizer (currently separate)
251
		# AddressSanitizer symbolizer (currently separate)
173
		python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
252
		python_doscript_versioned "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
174
	}
253
	}
175
	python_foreach_impl python_inst
254
	python_foreach_impl python_inst
176
255
256
	install_symlinks() {
257
		local dir=${ED%/}/${1#/}
258
		local category=$(basename "${dir}")
259
		local symlink_dir=${ED%/}/usr/$(get_libdir)/llvm-${SLOT}/${category}
260
		mkdir ${symlink_dir}
261
262
		local output
263
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
264
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
265
		done
266
	}
267
268
	# Expose clang binaries and includes to llvm-config
269
	install_symlinks /usr/bin/
270
	install_symlinks /usr/include/
271
177
	# Fix install_names on Darwin.  The build system is too complicated
272
	# Fix install_names on Darwin.  The build system is too complicated
178
	# to just fix this, so we correct it post-install
273
	# to just fix this, so we correct it post-install
179
	if [[ ${CHOST} == *-darwin* ]] ; then
274
	if [[ ${CHOST} == *-darwin* ]] ; then
Lines 200-202 src_install() { Link Here
200
	# Remove unnecessary headers on FreeBSD, bug #417171
295
	# Remove unnecessary headers on FreeBSD, bug #417171
201
	use kernel_FreeBSD && rm "${ED}"usr/$(get_libdir)/clang/${PV}/include/{arm_neon,std,float,iso,limits,tgmath,varargs}*.h
296
	use kernel_FreeBSD && rm "${ED}"usr/$(get_libdir)/clang/${PV}/include/{arm_neon,std,float,iso,limits,tgmath,varargs}*.h
202
}
297
}
298
299
pkg_postinst() {
300
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
301
		eselect ${PN} set ${SLOT}
302
	fi
303
}
304
305
pkg_prerm() {
306
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
307
		eselect ${PN} clear
308
	fi
309
}
310
311
pkg_postrm() {
312
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
313
		eselect ${PN} update
314
	fi
315
}
(-)a/sys-devel/clang/clang-3.3.ebuild (-8 / +121 lines)
Lines 16-28 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz Link Here
16
	http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.gz"
16
	http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.gz"
17
17
18
LICENSE="UoI-NCSA"
18
LICENSE="UoI-NCSA"
19
SLOT="0"
19
SLOT="${PV}"
20
KEYWORDS="~amd64 ~arm ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
20
KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
21
IUSE="debug kernel_FreeBSD multitarget python +static-analyzer test"
21
IUSE="debug kernel_FreeBSD multitarget python +static-analyzer test"
22
22
23
DEPEND="static-analyzer? ( dev-lang/perl )
23
DEPEND="static-analyzer? ( dev-lang/perl )
24
	${PYTHON_DEPS}"
24
	${PYTHON_DEPS}"
25
RDEPEND="~sys-devel/llvm-${PV}[debug=,multitarget=]
25
RDEPEND="sys-devel/llvm:${SLOT}=[debug=,multitarget=]
26
	app-admin/eselect-clang
26
	${PYTHON_DEPS}"
27
	${PYTHON_DEPS}"
27
28
28
S=${WORKDIR}/llvm-${PV}.src
29
S=${WORKDIR}/llvm-${PV}.src
Lines 56-63 src_prepare() { Link Here
56
		-i tools/clang/tools/scan-build/scan-build \
57
		-i tools/clang/tools/scan-build/scan-build \
57
		|| die "scan-build sed failed"
58
		|| die "scan-build sed failed"
58
	# Set correct path for gold plugin and coverage lib
59
	# Set correct path for gold plugin and coverage lib
59
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \
60
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm-${SLOT}/#" \
60
		-e "s#lib\(/libprofile_rt.a\)#$(get_libdir)/llvm\1#" \
61
		-e "s#lib\(/libprofile_rt.a\)#$(get_libdir)/llvm-${SLOT}\1#" \
61
		-i  tools/clang/lib/Driver/Tools.cpp \
62
		-i  tools/clang/lib/Driver/Tools.cpp \
62
		|| die "Tools.cpp paths sed failed"
63
		|| die "Tools.cpp paths sed failed"
63
64
Lines 69-75 src_prepare() { Link Here
69
		-i Makefile.config.in || die "Makefile.config sed failed"
70
		-i Makefile.config.in || die "Makefile.config sed failed"
70
71
71
	einfo "Fixing rpath and CFLAGS"
72
	einfo "Fixing rpath and CFLAGS"
72
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
73
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/llvm-${SLOT}'@" \
73
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
74
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
74
		-i Makefile.rules || die "rpath sed failed"
75
		-i Makefile.rules || die "rpath sed failed"
75
76
Lines 154-164 src_install() { Link Here
154
		doins tools/scan-build/sorttable.js
155
		doins tools/scan-build/sorttable.js
155
	fi
156
	fi
156
157
158
	# Register slot for app-admin/eselect-clang
159
	local eselect_dir="/usr/share/eselect-clang/slots/${SLOT}"
160
	dodir "${eselect_dir}"
161
	eselect_dir="${ED}/${eselect_dir}"
162
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
163
164
	with_slot_suffix() {
165
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
166
		local ext=""
167
		if [[ "${file}" =~ \. ]] ; then
168
			ext=".${file#*.}"
169
		fi
170
		local base="${file%%.*}"
171
		echo "${base}-${SLOT}${ext}"
172
	}
173
174
	make_versioned() {
175
		local dir=$1
176
		local candidates=(${ED%/}/${dir})
177
		if [[ ! ${dir##*/} ]] ; then
178
			dir=${dir%/}
179
			candidates=( "${candidates}"* )
180
		else
181
			dir=$(dirname "${dir}")
182
		fi
183
184
		pushd ${ED%/}/${dir} >/dev/null || die
185
186
		local candidate
187
		for candidate in "${candidates[@]}" ; do
188
			if [[ -h "${candidate}" ]] ; then
189
				# Add slot suffix to symlink target
190
				local target=$(readlink -s "${candidate}")
191
				local slotted_target=$(with_slot_suffix "${target}")
192
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
193
					ln -sf "${slotted_target}" "${candidate}" \
194
						|| die "Could not update symlink"
195
				fi
196
			fi
197
198
			local base_name=$(basename "${candidate}")
199
			local slotted_name=$(with_slot_suffix "${base_name}")
200
			mv "${candidate}" "${ED}/${dir}/${slotted_name}" \
201
				|| die "Could not rename ${candidate} to ${slotted_name}"
202
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
203
		done
204
205
		popd >/dev/null || die
206
	}
207
208
	# Trailing slash => version the content
209
	# No trailing slash => version the directory itself
210
	local paths=(
211
		/usr/bin/
212
		/usr/$(get_libdir)/llvm
213
		/usr/include/
214
		/usr/share/clang
215
		/usr/share/man/man1/
216
	)
217
218
	local path
219
	for path in "${paths[@]}" ; do
220
		make_versioned "${path}"
221
	done
222
223
	python_doscript_versioned() {
224
		local path="$1"
225
		local file=$(basename "${path}")
226
227
		python_newscript "${path}" $(with_slot_suffix "${file}")
228
229
		local scriptroot=${python_scriptroot:-${DESTTREE%/}/bin}
230
		echo "${scriptroot%/}/${file}" >> "${eselect_dir}/versioned"
231
	}
232
157
	python_inst() {
233
	python_inst() {
158
		if use static-analyzer ; then
234
		if use static-analyzer ; then
159
			pushd tools/scan-view >/dev/null || die
235
			pushd tools/scan-view >/dev/null || die
160
236
161
			python_doscript scan-view
237
			python_doscript_versioned scan-view
162
238
163
			touch __init__.py || die
239
			touch __init__.py || die
164
			python_moduleinto clang
240
			python_moduleinto clang
Lines 176-186 src_install() { Link Here
176
			popd >/dev/null || die
252
			popd >/dev/null || die
177
		fi
253
		fi
178
254
255
		use static-analyzer || use python && \
256
			make_versioned "$(python_get_sitedir)/clang"
257
179
		# AddressSanitizer symbolizer (currently separate)
258
		# AddressSanitizer symbolizer (currently separate)
180
		python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
259
		python_doscript_versioned "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
181
	}
260
	}
182
	python_foreach_impl python_inst
261
	python_foreach_impl python_inst
183
262
263
	install_symlinks() {
264
		local dir=${ED%/}/${1#/}
265
		local category=$(basename "${dir}")
266
		local symlink_dir=${ED%/}/usr/$(get_libdir)/llvm-${SLOT}/${category}
267
		mkdir ${symlink_dir}
268
269
		local output
270
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
271
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
272
		done
273
	}
274
275
	# Expose clang binaries and includes to llvm-config
276
	install_symlinks /usr/bin/
277
	install_symlinks /usr/include/
278
184
	# Fix install_names on Darwin.  The build system is too complicated
279
	# Fix install_names on Darwin.  The build system is too complicated
185
	# to just fix this, so we correct it post-install
280
	# to just fix this, so we correct it post-install
186
	if [[ ${CHOST} == *-darwin* ]] ; then
281
	if [[ ${CHOST} == *-darwin* ]] ; then
Lines 207-209 src_install() { Link Here
207
	# Remove unnecessary headers on FreeBSD, bug #417171
302
	# Remove unnecessary headers on FreeBSD, bug #417171
208
	use kernel_FreeBSD && rm "${ED}"usr/$(get_libdir)/clang/${PV}/include/{arm_neon,std,float,iso,limits,tgmath,varargs}*.h
303
	use kernel_FreeBSD && rm "${ED}"usr/$(get_libdir)/clang/${PV}/include/{arm_neon,std,float,iso,limits,tgmath,varargs}*.h
209
}
304
}
305
306
pkg_postinst() {
307
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
308
		eselect ${PN} set ${SLOT}
309
	fi
310
}
311
312
pkg_prerm() {
313
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
314
		eselect ${PN} clear
315
	fi
316
}
317
318
pkg_postrm() {
319
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
320
		eselect ${PN} update
321
	fi
322
}
(-)a/sys-devel/clang/clang-9999.ebuild (-15 / +142 lines)
Lines 14-26 SRC_URI="" Link Here
14
ESVN_REPO_URI="http://llvm.org/svn/llvm-project/cfe/trunk"
14
ESVN_REPO_URI="http://llvm.org/svn/llvm-project/cfe/trunk"
15
15
16
LICENSE="UoI-NCSA"
16
LICENSE="UoI-NCSA"
17
SLOT="0"
17
SLOT="${PV}"
18
KEYWORDS=""
18
KEYWORDS=""
19
IUSE="debug multitarget python +static-analyzer test"
19
IUSE="debug multitarget python +static-analyzer test"
20
20
21
DEPEND="static-analyzer? ( dev-lang/perl )
21
DEPEND="static-analyzer? ( dev-lang/perl )
22
	${PYTHON_DEPS}"
22
	${PYTHON_DEPS}"
23
RDEPEND="~sys-devel/llvm-${PV}[debug=,multitarget=]
23
RDEPEND="sys-devel/llvm:${SLOT}=[debug=,multitarget=]
24
	app-admin/eselect-clang
24
	${PYTHON_DEPS}"
25
	${PYTHON_DEPS}"
25
26
26
S="${WORKDIR}/llvm"
27
S="${WORKDIR}/llvm"
Lines 54-63 src_prepare() { Link Here
54
		-i tools/clang/tools/scan-build/scan-build \
55
		-i tools/clang/tools/scan-build/scan-build \
55
		|| die "scan-build sed failed"
56
		|| die "scan-build sed failed"
56
	# Set correct path for gold plugin and coverage lib
57
	# Set correct path for gold plugin and coverage lib
57
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \
58
	sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm-${SLOT}/#" \
58
		-e "s#lib\(/libprofile_rt.a\)#$(get_libdir)/llvm\1#" \
59
		-e "s#lib\(/libprofile_rt.a\)#$(get_libdir)/llvm-${SLOT}\1#" \
59
		-i  tools/clang/lib/Driver/Tools.cpp \
60
		-i  tools/clang/lib/Driver/Tools.cpp \
60
		|| die "driver tools paths sed failed"
61
		|| die "driver tools paths sed failed"
62
	# Add slot suffix for the live ebuild
63
	sed -e "/LLVM_VERSION =/s/\('[0-9.]*\)svn'$/\1-${SLOT}'/" \
64
		-i bindings/python/llvm/common.py || die "python bindings version sed failed"
65
	sed -e "/PACKAGE_VERSION=/s/\('[0-9.]*\)svn'$/\1-${SLOT}'/" \
66
		-i configure || die "configure version sed faile"
67
	sed -e "/#define CLANG_MAKE_VERSION_STRING2/s/#X/#X \"-${SLOT}\"/" \
68
		-i tools/clang/include/clang/Basic/Version.h \
69
		|| die "Version sed #1 failed"
70
	sed -e "/@CLANG_VERSION@/s/#g/-${SLOT}#g/" \
71
		-e "/subst rc/aCLANG_VERSION := \$(subst -${SLOT},,\$(CLANG_VERSION))" \
72
		-i tools/clang/include/clang/Basic/Makefile \
73
		|| die "Version sed #2 failed"
61
74
62
	# From llvm src_prepare
75
	# From llvm src_prepare
63
	einfo "Fixing install dirs"
76
	einfo "Fixing install dirs"
Lines 67-73 src_prepare() { Link Here
67
		-i Makefile.config.in || die "Makefile.config sed failed"
80
		-i Makefile.config.in || die "Makefile.config sed failed"
68
81
69
	einfo "Fixing rpath and CFLAGS"
82
	einfo "Fixing rpath and CFLAGS"
70
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \
83
	sed -e "s@\$(RPATH) -Wl,'\$\$ORIGIN/../lib'@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/llvm-${SLOT}'@" \
71
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
84
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
72
		-i Makefile.rules || die "rpath sed failed"
85
		-i Makefile.rules || die "rpath sed failed"
73
86
Lines 80-92 src_prepare() { Link Here
80
}
93
}
81
94
82
src_configure() {
95
src_configure() {
83
	# Update resource dir version after first RC
96
	local LLVM_VERSION=`sed -n "s/PACKAGE_VERSION='\([0-9.]*-${SLOT}\)'$/\1/p" configure`
97
	[[ -n "${LLVM_VERSION}" ]] || die "Could not extract LLVM version"
98
84
	local CONF_FLAGS="--enable-shared
99
	local CONF_FLAGS="--enable-shared
85
		--with-optimize-option=
100
		--with-optimize-option=
86
		$(use_enable !debug optimized)
101
		$(use_enable !debug optimized)
87
		$(use_enable debug assertions)
102
		$(use_enable debug assertions)
88
		$(use_enable debug expensive-checks)
103
		$(use_enable debug expensive-checks)
89
		--with-clang-resource-dir=../$(get_libdir)/clang/3.4"
104
		--with-clang-resource-dir=../$(get_libdir)/clang/${LLVM_VERSION}"
90
105
91
	# Setup the search path to include the Prefix includes
106
	# Setup the search path to include the Prefix includes
92
	if use prefix ; then
107
	if use prefix ; then
Lines 141-151 src_install() { Link Here
141
		doins tools/scan-build/sorttable.js
156
		doins tools/scan-build/sorttable.js
142
	fi
157
	fi
143
158
159
	# Register slot for app-admin/eselect-clang
160
	local eselect_dir="/usr/share/eselect-clang/slots/${SLOT}"
161
	dodir "${eselect_dir}"
162
	eselect_dir="${ED}/${eselect_dir}"
163
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
164
165
	with_slot_suffix() {
166
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
167
		local ext=""
168
		if [[ "${file}" =~ \. ]] ; then
169
			ext=".${file#*.}"
170
		fi
171
		local base="${file%%.*}"
172
		echo "${base}-${SLOT}${ext}"
173
	}
174
175
	make_versioned() {
176
		local dir=$1
177
		local candidates=(${ED%/}/${dir})
178
		if [[ ! ${dir##*/} ]] ; then
179
			dir=${dir%/}
180
			candidates=( "${candidates}"* )
181
		else
182
			dir=$(dirname "${dir}")
183
		fi
184
185
		pushd ${ED%/}/${dir} >/dev/null || die
186
187
		local candidate
188
		for candidate in "${candidates[@]}" ; do
189
			if [[ -h "${candidate}" ]] ; then
190
				# Add slot suffix to symlink target
191
				local target=$(readlink -s "${candidate}")
192
				local slotted_target=$(with_slot_suffix "${target}")
193
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
194
					ln -sf "${slotted_target}" "${candidate}" \
195
						|| die "Could not update symlink"
196
				fi
197
			fi
198
199
			local base_name=$(basename "${candidate}")
200
			local slotted_name=$(with_slot_suffix "${base_name}")
201
			mv "${candidate}" "${ED}/${dir}/${slotted_name}" \
202
				|| die "Could not rename ${candidate} to ${slotted_name}"
203
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
204
		done
205
206
		popd >/dev/null || die
207
	}
208
209
	# Trailing slash => version the content
210
	# No trailing slash => version the directory itself
211
	local paths=(
212
		/usr/bin/
213
		/usr/$(get_libdir)/llvm
214
		/usr/include/
215
		/usr/share/clang
216
		/usr/share/man/man1/
217
	)
218
219
	local path
220
	for path in "${paths[@]}" ; do
221
		make_versioned "${path}"
222
	done
223
224
	python_doscript_versioned() {
225
		local path="$1"
226
		local file=$(basename "${path}")
227
228
		python_newscript "${path}" $(with_slot_suffix "${file}")
229
230
		local scriptroot=${python_scriptroot:-${DESTTREE%/}/bin}
231
		echo "${scriptroot%/}/${file}" >> "${eselect_dir}/versioned"
232
	}
233
144
	python_inst() {
234
	python_inst() {
145
		if use static-analyzer ; then
235
		if use static-analyzer ; then
146
			pushd tools/scan-view >/dev/null || die
236
			pushd tools/scan-view >/dev/null || die
147
237
148
			python_doscript scan-view
238
			python_doscript_versioned scan-view
149
239
150
			touch __init__.py || die
240
			touch __init__.py || die
151
			python_moduleinto clang
241
			python_moduleinto clang
Lines 163-193 src_install() { Link Here
163
			popd >/dev/null || die
253
			popd >/dev/null || die
164
		fi
254
		fi
165
255
256
		use static-analyzer || use python && \
257
			make_versioned "$(python_get_sitedir)/clang"
258
166
		# AddressSanitizer symbolizer (currently separate)
259
		# AddressSanitizer symbolizer (currently separate)
167
		python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
260
		python_doscript_versioned "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
168
	}
261
	}
169
	python_foreach_impl python_inst
262
	python_foreach_impl python_inst
170
263
264
	install_symlinks() {
265
		local dir=${ED%/}/${1#/}
266
		local category=$(basename "${dir}")
267
		local symlink_dir=${ED%/}/usr/$(get_libdir)/llvm-${SLOT}/${category}
268
		mkdir ${symlink_dir}
269
270
		local output
271
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
272
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
273
		done
274
	}
275
276
	# Expose clang binaries and includes to llvm-config
277
	install_symlinks /usr/bin/
278
	install_symlinks /usr/include/
279
171
	# Fix install_names on Darwin.  The build system is too complicated
280
	# Fix install_names on Darwin.  The build system is too complicated
172
	# to just fix this, so we correct it post-install
281
	# to just fix this, so we correct it post-install
173
	if [[ ${CHOST} == *-darwin* ]] ; then
282
	if [[ ${CHOST} == *-darwin* ]] ; then
174
		for lib in libclang.dylib ; do
283
		for lib in libclang.dylib ; do
175
			ebegin "fixing install_name of $lib"
284
			ebegin "fixing install_name of $lib"
176
			install_name_tool -id "${EPREFIX}"/usr/lib/llvm/${lib} \
285
			install_name_tool -id "${EPREFIX}"/usr/lib/llvm-${SLOT}/${lib} \
177
				"${ED}"/usr/lib/llvm/${lib}
286
				"${ED}"/usr/lib/llvm-${SLOT}/${lib}
178
			eend $?
287
			eend $?
179
		done
288
		done
180
		for f in usr/bin/{c-index-test,clang} usr/lib/llvm/libclang.dylib ; do
289
		for f in usr/bin/{c-index-test,clang} usr/lib/llvm-${SLOT}/libclang.dylib ; do
181
			ebegin "fixing references in ${f##*/}"
290
			ebegin "fixing references in ${f##*/}"
182
			install_name_tool \
291
			install_name_tool \
183
				-change "@rpath/libclang.dylib" \
292
				-change "@rpath/libclang.dylib" \
184
					"${EPREFIX}"/usr/lib/llvm/libclang.dylib \
293
					"${EPREFIX}"/usr/lib/llvm-${SLOT}/libclang.dylib \
185
				-change "@executable_path/../lib/libLLVM-${PV}.dylib" \
294
				-change "@executable_path/../lib/libLLVM-${PV}.dylib" \
186
					"${EPREFIX}"/usr/lib/llvm/libLLVM-${PV}.dylib \
295
					"${EPREFIX}"/usr/lib/llvm-${SLOT}/libLLVM-${PV}.dylib \
187
				-change "${S}"/Release/lib/libclang.dylib \
296
				-change "${S}"/Release/lib/libclang.dylib \
188
					"${EPREFIX}"/usr/lib/llvm/libclang.dylib \
297
					"${EPREFIX}"/usr/lib/llvm-${SLOT}/libclang.dylib \
189
				"${ED}"/$f
298
				"${ED}"/$f
190
			eend $?
299
			eend $?
191
		done
300
		done
192
	fi
301
	fi
193
}
302
}
303
304
pkg_postinst() {
305
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
306
		eselect ${PN} set ${SLOT}
307
	fi
308
}
309
310
pkg_prerm() {
311
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
312
		eselect ${PN} clear
313
	fi
314
}
315
316
pkg_postrm() {
317
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
318
		eselect ${PN} update
319
	fi
320
}
(-)a/sys-devel/llvm/Manifest (-17 / +7 lines)
Lines 1-6 Link Here
1
-----BEGIN PGP SIGNED MESSAGE-----
2
Hash: SHA256
3
4
AUX cl-patches/0001-r600-Add-some-intrinsic-definitions.patch 2450 SHA256 b0a718800c8969e174f3a22e61c15a370376f477e031fe97fff6aaab152f9867 SHA512 d23f9645d3e3364b1e9ce522eb15022fd3f2a685741db88b117b409ee33a07344a8e9ba9d89dc3535e5289edf79c6beb7ff144659f4e725b1a8f2c4256f9aad0 WHIRLPOOL c549806dbe5309dc441b65c942de488c6afc8c511d060d5c1459a4f99b97a357acbec51ce51bd704e5e1e74437cd413755f15377ad6b96c235242bc370af096f
1
AUX cl-patches/0001-r600-Add-some-intrinsic-definitions.patch 2450 SHA256 b0a718800c8969e174f3a22e61c15a370376f477e031fe97fff6aaab152f9867 SHA512 d23f9645d3e3364b1e9ce522eb15022fd3f2a685741db88b117b409ee33a07344a8e9ba9d89dc3535e5289edf79c6beb7ff144659f4e725b1a8f2c4256f9aad0 WHIRLPOOL c549806dbe5309dc441b65c942de488c6afc8c511d060d5c1459a4f99b97a357acbec51ce51bd704e5e1e74437cd413755f15377ad6b96c235242bc370af096f
5
AUX cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch 1189 SHA256 172bbb3cb1214e61ee2684c133317bb997e94a34c91dae94d4848cbd0c216436 SHA512 cf711149c421b4258bc64b81018d0a9474d8b4e4128d0cc0cea788b54c93e9512397b2310db8a1834c3507b4d893d5743dbc53183ac0daca23da55601b976c16 WHIRLPOOL 8e6bd9f005a6a941c55d7c8d9b127826191944fab9e404f8ed958efd07017f5f9301273739f869a73f15fc2a79af9dc18687ff85403acf24e175a464838b3f2e
2
AUX cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch 1189 SHA256 172bbb3cb1214e61ee2684c133317bb997e94a34c91dae94d4848cbd0c216436 SHA512 cf711149c421b4258bc64b81018d0a9474d8b4e4128d0cc0cea788b54c93e9512397b2310db8a1834c3507b4d893d5743dbc53183ac0daca23da55601b976c16 WHIRLPOOL 8e6bd9f005a6a941c55d7c8d9b127826191944fab9e404f8ed958efd07017f5f9301273739f869a73f15fc2a79af9dc18687ff85403acf24e175a464838b3f2e
6
AUX llvm-2.6-commandguide-nops.patch 975 SHA256 0e36fb43e020fa380230a8c6f2a79b9a19e12e857e833ef856e2b41aaa283649 SHA512 6842285e499b86581ca12fd94f5335e0dcd7afcaf0cdc5042ee8d84d0da6aba6659652eb639027bcad7caf77b0c994ac7e181a15bc609c4b3882e0f391c8cd33 WHIRLPOOL bf1212a8fd06214dba0916a73266842558bed740220d68e3447701ffeba1b3020ca4b4ab5c6d57772a60a6e09f153232f680b1e0b11cbd5d430bd9ef693d2926
3
AUX llvm-2.6-commandguide-nops.patch 975 SHA256 0e36fb43e020fa380230a8c6f2a79b9a19e12e857e833ef856e2b41aaa283649 SHA512 6842285e499b86581ca12fd94f5335e0dcd7afcaf0cdc5042ee8d84d0da6aba6659652eb639027bcad7caf77b0c994ac7e181a15bc609c4b3882e0f391c8cd33 WHIRLPOOL bf1212a8fd06214dba0916a73266842558bed740220d68e3447701ffeba1b3020ca4b4ab5c6d57772a60a6e09f153232f680b1e0b11cbd5d430bd9ef693d2926
Lines 28-46 DIST llvm-3.2-manpages.tar.bz2 25962 SHA256 159eaaaf59a2cee66f6aa0bbc93ca4c9fa37 Link Here
28
DIST llvm-3.2.src.tar.gz 12275252 SHA256 125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343 SHA512 cc66171322dbbe40bcac0e0ea5b09df8ff52df63ded304f841f32f702270d6ab1512216413ee52498c3ebee8cd39c4cd23e3855d591944bc2ac0ae76f5be62cc WHIRLPOOL c3a39b2426293d0251b7769607ade873bb6bf8d54e7c8055773a9b75742bc8e39049fb71409a258c6f3d98775b78c280d4bfe4223ba91e5ed6ecae0eddf910e5
25
DIST llvm-3.2.src.tar.gz 12275252 SHA256 125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343 SHA512 cc66171322dbbe40bcac0e0ea5b09df8ff52df63ded304f841f32f702270d6ab1512216413ee52498c3ebee8cd39c4cd23e3855d591944bc2ac0ae76f5be62cc WHIRLPOOL c3a39b2426293d0251b7769607ade873bb6bf8d54e7c8055773a9b75742bc8e39049fb71409a258c6f3d98775b78c280d4bfe4223ba91e5ed6ecae0eddf910e5
29
DIST llvm-3.3-manpages.tar.bz2 27098 SHA256 46bb22d63d5fe7dd04e1a7bb7e16c03d93f2ed51d31540cfb9d97ed70059aa77 SHA512 6f24b66b13025d0606908f91ad9b4fc6de1b4aac2d97d261f6b989065476cf153d2f84792f8dd4972b95fb1a45a3931c328df3bcf8ce5ab21170a7a912a39783 WHIRLPOOL 31b9c3635b698f404b75b87c7891b4b6be9cbeb6062bcb6fba5476b0b3069a486ba60c27ab2b12b8a2da9404f666617162041860f023951050a9fc4c7d27748a
26
DIST llvm-3.3-manpages.tar.bz2 27098 SHA256 46bb22d63d5fe7dd04e1a7bb7e16c03d93f2ed51d31540cfb9d97ed70059aa77 SHA512 6f24b66b13025d0606908f91ad9b4fc6de1b4aac2d97d261f6b989065476cf153d2f84792f8dd4972b95fb1a45a3931c328df3bcf8ce5ab21170a7a912a39783 WHIRLPOOL 31b9c3635b698f404b75b87c7891b4b6be9cbeb6062bcb6fba5476b0b3069a486ba60c27ab2b12b8a2da9404f666617162041860f023951050a9fc4c7d27748a
30
DIST llvm-3.3.src.tar.gz 13602421 SHA256 68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578 SHA512 1b7f7c5e907a68f642dcbe48fdff9585cb1504022bc9d386f310ebe5d25103d0d5f7cf0abf19e0e3fd666970160a98c90033754e2b79b2fac0cf866c984f8038 WHIRLPOOL a89c0b470fde562a3402e7878b91bc0573d433ca0a60e62c9c46946d7948a4fb657b116b6bac032555e29c70d82c751876adb398fe240f5c8d0a9a2378ce1866
27
DIST llvm-3.3.src.tar.gz 13602421 SHA256 68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578 SHA512 1b7f7c5e907a68f642dcbe48fdff9585cb1504022bc9d386f310ebe5d25103d0d5f7cf0abf19e0e3fd666970160a98c90033754e2b79b2fac0cf866c984f8038 WHIRLPOOL a89c0b470fde562a3402e7878b91bc0573d433ca0a60e62c9c46946d7948a4fb657b116b6bac032555e29c70d82c751876adb398fe240f5c8d0a9a2378ce1866
31
EBUILD llvm-2.8-r2.ebuild 6305 SHA256 0d3960a19619eaa4c532ec703afda259851e40649ddec4133148459bc7e667a2 SHA512 d397e3a098bcbf9ec91bcb0520d73fc188a00c68ef2392f66bdfa5ee7902f0e3d76bf2263c499f336489eb91391fd5f52ca1918e9e6e27a009c8d87c4058db70 WHIRLPOOL d8049c39b65046a93e10016c7b12cd49246228e032258e78726f74a4471873fba7dabf57db02d7d4a99539465cad653d02efeae54dd3aaeac4bf3a03a6a5a99b
28
EBUILD llvm-2.8-r2.ebuild 9228 SHA256 ecabc9ef925b615556acb694273746ee469970f3853e9bdaa0e921bf0c5853e6 SHA512 efbbcc826a14158294b153863de41fc5912269ab97b0a81e0c2e2435eefda809de4eed698f86fce12e1e5921ae59fb1daa738303ad361119a7767735730b5911 WHIRLPOOL 73ef71136d55c85b63d97d9761f94134bce0a75f37bb1e419d83f024fb77b6d4da6e45458336b2e9f7ec312380fc77da4ef99694a0efb06275c7fb5e4a2aa4a3
32
EBUILD llvm-2.9-r2.ebuild 6380 SHA256 e95d4d6c0fefb602a04197b10d31fff3c4ef997ff7351deeb2b170033d4048a9 SHA512 afffc1450d8c6b45f88180187e13894aceb1cb8d62ba5ee3467d7d891e34259a29173db6596c43ad9f082430d75e5ce89612ef9de6c48716a410b69d05d62ea3 WHIRLPOOL 4659745840411d9787087d38368181054acab9ef5bd7359c56e96269ab8d169783ccb65b1a5948a9a2d35c401c91f46d61d3717730ce71d67bba6832286bc990
29
EBUILD llvm-2.9-r2.ebuild 9302 SHA256 e6de4c80de6386c32ec6caa03792fa5521d2372ab173c3e9d2c0f24a01b9dad0 SHA512 9ef2511ecb1c41b1ab7e630b202ad08bc64308c33d5798aab1648cd2aad63fd656bc568fdc3502352b9c5d7205440d454466f5804f7935072ef0c16a96a44802 WHIRLPOOL 4c282c0001d0196cb7661f9b003a37614436b7f97a73a0ddf68d0a28bb614a37ebf26aa9f243355a2b5604b38e9c4c2e034c371c8bec1b974045afce10a56f82
33
EBUILD llvm-3.0-r2.ebuild 5767 SHA256 62fca1169c63516f29102a3a1bb4ea74408dfd151d97a9edbfb165a2def317c3 SHA512 f7ee2bbf8b31d86c11ab07f530278e3240ec21f3c58144a9e627aef3c1fb7690935786f33368a6f56062b5daf501adebfc164fd6712985a91076897b89cdd85f WHIRLPOOL be1a6edd697e2504df033705c2cb8e37f6c17a13d77558d231172c00f91ec247785469b6e1265e25c42eb3f6f394614cf516e0e422cb54094d9ba25669c8406c
30
EBUILD llvm-3.0-r2.ebuild 8689 SHA256 c0122b0f2edf3cb96b5c20534348dc54abf19b8a0d0370c31d8c106a833b9af2 SHA512 f94bed3775258f673b66992042756860a87ae3334ba1595ce0c7c6139e5bcc349f13fa7e45caa69ff01cac0606b9315698a3ba5e46c164f9917a14ae6221e285 WHIRLPOOL 1a8674181b9c38511bd43ee548d35da51d1dcf6dc1232841f3ba347b1f54f8af69eb62b301d32dc9704b47cfc3a2538f439cebf576e8f975e102a21f1b2da8b0
34
EBUILD llvm-3.1-r2.ebuild 6033 SHA256 9b9a587d30419fa646764a96e12fc6272f73f7246138c76ba577f0d6ab3afe59 SHA512 8b969084210af4203c029bb33d5b984e0b17f6770fd489dad818154ac9f6a87bfad069eff71776f678d9eb5d5136af472d3008d5bc73fab9dc1f36811af906c4 WHIRLPOOL 928459551d7cf6e8d18244026ba82cc3dbaf2b65bd6eac8adb617695c95535ba65bd013909730d5922de5764e9d6c6c4cf007aa6acd0b493826aa938d0389a5d
31
EBUILD llvm-3.1-r2.ebuild 8955 SHA256 813232f15b94567a56e749049bbf60a1f7f560c3b786400f906554f08306c24d SHA512 4419bc4ab9ffc037320ecaa02dfa02bf5bda59fcb576d9754477c165df571fa75717178fe9fcf11c384266b61b4c6ad363480e2898cf5ccbec881e42fc037b10 WHIRLPOOL 5184f98d43705d6f887910fe6c02be0b08c5da347533be1799535fbeb829ab21cb0619fb829b8ee9ec70a7512933cc6eb87d2df1a2b5fb323808289f2a22fa08
35
EBUILD llvm-3.2.ebuild 6534 SHA256 5532d849a32e9f7a02f6bf6d16b01cc734132fdc9a192c46ec0e25cd8b3da7cf SHA512 bc8d3a7726a7cefc1de40e3e1be0bc06d89bdad9b3462e6ad1ef96f6d850fef3e708ebef3af20fc05a66b55f2837601ccff15b528bc088c8ceb715ed12212b25 WHIRLPOOL 5105558b2422e1d01d5aab4a52a8b434f357d481156d3885375987e9b34b001b427403407349ea82511a4230dcdfad60b08a30a20b6dc5ce4839ceb035e1163a
32
EBUILD llvm-3.2.ebuild 9456 SHA256 5cb88d0b2795bdb0b5e464af23df0163645dffc363a215f8ad6be3fb894336e0 SHA512 053b61913bd77f4e0971b69e4be0d405ea1a8c2a35a3cb40378af866fd914e8abba07e808c53f6ca7a79b99bb4826f0031c23f834f1d9a5bd023984dee5a749e WHIRLPOOL b8e4bb98a7718ab18946c97331c1410b49f7c47d40c80c97e3659cc6a82465a884d0eaba1af5c1802cdc23e4d7ccc16007e07d2939edd370ced823aa01a51c0d
36
EBUILD llvm-3.3.ebuild 6741 SHA256 e1f89537832dfd507c15880aee4e50ff5ac9163b2e0318783efd9470f83cab5e SHA512 bdf380643739a73fccae18abda3268912d8639b1dcf06f2c62e2832026ef82183fc736e7bdeb6582934b852ab70def1ce1b649d0128b9a680fd971db822b53fa WHIRLPOOL aad005b5d0c5f117b23cb9e365f967f928c09a75c58992dbd04b6545e9ce9020f2187fbc3071b2acf85f8e5a4092ef0fd75a34008228ca4d7441b638b4ce0cb4
33
EBUILD llvm-3.3.ebuild 9669 SHA256 810f123e8fad603bec9a19f25e11a6659435800384db88a567e9734406764039 SHA512 a05bde9bb9bc81549fbd89524f8e212c7a87ee2b45011914325b7acf2b9d019ead986e582bb9230f95c3f72ae2f273c750e81cc74698ec107f9e4e36b8f9375d WHIRLPOOL 83fdb0e5e445390d08bd7109b81c63f6f24cae2218c3c78427f3d4daf232750fcb700018b15bd2d6df052b131bf460f717dad10c4af69ddb15719539fed82019
37
EBUILD llvm-9999.ebuild 6403 SHA256 0bf8cf6152efca605f4dae6d2ff8dd50741a4b982df3a6a5dd983eb2084aea81 SHA512 522af6dc0e657f7a3b7b53662c540a1618e229f30f47169542675a26bea9024da234eb6b265d93cd68bc3ecb95b5c2d16997d83faf8a55d2514a99a62ab021c9 WHIRLPOOL 0b59232b99db28eb39e5bfcf00447dcc8213247691ed7942648c3bbfd1ca091c98d8f9c1b5b06dd04aefcd6612fe03c38d30fc1df2c5d84ab85c0afa0554da8f
34
EBUILD llvm-9999.ebuild 9577 SHA256 7bc11548d4b0f0552088251564fdd2b64e5031031259b78c3c5ca8be545f62e9 SHA512 8b1062134fd38d83fd468aba4fce5c75f6de100e9718ae15344cb4add5aab71113e534955fb4ff162b4d58ba8c11003cd1d98ad1ee15284470dadce54b244d3a WHIRLPOOL a9ad78c27e985fa02b3a92ba3b940ab7f7848f649c2606ae08a111f2101fb4ee4d9e76a1b95c3176db39844d48754f55cbdcd01b97d209577742894088262c48
38
MISC ChangeLog 19126 SHA256 f01fe4c4183b4a91b567341cc4258232c6555d6a7924e9194d7f46a77e475357 SHA512 d0cea5de1193aeec32b80f708e16da9c0aece78710e8042692af69c7e42bfcc6fa3dffe59578e11665edce8d2c2ed2499732037ac2a5fe31b43650954602f118 WHIRLPOOL e0dc717dc73ad79d9916bede92453d5ebe2d1c5c2dd916e5dca4b733c0fab96a6cd35837d97c43902ec11e46dcdc79e6d6874f9da0b99587ca24ce6ea6b77350
35
MISC ChangeLog 19126 SHA256 f01fe4c4183b4a91b567341cc4258232c6555d6a7924e9194d7f46a77e475357 SHA512 d0cea5de1193aeec32b80f708e16da9c0aece78710e8042692af69c7e42bfcc6fa3dffe59578e11665edce8d2c2ed2499732037ac2a5fe31b43650954602f118 WHIRLPOOL e0dc717dc73ad79d9916bede92453d5ebe2d1c5c2dd916e5dca4b733c0fab96a6cd35837d97c43902ec11e46dcdc79e6d6874f9da0b99587ca24ce6ea6b77350
39
MISC metadata.xml 2480 SHA256 7900bb9405502b6fca3ddf84e4927a9353d2f70fa7be4a32b674cad604e01c24 SHA512 42093ff40389c310ca3e316d8ea63d751e530f7af4efa7820f14a8979d337dcedaa61ef35f2e8dc226d7c55177c70e0bb8512e434e8d4b1c050aefd2914dcb02 WHIRLPOOL 695127371c9fa28f1b44517d8b6b123e1479048578adb84673f41b1a1fa5bdb7a3d424635ace6f08ad41eda1207a6d46ebe03f4b1be604adf2947af155bef3bd
36
MISC metadata.xml 2480 SHA256 7900bb9405502b6fca3ddf84e4927a9353d2f70fa7be4a32b674cad604e01c24 SHA512 42093ff40389c310ca3e316d8ea63d751e530f7af4efa7820f14a8979d337dcedaa61ef35f2e8dc226d7c55177c70e0bb8512e434e8d4b1c050aefd2914dcb02 WHIRLPOOL 695127371c9fa28f1b44517d8b6b123e1479048578adb84673f41b1a1fa5bdb7a3d424635ace6f08ad41eda1207a6d46ebe03f4b1be604adf2947af155bef3bd
40
-----BEGIN PGP SIGNATURE-----
41
Version: GnuPG v2.0.20 (GNU/Linux)
42
43
iF4EAREIAAYFAlHIWvwACgkQFYEBGcdFJfKPLQD+PHVy9ihOiQVMkb3Bm/rTSHd3
44
F6FKFDhirt2F8pI2+XAA/138gT1ivIFEZjAZ+f+r3falIPxi9MlpY9S/Vr7lobhB
45
=qwQx
46
-----END PGP SIGNATURE-----
(-)a/sys-devel/llvm/llvm-2.8-r2.ebuild (-9 / +114 lines)
Lines 12-18 HOMEPAGE="http://llvm.org/" Link Here
12
SRC_URI="http://llvm.org/releases/${PV}/${P}.tgz -> ${P}-r1.tgz"
12
SRC_URI="http://llvm.org/releases/${PV}/${P}.tgz -> ${P}-r1.tgz"
13
13
14
LICENSE="UoI-NCSA"
14
LICENSE="UoI-NCSA"
15
SLOT="0"
15
SLOT="${PV}"
16
KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
16
KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
17
IUSE="debug +libffi llvm-gcc multitarget ocaml test udis86"
17
IUSE="debug +libffi llvm-gcc multitarget ocaml test udis86"
18
18
Lines 25-31 DEPEND="dev-lang/perl Link Here
25
	libffi? ( virtual/libffi )
25
	libffi? ( virtual/libffi )
26
	ocaml? ( dev-lang/ocaml )
26
	ocaml? ( dev-lang/ocaml )
27
	udis86? ( dev-libs/udis86[pic(+)] )"
27
	udis86? ( dev-libs/udis86[pic(+)] )"
28
RDEPEND="dev-lang/perl"
28
RDEPEND="dev-lang/perl
29
	app-admin/eselect-llvm"
30
29
31
30
S=${WORKDIR}/${PN}-${PV/_pre*}
32
S=${WORKDIR}/${PN}-${PV/_pre*}
31
33
Lines 71-81 src_prepare() { Link Here
71
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
73
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
72
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
74
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
73
		-i Makefile.config.in || die "Makefile.config sed failed"
75
		-i Makefile.config.in || die "Makefile.config sed failed"
74
	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
76
	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}, \
77
		-e 's,$ABS_RUN_DIR/bin,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}/bin, \
78
		-e 's,$ABS_RUN_DIR/include,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}/include, \
75
		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
79
		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
80
	sed	-e "/SUB_LDFLAGS :=/s@:=@:= \$(RPATH) -Wl,\'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}\'@" \
81
		-e "s:'s/@LLVM_LDFLAGS@/\$(subst /,\\\\/,\$(SUB_LDFLAGS))/':\"s?@LLVM_LDFLAGS@?\$(SUB_LDFLAGS)?\":" \
82
		-i tools/llvm-config/Makefile || die "llvm-config LDFLAGS sed failed"
76
83
77
	einfo "Fixing rpath and CFLAGS"
84
	einfo "Fixing rpath and CFLAGS"
78
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
85
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}'@" \
79
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
86
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
80
		-i Makefile.rules || die "rpath sed failed"
87
		-i Makefile.rules || die "rpath sed failed"
81
88
Lines 163-189 src_compile() { Link Here
163
src_install() {
170
src_install() {
164
	emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
171
	emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
165
172
173
	# Register slot for app-admin/eselect-llvm
174
	local eselect_dir="/usr/share/eselect-llvm/slots/${SLOT}"
175
	dodir "${eselect_dir}"
176
	eselect_dir="${ED}/${eselect_dir}"
177
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
178
179
	with_slot_suffix() {
180
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
181
		local ext=""
182
		if [[ "${file}" =~ \. ]] ; then
183
			ext=".${file#*.}"
184
		fi
185
		local base="${file%%.*}"
186
		echo "${base}-${SLOT}${ext}"
187
	}
188
189
	make_versioned() {
190
		local dir=$1
191
		local candidates=(${ED%/}/${dir#/})
192
		if [[ ! ${dir##*/} ]] ; then
193
			dir=${dir%/}
194
			candidates=( "${candidates}"* )
195
		else
196
			dir=$(dirname "${dir}")
197
		fi
198
199
		pushd ${ED%/}/${dir#/} >/dev/null || die
200
201
		local candidate
202
		for candidate in "${candidates[@]}" ; do
203
			if [[ -h "${candidate}" ]] ; then
204
				# Add slot suffix to symlink target
205
				local target=$(readlink -s "${candidate}")
206
				local slotted_target=$(with_slot_suffix "${target}")
207
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
208
					ln -sf "${slotted_target}" "${candidate}" \
209
						|| die "Could not update symlink"
210
				fi
211
			fi
212
213
			local base_name=$(basename "${candidate}")
214
			local slotted_name=$(with_slot_suffix "${base_name}")
215
			mv "${candidate}" "${ED}/${dir#/}/${slotted_name}" \
216
				|| die "Could not rename ${candidate} to ${slotted_name}"
217
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
218
		done
219
220
		popd >/dev/null || die
221
	}
222
223
	# Trailing slash => version the content
224
	# No trailing slash => version the directory itself
225
	local paths=(
226
		/usr/bin/
227
		/usr/$(get_libdir)/
228
		/usr/include/
229
		/usr/share/man/man1/
230
	)
231
	use vim-syntax && paths+=( /usr/share/vim/vimfiles/syntax/ )
232
233
	local path
234
	for path in "${paths[@]}" ; do
235
		make_versioned "${path}"
236
	done
237
238
	install_symlinks() {
239
		local dir=${ED%/}/${1#/}
240
		local category=$(basename "${dir}")
241
		local symlink_dir=${ED%/}/usr/$(get_libdir)/${P}/${category}
242
		mkdir ${symlink_dir}
243
244
		local output
245
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
246
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
247
		done
248
	}
249
250
	install_symlinks /usr/bin/
251
	install_symlinks /usr/include/
252
166
	# Fix install_names on Darwin.  The build system is too complicated
253
	# Fix install_names on Darwin.  The build system is too complicated
167
	# to just fix this, so we correct it post-install
254
	# to just fix this, so we correct it post-install
168
	local lib= f= odylib=
255
	local lib= f= odylib=
169
	if [[ ${CHOST} == *-darwin* ]] ; then
256
	if [[ ${CHOST} == *-darwin* ]] ; then
170
		for lib in lib{EnhancedDisassembly,LLVM-${PV},BugpointPasses,LLVMHello,LTO,profile_rt}.dylib ; do
257
		for lib in lib{EnhancedDisassembly,LLVM-${PV},BugpointPasses,LLVMHello,LTO,profile_rt}.dylib ; do
171
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
258
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
172
			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
259
			[[ -f ${ED}/usr/lib/${PN}-${SLOT}/${lib} ]] || continue
173
			ebegin "fixing install_name of $lib"
260
			ebegin "fixing install_name of $lib"
174
			install_name_tool \
261
			install_name_tool \
175
				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
262
				-id "${EPREFIX}"/usr/lib/${PN}-${SLOT}/${lib} \
176
				"${ED}"/usr/lib/${PN}/${lib}
263
				"${ED}"/usr/lib/${PN}-${SLOT}/${lib}
177
			eend $?
264
			eend $?
178
		done
265
		done
179
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
266
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}-${SLOT}/libLTO.dylib ; do
180
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
267
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
181
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
268
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
182
			install_name_tool \
269
			install_name_tool \
183
				-change "${odylib}" \
270
				-change "${odylib}" \
184
					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
271
					"${EPREFIX}"/usr/lib/${PN}-${SLOT}/libLLVM-${PV}.dylib \
185
				"${f}"
272
				"${f}"
186
			eend $?
273
			eend $?
187
		done
274
		done
188
	fi
275
	fi
189
}
276
}
277
278
pkg_postinst() {
279
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
280
		eselect ${PN} set ${SLOT}
281
	fi
282
}
283
284
pkg_prerm() {
285
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
286
		eselect ${PN} clear
287
	fi
288
}
289
290
pkg_postrm() {
291
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
292
		eselect ${PN} update
293
	fi
294
}
(-)a/sys-devel/llvm/llvm-2.9-r2.ebuild (-8 / +112 lines)
Lines 10-16 HOMEPAGE="http://llvm.org/" Link Here
10
SRC_URI="http://llvm.org/releases/${PV}/${P}.tgz"
10
SRC_URI="http://llvm.org/releases/${PV}/${P}.tgz"
11
11
12
LICENSE="UoI-NCSA"
12
LICENSE="UoI-NCSA"
13
SLOT="0"
13
SLOT="${PV}"
14
KEYWORDS="amd64 ~ppc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
14
KEYWORDS="amd64 ~ppc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
15
IUSE="debug +libffi llvm-gcc multitarget ocaml test udis86 vim-syntax"
15
IUSE="debug +libffi llvm-gcc multitarget ocaml test udis86 vim-syntax"
16
16
Lines 25-30 DEPEND="dev-lang/perl Link Here
25
	ocaml? ( dev-lang/ocaml )
25
	ocaml? ( dev-lang/ocaml )
26
	udis86? ( dev-libs/udis86[pic(+)] )"
26
	udis86? ( dev-libs/udis86[pic(+)] )"
27
RDEPEND="dev-lang/perl
27
RDEPEND="dev-lang/perl
28
	app-admin/eselect-llvm
28
	libffi? ( virtual/libffi )
29
	libffi? ( virtual/libffi )
29
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
30
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
30
31
Lines 72-82 src_prepare() { Link Here
72
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
73
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
73
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
74
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
74
		-i Makefile.config.in || die "Makefile.config sed failed"
75
		-i Makefile.config.in || die "Makefile.config sed failed"
75
	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
76
	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}, \
77
		-e 's,$ABS_RUN_DIR/bin,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}/bin, \
78
		-e 's,$ABS_RUN_DIR/include,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}/include, \
76
		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
79
		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
80
	sed	-e "/SUB_LDFLAGS :=/s@:=@:= \$(RPATH) -Wl,\'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}\'@" \
81
		-e "s:'s/@LLVM_LDFLAGS@/\$(subst /,\\\\/,\$(SUB_LDFLAGS))/':\"s?@LLVM_LDFLAGS@?\$(SUB_LDFLAGS)?\":" \
82
		-i tools/llvm-config/Makefile || die "llvm-config LDFLAGS sed failed"
77
83
78
	einfo "Fixing rpath and CFLAGS"
84
	einfo "Fixing rpath and CFLAGS"
79
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
85
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}'@" \
80
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
86
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
81
		-i Makefile.rules || die "rpath sed failed"
87
		-i Makefile.rules || die "rpath sed failed"
82
88
Lines 170-196 src_install() { Link Here
170
		doins utils/vim/*.vim
176
		doins utils/vim/*.vim
171
	fi
177
	fi
172
178
179
	# Register slot for app-admin/eselect-llvm
180
	local eselect_dir="/usr/share/eselect-llvm/slots/${SLOT}"
181
	dodir "${eselect_dir}"
182
	eselect_dir="${ED}/${eselect_dir}"
183
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
184
185
	with_slot_suffix() {
186
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
187
		local ext=""
188
		if [[ "${file}" =~ \. ]] ; then
189
			ext=".${file#*.}"
190
		fi
191
		local base="${file%%.*}"
192
		echo "${base}-${SLOT}${ext}"
193
	}
194
195
	make_versioned() {
196
		local dir=$1
197
		local candidates=(${ED%/}/${dir#/})
198
		if [[ ! ${dir##*/} ]] ; then
199
			dir=${dir%/}
200
			candidates=( "${candidates}"* )
201
		else
202
			dir=$(dirname "${dir}")
203
		fi
204
205
		pushd ${ED%/}/${dir#/} >/dev/null || die
206
207
		local candidate
208
		for candidate in "${candidates[@]}" ; do
209
			if [[ -h "${candidate}" ]] ; then
210
				# Add slot suffix to symlink target
211
				local target=$(readlink -s "${candidate}")
212
				local slotted_target=$(with_slot_suffix "${target}")
213
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
214
					ln -sf "${slotted_target}" "${candidate}" \
215
						|| die "Could not update symlink"
216
				fi
217
			fi
218
219
			local base_name=$(basename "${candidate}")
220
			local slotted_name=$(with_slot_suffix "${base_name}")
221
			mv "${candidate}" "${ED}/${dir#/}/${slotted_name}" \
222
				|| die "Could not rename ${candidate} to ${slotted_name}"
223
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
224
		done
225
226
		popd >/dev/null || die
227
	}
228
229
	# Trailing slash => version the content
230
	# No trailing slash => version the directory itself
231
	local paths=(
232
		/usr/bin/
233
		/usr/$(get_libdir)/
234
		/usr/include/
235
		/usr/share/man/man1/
236
	)
237
	use vim-syntax && paths+=( /usr/share/vim/vimfiles/syntax/ )
238
239
	local path
240
	for path in "${paths[@]}" ; do
241
		make_versioned "${path}"
242
	done
243
244
	install_symlinks() {
245
		local dir=${ED%/}/${1#/}
246
		local category=$(basename "${dir}")
247
		local symlink_dir=${ED%/}/usr/$(get_libdir)/${P}/${category}
248
		mkdir ${symlink_dir}
249
250
		local output
251
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
252
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
253
		done
254
	}
255
256
	install_symlinks /usr/bin/
257
	install_symlinks /usr/include/
258
173
	# Fix install_names on Darwin.  The build system is too complicated
259
	# Fix install_names on Darwin.  The build system is too complicated
174
	# to just fix this, so we correct it post-install
260
	# to just fix this, so we correct it post-install
175
	local lib= f= odylib=
261
	local lib= f= odylib=
176
	if [[ ${CHOST} == *-darwin* ]] ; then
262
	if [[ ${CHOST} == *-darwin* ]] ; then
177
		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO}.dylib {BugpointPasses,LLVMHello,profile_rt}.dylib ; do
263
		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO}.dylib {BugpointPasses,LLVMHello,profile_rt}.dylib ; do
178
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
264
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
179
			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
265
			[[ -f ${ED}/usr/lib/${PN}-${SLOT}/${lib} ]] || continue
180
			ebegin "fixing install_name of $lib"
266
			ebegin "fixing install_name of $lib"
181
			install_name_tool \
267
			install_name_tool \
182
				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
268
				-id "${EPREFIX}"/usr/lib/${PN}-${SLOT}/${lib} \
183
				"${ED}"/usr/lib/${PN}/${lib}
269
				"${ED}"/usr/lib/${PN}-${SLOT}/${lib}
184
			eend $?
270
			eend $?
185
		done
271
		done
186
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
272
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}-${SLOT}/libLTO.dylib ; do
187
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
273
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
188
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
274
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
189
			install_name_tool \
275
			install_name_tool \
190
				-change "${odylib}" \
276
				-change "${odylib}" \
191
					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
277
					"${EPREFIX}"/usr/lib/${PN}-${SLOT}/libLLVM-${PV}.dylib \
192
				"${f}"
278
				"${f}"
193
			eend $?
279
			eend $?
194
		done
280
		done
195
	fi
281
	fi
196
}
282
}
283
284
pkg_postinst() {
285
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
286
		eselect ${PN} set ${SLOT}
287
	fi
288
}
289
290
pkg_prerm() {
291
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
292
		eselect ${PN} clear
293
	fi
294
}
295
296
pkg_postrm() {
297
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
298
		eselect ${PN} update
299
	fi
300
}
(-)a/sys-devel/llvm/llvm-3.0-r2.ebuild (-8 / +112 lines)
Lines 11-17 HOMEPAGE="http://llvm.org/" Link Here
11
SRC_URI="http://llvm.org/releases/${PV}/${P}.tar.gz"
11
SRC_URI="http://llvm.org/releases/${PV}/${P}.tar.gz"
12
12
13
LICENSE="UoI-NCSA"
13
LICENSE="UoI-NCSA"
14
SLOT="0"
14
SLOT="${PV}"
15
KEYWORDS="amd64 ~ppc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
15
KEYWORDS="amd64 ~ppc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
16
IUSE="debug gold +libffi multitarget ocaml test udis86 vim-syntax"
16
IUSE="debug gold +libffi multitarget ocaml test udis86 vim-syntax"
17
17
Lines 27-32 DEPEND="dev-lang/perl Link Here
27
	ocaml? ( dev-lang/ocaml )
27
	ocaml? ( dev-lang/ocaml )
28
	udis86? ( dev-libs/udis86[pic(+)] )"
28
	udis86? ( dev-libs/udis86[pic(+)] )"
29
RDEPEND="dev-lang/perl
29
RDEPEND="dev-lang/perl
30
	app-admin/eselect-llvm
30
	libffi? ( virtual/libffi )
31
	libffi? ( virtual/libffi )
31
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
32
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
32
33
Lines 78-88 src_prepare() { Link Here
78
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
79
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
79
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
80
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
80
		-i Makefile.config.in || die "Makefile.config sed failed"
81
		-i Makefile.config.in || die "Makefile.config sed failed"
81
	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
82
	sed -e 's,$ABS_RUN_DIR/lib,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}, \
83
		-e 's,$ABS_RUN_DIR/bin,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}/bin, \
84
		-e 's,$ABS_RUN_DIR/include,'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}/include, \
82
		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
85
		-i tools/llvm-config/llvm-config.in.in || die "llvm-config sed failed"
86
	sed	-e "/SUB_LDFLAGS :=/s@:=@:= \$(RPATH) -Wl,\'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}\'@" \
87
		-e "s:'s/@LLVM_LDFLAGS@/\$(subst /,\\\\/,\$(SUB_LDFLAGS))/':\"s?@LLVM_LDFLAGS@?\$(SUB_LDFLAGS)?\":" \
88
		-i tools/llvm-config/Makefile || die "llvm-config LDFLAGS sed failed"
83
89
84
	einfo "Fixing rpath and CFLAGS"
90
	einfo "Fixing rpath and CFLAGS"
85
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
91
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}'@" \
86
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
92
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
87
		-i Makefile.rules || die "rpath sed failed"
93
		-i Makefile.rules || die "rpath sed failed"
88
94
Lines 155-181 src_install() { Link Here
155
		doins utils/vim/*.vim
161
		doins utils/vim/*.vim
156
	fi
162
	fi
157
163
164
	# Register slot for app-admin/eselect-llvm
165
	local eselect_dir="/usr/share/eselect-llvm/slots/${SLOT}"
166
	dodir "${eselect_dir}"
167
	eselect_dir="${ED}/${eselect_dir}"
168
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
169
170
	with_slot_suffix() {
171
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
172
		local ext=""
173
		if [[ "${file}" =~ \. ]] ; then
174
			ext=".${file#*.}"
175
		fi
176
		local base="${file%%.*}"
177
		echo "${base}-${SLOT}${ext}"
178
	}
179
180
	make_versioned() {
181
		local dir=$1
182
		local candidates=(${ED%/}/${dir#/})
183
		if [[ ! ${dir##*/} ]] ; then
184
			dir=${dir%/}
185
			candidates=( "${candidates}"* )
186
		else
187
			dir=$(dirname "${dir}")
188
		fi
189
190
		pushd ${ED%/}/${dir#/} >/dev/null || die
191
192
		local candidate
193
		for candidate in "${candidates[@]}" ; do
194
			if [[ -h "${candidate}" ]] ; then
195
				# Add slot suffix to symlink target
196
				local target=$(readlink -s "${candidate}")
197
				local slotted_target=$(with_slot_suffix "${target}")
198
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
199
					ln -sf "${slotted_target}" "${candidate}" \
200
						|| die "Could not update symlink"
201
				fi
202
			fi
203
204
			local base_name=$(basename "${candidate}")
205
			local slotted_name=$(with_slot_suffix "${base_name}")
206
			mv "${candidate}" "${ED}/${dir#/}/${slotted_name}" \
207
				|| die "Could not rename ${candidate} to ${slotted_name}"
208
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
209
		done
210
211
		popd >/dev/null || die
212
	}
213
214
	# Trailing slash => version the content
215
	# No trailing slash => version the directory itself
216
	local paths=(
217
		/usr/bin/
218
		/usr/$(get_libdir)/
219
		/usr/include/
220
		/usr/share/man/man1/
221
	)
222
	use vim-syntax && paths+=( /usr/share/vim/vimfiles/syntax/ )
223
224
	local path
225
	for path in "${paths[@]}" ; do
226
		make_versioned "${path}"
227
	done
228
229
	install_symlinks() {
230
		local dir=${ED%/}/${1#/}
231
		local category=$(basename "${dir}")
232
		local symlink_dir=${ED%/}/usr/$(get_libdir)/${P}/${category}
233
		mkdir ${symlink_dir}
234
235
		local output
236
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
237
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
238
		done
239
	}
240
241
	install_symlinks /usr/bin/
242
	install_symlinks /usr/include/
243
158
	# Fix install_names on Darwin.  The build system is too complicated
244
	# Fix install_names on Darwin.  The build system is too complicated
159
	# to just fix this, so we correct it post-install
245
	# to just fix this, so we correct it post-install
160
	local lib= f= odylib=
246
	local lib= f= odylib=
161
	if [[ ${CHOST} == *-darwin* ]] ; then
247
	if [[ ${CHOST} == *-darwin* ]] ; then
162
		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
248
		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
163
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
249
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
164
			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
250
			[[ -f ${ED}/usr/lib/${PN}-${SLOT}/${lib} ]] || continue
165
			ebegin "fixing install_name of $lib"
251
			ebegin "fixing install_name of $lib"
166
			install_name_tool \
252
			install_name_tool \
167
				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
253
				-id "${EPREFIX}"/usr/lib/${PN}-${SLOT}/${lib} \
168
				"${ED}"/usr/lib/${PN}/${lib}
254
				"${ED}"/usr/lib/${PN}-${SLOT}/${lib}
169
			eend $?
255
			eend $?
170
		done
256
		done
171
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
257
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}-${SLOT}/libLTO.dylib ; do
172
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
258
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
173
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
259
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
174
			install_name_tool \
260
			install_name_tool \
175
				-change "${odylib}" \
261
				-change "${odylib}" \
176
					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
262
					"${EPREFIX}"/usr/lib/${PN}-${SLOT}/libLLVM-${PV}.dylib \
177
				"${f}"
263
				"${f}"
178
			eend $?
264
			eend $?
179
		done
265
		done
180
	fi
266
	fi
181
}
267
}
268
269
pkg_postinst() {
270
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
271
		eselect ${PN} set ${SLOT}
272
	fi
273
}
274
275
pkg_prerm() {
276
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
277
		eselect ${PN} clear
278
	fi
279
}
280
281
pkg_postrm() {
282
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
283
		eselect ${PN} update
284
	fi
285
}
(-)a/sys-devel/llvm/llvm-3.1-r2.ebuild (-10 / +114 lines)
Lines 11-17 HOMEPAGE="http://llvm.org/" Link Here
11
SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz"
11
SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz"
12
12
13
LICENSE="UoI-NCSA"
13
LICENSE="UoI-NCSA"
14
SLOT="0"
14
SLOT="${PV}"
15
KEYWORDS="amd64 arm ppc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
15
KEYWORDS="amd64 arm ppc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
16
IUSE="debug gold +libffi multitarget ocaml test udis86 vim-syntax"
16
IUSE="debug gold +libffi multitarget ocaml test udis86 vim-syntax"
17
17
Lines 27-32 DEPEND="dev-lang/perl Link Here
27
	ocaml? ( dev-lang/ocaml )
27
	ocaml? ( dev-lang/ocaml )
28
	udis86? ( dev-libs/udis86[pic(+)] )"
28
	udis86? ( dev-libs/udis86[pic(+)] )"
29
RDEPEND="dev-lang/perl
29
RDEPEND="dev-lang/perl
30
	app-admin/eselect-llvm
30
	libffi? ( virtual/libffi )
31
	libffi? ( virtual/libffi )
31
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
32
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
32
33
Lines 78-92 src_prepare() { Link Here
78
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
79
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
79
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
80
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
80
		-i Makefile.config.in || die "Makefile.config sed failed"
81
		-i Makefile.config.in || die "Makefile.config sed failed"
81
	sed -e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \
82
	sed	-e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${P}/" \
82
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config sed failed"
83
		-e "/ActiveBinDir = ActivePrefix/s/bin/$(get_libdir)\/${P}\/bin/" \
84
		-e "/ActiveIncludeDir = ActivePrefix/s/include/$(get_libdir)\/${P}\/include/" \
85
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config ActiveLibDir sed failed"
86
	sed	-e "/SUB_LDFLAGS :=/s@:=@:= \$(RPATH) -Wl,\'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}\'@" \
87
		-e "s:'s/@LLVM_LDFLAGS@/\$(subst /,\\\\/,\$(SUB_LDFLAGS))/':\"s?@LLVM_LDFLAGS@?\$(SUB_LDFLAGS)?\":" \
88
		-i tools/llvm-config/Makefile || die "llvm-config LDFLAGS sed failed"
83
89
84
	einfo "Fixing rpath and CFLAGS"
90
	einfo "Fixing rpath and CFLAGS"
85
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
91
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}'@" \
86
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
92
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
87
		-i Makefile.rules || die "rpath sed failed"
93
		-i Makefile.rules || die "rpath sed failed"
88
	if use gold; then
94
	if use gold; then
89
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
95
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}, \
90
			-i tools/gold/Makefile || die "gold rpath sed failed"
96
			-i tools/gold/Makefile || die "gold rpath sed failed"
91
	fi
97
	fi
92
98
Lines 164-190 src_install() { Link Here
164
		doins utils/vim/*.vim
170
		doins utils/vim/*.vim
165
	fi
171
	fi
166
172
173
	# Register slot for app-admin/eselect-llvm
174
	local eselect_dir="/usr/share/eselect-llvm/slots/${SLOT}"
175
	dodir "${eselect_dir}"
176
	eselect_dir="${ED}/${eselect_dir}"
177
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
178
179
	with_slot_suffix() {
180
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
181
		local ext=""
182
		if [[ "${file}" =~ \. ]] ; then
183
			ext=".${file#*.}"
184
		fi
185
		local base="${file%%.*}"
186
		echo "${base}-${SLOT}${ext}"
187
	}
188
189
	make_versioned() {
190
		local dir=$1
191
		local candidates=(${ED%/}/${dir#/})
192
		if [[ ! ${dir##*/} ]] ; then
193
			dir=${dir%/}
194
			candidates=( "${candidates}"* )
195
		else
196
			dir=$(dirname "${dir}")
197
		fi
198
199
		pushd ${ED%/}/${dir#/} >/dev/null || die
200
201
		local candidate
202
		for candidate in "${candidates[@]}" ; do
203
			if [[ -h "${candidate}" ]] ; then
204
				# Add slot suffix to symlink target
205
				local target=$(readlink -s "${candidate}")
206
				local slotted_target=$(with_slot_suffix "${target}")
207
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
208
					ln -sf "${slotted_target}" "${candidate}" \
209
						|| die "Could not update symlink"
210
				fi
211
			fi
212
213
			local base_name=$(basename "${candidate}")
214
			local slotted_name=$(with_slot_suffix "${base_name}")
215
			mv "${candidate}" "${ED}/${dir#/}/${slotted_name}" \
216
				|| die "Could not rename ${candidate} to ${slotted_name}"
217
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
218
		done
219
220
		popd >/dev/null || die
221
	}
222
223
	# Trailing slash => version the content
224
	# No trailing slash => version the directory itself
225
	local paths=(
226
		/usr/bin/
227
		/usr/$(get_libdir)/
228
		/usr/include/
229
		/usr/share/man/man1/
230
	)
231
	use vim-syntax && paths+=( /usr/share/vim/vimfiles/syntax/ )
232
233
	local path
234
	for path in "${paths[@]}" ; do
235
		make_versioned "${path}"
236
	done
237
238
	install_symlinks() {
239
		local dir=${ED%/}/${1#/}
240
		local category=$(basename "${dir}")
241
		local symlink_dir=${ED%/}/usr/$(get_libdir)/${P}/${category}
242
		mkdir ${symlink_dir}
243
244
		local output
245
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
246
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
247
		done
248
	}
249
250
	install_symlinks /usr/bin/
251
	install_symlinks /usr/include/
252
167
	# Fix install_names on Darwin.  The build system is too complicated
253
	# Fix install_names on Darwin.  The build system is too complicated
168
	# to just fix this, so we correct it post-install
254
	# to just fix this, so we correct it post-install
169
	local lib= f= odylib=
255
	local lib= f= odylib=
170
	if [[ ${CHOST} == *-darwin* ]] ; then
256
	if [[ ${CHOST} == *-darwin* ]] ; then
171
		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
257
		for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
172
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
258
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
173
			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
259
			[[ -f ${ED}/usr/lib/${PN}-${SLOT}/${lib} ]] || continue
174
			ebegin "fixing install_name of $lib"
260
			ebegin "fixing install_name of $lib"
175
			install_name_tool \
261
			install_name_tool \
176
				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
262
				-id "${EPREFIX}"/usr/lib/${PN}-${SLOT}/${lib} \
177
				"${ED}"/usr/lib/${PN}/${lib}
263
				"${ED}"/usr/lib/${PN}-${SLOT}/${lib}
178
			eend $?
264
			eend $?
179
		done
265
		done
180
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
266
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}-${SLOT}/libLTO.dylib ; do
181
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
267
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
182
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
268
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
183
			install_name_tool \
269
			install_name_tool \
184
				-change "${odylib}" \
270
				-change "${odylib}" \
185
					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
271
					"${EPREFIX}"/usr/lib/${PN}-${SLOT}/libLLVM-${PV}.dylib \
186
				"${f}"
272
				"${f}"
187
			eend $?
273
			eend $?
188
		done
274
		done
189
	fi
275
	fi
190
}
276
}
277
278
pkg_postinst() {
279
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
280
		eselect ${PN} set ${SLOT}
281
	fi
282
}
283
284
pkg_prerm() {
285
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
286
		eselect ${PN} clear
287
	fi
288
}
289
290
pkg_postrm() {
291
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
292
		eselect ${PN} update
293
	fi
294
}
(-)a/sys-devel/llvm/llvm-3.2.ebuild (-10 / +114 lines)
Lines 16-22 SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz Link Here
16
	!doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
16
	!doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
17
17
18
LICENSE="UoI-NCSA"
18
LICENSE="UoI-NCSA"
19
SLOT="0"
19
SLOT="${PV}"
20
KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
20
KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
21
IUSE="debug doc gold +libffi multitarget ocaml test udis86 vim-syntax"
21
IUSE="debug doc gold +libffi multitarget ocaml test udis86 vim-syntax"
22
22
Lines 34-39 DEPEND="dev-lang/perl Link Here
34
	udis86? ( dev-libs/udis86[pic(+)] )
34
	udis86? ( dev-libs/udis86[pic(+)] )
35
	${PYTHON_DEPS}"
35
	${PYTHON_DEPS}"
36
RDEPEND="dev-lang/perl
36
RDEPEND="dev-lang/perl
37
	app-admin/eselect-llvm
37
	libffi? ( virtual/libffi )
38
	libffi? ( virtual/libffi )
38
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
39
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
39
40
Lines 84-98 src_prepare() { Link Here
84
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
85
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
85
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
86
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
86
		-i Makefile.config.in || die "Makefile.config sed failed"
87
		-i Makefile.config.in || die "Makefile.config sed failed"
87
	sed -e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \
88
	sed	-e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${P}/" \
88
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config sed failed"
89
		-e "/ActiveBinDir = ActivePrefix/s/bin/$(get_libdir)\/${P}\/bin/" \
90
		-e "/ActiveIncludeDir = ActivePrefix/s/include/$(get_libdir)\/${P}\/include/" \
91
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config ActiveLibDir sed failed"
92
	sed	-e "/SUB_LDFLAGS :=/s@:=@:= \$(RPATH) -Wl,\'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}\'@" \
93
		-e "s:'s/@LLVM_LDFLAGS@/\$(subst /,\\\\/,\$(SUB_LDFLAGS))/':\"s?@LLVM_LDFLAGS@?\$(SUB_LDFLAGS)?\":" \
94
		-i tools/llvm-config/Makefile || die "llvm-config LDFLAGS sed failed"
89
95
90
	einfo "Fixing rpath and CFLAGS"
96
	einfo "Fixing rpath and CFLAGS"
91
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
97
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}'@" \
92
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
98
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
93
		-i Makefile.rules || die "rpath sed failed"
99
		-i Makefile.rules || die "rpath sed failed"
94
	if use gold; then
100
	if use gold; then
95
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
101
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}, \
96
			-i tools/gold/Makefile || die "gold rpath sed failed"
102
			-i tools/gold/Makefile || die "gold rpath sed failed"
97
	fi
103
	fi
98
104
Lines 178-183 src_install() { Link Here
178
		doins utils/vim/*.vim
184
		doins utils/vim/*.vim
179
	fi
185
	fi
180
186
187
	# Register slot for app-admin/eselect-llvm
188
	local eselect_dir="/usr/share/eselect-llvm/slots/${SLOT}"
189
	dodir "${eselect_dir}"
190
	eselect_dir="${ED}/${eselect_dir}"
191
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
192
193
	with_slot_suffix() {
194
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
195
		local ext=""
196
		if [[ "${file}" =~ \. ]] ; then
197
			ext=".${file#*.}"
198
		fi
199
		local base="${file%%.*}"
200
		echo "${base}-${SLOT}${ext}"
201
	}
202
203
	make_versioned() {
204
		local dir=$1
205
		local candidates=(${ED%/}/${dir#/})
206
		if [[ ! ${dir##*/} ]] ; then
207
			dir=${dir%/}
208
			candidates=( "${candidates}"* )
209
		else
210
			dir=$(dirname "${dir}")
211
		fi
212
213
		pushd ${ED%/}/${dir#/} >/dev/null || die
214
215
		local candidate
216
		for candidate in "${candidates[@]}" ; do
217
			if [[ -h "${candidate}" ]] ; then
218
				# Add slot suffix to symlink target
219
				local target=$(readlink -s "${candidate}")
220
				local slotted_target=$(with_slot_suffix "${target}")
221
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
222
					ln -sf "${slotted_target}" "${candidate}" \
223
						|| die "Could not update symlink"
224
				fi
225
			fi
226
227
			local base_name=$(basename "${candidate}")
228
			local slotted_name=$(with_slot_suffix "${base_name}")
229
			mv "${candidate}" "${ED}/${dir#/}/${slotted_name}" \
230
				|| die "Could not rename ${candidate} to ${slotted_name}"
231
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
232
		done
233
234
		popd >/dev/null || die
235
	}
236
237
	# Trailing slash => version the content
238
	# No trailing slash => version the directory itself
239
	local paths=(
240
		/usr/bin/
241
		/usr/$(get_libdir)/
242
		/usr/include/
243
		/usr/share/man/man1/
244
	)
245
	use vim-syntax && paths+=( /usr/share/vim/vimfiles/syntax/ )
246
247
	local path
248
	for path in "${paths[@]}" ; do
249
		make_versioned "${path}"
250
	done
251
252
	install_symlinks() {
253
		local dir=${ED%/}/${1#/}
254
		local category=$(basename "${dir}")
255
		local symlink_dir=${ED%/}/usr/$(get_libdir)/${P}/${category}
256
		mkdir ${symlink_dir}
257
258
		local output
259
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
260
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
261
		done
262
	}
263
264
	install_symlinks /usr/bin/
265
	install_symlinks /usr/include/
266
181
	# Fix install_names on Darwin.  The build system is too complicated
267
	# Fix install_names on Darwin.  The build system is too complicated
182
	# to just fix this, so we correct it post-install
268
	# to just fix this, so we correct it post-install
183
	local lib= f= odylib= libpv=${PV}
269
	local lib= f= odylib= libpv=${PV}
Lines 186-206 src_install() { Link Here
186
		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
272
		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
187
		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
273
		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
188
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
274
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
189
			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
275
			[[ -f ${ED}/usr/lib/${PN}-${SLOT}/${lib} ]] || continue
190
			ebegin "fixing install_name of $lib"
276
			ebegin "fixing install_name of $lib"
191
			install_name_tool \
277
			install_name_tool \
192
				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
278
				-id "${EPREFIX}"/usr/lib/${PN}-${SLOT}/${lib} \
193
				"${ED}"/usr/lib/${PN}/${lib}
279
				"${ED}"/usr/lib/${PN}-${SLOT}/${lib}
194
			eend $?
280
			eend $?
195
		done
281
		done
196
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
282
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}-${SLOT}/libLTO.dylib ; do
197
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
283
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
198
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
284
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
199
			install_name_tool \
285
			install_name_tool \
200
				-change "${odylib}" \
286
				-change "${odylib}" \
201
					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${libpv}.dylib \
287
					"${EPREFIX}"/usr/lib/${PN}-${SLOT}/libLLVM-${libpv}.dylib \
202
				"${f}"
288
				"${f}"
203
			eend $?
289
			eend $?
204
		done
290
		done
205
	fi
291
	fi
206
}
292
}
293
294
pkg_postinst() {
295
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
296
		eselect ${PN} set ${SLOT}
297
	fi
298
}
299
300
pkg_prerm() {
301
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
302
		eselect ${PN} clear
303
	fi
304
}
305
306
pkg_postrm() {
307
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
308
		eselect ${PN} update
309
	fi
310
}
(-)a/sys-devel/llvm/llvm-3.3.ebuild (-12 / +116 lines)
Lines 16-22 SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz Link Here
16
	!doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
16
	!doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
17
17
18
LICENSE="UoI-NCSA"
18
LICENSE="UoI-NCSA"
19
SLOT="0"
19
SLOT="${PV}"
20
KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
20
KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos"
21
IUSE="debug doc gold +libffi multitarget ocaml test udis86 vim-syntax video_cards_radeon"
21
IUSE="debug doc gold +libffi multitarget ocaml test udis86 vim-syntax video_cards_radeon"
22
22
Lines 35-40 DEPEND="dev-lang/perl Link Here
35
	udis86? ( dev-libs/udis86[pic(+)] )
35
	udis86? ( dev-libs/udis86[pic(+)] )
36
	${PYTHON_DEPS}"
36
	${PYTHON_DEPS}"
37
RDEPEND="dev-lang/perl
37
RDEPEND="dev-lang/perl
38
	app-admin/eselect-llvm
38
	libffi? ( virtual/libffi )
39
	libffi? ( virtual/libffi )
39
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
40
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
40
41
Lines 85-99 src_prepare() { Link Here
85
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
86
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
86
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
87
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
87
		-i Makefile.config.in || die "Makefile.config sed failed"
88
		-i Makefile.config.in || die "Makefile.config sed failed"
88
	sed -e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \
89
	sed	-e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${P}/" \
89
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config sed failed"
90
		-e "/ActiveBinDir = ActivePrefix/s/bin/$(get_libdir)\/${P}\/bin/" \
91
		-e "/ActiveIncludeDir = ActivePrefix/s/include/$(get_libdir)\/${P}\/include/" \
92
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config ActiveLibDir sed failed"
93
	sed	-e "/SUB_LDFLAGS :=/s@:=@:= \$(RPATH) -Wl,\'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}\'@" \
94
		-e "s:'s/@LLVM_LDFLAGS@/\$(subst /,\\\\/,\$(SUB_LDFLAGS))/':\"s?@LLVM_LDFLAGS@?\$(SUB_LDFLAGS)?\":" \
95
		-i tools/llvm-config/Makefile || die "llvm-config LDFLAGS sed failed"
90
96
91
	einfo "Fixing rpath and CFLAGS"
97
	einfo "Fixing rpath and CFLAGS"
92
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
98
	sed -e "s@\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}'@" \
93
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
99
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
94
		-i Makefile.rules || die "rpath sed failed"
100
		-i Makefile.rules || die "rpath sed failed"
95
	if use gold; then
101
	if use gold; then
96
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
102
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}, \
97
			-i tools/gold/Makefile || die "gold rpath sed failed"
103
			-i tools/gold/Makefile || die "gold rpath sed failed"
98
	fi
104
	fi
99
105
Lines 157-165 src_compile() { Link Here
157
	emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1
163
	emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1
158
164
159
	if use doc; then
165
	if use doc; then
160
		emake -C docs -f Makefile.sphinx man
166
		emake -C docs -f Makefile.sphinx man html
161
		emake -C docs -f Makefile.sphinx html
162
	fi
167
	fi
168
	#	emake -C docs -f Makefile.sphinx html
163
169
164
	if use debug; then
170
	if use debug; then
165
		pax-mark m Debug+Asserts+Checks/bin/lli
171
		pax-mark m Debug+Asserts+Checks/bin/lli
Lines 188-193 src_install() { Link Here
188
		doins utils/vim/*.vim
194
		doins utils/vim/*.vim
189
	fi
195
	fi
190
196
197
	# Register slot for app-admin/eselect-llvm
198
	local eselect_dir="/usr/share/eselect-llvm/slots/${SLOT}"
199
	dodir "${eselect_dir}"
200
	eselect_dir="${ED}/${eselect_dir}"
201
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
202
203
	with_slot_suffix() {
204
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
205
		local ext=""
206
		if [[ "${file}" =~ \. ]] ; then
207
			ext=".${file#*.}"
208
		fi
209
		local base="${file%%.*}"
210
		echo "${base}-${SLOT}${ext}"
211
	}
212
213
	make_versioned() {
214
		local dir=$1
215
		local candidates=(${ED%/}/${dir#/})
216
		if [[ ! ${dir##*/} ]] ; then
217
			dir=${dir%/}
218
			candidates=( "${candidates}"* )
219
		else
220
			dir=$(dirname "${dir}")
221
		fi
222
223
		pushd ${ED%/}/${dir#/} >/dev/null || die
224
225
		local candidate
226
		for candidate in "${candidates[@]}" ; do
227
			if [[ -h "${candidate}" ]] ; then
228
				# Add slot suffix to symlink target
229
				local target=$(readlink -s "${candidate}")
230
				local slotted_target=$(with_slot_suffix "${target}")
231
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
232
					ln -sf "${slotted_target}" "${candidate}" \
233
						|| die "Could not update symlink"
234
				fi
235
			fi
236
237
			local base_name=$(basename "${candidate}")
238
			local slotted_name=$(with_slot_suffix "${base_name}")
239
			mv "${candidate}" "${ED}/${dir#/}/${slotted_name}" \
240
				|| die "Could not rename ${candidate} to ${slotted_name}"
241
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
242
		done
243
244
		popd >/dev/null || die
245
	}
246
247
	# Trailing slash => version the content
248
	# No trailing slash => version the directory itself
249
	local paths=(
250
		/usr/bin/
251
		/usr/$(get_libdir)/
252
		/usr/include/
253
		/usr/share/man/man1/
254
	)
255
	use vim-syntax && paths+=( /usr/share/vim/vimfiles/syntax/ )
256
257
	local path
258
	for path in "${paths[@]}" ; do
259
		make_versioned "${path}"
260
	done
261
262
	install_symlinks() {
263
		local dir=${ED%/}/${1#/}
264
		local category=$(basename "${dir}")
265
		local symlink_dir=${ED%/}/usr/$(get_libdir)/${P}/${category}
266
		mkdir ${symlink_dir}
267
268
		local output
269
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
270
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
271
		done
272
	}
273
274
	install_symlinks /usr/bin/
275
	install_symlinks /usr/include/
276
191
	# Fix install_names on Darwin.  The build system is too complicated
277
	# Fix install_names on Darwin.  The build system is too complicated
192
	# to just fix this, so we correct it post-install
278
	# to just fix this, so we correct it post-install
193
	local lib= f= odylib= libpv=${PV}
279
	local lib= f= odylib= libpv=${PV}
Lines 196-216 src_install() { Link Here
196
		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
282
		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
197
		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
283
		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
198
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
284
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
199
			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
285
			[[ -f ${ED}/usr/lib/${PN}-${SLOT}/${lib} ]] || continue
200
			ebegin "fixing install_name of $lib"
286
			ebegin "fixing install_name of $lib"
201
			install_name_tool \
287
			install_name_tool \
202
				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
288
				-id "${EPREFIX}"/usr/lib/${PN}-${SLOT}/${lib} \
203
				"${ED}"/usr/lib/${PN}/${lib}
289
				"${ED}"/usr/lib/${PN}-${SLOT}/${lib}
204
			eend $?
290
			eend $?
205
		done
291
		done
206
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
292
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}-${SLOT}/libLTO.dylib ; do
207
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
293
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
208
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
294
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
209
			install_name_tool \
295
			install_name_tool \
210
				-change "${odylib}" \
296
				-change "${odylib}" \
211
					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${libpv}.dylib \
297
					"${EPREFIX}"/usr/lib/${PN}-${SLOT}/libLLVM-${libpv}.dylib \
212
				"${f}"
298
				"${f}"
213
			eend $?
299
			eend $?
214
		done
300
		done
215
	fi
301
	fi
216
}
302
}
303
304
pkg_postinst() {
305
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
306
		eselect ${PN} set ${SLOT}
307
	fi
308
}
309
310
pkg_prerm() {
311
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
312
		eselect ${PN} clear
313
	fi
314
}
315
316
pkg_postrm() {
317
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
318
		eselect ${PN} update
319
	fi
320
}
(-)a/sys-devel/llvm/llvm-9999.ebuild (-11 / +118 lines)
Lines 16-22 SRC_URI="" Link Here
16
ESVN_REPO_URI="http://llvm.org/svn/llvm-project/llvm/trunk"
16
ESVN_REPO_URI="http://llvm.org/svn/llvm-project/llvm/trunk"
17
17
18
LICENSE="UoI-NCSA"
18
LICENSE="UoI-NCSA"
19
SLOT="0"
19
SLOT="${PV}"
20
KEYWORDS=""
20
KEYWORDS=""
21
IUSE="debug doc gold +libffi multitarget ocaml test udis86 vim-syntax video_cards_radeon"
21
IUSE="debug doc gold +libffi multitarget ocaml test udis86 vim-syntax video_cards_radeon"
22
22
Lines 35-40 DEPEND="dev-lang/perl Link Here
35
	udis86? ( dev-libs/udis86[pic(+)] )
35
	udis86? ( dev-libs/udis86[pic(+)] )
36
	${PYTHON_DEPS}"
36
	${PYTHON_DEPS}"
37
RDEPEND="dev-lang/perl
37
RDEPEND="dev-lang/perl
38
	app-admin/eselect-llvm
38
	libffi? ( virtual/libffi )
39
	libffi? ( virtual/libffi )
39
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
40
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
40
41
Lines 83-97 src_prepare() { Link Here
83
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
84
		-e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
84
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
85
		-e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
85
		-i Makefile.config.in || die "Makefile.config sed failed"
86
		-i Makefile.config.in || die "Makefile.config sed failed"
86
	sed -e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \
87
	sed	-e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${P}/" \
87
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config sed failed"
88
		-e "/ActiveBinDir = ActivePrefix/s/bin/$(get_libdir)\/${P}\/bin/" \
89
		-e "/ActiveIncludeDir = ActivePrefix/s/include/$(get_libdir)\/${P}\/include/" \
90
		-i tools/llvm-config/llvm-config.cpp || die "llvm-config ActiveLibDir sed failed"
91
	sed	-e "/SUB_LDFLAGS :=/s@:=@:= \$(RPATH) -Wl,\'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}\'@" \
92
		-e "s:'s/@LLVM_LDFLAGS@/\$(subst /,\\\\/,\$(SUB_LDFLAGS))/':\"s?@LLVM_LDFLAGS@?\$(SUB_LDFLAGS)?\":" \
93
		-i tools/llvm-config/Makefile || die "llvm-config LDFLAGS sed failed"
94
	sed -e "/LLVM_VERSION =/s/\('[0-9.]*\)svn'$/\1-${SLOT}'/" \
95
		-i bindings/python/llvm/common.py || die "python bindings version sed failed"
96
	sed -e "/PACKAGE_VERSION=/s/\('[0-9.]*\)svn'$/\1-${SLOT}'/" \
97
		-i configure || die "configure version sed faile"
88
98
89
	einfo "Fixing rpath and CFLAGS"
99
	einfo "Fixing rpath and CFLAGS"
90
	sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
100
	sed -e "s@\$(RPATH) -Wl,'\$\$ORIGIN/../lib'@\$(RPATH) -Wl,'${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}'@" \
91
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
101
		-e '/OmitFramePointer/s/-fomit-frame-pointer//' \
92
		-i Makefile.rules || die "rpath sed failed"
102
		-i Makefile.rules || die "rpath sed failed"
93
	if use gold; then
103
	if use gold; then
94
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
104
		sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}-${SLOT}, \
95
			-i tools/gold/Makefile || die "gold rpath sed failed"
105
			-i tools/gold/Makefile || die "gold rpath sed failed"
96
	fi
106
	fi
97
107
Lines 177-182 src_install() { Link Here
177
		doins utils/vim/*.vim
187
		doins utils/vim/*.vim
178
	fi
188
	fi
179
189
190
	# Register slot for app-admin/eselect-llvm
191
	local eselect_dir="/usr/share/eselect-llvm/slots/${SLOT}"
192
	dodir "${eselect_dir}"
193
	eselect_dir="${ED}/${eselect_dir}"
194
	echo "${CATEGORY}/${PF}" > "${eselect_dir}/ebuild"
195
196
	with_slot_suffix() {
197
		local file=$(echo "$1" | sed -e "s/-${SLOT}//")
198
		local ext=""
199
		if [[ "${file}" =~ \. ]] ; then
200
			ext=".${file#*.}"
201
		fi
202
		local base="${file%%.*}"
203
		echo "${base}-${SLOT}${ext}"
204
	}
205
206
	make_versioned() {
207
		local dir=$1
208
		local candidates=(${ED%/}/${dir#/})
209
		if [[ ! ${dir##*/} ]] ; then
210
			dir=${dir%/}
211
			candidates=( "${candidates}"* )
212
		else
213
			dir=$(dirname "${dir}")
214
		fi
215
216
		pushd ${ED%/}/${dir#/} >/dev/null || die
217
218
		local candidate
219
		for candidate in "${candidates[@]}" ; do
220
			if [[ -h "${candidate}" ]] ; then
221
				# Add slot suffix to symlink target
222
				local target=$(readlink -s "${candidate}")
223
				local slotted_target=$(with_slot_suffix "${target}")
224
				if [[ -e "${target}" ]] || [[ -e "${slotted_target}" ]] ; then
225
					ln -sf "${slotted_target}" "${candidate}" \
226
						|| die "Could not update symlink"
227
				fi
228
			fi
229
230
			local base_name=$(basename "${candidate}")
231
			local slotted_name=$(with_slot_suffix "${base_name}")
232
			mv "${candidate}" "${ED}/${dir#/}/${slotted_name}" \
233
				|| die "Could not rename ${candidate} to ${slotted_name}"
234
			echo "/${dir#/}/${base_name}" >> "${eselect_dir}/versioned"
235
		done
236
237
		popd >/dev/null || die
238
	}
239
240
	# Trailing slash => version the content
241
	# No trailing slash => version the directory itself
242
	local paths=(
243
		/usr/bin/
244
		/usr/$(get_libdir)/
245
		/usr/include/
246
		/usr/share/man/man1/
247
	)
248
	use vim-syntax && paths+=( /usr/share/vim/vimfiles/syntax/ )
249
250
	local path
251
	for path in "${paths[@]}" ; do
252
		make_versioned "${path}"
253
	done
254
255
	install_symlinks() {
256
		local dir=${ED%/}/${1#/}
257
		local category=$(basename "${dir}")
258
		local symlink_dir=${ED%/}/usr/$(get_libdir)/${P}/${category}
259
		mkdir ${symlink_dir}
260
261
		local output
262
		for output in $(grep $1 ${eselect_dir}/versioned) ; do
263
			ln -s $(with_slot_suffix ${output}) ${symlink_dir%/}/$(basename ${output})
264
		done
265
	}
266
267
	install_symlinks /usr/bin/
268
	install_symlinks /usr/include/
269
180
	# Fix install_names on Darwin.  The build system is too complicated
270
	# Fix install_names on Darwin.  The build system is too complicated
181
	# to just fix this, so we correct it post-install
271
	# to just fix this, so we correct it post-install
182
	local lib= f= odylib= libpv=${PV}
272
	local lib= f= odylib= libpv=${PV}
Lines 185-205 src_install() { Link Here
185
		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
275
		[[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
186
		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
276
		for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
187
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
277
			# libEnhancedDisassembly is Darwin10 only, so non-fatal
188
			[[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
278
			[[ -f ${ED}/usr/lib/${PN}-${SLOT}/${lib} ]] || continue
189
			ebegin "fixing install_name of $lib"
279
			ebegin "fixing install_name of $lib"
190
			install_name_tool \
280
			install_name_tool \
191
				-id "${EPREFIX}"/usr/lib/${PN}/${lib} \
281
				-id "${EPREFIX}"/usr/lib/${PN}-${SLOT}/${lib} \
192
				"${ED}"/usr/lib/${PN}/${lib}
282
				"${ED}"/usr/lib/${PN}-${SLOT}/${lib}
193
			eend $?
283
			eend $?
194
		done
284
		done
195
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
285
		for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}-${SLOT}/libLTO.dylib ; do
196
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
286
			odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib)
197
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
287
			ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
198
			install_name_tool \
288
			install_name_tool \
199
				-change "${odylib}" \
289
				-change "${odylib}" \
200
					"${EPREFIX}"/usr/lib/${PN}/libLLVM-${libpv}.dylib \
290
					"${EPREFIX}"/usr/lib/${PN}-${SLOT}/libLLVM-${libpv}.dylib \
201
				"${f}"
291
				"${f}"
202
			eend $?
292
			eend $?
203
		done
293
		done
204
	fi
294
	fi
205
}
295
}
206
- 
296
297
pkg_postinst() {
298
	if [[ $(eselect ${PN} show) = "(none)" ]] ; then
299
		eselect ${PN} set ${SLOT}
300
	fi
301
}
302
303
pkg_prerm() {
304
	if [[ $(eselect ${PN} show) = ${SLOT} ]] ; then
305
		eselect ${PN} clear
306
	fi
307
}
308
309
pkg_postrm() {
310
	if [[ -z ${REPLACED_BY_VERSION} ]] ; then
311
		eselect ${PN} update
312
	fi
313
}

Return to bug 471330