diff options
author | Joachim Schiele <js@lastlog.de> | 2014-10-27 18:39:45 +0100 |
---|---|---|
committer | Joachim Schiele <js@lastlog.de> | 2014-10-27 19:11:51 +0100 |
commit | 40f24dca0f72c8767aae8d05dc9168bae12eaf80 (patch) | |
tree | 651eb34694a93957eb44f5cebd992d65a0c7060c /pkgs/servers | |
parent | e8dc583eb4493a32957a01d855af1c92d33fe03b (diff) |
brickd: packaged version 2.1.1
Diffstat (limited to 'pkgs/servers')
-rw-r--r-- | pkgs/servers/brickd/default.nix | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/servers/brickd/default.nix b/pkgs/servers/brickd/default.nix new file mode 100644 index 000000000000..9c88a6462145 --- /dev/null +++ b/pkgs/servers/brickd/default.nix @@ -0,0 +1,60 @@ +{ stdenv, fetchgit, libusb, pkgconfig, pmutils, udev} : + +let + +version = "2.1.1"; +daemonlib = fetchgit { + url = "https://github.com/Tinkerforge/daemonlib.git"; + rev = "refs/tags/brickd-${version}"; + sha256 = "097kaz7d0rzg0ijvcna3y620k3m5fgxpqsac5gbhah8pd7vlj1a4"; + }; + +in + +stdenv.mkDerivation rec { + name = "brickd-${version}"; + + src = fetchgit { + url = "git://github.com/Tinkerforge/brickd.git"; + rev = "refs/tags/v${version}"; + sha256 = "08g587bgx628g5vykh482wxiw0z98fmq4lf5ka6aw0v8l9gim9yf"; + }; + + buildInputs = [ libusb pkgconfig pmutils udev ]; + + # shell thing didn't work so i replaced it using nix + prePatch = '' + substituteInPlace src/brickd/Makefile --replace 'PKG_CONFIG := $(shell which pkg-config 2> /dev/null)' "PKG_CONFIG := $pkgconfig/bin/pkg_config"; + ''; + + buildPhase = '' + export + # build the brickd binary + mkdir src/daemonlib + cp -r ${daemonlib}/* src/daemonlib + cd src/brickd + make + + # build and execute the unit tests + cd ../tests + make + for i in array_test base58_test node_test putenv_test queue_test sha1_test; do + echo "running unit test $i:" + ./$i + done + ''; + + installPhase = '' + cd ../brickd + mkdir -p $out/bin + cp brickd $out/bin/brickd + ''; + + meta = { + homepage = http://www.tinkerforge.com/; + description = "The Brick Daemon is a daemon (or service on Windows) that acts as a bridge between the Bricks/Bricklets and the API bindings for the different programming languages."; + maintainers = [ stdenv.lib.maintainers.qknight ]; + license = "GPLv2"; + platforms = stdenv.lib.platforms.all; + }; +} |