diff options
author | Jaroslav Lichtblau | 2015-08-03 20:31:49 +0200 |
---|---|---|
committer | Jaroslav Lichtblau | 2015-08-03 20:31:49 +0200 |
commit | 74475e24e6390fcae6ee0c11ab0ce9c5360cafdf (patch) | |
tree | edc5e606814591cbf946486f203b14161c89c071 | |
download | aur-74475e24e6390fcae6ee0c11ab0ce9c5360cafdf.tar.gz |
moving tpp to AUR4
although the package still does not work properly
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 34 | ||||
-rw-r--r-- | fix-for-ruby1.9.patch | 98 |
3 files changed, 150 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e416d366621c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = tpp + pkgdesc = A text presentation program in ncurses, LaTeX, or text. + pkgver = 1.3.1 + pkgrel = 3 + url = http://www.ngolde.de/tpp.html + arch = any + license = GPL + makedepends = recode + depends = ncurses + depends = ruby-ncurses + depends = ruby>=1.8 + source = http://www.ngolde.de/download/tpp-1.3.1.tar.gz + source = fix-for-ruby1.9.patch + sha256sums = 68e3de94fbfb62bd91a6d635581bcf8671a306fffe615d00294d388ad91e1b5f + sha256sums = ba280e02c1e4373f7b8f4fcbb1822f342f00188bb17d0a6d22c78f0d927dcad3 + +pkgname = tpp + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..e5b11dba4817 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,34 @@ +# Maintainer: +# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org> +# Contributor: Bersam Karbasion <bersam.k at gmail dot com> +# Contributor: pancho <pancho at pancho dot name> +# Contributor: taifunbrowser <bjmnbraun at gmail dot com> +# Contributor: junglepeanut <jungle1peanut1 at hotmail dot com> + +pkgname=tpp +pkgver=1.3.1 +pkgrel=3 +pkgdesc="A text presentation program in ncurses, LaTeX, or text." +arch=('any') +url="http://www.ngolde.de/tpp.html" +license=('GPL') +depends=('ncurses' 'ruby-ncurses' 'ruby>=1.8') +makedepends=('recode') +source=(http://www.ngolde.de/download/$pkgname-$pkgver.tar.gz + fix-for-ruby1.9.patch) +sha256sums=('68e3de94fbfb62bd91a6d635581bcf8671a306fffe615d00294d388ad91e1b5f' + 'ba280e02c1e4373f7b8f4fcbb1822f342f00188bb17d0a6d22c78f0d927dcad3') + +prepare() { + cd "$srcdir"/$pkgname-$pkgver + + patch -p0 < "${srcdir}"/fix-for-ruby1.9.patch + recode latin1..UTF-8 "${srcdir}"/$pkgname-$pkgver/examples/*.tpp +} + +package() { + cd "${srcdir}"/$pkgname-$pkgver + + install -d "${pkgdir}"/usr/{bin,share/man/man1} + make prefix="${pkgdir}"/usr install +} diff --git a/fix-for-ruby1.9.patch b/fix-for-ruby1.9.patch new file mode 100644 index 000000000000..5f52a3f694ea --- /dev/null +++ b/fix-for-ruby1.9.patch @@ -0,0 +1,98 @@ +--- ../tpp-old/tpp-1.3.1/tpp.rb 2007-04-23 02:12:21.000000000 -0700 ++++ tpp.rb 2014-12-10 23:23:37.572444501 -0800 +@@ -568,13 +568,17 @@ + window.move(@termheight/4,1+prompt.length+cursor_pos) # move cursor to the end of code + ch = window.getch + case ch +- when Ncurses::KEY_ENTER, ?\n, ?\r ++ when Ncurses::KEY_ENTER, "\n"[0].ord, "\r"[0].ord + Ncurses.curs_set(0) + Ncurses.noecho ++ window.move(@termheight/4 + 1,1) # move cursor to the next line ++ window.refresh + rc = Kernel.system(string) + if not rc then + @screen.mvaddstr(@termheight/4+1,1,"Error: exec \"#{string}\" failed with error code #{$?}") + @screen.mvaddstr(@termheight-2,@termwidth/2-message.length/2,message) ++ ch = Ncurses.getch() ++ @screen.refresh + end + if rc then + @screen.mvaddstr(@termheight-2,@termwidth/2-message.length/2,message) +@@ -582,15 +586,15 @@ + @screen.refresh + end + return +- when Ncurses::KEY_LEFT ++ when Ncurses::KEY_LEFT + cursor_pos = [0, cursor_pos-1].max # jump one character to the left + when Ncurses::KEY_RIGHT + cursor_pos = [0, cursor_pos+1].max # jump one character to the right +- when Ncurses::KEY_BACKSPACE ++ when Ncurses::KEY_BACKSPACE, "\b"[0].ord, 127 + string = string[0...([0, cursor_pos-1].max)] + string[cursor_pos..-1] + cursor_pos = [0, cursor_pos-1].max +- window.mvaddstr(@termheight/4, 1+prompt.length+string.length, " ") +- when " "[0]..255 ++ window.mvaddstr(@termheight/4, 1+prompt.length+string.length, " ") ++ when " "[0].ord..255 + if (cursor_pos < max_len) + string[cursor_pos,0] = ch.chr + cursor_pos += 1 +@@ -1396,17 +1400,17 @@ + loop do + ch = @vis.get_key + case ch +- when 'q'[0], 'Q'[0] # 'Q'uit ++ when 'q'[0].ord, 'Q'[0].ord # 'Q'uit + return +- when 'r'[0], 'R'[0] # 'R'edraw slide ++ when 'r'[0].ord, 'R'[0].ord # 'R'edraw slide + changed_page = true # @todo: actually implement redraw +- when 'e'[0], 'E'[0] ++ when 'e'[0].ord, 'E'[0].ord + @cur_page = @pages.size - 1 + break +- when 's'[0], 'S'[0] ++ when 's'[0].ord, 'S'[0].ord + @cur_page = 0 + break +- when 'j'[0], 'J'[0] # 'J'ump to slide ++ when 'j'[0].ord, 'J'[0].ord # 'J'ump to slide + screen = @vis.store_screen + p = @vis.read_newpage(@pages,@cur_page) + if p >= 0 and p < @pages.size +@@ -1417,28 +1421,28 @@ + @vis.restore_screen(screen) + end + break +- when 'l'[0], 'L'[0] # re'l'oad current file ++ when 'l'[0].ord, 'L'[0].ord # re'l'oad current file + @reload_file = true + return +- when 'c'[0], 'C'[0] # command prompt ++ when 'c'[0].ord, 'C'[0].ord # command prompt + screen = @vis.store_screen + @vis.do_command_prompt + @vis.clear + @vis.restore_screen(screen) +- when '?'[0], 'h'[0] ++ when '?'[0].ord, 'h'[0].ord + screen = @vis.store_screen + @vis.show_help_page + ch = @vis.get_key + @vis.clear + @vis.restore_screen(screen) +- when :keyright, :keydown, ' '[0] ++ when :keyright, :keydown, ' '[0].ord + if @cur_page + 1 < @pages.size and eop then + @cur_page += 1 + @pages[@cur_page].reset_eop + @vis.new_page + end + break +- when 'b'[0], 'B'[0], :keyleft, :keyup ++ when 'b'[0].ord, 'B'[0].ord, :keyleft, :keyup + if @cur_page > 0 then + @cur_page -= 1 + @pages[@cur_page].reset_eop |