Skip to content

Commit

Permalink
add xhost (sharun.wrappe)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azathothas committed Feb 13, 2025
1 parent 5bf948b commit 64db070
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions packages/xhost/archive.wrappe.alpine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/SBUILD ver @v1.0.0
#SELF: https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/packages/xhost/archive.wrappe.alpine.yaml
_disabled: false

pkg: "xhost"
pkg_id: "sharun.wrappe.alpine.xhost"
pkg_type: "archive"
category:
- "Utility"
description: "Utility to control X server access"
distro_pkg:
alpine:
- "xhost"
archlinux:
extra:
- "xorg-xhost"
gnuguix:
- "xhost"
nixpkgs:
- "xorg.xhost"
homepage:
- "https://gitlab.freedesktop.org/xorg/app/xhost"
license:
- id: "custom"
url: "https://gitlab.freedesktop.org/xorg/app/xhost/-/raw/master/COPYING?ref_type=heads"
maintainer:
- "Azathothas (https://github.com/Azathothas)"
note:
- "[DO NOT RUN] (Meant for pkgforge CI Only)"
- "Built Using Sharun [alpine]. Check/Report @ https://github.com/VHSgunzo/sharun"
- "Learn more @ https://docs.pkgforge.dev/formats/packages/archive"
- "[PORTABLE] (Works on AnyLinux)"
- "[NO_DESKTOP_INTEGRATION] (Does not need desktop integration)"
provides:
- "xhost"
repology:
- "xhost"
src_url:
- "https://gitlab.freedesktop.org/xorg/app/xhost"
tag:
- "x11"
x_exec:
host:
- "aarch64-Linux"
- "x86_64-Linux"
shell: "bash"
pkgver: |
curl -qfsSL "https://gitlab.alpinelinux.org/alpine/aports/-/raw/master/community/xhost/APKBUILD" | sed -n 's/^pkgver=//p' | tr -d '"'\''[:space:]'
run: |
#Build
mkdir -pv "${SBUILD_TMPDIR}/tmp" && docker run --privileged --net="host" --name "alpine-builder-mimalloc" --pull="always" \
-e "PKG=${PKG}" -e "PKG_ID=${PKG_ID}" -e "PKG_TYPE=${PKG_TYPE}" -e "PKG_VER=${PKG_VER}" \
-e "PKGVER=${PKGVER}" -e "SBUILD_PKG=${SBUILD_PKG}" -e "SBUILD_PKGVER=${SBUILD_PKGVER}" \
--volume "${SBUILD_TMPDIR}/tmp:/tmp:rw" \
"alpine:edge" \
sh -c '
#Setup ENV
set -x ; chown -R "$(whoami):$(whoami)" "/tmp" 2>/dev/null ; chmod -v '1777' '/tmp'
mkdir -p "/build-bins" && cd "$(mktemp -d)" &>/dev/null
apk update && apk upgrade --no-interactive 2>/dev/null
apk cache clean --purge
#CoreUtils
apk add 7zip bash binutils coreutils croc curl findutils file g++ git grep jq libc-dev linux-headers moreutils patchelf rsync sed strace tar tree xz zstd --latest --upgrade --no-interactive 2>/dev/null
#Sharun
curl -qfsSL "https://api.gh.pkgforge.dev/repos/VHSgunzo/sharun/releases?per_page=100" | jq -r ".. | objects | .browser_download_url? // empty" | grep -Ei "$(uname -m)" | grep -Eiv "tar\.gz|\.b3sum" | grep -Ei "sharun" | sort --version-sort | tail -n 1 | tr -d "[:space:]" | xargs -I "{}" curl -qfsSL "{}" -o "/usr/local/bin/sharun"
chmod -v "a+x" "/usr/local/bin/sharun"
command -v sharun &>/dev/null || echo -e "\[X] FATAL: sharun is NOT Installed\n$(exit 1)"
#Build
apk add "${PKG}" --latest --upgrade --no-interactive
apk info -L "${PKG}"
sharun lib4bin --gen-lib-path --strace-time "60" --with-hooks --with-wrappe --wrappe-clvl "22" --wrappe-exec "${PKG}" --dst-dir "./${PKG}" "$(realpath $(which "${PKG}"))"
#Copy
find "./${PKG}" -maxdepth 1 -type f -exec file -i "{}" \; | grep -Ei "application/.*executable|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath | xargs -I "{}" cp -fv "{}" "/build-bins/"
apk info -L "${PKG}" | grep -i "usr/share/metainfo/" | grep -im1 "appdata\.xml" | tr -d "[:space:]" | head -n 1 | xargs -I "{}" cp -fv "/{}" "/build-bins/${PKG}.appdata.xml"
apk info -L "${PKG}" | grep -i "usr/share/applications/" | grep -im1 "desktop" | tr -d "[:space:]" | head -n 1 | xargs -I "{}" cp -fv "/{}" "/build-bins/${PKG}.desktop"
apk info -L "${PKG}" | grep -i "usr/share/metainfo/" | grep -im1 "metainfo\.xml" | tr -d "[:space:]" | head -n 1 | xargs -I "{}" cp -fv "/{}" "/build-bins/${PKG}.metainfo.xml"
apk info -L "${PKG}" | grep -i "usr/share/icons/hicolor" | grep -i "png" | sort -V | tail -n 1 | tr -d "[:space:]" | xargs -I "{}" cp -fv "/{}" "/build-bins/${PKG}.png"
apk info -L "${PKG}" | grep -i "usr/share/icons/hicolor" | grep -i "svg" | sort -V | tail -n 1 | tr -d "[:space:]" | xargs -I "{}" cp -fv "/{}" "/build-bins/${PKG}.svg"
#Info
file "/build-bins/"* && du -sh "/build-bins/"*
'
#Copy & Meta
docker cp "alpine-builder-mimalloc:/build-bins/." "${SBUILD_TMPDIR}/"
[ -s "${SBUILD_TMPDIR}/LICENSE" ] && cp -fv "${SBUILD_TMPDIR}/LICENSE" "${SBUILD_OUTDIR}/LICENSE"
find "${SBUILD_TMPDIR}" -maxdepth 1 -type f -exec file -i "{}" \; | grep -Ei 'application/.*executable|text/x-perl|text/.*script' | cut -d":" -f1 | xargs realpath | xargs -I "{}" rsync -achvL "{}" "${SBUILD_OUTDIR}"

0 comments on commit 64db070

Please sign in to comment.