.pc-files |
Gentoo Mono Handbook
PInvoke pkg-config https://en.wikipedia.org/wiki/Pkg-config |
# cat /usr/lib/pkgconfig/system-web.pc prefix=${pcfiledir}/../.. exec_prefix=${prefix} libdir=${exec_prefix}/lib64 Name: system-web Description: Framework for developing web-applications Version: 4.6.0.150 Libs: -r:${libdir}/mono/system-web/System.Web.dllExample of .ebuild piece ("<<-" operator of bash is used, see §3.6.6 Here Documents)
# @FUNCTION: einstall_pc_file # @DESCRIPTION: installs .pc file # The file format contains predefined metadata keywords and freeform variables (like ${prefix} and ${exec_prefix}) # $1 = ${PN} # $2 = myassembly.dllexample of usage:
src_install() { einstall_pc_file "${PN}" "${NAME}.dll" }
src_install() { if use debug; then DIR="Debug" else DIR="Release" fi egacinstall "${S}/mcs/class/${NAME}/obj/${DIR}/${NAME}.dll" egacinstall "${S}/policy.4.0.System.Web.dll" install_pc_file "${PN}" "${NAME}.dll" } # The file format contains predefined metadata keywords and freeform variables (like ${prefix} and ${exec_prefix}) # $1 = ${PN} # $2 = myassembly.dll install_pc_file() { if use pkg-config; then dodir /usr/$(get_libdir)/pkgconfig ebegin "Installing ${PC_FILE_NAME}.pc file" sed \ -e "s:@LIBDIR@:$(get_libdir):" \ -e "s:@PACKAGENAME@:$1:" \ -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 prefix=\${pcfiledir}/../.. exec_prefix=\${prefix} libdir=\${exec_prefix}/@LIBDIR@ Name: @PACKAGENAME@ 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." eend $? fi }