mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 09:56:18 +02:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6dd7be3fd4 | ||
![]() |
0365edb264 | ||
![]() |
4ff7aa0d8a | ||
![]() |
320c1fd0ac | ||
![]() |
7b209b63a7 | ||
![]() |
d45e77738b | ||
![]() |
009c58f7c9 | ||
![]() |
112026580d | ||
![]() |
f870ab6864 | ||
![]() |
ea782a8ab7 | ||
![]() |
a510331698 | ||
![]() |
dca8f91d26 | ||
![]() |
b64d8ebacf |
4
Makefile
4
Makefile
@@ -1,4 +1,4 @@
|
|||||||
V=20221012
|
V=20230307
|
||||||
BUILDTOOLVER ?= $(V)
|
BUILDTOOLVER ?= $(V)
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
@@ -78,7 +78,7 @@ $(1)/%: $(2)%.in $(LIBUTILS)
|
|||||||
@$(RM) "$$@"
|
@$(RM) "$$@"
|
||||||
@{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@
|
@{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@
|
||||||
@chmod $(3) "$$@"
|
@chmod $(3) "$$@"
|
||||||
@bash -n "$$@"
|
@bash -O extglob -n "$$@"
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call buildInScript,build/bin,src/,555))
|
$(eval $(call buildInScript,build/bin,src/,555))
|
||||||
|
@@ -46,13 +46,13 @@ CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
|
|||||||
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
||||||
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
||||||
LTOFLAGS="-flto=auto"
|
LTOFLAGS="-flto=auto"
|
||||||
#RUSTFLAGS="-C opt-level=2"
|
RUSTFLAGS=""
|
||||||
#-- Make Flags: change this for DistCC/SMP systems
|
#-- Make Flags: change this for DistCC/SMP systems
|
||||||
#MAKEFLAGS="-j2"
|
#MAKEFLAGS="-j2"
|
||||||
#-- Debugging flags
|
#-- Debugging flags
|
||||||
DEBUG_CFLAGS="-g"
|
DEBUG_CFLAGS="-g"
|
||||||
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
|
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
|
||||||
#DEBUG_RUSTFLAGS="-C debuginfo=2"
|
DEBUG_RUSTFLAGS="-C debuginfo=2"
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# BUILD ENVIRONMENT
|
# BUILD ENVIRONMENT
|
||||||
@@ -94,7 +94,7 @@ BUILDENV=(!distcc color !ccache check !sign)
|
|||||||
#-- debug: Add debugging flags as specified in DEBUG_* variables
|
#-- debug: Add debugging flags as specified in DEBUG_* variables
|
||||||
#-- lto: Add compile flags for building with link time optimization
|
#-- lto: Add compile flags for building with link time optimization
|
||||||
#
|
#
|
||||||
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto)
|
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto)
|
||||||
|
|
||||||
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
|
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
|
||||||
INTEGRITY_CHECK=(sha256)
|
INTEGRITY_CHECK=(sha256)
|
||||||
|
@@ -46,13 +46,13 @@ CFLAGS="-march=x86-64-v3 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
|
|||||||
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
|
||||||
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
|
||||||
LTOFLAGS="-flto=auto"
|
LTOFLAGS="-flto=auto"
|
||||||
#RUSTFLAGS="-C opt-level=2"
|
RUSTFLAGS=""
|
||||||
#-- Make Flags: change this for DistCC/SMP systems
|
#-- Make Flags: change this for DistCC/SMP systems
|
||||||
#MAKEFLAGS="-j2"
|
#MAKEFLAGS="-j2"
|
||||||
#-- Debugging flags
|
#-- Debugging flags
|
||||||
DEBUG_CFLAGS="-g"
|
DEBUG_CFLAGS="-g"
|
||||||
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
|
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
|
||||||
#DEBUG_RUSTFLAGS="-C debuginfo=2"
|
DEBUG_RUSTFLAGS="-C debuginfo=2"
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
# BUILD ENVIRONMENT
|
# BUILD ENVIRONMENT
|
||||||
@@ -94,7 +94,7 @@ BUILDENV=(!distcc color !ccache check !sign)
|
|||||||
#-- debug: Add debugging flags as specified in DEBUG_* variables
|
#-- debug: Add debugging flags as specified in DEBUG_* variables
|
||||||
#-- lto: Add compile flags for building with link time optimization
|
#-- lto: Add compile flags for building with link time optimization
|
||||||
#
|
#
|
||||||
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto)
|
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto)
|
||||||
|
|
||||||
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
|
#-- File integrity checks to use. Valid: md5, sha1, sha224, sha256, sha384, sha512, b2
|
||||||
INTEGRITY_CHECK=(sha256)
|
INTEGRITY_CHECK=(sha256)
|
||||||
|
@@ -25,6 +25,7 @@ Description
|
|||||||
|
|
||||||
The symlink used to run it will be inspected by archbuild, to determine which target you want it to use. It will load the available pacman configuration from 'pacman-reponame-arch.conf' with a fallback to 'pacman-reponame.conf' from {pkgdatadir}. The makepkg configuration is loaded from 'makepkg-repo-arch.conf' with a fallback to 'makepkg-reponame.conf' from {pkgdatadir}.
|
The symlink used to run it will be inspected by archbuild, to determine which target you want it to use. It will load the available pacman configuration from 'pacman-reponame-arch.conf' with a fallback to 'pacman-reponame.conf' from {pkgdatadir}. The makepkg configuration is loaded from 'makepkg-repo-arch.conf' with a fallback to 'makepkg-reponame.conf' from {pkgdatadir}.
|
||||||
|
|
||||||
|
It will also load the bind mount configuration from 'mount.d/arch' in {pkgdatadir}. The file format is that each line starting with ro and rw will be used, other lines will be ignored, and the rest of the used line is out/path:in/path preceded by a space as a separator. ro means it is a read-only mount, rw means a read-write mount.
|
||||||
|
|
||||||
Options
|
Options
|
||||||
-------
|
-------
|
||||||
|
@@ -137,6 +137,7 @@ pkgver_equal() {
|
|||||||
# $pkgver can be supplied with or without a pkgrel appended.
|
# $pkgver can be supplied with or without a pkgrel appended.
|
||||||
# If not supplied, any pkgrel will be matched.
|
# If not supplied, any pkgrel will be matched.
|
||||||
##
|
##
|
||||||
|
shopt -s extglob
|
||||||
find_cached_package() {
|
find_cached_package() {
|
||||||
local searchdirs=("$PWD" "$PKGDEST") results=()
|
local searchdirs=("$PWD" "$PKGDEST") results=()
|
||||||
local targetname=$1 targetver=$2 targetarch=$3
|
local targetname=$1 targetver=$2 targetarch=$3
|
||||||
@@ -191,7 +192,7 @@ find_cached_package() {
|
|||||||
return 1
|
return 1
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
shopt -u extglob
|
||||||
|
|
||||||
check_package_validity(){
|
check_package_validity(){
|
||||||
local pkgfile=$1
|
local pkgfile=$1
|
||||||
|
@@ -23,6 +23,22 @@ if [[ -f "@pkgdatadir@/setarch-aliases.d/${arch}" ]]; then
|
|||||||
else
|
else
|
||||||
set_arch="${arch}"
|
set_arch="${arch}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Architecture-specific Mount
|
||||||
|
arch_mounts=()
|
||||||
|
if [[ -f "@pkgdatadir@/mount.d/${arch}" ]]; then
|
||||||
|
mapfile -t arch_mounts < "@pkgdatadir@/mount.d/${arch}"
|
||||||
|
fi
|
||||||
|
for arch_mount in "${arch_mounts[@]}"; do
|
||||||
|
if [[ $arch_mount = rw* ]]; then
|
||||||
|
arch_mount=${arch_mount#rw }
|
||||||
|
in_array "$arch_mount" "${makechrootpkg_args[@]}" || makechrootpkg_args+=("-d" "$arch_mount")
|
||||||
|
elif [[ $arch_mount = ro* ]]; then
|
||||||
|
arch_mount=${arch_mount#ro }
|
||||||
|
in_array "$arch_mount" "${makechrootpkg_args[@]}" || makechrootpkg_args+=("-D" "$arch_mount")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
chroots='/var/lib/archbuild'
|
chroots='/var/lib/archbuild'
|
||||||
clean_first=false
|
clean_first=false
|
||||||
|
|
||||||
|
@@ -132,16 +132,17 @@ if [[ -n $(svn status -q) ]]; then
|
|||||||
svn commit -q -m "${msgtemplate}: ${1}" || die
|
svn commit -q -m "${msgtemplate}: ${1}" || die
|
||||||
stat_done
|
stat_done
|
||||||
else
|
else
|
||||||
msgfile="$(mktemp)"
|
[[ -z ${WORKDIR:-} ]] && setup_workdir
|
||||||
|
msgfile=$(mktemp --tmpdir="${WORKDIR}" commitpkg.XXXXXXXXXX)
|
||||||
echo "$msgtemplate" > "$msgfile"
|
echo "$msgtemplate" > "$msgfile"
|
||||||
if [[ -n $SVN_EDITOR ]]; then
|
if [[ -n $SVN_EDITOR ]]; then
|
||||||
$SVN_EDITOR "$msgfile"
|
$SVN_EDITOR "$msgfile" || die
|
||||||
elif [[ -n $VISUAL ]]; then
|
elif [[ -n $VISUAL ]]; then
|
||||||
$VISUAL "$msgfile"
|
$VISUAL "$msgfile" || die
|
||||||
elif [[ -n $EDITOR ]]; then
|
elif [[ -n $EDITOR ]]; then
|
||||||
$EDITOR "$msgfile"
|
$EDITOR "$msgfile" || die
|
||||||
else
|
else
|
||||||
vi "$msgfile"
|
vi "$msgfile" || die
|
||||||
fi
|
fi
|
||||||
[[ -s $msgfile ]] || die
|
[[ -s $msgfile ]] || die
|
||||||
stat_busy 'Committing changes to trunk'
|
stat_busy 'Committing changes to trunk'
|
||||||
|
@@ -248,6 +248,7 @@ diff_pkgs() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shopt -s extglob
|
||||||
fetch_pkg() {
|
fetch_pkg() {
|
||||||
local pkg pkgdest pkgurl
|
local pkg pkgdest pkgurl
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -295,6 +296,7 @@ fetch_pkg() {
|
|||||||
|
|
||||||
echo "$pkgdest"
|
echo "$pkgdest"
|
||||||
}
|
}
|
||||||
|
shopt -u extglob
|
||||||
|
|
||||||
if (( $# < 2 )); then
|
if (( $# < 2 )); then
|
||||||
if [[ ! -f PKGBUILD ]]; then
|
if [[ ! -f PKGBUILD ]]; then
|
||||||
|
@@ -40,6 +40,7 @@ else
|
|||||||
pushd "$WORKDIR" >/dev/null
|
pushd "$WORKDIR" >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
shopt -s extglob
|
||||||
process_sofile() {
|
process_sofile() {
|
||||||
# extract the library name: libfoo.so
|
# extract the library name: libfoo.so
|
||||||
shopt -s extglob nullglob
|
shopt -s extglob nullglob
|
||||||
@@ -56,6 +57,7 @@ process_sofile() {
|
|||||||
soobjects+=("${soname}=${soversion}-${soarch}")
|
soobjects+=("${soname}=${soversion}-${soarch}")
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
shopt -u extglob
|
||||||
|
|
||||||
case $script_mode in
|
case $script_mode in
|
||||||
deps) find_args=(-perm -u+x);;
|
deps) find_args=(-perm -u+x);;
|
||||||
|
@@ -24,6 +24,7 @@ clean_first=0
|
|||||||
run_namcap=0
|
run_namcap=0
|
||||||
run_checkpkg=0
|
run_checkpkg=0
|
||||||
temp_chroot=0
|
temp_chroot=0
|
||||||
|
tmp_opts="nosuid,nodev,size=50%,nr_inodes=2m"
|
||||||
|
|
||||||
bindmounts_ro=()
|
bindmounts_ro=()
|
||||||
bindmounts_rw=()
|
bindmounts_rw=()
|
||||||
@@ -365,6 +366,7 @@ prepare_chroot
|
|||||||
if arch-nspawn "$copydir" \
|
if arch-nspawn "$copydir" \
|
||||||
--bind="${PWD//:/\\:}:/startdir" \
|
--bind="${PWD//:/\\:}:/startdir" \
|
||||||
--bind="${SRCDEST//:/\\:}:/srcdest" \
|
--bind="${SRCDEST//:/\\:}:/srcdest" \
|
||||||
|
--tmpfs="/tmp:${tmp_opts}" \
|
||||||
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
|
||||||
/chrootbuild "${makepkg_args[@]}"
|
/chrootbuild "${makepkg_args[@]}"
|
||||||
then
|
then
|
||||||
|
@@ -86,13 +86,14 @@ get_pkgfile() {
|
|||||||
|
|
||||||
get_makepkg_conf() {
|
get_makepkg_conf() {
|
||||||
local fname=${1}
|
local fname=${1}
|
||||||
local makepkg_conf="${2}"
|
local arch="${2}"
|
||||||
|
local makepkg_conf="${3}"
|
||||||
if ! buildtool_file=$(get_pkgfile "${fname}"); then
|
if ! buildtool_file=$(get_pkgfile "${fname}"); then
|
||||||
error "failed to retrieve ${fname}"
|
error "failed to retrieve ${fname}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
msg2 "using makepkg.conf from ${fname}"
|
msg2 "using makepkg.conf from ${fname}"
|
||||||
bsdtar xOqf "${buildtool_file/file:\/\//}" usr/share/devtools/makepkg-x86_64.conf > "${makepkg_conf}"
|
bsdtar xOqf "${buildtool_file/file:\/\//}" "usr/share/devtools/makepkg-${arch}.conf" > "${makepkg_conf}"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,17 +214,17 @@ TEMPDIR=$(mktemp -d --tmpdir makerepropkg.XXXXXXXXXX)
|
|||||||
makepkg_conf="${TEMPDIR}/makepkg.conf"
|
makepkg_conf="${TEMPDIR}/makepkg.conf"
|
||||||
# anything before buildtool support is pinned to the last none buildtool aware release
|
# anything before buildtool support is pinned to the last none buildtool aware release
|
||||||
if [[ -z "${BUILDTOOL}" ]]; then
|
if [[ -z "${BUILDTOOL}" ]]; then
|
||||||
get_makepkg_conf "devtools-20210202-3-any" "${makepkg_conf}" || exit 1
|
get_makepkg_conf "devtools-20210202-3-any" "${CARCH}" "${makepkg_conf}" || exit 1
|
||||||
# prefere to assume devtools up until matching makepkg version so repository packages remain reproducible
|
# prefere to assume devtools up until matching makepkg version so repository packages remain reproducible
|
||||||
elif [[ "${BUILDTOOL}" = makepkg ]] && (( $(vercmp "${BUILDTOOLVER}" 6.0.1) <= 0 )); then
|
elif [[ "${BUILDTOOL}" = makepkg ]] && (( $(vercmp "${BUILDTOOLVER}" 6.0.1) <= 0 )); then
|
||||||
get_makepkg_conf "devtools-20210202-3-any" "${makepkg_conf}" || exit 1
|
get_makepkg_conf "devtools-20210202-3-any" "${CARCH}" "${makepkg_conf}" || exit 1
|
||||||
# all devtools builds
|
# all devtools builds
|
||||||
elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTOOLVER}" "${makepkg_conf}"; then
|
elif [[ "${BUILDTOOL}" = devtools ]] && get_makepkg_conf "${BUILDTOOL}-${BUILDTOOLVER}" "${CARCH}" "${makepkg_conf}"; then
|
||||||
true
|
true
|
||||||
# fallback to current makepkg.conf
|
# fallback to current makepkg.conf
|
||||||
else
|
else
|
||||||
warning "Unknown buildtool (${BUILDTOOL}-${BUILDTOOLVER}), using fallback"
|
warning "Unknown buildtool (${BUILDTOOL}-${BUILDTOOLVER}), using fallback"
|
||||||
makepkg_conf=@pkgdatadir@/makepkg-x86_64.conf
|
makepkg_conf=@pkgdatadir@/makepkg-${CARCH}.conf
|
||||||
fi
|
fi
|
||||||
printf '%s\n' "${allpkgfiles[@]}" | mkarchroot -M "${makepkg_conf}" -U "${archroot_args[@]}" "${namespace}/root" - || exit 1
|
printf '%s\n' "${allpkgfiles[@]}" | mkarchroot -M "${makepkg_conf}" -U "${archroot_args[@]}" "${namespace}/root" - || exit 1
|
||||||
|
|
||||||
|
@@ -81,10 +81,10 @@ for file in "${files[@]}"; do
|
|||||||
cp "$file" "$working_dir$file"
|
cp "$file" "$working_dir$file"
|
||||||
done
|
done
|
||||||
|
|
||||||
unshare --mount pacstrap -${umode}Mcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \
|
unshare --mount pacstrap -${umode}Mc ${pac_conf:+-C "$pac_conf"} "$working_dir" \
|
||||||
"${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages'
|
"${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages'
|
||||||
|
|
||||||
printf '%s.UTF-8 UTF-8\n' C en_US de_DE > "$working_dir/etc/locale.gen"
|
printf '%s.UTF-8 UTF-8\n' en_US de_DE > "$working_dir/etc/locale.gen"
|
||||||
echo 'LANG=C.UTF-8' > "$working_dir/etc/locale.conf"
|
echo 'LANG=C.UTF-8' > "$working_dir/etc/locale.conf"
|
||||||
echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot"
|
echo "$CHROOT_VERSION" > "$working_dir/.arch-chroot"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user