darcs-2.8.4-r6.ebuild 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. # ebuild generated by hackport 0.3.9999
  5. CABAL_FEATURES="bin lib profile haddock hoogle hscolour"
  6. inherit eutils haskell-cabal bash-completion-r1
  7. DESCRIPTION="a distributed, interactive, smart revision control system"
  8. HOMEPAGE="http://darcs.net/"
  9. SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz"
  10. LICENSE="GPL-2"
  11. SLOT="0/${PV}"
  12. KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
  13. IUSE="doc test"
  14. RDEPEND="=dev-haskell/extensible-exceptions-0.1*:=[profile?]
  15. >=dev-haskell/hashed-storage-0.5.6:=[profile?]
  16. <dev-haskell/hashed-storage-0.6:=[profile?]
  17. >=dev-haskell/haskeline-0.6.3:=[profile?]
  18. <dev-haskell/haskeline-0.8:=[profile?]
  19. =dev-haskell/html-1.0*:=[profile?]
  20. =dev-haskell/mmap-0.5*:=[profile?]
  21. >=dev-haskell/mtl-1.0:=[profile?]
  22. <dev-haskell/mtl-2.3:=[profile?]
  23. >=dev-haskell/parsec-2.0:=[profile?]
  24. <dev-haskell/parsec-3.2:=[profile?]
  25. =dev-haskell/random-1.0*:=[profile?]
  26. >=dev-haskell/regex-compat-0.95.1:=[profile?]
  27. >=dev-haskell/tar-0.3:=[profile?]
  28. <dev-haskell/tar-0.5:=[profile?]
  29. >=dev-haskell/terminfo-0.3:=[profile?] <dev-haskell/terminfo-0.5:=[profile?]
  30. >=dev-haskell/text-0.11.0.6:=[profile?]
  31. >=dev-haskell/utf8-string-0.3.6:=[profile?] <dev-haskell/utf8-string-0.4:=[profile?]
  32. >=dev-haskell/vector-0.7:=[profile?]
  33. >=dev-haskell/zlib-0.5.1.0:=[profile?]
  34. <dev-haskell/zlib-0.6.0.0:=[profile?]
  35. >=dev-lang/ghc-6.10.4:=
  36. net-misc/curl"
  37. DEPEND="${RDEPEND}
  38. >=dev-haskell/cabal-1.8
  39. doc? ( virtual/latex-base
  40. || ( dev-tex/latex2html[png]
  41. dev-tex/latex2html[gif]
  42. )
  43. )
  44. test? ( >=dev-haskell/cmdlib-0.2.1[profile?]
  45. <dev-haskell/cmdlib-0.4[profile?]
  46. =dev-haskell/findbin-0.0*[profile?]
  47. >=dev-haskell/quickcheck-2.3
  48. >=dev-haskell/shellish-0.1.3[profile?]
  49. <dev-haskell/shellish-0.2[profile?]
  50. >=dev-haskell/test-framework-0.4.0[profile?]
  51. >=dev-haskell/test-framework-hunit-0.2.2[profile?]
  52. >=dev-haskell/test-framework-quickcheck2-0.2.8[profile?]
  53. )
  54. "
  55. src_prepare() {
  56. rm "${S}/tests/add_permissions.sh" || die "Could not rm add_permissions.sh"
  57. rm "${S}/tests/send-output-v1.sh" || die "Could not rm send-output-v1.sh"
  58. rm "${S}/tests/send-output-v2.sh" || die "Could not rm send-output-v2.sh"
  59. rm "${S}/tests/utf8.sh" || die "Could not rm utf8.sh"
  60. epatch "${FILESDIR}"/${P}-ghc-7.8-part-1.patch
  61. epatch "${FILESDIR}"/${P}-ghc-7.8-part-2.patch
  62. epatch "${FILESDIR}"/${P}-fix-nonatomic-global.patch
  63. epatch "${FILESDIR}"/${P}-issue2364.patch
  64. epatch "${FILESDIR}"/${P}-issue2364-part-2.patch
  65. cabal_chdeps \
  66. 'text >= 0.11.0.6 && < 0.12.0.0' 'text >= 0.11.0.6' \
  67. 'terminfo == 0.3.*' 'terminfo >= 0.3 && < 0.5' \
  68. 'array >= 0.1 && < 0.5' 'array >= 0.1 && <0.6' \
  69. 'process >= 1.0.0.0 && < 1.2.0.0' 'process >= 1.0.0.0 && < 1.3' \
  70. 'unix >= 1.0 && < 2.7' 'unix >=1.0 && <2.8' \
  71. 'base >= 4.5 && < 4.7' 'base >= 4.5 && < 4.8' \
  72. 'ghc >= 6.10 && < 7.8' 'ghc >= 6.10' \
  73. 'mtl >= 1.0 && < 2.2' 'mtl >= 1.0 && < 2.3'
  74. }
  75. src_configure() {
  76. # checking whether ghc supports -threaded flag
  77. # Beware: http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#options-linker
  78. # contains: 'The ability to make a foreign call that does not block all other Haskell threads.'
  79. # It might have interactivity impact.
  80. threaded_flag=""
  81. if $(ghc-getghc) --info | grep "Support SMP" | grep -q "YES"; then
  82. threaded_flag="--flags=threaded"
  83. einfo "$P will be built with threads support"
  84. else
  85. threaded_flag="--flags=-threaded"
  86. einfo "$P will be built without threads support"
  87. fi
  88. # Use curl for net stuff to avoid strict version dep on HTTP and network
  89. cabal_src_configure \
  90. --flags=curl \
  91. --flags=-http \
  92. --flags=color \
  93. --flags=terminfo \
  94. --flags=mmap \
  95. --flags=force-char8-encoding \
  96. $threaded_flag \
  97. $(cabal_flag test)
  98. }
  99. src_test() {
  100. # run cabal test from haskell-cabal
  101. haskell-cabal_src_test || die "cabal test failed"
  102. }
  103. src_install() {
  104. cabal_src_install
  105. newbashcomp "${S}/contrib/darcs_completion" "${PN}"
  106. # fixup perms in such an an awkward way
  107. mv "${ED}/usr/share/man/man1/darcs.1" "${S}/darcs.1" || die "darcs.1 not found"
  108. doman "${S}/darcs.1" || die "failed to register darcs.1 as a manpage"
  109. }
  110. pkg_postinst() {
  111. ghc-package_pkg_postinst
  112. ewarn "NOTE: in order for the darcs send command to work properly,"
  113. ewarn "you must properly configure your mail transport agent to relay"
  114. ewarn "outgoing mail. For example, if you are using ssmtp, please edit"
  115. ewarn "${EPREFIX}/etc/ssmtp/ssmtp.conf with appropriate values for your site."
  116. }