Gentoo Archives: gentoo-commits

From: Heather Cynede <cynede@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/dotnet:master commit in: dev-dotnet/libgit2sharp/files/, dev-dotnet/libgit2sharp/
Date: Wed, 27 Jul 2016 06:39:45
Message-Id: 1469595052.8e7c529c0919d9011d11883ce03b28eb27b2198e.cynede@gentoo
1 commit: 8e7c529c0919d9011d11883ce03b28eb27b2198e
2 Author: ArsenShnurkov <Arsen.Shnurkov <AT> gmail <DOT> com>
3 AuthorDate: Wed Jul 27 04:50:52 2016 +0000
4 Commit: Heather Cynede <cynede <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 27 04:50:52 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=8e7c529c
7
8 gac and nupkg installation added
9
10 .../libgit2sharp/files/nuspec-file-list.patch | 13 +++++
11 dev-dotnet/libgit2sharp/libgit2sharp-0.22.ebuild | 61 ++++++++++++++++++++--
12 2 files changed, 70 insertions(+), 4 deletions(-)
13
14 diff --git a/dev-dotnet/libgit2sharp/files/nuspec-file-list.patch b/dev-dotnet/libgit2sharp/files/nuspec-file-list.patch
15 new file mode 100644
16 index 0000000..8623a2b
17 --- /dev/null
18 +++ b/dev-dotnet/libgit2sharp/files/nuspec-file-list.patch
19 @@ -0,0 +1,13 @@
20 +--- a/nuget.package/LibGit2Sharp.nuspec 2016-03-04 19:26:33.000000000 +0300
21 ++++ b/nuget.package.new/LibGit2Sharp.nuspec 2016-07-27 07:25:06.091068466 +0300
22 +@@ -14,9 +14,6 @@
23 + <tags>libgit2 git wrapper bindings API dvcs vcs</tags>
24 + </metadata>
25 + <files>
26 +- <file src="..\README.md" target="App_Readme\LibGit2Sharp.README.md" />
27 +- <file src="..\LICENSE.md" target="App_Readme\LibGit2Sharp.LICENSE.md" />
28 +- <file src="..\CHANGES.md" target="App_Readme\LibGit2Sharp.CHANGES.md" />
29 +- <file src="bin\$configuration$\$id$.pdb" target="lib\net40" />
30 ++ <file src="LibGit2Sharp/bin/$configuration$/$id$.dll" target="lib/net40" />
31 + </files>
32 + </package>
33
34 diff --git a/dev-dotnet/libgit2sharp/libgit2sharp-0.22.ebuild b/dev-dotnet/libgit2sharp/libgit2sharp-0.22.ebuild
35 index f2c69b7..8e9c5e9 100644
36 --- a/dev-dotnet/libgit2sharp/libgit2sharp-0.22.ebuild
37 +++ b/dev-dotnet/libgit2sharp/libgit2sharp-0.22.ebuild
38 @@ -5,7 +5,8 @@
39 EAPI=6
40
41 USE_DOTNET="net45"
42 -IUSE="${USE_DOTNET}"
43 +EBUILD_FRAMEWORK="4.5"
44 +IUSE="${USE_DOTNET} +gac +nupkg"
45
46 inherit nuget nupkg
47
48 @@ -15,7 +16,8 @@ DESCRIPTION="A C# PInvoke wrapper library for LibGit2 C library"
49
50 EGIT_COMMIT="8daef23223e1374141bf496e4b310ded9ae4639e"
51 HOMEPAGE="https://github.com/libgit2/libgit2sharp"
52 -SRC_URI="${HOMEPAGE}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
53 +SRC_URI="${HOMEPAGE}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
54 + mirror://gentoo/mono.snk.bz2"
55 #RESTRICT="mirror"
56
57 S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
58 @@ -32,6 +34,12 @@ DEPEND="${CDEPEND}
59 "
60 RDEPEND="${CDEPEND}"
61
62 +prefix=${PREFIX}/usr
63 +exec_prefix=${prefix}
64 +libdir=${exec_prefix}/lib/mono/${EBUILD_FRAMEWORK}
65 +
66 +NUSPEC_FILE="nuget.package/LibGit2Sharp.nuspec"
67 +
68 src_unpack() {
69 default
70 # remove rogue binaries
71 @@ -44,8 +52,19 @@ src_prepare() {
72 eapply "${FILESDIR}/csproj-remove-nuget-targets-check.patch"
73 eapply "${FILESDIR}/packages-config-remove-xunit.patch"
74 eapply "${FILESDIR}/remove-NativeBinaries-package-dependency.patch"
75 + eapply "${FILESDIR}/nuspec-file-list.patch"
76 echo "/usr/lib64/libgit2.so" >"LibGit2Sharp/libgit2_filename.txt" || die
77 enuget_restore "LibGit2Sharp.sln"
78 + sed -i 's=\$id\$=LibGit2Sharp=g' "${NUSPEC_FILE}" || die
79 + sed -i "s=\\\$version\\\$=$(get_version_component_range 1-2)=g" "${NUSPEC_FILE}" || die
80 + sed -i 's=\$author\$=nulltoken=g' "${NUSPEC_FILE}" || die
81 + sed -i "s=\\\$description\\\$=${DESCRIPTION}=g" "${NUSPEC_FILE}" || die
82 + if use debug; then
83 + DIR="Debug"
84 + else
85 + DIR="Release"
86 + fi
87 + sed -i "s=\\\$configuration\\\$=${DIR}=g" "${NUSPEC_FILE}" || die
88 default
89 }
90
91 @@ -54,6 +73,40 @@ src_compile() {
92 sed -i "s#<OutputPath>.*</OutputPath>#<OutputPath>.</OutputPath>#g" "Lib/CustomBuildTasks/CustomBuildTasks.csproj" || die
93 exbuild "Lib/CustomBuildTasks/CustomBuildTasks.csproj"
94
95 - # main compileation
96 - exbuild "LibGit2Sharp.sln"
97 + # main compilation
98 + exbuild_strong "LibGit2Sharp.sln"
99 +
100 + enuspec "${NUSPEC_FILE}"
101 +}
102 +
103 +src_install() {
104 + insinto "${libdir}"
105 + if use debug; then
106 + DIR="Debug"
107 + else
108 + DIR="Release"
109 + fi
110 + doins "LibGit2Sharp/bin/${DIR}/LibGit2Sharp.dll"
111 +
112 + enupkg "${WORKDIR}/LibGit2Sharp.0.22.nupkg"
113 +}
114 +
115 +pkg_postinst() {
116 + if use gac; then
117 + einfo "adding to GAC"
118 + gacutil -i "${libdir}/LibGit2Sharp.dll" || die
119 + fi
120 +
121 + # cd "${WORKDIR}
122 + # nuget push -source "Local NuGet packages" LibGit2Sharp.0.22.nupkg
123 +}
124 +
125 +pkg_postrm() {
126 + if use gac; then
127 + einfo "removing from GAC"
128 + gacutil -u LibGit2Sharp
129 + # don't die, it there is no such assembly in GAC
130 + fi
131 +
132 + # yes | nuget delete -source "Local NuGet packages" LibGit2Sharp 0.22
133 }