sixpair: init at 2007-04-18 (#43072)
This is a small c program used for pairing with a wireless PlayStation 3 controller via bluetooth. I included a patch that replaces the depricated 'hcitool' command with 'bluetoothctl'. For further info visit: http://www.pabr.org/sixlinux/
This commit is contained in:
parent
b1abb5a8c2
commit
cdebd1c61f
38
pkgs/tools/misc/sixpair/default.nix
Normal file
38
pkgs/tools/misc/sixpair/default.nix
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{ stdenv, fetchurl, libusb }:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "sixpair-2007-04-18";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = http://www.pabr.org/sixlinux/sixpair.c;
|
||||||
|
sha256 = "1b0a3k7gs544cbji7n29jxlrsscwfx6s1r2sgwdl6hmkc1l9gagr";
|
||||||
|
};
|
||||||
|
|
||||||
|
# hcitool is depricated
|
||||||
|
patches = [ ./hcitool.patch ];
|
||||||
|
|
||||||
|
buildInputs = [ libusb ];
|
||||||
|
|
||||||
|
unpackPhase = ''
|
||||||
|
cp $src sixpair.c
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
cc -o sixpair sixpair.c -lusb
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp sixpair $out/bin/sixpair
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Pair with SIXAXIS controllers over USB";
|
||||||
|
longDescription = ''
|
||||||
|
This command-line utility searches USB buses for SIXAXIS controllers and tells them to connect to a new Bluetooth master.
|
||||||
|
'';
|
||||||
|
homepage = http://www.pabr.org/sixlinux/;
|
||||||
|
license = stdenv.lib.licenses.gpl2;
|
||||||
|
maintainers = [ stdenv.lib.maintainers.tomsmeets ];
|
||||||
|
platforms = stdenv.lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
19
pkgs/tools/misc/sixpair/hcitool.patch
Normal file
19
pkgs/tools/misc/sixpair/hcitool.patch
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
diff --git a/sixpair.c b/sixpair.c
|
||||||
|
index b009a6f..78b7ef0 100644
|
||||||
|
--- a/sixpair.c
|
||||||
|
+++ b/sixpair.c
|
||||||
|
@@ -76,11 +76,11 @@ void process_device(int argc, char **argv, struct usb_device *dev,
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
- FILE *f = popen("hcitool dev", "r");
|
||||||
|
+ FILE *f = popen("bluetoothctl list", "r");
|
||||||
|
if ( !f ||
|
||||||
|
- fscanf(f, "%*s\n%*s %x:%x:%x:%x:%x:%x",
|
||||||
|
+ fscanf(f, "%*s %x:%x:%x:%x:%x:%x",
|
||||||
|
&mac[0],&mac[1],&mac[2],&mac[3],&mac[4],&mac[5]) != 6 ) {
|
||||||
|
- printf("Unable to retrieve local bd_addr from `hcitool dev`.\n");
|
||||||
|
+ printf("Unable to retrieve local bd_addr from `bluetoothctl list`.\n");
|
||||||
|
printf("Please enable Bluetooth or specify an address manually.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
@ -5040,6 +5040,8 @@ with pkgs;
|
|||||||
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
|
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sixpair = callPackage ../tools/misc/sixpair {};
|
||||||
|
|
||||||
skippy-xd = callPackage ../tools/X11/skippy-xd {};
|
skippy-xd = callPackage ../tools/X11/skippy-xd {};
|
||||||
|
|
||||||
sks = callPackage ../servers/sks { inherit (ocamlPackages_4_02) ocaml camlp4; };
|
sks = callPackage ../servers/sks { inherit (ocamlPackages_4_02) ocaml camlp4; };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user