Skip to content

Commit

Permalink
Merge pull request #23572 from rycee/fix/gpsbabel-darwin
Browse files Browse the repository at this point in the history
gpsbabel: fix darwin build
  • Loading branch information
LnL7 committed Apr 11, 2017
2 parents 73f04dd + 9561fec commit d55ab1a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
22 changes: 22 additions & 0 deletions pkgs/applications/misc/gpsbabel/clang-4.patch
Original file line number Diff line number Diff line change
@@ -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;
}
14 changes: 8 additions & 6 deletions pkgs/applications/misc/gpsbabel/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchpatch, zlib, qt4, which }:
{ lib, stdenv, fetchurl, fetchpatch, zlib, qt4, which, IOKit }:

stdenv.mkDerivation rec {
name = "gpsbabel-${version}";
Expand All @@ -12,13 +12,15 @@ 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";
})
];

buildInputs = [ zlib qt4 which ];
buildInputs = [ zlib qt4 which ]
++ lib.optionals stdenv.isDarwin [ IOKit ];

/* FIXME: Building the documentation, with "make doc", requires this:
Expand All @@ -40,11 +42,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 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";
Expand Down
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };

Expand Down

0 comments on commit d55ab1a

Please sign in to comment.