From a5dfaca07be78f6fc0aee25544a05d2f113ace7a Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 5 Oct 2023 16:08:40 +0200 Subject: [PATCH] pkgx v1.0.0 --- .SRCINFO | 16 ++++++++++++++++ .editorconfig | 20 ++++++++++++++++++++ .gitignore | 7 +++++++ PKGBUILD | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ pkgx.install | 7 +++++++ 5 files changed, 102 insertions(+) create mode 100644 .SRCINFO create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 PKGBUILD create mode 100644 pkgx.install diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6731f6f18084 --- /dev/null +++ b/.SRCINFO @@ -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 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000000..29215c86a3df --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..37dd117487ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/.vscode/ +/src +/pkg +*.log +*.pkg.* +*.tar.* +*.zip diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..eed8db126110 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Claudia Pellegrino + +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" +} diff --git a/pkgx.install b/pkgx.install new file mode 100644 index 000000000000..572b45b01da2 --- /dev/null +++ b/pkgx.install @@ -0,0 +1,7 @@ +post_install() { + cat << 'EOF' + try it out: + + pkgx node@18 --eval 'console.log("pkgx: run anything")' +EOF +}