Two more stops from build/logs/userland-2026-11-14h.log: - devel/flex linked stage1flex without libintl: its gnulib decides gettext is needed in a cross build but adds no library, 'undefined reference to gettext' (log:393-398). The target's base has no libintl, and flex's messages do not need translating: PKG_OPTIONS.flex= -nls, which its own option turns into --disable-nls (verified with show-var: CONFIGURE_ARGS carries it). - wm/mcde stopped linking ttdbck on libXm.la: libtool had recorded a sysroot-relative '=<workdir>/.buildlink/lib/libpng16.la' in dependency_libs, so the consumer looked for <sysroot>/<workdir>/... (log:5370ff). pkgsrc rewrites dependency_libs (mk/buildlink3/bsd.buildlink3.mk:859ff) but not a path starting with '='. The Motif recipe's post-install gives the installed .la files the target's path.
213 lines
8.8 KiB
Makefile
213 lines
8.8 KiB
Makefile
# $NetBSD$
|
|
|
|
# Makronix's Motif: Motif 2.3.8 as MCDE carries it (ext/src/mcde/motif,
|
|
# with the 28 patches of pkgsrc x11/motif folded in and MCDE's own fixes:
|
|
# the Command key in text fields, menu bars shown in the top bar, Xft
|
|
# renditions), built from the MCDE archive that tools/mcde-dist.sh makes.
|
|
# The rest of this recipe is pkgsrc's x11/motif. On Makronix it is the
|
|
# system's Motif (Konrad, 2026-11-13: MCDE builds its own Motif only where
|
|
# it is not Makronix); mk.conf's MOTIFBASE lets every other package take it.
|
|
DISTNAME= mcde-0.1.0
|
|
PKGNAME= mcde-motif-2.3.8
|
|
CATEGORIES= x11
|
|
MASTER_SITES= # none yet: tools/mcde-dist.sh puts the archive into DISTDIR
|
|
WRKSRC= ${WRKDIR}/${DISTNAME}/motif
|
|
|
|
MAINTAINER= konrad.lother@gmail.com
|
|
HOMEPAGE= https://motif.ics.com/
|
|
COMMENT= LGPLed Motif toolkit, as the Makronix desktop carries it
|
|
LICENSE= gnu-lgpl-v2.1
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
# the same files as x11/motif
|
|
CONFLICTS+= motif-[0-9]* lesstif-[0-9]* openmotif-[0-9]*
|
|
|
|
USE_LIBTOOL= yes
|
|
USE_TOOLS+= flex gmake tbl pkg-config yacc
|
|
GNU_CONFIGURE= yes
|
|
|
|
CFLAGS.SunOS+= -Dsun
|
|
|
|
SUBST_CLASSES+= man_rename
|
|
SUBST_STAGE.man_rename= pre-configure
|
|
SUBST_MESSAGE.man_rename= Fixing hardcoded paths.
|
|
SUBST_FILES.man_rename= doc/man/man3/Makefile.in
|
|
SUBST_SED.man_rename= -e 's: Core.3: XCore.3:g'
|
|
SUBST_SED.man_rename+= -e 's: Object.3: XObject.3:g'
|
|
SUBST_SED.man_rename+= -e 's: Shell.3: XShell.3:g'
|
|
|
|
CONFIGURE_ARGS+= --enable-jpeg
|
|
CONFIGURE_ARGS+= --enable-png
|
|
CONFIGURE_ARGS+= --with-libjpeg-includes=${JPEGBASE}/include
|
|
CONFIGURE_ARGS+= --with-libjpeg-lib=${JPEGBASE}/lib
|
|
CONFIGURE_ARGS+= --with-libpng-includes=${BUILDLINK_PREFIX.png}/include
|
|
CONFIGURE_ARGS+= --with-libpng-lib=${BUILDLINK_PREFIX.png}/lib
|
|
CONFIGURE_ARGS+= --x-libraries=${X11BASE}/lib
|
|
|
|
CONFIGURE_ARGS+= --disable-printing
|
|
|
|
BUILDLINK_TRANSFORM+= l:Xft:Xft:fontconfig
|
|
|
|
# Don't compress manual pages as they include each other.
|
|
.undef MANZ
|
|
|
|
CONFIGURE_ENV.NetBSD+= ac_cv_func_setpgrp_void=no
|
|
CONFIGURE_ARGS+= --enable-xft
|
|
CFLAGS.SunOS+= -D_POSIX_PTHREAD_SEMANTICS
|
|
|
|
# The parser and scanner of tools/wml are checked in, generated from
|
|
# wmlparse.y. A git archive gives every file the commit's timestamp, so make
|
|
# sees the generated wmlparse.c as up to date and compiles the old copy even
|
|
# when the grammar changed -- the 13.11. prototype fixes in wmlparse.y were
|
|
# simply ignored ("error: passing argument 2 ... [-Wint-conversion]" with line
|
|
# numbers of the old grammar, build/logs/userland-2026-11-13y.log:3660ff).
|
|
# They are regenerated here (USE_TOOLS has yacc).
|
|
post-extract:
|
|
${RUN}${RM} -f ${WRKSRC}/tools/wml/wmlparse.c ${WRKSRC}/tools/wml/wmlparse.h
|
|
|
|
MAKE_FLAGS+= CC_FOR_BUILD=${NATIVE_CC:Q:U${CC:Q}}
|
|
# The build tools (config/util/makestrs, tools/wml) are compiled by the build
|
|
# HOST's compiler, whose default dialect has moved to C23, where "()" means
|
|
# "no arguments": the fork's 1990s sources then stop with "too many arguments
|
|
# to function" (build/logs/userland-2026-11-13v.log:3646,3990). They are
|
|
# C89/C99 code, so they get gnu17; the target code is unaffected (the tree's
|
|
# cross gcc defaults to C17, measured: __STDC_VERSION__ 201710L).
|
|
# :Q is required -- without it make reads -std=gnu17 as an option of its own
|
|
# ("invalid option -- '='", userland-2026-11-13x.log:396).
|
|
CFLAGS_FOR_BUILD= -O2 -std=gnu17
|
|
MAKE_FLAGS+= CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:Q}
|
|
# wmluiltok is a host tool that links -lfl (wmluiltok_LDADD in tools/wml/Makefile).
|
|
# In a cross build -L${LOCALBASE}/lib is rewritten to the buildlink directory, so
|
|
# -lfl resolves to the TARGET's flex library; the host linker then stops on
|
|
# NetBSD's libc.so.12 ("errno@@GLIBC_PRIVATE ... TLS definition ... mismatches",
|
|
# build/logs/userland-2026-11-14a.log:3678ff). The bootstrap prefix has a host
|
|
# libfl.a; naming the file leaves no search path to pick the target's from.
|
|
.if ${USE_CROSS_COMPILE:U:tl} == "yes"
|
|
MAKE_FLAGS+= wmluiltok_LDADD=${MAKRONIX_TOP:Q}/build/pkg/lib/libfl.a
|
|
.endif
|
|
MAKE_FLAGS+= AR_FOR_BUILD=${NATIVE_AR:Q:U${AR:Q}}
|
|
MAKE_FLAGS+= RANLIB_FOR_BUILD=${NATIVE_RANLIB:Q:U${RANLIB:Q}}
|
|
MAKE_FLAGS+= CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD:Q}
|
|
MAKE_FLAGS+= LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD:Q}
|
|
# wmldbcreate (a host tool) references XtStrings/XtShellStrings from libXt, and
|
|
# the tools link it through LIBS_FOR_BUILD. In a cross build -lXt finds the
|
|
# TARGET's libXt, whose libSM then drags in NetBSD's libc.so.12 and the host
|
|
# linker stops (build/logs/userland-2026-11-14b.log:3698ff). libXt is a
|
|
# TOOL_DEPENDS, so tools/userland.sh builds it for this host into build/pkg;
|
|
# the static archives there are named directly, which no search path can
|
|
# redirect to the target's.
|
|
.if ${USE_CROSS_COMPILE:U:tl} == "yes"
|
|
LIBS_FOR_BUILD= ${MAKRONIX_TOP:Q}/build/pkg/lib/libXt.a \
|
|
${MAKRONIX_TOP:Q}/build/pkg/lib/libX11.a \
|
|
${MAKRONIX_TOP:Q}/build/pkg/lib/libSM.a \
|
|
${MAKRONIX_TOP:Q}/build/pkg/lib/libICE.a
|
|
.else
|
|
LIBS_FOR_BUILD= -lXt
|
|
.endif
|
|
MAKE_FLAGS+= LIBS_FOR_BUILD=${LIBS_FOR_BUILD:Q}
|
|
|
|
# wml.c has
|
|
#
|
|
# #ifdef HAVE_CONFIG_H
|
|
# #include <config.h>
|
|
# #endif
|
|
# ...
|
|
# #ifdef HAVE_FCNTL_H
|
|
# #include <fcntl.h>
|
|
# #else
|
|
# #include <sys/file.h>
|
|
# #endif
|
|
#
|
|
# Using config.h doesn't make sense for cross-builds because it
|
|
# describes the target system, not the native system. But <fcntl.h> is
|
|
# in POSIX and has been for a very long time. If there are any systems
|
|
# that _don't_ have it and really need <sys/file.h>, and still run
|
|
# pkgsrc, we can make this conditional or find another way to do it.
|
|
#
|
|
CPPFLAGS_FOR_BUILD+= -DHAVE_FCNTL_H
|
|
|
|
.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
|
|
CPPFLAGS_FOR_BUILD+= ${BUILDLINK_CPPFLAGS}
|
|
LDFLAGS_FOR_BUILD+= ${BUILDLINK_LDFLAGS}
|
|
.else
|
|
MAKE_FLAGS+= CROSS_COMPILING=yes
|
|
# XXX should support independent cross PREFIX
|
|
CPPFLAGS_FOR_BUILD+= -I${PREFIX:Q}/include
|
|
LDFLAGS_FOR_BUILD+= -L${PREFIX:Q}/lib
|
|
LDFLAGS_FOR_BUILD+= ${COMPILER_RPATH_FLAG:Q}${PREFIX:Q}/lib
|
|
CONFIGURE_ARGS.NetBSD+= ac_cv_file__usr_X_include_X11_X_h=no
|
|
CONFIGURE_ARGS.NetBSD+= ac_cv_file__usr_X11R6_include_X11_X_h=no
|
|
# Motif's build involves building and running tools, wml*, that are
|
|
# linked against libXt. Thus we need libXt as a tool dependency, not
|
|
# as a build or run dependency. In a cross build the tools are built and
|
|
# run on the build HOST, so the host's libXt is needed whether or not
|
|
# x11-links is native (measured 2026-11-13: with X11_TYPE=native the tools
|
|
# linked the target's libXt; build/logs/userland-2026-11-14b.log:3698ff).
|
|
TOOL_DEPENDS+= libXt>=0:../../x11/libXt
|
|
.endif
|
|
|
|
# 1) Fix the man pages to refer to the correct sections.
|
|
# 2) Change references to {Core,Object,Shell}.3 to X{Core,Object,Shell}.3 to
|
|
# avoid manpage conflicts with other packages.
|
|
#
|
|
post-patch:
|
|
set -e; \
|
|
cd ${WRKSRC}/doc/man; \
|
|
for manpage in man1/*.1 man3/*.3 man4/*.4 man5/*.5; do \
|
|
${SED} -e "s|user cmd|1|g" \
|
|
-e "s|library call|3|g" \
|
|
-e "s|special file|5|g" \
|
|
-e "s|file formats|5|g" \
|
|
$${manpage} > $${manpage}.fixed; \
|
|
${MV} -f $${manpage}.fixed $${manpage}; \
|
|
done; \
|
|
set -e; \
|
|
cd ${WRKSRC}/doc/man/man3; \
|
|
for name in Core Object Shell; do \
|
|
${MV} -f $${name}.3 X$${name}.3; \
|
|
files=`${GREP} -l ".fB$${name}.fP(3)" *.3`; \
|
|
for manpage in $${files}; do \
|
|
${MV} -f $${manpage} $${manpage}.presubst; \
|
|
${SED} "s|\\(.fB\\)$${name}\\(.fP(3)\\)|\\1X$${name}\\2|g" \
|
|
$${manpage}.presubst > $${manpage}; \
|
|
${RM} -f $${manpage}.presubst; \
|
|
done; \
|
|
done
|
|
${ECHO} "#include <X11/Xos_r.h>" > ${WRKSRC}/lib/Xm/Xmos_r.h
|
|
|
|
# Filter the manpages through tbl.
|
|
post-build:
|
|
set -e; \
|
|
cd ${WRKSRC}/doc/man; \
|
|
for manpage in man1/*.1 man3/*.3 man4/*.4 man5/*.5; do \
|
|
${TBL} $${manpage} > $${manpage}.tblized; \
|
|
${MV} -f $${manpage}.tblized $${manpage}; \
|
|
done
|
|
|
|
# libtool writes the .la files of libXm with a sysroot-relative path for a
|
|
# library it found through the buildlink directory:
|
|
# dependency_libs='... =<workdir>/.buildlink/lib/libpng16.la ...'
|
|
# A consumer then looks for <sysroot>/<workdir>/... and stops ("libtool: cannot
|
|
# find the library '.../destdir.amd64/home/.../libpng16.la'", build/logs/
|
|
# userland-2026-11-14h.log:5370ff -- wm/mcde's ttdbck). pkgsrc rewrites
|
|
# dependency_libs in mk/buildlink3/bsd.buildlink3.mk:859ff, but its patterns do
|
|
# not match a path that begins with '='. The installed files get the target's
|
|
# path instead, as a natively built package would have.
|
|
post-install:
|
|
${RUN}${FIND} ${DESTDIR}${PREFIX}/lib -name '*.la' -type f | \
|
|
while read f; do \
|
|
${SED} -i -e 's|=${WRKDIR}/.buildlink/lib/|${PREFIX}/lib/|g' $$f; \
|
|
done
|
|
|
|
.include "../../converters/libiconv/buildlink3.mk"
|
|
.include "../../mk/jpeg.buildlink3.mk"
|
|
.include "../../graphics/png/buildlink3.mk"
|
|
.include "../../x11/libX11/buildlink3.mk"
|
|
.include "../../x11/libXaw/buildlink3.mk"
|
|
.include "../../x11/libXmu/buildlink3.mk"
|
|
.include "../../x11/libXext/buildlink3.mk"
|
|
.include "../../x11/libXft/buildlink3.mk"
|
|
.include "../../x11/xbitmaps/buildlink3.mk"
|
|
.include "../../mk/bsd.pkg.mk"
|