From: flameeyes@gmail.com (Diego 'Flameeyes' Pettenò)
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] [RFC] simple-build eclass
Date: Fri, 14 Nov 2008 01:15:34 +0100 [thread overview]
Message-ID: <m2prkzmac9.fsf@gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1057 bytes --]
I've already written about the possibility of creating an ebuild to
simply _replace_ the entire buildsystem of a package if it's
non-existant (simple .c file thrown around by upstream), too minimal
and/or impossible to get upstream do adapt, or as a temporary measure
until upstream is beaten into common sense.
The whole story can be found at
http://blog.flameeyes.eu/2008/10/15/fixing-cflags-ldflags-handling-with-a-single-boilerplate-makefile
I'm attaching a proof of concept of the eclass, it's certainly not ready
for prime time: it does not support C++ programs, it does not have
pkg-config support, and so on. But in general it should work, I'm also
attaching a reworked ebuild for uif2iso (package I maintain and for
which I had to _rewrite_ the whole Makefile already).
This gets especially interesting to consider if we want to enable
--as-needed by default, since this will allow easy fix for packages that
don't otherwise build with --as-needed, like habak that I had to fix,
and takes care of quite a few different problems at once.
HTH,
[-- Attachment #1.2: simple-build.eclass --]
[-- Type: text/plain, Size: 668 bytes --]
# Copyright 2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Author: Diego Pettenò <flameeyes@gentoo.org>
inherit toolchain-funcs
EXPORT_FUNCTIONS src_compile src_install
simple-build_src_compile() {
cat - > Makefile <<EOF
OBJS = \$(patsubst %.c,%.o,\$(wildcard \$(SRCS)))
\$(TARGET): \$(OBJS)
\$(CC) \$(LDFLAGS) \$^ -o \$@ \$(LIBS)
EOF
emake \
CC="$(tc-getCC)" \
SRCS="${SIMPLE_SOURCES}" \
LIBS="${SIMPLE_LIBRARIES}" \
TARGET="${SIMPLE_TARGET:-${PN}}" \
|| die "emake failed"
}
simple-build_src_install() {
dobin ${SIMPLE_TARGET:-${PN}} || die "dobin failed"
}
[-- Attachment #1.3: uif2iso-0.1.7.ebuild --]
[-- Type: text/plain, Size: 653 bytes --]
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit simple-build flag-o-matic
DESCRIPTION="Converts MagicISO CD-images to iso"
HOMEPAGE="http://aluigi.org/mytoolz.htm#uif2iso"
SRC_URI="mirror://gentoo/${P}.zip"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
RDEPEND="sys-libs/zlib"
DEPEND="${RDEPEND}
app-arch/unzip"
SIMPLE_SOURCES='src/*.c'
SIMPLE_LIBRARIES='-lz'
src_compile() {
append-flags -DMAGICISO_IS_SHIT
simple-build_src_compile
}
src_install() {
simple-build_src_install
dodoc "${WORKDIR}"/${PN}.txt "${WORKDIR}"/README || die "dodoc failed"
}
[-- Attachment #1.4: Type: text/plain, Size: 66 bytes --]
--
Diego "Flameeyes" Pettenò
http://blog.flameeyes.eu/
[-- Attachment #2: Type: application/pgp-signature, Size: 196 bytes --]
reply other threads:[~2008-11-14 14:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2prkzmac9.fsf@gmail.com \
--to=flameeyes@gmail.com \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox