Merge pull request #87950 from sikmir/mapper

openorienteering-mapper: 0.9.2 -> 0.9.3
This commit is contained in:
Benjamin Hipple 2020-06-03 23:42:51 -04:00 committed by GitHub
commit 33e9db21d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 19 deletions

View File

@ -1,31 +1,61 @@
{ stdenv, fetchFromGitHub, gdal, cmake, ninja, proj, clipper, zlib, qtbase, qttools { stdenv
, qtlocation, qtsensors, doxygen, cups, wrapQtAppsHook, qtimageformats , mkDerivation
, fetchFromGitHub
, gdal
, cmake
, ninja
, proj
, clipper
, zlib
, qttools
, qtlocation
, qtsensors
, qttranslations
, doxygen
, cups
, qtimageformats
}: }:
stdenv.mkDerivation rec { mkDerivation rec {
pname = "OpenOrienteering-Mapper"; pname = "OpenOrienteering-Mapper";
version = "0.9.2"; version = "0.9.3";
buildInputs = [ gdal qtbase qttools qtlocation qtimageformats buildInputs = [
qtsensors clipper zlib proj doxygen cups]; gdal
qtlocation
qtimageformats
qtsensors
clipper
zlib
proj
cups
];
nativeBuildInputs = [ cmake wrapQtAppsHook ninja ]; nativeBuildInputs = [ cmake doxygen ninja qttools ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "OpenOrienteering"; owner = "OpenOrienteering";
repo = "mapper"; repo = "mapper";
rev = "v${version}"; rev = "v${version}";
sha256 = "1787f2agjzcyizk2m60icb44yv9dlwv6irw3k53fqfmwkhkd2h5p"; sha256 = "05bliglpc8170px6k9lfrp9ylpnb2zf47gnjns9b2bif8dv8zq0l";
}; };
cmakeFlags = patches = [
[ # See https://github.com/NixOS/nixpkgs/issues/86054
./fix-qttranslations-path.diff
];
postPatch = ''
substituteInPlace src/util/translation_util.cpp \
--subst-var-by qttranslations ${qttranslations}
'';
cmakeFlags = [
# Building the manual and bundling licenses fails # Building the manual and bundling licenses fails
# See https://github.com/NixOS/nixpkgs/issues/85306
"-DLICENSING_PROVIDER:BOOL=OFF" "-DLICENSING_PROVIDER:BOOL=OFF"
"-DMapper_MANUAL_QTHELP:BOOL=OFF" "-DMapper_MANUAL_QTHELP:BOOL=OFF"
] ++ ] ++ stdenv.lib.optionals stdenv.isDarwin [
(stdenv.lib.optionals stdenv.isDarwin
[
# Usually enabled on Darwin # Usually enabled on Darwin
"-DCMAKE_FIND_FRAMEWORK=never" "-DCMAKE_FIND_FRAMEWORK=never"
# FindGDAL is broken and always finds /Library/Framework unless this is # FindGDAL is broken and always finds /Library/Framework unless this is
@ -38,16 +68,17 @@ stdenv.mkDerivation rec {
"-DMapper_PACKAGE_QT=0" "-DMapper_PACKAGE_QT=0"
"-DMapper_PACKAGE_ASSISTANT=0" "-DMapper_PACKAGE_ASSISTANT=0"
"-DMapper_PACKAGE_GDAL=0" "-DMapper_PACKAGE_GDAL=0"
]); ];
postInstall = postInstall = with stdenv; lib.optionalString isDarwin ''
stdenv.lib.optionalString stdenv.isDarwin '' mkdir -p $out/Applications
mv $out/Mapper.app $out/Applications
# Fixes "This application failed to start because it could not find or load the Qt # Fixes "This application failed to start because it could not find or load the Qt
# platform plugin "cocoa"." # platform plugin "cocoa"."
wrapQtApp $out/Mapper.app/Contents/MacOS/Mapper wrapQtApp $out/Applications/Mapper.app/Contents/MacOS/Mapper
mkdir -p $out/bin mkdir -p $out/bin
ln -s $out/Mapper.app/Contents/MacOS/Mapper $out/bin/mapper ln -s $out/Applications/Mapper.app/Contents/MacOS/Mapper $out/bin/mapper
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = '' description = ''

View File

@ -0,0 +1,13 @@
diff --git i/src/util/translation_util.cpp w/src/util/translation_util.cpp
index da03d216..c1f12751 100644
--- i/src/util/translation_util.cpp
+++ w/src/util/translation_util.cpp
@@ -103,7 +103,7 @@ TranslationUtil::TranslationUtil(const QString& code, QString translation_file)
}
QString translation_name = QLatin1String("qt_") + language.code;
- if (!qt_translator.load(translation_name, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+ if (!qt_translator.load(translation_name, QLatin1String("@qttranslations@/translations")))
load(qt_translator, translation_name);
load(app_translator, translation_file);