blob: b3f7238cb95fd69bb5df689a2746d2fbe4562102 (
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.3
pkgrel=2
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' 'yarn' 'python')
source=("https://github.com/Fabio286/antares/archive/refs/tags/v${pkgver}.tar.gz"
"antares-sql.desktop"
"antares-sql.sh")
sha512sums=("809cded44811c8646b246c628cf24eb543d7a1c19330452d72b95efcf73a73bf65cef1891dff3acd6774c7fb165fd1b81792ea4e5f4bf9419f865a0b2cba729c"
"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 14 with NVM to avoid compatibility issues
nvm install 14
# Enter the Antares source folder downloaded from GitHub
cd "${srcdir}/antares-${pkgver}"
# Install JS dependencies
yarn install
}
build() {
# Enter the Antares source folder downloaded from GitHub
cd "${srcdir}/antares-${pkgver}"
# Build (WebPack) the application
yarn build
# Run Electron Builder
yarn run electron-builder --linux --"x64" --dir -c.npmRebuild=false -c.electronDist=/usr/lib/electron17 -c.electronVersion=$(</usr/lib/electron17/version)
}
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"
}
|