Files
makronix/tools/ext-sync.sh
T
lotherkandClaude Opus 5.5 0c702d7fc9 Makronix's Motif: x11/mcde-motif from MCDE's motif/, wm/mcde links it
make userland stopped in the build VM (build/logs/x-userland-2026-11-13a.log:
"Makefile.am: error: required file './AUTHORS' not found", in motif/): since
081fb4c4b (2026-11-11) MCDE configures motif/ as a subpackage by default, and
pkgsrc's autoreconf -fiv of wm/mcde reached it; the last VM build (dd7c19207)
was before.  Against pkgsrc's unchanged x11/motif MCDE does not build at all
since 92e52775b (_XmMenuBarSetExported is ours).

Konrad, 2026-11-13: MCDE builds its own Motif only where it is not Makronix;
on Makronix the system's Motif comes from motif/ (configure.ac:622-626 says
so; the package did not exist).  Now:
- ext/src/mcde/pkgsrc-motif: x11/mcde-motif-2.3.8, built from the MCDE
  archive with WRKSRC motif/; pkgsrc's x11/motif recipe and PLIST otherwise
  (its 28 patches are folded in, d07ef09e1, checked with patch -R
  --dry-run: 28 of 28); CONFLICTS motif, lesstif, openmotif.
- wm/mcde: --without-private-motif and x11/mcde-motif's buildlink3.mk
  instead of mk/motif.buildlink3.mk.
- motif/Makefile.am: AUTOMAKE_OPTIONS foreign (autoreconf -fi of motif/
  exit 0 afterwards, on a copy of HEAD's motif/).
- tools: ext-sync takes ext/src/<name>/pkgsrc-<part> as
  <category>/<name>-<part>; mcde-dist writes the distinfo for both recipes
  and leaves pkgsrc-* out of the archive; the VM builds x11/mcde-motif before
  wm/mcde with the same GCC 14 settings, and a conflicting x11/motif needed
  by the old wm/mcde is removed with -f (wm/mcde is rebuilt after it);
  mk-cde.conf sets MOTIFBASE so other Motif packages take ours.
- packages.list and packages.vm.list name x11/mcde-motif.

Checked on the host with pkgsrc's bmake: x11/mcde-motif PKGNAME
mcde-motif-2.3.8, WRKSRC ${WRKDIR}/${DISTNAME}/motif; wm/mcde show-depends
"mcde-motif>=2.3.8:../../x11/mcde-motif", CONFIGURE_ARGS
--without-private-motif.  Not yet built in the VM: make userland next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 07:06:33 +00:00

48 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
#
# ext-sync.sh -- put the recipes of ext/ into the pkgsrc tree
#
# usage: tools/ext-sync.sh [PKGSRCDIR]
#
# A fork under ext/src/<name>/ (ext/AGENTS.md) keeps its pkgsrc recipe in
# ext/src/<name>/pkgsrc/. pkgsrc builds a recipe only from inside its tree
# (the recipe includes ../../mk/bsd.pkg.mk), so this copies it to
# PKGSRCDIR/<category>/<name>, the category being the first word of the
# recipe's CATEGORIES -- the way an owned copy is kept in this tree.
# PKGSRCDIR defaults to pkgsrc/ of this tree; tools/userland.sh gives the build
# VM's copy.
#
# A copy, not a link: the source set (msrc) and the VM need real files. The
# target is only ever replaced when upstream pkgsrc does not own that path
# (`git ls-files' of the pkgsrc import is empty for it): an upstream package
# of the same name is never overwritten.
set -eu
TOP=$(cd "$(dirname "$0")/.." && pwd)
PKGSRCDIR=${1:-$TOP/pkgsrc}
# ext/src/<name>/pkgsrc is <category>/<name>; a second package from the same
# tree, ext/src/<name>/pkgsrc-<part>, is <category>/<name>-<part> (MCDE's
# Motif: ext/src/mcde/pkgsrc-motif, x11/mcde-motif)
for recipe in "$TOP"/ext/src/*/pkgsrc "$TOP"/ext/src/*/pkgsrc-*; do
[ -f "$recipe/Makefile" ] || continue
name=$(basename "$(dirname "$recipe")")
case ${recipe##*/} in
pkgsrc-*) name=$name-${recipe##*/pkgsrc-} ;;
esac
cat=$(sed -n 's/^CATEGORIES=[[:space:]]*\([^[:space:]]*\).*/\1/p' \
"$recipe/Makefile")
[ -n "$cat" ] || { echo "ext-sync: no CATEGORIES in $recipe/Makefile" >&2; exit 1; }
dst=$PKGSRCDIR/$cat/$name
if [ -d "$PKGSRCDIR/.git" ] &&
[ -n "$(git -C "$PKGSRCDIR" ls-files -- "$cat/$name" | head -1)" ]; then
echo "ext-sync: $cat/$name belongs to upstream pkgsrc, not replaced" >&2
exit 1
fi
rm -rf "$dst"
mkdir -p "$dst"
(cd "$recipe" && tar -cf - .) | (cd "$dst" && tar -xf -)
echo "ext-sync: $cat/$name"
done