From 08656a73f06e27c2a73ccdfcaa434f8ee26da2fb Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 6 Mar 2017 23:29:48 +0100 Subject: [PATCH 1/2] gpsbabel: fix darwin build --- pkgs/applications/misc/gpsbabel/default.nix | 13 +++++++------ pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix index 6c248bc4dfa..d017c704484 100644 --- a/pkgs/applications/misc/gpsbabel/default.nix +++ b/pkgs/applications/misc/gpsbabel/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchpatch, zlib, qt4, which }: +{ lib, stdenv, fetchurl, fetchpatch, zlib, qt4, which, IOKit }: stdenv.mkDerivation rec { name = "gpsbabel-${version}"; @@ -18,7 +18,8 @@ stdenv.mkDerivation rec { }) ]; - buildInputs = [ zlib qt4 which ]; + buildInputs = [ zlib qt4 which ] + ++ lib.optionals stdenv.isDarwin [ IOKit ]; /* FIXME: Building the documentation, with "make doc", requires this: @@ -40,11 +41,11 @@ stdenv.mkDerivation rec { patchShebangs testo substituteInPlace testo \ --replace "-x /usr/bin/hexdump" "" - '' + ( + '' # The raymarine and gtm tests fail on i686 despite -ffloat-store. - if stdenv.isi686 then "rm -v testo.d/raymarine.test testo.d/gtm.test;" - else "" - ); + + lib.optionalString stdenv.isi686 "rm -v testo.d/raymarine.test testo.d/gtm.test;" + # The tomtom asc test fails on darwin, see PR #23572. + + lib.optionalString stdenv.isDarwin "rm -v testo.d/tomtom_asc.test;"; meta = with stdenv.lib; { description = "Convert, upload and download data from GPS and Map programs"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45562df3170..c5b51ab14cb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13985,7 +13985,9 @@ with pkgs; gosmore = callPackage ../applications/misc/gosmore { }; - gpsbabel = libsForQt5.callPackage ../applications/misc/gpsbabel { }; + gpsbabel = libsForQt5.callPackage ../applications/misc/gpsbabel { + inherit (darwin) IOKit; + }; gpscorrelate = callPackage ../applications/misc/gpscorrelate { }; From 9561fecd02a547e2a47afdc9afc51af72f2e3eff Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 11 Apr 2017 20:18:53 +0200 Subject: [PATCH 2/2] gpsbabel: fix build with llvm-4 --- pkgs/applications/misc/gpsbabel/clang-4.patch | 22 +++++++++++++++++++ pkgs/applications/misc/gpsbabel/default.nix | 5 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/misc/gpsbabel/clang-4.patch diff --git a/pkgs/applications/misc/gpsbabel/clang-4.patch b/pkgs/applications/misc/gpsbabel/clang-4.patch new file mode 100644 index 00000000000..6bd19ae6044 --- /dev/null +++ b/pkgs/applications/misc/gpsbabel/clang-4.patch @@ -0,0 +1,22 @@ +diff --git a/bushnell.cc b/bushnell.cc +index 8fa844d..40707c4 100644 +--- a/bushnell.cc ++++ b/bushnell.cc +@@ -135,7 +135,7 @@ bushnell_get_icon_from_name(QString name) + name = "Waypoint"; + } + +- for (t = bushnell_icons; t->icon > 0; t++) { ++ for (t = bushnell_icons; t->icon != 0; t++) { + if (0 == name.compare(t->icon, Qt::CaseInsensitive)) { + return t->symbol; + } +@@ -147,7 +147,7 @@ static const char* + bushnell_get_name_from_symbol(signed int s) + { + icon_mapping_t* t; +- for (t = bushnell_icons; t->icon > 0; t++) { ++ for (t = bushnell_icons; t->icon != 0; t++) { + if (s == t->symbol) { + return t->icon; + } diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix index d017c704484..ace89cd8a21 100644 --- a/pkgs/applications/misc/gpsbabel/default.nix +++ b/pkgs/applications/misc/gpsbabel/default.nix @@ -12,6 +12,7 @@ stdenv.mkDerivation rec { }; patches = [ + ./clang-4.patch (fetchpatch { url = https://sources.debian.net/data/main/g/gpsbabel/1.5.3-2/debian/patches/use_minizip; sha256 = "03fpsmlx1wc48d1j405zkzp8j64hcp0z72islf4mk1immql3ibcr"; @@ -44,8 +45,8 @@ stdenv.mkDerivation rec { '' # The raymarine and gtm tests fail on i686 despite -ffloat-store. + lib.optionalString stdenv.isi686 "rm -v testo.d/raymarine.test testo.d/gtm.test;" - # The tomtom asc test fails on darwin, see PR #23572. - + lib.optionalString stdenv.isDarwin "rm -v testo.d/tomtom_asc.test;"; + # The gtm, kml and tomtom asc tests fail on darwin, see PR #23572. + + lib.optionalString stdenv.isDarwin "rm -v testo.d/gtm.test testo.d/kml.test testo.d/tomtom_asc.test"; meta = with stdenv.lib; { description = "Convert, upload and download data from GPS and Map programs";