blob: cffa941020eb042db403726f4ac408c9fb0acae4 (
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: Daniel Peukert <daniel@peukert.cc>
_target='compass-readonly-beta'
_edition=' Readonly Beta'
pkgname="mongodb-$_target"
_pkgver='1.46.6-beta.1'
pkgver="$(printf '%s' "$_pkgver" | tr '-' '.')"
pkgrel='1'
pkgdesc='The official GUI for MongoDB - Readonly Edition - beta version'
arch=('x86_64' 'armv7h' 'aarch64')
url='https://www.mongodb.com/products/compass'
license=('SSPL-1.0')
_electronpkg='electron36'
depends=("$_electronpkg" 'krb5' 'libmongocrypt>=1.12.0' 'libsecret' 'lsb-release' 'nodejs>=18.19.1')
makedepends=('git' 'npm>=11.4.1' 'python' 'unzip')
optdepends=('org.freedesktop.secrets')
backup=('etc/mongodb-compass.conf')
source=(
"$pkgname-$pkgver.tar.gz::https://github.com/mongodb-js/compass/archive/v$_pkgver.tar.gz"
'update-dependencies.diff'
'update-dependencies-beta.diff'
'hadron-build-ffmpeg.diff'
'fix-argv.diff'
'fix-argv-beta.diff'
'mongodb-compass.conf'
)
b2sums=('72d7a32b540d7667340a4a255fcc4d1923c3ce33285279b603a651ac7c16ca24f8d07552e9a7a131c6980b00b6482d1de45de4441a1d89f6974a7c9da8c81e5b'
'39963c3cf3aec9a9e43ea76a5a5d7ac7dfd5bc9ed3011bbf8b1febf4f70fc5b885e33197327d9ac82f3ae51d282e118f206ac1ee44dfbff7192109ecf05e9e8e'
'ba5a5b57c4f8d75fa2cbdbf9267a4025768db5c9c13759893b29e1a4265e16ea4a5194e880b6e70d30db19e0e25ff248a06de8152936c9f36d277654ca7ac14d'
'339cb2f14805ce8f186064d823b3b01630ea02b16052fb764a46a4df2c9b06f8d12b012e764d00aaa1906639e8019869816ddbb6c02fedac2cb06caeefab28ef'
'69154b5491c8c3149195743bcbcb0ae7b18b8e83635f7afa29e9ef7b50a42343a2877760b41662c5943b8f7d390df85548cbcd253772fa92e33b9f231ab19436'
'416e82d97116bbb4c8ad00837a81608a3b18fba4fffa9adebbabc4583124da96f9c6632645de5a9b234ccdb0436030928546c8c1a897081da8bbd12fef95249e'
'42535bfc10db335d685fad29aade1d091554a321fb4032b72db5699a450c6d701f630c45bb0d4cf9f456e77e3263a5aed49e843516cd3016d1a837ac5f1e6fec')
_sourcedirectory="compass-$_pkgver"
prepare() {
cd "$srcdir/$_sourcedirectory/"
# Set npm overrides for various dependencies
if [[ "$_target" =~ -beta$ ]]; then
patch --forward -p1 < "$srcdir/update-dependencies-beta.diff"
else
patch --forward -p1 < "$srcdir/update-dependencies.diff"
fi
# Set system Electron version for ABI compatibility
sed -i "s|%%ELECTRON_VERSION%%|$(cat "/usr/lib/$_electronpkg/version")|g" 'package.json'
npm update electron --package-lock-only
# Force the newest version of electron-to-chromium to make sure we support the Electron version set above
npm update electron-to-chromium --package-lock-only
# Fix ssh2 and cpu-features build
npm update nan ssh2 --package-lock-only
# Don't use the bundled ffmpeg
patch --forward -p1 < "$srcdir/hadron-build-ffmpeg.diff"
# Apply argv fixes
if [[ "$_target" =~ -beta$ ]]; then
patch --forward -p1 < "$srcdir/fix-argv-beta.diff"
else
patch --forward -p1 < "$srcdir/fix-argv.diff"
fi
# Run the bootstrap command
HUSKY=0 GYP_DEFINES='libmongocrypt_link_type=dynamic' npm run bootstrap
}
build() {
cd "$srcdir/$_sourcedirectory/"
# electron-packager does not support building against a local electron binary,
# the best we can do for now is to just set the electron version in package.json
# and let electron-packager use it for building
# https://github.com/electron/electron-packager/issues/187
HADRON_DISTRIBUTION="${_target%-beta}" HADRON_SKIP_INSTALLER='true' npm run package-compass
}
package() {
local _distFolder
_distFolder="$srcdir/$_sourcedirectory/packages/compass/dist/MongoDB Compass$_edition-linux"
case "$CARCH" in
armv7h)
_distFolder="$_distFolder-armv7l"
;;
aarch64)
_distFolder="$_distFolder-arm64"
;;
*)
_distFolder="$_distFolder-x64"
;;
esac
cd "$_distFolder/"
install -Dm644 'resources/app.asar' "$pkgdir/usr/lib/$pkgname/app.asar"
cp -r --no-preserve=ownership --preserve=mode 'resources/app.asar.unpacked/' "$pkgdir/usr/lib/$pkgname/app.asar.unpacked/"
install -dm755 "$pkgdir/usr/bin/"
cat << EOF > "$pkgdir/usr/bin/$pkgname"
#!/bin/sh
NODE_ENV=production exec $_electronpkg '/usr/lib/$pkgname/app.asar' "\$@"
EOF
chmod +x "$pkgdir/usr/bin/$pkgname"
install -dm755 "$pkgdir/usr/share/applications/"
cat << EOF > "$pkgdir/usr/share/applications/$pkgname.desktop"
[Desktop Entry]
Name=MongoDB Compass$_edition
Comment=The official GUI for MongoDB
Exec=$pkgname %U
Icon=$pkgname
Type=Application
StartupNotify=true
Categories=Office;Database;Building;Debugger;IDE;GUIDesigner;Profiling;
EOF
install -Dm644 "$srcdir/mongodb-compass.conf" "$pkgdir/etc/mongodb-compass.conf"
if [[ "$_target" =~ -beta$ ]]; then
install -Dm644 "$srcdir/$_sourcedirectory/packages/compass/app-icons/linux/mongodb-compass-logo-beta.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
else
install -Dm644 "$srcdir/$_sourcedirectory/packages/compass/app-icons/linux/mongodb-compass-logo-stable.png" "$pkgdir/usr/share/pixmaps/$pkgname.png"
fi
install -dm755 "$pkgdir/usr/share/licenses/$pkgname/"
install -Dm644 'LICENSE' "$pkgdir/usr/share/licenses/$pkgname/SSPL-1.0"
install -Dm644 'LICENSES.chromium.html' "$pkgdir/usr/share/licenses/$pkgname/LICENSES.chromium.html"
}
|