Hi!

The diff below updates LuaJIT to version 2.0.4 and fixes runtime
wrt multiple Lua versions ("5.1" was still hardcoded in some
places...)

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/luajit/Makefile,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 Makefile
--- Makefile    28 May 2015 10:17:24 -0000      1.16
+++ Makefile    5 Jun 2015 04:46:56 -0000
@@ -5,13 +5,12 @@ ONLY_FOR_ARCHS = powerpc i386 amd64
 # for mips64* gcc 4.6 is needed, but that doesn't build on this arch (yet)
 
 SHARED_ONLY =  Yes
-SHARED_LIBS += luajit-${MODLUA_VERSION} 0.0 # 2.0.0
+SHARED_LIBS += luajit-${MODLUA_VERSION} 0.0 # 2.0.4
 
 COMMENT =      just-in-time compiler for Lua
-V =            2.0.3
+V =            2.0.4
 DISTNAME =     LuaJIT-${V}
 PKGNAME =      ${DISTNAME:L}
-REVISION =     3
 
 CATEGORIES =   lang
 
@@ -52,7 +51,9 @@ MAKE_FLAGS += XCFLAGS="-DLUAJIT_ENABLE_L
 .endif
 
 pre-configure:
-       ${SUBST_CMD} ${WRKDIST}/Makefile
+       ${SUBST_CMD} ${WRKDIST}/Makefile \
+               ${WRKDIST}/etc/luajit.pc \
+               ${WRKDIST}/src/luaconf.h
 
 post-install:
        mv ${PREFIX}/bin/luajit-$V ${PREFIX}/bin/luajit${MODLUA_DEP_VERSION}
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/luajit/distinfo,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 distinfo
--- distinfo    12 Mar 2014 22:51:21 -0000      1.6
+++ distinfo    5 Jun 2015 04:46:56 -0000
@@ -1,2 +1,2 @@
-SHA256 (LuaJIT-2.0.3.tar.gz) = Vb5sstEB7TisyjLFsfma40WQSzZbZCIDGUxYXSe+vXk=
-SIZE (LuaJIT-2.0.3.tar.gz) = 844927
+SHA256 (LuaJIT-2.0.4.tar.gz) = Yg+k6xI3UCG+9uTyN8vS3V1J5WvrQUvuBSx0a+7xgH0=
+SIZE (LuaJIT-2.0.4.tar.gz) = 847615
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/lang/luajit/patches/patch-Makefile,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 patch-Makefile
--- patches/patch-Makefile      3 May 2014 14:24:03 -0000       1.4
+++ patches/patch-Makefile      5 Jun 2015 04:46:56 -0000
@@ -1,9 +1,9 @@
 $OpenBSD: patch-Makefile,v 1.4 2014/05/03 14:24:03 abieber Exp $
---- Makefile.orig      Wed Mar 12 06:10:00 2014
-+++ Makefile   Mon Apr 14 12:35:12 2014
+--- Makefile.orig      Thu May 14 20:30:00 2015
++++ Makefile   Thu Jun  4 19:20:59 2015
 @@ -17,7 +17,7 @@ MAJVER=  2
  MINVER=  0
- RELVER=  3
+ RELVER=  4
  VERSION= $(MAJVER).$(MINVER).$(RELVER)
 -ABIVER=  5.1
 +ABIVER=  ${MODLUA_VERSION}
Index: patches/patch-etc_luajit_pc
===================================================================
RCS file: patches/patch-etc_luajit_pc
diff -N patches/patch-etc_luajit_pc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-etc_luajit_pc 5 Jun 2015 04:46:56 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+--- etc/luajit.pc.orig Thu Jun  4 20:05:32 2015
++++ etc/luajit.pc      Thu Jun  4 20:06:57 2015
+@@ -3,9 +3,9 @@ majver=2
+ minver=0
+ relver=4
+ version=${majver}.${minver}.${relver}
+-abiver=5.1
++abiver=${MODLUA_VERSION}
+ 
+-prefix=/usr/local
++prefix=${TRUEPREFIX}
+ multilib=lib
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/${multilib}
Index: patches/patch-src_Makefile
===================================================================
RCS file: /cvs/ports/lang/luajit/patches/patch-src_Makefile,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 patch-src_Makefile
--- patches/patch-src_Makefile  12 Mar 2014 22:51:21 -0000      1.4
+++ patches/patch-src_Makefile  5 Jun 2015 04:46:56 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-src_Makefile,v 1.4 2014/03/12 22:51:21 abieber Exp $
---- src/Makefile.orig  Wed Mar 12 06:10:00 2014
-+++ src/Makefile       Wed Mar 12 13:31:24 2014
-@@ -327,6 +327,10 @@ else
+--- src/Makefile.orig  Thu May 14 20:30:00 2015
++++ src/Makefile       Thu Jun  4 19:20:59 2015
+@@ -325,6 +325,10 @@ else
    ifeq (GNU/kFreeBSD,$(TARGET_SYS))
      TARGET_XLIBS+= -ldl
    endif
@@ -12,7 +12,7 @@ $OpenBSD: patch-src_Makefile,v 1.4 2014/
  endif
  endif
  endif
-@@ -559,10 +563,10 @@ endif
+@@ -557,10 +561,10 @@ endif
  endif
  endif
  
Index: patches/patch-src_host_buildvm_asm_c
===================================================================
RCS file: /cvs/ports/lang/luajit/patches/patch-src_host_buildvm_asm_c,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-src_host_buildvm_asm_c
--- patches/patch-src_host_buildvm_asm_c        5 Oct 2013 15:51:08 -0000       
1.2
+++ patches/patch-src_host_buildvm_asm_c        5 Jun 2015 04:46:56 -0000
@@ -2,10 +2,10 @@ $OpenBSD: patch-src_host_buildvm_asm_c,v
 
 .gnu_attribute requires binutils 2.18
 
---- src/host/buildvm_asm.c.orig        Mon Jun  3 13:00:00 2013
-+++ src/host/buildvm_asm.c     Sat Oct  5 09:33:08 2013
+--- src/host/buildvm_asm.c.orig        Thu May 14 20:30:00 2015
++++ src/host/buildvm_asm.c     Thu Jun  4 19:20:59 2015
 @@ -289,12 +289,14 @@ void emit_asm(BuildCtx *ctx)
- #if !LJ_TARGET_PS3
+ #if !(LJ_TARGET_PS3 || LJ_TARGET_PSVITA)
      fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\"," ELFASM_PX 
"progbits\n");
  #endif
 +#if 0
Index: patches/patch-src_lj_arch_h
===================================================================
RCS file: /cvs/ports/lang/luajit/patches/patch-src_lj_arch_h,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-src_lj_arch_h
--- patches/patch-src_lj_arch_h 12 Mar 2014 22:51:21 -0000      1.3
+++ patches/patch-src_lj_arch_h 5 Jun 2015 04:46:56 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-src_lj_arch_h,v 1.3 2014/03/12 22:51:21 abieber Exp $
---- src/lj_arch.h.orig Wed Mar 12 06:10:00 2014
-+++ src/lj_arch.h      Wed Mar 12 13:34:08 2014
-@@ -324,9 +324,6 @@
+--- src/lj_arch.h.orig Thu May 14 20:30:00 2015
++++ src/lj_arch.h      Thu Jun  4 19:20:59 2015
+@@ -332,9 +332,6 @@
  #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
  #error "No support for PowerPC CPUs without double-precision FPU"
  #endif
Index: patches/patch-src_lj_mcode_c
===================================================================
RCS file: patches/patch-src_lj_mcode_c
diff -N patches/patch-src_lj_mcode_c
--- patches/patch-src_lj_mcode_c        20 Jan 2015 15:26:26 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,34 +0,0 @@
-$OpenBSD: patch-src_lj_mcode_c,v 1.1 2015/01/20 15:26:26 abieber Exp $
---- src/lj_mcode.c.orig        Wed Mar 12 06:10:00 2014
-+++ src/lj_mcode.c     Mon Jan 19 10:21:45 2015
-@@ -145,7 +145,7 @@ static void mcode_free(jit_State *J, void *p, size_t s
- 
- /* -- MCode area protection ----------------------------------------------- */
- 
--/* Define this ONLY if the page protection twiddling becomes a bottleneck. */
-+/* Define this ONLY if page protection twiddling becomes a bottleneck. */
- #ifdef LUAJIT_UNPROTECT_MCODE
- 
- /* It's generally considered to be a potential security risk to have
-@@ -252,7 +252,20 @@ static void *mcode_alloc(jit_State *J, size_t sz)
- #else
- 
- /* All memory addresses are reachable by relative jumps. */
--#define mcode_alloc(J, sz)    mcode_alloc_at((J), 0, (sz), MCPROT_GEN)
-+static void *mcode_alloc(jit_State *J, size_t sz)
-+{
-+#ifdef __OpenBSD__
-+  /* Allow better executable memory allocation for OpenBSD W^X mode. */
-+  void *p = mcode_alloc_at(J, 0, sz, MCPROT_RUN);
-+  if (p && mcode_setprot(p, sz, MCPROT_GEN)) {
-+    mcode_free(J, p, sz);
-+    return NULL;
-+  }
-+  return p;
-+#else
-+  return mcode_alloc_at(J, 0, sz, MCPROT_GEN);
-+#endif
-+}
- 
- #endif
- 
Index: patches/patch-src_luaconf_h
===================================================================
RCS file: patches/patch-src_luaconf_h
diff -N patches/patch-src_luaconf_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_luaconf_h 5 Jun 2015 04:46:56 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- src/luaconf.h.orig Thu Jun  4 21:49:15 2015
++++ src/luaconf.h      Thu Jun  4 21:52:03 2015
+@@ -35,9 +35,9 @@
+ #ifndef LUA_LMULTILIB
+ #define LUA_LMULTILIB "lib"
+ #endif
+-#define LUA_LROOT     "/usr/local"
+-#define LUA_LUADIR    "/lua/5.1/"
+-#define LUA_LJDIR     "/luajit-2.0.4/"
++#define LUA_LROOT     "${TRUEPREFIX}"
++#define LUA_LUADIR    "/lua/${MODLUA_VERSION}/"
++#define LUA_LJDIR     "/luajit-2.0/"
+ 
+ #ifdef LUA_ROOT
+ #define LUA_JROOT     LUA_ROOT

Reply via email to