# HG changeset patch # User Franz Glasner # Date 1741952049 -3600 # Node ID 7febb8b5cb59646dfc14a0aba2f0a71b9ae0741f # Parent 6aa5c9b981b214919ba8d09bcfaf166e78f06f23 Patch our PORTVERSION into uwsgi that is returned with "uwsgi --version". The parser for the version in uwsgiconfig.py also needed to be adjusted therefore because all version parts up to and including the revision must be integers to be used in the Python plugins properly. diff -r 6aa5c9b981b2 -r 7febb8b5cb59 uwsginl/Makefile --- a/uwsginl/Makefile Fri Mar 14 12:16:05 2025 +0100 +++ b/uwsginl/Makefile Fri Mar 14 12:34:09 2025 +0100 @@ -78,6 +78,9 @@ EXTRA_PROFILE_OVERRIDE+= ${bcvar:tl}=${BUILDCONF_${bcvar}:Ufalse} .endfor +post-patch: + ${REINPLACE_CMD} -i '' -e 's/2.1-dev/${PORTVERSION}/' ${WRKSRC}/uwsgiconfig.py + do-configure: @${DO_NADA} diff -r 6aa5c9b981b2 -r 7febb8b5cb59 uwsginl/files/patch-uwsgiconfig.py --- a/uwsginl/files/patch-uwsgiconfig.py Fri Mar 14 12:16:05 2025 +0100 +++ b/uwsginl/files/patch-uwsgiconfig.py Fri Mar 14 12:34:09 2025 +0100 @@ -1,6 +1,35 @@ ---- uwsgiconfig.py.orig 2024-10-26 09:59:26 UTC +--- uwsgiconfig.py.orig 2024-10-26 09:39:02 UTC +++ uwsgiconfig.py -@@ -1467,7 +1467,8 @@ def build_plugin(path, uc, cflags, ldflags, libs, name +@@ -1218,11 +1218,24 @@ class uConf(object): + uver_min = '0' + uver_rev = '0' + +- if len(uver_dots) > 2: +- uver_min = uver_dots[2] ++ # fag: handle our PORTVERSION strings properly ++ for plidx, uver_part in enumerate(uver_dots): ++ if uver_part[0].isalpha(): ++ assert ((uver_part.startswith("pl") and (uver_part[2:]).isnumeric()) ++ or ++ (uver_part.startswith("dev") and (uver_part[3:]).isnumeric())) ++ if uver_custom: ++ uver_custom = ".".join(uver_dots[plidx:]) + "-" + uver_custom ++ else: ++ uver_custom = ".".join(uver_dots[plidx:]) ++ break ++ else: ++ # uWSGI standard ++ if len(uver_dots) > 2: ++ uver_min = uver_dots[2] + +- if len(uver_dots) > 3: +- uver_rev = uver_dots[3] ++ if len(uver_dots) > 3: ++ uver_rev = uver_dots[3] + + self.cflags.append('-DUWSGI_VERSION_BASE="' + uver_base + '"') + self.cflags.append('-DUWSGI_VERSION_MAJOR="' + uver_maj + '"') +@@ -1497,7 +1510,8 @@ def build_plugin(path, uc, cflags, ldflags, libs, name gcc_list.append(path + '/' + cfile) for bfile in up.get('BINARY_LIST', []): try: @@ -10,10 +39,10 @@ print(binary_link_cmd) if subprocess.call(binary_link_cmd, shell=True) != 0: raise Exception('unable to link binary file') -@@ -1561,6 +1562,19 @@ def build_plugin(path, uc, cflags, ldflags, libs, name - print("build time: %d seconds" % (time.time() - plugin_started_at)) +@@ -1595,6 +1609,19 @@ def build_plugin(path, uc, cflags, ldflags, libs, name print("*** %s plugin built and available in %s ***" % (name, plugin_dest + '.so')) + + +def get_default_target_emulation(): + """Need a target emulation on FreeBSD (ld, ld.lld when linking binary/raw""" @@ -30,8 +59,8 @@ def vararg_callback(option, opt_str, value, parser): assert value is None value = [] -@@ -1650,7 +1664,7 @@ if __name__ == "__main__": - print("*** uWSGI building and linking plugin %s ***" % options.plugin[0] ) +@@ -1684,7 +1711,7 @@ if __name__ == "__main__": + print("*** uWSGI building and linking plugin %s ***" % options.plugin[0]) build_plugin(options.plugin[0], uc, cflags, ldflags, libs, name) elif options.extra_plugin: - print("*** uWSGI building and linking plugin from %s ***" % options.extra_plugin[0])