Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mupdf - lightweight pdf-viewer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Tue Aug 04, 2009 11:18 am    Post subject: mupdf - lightweight pdf-viewer Reply with quote

Yesterday, I found a nice little pdf-viewer, no frills, no strings attached, just what I want. Now, I'd like to have an ebuild for it, but got some problems with it, mainly because of the uncommon naming of the source's package - help appreciated :)

Code:
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI="2"

DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
HOMEPAGE="http://ccxvii.net/mupdf/"

MY_VERSION="2009-07-07-source"

SRC_URI="http://ccxvii.net/mupdf/download/mupdf-${MY_VERSION}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+cjk jbig jpeg2k"

RDEPEND="sys-libs/zlib
    media-libs/jpeg
    >=media-libs/freetype-2
    jbig? ( media-libs/jbigkit )
    jpeg2k? ( media-libs/jasper )"

DEPEND="${RDEPEND}
    dev-util/ftjam"

src_unpack() {
    unpack ${A}
    cd "mupdf-${MY_VERSION}"
}

src_compile() {
    PARAMETER=""
    use ! cjk && PARAMETER="${PARAMETER} '-sDEFINES=NOCJK'"
    use jbig && PARAMETER="${PARAMETER} '-sHAVE_JBIG2DEC=yes'"
    use jpeg2k && PARAMETER="${PARAMETER} '-sHAVE_JASPER=yes'"
    jam ${PARAMETER}
}

src_install() {
    cp build/mupdf "${D}/usr/bin/mupdf"
}


Edit, thanks to @goffrie, we now have a working ebuild @ b.g.o.


Last edited by avx on Wed Aug 05, 2009 3:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
goffrie
n00b
n00b


Joined: 14 Mar 2007
Posts: 67

PostPosted: Wed Aug 05, 2009 4:15 am    Post subject: Reply with quote

This ebuild seems to work fine for me. However, I only tested it with the "+cjk +jpeg2k -jbig" USE flag combination.

Unfortunately the "pdfinfo" binary conflicts with one installed from app-text/poppler-utils, so I renamed it to "mupdf_pdfinfo".
Code:

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

EAPI="2"

DESCRIPTION="a lightweight PDF viewer and toolkit written in portable C"
HOMEPAGE="http://ccxvii.net/mupdf/"

MY_VERSION="2009-07-07"

SRC_URI="http://ccxvii.net/mupdf/download/mupdf-${MY_VERSION}-source.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+cjk jbig jpeg2k"

RDEPEND="sys-libs/zlib
   media-libs/jpeg
   >=media-libs/freetype-2
   jbig? ( media-libs/jbigkit )
   jpeg2k? ( media-libs/jasper )"

DEPEND="${RDEPEND}
   dev-util/ftjam"

src_compile() {
   cd "mupdf-${MY_VERSION}-source"
   echo "LINKFLAGS = ${LDFLAGS} ;" >> Jamrules
   echo "OPTIM = ${CFLAGS} ;" >> Jamrules
   PARAMETER=""
   use cjk || PARAMETER="${PARAMETER} '-sDEFINES=NOCJK'"
   use jbig && PARAMETER="${PARAMETER} '-sHAVE_JBIG2DEC=yes'"
   use jpeg2k && PARAMETER="${PARAMETER} '-sHAVE_JASPER=yes'"
   jam ${PARAMETER} || die "jam failed"
}

src_install() {
   cd "mupdf-${MY_VERSION}-source"
   dodoc COPYING README
   cd build
   dobin cmapdump fontdump mupdf pdfclean pdfdraw pdfextract pdfshow
   newbin pdfinfo mupdf_pdfinfo # avoid collision with app-text/poppler-utils
   dolib.a *.a
}
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Wed Aug 05, 2009 12:09 pm    Post subject: Reply with quote

Mh, doesn't work for me on ~x86, I get "{dobin,newbin,dolib}: $file does not exist"-errors, allthough it compiled. If I can get it working, may I post it to bugzilla or do you want to do it yourself? Thanks so far.
Back to top
View user's profile Send private message
goffrie
n00b
n00b


Joined: 14 Mar 2007
Posts: 67

PostPosted: Wed Aug 05, 2009 3:13 pm    Post subject: Reply with quote

Huh. It builds into "build/" on amd64, but it builds into "build/linux-x86-debug/" on x86. Add this to the ebuild:
Code:

echo 'ALL_LOCATE_TARGET = [ FDirName $(TOP) build ] ;' >> Jamrules

some place before the "jam ${PARAMETER}" in src_compile;
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Wed Aug 05, 2009 3:41 pm    Post subject: Reply with quote

That works, thank you. I hope you don't mind, I posted the ebuild @ b.g.o. Marking as solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum