commit cc77f2d4ac08b40665642e90c7eeafff55438034f446031f0ce4f7d686040ea2 Author: Martin Pluskal Date: Thu Sep 17 13:53:21 2020 +0000 Accepting request 835194 from home:mrostecki:branches:devel:kubic New Bazel version OBS-URL: https://build.opensuse.org/request/show/835194 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/bazel3.4?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-python-Always-use-python3.patch b/0001-python-Always-use-python3.patch new file mode 100644 index 0000000..583761d --- /dev/null +++ b/0001-python-Always-use-python3.patch @@ -0,0 +1,22 @@ +From c351a9d86f705ce14e5b5e1393a3c46331f3920d Mon Sep 17 00:00:00 2001 +From: Michal Rostecki +Date: Mon, 20 Apr 2020 11:15:39 +0200 +Subject: [PATCH] python: Always use python3 + +--- + .../build/lib/bazel/rules/python/BazelPythonSemantics.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: bazel3.4-3.4.1/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java +=================================================================== +--- bazel3.4-3.4.1.orig/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java ++++ bazel3.4-3.4.1/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java +@@ -247,7 +247,7 @@ public class BazelPythonSemantics implem + PathFragment shExecutable = ShToolchain.getPathOrError(ruleContext); + // TODO(#8685): Remove this special-case handling as part of making the proper shebang a + // property of the Python toolchain configuration. +- String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python"; ++ String pythonExecutableName = "python3"; + // NOTE: keep the following line intact to support nix builds + String pythonShebang = "#!/usr/bin/env " + pythonExecutableName; + ruleContext.registerAction( diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..9fb5343 --- /dev/null +++ b/_constraints @@ -0,0 +1,10 @@ + + + + 4 + + + 4 + + + diff --git a/bazel-3.4.1-dist.zip b/bazel-3.4.1-dist.zip new file mode 100644 index 0000000..0dab24b --- /dev/null +++ b/bazel-3.4.1-dist.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27af1f11c8f23436915925b25cf6e1fb07fccf2d2a193a307c93437c60f63ba8 +size 303411732 diff --git a/bazel-3.4.1-dist.zip.sig b/bazel-3.4.1-dist.zip.sig new file mode 100644 index 0000000..8860bed Binary files /dev/null and b/bazel-3.4.1-dist.zip.sig differ diff --git a/bazel3.4.changes b/bazel3.4.changes new file mode 100644 index 0000000..0389185 --- /dev/null +++ b/bazel3.4.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Fri Jul 31 13:52:30 UTC 2020 - MichaƂ Rostecki + +- Initial release diff --git a/bazel3.4.spec b/bazel3.4.spec new file mode 100644 index 0000000..1486e61 --- /dev/null +++ b/bazel3.4.spec @@ -0,0 +1,132 @@ +# +# spec file for package bazel3.0 +# +# Copyright (c) 2020 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define bashcompdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null) +%define shortname bazel +%define shortver 3.4 + +#Workaround for s390x (Java 1.8 runs out of memory) +%ifarch s390x +%if 0%{?suse_version} > 1500 +%define openjdktouse java-12-openjdk-devel +%else +%define openjdktouse java-11-openjdk-devel +%endif +%else +%define openjdktouse java-1_8_0-openjdk-devel +%endif + +Name: bazel%{shortver} +Version: 3.4.1 +Release: 0 +Summary: Tool for the automation of building and testing of software +License: Apache-2.0 +Group: Development/Tools/Building +URL: http://bazel.io/ +Source0: https://github.com/bazelbuild/bazel/releases/download/%{version}/%{shortname}-%{version}-dist.zip +Source1: https://github.com/bazelbuild/bazel/releases/download/%{version}/%{shortname}-%{version}-dist.zip.sig +Patch0: 0001-python-Always-use-python3.patch +BuildRequires: gcc-c++ +BuildRequires: java-1_8_0-openjdk-devel +BuildRequires: pkgconfig +BuildRequires: python3 +BuildRequires: unzip +BuildRequires: zip +BuildRequires: pkgconfig(bash-completion) +BuildRequires: pkgconfig(zlib) +Requires(post): update-alternatives +Requires(postun): update-alternatives +Requires: %{openjdktouse} +Provides: bazel = %{version} +ExcludeArch: %ix86 + +%description +Tool for the automation of building and testing of software. It supports Java, +C++ and Go as programing languages. It also has a support for Android and iOS +as mobile operating systems. + +%prep +%setup -q -c +%patch0 -p1 +# Remove executable permissions +chmod 0644 AUTHORS CHANGELOG.md CONTRIBUTORS LICENSE +# Use Python 3 +find . -type f \( -name "*.py" -o -name "*.txt" \) -exec sed -i 's|#!.*python.*|#!/usr/bin/python3|' "{}" + +find . -type f -name "*.java" -exec sed -i 's|#!/usr/bin/env python|#!/usr/bin/python3|' "{}" + +# Fix collision between grpc's gettid and glibc's gettid +#grep -R "env python" . +find third_party/grpc -type f -name "*.cc" -exec sed -i -e 's|gettid(|my_gettid(|g' {} + + +%build +%ifarch aarch64 %arm +export BAZEL_JAVAC_OPTS="-J-Xmx2g -J-Xms200m" +%endif +%ifarch s390x +export BAZEL_JAVAC_OPTS="-J-Xmx4g -J-Xms1g" +%endif +CC=gcc +CXX=g++ +EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" ./compile.sh +./scripts/generate_bash_completion.sh \ + --bazel=output/bazel \ + --output=output/bazel-complete.bash \ + --prepend=scripts/bazel-complete-header.bash \ + --prepend=scripts/bazel-complete-template.bash +./output/bazel shutdown + +%install +export NO_BRP_STRIP_DEBUG=true +export NO_DEBUGINFO_STRIP_DEBUG=true +%define __debug_install_post %{nil} +: >debugfiles.list +: >debugsources.list +: >debugsourcefiles.list + +install -Dm0755 output/bazel %{buildroot}%{_bindir}/bazel%{shortver} +install -Dm0644 output/bazel-complete.bash %{buildroot}%{_datadir}/%{name}/bazel-complete.bash + +# update-alternatives +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +ln -sf %{_sysconfdir}/alternatives/bazel %{buildroot}%{_bindir}/bazel +mkdir -p %{buildroot}%{_datadir}/bash-completion/completions +ln -sf %{_sysconfdir}/alternatives/bazel-complete.bash %{buildroot}%{_datadir}/bash-completion/completions/bazel + +%post +update-alternatives \ + --install %{_bindir}/bazel bazel %{_bindir}/bazel%{shortver} 100 \ + --slave %{_datadir}/bash-completion/completions/bazel \ + bazel-complete.bash \ + %{_datadir}/%{name}/bazel-complete.bash + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove bazel %{_bindir}/bazel%{shortver} +fi + +%files +%doc AUTHORS CHANGELOG.md CONTRIBUTORS +%license LICENSE +%{_bindir}/bazel +%{_bindir}/bazel%{shortver} +%{_datadir}/bash-completion/completions/bazel +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/bazel-complete.bash +%ghost %{_sysconfdir}/alternatives/bazel +%ghost %{_sysconfdir}/alternatives/bazel-complete.bash + +%changelog