diff --git a/0001-Fix-for-compiling-under-older-versions-of-wxWidgets.patch b/0001-Fix-for-compiling-under-older-versions-of-wxWidgets.patch new file mode 100644 index 0000000..bffa62a --- /dev/null +++ b/0001-Fix-for-compiling-under-older-versions-of-wxWidgets.patch @@ -0,0 +1,88 @@ +From 856ede8dec0898210060c6d4ae7cbf91f0ac1aac Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 29 May 2023 17:28:37 +0800 +Subject: [PATCH] Fix for compiling under older versions of wxWidgets + +--- + src/chmframe.cpp | 35 ++++++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 15 deletions(-) + +diff --git a/src/chmframe.cpp b/src/chmframe.cpp +index 16ad993..650aae9 100644 +--- a/src/chmframe.cpp ++++ b/src/chmframe.cpp +@@ -42,6 +42,13 @@ + #include + #include + #include ++#include ++ ++#if wxCHECK_VERSION(3, 1, 6) ++#define ARTPROV_GETTOOLBARBITMAP wxArtProvider::GetBitmapBundle ++#else ++#define ARTPROV_GETTOOLBARBITMAP wxArtProvider::GetBitmap ++#endif + + #define OPEN_HELP _("Open a CHM book.") + #define FONTS_HELP _("Change fonts.") +@@ -851,27 +858,26 @@ namespace { + + bool CHMFrame::InitToolBar(wxToolBar* toolbar) + { +- toolbar->AddTool(ID_Open, _("Open .."), wxArtProvider::GetBitmapBundle(wxART_FILE_OPEN, wxART_TOOLBAR), OPEN_HELP); +- toolbar->AddTool(ID_Print, _("Print .."), wxArtProvider::GetBitmapBundle(wxART_PRINT, wxART_TOOLBAR), PRINT_HELP); ++ toolbar->AddTool(ID_Open, _("Open .."), ARTPROV_GETTOOLBARBITMAP(wxART_FILE_OPEN, wxART_TOOLBAR), OPEN_HELP); ++ toolbar->AddTool(ID_Print, _("Print .."), ARTPROV_GETTOOLBARBITMAP(wxART_PRINT, wxART_TOOLBAR), PRINT_HELP); + + #ifdef __WXGTK__ +- toolbar->AddTool(ID_Fonts, _("Fonts .."), wxArtProvider::GetBitmapBundle("gtk-select-font", wxART_TOOLBAR), +- FONTS_HELP); +- toolbar->AddCheckTool(ID_Contents, _("Contents"), wxArtProvider::GetBitmapBundle("gtk-index", wxART_TOOLBAR), +- wxArtProvider::GetBitmapBundle("gtk-index", wxART_TOOLBAR), CONTENTS_HELP); ++ toolbar->AddTool(ID_Fonts, _("Fonts .."), ARTPROV_GETTOOLBARBITMAP("gtk-select-font", wxART_TOOLBAR), FONTS_HELP); ++ toolbar->AddCheckTool(ID_Contents, _("Contents"), ARTPROV_GETTOOLBARBITMAP("gtk-index", wxART_TOOLBAR), ++ ARTPROV_GETTOOLBARBITMAP("gtk-index", wxART_TOOLBAR), CONTENTS_HELP); + #else + toolbar->AddTool(ID_Fonts, _("Fonts .."), wxBitmap(htmoptns_xpm), FONTS_HELP); + toolbar->AddCheckTool(ID_Contents, _("Contents"), wxBitmap(htmsidep_xpm), wxBitmap(htmsidep_xpm), CONTENTS_HELP); + #endif + + toolbar->AddSeparator(); +- toolbar->AddTool(ID_CopySelection, _("Copy"), wxArtProvider::GetBitmapBundle(wxART_COPY, wxART_TOOLBAR), COPY_HELP); +- toolbar->AddTool(ID_FindInPage, _("Find"), wxArtProvider::GetBitmapBundle(wxART_FIND, wxART_TOOLBAR), FIND_HELP); ++ toolbar->AddTool(ID_CopySelection, _("Copy"), ARTPROV_GETTOOLBARBITMAP(wxART_COPY, wxART_TOOLBAR), COPY_HELP); ++ toolbar->AddTool(ID_FindInPage, _("Find"), ARTPROV_GETTOOLBARBITMAP(wxART_FIND, wxART_TOOLBAR), FIND_HELP); + + toolbar->AddSeparator(); + + #ifdef __WXGTK__ +- toolbar->AddTool(ID_FullScreen, _("Fullscreen"), wxArtProvider::GetBitmapBundle("gtk-fullscreen", wxART_TOOLBAR), ++ toolbar->AddTool(ID_FullScreen, _("Fullscreen"), ARTPROV_GETTOOLBARBITMAP("gtk-fullscreen", wxART_TOOLBAR), + FULLSCREEN_HELP); + #else + toolbar->AddTool(ID_FullScreen, _("Fullscreen"), wxBitmap(fullscreen_xpm), FULLSCREEN_HELP); +@@ -879,16 +885,15 @@ bool CHMFrame::InitToolBar(wxToolBar* toolbar) + + toolbar->AddSeparator(); + +- toolbar->AddTool(ID_Back, _("Back"), wxArtProvider::GetBitmapBundle(wxART_GO_BACK, wxART_TOOLBAR), BACK_HELP); +- toolbar->AddTool(ID_Forward, _("Forward"), wxArtProvider::GetBitmapBundle(wxART_GO_FORWARD, wxART_TOOLBAR), +- FORWARD_HELP); +- toolbar->AddTool(ID_Home, _("Home"), wxArtProvider::GetBitmapBundle(wxART_GO_HOME, wxART_TOOLBAR), HOME_HELP); ++ toolbar->AddTool(ID_Back, _("Back"), ARTPROV_GETTOOLBARBITMAP(wxART_GO_BACK, wxART_TOOLBAR), BACK_HELP); ++ toolbar->AddTool(ID_Forward, _("Forward"), ARTPROV_GETTOOLBARBITMAP(wxART_GO_FORWARD, wxART_TOOLBAR), FORWARD_HELP); ++ toolbar->AddTool(ID_Home, _("Home"), ARTPROV_GETTOOLBARBITMAP(wxART_GO_HOME, wxART_TOOLBAR), HOME_HELP); + toolbar->AddSeparator(); + + #ifdef __WXGTK__ +- toolbar->AddTool(ID_About, _("About"), wxArtProvider::GetBitmapBundle("gtk-about", wxART_TOOLBAR), ABOUT_HELP); ++ toolbar->AddTool(ID_About, _("About"), ARTPROV_GETTOOLBARBITMAP("gtk-about", wxART_TOOLBAR), ABOUT_HELP); + #else +- toolbar->AddTool(ID_About, _("About"), wxArtProvider::GetBitmapBundle(wxART_HELP, wxART_TOOLBAR), ABOUT_HELP); ++ toolbar->AddTool(ID_About, _("About"), ARTPROV_GETTOOLBARBITMAP(wxART_HELP, wxART_TOOLBAR), ABOUT_HELP); + #endif + + toolbar->Realize(); +-- +2.33.0 + diff --git a/xchm-1.35.tar.gz b/xchm-1.35.tar.gz new file mode 100644 index 0000000..cdeab3b Binary files /dev/null and b/xchm-1.35.tar.gz differ diff --git a/xchm.spec b/xchm.spec new file mode 100644 index 0000000..64fbf0a --- /dev/null +++ b/xchm.spec @@ -0,0 +1,51 @@ +Summary: A GUI front-end to CHMlib +Name: xchm +Version: 1.35 +Release: 1 +License: GPL-2.0-or-later +URL: https://github.com/rzvncj/xCHM +Source0: %{url}/releases/download/%{version}/xchm-%{version}.tar.gz +Patch0: 0001-Fix-for-compiling-under-older-versions-of-wxWidgets.patch + +BuildRequires: make +BuildRequires: gcc-c++ +BuildRequires: gcc +BuildRequires: chmlib-devel +BuildRequires: wxGTK3-devel +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib + +%description +xCHM is a wxWidgets-based .chm viewer. xCHM can show the contents tree if +one is available, print the displayed page, change fonts faces and size, +work with bookmarks, do the usual history stunts (forward, back, home), +provide a searchable index and seach for text in the whole book. The +search is a fast B-tree search, based on the internal $FIftiMain file +found inside indexed .chm archives, and it can be customized to search in +content or just the topics' titles. + +%prep +%autosetup -p1 + +%build +%configure --disable-dependency-tracking +%make_build + +%install +%make_install +desktop-file-validate %{buildroot}%{_datadir}/applications/xchm.desktop +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/xchm.appdata.xml +%find_lang %{name} + +%files -f %{name}.lang +%doc ChangeLog README +%license AUTHORS COPYING +%{_bindir}/xchm +%{_datadir}/applications/xchm.desktop +%{_datadir}/icons/hicolor/*/apps/xchm* +%{_datadir}/metainfo/xchm.appdata.xml +%{_mandir}/man1/xchm.1* + +%changelog +* Fri May 26 2023 wangtaozhi - 1.35-1 +- Package init \ No newline at end of file diff --git a/xchm.yaml b/xchm.yaml new file mode 100644 index 0000000..ed4b012 --- /dev/null +++ b/xchm.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: https://github.com/rzvncj/xCHM +tag_prefix: "v" +separator: "." \ No newline at end of file