Skip to content

Commit

Permalink
updated windows ruby runtime with 2.7.1/64bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
KojiNakamaru committed Aug 19, 2020
1 parent f61b50e commit 9243a05
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 75 deletions.
4 changes: 2 additions & 2 deletions build/win/LWFS/.a/start-remote.bat
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cd /d "%~dp0"
set PATH=%~dp0ruby19\bin;%PATH%
set PATH=%~dp0ruby27\bin;%PATH%
if exist "..\.lwfsrc" copy "..\.lwfsrc" tmp.bat & call tmp.bat
set JRUBY_OPTS="--server -J-Djruby.jit.threshold=30"
set TZ=
Expand All @@ -14,7 +14,7 @@ ver | find "XP"
if %errorlevel% EQU 0 goto :winxp

:run
ruby -Ku "%~dp0ruby19\bin\rackup" lwfs.ru
ruby -Ku "%~dp0ruby27\bin\rackup" lwfs.ru
exit

:setdatafolder
Expand Down
4 changes: 2 additions & 2 deletions build/win/LWFS/.a/start.bat
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cd /d "%~dp0"
set PATH=%~dp0ruby19\bin;%PATH%
set PATH=%~dp0ruby27\bin;%PATH%
if exist "..\.lwfsrc" copy "..\.lwfsrc" tmp.bat & call tmp.bat
set JRUBY_OPTS="--server -J-Djruby.jit.threshold=30"
set TZ=
Expand All @@ -14,7 +14,7 @@ ver | find "XP"
if %errorlevel% EQU 0 goto :winxp

:run
ruby -Ku "%~dp0ruby19\bin\rackup" lwfs.ru
ruby -Ku "%~dp0ruby27\bin\rackup" lwfs.ru
exit

:setdatafolder
Expand Down
2 changes: 1 addition & 1 deletion build/win/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build: testtag clean
mkdir -p tmp/LWFS
cp -a LWFS tmp/LWFS/LWFS
cp -a README*.txt *.jse tmp/LWFS
unzip -q ruby19.zip -d tmp/LWFS/LWFS/.a
unzip -q ruby27.zip -d tmp/LWFS/LWFS/.a
mkdir -p tmp/LWFS/LWFS/.a/lwfs
cp -a ../../{lib,lwfs.rb,lwfs.ru,lwfs.conf,tmpl} tmp/LWFS/LWFS/.a/lwfs
find tmp/LWFS -name '.git*' -print0 | xargs -0 rm -rf
Expand Down
Binary file renamed build/win/ruby19.zip → build/win/ruby27.zip
Binary file not shown.
133 changes: 66 additions & 67 deletions build/win/runtime/Makefile
Original file line number Diff line number Diff line change
@@ -1,95 +1,94 @@
# -*- mode: makefile-gmake; -*-

RUBY=http://dl.bintray.com/oneclick/rubyinstaller/ruby-1.9.3-p545-i386-mingw32.7z
DEVKIT=https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
LIBJPEG=http://www.ijg.org/files/jpegsrc.v9a.tar.gz
LIBPNG=http://prdownloads.sourceforge.net/libpng/libpng-1.2.51.tar.gz
ZLIB=http://zlib.net/zlib-1.2.8.tar.gz
LIBICONV=http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
LIBXML2=http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz
RUBY=https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.1-1/rubyinstaller-devkit-2.7.1-1-x64.exe
LIBJPEG=http://www.ijg.org/files/jpegsrc.v9d.tar.gz
LIBPNG=http://prdownloads.sourceforge.net/libpng/libpng-1.2.59.tar.gz
ZLIB=http://zlib.net/zlib-1.2.11.tar.gz
LIBICONV=http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
LIBXML2=http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz

WGET=wget --no-check-certificate
SEVENZIP='/cygdrive/c/Program Files/7-zip/7z.exe'

default:
@echo 'make [ all | download | ruby | devkit | zlib | libpng | libjpeg | libiconv | libxml2 | gems | cleanall | clean | updateruby ]'
@echo 'make [ all | download | ruby | libpng | libjpeg | libxml2 | gems | cleanall | clean | updateruby ]'
@echo ''
@echo 'NOTES:'
@echo ' install bison/flex under bison-and-flex (for actioncompiler-*.gem).'
@echo ' after installing ruby, open mingw64 terminal and proceed.'

all: cleanall download ruby devkit zlib libpng libjpeg libiconv libxml2 gems
all: cleanall download ruby libpng libjpeg libxml2 gems

download:
if [ ! -d dl ]; then mkdir dl; fi
cd dl; if [ ! -f `basename $(RUBY)` ]; then $(WGET) $(RUBY); fi
cd dl; if [ ! -f `basename $(DEVKIT)` ]; then $(WGET) $(DEVKIT); fi
cd dl; if [ ! -f `basename $(LIBJPEG)` ]; then $(WGET) $(LIBJPEG); fi
cd dl; if [ ! -f `basename $(LIBPNG)` ]; then $(WGET) $(LIBPNG); fi
cd dl; if [ ! -f `basename $(ZLIB)` ]; then $(WGET) $(ZLIB); fi
cd dl; if [ ! -f `basename $(LIBICONV)` ]; then $(WGET) $(LIBICONV); fi
cd dl; if [ ! -f `basename $(LIBXML2)` ]; then $(WGET) $(LIBXML2); fi

checkso:
(ldd `which ruby`; find /home/ruby19 -name '*.so' | grep -vi tcltk | xargs ldd) | grep ' ' | sort | uniq
(ldd /c/Ruby27-x64/bin/ruby; find /c/Ruby27-x64 -name '*.so' | xargs ldd) | grep ' ' | sort | uniq

ruby:
cp dl/ruby-*.7z /home
cd /home; $(SEVENZIP) x ruby-*.7z > /dev/null
cd /home; rm ruby-*.7z; mv ruby-*-mingw32 ruby19; chmod -R 755 ruby19

devkit:
mkdir /home/devkit; cp dl/DevKit*.exe /home/devkit
cd /home/devkit; $(SEVENZIP) x DevKit*.exe > /dev/null
cd /home/devkit; rm DevKit*.exe; chmod -R 755 .
cd /home/devkit; env LANG= PATH=/home/ruby19/bin:/usr/bin ruby dk.rb init
cd /home/devkit; echo ' - C:/home/ruby19' >> config.yml
cd /home/devkit; env LANG= PATH=/home/ruby19/bin:/usr/bin ruby dk.rb install

zlib:
tar xzf dl/zlib-*.tar.gz
cd zlib-*; export PATH=/home/devkit/mingw/bin:/home/devkit/mingw/bin:/usr/bin; make -fwin32/Makefile.gcc
cd zlib-*; cp zlib.h zconf.h /home/devkit/mingw/include
cd zlib-*; cp libz.a /home/devkit/mingw/lib

libpng:
chmod 755 dl/`basename ${RUBY}`
cygstart -w dl/`basename ${RUBY}`
echo "please perform 'make mingw64' after installing ruby."

mingw64:
cygstart /c/Ruby27-x64/msys64/mingw64.exe

# zlib: checkmingw64
# tar xzf dl/zlib-*.tar.gz
# cd zlib-*; bash -c 'source ../_bashrc; make -fwin32/Makefile.gcc'
# cd zlib-*; cp zlib.h zconf.h /c/Ruby27-x64/msys64/mingw64/include
# cd zlib-*; cp libz.a /c/Ruby27-x64/msys64/mingw64/lib

libpng: checkmingw64
tar xzf dl/libpng-*.tar.gz
cd libpng-*; export PATH=/home/devkit/mingw/bin:/home/devkit/mingw/bin:/usr/bin; ./configure --target=mingw32 --prefix=/home/devkit/mingw; make
cd libpng-*; cp png*.h /home/devkit/mingw/include
cd libpng-*; cp .libs/libpng.a /home/devkit/mingw/lib
cd libpng-*; bash -c 'source ../_bashrc; ./configure --prefix=/c/Ruby27-x64/msys64/mingw64; make'
cd libpng-*; cp png*.h /c/Ruby27-x64/msys64/mingw64/include
cd libpng-*; cp .libs/libpng.a /c/Ruby27-x64/msys64/mingw64/lib

libjpeg:
libjpeg: checkmingw64
tar xzf dl/jpegsrc.*.tar.gz
cd jpeg-*; export PATH=/home/devkit/mingw/bin:/home/devkit/mingw/bin:/usr/bin; ./configure --target=mingw32 --prefix=/home/devkit/mingw; make
cd jpeg-*; cp jconfig.h jerror.h jmorecfg.h jpeglib.h /home/devkit/mingw/include
cd jpeg-*; cp .libs/libjpeg.a /home/devkit/mingw/lib

libiconv:
tar xzf dl/libiconv-*.tar.gz
cd libiconv-1.14; export PATH=/home/devkit/mingw/bin:/home/devkit/mingw/bin:/usr/bin; ./configure --target=mingw32 --prefix=/home/devkit/mingw --disable-shared; make
cp libiconv-*/lib/libcharset.h /home/devkit/mingw/include
cp libiconv-*/lib/libcharset.a /home/devkit/mingw/lib
cp libiconv-*/include/iconv.h /home/devkit/mingw/include
cp libiconv-*/lib/.libs/libiconv.a /home/devkit/mingw/lib

libxml2:
cd jpeg-*; bash -c 'source ../_bashrc; ./configure --prefix=/c/Ruby27-x64/msys64/mingw64; make'
cd jpeg-*; cp jconfig.h jerror.h jmorecfg.h jpeglib.h /c/Ruby27-x64/msys64/mingw64/include
cd jpeg-*; cp .libs/libjpeg.a /c/Ruby27-x64/msys64/mingw64/lib

# libiconv: checkmingw64
# tar xzf dl/libiconv-*.tar.gz
# cd libiconv-*; bash -c 'source ../_bashrc; ./configure --prefix=/c/Ruby27-x64/msys64/mingw64 --disable-shared; make'
# cp libiconv-*/lib/libcharset.h /c/Ruby27-x64/msys64/mingw64/include
# cp libiconv-*/lib/libcharset.a /c/Ruby27-x64/msys64/mingw64/lib
# cp libiconv-*/include/iconv.h /c/Ruby27-x64/msys64/mingw64/include
# cp libiconv-*/lib/.libs/libiconv.a /c/Ruby27-x64/msys64/mingw64/lib

libxml2: checkmingw64
tar xzf dl/libxml2-*.tar.gz
cd libxml2-*; export PATH=/home/devkit/mingw/bin:/home/devkit/mingw/bin:/usr/bin; ./configure --target=mingw32 --prefix=/home/devkit/mingw --disable-shared; make libxml2.la
cd libxml2-*; mkdir /home/devkit/mingw/include/libxml; cp include/libxml/*.h /home/devkit/mingw/include/libxml
cd libxml2-*; cp .libs/libxml2.a /home/devkit/mingw/lib
cd libxml2-*; bash -c 'source ../_bashrc; ./configure --prefix=/c/Ruby27-x64/msys64/mingw64 --disable-shared; make libxml2.la'
cd libxml2-*; mkdir /c/Ruby27-x64/msys64/mingw64/include/libxml; cp include/libxml/*.h /c/Ruby27-x64/msys64/mingw64/include/libxml
cd libxml2-*; cp .libs/libxml2.a /c/Ruby27-x64/msys64/mingw64/lib

gems:
gems: checkmingw64
bash -c 'source _bashrc; gem install httpclient'
bash -c 'source _bashrc; gem install ../../../vendor/cache/listen-*[0-9].gem'
bash -c 'source _bashrc; gem install wdm'
bash -c 'source _bashrc; gem install sinatra'
bash -c 'source _bashrc; gem install thin'
bash -c 'source _bashrc; gem install uuidtools'
bash -c 'source _bashrc; gem install ../../../vendor/cache/ruby-lzma-*[0-9].gem'
bash -c 'source _bashrc; gem install ../../../vendor/cache/libxml-ruby-*[0-9].gem'
bash -c 'source _bashrc; gem install ../../../vendor/cache/libxml-ruby-*[0-9].gem -- --with-cppflags=-DLIBXML_STATIC'
bash -c 'source _bashrc; gem install ../../../lib/swf2lwf/gems/rb-img-*[0-9].gem'
bash -c 'source _bashrc; gem install ../../../lib/swf2lwf/gems/actioncompiler-*[0-9].gem'

checkmingw64:
if expr `uname` : '^MINGW64' > /dev/null; then exit 0; else exit 1; fi

cleanall: clean
cygstart -w /c/Ruby27-x64/unins000.exe
rm -rf /c/Ruby27-x64
rm -rf dl
rm -rf /home/ruby19
rm -rf /home/devkit

clean:
rm -rf zlib-*
Expand All @@ -99,15 +98,15 @@ clean:
rm -rf libxml2-*

updateruby:
rm -f ../ruby19.zip
cp -r /home/ruby19 .
cp -r rsync-cw/* ruby19/bin
chmod -R 755 ruby19
find ruby19 -name '*.o' | xargs rm -f
rm -rf ruby19/lib/ruby/gems/1.9.1/cache/*
rm -rf ruby19/lib/ruby/gems/1.9.1/doc/*
rm -rf ruby19/lib/libmsvcrt-ruby191.dll.a
rm -rf ruby19/lib/libmsvcrt-ruby191-static.a
rm -rf ruby19/lib/tcltk
zip -Xqr9 ../ruby19.zip ruby19
rm -rf ruby19
rm -f ../ruby27.zip
rm -rf ruby27; mkdir ruby27
(cd /c/Ruby27-x64; tar --exclude=msys64 -cf - .) | (cd ruby27; tar xf -)
cp -r rsync-cw/* ruby27/bin
chmod -R 755 ruby27
find ruby27 -name '*.o' | xargs rm -f
rm -rf ruby27/lib/ruby/gems/2.7.0/cache/*
rm -rf ruby27/lib/ruby/gems/2.7.0/doc/*
rm -rf ruby27/lib/libx64-msvcrt-ruby270.dll.a
rm -rf ruby27/msys64
zip -Xqr9 ../ruby27.zip ruby27
rm -rf ruby27
3 changes: 1 addition & 2 deletions build/win/runtime/_bashrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
PATH=/home/ruby19/bin:/usr/bin
export PATH
export PATH="/c/PROGRA~2/GnuWin32/bin:/c/Ruby27-x64/bin:/c/Ruby27-x64/msys64/mingw64/bin:/Ruby27-x64/bin:/usr/bin:/bin"
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion lib/postupdate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def postUpdate(port, arg = nil)
if arg
res = client.post_content("http://localhost:#{port}/update/", {'arg' => arg})
else
res = client.post_content("http://localhost:#{port}/update/")
# https://stackoverflow.com/questions/2651379/webrickhttpstatuslengthrequired-error-when-accessing-create-method-in-contro/4061028#4061028
res = client.post_content("http://localhost:#{port}/update/", {})
end
ret = true # at least the http request was correctly processed.
rescue
Expand Down
Binary file removed vendor/cache/libxml-ruby-2.7.0.1.gem
Binary file not shown.
Binary file added vendor/cache/libxml-ruby-2.7.0.2.gem
Binary file not shown.

0 comments on commit 9243a05

Please sign in to comment.