summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fe09faaff46cb14692fd9f4e6c3a778d12201974 (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
# Maintainer: dreieck
# Contributor:  WorMzy Tykashi <wormzy.tykashi@gmail.com>
# Contributor: artiom <a.mv at gmx dot fr>
# Contributor: ilikenwf
# Contributor: American_Jesus

_pkgname=palemoon
pkgname="${_pkgname}-26"
pkgver=26.5.0
pkgrel=3
pkgdesc="Pale Moon web browser, old version 26 (still with the jetpack SDK addon technology, but not maintained anymore). Unofficial New Moon-branding."
arch=(
      'i686'
      'x86_64'
     )
url="http://www.palemoon.org/"
provides=(
          "${_pkgname}=${pkgver}"
         )
conflicts=(
           "${_pkgname}"
          )
license=(
         'MPL'
         'GPL'
         'LGPL'
        )
depends=(
         'alsa-lib'
         'dbus-glib'
         'desktop-file-utils'
         'gtk2'
         'libxt'
         'mime-types'
        )
makedepends=(
             'autoconf2.13'
             'gcc5'
             'git'
             'gstreamer'
             'gst-plugins-base'
             'python2'
             'unzip'
             'yasm'
             'zip'
            )
optdepends=(
            'hunspell: spell checker and morphological analyzer'
            'hyphen: library for hyphenation and justification'
            'gst-libav: h.264 support'
            'gst-plugins-good: h.264 support'
           )
source=(
        git+"https://github.com/MoonchildProductions/Pale-Moon#tag=${pkgver}_Release"
        "mozconfig.in"
       )
sha256sums=(
            'SKIP'
            '808a602d5504cb68fac706644ac01b09d8236ec7793ea81dbd453b9eb1afec32'
           )

prepare() {
  sed 's#%SRCDIR%#'"$srcdir"'#g' mozconfig.in > mozconfig
  cd Pale-Moon

  chmod -R +x build/autoconf/* python/*
  find . -name '*.sh' -exec chmod +x {} \;
}

build() {
  cd Pale-Moon

  export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
  export MOZCONFIG="$srcdir/mozconfig"
  export CPPFLAGS="$CPPFLAGS -O2"
  python2 mach build || echo "Next =>"
  python2 mach build
}

package() {
  cd pmbuild
  make package
  cd dist
  install -d "$pkgdir"/usr/{bin,lib}
  cp -r palemoon/ "$pkgdir/usr/lib/${_pkgname}"
  ln -s "../lib/${_pkgname}/palemoon" "$pkgdir/usr/bin/palemoon"

  # icons
  install -Dm644 palemoon/browser/chrome/icons/default/default16.png \
    "$pkgdir/usr/share/icons/hicolor/16x16/apps/${_pkgname}.png"
  install -Dm644 palemoon/browser/chrome/icons/default/default32.png \
    "$pkgdir/usr/share/icons/hicolor/32x32/apps/${_pkgname}.png"
  install -Dm644 palemoon/browser/chrome/icons/default/default48.png \
    "$pkgdir/usr/share/icons/hicolor/48x48/apps/${_pkgname}.png"
  install -Dm644 palemoon/browser/icons/mozicon128.png \
    "$pkgdir/usr/share/icons/hicolor/128x128/apps/${_pkgname}.png"

  # use system-provided dictionaries
  rm -rf "$pkgdir/usr/lib/${_pkgname}"/{dictionaries,hyphenation}
  ln -s /usr/share/hunspell "$pkgdir/usr/lib/${_pkgname}/dictionaries"
  ln -s /usr/share/hyphen "$pkgdir/usr/lib/${_pkgname}/hyphenation"

  # avoid duplicate binaries
  # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
  #ln -sf palemoon "$pkgdir/usr/lib/${_pkgname}/palemoon-bin"
  rm -f "$pkgdir/usr/lib/${_pkgname}/palemoon-bin"

  # install desktop file
  install -Dm644 "$srcdir/Pale-Moon/browser/branding/official/palemoon.desktop" "$pkgdir/usr/share/applications/${_pkgname}.desktop"
}