alicevision-9999.ebuild 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Copyright 1999-2020 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit cmake toolchain-funcs
  5. if [[ ${PV} == 9999 ]]; then
  6. inherit git-r3
  7. EGIT_REPO_URI="https://github.com/alicevision/AliceVision"
  8. EGIT_SUBMODULES=( src/dependencies/osi_clp src/dependencies/nanoflann src/dependencies/MeshSDFilter )
  9. EGIT_BRANCH="master"
  10. #EGIT_OVERRIDE_COMMIT="6ac5c4e96eb47e6733be28aa2d8b23cc2f4b019b"
  11. KEYWORDS=""
  12. else
  13. KEYWORDS="~amd64 ~x86"
  14. NANOFLANN_GIT_COMMIT=cc77e17934441dc82b33fd00e0a8a1398f24c928
  15. OSI_CLP_GIT_COMMIT=38ab28d1c5a53de13c8684cdc272b1deb8cef459
  16. MESHSDFILTER_GIT_COMMIT=b7dfeed64be90f2eff49345cf65451b700d3a417
  17. SRC_URI="https://github.com/alicevision/AliceVision/archive/v$PV.tar.gz -> $P.tar.gz
  18. https://github.com/alicevision/nanoflann/archive/$NANOFLANN_GIT_COMMIT.tar.gz -> nanoflann-$NANOFLANN_GIT_COMMIT.tar.gz
  19. https://github.com/alicevision/osi_clp/archive/$OSI_CLP_GIT_COMMIT.tar.gz -> osi_clp-$OSI_CLP_GIT_COMMIT.tar.gz
  20. https://github.com/alicevision/MeshSDFilter/archive/$MESHSDFILTER_GIT_COMMIT.tar.gz -> meshsdfilter-$MESHSDFILTER_GIT_COMMIT.tar.gz"
  21. fi
  22. DESCRIPTION="Photogrammetric framework which provides a 3D Reconstruction and Camera Tracking"
  23. HOMEPAGE="http://alicevision.github.io"
  24. SLOT="0"
  25. LICENSE="MPL-2.0"
  26. IUSE="alembic cuda cctag doc popsift geogram magma mosek opencv opengv openmp test examples ute"
  27. DEPEND="
  28. >=dev-libs/boost-1.60.0
  29. >=dev-cpp/eigen-3.3.4
  30. sci-libs/flann
  31. sci-libs/lemon[coin]
  32. magma? ( sci-libs/magma )
  33. media-libs/openexr:0
  34. sci-libs/ceres-solver[sparse,lapack]
  35. sys-libs/zlib
  36. x11-libs/libXxf86vm
  37. media-libs/libpng
  38. media-libs/libjpeg-turbo:=
  39. >=x11-libs/libXi-1.6.0:=
  40. x11-libs/libXrandr:=
  41. media-libs/freetype:=
  42. media-libs/glu:=
  43. media-libs/glfw:=
  44. media-gfx/openmesh:=
  45. cuda? ( dev-util/nvidia-cuda-toolkit )
  46. media-libs/openimageio
  47. opengv? ( media-libs/opengv )
  48. alembic? ( media-gfx/alembic )
  49. opencv? ( media-libs/opencv[contribxfeatures2d] )
  50. geogram? ( >=sci-libs/geogram-1.5.4 )
  51. mosek? ( =sci-libs/mosek-bin-5.0.0 )
  52. ute? ( sci-libs/ute-lib )
  53. doc? (
  54. >=app-doc/doxygen-1.7.0
  55. dev-python/sphinx
  56. )
  57. "
  58. PATCHES=(
  59. "${FILESDIR}/submodule.patch"
  60. "${FILESDIR}/cmake-fix-linking.patch"
  61. )
  62. RDEPEND=""
  63. RESTRICT="mirror"
  64. src_unpack() {
  65. if [[ ${PV} == 9999 ]]; then
  66. git-r3_src_unpack
  67. else
  68. S="${WORKDIR}/AliceVision-${PV/_*}"
  69. unpack ${P}.tar.gz
  70. cd ${S}
  71. unpack nanoflann-${NANOFLANN_GIT_COMMIT}.tar.gz
  72. rmdir src/dependencies/nanoflann
  73. mv nanoflann-${NANOFLANN_GIT_COMMIT} src/dependencies/nanoflann
  74. unpack osi_clp-${OSI_CLP_GIT_COMMIT}.tar.gz
  75. rmdir src/dependencies/osi_clp
  76. mv osi_clp-${OSI_CLP_GIT_COMMIT} src/dependencies/osi_clp
  77. unpack meshsdfilter-${MESHSDFILTER_GIT_COMMIT}.tar.gz
  78. rmdir src/dependencies/MeshSDFilter
  79. mv MeshSDFilter-${MESHSDFILTER_GIT_COMMIT} src/dependencies/MeshSDFilter
  80. fi
  81. }
  82. pkg_pretend() {
  83. [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
  84. }
  85. src_prepare() {
  86. cmake_src_prepare
  87. # set std=c++14
  88. sed -i -e "s|\(set(CMAKE_CXX_STANDARD \)11|\114|" src/CMakeLists.txt || die
  89. # drop Werror
  90. sed -i -e 's|-Werror||' src/CMakeLists.txt || die
  91. }
  92. src_configure() {
  93. CMAKE_BUILD_TYPE=Release
  94. local mycmakeargs=(
  95. -DALICEVISION_BUILD_DEPENDENCIES=OFF
  96. -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
  97. -DCMAKE_INSTALL_LIBDIR="$(get_libdir)"
  98. -DALICEVISION_USE_INTERNAL_FLANN=ON # Todo unbundle
  99. -DCERES_INCLUDE_DIRS="/usr/include/ceres"
  100. -DFLANN_INCLUDE_DIR_HINTS="/usr/include/flann"
  101. -DCOINUTILS_INCLUDE_DIR_HINTS="/usr/include/coin"
  102. -DLEMON_INCLUDE_DIR_HINTS="/usr/include/lemon"
  103. -DCLP_INCLUDE_DIR_HINTS="/usr/include/coin"
  104. -DOSI_INCLUDE_DIR_HINTS="/usr/include/coin"
  105. -DMOSEK_LIB=$(usex mosek ON OFF)
  106. -DMOSEK_SEARCH_HEADER="/opt/mosek/usr/include"
  107. -DMOSEK_SEARCH_LIB="/opt/mosek/usr/lib"
  108. -DALICEVISION_USE_OPENMP=$(usex openmp ON OFF)
  109. -DALICEVISION_USE_CCTAG=$(usex cctag ON OFF)
  110. -DCCTag_DIR:PATH="/usr/lib/cmake/CCTag"
  111. -DALICEVISION_USE_OPENGV=$(usex opengv ON OFF)
  112. -DALICEVISION_USE_ALEMBIC=$(usex alembic ON OFF)
  113. -DALICEVISION_USE_CUDA=$(usex cuda ON OFF)
  114. -DCUDA_INCLUDE_DIRS:PATH="/opt/cuda/include"
  115. -DCUDA_NVCC_EXECUTABLE="/opt/cuda/bin/nvcc"
  116. -DALICEVISION_USE_POPSIFT=$(usex popsift ON OFF)
  117. #-DPopSift_DIR:PATH="/usr/lib/cmake/PopSift"
  118. -DALICEVISION_USE_UNCERTAINTYTE=$(usex ute ON OFF)
  119. #-DUNCERTAINTYTE_DIR:PATH="/path/to/uncertaintyTE/install/""
  120. #-DMAGMA_ROOT:PATH="/path/to/magma/install/"
  121. -DALICEVISION_USE_OPENCV=$(usex opencv ON OFF)
  122. #-DOPENCV_DIR:PATH="/usr/share/opencv4/"
  123. -DALICEVISION_REQUIRE_CERES_WITH_SUITESPARSE=ON
  124. #-DALICEVISION_BUILD_SHARED=ON
  125. -DALICEVISION_BUILD_TESTS=$(usex test ON OFF)
  126. -DALICEVISION_BUILD_DOC=$(usex doc ON OFF)
  127. -DALICEVISION_BUILD_EXAMPLES=$(usex examples ON OFF)
  128. -DALICEVISION_BUILD_COVERAGE=OFF #$(tc-is-gcc && echo ON || echo OFF)
  129. )
  130. cmake_src_configure
  131. }