From fe3d23ebe8dfc10de4e781edd665700baee184fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 12 Dec 2023 22:31:14 +0700 Subject: [PATCH] codeblocks: fix a crash on startup Fix: #47691 --- .../patches/correct-file-access.patch | 29 +++++++++++++++++++ .../patches/wxwiget-3.1-regex-is-pcre.patch | 14 +++++++++ srcpkgs/codeblocks/template | 3 +- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/codeblocks/patches/correct-file-access.patch create mode 100644 srcpkgs/codeblocks/patches/wxwiget-3.1-regex-is-pcre.patch diff --git a/srcpkgs/codeblocks/patches/correct-file-access.patch b/srcpkgs/codeblocks/patches/correct-file-access.patch new file mode 100644 index 00000000000..e73d12e3066 --- /dev/null +++ b/srcpkgs/codeblocks/patches/correct-file-access.patch @@ -0,0 +1,29 @@ +--- a/src/plugins/contrib/FileManager/FileExplorer.cpp ++++ b/src/plugins/contrib/FileManager/FileExplorer.cpp +@@ -812,7 +812,7 @@ void FileExplorer::WriteConfig() + wxString ref=wxString::Format(_T("FileExplorer/RootList/I%i"),i); + cfg->Write(ref, m_Loc->GetString(m_favdirs.GetCount()+i)); + } +- count=static_cast(m_Loc->GetCount()); ++ count=static_cast(m_WildCards->GetCount()); + cfg->Write(_T("FileExplorer/WildMask/Len"), count); + for(int i=0;iGetFullPath(ti).c_str()); + m_wildcard=wxString(m_fe->m_WildCards->GetValue().c_str()); + m_vcs_type=wxString(m_fe->m_VCS_Type->GetLabel().c_str()); +- m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str()); ++ if (m_fe->m_VCS_Control->GetSelection() == wxNOT_FOUND) ++ { ++ m_vcs_commit_string = ""; ++ } ++ else ++ { ++ m_vcs_commit_string=wxString(m_fe->m_VCS_Control->GetString(m_fe->m_VCS_Control->GetSelection()).c_str()); ++ } + m_vcs_changes_only = m_fe->m_VCS_ChangesOnly->IsChecked(); + if (m_vcs_type != wxEmptyString) + m_repo_path=wxString(m_fe->GetRootFolder().c_str()); diff --git a/srcpkgs/codeblocks/patches/wxwiget-3.1-regex-is-pcre.patch b/srcpkgs/codeblocks/patches/wxwiget-3.1-regex-is-pcre.patch new file mode 100644 index 00000000000..5b123a0a6d9 --- /dev/null +++ b/srcpkgs/codeblocks/patches/wxwiget-3.1-regex-is-pcre.patch @@ -0,0 +1,14 @@ +--- a/src/sdk/macrosmanager.cpp ++++ b/src/sdk/macrosmanager.cpp +@@ -83,9 +83,9 @@ void MacrosManager::Reset() + m_Plugins = UnixFilename(ConfigManager::GetPluginsFolder()); + m_DataPath = UnixFilename(ConfigManager::GetDataFolder()); + ClearProjectKeys(); +- m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[)} /\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE); ++ m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[\\)} \\/\\\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE); + m_RE_DOS.Compile(_T("([^%]|^)(%(#?[A-Za-z_0-9.]+)%)"), wxRE_EXTENDED | wxRE_NEWLINE); +- m_RE_If.Compile(_T("\\$if\\(([^)]*)\\)[::space::]*(\\{([^}]*)\\})(\\{([^}]*)\\})?"), wxRE_EXTENDED | wxRE_NEWLINE); ++ m_RE_If.Compile(_T("\\$if\\(([^)]*)\\)\\s*(\\{([^}]*)\\})(\\{([^}]*)\\})?"), wxRE_EXTENDED | wxRE_NEWLINE); + m_RE_IfSp.Compile(_T("[^=!<>]+|(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE); + m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE); + m_RE_ToAbsolutePath.Compile(_T("\\$TO_ABSOLUTE_PATH{([^}]*)}"), diff --git a/srcpkgs/codeblocks/template b/srcpkgs/codeblocks/template index d002a274087..785560214c3 100644 --- a/srcpkgs/codeblocks/template +++ b/srcpkgs/codeblocks/template @@ -1,7 +1,7 @@ # Template file for 'codeblocks' pkgname=codeblocks version=20.03 -revision=6 +revision=7 build_style=gnu-configure configure_args="--with-wx-config=wx-config-gtk3 --with-contrib-plugins --with-boost=${XBPS_CROSS_BASE}/usr @@ -16,6 +16,7 @@ license="GPL-3.0-only" homepage="http://www.codeblocks.org" distfiles="${SOURCEFORGE_SITE}/${pkgname}/Sources/${version}/${pkgname}-${version}.tar.xz" checksum=15eeb3e28aea054e1f38b0c7f4671b4d4d1116fd05f63c07aa95a91db89eaac5 +disable_parallel_build="plugins use same working directory" CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"