forked from Geoxor/Amethyst
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate_aur_manifest.ts
78 lines (67 loc) · 2.17 KB
/
generate_aur_manifest.ts
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
import fs from "fs";
import {version, description, license, author, name} from "../package.json";
import chalk from "chalk";
try {
fs.statSync("./manifests/aur/");
} catch (error) {
fs.mkdirSync("./manifests/aur/", {recursive: true});
}
fs.writeFileSync("./manifests/aur/.SRCINFO", `
pkgbase = amethyst-player
pkgdesc = ${description}
pkgver = ${version}
pkgrel = 1
url = https://github.com/Geoxor/amethyst
arch = x86_64
license = ${license}
makedepends = gcc-multilib
makedepends = git
makedepends = gendesk
makedepends = yarn
makedepends = libxcrypt-compat
source = git+https://github.com/Geoxor/amethyst/#tag=v${version}
md5sums = SKIP
pkgname = amethyst-player
`);
console.log(chalk.bgCyan("[AUR Manifest]"), chalk.cyan("Generated .SRCINFO"));
fs.writeFileSync("./manifests/aur/PKGBUILD", `
# Maintainer: ${author}
appname=${name}
pkgname=$appname-player
pkgver=${version}
pkgrel=1
pkgdesc="${description}"
arch=('x86_64')
url="https://github.com/Geoxor/$appname"
license=('MIT')
makedepends=('gcc-multilib' 'git' 'gendesk' 'yarn' 'libxcrypt-compat')
source=("git+https://github.com/Geoxor/$appname/#tag=v$pkgver")
md5sums=('SKIP')
logo() {
echo " ___ __ __ __ "
echo " / | ____ ___ ___ / /_/ /_ __ _______/ /_"
echo " / /| | / __ \\\`__ \\\\/ _ \\\\/ __/ __ \\\\/ / / / ___/ __/"
echo " / ___ |/ / / / / / __/ /_/ / / / /_/ (__ ) /_ "
echo "/_/ |_/_/ /_/ /_/\\\\___/\\\\__/_/ /_/\\\\__, /____/\\\\__/ "
echo " /____/"
}
prepare(){
logo
cd "$appname"
gendesk -n -f --pkgname "$appname" --pkgdesc "$pkgdesc" --exec="/opt/$appname/$appname"
git submodule update --init --recursive
yarn
}
build() {
cd "$appname"
yarn build && yarn electron-builder --linux dir --publish never
}
package() {
cd "$appname"
install -Dm644 "$appname.desktop" "$pkgdir/usr/share/applications/$appname.desktop"
install -d "$pkgdir/opt/$appname" && cp -r release/build/linux-unpacked/* "$pkgdir/opt/$appname"
install -Dm644 assets/icon.svg "$pkgdir/usr/share/pixmaps/$appname.svg"
install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$appname"
}
`);
console.log(chalk.bgCyan("[AUR Manifest]"), chalk.cyan("Generated .PKGBUILD"));