summaryrefslogtreecommitdiff
blob: e167d52fa32457af8533e8cd5e745a8b41cb0726 (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
46
47
48
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs unpacker

DESCRIPTION="object code file converted (COFF, ELF, OMF, MACHO)"
HOMEPAGE="https://agner.org/optimize/#objconv"
# original URL is "http://agner.org/optimize/objconv.zip", but it's unversioned.
# I copy those to distfiles time to time. last modified: 2018-Oct-07
SRC_URI="https://dev.gentoo.org/~sam/distfiles/${P}.zip"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND=""
DEPEND=""
BDEPEND="app-arch/unzip"

S=${WORKDIR}/${P}

src_unpack() {
	unpacker_src_unpack
	mkdir "${S}" || die
	pushd "${S}" || die
	unpack_zip ../source.zip
}

src_prepare() {
	default

	# project has extremenly poor build system (see build.sh)
	local sources=$(echo *.cpp)

	{
		echo "objconv: ${sources//.cpp/.o}"
		echo "	\$(CXX) \$(CXXFLAGS) -o \$@ \$^ \$(LDFLAGS)"
	} > Makefile || die

	tc-export CXX
}

src_install() {
	dobin objconv
	dodoc ../objconv-instructions.pdf
}