Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/xfig/, media-gfx/xfig/files/
Date: Sat, 27 Aug 2022 23:15:09
Message-Id: 1661614177.2a48d4e4bce4431bd68ead902a4042e9877c9ff6.mattst88@gentoo
1 commit: 2a48d4e4bce4431bd68ead902a4042e9877c9ff6
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 27 12:54:45 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 27 15:29:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a48d4e4
7
8 media-gfx/xfig: Version bump to 3.2.8b
9
10 * Bump to EAPI=8
11 * Move media-libs/netpbm from DEPEND/RDEPEND to optfeature
12 * Remove unneeded dependencies: x11-libs/libXaw, x11-libs/libXi
13 * Add needed dependencies: media-libs/tiff, x11-libs/libX11, x11-libs/libXpm
14 * Remove IUSE="jpeg" and IUSE="postscript", as they're always enabled
15 upstream now.
16 * Remove IUSE="nls" and add (+) to x11-libs/libXaw3d's unicode USE-dep
17 * Switch from virtual/jpeg to media-libs/libjpeg-turbo
18 * Add patch to build with -lflto
19
20 Bug: https://bugs.gentoo.org/807784
21 Closes: https://bugs.gentoo.org/761424
22 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
23
24 media-gfx/xfig/Manifest | 1 +
25 .../files/xfig-3.2.8b-Fix-build-with-flto.patch | 62 ++++++++++++++++++++++
26 .../xfig/files/xfig-3.2.8b-app-defaults.patch | 14 +++++
27 media-gfx/xfig/xfig-3.2.8b.ebuild | 52 ++++++++++++++++++
28 4 files changed, 129 insertions(+)
29
30 diff --git a/media-gfx/xfig/Manifest b/media-gfx/xfig/Manifest
31 index 46a43488a86d..80f26b1cdbf9 100644
32 --- a/media-gfx/xfig/Manifest
33 +++ b/media-gfx/xfig/Manifest
34 @@ -1 +1,2 @@
35 DIST xfig-3.2.7b.tar.xz 5059984 BLAKE2B a22465e16019e9887e302ea308e250ad5d7ba0c49aec8f554a73d3b4489d803a05041cb7d267c543a7c0d3b78eac25077c628283f82767932afcc9d9750ce883 SHA512 f3396ebf8a5961909e58b05b60117fd7bbc8c24fabbd47f108eaea9586f4180af572faffe077b1a5dcbf669ebd69b1c2791f302c126dea62a44aa1592de66f73
36 +DIST xfig-3.2.8b.tar.xz 5382524 BLAKE2B 94963d165664c6451776fcbc3e332a7933c00d4b43e3d4196f15883a9873171f7a0791e6fa41cbb6e8d07958f9ddcceb9578a62a9893cf2f436c07dcbe3e7f37 SHA512 5cc5e61977f97956baca77bf4bce09d0f47ea6fafb10055d0523f7cccd72d7af80e706daa62ae16df3fc54338b4f6cd4a6b71dc460311e65be749ec84fa662b3
37
38 diff --git a/media-gfx/xfig/files/xfig-3.2.8b-Fix-build-with-flto.patch b/media-gfx/xfig/files/xfig-3.2.8b-Fix-build-with-flto.patch
39 new file mode 100644
40 index 000000000000..344d4df06e69
41 --- /dev/null
42 +++ b/media-gfx/xfig/files/xfig-3.2.8b-Fix-build-with-flto.patch
43 @@ -0,0 +1,62 @@
44 +https://sourceforge.net/p/mcj/tickets/149/
45 +
46 +From 938c4089e6cc09e6e327f15d622c064865f837ae Mon Sep 17 00:00:00 2001
47 +From: Matt Turner <mattst88@×××××.com>
48 +Date: Sat, 27 Aug 2022 09:14:55 -0400
49 +Subject: [PATCH] Fix build with -flto
50 +
51 +With CFLAGS="-lflto" the tests fail to build because main() is
52 +redeclared with a different type:
53 +
54 +../src/main.c:651:1: error: type of ‘main’ does not match original declaration [-Werror=lto-type-mismatch]
55 + 651 | main(int argc, char **argv)
56 + | ^
57 +test1.c:47:1: note: type mismatch in parameter 1
58 + 47 | main(void)
59 + | ^
60 +test1.c:47:1: note: type ‘void’ should match type ‘int’
61 +test1.c:47:1: note: ‘main’ was previously declared here
62 +
63 +Simply change the definitions of main() in the tests to match
64 +the one in src/main.c.
65 +---
66 + tests/test1.c | 4 +++-
67 + tests/test2.c | 4 +++-
68 + tests/test4.c | 4 +++-
69 + 3 files changed, 9 insertions(+), 3 deletions(-)
70 +
71 +diff --git a/tests/test1.c b/tests/test1.c
72 +index 83cf930..da76dd7 100644
73 +--- a/tests/test1.c
74 ++++ b/tests/test1.c
75 +@@ -44,8 +44,10 @@ round_coords(int *x, int *y)
76 + }
77 +
78 + int
79 +-main(void)
80 ++main(int argc, char *argv[])
81 + {
82 ++ (void) argc;
83 ++ (void) argv;
84 + int errcode = 0;
85 +
86 + cur_pointposn = 2; /* == P_GRID1, see mode.h */
87 +diff --git a/tests/test2.c b/tests/test2.c
88 +index ab3b434..02e919c 100644
89 +--- a/tests/test2.c
90 ++++ b/tests/test2.c
91 +@@ -77,8 +77,10 @@ compare(int xc, int yc, int n, int pts[n][2])
92 + }
93 +
94 + int
95 +-main(void)
96 ++main(int argc, char *argv[])
97 + {
98 ++ (void) argc;
99 ++ (void) argv;
100 + int x, y, yspacing, xc, yc, dist, xdist;
101 + int error = 0;
102 + int pts_square[2][2];
103 +--
104 +2.35.1
105 +
106
107 diff --git a/media-gfx/xfig/files/xfig-3.2.8b-app-defaults.patch b/media-gfx/xfig/files/xfig-3.2.8b-app-defaults.patch
108 new file mode 100644
109 index 000000000000..3ca0f99963ac
110 --- /dev/null
111 +++ b/media-gfx/xfig/files/xfig-3.2.8b-app-defaults.patch
112 @@ -0,0 +1,14 @@
113 +diff -ruN xfig-3.2.8b.orig/app-defaults/Fig xfig-3.2.6a/app-defaults/Fig
114 +--- xfig-3.2.8b.orig/app-defaults/Fig.in 2017-01-10 00:27:39.000000000 +0100
115 ++++ xfig-3.2.8b/app-defaults/Fig.in 2017-03-24 16:22:14.702253419 +0100
116 +@@ -10,6 +10,10 @@
117 +
118 + ! some sample settings you may want to change
119 +
120 ++! If the following resource is set to false, xfig will use metric units
121 ++! by default.
122 ++Fig.inches: false
123 ++
124 + ! The following fixes a problem that some window managers have
125 + ! with xfig continually resizing itself
126 +
127
128 diff --git a/media-gfx/xfig/xfig-3.2.8b.ebuild b/media-gfx/xfig/xfig-3.2.8b.ebuild
129 new file mode 100644
130 index 000000000000..e25f69b210d0
131 --- /dev/null
132 +++ b/media-gfx/xfig/xfig-3.2.8b.ebuild
133 @@ -0,0 +1,52 @@
134 +# Copyright 1999-2022 Gentoo Authors
135 +# Distributed under the terms of the GNU General Public License v2
136 +
137 +EAPI=8
138 +
139 +inherit optfeature xdg
140 +
141 +DESCRIPTION="A menu-driven tool to draw and manipulate objects interactively in an X window"
142 +HOMEPAGE="http://mcj.sourceforge.net/"
143 +SRC_URI="https://downloads.sourceforge.net/project/mcj/${P}.tar.xz"
144 +
145 +LICENSE="BSD"
146 +SLOT="0"
147 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris ~x86-solaris"
148 +
149 +COMMON_DEPEND="
150 + app-text/ghostscript-gpl:=
151 + >=media-gfx/transfig-3.2.5-r1
152 + media-libs/libjpeg-turbo:0=
153 + media-libs/libpng:0=
154 + media-libs/tiff
155 + x11-libs/libX11
156 + x11-libs/libXaw3d[unicode(+)]
157 + x11-libs/libXpm
158 + x11-libs/libXt
159 +"
160 +DEPEND="${COMMON_DEPEND}
161 + x11-base/xorg-proto
162 +"
163 +RDEPEND="${COMMON_DEPEND}
164 + media-fonts/font-misc-misc
165 + media-fonts/urw-fonts
166 +"
167 +
168 +PATCHES=(
169 + "${FILESDIR}/${PN}-3.2.6a-urwfonts.patch"
170 + "${FILESDIR}/${PN}-3.2.6a-solaris.patch"
171 + "${FILESDIR}/${PN}-3.2.8b-app-defaults.patch"
172 + "${FILESDIR}/${PN}-3.2.8b-Fix-build-with-flto.patch"
173 +)
174 +
175 +src_configure() {
176 + local myeconfargs=(
177 + --enable-i18n
178 + --htmldir="${EPREFIX}/usr/share/doc/${PF}" # it expects docdir...
179 + )
180 + econf "${myeconfargs[@]}"
181 +}
182 +
183 +pkg_postinst() {
184 + optfeature "GIF support" media-libs/netpbm virtual/imagemagick-tools
185 +}