diff --git a/.abf.yml b/.abf.yml index cd23334..3abb2f2 100644 --- a/.abf.yml +++ b/.abf.yml @@ -1,2 +1,3 @@ sources: android-tools-31.0.0p1.tar.xz: 73a90d7abf19882ca86dfc8d1c3564caeea0f17c + android-tools-34.0.0.tar.xz: f4e5e3f75cec14688e1621e18c22d7ceec05ba3f diff --git a/android-tools.spec b/android-tools.spec index c8dfb2d..c0eb182 100644 --- a/android-tools.spec +++ b/android-tools.spec @@ -1,34 +1,47 @@ +%global optflags %(echo %{optflags} | sed -e 's/-ffat-lto-objects//g' -e 's/-fvar-tracking-assignments//g' -e 's/--compress-debug-sections//g' -e 's/-Wa,//g' -e 's/-flto//g' ) +%define llvm_prefix /opt/llvm15 + Summary: Android platform tools (adb, fastboot, mkbootimg) Name: android-tools -Version: 31.0.0p1 +Version: 34.0.0 Release: 1 License: Apache Software License and BSD Group: Development/Tools -Url: https://github.com/nmeum/android-tools -Source0: https://github.com/nmeum/android-tools/releases/download/%{version}/%{name}-%{version}.tar.xz +URL: https://github.com/nmeum/android-tools +Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz +Source4: https://abf.io/import/libreoffice/raw/rosa2016.1/loffice-libcxx-wrapper.sh Source5: 51-android.rules Source6: adb.service + # From Fedora Patch0: android-tools-31.0.0-system-golang-x-crypto.patch # Fix for GCC 11 (P1,P2,P3) -Patch1: 0001-Fix-mismatch-between-header-and-implementation-of-bn_sqr_comba8.patch -Patch2: 0002-Use-an-unsized-helper-for-truncated-SHA-512-variants.patch -Patch3: android-tools-31.0.0-disable-Werror-with-gcc11.patch +#Patch1: 0001-Fix-mismatch-between-header-and-implementation-of-bn_sqr_comba8.patch +#Patch2: 0002-Use-an-unsized-helper-for-truncated-SHA-512-variants.patch +#Patch3: android-tools-31.0.0-disable-Werror-with-gcc11.patch BuildRequires: cmake BuildRequires: go -BuildRequires: golang-x-crypto-devel +BuildRequires: clang +BuildRequires: llvm15 +BuildRequires: e2fsprogs +#BuildRequires: golang-x-crypto-devel +#BuildRequires: kernel-devel BuildRequires: pkgconfig(bash-completion) BuildRequires: pkgconfig(gtest) BuildRequires: pkgconfig(libbrotlidec) BuildRequires: pkgconfig(libbrotlienc) +BuildRequires: pkgconfig(libbrotlicommon) BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(libpcre2-8) BuildRequires: pkgconfig(libunwind-generic) BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(libzstd) -BuildRequires: pkgconfig(openssl) +#BuildRequires: pkgconfig(openssl) +BuildRequires: openssl-devel BuildRequires: pkgconfig(protobuf) BuildRequires: pkgconfig(zlib) +BuildRequires: stdc++-gcc10-devel +BuildRequires: ninja Provides: adb = %{EVRD} Provides: fastboot = %{EVRD} Provides: mkbootimg = %{EVRD} @@ -86,15 +99,68 @@ For Rosa Fresh you must use the following commands: #---------------------------------------------------------------------------- %prep -%autosetup -p1 +%setup -q sed -i -e '1s/python$/python3/' vendor/mkbootimg/mkbootimg.py +sed -i '/CMAKE_CXX_STANDARD/s/20/17/' vendor/CMakeLists.txt + %build +install -m0755 %{SOURCE4} $RPM_BUILD_DIR/%{name}-%{version} +sed 's/clang++/clang/' loffice-libcxx-wrapper.sh > loffice-libc-wrapper.sh +chmod +x loffice-libc-wrapper.sh + +#clang_gcc_wrapper + +export CC=%{llvm_prefix}/bin/clang +export CXX=%{llvm_prefix}/bin/clang++ +export AR=%{llvm_prefix}/bin/llvm-ar +export NM=%{llvm_prefix}/bin/llvm-nm + +export READELF=readelf + +#export CXX_STANDARD=17 + +export LDFLAGS="-lstdc++-gcc10" + + +echo $LDFLAGS +echo $optflags +echo $CFLAGS +echo $CXXFLAGS + + +#export CFLAGS="`echo %{optflags} | sed -e 's/-gdwarf-4//' -e 's/-fvar-tracking-assignments//' -e 's/-frecord-gcc-switches//' -e 's/-flto//g' -e 's/-std=gnu11//g'`" +#export CXXFLAGS="$CFLAGS" + +#cmake \ +# -DCMAKE_CXX_COMPILER:FILEPATH="$RPM_BUILD_DIR/%{name}-%{version}/loffice-libcxx-wrapper.sh" \ +# -DCMAKE_C_COMPILER:FILEPATH="$RPM_BUILD_DIR/%{name}-%{version}/loffice-libc-wrapper.sh" \ +# -DCMAKE_BUILD_TYPE=Release \ +# -DCMAKE_CXX_FLAGS="-I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}" \ +# -DCMAKE_C_FLAGS="-I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}" \ +# -DCMAKE_EXE_LINKER_FLAGS="-lstdc++-gcc10" \ +# -DCMAKE_MODULE_LINKER_FLAGS="-lstdc++-gcc10" \ +# -DCMAKE_SHARED_LINKER_FLAGS="-lstdc++-gcc10" \ +# -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ +# -DCMAKE_INSTALL_LIBDIR="%{_lib}" \ +# -DBUILD_SHARED_LIBS=ON \ +# -DBUILD_STATIC_LIBS=OFF + %cmake \ - -DBUILD_SHARED_LIBS:BOOL=OFF \ - -DBUILD_STATIC_LIBS:BOOL=ON -%make + -G Ninja \ + -DCMAKE_INSTALL_PREFIX=%{prefix} \ + -DCMAKE_INSTALL_LIBDIR=%{lib} \ + -DCMAKE_BUILD_TYPE=None \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DBUILD_STATIC_LIBS:BOOL=OFF \ + -DCMAKE_CXX_STANDARD="17" \ + -DCMAKE_CXX_FLAGS="-std=c++1z -nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host} " \ + -DCMAKE_C_FLAGS="-Werror=implicit-function-declaration -nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}" + +cmake --build . + +#make %install %makeinstall_std -C build diff --git a/loffice-libcxx-wrapper.sh b/loffice-libcxx-wrapper.sh new file mode 100644 index 0000000..16814df --- /dev/null +++ b/loffice-libcxx-wrapper.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +linker_flags="$(echo "$@" | tr ' ' '\n' | grep '^\-l' | tr '\n' ' ')" + +/usr/bin/clang++ "$@" $LIBCCX_LIBS $linker_flags