aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremmett1 <me@emmett1.my>2026-06-02 23:16:44 +0800
committeremmett1 <me@emmett1.my>2026-06-02 23:16:44 +0800
commit4c760bed6bafcba77bb02c336beacdb909e05b85 (patch)
tree30562c0a5a3e670569c0f5c10b99781b1435d10f
parent6e1e6d867330dd2ac4e04f0373b8be312c997e6a (diff)
downloadautils-4c760bed6bafcba77bb02c336beacdb909e05b85.tar.gz
autils-4c760bed6bafcba77bb02c336beacdb909e05b85.zip
added _muon_build, fix repo not configured and some fixes0.3
-rwxr-xr-xapkg42
1 files changed, 36 insertions, 6 deletions
diff --git a/apkg b/apkg
index a536c8e..cfe7d97 100755
--- a/apkg
+++ b/apkg
@@ -195,6 +195,30 @@ _meson_build() {
DESTDIR=$PKG meson install -C build
}
+_muon_build() {
+ muon setup \
+ -Dprefix=/usr \
+ -Dlibdir=/usr/lib \
+ -Dincludedir=/usr/include \
+ -Ddatadir=/usr/share \
+ -Dmandir=/usr/share/man \
+ -Dinfodir=/usr/share/info \
+ -Dlocaledir=/usr/share/locale \
+ -Dsysconfdir=/etc \
+ -Dlocalstatedir=/var \
+ -Dsharedstatedir=/var/lib \
+ -Dbuildtype=plain \
+ -Dauto_features=auto \
+ -Dwrap_mode=nodownload \
+ -Ddefault_library=shared \
+ -Db_lto=true \
+ -Db_pie=true \
+ $build_opt \
+ build
+ samu -C build
+ DESTDIR=$PKG muon -C build install -d "$PKG"
+}
+
apply_patch() {
[ "$skip_patch" ] && {
unset skip_patch # allowing manual patch in build() using apply_patch
@@ -371,7 +395,7 @@ build_src() {
msg "Failed packaging $packagefile"
ret 1
}
- cd - >/dev/null
+ cd $HERE
if [ ! -f "$apkg_list" ] || [ -n "$(find "$apkg_build" -newer "$apkg_list")" ]; then
pkg_updatefiles
@@ -390,6 +414,7 @@ pkg_updatefiles() {
}
pkg_path() {
+ needrepo
for p in $@; do
for r in $APKG_REPO; do
[ -f $r/$p/${apkg_build##*/} ] && {
@@ -438,6 +463,7 @@ pkg_deplist() {
}
pkg_fsearch() {
+ needrepo
for r in $APKG_REPO; do
rr="$rr $r/*/.files"
done
@@ -445,6 +471,7 @@ pkg_fsearch() {
}
pkg_dependents() {
+ needrepo
for r in $APKG_REPO; do
rr="$rr $r/*/depends"
done
@@ -517,11 +544,15 @@ pkg_sysup() {
fi
}
-pkg_search() {
- if [ ! "$APKG_REPO" ]; then
- msg "No repo configured."
+needrepo() {
+ [ "$APKG_REPO" ] || {
+ msg 'No repo configured'
exit 1
- fi
+ }
+}
+
+pkg_search() {
+ needrepo
if [ "$pkg" ]; then
for p in $pkg; do
grep="$grep -e $p"
@@ -984,7 +1015,6 @@ apkg_build="$HERE/abuild"
APKG=$0
SPM_PKGDB="${APKG_ROOT%/}/var/lib/spm/db"
-APKG_REPO="${APKG_REPO:-$PWD}"
APKG_PACKAGE_DIR="${APKG_PACKAGE_DIR:-$PWD}"
APKG_SOURCE_DIR="${APKG_SOURCE_DIR:-$PWD}"
APKG_WORK_DIR="${APKG_WORK_DIR:-$PWD}"