Le Thu, 9 Jan 2020 11:14:12 +0100,
Solene Rapenne <[email protected]> a écrit :

> I've been trying to get textsuggest to work without success.
> 
> - textsuggest-server is started, ktrace shows it loads a dictionary
> - textsuggest -l en, opens a window empty, if I type a word nothing is
>   suggested but I see each search within the textsuggest-server output
> 
> I tried within MATE and Gnome3.
> 
> I worked to update textsuggest to last version to see if it help,
> update wasn't straightforward and lead to an issue when using
> --auto-selection , it crashes the textsuggest-server with this
> message:
> 
> X Error of failed request:  BadWindow (invalid Window parameter)
>   Major opcode of failed request:  20 (X_GetProperty)
>   Resource id in failed request:  0x0
>   Serial number of failed request:  459
>   Current serial number in output stream:  459
> pthread_mutex_destroy on mutex with waiters!
> 
> 
> I share the diff to update textsuggest if someone wants to check.
> 
> xdotool is required for building now, and textsuggests looks for xdo.h
> and will link against libxdo.
> 
> Most patches got updated due to changes, but I had to fix by hand
> Commands.cpp, especially a catch { } which produced a
> compilation error (maybe some other compiler allow this syntax)
> 
> 

jca@ found the diff was bad, claws-mail did rewrap it
correct diff below

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/x11/textsuggest/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile    12 Jul 2019 20:51:22 -0000      1.5
+++ Makefile    9 Jan 2020 10:11:30 -0000
@@ -2,8 +2,7 @@
 
 COMMENT =      auto-complete and text expansion in X11
 
-V =            4.2.0
-REVISION =     0
+V =            4.2.4
 DISTNAME =     TextSuggest-v${V}
 PKGNAME =      textsuggest-${V}
 CATEGORIES =   x11
@@ -16,19 +15,20 @@ MAINTAINER =        Stefan Sperling <stsp@openb
 PERMIT_PACKAGE =       Yes
 
 WANTLIB =              c ${COMPILER_LIBCXX} GL Qt5Core Qt5Gui Qt5Widgets \
-                       dbus-c++-1 m xcb
+                       dbus-c++-1 m xcb xdo
 
 MASTER_SITES =         
https://gitlab.com/bharadwaj-raju/TextSuggest/-/archive/v${V}/
 
 MODULES =              x11/qt5
-RUN_DEPENDS =          x11/xdotool
-LIB_DEPENDS =          x11/libdbus-c++
+LIB_DEPENDS =          x11/libdbus-c++ \
+                       x11/xdotool
 
 CXXFLAGS +=            -std=c++11 \
                        -I${X11BASE}/include \
+                       -I${LOCALBASE}/include \
                        -I${LOCALBASE}/include/dbus-c++-1
 LDFLAGS +=             -L${X11BASE}/lib -lxcb \
-                       -L${PREFIX}/lib -ldbus-c++-1
+                       -L${PREFIX}/lib -lxdo -ldbus-c++-1
 
 post-patch:
        ${SUBST_CMD} ${WRKSRC}/server/Files.hpp
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/x11/textsuggest/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo    14 Mar 2019 14:47:07 -0000      1.1.1.1
+++ distinfo    9 Jan 2020 09:47:54 -0000
@@ -1,2 +1,2 @@
-SHA256 (TextSuggest-v4.2.0.tar.gz) = 
UASDN00D5+12Q53QLz7XqsXI2bfTnlRCdNkE8gCgD34=
-SIZE (TextSuggest-v4.2.0.tar.gz) = 217179
+SHA256 (TextSuggest-v4.2.4.tar.gz) = 
okVBiKQuWeHL3vVMdG1/GspcUGJXIH40gBOHIZHrsAI=
+SIZE (TextSuggest-v4.2.4.tar.gz) = 217220
Index: patches/patch-server_TextSuggestServer_cpp
===================================================================
RCS file: 
/home/cvs/ports/x11/textsuggest/patches/patch-server_TextSuggestServer_cpp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-server_TextSuggestServer_cpp
--- patches/patch-server_TextSuggestServer_cpp  14 Mar 2019 14:47:07 -0000      
1.1.1.1
+++ patches/patch-server_TextSuggestServer_cpp  9 Jan 2020 09:52:30 -0000
@@ -3,21 +3,7 @@ Adjust to match our changes in subproces
 Index: server/TextSuggestServer.cpp
 --- server/TextSuggestServer.cpp.orig
 +++ server/TextSuggestServer.cpp
-@@ -347,10 +347,10 @@ class TextSuggestServer (public)
- 
-               sp::popen proc ("xdotool", {"getwindowfocus"});
-               proc.wait();
--              std::string stdout 
(std::istreambuf_iterator<char>(proc.stdout()), {});
--              stdout.erase(stdout.find_last_not_of(" \n\r\t")+1);
-+              std::string output 
(std::istreambuf_iterator<char>(proc.get_stdout()), {});
-+              output.erase(output.find_last_not_of(" \n\r\t")+1);
- 
--              return stdout;
-+              return output;
- 
-       };
- 
-@@ -425,8 +425,8 @@ class TextSuggestServer (public)
+@@ -433,8 +433,8 @@ class TextSuggestServer (public)
  
                sp::popen proc ("setxkbmap", {"-print"});
                proc.wait();
@@ -28,7 +14,7 @@ Index: server/TextSuggestServer.cpp
  
                std::string line;
                std::vector<std::string> line_split;
-@@ -456,4 +456,4 @@ class TextSuggestServer (public)
+@@ -464,4 +464,4 @@ class TextSuggestServer (public)
  
  private:
        
Index: patches/patch-textsuggest_processors_command_cpp
===================================================================
RCS file: 
/home/cvs/ports/x11/textsuggest/patches/patch-textsuggest_processors_command_cpp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-textsuggest_processors_command_cpp
--- patches/patch-textsuggest_processors_command_cpp    14 Mar 2019 14:47:07 
-0000      1.1.1.1
+++ patches/patch-textsuggest_processors_command_cpp    9 Jan 2020 10:03:32 
-0000
@@ -3,14 +3,19 @@ Adjust to match our changes in subproces
 Index: textsuggest/processors/command.cpp
 --- textsuggest/processors/command.cpp.orig
 +++ textsuggest/processors/command.cpp
-@@ -31,10 +31,10 @@ int main(int argc, char ** argv) {
-                       shell = env_shell;
+@@ -36,9 +36,9 @@ int main(int argc, char ** argv) {
+               }
+               try {
+                       sp::popen proc (shell, {"-c", "--", text});
+-                      std::cout << proc.stdout().rdbuf();
++                      std::cout << &proc.get_stdout();
+               }
+-              catch {
++              catch(const std::exception &e) {
+                       // if command fails do nothing
                }
-               sp::popen proc (shell, {"-c", "--", text});
--              std::cout << proc.stdout().rdbuf();
-+              std::cout << &proc.get_stdout();
  
-       }
+@@ -46,4 +46,4 @@ int main(int argc, char ** argv) {
        
        return 0;
  
Index: patches/patch-textsuggest_processors_math_expression_cpp
===================================================================
RCS file: 
/home/cvs/ports/x11/textsuggest/patches/patch-textsuggest_processors_math_expression_cpp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-textsuggest_processors_math_expression_cpp
--- patches/patch-textsuggest_processors_math_expression_cpp    14 Mar 2019 
14:47:07 -0000      1.1.1.1
+++ patches/patch-textsuggest_processors_math_expression_cpp    9 Jan 2020 
09:52:30 -0000
@@ -3,16 +3,12 @@ Adjust to match our changes in subproces
 Index: textsuggest/processors/math_expression.cpp
 --- textsuggest/processors/math_expression.cpp.orig
 +++ textsuggest/processors/math_expression.cpp
-@@ -24,9 +24,9 @@ int main(int argc, char ** argv) {
-               std::string python_cmd = "from math import *;print(";
+@@ -29,7 +29,7 @@ int main(int argc, char ** argv) {
                python_cmd += text + ")";
+               std::cerr << python_cmd << std::endl;
                sp::popen proc ("python3", {"-c", python_cmd});
 -              std::cout << proc.stdout().rdbuf();
 +              std::cout << &proc.get_stdout();
        }
        
        return 0;
- 
--}
-\ No newline at end of file
-+}

Reply via email to