diff options
| author | Xiao Pan <xyz@flylightning.xyz> | 2025-03-21 23:02:37 -0700 | 
|---|---|---|
| committer | Xiao Pan <xyz@flylightning.xyz> | 2025-03-21 23:02:37 -0700 | 
| commit | 4194d83c1c984c104dc0b019b4924fb5146c3b75 (patch) | |
| tree | 3aa3431ff272fb783737790d7f6b4152a26e4970 | |
| parent | 7d181254c17c1ea5e44bc878ce6d76694cc7535d (diff) | |
add sdcv patch
| -rw-r--r-- | .gitignore | 1 | ||||
| l--------- | aarch64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch | 1 | ||||
| -rw-r--r-- | pkgbuilds/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch | 30 | ||||
| -rw-r--r-- | pkgbuilds/sdcv-git/PKGBUILD | 17 | ||||
| l--------- | x86_64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch | 1 | 
5 files changed, 46 insertions, 4 deletions
| @@ -4,3 +4,4 @@  /*/**  !/*/*/  !/*/*/PKGBUILD +!/*/*/*.patch diff --git a/aarch64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch b/aarch64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch new file mode 120000 index 0000000..05ca90e --- /dev/null +++ b/aarch64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch @@ -0,0 +1 @@ +../../pkgbuilds/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch
\ No newline at end of file diff --git a/pkgbuilds/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch b/pkgbuilds/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch new file mode 100644 index 0000000..c787a3c --- /dev/null +++ b/pkgbuilds/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch @@ -0,0 +1,30 @@ +From aec5081a8c852ef7f7330985472c564eed6c998c Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@altlinux.org> +Date: Fri, 20 Sep 2024 16:32:47 +0300 +Subject: [PATCH] stardict_lib.cpp: use explicit const_cast + +Gcc-14 considers incompatible pointer types as an error, so use +expcilict const_cast to convert from const char* to gchar*. + +Signed-off-by: Andrew Savchenko <bircoph@altlinux.org> +Signed-off-by: Xiao Pan <xyz@flylightning.xyz> +--- + src/stardict_lib.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/stardict_lib.cpp b/src/stardict_lib.cpp +index 83fbc59..799a025 100644 +--- a/src/stardict_lib.cpp ++++ b/src/stardict_lib.cpp +@@ -1047,7 +1047,7 @@ bool Libs::LookupSimilarWord(const gchar *sWord, std::set<glong> &iWordIndices, +         } +         // Upper the first character and lower others. +         if (!bFound) { +-            gchar *nextchar = g_utf8_next_char(sWord); ++            gchar *nextchar = const_cast<gchar*>(g_utf8_next_char(sWord)); +             gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord); +             nextchar = g_utf8_strdown(nextchar, -1); +             casestr = g_strdup_printf("%s%s", firstchar, nextchar); +--  +2.49.0 + diff --git a/pkgbuilds/sdcv-git/PKGBUILD b/pkgbuilds/sdcv-git/PKGBUILD index 702ff7f..f1be278 100644 --- a/pkgbuilds/sdcv-git/PKGBUILD +++ b/pkgbuilds/sdcv-git/PKGBUILD @@ -2,16 +2,19 @@  pkgname=sdcv-git  _pkgname=sdcv -pkgver=0.5.3.r0.ge73388c -pkgrel=3 +pkgver=0.5.5.r1.gbeebb0f +pkgrel=1  pkgdesc="StarDict Console Version - Git version"  arch=('x86_64' 'aarch64')  url="https://github.com/Dushistov/sdcv"  license=('GPL')  depends=('glib2' 'readline' 'zlib')  makedepends=('cmake' 'git') -source=("git+${url}.git") -md5sums=('SKIP') +# patch from https://github.com/Dushistov/sdcv/pull/104 +source=("git+${url}.git" +        '0001-stardict_lib.cpp-use-explicit-const_cast.patch') +b2sums=('SKIP' +       'd962abc55b93e487614df556124b1c7f72310332375bb903cd80c8dc5b6afed62ae8f1e11e3751d602bd9ceea5566a1af36a7f8aa70e606150e3d72c7f0423c9')  provides=('sdcv' 'stardict')  conflicts=('sdcv') @@ -22,6 +25,12 @@ pkgver() {    git describe --long | sed 's/^v//;s/-/.r/;s/-/./'  } +prepare() { +  cd "${srcdir}/${_pkgname}" + +  patch -p1 -i "$srcdir/0001-stardict_lib.cpp-use-explicit-const_cast.patch" +} +  build() {    cd "${srcdir}/${_pkgname}" diff --git a/x86_64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch b/x86_64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch new file mode 120000 index 0000000..05ca90e --- /dev/null +++ b/x86_64/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch @@ -0,0 +1 @@ +../../pkgbuilds/sdcv-git/0001-stardict_lib.cpp-use-explicit-const_cast.patch
\ No newline at end of file | 
