summaryrefslogtreecommitdiff
path: root/nonprism/pidgin/PKGBUILD
blob: 74f42a8f42e3ca13d637d812b85632887d8efaa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# $Id: PKGBUILD 249233 2015-10-13 21:30:13Z foutrelis $
# Maintainer (Arch): Evangelos Foutras <evangelos@foutrelis.com>
# Contributor (Arch): Ionut Biru <ibiru@archlinux.org>
# Contributor (Arch): Andrea Scarpino <andrea@archlinux.org>
# Contributor (Arch): Alexander Fehr <pizzapunk gmail com>
# Contributor (Arch): Lucien Immink <l.immink@student.fnt.hvu.nl>
# Maintainer: André Silva <emulatorman@parabola.nu>
# Contributor: Márcio Silva <coadde@parabola.nu>

pkgname=('pidgin' 'libpurple' 'finch')
pkgver=2.10.11
pkgrel=6.nonprism1
_rev=cbc4db14444c91f4f4b03aa1b228c2d51dacea6b
arch=('i686' 'x86_64')
url="http://pidgin.im/"
license=('GPL')
makedepends=('startup-notification' 'gtkspell' 'libxss' 'nss' 'libsasl' 'libsm'
             'libidn' 'python2' 'hicolor-icon-theme' 'farstream'
             'avahi' 'tk' 'ca-certificates' 'intltool' 'networkmanager'
             'mercurial')
source=(pidgin::hg+https://bitbucket.org/pidgin/main#revision=$_rev
        nonprism.patch)
sha256sums=('SKIP'
            'f720dc9aca3191b65cd89828ab7266e06d93203b7f0de9ac6b506227b00b0bc0')

prepare() {
  cd $pkgbase

  # Revert change that breaks rejoining multi-user chats
  # https://developer.pidgin.im/ticket/16724
  {
    hg diff -c 136a5e95a1ad
    hg diff -c 187b51ce9922
  } | patch -Rp1

  msg "Remove Google Talk and Facebook protocols"
  patch -Np1 -i "$srcdir/nonprism.patch"

  msg "Remove wrong OS term"
  sed -i 's|on Linux|on GNU/Linux|' libpurple/valgrind.h
  sed -i 's|On Linux|On GNU/Linux|' libpurple/connection.h

  autoreconf -vi

  # Use Python 2
  sed -i 's/env python$/&2/' */plugins/*.py \
    libpurple/purple-{remote,notifications-example,url-handler}
}

build() {
  cd $pkgbase

  ./autogen.sh \
    --prefix=/usr \
    --sysconfdir=/etc \
    --disable-schemas-install \
    --disable-meanwhile \
    --disable-gnutls \
    --enable-cyrus-sasl \
    --disable-doxygen \
    --enable-nm \
    --with-python=/usr/bin/python2 \
    --with-system-ssl-certs=/etc/ssl/certs \
    --with-dynamic-prpls=bonjour,irc,jabber,silc,simple,zephyr
    make
}

package_pidgin(){
  pkgdesc="Multi-protocol instant messaging client, without support for unsafe and dangerous for privacy protocols"
  depends=('libpurple' 'startup-notification' 'gtkspell' 'libxss' 'libsm'
           'gst-plugins-base' 'gst-plugins-good' 'hicolor-icon-theme')
  optdepends=('aspell: for spelling correction')
  conflicts=(${pkgname}-nonprism)
  replaces=(${pkgname}-nonprism)
  install=pidgin.install

  cd $pkgbase

  # For linking
  make -C libpurple DESTDIR="$pkgdir" install-libLTLIBRARIES

  make -C pidgin DESTDIR="$pkgdir" install
  make -C doc DESTDIR="$pkgdir" install

  # Remove files that are packaged in libpurle
  make -C libpurple DESTDIR="$pkgdir" uninstall-libLTLIBRARIES

  rm "$pkgdir/usr/share/man/man1/finch.1"

  msg "Removing PRISM images"
  rm -v "$pkgdir"/usr/share/pixmaps/pidgin/emblems/{16/aol-client.png,scalable/aol-client.svg} 
  rm -v "$pkgdir"/usr/share/pixmaps/pidgin/emotes/default/msn{,-away,-busy,_online}.png 
  rm -v "$pkgdir"/usr/share/pixmaps/pidgin/protocols/{16,22}/google-talk.png 
  rm -v "$pkgdir"/usr/share/pixmaps/pidgin/protocols/{16,22,48}/{aim,facebook,gadu-gadu,icq,meanwhile,msn,mxit,myspace,novell,yahoo}.png  
  rm -v "$pkgdir"/usr/share/pixmaps/pidgin/protocols/scalable/{aim,gadu-gadu,google-talk,icq,meanwhile,msn,mxit,novell,yahoo}.svg 

  msg "Pidgin desktop patching"
  sed -i "\|Comment\[|d
          s|Supports AIM, Google Talk, Jabber/XMPP, MSN, Yahoo and more|Supports Jabber/XMPP and more|
         " "$pkgdir"/usr/share/applications/pidgin.desktop
}

package_libpurple(){
  pkgdesc="IM library extracted from Pidgin, without support for unsafe and dangerous for privacy protocols"
  depends=('farstream' 'libsasl' 'libidn' 'dbus-glib' 'nss')
  optdepends=('avahi: Bonjour protocol support'
              'ca-certificates: SSL CA certificates'
              'python2-dbus: for purple-remote and purple-url-handler'
              'tk: Tcl/Tk scripting support')
  conflicts=(${pkgname}-nonprism)
  replaces=(${pkgname}-nonprism)

  cd $pkgbase

  for _dir in libpurple share/sounds share/ca-certs m4macros po; do
    make -C "$_dir" DESTDIR="$pkgdir" install
  done
}

package_finch(){
  pkgdesc="A ncurses-based messaging client, without support for unsafe and dangerous for privacy protocols"
  depends=('libpurple' 'libx11' 'python2')
  conflicts=(${pkgname}-nonprism)
  replaces=(${pkgname}-nonprism)

  cd $pkgbase

  # For linking
  make -C libpurple DESTDIR="$pkgdir" install-libLTLIBRARIES

  make -C finch DESTDIR="$pkgdir" install
  make -C doc DESTDIR="$pkgdir" install

  # Remove files that are packaged in libpurle
  make -C libpurple DESTDIR="$pkgdir" uninstall-libLTLIBRARIES

  rm "$pkgdir"/usr/share/man/man1/pidgin.1
}

# vim:set ts=2 sw=2 et: