Skip to content

Commit

Permalink
devel/genie: Update version g2020082801=>g20230921
Browse files Browse the repository at this point in the history
- Pet port{clippy,fmt,lint} hints
- Add DEBUG option to Port
- GENie releases come with pre-rolled assets used for project
  generation, this means GNU makefiles configured to build GENie, and
  created for User projects, include hard coded architecture
  information, including compiler platform options (-m64). Remove hard
  coded information, as well as any -O optimisation that are fouling
  with the Ports framework. Patch the GENie sources to produce sanitised
  output fit for consumers of the Port, and use the assets produced from
  the build to create the needed patches in files/

PR:		274947
  • Loading branch information
Alastair Hogge authored and 5u623l20 committed Nov 23, 2023
1 parent 0cafe14 commit c62bdd5
Show file tree
Hide file tree
Showing 9 changed files with 272 additions and 40 deletions.
23 changes: 17 additions & 6 deletions devel/genie/Makefile
@@ -1,25 +1,36 @@
PORTNAME= genie
PORTVERSION= g2020082801
DISTVERSION= g20230921
CATEGORIES= devel

MAINTAINER= bofh@FreeBSD.org
COMMENT= GENie Project generator tool
WWW= https://github.com/bkaradzic/GENie

LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE

USES= gmake
USE_GITHUB= yes
GH_ACCOUNT= bkaradzic
GH_PROJECT= GENie
GH_TAGNAME= a503d6e
GH_TAGNAME= 7f00dcba5845a0158d53b9b2867f42e6979648ba

MAKE_ARGS= -C build/gmake.freebsd config=release CC=${CC} CXX=${CXX}
MAKE_ARGS= -C build/gmake.freebsd \
AR=${AR} \
CC=${CC} \
CXX=${CXX} \
verbose=1
MAKE_JOBS_UNSAFE= yes

PLIST_FILES= bin/${PORTNAME}

LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
OPTIONS_DEFINE= DEBUG

DEBUG_MAKE_ARGS= config=debug
DEBUG_MAKE_ARGS_OFF= config=release

do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/bsd/genie ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/bin/bsd/genie \
${STAGEDIR}${PREFIX}/bin

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions devel/genie/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1598641181
SHA256 (bkaradzic-GENie-g2020082801-a503d6e_GH0.tar.gz) = b820925faaeb8fbe9a562b0ea1370a7deb28ac881799f1da0a85c717321db46a
SIZE (bkaradzic-GENie-g2020082801-a503d6e_GH0.tar.gz) = 553692
TIMESTAMP = 1698902221
SHA256 (bkaradzic-GENie-g20230921-7f00dcba5845a0158d53b9b2867f42e6979648ba_GH0.tar.gz) = 540fdf51fca60897305e556d0f374d6d838c09caa4a63fa9f6b30dc4dbde4bfd
SIZE (bkaradzic-GENie-g20230921-7f00dcba5845a0158d53b9b2867f42e6979648ba_GH0.tar.gz) = 543873
93 changes: 62 additions & 31 deletions devel/genie/files/patch-build_gmake.freebsd_genie.make
@@ -1,50 +1,81 @@
--- build/gmake.freebsd/genie.make.orig 2018-11-08 16:01:03 UTC
--- build/gmake.freebsd/genie.make.orig 2023-09-20 17:46:05 UTC
+++ build/gmake.freebsd/genie.make
@@ -49,17 +49,17 @@ ifeq ($(config),release)
@@ -6,9 +6,8 @@ endif
config=release
endif

-ifndef verbose
- SILENT = @
-endif
+verbose=1
+SILENT =

SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
@@ -31,10 +30,6 @@ endif
RM = $(SILENT) del /F "$(subst /,\\,$(1))" 2> nul || exit 0
endif

-CC = gcc
-CXX = g++
-AR = ar
-
ifndef RESCOMP
ifdef WINDRES
RESCOMP = $(WINDRES)
@@ -52,20 +47,20 @@ ifeq ($(config),release)
DEFINES += -DNDEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Os
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Os
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Os
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Os
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Os
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -Os -m64 -Wno-implicit-fallthrough
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Wno-implicit-fallthrough
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Wno-implicit-fallthrough
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Wno-implicit-fallthrough
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Wno-implicit-fallthrough
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -Wno-implicit-fallthrough
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -s -rdynamic
- ALL_LDFLAGS += $(LDFLAGS) -L"." -s -rdynamic
+ ALL_LDFLAGS += --verbose $(LDFLAGS) -L"." -s -rdynamic
LIBDEPS +=
LDDEPS +=
LDRESP =
LIBS += $(LDDEPS) -lm
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
LINKOBJS = $(OBJECTS)
- LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
@@ -132,17 +132,17 @@ ifeq ($(config),debug)
@@ -139,20 +134,20 @@ ifeq ($(config),debug)
DEFINES += -D_DEBUG -DLUA_COMPAT_MODULE -DLUA_USE_POSIX -DLUA_USE_DLOPEN
INCLUDES += -I"../../src/host/lua-5.3.0/src"
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -MP $(DEFINES) $(INCLUDES)
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g
- ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough
- ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough
- ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough
- ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough
- ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -Wall -Wextra -g -m64 -Wno-implicit-fallthrough
+ ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g -Wno-implicit-fallthrough
+ ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g -Wno-implicit-fallthrough
+ ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g -Wno-implicit-fallthrough
+ ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g -Wno-implicit-fallthrough
+ ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) -Wall -Wextra -g -Wno-implicit-fallthrough
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
ALL_LDFLAGS += $(LDFLAGS) -L. -rdynamic
- ALL_LDFLAGS += $(LDFLAGS) -L"." -rdynamic
+ ALL_LDFLAGS += --verbose $(LDFLAGS) -L"." -rdynamic
LIBDEPS +=
LDDEPS +=
LDRESP =
LIBS += $(LDDEPS) -lm
EXTERNAL_LIBS +=
- LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
LINKOBJS = $(OBJECTS)
- LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS)
+ LINKCMD = $(CC) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
OBJRESP =
OBJECTS := \
$(OBJDIR)/src/host/lua-5.3.0/src/lapi.o \
$(OBJDIR)/src/host/lua-5.3.0/src/lauxlib.o \
20 changes: 20 additions & 0 deletions devel/genie/files/patch-scripts_genie.lua
@@ -0,0 +1,20 @@
--- scripts/genie.lua.orig 2023-09-20 17:46:05 UTC
+++ scripts/genie.lua
@@ -45,17 +45,12 @@ --
"../src/host/lua-5.3.0/etc/*.c",
}

- buildoptions {
- "-m64",
- }
-
configuration "Debug"
defines { "_DEBUG", "LUA_COMPAT_MODULE" }
flags { "Symbols" }

configuration "Release"
defines { "NDEBUG", "LUA_COMPAT_MODULE" }
- flags { "OptimizeSize" }

configuration "vs*"
defines { "_CRT_SECURE_NO_WARNINGS" }
22 changes: 22 additions & 0 deletions devel/genie/files/patch-scripts_release.lua
@@ -0,0 +1,22 @@
--- scripts/release.lua.orig 2023-09-20 17:46:05 UTC
+++ scripts/release.lua
@@ -21,7 +21,7 @@ function dorelease()
f = io.popen("git log --format=format:%H -1")
local sha1 = f:read("*a")
f:close()
- io.output("src/host/version.h")
+ io.output("../src/host/version.h")
io.write("#define VERSION " ..rev .. "\n")
io.write("#define VERSION_STR \"version " ..rev .. " (commit " .. sha1 .. ")\"\n")
io.close()
@@ -37,9 +37,7 @@ function dorelease()

print("Generating project files...")

- exec(_PREMAKE_COMMAND .. " /to=../build/gmake.windows /os=windows gmake")
- exec(_PREMAKE_COMMAND .. " /to=../build/gmake.linux /os=linux gmake")
- exec(_PREMAKE_COMMAND .. " /to=../build/gmake.darwin /os=macosx /platform=universal32 gmake")
+ exec(_PREMAKE_COMMAND .. " /to=../build/gmake.freebsd /os=bsd gmake")

print("")
print( "Finished.")
61 changes: 61 additions & 0 deletions devel/genie/files/patch-src_actions_make_make__cpp.lua
@@ -0,0 +1,61 @@
--- src/actions/make/make_cpp.lua.orig 2023-09-20 17:46:05 UTC
+++ src/actions/make/make_cpp.lua
@@ -225,9 +225,8 @@ --
_p('endif')
_p('')

- _p('ifndef verbose')
- _p(' SILENT = @')
- _p('endif')
+ _p('verbose=1')
+ _p('SILENT =')
_p('')

-- identify the shell type
@@ -254,11 +253,6 @@ --
_p('endif')
_p('')

- _p('CC = %s', cc.cc)
- _p('CXX = %s', cc.cxx)
- _p('AR = %s', cc.ar)
- _p('')
-
_p('ifndef RESCOMP')
_p(' ifdef WINDRES')
_p(' RESCOMP = $(WINDRES)')
@@ -423,11 +417,11 @@ --

_p(' ALL_CPPFLAGS += $(CPPFLAGS) %s $(DEFINES) $(INCLUDES)', table.concat(cc.getcppflags(cfg), " "))

- _p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)))
- _p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))
- _p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))
- _p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))
- _p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH)%s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))
+ _p(' ALL_ASMFLAGS += $(ASMFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) %s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_asm)))
+ _p(' ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) %s', make.list(table.join(cc.getcflags(cfg), cfg.buildoptions, cfg.buildoptions_c)))
+ _p(' ALL_CXXFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) %s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cfg.buildoptions, cfg.buildoptions_cpp)))
+ _p(' ALL_OBJCFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) %s', make.list(table.join(cc.getcflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objc)))
+ _p(' ALL_OBJCPPFLAGS += $(CXXFLAGS) $(CFLAGS) $(ALL_CPPFLAGS) %s', make.list(table.join(cc.getcflags(cfg), cc.getcxxflags(cfg), cc.getobjcflags(cfg), cfg.buildoptions, cfg.buildoptions_objcpp)))

_p(' ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)%s',
make.list(table.join(cc.getdefines(cfg.resdefines),
@@ -467,7 +461,7 @@ --
lddeps = libdeps
end

- _p(' ALL_LDFLAGS += $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))
+ _p(' ALL_LDFLAGS += --verbose $(LDFLAGS)%s', make.list(table.join(cc.getlibdirflags(cfg), cc.getldflags(cfg), cfg.linkoptions)))
_p(' LIBDEPS +=%s', libdeps)
_p(' LDDEPS +=%s', lddeps)

@@ -497,7 +491,7 @@ --
startgroup = '-Wl,--start-group '
endgroup = ' -Wl,--end-group'
end
- _p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup, endgroup)
+ _p(' LINKCMD = $(%s) -o $(TARGET) $(LINKOBJS) $(RESOURCES) $(ALL_LDFLAGS) %s$(LIBS)%s', tool, startgroup, endgroup)
end
end

0 comments on commit c62bdd5

Please sign in to comment.