diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml new file mode 100644 index 0000000..736fa95 --- /dev/null +++ b/.github/workflows/appimage.yml @@ -0,0 +1,48 @@ +name: Build Arch Package & AppImage (Git) + +on: + workflow_dispatch: + +jobs: + build: + name: Build with makepkg + runs-on: ubuntu-latest + + container: + image: archlinux:latest + + steps: + - name: Install base dependencies + run: | + pacman -Syu --noconfirm archlinux-keyring + pacman -Syu --noconfirm base-devel git sudo wget zsync + + - name: Create build user + run: | + useradd -m builder + echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Fix permissions + run: chown -R builder:builder . + + - name: Build package + run: | + sudo -u builder bash <<'EOF' + set -e + cd pkg/GIT + makepkg -si --noconfirm + cd ../AppImage/ + chmod +x AppImage.sh + ./AppImage.sh + EOF + + - name: Upload package artifact + uses: actions/upload-artifact@v4 + with: + name: arch-package + path: | + pkg/GIT/*.pkg.tar.zst + pkg/AppImage/dist/*.AppImage diff --git a/.gitignore b/.gitignore index c403c34..76df819 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,23 @@ /target .idea/ + +*.kate-swp + +pkg/AppImage/dist +pkg/AppImage/AppDir + +pkg/AppImage/quick-sharun + +pkg/GIT/.MTREE +pkg/GIT/.PKGINFO +pkg/GIT/.BUILDINFO + +pkg/GIT/src/metapac/ +pkg/GIT/src/metapac-* + + +pkg/GIT/pkg + +pkg/GIT/*.tar.gz + +pkg/GIT/*.pkg.tar.zst diff --git a/metapac.desktop b/metapac.desktop new file mode 100644 index 0000000..0760f67 --- /dev/null +++ b/metapac.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=metapac +Comment=multi-backend declarative package manager +Exec=metapac +StartupNotify=false +StartupWMClass=metapac +Terminal=false +Type=Application +Categories=Game; +Keywords=Package; diff --git a/pkg/AppImage/AppImage.sh b/pkg/AppImage/AppImage.sh new file mode 100755 index 0000000..fc59f59 --- /dev/null +++ b/pkg/AppImage/AppImage.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# You might need to restart your pc if sharun doesn't create `AppDir` in this directory (It should create dirs on its own) + +set -eu + +ARCH="$(uname -m)" +SHARUN="https://raw.githubusercontent.com/pkgforge-dev/Anylinux-AppImages/main/useful-tools/quick-sharun.sh" + +export ADD_HOOKS="self-updater.bg.hook" +#export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync" +export OUTNAME=metapac-anylinux-"$ARCH".AppImage +export DESKTOP=../../metapac.desktop +export ICON=DUMMY +export OUTPATH=./dist +export DEPLOY_OPENGL=0 +export DEPLOY_VULKAN=0 +export DEPLOY_DOTNET=0 + +#Remove leftovers +rm -rf AppDir dist appinfo + +# ADD LIBRARIES +wget --retry-connrefused --tries=30 "$SHARUN" -O ./quick-sharun +chmod +x ./quick-sharun + +# Point to binaries +./quick-sharun /usr/bin/metapac + +# Make AppImage +./quick-sharun --make-appimage + +echo "All Done!" diff --git a/pkg/GIT/PKGBUILD b/pkg/GIT/PKGBUILD new file mode 100644 index 0000000..77a0034 --- /dev/null +++ b/pkg/GIT/PKGBUILD @@ -0,0 +1,48 @@ +# Maintainer: James Forster + +pkgname=metapac +pkgver=0.9.0 +pkgrel=1 +pkgdesc="multi-backend declarative package manager" +url="https://github.com/ripytide/${pkgname}" +license=("GPL-3.0-or-later") +provides=("${pkgname}") +conflicts=("${pkgname}") +makedepends=('cargo') +arch=('i686' 'x86_64' 'armv6h' 'armv7h') +source=("${pkgname}-${pkgver}.tar.gz::https://static.crates.io/crates/${pkgname}/${pkgname}-${pkgver}.crate") +options=(!debug !lto) +sha256sums=('SKIP') + +prepare() { + cd "${pkgname}-${pkgver}" + + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" +} + +build() { + cd "${pkgname}-${pkgver}" + + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + cargo build --frozen --release --all-features + + mkdir -p completions + for shell in bash elvish fish powershell zsh nushell; do + "./target/release/${pkgname}" completions --shell "$shell" > "completions/$shell" + done +} + +package() { + cd "${pkgname}-${pkgver}" + + install -Dm0755 -t "${pkgdir}/usr/bin/" "target/release/${pkgname}" + + install -Dm644 "completions/bash" "${pkgdir}/usr/share/bash-completion/completions/${pkgname}" + install -Dm644 "completions/elvish" "${pkgdir}/usr/share/elvish/lib/${pkgname}.elv" + install -Dm644 "completions/fish" "${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish" + install -Dm644 "completions/powershell" "${pkgdir}/usr/share/powershell/Modules/${pkgname}/completions.ps1" + install -Dm644 "completions/zsh" "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}" + install -Dm644 "completions/nushell" "${pkgdir}/usr/share/nushell/vendor/autoload/${pkgname}.nu" +}