You are not logged in.

#1 2012-01-26 21:16:13

dazzy
Member
Registered: 2009-02-05
Posts: 5

Psi+ with OTR Plugin 0.9.4

Hi,

this articel is about the psi-plus package you can find in the AUR.

I want to stress, that it is very easy to have OTR functionality built in this application. By the way: this version 0.9.4 supports shared secret authentification. Acutally it allready comes with all the sources needed, when you download it, they are just disabled. Here is how to enable them. Hope somebody helps me improving this...

First, you download the AUR tarball, extract and enter it:

$ wget https://aur.archlinux.org/packages/ps/psi-plus/psi-plus.tar.gz
$ tar zxf psi-plus.tar.gz
$ cd psi-plus

Now you have to create this patch file,
PKGBUILD.patch:

--- PKGBUILD	2011-06-30 10:35:12.000000000 +0300
+++ PKGBUILD.new	2012-01-26 21:26:51.559494500 +0200
@@ -44,6 +44,7 @@
   if [ ! -f ./libpsibuild.sh -o "$WORK_OFFLINE" = 0 ]; then
     [ -f libpsibuild.sh ] && { rm libpsibuild.sh || die "Delete error"; }
     wget --no-check-certificate "https://raw.github.com/psi-plus/maintenance/master/scripts/posix/libpsibuild.sh" || die "Failed to update libpsibuild";
+    patch libpsibuild.sh ../libpsibuild.sh.patch
   fi
   
   . ./libpsibuild.sh

And apply the patch:

[psi-plus]$ patch PKGBUILD PKGBUILD.patch

Now create some other patches,
libpsibuild.sh.patch:

--- libpsibuild.sh	2012-01-26 21:01:40.729845180 +0200
+++ libpsibuild.sh.new	2012-01-26 22:43:30.347865484 +0200
@@ -43,7 +43,7 @@
 # convert PSI_DIR to absolute path
 [ -n "${PSI_DIR}" ] && case "${PSI_DIR}" in /*) ;; *) PSI_DIR="$(pwd)/${PSI_DIR}"; ;; esac
 
-PLUGINS_PREFIXES="${PLUGINS_PREFIXES:-generic}" # will be updated later while detecting platform specific settings
+PLUGINS_PREFIXES="${PLUGINS_PREFIXES:-generic dev}" # will be updated later while detecting platform specific settings
 #######################
 # FUNCTIONS / ФУНКЦИИ #
 #######################
@@ -545,6 +545,11 @@
     cp -a "${PSI_DIR}/plugins/$name" \
       "${PSI_DIR}/build/src/plugins/$name"
   done
+  
+  # apply otrplugin patch
+  echo "Apply otrplugin patch"
+  patch "${PSI_DIR}/build/src/plugins/dev/otrplugin/src/HtmlTidy.hpp" \
+      "${PSI_DIR}/../HtmlTidy.hpp.patch"
 }
 
 prepare_all() {

and
HtmlTidy.hpp.patch:

--- HtmlTidy.hpp	2012-01-26 21:55:46.714195407 +0200
+++ HtmlTidy.hpp.new	2012-01-26 21:58:15.710492819 +0200
@@ -22,8 +22,8 @@
 #define HTMLTIDY_HPP_
 
 #include <string>
-#include <tidy/tidy.h>
-#include <tidy/buffio.h>
+#include <tidy.h>
+#include <buffio.h>
 #include <QtXml>
 
 class HtmlTidy

So finally, your psi-plus folder should look like this, with PKGBUILD allready patched:

[psi-plus]$ ls -1
HtmlTidy.hpp.patch
libpsibuild.sh.patch
PKGBUILD
PKGBUILD.patch

Now build the package and you are done:

[psi-plus]$ makepkg

Anyone ideas, how to make this easier?

Last edited by dazzy (2012-01-26 22:05:04)

Offline

#2 2012-01-27 03:01:36

ddazzy
Member
Registered: 2011-01-10
Posts: 8

Re: Psi+ with OTR Plugin 0.9.4

More information about otr plugin is avaible here:
github.com/psi-plus/plugins/tree/master/dev/otrplugin
You can also see: it really allready is inside the Psi+ sources you can download, if you enable the "dev" plugins as well.

Offline

#3 2012-01-27 23:08:00

andre.vmatos
Member
Registered: 2010-07-28
Posts: 19

Re: Psi+ with OTR Plugin 0.9.4

To enable dev plugins (to compile OTR directly), just add:

PLUGINS_PREFIXES="generic dev"

to variable declarations in build() in PKGBUILD (e.g. just before PLUGINS declaration).

The tidy error also can be fixed (in a dirty and temporary way) by making a folder named "tidy" into /usr/include and linking tidy headers (buffio.h, platform.h, tidyenum.h, tidy.h) from /usr/include into /usr/include/tidy.

Offline

#4 2012-01-28 19:20:15

ddazzy
Member
Registered: 2011-01-10
Posts: 8

Re: Psi+ with OTR Plugin 0.9.4

Oh, I see. That's just what you wrote on Dec 16th on the psi-plus AUR page. Didn't see that, sry. Well, so we have two ways of doing that. Both not perfect, but your explanation is shorter ;-)

Offline

#5 2012-01-28 21:27:29

andre.vmatos
Member
Registered: 2010-07-28
Posts: 19

Re: Psi+ with OTR Plugin 0.9.4

I think the most correct way to fix that is PLUGINS_PREFIXES with a patch to fix tidy errors

Offline

#6 2012-01-29 19:02:14

ddazzy
Member
Registered: 2011-01-10
Posts: 8

Re: Psi+ with OTR Plugin 0.9.4

Well, to complete this I merged both of our versions to this, hope it's short and clean now:

1. Modify PKGBUILD like this:

--- PKGBUILD	2011-10-11 03:01:19.000000000 +0200
+++ PKGBUILD.new	2012-01-29 20:45:36.348771529 +0200
@@ -36,6 +36,7 @@
   CONF_OPTS=""
   [ $usewebkit -eq "1" ] && CONF_OPTS="${CONF_OPTS} --enable-webkit"
   INSTALL_ROOT=$pkgdir 
+  PLUGINS_PREFIXES="generic dev"
   PLUGINS=$plugins_list
   TRANSLATIONS="ru"
   
@@ -60,6 +61,11 @@
   revision=$rev
   [ $usewebkit -eq "1" ] && revision="${revision}webkit"
   sleep 0;pkgver="$pkgver.$revision"
+
+  # Apply HtmlTidy.hpp patch
+  echo "Apply HtmlTidy.hpp patch"
+  patch "${PSI_DIR}/build/src/plugins/dev/otrplugin/src/HtmlTidy.hpp" \
+      "${PSI_DIR}/../HtmlTidy.hpp.patch"
   
   compile_all || true
   install_all || true

2. This new PKGBUILD also includes a patch file for the Htmltipy.hpp problem, so you also need to create a patchfile in your "psi-plus" directory, named "HtmlTidy.hpp.patch":

--- HtmlTidy.hpp	2012-01-26 21:55:46.714195407 +0200
+++ HtmlTidy.hpp.new	2012-01-26 21:58:15.710492819 +0200
@@ -22,8 +22,8 @@
 #define HTMLTIDY_HPP_
 
 #include <string>
-#include <tidy/tidy.h>
-#include <tidy/buffio.h>
+#include <tidy.h>
+#include <buffio.h>
 #include <QtXml>
 
 class HtmlTidy

3. You're done, you can build the package now:

 $ makepkg

Offline

#7 2012-03-13 16:58:07

ddazzy
Member
Registered: 2011-01-10
Posts: 8

Re: Psi+ with OTR Plugin 0.9.4

Thanks to this...

otrplugin.pro (...) A try to fix otrplugin compilation on systems with different include

... having Psi-Plus with OTR-Plugin is much easier now. (Source: https://github.com/psi-plus/plugins/tre … /otrplugin)

Just modify your PKGBUILD like this...

--- PKGBUILD	2012-03-08 03:57:54.000000000 +0200
+++ PKGBUILD.new	2012-03-13 18:53:18.127889422 +0200
@@ -9,7 +9,7 @@
 url="http://psi-plus.com"
 license=('GPL2')
 arch=('i686' 'x86_64')
-depends=('qt' 'qca-ossl' 'qca-gnupg' 'aspell' 'libxss' 'openssl' 'dbus' 'zlib')
+depends=('qt' 'qca-ossl' 'qca-gnupg' 'aspell' 'libxss' 'openssl' 'dbus' 'zlib' 'tidyhtml')
 makedepends=('wget' 'git' 'patch' 'qconf')
 # Plugins list. Includes certain plugins
 # * - include all plugins
@@ -36,6 +36,7 @@
   CONF_OPTS=""
   [ $usewebkit -eq "1" ] && CONF_OPTS="${CONF_OPTS} --enable-webkit"
   INSTALL_ROOT=$pkgdir 
+  PLUGINS_PREFIXES="generic dev"
   PLUGINS=$plugins_list
   TRANSLATIONS="ru"
   

... and you are done. Now Compile your Psi-Plus and that's it.

$ makepkg

Offline

Board footer

Powered by FluxBB