From 1c129ef5fe7a423f841b324d5bef9628bd10788e5c790bdd1da7d13d7cb97931 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 10 Jan 2025 11:08:36 +0000 Subject: [PATCH 1/2] - Build AVX2 enabled hwcaps library for x86_64-v3 OBS-URL: https://build.opensuse.org/package/show/network:cryptocurrencies/libff?expand=0&rev=9 --- .gitattributes | 23 ++++ .gitignore | 1 + 00_no_bn128.patch | 215 +++++++++++++++++++++++++++++ 01_shared_lib.patch | 52 +++++++ 02_config_hpp.patch | 326 ++++++++++++++++++++++++++++++++++++++++++++ baselibs.conf | 1 + libff-1.0.0.tar.gz | 3 + libff.changes | 41 ++++++ libff.spec | 83 +++++++++++ 9 files changed, 745 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 00_no_bn128.patch create mode 100644 01_shared_lib.patch create mode 100644 02_config_hpp.patch create mode 100644 baselibs.conf create mode 100644 libff-1.0.0.tar.gz create mode 100644 libff.changes create mode 100644 libff.spec 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/00_no_bn128.patch b/00_no_bn128.patch new file mode 100644 index 0000000..b319ae6 --- /dev/null +++ b/00_no_bn128.patch @@ -0,0 +1,215 @@ +From: Adam Mizerski +Date: 2019-02-12 20:48:31 +Upstream: no +References: https://github.com/scipr-lab/libff/issues/22 +Subject: disable BN128 + +BN128 uses internally bundled dependencies, which would require more work to +package properly. + +Index: libff-1.0.0/CMakeLists.txt +=================================================================== +--- libff-1.0.0.orig/CMakeLists.txt ++++ libff-1.0.0/CMakeLists.txt +@@ -9,10 +9,10 @@ endif() + + set( + CURVE +- "BN128" ++ "ALT_BN128" + CACHE + STRING +- "Default curve: one of ALT_BN128, BN128, EDWARDS, MNT4, MNT6" ++ "Default curve: one of ALT_BN128, EDWARDS, MNT4, MNT6" + ) + + option( +@@ -135,12 +135,6 @@ add_definitions( + + enable_testing() + +-if(${CURVE} STREQUAL "BN128") +- add_definitions( +- -DBN_SUPPORT_SNARK=1 +- ) +-endif() +- + if("${DEBUG}") + add_definitions(-DDEBUG=1) + endif() +@@ -226,7 +220,5 @@ if ("${IS_LIBFF_PARENT}") + COMMAND ${CMAKE_COMMAND} + -E echo 'Built target finished' + ) +- +- add_subdirectory(depends) + endif() + add_subdirectory(libff) +Index: libff-1.0.0/libff/CMakeLists.txt +=================================================================== +--- libff-1.0.0.orig/libff/CMakeLists.txt ++++ libff-1.0.0/libff/CMakeLists.txt +@@ -1,25 +1,3 @@ +-set(FF_EXTRASRCS) +-set(FF_EXTRALIBS) +-if(${CURVE} STREQUAL "BN128") +- set( +- FF_EXTRASRCS +- +- ${FF_EXTRASRCS} +- algebra/curves/bn128/bn128_g1.cpp +- algebra/curves/bn128/bn128_g2.cpp +- algebra/curves/bn128/bn128_gt.cpp +- algebra/curves/bn128/bn128_init.cpp +- algebra/curves/bn128/bn128_pairing.cpp +- algebra/curves/bn128/bn128_pp.cpp +- ) +- set( +- FF_EXTRALIBS +- +- ${FF_EXTRALIBS} +- zm +- ) +-endif() +- + add_library( + ff + STATIC +@@ -48,15 +26,12 @@ add_library( + common/double.cpp + common/profiling.cpp + common/utils.cpp +- +- ${FF_EXTRASRCS} + ) + target_link_libraries( + ff + + GMP::gmp + ${PROCPS_LIBRARIES} +- ${FF_EXTRALIBS} + ) + target_include_directories( + ff +@@ -131,19 +106,4 @@ if ("${IS_LIBFF_PARENT}") + add_dependencies(check algebra_bilinearity_test) + add_dependencies(check algebra_groups_test) + add_dependencies(check algebra_fields_test) +- +- add_executable( +- multiexp_profile +- EXCLUDE_FROM_ALL +- +- algebra/scalar_multiplication/multiexp_profile.cpp +- ) +- target_link_libraries( +- multiexp_profile +- +- ${OPENSSL_LIBRARIES} +- ff +- ) +- +- add_dependencies(profile multiexp_profile) + endif() +Index: libff-1.0.0/libff/algebra/curves/tests/test_bilinearity.cpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/tests/test_bilinearity.cpp ++++ libff-1.0.0/libff/algebra/curves/tests/test_bilinearity.cpp +@@ -6,9 +6,6 @@ + *****************************************************************************/ + #include + #include +-#ifdef CURVE_BN128 +-#include +-#endif + #include + #include + #include +@@ -128,12 +125,6 @@ int main(void) + alt_bn128_pp::init_public_params(); + pairing_test(); + double_miller_loop_test(); +- +-#ifdef CURVE_BN128 // BN128 has fancy dependencies so it may be disabled +- bn128_pp::init_public_params(); +- pairing_test(); +- double_miller_loop_test(); +-#endif + } + + #else // NDEBUG +Index: libff-1.0.0/libff/algebra/curves/tests/test_groups.cpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/tests/test_groups.cpp ++++ libff-1.0.0/libff/algebra/curves/tests/test_groups.cpp +@@ -8,9 +8,6 @@ + #include + #include + #include +-#ifdef CURVE_BN128 +-#include +-#endif + #include + + #include +@@ -166,14 +163,6 @@ int main(void) + test_group >(); + test_output >(); + test_mul_by_q >(); +- +-#ifdef CURVE_BN128 // BN128 has fancy dependencies so it may be disabled +- bn128_pp::init_public_params(); +- test_group >(); +- test_output >(); +- test_group >(); +- test_output >(); +-#endif + } + + #else // NDEBUG +Index: libff-1.0.0/libff/algebra/fields/tests/test_fields.cpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/fields/tests/test_fields.cpp ++++ libff-1.0.0/libff/algebra/fields/tests/test_fields.cpp +@@ -8,9 +8,6 @@ + #include + #include + #include +-#ifdef CURVE_BN128 +-#include +-#endif + #include + #include + #include +@@ -237,12 +234,6 @@ int main() + test_field(); + test_Frobenius(); + test_all_fields(); +- +-#ifdef CURVE_BN128 // BN128 has fancy dependencies so it may be disabled +- bn128_pp::init_public_params(); +- test_field >(); +- test_field >(); +-#endif + } + + #else // NDEBUG +Index: libff-1.0.0/libff/common/default_types/ec_pp.hpp +=================================================================== +--- libff-1.0.0.orig/libff/common/default_types/ec_pp.hpp ++++ libff-1.0.0/libff/common/default_types/ec_pp.hpp +@@ -23,14 +23,6 @@ typedef alt_bn128_pp default_ec_pp; + } // libff + #endif + +-#ifdef CURVE_BN128 +-#define LIBFF_DEFAULT_EC_PP_DEFINED +-#include +-namespace libff { +-typedef bn128_pp default_ec_pp; +-} // libff +-#endif +- + #ifdef CURVE_EDWARDS + #define LIBFF_DEFAULT_EC_PP_DEFINED + #include diff --git a/01_shared_lib.patch b/01_shared_lib.patch new file mode 100644 index 0000000..55dcda4 --- /dev/null +++ b/01_shared_lib.patch @@ -0,0 +1,52 @@ +From: Adam Mizerski +Date: 2019-02-12 20:48:31 +Upstream: no +Subject: build as shared library + +--- + libff/CMakeLists.txt | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +Index: libff-1.0.0/libff/CMakeLists.txt +=================================================================== +--- libff-1.0.0.orig/libff/CMakeLists.txt ++++ libff-1.0.0/libff/CMakeLists.txt +@@ -1,6 +1,6 @@ + add_library( + ff +- STATIC ++ SHARED + + algebra/curves/alt_bn128/alt_bn128_g1.cpp + algebra/curves/alt_bn128/alt_bn128_g2.cpp +@@ -27,6 +27,7 @@ add_library( + common/profiling.cpp + common/utils.cpp + ) ++set_target_properties(ff PROPERTIES OUTPUT_NAME ff-${PACKAGE_VERSION}) + target_link_libraries( + ff + +@@ -48,7 +49,7 @@ install( + ) + + install( +- TARGETS ff DESTINATION lib ++ TARGETS ff DESTINATION lib${LIB_SUFFIX} + ) + + # Tests +@@ -102,6 +103,13 @@ if ("${IS_LIBFF_PARENT}") + NAME algebra_fields_test + COMMAND algebra_fields_test + ) ++ set_tests_properties( ++ algebra_bilinearity_test ++ algebra_groups_test ++ algebra_fields_test ++ PROPERTIES ++ ENVIRONMENT LD_LIBRARY_PATH=. ++ ) + + add_dependencies(check algebra_bilinearity_test) + add_dependencies(check algebra_groups_test) diff --git a/02_config_hpp.patch b/02_config_hpp.patch new file mode 100644 index 0000000..f3361c6 --- /dev/null +++ b/02_config_hpp.patch @@ -0,0 +1,326 @@ +From: Adam Mizerski +Date: 2019-02-12 20:48:31 +Upstream: yes +References: https://github.com/scipr-lab/libff/issues/21 +Subject: add a configuration header + +Index: libff-1.0.0/CMakeLists.txt +=================================================================== +--- libff-1.0.0.orig/CMakeLists.txt ++++ libff-1.0.0/CMakeLists.txt +@@ -124,13 +124,14 @@ if("${WITH_PROCPS}") + libprocps + ) + else() ++ set(NO_PROCPS) + add_definitions( + -DNO_PROCPS + ) + endif() + + add_definitions( +- -DCURVE_${CURVE} ++ -DCURVE=${CURVE} + ) + + enable_testing() +@@ -156,6 +157,7 @@ if("${MONTGOMERY_OUTPUT}") + endif() + + if(NOT "${USE_PT_COMPRESSION}") ++ set(NO_PT_COMPRESSION) + add_definitions(-DNO_PT_COMPRESSION=1) + endif() + +Index: libff-1.0.0/libff/CMakeLists.txt +=================================================================== +--- libff-1.0.0.orig/libff/CMakeLists.txt ++++ libff-1.0.0/libff/CMakeLists.txt +@@ -1,3 +1,5 @@ ++configure_file(config.hpp.in config.hpp) ++ + add_library( + ff + SHARED +@@ -36,6 +38,7 @@ target_link_libraries( + target_include_directories( + ff + PUBLIC .. ++ ${CMAKE_CURRENT_BINARY_DIR}/.. + ) + + install( +@@ -48,6 +51,10 @@ install( + ) + + install( ++ FILES "${CMAKE_CURRENT_BINARY_DIR}/config.hpp" DESTINATION "include/libff" ++) ++ ++install( + TARGETS ff DESTINATION lib${LIB_SUFFIX} + ) + +Index: libff-1.0.0/libff/config.hpp.in +=================================================================== +--- /dev/null ++++ libff-1.0.0/libff/config.hpp.in +@@ -0,0 +1,22 @@ ++#ifndef LIBFF_CONFIG_HPP_ ++#define LIBFF_CONFIG_HPP_ ++ ++#cmakedefine NO_PROCPS ++ ++#define ALT_BN128 1 ++#define EDWARDS 2 ++#define MNT4 3 ++#define MNT6 4 ++#cmakedefine CURVE ${CURVE} ++ ++#cmakedefine DEBUG ++#cmakedefine LOWMEM ++#cmakedefine MULTICORE ++#cmakedefine BINARY_OUTPUT ++#cmakedefine MONTGOMERY_OUTPUT ++#cmakedefine NO_PT_COMPRESSION ++#cmakedefine PROFILE_OP_COUNTS ++#cmakedefine USE_MIXED_ADDITION ++#cmakedefine USE_ASM ++ ++#endif // LIBFF_CONFIG_HPP_ +Index: libff-1.0.0/libff/common/default_types/ec_pp.hpp +=================================================================== +--- libff-1.0.0.orig/libff/common/default_types/ec_pp.hpp ++++ libff-1.0.0/libff/common/default_types/ec_pp.hpp +@@ -13,9 +13,11 @@ + #ifndef EC_PP_HPP_ + #define EC_PP_HPP_ + ++#include ++ + /************************ Pick the elliptic curve ****************************/ + +-#ifdef CURVE_ALT_BN128 ++#if CURVE == ALT_BN128 + #define LIBFF_DEFAULT_EC_PP_DEFINED + #include + namespace libff { +@@ -23,7 +25,7 @@ typedef alt_bn128_pp default_ec_pp; + } // libff + #endif + +-#ifdef CURVE_EDWARDS ++#if CURVE == EDWARDS + #define LIBFF_DEFAULT_EC_PP_DEFINED + #include + namespace libff { +@@ -31,7 +33,7 @@ typedef edwards_pp default_ec_pp; + } // libff + #endif + +-#ifdef CURVE_MNT4 ++#if CURVE == MNT4 + #define LIBFF_DEFAULT_EC_PP_DEFINED + #include + namespace libff { +@@ -39,7 +41,7 @@ typedef mnt4_pp default_ec_pp; + } // libff + #endif + +-#ifdef CURVE_MNT6 ++#if CURVE == MNT6 + #define LIBFF_DEFAULT_EC_PP_DEFINED + #include + namespace libff { +@@ -48,7 +50,7 @@ typedef mnt6_pp default_ec_pp; + #endif + + #ifndef LIBFF_DEFAULT_EC_PP_DEFINED +-#error You must define one of the CURVE_* symbols to pick a curve for pairings. ++#error You must define the CURVE symbol to pick a curve for pairings. + #endif + + #endif // EC_PP_HPP_ +Index: libff-1.0.0/libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp ++++ libff-1.0.0/libff/algebra/curves/alt_bn128/alt_bn128_g1.hpp +@@ -9,6 +9,7 @@ + #define ALT_BN128_G1_HPP_ + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp ++++ libff-1.0.0/libff/algebra/curves/alt_bn128/alt_bn128_g2.hpp +@@ -9,6 +9,7 @@ + #define ALT_BN128_G2_HPP_ + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/curves/edwards/edwards_g1.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/edwards/edwards_g1.hpp ++++ libff-1.0.0/libff/algebra/curves/edwards/edwards_g1.hpp +@@ -9,6 +9,7 @@ + #define EDWARDS_G1_HPP_ + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/curves/edwards/edwards_g2.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/edwards/edwards_g2.hpp ++++ libff-1.0.0/libff/algebra/curves/edwards/edwards_g2.hpp +@@ -10,6 +10,7 @@ + #include + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/curves/mnt/mnt4/mnt4_g1.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/mnt/mnt4/mnt4_g1.hpp ++++ libff-1.0.0/libff/algebra/curves/mnt/mnt4/mnt4_g1.hpp +@@ -14,6 +14,7 @@ + + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/curves/mnt/mnt4/mnt4_g2.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/mnt/mnt4/mnt4_g2.hpp ++++ libff-1.0.0/libff/algebra/curves/mnt/mnt4/mnt4_g2.hpp +@@ -14,6 +14,7 @@ + + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/curves/mnt/mnt6/mnt6_g1.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/mnt/mnt6/mnt6_g1.hpp ++++ libff-1.0.0/libff/algebra/curves/mnt/mnt6/mnt6_g1.hpp +@@ -14,6 +14,7 @@ + + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/curves/mnt/mnt6/mnt6_g2.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/curves/mnt/mnt6/mnt6_g2.hpp ++++ libff-1.0.0/libff/algebra/curves/mnt/mnt6/mnt6_g2.hpp +@@ -14,6 +14,7 @@ + + #include + ++#include + #include + #include + +Index: libff-1.0.0/libff/algebra/fields/fp2.tcc +=================================================================== +--- libff-1.0.0.orig/libff/algebra/fields/fp2.tcc ++++ libff-1.0.0/libff/algebra/fields/fp2.tcc +@@ -10,6 +10,7 @@ + #ifndef FP2_TCC_ + #define FP2_TCC_ + ++#include + #include + + namespace libff { +Index: libff-1.0.0/libff/algebra/fields/fp3.tcc +=================================================================== +--- libff-1.0.0.orig/libff/algebra/fields/fp3.tcc ++++ libff-1.0.0/libff/algebra/fields/fp3.tcc +@@ -10,6 +10,7 @@ + #ifndef FP3_TCC_ + #define FP3_TCC_ + ++#include + #include + + namespace libff { +Index: libff-1.0.0/libff/algebra/scalar_multiplication/multiexp.tcc +=================================================================== +--- libff-1.0.0.orig/libff/algebra/scalar_multiplication/multiexp.tcc ++++ libff-1.0.0/libff/algebra/scalar_multiplication/multiexp.tcc +@@ -18,6 +18,7 @@ + #include + #include + ++#include + #include + #include + #include +Index: libff-1.0.0/libff/common/utils.hpp +=================================================================== +--- libff-1.0.0.orig/libff/common/utils.hpp ++++ libff-1.0.0/libff/common/utils.hpp +@@ -16,6 +16,8 @@ + #include + #include + ++#include ++ + namespace libff { + + typedef std::vector bit_vector; +Index: libff-1.0.0/libff/algebra/fields/bigint.tcc +=================================================================== +--- libff-1.0.0.orig/libff/algebra/fields/bigint.tcc ++++ libff-1.0.0/libff/algebra/fields/bigint.tcc +@@ -13,6 +13,8 @@ + #include + #include + ++#include ++ + namespace libff { + + template +Index: libff-1.0.0/libff/algebra/fields/fp.hpp +=================================================================== +--- libff-1.0.0.orig/libff/algebra/fields/fp.hpp ++++ libff-1.0.0/libff/algebra/fields/fp.hpp +@@ -10,6 +10,7 @@ + #ifndef FP_HPP_ + #define FP_HPP_ + ++#include + #include + #include + +Index: libff-1.0.0/libff/common/serialization.hpp +=================================================================== +--- libff-1.0.0.orig/libff/common/serialization.hpp ++++ libff-1.0.0/libff/common/serialization.hpp +@@ -18,6 +18,8 @@ + #include + #include + ++#include ++ + namespace libff { + + /* diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..1de2e5a --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libff-1_0_0 diff --git a/libff-1.0.0.tar.gz b/libff-1.0.0.tar.gz new file mode 100644 index 0000000..c930eb7 --- /dev/null +++ b/libff-1.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a49555be4581c898eaa899d6c282e61d15db3d06a2b239feb2d6bea5b723324f +size 107945 diff --git a/libff.changes b/libff.changes new file mode 100644 index 0000000..d3e5ec6 --- /dev/null +++ b/libff.changes @@ -0,0 +1,41 @@ +------------------------------------------------------------------- +Fri Jan 10 11:06:28 UTC 2025 - Martin Pluskal + +- Build AVX2 enabled hwcaps library for x86_64-v3 + +------------------------------------------------------------------- +Tue Feb 13 12:30:27 UTC 2024 - Martin Pluskal + +- Small spec file modernization + +------------------------------------------------------------------- +Tue Feb 13 10:19:47 UTC 2024 - Pedro Monreal + +- Remove the hardcoded libopenssl-1_1-devel to libopenssl-devel. + +------------------------------------------------------------------- +Tue Feb 9 14:49:40 UTC 2021 - Jan Engelhardt + +- Edit 01_shared_lib.patch and implement the SUSE shlib packaging + policy. + +------------------------------------------------------------------- +Fri Feb 5 06:59:22 UTC 2021 - Martin Pluskal + +- Cleanup spec file + +------------------------------------------------------------------- +Fri Oct 30 07:43:39 UTC 2020 - Adam Mizerski + +- update to 1.0.0 + * no upstream changelog +- refreshed patches + +------------------------------------------------------------------- +Mon Jan 21 21:26:14 UTC 2019 - Adam Mizerski + +- new package; version 0~git63 +- added patches: + * 00_no_bn128.patch + * 01_shared_lib.patch + * 02_config_hpp.patch diff --git a/libff.spec b/libff.spec new file mode 100644 index 0000000..c1ee998 --- /dev/null +++ b/libff.spec @@ -0,0 +1,83 @@ +# +# spec file for package libff +# +# Copyright (c) 2025 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 lname libff-1_0_0 +Name: libff +Version: 1.0.0 +Release: 0 +Summary: C++ library for Finite Fields and Elliptic Curves +License: MIT +URL: https://github.com/scipr-lab/libff +Source0: https://github.com/scipr-lab/libff/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: 00_no_bn128.patch +Patch1: 01_shared_lib.patch +Patch2: 02_config_hpp.patch +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: gmp-devel +BuildRequires: libopenssl-devel +%{?suse_build_hwcaps_libs} + +%description +libff is a C++ library for finite fields and elliptic curves. + +%package -n %{lname} +Summary: C++ library for finite fields and elliptic curves + +%description -n %{lname} +libff is a C++ library for finite fields and elliptic curves. + +%package devel +Summary: Development files for libff +Requires: %{lname} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for developing applications that use libff. + +%prep +%autosetup -p1 +chmod 0644 LICENSE AUTHORS README.md +# see 00_no_bn128.patch +rm -r depends +rm -r libff/algebra/curves/bn128 +rm libff/algebra/scalar_multiplication/multiexp_profile.cpp + +%build +%cmake \ + -DWITH_PROCPS=OFF \ + -DPACKAGE_VERSION:STRING="%{version}" +%cmake_build + +%check +pushd build +make check + +%install +%cmake_install + +%ldconfig_scriptlets -n %{lname} + +%files -n %{lname} +%doc README.md +%license LICENSE AUTHORS +%{_libdir}/libff-%{version}.so + +%files devel +%{_includedir}/libff/ + +%changelog From 9ad7fa2156ac9f451a6fb8a7d84fd8130559bd02904141c3a6030c1aebb99a64 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Fri, 10 Jan 2025 11:09:11 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/network:cryptocurrencies/libff?expand=0&rev=10 --- libff.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/libff.spec b/libff.spec index c1ee998..ae9a2ff 100644 --- a/libff.spec +++ b/libff.spec @@ -24,6 +24,7 @@ Summary: C++ library for Finite Fields and Elliptic Curves License: MIT URL: https://github.com/scipr-lab/libff Source0: https://github.com/scipr-lab/libff/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source99: baselibs.conf Patch0: 00_no_bn128.patch Patch1: 01_shared_lib.patch Patch2: 02_config_hpp.patch