Skip to end of metadata
Go to start of metadata

Building a FireBreath Plugin on Linux

The following describes the process to build the example FireBreath plugin on Linux; pretty much the same process applies to building your own plugin - differences should be noted.

See Also: FireBreath Tips: Working with Source Control

Requirements

In Debian: 

In Fedora: 

 

Get the source

First thing is first; get the source code.

To get a copy of the source, see the download page.

Generate the example project files

To generate the project files execute:

The project build files will all be generated into the buildex/ directory under the project root.

Generate your own project files

If you have created your own project in the projects/ directory, you can build it by running the same command as for example projects, but (this will be a shocker) without "examples".

To generate the project build files:

The project build files will all be generated into the build/ directory under the project root - this only has to be done after either adding or generating another FireBreath project.

Build the Plugin

The example plugin can be built by changing to the directory buildex and executing:

To build your own project, change to the directory build/ and execute:

Debug Builds

You can pass arguments to the prepmake command - see the full list at Prep Scripts.  For example:

Removing the libgtk2.0-dev dependency

If you plan to do drawing, then libgtk2.0-dev is required because that's what the browser uses to draw. If you aren't planning to draw, you can add the following line to PluginConfig.cmake:

Make the plugin accessible

Most browsers on Linux look for NPAPI plugins in either "/usr/lib/mozilla/plugins" or "~/.mozilla/plugins" (Firefox, Chrome, Chromium, Arora); copy the plugin file to one of those locations -

You can copy the plugin shared object file to either of those locations, easiest is most likely "~/.mozilla/plugins" as root privileges are not required. Alternately you could use a link.

Open in your browser and play with it

Open the file buildex/projects/FBTestPlugin/gen/FBControl.htm in your preferred browser

Use Jash or firebug (or whatever) to make calls on the plugin. For supported calls, check out projects/TemplatePlugin/MathAPI.cpp.

A few JS commands to try:

1 Comment

  1. The command fails when the script does not contain any path:


    sh -v prepmake.sh examples

    source ${0%/*}/common.sh "$@"
    prepmake.sh: line 7: prepmake.sh/common.sh: Not a directory