Compare commits

...

5 Commits

Author SHA1 Message Date
David Abdurachmanov c549272365
Merge remote-tracking branch 'up/main' into main-riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-01-11 11:13:30 +02:00
Yaakov Selkowitz ccf085c1ac Add zlib-ng-compat-static to replace zlib-static 2024-01-09 14:58:15 -05:00
Tulio Magno Quites Machado Filho 05f17dd963 Update to zlib-ng 2.1.5 2023-12-22 12:19:42 -03:00
Tulio Magno Quites Machado Filho 5e4a09ffbf Enable gating tests
Ensure the Fedora zlib-ng tests will be executed when packages are
pushed to testing or stable.
2023-12-20 18:57:12 -03:00
Jacek Szafarkiewicz 245d095d95 Add support for compat mode
Build zlib-ng twice in order to distribute the compat sub-packages that
can fully replace zlib (zlib-ng-compat and zlib-ng-compat-devel).

Run ABI tests provided by upstream during %check.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
2023-12-20 15:21:43 -03:00
6 changed files with 217 additions and 16 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

12
far.diff Normal file
View File

@ -0,0 +1,12 @@
diff --git a/zconf.h.in b/zconf.h.in
index 074f0255..e7183db3 100644
--- a/zconf.h.in
+++ b/zconf.h.in
@@ -200,4 +200,7 @@ typedef PTRDIFF_TYPE ptrdiff_t;
typedef size_t z_size_t;
+/* Some packages depend on FAR being defined, i.e. old versions of minizip. */
+#define FAR
+
#endif /* ZCONF_H */

10
gating.yaml Normal file
View File

@ -0,0 +1,10 @@
--- !Policy
product_versions:
- fedora-*
decision_contexts:
- bodhi_update_push_testing
- bodhi_update_push_stable
- bodhi_update_push_stable_critpath
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

7
plans/build-gating.fmf Normal file
View File

@ -0,0 +1,7 @@
summary: Fedora zlib-ng tests
discover:
- name: fedora
how: fmf
url: https://src.fedoraproject.org/tests/zlib-ng.git
execute:
how: tmt

View File

@ -1 +1 @@
SHA512 (zlib-ng-2.1.3.tar.gz) = cb987c0b20a11fca5361dce94e53dead7364e739a984545c38ad4bf0c7fedd83d5d62530d979eca2182da88d7507a9bec8d3f5abff41e92ab5a63ac61001502e
SHA512 (zlib-ng-2.1.5.tar.gz) = 9212d87c63a2da4e5355a7a1c75380aeba40fbd0ea3d71d3784cb3eac94237f9bea2a1b7993a08f39d4197725c4c133087d3a9d213d3944aa48a7559de2be920

View File

@ -1,18 +1,36 @@
%bcond_without compat
%bcond_without sanitizers
# Be explicit about the soname in order to avoid unintentional changes.
# Before modifying any of the sonames, this must be announced to the Fedora
# community as it may break many other packages.
# A change proposal is needed:
# https://docs.fedoraproject.org/en-US/program_management/changes_policy/
%global soname libz-ng.so.2
%global compat_soname libz.so.1
# Compatible with the following zlib version.
%global zlib_ver 1.3.0
# Obsoletes zlib versions less than.
%global zlib_obsoletes 1.3
# ABI files for ix86 and s390x are not available upstream.
%global supported_abi_test aarch64 ppc64le x86_64
Name: zlib-ng
Version: 2.1.3
Release: 2.1.riscv64%{?dist}
Version: 2.1.5
Release: 2.0.riscv64%{?dist}
Summary: Zlib replacement with optimizations
License: zlib
Url: https://github.com/zlib-ng/zlib-ng
Source0: https://github.com/zlib-ng/zlib-ng/archive/%{version}/%{name}-%{version}.tar.gz
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64 riscv64
Patch: far.diff
BuildRequires: cmake >= 3.1
BuildRequires: gcc-c++
BuildRequires: cmake(GTest)
BuildRequires: libabigail
%description
zlib-ng is a zlib replacement that provides optimizations for "next generation"
@ -23,28 +41,142 @@ Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains static libraries and header files for
developing application that use %{name}.
The %{name}-devel package contains libraries and header files for developing
application that use %{name}.
%if %{with compat}
%package compat
Summary: Zlib implementation provided by %{name}
Provides: zlib = %{zlib_ver}
Provides: zlib%{?_isa} = %{zlib_ver}
Conflicts: zlib%{?_isa}
Obsoletes: zlib < %{zlib_obsoletes}
%description compat
zlib-ng is a zlib replacement that provides optimizations for "next generation"
systems.
The %{name}-compat package contains the library that is API and binary
compatible with zlib.
%package compat-devel
Summary: Development files for %{name}-compat
Requires: %{name}-compat%{?_isa} = %{version}-%{release}
Provides: zlib-devel = %{zlib_ver}
Provides: zlib-devel%{?_isa} = %{zlib_ver}
Conflicts: zlib-devel%{?_isa}
Obsoletes: zlib-devel < %{zlib_obsoletes}
%description compat-devel
The %{name}-compat-devel package contains libraries and header files for
developing application that use zlib.
%package compat-static
Summary: Static libraries for %{name}-compat
Requires: %{name}-compat-devel%{?_isa} = %{version}-%{release}
Provides: zlib-static = %{zlib_ver}
Provides: zlib-static%{?_isa} = %{zlib_ver}
Conflicts: zlib-static%{?_isa}
Obsoletes: zlib-static < %{zlib_obsoletes}
%description compat-static
The %{name}-compat-static package contains static libraries needed for
developing applications that use zlib.
%endif
%prep
%autosetup -p1 -n %{name}-%{version}
%build
cat <<_EOF_
###########################################################################
#
# Build the default zlib-ng library
#
###########################################################################
_EOF_
# zlib-ng uses a different macro for library directory.
%cmake \
-DWITH_SANITIZERS=ON \
%ifarch riscv64
-DWITH_RVV=OFF \
%endif
-DINSTALL_LIB_DIR=%{_libdir}
%global cmake_param %{?with_sanitizers:-DWITH_SANITIZER=ON} -DINSTALL_LIB_DIR=%{_libdir} -DWITH_RVV=OFF
# Setting __cmake_builddir is not necessary in this step, but do it anyway for symmetry.
%global __cmake_builddir %{_vpath_builddir}
%cmake %{cmake_param}
%cmake_build
%if %{with compat}
cat <<_EOF_
###########################################################################
#
# Build the compat mode library
#
###########################################################################
_EOF_
%global __cmake_builddir %{_vpath_builddir}-compat
# defining BUILD_SHARED_LIBS disables the static library
%undefine _cmake_shared_libs
# Disable new strategies in order to keep compatibility with zlib.
%cmake %{cmake_param} -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF
%cmake_build
%endif
%check
cat <<_EOF_
###########################################################################
#
# Run the zlib-ng tests
#
###########################################################################
_EOF_
%global __cmake_builddir %{_vpath_builddir}
%ctest
%ifarch ppc64le
# Workaround Copr, that sets _target_cpu to ppc64le.
%global target_cpu powerpc64le
%else
%global target_cpu %{_target_cpu}
%endif
%ifarch x86_64
%global vendor pc
%else
%global vendor unknown
%endif
%ifarch %{supported_abi_test}
CHOST=%{target_cpu}-%{vendor}-linux-gnu sh test/abicheck.sh
%endif
%if %{with compat}
cat <<_EOF_
###########################################################################
#
# Run the compat mode tests
#
###########################################################################
_EOF_
%global __cmake_builddir %{_vpath_builddir}-compat
%ctest
%ifarch %{supported_abi_test}
CHOST=%{target_cpu}-%{vendor}-linux-gnu sh test/abicheck.sh --zlib-compat
%endif
%endif
%install
%global __cmake_builddir %{_vpath_builddir}
%cmake_install
%if %{with compat}
%global __cmake_builddir %{_vpath_builddir}-compat
%cmake_install
%endif
%files
%license LICENSE.md
%doc README.md
@ -58,13 +190,52 @@ developing application that use %{name}.
%{_libdir}/libz-ng.so
%{_libdir}/pkgconfig/%{name}.pc
%changelog
* Mon Nov 06 2023 David Abdurachmanov <davidlt@rivosinc.com> - 2.1.3-2.1.riscv64
- Disable RVV (Vector) on riscv64
%if %{with compat}
* Mon Nov 06 2023 David Abdurachmanov <davidlt@rivosinc.com> - 2.1.3-2.0.riscv64
%files compat
%{_libdir}/%{compat_soname}
%{_libdir}/libz.so.%{zlib_ver}.zlib-ng
%files compat-devel
%{_includedir}/zconf.h
%{_includedir}/zlib.h
%{_includedir}/zlib_name_mangling.h
%{_libdir}/libz.so
%{_libdir}/pkgconfig/zlib.pc
%files compat-static
%{_libdir}/libz.a
%endif
%changelog
* Thu Jan 11 2023 David Abdurachmanov <davidlt@rivosinc.com> - 2.1.5-1.1.riscv64
- Disable RVV (Vector) on riscv64
- Enable riscv64
* Tue Jan 09 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 2.1.5-2
- Add zlib-ng-compat-static to replace zlib-static
* Wed Dec 20 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.5-1
- Update to zlib-ng 2.1.5
* Wed Oct 18 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-7
- Improve the patch that defines the FAR macro
* Wed Sep 27 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-6
- Add a patch that defines the FAR macro
* Wed Sep 20 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-5
- Fix WITH_SANITIZER
* Tue Sep 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-4
- Disable WITH_NEW_STRATEGIES in compat mode
* Thu Aug 24 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-3
- Enable zlib compat build
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild