2

I'm writing an application that uses taglib-ruby, which in turn depends on Taglib. So that the user doesn't have to download and install taglib themselves, I want to bundle it with my application. I don't have much experience doing this kind of thing, but my sense is that I need to do the following:

  1. Compile Taglib to a folder within my app
  2. Compile taglib-ruby, pointing it to the local Taglib from the previous step

The problem I'm running into is that rake clean compile in step 2 fails with the error:

checking for main() in -ltag... no

You must have taglib installed in order to use taglib-ruby.

If I simply brew install taglib, then step 2 runs without a problem. I have tried step 1 in two ways: 1) simply copying the installed files from Homebrew's Cellar directory after running brew install, and 2) Downloading and running cmake on the extracted contents of one of the tar files on Taglib's website.

Since this error obviously suggests that rake clean compile can't find my non-Homebrew installed version of Taglib, I tried editing the opt_dirs variable in the extconf_common.rb file in taglib-ruby, but no luck.

How can I get taglib-ruby to use a locally installed version of Taglib?

Community
  • 1
  • 1
maxedison
  • 17,243
  • 14
  • 67
  • 114

1 Answers1

0

I think you're better off not to bundle the dependency unless it is necessary to.

There's a few reasons:

  1. The dependency needs to be build differently for different platforms. It's easier to direct users to apt-get/brew install taglib than to include the latest build for all system architectures and then try and determine which one to install.
  2. The dependency might not get updated unless it's installed via a package manager.

Perhaps you could make an install script which determines the user's platform and then downloads the dependency using the appropriate package manager.

See Detecting Operating Systems in Ruby

Community
  • 1
  • 1
max pleaner
  • 26,189
  • 9
  • 66
  • 118