blob: 0ad253a4c29216aaf16e154e566b8ed1630f2370 (
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
|
# Maintainer: Daniel Peukert <daniel@peukert.cc>
_target='compass-isolated'
_edition=' Isolated Edition'
pkgname="mongodb-$_target"
_pkgver='1.49.1'
pkgver="$(printf '%s' "$_pkgver" | tr '-' '.')"
pkgrel='1'
pkgdesc='The official GUI for MongoDB - Isolated Edition'
arch=('x86_64' 'armv7h' 'aarch64')
url='https://www.mongodb.com/products/compass'
license=('SSPL-1.0')
_electronpkg='electron37'
depends=("$_electronpkg" 'krb5' 'libmongocrypt>=1.12.0' 'libsecret' 'lsb-release' 'nodejs>=22.21.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"
'hadron-build-ffmpeg.diff'
'fix-argv.diff'
'update-dependencies.diff'
'mongodb-compass.conf'
)
b2sums=('efda14cfc07d5439a99627ffc1101b91684bbf831048232410d63c1ce2dfdbb2364c40942da04924b1ea2b7d6f63eb864b9b149df970b805209658ca3655e4fc'
'c0f139a686be88867b54ee530bd95bf51e71ccf2d07f25a8a70fffdfc7592ff017fd386641170a80596f855b2df39da5dc05fc563c018540fc3bc610e16971e1'
'925dbea3aa18e5ac3529276f0c5d4c42d7ae5cb81cc9e5df3b411af751b8314e9a20bd0c5c7af144d2cdd11a26634a11aa7c064545d96003566640f5005375df'
'5f42f9cd32956adb4c90e5db5f24afbccf63a881fb1e87913d6d52938c3d358db10b18e4caae5e4d2ac65e206f61e8af092388c729ec09f67e18ea1e3edc3f07'
'42535bfc10db335d685fad29aade1d091554a321fb4032b72db5699a450c6d701f630c45bb0d4cf9f456e77e3263a5aed49e843516cd3016d1a837ac5f1e6fec')
_sourcedirectory="compass-$_pkgver"
prepare() {
cd "$srcdir/$_sourcedirectory/"
# Don't use the bundled ffmpeg
patch --forward -p1 < "$srcdir/hadron-build-ffmpeg.diff"
# Apply argv fixes
patch --forward -p1 < "$srcdir/fix-argv.diff"
# Set npm overrides for various dependencies
patch --forward -p1 < "$srcdir/update-dependencies.diff"
# Set system Electron version for ABI compatibility
sed -i "s|%%ELECTRON_VERSION%%|$(cat "/usr/lib/$_electronpkg/version")|g" 'package.json'
# Update overriden packages, see below for reasoning
## electron - ABI compatibility with the system Electron version
## electron-to-chromium - ensure compatibility with the Electron version set above
## html-webpack-plugin - fix build with node>=25.1.0
npm update electron electron-to-chromium html-webpack-plugin --package-lock-only
# 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"
}
|