Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/libredwg/
Date: Sat, 19 Feb 2022 11:12:32
Message-Id: 1645269141.159517c6d1f9ce7e49fe79817b3c94639611389b.andrewammerlaan@gentoo
1 commit: 159517c6d1f9ce7e49fe79817b3c94639611389b
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 19 11:11:19 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 19 11:12:21 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=159517c6
7
8 media-gfx/libredwg: add version 0.12.5
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
12
13 media-gfx/libredwg/Manifest | 2 +
14 media-gfx/libredwg/libredwg-0.12.5.ebuild | 110 ++++++++++++++++++++++++++++++
15 2 files changed, 112 insertions(+)
16
17 diff --git a/media-gfx/libredwg/Manifest b/media-gfx/libredwg/Manifest
18 index 1899b90fb653..9890c3c5ce28 100644
19 --- a/media-gfx/libredwg/Manifest
20 +++ b/media-gfx/libredwg/Manifest
21 @@ -1 +1,3 @@
22 DIST libredwg-0.12.4.tar.gz 18318912 BLAKE2B 21ff443881c19782c747ddf880eba23090295432edf4367161472aeef970e1b93983967e667ca2c3e140bf0b97e7b238bbe4a342815df365cee10bde83a04178 SHA512 df9424f475be512a6e9e02a1156a7d6a966f684f5753f420843593ee9dc236bd33bd10dbd627bab1b9adab9b8e7cb3a6b464c15e643ae755bc7e11974c05cd7a
23 +DIST libredwg-0.12.5.tar.gz 16855123 BLAKE2B 2ca0bfafdb0ca6e412d3aaf7df21f80a2eed4bad795bffacc1c767f23dc555b35b2aeedb35dffab099c5dbab2890f9363cfc1508c3fec16a6ff51ce79a272e3e SHA512 0b5da6e863410d9ce012d311e921a39fa0d9cb6d96d17f1df70ca767c1768cd625e35503f24830a6a33400ede92d14b36ce87b92f177a5af7e6d4573920cf50c
24 +DIST libredwg-85695f3d5903b1cd5b4030efe50db3b4f5f3c928.tar.gz 12597 BLAKE2B cd01f6c446d5d129545fdae07c0101d133e1f4e69ee62e94c27c3c2853dcc30854f40aed0c6f38f6594c5f5eb9e7b2d18d3b2e4f487b7bf1a3f7f39facde38bc SHA512 1d08cfa6216e0fe671dab77a0bd0b4ef0c4eb174878eba909c680e0ee93a82079b3cbf60afe2de7b0078258de8bcc588961e59cf0c14fe5f2d1f70db639ef95a
25
26 diff --git a/media-gfx/libredwg/libredwg-0.12.5.ebuild b/media-gfx/libredwg/libredwg-0.12.5.ebuild
27 new file mode 100644
28 index 000000000000..0d74bb5e092f
29 --- /dev/null
30 +++ b/media-gfx/libredwg/libredwg-0.12.5.ebuild
31 @@ -0,0 +1,110 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +PYTHON_COMPAT=( python3_{8..10} )
38 +DOCS_BUILDER="doxygen"
39 +# File is hardcoded to be run from ../ so we use this instead of DOCS_DIR
40 +DOCS_CONFIG_NAME="doc/Doxyfile"
41 +
42 +inherit autotools docs python-single-r1 perl-functions
43 +
44 +JSMN_COMMIT="85695f3d5903b1cd5b4030efe50db3b4f5f3c928"
45 +
46 +DESCRIPTION="C library to handle DWG files"
47 +HOMEPAGE="https://www.gnu.org/software/libredwg/"
48 +SRC_URI="
49 + https://github.com/LibreDWG/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
50 + https://github.com/zserge/jsmn/archive/${JSMN_COMMIT}.tar.gz -> ${PN}-${JSMN_COMMIT}.tar.gz
51 +"
52 +
53 +LICENSE="GPL-3 MIT"
54 +SLOT="0"
55 +KEYWORDS="~amd64"
56 +
57 +# https://github.com/LibreDWG/libredwg/issues/342
58 +RESTRICT="test"
59 +
60 +IUSE="debug python perl static-libs"
61 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
62 +
63 +RDEPEND="
64 + python? ( ${PYTHON_DEPS} )
65 + perl? ( dev-lang/perl )
66 + dev-libs/libpcre2
67 + dev-libs/pslib
68 +"
69 +DEPEND="${RDEPEND}
70 + python? ( dev-lang/swig )
71 + perl? ( dev-lang/swig )
72 +"
73 +BDEPEND="|| (
74 + sys-devel/gcc[sanitize]
75 + sys-libs/compiler-rt-sanitizers[asan(-)]
76 + )
77 + dev-vcs/git
78 +"
79 +
80 +src_unpack() {
81 + # Build system really wants jsmn to be here
82 + default
83 + rm -r "${S}/jsmn" || die
84 + mv "${WORKDIR}/jsmn-${JSMN_COMMIT}" "${S}/jsmn" || die
85 +}
86 +
87 +src_prepare() {
88 + default
89 + # https://github.com/LibreDWG/libredwg/issues/404
90 + # Workaround: release tarball does not include dwg2ps.1.
91 + # Upstream autotools stuff has to be run in git repo
92 + git init -q || die
93 + git config --global user.email "larry@g.o" || die
94 + git config --global user.name "Larry the Cow" || die
95 + git add . || die
96 + git commit -qm 'init' || die
97 + git tag ${PV} || die
98 + eautoreconf
99 +}
100 +
101 +src_configure() {
102 + perl_set_version
103 + local myconf=(
104 + --enable-write
105 + --enable-dxf
106 + --enable-json
107 + --disable-gcov
108 + $(use_enable !debug release)
109 + $(use_enable debug trace)
110 + $(use_enable debug)
111 + $(use_enable static-libs static)
112 + $(use_enable python python "${EPYTHON}")
113 + $(usex perl "--with-perl-install=vendor" "--with-perl-install=no")
114 + )
115 +
116 + if use python || use perl; then
117 + myconf+=( --enable-bindings )
118 + else
119 + myconf+=( --disable-bindings )
120 + fi
121 +
122 + econf ${myconf[@]}
123 +
124 + # Fix variable references itself error, fails in src_install otherwise.
125 + # Can't put this in src_prepare and use eautoreconf because eautoreconf
126 + # only works inside a git repository for this package.
127 + sed -i -e 's/TEXINPUTS = "$(TEXINPUTS)$(PATH_SEPARATOR)$(TEXINFO_TEX_DIR)"/TEXINPUTS += "$(PATH_SEPARATOR)$(TEXINFO_TEX_DIR)"/g' doc/Makefile || die
128 +}
129 +
130 +src_compile() {
131 + perl_set_version
132 + emake
133 + docs_compile
134 +}
135 +
136 +src_install() {
137 + perl_set_version
138 + default
139 + use python && python_optimize
140 + use perl && perl_domodule bindings/perl/LibreDWG.pm
141 +}