Skip to content
jacob-carlborg edited this page Jul 12, 2011 · 6 revisions

An orb package is just a simple archive with a specific file and directory structure in any of the supported formats. Currently only zip is supported. An orb package has the extension ".orb." where indicates in what format the package is archived, i.e. "zip".

Package Structure

At the top level of in the package there is a file, "metadata", containing metadata about the package. This file contain information like the name of the package, version, dependencies and so on. Next to the metadata file, at the top level, is directory called "data". This directory contains the actual data in the package. It contains all files necessary do build and/or install the package.

A typical package can look like this:

orbit-0.0.1
 	|--- metadata
	|--- data
		|--- orbit
			|--- orb.d
			|--- main.d
			|--- dakefile

Package Types

There are three different package types: binary packages, source packages and mixed packages.

Binary Packages

Binary packages are packages that don't have to be built when installing the package. These can be, for example, pre-compiled executables or pre-compiled libraries. For a binary package containing an executable, only the actual executable needs to be in the package.

Source Packages

A source package is a package that needs to be built before installing it. Examples of source packages can be dynamic libraries, bindings and so on. A source package requires that all the files necessary to build the package are present. A source package can contain all kinds of sub types (see below).

Mixed Packages

A mixed package is just what it sounds like: a mix of a binary and source package. A package containing both targets that needs to be built and targets that are pre-compiled.

Sub Types

In addition to package types there are also sub types or just "types". The following types exist:

  • Library
  • Executable
  • Dynamic library
  • Bindings
  • Source

These types indicate what a package contains.

Versions

You can specify which version you want to use/install of an orb package in several ways, this example shows this using an orbfile:

orb "dwt", "0.5.3" # specifies an exact version
orb "sqlite" # uses the latest version
orb "orange", "> 0.0.1" # uses any version greater than "0.0.1", basically any comparsion operator is allowed here
orb "derelict, "~> 0.3.4" # uses any version above "0.3.4" that is "0.x.y", i.e. won't use any "1.x.y" version

It's recommended that all packages following this version scheme:

A version consist of three parts: major.minor.build.

  • Build is incremented when a implementation detail changes that doesn't affect the API. For example, an array is replaced with a linked list
  • Minor is incremented when a non-braking API change is introduced. For example, a new function is added
  • Major is incremented when an API braking change is introduced, For example, a function is removed

If the above is followed then you can easily specify that you want to use the latest version of a package without braking your own code when a new version of the package is available. The syntax used for this is (in an orbfile):

orb "derelict, "~> 0.3.4"
Clone this wiki locally