From c0d7db4865c4629b0f35eef3845350b82ca34267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Sat, 29 Mar 2025 13:00:48 +0100 Subject: [PATCH] littlenavmap: init 3.0.16 --- pkgs/by-name/li/littlenavmap/atools.nix | 46 ++++++++ pkgs/by-name/li/littlenavmap/deploy.patch | 108 ++++++++++++++++++ pkgs/by-name/li/littlenavmap/package.nix | 131 ++++++++++++++++++++++ 3 files changed, 285 insertions(+) create mode 100644 pkgs/by-name/li/littlenavmap/atools.nix create mode 100644 pkgs/by-name/li/littlenavmap/deploy.patch create mode 100644 pkgs/by-name/li/littlenavmap/package.nix diff --git a/pkgs/by-name/li/littlenavmap/atools.nix b/pkgs/by-name/li/littlenavmap/atools.nix new file mode 100644 index 000000000000..c24c675f3c3c --- /dev/null +++ b/pkgs/by-name/li/littlenavmap/atools.nix @@ -0,0 +1,46 @@ +{ + lib, + stdenv, + fetchFromGitHub, + libsForQt5, +}: + +stdenv.mkDerivation rec { + pname = "atools"; + version = "4.0.16"; + + src = fetchFromGitHub { + owner = "albar965"; + repo = "atools"; + tag = "v${version}"; + hash = "sha256-wPDE2CUHrf/WoksInYZ9UBEBMISqIkBYcMVu0NaxbmE="; + }; + + nativeBuildInputs = [ + libsForQt5.qmake + ]; + + buildInputs = [ + libsForQt5.qtsvg + ]; + + env.ATOOLS_NO_CRASHHANDLER = "true"; + + installTargets = "deploy"; + + postInstall = '' + rmdir $out + mv D/atools $out + ''; + + dontWrapQtApps = true; + + meta = { + description = "A static library extending Qt for exception handling, a log4j like logging framework, Flight Simulator related utilities like BGL reader and more"; + homepage = "https://github.com/albar965/atools"; + changelog = "https://github.com/albar965/atools/blob/${src.rev}/CHANGELOG.txt"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ ck3d ]; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/by-name/li/littlenavmap/deploy.patch b/pkgs/by-name/li/littlenavmap/deploy.patch new file mode 100644 index 000000000000..d35674f7c2e1 --- /dev/null +++ b/pkgs/by-name/li/littlenavmap/deploy.patch @@ -0,0 +1,108 @@ +diff --git a/littlenavmap.pro b/littlenavmap.pro +index 7c8ed0c6..31590e2c 100644 +--- a/littlenavmap.pro ++++ b/littlenavmap.pro +@@ -777,18 +777,6 @@ OTHER_FILES += \ + # Linux - Copy help and Marble plugins and data + unix:!macx { + copydata.commands = mkdir -p $$OUT_PWD/plugins && +- copydata.commands += cp -avfu \ +- $$MARBLE_LIB_PATH/marble/plugins/libCachePlugin.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libAtmospherePlugin.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libCompassFloatItem.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libGraticulePlugin.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libKmlPlugin.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libLatLonPlugin.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libPn2Plugin.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libMapScaleFloatItem.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libNavigationFloatItem.so \ +- $$MARBLE_LIB_PATH/marble/plugins/libOverviewMap.so \ +- $$OUT_PWD/plugins && + copydata.commands += mkdir -p $$OUT_PWD/translations && + copydata.commands += cp -avfu $$PWD/*.qm $$OUT_PWD/translations && + copydata.commands += cp -avfu $$ATOOLS_INC_PATH/../*.qm $$OUT_PWD/translations && +@@ -796,8 +784,7 @@ unix:!macx { + copydata.commands += cp -avfu $$PWD/web $$OUT_PWD && + copydata.commands += cp -avfu $$PWD/customize $$OUT_PWD && + copydata.commands += cp -avfu $$PWD/marble/data $$OUT_PWD && +- copydata.commands += cp -vf $$PWD/desktop/littlenavmap*.sh $$OUT_PWD && +- copydata.commands += chmod -v a+x $$OUT_PWD/littlenavmap*.sh ++ copydata.commands += true + } + + # Mac OS X - Copy help and Marble plugins and data +@@ -820,73 +807,20 @@ unix:!macx { + + deploy.commands += rm -Rfv $$DEPLOY_DIR && + deploy.commands += mkdir -pv $$DEPLOY_DIR/translations && +- deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB && +- deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB/iconengines && +- deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB/imageformats && +- deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB/platforms && +- deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB/platformthemes && +- deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB/printsupport && +- deploy.commands += mkdir -pv $$DEPLOY_DIR_LIB/sqldrivers && + deploy.commands += echo $$VERSION_NUMBER > $$DEPLOY_DIR/version.txt && +- deploy.commands += echo $$GIT_REVISION_FULL > $$DEPLOY_DIR/revision.txt && +- deploy.commands += cp -Rvf $$MARBLE_LIB_PATH/*.so* $$DEPLOY_DIR_LIB && +- deploy.commands += patchelf --set-rpath \'\$\$ORIGIN/.\' $$DEPLOY_DIR_LIB/libmarblewidget-qt5.so* && +- deploy.commands += patchelf --set-rpath \'\$\$ORIGIN/.\' $$DEPLOY_DIR_LIB/libastro.so* && +- deploy.commands += cp -Rvf $$OUT_PWD/plugins $$DEPLOY_DIR && + deploy.commands += cp -Rvf $$OUT_PWD/data $$DEPLOY_DIR && + deploy.commands += cp -Rvf $$OUT_PWD/help $$DEPLOY_DIR && + deploy.commands += cp -Rvf $$OUT_PWD/web $$DEPLOY_DIR && + deploy.commands += cp -Rvf $$OUT_PWD/customize $$DEPLOY_DIR && + deploy.commands += cp -Rvf $$OUT_PWD/littlenavmap $$DEPLOY_DIR && +- deploy.commands += cp -vfa $$[QT_INSTALL_TRANSLATIONS]/qt_??.qm $$DEPLOY_DIR/translations && +- deploy.commands += cp -vfa $$[QT_INSTALL_TRANSLATIONS]/qt_??_??.qm $$DEPLOY_DIR/translations && +- deploy.commands += cp -vfa $$[QT_INSTALL_TRANSLATIONS]/qtbase*.qm $$DEPLOY_DIR/translations && + deploy.commands += cp -Rvf $$OUT_PWD/translations $$DEPLOY_DIR && + exists($$DATABASE_BASE) : deploy.commands += cp -Rvf $$DATABASE_BASE $$DEPLOY_DIR && + exists($$HELP_BASE) : deploy.commands += cp -Rvf $$HELP_BASE/* $$DEPLOY_DIR/help && +- deploy.commands += cp -vf $$PWD/desktop/\"Little Navmap Portable Linux.sh\" $$DEPLOY_DIR/\"Little Navmap Portable.sh\" && +- deploy.commands += cp -vf $$PWD/desktop/linux-qt.conf $$DEPLOY_DIR/qt.conf && + deploy.commands += cp -vf $$PWD/CHANGELOG.txt $$DEPLOY_DIR && + deploy.commands += cp -vf $$PWD/README.txt $$DEPLOY_DIR && + deploy.commands += cp -vf $$PWD/LICENSE.txt $$DEPLOY_DIR && + deploy.commands += cp -vf $$PWD/resources/icons/littlenavmap.svg $$DEPLOY_DIR && +- deploy.commands += cp -vf \"$$PWD/desktop/Little Navmap.desktop\" $$DEPLOY_DIR && +- exists(/usr/lib/x86_64-linux-gnu/libssl.so.1.1) : deploy.commands += cp -vfaL /usr/lib/x86_64-linux-gnu/libssl.so.1.1 $$DEPLOY_DIR_LIB && +- exists(/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1) : deploy.commands += cp -vfaL /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/iconengines/libqsvgicon.so* $$DEPLOY_DIR_LIB/iconengines && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/imageformats/libqgif.so* $$DEPLOY_DIR_LIB/imageformats && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/imageformats/libqjpeg.so* $$DEPLOY_DIR_LIB/imageformats && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/imageformats/libqsvg.so* $$DEPLOY_DIR_LIB/imageformats && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/imageformats/libqwbmp.so* $$DEPLOY_DIR_LIB/imageformats && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/imageformats/libqwebp.so* $$DEPLOY_DIR_LIB/imageformats && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/platforms/libqeglfs.so* $$DEPLOY_DIR_LIB/platforms && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/platforms/libqlinuxfb.so* $$DEPLOY_DIR_LIB/platforms && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/platforms/libqminimal.so* $$DEPLOY_DIR_LIB/platforms && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/platforms/libqminimalegl.so* $$DEPLOY_DIR_LIB/platforms && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/platforms/libqoffscreen.so* $$DEPLOY_DIR_LIB/platforms && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/platforms/libqxcb.so* $$DEPLOY_DIR_LIB/platforms && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/platformthemes/libqgtk*.so* $$DEPLOY_DIR_LIB/platformthemes && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/printsupport/libcupsprintersupport.so* $$DEPLOY_DIR_LIB/printsupport && +- deploy.commands += cp -vfa $$[QT_INSTALL_PLUGINS]/sqldrivers/libqsqlite.so* $$DEPLOY_DIR_LIB/sqldrivers && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libicudata.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libicui18n.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libicuuc.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Concurrent.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Core.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5DBus.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Gui.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Network.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5PrintSupport.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Qml.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Quick.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Sql.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Svg.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Widgets.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5X11Extras.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5XcbQpa.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5QmlModels.so* $$DEPLOY_DIR_LIB && +- deploy.commands += cp -vfa $$[QT_INSTALL_LIBS]/libQt5Xml.so* $$DEPLOY_DIR_LIB && +- deploy.commands += rm -fv $$DEPLOY_DIR_LIB/lib*.so.*.debug $$DEPLOY_DIR_LIB/*/lib*.so.*.debug ++ deploy.commands += true + } + + # Mac specific deploy target diff --git a/pkgs/by-name/li/littlenavmap/package.nix b/pkgs/by-name/li/littlenavmap/package.nix new file mode 100644 index 000000000000..3648037ef2eb --- /dev/null +++ b/pkgs/by-name/li/littlenavmap/package.nix @@ -0,0 +1,131 @@ +{ + lib, + stdenv, + callPackage, + fetchFromGitHub, + libsForQt5, + makeDesktopItem, +}: +let + atools = callPackage ./atools.nix { }; + marble = libsForQt5.marble.overrideAttrs (self: { + version = "0.25.5"; + + src = fetchFromGitHub { + owner = "albar965"; + repo = "marble"; + rev = "722acf7f8d79023f6c6a761063645a1470bb3935"; + hash = "sha256-5GSa+xIQS9EgJXxMFUOA5jTtHJ6Dl4C9yAkFPIOrgo8="; + }; + + # https://github.com/albar965/littlenavmap/wiki/Compiling#compile-marble + cmakeFlags = + let + disable = n: lib.cmakeBool n false; + enable = n: lib.cmakeBool n true; + in + map enable [ + "STATIC_BUILD" + "MARBLE_EMPTY_MAPTHEME" + "QTONLY" + ] + ++ map disable [ + "BUILD_MARBLE_EXAMPLES" + "BUILD_INHIBIT_SCREENSAVER_PLUGIN" + "BUILD_MARBLE_APPS" + "BUILD_MARBLE_EXAMPLES" + "BUILD_MARBLE_TESTS" + "BUILD_MARBLE_TOOLS" + "BUILD_TESTING" + "BUILD_WITH_DBUS" + "MOBILE" + "WITH_DESIGNER_PLUGIN" + "WITH_Phonon" + "WITH_Qt5Location" + "WITH_Qt5Positioning" + "WITH_Qt5SerialPort" + "WITH_ZLIB" + "WITH_libgps" + "WITH_libshp" + "WITH_libwlocate" + ]; + }); + + pname = "littlenavmap"; + + desktopItem = makeDesktopItem { + name = "Little Navmap"; + desktopName = "Little Navmap"; + icon = pname; + terminal = false; + exec = pname; + categories = [ + "Qt" + "Utility" + "Geography" + "Maps" + ]; + }; +in +stdenv.mkDerivation (finalAttrs: rec { + inherit pname; + version = "3.0.16"; + + src = fetchFromGitHub { + owner = "albar965"; + repo = "littlenavmap"; + rev = "v${version}"; + hash = "sha256-QUgQV8WOAVowjGFpNbzl32gksQ2OnWtLfrJmBK2lJ6M="; + }; + + nativeBuildInputs = [ + libsForQt5.qmake + libsForQt5.wrapQtAppsHook + ]; + + # https://github.com/albar965/littlenavmap/wiki/Compiling#default-paths-and-environment-variables-2 + env = { + ATOOLS_INC_PATH = "${atools}/include"; + ATOOLS_LIB_PATH = "${atools}/lib"; + MARBLE_INC_PATH = "${marble.dev}/include"; + MARBLE_LIB_PATH = "${marble}/lib"; + inherit (atools) ATOOLS_NO_CRASHHANDLER; + }; + + patches = [ ./deploy.patch ]; + + configurePhase = '' + runHook preConfigure + + # we have to build out of source tree + cd build + qmake "''${flagsArray[@]}" .. + + runHook postConfigure + ''; + + postInstall = '' + mkdir -p $out/bin $out/lib $out/share/icons/scaleable/apps + mv "../../deploy/Little Navmap" $out/lib/littlenavmap + ln -s $out/lib/littlenavmap/littlenavmap $out/bin + cp -ra ${desktopItem}/* $out + mv $out/lib/littlenavmap/littlenavmap.svg $out/share/icons/scaleable/apps + ''; + + enableParallelBuilding = true; + enableParallelInstalling = true; + + installTargets = "deploy"; + + passthru.local-packages = { inherit atools marble; }; + + meta = { + description = "A free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane"; + homepage = "https://github.com/albar965/littlenavmap"; + changelog = "https://github.com/albar965/littlenavmap/blob/${src.rev}/CHANGELOG.txt"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ ck3d ]; + mainProgram = "littlenavmap"; + platforms = lib.platforms.linux; + }; +})