Package Details: opencc-gui-git r38.47b0e26-2

Git Clone URL: https://aur.archlinux.org/opencc-gui-git.git (read-only, click to copy)
Package Base: opencc-gui-git
Description: Gui in Qt5 of Library for Open Chinese Convert
Upstream URL: http://code.google.com/p/opencc/
Keywords: opencc
Licenses: Apache License 2.0
Submitter: osfans
Maintainer: osfans
Last Packager: osfans
Votes: 1
Popularity: 0.000000
First Submitted: 2015-11-10 02:36 (UTC)
Last Updated: 2021-04-07 10:04 (UTC)

Dependencies (5)

Required by (0)

Sources (1)

Latest Comments

tuxsavvy commented on 2021-02-02 06:06 (UTC)

Hi, thanks for creating and maintaining this package. It appears the compiled binary could not find opencc, and in the About dialog, shows "Failed to load" for the opencc module. Turns out that this is a simple fix in the src/converter.cpp did the trick; it looks for a very specific version of opencc and simply returns false if that version is not found within the system. Below I have included patches to rectify this along with other minor changes to your PKGBUILD.

Please consider incorporating these, thanks.

PKGBUILD.patch:

--- PKGBUILD.orig       2021-02-02 05:55:42.000000000 +0000
+++ PKGBUILD    2021-02-02 05:44:31.873948868 +0000
@@ -2,7 +2,7 @@
 _pkgname=opencc-gui
 pkgname=$_pkgname-git
 pkgver=r38.47b0e26
-pkgrel=1
+pkgrel=2
 pkgdesc="Gui in Qt5 of Library for Open Chinese Convert"
 arch=('i686' 'x86_64')
 url="http://code.google.com/p/opencc/"
@@ -10,24 +10,32 @@
 depends=('opencc' 'qt5-base')
 makedepends=('git' 'qt5-tools')
 optdepends=('uchardet')
-source=('opencc-gui::git+https://github.com/BYVoid/opencc-gui.git')
-md5sums=('SKIP')
+source=(
+       'opencc-gui::git+https://github.com/BYVoid/opencc-gui.git'
+       'converter.patch')
+sha256sums=('SKIP'
+            '7519f350e3a92c955f68221d2f629b114855fe23689c49e6904fcc87dcb5dca0')

 pkgver() {
-       cd $srcdir/$_pkgname
+       cd ${srcdir}/${_pkgname}
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
 }

+prepare() {
+       cd ${srcdir}/${_pkgname}
+       patch -Np0 < ../converter.patch
+} 
+
 build() {
-       cd $srcdir/$_pkgname
+       cd ${srcdir}/${_pkgname}
        sed -i "s/0.0.0//" src/charsetdetector.cpp
        ./build.sh
 }

 package() {
-       cd $srcdir/$_pkgname
-       mkdir -p ${pkgdir}/usr/share/$_pkgname
-       cp build/$_pkgname build/*.qm ${pkgdir}/usr/share/$_pkgname
+       cd ${srcdir}/${_pkgname}
+       mkdir -p ${pkgdir}/usr/share/${_pkgname}
+       cp build/${_pkgname} build/*.qm ${pkgdir}/usr/share/${_pkgname}
        mkdir -p ${pkgdir}/usr/bin
-       ln -s /usr/share/$_pkgname/$_pkgname ${pkgdir}/usr/bin
+       ln -s /usr/share/${_pkgname}/${_pkgname} ${pkgdir}/usr/bin
 }

.SRCINFO.patch:

--- .SRCINFO.orig       2021-02-02 05:08:30.443985932 +0000
+++ .SRCINFO    2021-02-02 05:56:31.676146428 +0000
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Mon May 15 05:21:52 UTC 2017
 pkgbase = opencc-gui-git
        pkgdesc = Gui in Qt5 of Library for Open Chinese Convert
        pkgver = r38.47b0e26
-       pkgrel = 1
+       pkgrel = 2
        url = http://code.google.com/p/opencc/
        arch = i686
        arch = x86_64
@@ -14,7 +12,9 @@
        depends = qt5-base
        optdepends = uchardet
        source = opencc-gui::git+https://github.com/BYVoid/opencc-gui.git
-       md5sums = SKIP
+       source = converter.patch
+       sha256sums = SKIP
+       sha256sums = 7519f350e3a92c955f68221d2f629b114855fe23689c49e6904fcc87dcb5dca0

 pkgname = opencc-gui-git

converter.patch:

--- src/converter.cpp.orig      2021-02-02 05:26:53.089360684 +0000
+++ src/converter.cpp           2021-02-02 05:27:48.496965008 +1000
@@ -15,7 +15,7 @@
 {
     initialized = true;
     QLibrary libopencc;
-    libopencc.setFileNameAndVersion("opencc", "1.0.0");
+    libopencc.setFileNameAndVersion("opencc", "1.1.1");

     if (!libopencc.load())
         return;