-
Notifications
You must be signed in to change notification settings - Fork 19
FreeBSD and Shoes
We can support Shoes on FreeBSD 11.1 (very new bsd). But There are trade offs. and Bewares.
Shoes 3.3.4 users can package and app to run on FreeBSD and it will work if the end user has some dependencies already installed. There is no rational reason to expect your end users will have done that. They can do a pkg info gtk3
and there is gtk3 port available then they can do pkg install gtk3
Not Shoes thing to do just to try out an app but it's the only way. It's also the case that freebsd users are sophisticated enough to figure out what is missing.
Shoes does not have port package for bsd for the same reason it does not have a .deb or .rpm installer for Linux -- too many authorities about what to do, all different and too little time.
This is very painful.
I chose to install Mate for a window manager and once it's all debugged then install slim if you want to boot to a graphical login screen. I don't. startx
will be fine
Now, if you want build Shoes from source on your FreeBSD box (or VM) - which you probably want to do then there is another rule or two or three. First rule - you'll want two rubies - Your system ruby and the one you package up with Shoes. So install a system ruby. sudo pkg install ruby
which hints that you should pkg install devel/ruby-gems
and
pkg install rubygem-rake
and pkg install databases/ruby-gdbm
. Take the hints! Do it.
cd into the directory with your Shoes source (from git clone).
$ cd Projects/shoes3
$ rake -T
Please pick a bsd:setup: target - see rake -T
rake bsd:setup:freebsd # freebsd 11.1 x86_64
rake bsd:setup:minbsd # freebsd minimal
rake build # Build using your OS setup
rake clean # Remove any temporary products
rake clobber # Remove any generated files
rake default # Same as `rake build'
rake install # Install Shoes in your ~/.shoes Directory
rake linux:setup:i686_linux # chroot build for i686 (32bit linux)
rake linux:setup:minlin # build non-portable linux
rake linux:setup:pi2 # Native arm build - pi 2+
rake linux:setup:x86_64_linux # chroot build for x86_64 (64bit linux)
rake linux:setup:xwin7 # Cross compile with MingW32
rake osx:setup:xmavericks # Setup to build Shoes for 10.9+ from 10.10+
rake package # Package Shoes for distribution
rake version # create VERSION.txt
rake win32:setup:msys2 # Windows build with msys2
rake win32:setup:win7
$
We have a choice 'freebsd' and 'minbsd'. minbsd links against the system ruby and uses gems in that Ruby. This is a loose Shoes. Odds are high it's not built for redistribution. Loose Shoes also uses symlinks back into the source source tree so there is less copying. It also includes symbols. Perfect for playing around and debugging C. Let's build that first.
rake bsd:setup:minbsd
rake
Assuming it doesn't error out, this creates a minbsd directory, so ./minbsd/shoes is what to type to try it out. If you're following these instructions you'll notice that nothing useful is displayed. Alt-/ brings up the console which informs us the several gems failed to load. Easy solution, get those gems installed. If you like one-liners
$ su
# echo chipmunk sqlite3 nokogiri rb-readline byebug ffi picky yajl-ruby typhoeus | xargs -n 1 gem install --no-doc
or you can do them individually:
$ sudo -s
Password:
# gem install chipmunk --no-doc
Fetching: chipmunk-6.1.3.4.gem (100%)
Building native extensions. This could take a while...
Successfully installed chipmunk-6.1.3.4
1 gem installed
# gem install sqlite3 --no-doc
Fetching: sqlite3-1.3.13.gem (100%)
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.13
1 gem installed
# gem install nokogiri --no-doc
Fetching: mini_portile2-2.2.0.gem (100%)
Successfully installed mini_portile2-2.2.0
Fetching: nokogiri-1.8.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed nokogiri-1.8.0
2 gems installed
# gem install rb-readline --no-doc
Fetching: rb-readline-0.5.5.gem (100%)
Successfully installed rb-readline-0.5.5
1 gem installed
# gem install byebug --no-doc
Fetching: byebug-9.1.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed byebug-9.1.0
1 gem installed
# gem install ffi --no-doc
Fetching: ffi-1.9.18.gem (100%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.18
1 gem installed
# gem install picky --no-doc
Fetching: i18n-0.8.6.gem (100%)
Successfully installed i18n-0.8.6
Fetching: thread_safe-0.3.6.gem (100%)
Successfully installed thread_safe-0.3.6
Fetching: tzinfo-1.2.3.gem (100%)
Successfully installed tzinfo-1.2.3
Fetching: minitest-5.10.3.gem (100%)
Successfully installed minitest-5.10.3
Fetching: concurrent-ruby-1.0.5.gem (100%)
Successfully installed concurrent-ruby-1.0.5
Fetching: activesupport-5.1.4.gem (100%)
Successfully installed activesupport-5.1.4
Fetching: multi_json-1.12.2.gem (100%)
Successfully installed multi_json-1.12.2
Fetching: url_escape-2009.06.24.gem (100%)
Building native extensions. This could take a while...
Successfully installed url_escape-2009.06.24
Fetching: rack_fast_escape-2009.06.24.gem (100%)
============================================================
Thank you for installing RackFastEscape!
============================================================
Successfully installed rack_fast_escape-2009.06.24
Fetching: picky-4.31.3.gem (100%)
Building native extensions. This could take a while...
Successfully installed picky-4.31.3
10 gems installed
# gem install yajl-ruby --no-doc
Fetching: yajl-ruby-1.3.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed yajl-ruby-1.3.0
1 gem installed
# gem install typhoeus --no-doc
Fetching: ethon-0.10.1.gem (100%)
Successfully installed ethon-0.10.1
Fetching: typhoeus-1.3.0.gem (100%)
Successfully installed typhoeus-1.3.0
2 gems installed
#
Now ./minbsd/shoes does work. It would be a good idea to take a look inside the minbsd directory and subdirectories to see how every thing is put together.
A couple of notes: My shoes source is NFS mounted and writing to NFS is slow. I direct where to place that minbsd directory by setting a shell environment variable.export NFS_ALTP=/usr/home/ccoupe/build/
That trailing slash is required. That's not a network place so builds are faster for me.
How to run gdb on a Loose Shoes:
$ gdb ~/build/minbsd/shoes
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) br main
Breakpoint 1 at 0x427289: file shoes/main.c, line 31.
(gdb) r
Starting program: /usr/home/ccoupe/build/minbsd/shoes
Breakpoint 1, main (argc=1, argv=0x7fffffffe8a0) at shoes/main.c:31
31 char *path = NULL;
Current language: auto; currently minimal
(gdb)
Tight Shoes is more button downed (or laced tight). It's what you can use to build and distribute your apps. It's what I build and put up on the website for download. If that's what you want build from source I encourage you to do
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