Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 460864

Summary: sci-electronics/pcb - add -9999 live git ebuild
Product: Gentoo Linux Reporter: Joe M <joe9mail>
Component: Current packagesAssignee: The Soldering-Iron Brotherhood <sci-electronics>
Status: RESOLVED WONTFIX    
Severity: enhancement CC: alex_y_xu, joe9mail
Priority: Normal Keywords: EBUILD
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: pcb git ebuild
live ebuild
live ebuild
freecad-9999.ebuild
freecad-9999.ebuild
pcb-99999999.ebuild
pcb-99999999.ebuild
pcb-9999999.ebuild
pcb-99999999.ebuild

Description Joe M 2013-03-09 05:41:46 UTC
cat pcb-99999999.ebuild
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-electronics/pcb/pcb-20110918.ebuild,v 1.8 2013/01/04 12:58:37 ago Exp $

EAPI="5"

inherit autotools eutils fdo-mime gnome2-utils toolchain-funcs git-2

DESCRIPTION="GPL Electronic Design Automation: Printed Circuit Board editor"
HOMEPAGE="http://www.gpleda.org/"
EGIT_REPO_URI="git://git.geda-project.org/pcb.git"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc x86 ~x86-macos"
IUSE="dbus debug doc gcode gif gtk jpeg m4lib-png motif nelma opengl png
test tk toporouter xrender nls"
# toporouter-output USE flag removed, there seems to be no result

CDEPEND="gif? ( >=media-libs/gd-2.0.23 )
        gtk? ( x11-libs/gtk+:2 x11-libs/pango
                x11-libs/gtkglext
                dbus? ( sys-apps/dbus ) )
        jpeg? ( >=media-libs/gd-2.0.23[jpeg] )
        motif? ( !gtk? (
                >=x11-libs/motif-2.3:0
                dbus? ( sys-apps/dbus )
                xrender? ( >=x11-libs/libXrender-0.9 ) ) )
        nelma? ( >=media-libs/gd-2.0.23 )
        opengl? ( virtual/opengl )
        gcode? ( >=media-libs/gd-2.0.23 )
        nls? ( virtual/libintl )
        png? ( >=media-libs/gd-2.0.23[png] )
        m4lib-png? ( >=media-libs/gd-2.0.23[png] )
        tk? ( >=dev-lang/tk-8 )"
#toporouter-output? ( x11-libs/cairo )

DEPEND="${CDEPEND}
        test? (
                || ( media-gfx/graphicsmagick[imagemagick] media-gfx/imagemagick )
                sci-electronics/gerbv
        )
        >=dev-util/intltool-0.35
        virtual/pkgconfig
        sys-devel/gettext"

RDEPEND="${CDEPEND}
        sci-electronics/electronics-menu"

pkg_setup() {
        if use gtk && use motif; then
                elog "Can only build for GTK+ or Motif/Lesstif GUI. GTK+ has priority."
        fi
        if !(use gtk || use motif); then
                elog "Building without GUI, make sure you know what you are doing."
        fi
        if use dbus && !(use gtk || use motif); then
                elog "dbus needs GTK or Motif/Lesstif GUI. Try USE=-dbus or USE=gtk or USE=motif."
        fi
        if use opengl && !(use gtk); then
                elog "GL drawing needs GTK"
        fi
        if (use gtk || (! use gtk && ! use motif)) &&  (use xrender); then
                elog "The XRender extension is only usable with the Motif/Lesstif GUI."
        fi
}

src_prepare() {
        if use test; then
                # adapt the list of tests to run according to USE flag settings
                if ! use png; then
                        sed -i '/^hid_png/d' tests/tests.list || die
                fi
                if ! use gcode; then
                        sed -i '/^hid_gcode/d' tests/tests.list || die
                fi
        fi
        # Backport from upstream
        # http://git.geda-project.org/pcb/commit/?id=a34b40add60310a51780f359cc90d9c5ee75752c
        # (do not install static GTS library)
        sed -i -e 's/lib_LIBRARIES/noinst_LIBRARIES/' -e 's/include_HEADERS/noinst_HEADERS/' gts/Makefile.am || die

        # fix bad syntax in Makefile.am and configure.ac before running eautoreconf
        sed -i -e 's/:=/=/' Makefile.am || die
        #epatch "${FILESDIR}"/${P}-fix-config.diff
        eautoreconf
}

src_configure() {
        local myconf
        if use gtk ; then
                myconf="--with-gui=gtk $(use_enable dbus) $(use_enable opengl gl) --disable-xrender"
        elif use motif ; then
                myconf="--with-gui=lesstif $(use_enable dbus) $(use_enable xrender)"
        else
                myconf="--with-gui=batch --disable-xrender --disable-dbus"
        fi

        local exporters="bom gerber ps"
        if (use png || use jpeg || use gif) ; then
                exporters="${exporters} png"
        fi
        use nelma && exporters="${exporters} nelma"
        use gcode && exporters="${exporters} gcode"
        use tk || export WISH="${EPREFIX}/bin/true"

        econf \
                ${myconf} \
                $(use_enable doc) \
                $(use_enable gif) \
                $(use_enable jpeg) \
                $(use_enable png) \
                $(use_enable m4lib-png) \
                $(use_enable toporouter) \
                $(use_enable debug) \
                $(use_enable nls) \
                --disable-toporouter-output \
                --with-exporters="${exporters}" \
                --disable-dependency-tracking \
                --disable-rpath \
                --disable-update-mime-database \
                --disable-update-desktop-database \
                --docdir="${EPREFIX}/usr/share/doc/${PF}"
}
# toporouter-output USE flag removed, there seems to be no result
#               $(use_enable toporouter-output) \

src_compile() {
        emake AR="$(tc-getAR)"
}

src_install() {
        emake DESTDIR="${D}" install || die "install failed"
        dodoc AUTHORS README NEWS ChangeLog
}

pkg_preinst() {
        gnome2_icon_savelist
}

pkg_postinst() {
        fdo-mime_desktop_database_update
        fdo-mime_mime_database_update
        gnome2_icon_cache_update
}

pkg_postrm() {
        fdo-mime_desktop_database_update
        fdo-mime_mime_database_update
        gnome2_icon_cache_update
}
-

Reproducible: Always
Comment 1 Joe M 2013-03-09 05:42:08 UTC
Created attachment 341376 [details, diff]
pcb git ebuild
Comment 2 Joe M 2014-02-12 21:49:59 UTC
Created attachment 370250 [details]
live ebuild
Comment 3 Alex Xu (Hello71) 2014-02-12 21:55:39 UTC
IUSE="dbus debug doc gcode gif +gtk jpeg m4lib-png motif nelma opengl png
test tk toporouter xrender nls"

sort IUSE

delete unused code

	 xrender? ( motif )
"

one line

if !(use gtk || use motif);

de morgan's laws

		if ! use png; then
			sed -i '/^hid_png/d' tests/tests.list || die
		fi

use png || ...

	if (use png || use jpeg || use gif) ; then

this is not C, you don't need () around if cond
Comment 4 Joe M 2014-02-13 03:17:57 UTC
Created attachment 370264 [details]
live ebuild
Comment 5 Joe M 2014-02-13 03:22:20 UTC
(In reply to Alex Xu (Hello71) from comment #3)
> IUSE="dbus debug doc gcode gif +gtk jpeg m4lib-png motif nelma opengl png
> test tk toporouter xrender nls"
> 
> sort IUSE
done

> 
> delete unused code
> 
> 	 xrender? ( motif )
> "
> 
> one line
done

> 
> if !(use gtk || use motif);
> 
> de morgan's laws
"not (A or B)" is the same as "(not A) and (not B)"
changed to if (! use gtk)  && (! use motif); then
Is that what is needed?

> 
> 		if ! use png; then
> 			sed -i '/^hid_png/d' tests/tests.list || die
> 		fi
> 
> use png || ...
done

> 
> 	if (use png || use jpeg || use gif) ; then
> 
> this is not C, you don't need () around if cond
done

Thanks
Comment 6 Alex Xu (Hello71) 2014-02-13 12:36:19 UTC
(In reply to Joe M from comment #5)
> (In reply to Alex Xu (Hello71) from comment #3)
> > 
> > if !(use gtk || use motif);
> > 
> > de morgan's laws
> "not (A or B)" is the same as "(not A) and (not B)"
> changed to if (! use gtk)  && (! use motif); then
> Is that what is needed?
> 
> Thanks

this isn't C, you *do not need ()*. parens in shell mean "spawn a new process", which is to be avoided if possible.

if ! use gtk && ! use motif
Comment 7 Joe M 2014-02-13 14:45:37 UTC
Created attachment 370320 [details]
freecad-9999.ebuild

changed to

	if ! use gtk  && ! use motif; then
		ewarn "${P} is being built without a GUI, make sure you know what you're doing!  Otherwise please enable GTK or MOTIF use flags"
	fi
Comment 8 Joe M 2014-02-13 14:47:23 UTC
(In reply to Alex Xu (Hello71) from comment #6)
> (In reply to Joe M from comment #5)
> > (In reply to Alex Xu (Hello71) from comment #3)
> > > 
> > > if !(use gtk || use motif);
> > > 
> > > de morgan's laws
> > "not (A or B)" is the same as "(not A) and (not B)"
> > changed to if (! use gtk)  && (! use motif); then
> > Is that what is needed?
> > 
> > Thanks
> 
> this isn't C, you *do not need ()*. parens in shell mean "spawn a new
> process", which is to be avoided if possible.
> 
> if ! use gtk && ! use motif

Thanks for the explanation.
Comment 9 Joe M 2014-02-13 14:47:36 UTC
Created attachment 370322 [details]
freecad-9999.ebuild
Comment 10 Joe M 2014-02-13 19:30:29 UTC
Created attachment 370344 [details]
pcb-99999999.ebuild
Comment 11 Alex Xu (Hello71) 2014-02-22 13:10:50 UTC
	if use gtk ; then
		myconf="--with-gui=gtk $(use_enable dbus) $(use_enable opengl gl) --disable-xrender"
	elif use motif ; then
		myconf="--with-gui=lesstif $(use_enable dbus) $(use_enable xrender) --disable-gl"
	else
		myconf="--with-gui=batch --disable-xrender --disable-dbus --disable-gl"
	fi

maybe warn when some USE flags are being ignored?

e.g. use opengl && einfo "Ignoring opengl use flag, requires gtk"
Comment 12 Joe M 2014-02-22 17:52:37 UTC
(In reply to Alex Xu (Hello71) from comment #11)
> 	if use gtk ; then
> 		myconf="--with-gui=gtk $(use_enable dbus) $(use_enable opengl gl)
> --disable-xrender"
> 	elif use motif ; then
> 		myconf="--with-gui=lesstif $(use_enable dbus) $(use_enable xrender)
> --disable-gl"
> 	else
> 		myconf="--with-gui=batch --disable-xrender --disable-dbus --disable-gl"
> 	fi
> 
> maybe warn when some USE flags are being ignored?
> 
> e.g. use opengl && einfo "Ignoring opengl use flag, requires gtk"

ok, added the change to the attached ebuild.
Comment 13 Joe M 2014-02-22 17:53:06 UTC
Created attachment 371076 [details]
pcb-99999999.ebuild
Comment 14 Joe M 2014-03-05 16:43:48 UTC
Created attachment 371794 [details]
pcb-9999999.ebuild

changed IUSE from 2 lines to a single line.
Comment 15 Joe M 2014-03-05 16:44:34 UTC
Created attachment 371796 [details]
pcb-99999999.ebuild
Comment 16 David Seifert gentoo-dev 2020-02-04 11:29:37 UTC
Unless someone steps up to maintain this, it won't happen.