From 2469dec9029d737fd774bf989819d49eea14b609 Mon Sep 17 00:00:00 2001 From: thfr Date: Sun, 12 Dec 2021 04:41:03 +0000 Subject: [PATCH] update mojoshader to last commit (2021-11-24). Project has moved to GitHub, so versioning by mercurial commit isn't meaningful anymore. - remove manual version setting (mojoshader now sets version to -1 if it can't find git/hg info; this is fine) - 2 functions have incomplete signature; add ctx to complete them (plan to upstream this) - tested with fnaify and several FNA games, including Rogue Legacy, Cryptark, Miasma without issues --- graphics/mojoshader/Makefile | 23 ++++++++--------- graphics/mojoshader/distinfo | 4 +-- .../mojoshader/patches/patch-CMakeLists_txt | 18 ------------- .../patches/patch-mojoshader_compiler_c | 25 +++++++++++++++++++ .../patches/patch-mojoshader_opengl_c | 4 +-- 5 files changed, 39 insertions(+), 35 deletions(-) delete mode 100644 graphics/mojoshader/patches/patch-CMakeLists_txt create mode 100644 graphics/mojoshader/patches/patch-mojoshader_compiler_c diff --git a/graphics/mojoshader/Makefile b/graphics/mojoshader/Makefile index 428321cfb9c..260329be323 100644 --- a/graphics/mojoshader/Makefile +++ b/graphics/mojoshader/Makefile @@ -1,22 +1,20 @@ -# $OpenBSD: Makefile,v 1.11 2021/03/07 17:09:36 thfr Exp $ +# $OpenBSD: Makefile,v 1.12 2021/12/12 04:41:03 thfr Exp $ -COMMENT = library to move calls to Direct3D shaders to OpenGL +COMMENT = library to move Direct3D shader calls to OpenGL -# HG_CHANGESET and HG_COMMIT must be kept in sync. -HG_CHANGESET = 1321 -HG_COMMIT = 02f2aafb103c +DISTNAME = mojoshader-0.0.0.20211124 +GH_ACCOUNT = icculus +GH_PROJECT = mojoshader +GH_COMMIT = 76293ed6d5c4bb33875abb92979309e2797cc6ed +EPOCH = 0 + +SHARED_LIBS += mojoshader 2.0 # 0.0.0.20211124 -DISTNAME = mojoshader-${HG_COMMIT}{${HG_COMMIT}} -PKGNAME = mojoshader-${HG_CHANGESET} CATEGORIES = graphics -MASTER_SITES = https://hg.icculus.org/icculus/mojoshader/archive/ - -SHARED_LIBS += mojoshader 1.0 # Changeset 1303 +MAINTAINER = Thomas Frohwein HOMEPAGE = https://icculus.org/mojoshader/ -MAINTAINER = Thomas Frohwein - # zlib PERMIT_PACKAGE = Yes @@ -36,7 +34,6 @@ CONFIGURE_ARGS = -DBUILD_SHARED_LIBS=ON \ -DPROFILE_METAL=OFF CFLAGS += -I${LOCALBASE}/include -WRKDIST = ${WRKDIR}/mojoshader-${HG_COMMIT} SUBST_VARS += HG_CHANGESET HG_COMMIT diff --git a/graphics/mojoshader/distinfo b/graphics/mojoshader/distinfo index d288186b26c..8b097dd661a 100644 --- a/graphics/mojoshader/distinfo +++ b/graphics/mojoshader/distinfo @@ -1,2 +1,2 @@ -SHA256 (mojoshader-02f2aafb103c.tar.gz) = UbCB4dyT4whIlXGav+8QE+7AW8OS94ijvbYGaZmGZvc= -SIZE (mojoshader-02f2aafb103c.tar.gz) = 466287 +SHA256 (mojoshader-0.0.0.20211124-76293ed6.tar.gz) = mFw9ui9ziphuTh+H0dw2JGc/rq0i+cIXGRN81jQjcYY= +SIZE (mojoshader-0.0.0.20211124-76293ed6.tar.gz) = 477384 diff --git a/graphics/mojoshader/patches/patch-CMakeLists_txt b/graphics/mojoshader/patches/patch-CMakeLists_txt deleted file mode 100644 index 433716f84b8..00000000000 --- a/graphics/mojoshader/patches/patch-CMakeLists_txt +++ /dev/null @@ -1,18 +0,0 @@ -$OpenBSD: patch-CMakeLists_txt,v 1.3 2020/09/18 18:46:57 thfr Exp $ - -set version/changeset information manually - -Index: CMakeLists.txt ---- CMakeLists.txt.orig -+++ CMakeLists.txt -@@ -67,8 +67,8 @@ WRITE_FILE( - "/* This file was autogenerated. Do not edit! */\n" - "#ifndef _INCL_MOJOSHADER_VERSION_H_\n" - "#define _INCL_MOJOSHADER_VERSION_H_\n" -- "#define MOJOSHADER_VERSION ${MOJOSHADER_VERSION}\n" -- "#define MOJOSHADER_CHANGESET \"${MOJOSHADER_CHANGESET}\"\n" -+ "#define MOJOSHADER_VERSION ${HG_CHANGESET}\n" -+ "#define MOJOSHADER_CHANGESET \"${HG_CHANGESET}:${HG_COMMIT}\"\n" - "#endif\n" - ) - diff --git a/graphics/mojoshader/patches/patch-mojoshader_compiler_c b/graphics/mojoshader/patches/patch-mojoshader_compiler_c new file mode 100644 index 00000000000..fef0d9564b0 --- /dev/null +++ b/graphics/mojoshader/patches/patch-mojoshader_compiler_c @@ -0,0 +1,25 @@ +$OpenBSD: patch-mojoshader_compiler_c,v 1.1 2021/12/12 04:41:03 thfr Exp $ + +fix incomplete function signatures + +Index: mojoshader_compiler.c +--- mojoshader_compiler.c.orig ++++ mojoshader_compiler.c +@@ -475,7 +475,7 @@ static void pop_symbol(Context *ctx, SymbolMap *map) + if (!item) + return; + if (item->symbol) +- hash_remove(map->hash, item->symbol); ++ hash_remove(map->hash, item->symbol, ctx); + map->scope = item->next; + Free(ctx, item); + } // pop_symbol +@@ -524,7 +524,7 @@ static void destroy_symbolmap(Context *ctx, SymbolMap + { + while (map->scope) + pop_symbol(ctx, map); +- hash_destroy(map->hash); ++ hash_destroy(map->hash, ctx); + } // destroy_symbolmap + + diff --git a/graphics/mojoshader/patches/patch-mojoshader_opengl_c b/graphics/mojoshader/patches/patch-mojoshader_opengl_c index 492b43c3942..4972c9831b0 100644 --- a/graphics/mojoshader/patches/patch-mojoshader_opengl_c +++ b/graphics/mojoshader/patches/patch-mojoshader_opengl_c @@ -1,4 +1,4 @@ -$OpenBSD: patch-mojoshader_opengl_c,v 1.2 2020/09/18 18:46:57 thfr Exp $ +$OpenBSD: patch-mojoshader_opengl_c,v 1.3 2021/12/12 04:41:03 thfr Exp $ re-add MOJOSHADER_glProgramViewportFlip() for backwards compatibility. Was removed by upstream in changeset 1210 @@ -7,7 +7,7 @@ Was removed by upstream in changeset 1210 Index: mojoshader_opengl.c --- mojoshader_opengl.c.orig +++ mojoshader_opengl.c -@@ -2671,6 +2671,27 @@ static inline GLenum opengl_attr_type(const MOJOSHADER +@@ -2681,6 +2681,27 @@ static inline GLenum opengl_attr_type(const MOJOSHADER return GL_NONE; // oh well. Raises a GL error later. } // opengl_attr_type