From 0353b8b3ffcbaa102d36fa7e8f2bb218a1374820 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 26 Jan 2016 01:57:30 +0100 Subject: pkgs: Add a small utility to dump joystick GUIDs SDL 2 has an environment variable called SDL_GAMECONTROLLERCONFIG, which lists button/axis mappings of various game controllers attached to the system. The game controllers are themselves identified using a GUID which is SDL 2 specific and this tool is there to just dump the name of a particular game controller along with the GUID so it's easier to get the GUID. Signed-off-by: aszlig --- pkgs/list-gamecontrollers/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 pkgs/list-gamecontrollers/default.nix (limited to 'pkgs/list-gamecontrollers/default.nix') diff --git a/pkgs/list-gamecontrollers/default.nix b/pkgs/list-gamecontrollers/default.nix new file mode 100644 index 00000000..c207d2eb --- /dev/null +++ b/pkgs/list-gamecontrollers/default.nix @@ -0,0 +1,10 @@ +{ runCommand, pkgconfig, SDL2 }: + +runCommand "list-gamecontrollers" { + buildInputs = [ pkgconfig SDL2 ]; +} '' + mkdir -p "$out/bin" + gcc -Werror "${./list-gc.c}" \ + $(pkg-config --libs --cflags sdl2) \ + -o "$out/bin/list-gamecontrollers" +'' -- cgit 1.4.1