summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1891b1ea6054f0a634ce4505a788c04cabed5a73 (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
141
142
143
144
145
146
147
148
149
150
151
152
153
# Maintainer: Michał Wojdyła < micwoj9292 at gmail dot com >
# Contributor: Carl Smedstad <carl.smedstad at protonmail dot com>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=seamonkey
pkgver=2.53.19
pkgrel=2
pkgdesc="SeaMonkey internet suite"
arch=(x86_64)
url="https://www.seamonkey-project.org"
license=(MPL-2.0)
depends=(
  at-spi2-core
  bash
  cairo
  dbus
  dbus-glib
  fontconfig
  freetype2
  gcc-libs
  gdk-pixbuf2
  glib2
  glibc
  gtk3
  hunspell
  libevent
  libffi
  libpulse
  libvpx
  libx11
  libxcb
  libxcomposite
  libxdamage
  libxext
  libxfixes
  libxrender
  libxt
  mime-types
  nspr
  nss
  pango
  pixman
  sqlite
  startup-notification
  zlib
)
makedepends=(
  autoconf2.13
#  cargo
  rustup
  cbindgen
  clang
  imake
  llvm
  mesa
  nasm
#  python, fails with python 3.12
  unzip
  yasm
  zip
)
optdepends=(
  'libnotify: Notification integration'
  'networkmanager: Location detection via available WiFi networks'
  'pulseaudio: Audio support'
)
install="$pkgname.install"
options=(!lto)
source=(
  "https://archive.seamonkey-project.org/releases/$pkgver/source/seamonkey-$pkgver.source.tar.xz"
  "mozconfig"
  https://www.python.org/ftp/python/3.11.10/Python-3.11.10.tar.xz{,.asc}
)
validpgpkeys=('A035C8C19219BA821ECEA86B64E628F8D684696D')  # Pablo Galindo Salgado <pablogsal@gmail.com>
sha256sums=(
  'a6c9a44d2a167f04fff5d4175ad61e934c6177852ab8ab56c319f242a73146e2'
  '9554b2823d05c7d406325daec629c8b3f64e7d6a32db1bae5683c57d41de529f'
  '07a4356e912900e61a15cb0949a06c4a05012e213ecd6b4e84d0f67aabbee372'
  'SKIP'
)

# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact foutrelis@archlinux.org for
# more information.
_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM

# Mozilla API keys (see https://location.services.mozilla.com/api)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact heftig@archlinux.org for
# more information.
_mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a

_archive="$pkgname-$pkgver"

prepare() {
  # packed_simd no longer builds with 1.78.0
  # https://github.com/rust-lang/packed_simd/issues/360
  rustup toolchain update --profile minimal 1.77.2
  rustup default 1.77.2

  cd "$_archive"

  cp "$srcdir/mozconfig" .mozconfig

  echo -n "$_google_api_key" > google-api-key
  echo -n "$_mozilla_api_key" > mozilla-api-key

  {
    echo "ac_add_options --with-google-location-service-api-keyfile=${PWD@Q}/google-api-key"
    echo "ac_add_options --with-google-safebrowsing-api-keyfile=${PWD@Q}/google-api-key"
    echo "ac_add_options --with-mozilla-api-keyfile=${PWD@Q}/mozilla-api-key"
  } >> .mozconfig
}

build() {
  cd Python-3.11.10
  ./configure
  make
  make DESTDIR="$srcdir/pythoninstall" install
  cd ..
  PATH="$PWD/pythoninstall/usr/local/bin:$PATH"

  cd "$_archive"

  # Don't use mold - fails.
  LDFLAGS=$(printf '%s' "$LDFLAGS" | sed 's/-fuse-ld=[^[:space:]]*//')
  export LDFLAGS
  export MACH_USE_SYSTEM_PYTHON=1
  # Fix build on non utf-8 charsets
  LC_ALL=C.UTF-8 \
  ./mach build
}

package() {
  cd "$_archive"

  # shellcheck disable=SC1007
  LC_ALL=C.UTF-8 DESTDIR="$pkgdir" INSTALL_SDK= ./mach install

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

  install -Dm644 comm/suite/branding/seamonkey/default128.png \
    "$pkgdir/usr/share/pixmaps/seamonkey.png"

  install -Dm644 toolkit/mozapps/installer/linux/rpm/mozilla.desktop \
    "$pkgdir/usr/share/applications/seamonkey.desktop"
  sed -i 's/@MOZ_APP_DISPLAYNAME@/SeaMonkey internet suite/' \
    "$pkgdir/usr/share/applications/seamonkey.desktop"
  sed -i 's/@MOZ_APP_NAME@/seamonkey/' "$pkgdir/usr/share/applications/seamonkey.desktop"
}