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
cb1128ca
Commit
cb1128ca
authored
Oct 26, 2013
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'relative-paths'
parents
d35349e8
b37427b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
30 deletions
+45
-30
bin/ruby-build
+2
-0
test/build.bats
+43
-30
No files found.
bin/ruby-build
View file @
cb1128ca
...
@@ -772,6 +772,8 @@ fi
...
@@ -772,6 +772,8 @@ fi
PREFIX_PATH
=
"
${
ARGUMENTS
[1]
}
"
PREFIX_PATH
=
"
${
ARGUMENTS
[1]
}
"
if
[
-z
"
$PREFIX_PATH
"
]
;
then
if
[
-z
"
$PREFIX_PATH
"
]
;
then
usage
usage
elif
[
"
${
PREFIX_PATH
#/
}
"
=
"
$PREFIX_PATH
"
]
;
then
PREFIX_PATH
=
"
${
PWD
}
/
${
PREFIX_PATH
}
"
fi
fi
if
[
-z
"
$TMPDIR
"
]
;
then
if
[
-z
"
$TMPDIR
"
]
;
then
...
...
test/build.bats
View file @
cb1128ca
#!/usr/bin/env bats
#!/usr/bin/env bats
load test_helper
load test_helper
export RUBY_BUILD_CACHE_PATH="$TMP/cache"
setup() {
mkdir -p "$INSTALL_ROOT"
stub md5 false
stub curl false
}
cached_tarball() {
mkdir -p "$RUBY_BUILD_CACHE_PATH"
pushd "$RUBY_BUILD_CACHE_PATH" >/dev/null
tarball "$1"
popd >/dev/null
}
tarball() {
tarball() {
local name="$1"
local name="$1"
local path="$
TMP
/$name"
local path="$
PWD
/$name"
local configure="$path/configure"
local configure="$path/configure"
mkdir -p "$path"
mkdir -p "$path"
...
@@ -14,68 +28,67 @@ echo "$name: \$@" > build.log
...
@@ -14,68 +28,67 @@ echo "$name: \$@" > build.log
OUT
OUT
chmod +x "$configure"
chmod +x "$configure"
tar czf "${path}.tgz" -C "$TMP" "$name"
tar czf "${path}.tar.gz" -C "${path%/*}" "$name"
echo "${path}.tgz"
}
stub_make_install() {
stub make \
' : echo make "$@" >> build.log' \
"install : cat build.log >> '$INSTALL_ROOT/build.log'"
}
}
stub_download() {
assert_build_log() {
stub curl "-C - -o * -*S* $1 : cp '$(tarball "$2")' \$4"
run cat "$INSTALL_ROOT/build.log"
assert_output
}
}
@test "yaml is installed for ruby" {
@test "yaml is installed for ruby" {
mkdir -p "$INSTALL_ROOT/bin"
cached_tarball "yaml-0.1.4"
cached_tarball "ruby-2.0.0"
stub md5 false
stub brew false
stub brew false
stub_download "http://pyyaml.org/*" "yaml-0.1.4"
stub_make_install
stub_download "http://ruby-lang.org/*" "ruby-2.0.0"
stub_make_install
stub make \
' : echo make "$@" >> build.log' \
"install : cp build.log '$INSTALL_ROOT/yaml.log'" \
' : echo make "$@" >> build.log' \
"install : cp build.log '$INSTALL_ROOT/ruby.log'"
install_fixture definitions/needs-yaml
install_fixture definitions/needs-yaml
assert_success
assert_success
unstub curl
unstub make
unstub make
run cat "$INSTALL_ROOT/yaml.log"
assert_build_log <<OUT
assert_output <<OUT
yaml-0.1.4: --prefix=$INSTALL_ROOT
yaml-0.1.4: --prefix=$INSTALL_ROOT
make -j 2
make -j 2
OUT
run cat "$INSTALL_ROOT/ruby.log"
assert_output <<OUT
ruby-2.0.0: --prefix=$INSTALL_ROOT
ruby-2.0.0: --prefix=$INSTALL_ROOT
make -j 2
make -j 2
OUT
OUT
}
}
@test "yaml is linked from Homebrew" {
@test "yaml is linked from Homebrew" {
cached_tarball "ruby-2.0.0"
brew_libdir="$TMP/homebrew-yaml"
brew_libdir="$TMP/homebrew-yaml"
mkdir -p "$INSTALL_ROOT/bin"
mkdir -p "$brew_libdir"
mkdir -p "$brew_libdir"
stub md5 false
stub brew "--prefix libyaml : echo '$brew_libdir'"
stub brew "--prefix libyaml : echo '$brew_libdir'"
stub_download "http://ruby-lang.org/*" "ruby-2.0.0"
stub_make_install
stub make \
' : echo make "$@" >> build.log' \
"install : cp build.log '$INSTALL_ROOT/ruby.log'"
install_fixture definitions/needs-yaml
install_fixture definitions/needs-yaml
assert_success
assert_success
unstub brew
unstub brew
unstub curl
unstub make
unstub make
run cat "$INSTALL_ROOT/ruby.log"
assert_build_log <<OUT
assert_output <<OUT
ruby-2.0.0: --prefix=$INSTALL_ROOT --with-libyaml-dir=$brew_libdir
ruby-2.0.0: --prefix=$INSTALL_ROOT --with-libyaml-dir=$brew_libdir
make -j 2
make -j 2
OUT
OUT
}
}
@test "custom relative install destination" {
export RUBY_BUILD_CACHE_PATH="$FIXTURE_ROOT"
cd "$TMP"
install_fixture definitions/without-checksum ./here
assert_success
assert [ -x ./here/bin/package ]
}
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