git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #23572 from rycee/fix/gpsbabel-darwin

gpsbabel: fix darwin build

commitd55ab1a6b93b28188f3cc136f794325dd9391604 authorDaiderd Jordan <daiderd@gmail.com> dateTue 11 Apr 2017, 20:40 (10 years ago) parent73f04dd9561fec
3 files changed+33−7
pkgs/applications/misc/gpsbabel/clang-4.patch+22 pkgs/applications/misc/gpsbabel/default.nix+8−6 pkgs/top-level/all-packages.nix+3−1
pkgs/applications/misc/gpsbabel/clang-4.patchnew file+22
@@ -0,0 +1,22 @@
1+diff --git a/bushnell.cc b/bushnell.cc
2+index 8fa844d..40707c4 100644
3+--- a/bushnell.cc
4++++ b/bushnell.cc
5+@@ -135,7 +135,7 @@ bushnell_get_icon_from_name(QString name)
6+ name = "Waypoint";
7+ }
8+
9+- for (t = bushnell_icons; t->icon > 0; t++) {
10++ for (t = bushnell_icons; t->icon != 0; t++) {
11+ if (0 == name.compare(t->icon, Qt::CaseInsensitive)) {
12+ return t->symbol;
13+ }
14+@@ -147,7 +147,7 @@ static const char*
15+ bushnell_get_name_from_symbol(signed int s)
16+ {
17+ icon_mapping_t* t;
18+- for (t = bushnell_icons; t->icon > 0; t++) {
19++ for (t = bushnell_icons; t->icon != 0; t++) {
20+ if (s == t->symbol) {
21+ return t->icon;
22+ }
pkgs/applications/misc/gpsbabel/default.nix+8−6
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, fetchpatch, zlib, qt4, which }:
1+{ lib, stdenv, fetchurl, fetchpatch, zlib, qt4, which, IOKit }:
22
33stdenv.mkDerivation rec {
44 name = "gpsbabel-${version}";
@@ -12,13 +12,15 @@ stdenv.mkDerivation rec {
1212 };
1313
1414 patches = [
15+ ./clang-4.patch
1516 (fetchpatch {
1617 url = https://sources.debian.net/data/main/g/gpsbabel/1.5.3-2/debian/patches/use_minizip;
1718 sha256 = "03fpsmlx1wc48d1j405zkzp8j64hcp0z72islf4mk1immql3ibcr";
1819 })
1920 ];
2021
21− buildInputs = [ zlib qt4 which ];
22+ buildInputs = [ zlib qt4 which ]
23+ ++ lib.optionals stdenv.isDarwin [ IOKit ];
2224
2325 /* FIXME: Building the documentation, with "make doc", requires this:
2426
@@ -40,11 +42,11 @@ stdenv.mkDerivation rec {
4042 patchShebangs testo
4143 substituteInPlace testo \
4244 --replace "-x /usr/bin/hexdump" ""
43− '' + (
45+ ''
4446 # The raymarine and gtm tests fail on i686 despite -ffloat-store.
45− if stdenv.isi686 then "rm -v testo.d/raymarine.test testo.d/gtm.test;"
46− else ""
47− );
47+ + lib.optionalString stdenv.isi686 "rm -v testo.d/raymarine.test testo.d/gtm.test;"
48+ # The gtm, kml and tomtom asc tests fail on darwin, see PR #23572.
49+ + lib.optionalString stdenv.isDarwin "rm -v testo.d/gtm.test testo.d/kml.test testo.d/tomtom_asc.test";
4850
4951 meta = with stdenv.lib; {
5052 description = "Convert, upload and download data from GPS and Map programs";
pkgs/top-level/all-packages.nix+3−1
@@ -13985,7 +13985,9 @@ with pkgs;
1398513985
1398613986 gosmore = callPackage ../applications/misc/gosmore { };
1398713987
13988− gpsbabel = libsForQt5.callPackage ../applications/misc/gpsbabel { };
13988+ gpsbabel = libsForQt5.callPackage ../applications/misc/gpsbabel {
13989+ inherit (darwin) IOKit;
13990+ };
1398913991
1399013992 gpscorrelate = callPackage ../applications/misc/gpscorrelate { };
1399113993