bluez5: fix python programs

This commit is contained in:
Aristid Breitkreuz 2013-08-27 23:10:39 +02:00 committed by Bjørn Forsman
parent 69c57b92e8
commit 319629355c
1 changed files with 12 additions and 11 deletions

View File

@ -1,13 +1,9 @@
{ stdenv, fetchurl, pkgconfig, dbus, glib, libusb, alsaLib, python, makeWrapper { stdenv, fetchurl, pkgconfig, dbus, glib, libusb, alsaLib, python,
, pythonDBus, pygobject, readline, libsndfile, udev, libical, systemd }: pythonPackages, pythonDBus, readline, libsndfile, udev, libical,
systemd }:
assert stdenv.isLinux; assert stdenv.isLinux;
let
pythonpath = "${pythonDBus}/lib/${python.libPrefix}/site-packages:"
+ "${pygobject}/lib/${python.libPrefix}/site-packages";
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "bluez-5.8"; name = "bluez-5.8";
@ -16,8 +12,11 @@ stdenv.mkDerivation rec {
sha256 = "1l33lq1lpg7hy26138ir5dj4gl3mql2qxpj20rjnnwyckc3jk700"; sha256 = "1l33lq1lpg7hy26138ir5dj4gl3mql2qxpj20rjnnwyckc3jk700";
}; };
pythonPath = with pythonPackages;
[ pythonDBus pygobject3 recursivePthLoader ];
buildInputs = buildInputs =
[ pkgconfig dbus.libs glib libusb alsaLib python makeWrapper [ pkgconfig dbus.libs glib libusb alsaLib python pythonPackages.wrapPython
readline libsndfile udev libical readline libsndfile udev libical
# Disables GStreamer; not clear what it gains us other than a # Disables GStreamer; not clear what it gains us other than a
# zillion extra dependencies. # zillion extra dependencies.
@ -49,7 +48,9 @@ stdenv.mkDerivation rec {
# FIXME: Move these into a separate package to prevent Bluez from # FIXME: Move these into a separate package to prevent Bluez from
# depending on Python etc. # depending on Python etc.
postInstall = '' postInstall = ''
pushd test mkdir $out/test
cp -a test $out
pushd $out/test
for a in \ for a in \
simple-agent \ simple-agent \
test-adapter \ test-adapter \
@ -58,10 +59,10 @@ stdenv.mkDerivation rec {
list-devices \ list-devices \
monitor-bluetooth \ monitor-bluetooth \
; do ; do
cp $a $out/bin/bluez-$a ln -s ../test/$a $out/bin/bluez-$a
wrapProgram $out/bin/bluez-$a --prefix PYTHONPATH : ${pythonpath}
done done
popd popd
wrapPythonProgramsIn $out/test "$out/test $pythonPath"
''; '';
meta = { meta = {