You are not logged in.
Here are the build instructions to help anyone interested: https://code.google.com/p/pdfium/wiki/Build
You might want to look at chromium's PKGBUILD for any helpful tricks you might want to reuse.
I would love to have an opensource pdf rendering library available to me so that I can run it in my opensource browser
I wish I had time to package this myself but I do not.
Cheers!
Offline
Getting there. I've been able to build the test app, but no library yet. Anyone else working on this?
Offline
Here's my stab at a PKGBUILD:
pkgname=pdfium-git
pkgver=r171.8f2c3dc
pkgrel=1
pkgdesc="An open-source PDF rendering engine."
url="https://code.google.com/p/pdfium/"
arch=('i686' 'x86_64')
makedepends=('git' 'subversion' 'python2')
license=('BSD')
source=(
"git+https://pdfium.googlesource.com/pdfium"
"gyp::svn+http://gyp.googlecode.com/svn/trunk"
"v8::svn+http://v8.googlecode.com/svn/trunk"
"icu::svn+https://src.chromium.org/chrome/trunk/deps/third_party/icu46"
)
md5sums=('SKIP' 'SKIP' 'SKIP' 'SKIP')
pkgver() {
cd "${srcdir}/pdfium"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}"
mv gyp pdfium/build/
mv v8 pdfium/
mv icu pdfium/v8/third_party/
echo "Fixing python2 dependence..."
find -type f -exec grep -Il . {} + | grep -v '/\.\(svn\|git\)/' | xargs -d '\n' sed --in-place "s/\bpython\b/python2/g"
}
package() {
cd "${srcdir}/pdfium"
build/gyp_pdfium
BUILDTYPE=Release make
}
Notes:
1. I have no idea what the depends should be.
2. It feels really wrong to checkout three other repos in order to build this one, but it looks like there are actual source dependencies. I.e. Arch's v8 package does not supply the GYP files that the pdfium build looks for. Maybe the gyp checkout could be replaced by gyp-svn?
3. I couldn't find any guidance on handling scripts that expect `python` to be Python 2.7, so I went with a really ugly, overzealous find-and-replace. Would a symlink to python2 and some PATH manipulation work? What's preferred?
4. This builds binaries mksnapshot and pdfium_test... how does this end up as a browser plugin?
Last edited by silverhammermba (2014-08-21 12:05:39)
Offline
I gave up on this, I'm pretty sure in order to build it as a plugin, you need to build it when you build chromium, and I'm not getting into that can of worms.
Offline
I'm starting to think it's even worse, and this is just the bare bones PDF library without any browser plugin stuff whatsoever. It's also annoying that I can't find many people talking about this elsewhere.
Offline
Why not put all three svn checkouts to the source array and then check them out locally?
Offline
That definitely makes more sense, but the pdfium build instructions expect you to check them out into pdfium's source directory. What is the proper way to put them there? Just mv them in prepare()?
Offline
I tried to check them out locally, but it doesn't seem to be that easy with svn.
PKGBUILD
pkgname=pdfium-git
pkgver=r171.8f2c3dc
pkgrel=1
pkgdesc="An open-source PDF rendering engine."
url="https://code.google.com/p/pdfium/"
arch=('i686' 'x86_64')
makedepends=('git' 'subversion' 'python2')
license=('BSD')
source=("pdfium::git+https://pdfium.googlesource.com/pdfium"
"gyp::svn+http://gyp.googlecode.com/svn/trunk"
"v8::svn+http://v8.googlecode.com/svn/trunk"
"icu46::svn+https://src.chromium.org/chrome/trunk/deps/third_party/icu46")
md5sums=('SKIP'
'SKIP'
'SKIP'
'SKIP')
pkgver() {
cd "$srcdir/pdfium"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/pdfium"
# checkout third party tools
svn co file://"$srcdir"/gyp build/gyp
svn co file://"$srcdir"/v8 v8
svn co file://"$srcdir"/icu46 v8/third_party/icu
# fix for python2
find -type f -exec grep -Il . {} + | grep -v '/\.\(svn\|git\)/' | xargs -d '\n' sed --in-place "s/\bpython\b/python2/g"
}
build() {
cd "$srcdir/pdfium"
build/gyp_pdfium
BUILDTYPE=Release make
}
package() {
cd "$srcdir/pdfium"
}
output of makepkg
==> Making package: pdfium-git r171.8f2c3dc-1 (Thu Aug 21 16:33:25 CEST 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating pdfium git repo...
Fetching origin
-> Updating gyp svn repo...
Updating '.':
At revision 1967.
-> Updating v8 svn repo...
Updating '.':
At revision 23280.
-> Updating icu46 svn repo...
Updating '.':
At revision 291064.
==> Validating source files with md5sums...
pdfium ... Skipped
gyp ... Skipped
v8 ... Skipped
icu46 ... Skipped
==> Extracting sources...
-> Creating working copy of pdfium git repo...
Cloning into 'pdfium'...
done.
-> Creating working copy of trunk svn repo...
-> Creating working copy of trunk svn repo...
-> Creating working copy of icu46 svn repo...
==> Starting pkgver()...
==> Starting prepare()...
svn: E180001: Unable to connect to a repository at URL 'file:///tmp/pdfium-git/src/gyp'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///tmp/pdfium-git/src/gyp'
==> ERROR: A failure occurred in prepare().
Aborting...
Offline
This is what I was doing:
_pkgname=pdfium
pkgname=$_pkgname-git
pkgver=r154.fda0d42
pkgrel=1
pkgdesc="Open-source PDF rendering engine"
arch=('i686' 'x86_64')
url="https://code.google.com/p/pdfium/"
license=('BSD')
depends=()
makedepends=('git' 'subversion' 'python2')
source=("git+https://pdfium.googlesource.com/pdfium"
"gyp::svn+http://gyp.googlecode.com/svn/trunk"
"v8::svn+http://v8.googlecode.com/svn/trunk"
"icu::svn+https://src.chromium.org/chrome/trunk/deps/third_party/icu46")
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP')
pkgver() {
cd "$srcdir/$_pkgname"
printf "r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}
prepare() {
cd "$srcdir/$_pkgname"
mv "$srcdir/gyp" build
mv "$srcdir/v8" .
mv "$srcdir/icu" v8/third_party
find -name *.py -exec sed -i 's/env python$/&2/' {} \;
sed -i 's/env python$/&2/' build/gyp_pdfium
sed -i "s/'python'/'python2'/g" v8/tools/gyp/v8.gyp
}
build() {
cd "$srcdir/$_pkgname"
build/gyp_pdfium
make
}
Last edited by Scimmia (2014-08-21 14:43:53)
Offline
Ok now I feel stupid, of course it makes more sense to just move this stuff..
Offline
Ok now I feel stupid, of course it makes more sense to just move this stuff..
I'd use a symlink if the build process allows it.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Right, sounds like the cleaner way. The package still builds here, no idea how long it'll take..
Offline
sekret wrote:Ok now I feel stupid, of course it makes more sense to just move this stuff..
I'd use a symlink if the build process allows it.
I tried that first, build failed.
Offline