From 1a1d55604438887fd724523729334e196a1980af Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Mon, 12 Dec 2022 18:26:57 +0000 Subject: [PATCH 1/2] Make it build on el8 --- android-tools.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/android-tools.spec b/android-tools.spec index d4a5a52..f7a05f8 100644 --- a/android-tools.spec +++ b/android-tools.spec @@ -1,4 +1,9 @@ %global _hardened_build 1 +%if 0%{?el8} +# Required to avoid conflicts between installed files and existing directories +# with the same name in the source tree +%undefine __cmake_in_source_build +%endif Name: android-tools Version: 33.0.3p1 @@ -20,8 +25,15 @@ Patch0: Disable-e2fsdroid-for-ppc64le.patch BuildRequires: brotli-devel BuildRequires: cmake +%if 0%{?el8} +# Uses C++20 features so we need a newer GCC +BuildRequires: gcc-toolset-11-gcc-c++ +BuildRequires: gcc-toolset-11-annobin-plugin-gcc +BuildRequires: gcc-toolset-11-binutils +%else BuildRequires: gcc BuildRequires: gcc-c++ +%endif BuildRequires: gtest-devel BuildRequires: golang BuildRequires: golang(golang.org/x/crypto/chacha20) @@ -76,6 +88,9 @@ setup between the host and the target phone as adb. cp -p %{SOURCE1} 51-android.rules %build +%if 0%{?el8} +. /opt/rh/gcc-toolset-11/enable +%endif export GO111MODULE=off %cmake -DBUILD_SHARED_LIBS:BOOL=OFF %cmake_build From dd553ee2c43ff409b514505368b7b692b31dd4d3 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Fri, 23 Dec 2022 18:50:31 +0100 Subject: [PATCH 2/2] Drop adb bash completion on el8 to avoid conflict --- android-tools.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android-tools.spec b/android-tools.spec index f7a05f8..833f443 100644 --- a/android-tools.spec +++ b/android-tools.spec @@ -101,6 +101,11 @@ install -p -D -m 0644 %{SOURCE2} \ %{buildroot}%{_unitdir}/adb.service install -d -m 0775 ${RPM_BUILD_ROOT}%{_sharedstatedir}/adb +%if 0%{?el8} +# On el8 this is provided by the bash-completion package +rm %{buildroot}%{_datadir}/bash-completion/completions/adb +%endif + %post %systemd_post adb.service @@ -141,7 +146,9 @@ install -d -m 0775 ${RPM_BUILD_ROOT}%{_sharedstatedir}/adb %{_datadir}/android-tools/completions/fastboot %{_datadir}/android-tools/mkbootimg/gki/generate_gki_certificate.py %{_datadir}/android-tools/mkbootimg/mkbootimg.py +%if 0%{?fedora} || 0%{?rhel} > 8 %{_datadir}/bash-completion/completions/adb +%endif %{_datadir}/bash-completion/completions/fastboot %changelog