blob: e13eed7821299ff665137e82cc634df4e925a80a (
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
|
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=forgetools-bin
_pkgname=ForgeTools
pkgver=1.2.1
pkgrel=1
pkgdesc="Offline developer utilities in one desktop app. Format, decode, convert and generate without anything you paste leaving your machine."
arch=('x86_64')
url="https://github.com/tengfone/forgetools"
license=('MIT')
provides=("${pkgname%-bin}=${pkgver}")
conflicts=("${pkgname%-bin}")
depends=(
'gtk3'
'gdk-pixbuf2'
'webkit2gtk-4.1'
'libayatana-indicator'
'libappindicator'
)
source=(
"${pkgname%-bin}-${pkgver}-x86_64.deb::${url}/releases/download/v${pkgver}/${_pkgname}-${pkgver}-amd64.deb"
"LICENSE-${pkgver}::https://raw.githubusercontent.com/tengfone/forgetools/v${pkgver}/LICENSE"
)
sha256sums=('9058c43f6d419739cea46746f82fc049e888812adb9447bda75fd33d358ab733'
'0dc10cba97dc9bc07084efac452895efbdd0b469dc4a384e9c10fedc1691617b')
_install_icons() {
local _src="${1:-${srcdir}}" _name="${pkgname%-bin}" _icon _ext _size _dest
while IFS= read -r -d '' _icon; do
_ext="${_icon##*.}"
_size=$(echo "${_icon%/*}" | grep -oE '[0-9]+x[0-9]+|scalable' | head -1)
[[ -z "${_size}" ]] && _size=$([[ "${_ext}" == svg ]] && echo scalable || od -An -tu1 -j16 -N8 "${_icon}" 2>/dev/null | awk '{printf "%dx%d",$1*16777216+$2*65536+$3*256+$4,$5*16777216+$6*65536+$7*256+$8}')
[[ "${_size}" =~ ^[0-9]+x[0-9]+$ ]] || _size=scalable
_dest=$([[ "${_icon}" == */share/pixmaps/* ]] && echo pixmaps || echo "icons/hicolor/${_size}/apps")
install -Dm644 "${_icon}" "${pkgdir}/usr/share/${_dest}/${_name}.${_ext}"
done < <(find "${_src}" \( -path '*/share/icons/*' -o -path '*/share/pixmaps/*' -o -path '*entries/icons/*' \) -type f \( -name '*.png' -o -name '*.svg' \) -print0 2>/dev/null)
}
prepare() {
bsdtar -xf "${srcdir}/data."*
}
package() {
install -Dm755 "${srcdir}/usr/bin/${pkgname%-bin}" -t "${pkgdir}/usr/bin"
[ -d "${srcdir}/usr/lib" ] && cp -a "${srcdir}/usr/lib" "${pkgdir}/usr/"
_install_icons
install -Dm644 "${srcdir}/usr/share/applications/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname%-bin}.desktop"
install -Dm644 "${srcdir}/LICENSE-${pkgver}" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|