blob: 6884cb82ce095016afdbbb1b8cce0ef2d27c559e (
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
|
# Maintainer: Riccardo Sacchetto <rsacchetto@nexxontech.it>
pkgname=antares-sql
pkgver=0.5.15
pkgrel=1
pkgdesc="Open source and cross platform SQL client made to be simple and complete"
arch=('x86_64')
url="https://antares-sql.app/"
license=('MIT')
depends=('electron17')
makedepends=('nvm' 'python')
source=("https://github.com/Fabio286/antares/archive/refs/tags/v${pkgver}.tar.gz"
"antares-sql.desktop"
"antares-sql.sh")
sha512sums=("3c5ecdb2f4419030140e37948c4ccd811043d9b62361e65fdd06c3903536a54344c535329efcd0740c25ce8b3e17529fb91bb803cce2fdc474ac34e2fc7f4a2b"
"4dc1837ee4a8e9e4c610a9fc8b8724a903ebaea1aeed32f30c4ee469d2e12198549bfc760327c413534053f54ffe8248905a925fc5d63d2c6e31d75a413da4dc"
"b3b1e1c9dfb59fc3e89f3c53194550634a2cd9e45ee9ae1b725c315e1ee3fdf657487409cb044a0c28875031608b6d128475095597de7031a8aa3b601a34baf4")
_ensure_local_nvm() {
# Check if NVM is enabled (and, if so, disable it)
which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
# Use a temp folder as NVM dir to avoid ruining user config
export NVM_DIR="${srcdir}/.nvm"
# Load NVM with the temp path
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
}
prepare() {
# Load NVM with temp path
_ensure_local_nvm
# Install Node.JS 16 with NVM to avoid compatibility issues
nvm install 16
# Enter the Antares source folder downloaded from GitHub
cd "${srcdir}/antares-${pkgver}"
# Install JS dependencies
npm install
}
build() {
# Enter the Antares source folder downloaded from GitHub
cd "${srcdir}/antares-${pkgver}"
# Compile (WebPack) the application
NODE_ENV=production npm run compile
# Run Electron Builder
npx --no-install electron-builder --linux --"x64" --dir -c.npmRebuild=false -c.electronDist=/usr/lib/electron17 -c.electronVersion=$(</usr/lib/electron17/version) --publish always
}
package() {
# Enter the source directory
cd "${srcdir}"
# Install the desktop file
install -Dm644 ./antares-sql.desktop "${pkgdir}/usr/share/applications/antares-sql.desktop"
# Install the startup script
install -Dm755 ./antares-sql.sh "${pkgdir}/usr/bin/antares-sql"
# Enter the Antares source folder downloaded from GitHub
cd "antares-${pkgver}"
# Create destination directory
install -dm755 "${pkgdir}/usr/lib/antares-sql"
# Install the asar archive
install -Dm644 ./build/linux-unpacked/resources/app.asar "${pkgdir}/usr/lib/antares-sql/antares-sql.asar"
# Copy the folder with the native dependencies
cp -r ./build/linux-unpacked/resources/app.asar.unpacked "${pkgdir}/usr/lib/antares-sql/antares-sql.asar.unpacked"
# Install the icon
install -Dm644 ./assets/appx/Square150x150Logo.png "${pkgdir}/usr/share/icons/antares-sql.png"
}
|