Jeremie Courreges-Anglas <[email protected]> writes:

> Solene Rapenne <[email protected]> writes:
>
>> Hello,
>
> Hi,
>
>> Please find a patch to update games/tome4 to 1.5.1
>>
>> I updated patch-src_getself_c because the (Free)BSD code changed
>> upstream and the previous patch wasn't applying anymore.
>>
>> I hope the patch doesn't get scrambled in the process.
>
> Ports-wise:
>
> - better use sysconf than yet another hand-rolled sysctl call -> the
>   diff gets shorter.
> - also in the updated diff below:
>   - add V to SUBST_VARS and regen PLIST.  You'll get less changes when
>     updating later.
>   - drops REVISION-foo (this should be done when updating to a newer
>     version)
>   - rm a patched fine remnant

After further discussion with Solene:
- kill the example modules
- add a MASTER_SITES mirror hosted by Solene, to provide a fallback if
  upstream keeps on altering existing release tarballs.


Index: Makefile
===================================================================
RCS file: /d/cvs/ports/games/tome4/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- Makefile    3 Mar 2017 21:29:00 -0000       1.4
+++ Makefile    23 Mar 2017 13:30:31 -0000
@@ -3,15 +3,13 @@
 COMMENT-main = graphical sdl rogue-like game
 COMMENT-data = data for Tales of Maj'Eyal
 
-V =            1.4.9
+V =            1.5.1
 PKGNAME-main = tome4-${V}
 PKGNAME-data = tome4-data-${V}
 CATEGORIES =   games x11
 
-REVISION-main =        0
-REVISION-data =        0
-
-MASTER_SITES = http://te4.org/dl/t-engine/
+MASTER_SITES = http://te4.org/dl/t-engine/ \
+               http://distfiles-openbsd.perso.pw/
 DISTNAME =     t-engine4-src-${V}
 EXTRACT_SUFX = .tar.bz2
 HOMEPAGE =     http://te4.org
@@ -39,9 +37,6 @@ RUN_DEPENDS-main =    games/tome4,-data
 LIB_DEPENDS-data =
 WANTLIB-data =
 
-GAMEDIR =      ${PREFIX}/share/tome4
-SUBST_VARS =   GAMEDIR
-
 # The build system hardcodes the use of the "gcc" command
 MODULES =      gcc4
 MODGCC4_ARCHS =        *
@@ -52,6 +47,9 @@ USE_GMAKE =   YES
 MAKE_FLAGS =   verbose=1
 MAKE_ENV =     config=release
 
+GAMEDIR =      ${PREFIX}/share/tome4
+SUBST_VARS +=  GAMEDIR V
+
 do-configure:
        sed -i 's/gcc /${CC} /g' ${WRKSRC}/build/te4core.lua
        ${SUBST_CMD} ${WRKSRC}/src/getself.c
@@ -62,6 +60,7 @@ do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/t-engine ${PREFIX}/bin/tome4
        ${INSTALL_DATA_DIR} ${GAMEDIR}
        cd ${WRKSRC}; tar cf - bootstrap game | tar xf - -C ${GAMEDIR}
-
+       rm -R ${GAMEDIR}/game/modules/example*
+       rm ${GAMEDIR}/bootstrap/boot.lua.orig
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /d/cvs/ports/games/tome4/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo    28 Dec 2016 18:34:57 -0000      1.1.1.1
+++ distinfo    20 Mar 2017 17:21:47 -0000
@@ -1,2 +1,2 @@
-SHA256 (t-engine4-src-1.4.9.tar.bz2) = 
tKcX/jyN0qgithNCXs5iz7q9TEXn5vbg+8ToGx6oAjE=
-SIZE (t-engine4-src-1.4.9.tar.bz2) = 354443574
+SHA256 (t-engine4-src-1.5.1.tar.bz2) = 
er5VbR72iQ0WrlO4KSwQWSVDopR6QCS7mjtnARp00Lg=
+SIZE (t-engine4-src-1.5.1.tar.bz2) = 421336208
Index: patches/patch-src_getself_c
===================================================================
RCS file: /d/cvs/ports/games/tome4/patches/patch-src_getself_c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-src_getself_c
--- patches/patch-src_getself_c 28 Dec 2016 18:34:57 -0000      1.1.1.1
+++ patches/patch-src_getself_c 20 Mar 2017 17:49:13 -0000
@@ -1,29 +1,17 @@
-$OpenBSD: patch-src_getself_c,v 1.1.1.1 2016/12/28 18:34:57 awolk Exp $
---- src/getself.c.orig Thu Jan  7 20:09:06 2016
-+++ src/getself.c      Tue Nov 29 16:38:12 2016
-@@ -47,7 +47,8 @@ const char *get_self_executable(int argc, char **argv)
+--- src/getself.c.orig Wed Mar  8 18:20:39 2017
++++ src/getself.c      Mon Mar 20 18:46:27 2017
+@@ -47,13 +47,7 @@ int get_number_cpus()
+ const char *get_self_executable(int argc, char **argv)
+ {
        static char res[PATH_MAX];
-       // Like linux, but /proc is not always mounted
-       //  return 0 if it's not
--      if (realpath("/proc/curproc/file", res)) return NULL;
-+      //if (realpath("/proc/curproc/file", res)) return NULL;
+-      int mib[4];
+-      mib[0] = CTL_KERN;
+-      mib[1] = KERN_PROC;
+-      mib[2] = KERN_PROC_PATHNAME;
+-      mib[3] = -1;
+-      size_t cb = sizeof(res);
+-      sysctl(mib,4,res,&cb,NULL,0);
 +      realpath("${GAMEDIR}/", res);
        return res;
- }
- 
-@@ -57,8 +58,14 @@ int get_number_cpus()
- {
-       int count;
-       size_t size=sizeof(count);
-+      int name[2];
-+      name[0] = CTL_HW;
-+      name[1] = HW_NCPU;
-       
--      if (sysctlbyname("hw.ncpu",&count,&size,NULL,0)) return 1;
-+      if (sysctl(name, 2, &count, &size, NULL, 0) < 0) {
-+        count = 1;
-+      }
-+
-       return count;
  }
  
Index: pkg/PLIST-data
===================================================================
RCS file: /d/cvs/ports/games/tome4/pkg/PLIST-data,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-data
--- pkg/PLIST-data      29 Dec 2016 14:07:11 -0000      1.2
+++ pkg/PLIST-data      23 Mar 2017 13:31:27 -0000
@@ -2,7 +2,7 @@
 share/tome4/
 share/tome4/game/
 share/tome4/game/modules/
-share/tome4/game/modules/boot-te4-1.4.9.team
-share/tome4/game/modules/tome-1.4.9-gfx.team
-share/tome4/game/modules/tome-1.4.9-music.team
-share/tome4/game/modules/tome-1.4.9.team
+share/tome4/game/modules/boot-te4-${V}.team
+share/tome4/game/modules/tome-${V}-gfx.team
+share/tome4/game/modules/tome-${V}-music.team
+share/tome4/game/modules/tome-${V}.team
Index: pkg/PLIST-main
===================================================================
RCS file: /d/cvs/ports/games/tome4/pkg/PLIST-main,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-main
--- pkg/PLIST-main      29 Dec 2016 14:07:11 -0000      1.2
+++ pkg/PLIST-main      23 Mar 2017 13:31:27 -0000
@@ -5,9 +5,9 @@ share/tome4/bootstrap/boot.lua
 share/tome4/game/addons/
 share/tome4/game/addons/tome-addon-dev.teaa
 share/tome4/game/addons/tome-items-vault.teaa
-share/tome4/game/addons/tome-stone-wardens.teaa
+share/tome4/game/addons/tome-possessors.teaa
 share/tome4/game/engines/
-share/tome4/game/engines/te4-1.4.9.teae
+share/tome4/game/engines/te4-${V}.teae
 share/tome4/game/loader/
 share/tome4/game/loader/init.lua
 share/tome4/game/loader/pre-init.lua


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to