[COPY] --- T2-COPYRIGHT-BEGIN --- [COPY] t2/package/*/plan9port/plan9port.desc [COPY] Copyright (C) 2021 - 2025 The T2 SDE Project [COPY] SPDX-License-Identifier: GPL-2.0 [COPY] --- T2-COPYRIGHT-END --- [I] Port of many Plan 9 libraries and programs to Unix [T] Plan 9 from User Space provides many of the ideas, applications, and [T] services from Plan 9 on Unix-like systems. [U] https://9fans.github.io/plan9port [A] Plan 9 Foundation [A] Russ Cox [A] Google Inc. [M] Tomas Glozar [C] extra/emulator [F] CROSS [L] MIT [S] Stable [V] be7c68f [D] 6c86ef716bb7036cfa7ab6c60c03aca1bc9363de170e5103e515716c plan9port-be7c68f.tar.gz !https://codeload.github.com/9fans/plan9port/tar.gz/be7c68f if atstage cross; then export HOSTPLAN9=$base/build/$SDECFG_ID/TOOLCHAIN/$toolsdir/plan9port fi configure() { var_append CPPFLAGS ' ' -I$root$includedir/freetype2 var_append CPPFLAGS ' ' -Wno-sizeof-array-div var_append CPPFLAGS ' ' -Wno-array-parameter var_append LDFLAGS ' ' "-L$root/$SDECFG_PKG_X11_PREFIX/${libdir##*/}" var_append CC9FLAGS ' ' $CFLAGS var_append CC9FLAGS ' ' $CPPFLAGS var_append CC9FLAGS ' ' $LDFLAGS echo "CC9FLAGS='$CC9FLAGS'" >> LOCAL.config echo "CC9='$CC'" >> LOCAL.config echo "LDFLAGS='$LDFLAGS'" >> LOCAL.config if atstage cross; then # Use cross tools yacc, lex and rc # Note: replacing with just yacc (lex, rc) won't work, since it would conflict with system binaries cp src/mkhdr src/mkhdr.orig sed -i "s%9 yacc%$HOSTPLAN9/bin/yacc%g" src/mkhdr src/cmd/upas/smtp/mkfile sed -i "s%9 lex%$HOSTPLAN9/bin/lex%g" src/mkhdr src/cmd/mkfile src/cmd/tpic/mkfile sed -i "s%9 rc%PLAN9=$HOSTPLAN9 $HOSTPLAN9/bin/rc%g" man/mkfile dist/mkfile dist/publish fi } build() { if atstage toolchain; then # Toolchain stage - build mk, yacc, lex, rc and cleanname export PLAN9=$PWD export PATH=$PATH:$PLAN9/bin cd src ../dist/buildmk cd cmd mk $PLAN9/bin/yacc mk $PLAN9/bin/cleanname cd lex mk $PLAN9/bin/lex cd ../rc mk $PLAN9/bin/rc cd ../.. # Build libdraw and libmux (required for rgbycc) cd libdraw mk $PLAN9/lib/libdraw.a cd ../libmux mk $PLAN9/lib/libmux.a cd ../.. else ./INSTALL -r $root/$prefix/plan9port | tee install.log fgrep 'exit status=exit(1)' install.log >/dev/null && exit 1 fgrep 'exit status=exit(2)' install.log >/dev/null && exit 2 # Fix rc scripts for file in $(find . -type f -executable -exec grep -Iq . {} \; -print) do sed -i "s%#!/usr/local/plan9/bin/rc%#!/$prefix/plan9port/bin/rc%" "$file" done # Revert src/mkhdr changes atstage cross && mv src/mkhdr.orig src/mkhdr true fi } install() { if atstage toolchain; then mkdir -p $root/plan9port/{bin,lib,include} # Install mk, yacc, lex, rc, cleanname, 9c and 9l for cmd in mk yacc lex rc cleanname 9c 9l do command install bin/$cmd $root/plan9port/bin/ done # Install libraries and includes for toolchain compiler cp -r include/* $root/plan9port/include/ cp -r lib/* $root/plan9port/lib/ cp rcmain $root/plan9port/rcmain mkdir -p $root/plan9port/src for file in $(find src/ -maxdepth 1 -type f) do cp $file $root/plan9port/src/ done else # Remove files not needed at runtime rm -rf `find src/ -type d -maxdepth 1 -mindepth 1` unix/ mac/ dist/ find . -maxdepth 1 -type f -and ! -name rcmain | xargs rm cp -rv . $root/$prefix/plan9port/ || exit 1 ln -sf /$prefix/plan9port/bin/9 $root$bindir/9 || exit 1 echo "export PLAN9=/$prefix/plan9port" > $root$sysconfdir/profile.d/plan9port fi } runconf=0 runmake=0 hook_add premake 2 configure hook_add inmake 2 build hook_add postmake 2 install