3 Commits

Author SHA256 Message Date
9fea0efcfa Accepting request 1301092 from science
- Add patches, mainly to fix build with GCC 15:
  * Fix-build-with-GCC-15.patch
  * Fix-Wparentheses-warnings.patch
  * Fix-Wdangling-else-warnings.patch
- Migrate from %suse_update_desktop_file to %translate_suse_desktop
  with translation only for GenericName. (Name is a proper name.)

OBS-URL: https://build.opensuse.org/request/show/1301092
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/TreeMaker?expand=0&rev=4
2025-08-25 18:37:42 +00:00
Aaron Puchert
1bb7169a43 - Migrate from %suse_update_desktop_file to %translate_suse_desktop
with translation only for GenericName. (Name is a proper name.)

OBS-URL: https://build.opensuse.org/package/show/science/TreeMaker?expand=0&rev=9
2025-08-23 19:34:40 +00:00
Aaron Puchert
6b4e4d36db - Add patches, mainly to fix build with GCC 15:
* Fix-build-with-GCC-15.patch
  * Fix-Wparentheses-warnings.patch
  * Fix-Wdangling-else-warnings.patch

OBS-URL: https://build.opensuse.org/package/show/science/TreeMaker?expand=0&rev=8
2025-08-23 16:15:07 +00:00
6 changed files with 135 additions and 8 deletions

View File

@@ -0,0 +1,54 @@
From: Aaron Puchert <aaronpuchert@alice-dsl.net>
Date: Sat, 23 Aug 2025 17:38:13 +0200
Subject: [PATCH 3/3] Fix -Wdangling-else warnings
The indentation matched how the compiler would parse the statements (the
`else` is assigned to the innermost `if`), so we just add braces to
clarify that this is intentional.
---
Source/tmModel/tmTreeClasses/tmTree.cpp | 3 ++-
Source/tmModel/tmTreeClasses/tmVertex.cpp | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Source/tmModel/tmTreeClasses/tmTree.cpp b/Source/tmModel/tmTreeClasses/tmTree.cpp
index 1347e8d..38d1b9f 100644
--- a/Source/tmModel/tmTreeClasses/tmTree.cpp
+++ b/Source/tmModel/tmTreeClasses/tmTree.cpp
@@ -777,7 +777,7 @@ void tmTree::AbsorbEdge(tmEdge* aEdge)
// Paths that end on killNode are deleted.
if (thePath->StartsOrEndsWith(killNode))
delete thePath;
- else if (thePath->mNodes.contains(killNode))
+ else if (thePath->mNodes.contains(killNode)) {
if (thePath->mNodes.contains(keepNode))
// Paths that contain killNode and keepNode get the reference to
// killNode removed.
@@ -786,6 +786,7 @@ void tmTree::AbsorbEdge(tmEdge* aEdge)
// Paths that only contain killNode get the reference replaced by
// a reference to keepNode.
thePath->mNodes.replace_with(killNode, keepNode);
+ }
// Remove the edge from the path
if (thePath->mEdges.contains(aEdge))
thePath->mEdges.erase_remove(aEdge);
diff --git a/Source/tmModel/tmTreeClasses/tmVertex.cpp b/Source/tmModel/tmTreeClasses/tmVertex.cpp
index f98c533..7f75392 100644
--- a/Source/tmModel/tmTreeClasses/tmVertex.cpp
+++ b/Source/tmModel/tmTreeClasses/tmVertex.cpp
@@ -241,7 +241,7 @@ void tmVertex::GetAxialOrGussetCreases(tmCrease*& crease1,
crease1 = crease2 = 0;
for (size_t i = 0; i < mCreases.size(); ++i) {
tmCrease* theCrease = mCreases[i];
- if (theCrease->IsAxialOrGussetCrease())
+ if (theCrease->IsAxialOrGussetCrease()) {
if (!crease1)
crease1 = theCrease;
else {
@@ -249,6 +249,7 @@ void tmVertex::GetAxialOrGussetCreases(tmCrease*& crease1,
crease2 = theCrease;
return;
}
+ }
}
TMFAIL("tmVertex::GetAxialOrGussetCreases(): "\
"couldn't find axial or gusset creases");

View File

@@ -0,0 +1,37 @@
From: Aaron Puchert <aaronpuchert@alice-dsl.net>
Date: Sat, 23 Aug 2025 17:36:40 +0200
Subject: [PATCH 2/3] Fix -Wparentheses warnings
These seem to be true positives, so I fixed the code. This could result
in behavioral changes, but I haven't noticed anything broken yet.
---
Source/tmModel/tmTreeClasses/tmConditionPathActive.cpp | 2 +-
Source/tmModel/tmTreeClasses/tmConditionPathCombo.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Source/tmModel/tmTreeClasses/tmConditionPathActive.cpp b/Source/tmModel/tmTreeClasses/tmConditionPathActive.cpp
index ebbf677..551415d 100644
--- a/Source/tmModel/tmTreeClasses/tmConditionPathActive.cpp
+++ b/Source/tmModel/tmTreeClasses/tmConditionPathActive.cpp
@@ -46,7 +46,7 @@ void tmConditionPathActive::SetPath(tmPath* aPath)
{
TMASSERT(aPath);
TMASSERT(aPath->mIsLeafPath);
- if (mPath = aPath) return;
+ if (mPath == aPath) return;
tmTreeCleaner tc(mTree);
mPath = aPath;
mNode1 = aPath->mNodes.front();
diff --git a/Source/tmModel/tmTreeClasses/tmConditionPathCombo.cpp b/Source/tmModel/tmTreeClasses/tmConditionPathCombo.cpp
index aa34cc3..7e84b93 100644
--- a/Source/tmModel/tmTreeClasses/tmConditionPathCombo.cpp
+++ b/Source/tmModel/tmTreeClasses/tmConditionPathCombo.cpp
@@ -65,7 +65,7 @@ void tmConditionPathCombo::SetPath(tmPath* aPath)
{
TMASSERT(aPath);
TMASSERT(aPath->mIsLeafPath);
- if (mPath = aPath) return;
+ if (mPath == aPath) return;
tmTreeCleaner tc(mTree);
mPath = aPath;
mNode1 = aPath->mNodes.front();

View File

@@ -0,0 +1,22 @@
From: Aaron Puchert <aaronpuchert@alice-dsl.net>
Date: Sat, 23 Aug 2025 17:29:03 +0200
Subject: [PATCH 1/3] Fix build with GCC 15
Non-prototype declarations are no longer accepted by default.
---
Source/tmModel/wnlib/mem/wnmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Source/tmModel/wnlib/mem/wnmem.c b/Source/tmModel/wnlib/mem/wnmem.c
index 1f0a15b..918f5f8 100644
--- a/Source/tmModel/wnlib/mem/wnmem.c
+++ b/Source/tmModel/wnlib/mem/wnmem.c
@@ -105,7 +105,7 @@ bool wn_gp_fill_flag=FALSE,
wn_gp_trap_address_flag=FALSE;
ptr wn_gp_trap_address_address;
-ptr wn_system_alloc(/*size*/);
+ptr wn_system_alloc(int size);
local void default_error_func(int size);
typedef void (*voidfunc)(int size);

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sat Aug 23 16:11:55 UTC 2025 - Aaron Puchert <aaronpuchert@alice-dsl.net>
- Add patches, mainly to fix build with GCC 15:
* Fix-build-with-GCC-15.patch
* Fix-Wparentheses-warnings.patch
* Fix-Wdangling-else-warnings.patch
- Migrate from %suse_update_desktop_file to %translate_suse_desktop
with translation only for GenericName. (Name is a proper name.)
-------------------------------------------------------------------
Wed May 1 16:45:29 UTC 2024 - Aaron Puchert <aaronpuchert@alice-dsl.net>

View File

@@ -1,8 +1,7 @@
#
# spec file for package TreeMaker
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2024 Aaron Puchert <aaronpuchert@alice-dsl.net>
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +18,7 @@
# We have to build hhp2cached ourselves. We take the source from a fixed version
# of wxWidgets to not break source validation, but warn if it doesn't match.
%global hhp2cached_ver 3.2.4
%global hhp2cached_ver 3.2.8
%if %{pkg_vcmp wxGTK3-devel != %{hhp2cached_ver}}
%{warn:hhp2cached version does not match wxGTK3-devel}
%endif
@@ -32,7 +31,7 @@ License: GPL-2.0-only
Group: Productivity/Graphics/CAD
URL: https://www.langorigami.com/article/treemaker
Source: https://www.langorigami.com/wp-content/uploads/2015/09/TreeMaker_src.zip
Source1: com.langorigami.TreeMaker.desktop
Source1: com.langorigami.TreeMaker.desktop.in
Source2: com.langorigami.TreeMaker.metainfo.xml
Source3: treemaker.xml
Source4: https://github.com/wxWidgets/wxWidgets/raw/v%{hhp2cached_ver}/utils/hhp2cached/hhp2cached.cpp
@@ -59,11 +58,14 @@ Patch19: Fix-crash-on-opening-help.patch
Patch20: Make-some-build-options-configurable.patch
Patch21: Don-t-run-pkg-config-wx-config-for-every-compile-job.patch
Patch22: Correctly-detect-64-bit-platforms.patch
Patch23: Fix-build-with-GCC-15.patch
Patch24: Fix-Wparentheses-warnings.patch
Patch25: Fix-Wdangling-else-warnings.patch
BuildRequires: c++_compiler
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: translate-suse-desktop
BuildRequires: unzip
BuildRequires: update-desktop-files
BuildRequires: wxGTK3-devel
BuildRequires: zip
BuildRequires: pkgconfig(gtk+-3.0)
@@ -86,6 +88,8 @@ pasted into another graphics program for further processing.
unzip -uo %{SOURCE0} -d ..
%autopatch -p1
cp %{SOURCE1} .
%build
pushd linux/
OPTIONS="%{optflags}" make %{?_smp_mflags} INSTALL_PREFIX=%{_prefix}
@@ -101,8 +105,8 @@ popd
rm %{buildroot}%{_datadir}/TreeMaker\ 5/{Icon_app.ppm,LICENSE.txt.gz,uninstall}
%suse_update_desktop_file -i %{SOURCE1}
install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/com.langorigami.TreeMaker.desktop
%translate_suse_desktop com.langorigami.TreeMaker.desktop
install -D -m 644 com.langorigami.TreeMaker.desktop %{buildroot}%{_datadir}/applications/com.langorigami.TreeMaker.desktop
install -D -m 644 %{SOURCE2} %{buildroot}%{_datadir}/metainfo/com.langorigami.TreeMaker.metainfo.xml
install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/mime/packages/treemaker.xml
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{48x48,128x128}/{apps,mimetypes}

View File

@@ -2,7 +2,7 @@
Encoding=UTF-8
Type=Application
Name=TreeMaker
GenericName=Origami Designer
_GenericName=Origami Designer
Categories=Science;Art;
MimeType=model/x-tmd5;
Exec=TreeMaker %F