New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QB64: 32- and 64-bit BASIC Compiler and IDE #2569

Closed
superloach opened this Issue Aug 19, 2018 · 69 comments

Comments

Projects
None yet
3 participants
@superloach
Contributor

superloach commented Aug 19, 2018

I've been attempting to compile QB64, with little success.

I modified the install script to use bash setup_build.sh instead of ./setup_build.sh, and that fixed some initial errors. But now I keep getting this error, which is obviously related to #2567:

/usr/local/libexec/gcc/x86_64-cros-linux-gnu/4.9.4/cc1: error while loading shared libraries: libisl.so.15: cannot open shared object file: No such file or directory

Hopefully we can get that fixed, because I'd love to mess around with some of my old programs 😝

(p.s. - there's an SDL version of QB64 as well, in case there are graphical issues in future)

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 19, 2018

Contributor

After moving the symlink to libisl.so.19, it complains about not finding GL/glu.h. I'll mention this on the QB64 forum, but should I open an issue on their GitHub?

Contributor

superloach commented Aug 19, 2018

After moving the symlink to libisl.so.19, it complains about not finding GL/glu.h. I'll mention this on the QB64 forum, but should I open an issue on their GitHub?

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 19, 2018

Hi and thanks for you interest in QB64. I just replied to your inquiry at our forum. The setup script attempts to detect the distro you're using to download the appropriate dependencies. You may be interested in trying to download them manually first.
https://www.qb64.org/forum/index.php?topic=438.msg3140#msg3140

FellippeHeitor commented Aug 19, 2018

Hi and thanks for you interest in QB64. I just replied to your inquiry at our forum. The setup script attempts to detect the distro you're using to download the appropriate dependencies. You may be interested in trying to download them manually first.
https://www.qb64.org/forum/index.php?topic=438.msg3140#msg3140

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 19, 2018

Contributor

Hmm, didn't think to check those. Thanks!

Contributor

superloach commented Aug 19, 2018

Hmm, didn't think to check those. Thanks!

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 19, 2018

Hope it works, please let us know.

FellippeHeitor commented Aug 19, 2018

Hope it works, please let us know.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 19, 2018

Contributor

It appears that libglu1-mesa-dev isn't in the repositories (or anything mentioning "glu", for that matter).

Contributor

superloach commented Aug 19, 2018

It appears that libglu1-mesa-dev isn't in the repositories (or anything mentioning "glu", for that matter).

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 19, 2018

Contributor

I have all the other requirements, though.
Doesn't appear that any other packages have provided it, either.

$ sudo find /usr/local/ -name *glu*
/usr/local/share/gtk-doc/html/gobject/glue.png
/usr/local/share/doc/groff-1.22.3/examples/chem/122/ch4z1_eqn_glutamic.chem
/usr/local/include/gssapi/mechglue.h
/usr/local/lib64/wine/fakedlls/glu32.dll
/usr/local/lib64/wine/libglu32.def
/usr/local/lib64/wine/glu32.dll.so

The only mention in this repository is a --without-glu flag in a PR for Wine.

Contributor

superloach commented Aug 19, 2018

I have all the other requirements, though.
Doesn't appear that any other packages have provided it, either.

$ sudo find /usr/local/ -name *glu*
/usr/local/share/gtk-doc/html/gobject/glue.png
/usr/local/share/doc/groff-1.22.3/examples/chem/122/ch4z1_eqn_glutamic.chem
/usr/local/include/gssapi/mechglue.h
/usr/local/lib64/wine/fakedlls/glu32.dll
/usr/local/lib64/wine/libglu32.def
/usr/local/lib64/wine/glu32.dll.so

The only mention in this repository is a --without-glu flag in a PR for Wine.

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 19, 2018

FreeGLUT is in the core of QB64. Looks like a deal breaker. We do have some legacy versions available at qb64.org that use SDL instead, as you mentioned above. Maybe one of those will cut it for you. Last version to use it was 0.954

FellippeHeitor commented Aug 19, 2018

FreeGLUT is in the core of QB64. Looks like a deal breaker. We do have some legacy versions available at qb64.org that use SDL instead, as you mentioned above. Maybe one of those will cut it for you. Last version to use it was 0.954

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 19, 2018

Contributor

I'll try the SDL version for now, but it's still possible we could get libglu1-mesa-dev in the repos and work from there.

Contributor

superloach commented Aug 19, 2018

I'll try the SDL version for now, but it's still possible we could get libglu1-mesa-dev in the repos and work from there.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 19, 2018

Contributor

The SDL (0.954) build fails with

In file included from libqbx.cpp:1:0:
common.cpp:33:23: fatal error: SDL_mixer.h: No such file or directory
 #include <SDL_mixer.h>
                       ^
compilation terminated.
g++: error: libqbx_lnx.o: No such file or directory
Contributor

superloach commented Aug 19, 2018

The SDL (0.954) build fails with

In file included from libqbx.cpp:1:0:
common.cpp:33:23: fatal error: SDL_mixer.h: No such file or directory
 #include <SDL_mixer.h>
                       ^
compilation terminated.
g++: error: libqbx_lnx.o: No such file or directory
@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 19, 2018

😩 rats...

Well, good luck with the next option #2569 (comment)

FellippeHeitor commented Aug 19, 2018

😩 rats...

Well, good luck with the next option #2569 (comment)

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 20, 2018

Collaborator

Hey guys,
I was working on another project that required libglu / freeglut and just added 2 new PRs for those packages (#2570 and #2571), if it helps any.

Collaborator

uberhacker commented Aug 20, 2018

Hey guys,
I was working on another project that required libglu / freeglut and just added 2 new PRs for those packages (#2570 and #2571), if it helps any.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

Oh, that's awesome!!

Contributor

superloach commented Aug 20, 2018

Oh, that's awesome!!

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

After installing libglu and freeglut, the GL build still fails.

Building 'QB64'
/usr/local/bin/ld: /usr/local/lib/gcc/x86_64-cros-linux-gnu/4.9.4/../../../../lib64/libGLU.so: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'
collect2: error: ld returned 1 exit status
Contributor

superloach commented Aug 20, 2018

After installing libglu and freeglut, the GL build still fails.

Building 'QB64'
/usr/local/bin/ld: /usr/local/lib/gcc/x86_64-cros-linux-gnu/4.9.4/../../../../lib64/libGLU.so: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'
collect2: error: ld returned 1 exit status
@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 20, 2018

Collaborator

This might be a dumb question but what is your crew version? It looks like you are using gcc 4.9.4. The current version is gcc 7.3.0.

Collaborator

uberhacker commented Aug 20, 2018

This might be a dumb question but what is your crew version? It looks like you are using gcc 4.9.4. The current version is gcc 7.3.0.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor
$ crew -V
1.0.3

Also, I tried to crew update, and it gave these errors:

$ crew update
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
fatal: loose object 07bc22bff97ff3bffc2bf71f7d994808abe2c717 (stored in .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717) is corrupt
fatal: The remote end hung up unexpectedly
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
fatal: loose object 07bc22bff97ff3bffc2bf71f7d994808abe2c717 (stored in .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717) is corrupt
Package lists, crew, and library updated.
Checking for package updates...

I'll just purge /usr/local/* and reinstall crew, hopefully that'll fix things.

Contributor

superloach commented Aug 20, 2018

$ crew -V
1.0.3

Also, I tried to crew update, and it gave these errors:

$ crew update
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
fatal: loose object 07bc22bff97ff3bffc2bf71f7d994808abe2c717 (stored in .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717) is corrupt
fatal: The remote end hung up unexpectedly
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
error: object file .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717 is empty
fatal: loose object 07bc22bff97ff3bffc2bf71f7d994808abe2c717 (stored in .git/objects/07/bc22bff97ff3bffc2bf71f7d994808abe2c717) is corrupt
Package lists, crew, and library updated.
Checking for package updates...

I'll just purge /usr/local/* and reinstall crew, hopefully that'll fix things.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

After fixing my [apparently broken] Chromebrew installation, QB64 builds properly!
However, I'm having a bit of difficulty running the resulting binary. If I place it in /usr/local/bin, it'll run, but exits immediately... not sure what the problem is.

$ qb64
freeglut (qb64): 
$ sommelier -X qb64
Warning: Unknown scale factor: 1111
Warning: Unknown scale factor: 952
Warning: Unknown scale factor: 909
Warning: Unknown scale factor: 870
Warning: Unknown scale factor: 833
Warning: Unknown scale factor: 769
Warning: Unknown scale factor: 667
Child exited with status: 1
Contributor

superloach commented Aug 20, 2018

After fixing my [apparently broken] Chromebrew installation, QB64 builds properly!
However, I'm having a bit of difficulty running the resulting binary. If I place it in /usr/local/bin, it'll run, but exits immediately... not sure what the problem is.

$ qb64
freeglut (qb64): 
$ sommelier -X qb64
Warning: Unknown scale factor: 1111
Warning: Unknown scale factor: 952
Warning: Unknown scale factor: 909
Warning: Unknown scale factor: 870
Warning: Unknown scale factor: 833
Warning: Unknown scale factor: 769
Warning: Unknown scale factor: 667
Child exited with status: 1
@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 20, 2018

Collaborator

Maybe try sommelier -X qb64 --scale=1? You can also edit /usr/local/sbin/sommelierd and add the options you need for every login.

Collaborator

uberhacker commented Aug 20, 2018

Maybe try sommelier -X qb64 --scale=1? You can also edit /usr/local/sbin/sommelierd and add the options you need for every login.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

Sommelier doesn't seem to care about the --scale option.

$ sommelier -X qb64 --scale=1
Warning: Unknown scale factor: 1111
Warning: Unknown scale factor: 952
Warning: Unknown scale factor: 909
Warning: Unknown scale factor: 870
Warning: Unknown scale factor: 833
Warning: Unknown scale factor: 769
Warning: Unknown scale factor: 667
Child exited with status: 1
Contributor

superloach commented Aug 20, 2018

Sommelier doesn't seem to care about the --scale option.

$ sommelier -X qb64 --scale=1
Warning: Unknown scale factor: 1111
Warning: Unknown scale factor: 952
Warning: Unknown scale factor: 909
Warning: Unknown scale factor: 870
Warning: Unknown scale factor: 833
Warning: Unknown scale factor: 769
Warning: Unknown scale factor: 667
Child exited with status: 1
@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

Forgot to mention, I get those errors with all GUI apps, and they work fine anyways. I think the issue may be that QB64 needs some of these files, but I haven't used a working build in a while so idk.

$ pwd;ls
/home/chronos/user/Downloads/qb64
cyberbit.ttf  LICENSE   qb64                             run_qb64.sh   source
internal      programs  'README for Linux and OS X.txt'  setup_lnx.sh  virtual_keyboard_layout_default.txt

Also run_qb64.sh doesn't work, because it uses ./. Any idea why Chrome OS refuses to work when running things with that?

Contributor

superloach commented Aug 20, 2018

Forgot to mention, I get those errors with all GUI apps, and they work fine anyways. I think the issue may be that QB64 needs some of these files, but I haven't used a working build in a while so idk.

$ pwd;ls
/home/chronos/user/Downloads/qb64
cyberbit.ttf  LICENSE   qb64                             run_qb64.sh   source
internal      programs  'README for Linux and OS X.txt'  setup_lnx.sh  virtual_keyboard_layout_default.txt

Also run_qb64.sh doesn't work, because it uses ./. Any idea why Chrome OS refuses to work when running things with that?

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 20, 2018

Collaborator

You might try crew install qb64 -s > qb64.log 2>&1 and study the output of qb64.log to see if any messages stand out.

Collaborator

uberhacker commented Aug 20, 2018

You might try crew install qb64 -s > qb64.log 2>&1 and study the output of qb64.log to see if any messages stand out.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

Uhh... Package qb64 not found. :(?

Contributor

superloach commented Aug 20, 2018

Uhh... Package qb64 not found. :(?

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 20, 2018

Collaborator

Oh, I thought you made a package already? How did you "install"?

Collaborator

uberhacker commented Aug 20, 2018

Oh, I thought you made a package already? How did you "install"?

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 20, 2018

QB64's binary must be able to find and write to the internal folder on its level to work properly.

FellippeHeitor commented Aug 20, 2018

QB64's binary must be able to find and write to the internal folder on its level to work properly.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

No, I just built it and copied the resulting binary to /usr/local/bin.
Ah yes, that's what I was thinking.

Contributor

superloach commented Aug 20, 2018

No, I just built it and copied the resulting binary to /usr/local/bin.
Ah yes, that's what I was thinking.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

Sorry I'm not familiar with crew's packaging system, or really that much of Ruby for that matter. I'll definitely see if I can get a package together though, that might help things?

Contributor

superloach commented Aug 20, 2018

Sorry I'm not familiar with crew's packaging system, or really that much of Ruby for that matter. I'll definitely see if I can get a package together though, that might help things?

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 20, 2018

Collaborator

Packages can be as simple as just a few commands. You can examine some of the other packages to get an idea but if you copy something that looks close to how you are trying install, it can act as a "template". The wiki may help also. See https://github.com/skycocker/chromebrew/wiki/Creating-a-package.

Collaborator

uberhacker commented Aug 20, 2018

Packages can be as simple as just a few commands. You can examine some of the other packages to get an idea but if you copy something that looks close to how you are trying install, it can act as a "template". The wiki may help also. See https://github.com/skycocker/chromebrew/wiki/Creating-a-package.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor

Alright, I've got a package made. Before I submit a PR, does this look right?

require 'package'

class Qb64 < Package
  description 'QB64 is a 64-bit BASIC compiler and IDE.'
  homepage 'https://www.qb64.org/'
  version '1.2'
  source_url 'https://www.qb64.org/autobuilds/master/qb64_2018-02-28-12-16-57_c3ad985-master_lnx.tar.gz'
  source_sha256 '47c739847e3f0d517150eae28e459e4c2cc1f904c1ab11eb7d089810d56e044a'

  depends_on 'gcc7'
  depends_on 'libglu'
  depends_on 'freeglut'
  depends_on 'mesa'
  depends_on 'sommelier'
  depends_on 'alsa_lib'
  depends_on 'alsa_plugins'

  def self.build
    system "find . -name '*.sh' -exec sed -i \"s/\\r//g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
    system "bash setup_lnx.sh"
  end

  def self.install
    system "chown", "chronos:chronos", "qb64"
    system "chmod", "+x", "qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/share/qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/bin"
    system "cp", "-rpa", ".", "#{CREW_DEST_PREFIX}/share/qb64/"
    system "echo '\#!/bin/bash' >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"cd #{CREW_PREFIX}/share/qb64/\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"sommelier -X #{CREW_PREFIX}/share/qb64/qb64\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "chmod +x #{CREW_DEST_PREFIX}/bin/qb64"
  end
end
Contributor

superloach commented Aug 20, 2018

Alright, I've got a package made. Before I submit a PR, does this look right?

require 'package'

class Qb64 < Package
  description 'QB64 is a 64-bit BASIC compiler and IDE.'
  homepage 'https://www.qb64.org/'
  version '1.2'
  source_url 'https://www.qb64.org/autobuilds/master/qb64_2018-02-28-12-16-57_c3ad985-master_lnx.tar.gz'
  source_sha256 '47c739847e3f0d517150eae28e459e4c2cc1f904c1ab11eb7d089810d56e044a'

  depends_on 'gcc7'
  depends_on 'libglu'
  depends_on 'freeglut'
  depends_on 'mesa'
  depends_on 'sommelier'
  depends_on 'alsa_lib'
  depends_on 'alsa_plugins'

  def self.build
    system "find . -name '*.sh' -exec sed -i \"s/\\r//g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
    system "bash setup_lnx.sh"
  end

  def self.install
    system "chown", "chronos:chronos", "qb64"
    system "chmod", "+x", "qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/share/qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/bin"
    system "cp", "-rpa", ".", "#{CREW_DEST_PREFIX}/share/qb64/"
    system "echo '\#!/bin/bash' >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"cd #{CREW_PREFIX}/share/qb64/\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"sommelier -X #{CREW_PREFIX}/share/qb64/qb64\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "chmod +x #{CREW_DEST_PREFIX}/bin/qb64"
  end
end
@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 20, 2018

Collaborator

Hey @superloach: You are definitely on the right track! Some things I noticed:

- gcc7 and mesa are not needed as dependencies since mesa comes along for the ride in sommelier and gcc7 is already in "core"
- sommelier should be the last dependency listed to make sure the manual configuration steps are not missed
- You won't need the chown line since those permissions will already be inherited
- What happens if you just execute `#{CREW_PREFIX}/share/qb64/qb64` without the sommelier prefix and you have the sommelierd daemon running?  Does it still work?
- Might want to limit this to `x86_64` architecture and provide a message that other architectures are not supported to avoid confusion
Collaborator

uberhacker commented Aug 20, 2018

Hey @superloach: You are definitely on the right track! Some things I noticed:

- gcc7 and mesa are not needed as dependencies since mesa comes along for the ride in sommelier and gcc7 is already in "core"
- sommelier should be the last dependency listed to make sure the manual configuration steps are not missed
- You won't need the chown line since those permissions will already be inherited
- What happens if you just execute `#{CREW_PREFIX}/share/qb64/qb64` without the sommelier prefix and you have the sommelierd daemon running?  Does it still work?
- Might want to limit this to `x86_64` architecture and provide a message that other architectures are not supported to avoid confusion
@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 20, 2018

Contributor
  • Thanks for pointing that out about gcc7 and mesa, I removed them.
  • I put sommelier at the end, good call.
  • Alright, I removed the chown line.
  • It works without sommelier -X, but since some (like me) may choose to not run the daemon, and I already had to make a bash script to fix the internals dir, I thought I'd throw that in there for good measure.
  • I'm unable to test this, but it should work on i686 as well as x86_64. Should I go ahead and limit it to x86_64 for now?
require 'package'

class Qb64 < Package
  description 'QB64 is a modern extended BASIC+OpenGL language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows, Linux and macOS.'
  homepage 'https://www.qb64.org/'
  version '1.2'
  source_url 'https://www.qb64.org/autobuilds/master/qb64_2018-02-28-12-16-57_c3ad985-master_lnx.tar.gz'
  source_sha256 '47c739847e3f0d517150eae28e459e4c2cc1f904c1ab11eb7d089810d56e044a'

  depends_on 'libglu'
  depends_on 'freeglut'
  depends_on 'alsa_lib'
  depends_on 'alsa_plugins'
  depends_on 'sommelier'

  def self.build
    system "find . -name '*.sh' -exec sed -i \"s/\\r//g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
    system "bash setup_lnx.sh"
  end

  def self.install
    system "chmod", "+x", "qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/share/qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/bin"
    system "cp", "-rpa", ".", "#{CREW_DEST_PREFIX}/share/qb64/"
    system "echo '\#!/bin/bash' >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"cd #{CREW_PREFIX}/share/qb64/\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"sommelier -X #{CREW_PREFIX}/share/qb64/qb64\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "chmod +x #{CREW_DEST_PREFIX}/bin/qb64"
  end
end

I also updated the description per their homepage.

Contributor

superloach commented Aug 20, 2018

  • Thanks for pointing that out about gcc7 and mesa, I removed them.
  • I put sommelier at the end, good call.
  • Alright, I removed the chown line.
  • It works without sommelier -X, but since some (like me) may choose to not run the daemon, and I already had to make a bash script to fix the internals dir, I thought I'd throw that in there for good measure.
  • I'm unable to test this, but it should work on i686 as well as x86_64. Should I go ahead and limit it to x86_64 for now?
require 'package'

class Qb64 < Package
  description 'QB64 is a modern extended BASIC+OpenGL language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows, Linux and macOS.'
  homepage 'https://www.qb64.org/'
  version '1.2'
  source_url 'https://www.qb64.org/autobuilds/master/qb64_2018-02-28-12-16-57_c3ad985-master_lnx.tar.gz'
  source_sha256 '47c739847e3f0d517150eae28e459e4c2cc1f904c1ab11eb7d089810d56e044a'

  depends_on 'libglu'
  depends_on 'freeglut'
  depends_on 'alsa_lib'
  depends_on 'alsa_plugins'
  depends_on 'sommelier'

  def self.build
    system "find . -name '*.sh' -exec sed -i \"s/\\r//g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
    system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
    system "bash setup_lnx.sh"
  end

  def self.install
    system "chmod", "+x", "qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/share/qb64"
    system "mkdir", "-p", "#{CREW_DEST_PREFIX}/bin"
    system "cp", "-rpa", ".", "#{CREW_DEST_PREFIX}/share/qb64/"
    system "echo '\#!/bin/bash' >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"cd #{CREW_PREFIX}/share/qb64/\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "echo \"sommelier -X #{CREW_PREFIX}/share/qb64/qb64\" >> #{CREW_DEST_PREFIX}/bin/qb64"
    system "chmod +x #{CREW_DEST_PREFIX}/bin/qb64"
  end
end

I also updated the description per their homepage.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Oh, well that looks pretty simple! Hey @uberhacker, do you want me to go ahead and modify the package, or could you do it?

Contributor

superloach commented Aug 21, 2018

Oh, well that looks pretty simple! Hey @uberhacker, do you want me to go ahead and modify the package, or could you do it?

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

I will test and report back if successful. Then you can make the change in the package.

Collaborator

uberhacker commented Aug 21, 2018

I will test and report back if successful. Then you can make the change in the package.

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

Success! Here is your patch:

diff --git a/packages/qb64.rb b/packages/qb64.rb
index 7cfdc6d6..cdf93caa 100644
--- a/packages/qb64.rb
+++ b/packages/qb64.rb
@@ -18,6 +18,7 @@ class Qb64 < Package
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
+    system "sed -i '1i#define QB64_NOT_X86' internal/c/common.h" if ARCH == 'armv7l' || ARCH == 'aarch64'
     system "bash setup_lnx.sh"
   end
Collaborator

uberhacker commented Aug 21, 2018

Success! Here is your patch:

diff --git a/packages/qb64.rb b/packages/qb64.rb
index 7cfdc6d6..cdf93caa 100644
--- a/packages/qb64.rb
+++ b/packages/qb64.rb
@@ -18,6 +18,7 @@ class Qb64 < Package
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
+    system "sed -i '1i#define QB64_NOT_X86' internal/c/common.h" if ARCH == 'armv7l' || ARCH == 'aarch64'
     system "bash setup_lnx.sh"
   end
@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Great, thanks a lot!

Contributor

superloach commented Aug 21, 2018

Great, thanks a lot!

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

Actually, I thought of a more elegant way to do all this patching. New patch coming soon...

Collaborator

uberhacker commented Aug 21, 2018

Actually, I thought of a more elegant way to do all this patching. New patch coming soon...

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Haha, alright then.

Contributor

superloach commented Aug 21, 2018

Haha, alright then.

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

Try this instead:

diff --git a/packages/qb64.rb b/packages/qb64.rb
index 7cfdc6d6..d60628bf 100644
--- a/packages/qb64.rb
+++ b/packages/qb64.rb
@@ -13,11 +13,18 @@ class Qb64 < Package
   depends_on 'alsa_plugins'
   depends_on 'sommelier'

-  def self.build
+  def self.patch
     system "find . -name '*.sh' -exec sed -i \"s/\\r//g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
+    case ARCH
+    when 'armv7l', 'aarch64'
+      system "sed -i '1i#define QB64_NOT_X86' internal/c/common.h"
+    end
+  end
+
+  def self.build
     system "bash setup_lnx.sh"
   end
Collaborator

uberhacker commented Aug 21, 2018

Try this instead:

diff --git a/packages/qb64.rb b/packages/qb64.rb
index 7cfdc6d6..d60628bf 100644
--- a/packages/qb64.rb
+++ b/packages/qb64.rb
@@ -13,11 +13,18 @@ class Qb64 < Package
   depends_on 'alsa_plugins'
   depends_on 'sommelier'

-  def self.build
+  def self.patch
     system "find . -name '*.sh' -exec sed -i \"s/\\r//g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/setup/bash setup/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\.\\/qb64 \\&/exec qb64 \\&/g\" {} \\;"
     system "find . -name '*.sh' -exec sed -i \"s/\~\\/\.local\\/share\\/applicationexec qb64\\.desktop/\\/dev\\/null/g\" {} \\;"
+    case ARCH
+    when 'armv7l', 'aarch64'
+      system "sed -i '1i#define QB64_NOT_X86' internal/c/common.h"
+    end
+  end
+
+  def self.build
     system "bash setup_lnx.sh"
   end
@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Yeah, that's way more elegant! Sorry I didn't know self.patch was a thing, it wasn't used in the example I built off. 😛

Contributor

superloach commented Aug 21, 2018

Yeah, that's way more elegant! Sorry I didn't know self.patch was a thing, it wasn't used in the example I built off. 😛

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

Now if we can solve the mysterious black screen of death, then i686 will be working also.

Collaborator

uberhacker commented Aug 21, 2018

Now if we can solve the mysterious black screen of death, then i686 will be working also.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Hmm, this is interesting: Re: How do you make the 64 bit Version of QB64?
This makes it sound like Unix only supports 64-bit now, but I'm not sure what version that was.

Contributor

superloach commented Aug 21, 2018

Hmm, this is interesting: Re: How do you make the 64 bit Version of QB64?
This makes it sound like Unix only supports 64-bit now, but I'm not sure what version that was.

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 21, 2018

QB64 is 32bit by default on Windows; 64bit by default on macOS; 32/64bit on Linux depending on the Distro it's being compiled on, since it'll use the gcc version that's installed.

FellippeHeitor commented Aug 21, 2018

QB64 is 32bit by default on Windows; 64bit by default on macOS; 32/64bit on Linux depending on the Distro it's being compiled on, since it'll use the gcc version that's installed.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Thanks for clearing that up, I couldn't find a straight answer anywhere!

Contributor

superloach commented Aug 21, 2018

Thanks for clearing that up, I couldn't find a straight answer anywhere!

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 21, 2018

I for instance have it installed on two separate VMs for occasional testing, both running Debian, one 32 one 64 bit.

FellippeHeitor commented Aug 21, 2018

I for instance have it installed on two separate VMs for occasional testing, both running Debian, one 32 one 64 bit.

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

@FellippeHeitor: The good news is we now have it working in ChromeOS on both x86_64 and arm architecture which probably covers over 95% of all Chromebook owners currently.

Collaborator

uberhacker commented Aug 21, 2018

@FellippeHeitor: The good news is we now have it working in ChromeOS on both x86_64 and arm architecture which probably covers over 95% of all Chromebook owners currently.

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 21, 2018

That's amazing. We can offer instructions at qb64.org if you guys can offer me a set of them. When do these changes come into effect?

FellippeHeitor commented Aug 21, 2018

That's amazing. We can offer instructions at qb64.org if you guys can offer me a set of them. When do these changes come into effect?

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

I can create pre-built binaries but you need this project installed on your Chromebook and simply install the package via crew install qb64.

Collaborator

uberhacker commented Aug 21, 2018

I can create pre-built binaries but you need this project installed on your Chromebook and simply install the package via crew install qb64.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Yep, something like this will probably do:

  • Enable developer mode.
  • Install Chromebrew:
    • Open Crosh (Ctrl+Alt+T).
    • Type shell and hit enter.
    • Type curl -Ls git.io/vddgY | bash and hit enter (right click in Crosh to paste).
  • Install QB64:
    • Type crew install qb64 and hit enter.
    • To run QB64, open Crosh again, enter shell, and then enter qb64.
Contributor

superloach commented Aug 21, 2018

Yep, something like this will probably do:

  • Enable developer mode.
  • Install Chromebrew:
    • Open Crosh (Ctrl+Alt+T).
    • Type shell and hit enter.
    • Type curl -Ls git.io/vddgY | bash and hit enter (right click in Crosh to paste).
  • Install QB64:
    • Type crew install qb64 and hit enter.
    • To run QB64, open Crosh again, enter shell, and then enter qb64.
@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 21, 2018

Yeah, I meant instructions for the Chromebook setup. When does crew install qb64 come into effect with the above changes?

FellippeHeitor commented Aug 21, 2018

Yeah, I meant instructions for the Chromebook setup. When does crew install qb64 come into effect with the above changes?

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 21, 2018

Oh, @uberhacker is a main contributor here! I apologize for my ignorance.

FellippeHeitor commented Aug 21, 2018

Oh, @uberhacker is a main contributor here! I apologize for my ignorance.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Haha, I just saw you notice the PR got merged, I was about to tell you 😝

Contributor

superloach commented Aug 21, 2018

Haha, I just saw you notice the PR got merged, I was about to tell you 😝

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

No worries at all. I'm glad you are interested in this project. Your feedback is greatly appreciated.

Collaborator

uberhacker commented Aug 21, 2018

No worries at all. I'm glad you are interested in this project. Your feedback is greatly appreciated.

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

So how do you plan on presenting this on qb64.org?
I just scrapped together this example, I feel like a link to that comment would be sufficient

<td align="center" width="25%">
  <a href="https://github.com/skycocker/chromebrew/issues/2569#issuecomment-414528254" target="">
    <img width="65px" height="65px" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/1200px-Google_Chrome_icon_%28September_2014%29.svg.png">
  </a>
  <br>
  <a href="https://github.com/skycocker/chromebrew/issues/2569#issuecomment-414528254" style="text-decoration:none" target="">
    Chrome OS
  </a>
</td>

Obviously, if you chose to present it this way you'd use a pre-sized locally hosted icon, but overall I feel like this looks good.

image

(p.s. - sorry if I'm entering nitpick territory 😅)

Contributor

superloach commented Aug 21, 2018

So how do you plan on presenting this on qb64.org?
I just scrapped together this example, I feel like a link to that comment would be sufficient

<td align="center" width="25%">
  <a href="https://github.com/skycocker/chromebrew/issues/2569#issuecomment-414528254" target="">
    <img width="65px" height="65px" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/1200px-Google_Chrome_icon_%28September_2014%29.svg.png">
  </a>
  <br>
  <a href="https://github.com/skycocker/chromebrew/issues/2569#issuecomment-414528254" style="text-decoration:none" target="">
    Chrome OS
  </a>
</td>

Obviously, if you chose to present it this way you'd use a pre-sized locally hosted icon, but overall I feel like this looks good.

image

(p.s. - sorry if I'm entering nitpick territory 😅)

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 21, 2018

Hahaha, I was just creating a mockup now... this icon had come up in my searches:

Either way, because this is not a direct download, I thought of adding it as a smaller icon and an extra paragraph in that session with the summarized instructions. Sound good?

FellippeHeitor commented Aug 21, 2018

Hahaha, I was just creating a mockup now... this icon had come up in my searches:

Either way, because this is not a direct download, I thought of adding it as a smaller icon and an extra paragraph in that session with the summarized instructions. Sound good?

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Sounds good! Good idea to use Chromium instead of Chrome, too.

Contributor

superloach commented Aug 21, 2018

Sounds good! Good idea to use Chromium instead of Chrome, too.

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

@superloach: This is awesome what you are doing to promote Chromebrew.

Collaborator

uberhacker commented Aug 21, 2018

@superloach: This is awesome what you are doing to promote Chromebrew.

@FellippeHeitor

This comment has been minimized.

Show comment
Hide comment
@FellippeHeitor

FellippeHeitor Aug 21, 2018

@superloach maybe your idea does look better to keep the general alignment there. Wanna give it a go?
FellippeHeitor/qb64.org#1

FellippeHeitor commented Aug 21, 2018

@superloach maybe your idea does look better to keep the general alignment there. Wanna give it a go?
FellippeHeitor/qb64.org#1

@superloach

This comment has been minimized.

Show comment
Hide comment
@superloach

superloach Aug 21, 2018

Contributor

Haha, no problem @uberhacker! Always glad to help share good projects, especially if I find them useful.

Contributor

superloach commented Aug 21, 2018

Haha, no problem @uberhacker! Always glad to help share good projects, especially if I find them useful.

@uberhacker

This comment has been minimized.

Show comment
Hide comment
@uberhacker

uberhacker Aug 21, 2018

Collaborator

Fixed in #2577.
Fixed in #2578.

Collaborator

uberhacker commented Aug 21, 2018

Fixed in #2577.
Fixed in #2578.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment