Apothecary Jumpstart

Hello all (in particular @danomatika) - I’m trying to get my brain around apothecary because I need to build a few external libs for this ofFont upgrade. So here are my questions:

  1. What is the latest, most definitive repo location? This one?
  2. Are the folks over at openFrameworks-cpp11 using it with success and are they more up-to-date?
  3. What is the recommend method for building libs for VS? Building libs for VS is magic, and I have no idea how it is done, even without apothecary.
  4. Some libraries like freetype require libpng, etc. Currently cairo has the libpng dependencies sequestered in its own directory. I also have a new core library (for ofFont) that needs to build against our special non-system, non-64, non-homebrew freetype, libpng, cairo. So, I’m wondering how you would recommend making a more flexible dependency scheme for these situations – or should we just move those formulae in cairo to the main repo?
  5. Is this up to date: https://docs.google.com/spreadsheet/ccc?key=0Ao8N9g3ekXTydGtzZUxya0IxMTNkdUNiT05laTJieXc&usp=sharing#gid=0


1-3: The openFrameworks-cpp11 version is more up to date. They’ve added VS stuff there, to some degree, although I haven’t tested it and haven’t worked with apothecary since the summer.

4: Simplest solution would be to copy how the cairo script does it and download it twice. I deliberately avoided dependency handling to keep it simple. Another option, as you say, is to promote it to the main lib and just leave the copy function empty so it’s not installed.

5: That is freely editable. I haven’t updated it in a while so feel free to do so.

apothecary is an experiment. Go ahead and fork, add, and make it better. The idea was to put something out there to convince people that automating the building of libraries could save us all time and pain in the future. I’m sure there are probably better ways to do things, using python for instance … but at least this should basically work in a Unix environment on all platforms via Git+Bash / Github for Windows on Win.

I tackled the core OSX & iOS libs, with the idea being that lots of other people could come and fill out other platforms.

Very cool. I’m working w/ the openFrameworks-cpp11 vs branch (as it seems to be the most advanced) @LeoColomb now trying to figure out an easy way to build these dependencies to be used by multiple libs. it seems pretty easy to just place those cairo depends in the core directory and just not copying them. in my case, since some of the other libs depend on libpng etc, it probably make sense to move those libs out of the cairo subdirectory and just make them first class 3rd party root level lib citizens.

Yeah! It’s so easy!..
And if @danomatika hasn’t merged my work about Git in his own repo, yes, it’s the oF-11 repo the most advanced :blush:.
But VS implementation is not completed and in review in vs branch.

@LeoColomb @tgfrerer @danomatika

Hey folks, I’m working with apothecary and have a few questions, comments suggestions I’d like to propose, but I need feedback from those of you who have already invested and have more experience with the project …

So the first problem that I am trying to solve is that I want to be able to build libs that link against each other in our system. For instance, for this font work I’m doing, harfbuzz needs to link against our existing freetype. Currently when those libraries are built, they don’t get installed in any normal linux-y way (some do, some don’t). Basically, I’m wondering if we could add a required step to the copy process that both runs the normal make install (so that other libs can link against the static libs, headers, etc) just like they would in /usr/local and then have a second step that deploys the built libs into the $OF_ROOT/libs directory with all of the strange non-standard naming, platform specific lib paths, etc.

The idea then would be to have a directory structure that looks like:

          /doc       // docs go here
          /build     // downloaded raw source repos go here
          /formulas  // formulae go here
          /local      // this is the --prefix location that we would use t
                 /osx // make install would install here of osx
                 /ios // make install would install here of ios
                 /... // etc

If we enforce this make install with the apothecary/local/$TYPE then it will be easier move items around from there and the cross-linking will be a bit easier.

Any thoughts about this approach? It’s kind of like having our own brew Cellar, in the local dir.

Yeah sounds good. Try it. You could call make install at the end of the build function, depending on the platform and the copy libs functions simply copies/renames from the the local folder.

Regarding dependency tracking, a simple idea would be to check if the target lib exists within the local folder and, if not, run the dependency formula. One option would be to add a new formula function called check which returns whether the formula had been downloaded and built yet which the parent formula could call. Again, this would not be super smart but it would work.

Also, @LeoColomb @bakercp feel free to give me PR’s back from the cpp11 apothecary branch so we can keep things centralized as we go on.

Also, we need to add a formula for glfw.


I sent it over this evening → https://github.com/danomatika/apothecary/blob/master/scripts/apothecary/formulas/glfw.sh

Just need to add the other platforms.

Ha yeah, I saw that in the PR after I posted.

I added dependency & buildroot support, see the updated readme & the cairo formula.

Also, freetype now installs to the build root for @bakercp.