aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2019-10-31 15:10:46 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2019-10-31 15:10:46 +0000
commitd23d35ea8b649d4b815980cf81f5e9f00303f9e5 (patch)
tree80ba08cd38d1e179da68318c62742a656fa6470c
parent6702926386dd97f81413eb8219b4e345f753b323 (diff)
downloadports-d23d35ea8b649d4b815980cf81f5e9f00303f9e5.tar.gz
ports-d23d35ea8b649d4b815980cf81f5e9f00303f9e5.zip
science/py-tensorflow: Fix build by using the version of devel/bazel (0.29.0) that is known to be able to build it
One of the previous commits to devel/bazel broke tensorflow. Fun fact: the latest version of tensorflow-2.0.0 also fails to build with the latest version of bazel-1.1.0.
Notes
Notes: svn path=/head/; revision=516173
-rw-r--r--devel/Makefile1
-rw-r--r--devel/bazel029/Makefile88
-rw-r--r--devel/bazel029/distinfo3
-rw-r--r--devel/bazel029/files/extra-i386_tools_cpp_BUILD.static.freebsd16
-rw-r--r--devel/bazel029/files/patch-scripts_bootstrap_bootstrap.sh11
-rw-r--r--devel/bazel029/files/patch-scripts_bootstrap_buildenv.sh11
-rw-r--r--devel/bazel029/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt11
-rw-r--r--devel/bazel029/files/patch-src_tools_singlejar_port.h14
-rw-r--r--devel/bazel029/files/patch-third_party__BUILD11
-rw-r--r--devel/bazel029/files/patch-tools__jdk__default_java_toolchain.bzl37
-rw-r--r--devel/bazel029/pkg-descr7
-rw-r--r--devel/bazel029/pkg-plist2
-rw-r--r--science/py-tensorflow/Makefile3
13 files changed, 213 insertions, 2 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 9f8ff155160e..fcf8165c3389 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -213,6 +213,7 @@
SUBDIR += bashdb
SUBDIR += bats-core
SUBDIR += bazel
+ SUBDIR += bazel029
SUBDIR += bazel-buildtools
SUBDIR += bbfreeze
SUBDIR += bbfreeze-loader
diff --git a/devel/bazel029/Makefile b/devel/bazel029/Makefile
new file mode 100644
index 000000000000..5c4f6a2ed65d
--- /dev/null
+++ b/devel/bazel029/Makefile
@@ -0,0 +1,88 @@
+# Created by: Klaus Aehlig <aehlig@linta.de>
+# $FreeBSD$
+
+PORTNAME= bazel
+DISTVERSION= 0.29.0
+CATEGORIES= devel java
+MASTER_SITES= https://storage.googleapis.com/bazel/${PORTVERSION}/rc${FINALRC}/
+DISTNAME= bazel-${PORTVERSION}rc${FINALRC}-dist
+PKGNAMESUFFIX= 029
+
+MAINTAINER= aehlig@linta.de
+COMMENT= Fast and correct build system
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BROKEN_aarch64= fails to build: java.lang.OutOfMemoryError: Java heap space
+BROKEN_armv6= fails to package: cp: bazel: No such file or directory
+BROKEN_armv7= fails to package: cp: bazel: No such file or directory
+BROKEN_powerpc64= fails to compile: Action failed to execute: java.io.IOException: Cannot run program /usr/bin/clang
+
+BUILD_DEPENDS= bash:shells/bash \
+ zip:archivers/zip
+
+USES= python:3.3+ shebangfix zip:infozip
+
+# In bazel, a release is always code-wise identical to the final release candidate.
+# Hence we can also download that one and so have a simple way to also test earlier release
+# candidates.
+FINALRC= 8
+
+SHEBANG_REGEX= .*(sh|txt|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)
+USE_JAVA= yes
+JAVA_VENDOR= openjdk
+JAVA_VERSION= 1.8
+JAVA_BUILD= yes
+JAVA_RUN= yes
+
+NO_WRKSUBDIR= YES
+
+# The bazel binary is also a zip archive (extracted by the elf part), it must not be stripped
+STRIP=
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "i386"
+EXTRA_PATCHES+= ${FILESDIR}/extra-i386_tools_cpp_BUILD.static.freebsd
+.endif
+
+# Have the location of the system-wide rc file reside ${ETCDIR}.
+# Also adapt the sample file to disable persistent java workers as they
+# do not work reliably on FreeBSD.
+post-patch:
+ @${REINPLACE_CMD} \
+ -e "s|/etc/bazel.bazelrc|${ETCDIR}/bazel.bazelrc|" \
+ ${WRKSRC}/src/main/cpp/blaze_util_posix.cc \
+ ${WRKSRC}/src/main/cpp/BUILD
+ @${ECHO_CMD} build --strategy=Javac=standalone >> ${WRKSRC}/scripts/packages/bazel.bazelrc
+ @${ECHO_CMD} build --host_javabase=@local_jdk//:jdk >> ${WRKSRC}/scripts/packages/bazel.bazelrc
+ @${ECHO_CMD} build --action_env=PATH=/bin:/usr/bin/:${LOCALBASE}/bin >> ${WRKSRC}/scripts/packages/bazel.bazelrc
+ @${REINPLACE_CMD} \
+ -e 's|^\(PYTHON_BIN=.*\)|if [ "%VERSION%" = "3" ] ; then PYTHON_BIN=${PYTHON_CMD}; else \1 ; fi|' \
+ ${WRKSRC}/tools/python/pywrapper_template.txt
+ @${REINPLACE_CMD} \
+ -e 's|/usr/bin/env python|${PYTHON_CMD}|' \
+ ${WRKSRC}/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+
+do-build:
+ @${MKDIR} ${WRKDIR}/bazel_tmp
+ (if [ -z "$${SOURCE_DATE_EPOCH}" ] ; \
+ then SOURCE_DATE_EPOCH=`grep TIMESTAMP ${DISTINFO_FILE} \
+ | ${SED} -e 's/[^0-9]//g'`; \
+ fi ; \
+ cd ${WRKSRC} && \
+ ${SETENV} BAZEL_SH=${LOCALBASE}/bin/bash \
+ TMPDIR=${WRKDIR}/bazel_tmp \
+ EMBED_LABEL='${PORTVERSION}' \
+ PATH=${LOCALBASE}/bin:$$PATH \
+ SOURCE_DATE_EPOCH=$${SOURCE_DATE_EPOCH} \
+ EXTRA_BAZEL_ARGS=--host_javabase=@local_jdk//:jdk \
+ ${LOCALBASE}/bin/bash ./compile.sh)
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/output/bazel ${STAGEDIR}${PREFIX}/bin
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/scripts/packages/bazel.bazelrc ${STAGEDIR}${ETCDIR}/bazel.bazelrc.sample
+
+.include <bsd.port.post.mk>
diff --git a/devel/bazel029/distinfo b/devel/bazel029/distinfo
new file mode 100644
index 000000000000..d0bbc2873622
--- /dev/null
+++ b/devel/bazel029/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1566883509
+SHA256 (bazel-0.29.0rc8-dist.zip) = d812e6fb46540b42fa8546c381f44728d3a27fcd8029faec05a7f8d14cfc7aa1
+SIZE (bazel-0.29.0rc8-dist.zip) = 265744572
diff --git a/devel/bazel029/files/extra-i386_tools_cpp_BUILD.static.freebsd b/devel/bazel029/files/extra-i386_tools_cpp_BUILD.static.freebsd
new file mode 100644
index 000000000000..1c70d376e68a
--- /dev/null
+++ b/devel/bazel029/files/extra-i386_tools_cpp_BUILD.static.freebsd
@@ -0,0 +1,16 @@
+--- tools/cpp/BUILD.static.freebsd.orig 2019-07-10 15:47:44.533177000 +0000
++++ tools/cpp/BUILD.static.freebsd 2019-07-10 15:48:07.637126000 +0000
+@@ -62,11 +62,11 @@
+ toolchain(
+ name = "cc-toolchain-freebsd",
+ exec_compatible_with = [
+- "@platforms//cpu:x86_64",
++ "@platforms//cpu:x86_32",
+ "@platforms//os:freebsd",
+ ],
+ target_compatible_with = [
+- "@platforms//cpu:x86_64",
++ "@platforms//cpu:x86_32",
+ "@platforms//os:freebsd",
+ ],
+ toolchain = ":cc-compiler-freebsd",
diff --git a/devel/bazel029/files/patch-scripts_bootstrap_bootstrap.sh b/devel/bazel029/files/patch-scripts_bootstrap_bootstrap.sh
new file mode 100644
index 000000000000..2fe060abacc3
--- /dev/null
+++ b/devel/bazel029/files/patch-scripts_bootstrap_bootstrap.sh
@@ -0,0 +1,11 @@
+--- scripts/bootstrap/bootstrap.sh.orig 2019-08-06 08:04:56.534744000 +0000
++++ scripts/bootstrap/bootstrap.sh 2019-08-06 08:05:20.598434000 +0000
+@@ -35,7 +35,7 @@
+ --host_java_toolchain=//src/java_tools/buildjar:bootstrap_toolchain \
+ --spawn_strategy=standalone \
+ --nojava_header_compilation \
+- --strategy=Javac=worker --worker_quit_after_build --ignore_unsupported_sandboxing \
++ --strategy=Javac=standalone --ignore_unsupported_sandboxing --curses=no \
+ --compilation_mode=opt \
+ --distdir=derived/distdir \
+ ${EXTRA_BAZEL_ARGS:-}"
diff --git a/devel/bazel029/files/patch-scripts_bootstrap_buildenv.sh b/devel/bazel029/files/patch-scripts_bootstrap_buildenv.sh
new file mode 100644
index 000000000000..c1a1d5202b89
--- /dev/null
+++ b/devel/bazel029/files/patch-scripts_bootstrap_buildenv.sh
@@ -0,0 +1,11 @@
+--- scripts/bootstrap/buildenv.sh.orig 1979-12-31 23:00:00 UTC
++++ scripts/bootstrap/buildenv.sh
+@@ -215,7 +215,7 @@ function clear_log() {
+ rm -f ${phasefile}
+ }
+
+-LEAVES="\xF0\x9F\x8D\x83"
++LEAVES="[LEAVES]"
+ INFO="\033[32mINFO\033[0m:"
+ WARNING="\033[31mWARN\033[0m:"
+
diff --git a/devel/bazel029/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt b/devel/bazel029/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt
new file mode 100644
index 000000000000..513c8e5604ec
--- /dev/null
+++ b/devel/bazel029/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt
@@ -0,0 +1,11 @@
+--- src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt.orig 2017-07-25 04:58:01 UTC
++++ src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
+@@ -38,7 +38,7 @@ if IsWindows() and not PYTHON_BINARY.end
+
+ # Find a file in a given search path.
+ def SearchPath(name):
+- search_path = os.getenv('PATH', os.defpath).split(os.pathsep)
++ search_path = os.getenv('PATH', os.defpath + ":/usr/local/bin").split(os.pathsep)
+ for directory in search_path:
+ if directory == '': continue
+ path = os.path.join(directory, name)
diff --git a/devel/bazel029/files/patch-src_tools_singlejar_port.h b/devel/bazel029/files/patch-src_tools_singlejar_port.h
new file mode 100644
index 000000000000..2010e26857f6
--- /dev/null
+++ b/devel/bazel029/files/patch-src_tools_singlejar_port.h
@@ -0,0 +1,14 @@
+--- src/tools/singlejar/port.h.orig 2018-09-18 16:02:23.430634000 +0200
++++ src/tools/singlejar/port.h 2018-09-18 16:03:58.961047000 +0200
+@@ -28,6 +28,11 @@
+ #include <sys/types.h>
+ #include <time.h>
+
++#ifndef _OFF64_T_DECLARED
++typedef off_t off64_t;
++#define _OFF64_T_DECLARED
++#endif
++
+ #if defined(__APPLE__)
+ typedef off_t off64_t;
+ #elif defined(_WIN32)
diff --git a/devel/bazel029/files/patch-third_party__BUILD b/devel/bazel029/files/patch-third_party__BUILD
new file mode 100644
index 000000000000..1d19aae4fd01
--- /dev/null
+++ b/devel/bazel029/files/patch-third_party__BUILD
@@ -0,0 +1,11 @@
+--- third_party/BUILD.orig 2019-07-11 08:41:05.213918000 +0000
++++ third_party/BUILD 2019-07-11 08:41:40.502181000 +0000
+@@ -536,7 +536,7 @@
+ name = "filter_netty_dynamic_libs",
+ srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"],
+ outs = ["netty_tcnative/netty-tcnative-filtered.jar"],
+- cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES,
++ cmd = "cp $< $@ && (zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + " || : )",
+ )
+
+ java_import(
diff --git a/devel/bazel029/files/patch-tools__jdk__default_java_toolchain.bzl b/devel/bazel029/files/patch-tools__jdk__default_java_toolchain.bzl
new file mode 100644
index 000000000000..742616c05916
--- /dev/null
+++ b/devel/bazel029/files/patch-tools__jdk__default_java_toolchain.bzl
@@ -0,0 +1,37 @@
+--- tools/jdk/default_java_toolchain.bzl.orig 2019-08-06 08:09:07.930962000 +0000
++++ tools/jdk/default_java_toolchain.bzl 2019-08-06 08:16:15.674960000 +0000
+@@ -19,25 +19,6 @@
+ ]
+
+ JDK9_JVM_OPTS = [
+- # Allow JavaBuilder to access internal javac APIs.
+- "--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
+- "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
+- "--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
+- "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
+- "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
+- "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
+- "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
+- "--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
+-
+- # override the javac in the JDK.
+- "--patch-module=java.compiler=$(location @bazel_tools//tools/jdk:java_compiler_jar)",
+- "--patch-module=jdk.compiler=$(location @bazel_tools//tools/jdk:jdk_compiler_jar)",
+-
+- # quiet warnings from com.google.protobuf.UnsafeUtil,
+- # see: https://github.com/google/protobuf/issues/3781
+- # and: https://github.com/bazelbuild/bazel/issues/5599
+- "--add-opens=java.base/java.nio=ALL-UNNAMED",
+- "--add-opens=java.base/java.lang=ALL-UNNAMED",
+ ]
+
+ DEFAULT_JAVACOPTS = [
+@@ -70,7 +51,7 @@
+ "@bazel_tools//tools/jdk:jdk_compiler_jar",
+ ],
+ "javac_supports_workers": 1,
+- "jvm_opts": JDK9_JVM_OPTS,
++ "jvm_opts": JDK8_JVM_OPTS,
+ "misc": DEFAULT_JAVACOPTS,
+ "compatible_javacopts": COMPATIBLE_JAVACOPTS,
+ "singlejar": ["@bazel_tools//tools/jdk:singlejar"],
diff --git a/devel/bazel029/pkg-descr b/devel/bazel029/pkg-descr
new file mode 100644
index 000000000000..e8f993e2da3c
--- /dev/null
+++ b/devel/bazel029/pkg-descr
@@ -0,0 +1,7 @@
+Bazel is Google's own build tool, now publicly available in Beta.
+Bazel has built-in support for building both client and server
+software, including client applications for both Android and iOS
+platforms. It also provides an extensible framework that you can
+use to develop your own build rules.
+
+WWW: https://bazel.build/
diff --git a/devel/bazel029/pkg-plist b/devel/bazel029/pkg-plist
new file mode 100644
index 000000000000..d157c119f36f
--- /dev/null
+++ b/devel/bazel029/pkg-plist
@@ -0,0 +1,2 @@
+bin/bazel
+@sample %%ETCDIR%%/bazel.bazelrc.sample
diff --git a/science/py-tensorflow/Makefile b/science/py-tensorflow/Makefile
index 0786992eaccf..d2b595c54477 100644
--- a/science/py-tensorflow/Makefile
+++ b/science/py-tensorflow/Makefile
@@ -15,7 +15,6 @@ COMMENT= Computation using data flow graphs for scalable machine learning
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
-BROKEN= fails to build
ONLY_FOR_ARCHS= amd64
BUILD_DEPENDS= ${RUN_DEPENDS} \
@@ -23,7 +22,7 @@ BUILD_DEPENDS= ${RUN_DEPENDS} \
bash:shells/bash \
cython:lang/cython \
swig3.0:devel/swig30 \
- bazel:devel/bazel
+ bazel:devel/bazel029
LIB_DEPENDS= libsnappy.so:archivers/snappy \
liblmdb.so:databases/lmdb \
libsqlite3.so:databases/sqlite3 \