diff options
-rw-r--r-- | dev-tex/circuit_macros/ChangeLog | 10 | ||||
-rw-r--r-- | dev-tex/circuit_macros/circuit_macros-7.5.ebuild | 54 | ||||
-rwxr-xr-x | dev-tex/circuit_macros/files/CM2pdf | 25 | ||||
-rw-r--r-- | dev-tex/circuit_macros/metadata.xml | 19 |
4 files changed, 108 insertions, 0 deletions
diff --git a/dev-tex/circuit_macros/ChangeLog b/dev-tex/circuit_macros/ChangeLog new file mode 100644 index 000000000000..ecc258a623c4 --- /dev/null +++ b/dev-tex/circuit_macros/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for dev-tex/circuit_macros +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-tex/circuit_macros/ChangeLog,v 1.1 2013/06/11 14:41:06 calchan Exp $ + +*circuit_macros-7.5 (11 Jun 2013) + + 11 Jun 2013; Denis Dupeyron <calchan@gentoo.org> +circuit_macros-7.5.ebuild, + +files/CM2pdf, +metadata.xml: + Initial commit. + diff --git a/dev-tex/circuit_macros/circuit_macros-7.5.ebuild b/dev-tex/circuit_macros/circuit_macros-7.5.ebuild new file mode 100644 index 000000000000..e4b672a46e2e --- /dev/null +++ b/dev-tex/circuit_macros/circuit_macros-7.5.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-tex/circuit_macros/circuit_macros-7.5.ebuild,v 1.1 2013/06/11 14:41:06 calchan Exp $ + +EAPI=5 + +inherit unpacker texlive-common + +DESCRIPTION="M4 Macros for Electric circuit diagrams in TeX or LaTeX" +HOMEPAGE="https://ece.uwaterloo.ca/~aplevich/Circuit_macros/" +SRC_URI="http://mirrors.ctan.org/graphics/circuit_macros.zip -> circuit_macros-7.5.zip" + +LICENSE="LPPL-1.3c" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc examples +script" + +DEPEND="" +RDEPEND="|| ( app-text/texlive[graphics] app-text/texlive[pstricks] ) + media-gfx/dpic + sys-devel/m4 + script? ( app-text/texlive[graphics] + dev-texlive/texlive-latexextra )" + +S="${WORKDIR}/${PN}" + +src_compile() { + : +} + +src_install() { + insinto /usr/share/${PN} + doins *.m4 + insinto /usr/share/texmf-site/tex/latex/${PN} + doins boxdims.sty + dodoc README CHANGES Makefile doc/CMman.pdf + rm -f doc/CMman.pdf + use doc && dodoc -r doc + use examples && dodoc -r examples + use script && dobin "${FILESDIR}/CM2pdf" + docompress -x \ + /usr/share/doc/${PF}/Makefile \ + /usr/share/doc/${PF}/doc \ + /usr/share/doc/${PF}/examples +} + +pkg_postinst() { + etexmf-update + use script && einfo "CM2pdf was installed to automatically create PDFs" +} + +pkg_postrm() { + etexmf-update +} diff --git a/dev-tex/circuit_macros/files/CM2pdf b/dev-tex/circuit_macros/files/CM2pdf new file mode 100755 index 000000000000..5629d2c5c7d0 --- /dev/null +++ b/dev-tex/circuit_macros/files/CM2pdf @@ -0,0 +1,25 @@ +#! /bin/bash + +if [[ "$#" != 1 ]] +then + echo "Usage:" + echo "CM2pdf path/to/file.m4" + exit +fi + +if [[ "${1##*.}" != "m4" ]] +then + echo "Input file must have .m4 suffix" + exit +fi + +tempdir=$(mktemp -d) +cp -f "${1}" "${tempdir}/source.m4" +pushd "${tempdir}" > /dev/null + +m4 -I /usr/share/circuit_macros pgf.m4 source.m4 | dpic -g > source.tex +pdflatex "\documentclass{standalone}\usepackage{tikz,boxdims}\begin{document}\input source.tex\end{document}" + +popd > /dev/null +cp "${tempdir}/standalone.pdf" "${1%.m4}.pdf" +rm -rf "${tempdir}" diff --git a/dev-tex/circuit_macros/metadata.xml b/dev-tex/circuit_macros/metadata.xml new file mode 100644 index 000000000000..2bb86304fa57 --- /dev/null +++ b/dev-tex/circuit_macros/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>tex</herd> +<herd>sci-electronics</herd> +<maintainer> + <email>calchan@gentoo.org</email> +</maintainer> +<longdescription>Set of macros for drawing high-quality line diagrams to include + in TeX, LaTeX, or similar documents. Fundamental electric circuit + elements and basic logic gates are included with several tools and + examples of other types of diagrams. +</longdescription> +<use> + <flag name="script">Install CM2pdf to automatically create a correctly + sized PDF from a circuit_macro m4 source + </flag> +</use> +</pkgmetadata> |