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/monotorrent/, eclass/, dev-dotnet/monotorrent/files/
Date: Thu, 29 Oct 2015 07:21:18
Message-Id: 1446087801.9ad6c388b5f59e93eeb84fd31c99a622b4281f24.cynede@gentoo
1 commit: 9ad6c388b5f59e93eeb84fd31c99a622b4281f24
2 Author: ArsenShnurkov <Arsen.Shnurkov <AT> gmail <DOT> com>
3 AuthorDate: Thu Oct 29 03:03:21 2015 +0000
4 Commit: Heather Cynede <cynede <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 29 03:03:21 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=9ad6c388
7
8 ebuild features added
9
10 .../monotorrent/files/NoStdLib-NoConfig.patch | 0
11 .../files/downgrade-from-4.6-to-4.5.patch | 42 ++++++++++
12 .../monotorrent-1.0.0-r201510130.ebuild | 97 ++++++++++++----------
13 eclass/nuget.eclass | 25 +-----
14 eclass/nupkg.eclass | 16 ++++
15 5 files changed, 111 insertions(+), 69 deletions(-)
16
17 diff --git a/dev-dotnet/monotorrent/files/NoStdLib-NoConfig.patch b/dev-dotnet/monotorrent/files/NoStdLib-NoConfig.patch
18 new file mode 100644
19 index 0000000..e69de29
20
21 diff --git a/dev-dotnet/monotorrent/files/downgrade-from-4.6-to-4.5.patch b/dev-dotnet/monotorrent/files/downgrade-from-4.6-to-4.5.patch
22 new file mode 100644
23 index 0000000..24e6922
24 --- /dev/null
25 +++ b/dev-dotnet/monotorrent/files/downgrade-from-4.6-to-4.5.patch
26 @@ -0,0 +1,42 @@
27 +diff --git a/src/MonoTorrent/MonoTorrent.csproj b/src/MonoTorrent/MonoTorrent.csproj
28 +index f5e5bdf..50fe05a 100644
29 +--- a/src/MonoTorrent/MonoTorrent.csproj
30 ++++ b/src/MonoTorrent/MonoTorrent.csproj
31 +@@ -1,9 +1,7 @@
32 + <?xml version="1.0" encoding="utf-8"?>
33 +-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
34 ++<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
35 + <PropertyGroup>
36 + <ProjectType>Local</ProjectType>
37 +- <ProductVersion>9.0.21022</ProductVersion>
38 +- <SchemaVersion>2.0</SchemaVersion>
39 + <ProjectGuid>{411A9E0E-FDC6-4E25-828A-0C2CD1CD96F8}</ProjectGuid>
40 + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
41 + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
42 +@@ -23,7 +21,7 @@
43 + <OldToolsVersion>3.5</OldToolsVersion>
44 + <UpgradeBackupLocation>
45 + </UpgradeBackupLocation>
46 +- <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
47 ++ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
48 + <PublishUrl>publish\</PublishUrl>
49 + <Install>true</Install>
50 + <InstallFrom>Disk</InstallFrom>
51 +@@ -47,8 +45,6 @@
52 + <ConfigurationOverrideFile>
53 + </ConfigurationOverrideFile>
54 + <DefineConstants>TRACE;DEBUG</DefineConstants>
55 +- <DocumentationFile>
56 +- </DocumentationFile>
57 + <DebugSymbols>true</DebugSymbols>
58 + <FileAlignment>4096</FileAlignment>
59 + <Optimize>false</Optimize>
60 +@@ -65,8 +61,6 @@
61 + <ConfigurationOverrideFile>
62 + </ConfigurationOverrideFile>
63 + <DefineConstants>TRACE</DefineConstants>
64 +- <DocumentationFile>
65 +- </DocumentationFile>
66 + <FileAlignment>4096</FileAlignment>
67 + <Optimize>true</Optimize>
68 + <OutputPath>..\..\build\MonoTorrent\Release\</OutputPath>
69
70 diff --git a/dev-dotnet/monotorrent/monotorrent-1.0.0-r201510130.ebuild b/dev-dotnet/monotorrent/monotorrent-1.0.0-r201510130.ebuild
71 index b2c59fe..61cf473 100644
72 --- a/dev-dotnet/monotorrent/monotorrent-1.0.0-r201510130.ebuild
73 +++ b/dev-dotnet/monotorrent/monotorrent-1.0.0-r201510130.ebuild
74 @@ -4,7 +4,8 @@
75
76 EAPI=5
77
78 -inherit mono-env dotnet nupkg
79 +# mono-env
80 +inherit dotnet nupkg
81
82 HOMEPAGE="http://projects.qnetp.net/projects/show/monotorrent"
83 DESCRIPTION="Monotorrent is an open source C# bittorrent library"
84 @@ -12,6 +13,7 @@ LICENSE="MIT"
85 SLOT="0"
86 KEYWORDS="~amd64 ~x86"
87 IUSE="net45 +gac +nupkg pkg-config debug developer"
88 +USE_DOTNET="net45"
89
90 COMMON_DEPEND=">=dev-lang/mono-4.0.2.5
91 "
92 @@ -30,8 +32,8 @@ ICONMETA="https://openclipart.org/detail/198771/mono-torrent"
93 ICON_URL="https://openclipart.org/download/198771/mono-torrent.svg"
94
95 # monotorrent-1.0.0-r201510130
96 -EGIT_BRANCH="longpath"
97 -EGIT_COMMIT="e78d386d0785a9a42eeb5865bd58a8887e14b8f2"
98 +EGIT_BRANCH="master"
99 +EGIT_COMMIT="a76e4cd552d0fff51e47a25fe050efff672f34b2"
100 SRC_URI="${REPOSITORY}/archive/${EGIT_BRANCH}/${EGIT_COMMIT}.zip -> ${PF}.zip
101 mirror://gentoo/mono.snk.bz2"
102 #S="${WORKDIR}/${NAME}-${EGIT_COMMIT}"
103 @@ -42,75 +44,80 @@ S="${WORKDIR}/${NAME}-${EGIT_BRANCH}"
104 RESTRICT="test"
105
106 FILE_TO_BUILD=./src/MonoTorrent.sln
107 -METAFILETOBUILD="${S}/${FILE_TO_BUILD}"
108
109 -src_prepare() {
110 - #enuget_restore "${METAFILETOBUILD}"
111 +#METAFILETOBUILD="${S}/${FILE_TO_BUILD}"
112 +#gives Reference 'AlphaFS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL' not resolved
113 +
114 +METAFILETOBUILD="src/MonoTorrent/MonoTorrent.csproj"
115 +
116 +# leafpad /var/lib/layman/dotnet/eclass/nupkg.eclass &
117 +NUGET_VERSION="${PVR//-r/.}"
118
119 +src_prepare() {
120 sed -i \
121 -e "/InternalsVisibleTo/d" \
122 - MonoTorrent/AssemblyInfo.cs* || die
123 + ./src/MonoTorrent/AssemblyInfo.cs* || die
124 +
125 + epatch "${FILESDIR}/NoStdLib-NoConfig.patch"
126 + epatch "${FILESDIR}/downgrade-from-4.6-to-4.5.patch"
127 +
128 + enuget_restore "${METAFILETOBUILD}"
129 +
130 + # leafpad /var/tmp/portage/dev-dotnet/monotorrent-1.0.0-r201510130/work/monotorrent-master/monotorrent.nuspec &
131 + create_nuspec_file "${S}/${PN}.nuspec"
132 +}
133 +
134 +src_configure() {
135 + :;
136 }
137
138 src_compile() {
139 # emake -j1 ASSEMBLY_COMPILER_COMMAND="/usr/bin/gmcs" -keyfile:${WORKDIR}/mono.snk
140 - exbuild "${METAFILETOBUILD}"
141 + exbuild /p:SignAssembly=true "/p:AssemblyOriginatorKeyFile=${WORKDIR}/mono.snk" "${METAFILETOBUILD}"
142
143 - create_nuspec_file
144 + # run nuget_pack
145 + enuspec -Prop version=${NUGET_VERSION} ./${PN}.nuspec
146 }
147
148 src_install() {
149 egacinstall $(find . -name "MonoTorrent.dll")
150 +
151 + enupkg "${WORKDIR}/monotorrent.${NUGET_VERSION}.nupkg"
152 +
153 if use pkg-config; then
154 install_pc_file
155 fi
156 }
157
158 -# replace underscore to dash
159 -NUGET_VERSION="${PV//_/-}"
160 -
161 create_nuspec_file()
162 {
163 - REPLACEMENT_TOKENS+="s~$id$~${PN}~g;"
164 - REPLACEMENT_TOKENS+="s~$version$~${NUGET_VERSION}~g;"
165 - REPLACEMENT_TOKENS+="s~$author$~leaves project~g;"
166 - REPLACEMENT_TOKENS+="s~$package_owners$~lasy monkeys~g;"
167 - REPLACEMENT_TOKENS+="s~$package_licenseUrl$~${LICENSE_URL}~g;"
168 - REPLACEMENT_TOKENS+="s~$package_ProjectUrl$~${HOMEPAGE}~g;"
169 - REPLACEMENT_TOKENS+="s~$package_iconUrl$~${ICON_URL}~g;"
170 - REPLACEMENT_TOKENS+="s~$description$~${DESCRIPTION}~g;"
171 - sed "${REPLACEMENT_TOKENS}" <<EOF >"${S}/${PN}.nuspec" || die
172 + if use nupkg; then
173 + if use debug; then
174 + DIR="Debug"
175 + else
176 + DIR="Release"
177 + fi
178 + cat <<EOF >$1 || die
179 <?xml version="1.0"?>
180 -<package >
181 +<package>
182 <metadata>
183 - <id>$id$</id>
184 - <version>$version$</version>
185 - <authors>$author$</authors>
186 - <owners>$package_owners$</owners>
187 - <licenseUrl>$package_licenseUrl$</licenseUrl>
188 - <projectUrl>$package_ProjectUrl$</projectUrl>
189 - <iconUrl>$package_iconUrl$</iconUrl>
190 - <requireLicenseAcceptance>false</requireLicenseAcceptance>
191 - <description>$description$</description>
192 - <!--
193 - <releaseNotes>$package_releaseNotes$</releaseNotes>
194 - <copyright>$package_copyright$</copyright>
195 - <tags>$package_tags$</tags>
196 - -->
197 - <!--
198 - <dependencies>
199 - <dependency id="SampleDependency" version="1.0" />
200 - </dependencies>
201 - -->
202 + <id>${PN}</id>
203 + <version>${NUGET_VERSION}</version>
204 + <authors>unknown</authors>
205 + <owners>unknown</owners>
206 + <licenseUrl>${LICENSE_URL}</licenseUrl>
207 + <projectUrl>${HOMEPAGE}</projectUrl>
208 + <iconUrl>${ICON_URL}</iconUrl>
209 + <requireLicenseAcceptance>false</requireLicenseAcceptance>
210 + <description>${DESCRIPTION}</description>
211 </metadata>
212 <files> <!-- https://docs.nuget.org/create/nuspec-reference -->
213 - <file src="bin/$configuration$/*.dll" target="lib\net40\" />
214 + <file src="build/MonoTorrent/${DIR}/*.dll" target="lib\net45\" />
215 + <file src="build/MonoTorrent/${DIR}/*.mdb" target="lib\net45\" />
216 </files>
217 -
218 </package>
219 EOF
220 - # run nuget_pack
221 - enuspec -Prop version=${NUGET_VERSION} ./${PN}.nuspec
222 + fi
223 }
224
225 install_pc_file()
226
227 diff --git a/eclass/nuget.eclass b/eclass/nuget.eclass
228 index d742265..02e13b8 100644
229 --- a/eclass/nuget.eclass
230 +++ b/eclass/nuget.eclass
231 @@ -9,30 +9,7 @@
232 # introduce nuget IUSE flag for packages that are on nuget to download them from nuget. (if sources fails with some reason or dependies is complicated or if user just want binaries).
233 # or maybe even introduce few packages that just downloads and instulls from nuget, reason is obviously - easy maintaince
234
235 -inherit dotnet
236 -
237 -# @FUNCTION: enuget_restore
238 -# @DESCRIPTION: run nuget restore
239 -# accepts path to .sln or .proj or .csproj file to restore as parameter
240 -enuget_restore() {
241 - nuget restore "$@" || die
242 -}
243 -
244 -# @ECLASS_VARIABLE: NUGET_DEPEND
245 -# @DESCRIPTION Set false to net depend on nuget
246 -: ${NUGET_NO_DEPEND:=}
247 -
248 -if [[ -n $NUGET_NO_DEPEND ]]; then
249 - DEPEND+=" dev-dotnet/nuget"
250 -fi
251 -
252 -NPN=${PN/_/.}
253 -if [[ $PV == *_alpha* ]] || [[ $PV == *_beta* ]] || [[ $PV == *_pre* ]]
254 -then
255 - NPV=${PVR/_/-}
256 -else
257 - NPV=${PVR}
258 -fi
259 +inherit nupkg
260
261 # @FUNCTION: nuget_src_unpack
262 # @DESCRIPTION: Runs nuget
263
264 diff --git a/eclass/nupkg.eclass b/eclass/nupkg.eclass
265 index 398c4ab..4142588 100644
266 --- a/eclass/nupkg.eclass
267 +++ b/eclass/nupkg.eclass
268 @@ -9,6 +9,13 @@
269
270 inherit dotnet
271
272 +# @FUNCTION: enuget_restore
273 +# @DESCRIPTION: run nuget restore
274 +# accepts path to .sln or .proj or .csproj file to restore as parameter
275 +enuget_restore() {
276 + nuget restore "$@" || die
277 +}
278 +
279 # @FUNCTION: enuspec
280 # @DESCRIPTION: run nuget pack
281 # accepts path to .nuspec file as parameter
282 @@ -51,3 +58,12 @@ enupkg() {
283 if [[ -n $NUGET_NO_DEPEND ]]; then
284 DEPEND+=" dev-dotnet/nuget"
285 fi
286 +
287 +NPN=${PN/_/.}
288 +if [[ $PV == *_alpha* ]] || [[ $PV == *_beta* ]] || [[ $PV == *_pre* ]]
289 +then
290 + NPV=${PVR/_/-}
291 +else
292 + NPV=${PVR}
293 +fi
294 +