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
- CMake version 2.8: http://www.cmake.org/cmake/resources/software.html
- libgtk2.0-dev (if you need GUI/drawing support)
- Git: http://git-scm.com/
In Debian:
apt-get install cmake libgtk2.0-dev git
In Fedora:
yum install cmake gtk2-devel git
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
./prepmake.sh examples
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".
./prepmake.sh
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:
make
To build your own project, change to the directory build/ and execute:
make
Debug Builds
You can pass arguments to the prepmake command - see the full list at Prep Scripts. For example:
./prepmake.sh examples -D CMAKE_BUILD_TYPE="Debug" cd buildex make
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
:
set(FB_GUI_DISABLED 1)
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 -
cp buildex/bin/FBTestPlugin/npFBTestPlugin.so ~/.mozilla/plugins/.