Patch for premake 4.4 beta 5 from premake 4

Sergei G sergeig.public at gmail.com
Tue Jun 24 06:51:07 UTC 2014


I had to update Premake 4 port (4.3) to 4.4 beta 5 on FreeBSD 
10.0-RELEASE #0.

I included patch file with changes applied to Premake 4 port. The 
changes consist of:

 1. updating version and addition of beta version in Makefile
 2. switch to clang compiler in Makefile
 3. update of download file signatures
 4. removal of 2 patch files, because the files appear to be obsolete
    and I could not figure out the proper fix. Keeping both patch files
    resulted in error during premake execution.

I was successful for my small scope of compiling Box2D, but I observed a 
couple of issues with my upgrade.

3 regression tests failed (it appears due to at least one missing patch 
file):

cd /usr/ports/devel/premake4.4/work/premake-4.4-beta5/tests && ./test
Building configurations...
Running action 'test'...
os.findlib_FindSystemLib: [string "function os.executef(cmd, 
...)..."]:12: attempt to call method 'lines' (a nil value)
os.findlib_FailsOnBadLibName: [string "function os.executef(cmd, 
...)..."]:12: attempt to call method 'lines' (a nil value)
premake_command.valueIsSet: 
...remake-4.4-beta5/tests/base/test_premake_command.lua:13: expected 
/usr/ports/devel/premake4.4/work/premake-4.4-beta5/bin/debug/premake4 
but was 
/usr/ports/devel/premake4.4/work/premake-4.4-beta5/bin/release/premake4
running time : 1.9140625
713 tests passed, 3 failed
Done.

Once I installed premake I observed that it generated Makefile with gcc 
in it, instead of clang. Should switch to clang be applied at premake or 
Box2D project level?


Thanks
-------------- next part --------------
diff -Naur premake4/Makefile premake4.4/Makefile
--- premake4/Makefile	2014-01-24 16:41:42.000000000 -0800
+++ premake4.4/Makefile	2014-06-23 23:33:07.000000000 -0700
@@ -2,10 +2,11 @@
 # $FreeBSD: head/devel/premake4/Makefile 340969 2014-01-25 00:41:42Z bapt $
 
 PORTNAME=	premake4
-PORTVERSION=	4.3
+PORTVERSION=	4.4
+BETAVERSION=    -beta5
 CATEGORIES=	devel
 MASTER_SITES=	SF/premake/Premake/${PORTVERSION}
-DISTNAME=	premake-${PORTVERSION}-src
+DISTNAME=	premake-${PORTVERSION}${BETAVERSION}-src
 EXTRACT_SUFX=	.zip
 
 MAINTAINER=	vmagerya at gmail.com
@@ -13,7 +14,7 @@
 
 OPTIONS_DEFINE=	DOCS
 
-WRKSRC=		${WRKDIR}/premake-${PORTVERSION}
+WRKSRC=		${WRKDIR}/premake-${PORTVERSION}${BETAVERSION}
 BUILD_WRKSRC=	${WRKSRC}/build/gmake.unix
 
 USES=		gmake
@@ -24,7 +25,7 @@
 PORTDOCS=	CHANGES.txt LICENSE.txt README.txt
 
 post-patch:
-	${REINPLACE_CMD} -e 's|-ldl||' ${BUILD_WRKSRC}/Premake4.make
+	${REINPLACE_CMD} -e 's|-ldl||' -e 's|CC = gcc|CC = clang|' -e 's|CXX = g\+\+|CXX = clang++|' ${BUILD_WRKSRC}/Premake4.make
 	${REINPLACE_CMD} -e 's|debug|release|' ${WRKSRC}/tests/test
 
 do-install:
diff -Naur premake4/distinfo premake4.4/distinfo
--- premake4/distinfo	2014-01-22 07:30:13.000000000 -0800
+++ premake4.4/distinfo	2014-06-23 22:01:46.000000000 -0700
@@ -1,2 +1,2 @@
-SHA256 (premake-4.3-src.zip) = 36536490f8928d8ecde135da80cd8b751ea5bebe50cabba5c0de49cd41cb2780
-SIZE (premake-4.3-src.zip) = 514366
+SHA256 (premake-4.4-beta5-src.zip) = 0fa1ed02c5229d931e87995123cdb11d44fcc8bd99bba8e8bb1bbc0aaa798161
+SIZE (premake-4.4-beta5-src.zip) = 596883
diff -Naur premake4/files/patch-src-base-os.lua premake4.4/files/patch-src-base-os.lua
--- premake4/files/patch-src-base-os.lua	2014-01-22 09:40:44.000000000 -0800
+++ premake4.4/files/patch-src-base-os.lua	1969-12-31 16:00:00.000000000 -0800
@@ -1,17 +0,0 @@
---- src/base/os.lua.orig	2012-01-31 15:40:25.000000000 +0200
-+++ src/base/os.lua	2012-01-31 15:42:16.000000000 +0200
-@@ -33,14 +33,6 @@
- 			else
- 				formats = { "lib%s.so", "%s.so" }
- 				path = os.getenv("LD_LIBRARY_PATH") or ""
--	
--				io.input("/etc/ld.so.conf")
--				if io.input() then
--					for line in io.lines() do
--						path = path .. ":" .. line
--					end
--					io.input():close()
--				end
- 			end
- 			
- 			table.insert(formats, "%s")	
diff -Naur premake4/files/patch-src-host-scripts.c premake4.4/files/patch-src-host-scripts.c
--- premake4/files/patch-src-host-scripts.c	2014-01-22 09:40:44.000000000 -0800
+++ premake4.4/files/patch-src-host-scripts.c	1969-12-31 16:00:00.000000000 -0800
@@ -1,5 +0,0 @@
---- src/host/scripts.c.orig	2010-11-16 13:29:13.000000000 +0200
-+++ src/host/scripts.c	2012-01-31 16:05:26.000000000 +0200
-@@ -7 +7 @@
--	"function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\npath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nio.input(\"/etc/ld.so.conf\")\nif io.input() then\nfor line in io.lines() do\npath = path .. \":\" .. line\nend\nio.input():close()\nend\nend\ntable.insert(formats, \"%s\")\npath = (path or \"\") .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal function domatch(result, mask, wantfiles)\nif mas"
-+	"function os.executef(cmd, ...)\ncmd = string.format(cmd, unpack(arg))\nreturn os.execute(cmd)\nend\nfunction os.findlib(libname)\nlocal path, formats\nif os.is(\"windows\") then\nformats = { \"%s.dll\", \"%s\" }\npath = os.getenv(\"PATH\")\nelse\nif os.is(\"macosx\") then\nformats = { \"lib%s.dylib\", \"%s.dylib\" }\npath = os.getenv(\"DYLD_LIBRARY_PATH\")\nelse\nformats = { \"lib%s.so\", \"%s.so\" }\npath = os.getenv(\"LD_LIBRARY_PATH\") or \"\"\nend\ntable.insert(formats, \"%s\")\npath = (path or \"\") .. \":/lib:/usr/lib:/usr/local/lib\"\nend\nfor _, fmt in ipairs(formats) do\nlocal name = string.format(fmt, libname)\nlocal result = os.pathsearch(name, path)\nif result then return result end\nend\nend\nfunction os.get()\nreturn _OPTIONS.os or _OS\nend\nfunction os.is(id)\nreturn (os.get():lower() == id:lower())\nend\nlocal function domatch(result, mask, wantfiles)\nif mas"


More information about the freebsd-ports mailing list