about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@gmail.com>2020-04-11 14:20:47 +0300
committerRobert Helgesson <robert@rycee.net>2020-04-13 17:12:20 +0200
commit6f6d2124fc890c41c7aaf0bee50f386866d30c15 (patch)
tree534d68ef036786409998d1432ffb36919d7d9a52 /pkgs/applications/misc
parent156c67858fbd85c7340167c0fe2ebb8a19695215 (diff)
downloadnixlib-6f6d2124fc890c41c7aaf0bee50f386866d30c15.tar
nixlib-6f6d2124fc890c41c7aaf0bee50f386866d30c15.tar.gz
nixlib-6f6d2124fc890c41c7aaf0bee50f386866d30c15.tar.bz2
nixlib-6f6d2124fc890c41c7aaf0bee50f386866d30c15.tar.lz
nixlib-6f6d2124fc890c41c7aaf0bee50f386866d30c15.tar.xz
nixlib-6f6d2124fc890c41c7aaf0bee50f386866d30c15.tar.zst
nixlib-6f6d2124fc890c41c7aaf0bee50f386866d30c15.zip
gpsbabel-gui: init at 1.6.0
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/gpsbabel/gui.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/applications/misc/gpsbabel/gui.nix b/pkgs/applications/misc/gpsbabel/gui.nix
new file mode 100644
index 000000000000..57eca9f47a58
--- /dev/null
+++ b/pkgs/applications/misc/gpsbabel/gui.nix
@@ -0,0 +1,49 @@
+{ stdenv, mkDerivation, qmake, qttools, qtwebkit, qttranslations, gpsbabel }:
+
+mkDerivation {
+  pname = "gpsbabel-gui";
+
+  inherit (gpsbabel) src version;
+
+  sourceRoot = "source/gui";
+
+  nativeBuildInputs = [ qmake qttools ];
+  buildInputs = [ qtwebkit ];
+
+  postPatch = ''
+    substituteInPlace mainwindow.cc \
+      --replace "QApplication::applicationDirPath() + \"/" "\"" \
+      --replace "QApplication::applicationDirPath() + '/' + " "" \
+      --replace "translator.load(full_filename)" "translator.load(filename)" \
+      --replace "gpsbabelfe_%1.qm" "$out/share/gpsbabel/translations/gpsbabelfe_%1.qm" \
+      --replace "gpsbabel_%1.qm" "$out/share/gpsbabel/translations/gpsbabel_%1.qm" \
+      --replace "qt_%1.qm" "${qttranslations}/translations/qt_%1.qm"
+    substituteInPlace formatload.cc \
+      --replace "QApplication::applicationDirPath() + \"/" "\""
+    substituteInPlace gpsbabel.desktop \
+      --replace "gpsbabelfe-bin" "gpsbabelfe"
+  '';
+
+  preConfigure = ''
+    lrelease *.ts coretool/*.ts
+  '';
+
+  qtWrapperArgs = [
+    "--prefix PATH : ${stdenv.lib.makeBinPath [ gpsbabel ]}"
+  ];
+
+  postInstall = ''
+    install -Dm755 objects/gpsbabelfe -t $out/bin
+    install -Dm644 gpsbabel.desktop -t $out/share/applications
+    install -Dm644 images/appicon.png $out/share/icons/hicolor/512x512/apps/gpsbabel.png
+    install -Dm644 *.qm coretool/*.qm -t $out/share/gpsbabel/translations
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Qt-based GUI for gpsbabel";
+    homepage = "http://www.gpsbabel.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ sikmir ];
+    platforms = with platforms; linux;
+  };
+}