blob: 6c522fa152e802050ac2fc6359b77adae0cdc142 (
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
|
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=encryptednotepad2-git
_pkgname="Encrypted Notepad 2"
pkgver=r56.99e8197
pkgrel=1
pkgdesc="A Notepad-like simple text editor where files are saved (and later loaded) encrypted with AES-256."
arch=('any')
url="https://github.com/ivoras/EncryptedNotepad2"
license=('GPL-3.0-only')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}=${pkgver%.r*}")
depends=(
'libxi'
'libx11'
'libxcursor'
'libxxf86vm'
'libxinerama'
'libglvnd'
'libxrandr'
)
makedepends=(
'git'
'go>=1.22'
'gendesk'
'gcc'
'cmake'
)
source=(
"${pkgname//-/.}::git+${url}.git"
)
sha256sums=('SKIP')
pkgver() {
cd "${srcdir}/${pkgname//-/.}"
#git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g'
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
build() {
gendesk -q -f -n --categories="Utility" --name="${_pkgname}" --exec="${pkgname%-git} %U"
cd "${srcdir}/${pkgname//-/.}"
export CGO_ENABLED=1
export GO111MODULE=on
export GOOS=linux
export GOCACHE="${srcdir}/.go-build"
export GOMODCACHE="${srcdir}/.go/pkg/mod"
if [ `curl -s ipinfo.io/country | grep CN | wc -l ` -ge 1 ];then
export GOPROXY=https://goproxy.cn
echo '[url "https://github.moeyy.xyz/https://github.com/"]' >> .gitconfig
echo ' insteadof = https://github.com/' >> .gitconfig
else
echo "Your network is OK."
fi
go build -o "${pkgname%-git}"
}
package() {
install -Dm755 "${srcdir}/${pkgname//-/.}/${pkgname%-git}" -t "${pkgdir}/usr/bin"
install -Dm644 "${srcdir}/${pkgname//-/.}/Icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"
install -Dm644 "${srcdir}/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
install -Dm644 "${srcdir}/${pkgname//-/.}/LICENSE"* -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
|