unison-2.48.4.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils versionator
  5. IUSE="gtk doc static debug threads +ocamlopt test"
  6. DESCRIPTION="Two-way cross-platform file synchronizer"
  7. HOMEPAGE="https://www.seas.upenn.edu/~bcpierce/unison/"
  8. LICENSE="GPL-2"
  9. SLOT="$(get_version_component_range 1-2 ${PV})"
  10. KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris"
  11. # ocaml version so we are sure it has ocamlopt use flag
  12. DEPEND="dev-lang/ocaml[ocamlopt?]
  13. gtk? ( dev-ml/lablgtk )
  14. test? ( || ( dev-util/ctags virtual/emacs ) )"
  15. RDEPEND="gtk? ( dev-ml/lablgtk
  16. || ( net-misc/x11-ssh-askpass net-misc/ssh-askpass-fullscreen ) )
  17. !net-misc/unison:0
  18. app-eselect/eselect-unison"
  19. #PDEPEND="gtk? ( media-fonts/font-schumacher-misc )"
  20. SRC_URI="https://www.seas.upenn.edu/~bcpierce/unison/download/releases/${P}/${P}.tar.gz
  21. doc? ( https://www.seas.upenn.edu/~bcpierce/unison/download/releases/${P}/${P}-manual.pdf
  22. https://www.seas.upenn.edu/~bcpierce/unison/download/releases/${P}/${P}-manual.html )"
  23. S="${WORKDIR}"/src
  24. src_compile() {
  25. local myconf
  26. if use threads; then
  27. myconf="$myconf THREADS=true"
  28. fi
  29. if use static; then
  30. myconf="$myconf STATIC=true"
  31. fi
  32. if use debug; then
  33. myconf="$myconf DEBUGGING=true"
  34. fi
  35. if use gtk; then
  36. myconf="$myconf UISTYLE=gtk2"
  37. else
  38. myconf="$myconf UISTYLE=text"
  39. fi
  40. use ocamlopt || myconf="$myconf NATIVE=false"
  41. # Discard cflags as it will try to pass them to ocamlc...
  42. emake $myconf CFLAGS="" buildexecutable
  43. }
  44. src_test() {
  45. emake selftest
  46. }
  47. src_install () {
  48. # install manually, since it's just too much
  49. # work to force the Makefile to do the right thing.
  50. newbin unison unison-${SLOT}
  51. dodoc BUGS.txt CONTRIB INSTALL NEWS \
  52. README ROADMAP.txt TODO.txt
  53. if use doc; then
  54. dohtml "${DISTDIR}/${P}-manual.html"
  55. dodoc "${DISTDIR}/${P}-manual.pdf"
  56. fi
  57. use ocamlopt || export STRIP_MASK="*/bin/*"
  58. }
  59. pkg_postinst() {
  60. elog "Unison now uses SLOTs, so you can specify servercmd=/usr/bin/unison-${SLOT}"
  61. elog "in your profile files to access exactly this version over ssh."
  62. elog "Or you can use 'eselect unison' to set the version."
  63. eselect unison update
  64. }