Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions metapac.desktop
Original file line number Diff line number Diff line change
@@ -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;
33 changes: 33 additions & 0 deletions pkg/AppImage/AppImage.sh
Original file line number Diff line number Diff line change
@@ -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!"
48 changes: 48 additions & 0 deletions pkg/GIT/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Maintainer: James Forster <james.forsterer@gmail.com>

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"
}