Skip to content

Browser native plugin to connect Diveobard to dive computers

License

Notifications You must be signed in to change notification settings

Diveboard/DC-plugin

Repository files navigation

0/ Prerequisites

- Install CMake :
  Mac/windows : http://www.cmake.org/cmake/resources/software.html
  Debian/Ubuntu : apt-get install cmake

- Make sure dependencies are there :
  Linux : 
    sudo apt-get install libgtk2.0-dev automake autoconf libtool git screen cmake pkg-config gawk rpm
  Windows : 
    Visual studio (we're using verion 10)
    NSIS (for packaging)
  Mac : 
    xcode
    PackageMaker : Since xcode 4.3, command line tools are no longer part of xcode. To install PackageMaker command line : 
        -> launch xcode, menu XCode/Open developper tools/More developper tools
        -> Download "auxiliary tools for xcode"
        -> Copy PackageMaker to your Applications folder (yeah Apple didn't provide any installer.....)
        -> run : sudo ln -s /Applications/PackageMaker.app/Contents/MacOS/PackageMaker /Applications/Xcode.app/Contents/Developer/usr/bin/packagemaker

- Configure globally Xcode for mac
  For mac, make sure that the build location can be configured on a project basis :
  XCode > Preferences > Locations > Advanced > Build Location = Location Specified By Targets


1/ Compiling for development environment

- in a shell, place yourself in the same folder as this readme

- Get Firebreath from github:
  git submodule update --init
  
  Note: Firebreath has been included as a submodule, and Libdivecomputer has been integrated as a subtree merge.

- launch the correct prep... command for your platform with the arguments "projects" and "build" :
	Mac : ./firebreath/prepmac.sh projects build
	Linux : ./firebreath/prepcodeblocks.sh projects build
	Windows : firebreath\prep2010.cmd projects build

- you may open the main plugin projects in your favorite IDE :
	Mac : FireBreath.xcode
	Linux : FireBreath.cbp
	Windows : FireBreath.sln

- To compile the main plugin with Debug symbols, run, go in the build/ directory and run :
  Mac : 
    xcodebuild -configuration Debug -project FireBreath.xcodeproj build
  Linux : 
    make
  Windows : 
    "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
    msbuild FireBreath.sln /p:Configuration=Debug /t:clean,rebuild



  Note for Mac build: in case of error with lipo, it might be because of parallel build. To disactivate that feature in xcode, go to "Project/Edit Project settings" and uncheck "Build independant targets in parallel"


- To build the libdivecomputer library, go in the libdivecomputer directory and run :
  Mac:
    autoreconf --install && ./configure && make
  Linux:
    autoreconf --install && ./configure && make
  Windows:
    "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
    msbuild msvc\libdivecomputer.sln /p:Configuration=Release /t:clean,rebuild


WARNING ! On Linux you must build on both a 32-bit platform and a 64-bit platform - you must build really 2 times on 2 platforms, no kidding.


- The built binaries will be :
	Mac:
    build/projects/DiveBoard/Release/DiveBoard_x86_64.plugin/Contents/MacOS/DiveBoard_x86_64
    libdivecomputer/src/.libs/libdivecomputer.0.dylib
	Linux:
    
    libdivecomputer/src/.libs/libdivecomputer.so
	Windows:
    build\bin\DiveBoard\Release\npDiveBoard.dll
    libdivecomputer\msvc\Release\libdivecomputer.dll


2/ Build the release package

- To build the package run
	Windows: 
    mkexewin32.bat
	Mac: 
    mkpkg4mac.sh
  Linux:
    mkpkg4linux.sh

- The installation package will be placed in
	Mac : build/packages/diveboard.dmg
	Windows : build\bin\DiveBoard\Release\DiveBoard.exe
  Linux : build/packages/



Notes : 

On windows, the easiest way is to register the dll in build/bin/DiveBoard/Debug
	regsvr32 npPluginTemplate.dll





Good luck !



ANNEXES
=======

A/ IRDA INTEGRATION FOR MAC

  - Build IRDA library
      cd irda_mac ; make
  - Patch libdivecomputer
      cd ../libdivecomputer
      cp ../irda_mac/irda_mac.c src/
      patch -N -p1 < ../irda_mac/libdivecomputer_irda_mac.1.patch
  - Configure libdivecomputer with the IrDA Library
      DYLD_LIBRARY_PATH=$(pwd)/../irda_mac CPPFLAGS=-I$(pwd)/../irda_mac/ LDFLAGS=-L$(pwd)/../irda_mac LIBS="-lirda" ./configure
  - Compile libdivecomputer
      make
  - Tell the linker where the IrDA Library will be installed
      install_name_tool -change irda.dylib "/Library/Internet Plug-Ins/DiveBoard.plugin/Contents/MacOS/irda.dylib" src/.libs/libdivecomputer.dylib

B/ CODE UPDATE FOR LIBDIVECOMPUTER

  - look into git log for previous libdivecomputer commit number
  - cd /tmp
  - git clone git://git.libdivecomputer.org/libdivecomputer.git
  - cd libdivecomputer
  - git diff previous_ldc_commit HEAD > /tmp/ldc.path
  - cd /.../dev_env/libdivecomputer
  - patch -N -p1 < /tmp/ldc.patch
  - include the latest commit number from libdivecomputer into the commit comment


About

Browser native plugin to connect Diveobard to dive computers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published