New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support or documentation for non-AUR packages #860
Comments
You don't need to git pull manually, because there's
One specific aim of the modular nature of |
Ah, I thought So it looks like my workflow for modified official packages would be
I guess only steps 2, 4, and 5 are the same between this and the AUR workflow, since |
Well About 3, the official repositories has a limited API to check for package updates: https://wiki.archlinux.org/title/Official_repositories_web_interface About 4, if PKGBUILDs are strictly from the official repositories, they have a trusted nature and it's not strictly needed to review them. Of course |
Yeah, I agree that I could simplify the procedure for official repositories. I donʼt see myself using non-AUR non-official PKGBUILDs Iʼm not completely writing myself, so Iʼd probably skip some of these steps. |
Did you come up with an example script? My plan is to add one to the |
I've come up with a sample script (see below the horizontal line). I would like input on some points:
The general workflow is similar to #860 (comment). #!/bin/bash
set -e
argv0=sync-arch
XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
ASPROOT=${ASPROOT:-$XDG_CACHE_HOME/asp}
ARCH_VIEW_DB=${ARCH_VIEW_DB:-$XDG_DATA_HOME/aurutils/view_arch}
# Scratch space for intermediary results.
tmp=$(mktemp -d --tmpdir "aurutils-$UID/$argv0.XXXXXXXX")
trap 'rm -rf "$tmp"' EXIT
# The source directory is assumed to have the following layout:
# .
# ├── paraview
# | ├── .git
# │ ├── repos
# │ │ └── community-x86_64
# │ │ ├── ...
# │ │ └── PKGBUILD
# │ └── trunk
# │ ├── ...
# │ └── PKGBUILD
# └── ...
cd "$1"
# Retrieve new upstream revisions (FETCH_HEAD) and display them with
# aur-view(1). Checkouts have to be updated individually.
mapfile -t targets < <(asp list-local) # get all tracked packages
asp update # update ASPROOT/cache
aur fetch "${targets[@]}" --existing --results "$tmp"/fetch_results # update */{trunk,repos}
# If the changes are approved (exit 0), write FETCH_HEAD to a file in
# ARCH_VIEW_DB. Note that build files are shown at their previous
# revisions; they are merged in the next step.
mkdir -p "$ARCH_VIEW_DB"
env AUR_VIEW_DB="$ARCH_VIEW_DB" -C \
aur view "${repo_targets[@]}" --revision FETCH_HEAD
targets_new=()
while IFS=: read -r mode rev_old rev path; do
path=${path#file://} name=${path##*/}
# A package is considered a target if HEAD differs from FETCH_HEAD.
if [[ $mode == "fetch" ]] && [[ $rev != "$rev_old" ]]; then
targets_new+=("$name")
fi
done <"$tmp"/fetch_results
# Rebase custom changes. Assumes custom changes are done as commits to the
# master branch.
# XXX: 1. check if this sets FETCH_HEAD == HEAD
# 2. do this in a custom branch (or keep a different branch for upstream)
for t in "${targets_new[@]}"; do
env -C "$t" git rebase --verbose
done
# Build packages in dependency order. `printsrcinfo` is a small helper
# script which uses `libmakepkg` to write .SRCINFO. This skips any
# linting checks done by makepkg to increase performance.
printf './%s/trunk\0' "${targets_new[@]}" \
| xargs -0 -I{} env -C {} printsrcinfo \
| aur graph | tsort | tac | awk '{print $0 "/trunk"}' >"$tmp"/queue
# XXX: the modified package has the same version string as the
# original one, which may cause issues if the original package is
# cached. Workaround: use setconf to bump "subpkgrel"
for t in "${targets_new[@]}"; do
( cd "$t"; pkgrel=$(pacini PKGBUILD "$pkgrel")
setconf PKGBUILD pkgrel=$pkgrel~custom
)
done
# Build in a chroot so that the modified package can be updated in a
# single transaction.
aur build -a "$tmp"/queue --chroot The used #!/bin/bash
set -e
source /usr/share/makepkg/srcinfo.sh
source_safe PKGBUILD
write_srcinfo |
Iʼll look at this later today; Iʼve been a bit busy recently but it should be calming down soon. |
The script above had some typos - those should be fixed now. |
Could someone perhaps let me know how to use the script above? As in if I have a git url, how to I use the above to build a package to my package repo? I'm guessing I first need to build and install the package manually since it uses Thanks! |
@SahAssar FYI the script above was meant specifically for modified packages from the official repos. Also, the script will need updating since If I get some time I might write my own script, since I do keep some PKGBUILDs that aren't uploaded to the AUR. |
[Suggested label: question and/or enhancement]
This is a great tool for building Arch packages and putting them in a repository for Pacman. Despite the name, this is useful for more than just the AUR; is there a way to use most of this same infrastructure for non-AUR packages? As far as I can tell, there is not, but primarily because
aur-depends
is called unconditionally byaur-sync
and I have to drop down toaur-build
, and do things likegit pull
ing the packages manually.As a specific example, both for concreteness and to forestall the “just submit it to the AUR” objection:
I like the Terminus font, which is available as a package in
community/terminus-font
. However, it supports a number of variant character appearances, and I like a few of the options more than the defaults. I could do what several other people have done and upload a custom configuration to the AUR, but nobody else would use it and it would be harder to make sure I stayed in sync with upstream, and wouldnʼt actually make things any easier.So unless I end up switching to Gentoo where the equivalent package has USE flags for this kind of thing, Iʼm better off installing packages that donʼt come from the AUR. But Iʼd still like to use as much of this as still applies, which is a lot.
Before filing a bug, check the following:
is the issue reproducible from the master branch? Yes
Other questions deleted as not relevant
__If yes to all, create a debug log:__with
N/A
The text was updated successfully, but these errors were encountered: