aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lang/hiphop-php/Makefile21
-rw-r--r--lang/hiphop-php/files/patch-hphp-runtime-vm-repo.cpp11
-rw-r--r--lang/hiphop-php/files/patch-hphp-util-embedded_data.cpp78
-rw-r--r--lang/hiphop-php/files/patch-hphp-util-generate_buildinfo.sh11
-rw-r--r--lang/hiphop-php/pkg-plist15
5 files changed, 112 insertions, 24 deletions
diff --git a/lang/hiphop-php/Makefile b/lang/hiphop-php/Makefile
index 07671f924841..59cee3834158 100644
--- a/lang/hiphop-php/Makefile
+++ b/lang/hiphop-php/Makefile
@@ -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/icu \
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/bison \
${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}:main \
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>
diff --git a/lang/hiphop-php/files/patch-hphp-runtime-vm-repo.cpp b/lang/hiphop-php/files/patch-hphp-runtime-vm-repo.cpp
new file mode 100644
index 000000000000..b8b14698e339
--- /dev/null
+++ b/lang/hiphop-php/files/patch-hphp-runtime-vm-repo.cpp
@@ -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();
+ }
+
diff --git a/lang/hiphop-php/files/patch-hphp-util-embedded_data.cpp b/lang/hiphop-php/files/patch-hphp-util-embedded_data.cpp
new file mode 100644
index 000000000000..0671bc9144ce
--- /dev/null
+++ b/lang/hiphop-php/files/patch-hphp-util-embedded_data.cpp
@@ -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;
diff --git a/lang/hiphop-php/files/patch-hphp-util-generate_buildinfo.sh b/lang/hiphop-php/files/patch-hphp-util-generate_buildinfo.sh
new file mode 100644
index 000000000000..e33edae4cf5f
--- /dev/null
+++ b/lang/hiphop-php/files/patch-hphp-util-generate_buildinfo.sh
@@ -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
+
diff --git a/lang/hiphop-php/pkg-plist b/lang/hiphop-php/pkg-plist
deleted file mode 100644
index fdf2492b203d..000000000000
--- a/lang/hiphop-php/pkg-plist
+++ /dev/null
@@ -1,15 +0,0 @@
-bin/hhvm
-%%DATADIR%%/bin/libafdt.a
-%%DATADIR%%/bin/libdouble-conversion.a
-%%DATADIR%%/bin/libext_hhvm.a
-%%DATADIR%%/bin/libfolly.a
-%%DATADIR%%/bin/libhphp_analysis.a
-%%DATADIR%%/bin/libhphp_runtime.a
-%%DATADIR%%/bin/libhphp_system.a
-%%DATADIR%%/bin/liblz4.a
-%%DATADIR%%/bin/libmbfl.a
-%%DATADIR%%/bin/libsqlite3.a
-%%DATADIR%%/bin/libtimelib.a
-%%DATADIR%%/bin/systemlib.php
-@dirrmtry %%DATADIR%%/bin
-@dirrmtry %%DATADIR%%