Browse Source

Updated nim tests, fixed ringojs-convenient

Started working on Perl
msmith-techempower 10 years ago
parent
commit
efc20cd5da

+ 3 - 0
frameworks/JavaScript/ringojs-convenient/setup.sh

@@ -10,4 +10,7 @@ ringo-admin install grob/ringo-sqlstore
 ringo-admin install ringo/stick
 ringo-admin install ringo/stick
 ringo-admin install oberhamsi/reinhardt
 ringo-admin install oberhamsi/reinhardt
 
 
+mkdir -p $RINGOJS_HOME/packages/ringo-sqlstore/jars/
+cp $RINGOJS_HOME/packages/sql-ringojs-client/jars/mysql.jar $RINGOJS_HOME/packages/ringo-sqlstore/jars/
+
 ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js &
 ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js &

+ 0 - 18
frameworks/Nim/jester/install.sh

@@ -1,18 +0,0 @@
-#!/bin/bash
-
-fw_depends nim nginx
-
-export PATH="$IROOT/nim/bin:$PATH"
-
-if ! nimble path jester > /dev/null 2>&1; then
-  pushd $IROOT
-  if [ ! -d jester ]; then
-    git clone https://github.com/dom96/jester.git
-  fi
-  cd jester
-  git fetch origin
-  git checkout da9e3a73ecac51494430dce2a8387e5f0e32f968
-  nimble update
-  nimble install
-  popd
-fi

+ 1 - 1
frameworks/Nim/jester/setup.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 
 
-export PATH="$IROOT/nim/bin:$IROOT/nginx/sbin:$PATH"
+fw_depends nim jester nginx
 
 
 nim c -d:release hello.nim
 nim c -d:release hello.nim
 nginx -c $TROOT/config/nginx.conf
 nginx -c $TROOT/config/nginx.conf

+ 0 - 18
frameworks/Nim/nawak/install.sh

@@ -1,18 +0,0 @@
-#!/bin/bash
-
-fw_depends nim zeromq mongrel2
-
-export PATH="$IROOT/nim/bin:$PATH"
-
-if ! nimble path nawak > /dev/null 2>&1; then
-  pushd $IROOT
-  if [ ! -d nawak ]; then
-    git clone https://github.com/idlewan/nawak.git
-  fi
-  cd nawak
-  git fetch
-  git checkout b34b0b5077541ae9671957452a70e2578894d3a8
-  nimble update
-  nimble install
-  popd
-fi

+ 2 - 2
frameworks/Nim/nawak/setup.sh

@@ -1,9 +1,9 @@
 #!/bin/bash
 #!/bin/bash
 
 
-export PATH="$IROOT/nim/bin:$IROOT/mongrel2/bin:$PATH"
-
 sed -i 's|host=.* port=5432|host='"${DBHOST}"' port=5432|g' model_postgre.nim
 sed -i 's|host=.* port=5432|host='"${DBHOST}"' port=5432|g' model_postgre.nim
 
 
+fw_depends nim nimble zeromq mongrel2 nawak
+
 echo "** Compiling app"
 echo "** Compiling app"
 nim c --threads:on -d:release -d:postgre_model -l:-Wl,-rpath,$IROOT/zeromq-4.0.3/lib -o:nawak_postgre app.nim
 nim c --threads:on -d:release -d:postgre_model -l:-Wl,-rpath,$IROOT/zeromq-4.0.3/lib -o:nawak_postgre app.nim
 
 

+ 2 - 2
frameworks/Nim/nawak/setup_redis.sh

@@ -1,9 +1,9 @@
 #!/bin/bash
 #!/bin/bash
 
 
-export PATH="$IROOT/nim/bin:$IROOT/mongrel2/bin:$PATH"
-
 sed -i 's|host=.*)|host="'$DBHOST'")|g' model_redis.nim
 sed -i 's|host=.*)|host="'$DBHOST'")|g' model_redis.nim
 
 
+fw_depends nim nimble zeromq mongrel2 nawak
+
 echo "** Compiling app"
 echo "** Compiling app"
 nim c --threads:on -d:release -d:redis_model -l:-Wl,-rpath,$IROOT/zeromq-4.0.3/lib -o:nawak_redis app.nim
 nim c --threads:on -d:release -d:redis_model -l:-Wl,-rpath,$IROOT/zeromq-4.0.3/lib -o:nawak_redis app.nim
 
 

+ 5 - 5
frameworks/Perl/dancer/setup.sh

@@ -1,11 +1,11 @@
 #!/bin/bash
 #!/bin/bash
-export PERL_HOME=${IROOT}/perl-5.18
-export NGINX_HOME=${IROOT}/nginx
 
 
 sed -i 's|localhost|'"${DBHOST}"'|g' app.pl
 sed -i 's|localhost|'"${DBHOST}"'|g' app.pl
-#sed -i 's|user .*;|user '"$(id -u -n)"';|g' nginx.conf
+sed -i 's|user .*;|user '"$(id -u -n)"';|g' nginx.conf
 sed -i 's|server unix.*frameworks-benchmark.sock;|server unix:'"${TROOT}"'/frameworks-benchmark.sock;|g' nginx.conf
 sed -i 's|server unix.*frameworks-benchmark.sock;|server unix:'"${TROOT}"'/frameworks-benchmark.sock;|g' nginx.conf
 
 
-$NGINX_HOME/sbin/nginx -c ${TROOT}/nginx.conf
+fw_depends perl dancer nginx
 
 
-$PERL_HOME/bin/plackup -E production -s Starman --workers=${MAX_THREADS} -l ${TROOT}/frameworks-benchmark.sock -a ./app.pl &
+nginx -c ${TROOT}/nginx.conf
+
+plackup -E production -s Starman --workers=${MAX_THREADS} -l ${TROOT}/frameworks-benchmark.sock -a ./app.pl &

+ 12 - 0
toolset/setup/linux/frameworks/dancer.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+RETCODE=$(fw_exists ${IROOT}/dancer.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $IROOT/dancer.installed
+  return 0; }
+
+cpanm --notest --no-man-page Dancer Dancer::Plugin::Database DBI DBD::mysql JSON::XS Plack Starman
+
+echo "" > $DANCER.installed
+
+source $IROOT/dancer.installed

+ 20 - 0
toolset/setup/linux/frameworks/jester.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+
+JESTER=$IROOT/
+RETCODE=$(fw_exists ${JESTER}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $JESTER.installed
+  return 0; }
+
+fw_depends nim
+
+git clone https://github.com/dom96/jester.git
+cd jester
+git fetch origin
+git checkout da9e3a73ecac51494430dce2a8387e5f0e32f968
+nimble update
+nimble install
+
+echo "" > $JESTER.installed
+
+source $JESTER.installed

+ 19 - 0
toolset/setup/linux/frameworks/nawak.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+
+RETCODE=$(fw_exists ${IROOT}/nawak.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $IROOT/nawak.installed
+  return 0; }
+
+fw_depends nim nimble zeromq mongrel2
+
+git clone https://github.com/idlewan/nawak.git
+cd nawak
+git fetch
+git checkout b34b0b5077541ae9671957452a70e2578894d3a8
+nimble update
+nimble install
+
+echo "" > $IROOT/nawak.installed
+
+source $IROOT/nawak.installed

+ 18 - 12
toolset/setup/linux/languages/nim.sh

@@ -1,14 +1,24 @@
 #!/bin/bash
 #!/bin/bash
 
 
-RETCODE=$(fw_exists $IROOT/nim.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+NIM_VERSION="v0.10.2"
+NIM=$IROOT/nim
+RETCODE=$(fw_exists ${NIM}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $NIM.installed
+  return 0; }
 
 
-test -d nim || git clone git://github.com/Araq/Nim.git nim
+git clone git://github.com/Araq/Nim.git nim
 cd nim
 cd nim
 # post version 0.10.2 - most recent as of 2014-12-
 # post version 0.10.2 - most recent as of 2014-12-
-git checkout v0.10.2
+git checkout $NIM_VERSION
 
 
-test -d csources || git clone git://github.com/nim-lang/csources.git
+# Fixes a complex http request issue in 0.10.2:
+# https://github.com/Araq/Nim/pull/1848
+fw_get https://patch-diff.githubusercontent.com/raw/Araq/Nim/pull/1848.patch
+git apply 1848.patch
+rm 1848.patch
+
+git clone git://github.com/nim-lang/csources.git
 cd csources
 cd csources
 sh build.sh
 sh build.sh
 cd ..
 cd ..
@@ -18,11 +28,7 @@ bin/nim c koch
 # bootstrapping nim's compiler
 # bootstrapping nim's compiler
 ./koch boot -d:release
 ./koch boot -d:release
 
 
-# nim's package manager
-test -d nimble || git clone git://github.com/nim-lang/nimble.git
-cd nimble
-git checkout v0.6
-../bin/nim c src/nimble
-mv src/nimble ../bin/
+echo "export NIM_HOME=${NIM}" > $NIM.installed
+echo -e "export PATH=${NIM}/bin:\$PATH" >> $NIM.installed
 
 
-touch $IROOT/nim.installed
+source $NIM.installed

+ 13 - 6
toolset/setup/linux/languages/perl.sh

@@ -1,16 +1,23 @@
 #!/bin/bash
 #!/bin/bash
 
 
-RETCODE=$(fw_exists ${IROOT}/perl-5.18.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+VERSION="5.18"
+PERL=$IROOT/perl-5.18
+RETCODE=$(fw_exists ${PERL}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $PERL.installed
+  return 0; }
 
 
 fw_get https://raw.github.com/tokuhirom/Perl-Build/master/perl-build -O perl-build.pl
 fw_get https://raw.github.com/tokuhirom/Perl-Build/master/perl-build -O perl-build.pl
 # compile with optimizations, n.b. this does not turn on debugging
 # compile with optimizations, n.b. this does not turn on debugging
-perl perl-build.pl -DDEBUGGING=-g 5.18.2 perl-5.18 2>&1 | tee $IROOT/perl-install.log | awk '{ if (NR%100 == 0) printf "."}'
+perl perl-build.pl -DDEBUGGING=-g 5.18.2 perl-$VERSION 2>&1 | tee $IROOT/perl-install.log | awk '{ if (NR%100 == 0) printf "."}'
 
 
 fw_get http://cpanmin.us -O cpanminus.pl
 fw_get http://cpanmin.us -O cpanminus.pl
-perl-5.18/bin/perl cpanminus.pl --notest --no-man-page App::cpanminus
+perl-$VERSION/bin/perl cpanminus.pl --notest --no-man-page App::cpanminus
 # Install only a bare-bones of Perl modules
 # Install only a bare-bones of Perl modules
 # Install others in the per-framework install script or cpanfile
 # Install others in the per-framework install script or cpanfile
-perl-5.18/bin/cpanm -f --notest --no-man-page Carton JSON JSON::XS IO::Socket::IP IO::Socket::SSL
+perl-$VERSION/bin/cpanm -f --notest --no-man-page Carton JSON JSON::XS IO::Socket::IP IO::Socket::SSL
 
 
-touch ${IROOT}/perl-5.18.installed
+echo "export PERL_HOME=${PERL}" > $PERL.installed
+echo -e "export PATH=:${PERL}/bin:\$PATH" >> $PERL.installed
+
+source $PERL.installed

+ 2 - 2
toolset/setup/linux/languages/ringojs.sh

@@ -8,8 +8,8 @@ RETCODE=$(fw_exists ${RINGOJS}.installed)
   source $RINGOJS.installed
   source $RINGOJS.installed
   return 0; }
   return 0; }
 
 
-fw_get http://ringojs.org/downloads/ringojs-0.10.tar.gz
-fw_untar ringojs-0.10.tar.gz
+fw_get https://github.com/ringo/ringojs/releases/download/v$VERSION.0/ringojs-$VERSION.tar.gz -O ringojs-$VERSION.tar.gz
+fw_untar ringojs-$VERSION.tar.gz
 
 
 echo "export RINGOJS_HOME=${RINGOJS_HOME}" > $RINGOJS.installed
 echo "export RINGOJS_HOME=${RINGOJS_HOME}" > $RINGOJS.installed
 echo -e "export PATH=${RINGOJS_HOME}/bin:\$PATH" >> $RINGOJS.installed
 echo -e "export PATH=${RINGOJS_HOME}/bin:\$PATH" >> $RINGOJS.installed

+ 23 - 0
toolset/setup/linux/systools/nimble.sh

@@ -0,0 +1,23 @@
+#!/bin/bash
+
+fw_depends nim
+
+NIMBLE_VERSION="v0.6"
+NIMBLE=$NIM_HOME/nimble
+RETCODE=$(fw_exists ${IROOT}/nimble.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $IROOT/nimble.installed
+  return 0; }
+
+cd $NIM_HOME
+# nim's package manager
+git clone git://github.com/nim-lang/nimble.git
+cd nimble
+git checkout $NIMBLE_VERSION
+../bin/nim c src/nimble
+mv src/nimble ../bin/
+
+cd $IROOT
+echo "" > $IROOT/nimble.installed
+
+source $IROOT/nimble.installed

+ 9 - 3
toolset/setup/linux/webservers/mongrel2.sh

@@ -1,7 +1,10 @@
 #!/bin/bash
 #!/bin/bash
 
 
-RETCODE=$(fw_exists ${IROOT}/mongrel2.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+MONGREL2=$IROOT/mongrel2
+RETCODE=$(fw_exists ${MONGREL2}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $MONGREL2.installed
+  return 0; }
 
 
 fw_depends zeromq
 fw_depends zeromq
 
 
@@ -32,4 +35,7 @@ cd mongrel2-install
   make install
   make install
 )
 )
 
 
-touch ${IROOT}/mongrel2.installed
+echo "export MONGREL2_HOME=${MONGREL2}" > $MONGREL2.installed
+echo -e "export PATH=${MONGREL2}/bin:\$PATH" >> $MONGREL2.installed
+
+source $MONGREL2.installed

+ 9 - 3
toolset/setup/linux/webservers/zeromq.sh

@@ -1,7 +1,11 @@
 #!/bin/bash
 #!/bin/bash
 
 
-RETCODE=$(fw_exists ${IROOT}/zeromq-4.0.3.installed)
-[ ! "$RETCODE" == 0 ] || { return 0; }
+VERSION="4.0.3"
+ZEROMQ=$IROOT/zeromq-$VERSION
+RETCODE=$(fw_exists ${ZEROMQ}.installed)
+[ ! "$RETCODE" == 0 ] || { \
+  source $ZEROMQ.installed
+  return 0; }
 
 
 fw_get http://download.zeromq.org/zeromq-4.0.3.tar.gz
 fw_get http://download.zeromq.org/zeromq-4.0.3.tar.gz
 fw_untar zeromq-4.0.3.tar.gz
 fw_untar zeromq-4.0.3.tar.gz
@@ -11,4 +15,6 @@ cd zeromq-4.0.3-install
 make
 make
 make install
 make install
 
 
-touch ${IROOT}/zeromq-4.0.3.installed
+echo "" > $ZEROMQ.installed
+
+source $ZEROMQ.installed