summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Bachmann2017-01-28 13:32:41 +0100
committerSimon Bachmann2017-01-28 13:32:41 +0100
commitd9840adc93c5250c1d2c59807c80d347109b435a (patch)
treeb36d213d9fb16cb9188ec1f840cb514517e10f4d
downloadaur-d9840adc93c5250c1d2c59807c80d347109b435a.tar.gz
Created package
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD55
-rw-r--r--destdir.patch58
3 files changed, 134 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..9e0acc76e6c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = critcl-git
+ pkgdesc = Critcl lets you easily embed C code in Tcl.
+ pkgver = 3.1.16rc0.r10.21a4e10
+ pkgrel = 2
+ url = http://andreas-kupries.github.io/critcl/
+ arch = any
+ license = BSD
+ makedepends = git
+ makedepends = tcl>=8.5
+ depends = tcl
+ depends = tcllib
+ depends = gcc
+ provides = critcl
+ conflicts = critcl
+ source = critcl::git+http://github.com/andreas-kupries/critcl#branch=master
+ source = destdir.patch
+ md5sums = SKIP
+ md5sums = b7d96a2d75916544babf9b7c160eeeff
+
+pkgname = critcl-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..57728ce2c50
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer: Simon Bachmann simonbachmann@bluewin.ch
+pkgname=critcl-git # '-bzr', '-git', '-hg' or '-svn'
+pkgver=3.1.16rc0.r10.21a4e10
+pkgrel=2
+pkgdesc="Critcl lets you easily embed C code in Tcl."
+arch=('any')
+url="http://andreas-kupries.github.io/critcl/"
+license=('BSD')
+groups=()
+depends=('tcl' 'tcllib' 'gcc')
+makedepends=('git' 'tcl>=8.5')
+provides=("${pkgname%-git}")
+conflicts=("${pkgname%-git}")
+replaces=()
+backup=()
+options=()
+install=
+source=('critcl::git+http://github.com/andreas-kupries/critcl#branch=master' 'destdir.patch')
+noextract=()
+md5sums=('SKIP'
+ 'b7d96a2d75916544babf9b7c160eeeff')
+
+pkgver() {
+ cd "$srcdir/${pkgname%-git}"
+
+# Git, tags available
+ printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
+
+}
+
+prepare() {
+ cd "$srcdir/${pkgname%-git}"
+ patch -p1 -i "$srcdir/destdir.patch"
+}
+
+build() {
+ cd "$srcdir/${pkgname%-git}"
+ # Only thing to build is the doc
+ tclsh ./build.tcl doc > /dev/null
+}
+
+check() {
+ cd "$srcdir/${pkgname%-git}"
+ tclsh ./build.tcl test > /dev/null
+}
+
+package() {
+ cd "$srcdir/${pkgname%-git}"
+ tclsh ./build.tcl install $pkgdir/$(echo "puts [info library]" | tclsh) > /dev/null
+
+ # install the doc manually
+ install -m 755 -d $pkgdir/usr/share/man/mann
+ install -m 444 -t $pkgdir/usr/share/man/mann ./embedded/man/files/critcl_*.n
+}
+
diff --git a/destdir.patch b/destdir.patch
new file mode 100644
index 00000000000..d654a8ff0c4
--- /dev/null
+++ b/destdir.patch
@@ -0,0 +1,58 @@
+diff -ur andreas-kupries-critcl-62a03a2/build.tcl andreas-kupries-critcl-62a03a2-mod/build.tcl
+--- andreas-kupries-critcl-62a03a2/build.tcl 2016-11-03 08:36:34.000000000 +0100
++++ andreas-kupries-critcl-62a03a2-mod/build.tcl 2017-01-28 11:31:04.251417238 +0100
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # -*- tcl -*- \
+ exec tclsh "$0" ${1+"$@"}
+-package require Tcl 8.4
++package require Tcl 8.5
+ unset -nocomplain ::errorInfo
+ set me [file normalize [info script]]
+ proc main {} {
+@@ -105,6 +105,24 @@
+ }
+ return $path
+ }
++proc dstlfromlib {path} {
++ # kinda the inverse of findlib above
++ # returns the path to dstlpath, relative the */lib path returned by findlib
++ # The path is returned
++ # as a list of directories
++ set relpath {}
++ while {1} {
++ if {[file tail $path] eq "lib"} {
++ break
++ }
++ set new [file dirname $path]
++ set relpath [list [file tail $path] {*}$relpath]
++ if {$new eq $path} break
++ set path $new
++ }
++ return $relpath
++}
++
+ proc id {cv vv} {
+ upvar 1 $cv commit $vv version
+
+@@ -366,9 +384,17 @@
+ # Application: critcl
+
+ set theapp [critapp $dsta]
+-
+- set c [open $theapp w]
+- puts $c "#!/bin/sh\n# -*- tcl -*- \\\nexec [file dirname [file normalize [info nameofexecutable]/___]] \"\$0\" \$\{1+\"\$@\"\}\npackage require critcl::app\ncritcl::app::main \$argv"
++ set reldstl [dstlfromlib $dstl]
++
++ set c [open $theapp w]
++ puts $c {#!/bin/sh}
++ puts $c "# -*- tcl -*- \\"
++ puts $c "exec [file dirname [file normalize [info nameofexecutable]/___]] \"\$0\" \$\{1+\"\$@\"\}\n"
++ puts $c {set libpath [file normalize [file join [file dirname [info script]] .. lib]]}
++ puts $c "set libpath \[file join \$libpath $reldstl \]"
++ puts $c {if {$libpath ni $auto_path} {lappend auto_path $libpath}}
++ puts $c "\npackage require critcl::app"
++ puts $c "critcl::app::main \$argv"
+ close $c
+ +x $theapp
+