On Tue, Aug 09 2022, Jeremie Courreges-Anglas <j...@wxcvbn.org> wrote: > Another diff I have used on riscv64 bulk build cluster since some > weeks/months. The executables are named differently on riscv64. > > The SConstruct file has this logic: > > if env["arch"] != "": > suffix += "." + env["arch"] > elif env["bits"] == "32": > suffix += ".32" > elif env["bits"] == "64": > suffix += ".64" > > In the detect.py scripts: > > if env["arch"] == "" and platform.machine() == "riscv64": > env["arch"] = "rv64 > > The executables are named as such: > > hifive /usr/ports/games/godot$ ls -l > /usr/ports/pobj/godot-3.4.5/godot-3.4.5-stable/bin/godot.x11.opt.* > -rwxr-xr-x 1 _pbuild _pbuild 77693472 Aug 8 02:59 > /usr/ports/pobj/godot-3.4.5/godot-3.4.5-stable/bin/godot.x11.opt.rv64 > -rwxr-xr-x 1 _pbuild _pbuild 157345856 Aug 8 05:28 > /usr/ports/pobj/godot-3.4.5/godot-3.4.5-stable/bin/godot.x11.opt.tools.rv64 > > which doesn't match the logic used in do-install, hence the following diff.
> Another approach with more explicit code would be to use a variable in > the file names, that variable would hold either "rv64", "64" or "32" > depending on the arch. That would give something like the diff below (tested on riscv64 and amd64). Index: Makefile =================================================================== RCS file: /cvs/ports/games/godot/Makefile,v retrieving revision 1.38 diff -u -p -r1.38 Makefile --- Makefile 5 Aug 2022 14:19:42 -0000 1.38 +++ Makefile 8 Aug 2022 23:10:50 -0000 @@ -99,6 +99,15 @@ NO_TEST = Yes DPB_PROPERTIES = parallel +.include <bsd.port.arch.mk> +.if ${MACHINE_ARCH} == "riscv64" +BINSUFFIX = rv64 +.elif ${PROPERTIES:Mlp64} +BINSUFFIX = 64 +.else +BINSUFFIX = 32 +.endif + .if ${MACHINE_ARCH:Mhppa} LDFLAGS += -latomic WANTLIB += atomic @@ -123,9 +132,9 @@ do-build: @${MODSCONS_BUILD_TARGET} tools=yes target=release_debug do-install: - ${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot.x11.opt.[36]* \ + ${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot.x11.opt.${BINSUFFIX} \ ${PREFIX}/bin/godot - ${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot.x11.opt.tools.* \ + ${INSTALL_PROGRAM} ${WRKBUILD}/bin/godot.x11.opt.tools.${BINSUFFIX} \ ${PREFIX}/bin/godot-tools ${INSTALL_MAN_DIR} ${PREFIX}/man/man6 ${INSTALL_MAN} ${WRKSRC}/misc/dist/linux/godot.6 \ -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE