1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils versionator
9 IUSE="gtk doc static debug threads +ocamlopt test"
11 DESCRIPTION="Two-way cross-platform file synchronizer"
12 HOMEPAGE="http://www.cis.upenn.edu/~bcpierce/unison/"
14 SLOT="$(get_version_component_range 1-2 ${PV})"
15 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris"
17 # ocaml version so we are sure it has ocamlopt use flag
18 DEPEND=">=dev-lang/ocaml-3.10.2[ocamlopt?]
19 gtk? ( >=dev-ml/lablgtk-2.2 )
20 test? ( || ( dev-util/ctags virtual/emacs ) )"
22 RDEPEND="gtk? ( >=dev-ml/lablgtk-2.2
23 || ( net-misc/x11-ssh-askpass net-misc/ssh-askpass-fullscreen ) )
25 app-eselect/eselect-unison"
27 #PDEPEND="gtk? ( media-fonts/font-schumacher-misc )"
29 SRC_URI="http://www.cis.upenn.edu/~bcpierce/unison/download/releases/${P}/${P}.tar.gz
30 doc? ( http://www.cis.upenn.edu/~bcpierce/unison/download/releases/${P}/${P}-manual.pdf
31 http://www.cis.upenn.edu/~bcpierce/unison/download/releases/${P}/${P}-manual.html )"
34 epatch "${FILESDIR}/${PN}-2.27.57-as-needed.patch"
35 epatch "${FILESDIR}/${PN}-mymap.patch"
42 myconf="$myconf THREADS=true"
46 myconf="$myconf STATIC=true"
50 myconf="$myconf DEBUGGING=true"
54 myconf="$myconf UISTYLE=gtk2"
56 myconf="$myconf UISTYLE=text"
59 use ocamlopt || myconf="$myconf NATIVE=false"
61 # Discard cflags as it will try to pass them to ocamlc...
62 emake $myconf CFLAGS="" buildexecutable || die "error making unsion"
66 emake selftest || die "selftest failed"
70 # install manually, since it's just too much
71 # work to force the Makefile to do the right thing.
72 newbin unison unison-${SLOT} || die
73 dodoc BUGS.txt CONTRIB INSTALL NEWS \
74 README ROADMAP.txt TODO.txt || die
77 dohtml "${DISTDIR}/${P}-manual.html" || die
78 dodoc "${DISTDIR}/${P}-manual.pdf" || die
80 use ocamlopt || export STRIP_MASK="*/bin/*"
84 elog "Unison now uses SLOTs, so you can specify servercmd=/usr/bin/unison-${SLOT}"
85 elog "in your profile files to access exactly this version over ssh."
86 elog "Or you can use 'eselect unison' to set the version."