summaryrefslogtreecommitdiff
path: root/libre-testing/icedove-libre/PKGBUILD
blob: f3c18693770c7f9c1619344adf6de56d5f2146b7 (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
# Maintainer : Márcio Silva <coadde@adinet.com.uy>
# Contributor: André Silva <andre.paulista@adinet.com.uy>

_pgo=false

# We're getting this from Debian Sid
_debname=icedove
_debver=10.0.3
_debrel=3
_debrepo=http://ftp.debian.org/debian/pool/main/
debfile() { echo $@|sed -r 's@(.).*@\1/&/&@'; }

_pkgname=icedove
pkgname=icedove-libre
pkgver=${_debver}
pkgrel=1

if [ -z "$pkgname" ]; then pkgname=$_pkgname; fi
if $_pgo; then
  pkgname+='-pgo'
fi

pkgdesc="A libre version of Debian Icedove, the Standalone Mail/News reader based on Mozilla thunderbird."
arch=('i586' 'i686' 'x86_64' 'mips64el')
license=('GPL2' 'MPL' 'LGPL')
depends=('alsa-lib' 'dbus-glib' 'desktop-file-utils' 'gtk2' 'hicolor-icon-theme' 'hunspell' 'libevent' 'libnotify' 'libvpx' 'libxt' 'mime-types' 'mozilla-common' 'nss' 'sqlite3' 'startup-notification')
makedepends=('unzip' 'zip' 'pkg-config' 'python2' 'wireless_tools' 'yasm' 'mesa' 'autoconf2.13')
optdepends=('libcanberra: for sound support')
if $_pgo; then
  makedepends+=('xorg-server-xvfb')
  options=(!ccache)
fi

url="http://packages.debian.org/source/sid/icedove"
install=icedove.install
source=("${_debrepo}/`debfile ${_debname}`_${_debver}.orig.tar.bz2"
        "${_debrepo}/`debfile ${_debname}`_${_debver}-${_debrel}.debian.tar.gz"
        "${_debrepo}/`debfile ${_debname}`_${_debver}-${_debrel}.dsc"
        mozconfig
        mozconfig.pgo
        icedove.desktop
        channel-prefs.js
        vendor.js)
#       libvpx.patch)
md5sums=('3efe2ef4d5471aae3b79531ce8aee9dc'
         'cb3dba2916bdf2deb72248b0984c4302'
         '57e21e997a75d85fcc0dcfe30b83f1ee'
         '3c87a2c89bd778d7cb40fc4fb2ccc52d'
         'ac29b01c189f20abae2f3eef1618ffc0'
         'e785e0c267f4435ae1a9aa0b03bcacfb'
         '476ec205162340fb0679f522c9d31c3b'
         '5a53179d14ae9631b7afe5e4d0fc0b25')
#         '5b2aaff7dfe7f1f94ad965905b20e782')

if [ "$_pkgname" != "$pkgname" ]; then
  provides+=("$_pkgname=$pkgver")
  conflicts+=("$_pkgname")
fi

dpkg-source() {
  # This will simulate dpkg-source -x ${_debname}_${_debver}-${_debrel}.dsc
  export QUILT_PATCHES=debian/patches
  export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
  export QUILT_DIFF_ARGS='--no-timestamps'
  mv comm-esr10 "${_debname}-${_debver}"
  mv debian "${_debname}-${_debver}"
  cd "${_debname}-${_debver}"
  quilt push -a
  find .pc -name .timestamp -delete # why isn't "--no-timestamps" doing this?
  cd ..
}

build() {
# Don't run this if we're using -e
if [ $NOEXTRACT -eq 0 ]; then
  msg2 "Applying Debian patches..."
  cd "${srcdir}"
  dpkg-source -x ${_debname}_${_debver}-${_debrel}.dsc

  msg2 "Starting normal build..."
  mv "${_debname}-${_debver}" "$srcdir/mozilla-build"
  cd "$srcdir/mozilla-build"

#  patch -Np1 -i "$srcdir/libvpx.patch"

  cp "$srcdir/mozconfig" .mozconfig # Load our build config, disable SafeSearch
fi

  if $_pgo; then
    cat "$srcdir/mozconfig.pgo" >> .mozconfig
  fi

  export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/$_pkgname"
  export PYTHON="/usr/bin/python2"

  if $_pgo; then
    LD_PRELOAD="" /usr/bin/Xvfb -nolisten tcp -extension GLX -screen 0 1280x1024x24 :99 &
    LD_PRELOAD="" DISPLAY=:99 make -j1 -f client.mk profiledbuild MOZ_MAKE_FLAGS="$MAKEFLAGS"
    kill $! || true
  else
    LD_PRELOAD="" make -j1 -f client.mk build MOZ_MAKE_FLAGS="$MAKEFLAGS"
  fi
}

package() {
  cd "$srcdir/mozilla-build"
  make -j1 -f client.mk DESTDIR="$pkgdir" install

  install -m644 "$srcdir"/vendor.js "$pkgdir/usr/lib/$_pkgname/defaults/pref/"

  brandingdir=other-licenses/branding/
  icondir="$pkgdir/usr/share/icons/hicolor"
  for i in 16x16 22x22 24x24 32x32 48x48 256x256; do
      install -Dm644 $brandingdir/$_pkgname/mailicon${i/x*/}.png "$icondir/$i/apps/$_pkgname.png"
  done

  install -Dm644 "$srcdir/$_pkgname.desktop" \
      "$pkgdir/usr/share/applications/$_pkgname.desktop"

  rm -rf "$pkgdir"/usr/lib/$_pkgname/{dictionaries,hyphenation}
  ln -sf /usr/share/hunspell "$pkgdir/usr/lib/$_pkgname/dictionaries"
  ln -sf /usr/share/hyphen "$pkgdir/usr/lib/$_pkgname/hyphenation"

  # We don't want the development stuff
  rm -r "$pkgdir"/usr/{include,lib/$_pkgname-devel,share/idl}

# Recommend free addons
  cp --remove-destination "${srcdir}/channel-prefs.js" \
     "${pkgdir}/usr/lib/$_pkgname/defaults/pref/channel-prefs.js"
}