The package rpms/fbthrift.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/fbthrift.git/commit/?id=79f0c3bcc....
Change:
+%ifarch i686 x86_64
Thanks.
Full change:
============
commit 79f0c3bcc67bc48af93589df1da150da095ea552
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Wed Nov 4 10:35:46 2020 -0800
Enable static subpackage on architectures where fizz-static is available
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/fbthrift-2020.11.02.00-fix_static_build.patch
b/fbthrift-2020.11.02.00-fix_static_build.patch
new file mode 100644
index 0000000..41ec22a
--- /dev/null
+++ b/fbthrift-2020.11.02.00-fix_static_build.patch
@@ -0,0 +1,25 @@
+From 934da73ea8b3b491b6b79f6062c07586941d4f27 Mon Sep 17 00:00:00 2001
+From: Michel Alexandre Salim <michel(a)michel-slm.name>
+Date: Wed, 4 Nov 2020 10:05:57 -0800
+Subject: [PATCH] Fix static build
+
+Signed-off-by: Michel Alexandre Salim <michel(a)michel-slm.name>
+---
+ thrift/compiler/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/thrift/compiler/CMakeLists.txt b/thrift/compiler/CMakeLists.txt
+index c0e134cc6..a82ea06d0 100644
+--- a/thrift/compiler/CMakeLists.txt
++++ b/thrift/compiler/CMakeLists.txt
+@@ -145,7 +145,6 @@ add_executable(
+ compiler.cc
+ mutator/mutator.cc
+ validator/diagnostic.cc
+- validator/validator.cc
+ ast/visitor.cc
+ )
+ target_link_libraries(
+--
+2.28.0
+
diff --git a/fbthrift.spec b/fbthrift.spec
index 6a14c52..91a8a6a 100644
--- a/fbthrift.spec
+++ b/fbthrift.spec
@@ -1,15 +1,26 @@
+# Depends on fizz, which has linking issues on some platforms:
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1893332
+%ifarch i686 x86_64
+%bcond_without static
+%else
+%bcond_with static
+%endif
+
+%global _static_builddir static_build
+
Name: fbthrift
Version: 2020.11.02.00
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Facebook's branch of Apache Thrift, including a new C++ server
License: ASL 2.0
URL:
https://github.com/facebook/fbthrift
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: %{name}-%{version}-fix_undefined_symbols.patch
+Patch1: %{name}-%{version}-fix_static_build.patch
# Folly is known not to work on big-endian CPUs
-# will add bz# after review
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1894635
ExcludeArch: s390x
BuildRequires: cmake
@@ -22,6 +33,11 @@ BuildRequires: fizz-devel
BuildRequires: folly-devel
BuildRequires: python3-six
BuildRequires: wangle-devel
+%if %{with static}
+BuildRequires: fizz-static
+BuildRequires: folly-static
+BuildRequires: wangle-static
+%endif
%description
Thrift is a serialization and RPC framework for service communication. Thrift
@@ -47,11 +63,39 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
+%if %{with static}
+%package static
+Summary: Static development libraries for %{name}
+Requires: %{name}-devel%{?_isa} = %{version}-%{release}
+
+%description static
+The %{name}-static package contains static libraries for
+developing applications that use %{name}.
+%endif
+
+
%prep
%autosetup -p1
%build
+%if %{with static}
+# static build
+mkdir %{_static_builddir}
+pushd %{_static_builddir}
+%cmake .. \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name}-static \
+ -DPACKAGE_VERSION=%{version} \
+ -DFIZZ_ROOT=%{_libdir}/cmake/fizz-static \
+ -DFOLLY_ROOT=%{_libdir}/cmake/folly-static \
+ -DWANGLE_ROOT=%{_libdir}/cmake/wangle-static \
+ -Denable_tests=OFF
+%cmake_build
+popd
+
+%endif
+
%cmake \
-DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
-DCMAKE_SKIP_INSTALL_RPATH=TRUE \
@@ -61,7 +105,15 @@ developing applications that use %{name}.
%install
+%if %{with static}
+# static build
+pushd %{_static_builddir}
+%cmake_install
+popd
+%endif
+
%cmake_install
+
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
@@ -80,8 +132,17 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%{_libdir}/*.so
%{_libdir}/cmake/%{name}
+%if %{with static}
+%files static
+%{_libdir}/*.a
+%{_libdir}/cmake/%{name}-static
+%endif
+
%changelog
+* Wed Nov 4 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.11.02.00-2
+- Enable static subpackage on architectures where fizz-static is available
+
* Mon Nov 2 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.11.02.00-1
- Update to 2020.11.02.00
- Fix undefined symbol warnings