Author Topic: Scriptbasic Build Linux  (Read 5737 times)

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #105 on: November 30, 2018, 11:10:05 PM »
Under Windows I had a conflict with using iup.dll as my extension module name. I had to generate it as pui.dll to get around it.

Under Linux you can have duplicate named shared objects loaded at the same time?

With SB that's not an issue, because the modules aren't prefixed with "lib", and they're not in the library cache.

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #106 on: November 30, 2018, 11:13:03 PM »
Hmm, this is a weird one.  Let me finish setting up the 18.10 vm.

Can you post the test file you're using?

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #107 on: November 30, 2018, 11:16:06 PM »
Here it is again. (attached in an earlier post)


Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #108 on: November 30, 2018, 11:28:09 PM »
My old SB system based install version still works.


jrs@jrs-laptop:~$ cd sb/abcc/LIKE
jrs@jrs-laptop:~/sb/abcc/LIKE$ scriba.JRS ff_extract_ai.sb
Downloading Latest 64Bit Firefox (63.0.3) for Windows.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   134  100   134    0     0    494      0 --:--:-- --:--:-- --:--:--   494
100 42.3M  100 42.3M    0     0  17.1M      0  0:00:02  0:00:02 --:--:-- 23.8M

Firefox_Setup-63.0.3.exe Downloaded 44,396,080 Bytes at 18,010,580 Bytes/Second.
jrs@jrs-laptop:~/sb/abcc/LIKE$


Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #109 on: November 30, 2018, 11:29:46 PM »
FWIW, it works on my system as well.

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #110 on: November 30, 2018, 11:43:18 PM »
John, there's something weird going on on your system.

On a newly set up Ubuntu 18.10 vm, with nothing added:

riveraa@sbdev:~/Projects/sb64$ ./sb.sh ff_extract_ai.sb
Downloading Latest 64Bit Firefox (63.0.3) for Windows.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   134  100   134    0     0   1055      0 --:--:-- --:--:-- --:--:--  1055
100 42.3M  100 42.3M    0     0  15.3M      0  0:00:02  0:00:02 --:--:-- 16.9M

Firefox_Setup-63.0.3.exe Downloaded 44,396,080 Bytes at 16,085,536 Bytes/Second.
riveraa@sbdev:~/Projects/sb64$

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #111 on: November 30, 2018, 11:49:15 PM »
John, you're still running the appimage!!!

Quote
Checking installed module header file location '/tmp/.mount_sbeiT23I/include/curl.bas' Result=OK

Let's try this:  in the sb.sh file change the order of the PATH= line

from
export PATH=$PATH:"${WORKDIR}"/bin


to
export PATH="${WORKDIR}"/bin:$PATH
« Last Edit: November 30, 2018, 11:57:22 PM by AIR »

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #112 on: December 01, 2018, 12:15:18 AM »
Additionally, on the freshly loaded Ubuntu 18.10 vm, the attached appimage works:

riveraa@sbdev:~/Projects$ ./sb ff_extract_ai.sb
Downloading Latest 64Bit Firefox (63.0.3) for Windows.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   134  100   134    0     0   1522      0 --:--:-- --:--:-- --:--:--  1522
100 42.3M  100 42.3M    0     0  15.9M      0  0:00:02  0:00:02 --:--:-- 17.1M

Firefox_Setup-63.0.3.exe Downloaded 44,396,080 Bytes at 16,740,603 Bytes/Second.
riveraa@sbdev:~/Projects$

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #113 on: December 01, 2018, 12:49:11 AM »
Totally unrelated, but check this out:

riveraa@nas:~/Projects/sb$ cat testprint.bas
print "Hello\nis this mic on?\n"

riveraa@nas:~/Projects/sb$ sb64/sb.sh testprint.bas
Hello
is this mic on?
riveraa@nas:~/Projects/sb$


John, did you know you could do this?

AIR.

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #114 on: December 01, 2018, 01:24:27 AM »
The in-line linefeeds, instead of

print "Hello","\n"

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #115 on: December 01, 2018, 01:40:17 AM »
Code: Script BASIC
  1. PRINT "\n\n\n\t\t\"Hello\"\n"
  2.  

That is normal syntax for SB.


jrs@jrs-laptop:~/sb/examples/test$ sb testmxml.sb
Test1: This is a test!
Test2: And this is another test!

Image: madonna.jpg
Alt Image: Foligno Madonna, by Raphael

ID = 1
Name = Hello, world!
ID = 2
Name = Hello, China!
jrs@jrs-laptop:~/sb/examples/test$ sb escstr.sb



      "Hello"
jrs@jrs-laptop:~/sb/examples/test$

« Last Edit: December 01, 2018, 01:42:19 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #116 on: December 01, 2018, 03:06:04 AM »
After getting rid of AppImage, this works fine for me. Just running ./sb.sh alone doesn't add anything to the system PATH variable. (even after making the change you posted)

Using scriba again is fine.


jrs@jrs-laptop:~$ cd sb/sb64
jrs@jrs-laptop:~/sb/sb64$ source sb.sh
jrs@jrs-laptop:~/sb/sb64$ cd ../abcc/LIKE
jrs@jrs-laptop:~/sb/abcc/LIKE$ scriba -v
ScriptBasic v2.1
Variation >>STANDARD<< build 1
Magic value 859037488
Node size is 24
Extension interface version is 11
Compilation: Nov 30 2018 02:25:18
jrs@jrs-laptop:~/sb/abcc/LIKE$ scriba -D
dll ".so"
module "/home/jrs/sb/sb64/module/"
include "/home/jrs/sb/sb64/include/"
maxstep 0
maxlocalstep 0
maxlevel 29666
maxmem 0
jrs@jrs-laptop:~/sb/abcc/LIKE$ scriba ff_extract.sb
Downloading Latest 64Bit Firefox (63.0.3) for Windows.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   134  100   134    0     0    485      0 --:--:-- --:--:-- --:--:--   774
100 42.3M  100 42.3M    0     0  21.6M      0  0:00:01  0:00:01 --:--:-- 34.4M

Firefox_Setup-63.0.3.exe Downloaded 44,396,080 Bytes at 22,662,623 Bytes/Second.
jrs@jrs-laptop:~/sb/abcc/LIKE$
jrs@jrs-laptop:~/sb/abcc/LIKE$ echo $PATH
/home/jrs/sb/sb64/bin:/home/jrs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
jrs@jrs-laptop:~/sb/abcc/LIKE$

« Last Edit: December 01, 2018, 03:10:09 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #117 on: December 01, 2018, 11:03:13 AM »
AIR,

If you can get sb.sh to set the PATH correctly like source does, I think we can put this behind us.

Offline AIR

  • BASIC Developer
  • Posts: 660
Re: Scriptbasic Build Linux
« Reply #118 on: December 01, 2018, 11:46:13 AM »
AIR,

If you can get sb.sh to set the PATH correctly like source does, I think we can put this behind us.

Quote from: AIR
Understand that when you run the script, it's setting up a temporary environment, so when you run a script via ./sb.sh <path to bas> it should work.  It works on my Mac/LinBox/RPi.  Once that's done, the environment reverts to what it was before calling the sb.sh script.

So, if you run sb.sh and then go looking for the updated path you will not see it.  There is nothing to fix here, it is functioning as it should.

When you launch an executable from a terminal, whether it's a script or a binary, it inherits the environment from the parent shell.  It can set or overwrite the environment variables, but only for the life of that script/binary.  None of the changes are permanent, because  those changes are not set in the parent shell.

When you source a script, any changes to the environment are reflected in the current shell.  So that is why when you check the environment, you see the updated PATH reflected.

However, if you launch a NEW terminal, those environment changes are not set in the new shell.

This is how the shell works in ALL operating systems, from Windows to Mac to *nix.

It's a common misunderstanding on the part of many people.

AIR.


Offline John

  • Forum Support / SB Dev
  • Posts: 2685
    • ScriptBasic Open Source Project
Re: Scriptbasic Build Linux
« Reply #119 on: December 01, 2018, 11:56:19 AM »
I was hoping for a simple way to get the Linux version installed in a user account without having to think about it.

It would be a nice option if you can expand on sb.sh to have an option to update .bashrc so the startup script no longer needs to be run.

A sbrm.sh script could uninstall SB by removing the sb64 directory and cleaning up .bashrc if the permanent option.was used.

For extra points, a way to install additional extension modules easily would be nice.

This is really creating a run time setup script.
« Last Edit: December 01, 2018, 12:58:35 PM by John »