Skip to content
Newer
Older
100644 35 lines (29 sloc) 763 Bytes
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
1 #!/bin/sh
2 set -e
4b1ed8b @rtomayko s/pgem/rpg/g on entire project
authored Mar 13, 2010
3 . rpg-sh-setup
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
4
9abeb5c @rtomayko usage and logging cleanup across the board
authored Mar 13, 2010
5 [ "$*" ] || set -- '--help'
6 ARGV="$@"
7 USAGE '${PROGNAME} <path>
8 Build native extensions for a package.
9
10 The paths to newly built libraries are written on standard output. Exits with
11 success if the build succeeds, failure otherwise.'
12
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
13 path="$(cd "$1" && pwd)"
14
15 test -d "$path/ext" ||
16 exit 0
17
18 find "$path/ext" -name "extconf.rb" |
19 while read file
20 do
496b589 @rtomayko shell quoting safety
authored Mar 16, 2010
21 heed "$(basename "$path") $(basename $(dirname "$file"))"
22 cd "$(dirname "$file")"
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
23 if (ruby extconf.rb &&
0c1475e @rtomayko rpg-build doesn't care if there's no clean target
authored Mar 16, 2010
24 { make clean || true; } &&
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
25 make) 1> build.log 2>&1
26 then
4b1ed8b @rtomayko s/pgem/rpg/g on entire project
authored Mar 14, 2010
27 $RPGSHOWBUILD && cat build.log 1>&2
e66c43f @josh only search for dlexts in the current directory
josh authored Apr 28, 2010
28 find "$(dirname "$file")" -name "*.$(ruby_dlext)"
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
29 else
3b132c3 @richmeyers Fix for issue #13 - propagate exit status when extension build fails
richmeyers authored Oct 12, 2011
30 status=$?
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
31 cat build.log 1>&2
3b132c3 @richmeyers Fix for issue #13 - propagate exit status when extension build fails
richmeyers authored Oct 12, 2011
32 exit $status
fa76961 @rtomayko pgem-build takes care of native extensions. this fuckers usable
authored Mar 12, 2010
33 fi
34 done
Something went wrong with that request. Please try again.