Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
194e007e
Commit
194e007e
authored
Oct 28, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yosemite'
Fixes #651, fixes #648
parents
87d7e109
84d61e86
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
1 deletions
+102
-1
bin/ruby-build
+17
-1
test/compiler.bats
+85
-0
No files found.
bin/ruby-build
View file @
194e007e
...
...
@@ -85,6 +85,16 @@ os_information() {
fi
}
# 9.1 -> 901
# 10.9 -> 1009
# 10.10 -> 1010
osx_version
()
{
local
ver
=
"
$(
sw_vers
-productVersion
)
"
local
major
=
"
${
ver
%.*
}
"
local
minor
=
"
${
ver
#*.
}
"
echo
$((
major
*
100
+
minor
))
}
build_failed
()
{
{
echo
colorize 1
"BUILD FAILED"
...
...
@@ -470,6 +480,9 @@ build_package_standard() {
(
if
[
"
${
CFLAGS
+defined
}
"
]
||
[
"
${
!PACKAGE_CFLAGS+defined
}
"
]
;
then
export
CFLAGS
=
"
$CFLAGS
${
!PACKAGE_CFLAGS
}
"
fi
if
[
-z
"
$CC
"
]
&&
[
"
$(
uname
-s
)
"
=
"Darwin"
]
&&
[
"
$(
osx_version
)
"
-ge
1010
]
;
then
export
CC
=
clang
fi
${
!PACKAGE_CONFIGURE
:-
./configure
}
--prefix
=
"
${
!PACKAGE_PREFIX_PATH
:-
$PREFIX_PATH
}
"
\
$CONFIGURE_OPTS
${
!PACKAGE_CONFIGURE_OPTS
}
"
${
!PACKAGE_CONFIGURE_OPTS_ARRAY
}
"
||
return
1
)
>
&4 2>&1
...
...
@@ -720,6 +733,9 @@ require_gcc() {
fi
export
CC
=
"
$gcc
"
if
[
"
$(
uname
-s
)
"
=
"Darwin"
]
&&
[
"
$(
osx_version
)
"
-ge
1010
]
;
then
export
MACOSX_DEPLOYMENT_TARGET
=
10.9
fi
}
locate_gcc
()
{
...
...
@@ -758,7 +774,7 @@ verify_gcc() {
return
1
fi
local
version
=
"
$(
"
$gcc
"
--version
||
true
)
"
local
version
=
"
$(
"
$gcc
"
--version
2>/dev/null
||
true
)
"
if
[
-z
"
$version
"
]
;
then
return
1
fi
...
...
test/compiler.bats
0 → 100644
View file @
194e007e
#!/usr/bin/env bats
load test_helper
export MAKE=make
export MAKE_OPTS='-j 2'
export -n CFLAGS
export -n CC
@test "require_gcc on OS X 10.9" {
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.9'
stub gcc '--version : echo 4.2.1'
run_inline_definition <<DEF
require_gcc
echo CC=\$CC
echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
DEF
assert_success
assert_output <<OUT
CC=${TMP}/bin/gcc
MACOSX_DEPLOYMENT_TARGET=no
OUT
}
@test "require_gcc on OS X 10.10" {
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub gcc '--version : echo 4.2.1'
run_inline_definition <<DEF
require_gcc
echo CC=\$CC
echo MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET-no}
DEF
assert_success
assert_output <<OUT
CC=${TMP}/bin/gcc
MACOSX_DEPLOYMENT_TARGET=10.9
OUT
}
@test "require_gcc silences warnings" {
stub gcc '--version : echo warning >&2; echo 4.2.1'
run_inline_definition <<DEF
require_gcc
echo \$CC
DEF
assert_success "${TMP}/bin/gcc"
}
@test "CC=clang by default on OS X 10.10" {
mkdir -p "$INSTALL_ROOT"
cd "$INSTALL_ROOT"
stub uname '-s : echo Darwin'
stub sw_vers '-productVersion : echo 10.10'
stub cc 'false'
stub brew 'false'
stub make \
'echo make $@' \
'echo make $@'
cat > ./configure <<CON
#!${BASH}
echo ./configure "\$@"
echo CC=\$CC
echo CFLAGS=\${CFLAGS-no}
CON
chmod +x ./configure
run_inline_definition <<DEF
exec 4<&1
build_package_standard ruby
DEF
assert_success
assert_output <<OUT
./configure --prefix=$INSTALL_ROOT
CC=clang
CFLAGS=no
make -j 2
make install
OUT
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment