From b839939740b1fa7734e1a8b58969b5ed6485cf0e Mon Sep 17 00:00:00 2001
From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl>
Date: Thu, 6 Apr 2017 19:59:25 +0200
Subject: [PATCH] wine box!

---
 example/README.md           | 12 ------------
 example/build.sh            |  5 -----
 example/build_as_vagrant.sh |  5 -----
 wine/README.md              | 12 ++++++++++++
 wine/build.sh               | 36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 48 insertions(+), 22 deletions(-)
 delete mode 100644 example/README.md
 delete mode 100644 example/build.sh
 delete mode 100644 example/build_as_vagrant.sh
 create mode 100644 wine/README.md
 create mode 100644 wine/build.sh

diff --git a/example/README.md b/example/README.md
deleted file mode 100644
index 113ac88..0000000
--- a/example/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# example
-
-This is description of the box. It will be copied. Keep it short and single-line. Don't remove the line break before.
-Version: 1.0
-
-Write what this box consists of and how it behaves.
-First four lines have a special meaning - dont move them around. Change only version number, not the word.
-
----
-
-This section will be automatically replaced by `python make.py` with auto-generated
-content of Vagrantfile that will refer to this box.
diff --git a/example/build.sh b/example/build.sh
deleted file mode 100644
index 205a232..0000000
--- a/example/build.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-# This will be executed during build process as root
-# You can delete it if you want to.
-# cd into a directory if you depend on a particular working directory.
diff --git a/example/build_as_vagrant.sh b/example/build_as_vagrant.sh
deleted file mode 100644
index 8e9ea4b..0000000
--- a/example/build_as_vagrant.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-# This will be executed during build process as user Vagrant
-# You can delete it if you want to.
-# cd into a directory if you depend on a particular working directory.
diff --git a/wine/README.md b/wine/README.md
new file mode 100644
index 0000000..7308f29
--- /dev/null
+++ b/wine/README.md
@@ -0,0 +1,12 @@
+# wine

+

+Debian with a 32-bit WINE

+Version: 1.0

+

+---

+

+Usage in Vagrantfile:

+```

+config.vm.box = "henrietta/wine"

+config.vm.box_url = "http://dev.dms-serwis.com.pl/vagrant/wine.box"

+```

diff --git a/wine/build.sh b/wine/build.sh
new file mode 100644
index 0000000..f28b3f6
--- /dev/null
+++ b/wine/build.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Install WINE
+dpkg --add-architecture i386
+apt-get update
+apt-get install -y wget xvfb wine winetricks unzip
+
+# Load framebuffer
+sudo -u vagrant Xvfb :0 -screen 0 1024x768x16 &
+sudo -u vagrant wine start.exe
+sudo -u vagrant "ln -s /vagrant /home/vagrant/.wine/drive_c/vagrant"
+
+# Start framebuffer on VM start
+echo "sudo -u vagrant Xvfb :0 -screen 0 1024x768x16 &" >> /etc/rc.local
+
+# Install Tibbo tools
+sudo -u vagrant wget http://dev.dms-serwis.com.pl/misc/tide-tibbo-lite-5.1.3-win32.zip -O /tmp/tibbo.zip
+sudo -u vagrant mkdir "/home/vagrant/.wine/drive_c/Program Files/Tibbo"
+sudo -u vagrant unzip /tmp/tibbo.zip -d  "/home/vagrant/.wine/drive_c/Program Files/Tibbo"
+
+# WINE extensions
+sudo -u vagrant "export DISPLAY=:0.0; winetricks corefonts vcrun6"
+
+# Install command
+echo """#!/bin/bash
+rm -rf ~/.wine/drive_c/vagrant || true
+mkdir ~/.wine/drive_c/vagrant
+cp -rf /vagrant/* ~/.wine/drive_c/vagrant/
+env DISPLAY=:0.0
+cd ~/.wine/drive_c/vagrant
+wine "C:\Program Files\Tibbo\TIDE\Bin\tmake.exe" $1 -b "C:\Program Files\Tibbo\TIDE\Bin" -p "C:\Program Files\Tibbo\TIDE\Platforms"
+cp -f /.wine/drive_c/vagrant/*.tpc /vagrant
+rm -rf ~/.wine/drive_c/vagrant || true
+""" > /usr/sbin/tibbo_build
+
+chmod ugo+rx /usr/sbin/tibbo_build
-- 
GitLab