commit:     f1f4574fb3c4c11795e38421ba58597c7c34d57c
Author:     ArsenShnurkov <Arsen.Shnurkov <AT> gmail <DOT> com>
AuthorDate: Fri Sep 30 05:14:58 2016 +0000
Commit:     Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
CommitDate: Fri Sep 30 05:14:58 2016 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=f1f4574f

.pc file installation for Ionic

 ...mu-control-winforms-1.0.0_p2016051802-r1.ebuild |  2 +-
 .../dotnetzip-semverd-1.9.3-r1.ebuild              | 48 ++++++++++++++++++++
 eclass/gac.eclass                                  | 53 ++++++++++++++++------
 3 files changed, 89 insertions(+), 14 deletions(-)

diff --git 
a/dev-dotnet/conemu-control-winforms/conemu-control-winforms-1.0.0_p2016051802-r1.ebuild
 
b/dev-dotnet/conemu-control-winforms/conemu-control-winforms-1.0.0_p2016051802-r1.ebuild
index 1fd1b47..62fc3b1 100644
--- 
a/dev-dotnet/conemu-control-winforms/conemu-control-winforms-1.0.0_p2016051802-r1.ebuild
+++ 
b/dev-dotnet/conemu-control-winforms/conemu-control-winforms-1.0.0_p2016051802-r1.ebuild
@@ -46,5 +46,5 @@ src_install() {
                DIR=Release
        fi
        egacinstall "${S}/ConEmuWinForms/bin/${DIR}/ConEmu.WinForms.dll"
-       einstall_pc_file "${PN}" "ConEmu.WinForms.dll"
+       einstall_pc_file "${PN}" "${PV}" "ConEmu.WinForms.dll"
 }

diff --git a/dev-dotnet/dotnetzip-semverd/dotnetzip-semverd-1.9.3-r1.ebuild 
b/dev-dotnet/dotnetzip-semverd/dotnetzip-semverd-1.9.3-r1.ebuild
new file mode 100644
index 0000000..7eab427
--- /dev/null
+++ b/dev-dotnet/dotnetzip-semverd/dotnetzip-semverd-1.9.3-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+SLOT="0"
+
+KEYWORDS="~amd64 ~ppc ~x86"
+USE_DOTNET="net45"
+
+inherit gac dotnet
+
+SRC_URI="https://github.com/haf/DotNetZip.Semverd/archive/v1.9.3.tar.gz -> 
${PV}.tar.gz"
+RESTRICT="mirror"
+S="${WORKDIR}/DotNetZip.Semverd-${PV}"
+
+HOMEPAGE="https://github.com/haf/DotNetZip.Semverd";
+DESCRIPTION="create, extract, or update zip files with C# (=DotNetZip+SemVer)"
+LICENSE="MS-PL" # https://github.com/haf/DotNetZip.Semverd/blob/master/LICENSE
+
+IUSE="net45 +gac +nupkg developer debug doc"
+
+COMMON_DEPEND=">=dev-lang/mono-4.0.2.5
+"
+RDEPEND="${COMMON_DEPEND}
+"
+DEPEND="${COMMON_DEPEND}
+"
+
+src_prepare() {
+       eapply "${FILESDIR}/version-${PV}.patch"
+       eapply_user
+}
+
+src_compile() {
+       #exbuild "/p:SignAssembly=true" 
"/p:AssemblyOriginatorKeyFile=${S}/src/Ionic.snk" "src/Zip Reduced/Zip 
Reduced.csproj"
+       exbuild_strong "src/Zip Reduced/Zip Reduced.csproj"
+}
+
+src_install() {
+       if use debug; then
+               DIR="Debug"
+       else
+               DIR="Release"
+       fi
+       egacinstall "src/Zip Reduced/bin/${DIR}/Ionic.Zip.Reduced.dll"
+       einstall_pc_file "${PN}" "${PV}" "Ionic.Zip.Reduced.dll"
+}

diff --git a/eclass/gac.eclass b/eclass/gac.eclass
index 1523301..0c47445 100644
--- a/eclass/gac.eclass
+++ b/eclass/gac.eclass
@@ -13,7 +13,7 @@ case ${EAPI:-0} in
        6) ;;
 esac
 
-IUSE+=" +gac"
+IUSE+=" +gac +pkg-config +symlink"
 
 DEPEND+=" dev-lang/mono"
 RDEPEND+=" dev-lang/mono"
@@ -64,30 +64,57 @@ egacdel() {
 # @DESCRIPTION:  installs .pc file
 # The file format contains predefined metadata keywords and freeform variables 
(like ${prefix} and ${exec_prefix})
 # $1 = ${PN}
-# $2 = myassembly.dll
+# $2 = ${PV}
+# $3 = myassembly.dll # should not contain path, it is calculated magically, 
see DLL_FILENAME variable
 einstall_pc_file()
 {
        if use pkg-config; then
-               dodir /usr/$(get_libdir)/pkgconfig
-               ebegin "Installing ${PC_FILE_NAME}.pc file"
+               local PC_NAME="$1"
+               local PC_VERSION="$2"
+               local DLL_NAME="$3"
+               local PC_FILENAME="${PC_NAME}-${PC_VERSION}"
+               local PC_DIRECTORY="/usr/$(get_libdir)/pkgconfig"
+               #local PC_DIRECTORY_DELTA="${CATEGORY}/${PN}"
+               local PC_DIRECTORY_VER="${PC_DIRECTORY}/${PC_DIRECTORY_DELTA}"
+               local DLL_FILENAME="\${libdir}/mono/${PC_NAME}/${DLL_NAME}"
+
+               dodir "${PC_DIRECTORY}"
+               dodir "${PC_DIRECTORY_VER}"
+
+               ebegin "Installing ${PC_DIRECTORY_VER}/${PC_FILENAME}.pc file"
+
+               # @Name@: A human-readable name for the library or package. 
This does not affect usage of the pkg-config tool,
+               # which uses the name of the .pc file.
+               # see https://people.freedesktop.org/~dbn/pkg-config-guide.html
+
+               # \${name} variables going directly into .pc file after 
unescaping $ sign
+               #
+               # other variables are not substituted to sed input directly
+               # to protect them from processing by bash
+               # (they only requires sed escaping for replacement path)
                sed \
-                       -e "s:@LIBDIR@:$(get_libdir):" \
-                       -e "s:@PACKAGENAME@:$1:" \
+                       -e "s:@PC_VERSION@:${PC_VERSION}:" \
+                       -e "s:@Name@:${CATEGORY}/${PN}:" \
                        -e "s:@DESCRIPTION@:${DESCRIPTION}:" \
-                       -e "s:@VERSION@:${PV}:" \
-                       -e 's*@LIBS@*-r:${libdir}'"/mono/$1/$2"'*' \
-                       <<-EOF >"${D}/usr/$(get_libdir)/pkgconfig/$1.pc" || die
+                       -e "s:@LIBDIR@:$(get_libdir):" \
+                       -e "s*@LIBS@*-r:${DLL_FILENAME}*" \
+                       <<-EOF >"${D}/${PC_DIRECTORY_VER}/${PC_FILENAME}.pc" || 
die
                                prefix=\${pcfiledir}/../..
                                exec_prefix=\${prefix}
                                libdir=\${exec_prefix}/@LIBDIR@
-                               Name: @PACKAGENAME@
+                               Version: @PC_VERSION@
+                               Name: @Name@
                                Description: @DESCRIPTION@
-                               Version: @VERSION@
                                Libs: @LIBS@
                        EOF
 
-               einfo PKG_CONFIG_PATH="${D}/usr/$(get_libdir)/pkgconfig/" 
pkg-config --exists "$1"
-               PKG_CONFIG_PATH="${D}/usr/$(get_libdir)/pkgconfig/" pkg-config 
--exists "$1" || die ".pc file failed to validate."
+               einfo PKG_CONFIG_PATH="${D}/${PC_DIRECTORY_VER}" pkg-config 
--exists "${PC_FILENAME}"
+               PKG_CONFIG_PATH="${D}/${PC_DIRECTORY_VER}" pkg-config --exists 
"${PC_FILENAME}" || die ".pc file failed to validate."
                eend $?
+
+               if use symlink; then
+                       einfo "SymLinking ${PC_DIRECTORY_VER}/${PC_FILENAME}.pc 
file as ${PC_DIRECTORY}/${PC_NAME}.pc"
+                       dosym "./${PC_DIRECTORY_DELTA}/${PC_FILENAME}.pc" 
"${PC_DIRECTORY}/${PC_NAME}.pc"
+               fi
        fi
 }

Reply via email to