svn commit: r323496 - in head/lang/hiphop-php: . files

Martin Matuska mm at FreeBSD.org
Mon Jul 22 20:18:43 UTC 2013


Author: mm
Date: Mon Jul 22 20:18:42 2013
New Revision: 323496
URL: http://svnweb.freebsd.org/changeset/ports/323496

Log:
  Fix embedding of systemlib.php [1]
  Fix repository creation [1]
  Add docs, reduce dependencies
  
  Submitted by:	Vanilla Hsu [1]

Added:
  head/lang/hiphop-php/files/patch-hphp-runtime-vm-repo.cpp   (contents, props changed)
  head/lang/hiphop-php/files/patch-hphp-util-embedded_data.cpp   (contents, props changed)
  head/lang/hiphop-php/files/patch-hphp-util-generate_buildinfo.sh   (contents, props changed)
Deleted:
  head/lang/hiphop-php/pkg-plist
Modified:
  head/lang/hiphop-php/Makefile

Modified: head/lang/hiphop-php/Makefile
==============================================================================
--- head/lang/hiphop-php/Makefile	Mon Jul 22 19:16:07 2013	(r323495)
+++ head/lang/hiphop-php/Makefile	Mon Jul 22 20:18:42 2013	(r323496)
@@ -3,7 +3,7 @@
 
 PORTNAME=	hiphop-php
 PORTVERSION=	2.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	lang devel www
 MASTER_SITES=	https://github.com/facebook/hiphop-php/archive/:main \
 		http://unicode.org/Public/UNIDATA/:unidata \
@@ -46,7 +46,8 @@ LIB_DEPENDS=	icudata:${PORTSDIR}/devel/i
 		unwind:${PORTSDIR}/devel/libunwind \
 		glog:${PORTSDIR}/devel/glog
 
-OPTIONS_DEFINE=	DEBUG
+OPTIONS_DEFINE=		DEBUG DOCS
+OPTIONS_DEFAULT=	DOCS
 
 ONLY_FOR_ARCHS=		amd64
 ONLY_FOR_ARCHS_REASON=	This program is developed for amd64 only
@@ -61,10 +62,6 @@ BUILD_DEPENDS+=	bison:${PORTSDIR}/devel/
 		${LOCALBASE}/${_EXTDIR}/lib/libcurl.a:${PORTSDIR}/ftp/curl-hiphop \
 		${LOCALBASE}/lib/libdwarf.a:${PORTSDIR}/devel/libdwarf
 
-RUN_DEPENDS+=	${LOCALBASE}/${_EXTDIR}/lib/libevent.a:${PORTSDIR}/devel/libevent-hiphop \
-		${LOCALBASE}/${_EXTDIR}/lib/libcurl.a:${PORTSDIR}/ftp/curl-hiphop \
-		${LOCALBASE}/lib/libdwarf.a:${PORTSDIR}/devel/libdwarf
-
 WRKSRC=		${WRKDIR}/${PORTNAME}-HPHP-${PORTVERSION}
 
 GNU_CONFIGURE=	yes
@@ -100,6 +97,9 @@ DISTFILES+=	${DISTNAME}${EXTRACT_SUFX}:m
 		8859-15.TXT:mappings \
 		8859-16.TXT:mappings
 
+PLIST_FILES=	bin/hhvm
+PORTDOCS=	*
+
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MDEBUG}
@@ -142,11 +142,14 @@ post-patch:
 	@${REINPLACE_CMD} -e 's|%%CFLAGS%%|${_CFLAGS}|g' \
 		-e 's|%%CXXFLAGS%%|${_CXXFLAGS}|g' \
 		${WRKSRC}/CMake/HPHPSetup.cmake
+	@${REINPLACE_CMD} -e 's|../src/hhvm/hhvm|hhvm|g' \
+		${WRKSRC}/hphp/doc/Makefile
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/hphp/hhvm/hhvm ${LOCALBASE}/bin/
-	${MKDIR} ${DATADIR}/bin
-	${INSTALL_DATA} ${WRKSRC}/bin/systemlib.php ${DATADIR}/bin/
-	${CP} ${WRKSRC}/bin/*.a ${DATADIR}/bin/
+.if ${PORT_OPTIONS:MDOCS}
+	${MKDIR} ${DOCSDIR}
+	${CP} -rf ${WRKSRC}/hphp/doc/ ${DOCSDIR}/
+.endif
 
 .include <bsd.port.post.mk>

Added: head/lang/hiphop-php/files/patch-hphp-runtime-vm-repo.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/hiphop-php/files/patch-hphp-runtime-vm-repo.cpp	Mon Jul 22 20:18:42 2013	(r323496)
@@ -0,0 +1,11 @@
+--- hphp/runtime/vm/repo.cpp.orig	2013-07-22 20:34:07.689418184 +0200
++++ hphp/runtime/vm/repo.cpp	2013-07-22 20:34:29.924423584 +0200
+@@ -216,7 +216,7 @@
+ 
+ std::string Repo::table(int repoId, const char* tablePrefix) {
+   std::stringstream ss;
+-  ss << dbName(repoId) << "." << tablePrefix << "_" << kRepoSchemaId;
++  ss << dbName(repoId) << "_" << tablePrefix << "_" << kRepoSchemaId;
+   return ss.str();
+ }
+ 

Added: head/lang/hiphop-php/files/patch-hphp-util-embedded_data.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/hiphop-php/files/patch-hphp-util-embedded_data.cpp	Mon Jul 22 20:18:42 2013	(r323496)
@@ -0,0 +1,78 @@
+--- hphp/util/embedded_data.cpp.orig	2013-07-22 20:35:04.724464109 +0200
++++ hphp/util/embedded_data.cpp	2013-07-22 20:44:41.416725106 +0200
+@@ -27,12 +27,43 @@
+ #include <string.h>
+ #include <unistd.h>
+ 
++#ifdef __FreeBSD__
++#include <limits.h>
++#include <sys/sysctl.h>
++#endif
++
+ #ifdef __APPLE__
+ #include <mach-o/getsect.h>
+ #endif
+ 
+ namespace HPHP { namespace Util {
+ 
++#ifdef __FreeBSD__
++static int
++_get_exepath(char *buffer, size_t *size) {
++  int mib[4];
++  size_t cb;
++
++  if (!buffer || !size) {
++    return (-1);
++  }
++
++  mib[0] = CTL_KERN;
++  mib[1] = KERN_PROC;
++  mib[2] = KERN_PROC_PATHNAME;
++  mib[3] = -1;
++
++  cb = *size;
++  if (sysctl(mib, 4, buffer,  &cb, NULL, 0) < 0) {
++    *size = 0;
++    return (-1);
++  }
++  *size = strlen(buffer);
++
++  return(0);
++}
++#endif
++
+ bool get_embedded_data(const char *section, embedded_data* desc) {
+ #ifndef __APPLE__
+   GElf_Shdr shdr;
+@@ -42,7 +73,19 @@
+ 
+   if (elf_version(EV_CURRENT) == EV_NONE) return false;
+ 
++#ifdef __FreeBSD__
++  char exepath[PATH_MAX];
++  size_t exesize;
++
++  exesize = sizeof(exepath);
++  if (_get_exepath(exepath, &exesize) != 0) return false;
++
++  if (exesize < 1) return false;
++
++  int fd = open(exepath, O_RDONLY, 0);
++#else
+   int fd = open("/proc/self/exe", O_RDONLY, 0);
++#endif
+   if (fd < 0) return false;
+   SCOPE_EXIT { close(fd); };
+ 
+@@ -67,7 +110,11 @@
+     if (!strcmp(section, name)) {
+       GElf_Shdr ghdr;
+       if (gelf_getshdr(scn, &ghdr) != &ghdr) return false;
++#ifdef __FreeBSD__
++      desc->m_filename = exepath;
++#else
+       desc->m_filename = "/proc/self/exe";
++#endif
+       desc->m_start = ghdr.sh_offset;
+       desc->m_len = ghdr.sh_size;
+       return true;

Added: head/lang/hiphop-php/files/patch-hphp-util-generate_buildinfo.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/hiphop-php/files/patch-hphp-util-generate_buildinfo.sh	Mon Jul 22 20:18:42 2013	(r323496)
@@ -0,0 +1,11 @@
+--- hphp/util/generate_buildinfo.sh.orig	2013-07-22 20:32:44.836745592 +0200
++++ hphp/util/generate_buildinfo.sh	2013-07-22 20:33:07.435450744 +0200
+@@ -74,7 +74,7 @@
+     # As with COMPILER_ID above, we're not in git so we have to
+     # use a fallback state where we assume to repo is constantly
+     # changing by using the system time
+-    HHVM_REPO_SCHEMA=$(date +%N.%s)
++    HHVM_REPO_SCHEMA=$(date +%N_%s)
+   fi
+ fi
+ 


More information about the svn-ports-all mailing list