pkgx v1.0.0

This commit is contained in:
Claudia 2023-10-05 16:08:40 +02:00
commit a5dfaca07b
No known key found for this signature in database
GPG key ID: 7AA67DE7B73139CE
5 changed files with 102 additions and 0 deletions

16
.SRCINFO Normal file
View file

@ -0,0 +1,16 @@
pkgbase = pkgx
pkgdesc = Run Anything
pkgver = 1.0.0
pkgrel = 1
url = https://pkgx.sh
install = pkgx.install
arch = x86_64
license = Apache
makedepends = deno
depends = gcc-libs
depends = glibc
options = !strip
source = pkgx-1.0.0.tar.gz::https://github.com/pkgxdev/pkgx/archive/v1.0.0.tar.gz
sha512sums = c5846e9f79c6e1e3e73dc0568f0f98f0d37c153c0c6469596ba715dedc70812cca400a3d64ccbb4cb7c0dde448bf57c764d49fcec8d764080fde15ed6f3dc2ee
pkgname = pkgx

20
.editorconfig Normal file
View file

@ -0,0 +1,20 @@
# https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.{diff,patch}]
end_of_line = lf
trim_trailing_whitespace = false
[PKGBUILD]
indent_size = 2
[*.json]
indent_size = 2

7
.gitignore vendored Normal file
View file

@ -0,0 +1,7 @@
/.vscode/
/src
/pkg
*.log
*.pkg.*
*.tar.*
*.zip

52
PKGBUILD Normal file
View file

@ -0,0 +1,52 @@
# Maintainer: Claudia Pellegrino <aur ät cpellegrino.de>
pkgname=pkgx
pkgver=1.0.0
pkgrel=1
pkgdesc='Run Anything'
arch=('x86_64')
url='https://pkgx.sh'
license=('Apache')
depends=('gcc-libs' 'glibc')
makedepends=('deno')
options=('!strip') # stripping breaks the binary
install="${pkgname}.install"
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/pkgxdev/pkgx/archive/v${pkgver}.tar.gz"
)
sha512sums=(
'c5846e9f79c6e1e3e73dc0568f0f98f0d37c153c0c6469596ba715dedc70812cca400a3d64ccbb4cb7c0dde448bf57c764d49fcec8d764080fde15ed6f3dc2ee'
)
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
/usr/bin/deno task compile
}
check() {
cd "$(mktemp -d)"
cat > hello.js << 'EOF'
const middle="llo, w"
console.log(`he${middle}orld`);
EOF
stdout="$(
PKGX_DIR="$(pwd)/.pkgx" "${srcdir}/${pkgname}-${pkgver}/pkgx" hello.js
)"
[[ "${stdout}" == 'hello, world' ]]
}
package() {
echo >&2 'Packaging the executable'
install -D -m 755 -t "${pkgdir}/usr/bin" \
"${srcdir}/${pkgname}-${pkgver}/pkgx"
echo >&2 'Packaging the documentation'
install -D -m 644 -t "${pkgdir}/usr/share/doc/${pkgname}" \
"${srcdir}/${pkgname}-${pkgver}/README.md"
echo >&2 'Packaging the license'
install -D -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" \
"${srcdir}/${pkgname}-${pkgver}/LICENSE.txt"
}

7
pkgx.install Normal file
View file

@ -0,0 +1,7 @@
post_install() {
cat << 'EOF'
try it out:
pkgx node@18 --eval 'console.log("pkgx: run anything")'
EOF
}