Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@××××××.net>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: media-gfx/grafx2/, media-gfx/grafx2/files/
Date: Sat, 26 Sep 2020 12:26:34
Message-Id: 1601123177.0c3b028992ba41bbd2940db583140129a9412978.andrewammerlaan@gentoo
1 commit: 0c3b028992ba41bbd2940db583140129a9412978
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
3 AuthorDate: Sat Sep 26 12:26:17 2020 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
5 CommitDate: Sat Sep 26 12:26:17 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0c3b0289
7
8 media-gfx/grafx2: simplify ebuild
9
10 - xdg eclass exports phase functions so saves some lines
11 - use the S variable instead of moving stuff around and cd'ing
12 - RESTRICT test phase because it fails
13
14 Package-Manager: Portage-3.0.8, Repoman-3.0.1
15 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
16
17 media-gfx/grafx2/files/grafx2-desktop-file.patch | 7 ++--
18 media-gfx/grafx2/grafx2-2.7.2978.ebuild | 49 ++++++++----------------
19 media-gfx/grafx2/metadata.xml | 9 +++++
20 3 files changed, 29 insertions(+), 36 deletions(-)
21
22 diff --git a/media-gfx/grafx2/files/grafx2-desktop-file.patch b/media-gfx/grafx2/files/grafx2-desktop-file.patch
23 index 8b623545..a08bb8ae 100644
24 --- a/media-gfx/grafx2/files/grafx2-desktop-file.patch
25 +++ b/media-gfx/grafx2/files/grafx2-desktop-file.patch
26 @@ -1,6 +1,7 @@
27 -diff -Naur grafx2.orig/misc/unix/grafx2.desktop grafx2/misc/unix/grafx2.desktop
28 ---- grafx2.orig/misc/unix/grafx2.desktop 2020-03-03 20:32:57.000000000 +0100
29 -+++ grafx2/misc/unix/grafx2.desktop 2020-09-26 04:04:31.315093477 +0200
30 +diff --git a/misc/unix/grafx2.desktop b/misc/unix/grafx2.desktop
31 +index 9718f06..892e7b2 100644
32 +--- a/misc/unix/grafx2.desktop
33 ++++ b/misc/unix/grafx2.desktop
34 @@ -1,9 +1,9 @@
35 [Desktop Entry]
36 Name=GrafX2
37
38 diff --git a/media-gfx/grafx2/grafx2-2.7.2978.ebuild b/media-gfx/grafx2/grafx2-2.7.2978.ebuild
39 index fb9aa1b4..ac53ecd1 100644
40 --- a/media-gfx/grafx2/grafx2-2.7.2978.ebuild
41 +++ b/media-gfx/grafx2/grafx2-2.7.2978.ebuild
42 @@ -1,9 +1,9 @@
43 -# Copyright 1999-2009 Gentoo Foundation
44 +# Copyright 2020 Gentoo Authors
45 # Distributed under the terms of the GNU General Public License v2
46
47 EAPI=7
48
49 -inherit xdg-utils
50 +inherit xdg
51
52 DESCRIPTION="A pixelart-oriented painting program"
53 HOMEPAGE="http://www.pulkomandy.tk/projects/GrafX2"
54 @@ -14,56 +14,39 @@ SLOT="0"
55 KEYWORDS="~amd64 ~x86"
56 IUSE="ttf lua"
57
58 +# Test phase fails: make: *** [Makefile:1146: ../bin/tests-sdl] Error 1
59 +RESTRICT="test"
60 +
61 PATCHES=(
62 "${FILESDIR}/${PN}-desktop-file.patch"
63 )
64
65 -DEPEND="media-libs/libsdl
66 +DEPEND="
67 + media-libs/libsdl
68 media-libs/sdl-image
69 media-libs/freetype
70 media-libs/libpng
71 ttf? ( media-libs/sdl-ttf )
72 - lua? ( >=dev-lang/lua-5.1.0 )"
73 -RDEPEND=""
74 + lua? ( >=dev-lang/lua-5.1.0 )
75 +"
76
77 -src_unpack()
78 -{
79 - unpack ${P}-src.tgz && mv ${PN} ${P}
80 -}
81 +S="${WORKDIR}/${PN}/src/"
82
83 -src_prepare()
84 -{
85 +src_prepare() {
86 + pushd ../
87 eapply ${PATCHES}
88 -
89 eapply_user
90 -
91 - cd ${WORKDIR}/${P}/src/
92 - sed -i s/lua5\.1/lua/g Makefile
93 + popd
94 + sed -i s/lua5\.1/lua/g Makefile || die
95 }
96
97 -src_compile()
98 -{
99 +src_compile() {
100 use ttf || MYCNF="NOTTF=1"
101 use lua || MYCNF="${MYCNF} NOLUA=1"
102
103 - cd ${WORKDIR}/${P}/src/
104 emake ${MYCNF} || die "emake failed"
105 }
106
107 -src_install()
108 -{
109 - cd ${WORKDIR}/${P}/src/
110 +src_install() {
111 emake ${MYCNF} DESTDIR="${D}" PREFIX="/usr" install || die "Install failed"
112 }
113 -
114 -pkg_postinst()
115 -{
116 - xdg_desktop_database_update
117 - xdg_icon_cache_update
118 -}
119 -
120 -pkg_postrm()
121 -{
122 - xdg_desktop_database_update
123 - xdg_icon_cache_update
124 -}
125
126 diff --git a/media-gfx/grafx2/metadata.xml b/media-gfx/grafx2/metadata.xml
127 new file mode 100644
128 index 00000000..8e1ca16e
129 --- /dev/null
130 +++ b/media-gfx/grafx2/metadata.xml
131 @@ -0,0 +1,9 @@
132 +<?xml version="1.0" encoding="UTF-8"?>
133 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
134 +
135 +<pkgmetadata>
136 + <!-- maintainer-needed -->
137 + <use>
138 + <flag name="ttf">Install TTF Fonts</flag>
139 + </use>
140 +</pkgmetadata>