diff --git a/.gitignore b/.gitignore index 3b589b2..4a800ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /libsavitar-*.tar.gz +/pySavitar-5.2.2.tar.gz +/pySavitar-5.3.0.tar.gz diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e1dc5fe --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,174 @@ +project(savitar) +cmake_minimum_required(VERSION 3.8) + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) +include(GenerateExportHeader) + +option(BUILD_PYTHON "Build " ON) +option(BUILD_STATIC "Build as a static library" OFF) +option(BUILD_TESTS "Building the test-suite" OFF) + +if(BUILD_TESTS) + message(STATUS "Building with tests...") + find_package(GTest REQUIRED) + find_package(Threads QUIET) +endif() + +# add_subdirectory(pugixml) + +if(BUILD_PYTHON) + list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + + # FIXME: Remove the code for CMake <3.12 once we have switched over completely. + # FindPython3 is a new module since CMake 3.12. It deprecates FindPythonInterp and FindPythonLibs. + if(${CMAKE_VERSION} VERSION_LESS 3.12) + # FIXME: Use FindPython3 to find Python, new in CMake 3.12. + # However currently on our CI server it finds the wrong Python version and then doesn't find the headers. + find_package(PythonInterp 3.4 REQUIRED) + find_package(PythonLibs 3.4 REQUIRED) + + else() + # Use FindPython3 for CMake >=3.12 + find_package(Python3 3.4 REQUIRED COMPONENTS Interpreter Development) + endif() + + find_package(SIP REQUIRED) + if(NOT DEFINED LIB_SUFFIX) + set(LIB_SUFFIX "") + endif() + + include_directories(python/ src/ ${SIP_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}) +endif() + +set(CMAKE_CXX_STANDARD 17) + +if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif() + +set(savitar_SRCS + src/Namespace.cpp + src/ThreeMFParser.cpp + src/SceneNode.cpp + src/Scene.cpp + src/MeshData.cpp + src/Vertex.cpp + src/Face.cpp +) + +set(savitar_HDRS + include/Savitar/Namespace.h + include/Savitar/ThreeMFParser.h + include/Savitar/Types.h + include/Savitar/SceneNode.h + include/Savitar/Scene.h + include/Savitar/MeshData.h + include/Savitar/Vertex.h + include/Savitar/Face.h + ${CMAKE_CURRENT_BINARY_DIR}/src/SavitarExport.h +) + +set(SAVITAR_VERSION 0.1.2) +set(SAVITAR_SOVERSION 0) + +set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) + +if(BUILD_STATIC) + add_library(Savitar STATIC ${savitar_SRCS}) +else() + add_library(Savitar SHARED ${savitar_SRCS}) +endif() + +set(Savitar_LINK_LIBRARIES pugixml) +if(CMAKE_USE_PTHREADS_INIT) + list(APPEND Savitar_LINK_LIBRARIES pthread) +endif() +target_link_libraries(Savitar PUBLIC ${Savitar_LINK_LIBRARIES}) + +if(NOT WIN32 OR CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(Savitar PROPERTIES COMPILE_FLAGS -fPIC) +endif() + +set_target_properties(Savitar PROPERTIES COMPILE_FLAGS "-fPIC -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wlogical-op -Wuseless-cast") + +if(BUILD_PYTHON) + set(SIP_EXTRA_FILES_DEPEND python/Types.sip python/MeshData.sip python/SceneNode.sip python/Scene.sip) + #set(SIP_EXTRA_SOURCE_FILES python/Types.cpp) + set(SIP_EXTRA_OPTIONS -g -n PyQt5.sip) # -g means always release the GIL before calling C++ methods. -n PyQt5.sip is required to not get the PyCapsule error + add_sip_python_module(pySavitar python/pySavitar.sip Savitar) +endif() + +target_include_directories(Savitar PUBLIC + $ + $ +) + +if(${CMAKE_BUILD_TYPE}) + if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") + add_definitions(-DSAVITAR_DEBUG) + endif() +endif() + +set_target_properties(Savitar PROPERTIES + FRAMEWORK FALSE + VERSION ${SAVITAR_VERSION} + SOVERSION ${SAVITAR_SOVERSION} + PUBLIC_HEADER "${savitar_HDRS}" + DEFINE_SYMBOL MAKE_SAVITAR_LIB + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN 1 +) + +generate_export_header(Savitar + EXPORT_FILE_NAME src/SavitarExport.h +) +# This is required when building out-of-tree. +# The compiler won't find the generated header otherwise. +include_directories(${CMAKE_BINARY_DIR}/src include/) + +install(TARGETS Savitar + EXPORT Savitar-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Savitar +) + +install(EXPORT Savitar-targets + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Savitar +) + +configure_package_config_file(SavitarConfig.cmake.in ${CMAKE_BINARY_DIR}/SavitarConfig.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Savitar) +write_basic_package_version_file(${CMAKE_BINARY_DIR}/SavitarConfigVersion.cmake VERSION ${SAVITAR_VERSION} COMPATIBILITY SameMajorVersion) + +# List of tests. For each test there must be a file tests/${NAME}.cpp. +set(savitar_TEST + ThreeMFParserTest + MeshDataTest + NamespaceTest +) + +# Compiling the test environment. +if (BUILD_TESTS) + include_directories(${GTEST_INCLUDE_DIR}) + + enable_testing() + + #To make sure that the tests are built before running them, add the building of these tests as an additional test. + add_custom_target(build_all_tests) + add_test(BuildTests "${CMAKE_COMMAND}" --build ${CMAKE_CURRENT_BINARY_DIR} --target build_all_tests) + + foreach (test ${savitar_TEST}) + add_executable(${test} tests/main.cpp tests/${test}.cpp) + target_link_libraries(${test} Savitar ${GTEST_BOTH_LIBRARIES}) + add_test(${test} ${test}) + add_dependencies(build_all_tests ${test}) #Make sure that this gets built as part of the build_all_tests target. + endforeach() +endif() + +install(FILES + ${CMAKE_BINARY_DIR}/SavitarConfig.cmake + ${CMAKE_BINARY_DIR}/SavitarConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Savitar +) diff --git a/COPYING-CMAKE-SCRIPTS b/COPYING-CMAKE-SCRIPTS new file mode 100644 index 0000000..4b41776 --- /dev/null +++ b/COPYING-CMAKE-SCRIPTS @@ -0,0 +1,22 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/FindSIP.cmake b/FindSIP.cmake new file mode 100644 index 0000000..3774b12 --- /dev/null +++ b/FindSIP.cmake @@ -0,0 +1,91 @@ +# Find SIP +# ~~~~~~~~ +# +# SIP website: http://www.riverbankcomputing.co.uk/sip/index.php +# +# Find the installed version of SIP. FindSIP should be called after Python +# has been found. +# +# This file defines the following variables: +# +# SIP_VERSION - SIP version. +# +# SIP_EXECUTABLE - Path to the SIP executable. +# +# SIP_INCLUDE_DIRS - The SIP include directories. +# + +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(APPLE) + # Workaround for broken FindPythonLibs. It will always find Python 2.7 libs on OSX + set(CMAKE_FIND_FRAMEWORK LAST) +endif() + +# FIXME: Use the new FindPython3 module rather than these. New in CMake 3.12. +# However currently that breaks on our CI server, since the CI server finds the built-in Python3.6 and then doesn't find the headers. +find_package(PythonInterp 3.5 REQUIRED) +find_package(PythonLibs 3.5 REQUIRED) + +# Define variables that are available in FindPython3, so there's no need to branch off in the later part. +set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE}) +set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}) +set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) + +execute_process( + COMMAND ${Python3_EXECUTABLE} -c + "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False))" + RESULT_VARIABLE _process_status + OUTPUT_VARIABLE _process_output + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if(${_process_status} EQUAL 0) + string(STRIP ${_process_output} Python3_SITELIB) +else() + message(FATAL_ERROR "Failed to get Python3_SITELIB. Error: ${_process_output}") +endif() + +execute_process( + COMMAND ${Python3_EXECUTABLE} -c + "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False))" + RESULT_VARIABLE _process_status + OUTPUT_VARIABLE _process_output + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if(${_process_status} EQUAL 0) + string(STRIP ${_process_output} Python3_SITEARCH) +else() + message(FATAL_ERROR "Failed to get Python3_SITEARCH. Error: ${_process_output}") +endif() + +get_filename_component(_python_binary_path ${Python3_EXECUTABLE} DIRECTORY) + +find_program(SIP_EXECUTABLE sip + HINTS ${CMAKE_PREFIX_PATH}/bin ${CMAKE_INSTALL_PATH}/bin ${_python_binary_path} ${Python3_SITELIB}/PyQt5 +) + +find_path(SIP_INCLUDE_DIRS sip.h + HINTS ${CMAKE_PREFIX_PATH}/include ${CMAKE_INSTALL_PATH}/include ${Python3_INCLUDE_DIRS} ${Python3_SITELIB}/PyQt5 +) + +execute_process( + COMMAND ${Python3_EXECUTABLE} -c "import sip; print(sip.SIP_VERSION_STR)" + RESULT_VARIABLE _process_status + OUTPUT_VARIABLE _process_output + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if(${_process_status} EQUAL 0) + string(STRIP ${_process_output} SIP_VERSION) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SIP REQUIRED_VARS SIP_EXECUTABLE SIP_INCLUDE_DIRS VERSION_VAR SIP_VERSION) + +if(SIP_FOUND) + include(${CMAKE_CURRENT_LIST_DIR}/SIPMacros.cmake) +endif() + +mark_as_advanced(SIP_EXECUTABLE SIP_INCLUDE_DIRS SIP_VERSION) diff --git a/SIPMacros.cmake b/SIPMacros.cmake new file mode 100644 index 0000000..14544d2 --- /dev/null +++ b/SIPMacros.cmake @@ -0,0 +1,129 @@ +# Macros for SIP +# ~~~~~~~~~~~~~~ +# Copyright (c) 2007, Simon Edwards +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +# SIP website: http://www.riverbankcomputing.co.uk/sip/index.php +# +# This file defines the following macros: +# +# ADD_SIP_PYTHON_MODULE (MODULE_NAME MODULE_SIP [library1, libaray2, ...]) +# Specifies a SIP file to be built into a Python module and installed. +# MODULE_NAME is the name of Python module including any path name. (e.g. +# os.sys, Foo.bar etc). MODULE_SIP the path and filename of the .sip file +# to process and compile. libraryN are libraries that the Python module, +# which is typically a shared library, should be linked to. The built +# module will also be install into Python's site-packages directory. +# +# The behaviour of the ADD_SIP_PYTHON_MODULE macro can be controlled by a +# number of variables: +# +# SIP_INCLUDE_DIRS - List of directories which SIP will scan through when looking +# for included .sip files. (Corresponds to the -I option for SIP.) +# +# SIP_TAGS - List of tags to define when running SIP. (Corresponds to the -t +# option for SIP.) +# +# SIP_CONCAT_PARTS - An integer which defines the number of parts the C++ code +# of each module should be split into. Defaults to 8. (Corresponds to the +# -j option for SIP.) +# +# SIP_DISABLE_FEATURES - List of feature names which should be disabled +# running SIP. (Corresponds to the -x option for SIP.) +# +# SIP_EXTRA_OPTIONS - Extra command line options which should be passed on to +# SIP. + +SET(SIP_INCLUDE_DIRS) +SET(SIP_TAGS) +SET(SIP_CONCAT_PARTS 8) +SET(SIP_DISABLE_FEATURES) +SET(SIP_EXTRA_OPTIONS) + +MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP) + + SET(EXTRA_LINK_LIBRARIES ${ARGN}) + + STRING(REPLACE "." "/" _x ${MODULE_NAME}) + GET_FILENAME_COMPONENT(_parent_module_path ${_x} PATH) + GET_FILENAME_COMPONENT(_child_module_name ${_x} NAME) + + GET_FILENAME_COMPONENT(_module_path ${MODULE_SIP} PATH) + GET_FILENAME_COMPONENT(_abs_module_sip ${MODULE_SIP} ABSOLUTE) + + # We give this target a long logical target name. + # (This is to avoid having the library name clash with any already + # install library names. If that happens then cmake dependency + # tracking get confused.) + STRING(REPLACE "." "_" _logical_name ${MODULE_NAME}) + SET(_logical_name "python_module_${_logical_name}") + + FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_module_path}) # Output goes in this dir. + + SET(_sip_includes) + FOREACH (_inc ${SIP_INCLUDES}) + GET_FILENAME_COMPONENT(_abs_inc ${_inc} ABSOLUTE) + LIST(APPEND _sip_includes -I ${_abs_inc}) + ENDFOREACH (_inc ) + + SET(_sip_tags) + FOREACH (_tag ${SIP_TAGS}) + LIST(APPEND _sip_tags -t ${_tag}) + ENDFOREACH (_tag) + + SET(_sip_x) + FOREACH (_x ${SIP_DISABLE_FEATURES}) + LIST(APPEND _sip_x -x ${_x}) + ENDFOREACH (_x ${SIP_DISABLE_FEATURES}) + + SET(_message "-DMESSAGE=Generating CPP code for module ${MODULE_NAME}") + SET(_sip_output_files) + FOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} ) + IF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} ) + SET(_sip_output_files ${_sip_output_files} ${CMAKE_CURRENT_BINARY_DIR}/${_module_path}/sip${_child_module_name}part${CONCAT_NUM}.cpp ) + ENDIF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} ) + ENDFOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} ) + + # Suppress warnings + IF(PEDANTIC) + IF(MSVC) + # 4996 deprecation warnings (bindings re-export deprecated methods) + # 4701 potentially uninitialized variable used (sip generated code) + # 4702 unreachable code (sip generated code) + ADD_DEFINITIONS( /wd4996 /wd4701 /wd4702 ) + ELSE(MSVC) + # disable all warnings + ADD_DEFINITIONS( -w ) + ENDIF(MSVC) + ENDIF(PEDANTIC) + + ADD_CUSTOM_COMMAND( + OUTPUT ${_sip_output_files} + COMMAND ${CMAKE_COMMAND} -E echo ${message} + COMMAND ${CMAKE_COMMAND} -E touch ${_sip_output_files} + COMMAND ${SIP_EXECUTABLE} ${_sip_tags} ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip} + DEPENDS ${_abs_module_sip} ${SIP_EXTRA_FILES_DEPEND} + ) + # not sure if type MODULE could be uses anywhere, limit to cygwin for now + IF (CYGWIN OR APPLE) + ADD_LIBRARY(${_logical_name} MODULE ${_sip_output_files} ${SIP_EXTRA_SOURCE_FILES}) + ELSE (CYGWIN OR APPLE) + ADD_LIBRARY(${_logical_name} SHARED ${_sip_output_files} ${SIP_EXTRA_SOURCE_FILES}) + ENDIF (CYGWIN OR APPLE) + IF (NOT APPLE) + TARGET_LINK_LIBRARIES(${_logical_name} ${Python3_LIBRARIES}) + ENDIF (NOT APPLE) + TARGET_LINK_LIBRARIES(${_logical_name} ${EXTRA_LINK_LIBRARIES}) + IF (APPLE) + SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + ENDIF (APPLE) + SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES PREFIX "" OUTPUT_NAME ${_child_module_name}) + + IF (WIN32) + SET_TARGET_PROPERTIES(${_logical_name} PROPERTIES SUFFIX ".pyd" IMPORT_PREFIX "_") + ENDIF (WIN32) + + INSTALL(TARGETS ${_logical_name} DESTINATION "${Python3_SITEARCH}/${_parent_module_path}") + +ENDMACRO(ADD_SIP_PYTHON_MODULE) diff --git a/SavitarConfig.cmake.in b/SavitarConfig.cmake.in new file mode 100644 index 0000000..3ae8f9a --- /dev/null +++ b/SavitarConfig.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +include(${SELF_DIR}/Savitar-targets.cmake) \ No newline at end of file diff --git a/changelog b/changelog new file mode 100644 index 0000000..5dbbab1 --- /dev/null +++ b/changelog @@ -0,0 +1,154 @@ +* Thu Jul 20 2023 Fedora Release Engineering - 5.2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jun 13 2023 Python Maint - 5.2.2-2 +- Rebuilt for Python 3.12 + +* Wed Mar 8 2023 Tom Callaway - 5.2.2-1 +- Update to 5.2.2 + +* Thu Jan 19 2023 Fedora Release Engineering - 4.13.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 4.13.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jun 17 2022 Python Maint - 4.13.1-3 +- Rebuilt for Python 3.11 + +* Mon Mar 28 2022 Miro Hrončok - 4.13.1-2 +- Fix build failure with cmake 3.23+ +- Fixes: rhbz#2069148 + +* Tue Feb 01 2022 Gabriel Féron - 4.13.1-1 +- Update to 4.13.1 + +* Thu Jan 20 2022 Gabriel Féron - 4.13.0-1 +- Update to 4.13.0 + +* Thu Jan 20 2022 Fedora Release Engineering - 4.12.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Dec 13 2021 Gabriel Féron - 4.12.1-1 +- Update to 4.12.1 + +* Wed Sep 15 2021 Gabriel Féron - 4.11.0-1 +- Update to 4.11.0 + +* Mon Aug 16 2021 Gabriel Féron - 4.10.0-1 +- Update to 4.10.0 + +* Thu Jul 22 2021 Fedora Release Engineering - 4.9.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jun 10 2021 Gabriel Féron - 4.9.1-1 +- Update to 4.9.1 + +* Fri Jun 04 2021 Python Maint - 4.9.0-2 +- Rebuilt for Python 3.10 + +* Mon Apr 26 2021 Gabriel Féron - 4.9.0-1 +- Update to 4.9.0 + +* Tue Jan 26 2021 Fedora Release Engineering - 4.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Dec 22 2020 Jan Pazdziora - 4.8.0-1 +- Update to 4.8.0 + +* Thu Sep 03 2020 Miro Hrončok - 4.7.1-1 +- Update to 4.7.1 + +* Mon Aug 31 2020 Gabriel Féron - 4.7.0-1 +- Update to 4.7.0 + +* Tue Jul 28 2020 Fedora Release Engineering - 4.6.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 4.6.1-2 +- Rebuilt for Python 3.9 + +* Tue May 5 2020 Gabriel Féron - 4.6.1-1 +- Update to 4.6.1 + +* Tue Apr 21 2020 Gabriel Féron - 4.6.0-1 +- Update to 4.6.0 + +* Wed Jan 29 2020 Fedora Release Engineering - 4.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Nov 21 2019 Gabriel Féron - 4.4.0-1 +- Update to 4.4.0 + +* Fri Nov 01 2019 Miro Hrončok - 4.1.0-4 +- Make the dependency of python3-savitar on libsavitar strict (#1767762) + +* Mon Aug 19 2019 Miro Hrončok - 4.1.0-3 +- Rebuilt for Python 3.8 + +* Thu Jul 25 2019 Fedora Release Engineering - 4.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Tue Jun 18 2019 Gabriel Féron - 4.1.0-1 +- Update to 4.1.0 + +* Wed Apr 03 2019 Gabriel Féron - 4.0.0-1 +- Update to 4.0.0 + +* Fri Feb 01 2019 Fedora Release Engineering - 3.6.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jan 26 2019 Gabriel Féron - 3.6.0-1 +- Update to 3.6.0 + +* Mon Nov 12 2018 Miro Hrončok - 3.5.1-2 +- Use PyQt5.sip (#1601917) + +* Mon Nov 12 2018 Miro Hrončok - 3.5.1-1 +- Update to 3.5.1 (#1644323) + +* Tue Aug 28 2018 Miro Hrončok - 3.4.1-1 +- Update to 3.4.1 (#1599715) + +* Fri Jul 13 2018 Fedora Release Engineering - 3.3.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 3.3.0-2 +- Rebuilt for Python 3.7 + +* Wed May 02 2018 Miro Hrončok - 3.3.0-1 +- Update to 3.3.0 (#1571783) + +* Mon Mar 19 2018 Miro Hrončok - 3.2.1-2 +- Fix license tag (AGPLv3+ to LGPLv3+) + +* Mon Mar 19 2018 Miro Hrončok - 3.2.1-1 +- Update to 3.2.1 (#1523886) + +* Wed Feb 07 2018 Fedora Release Engineering - 3.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Dec 09 2017 Miro Hrončok - 3.1.0-1 +- Update to 3.1.0 (#1523886) +- Don't sed lib -> lib64 (not needed now) + +* Mon Oct 23 2017 Miro Hrončok - 3.0.3-1 +- Update to 3.0.3 (#1505189) + +* Wed Aug 30 2017 Miro Hrončok - 2.7.0-1 +- Update to 2.7.0 (#1486731) + +* Thu Aug 03 2017 Fedora Release Engineering - 2.6.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.6.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Jun 28 2017 Miro Hrončok - 2.6.1-1 +- Updated to 2.6.1 (#1465417) + +* Tue Jun 27 2017 Miro Hrončok - 2.6.0-1 +- Updated to 2.6.0 (#1465417) + +* Wed May 03 2017 Miro Hrončok - 0-0.1.20170501git1ad7ddb +- New package diff --git a/libsavitar-5.2.2-export-fix.patch b/libsavitar-5.2.2-export-fix.patch new file mode 100644 index 0000000..00df863 --- /dev/null +++ b/libsavitar-5.2.2-export-fix.patch @@ -0,0 +1,123 @@ +diff -up libSavitar-5.2.2/include/Savitar/Face.h.export libSavitar-5.2.2/include/Savitar/Face.h +--- libSavitar-5.2.2/include/Savitar/Face.h.export 2022-12-30 05:56:38.000000000 -0500 ++++ libSavitar-5.2.2/include/Savitar/Face.h 2023-03-09 10:02:47.418615400 -0500 +@@ -4,9 +4,11 @@ + #ifndef FACE_H + #define FACE_H + ++#include "SavitarExport.h" ++ + namespace Savitar + { +-class Face ++class SAVITAR_EXPORT Face + { + public: + /** +diff -up libSavitar-5.2.2/include/Savitar/MeshData.h.export libSavitar-5.2.2/include/Savitar/MeshData.h +--- libSavitar-5.2.2/include/Savitar/MeshData.h.export 2022-12-30 05:56:38.000000000 -0500 ++++ libSavitar-5.2.2/include/Savitar/MeshData.h 2023-03-09 10:02:47.418615400 -0500 +@@ -14,9 +14,11 @@ + + #include + ++#include "SavitarExport.h" ++ + namespace Savitar + { +-class MeshData ++class SAVITAR_EXPORT MeshData + { + public: + /** +diff -up libSavitar-5.2.2/include/Savitar/Namespace.h.export libSavitar-5.2.2/include/Savitar/Namespace.h +--- libSavitar-5.2.2/include/Savitar/Namespace.h.export 2022-12-30 05:56:38.000000000 -0500 ++++ libSavitar-5.2.2/include/Savitar/Namespace.h 2023-03-09 10:03:16.981007419 -0500 +@@ -10,6 +10,8 @@ + + #include + ++#include "SavitarExport.h" ++ + namespace xml_namespace + { + using xmlns_map_t = std::map>; +@@ -17,8 +19,8 @@ using xmlns_map_t = std::map getNamesFor(const xmlns_map_t& map, const std::string& uri); ++[[nodiscard]] xmlns_map_t SAVITAR_EXPORT getAncestralNamespaces(const pugi::xml_node& xml_node); ++[[nodiscard]] std::set SAVITAR_EXPORT getNamesFor(const xmlns_map_t& map, const std::string& uri); + } // namespace xml_namespace + +-#endif +\ No newline at end of file ++#endif +diff -up libSavitar-5.2.2/include/Savitar/Scene.h.export libSavitar-5.2.2/include/Savitar/Scene.h +--- libSavitar-5.2.2/include/Savitar/Scene.h.export 2022-12-30 05:56:38.000000000 -0500 ++++ libSavitar-5.2.2/include/Savitar/Scene.h 2023-03-09 10:02:47.418615400 -0500 +@@ -12,9 +12,11 @@ + + #include + ++#include "SavitarExport.h" ++ + namespace Savitar + { +-class Scene ++class SAVITAR_EXPORT Scene + { + public: + /** +diff -up libSavitar-5.2.2/include/Savitar/SceneNode.h.export libSavitar-5.2.2/include/Savitar/SceneNode.h +--- libSavitar-5.2.2/include/Savitar/SceneNode.h.export 2022-12-30 05:56:38.000000000 -0500 ++++ libSavitar-5.2.2/include/Savitar/SceneNode.h 2023-03-09 10:02:47.418615400 -0500 +@@ -13,9 +13,11 @@ + + #include + ++#include "SavitarExport.h" ++ + namespace Savitar + { +-class SceneNode ++class SAVITAR_EXPORT SceneNode + { + public: + SceneNode() = default; +diff -up libSavitar-5.2.2/include/Savitar/ThreeMFParser.h.export libSavitar-5.2.2/include/Savitar/ThreeMFParser.h +--- libSavitar-5.2.2/include/Savitar/ThreeMFParser.h.export 2022-12-30 05:56:38.000000000 -0500 ++++ libSavitar-5.2.2/include/Savitar/ThreeMFParser.h 2023-03-09 10:02:47.418615400 -0500 +@@ -8,11 +8,13 @@ + #include + + #include ++ ++#include "SavitarExport.h" + namespace Savitar + { + class Scene; + +-class ThreeMFParser ++class SAVITAR_EXPORT ThreeMFParser + { + public: + ThreeMFParser(); +diff -up libSavitar-5.2.2/include/Savitar/Vertex.h.export libSavitar-5.2.2/include/Savitar/Vertex.h +--- libSavitar-5.2.2/include/Savitar/Vertex.h.export 2022-12-30 05:56:38.000000000 -0500 ++++ libSavitar-5.2.2/include/Savitar/Vertex.h 2023-03-09 10:02:47.418615400 -0500 +@@ -4,9 +4,11 @@ + #ifndef VERTEX_H + #define VERTEX_H + ++#include "SavitarExport.h" ++ + namespace Savitar + { +-class Vertex ++class SAVITAR_EXPORT Vertex + { + public: + /** diff --git a/libsavitar.spec b/libsavitar.spec index ebdb127..26d651e 100644 --- a/libsavitar.spec +++ b/libsavitar.spec @@ -1,12 +1,22 @@ Name: libsavitar -Version: 4.13.1 -Release: 4%{?dist} +Version: 5.3.0 +Release: %autorelease Summary: C++ implementation of 3mf loading with SIP Python bindings -License: LGPLv3+ +License: LGPL-3.0-or-later URL: https://github.com/Ultimaker/libSavitar Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Python bits +Source1: https://github.com/Ultimaker/pySavitar/archive/%{version}.tar.gz#/pySavitar-%{version}.tar.gz -Patch0: %{name}-no-pugixml.patch +# Cmake bits taken from 4.13.1, before upstream went nuts with conan +Source2: FindSIP.cmake +Source3: SIPMacros.cmake +Source4: CMakeLists.txt +Source5: SavitarConfig.cmake.in +Source6: COPYING-CMAKE-SCRIPTS + +# Actually export symbols into the shared lib +Patch0: libsavitar-5.2.2-export-fix.patch BuildRequires: cmake BuildRequires: dos2unix @@ -17,25 +27,21 @@ BuildRequires: python3-devel BuildRequires: python3-sip-devel BuildRequires: /usr/bin/sip -# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval -%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10 -ExcludeArch: %{ix86} -%endif +# we add a dependency on setuptools to provide the distutils module for FindSIP.cmake +BuildRequires: (python3-setuptools if python3-devel >= 3.12) -# Get Fedora 33++ behavior on anything older -%undefine __cmake_in_source_build +# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval +ExcludeArch: %{ix86} %description Savitar is a C++ implementation of 3mf loading with SIP Python bindings. 3mf is a 3D printing file format. %package devel - -# The cmake scripts are BSD -License: LGPLv3+ and BSD - Summary: Development files for libsavitar Requires: %{name}%{?_isa} = %{version}-%{release} +# The cmake scripts are BSD +License: LGPL-3.0-or-later AND BSD-3-Clause %description devel Savitar is a C++ implementation of 3mf loading with SIP Python bindings. @@ -46,7 +52,6 @@ Development files. %package -n python3-savitar Summary: Python 3 libSavitar bindings Requires: %{name}%{?_isa} = %{version}-%{release} -%{?python_provide:%python_provide python3-savitar} %description -n python3-savitar Savitar is a C++ implementation of 3mf loading with SIP Python bindings. @@ -55,18 +60,17 @@ Savitar is a C++ implementation of 3mf loading with SIP Python bindings. The Python bindings. %prep -%autosetup -n libSavitar-%{version} -p1 -S git +%autosetup -n libSavitar-%{version} -p1 -S git -a 1 + +cp -a pySavitar-%{version}/python . +mkdir cmake +cp -a %{SOURCE2} %{SOURCE3} %{SOURCE6} cmake/ +rm -rf CMakeLists.txt +cp -a %{SOURCE4} %{SOURCE5} . # Wrong end of line encoding dos2unix README.md -# Bundling -rm pugixml -rf -sed -i 's|"../pugixml/src/pugixml.hpp"||g' src/*.cpp src/*.h - -# https://github.com/Ultimaker/libSavitar/pull/18 -sed -i 's/Python3_SITELIB/Python3_SITEARCH/' cmake/SIPMacros.cmake - %build export CXXFLAGS="%{optflags} -Wl,--as-needed" %cmake -DCMAKE_SKIP_RPATH:BOOL=ON @@ -90,148 +94,7 @@ export CXXFLAGS="%{optflags} -Wl,--as-needed" %files -n python3-savitar %license LICENSE %doc README.md -%{python3_sitearch}/Savitar.so +%{python3_sitearch}/pySavitar.so %changelog -* Thu Jul 21 2022 Fedora Release Engineering - 4.13.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Fri Jun 17 2022 Python Maint - 4.13.1-3 -- Rebuilt for Python 3.11 - -* Mon Mar 28 2022 Miro Hrončok - 4.13.1-2 -- Fix build failure with cmake 3.23+ -- Fixes: rhbz#2069148 - -* Tue Feb 01 2022 Gabriel Féron - 4.13.1-1 -- Update to 4.13.1 - -* Thu Jan 20 2022 Gabriel Féron - 4.13.0-1 -- Update to 4.13.0 - -* Thu Jan 20 2022 Fedora Release Engineering - 4.12.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Mon Dec 13 2021 Gabriel Féron - 4.12.1-1 -- Update to 4.12.1 - -* Wed Sep 15 2021 Gabriel Féron - 4.11.0-1 -- Update to 4.11.0 - -* Mon Aug 16 2021 Gabriel Féron - 4.10.0-1 -- Update to 4.10.0 - -* Thu Jul 22 2021 Fedora Release Engineering - 4.9.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Thu Jun 10 2021 Gabriel Féron - 4.9.1-1 -- Update to 4.9.1 - -* Fri Jun 04 2021 Python Maint - 4.9.0-2 -- Rebuilt for Python 3.10 - -* Mon Apr 26 2021 Gabriel Féron - 4.9.0-1 -- Update to 4.9.0 - -* Tue Jan 26 2021 Fedora Release Engineering - 4.8.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Dec 22 2020 Jan Pazdziora - 4.8.0-1 -- Update to 4.8.0 - -* Thu Sep 03 2020 Miro Hrončok - 4.7.1-1 -- Update to 4.7.1 - -* Mon Aug 31 2020 Gabriel Féron - 4.7.0-1 -- Update to 4.7.0 - -* Tue Jul 28 2020 Fedora Release Engineering - 4.6.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue May 26 2020 Miro Hrončok - 4.6.1-2 -- Rebuilt for Python 3.9 - -* Tue May 5 2020 Gabriel Féron - 4.6.1-1 -- Update to 4.6.1 - -* Tue Apr 21 2020 Gabriel Féron - 4.6.0-1 -- Update to 4.6.0 - -* Wed Jan 29 2020 Fedora Release Engineering - 4.4.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Nov 21 2019 Gabriel Féron - 4.4.0-1 -- Update to 4.4.0 - -* Fri Nov 01 2019 Miro Hrončok - 4.1.0-4 -- Make the dependency of python3-savitar on libsavitar strict (#1767762) - -* Mon Aug 19 2019 Miro Hrončok - 4.1.0-3 -- Rebuilt for Python 3.8 - -* Thu Jul 25 2019 Fedora Release Engineering - 4.1.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Tue Jun 18 2019 Gabriel Féron - 4.1.0-1 -- Update to 4.1.0 - -* Wed Apr 03 2019 Gabriel Féron - 4.0.0-1 -- Update to 4.0.0 - -* Fri Feb 01 2019 Fedora Release Engineering - 3.6.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sat Jan 26 2019 Gabriel Féron - 3.6.0-1 -- Update to 3.6.0 - -* Mon Nov 12 2018 Miro Hrončok - 3.5.1-2 -- Use PyQt5.sip (#1601917) - -* Mon Nov 12 2018 Miro Hrončok - 3.5.1-1 -- Update to 3.5.1 (#1644323) - -* Tue Aug 28 2018 Miro Hrončok - 3.4.1-1 -- Update to 3.4.1 (#1599715) - -* Fri Jul 13 2018 Fedora Release Engineering - 3.3.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 19 2018 Miro Hrončok - 3.3.0-2 -- Rebuilt for Python 3.7 - -* Wed May 02 2018 Miro Hrončok - 3.3.0-1 -- Update to 3.3.0 (#1571783) - -* Mon Mar 19 2018 Miro Hrončok - 3.2.1-2 -- Fix license tag (AGPLv3+ to LGPLv3+) - -* Mon Mar 19 2018 Miro Hrončok - 3.2.1-1 -- Update to 3.2.1 (#1523886) - -* Wed Feb 07 2018 Fedora Release Engineering - 3.1.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Sat Dec 09 2017 Miro Hrončok - 3.1.0-1 -- Update to 3.1.0 (#1523886) -- Don't sed lib -> lib64 (not needed now) - -* Mon Oct 23 2017 Miro Hrončok - 3.0.3-1 -- Update to 3.0.3 (#1505189) - -* Wed Aug 30 2017 Miro Hrončok - 2.7.0-1 -- Update to 2.7.0 (#1486731) - -* Thu Aug 03 2017 Fedora Release Engineering - 2.6.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 2.6.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Wed Jun 28 2017 Miro Hrončok - 2.6.1-1 -- Updated to 2.6.1 (#1465417) - -* Tue Jun 27 2017 Miro Hrončok - 2.6.0-1 -- Updated to 2.6.0 (#1465417) - -* Wed May 03 2017 Miro Hrončok - 0-0.1.20170501git1ad7ddb -- New package +%autochangelog diff --git a/sources b/sources index 954a2e6..a9a42f4 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (libsavitar-4.13.1.tar.gz) = ad9a22ea996ffa2c042f9935fb457894a24dfbe39a0608476c501b7999e1d1c3b5dcb65f9ff20367d37b5af08796f27794f743cebb6a88ab1c9e7bf878772f9b +SHA512 (libsavitar-5.3.0.tar.gz) = 64420ef49c73b3e4306e2d1a43487bc0f0ddc78c4b274cd05e51d82cbcb8e96a435d9d7f753be3eb52794750f87e70856c556a29a2973aabce1a61621fa90493 +SHA512 (pySavitar-5.3.0.tar.gz) = 40766ea7b6e8af7c152aa67a0ec4005c2150e884e6556e404b552daab370c67bee8e62d6581416a4125529dffea3f17c0c0b2e8b8591df971ec56094c7a97659