Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

cwiid: fix cross-compilation

* Remove hardcoded use of ar.
* Move flex and bison to nativeBuildInputs.
* Reformat for good measure.

authored by Zane van Iperen and committed by Benno Fünfstück f36a80e5 e1107739

+56 -9
+30 -9
pkgs/development/libraries/cwiid/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, autoreconfHook, bison, flex, bluez, pkg-config, gtk2 }: 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , autoreconfHook 5 + , bison 6 + , flex 7 + , bluez 8 + , pkg-config 9 + , gtk2 10 + }: 2 11 3 12 stdenv.mkDerivation rec { 4 13 pname = "cwiid"; 5 14 version = "unstable-2010-02-21"; 6 15 7 16 src = fetchFromGitHub { 8 - owner = "abstrakraft"; 9 - repo = "cwiid"; 10 - rev = "fadf11e89b579bcc0336a0692ac15c93785f3f82"; 17 + owner = "abstrakraft"; 18 + repo = "cwiid"; 19 + rev = "fadf11e89b579bcc0336a0692ac15c93785f3f82"; 11 20 sha256 = "0qdb0x757k76nfj32xc2nrrdqd9jlwgg63vfn02l2iznnzahxp0h"; 12 21 }; 13 22 ··· 19 28 sed -i -e '/$(LDCONFIG)/d' common/include/lib.mak.in 20 29 ''; 21 30 22 - buildInputs = [ bison flex bluez gtk2 ]; 31 + patches = [ 32 + ./fix-ar.diff 33 + ]; 23 34 24 - nativeBuildInputs = [ autoreconfHook pkg-config ]; 35 + buildInputs = [ 36 + bluez 37 + gtk2 38 + ]; 39 + 40 + nativeBuildInputs = [ 41 + autoreconfHook 42 + pkg-config 43 + bison 44 + flex 45 + ]; 25 46 26 47 NIX_LDFLAGS = "-lbluetooth"; 27 48 ··· 32 53 33 54 meta = with lib; { 34 55 description = "Linux Nintendo Wiimote interface"; 35 - homepage = "http://cwiid.org"; 36 - license = licenses.gpl2Plus; 56 + homepage = "http://cwiid.org"; 57 + license = licenses.gpl2Plus; 37 58 maintainers = with maintainers; [ bennofs ]; 38 - platforms = platforms.linux; 59 + platforms = platforms.linux; 39 60 }; 40 61 }
+26
pkgs/development/libraries/cwiid/fix-ar.diff
··· 1 + diff --git a/common/include/lib.mak.in b/common/include/lib.mak.in 2 + index 3afbb14..b8df9d9 100644 3 + --- a/common/include/lib.mak.in 4 + +++ b/common/include/lib.mak.in 5 + @@ -22,7 +22,7 @@ static: $(STATIC_LIB) 6 + shared: $(SHARED_LIB) 7 + 8 + $(STATIC_LIB): $(OBJECTS) 9 + - ar rcs $(STATIC_LIB) $(OBJECTS) 10 + + $(AR) rcs $(STATIC_LIB) $(OBJECTS) 11 + 12 + $(SHARED_LIB): $(OBJECTS) 13 + $(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $(SHARED_LIB) \ 14 + diff --git a/configure.ac b/configure.ac 15 + index 82ca3e1..0a78283 100644 16 + --- a/configure.ac 17 + +++ b/configure.ac 18 + @@ -15,6 +15,8 @@ if test "$YACC" != "bison -y"; then 19 + AC_MSG_ERROR([bison not found]) 20 + fi 21 + 22 + +AC_CHECK_TOOL([AR], [ar], [:]) 23 + + 24 + AC_ARG_WITH( 25 + [python], 26 + [AS_HELP_STRING([--without-python],[compile without python support])],