%global forgeurl0 https://gitlab.freedesktop.org/mateosss/basalt/ %global commit0 ab5a3c72143a8b215cdca3115cb77d4d5413a502 %global date 20241104 # Submodules in forgeurl0 %global forgeurl1 https://github.com/CLIUtils/CLI11/ %global commit1 4af78beef777e313814b4daff70e2da9171a385a %global forgeurl2 https://github.com/stevenlovegrove/Pangolin/ %global commit2 2e67335fde01e25328160d92de660566806e92fa %global forgeurl3 https://gitlab.freedesktop.org/mateosss/basalt-headers/ %global commit3 81face5662edc2f08d8df796e26f78ba475557db %global forgeurl4 https://github.com/Neargye/magic_enum/ %global commit4 3d1f6a5a2a3fbcba077e00ad0ccc2dd9fefc2ca7 %global forgeurl5 https://github.com/laurentkneip/opengv/ %global commit5 91f4b19c73450833a40e463ad3648aae80b3a7f3 %global forgeurl6 https://github.com/strasdat/Sophus/ %global commit6 8e1941677ef214aab0397608f42b18fbe1a19885 %global forgeurl7 https://github.com/USCiLab/cereal/ %global commit7 ebef1e929807629befafbb2918ea1a08c7194554 %global forgeurl8 https://gitlab.com/libeigen/eigen/ %global commit8 3147391d946bb4b6c68edd901f2add6ac1f31f8c %global forgeurl9 https://github.com/ros/console_bridge/ %global commit9 f0b423c0c2d02651db1776c96887c0a314908063 %global forgeurl10 https://github.com/ros/ros_comm/ %global commit10 194c776737134a429619f6851f1850734843e210 %global forgeurl11 https://github.com/NikolausDemmel/roscpp_core/ %global commit11 1a74781ce707b1a2198d1bd6799b892b3c1fa195 %global forgeurl12 https://github.com/google/benchmark %global commit12 f91b6b42b1b9854772a90ae9501464a161707d1e %global forgeurl13 https://github.com/google/googletest/ %global commit13 e2239ee6043f73722e7aa812a459f54a28552929 %forgemeta Name: basalt # FIXME: upstream versioning is commit based, using soname version Version: 2.0.1 Release: %autorelease Summary: Visual-Inertial Mapping with Non-Linear Factor Recovery License: BSD-3-Clause URL: %{forgeurl0} Source0: %{forgesource0} # License: BSD-3-Clause Source1: %{forgeurl1}/archive/%{commit1}/CLI11-%{commit1}.tar.gz # License: MIT Source2: %{forgeurl2}/archive/%{commit2}/Pangolin-%{commit2}.tar.gz # License: BSD-3-Clause Source3: %{forgeurl3}/-/archive/%{commit3}/basalt-headers-%{commit3}.tar.bz2 # License: MIT Source4: %{forgeurl4}/archive/%{commit4}/magic_enum-%{commit4}.tar.gz # License: BSD-3-Clause Source5: %{forgeurl5}/archive/%{commit5}/opengv-%{commit5}.tar.gz # License: MIT Source6: %{forgeurl6}/archive/%{commit6}/Sophus-%{commit6}.tar.gz # License: BSD-3-Clause Source7: %{forgeurl7}/archive/%{commit7}/cereal-%{commit7}.tar.gz # License: MPL-2.0 Source8: %{forgeurl8}/-/archive/%{commit8}/eigen-%{commit8}.tar.bz2 # License: BSD-3-Clause Source9: %{forgeurl9}/archive/%{commit9}/console_bridge-%{commit9}.tar.gz # License: FIXME - unknown Source10: %{forgeurl10}/archive/%{commit10}/ros_comm-%{commit10}.tar.gz # License: FIXME - unknown Source11: %{forgeurl11}/archive/%{commit11}/roscpp_core-%{commit11}.tar.gz # License: Apache - 2.0 Source12: %{forgeurl12}/archive/%{commit12}/benchmark-%{commit12}.tar.gz # License: BSD-3-Clause Source13: %{forgeurl13}/archive/%{commit13}/googletest-%{commit13}.tar.gz # https://gitlab.freedesktop.org/mateosss/basalt/-/merge_requests/56 Patch1: https://gitlab.freedesktop.org/mateosss/basalt/-/merge_requests/56.patch BuildRequires: boost-devel BuildRequires: cmake BuildRequires: doxygen BuildRequires: gcc-c++ BuildRequires: git BuildRequires: ninja-build BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(catch2) BuildRequires: pkgconfig(CLI11) BuildRequires: pkgconfig(eigen3) BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(fmt) BuildRequires: pkgconfig(glew) #BuildRequires: pkgconfig(benchmark) #BuildRequires: pkgconfig(gtest) BuildRequires: pkgconfig(liblz4) BuildRequires: pkgconfig(magic_enum) BuildRequires: pkgconfig(opencv) BuildRequires: pkgconfig(opengl) BuildRequires: pkgconfig(tbb) BuildRequires: pkgconfig(xkbcommon) # Best effort commit to version mapping for all thirdparty sources # Fedora pkgconfig(CLI11) = 2.4.2 #Provides: bundled(CLI11) = 2.0.0 # FIXME: Even with this added to basalt-headers the old pangolin.so # is listed as a Requires vs being statically linked Provides: bundled(pangolin) = 0.6 # No upstream versioning Provides: bundled(basalt-headers) # Fedora pkgconfig(magic_enum) = 0.9.5 #Provides: bundled(magic_enum) = 0.7.3 # No upstream versioning Provides: bundled(opengv) Provides: bundled(sophus) = 1.22.10 Provides: bundled(cereal) = 1.3.2 # Fedora pkgconfig(eigen3) = 3.4.0 Provides: bundled(eigen3) = 3.4.0 Provides: bundled(console_bridge) = 0.4.3 # Commit never included in a tag Provides: bundled(ros_com) # Commit never included in a tag Provides: bundled(roscpp_core) # Fedora pkgconfig(benchmark) = 1.8.3 Provides: bundled(benchmark) = 1.6.0 # Fedora pkgconfig(gtest) = 1.13.0 Provides: bundled(gtest) = 1.11.0 %description This project contains tools for: Camera, IMU and motion capture calibration. Visual-inertial odometry and mapping. Simulated environment to test different components of the system. %package devel Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Development files for Basalt %description devel Devel information for Basalt. %prep %forgesetup # Extract libraries that are bundled #tar -xvf %{SOURCE1} --strip-components 1 -C thirdparty/CLI11 ln -s /usr/include/CLI thirdparty/CLI11/include tar -xvf %{SOURCE2} --strip-components 1 -C thirdparty/Pangolin tar -xvf %{SOURCE3} --strip-components 1 -C thirdparty/basalt-headers #tar -xvf %{SOURCE4} --strip-components 1 -C thirdparty/magic_enum mkdir -p thirdparty/magic_enum/include find /usr/include -maxdepth 1 -type f -name 'magic_enum*.hpp' -exec ln -s -t thirdparty/magic_enum/include {} \; tar -xvf %{SOURCE5} --strip-components 1 -C thirdparty/opengv tar -xvf %{SOURCE6} --strip-components 1 -C thirdparty/basalt-headers/thirdparty/Sophus tar -xvf %{SOURCE7} --strip-components 1 -C thirdparty/basalt-headers/thirdparty/cereal tar -xvf %{SOURCE8} --strip-components 1 -C thirdparty/basalt-headers/thirdparty/eigen # XXX: custom cmake functions seem to be getting in the way here #ln -s /usr/include/eigen3 thirdparty/basalt-headers/thirdparty/eigen tar -xvf %{SOURCE9} --strip-components 1 -C thirdparty/ros/console_bridge tar -xvf %{SOURCE10} --strip-components 1 -C thirdparty/ros/ros_comm tar -xvf %{SOURCE11} --strip-components 1 -C thirdparty/ros/roscpp_core tar -xvf %{SOURCE12} --strip-components 1 -C thirdparty/basalt-headers/test/benchmark # Doesn't work due to the use of add_subdirectory() expecting CMakeLists.txt #ln -s /usr/include/benchmark thirdparty/basalt-headers/test/benchmark tar -xvf %{SOURCE13} --strip-components 1 -C thirdparty/basalt-headers/test/googletest # Doesn't work due to the use of add_subdirectory() expecting CMakeLists.txt #ln -s /usr/include/gtest thirdparty/basalt-headers/test/googletest %autopatch -p1 %build # W: package-with-huge-docs 83% # Eigen3 attempt to unbundle, likely need to patch cmake configs of basalt-headers # -DBASALT_BUILTIN_EIGEN=off \ # -DEIGEN3_INCLUDE_DIR=%{_includedir}/eigen3 \ # -DEIGEN3_DIR=%{_includedir}/eigen3 \ # -- Finding external Eigen # CMake Error at thirdparty/basalt-headers/CMakeLists.txt:77 (get_target_property): # get_target_property() called with non-existent target "Eigen3::Eigen". # Call Stack (most recent call first): # thirdparty/basalt-headers/CMakeLists.txt:105 (report_dependency_location) %cmake -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DEIGEN_ROOT=%{_includedir}/eigen3 \ -DBASALT_BUILD_SHARED_LIBRARY_ONLY=on \ -DBUILD_TESTS=off \ # -DBUILD_TESTS=on \ #/usr/bin/ld: cannot find -ltest_uris: No such file or directory #/usr/bin/ld: cannot find -ltest_vars: No such file or directory #/usr/bin/ld: cannot find -ltest_video_uris: No such file or directory #/usr/bin/ld: cannot find -ltest_video_loading: No such file or directory %cmake_build %install %cmake_install %check %ctest %files %license LICENSE %doc README.md doc/*.md %{_libdir}/libbasalt.so.2 %{_libdir}/libbasalt.so.2.0.1 %{_datarootdir}/basalt %files devel %license LICENSE %{_libdir}/libbasalt.so %{_libdir}/pkgconfig/basalt.pc %changelog %autochangelog