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
09e55a8b
Commit
09e55a8b
authored
Dec 21, 2013
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jruby-sed'
Closes #476
parents
578f0c5c
9effc7a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
6 deletions
+46
-6
bin/ruby-build
+2
-1
test/build.bats
+44
-5
No files found.
bin/ruby-build
View file @
09e55a8b
...
@@ -519,7 +519,8 @@ install_jruby_launcher() {
...
@@ -519,7 +519,8 @@ install_jruby_launcher() {
fix_jruby_shebangs
()
{
fix_jruby_shebangs
()
{
for
file
in
"
${
PREFIX_PATH
}
/bin"
/
*
;
do
for
file
in
"
${
PREFIX_PATH
}
/bin"
/
*
;
do
if
[
"
$(
head
-c
20
"
$file
"
)
"
=
"#!/usr/bin/env jruby"
]
;
then
if
[
"
$(
head
-c
20
"
$file
"
)
"
=
"#!/usr/bin/env jruby"
]
;
then
sed
-i
''
-E
"1s:.+:#
\!
${
PREFIX_PATH
}
/bin/jruby:"
"
$file
"
sed
-i
.bak
-E
"1s:.+:#
\!
${
PREFIX_PATH
}
/bin/jruby:"
"
$file
"
rm
"
$file
"
.bak
fi
fi
done
done
}
}
...
...
test/build.bats
View file @
09e55a8b
...
@@ -11,6 +11,13 @@ setup() {
...
@@ -11,6 +11,13 @@ setup() {
stub curl false
stub curl false
}
}
executable() {
local file="$1"
mkdir -p "${file%/*}"
cat > "$file"
chmod +x "$file"
}
cached_tarball() {
cached_tarball() {
mkdir -p "$RUBY_BUILD_CACHE_PATH"
mkdir -p "$RUBY_BUILD_CACHE_PATH"
pushd "$RUBY_BUILD_CACHE_PATH" >/dev/null
pushd "$RUBY_BUILD_CACHE_PATH" >/dev/null
...
@@ -24,12 +31,10 @@ tarball() {
...
@@ -24,12 +31,10 @@ tarball() {
local configure="$path/configure"
local configure="$path/configure"
shift 1
shift 1
mkdir -p "$path"
executable "$configure" <<OUT
cat > "$configure" <<OUT
#!$BASH
#!$BASH
echo "$name: \$@" \${RUBYOPT:+RUBYOPT=\$RUBYOPT} >> build.log
echo "$name: \$@" \${RUBYOPT:+RUBYOPT=\$RUBYOPT} >> build.log
OUT
OUT
chmod +x "$configure"
for file; do
for file; do
mkdir -p "$(dirname "${path}/${file}")"
mkdir -p "$(dirname "${path}/${file}")"
...
@@ -230,12 +235,11 @@ OUT
...
@@ -230,12 +235,11 @@ OUT
@test "can use RUBY_CONFIGURE to apply a patch" {
@test "can use RUBY_CONFIGURE to apply a patch" {
cached_tarball "ruby-2.0.0"
cached_tarball "ruby-2.0.0"
cat >
"${TMP}/custom-configure" <<CONF
executable
"${TMP}/custom-configure" <<CONF
#!$BASH
#!$BASH
apply -p1 -i /my/patch.diff
apply -p1 -i /my/patch.diff
exec ./configure "\$@"
exec ./configure "\$@"
CONF
CONF
chmod +x "${TMP}/custom-configure"
stub apply 'echo apply "$@" >> build.log'
stub apply 'echo apply "$@" >> build.log'
stub_make_install
stub_make_install
...
@@ -332,6 +336,41 @@ bundle exec rake install
...
@@ -332,6 +336,41 @@ bundle exec rake install
OUT
OUT
}
}
@test "JRuby build" {
executable "${RUBY_BUILD_CACHE_PATH}/jruby-1.7.9/bin/jruby" <<OUT
#!${BASH}
echo jruby "\$@" >> ../build.log
OUT
executable "${RUBY_BUILD_CACHE_PATH}/jruby-1.7.9/bin/gem" <<OUT
#!/usr/bin/env jruby
nice gem things
OUT
cached_tarball "jruby-1.7.9" bin/foo.exe bin/bar.dll bin/baz.bat
run_inline_definition <<DEF
install_package "jruby-1.7.9" "http://jruby.org/downloads/jruby-bin-1.7.9.tar.gz" jruby
DEF
assert_success
assert_build_log <<OUT
jruby gem install jruby-launcher
OUT
run ls "${INSTALL_ROOT}/bin"
assert_output <<OUT
gem
jruby
ruby
OUT
assert [ -x "${INSTALL_ROOT}/bin/gem" ]
run cat "${INSTALL_ROOT}/bin/gem"
assert_output <<OUT
#!${INSTALL_ROOT}/bin/jruby
nice gem things
OUT
}
@test "non-writable TMPDIR aborts build" {
@test "non-writable TMPDIR aborts build" {
export TMPDIR="${TMP}/build"
export TMPDIR="${TMP}/build"
mkdir -p "$TMPDIR"
mkdir -p "$TMPDIR"
...
...
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