-
Notifications
You must be signed in to change notification settings - Fork 19
Building Shoes on Windows
This is not as simple as anyone would like. There are many tasks and things to remember. If you are not comfortable with the Windows cmd shell then you will become frustrated. Sorry.
Shoes has dependencies, primarily Ruby, GObject/GLib, Gtk2 and a few others. That's after you get the development stuff setup. Here's outline of what we need to do:
- Development setup
- Dependencies
- Get Shoes and modify Rakefiles
- Build and test Shoes
- Profit!
One more thing. I'm using a Windows 7 in an OracleBox VM. It's known to work on a native Windows 8.1. It might work on XP I install stuff to C:, just like a normal Windows system.
I also have an E: which is a network share mapped to a CIFS (Samba) server that holds my Projects directory (folder). That's where the Shoes source code is (shoes3.2) and the shoes deps directories live in(shoesdeps/mingw). You don't have to imitate my setup but you do have to remember how mine might differ from yours as you read further.
Shoes uses the Ruby provided by the RubyInstaller Project. That includes a minimal MinGW project Msys. This is the easy step if you don't get all clever. You want to select the 32 bit installer. It runs fine on 64 bit systems. It's what we use. Select the Ruby 2.1.5. Do NOT select the (x64). Install ruby. Accept the defaults.
Now we need the C Compiler. Shoes uses the Development Kit which is what the RubyInstaller and the dependencies in the next section are written for. We don't support the Microsoft compilers. Don't bother trying or asking about them.
The naming convention for the MinGW C compiler may be a bit confusing. Make sure you get the 32 bit 4.7.2 or higher devkit but not the 64 bit. The compiler is named 'mingw-w64-32' (you want) and mingw-w64-64 (you don't want. Do the right thing here or we'll mock you after many wasted hours of frustration on your part. From the download page select the correct one. Install it. Accept the defaults.
Play around with your ruby. If you don't know how to test that your new ruby is OK enough then you should find a book or online tutorial to help you - it will not get simpler from here on. Know your limits. Remember your goal. Move cautiously and with knowledge.
You'll want to download the 7-zip program and install it.
You should probably install git and get a free account at github.com. You don't have to, but you should.
You'll need a pkg-config. I used pkg-config-lite and I installed it where they said to in c:\MinGW\bin. That said, pkg-config in the gtk bundle works fine. For me.
nsis is the installer builder. Get it here.
Now it gets ugly. There's a couple of ways to do this correctly and many ways to get it wrong. Expect trouble. Dependencies are Libraries (.dll) and Header files (.h). and other Windows required stuff. You need a directory to put the stuff in. I use E:\shoesdeps\mingw. If you want to use C:\shoesstuff or c:\sandbox that's your choice. It would be best not to use a space in the names. OK? Where ever it is, lets call it DEPSDIR for short.
Download the pre-compiled libraries and headers from here. It will expand into a ShoesDeps
directory. Thats is your DEPSDIR, e:\projects\shoesdeps\mingw
for me. Remember where that is - we need to edit a file or two later to enter that information.
Skip past the Hard way discussion(s).
Make your DEPSDIR folder (c:\sandbox or c\your-choice\of\location).
Make another folder to hold all the downloaded and unzip'd and untarred stuff. (you can use DEPSDIR)
Point your browser to Shoes copy of src deps.
First get the gtk2 binary bundle and expand that zip into your DEPSDIR. You should see the usual Linux style directories: bin,lib,share,include and so on in DEPSDIR
That's not complete enough to build Shoes. We need libgif, libjpeg and sqlite3. While your there, grab those .sh scripts. Some of those are tarballs (tgz) use 7zip to expand them.
I like to keep things nice and tidy so when I compile and install the lib it goes into the DEPDIRS include and bin and lib directories along with the stuff in the gtk+ bundle.
- Get an msys shell (cmd shell won't work here). The best is to start a cmd shell and run C:\DevKit\myss.bat We have to use the msys shell window now.
- cd into where ever you extracted and uncompressed
giflib-4.2.3
. cd into giflib-4.2.3 (or the version you have) For me, that would be$ cd /e/shoesdeps/mingw/gliblib-4.2.3
*$ ./configure --prefix=/e/shoesdeps/mingw
(for me). That runs for a while displaying a lists of tests can configuration tests. the --prefix= on the command like tells configure where to install after building libgif. -
$ make
which displays all the compiling stuff. *$ make install
which copies things to that --prefix= location.
There are many options to ./configure. I like to use a script to do the configure. Take a look at the cross-gif.sh script. That one won't work for you, it's part of a cross compiling setup but the important part is to document what you did in case you need to repeat it.
Now do something similar for the jpeg-9 directory. configure,make,make install.
The sqlite3 directory is different. Copy the dll to DEPSDIR/bin, the two .h files to DEPSDIR/include and I suppose the .def goes in DEPSDIR/lib
Of course you could download and build sqlite3 from source. Of course you'll read the INSTALL and README files several times.
You could download the gtk2/gobj/glib/cairo/pango source that makes up the gtk+bundle. Expect to spend days and days on that path
Download Shoes Source - over in the right side are options to clone it with git or download a zip. If you decide to fix something and you want to send the fix back to us, that will be lot easier for you and us if you install git, get the github account, and clone.
If you're using an IDE like NetBeans you'll have some additional fun getting things setup.
Read Shoes Rakefiles for a background on targets, loose shoes and tight shoes. We are going to build Tight Shoes (one you can ship to someone else)
Get a Command shell window. Not a msys shell (unless you feel lucky and you could).
- cd to the directory with the Shoes 3.2 source code.
-
$ rake -T
will list all the targets (you can't build them all from windows) but it's nice test to make sure your in the properly place. -
$ rake win32:setup:tight
that tells the rakefiles that any build, package, clean or install commands will use that target.
Shoes 3.2.22 has a new way to do this: Custom.yaml
You need to modify the env.rb file in make/tightmingw/ You need to tell it where the DEPSDIR is look for this line near the top of file (line 3 at the moment):
ShoesDeps = "E:/shoesdeps/mingw"
It's Ruby Constant that contains a Ruby String. Replace with your DEPSDIR. Use the full path, not ../../ relative stuff.
Down around line 89 are these three lines
bindll = "#{ShoesDeps}/bin"
rubydll = "C:/Ruby21/bin"
devdll = "C:/Devkit/mingw/bin"
Set the rubydll to where your ruby bin is (it's got ruby dependent dlls in it like libyaml.dll) Set the devdll to where Devkit mingw bin is - it has a libwinpthread-1.dll
-
$ rake
or$ rake build
if you like to type, will start the build (compile, link, copy files)
If there are no errors, then in the tightmingw folder among many dll's will be cshoes.exe and shoes.exe. you can and should cd into tightmingw and see if they run. Both will give off warning messages about fontconfig and missing fonts.
If the build died, You have some debugging work. Fix what you think is wrong. If the build died while building ftsearch, chipmunk, hpricot or sqlite you must $ rake clean
before trying another $ rake
This is not the same as packaging a script or shy (which might include Shoes) The procedures below are for when you want to build Shoes-3.2-gtk-32.exe and you don't want to use the normal Shoes you could have downloaded.
There's another rake command, $ rake stub
which compiles the target's stub. You probably don't want to change the stub or do the rake stub
and you should expect and respect that any you change in the stub is going to cause all kinds of problems for you users and you. It's even possible the rake stub
will fail to build.
$ rake package
will build the target's Shoes installer (not your script/app installer, that's different). Package here means Shoes and nothing but Shoes. It uses the NSIS (Unicode version) and some .nsi files to create a Shoes installer from that tightmingw/ directory and puts it in the pkg/directory. There are good reasons why you might want to do this on your system. If you double click the installer in pkg/ it's going to run the shoes installer which copies Shoes into system space (by default) registers Shoes in the menus and sets the PATH for new cmd shells.
Beware! Be wery, wery careful! You and/or Windows will get confused about Shoes in system space and the Shoes in tightmingw/ Now would be a very good time to $ rake clean, close all the command shells, empty the recycle bin. You probably should reboot Windows so there is no chance the can find the unpackaged Shoes.
- git installation for windows
- netbeans for windows
Menu
In This Section:
- Shoes Rakefiles
- Rake files
- App.yaml secrets
- Custom.yaml
- Gems for Shoes
- Build with Vagrant
- Building Shoes on Linux
- Building Shoes on Pi2
- Mingw Dependencies
- Building Shoes on Windows
- Cross compile mingw
- OSX 10.10 Dependencies
- OSX 10.9 Dependencies
- OSX 10.6 Dependencies
- Caution Using brew 10.6
- Build-MinGW-with-OSX
- NSIS Installer for Windows
- MSYS2 cross compiling
- Cross-compile-for-arm-(raspberry)
- MXE-Dependencies
- FreeBSD and Shoes