summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: e24af0f1002d853c9d90c65af5009bd3fd645606 (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
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (AUR):  WorMzy Tykashi <wormzy.tykashi@gmail.com>
# Contributor (AUR): artiom <a.mv at gmx dot fr>
# Contributor (AUR): ilikenwf
# Contributor (AUR): American_Jesus
# Contributor (AUR): Mufflone
# Contributor (AUR): switchnode

# # I maintain this because:
# AUR version does not use full length commit IDs
# AUR version does not use specific UXP commit
# AUR version does not check signatures on UXP repo
# AUR version does not use system libs

pkgname=palemoon
_pmaltname=pale-moon
_pmotheraltname=Pale-Moon
_uxpaltname=uxp
pkgver=33.5.1
pkgrel=1
# palemoon commit ID can be found at https://repo.palemoon.org/MoonchildProductions/Pale-Moon/tags
_commit=9b1a67e34a3a86514dcb25f38398ec8e83ce93ac
# UXP commit ID can be found at https://repo.palemoon.org/MoonchildProductions/UXP/tags
_UXPcommit=2d1129eb7eb786f318067b4c0df0a7aea93048e0
pkgdesc="Open source web browser based on Firefox focusing on efficiency."
arch=(x86_64 i686)
license=(MPL-2.0 GPL LGPL)
url="https://www.palemoon.org/"
options=(lto)
depends=(gtk2 dbus-glib desktop-file-utils libxt mime-types alsa-lib
         bzip2 libffi libjpeg-turbo pixman zlib)
makedepends=(python2 unzip zip yasm libpulse jack
             git)
optdepends=('ffmpeg: various video and audio support'
            'alsa-utils: ALSA support'
            'jack: Jack support'
            'pulseaudio: PulseAudio support'
            'palemoon-preferences: Custom vendor.js with security by default'
            'palemoon-preferences-basic: Custom vendor.js with less breaking changes')
#source=($pkgname-$pkgver.tar.xz::https://archive.palemoon.org/source/${pkgname}-${pkgver}.source.tar.xz
#        $pkgname-$pkgver.tar.xz.sig::https://archive.palemoon.org/source/${pkgname}-${pkgver}.source.tar.xz.sig
source=(git+"https://repo.palemoon.org/MoonchildProductions/${_pmotheraltname}?signed#commit=${_commit}"
        git+"https://repo.palemoon.org/MoonchildProductions/UXP?signed#commit=${_UXPcommit}"
        mozconfig.in)
sha1sums=('27124ecc5e4100d2573d5bf75fa2a612eb34da2d'
          'ce52318730cfadd9c498936f04e26bf34a428a54'
          '71ad1fdd6f76c896486565d0dfa27b0919228b00')
sha256sums=('49775e29fd1cd00ee0a18d28e344e35cf2b6be128c268e508a0239aeaa50f12f'
            '6239920a5e7f459b36f17ad2f922af0e7f492ed0425f87344f4a0e32b07084f2'
            '2da2111c9c204a4babaf19e1e1c1d629513b410d1290ac44a1f14c02a4f5d704')
b2sums=('ae8112dedaa0e9c3430a6551f3d801e5e7539f0fedb05ae34cdfcac2d06875d6dcc33ae5aa71b67273e69542f9966063721a816b70b25e2a07be3a7dc44dd16f'
        'e4a17351c598005407091b5cb19829455bf035208321df811cf732f7919cddbebe0fc2fed5d54d4d26885c5bc7954e5c8ac4a8cc74093a5832ddc7c44b0471da'
        '290dfd5c3f93025048c94b6b592a3605e093862f1c4fbd96a9cde61b91ebb53b2901ce62b646cff298f9286bd46767972ac20a7bd19d902b470f15ca4c9fa4b7')
#https://www.palemoon.org/0x8FCF9CEC.asc
validpgpkeys=('3DAD8CD107197488D2A2A0BD40481E7B8FCF9CEC')

prepare() {
  sed 's#%SRCDIR%#'"${srcdir}"'#g' mozconfig.in > mozconfig

  cd ${_pmotheraltname}

  git submodule init
  git config submodule.platform.url "${srcdir}/UXP"
  git -c protocol.file.allow=always submodule update
}

build() {
  cd ${_pmotheraltname}

  # palemoon is prone to OOM, use 1 thread per 2GB ram
  export MOZ_MAKE_FLAGS="${MAKEFLAGS}"
  #export MOZ_MAKE_FLAGS="-j32"

  # Remove option not supported by ld.gold to prevent configure failure
  export LDFLAGS="${LDFLAGS/-Wl,-z,pack-relative-relocs/}"

  export MOZBUILD_STATE_PATH="${srcdir}/mozbuild"
  export MOZCONFIG="${srcdir}/mozconfig"
  export CFLAGS="$CFLAGS -O3 -fstack-protector-all -fPIC"
  export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -fPIC"

  ./mach build
}

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

  # icons
  install -Dm644 ${srcdir}/${_pmotheraltname}/${pkgname}/branding/official/default16.png \
    "${pkgdir}/usr/share/icons/hicolor/16x16/apps/${pkgname}.png"
  install -Dm644 ${srcdir}/${_pmotheraltname}/${pkgname}/branding/official/default32.png \
    "${pkgdir}/usr/share/icons/hicolor/32x32/apps/${pkgname}.png"
  install -Dm644 ${srcdir}/${_pmotheraltname}/${pkgname}/branding/official/default48.png \
    "${pkgdir}/usr/share/icons/hicolor/48x48/apps/${pkgname}.png"
  install -Dm644 ${srcdir}/${_pmotheraltname}/${pkgname}/branding/official/mozicon128.png \
    "${pkgdir}/usr/share/icons/hicolor/128x128/apps/${pkgname}.png"

  # install desktop file
  install -Dm644 "${srcdir}/${_pmotheraltname}/${pkgname}/branding/official/palemoon.desktop" \
    "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}