File tree Expand file tree Collapse file tree 3 files changed +34
-2
lines changed
Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,12 @@ Build and install gem into system gems:
9595
9696 rake install
9797
98+ The ` swig ` and ` compile ` rake tasks can use the ` TAGLIB_DIR ` environment
99+ variable to build against non-standard taglib installations. It is assumed
100+ that taglib headers are located at ` $TAGLIB_DIR/include ` and taglib libraries
101+ at ` $TAGLIB_DIR/lib ` . To run taglib-ruby with non-standard taglib
102+ installations, use the ` LD_LIBRARY_PATH ` env. variable.
103+
98104### Workflow
99105
100106* Check out the latest master to make sure the feature hasn't been
Original file line number Diff line number Diff line change @@ -20,7 +20,14 @@ def error msg
2020 abort
2121end
2222
23- dir_config ( 'tag' )
23+ if ENV . has_key? ( 'TAGLIB_DIR' ) and !File . directory? ( ENV [ 'TAGLIB_DIR' ] )
24+ error "When defined, the TAGLIB_DIR environment variable must point to a valid directory."
25+ end
26+
27+ # If specified, use the TAGLIB_DIR environment variable as the prefix
28+ # for finding taglib headers and libs. See MakeMakefile#dir_config
29+ # for more details.
30+ dir_config ( 'tag' , ( ENV [ 'TAGLIB_DIR' ] if ENV . has_key? ( 'TAGLIB_DIR' ) ) )
2431
2532# When compiling statically, -lstdc++ would make the resulting .so to
2633# have a dependency on an external libstdc++ instead of the static one.
Original file line number Diff line number Diff line change 11# Tasks for generating SWIG wrappers in ext
22
3+ # Execute SWIG for the specified extension.
4+ # Arguments:
5+ # mod:: The name of the SWIG wrapper to process.
6+ #
7+ # If the TAGLIB_DIR environment variable points to a directory,
8+ # $TAGLIB_DIR/include will be searched first for taglib headers.
39def run_swig ( mod )
410 swig = `which swig` . chomp
511 if swig . empty?
612 swig = `which swig2.0` . chomp
713 end
8- sh "cd ext/#{ mod } && #{ swig } -c++ -ruby -autorename -initname #{ mod } -I/usr/local/include -I/usr/include #{ mod } .i"
14+
15+ # Standard search location for headers
16+ include_args = %w{ -I/usr/local/include -I/usr/include }
17+
18+ if ENV . has_key? ( 'TAGLIB_DIR' )
19+ unless File . directory? ( ENV [ 'TAGLIB_DIR' ] )
20+ abort "When defined, the TAGLIB_DIR environment variable must point to a valid directory."
21+ end
22+
23+ # Push it in front to get it searched first.
24+ include_args . unshift ( '-I' + ENV [ 'TAGLIB_DIR' ] + '/include' )
25+ end
26+
27+ sh "cd ext/#{ mod } && #{ swig } -c++ -ruby -autorename -initname #{ mod } #{ include_args . join ( ' ' ) } #{ mod } .i"
928end
1029
1130task :swig =>
You can’t perform that action at this time.
0 commit comments