[packages/libE57Format] - new

baggins baggins at pld-linux.org
Sun Apr 19 10:01:23 CEST 2026


commit 37beca20322306309f56f0f32e4c1b7e3693c77a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Apr 19 12:00:55 2026 +0200

    - new

 libE57Format.spec        | 85 ++++++++++++++++++++++++++++++++++++++++++++++++
 use-packaged-gtest.patch | 75 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 160 insertions(+)
---
diff --git a/libE57Format.spec b/libE57Format.spec
new file mode 100644
index 0000000..77ba49a
--- /dev/null
+++ b/libE57Format.spec
@@ -0,0 +1,85 @@
+#
+# Conditional build:
+%bcond_without	tests		# build without tests
+#
+Summary:	Library for reading & writing the E57 file format
+Name:		libE57Format
+Version:	3.3.0
+Release:	1
+License:	Boost Software License
+Group:		Libraries
+Source0:	https://github.com/asmaloney/libE57Format/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	e0b5ca94917457bd61692d3e8c78fec9
+Source1:	https://github.com/asmaloney/libE57Format-test-data/archive/main/libE57Format-test-data.tar.gz
+# Source1-md5:	5e38e91a951c2afce5055f1f251fb5da
+Patch0:		use-packaged-gtest.patch
+URL:		https://github.com/asmaloney/libE57Format?tab=readme-ov-file
+BuildRequires:	cmake
+%if %{with tests}
+BuildRequires:	gtest-devel
+BuildRequires:	libasan-devel
+BuildRequires:	libubsan-devel
+%endif
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+libE57Format is a C++ library which provides read & write support for
+the ASTM-standard E57 file format on Linux, macOS, and Windows. E57
+files store 3D point cloud data (produced by 3D imaging systems such
+as laser scanners), attributes associated with 3D point data (color &
+intensity), and 2D images (photos taken using a 3D imaging system).
+
+%package devel
+Summary:	Header files for %{name} library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki %{name}
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Header files for %{name} library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki %{name}.
+
+%prep
+%setup -q -a1
+%patch -P0 -p1
+
+%build
+mkdir -p build
+cd build
+%cmake ../ \
+%if %{with tests}
+	-DE57_BUILD_TEST=ON \
+	-DE57_TEST_DATA_PATH=libE57Format-test-data \
+	-DUSE_PACKAGED_GTEST=ON
+%else
+	-DE57_BUILD_TEST=OFF
+%endif
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE.md README.md
+%{_libdir}/%{name}.so.*.*.*
+%ghost %{_libdir}/%{name}.so.3
+
+%files devel
+%defattr(644,root,root,755)
+%doc CHANGELOG.md CONTRIBUTING.md
+%{_libdir}/%{name}.so
+%{_includedir}/E57Format
+%{_libdir}/cmake/E57Format
diff --git a/use-packaged-gtest.patch b/use-packaged-gtest.patch
new file mode 100644
index 0000000..4e74658
--- /dev/null
+++ b/use-packaged-gtest.patch
@@ -0,0 +1,75 @@
+Description: Use packaged version of gtest.
+Author: Tobias Frost <tobi at debian.org>
+Forwarded: https://github.com/asmaloney/libE57Format/pull/339
+Last-Update: 2026-03-29
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -87,38 +87,37 @@
+ endif()
+ 
+ # GoogleTest from here: https://github.com/google/googletest
++if ( USE_PACKAGED_GTEST )
++ find_package( GTest REQUIRED)
++else()
++    if ( NOT TARGET GTest::gtest AND NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/extern/googletest/CMakeLists.txt" )
++        message( FATAL_ERROR "[E57 Test] The GoogleTest submodule was not downloaded. E57_GIT_SUBMODULE_UPDATE was turned off or failed. Please update submodules and try again." )
++    endif()
++
++    set( BUILD_GMOCK OFF CACHE BOOL "" FORCE )
++    set( INSTALL_GTEST OFF CACHE BOOL "" FORCE )
++
++    if ( MSVC )
++        # Prevent overriding the parent project's compiler/linker settings on Windows
++        set( gtest_force_shared_crt ON CACHE BOOL "" FORCE )
++    endif()
++
++    add_subdirectory( extern/googletest )
++
++    set_target_properties( gtest_main
++	    PROPERTIES
++	        EXPORT_COMPILE_COMMANDS ON
++    )
++
++    enable_all_sanitizers( gtest_main )
++
++    unset( BUILD_GMOCK CACHE )
++    unset( GTEST_HAS_ABSL CACHE )
++    unset( INSTALL_GTEST CACHE )
+ 
+-if ( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/extern/googletest/CMakeLists.txt" )
+-    message( FATAL_ERROR "[E57 Test] The GoogleTest submodule was not downloaded. E57_GIT_SUBMODULE_UPDATE was turned off or failed. Please update submodules and try again." )
+ endif()
+ 
+-set( BUILD_GMOCK OFF CACHE BOOL "" FORCE )
+-set( INSTALL_GTEST OFF CACHE BOOL "" FORCE )
+-
+-if ( MSVC )
+-    # Prevent overriding the parent project's compiler/linker settings on Windows
+-    set( gtest_force_shared_crt ON CACHE BOOL "" FORCE )
+-endif()
+-
+-add_subdirectory( extern/googletest )
+-
+-set_target_properties( gtest_main
+-	PROPERTIES
+-	    EXPORT_COMPILE_COMMANDS ON
+-)
+-
+-enable_all_sanitizers( gtest_main )
+-
+-unset( BUILD_GMOCK CACHE )
+-unset( GTEST_HAS_ABSL CACHE )
+-unset( INSTALL_GTEST CACHE )
+-
+-target_include_directories( testE57
+-    PRIVATE
+-        "${gtest_SOURCE_DIR}/include"
+-)
+-
+ target_link_libraries( testE57
+     PRIVATE
+-        gtest_main
++        GTest::gtest
+ )
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libE57Format.git/commitdiff/37beca20322306309f56f0f32e4c1b7e3693c77a



More information about the pld-cvs-commit mailing list