ahodesuka / ahoviewer

A GTK image viewer, manga reader, and booru browser
MIT License
486 stars 31 forks source link

Provide an ebuild #42

Closed ihavenoface closed 8 years ago

ihavenoface commented 8 years ago

It would be nice to have an "official" ebuild for this.

Right now I'm using the following (does not install .desktop / icons):

# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit autotools eutils git-r3

DESCRIPTION="A GTK2 image viewer, manga reader, and booru browser"
HOMEPAGE="https://github.com/ahodesuka/ahoviewer"

EGIT_REPO_URI="https://github.com/ahodesuka/${PN}.git"
EGIT_BRANCH="master"

LICENSE="MIT"
SLOT="0"
KEYWORDS=""
IUSE="gnome-keyring gstreamer rar zip"

DEPEND="gnome-keyring? (
                app-crypt/libsecret
                gnome-base/gnome-keyring
        )
        gstreamer? (
                media-libs/gstreamer:1.0
                media-libs/gst-plugins-bad:1.0
                media-libs/gst-plugins-good:1.0
        )
        rar? ( app-arch/unrar )
        zip? (
                app-arch/zip
                dev-libs/libzip
        )
        >=dev-cpp/gtkmm-2.20.0:2.4
        >=dev-cpp/glibmm-2.36.0
        >=dev-libs/libconfig-1.5
        >=net-misc/curl-7.32.0
        dev-libs/libxml2"
RDEPEND="${DEPEND}"

src_configure() {
        autoreconf -fvi  || die
        ./configure \
                $(use_enable gnome-keyring libsecret) \
                $(use_enable gstreamer gst) \
                $(use_enable rar) \
                $(use_enable zip) || die
}

src_compile() {
        emake
}

src_install() {
        emake DESTDIR="${D}" install
}
ahodesuka commented 8 years ago

Here's the ebuild I use.

# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit autotools eutils vcs-snapshot fdo-mime gnome2-utils

DESCRIPTION="A GTK2 image viewer, manga reader, and booru browser"
HOMEPAGE="https://github.com/ahodesuka/ahoviewer"

if [[ ${PV} = 9999 ]]; then
    EGIT_REPO_URI="https://github.com/ahodesuka/ahoviewer.git"
    inherit git-r3
else
    SRC_URI="https://github.com/ahodesuka/ahoviewer/archive/${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
fi

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+gstreamer +libsecret +rar +zip"

DEPEND="
    >=dev-cpp/glibmm-2.36.0:2
    >=dev-cpp/gtkmm-2.20.0:2.4
    >=dev-libs/libconfig-1.4
    >=net-misc/curl-7.16.0
    dev-libs/libxml2
    gstreamer? (
        media-libs/gstreamer:1.0
        media-libs/gst-plugins-bad:1.0[opengl]
    )
    libsecret? ( app-crypt/libsecret )
    rar? ( app-arch/unrar )
    zip? ( dev-libs/libzip )
"
RDEPEND="${DEPEND}
    gstreamer? (
        media-libs/gst-plugins-good:1.0
        || (
            media-plugins/gst-plugins-vpx
            media-plugins/gst-plugins-libav
        )
    )
"

src_prepare() {
    eautoreconf
}

src_configure() {
    econf \
        $(use_enable gstreamer gst) \
        $(use_enable libsecret) \
        $(use_enable rar) \
        $(use_enable zip)
}

pkg_preinst() {
    gnome2_icon_savelist
}

pkg_postinst() {
    fdo-mime_desktop_database_update
    gnome2_icon_cache_update
}

pkg_postrm() {
    fdo-mime_desktop_database_update
    gnome2_icon_cache_update
}

I have been planning on making a repository for my local overlay on github, but haven't gotten around to it. I'll keep this open until I finally do it.