chromium-extension-locals-git
LOW
maintainer gaougalos
0 votes
scanned 2026-11-02 18:02:51.835640
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: gaou-piou <i.am.piou@gmail.com>
2
3
pkgname=chromium-extension-locals-git
4
_pkgname=locals
5
pkgver=r0.0000000
6
pkgrel=2
7
pkgdesc='Chromium (MV3) extension that serves popular JS libraries, styles and fonts from a local copy instead of CDNs; learns from usage. Loaded unpacked'
8
arch=('any')
9
url='https://github.com/gaou-piou/locals'
10
# MPL-2.0 for the extension; the bundled libraries are MIT, and the font packages
11
# carry CC-BY-4.0 / OFL-1.1 (the licence text of each ships in libs/<name>/<version>/LICENSE).
12
license=('MPL-2.0' 'MIT' 'CC-BY-4.0' 'OFL-1.1')
13
depends=('nodejs')
14
makedepends=('git' 'nodejs>=24' 'pnpm')
15
provides=("chromium-extension-$_pkgname")
16
conflicts=("chromium-extension-$_pkgname")
17
install=locals.install
18
# The libraries are downloaded from the npm registry while building and checked against the sha256
19
# recorded in libraries.json; build() therefore needs network access.
20
source=("$_pkgname::git+$url.git")
21
sha256sums=('SKIP')
22
23
pkgver() {
24
cd "$_pkgname"
25
printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
26
}
27
28
_buildenv() {
29
export HOME="$srcdir/.home"
30
export XDG_CACHE_HOME="$srcdir/.cache"
31
export npm_config_cache="$srcdir/.cache/npm"
32
export CI=1
33
}
34
35
prepare() {
36
cd "$_pkgname"
37
_buildenv
38
pnpm install --frozen-lockfile
39
}
40
41
build() {
42
cd "$_pkgname"
43
_buildenv
44
pnpm build:libs
45
pnpm build
46
pnpm size
47
}
48
49
check() {
50
cd "$_pkgname"
51
_buildenv
52
pnpm test
53
}
54
55
package() {
56
cd "$_pkgname"
57
install -d "$pkgdir/usr/share/$pkgname"
58
cp -r dist/. "$pkgdir/usr/share/$pkgname/"
59
# Chromium writes _metadata/ into every unpacked extension it loads
60
rm -rf "$pkgdir/usr/share/$pkgname/_metadata"
61
find "$pkgdir/usr/share/$pkgname" -type d -exec chmod 755 {} +
62
find "$pkgdir/usr/share/$pkgname" -type f -exec chmod 644 {} +
63
install -Dm755 packaging/aur/locals-install "$pkgdir/usr/bin/locals-install"
64
install -Dm755 packaging/aur/locals-learn.cjs "$pkgdir/usr/bin/locals-learn"
65
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
66
# licence texts of the bundled libraries, one file per library version
67
local lic
68
for lic in dist/libs/*/*/LICENSE; do
69
install -Dm644 "$lic" "$pkgdir/usr/share/licenses/$pkgname/libs/$(basename "$(dirname "$(dirname "$lic")")")-$(basename "$(dirname "$lic")")-LICENSE"
70
done
71
}
72
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-11-02 18:02:51 | Low | 1 |