shoes/shoes3

Question about Shoes build dependencies

Closed this issue ยท 25 comments

Hi Guys,

I am trying to build Shoes on the new Fedora 29 and I am also working on updating the Fedora build instructions in the wiki (https://github.com/shoes/shoes3/wiki/Building-Shoes-on-Linux).

My question is: Do I need to install the 32-bit development packages? I ask because the 64-bit devel packages are installed by default. For example:

cairo-devel.i686 : Development files for cairo
cairo-devel.x86_64 : Development files for cairo

The x86_64 is the one that gets installed by default when running sudo dnf install cario-devel

I am asking all this right now because when I run the rake command in the minlin/env.rb its spits out "unknown architecture" when I look at the code its expecting some i386 package to exist, so am I assuming correctly that all the libraries that are needed have to be the 32 bit packages?

I need to know for my instructions and! also so I can actually "make" some Shoes! ๐Ÿ˜„

Hi, nice to see someone working with the source! There shouldn't be any 32 bit requirement for the minlin target unless some other sub-dependency drags it in - a real possibility, The wiki article is behind the times re: the master branch rake files and certainly behind the times for fedora.
Make sure to start with rake setup:minlin Then you can do 'rake' and 'rake clean' as needed. Make sure your ruby is 2.3.7 OR LESS. If your using rbenv then know that there may be rvm dependencies in some of the rake files. I wouldn't be surprised if 'libgif' or 'libungif' is not found correctly.

@tuttza , I've updated that wiki page to be more accurate including the need to install some gems.

@ccoupe Thanks! I will give it a try. Once I get it working I will post my updated fedora notes for the wiki.

Hi @ccoupe

I am getting a little bit further. I finally get more that just unknown architecture when running rake setup:minlin

When I run the rake command I get this output:

[ztuttle@box01 .shoes-dev]$ rake
rake ruby: /home/ztuttle/.rvm/rubies/ruby-2.3.7
mkdir -p minlin
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found
unknown architecture

but I am not sure why, I (think) I installed the gtk-3 libraries:

[ztuttle@box01 .shoes-dev]$ sudo dnf install gtk3-devel
Last metadata expiration check: 0:09:15 ago on Thu 06 Dec 2018 09:52:31 PM PST.
Package gtk3-devel-3.24.1-1.fc29.i686 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Is it a different package than what I have installed?

Actually I just re-installed it and now I am back to where I started:

[ztuttle@box01 .shoes-dev]$ rake
rake ruby: /home/ztuttle/.rvm/rubies/ruby-2.3.7
mkdir -p minlin
unknown architecture

From the shoes/make/linux/minlin/env.rb

MISC_CFLAGS = ' '
if File.exist? '/usr/lib/arm-linux-gnueabihf'
  ularch = 'arm-linux-gnueabihf'
elsif File.exist? '/usr/lib/x86_64-linux-gnu'
  ularch = 'x86_64-linux-gnu'
elsif File.exist? '/usr/lib/i386-linux-gnu'
  ularch = 'i386-linux-gnu'
else
  abort 'unknown architecture'
end

I feel like this will always return unknown architecture

when I search the /usr/lib directory on my system I get this:

[ztuttle@box01 .shoes-dev]$ ls /usr/lib | grep "linux"
ld-linux.so.2
libselinux.so.1
libxcb-xselinux.so.0
libxcb-xselinux.so.0.0.0

is there something I need to install to get those in there?

@tuttza, we are dependent on pkg-config being correctly set up. if you have locate: $locate gtk+-3.0.pc
or use find / -name gtk+-3.0.pc -print. There's also a command line arg to pkg-config to display its settings. Assuming you have it, if not it needs to be installed - in debian, it's part of build-essentials package.

Shoes has to figure out the location of librsvg-2.so (because pkg-config usually has it wrong) and its very repo dependent on where it is. Search for that and then modify that section of env.rb so ularch points to where librsvg-2.so lives. (you may need to install the devel package for it).

On more thing, you're not at the point where everything is setup correctly for rake (env.rb has to work to get to that point). So, you need to do a rake clobber, rake setup, rake for each attempt. Once it starts to compile then you can just use 'rake'.

@ccoupe Thanks for bearing with me!

That find / -name gtk+-3.0.pc -print command did in fact find those! Just in a new location and I found the libsvg-2.so:

/usr/lib/pkgconfig/gtk+-3.0.pc
/usr/lib64/pkgconfig/gtk+-3.0.pc
/usr/lib64/librsvg-2.so

That's good to know. I'm assuming we will need to update that in the setup code to find these libraries with the new locations.

To give you an idea of what I am doing (all this running rvm with ruby 2.3.7 and all the development dependencies installed, including libsvg-2 which wasn't installed so thank you ๐Ÿ™‡โ€โ™‚๏ธ )

  1. Clone the Shoes project
  2. cd into it
  3. bundle install
  4. I run rake setup:minlin this is about as far as I have gotten.

The weird thing is, after running rake setup:minlin I cannot run any other rake commands unless I delete the repo and re-clone it. Essentially once I run the rake setup:minlin task, every time I attempt to run rake clobber or even a simple rake -T it acts like it's running the rake setup task and keeps printing:

[ztuttle@box01 .shoes-dev]$ rake -T
rake ruby: /home/ztuttle/.rvm/rubies/ruby-2.3.7
mkdir -p minlin
unknown architecture

Making progress ๐Ÿ‘ have a good weekend.

Don't do the bundle install - it should be harmless but shoes3 doesn't use bundler to build (or run)

minlin/env.rb is loaded for every rake command so if it dies (the abort cmd) nothing runs. you can 'rm build_target' which is where rake setup stores the chosen target. I just committed a fix that should get you going and still works for debian based systems. You can git pull to get it.

@ccoupe Oh yeah were in business now!

After pulling your new changes down I was able to start the build.

new_link: minlin from minlin/shoes
gcc -o minlin/shoes  minlin/tmp/main.o minlin/shoes.lib -L. -rdynamic -Wl,-export-dynamic -L/home/ztuttle/.rvm/rubies/ruby-2.3.7/lib -Wl,-rpath,$/../lib -Wl,-rpath,$/../lib -lruby -lpthread -ldl -lcrypt -lm -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lcairo -lpango-1.0 -lgobject-2.0 -lglib-2.0  -lgif -ljpeg /usr/lib64/librsvg-2.so -lyaml -lfontconfig
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/../../../libgif.so when searching for -lgif
/usr/bin/ld: skipping incompatible //lib/libgif.so when searching for -lgif
/usr/bin/ld: skipping incompatible //usr/lib/libgif.so when searching for -lgif
/usr/bin/ld: cannot find -lgif
collect2: error: ld returned 1 exit status
rake aborted!

Should I try and remove my the 64-bit gcc and install the 32 bit version? I assume that's what they mean by "incompatible"

I installed fedora 29 in a VM and updated the wiki article (the fedora changes replace the ancient ones and they were really old. I can compile and link Shoes. It doesn't run - not finding a libruby.so.2.3 - I suspect I can fix that in a few more minutes.

I've got it building and running with the latest commit. There appears to be gtk3 or theme issues. Pretty serious for some people. If you run scripts from the command line they might be ok
minlin/shoes samples/good/cardflip.rb

@ccoupe going to try again, Thanks for the help

@ccoupe I pulled down the new changes and did rake clobber then ran rake setup:minlin and rake
this what I keep running into now:

gcc -o minlin/shoes  minlin/tmp/main.o minlin/shoes.lib -L. -rdynamic -Wl,-export-dynamic -L/home/ztuttle/.rvm/rubies/ruby-2.3.7/lib -Wl,-rpath,/home/ztuttle/.rvm/rubies/ruby-2.3.7/lib -Wl,-rpath,/home/ztuttle/.rvm/rubies/ruby-2.3.7/lib -lruby -lpthread -ldl -lcrypt -lm -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lcairo -lpango-1.0 -lgobject-2.0 -lglib-2.0  -lgif -ljpeg /usr/lib64/librsvg-2.so -lyaml -lfontconfig
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/../../../libgif.so when searching for -lgif
/usr/bin/ld: skipping incompatible //lib/libgif.so when searching for -lgif
/usr/bin/ld: skipping incompatible //usr/lib/libgif.so when searching for -lgif
/usr/bin/ld: cannot find -lgif
collect2: error: ld returned 1 exit status
rake aborted!
Command failed with status (1): [gcc -o minlin/shoes  minlin/tmp/main.o min...]
/home/ztuttle/.shoes-dev/make/linux/minlin/tasks.rb:79:in `new_link'
/home/ztuttle/.shoes-dev/Rakefile:445:in `block in <top (required)>'
/home/ztuttle/.rvm/gems/ruby-2.3.7/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/ztuttle/.rvm/gems/ruby-2.3.7/bin/ruby_executable_hooks:24:in `eval'
/home/ztuttle/.rvm/gems/ruby-2.3.7/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => default => build => linux:build => new_build
(See full trace by running task with --trace)

Am I missing something?

EDIT:
It does look like have the libgif.so

[ztuttle@box01 .shoes-dev]$ sudo find / -name libgif.so -print
find: โ€˜/run/user/1000/gvfsโ€™: Permission denied
/usr/lib/libgif.so

I'm just confused on what "incompatible" means here.

@ccoupe I finally got it built!
shoes

@ccoupe Appreciate your help in getting this going for me.

I've read your blog about what is going on but I'm not sure what your trying to do or what needs worked on, maybe menus, layout?. Is there any particular area you want to have worked on?

@tuttza

Am I missing something?

Those incompatible libs are probably from the really really old list of installs. Remember how I warned about libgif? New fedora's seemed to have fixed that mess. There are serious GUI issues easily seen with just a minlin/shoes. Offset for the mouse is wrong. Windows can't be moved. I'm not sure what Fedora did to the gtk theme to cause that or how I can detect and workaround it. I saw this behavior on another linux where they did 'non-standard' things. I'm not a fan of the Gnome Shell so I never use it.

Is there any particular area you want to have worked on?

If you want to work in C with Gtk3 there's a lot of things to be done. As you'll see, the github master branch is the 3.3.7 beta. It's got a Gtk3 resize bug when menu's are used. If you want to work in Ruby there's work to do on the 'direwolf' git branch (3.3.8 beta) dealing with the cassowary layout. Lot of testing to do of course. I really need to fix the gtk3 bugs on fedora. The manual doen't work like it does on ubuntu. minlin/shoes -m

I installed the shoes 3.3.6 binary in my fedora 29 VM - same gui issues. That means it's not my 3.3.7 menu stuff. Gtk is 3.24.1. That's recent. I vaguely remember some warning I read somewhere (gtk manual?) that mouse reporting changed it's baseline. That could also be the problem @dredknight logged about Win 10 and newer Gtk3.

@ccoupe I am looking to work on the lower level stuff (C, gtk, C ruby). I will start to dig into these mouse/window issues. Where do recommend I start within the project, maybe the gtk.h/gtk.c?

@tuttza. OK! We need more low level help. That part of Shoes is confusing for new comers. You may have noticed a lot of debugging printf's on the launch terminal. There's a -D option set in minlin/env.rb for that but more importantly there is the code. They are there for the resize bug, when menus are enabled, windows can can be expanded but they can't be shrunk. Since the manual isn't working on Fedora it going to be hard to read the details for menu support. There are some small scripts in Tests/menus that you can run to get familiar. Also the wiki article and this one.

@tuttza , yes shoes/native/gtk.c is where the window sizing code is but you'll need to learn where all the other code lives since it's not all that modular. Gdb and 'bt' are your friends.

@ccoupe Thanks, I will start messing around the source.

In the mean time I created a Gitter chat room for this shoes project so that we(and others) can talk in the chat room to ask and answer questions: https://gitter.im/ruby-shoes/Lobby#

I sent you an invite.

@tuttza - the latest commit should get you working if you have windows with menus. To enable menus for the splash screen, create a 'startup.yaml' that looks like this:

App_Name: Foobar
#Icon_Path: static/shoes-icon-blue.png
#Theme: XP 
Use_Menus: true

@ccoupe thanks, I will try it out. I saw your comment in gitter about the mouse position issue. I will take a look at your commit.

Closing 3.3.7 issues.