Skip to content

Commit

Permalink
Sync with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
KF-Art committed Jun 21, 2024
1 parent 0b12c07 commit df8c977
Show file tree
Hide file tree
Showing 27 changed files with 914 additions and 597 deletions.
2 changes: 1 addition & 1 deletion common/build-helper/meson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ cat > "${XBPS_WRAPPERDIR}/meson/xbps_meson.cross" <<-EOF
strip = '${STRIP}'
readelf = '${READELF}'
objcopy = '${OBJCOPY}'
pkgconfig = '${PKG_CONFIG}'
pkg-config = '${PKG_CONFIG}'
rust = ['rustc', '--target', '${RUST_TARGET}' ,'--sysroot', '${XBPS_CROSS_BASE}/usr']
g-ir-scanner = '${XBPS_CROSS_BASE}/usr/bin/g-ir-scanner'
g-ir-compiler = '${XBPS_CROSS_BASE}/usr/bin/g-ir-compiler'
Expand Down
3 changes: 3 additions & 0 deletions common/build-helper/rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,6 @@ export LIBSQLITE3_SYS_USE_PKG_CONFIG=1

# jemalloc-sys
export JEMALLOC_SYS_WITH_LG_PAGE=16

# libgit2-sys
export LIBGIT2_NO_VENDOR=1
2 changes: 1 addition & 1 deletion common/build-style/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ do_build() {
fi
else
# Otherwise, build using GOPATH
go get -p "$XBPS_MAKEJOBS" -v -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
go install -p "$XBPS_MAKEJOBS" -v -tags "${go_build_tags}" -ldflags "${go_ldflags}" ${go_package}
fi
}

Expand Down
39 changes: 23 additions & 16 deletions common/build-style/qmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
do_configure() {
local qmake
local qmake_args
local qt
if [ -x "/usr/lib/qt5/bin/qmake" ]; then
qmake="/usr/lib/qt5/bin/qmake"
local qt=${QT:-}
local builddir="${wrksrc}/${build_wrksrc}"
cd ${builddir}
if [ "${QT}" ]; then
qt=${QT}
if [ ! -x "/usr/lib/${qt}/bin/qmake" ]; then
msg_error "${QT} is requested, but not found\n"
fi
elif [ -x "/usr/lib/qt5/bin/qmake" ]; then
qt="qt5"
elif [ -x "/usr/lib/qt6/bin/qmake" ]; then
qmake="/usr/lib/qt6/bin/qmake"
qt="qt6"
fi
if [ -z "${qmake}" ]; then
else
msg_error "${pkgver}: Could not find qmake - missing in hostmakedepends?\n"
fi
qmake="/usr/lib/${qt}/bin/qmake"
if [ "$CROSS_BUILD" ]; then
case $XBPS_TARGET_MACHINE in
i686*) _qt_arch=i386;;
Expand All @@ -25,8 +30,8 @@ do_configure() {
ppc64*) _qt_arch=power64;;
ppc*) _qt_arch=power;;
esac
mkdir -p "${wrksrc}/.target-spec/linux-g++"
cat > "${wrksrc}/.target-spec/linux-g++/qmake.conf" <<_EOF
mkdir -p "${builddir}/.target-spec/linux-g++"
cat > "${builddir}/.target-spec/linux-g++/qmake.conf" <<_EOF
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental no_qt_rpath
QMAKE_INCREMENTAL_STYLE = sublib
Expand Down Expand Up @@ -54,10 +59,10 @@ QMAKE_CXXFLAGS = ${CXXFLAGS}
QMAKE_LFLAGS = ${LDFLAGS}
load(qt_config)
_EOF
echo "#include \"${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/linux-g++/qplatformdefs.h\"" > "${wrksrc}/.target-spec/linux-g++/qplatformdefs.h"
echo "#include \"${XBPS_CROSS_BASE}/usr/lib/${qt}/mkspecs/linux-g++/qplatformdefs.h\"" > "${builddir}/.target-spec/linux-g++/qplatformdefs.h"

mkdir -p "${wrksrc}/.host-spec/linux-g++"
cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<_EOF
mkdir -p "${builddir}/.host-spec/linux-g++"
cat > "${builddir}/.host-spec/linux-g++/qmake.conf" <<_EOF
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental no_qt_rpath
QMAKE_INCREMENTAL_STYLE = sublib
Expand All @@ -84,8 +89,8 @@ QMAKE_CXXFLAGS = ${CXXFLAGS_host}
QMAKE_LFLAGS = ${LDFLAGS_host}
load(qt_config)
_EOF
echo '#include "/usr/lib/${qt}/mkspecs/linux-g++/qplatformdefs.h"' > "${wrksrc}/.host-spec/linux-g++/qplatformdefs.h"
cat > "${wrksrc}/qt.conf" <<_EOF
echo '#include "/usr/lib/${qt}/mkspecs/linux-g++/qplatformdefs.h"' > "${builddir}/.host-spec/linux-g++/qplatformdefs.h"
cat > "${builddir}/qt.conf" <<_EOF
[Paths]
Sysroot=${XBPS_CROSS_BASE}
Prefix=/usr
Expand All @@ -108,10 +113,10 @@ HostData=/usr/lib/${qt}
HostBinaries=/usr/lib/${qt}/bin
HostLibraries=/usr/lib
HostLibraryExecutables=/usr/lib/${qt}/libexec
Spec=${wrksrc}/.host-spec/linux-g++
TargetSpec=${wrksrc}/.target-spec/linux-g++
Spec=${builddir}/.host-spec/linux-g++
TargetSpec=${builddir}/.target-spec/linux-g++
_EOF
qmake_args="-qtconf ${wrksrc}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/${PKG_CONFIG}"
qmake_args="-qtconf ${builddir}/qt.conf PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/${PKG_CONFIG}"
${qmake} ${qmake_args} \
PREFIX=/usr \
QT_INSTALL_PREFIX=/usr \
Expand All @@ -134,13 +139,15 @@ _EOF
}

do_build() {
cd "${wrksrc}/${build_wrksrc}"
: ${make_cmd:=make}

${make_cmd} ${makejobs} ${make_build_args} ${make_build_target} \
CC="$CC" CXX="$CXX" LINK="$CXX"
}

do_install() {
cd "${wrksrc}/${build_wrksrc}"
: ${make_cmd:=make}
: ${make_install_target:=install}

Expand Down
11 changes: 4 additions & 7 deletions common/build-style/texmf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ do_build() {
# Extract the source files
mkdir -p "build/usr/share/texmf-dist"
find . -maxdepth 1 -print -name "*.tar.xz" \
-exec bsdtar -C "build/usr/share/texmf-dist" -xf {} \;
-exec bsdtar \
-s '|^texmf-dist/||' \
-C "build/usr/share/texmf-dist" \
-xf {} \;
cd "build/usr/share/texmf-dist/"
# Everything in usr/share/texmf-dist/texmf-dist should really be in
# usr/share/texmf-dist, so we move it
if [ -d "texmf-dist" ] ; then
rsync -ar texmf-dist/ ./
rm -rf texmf-dist/
fi
# LICENSEs are unneeded
rm -f LICENSE*

Expand Down
21 changes: 18 additions & 3 deletions common/chroot-style/uchroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,27 @@ readonly EXTRA_ARGS="$4"
readonly CMD="$5"
shift 5

if ! command -v xbps-uchroot >/dev/null 2>&1; then
msg_red() {
# error messages in bold/red
[ -n "$NOCOLORS" ] || printf >&2 "\033[1m\033[31m"
printf "=> ERROR: %s\\n" "$@" >&2
[ -n "$NOCOLORS" ] || printf >&2 "\033[m"
}

readonly XBPS_UCHROOT_CMD="$(command -v xbps-uchroot 2>/dev/null)"

if [ -z "$XBPS_UCHROOT_CMD" ]; then
msg_red "could not find xbps-uchroot"
exit 1
fi

if ! [ -x "$XBPS_UCHROOT_CMD" ]; then
msg_red "xbps-uchroot is not executable. Are you in the $(stat -c %G "$XBPS_UCHROOT_CMD") group?"
exit 1
fi

if [ -z "$MASTERDIR" -o -z "$DISTDIR" ]; then
echo "$0 MASTERDIR/DISTDIR not set"
if [ -z "$MASTERDIR" ] || [ -z "$DISTDIR" ]; then
msg_red "$0: MASTERDIR/DISTDIR not set"
exit 1
fi

Expand Down
2 changes: 2 additions & 0 deletions common/container/noextract.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
noextract=/etc/sv*
noextract=/usr/share/man*
noextract=/usr/lib/dracut*
noextract=/etc/hosts
noextract=/etc/mtab
noextract=/etc/skel*
noextract=/usr/lib/modprobe.d*
noextract=/usr/lib/sysctl.d*
Expand Down
2 changes: 0 additions & 2 deletions common/environment/build-style/texmf.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
# rsync isn't needed for everything but it's far easier to just put it here
hostmakedepends+=" rsync"
# python_version isn't needed for everything either
python_version=3
21 changes: 13 additions & 8 deletions common/environment/build-style/texmf/ownership.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,19 @@ scripts/attachfile2/pdfatfi.pl texlive
scripts/authorindex/authorindex texlive
scripts/bib2gls/bib2gls.sh texlive
scripts/bib2gls/convertgls2bib.sh texlive
scripts/bibcop/bibcop.pl texlive
scripts/bibexport/bibexport.sh texlive
scripts/bundledoc/arlatex texlive
scripts/bundledoc/bundledoc texlive
scripts/cachepic/cachepic.tlu texlive-pictures
scripts/checkcites/checkcites.lua texlive
scripts/checklistings/checklistings.sh texlive
scripts/chklref/chklref.pl texlive
scripts/citation-style-language/citeproc-lua.lua texlive
scripts/cjk-gs-integrate/cjk-gs-integrate.pl texlive
scripts/clojure-pamphlet/pamphletangler texlive
scripts/cluttex/cluttex.lua texlive
scripts/context/perl/mptopdf.pl texlive
scripts/context/stubs/unix/contextjit texlive
scripts/context/stubs/unix/context texlive
scripts/context/stubs/unix/luatools texlive
scripts/context/stubs/unix/mtxrunjit texlive
scripts/context/stubs/unix/mtxrun texlive
scripts/context/stubs/unix/texexec texlive
scripts/context/stubs/unix/texmfstart texlive
scripts/convbkmk/convbkmk.rb texlive-langjapanese
scripts/crossrefware/bbl2bib.pl texlive
scripts/crossrefware/bibdoiadd.pl texlive
Expand All @@ -57,6 +52,7 @@ scripts/ctan-o-mat/ctan-o-mat.pl texlive
scripts/ctanupload/ctanupload.pl texlive
scripts/de-macro/de-macro texlive
scripts/diadia/diadia.lua texlive-humanities
scripts/digestif/digestif.texlua texlive
scripts/dosepsbin/dosepsbin.pl texlive
scripts/dtxgen/dtxgen texlive
scripts/dviasm/dviasm.py texlive
Expand Down Expand Up @@ -102,6 +98,7 @@ scripts/listbib/listbib texlive
scripts/listings-ext/listings-ext.sh texlive
scripts/ltxfileinfo/ltxfileinfo texlive
scripts/ltximg/ltximg.pl texlive
scripts/luafindfont/luafindfont.lua texlive
scripts/luaotfload/luaotfload-tool.lua texlive
scripts/lwarp/lwarpmk.lua texlive
scripts/make4ht/make4ht texlive
Expand All @@ -116,6 +113,9 @@ scripts/m-tx/m-tx.lua texlive-music
scripts/multibibliography/multibibliography.pl texlive
scripts/musixtex/musixflx.lua texlive-music
scripts/musixtex/musixtex.lua texlive-music
scripts/optexcount/optexcount texlive
scripts/pagelayout/pagelayoutapi texlive
scripts/pagelayout/textestvis texlive
scripts/pax/pdfannotextractor.pl texlive
scripts/pdfbook2/pdfbook2 texlive
scripts/pdfcrop/pdfcrop.pl texlive
Expand Down Expand Up @@ -155,6 +155,7 @@ scripts/srcredact/srcredact.pl texlive
scripts/sty2dtx/sty2dtx.pl texlive
scripts/svn-multi/svn-multi.pl texlive
scripts/tex4ebook/tex4ebook texlive
scripts/texaccents/texaccents.sno texlive
scripts/texcount/texcount.pl texlive
scripts/texdef/texdef.pl texlive
scripts/texdiff/texdiff texlive
Expand All @@ -178,20 +179,24 @@ scripts/texlive-extra/texconfig-dialog.sh texlive
scripts/texlive-extra/texconfig.sh texlive
scripts/texlive-extra/texconfig-sys.sh texlive
scripts/texlive-extra/texlinks.sh texlive
scripts/texlive-extra/xelatex-unsafe.sh texlive
scripts/texlive-extra/xetex-unsafe.sh texlive
scripts/texlive/fmtutil.pl texlive
scripts/texlive/fmtutil-sys.sh texlive
scripts/texlive/fmtutil-user.sh texlive
scripts/texlive/mktexlsr texlive
scripts/texlive/mktexmf texlive
scripts/texlive/mktexpk texlive
scripts/texlive/mktextfm texlive
scripts/texlive/rungs.lua texlive
scripts/texliveonfly/texliveonfly.py texlive
scripts/texlive/rungs.tlu texlive
scripts/texlive/tlmgr.pl texlive
scripts/texlive/updmap.pl texlive
scripts/texlive/updmap-sys.sh texlive
scripts/texlive/updmap-user.sh texlive
scripts/texloganalyser/texloganalyser texlive
scripts/texlogfilter/texlogfilter texlive
scripts/texlogsieve/texlogsieve texlive
scripts/texosquery/texosquery-jre5.sh texlive
scripts/texosquery/texosquery-jre8.sh texlive
scripts/texosquery/texosquery.sh texlive
Expand Down
2 changes: 1 addition & 1 deletion common/environment/configure/hardening.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ -z "$nopie" ]; then
fi
else
CFLAGS="-fno-PIE ${CFLAGS}"
CXXFLAGS="-fno-PIE ${CFLAGS}"
CXXFLAGS="-fno-PIE ${CXXFLAGS}"
FFLAGS="-fno-PIE ${FFLAGS}"
LDFLAGS="-no-pie ${LDFLAGS}"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ _EOF
fi
fi

if [ -n "$python_version" ]; then
if [ -n "$python_version" ] && [ "$python_version" != ignore ]; then
pycompile_version=${python_version}
fi

Expand Down
1 change: 0 additions & 1 deletion common/hooks/pre-configure/02-script-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,5 @@ hook() {
generic_wrapper3 giblib-config
python_wrapper python-config 2.7
python_wrapper python3-config 3.12
apr_apu_wrapper apr-1-config
apr_apu_wrapper apu-1-config
}
4 changes: 4 additions & 0 deletions common/hooks/pre-pkg/03-rewrite-python-shebang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ hook() {
pyver="$python_version"
fi

if [ "$python_version" = ignore ]; then
return
fi

if [ -n "$pyver" ]; then
default_shebang="#!/usr/bin/python${pyver%.*}"
fi
Expand Down
11 changes: 8 additions & 3 deletions common/hooks/pre-pkg/04-generate-runtime-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ store_pkgdestdir_rundeps() {
-z "$($XBPS_UHELPER_CMD getpkgname ${_curdep} 2>/dev/null)" ]; then
_curdep="${_curdep}>=0"
fi
printf -- "${_curdep}\n"
done | sort | xargs > ${PKGDESTDIR}/rdeps
printf "%s " "${_curdep}"
done > "${PKGDESTDIR}/rdeps"
fi
}

Expand Down Expand Up @@ -98,7 +98,12 @@ hook() {
for f in ${verify_deps}; do
unset _rdep _pkgname _rdepver

if [ "$(find ${PKGDESTDIR} -name "$f")" ]; then
local _findargs="-name"
# if SONAME is a path, find should use -wholename
if [[ "$f" = */* ]]; then
_findargs="-wholename"
fi
if [ "$(find "${PKGDESTDIR}" $_findargs "$f")" ]; then
# Ignore libs by current pkg
echo " SONAME: $f <-> $pkgname (ignored)"
continue
Expand Down
18 changes: 16 additions & 2 deletions common/hooks/pre-pkg/99-pkglint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,22 @@ hook() {

# Check for l10n files in usr/lib/locale
if [ -d ${PKGDESTDIR}/usr/lib/locale ]; then
msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
error=1
local locale_allow=0 ldir
local lroot="${PKGDESTDIR}/usr/lib/locale"

if [ "${pkgname}" = "glibc" ]; then
# glibc gets an exception for its included C.utf8 locale
locale_allow=1
for ldir in "${lroot}"/*; do
[ "${ldir}" = "${lroot}/C.utf8" ] && continue
locale_allow=0
done
fi

if [ "${locale_allow}" -ne 1 ]; then
msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
error=1
fi
fi

# Check for bash completions in etc/bash_completion.d
Expand Down
7 changes: 7 additions & 0 deletions common/scripts/xbps-cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,20 @@ def find_cycles(depmap, xbpsdir):
help='Directory used to cache build dependencies (must exist)')
parser.add_argument('-d', '--directory',
default=None, help='Path to void-packages repo')
parser.add_argument('-Q', dest='check_pkgs', action='store_const',
const='yes', help='Use build dependencies for check -Q')
parser.add_argument('-K', dest='check_pkgs', action='store_const',
const='full', help='Use build dependencies for check -K')

args = parser.parse_args()

if not args.directory:
try: args.directory = os.environ['XBPS_DISTDIR']
except KeyError: args.directory = '.'

if args.check_pkgs:
os.environ['XBPS_CHECK_PKGS'] = args.check_pkgs

pool = multiprocessing.Pool(processes = args.jobs)

pattern = os.path.join(args.directory, 'srcpkgs', '*')
Expand Down
Loading

0 comments on commit df8c977

Please sign in to comment.