summaryrefslogtreecommitdiff
path: root/extra/kdesdk-lokalize
diff options
context:
space:
mode:
Diffstat (limited to 'extra/kdesdk-lokalize')
-rw-r--r--extra/kdesdk-lokalize/PKGBUILD43
-rw-r--r--extra/kdesdk-lokalize/fix-python2-path.patch22
-rw-r--r--extra/kdesdk-lokalize/kdesdk-lokalize.install12
3 files changed, 77 insertions, 0 deletions
diff --git a/extra/kdesdk-lokalize/PKGBUILD b/extra/kdesdk-lokalize/PKGBUILD
new file mode 100644
index 000000000..2ec1b912d
--- /dev/null
+++ b/extra/kdesdk-lokalize/PKGBUILD
@@ -0,0 +1,43 @@
+# $Id$
+# Maintainer: Andrea Scarpino <andrea@archlinux.org>
+
+pkgname=kdesdk-lokalize
+pkgver=4.11.0
+pkgrel=1
+pkgdesc='Computer-Aided Translation System'
+url='http://kde.org/applications/development/lokalize/'
+arch=('i686' 'x86_64')
+license=('GPL' 'LGPL' 'FDL')
+groups=('kde' 'kdesdk')
+depends=('kdebase-runtime' 'kdebindings-python2' 'kdesdk-strigi-analyzers')
+makedepends=('cmake' 'automoc4')
+optdepends=('translate-toolkit: enable extra python script')
+install=${pkgname}.install
+source=("http://download.kde.org/stable/${pkgver}/src/lokalize-${pkgver}.tar.xz"
+ 'fix-python2-path.patch')
+sha1sums=('b0e606806db9188c95e49d139ba58d417232d3a3'
+ '07db42bbcae402c292eebf002e549b04162621c5')
+
+prepare() {
+ cd lokalize-${pkgver}
+ patch -p2 -i "${srcdir}"/fix-python2-path.patch
+}
+
+build() {
+ mkdir build
+ cd build
+ cmake ../lokalize-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DKDE4_BUILD_TESTS=OFF \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd build
+ make DESTDIR=$pkgdir install
+
+ # Fix python 2 path
+ sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' \
+ "${pkgdir}"/usr/share/apps/lokalize/scripts/odf/xliffmerge.py
+}
diff --git a/extra/kdesdk-lokalize/fix-python2-path.patch b/extra/kdesdk-lokalize/fix-python2-path.patch
new file mode 100644
index 000000000..9e9a442c0
--- /dev/null
+++ b/extra/kdesdk-lokalize/fix-python2-path.patch
@@ -0,0 +1,22 @@
+--- kdesdk-4.5.80/lokalize/scripts/msgmerge.py~ 2010-11-24 11:22:42.120000002 +0100
++++ kdesdk-4.5.80/lokalize/scripts/msgmerge.py 2010-11-24 11:22:42.146666670 +0100
+@@ -114,7 +114,7 @@
+ print >>sys.stderr, "Execution failed:", e
+
+ cmd='%s/odf/xliffmerge.py -i %s -t %s -o %s' % (ourPath,xliffpathname,xlifftemplatepathname,xliffpathname)
+- if os.name!='nt': cmd='python '+cmd
++ if os.name!='nt': cmd='python2 '+cmd
+ else: cmd=cmd.replace('/','\\')
+ os.system(cmd)
+
+--- kdesdk-4.5.80/lokalize/scripts/xliff2odf.py~ 2010-11-24 11:24:10.853333336 +0100
++++ kdesdk-4.5.80/lokalize/scripts/xliff2odf.py 2010-11-24 11:24:10.883333336 +0100
+@@ -42,7 +42,7 @@
+ xliff2odf.convertxliff(xliffinput, translatedodfpathname, odf)
+
+ ourpath=([p for p in sys.path if os.path.exists(p+'/xliff2odf.py')]+[''])[0]
+- os.system('python "'+ourpath+'/xliff2odf-standalone.py" "%s" "%s" &'%(translatedodfpathname, Editor.currentEntryId()))
++ os.system('python2 "'+ourpath+'/xliff2odf-standalone.py" "%s" "%s" &'%(translatedodfpathname, Editor.currentEntryId()))
+
+ try: convert()
+ except: print 'error occured'
diff --git a/extra/kdesdk-lokalize/kdesdk-lokalize.install b/extra/kdesdk-lokalize/kdesdk-lokalize.install
new file mode 100644
index 000000000..5495fb1b5
--- /dev/null
+++ b/extra/kdesdk-lokalize/kdesdk-lokalize.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}