Accepting request 943411 from home:jirislaby:branches:graphics

- fix paths creation (e.g. fonts loading) by:
  * 0001-Revert-AppImage-build-on-GitHub-Actions-with-go-appi.patch
  * 0002-Revert-RS_System-getDirectoryList-add-plugins-folder.patch
  * 0003-Revert-fix-RS_System-getDirectoryList-use-relative-p.patch
(did the revert and waiting for the upstream fix)

OBS-URL: https://build.opensuse.org/request/show/943411
OBS-URL: https://build.opensuse.org/package/show/graphics/librecad?expand=0&rev=62
This commit is contained in:
2022-01-01 20:01:06 +00:00
committed by Git OBS Bridge
parent 44893268d4
commit 5a6fdaf1e6
5 changed files with 209 additions and 1 deletions

View File

@@ -0,0 +1,83 @@
From: Jiri Slaby <jslaby@suse.cz>
Date: Sat, 1 Jan 2022 17:34:34 +0100
Subject: Revert "AppImage - build on GitHub Actions, with go-appimage tool"
Patch-mainline: waiting for fix
References: paths fix
This reverts commit a64f1f481cd3316e9cce79beeeafd59faf67b703, it breaks
paths construction.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
librecad/src/lib/engine/rs_system.cpp | 12 +++++-------
librecad/src/lib/engine/rs_system.h | 2 +-
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/librecad/src/lib/engine/rs_system.cpp b/librecad/src/lib/engine/rs_system.cpp
index 2093f31c79a0..9103eff3302c 100644
--- a/librecad/src/lib/engine/rs_system.cpp
+++ b/librecad/src/lib/engine/rs_system.cpp
@@ -3,7 +3,6 @@
** This file is part of the LibreCAD project, a 2D CAD program
**
** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
-** Copyright (C) 2021 A. Stebich (librecad@mail.lordofbikes.de)
** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
**
**
@@ -61,6 +60,7 @@ void RS_System::init(const QString& appName, const QString& appVersion,
else {
this->appDir = appDir;
}
+ binDir = QCoreApplication::applicationDirPath();
RS_DEBUG->print("RS_System::init: System %s initialized.", appName.toLatin1().data());
RS_DEBUG->print("RS_System::init: App dir: %s", appDir.toLatin1().data());
@@ -570,20 +570,18 @@ QStringList RS_System::getDirectoryList(const QString& _subDirectory) {
}
#ifdef Q_OS_UNIX
- RS_DEBUG->print( RS_Debug::D_ERROR, "RS_System::getDirectoryList: %s", appDir.toStdString().c_str());
+ RS_DEBUG->print( RS_Debug::D_ERROR, "RS_System::getDirectoryList: %s", binDir.toStdString().c_str());
// for AppImage use relative paths from executable
// from packet manager the executable is in /usr/bin
// in AppImage the executable is APPDIR/usr/bin
// so this should work for paket manager and AppImage distribution
- dirList.append( QDir::cleanPath( appDir + "/../share/doc/" + appDirName + "/" + subDirectory));
+ dirList.append( QDir::cleanPath( binDir + "/../share/doc/" + appDirName + "/" + subDirectory));
// Redhat style:
- dirList.append( QDir::cleanPath( appDir + "/../share/" + appDirName + "/" + subDirectory));
- // Debian style:
- dirList.append( QDir::cleanPath( appDir + "/../lib/" + appDirName + "/" + subDirectory));
+ dirList.append( QDir::cleanPath( binDir + "/../share/" + appDirName + "/" + subDirectory));
if (QStringLiteral( "plugins") == subDirectory) {
- dirList.append( QDir::cleanPath( appDir + "/../lib/" + appDirName));
+ dirList.append( QDir::cleanPath( binDir + "/../lib/" + appDirName));
}
#endif
diff --git a/librecad/src/lib/engine/rs_system.h b/librecad/src/lib/engine/rs_system.h
index 3342f63722b5..745ffdbde646 100644
--- a/librecad/src/lib/engine/rs_system.h
+++ b/librecad/src/lib/engine/rs_system.h
@@ -3,7 +3,6 @@
** This file is part of the LibreCAD project, a 2D CAD program
**
** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
-** Copyright (C) 2021 A. Stebich (librecad@mail.lordofbikes.de)
** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
**
**
@@ -198,6 +197,7 @@ protected:
QString appVersion;
QString appDirName;
QString appDir;
+ QString binDir;
QStringList languageList; //< List of available translations
bool initialized;
--
2.34.1

View File

@@ -0,0 +1,32 @@
From: Jiri Slaby <jslaby@suse.cz>
Date: Sat, 1 Jan 2022 17:36:05 +0100
Subject: Revert "RS_System::getDirectoryList() - add plugins folder for
AppImage"
Patch-mainline: waiting for fix
References: paths fix
This reverts commit 7484ec976afbcb8624243e5dae338fbf0df1d9a2.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
librecad/src/lib/engine/rs_system.cpp | 4 ----
1 file changed, 4 deletions(-)
diff --git a/librecad/src/lib/engine/rs_system.cpp b/librecad/src/lib/engine/rs_system.cpp
index 9103eff3302c..b0a346303038 100644
--- a/librecad/src/lib/engine/rs_system.cpp
+++ b/librecad/src/lib/engine/rs_system.cpp
@@ -579,10 +579,6 @@ QStringList RS_System::getDirectoryList(const QString& _subDirectory) {
// Redhat style:
dirList.append( QDir::cleanPath( binDir + "/../share/" + appDirName + "/" + subDirectory));
-
- if (QStringLiteral( "plugins") == subDirectory) {
- dirList.append( QDir::cleanPath( binDir + "/../lib/" + appDirName));
- }
#endif
#ifdef Q_OS_MAC
--
2.34.1

View File

@@ -0,0 +1,81 @@
From: Jiri Slaby <jslaby@suse.cz>
Date: Sat, 1 Jan 2022 17:36:28 +0100
Subject: Revert "fix: RS_System::getDirectoryList() - use relative paths for
AppImage"
Patch-mainline: waiting for fix
References: paths fix
This reverts commit e666fb172e3497dd00435ff435cc6d5177f3b8ee.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
librecad/src/lib/engine/rs_system.cpp | 20 ++++++++------------
librecad/src/lib/engine/rs_system.h | 1 -
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/librecad/src/lib/engine/rs_system.cpp b/librecad/src/lib/engine/rs_system.cpp
index b0a346303038..7437e0d44e2c 100644
--- a/librecad/src/lib/engine/rs_system.cpp
+++ b/librecad/src/lib/engine/rs_system.cpp
@@ -60,7 +60,6 @@ void RS_System::init(const QString& appName, const QString& appVersion,
else {
this->appDir = appDir;
}
- binDir = QCoreApplication::applicationDirPath();
RS_DEBUG->print("RS_System::init: System %s initialized.", appName.toLatin1().data());
RS_DEBUG->print("RS_System::init: App dir: %s", appDir.toLatin1().data());
@@ -544,7 +543,7 @@ QStringList RS_System::getFileList(const QString& subDirectory,
/**
* @return List of all directories in subdirectory 'subDirectory' in
- * all possible LibreCAD directories.
+ * all possible QCad directories.
*/
QStringList RS_System::getDirectoryList(const QString& _subDirectory) {
QStringList dirList;
@@ -569,22 +568,19 @@ QStringList RS_System::getDirectoryList(const QString& _subDirectory) {
}
}
-#ifdef Q_OS_UNIX
- RS_DEBUG->print( RS_Debug::D_ERROR, "RS_System::getDirectoryList: %s", binDir.toStdString().c_str());
- // for AppImage use relative paths from executable
- // from packet manager the executable is in /usr/bin
- // in AppImage the executable is APPDIR/usr/bin
- // so this should work for paket manager and AppImage distribution
- dirList.append( QDir::cleanPath( binDir + "/../share/doc/" + appDirName + "/" + subDirectory));
+ // Ubuntu
+ dirList.append( "/usr/share/doc/" + appDirName + "/" + subDirectory);
// Redhat style:
- dirList.append( QDir::cleanPath( binDir + "/../share/" + appDirName + "/" + subDirectory));
-#endif
+ dirList.append( "/usr/share/" + appDirName + "/" + subDirectory);
+
+ // Others, RVT April 25, 2011 removed, doesn anybody use that still?
+ // dirList.append("/usr/X11R6/share/" + appDirName + "/" + subDirectory);
#ifdef Q_OS_MAC
// Apple uses the resource directory
if (!appDir.isEmpty() && appDir!="/") {
- dirList.append( QDir::cleanPath( appDir + "/../Resources/" + subDirectory));
+ dirList.append( appDir + "/../Resources/" + subDirectory);
}
#endif
diff --git a/librecad/src/lib/engine/rs_system.h b/librecad/src/lib/engine/rs_system.h
index 745ffdbde646..cceb46280fc6 100644
--- a/librecad/src/lib/engine/rs_system.h
+++ b/librecad/src/lib/engine/rs_system.h
@@ -197,7 +197,6 @@ protected:
QString appVersion;
QString appDirName;
QString appDir;
- QString binDir;
QStringList languageList; //< List of available translations
bool initialized;
--
2.34.1

View File

@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sat Jan 1 16:38:27 UTC 2022 - Jiri Slaby <jslaby@suse.cz>
- fix paths creation (e.g. fonts loading) by:
* 0001-Revert-AppImage-build-on-GitHub-Actions-with-go-appi.patch
* 0002-Revert-RS_System-getDirectoryList-add-plugins-folder.patch
* 0003-Revert-fix-RS_System-getDirectoryList-use-relative-p.patch
(did the revert and waiting for the upstream fix)
-------------------------------------------------------------------
Mon Dec 20 09:15:40 UTC 2021 - Jiri Slaby <jslaby@suse.cz>

View File

@@ -1,7 +1,7 @@
#
# spec file for package librecad
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -35,6 +35,9 @@ Source3: http://wiki.librecad.org/images/7/70/Electronics3-LCAD.zip
Source4: http://wiki.librecad.org/images/9/9d/Electrical1-LCAD.zip
Source10: ttf2lff.1
Source20: %name-rpmlintrc
Patch0: 0001-Revert-AppImage-build-on-GitHub-Actions-with-go-appi.patch
Patch1: 0002-Revert-RS_System-getDirectoryList-add-plugins-folder.patch
Patch2: 0003-Revert-fix-RS_System-getDirectoryList-use-relative-p.patch
Patch4: librecad-no-date.diff
Patch5: librecad-use-system-libdxfrw.patch
Patch6: librecad-install.diff