commit:     e4e1b08e357416e2598af152c86bf0dce54b59b2
Author:     ArsenShnurkov <Arsen.Shnurkov <AT> gmail <DOT> com>
AuthorDate: Sat Feb 27 16:57:08 2016 +0000
Commit:     Heather Cynede <cynede <AT> gentoo <DOT> org>
CommitDate: Sat Feb 27 16:57:08 2016 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=e4e1b08e

compiled for three versions of framework

 dev-dotnet/cecil/cecil-0.9.6_p20160209.ebuild | 78 ++++++++++++++++-----------
 dev-dotnet/cecil/files/nuspec.patch           | 34 ++++++++++++
 dev-dotnet/cecil/metadata.xml                 |  4 +-
 3 files changed, 84 insertions(+), 32 deletions(-)

diff --git a/dev-dotnet/cecil/cecil-0.9.6_p20160209.ebuild 
b/dev-dotnet/cecil/cecil-0.9.6_p20160209.ebuild
index 7726e0f..5ef6253 100644
--- a/dev-dotnet/cecil/cecil-0.9.6_p20160209.ebuild
+++ b/dev-dotnet/cecil/cecil-0.9.6_p20160209.ebuild
@@ -13,8 +13,8 @@ DESCRIPTION="System.Reflection alternative to generate and 
inspect .NET executab
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="net45 +gac +nupkg +pkg-config debug developer"
-USE_DOTNET="net45"
+USE_DOTNET="net35 net40 net45"
+IUSE="net35 net40 net45 +gac +nupkg +pkg-config debug developer"
 
 COMMON_DEPEND=">=dev-lang/mono-4.0.2.5
 "
@@ -41,16 +41,18 @@ S="${WORKDIR}/${NAME}-${EGIT_BRANCH}"
 
 METAFILETOBUILD="./Mono.Cecil.sln"
 
-OUTPUT_DIR=Mono.Cecil/bin
-GAC_DLL_NAME=mono.cecil
+GAC_DLL_NAME=Mono.Cecil
 
+NUSPEC_ID="Mono.Cecil"
 NUSPEC_FILE="${S}/Mono.Cecil.nuspec"
-NUSPEC_VERSION="${PVR//-r/.}"
+NUSPEC_VERSION="${PV//_p/.}"
 
 src_prepare() {
        enuget_restore "${METAFILETOBUILD}"
 
-       patch_nuspec_file ${NUSPEC_FILE}
+       eapply "${FILESDIR}/nuspec.patch"
+
+       eapply_user
 }
 
 src_configure() {
@@ -58,40 +60,56 @@ src_configure() {
 }
 
 src_compile() {
-       exbuild /p:SignAssembly=true 
"/p:AssemblyOriginatorKeyFile=${WORKDIR}/mono.snk" "${METAFILETOBUILD}"
+       if [[ -z ${TOOLS_VERSION} ]]; then
+               TOOLS_VERSION=4.0
+       fi
+       PARAMETERS=" /tv:${TOOLS_VERSION}"
+       if use developer; then
+               SARGS=/p:DebugSymbols=True
+       else
+               SARGS=/p:DebugSymbols=False
+       fi
+       PARAMETERS+=" ${SARGS}"
+       PARAMETERS+=" /p:SignAssembly=true"
+       PARAMETERS+=" /p:AssemblyOriginatorKeyFile=${WORKDIR}/mono.snk"
+       PARAMETERS+=" /v:detailed"
+
+
+       for x in ${USE_DOTNET} ; do
+               FW_UPPER=${x:3:1}
+               FW_LOWER=${x:4:1}
+               PARAMETERS_2=" 
/p:TargetFrameworkVersion=v${FW_UPPER}.${FW_LOWER}"
+               if use debug; then
+                       CARGS=/p:Configuration=net_${FW_UPPER}_${FW_LOWER}_Debug
+               else
+                       
CARGS=/p:Configuration=net_${FW_UPPER}_${FW_LOWER}_Release
+               fi
+               PARAMETERS_2+=" ${CARGS}"
+               exbuild_raw ${PARAMETERS} ${PARAMETERS_2} "${METAFILETOBUILD}"
+       done
 
        # run nuget_pack
-       enuspec -Prop version=${NUSPEC_VERSION} ${NUSPEC_FILE}
+       enuspec -Prop "id=${NUSPEC_ID};version=${NUSPEC_VERSION}" ${NUSPEC_FILE}
 }
 
 src_install() {
-       enupkg "${WORKDIR}/${NAME}.${NUSPEC_VERSION}.nupkg"
+       enupkg "${WORKDIR}/${NUSPEC_ID}.${NUSPEC_VERSION}.nupkg"
+       
+       if use debug; then
+               DIR=Debug
+       else
+               DIR=Release
+       fi
 
-       egacinstall "${OUTPUT_DIR}/${DIR}/${GAC_DLL_NAME}.dll"
+       for x in ${USE_DOTNET} ; do
+               FW_UPPER=${x:3:1}
+               FW_LOWER=${x:4:1}
+               egacinstall 
"bin/net_${FW_UPPER}_${FW_LOWER}_${DIR}/${GAC_DLL_NAME}.dll"
+       done
 
        install_pc_file
 }
 
-patch_nuspec_file()
-{
-       if use nupkg; then
-               if use debug; then
-                       DIR="Debug"
-               else
-                       DIR="Release"
-               fi
-               FILES_STRING=`cat <<-EOF || die "files at patch_nuspec_file()"
-                      <files> <!-- 
https://docs.nuget.org/create/nuspec-reference -->
-                              <file src="${OUTPUT_DIR}/${DIR}/*.dll" 
target="lib\net45\" />
-                              <file src="${OUTPUT_DIR}/${DIR}/*.mdb" 
target="lib\net45\" />
-                      </files>
-               EOF
-               `
-               einfo ${FILES_STRING}
-               replace "</package>" "${FILES_STRING}</package>" -- $1 || die 
"replace at patch_nuspec_file()"
-       fi
-}
-
 PC_FILE_NAME=${PN}
 
 install_pc_file()

diff --git a/dev-dotnet/cecil/files/nuspec.patch 
b/dev-dotnet/cecil/files/nuspec.patch
new file mode 100644
index 0000000..39ce752
--- /dev/null
+++ b/dev-dotnet/cecil/files/nuspec.patch
@@ -0,0 +1,34 @@
+diff --git a/Mono.Cecil.nuspec b/Mono.Cecil.nuspec
+index e01234e..f7c2372 100644
+--- a/Mono.Cecil.nuspec
++++ b/Mono.Cecil.nuspec
+@@ -1,23 +1,23 @@
+ <?xml version="1.0"?>
+ <package xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+   <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd";>
+-    <id>Mono.Cecil</id>
+-    <version>0.9.6.0</version>
++    <id>$id$</id>
++    <version>$version$</version>
+     <title>Mono.Cecil</title>
+     <authors>Jb Evain</authors>
+     <owners>Jb Evain</owners>
+     <licenseUrl>http://opensource.org/licenses/mit-license.php</licenseUrl>
+     <requireLicenseAcceptance>false</requireLicenseAcceptance>
+     <projectUrl>http://github.com/jbevain/cecil/</projectUrl>
++    
<iconUrl>file:///var/lib/layman/dotnet/dev-dotnet/cecil/files/niget_icon_64x64.png</iconUrl>
+     <summary>Cecil is a library written by Jb Evain to generate and inspect 
programs and libraries in the ECMA CIL format.</summary>
+     <description>Cecil is a library written by Jb Evain to generate and 
inspect programs and libraries in the ECMA CIL format. It has full support for 
generics, and support some debugging symbol format. In simple English, with 
Cecil, you can load existing managed assemblies, browse all the contained 
types, modify them on the fly and save back to the disk the modified 
assembly.</description>
+     <language>en-US</language>
+     <tags>assembly assemblies module modules il cil msil bytecode reflection 
injection cecil mono aop</tags>
+   </metadata>
+   <files>
+-    <file src="bin\net_3_5_Release\*.dll" target="lib/net35" />
+-    <file src="bin\net_4_0_Release\*.dll" target="lib/net40" />
+-    <file src="bin\net_4_5_Release\*.dll" target="lib/net45" />
+-    <file src="bin\pcl_Release\*.dll" 
target="lib/portable-net40+sl5+win8+wp8+wpa" />
++    <file src="bin/net_3_5_$configuration$/*.dll" target="lib/net35" />
++    <file src="bin/net_4_0_$configuration$/*.dll" target="lib/net40" />
++    <file src="bin/net_4_5_$configuration$/*.dll" target="lib/net45" />
+   </files>
+ </package>

diff --git a/dev-dotnet/cecil/metadata.xml b/dev-dotnet/cecil/metadata.xml
index 481fc5e..c006382 100644
--- a/dev-dotnet/cecil/metadata.xml
+++ b/dev-dotnet/cecil/metadata.xml
@@ -14,8 +14,8 @@
        </use>
        <longdescription lang="en">
                System.Reflection alternative to generate and inspect .NET 
executables and libraries (.NET over PE/COFF+)
-       </use>
+       </longdescription>
        <longdescription lang="ru">
                Альтернатива библиотеке System.Reflection для создания и 
анализа .NET сборок (.NET поверх PE/COFF+)
-    </longdescription>
+       </longdescription>
 </pkgmetadata>

Reply via email to