summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 07d8235f36eac8e53323d0dd5c0a8f117a640afb (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
# 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

# # 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.0
pkgrel=1
# palemoon commit ID can be found at https://repo.palemoon.org/MoonchildProductions/Pale-Moon/tags
_commit=637e1ceec2c9528d48cbe31f800b0bdb8698b440
# UXP commit ID can be found at https://repo.palemoon.org/MoonchildProductions/UXP/tags
_UXPcommit=541c5f9f45d1ad02adff21ad9393c079142bd5b6
pkgdesc="Open source web browser based on Firefox focusing on efficiency."
arch=(x86_64 i686)
license=(MPL GPL LGPL)
url="https://www.palemoon.org/"
options=(lto)
depends=(gtk3 gtk2 desktop-file-utils libxt startup-notification mime-types dbus-glib
         libpulse alsa-lib
         bzip2 libffi libjpeg-turbo pixman zlib)
makedepends=(unzip zip python2 yasm
             jack
             autoconf2.13
             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=('SKIP'
          'SKIP'
          'c2dda3fd9ef3d84546c18046833fbabee9f5aa6d')
sha256sums=('SKIP'
            'SKIP'
            'fe73fb860b7cbd1153a4322811aefef09b87f609f41840269d9480530a0db57d')
b2sums=('SKIP'
        'SKIP'
        'bbbc3d1f72bab30fa15aa2754b977efd9f0908935f0c91804ec75bf5124a818c56d1eaa5f84ca95978a4fba96e4e0edd7a395ed92c4efe81d46c480026c6712b')
#https://www.palemoon.org/0x8FCF9CEC.asc
validpgpkeys=('3DAD8CD107197488D2A2A0BD40481E7B8FCF9CEC'
              '3059E09144F56804F0FBF4E126B40624BDBFD9F3')

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"

  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"
}