gpsbabel: 1.7.0 → 1.8.0

* adopt package
* add debian patches
* fix on darwin
* build documentation

+115 -92
+26
pkgs/applications/misc/gpsbabel/debian-patches.nix
··· 1 + # Generated by debian-patches.sh from debian-patches.txt 2 + let 3 + prefix = "https://sources.debian.org/data/main/g/gpsbabel/1.8.0+ds-4/debian/patches"; 4 + in 5 + [ 6 + { 7 + url = "${prefix}/gpsbabelfe_disable_version_check"; 8 + sha256 = "1kk1iq4mbmldl1jjvd4bphr0165rgn2gpqdyyd1vq8v8wjx942sb"; 9 + } 10 + { 11 + url = "${prefix}/gpsbabelfe_opt-in-for-usage-data-reporting"; 12 + sha256 = "0dr3jyn8sxx9vw3w11gir6jvshlda0ldmhlq4aq313xn6d1j8qv2"; 13 + } 14 + { 15 + url = "${prefix}/gpsbabelfe_do-not-check-for-newer-version"; 16 + sha256 = "0kmmxcq1k9p84v9cjagda1cqcc9p7p48i104l3z6clc17zixwgai"; 17 + } 18 + { 19 + url = "${prefix}/htmldoc-location"; 20 + sha256 = "0nk3gz3l0q68d7blzfkbkvr630xy8y7vlxalnzlbdigqcx7lk54f"; 21 + } 22 + { 23 + url = "${prefix}/Disable-donation-nagging"; 24 + sha256 = "11j2ffa0hn5cy8xw98jndkf735ar39sf6rl28bn91pxd38xyaz5b"; 25 + } 26 + ]
+6
pkgs/applications/misc/gpsbabel/debian-patches.txt
··· 1 + gpsbabel/1.8.0+ds-4 2 + gpsbabelfe_disable_version_check 3 + gpsbabelfe_opt-in-for-usage-data-reporting 4 + gpsbabelfe_do-not-check-for-newer-version 5 + htmldoc-location 6 + Disable-donation-nagging
+78 -37
pkgs/applications/misc/gpsbabel/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, fetchpatch, libusb1, qtbase, zlib, IOKit, which, expat }: 1 + { lib, stdenv, fetchFromGitHub, fetchurl, pkg-config, which 2 + , qtbase, qmake, qttools, qttranslations, wrapQtAppsHook 3 + , libusb1, shapelib, zlib 4 + , withGUI ? false, qtserialport 5 + , withMapPreview ? (!stdenv.isDarwin), qtwebengine 6 + , withDoc ? false, docbook_xml_dtd_45, docbook_xsl, expat, fop, libxml2, libxslt, perl 7 + }: 2 8 3 9 stdenv.mkDerivation rec { 4 10 pname = "gpsbabel"; 5 - version = "1.7.0"; 11 + version = "1.8.0"; 6 12 7 13 src = fetchFromGitHub { 8 14 owner = "gpsbabel"; 9 15 repo = "gpsbabel"; 10 16 rev = "gpsbabel_${lib.replaceStrings ["."] ["_"] version}"; 11 - sha256 = "010g0vd2f5knpq5p7qfnl31kv3r8m5sjdsafcinbj5gh02j2nzpy"; 17 + sha256 = "sha256-0w8LsO+HwqZF8SQmwd8bCKma9PCM0hAzXhzWR4DgAHs="; 12 18 }; 13 19 14 - patches = [ 15 - (fetchpatch { 16 - url = "https://sources.debian.net/data/main/g/gpsbabel/1.5.3-2/debian/patches/use_minizip"; 17 - sha256 = "03fpsmlx1wc48d1j405zkzp8j64hcp0z72islf4mk1immql3ibcr"; 18 - }) 19 - ]; 20 + patches = map fetchurl (import ./debian-patches.nix); 20 21 21 - buildInputs = [ libusb1 qtbase zlib ] 22 - ++ lib.optionals stdenv.isDarwin [ IOKit ]; 22 + postPatch = '' 23 + patchShebangs testo 24 + '' + lib.optionalString withGUI '' 25 + # See https://github.com/NixOS/nixpkgs/issues/86054 26 + substituteInPlace gui/mainwindow.cc \ 27 + --replace 'QLibraryInfo::location(QLibraryInfo::TranslationsPath)' \ 28 + 'QLatin1String("${qttranslations}/translations")' 29 + '' + lib.optionalString withDoc '' 30 + substituteInPlace gbversion.h.qmake.in \ 31 + --replace /usr/share/doc $doc/share/doc 32 + 33 + substituteInPlace testo.d/serialization.test \ 34 + --replace /usr/share/doc $doc/share/doc 35 + 36 + substituteInPlace xmldoc/gpsbabel_man.xml \ 37 + --replace /usr/share/doc $doc/share/doc 38 + ''; 39 + 40 + outputs = [ "out" ] ++ lib.optional withDoc "doc"; 41 + 42 + nativeBuildInputs = [ pkg-config qmake ] 43 + ++ lib.optionals withGUI [ qttools wrapQtAppsHook ] 44 + ++ lib.optionals withDoc [ docbook_xml_dtd_45 docbook_xsl expat fop libxml2 libxslt perl ]; 23 45 24 - checkInputs = [ expat.dev which ]; # Avoid ./testo.d/kml.test: line 74: which: command not found. Skipping KML validation phase. 46 + buildInputs = [ libusb1 shapelib zlib ] 47 + ++ lib.optional withGUI qtserialport 48 + ++ lib.optional (withGUI && withMapPreview) qtwebengine; 25 49 26 - /* FIXME: Building the documentation, with "make doc", requires this: 50 + checkInputs = [ libxml2 which ]; 27 51 28 - [ libxml2 libxslt perl docbook_xml_dtd_412 docbook_xsl fop ] 52 + preConfigure = lib.optionalString withGUI '' 53 + lrelease gui/*.ts gui/coretool/*.ts 54 + ''; 55 + 56 + qmakeFlags = [ 57 + "WITH_LIBUSB=pkgconfig" 58 + "WITH_SHAPELIB=pkgconfig" 59 + "WITH_ZLIB=pkgconfig" 60 + ] ++ lib.optionals (withGUI && !withMapPreview) [ 61 + "CONFIG+=disable-mappreview" 62 + ]; 29 63 30 - But FOP isn't packaged yet. */ 64 + makeFlags = lib.optional withGUI "gui" 65 + ++ lib.optionals withDoc [ "gpsbabel.pdf" "gpsbabel.html" "gpsbabel.org" ]; 31 66 32 - configureFlags = [ "--with-zlib=system" ] 33 - # Floating point behavior on i686 causes test failures. Preventing 34 - # extended precision fixes this problem. 35 - ++ lib.optionals stdenv.isi686 [ 36 - "CFLAGS=-ffloat-store" "CXXFLAGS=-ffloat-store" 37 - ]; 67 + # Floating point behavior on i686 causes nmea.test failures. Preventing 68 + # extended precision fixes this problem. 69 + NIX_CFLAGS_COMPILE = lib.optional stdenv.isi686 "-ffloat-store"; 38 70 39 - enableParallelBuilding = true; 71 + doCheck = true; 40 72 41 73 dontWrapQtApps = true; 42 74 43 - doCheck = true; 44 - preCheck = '' 45 - patchShebangs testo 46 - substituteInPlace testo \ 47 - --replace "-x /usr/bin/hexdump" "" 75 + installPhase = '' 76 + install -Dm755 gpsbabel -t $out/bin 77 + '' + lib.optionalString withGUI (if stdenv.isDarwin then '' 78 + mkdir -p $out/Applications 79 + mv gui/GPSBabelFE.app $out/Applications 80 + install -Dm644 gui/*.qm gui/coretool/*.qm -t $out/Applications/GPSBabelFE.app/Contents/Resources/translations 81 + ln -s $out/bin/gpsbabel $out/Applications/GPSBabelFE.app/Contents/MacOS 82 + '' else '' 83 + install -Dm755 gui/objects/gpsbabelfe -t $out/bin 84 + install -Dm644 gui/gpsbabel.desktop -t $out/share/application 85 + install -Dm644 gui/images/appicon.png $out/share/icons/hicolor/512x512/apps/gpsbabel.png 86 + install -Dm644 gui/*.qm gui/coretool/*.qm -t $out/share/gpsbabel/translations 87 + '') + lib.optionalString withDoc '' 88 + install -Dm655 gpsbabel.{html,pdf} -t $doc/share/doc/gpsbabel 89 + cp -r html $doc/share/doc/gpsbabel 90 + ''; 48 91 49 - rm -v testo.d/alantrl.test 50 - '' 51 - # The raymarine and gtm tests fail on i686 despite -ffloat-store. 52 - + lib.optionalString stdenv.isi686 "rm -v testo.d/raymarine.test testo.d/gtm.test;" 53 - # The gtm, kml and tomtom asc tests fail on darwin, see PR #23572. 54 - + lib.optionalString stdenv.isDarwin "rm -v testo.d/gtm.test testo.d/kml.test testo.d/tomtom_asc.test testo.d/classic-2.test" 55 - # The arc-project test fails on aarch64. 56 - + lib.optionalString stdenv.isAarch64 "rm -v testo.d/arc-project.test"; 92 + postFixup = lib.optionalString withGUI (if stdenv.isDarwin then '' 93 + wrapQtApp "$out/Applications/GPSBabelFE.app/Contents/MacOS/GPSBabelFE" 94 + '' else '' 95 + wrapQtApp "$out/bin/gpsbabelfe" 96 + ''); 57 97 58 98 meta = with lib; { 59 99 description = "Convert, upload and download data from GPS and Map programs"; ··· 75 115 process data that may (or may not be) placed on a map, such as 76 116 waypoints, tracks, and routes. 77 117 ''; 78 - homepage = "http://www.gpsbabel.org/"; 118 + homepage = "https://www.gpsbabel.org/"; 79 119 license = licenses.gpl2Plus; 80 - platforms = platforms.all; 120 + platforms = platforms.unix; 121 + maintainers = with maintainers; [ sikmir ]; 81 122 }; 82 123 }
-51
pkgs/applications/misc/gpsbabel/gui.nix
··· 1 - { lib, mkDerivation, qmake, qttools, qtwebkit, qttranslations, gpsbabel }: 2 - 3 - mkDerivation { 4 - pname = "gpsbabel-gui"; 5 - 6 - inherit (gpsbabel) src version; 7 - 8 - sourceRoot = "source/gui"; 9 - 10 - nativeBuildInputs = [ qmake qttools ]; 11 - buildInputs = [ qtwebkit ]; 12 - 13 - dontWrapQtApps = true; 14 - 15 - postPatch = '' 16 - substituteInPlace mainwindow.cc \ 17 - --replace "QApplication::applicationDirPath() + \"/" "\"" \ 18 - --replace "QApplication::applicationDirPath() + '/' + " "" \ 19 - --replace "translator.load(full_filename)" "translator.load(filename)" \ 20 - --replace "gpsbabelfe_%1.qm" "$out/share/gpsbabel/translations/gpsbabelfe_%1.qm" \ 21 - --replace "gpsbabel_%1.qm" "$out/share/gpsbabel/translations/gpsbabel_%1.qm" \ 22 - --replace "qt_%1.qm" "${qttranslations}/translations/qt_%1.qm" 23 - substituteInPlace formatload.cc \ 24 - --replace "QApplication::applicationDirPath() + \"/" "\"" 25 - substituteInPlace gpsbabel.desktop \ 26 - --replace "gpsbabelfe-bin" "gpsbabelfe" 27 - ''; 28 - 29 - preConfigure = '' 30 - lrelease *.ts coretool/*.ts 31 - ''; 32 - 33 - qtWrapperArgs = [ 34 - "--prefix PATH : ${lib.makeBinPath [ gpsbabel ]}" 35 - ]; 36 - 37 - postInstall = '' 38 - install -Dm755 objects/gpsbabelfe -t $out/bin 39 - install -Dm644 gpsbabel.desktop -t $out/share/applications 40 - install -Dm644 images/appicon.png $out/share/icons/hicolor/512x512/apps/gpsbabel.png 41 - install -Dm644 *.qm coretool/*.qm -t $out/share/gpsbabel/translations 42 - ''; 43 - 44 - meta = with lib; { 45 - description = "Qt-based GUI for gpsbabel"; 46 - homepage = "http://www.gpsbabel.org/"; 47 - license = licenses.gpl2; 48 - maintainers = with maintainers; [ sikmir ]; 49 - platforms = with platforms; linux; 50 - }; 51 - }
+5 -4
pkgs/top-level/all-packages.nix
··· 26859 26859 26860 26860 gosmore = callPackage ../applications/misc/gosmore { }; 26861 26861 26862 - gpsbabel = libsForQt5.callPackage ../applications/misc/gpsbabel { 26863 - inherit (darwin) IOKit; 26862 + gpsbabel = libsForQt5.callPackage ../applications/misc/gpsbabel { }; 26863 + 26864 + gpsbabel-gui = gpsbabel.override { 26865 + withGUI = true; 26866 + withDoc = true; 26864 26867 }; 26865 - 26866 - gpsbabel-gui = libsForQt5.callPackage ../applications/misc/gpsbabel/gui.nix { }; 26867 26868 26868 26869 gpscorrelate = callPackage ../applications/misc/gpscorrelate { }; 26869 26870