summaryrefslogtreecommitdiff
blob: ae20184cc167ce4ef49d3002e2065266bd111f25 (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
41
42
43
44
45
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

DESCRIPTION="Convert CD images from uif (MagicISO) to iso"
HOMEPAGE="http://aluigi.altervista.org/mytoolz.htm#uif2iso"
SRC_URI="
	mirror://gentoo/${P}.zip
	test? (
		https://yegortimoshenko.s3.amazonaws.com/${PN}-test.iso
		https://yegortimoshenko.s3.amazonaws.com/${PN}-test.uif
	)"
S="${WORKDIR}"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~x64-macos"
IUSE="test"
RESTRICT="!test? ( test )"

RDEPEND="sys-libs/zlib"
DEPEND="${RDEPEND}"
BDEPEND="app-arch/unzip"

src_compile() {
	emake CC="$(tc-getCC)" -C src -f - <<- 'EOF'
		CPPFLAGS += -DMAGICISO_IS_SHIT
		LDLIBS = -lz
		uif2iso: $(patsubst %.c,%.o,$(wildcard *.c))
	EOF
}

src_test() {
	einfo "checking that uif -> iso matches the expected output"
	src/uif2iso "${DISTDIR}"/uif2iso-test.uif "${T}"/uif2iso-test.iso # always returns 1
	diff "${DISTDIR}"/uif2iso-test.iso "${T}"/uif2iso-test.iso || die "unexpected iso"
}

src_install() {
	dobin src/uif2iso
	dodoc uif2iso.txt README
}