forked from artix/artools
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
bef2a0b3fa | |||
8d6f12f5a9 | |||
bf6fc3fcff | |||
11c73f1086 | |||
62e4795000 | |||
2f92ba003b | |||
c19b80adbd | |||
1812296bc3 | |||
cfb3ced261 | |||
77c7d1db8e | |||
eb9f03c5c1 | |||
16d0c1759d |
@@ -71,9 +71,14 @@ else
|
|||||||
cache_dirs=("$cache_dir")
|
cache_dirs=("$cache_dir")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pacconf_cmd=$(command -v pacman-conf || command -v pacconf)
|
||||||
|
host_mirrors=($($pacconf_cmd --repo world Server 2> /dev/null | sed -r 's#(.*/)world/os/.*#\1$repo/os/$arch#'))
|
||||||
|
|
||||||
copy_hostconf () {
|
copy_hostconf () {
|
||||||
cp -a /etc/pacman.d/gnupg "$1/etc/pacman.d"
|
cp -a /etc/pacman.d/gnupg "$1/etc/pacman.d"
|
||||||
|
|
||||||
|
printf 'Server = %s\n' "${host_mirrors[@]}" >"$working_dir/etc/pacman.d/mirrorlist"
|
||||||
|
|
||||||
[[ -n $pacman_conf ]] && cp $pacman_conf "$1/etc/pacman.conf"
|
[[ -n $pacman_conf ]] && cp $pacman_conf "$1/etc/pacman.conf"
|
||||||
|
|
||||||
[[ -n $makepkg_conf ]] && cp $makepkg_conf "$1/etc/makepkg.conf"
|
[[ -n $makepkg_conf ]] && cp $makepkg_conf "$1/etc/makepkg.conf"
|
||||||
@@ -104,6 +109,13 @@ chroot_extra_mount() {
|
|||||||
for m in ${bindmounts_rw[@]}; do
|
for m in ${bindmounts_rw[@]}; do
|
||||||
chroot_mount "${m%%:*}" "$1${m##*:}" -B
|
chroot_mount "${m%%:*}" "$1${m##*:}" -B
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for host_mirror in "${host_mirrors[@]}"; do
|
||||||
|
if [[ $host_mirror == *file://* ]]; then
|
||||||
|
host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g')
|
||||||
|
chroot_mount "$host_mirror_path" "$1$host_mirror_path" -Br
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
umask 0022
|
umask 0022
|
||||||
|
@@ -157,12 +157,12 @@ done
|
|||||||
|
|
||||||
shift $(($OPTIND - 1))
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
${pretend} && display_settings && exit 1
|
|
||||||
|
|
||||||
check_root
|
check_root
|
||||||
|
|
||||||
prepare_traps
|
prepare_traps
|
||||||
|
|
||||||
prepare_build
|
prepare_build
|
||||||
|
|
||||||
|
${pretend} && display_settings && exit 1
|
||||||
|
|
||||||
build
|
build
|
||||||
|
@@ -339,7 +339,7 @@ main() {
|
|||||||
[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
|
[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid makepkg user.'
|
||||||
makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
|
makepkg_user=${makepkg_user:-${SUDO_USER:-$USER}}
|
||||||
|
|
||||||
check_root SOURCE_DATE_EPOCH,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER,GNUPGHOME
|
check_root SOURCE_DATE_EPOCH,GNUPGHOME,SRCDEST,SRCPKGDEST,PKGDEST,LOGDEST,MAKEFLAGS,PACKAGER
|
||||||
|
|
||||||
# Canonicalize chrootdir, getting rid of trailing /
|
# Canonicalize chrootdir, getting rid of trailing /
|
||||||
chrootdir=$(readlink -e "$passeddir")
|
chrootdir=$(readlink -e "$passeddir")
|
||||||
@@ -385,9 +385,11 @@ main() {
|
|||||||
sync_chroot "$chrootdir/root" "$copydir" "$copy"
|
sync_chroot "$chrootdir/root" "$copydir" "$copy"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
bindmounts_rw+=("${PWD}:/startdir" "${SRCDEST}:/srcdest")
|
||||||
|
|
||||||
$update_first && chroot-run \
|
$update_first && chroot-run \
|
||||||
-r "${bindmounts_ro[@]}" \
|
-r "${bindmounts_ro[*]}" \
|
||||||
-w "${bindmounts_rw[@]}" \
|
-w "${bindmounts_rw[*]}" \
|
||||||
"$copydir" \
|
"$copydir" \
|
||||||
pacman -Syu --noconfirm
|
pacman -Syu --noconfirm
|
||||||
|
|
||||||
@@ -407,8 +409,6 @@ main() {
|
|||||||
|
|
||||||
prepare_chroot "$copydir" "$USER_HOME" "$keepbuilddir" "$run_namcap"
|
prepare_chroot "$copydir" "$USER_HOME" "$keepbuilddir" "$run_namcap"
|
||||||
|
|
||||||
bindmounts_rw+=("${PWD}:/startdir" "${SRCDEST}:/srcdest")
|
|
||||||
|
|
||||||
if chroot-run \
|
if chroot-run \
|
||||||
-r "${bindmounts_ro[*]}" \
|
-r "${bindmounts_ro[*]}" \
|
||||||
-w "${bindmounts_rw[*]}" \
|
-w "${bindmounts_rw[*]}" \
|
||||||
|
@@ -79,15 +79,21 @@ write_details() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
write_pkg_yaml(){
|
write_pkg_yaml(){
|
||||||
local pkgfile=$(makepkg --packagelist)
|
|
||||||
|
|
||||||
Yaml=$(write_yaml_header)
|
Yaml=$(write_yaml_header)
|
||||||
|
|
||||||
Yaml+=$(write_empty_line)
|
Yaml+=$(write_empty_line)
|
||||||
|
|
||||||
|
local full=$(get_full_version)
|
||||||
|
|
||||||
|
local ver=${full:-0}
|
||||||
|
|
||||||
|
pkgbase=${pkgbase:-${pkgname[0]}}
|
||||||
|
|
||||||
Yaml+=$(write_yaml_map 0 "pkgbase")
|
Yaml+=$(write_yaml_map 0 "pkgbase")
|
||||||
Yaml+=$(write_yaml_map 2 "pkgname" "${pkgbase:-${pkgname[0]}}")
|
Yaml+=$(write_yaml_map 2 "pkgname" "${pkgbase}")
|
||||||
${details} && write_details ''
|
${details} && write_details ''
|
||||||
|
Yaml+=$(write_yaml_map 2 "fullver" "${ver}")
|
||||||
|
|
||||||
Yaml+=$(write_empty_line)
|
Yaml+=$(write_empty_line)
|
||||||
|
|
||||||
@@ -99,6 +105,8 @@ write_pkg_yaml(){
|
|||||||
|
|
||||||
Yaml+=$(write_empty_line)
|
Yaml+=$(write_empty_line)
|
||||||
|
|
||||||
|
local pkgfile=$(print_all_package_names)
|
||||||
|
|
||||||
Yaml+=$(write_yaml_map 0 "pkgfile")
|
Yaml+=$(write_yaml_map 0 "pkgfile")
|
||||||
for f in ${pkgfile[@]};do
|
for f in ${pkgfile[@]};do
|
||||||
Yaml+=$(write_yaml_seq 2 "${f##*/}")
|
Yaml+=$(write_yaml_seq 2 "${f##*/}")
|
||||||
@@ -136,4 +144,6 @@ PACKAGE="$1"/PKGBUILD; shift
|
|||||||
|
|
||||||
. "$PACKAGE"
|
. "$PACKAGE"
|
||||||
|
|
||||||
|
. /etc/makepkg.conf
|
||||||
|
|
||||||
write_pkg_yaml
|
write_pkg_yaml
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
#!/hint/bash
|
#!/hint/bash
|
||||||
|
# shellcheck disable=2034
|
||||||
|
|
||||||
#
|
#
|
||||||
# /etc/makepkg.conf
|
# /etc/makepkg.conf
|
||||||
#
|
#
|
||||||
@@ -37,8 +39,8 @@ CHOST="x86_64-pc-linux-gnu"
|
|||||||
|
|
||||||
#-- Compiler and Linker Flags
|
#-- Compiler and Linker Flags
|
||||||
CPPFLAGS="-D_FORTIFY_SOURCE=2"
|
CPPFLAGS="-D_FORTIFY_SOURCE=2"
|
||||||
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
|
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
|
||||||
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
|
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt"
|
||||||
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
||||||
#-- Make Flags: change this for DistCC/SMP systems
|
#-- Make Flags: change this for DistCC/SMP systems
|
||||||
#MAKEFLAGS="-j2"
|
#MAKEFLAGS="-j2"
|
||||||
@@ -143,3 +145,5 @@ COMPRESSZ=(compress -c -f)
|
|||||||
#
|
#
|
||||||
PKGEXT='.pkg.tar.xz'
|
PKGEXT='.pkg.tar.xz'
|
||||||
SRCEXT='.src.tar.gz'
|
SRCEXT='.src.tar.gz'
|
||||||
|
|
||||||
|
# vim: set ft=sh ts=2 sw=2 et:
|
||||||
|
@@ -63,7 +63,7 @@ load_profile(){
|
|||||||
|
|
||||||
PASSWORD=${PASSWORD:-'artix'}
|
PASSWORD=${PASSWORD:-'artix'}
|
||||||
|
|
||||||
ADDGROUPS=${ADDGROUPS:-"video,power,cdrom,network,lp,scanner,wheel,users,log"}
|
ADDGROUPS=${ADDGROUPS:-"video,power,optical,network,lp,scanner,wheel,users,log"}
|
||||||
|
|
||||||
if [[ -z ${SERVICES[@]} ]];then
|
if [[ -z ${SERVICES[@]} ]];then
|
||||||
SERVICES=('acpid' 'bluetooth' 'cronie' 'cupsd' 'syslog-ng' 'NetworkManager')
|
SERVICES=('acpid' 'bluetooth' 'cronie' 'cupsd' 'syslog-ng' 'NetworkManager')
|
||||||
|
@@ -98,14 +98,14 @@ get_cases(){
|
|||||||
|
|
||||||
local cases=
|
local cases=
|
||||||
for p in ${pkgs[@]};do
|
for p in ${pkgs[@]};do
|
||||||
cases=${p:+}${p:-|}${p}
|
cases=${cases:-}${cases:+|}${p}
|
||||||
done
|
done
|
||||||
echo $cases
|
echo $cases
|
||||||
}
|
}
|
||||||
|
|
||||||
get_artix_tree(){
|
get_artix_tree(){
|
||||||
local pkg="$1" artix_tree="${2:-$3}" tree
|
local pkg="$1" artix_tree="${2:-$3}" tree
|
||||||
case $pkg in
|
eval "case $pkg in
|
||||||
$(get_cases kernel)) tree=packages-kernel ;;
|
$(get_cases kernel)) tree=packages-kernel ;;
|
||||||
python-*|python2-*) tree=packages-python ;;
|
python-*|python2-*) tree=packages-python ;;
|
||||||
perl-*) tree=packages-perl ;;
|
perl-*) tree=packages-perl ;;
|
||||||
@@ -115,18 +115,20 @@ get_artix_tree(){
|
|||||||
*-runit) tree=packages-runit ;;
|
*-runit) tree=packages-runit ;;
|
||||||
qt5-*) tree=packages-qt5 ;;
|
qt5-*) tree=packages-qt5 ;;
|
||||||
lxqt*|$(get_cases lxqt)) tree=packages-lxqt ;;
|
lxqt*|$(get_cases lxqt)) tree=packages-lxqt ;;
|
||||||
|
*) tree=$artix_tree
|
||||||
|
esac"
|
||||||
|
echo $tree
|
||||||
|
|
||||||
# $(get_cases freedesktop)) tree=packages-desktop ;;
|
# $(get_cases freedesktop)) tree=packages-desktop ;;
|
||||||
# $(get_cases kde)) tree=packages-kde ;;
|
# $(get_cases kde)) tree=packages-kde ;;
|
||||||
# $(get_cases gnome)) tree=packages-gnome ;;
|
# $(get_cases gnome)) tree=packages-gnome ;;
|
||||||
*) tree=$artix_tree
|
|
||||||
esac
|
|
||||||
echo $tree
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get_import_path(){
|
get_import_path(){
|
||||||
local pkg="$1" import_path=
|
local pkg="$1" import_path=
|
||||||
for tree in ${TREE_NAMES_ARCH[@]};do
|
for tree in ${TREE_NAMES_ARCH[@]};do
|
||||||
[[ -d ${TREE_DIR_ARCH}/$tree/$pkg ]] && import_path=${TREE_DIR_ARCH}/$tree/$pkg
|
[[ -d ${TREE_DIR_ARCH}/$tree/$pkg/repos ]] && import_path=${TREE_DIR_ARCH}/$tree/$pkg
|
||||||
done
|
done
|
||||||
echo $import_path
|
echo $import_path
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user