blob: b97719bb4805f34ca55f153c410499eb47e709fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
inherit git-2 elisp-common autotools dotnet eutils
EGIT_REPO_URI="git://github.com/fsharp/fsharpbinding.git"
DESCRIPTION="The F# Compiler"
HOMEPAGE="https://github.com/fsharp/fsharpbinding"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS=""
IUSE="-emacs +monodevelop"
MAKEOPTS="-j1" #nowarn
DEPEND="dev-lang/fsharp
monodevelop? ( dev-util/monodevelop )
emacs? ( >=virtual/emacs-${NEED_EMACS:-21} app-emacs/s app-emacs/dash app-emacs/auto-complete )"
RDEPEND="${DEPEND}"
pkg_setup() {
dotnet_pkg_setup
if use emacs; then
elisp-need-emacs "${NEED_EMACS:-21}"
case $? in
0) ;;
1) die "Emacs version too low" ;;
*) die "Could not determine Emacs version" ;;
esac
fi
}
src_unpack() {
git-2_src_unpack
if use emacs; then
cd "${S}/emacs"
if [[ -f ${P}.el ]]; then
# the "simple elisp" case with a single *.el file in WORKDIR
mv ${P}.el ${PN}.el || die
[[ -d ${S} ]] || S=${WORKDIR}
fi
fi
}
src_configure() {
if use monodevelop; then
cd "${S}/monodevelop"
addpredict "/etc/mono/registry"
./configure.sh || die "configure failed"
fi
}
src_compile() {
if use emacs; then
cd "${S}/emacs"
elisp-compile *.el
if [[ -n ${ELISP_TEXINFO} ]]; then
makeinfo ${ELISP_TEXINFO} || die
fi
fi
#TODO: mdtool fails to setup...
if use monodevelop; then
cd "${S}/monodevelop"
emake pack
#PACKVERSION=`cat Makefile | head -n 7 | tail -n 1 | grep -o "[0-9]\+.[0-9]\+.[0-9]\+\(.[0-9]\+\)\?"`
#mdtool setup pack bin/mac-linux/Debug/FSharpBinding.dll -d:pack/${PACKVERSION}/mac-linux/Debug
fi
}
src_install() {
if use monodevelop; then
dodir /usr/lib/monodevelop/Packs
insinto /usr/lib/monodevelop/Packs
PACKVERSION=`cat monodevelop/Makefile | head -n 7 | tail -n 1 | grep -o "[0-9]\+.[0-9]\+.[0-9]\+\(.[0-9]\+\)\?"`
elog "Using Packversion: ${PACKVERSION}"
newins "monodevelop/pack/${PACKVERSION}/mac-linux/Debug/MonoDevelop.FSharpBinding_${PACKVERSION}.mpack" "Monodevelop.FSharpBinding_${PVR}.mpack"
fi
if use emacs; then
cd "${S}/emacs"
elisp-install ${PN} *.el *.elc
if [[ -n ${SITEFILE} ]]; then
elisp-site-file-install "${FILESDIR}/${SITEFILE}"
fi
if [[ -n ${ELISP_TEXINFO} ]]; then
set -- ${ELISP_TEXINFO}
set -- ${@##*/}
doinfo ${@/%.*/.info*}
fi
#AutoComplete:
xbuild "${S}/FSharp.AutoComplete/FSharp.AutoComplete.fsproj" /property:OutputPath="${D}/usr/share/emacs/site-lisp/${PN}/bin/"
fi
# They try to install in the user directory
#if use monodevelop; then
# cd "${S}/monodevelop"
# emake install
#fi
}
pkg_postinst() {
if use emacs; then
elisp-site-regen
if declare -f readme.gentoo_print_elog >/dev/null; then
readme.gentoo_print_elog
fi
ewarn "To install fsharpbindings in emacs add the following lines to your init.el and read https://github.com/fsharp/fsharpbinding/tree/master/emacs"
ewarn "(autoload 'fsharp-mode \"fsharp-mode\" \"Major mode for editing F# code.\" t)"
ewarn "(add-to-list 'auto-mode-alist '(\"\\.fs[iylx]?$\" . fsharp-mode))"
fi
if use monodevelop; then
ewarn "To install fsharpbinding to monodevelop for your current user execute"
ewarn "mdtool setup install -y /usr/lib/monodevelop/Packs/Monodevelop.FSharpBinding_${PVR}.mpack"
ewarn "Please make sure to manually deinstall all old fsharpbinding versions before using the above command"
ewarn "If you still have problems use:"
ewarn "rm -r ~/.config/MonoDevelop/addins"
ewarn "rm -r ~/.local/share/MonoDevelop-3.0/LocalInstall/Addins"
ewarn "rm -r ~/.local/share/MonoDevelop-4.0/LocalInstall/Addins"
ewarn "Note that this will remove all Addins of the current user."
fi
}
|