mosek-bin-10.0.46.ebuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. PYTHON_COMPAT=( python3_{10..11} )
  5. MY_PN=${PN/-bin/}
  6. MY_PV=$(ver_rs 1-2 '_' $(ver_cut 1-2))
  7. inherit distutils-r1
  8. DESCRIPTION="A commercial solver for mathematical optimization problems."
  9. HOMEPAGE="http://mosek.com/"
  10. SRC_URI="https://download.mosek.com/stable/${PV}/mosektoolslinux64x86.tar.bz2 -> ${P}.tar.bz2"
  11. LICENSE="MOSEK"
  12. SLOT="$(ver_cut 1-1)"
  13. KEYWORDS="amd64"
  14. IUSE="python debug doc"
  15. RESTRICT="mirror"
  16. S="${WORKDIR}"
  17. DISTUTILS_USE_SETUPTOOLS=no
  18. DISTUTILS_OPTIONAL=1
  19. DISTUTILS_USE_PEP517=setuptools
  20. DISTUTILS_SINGLE_IMPL=1
  21. DISTUTILS_EXT=1
  22. RDEPEND="
  23. >=dev-python/numpy-1.11.0[${PYTHON_USEDEP}]
  24. "
  25. DEPEND="${RDEPEND}
  26. dev-python/setuptools[${PYTHON_USEDEP}]
  27. "
  28. QA_PREBUILT="opt/${MY_PN}/usr/lib/{libmosek64.so,libmosekxx$MY_PV.so} opt/${MY_PN}/usr/bin/mosek"
  29. PATCHES=(
  30. ${FILESDIR}/fix-python-version.patch
  31. )
  32. src_prepare() {
  33. default
  34. distutils-r1_src_prepare
  35. }
  36. python_prepare_all() {
  37. python_setup
  38. distutils-r1_python_prepare_all
  39. }
  40. src_compile(){
  41. if use python ; then
  42. cd "${S}/mosek/$(ver_cut 1-2)/tools/platform/linux64x86/python/3/" || die
  43. distutils-r1_src_compile
  44. fi
  45. }
  46. src_install (){
  47. dodir "/opt/${MY_PN}"
  48. # Install shared libraries.
  49. dodir "/opt/${MY_PN}/usr/lib"
  50. insinto "/opt/${MY_PN}/usr/lib"
  51. cd "${S}/mosek/$(ver_cut 1-2)/tools/platform/linux64x86/bin"
  52. #doins "libcilkrts.so.$(ver_cut 1-2)"
  53. doins "libmosek64.so.$(ver_cut 1-2)"
  54. doins "libmosekxx${MY_PV}.so"
  55. dosym "libmosek64.so.$(ver_cut 1-2)" "/opt/${MY_PN}/usr/lib/libmosek64.so"
  56. # Install command line utilities.
  57. cd "${S}/mosek/$(ver_cut 1-2)/tools/platform/linux64x86/bin"
  58. dodir "/opt/${MY_PN}/usr/bin"
  59. insinto "/opt/${MY_PN}/usr/bin"
  60. doins "mosek"
  61. # Install C bindings.
  62. cd "${S}/mosek/$(ver_cut 1-2)/tools/platform/linux64x86/h"
  63. dodir "/opt/${MY_PN}/usr/include"
  64. insinto "/opt/${MY_PN}/usr/include"
  65. doins "mosek.h"
  66. # Install Python bindings.
  67. if use python; then
  68. cd "${S}/mosek/$(ver_cut 1-2)/tools/platform/linux64x86/python/3/" || die
  69. distutils-r1_src_install
  70. fi
  71. cd "${S}"
  72. echo "PATH=\"/opt/${MY_PN}/usr/bin\"" > "99mosek"
  73. echo "LDPATH=\"/opt/${MY_PN}/usr/lib\"" > "99mosek"
  74. insinto "/etc/env.d"
  75. doins "99mosek"
  76. # Install documentation.
  77. if use doc; then
  78. cd "${S}/mosek/$(ver_cut 1-2)"
  79. dodoc mosek-eula.pdf
  80. dodoc doc/xml/*.xml
  81. dodoc doc/*.pdf
  82. #dodoc ${S}/mosek/$(ver_cut 1-2)/tools/examples/*
  83. fi
  84. }