aboutsummaryrefslogtreecommitdiff
blob: aebbd074322a160edc349c5c5e9ac25458533591 (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="6"
KEYWORDS="~amd64 ~x86"

RESTRICT="mirror"

SLOT="0"
if [ "${SLOT}" != "0" ]; then
	APPENDIX="-${SLOT}"
fi

USE_DOTNET="net45"
IUSE="+${USE_DOTNET} developer nupkg debug"

inherit versionator xbuild nupkg

HOMEPAGE="https://github.com/nant/${NAME}"
DESCRIPTION=".NET build tool"
LICENSE="GPL-2"

EGIT_COMMIT="e3644541bf083d8e33f450bfbd1a4147e494769c"
EGIT_BRANCH="master"
GITHUBNAME="nant/nant"
GITHUBACC=${GITHUBNAME%/*}
GITHUBREPO=${GITHUBNAME#*/}
GITFILENAME=${GITHUBREPO}-${GITHUBACC}-${PV}-${EGIT_COMMIT}
GITHUB_ZIP="https://api.github.com/repos/${GITHUBACC}/${GITHUBREPO}/zipball/${EGIT_COMMIT} -> ${GITFILENAME}.zip"
SRC_URI="${GITHUB_ZIP}"
S="${WORKDIR}/${GITFILENAME}"

RDEPEND=">=dev-lang/mono-4.4.0.40
	!dev-dotnet/nant
	nupkg? ( dev-dotnet/nuget )"
DEPEND="${RDEPEND}
	virtual/pkgconfig
"

SLN_FILE=NAnt.sln
METAFILETOBUILD="${S}/${SLN_FILE}"

# This build is not parallel build friendly
#MAKEOPTS="${MAKEOPTS} -j1"

src_unpack() {
	default_src_unpack
	mv "${WORKDIR}/${GITHUBACC}-${GITHUBREPO}-"* "${WORKDIR}/${GITFILENAME}" || die
}

src_prepare() {
	dotnet_pkg_setup
	find ${S} -type f -iname "*.csproj" -exec sed -i "s/Microsoft.CSharp.Targets/Microsoft.CSharp.targets/g" {} \; || die
	eapply_user
}

src_compile() {
	exbuild "${METAFILETOBUILD}"
	enuspec "${FILESDIR}/${SLN_FILE}.nuspec"
}

src_install() {
	DIR=""
	if use debug; then
		DIR="Debug"
	else
		DIR="Release"
	fi

	insinto "/usr/share/nant/"
	doins build/${DIR}/*

	make_wrapper nant "mono /usr/share/nant/NAnt.exe"

	enupkg "${WORKDIR}/NAnt.0.93.5019.nupkg"

	dodoc README.txt
}