summaryrefslogtreecommitdiff
blob: 10e5d2c0581c7a1653879ea1ae73027bf197a4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

DESCRIPTION="Implementation of markdown in C, using a PEG grammar"
HOMEPAGE="https://github.com/jgm/peg-markdown"
SRC_URI="https://github.com/jgm/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="|| ( GPL-2 MIT )"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"

RDEPEND="dev-libs/glib:2"
DEPEND="${RDEPEND}
	dev-util/peg
	test? (
		dev-lang/perl
		virtual/perl-Getopt-Long
		app-text/htmltidy )"

src_prepare() {
	rm -rf peg-* || die "rm failed"
	sed -i \
		-e 's/^PROGRAM=markdown/PROGRAM=peg-markdown/' \
		-e 's/$(CC) `/$(CC) $(LDFLAGS) `/g' \
		-e 's/^\t$(LEG)/\tleg/' \
		-e 's/^$(PEGDIR):/dummy:/' \
		-e '/$(PEGDIR)/d' \
		-e 's/$(LEG) //g' \
			Makefile || die 'sed failed'
	sed -i \
		-e '/strdup/d' markdown_peg.h || die 'sed .h failed'
}

src_install() {
	dobin peg-markdown
	dodoc README.markdown
}