gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
303 stars 99 forks source link

Create PPA install for ubuntu #2767

Closed RoiArthurB closed 5 years ago

RoiArthurB commented 5 years ago

Is your request related to a problem? Please describe.

There is no .desktop file in Linux release. This file is important because it create a shortcut to the application for every menu.

Describe the solution you'd like

Include a dummy desktop file name GAMA1.8.desktop in the zip archive.

The file could follow this template :

[Desktop Entry]
Type=Application
Name=GAMA 1.8
Icon=./icon.png
Exec=env GTK_THEME=Matcha-aliz:light ./Gama
Categories=Development
Terminal=false

I agree that it won't work if the file is not moved to the right position and path corrected, but it will help people by giving a template file.

Describe alternatives you've considered

We could create a simple script to automatically create the desktop file at the right location with good information on it (mainly path).

hqnghi88 commented 5 years ago

Tried once in Coding camp (for Patrick's issue to launch gamr - gaml model open with GAMA by doubleclicking) but a bit lost as you said , the path. Yes, scripting, of course, but i propose to open a tracker or another bigger issue on your past request : ppa for gama, on how unix program installed and created desktop shorcut. Iam open for discussing and doing this now (should have one for windows installer also).

RoiArthurB commented 5 years ago

I'm currently working on creating an aur (Arch User Repo) package. But in general, I don't know if I should focus more on Arch base OS or Debian base OS.. Do you have any information on what OS is the most used by the gama community?

hqnghi88 commented 5 years ago

Euhh, i think ubuntu debian. Most of African and asian i met use them. But may be some one on gama forum have better vision on gama courses somewhere.

RoiArthurB commented 5 years ago

Hello,

I've created a PPA for ubuntu to install GAMA w/o JDK : https://launchpad.net/~roiarthurb/+archive/ubuntu/gama-platform?field.series_filter=bionic

To install it simply run this :

sudo add-apt-repository ppa:roiarthurb/gama-platform
sudo apt update
sudo apt install gama

I'll test it soon, but if anyone have a ubuntu running, please try it and reply if you see it and the app display in your app menu ! :D (EDIT: it's working on docker, but I can't see if the .desktop is well generated).

For now it is only for bionic version (18.04 LTS) in 64 bits and I haven't set any dependencies. But, if you accept to use OpenJDK, I can add this one as a dep. . And when I'll be sure that it's working well, I'll add the w/ JDK version :)

RoiArthurB commented 5 years ago

@hqnghi88 I'm working on addind Gama w/ JDK on my PPA and I have a strange error message

   dh_shlibdeps
dpkg-shlibdeps: warning: cannot find library libjli.so needed by debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jdeps (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '/usr/share/gama-jdk/jdk/bin/../lib/amd64/jli:/usr/share/gama-jdk/jdk/bin/../lib/amd64')
dpkg-shlibdeps: warning: cannot find library libjli.so needed by debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/java (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '/usr/share/gama-jdk/jdk/jre/bin/../lib/amd64/jli:/usr/share/gama-jdk/jdk/jre/bin/../lib/amd64')
dpkg-shlibdeps: warning: cannot find library libjli.so needed by debian/gama-jdk/usr/share/gama-jdk/jdk/bin/keytool (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '/usr/share/gama-jdk/jdk/bin/../lib/amd64/jli:/usr/share/gama-jdk/jdk/bin/../lib/amd64')
dpkg-shlibdeps: error: cannot find library libX11.so.6 needed by debian/gama-jdk/usr/share/gama-jdk/jdk/bin/policytool (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '/usr/share/gama-jdk/jdk/bin/../lib/amd64/jli:/usr/share/gama-jdk/jdk/bin/../lib/amd64')
dpkg-shlibdeps: warning: cannot find library libjli.so needed by debian/gama-jdk/usr/share/gama-jdk/jdk/bin/policytool (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '/usr/share/gama-jdk/jdk/bin/../lib/amd64/jli:/usr/share/gama-jdk/jdk/bin/../lib/amd64')

[...]

dpkg-shlibdeps: error: cannot continue due to the errors listed above
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to use -l.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/gama-jdk.substvars debian/gama-jdk/usr/share/gama-jdk/Gama debian/gama-jdk/usr/share/gama-jdk/jdk/bin/serialver debian/gama-jdk/usr/share/gama-jdk/jdk/bin/orbd debian/gama-jdk/usr/share/gama-jdk/jdk/bin/javac debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jhat debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jps debian/gama-jdk/usr/share/gama-jdk/jdk/bin/rmid debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jar debian/gama-jdk/usr/share/gama-jdk/jdk/bin/keytool debian/gama-jdk/usr/share/gama-jdk/jdk/bin/native2ascii debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jstatd debian/gama-jdk/usr/share/gama-jdk/jdk/bin/policytool debian/gama-jdk/usr/share/gama-jdk/jdk/bin/idlj debian/gama-jdk/usr/share/gama-jdk/jdk/bin/schemagen debian/gama-jdk/usr/share/gama-jdk/jdk/bin/tnameserv debian/gama-jdk/usr/share/gama-jdk/jdk/bin/extcheck debian/gama-jdk/usr/share/gama-jdk/jdk/bin/unpack200 debian/gama-jdk/usr/share/gama-jdk/jdk/bin/wsgen debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jjs debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jdeps debian/gama-jdk/usr/share/gama-jdk/jdk/bin/xjc debian/gama-jdk/usr/share/gama-jdk/jdk/bin/javadoc debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jinfo debian/gama-jdk/usr/share/gama-jdk/jdk/bin/appletviewer debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jstat debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jsadebugd debian/gama-jdk/usr/share/gama-jdk/jdk/bin/wsimport debian/gama-jdk/usr/share/gama-jdk/jdk/bin/pack200 debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jstack debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jmc debian/gama-jdk/usr/share/gama-jdk/jdk/bin/javaws debian/gama-jdk/usr/share/gama-jdk/jdk/bin/rmiregistry debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jcmd debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jmap debian/gama-jdk/usr/share/gama-jdk/jdk/bin/javah debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jdb debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jconsole debian/gama-jdk/usr/share/gama-jdk/jdk/bin/servertool debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jarsigner debian/gama-jdk/usr/share/gama-jdk/jdk/bin/jrunscript debian/gama-jdk/usr/share/gama-jdk/jdk/bin/rmic debian/gama-jdk/usr/share/gama-jdk/jdk/bin/java debian/gama-jdk/usr/share/gama-jdk/jdk/bin/javap debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/orbd debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/rmid debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/keytool debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/policytool debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/tnameserv debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/unpack200 debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/jjs debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/pack200 debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/javaws debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/rmiregistry debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/servertool debian/gama-jdk/usr/share/gama-jdk/jdk/jre/bin/java debian/gama-jdk/usr/share/gama-jdk/jdk/jre/lib/jexec debian/gama-jdk/usr/share/gama-jdk/jdk/lib/jexec returned exit code 2
dh_shlibdeps: Aborting due to earlier error
debian/rules:18: recipe for target 'binary' failed
make: *** [binary] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2

You have full logs here : https://launchpadlibrarian.net/428204821/buildlog_ubuntu-bionic-amd64.gama-jdk_1.8.0-2_BUILDING.txt.gz

And yes, I've search for that lib libX11.so needed by all the JDK but I can't find it in the zip archive. Do you have any idea about that bug?

hqnghi88 commented 5 years ago

Not really see how to get that error (a script or a CI or...) but as in an google result here http://tugrulaslan.com/jdk-installation-javaws-error-javaws-error-while-loading-shared-libraries-libx11-so-6-cannot-open-shared-object-file-no-such-file-or-directory/ You think the libX11 must be in the zip of gama_with_jdk?

hqnghi88 commented 5 years ago

i launch a build for the zip syntax of gama_linux_with_jdk, can you retry?

RoiArthurB commented 5 years ago

It's the continuous build?

hqnghi88 commented 5 years ago

yes, not helpful?

RoiArthurB commented 5 years ago

The lib needed is not into that new zip archive... :x I can try to find it and add it manually, but actually (I'll test) I'm afraid that the whole software (version w/ JDK) is not working on linux... :/

hqnghi88 commented 5 years ago

When creating w/JDK on Mac, we found that symbolink was not included in the zip (syntax -y of zip will do) and the message was something similar with yours "lib.ldni....was not found". So i just add the -y for linux zip package. If libx11.so.6 is not a symbolink for jdk , i dont know how it works and why do you think w/jdk is not working on linux (only by ppa or the CI release crash)?

RoiArthurB commented 5 years ago

To create a PPA, I have to send files which are compiled by a CI to create a .deb and it's that compilation which fail all the time. Where should I create the sym. link ? I'll try it in local and try to send it with sym link :)

hqnghi88 commented 5 years ago

See how jdk installed by ppa have done with a symbolink (is it realted with libx11.so.6)?? BUt do you think yum -y install libX11-devel.x86_64 or apt-get insta libX11-devel.x86_64 would help?

hqnghi88 commented 5 years ago

The jdk include in gama w/ jdk is only the copy of the folder /usr/bin/jdk so i think it missed some symbolink (if there is some by ppa install in 2017).

RoiArthurB commented 5 years ago

But the sym links you're talking about are pointing from which file to where? I'm trying to add lix11-6 dependency to the build

hqnghi88 commented 5 years ago

NO idea, Mac-expert found it and i am not tollay understand how it works, just like the shorcut link on windows, see this file https://github.com/gama-platform/jdk/blob/master/mac/64/1.8.171/jdk/Contents/MacOS/libjli.dylib

RoiArthurB commented 5 years ago

Ok, i've added libX11 as a build dependency and the build pass now :D I'll try it later, but everything should work ! ^^

RoiArthurB commented 5 years ago

Hello, So I've tried both my gama released (w/ && w/o JDK) and I always have the same error message :

In error window

The Gama executable launcher was unable to locate its companion shared library.

In Terminal

Gtk-Message: 12:31:38.056: GtkDialog mapped without a transient parent. This is discouraged.

So I don't know which lib it's talking about. Maybe there's a link with sym links which could not been added to the zip archive ?

hqnghi88 commented 5 years ago

"The Gama executable launcher was unable to locate its companion shared library." this mean probably in the gama.ini , the path to vm is wrong on your configuration. https://github.com/gama-platform/jdk/blob/master/linux/64/Gama.ini

RoiArthurB commented 5 years ago

Ok, so the problem comes from the ini file (line 5/6) :

--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1000.v20190125-2016

For an unknown reason the file can't be load when I try to start GAMA.

The real strange element is that I can start GAMA with the source I build and send to Launchpad (the PPA repo/built), but if I point that lib in the installed repo it doesn't work anymore... So for now I'm trying to fix that with permissions (but it's not working even with a chmod 777 and I'm using my container as root, so I don't think it's a privilege problem...) :thinking:

RoiArthurB commented 5 years ago

FIND IT !! \o/ I don't know why for now, but the .deb file doesn't have the eclipse_1801.so file in the launcher.library directory !

tree /usr/share/gama-jdk/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1000.v20190125-2016/ -l
/usr/share/gama-jdk/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1000.v20190125-2016/
|-- META-INF
|   |-- ECLIPSE_.RSA
|   |-- ECLIPSE_.SF
|   `-- MANIFEST.MF
|-- about.html
|-- eclipse_1801.so       <==== HERE
`-- launcher.gtk.linux.x86_64.properties

So now I just have to find why it's not include in my PPA repo and I think that everything should works perfectly :sunglasses:

hqnghi88 commented 5 years ago

so is symbo link? so should it be the syntax to create deb must accept to keep symbolink (as in zip, we must specify -y)

RoiArthurB commented 5 years ago

No, the problem is that when I prepare source for Launchpad, the command debuild -S doesn't accept binary files by default (the w/ JDK PPA contains only 2482 files and the zip 2544 files) So I just have to prepare sources with this command debuild -S --source-option=--include-binaries (https://askubuntu.com/questions/164621/how-do-i-add-a-binary-file-to-my-existing-ppa-package)

So .deb is compiling, I'll test it and I think everything should be fixed now ;)

RoiArthurB commented 5 years ago

More news : I've fixed the problem (for sure this time) ! :smile: So, firstly, my previous solution didn't work. My package version was not compatible with the command :

dpkg-source: warning: --include-binaries is not a valid option for Dpkg::Source::Package::V3::Native

So I try to go deeper in commands used to build package and a Debian dev gave me (not to me, but on internet) some information (see here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735377#10 ). So as we can see, .so files are ignored by default and (a solution) is to overwrite this. So, I've simply added a debian/source/options file with extension file that I wanted to ignore

tar-ignore=.git
tar-ignore=.gitignore

And now I have some new bugs (YEAH! \o/) on the build server :

dpkg-shlibdeps: error: cannot find library libgtk-3.so.0 needed by debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libgdk-3.so.0 needed by debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libcairo.so.2 needed by debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libsecret-1.so.0 needed by debian/gama/usr/share/gama/plugins/org.eclipse.equinox.security.linux.x86_64_1.1.200.v20181106-0957/libkeystorelinuxnative.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/gama/usr/share/gama/plugins/org.eclipse.equinox.security.linux.x86_64_1.1.200.v20181106-0957/libkeystorelinuxnative.so was not linked against libgobject-2.0.so.0 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so was not linked against libgthread-2.0.so.0 (it uses none of the library's symbols)
dpkg-shlibdeps: error: cannot continue due to the errors listed above
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to use -l.
dh_shlibdeps: dpkg-shlibdeps -Tdebian/gama.substvars debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-gtk-4924r25.so debian/gama/usr/share/gama/Gama debian/gama/usr/share/gama/plugins/org.eclipse.equinox.security.linux.x86_64_1.1.200.v20181106-0957/libkeystorelinuxnative.so debian/gama/usr/share/gama/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1000.v20190125-2016/eclipse_1801.so returned exit code 2
dh_shlibdeps: Aborting due to earlier error

Full logs here Can you help me again with this errors @hqnghi88 ? :)

hqnghi88 commented 5 years ago

@RoiArthurB can i take a look at your script?

RoiArthurB commented 5 years ago

I don't use any script, I just unzip files in the right folder and send it to launchpad. I can create a repo with exactly my full folder if you want

AlexisDrogoul commented 5 years ago

I'm a bit lost in this discussion. Is the enhancement ready ? Working ? Deployable ?

hqnghi88 commented 5 years ago

Ready for Gama without jdk sudo add-apt-repository ppa:roiarthurb/gama-platform sudo apt update sudo apt install gama and Not yet for Gama version with JDK from last message of Arthur, the deploying to ppa have problem with finding private library shlibdeps: error: cannot find library libgtk-3.so.0 needed by debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '') dpkg-shlibdeps: error: cannot find library libgdk-3.so.0 needed by debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '') dpkg-shlibdeps: error: cannot find library libcairo.so.2 needed by debian/gama/usr/share/gama/configuration/org.eclipse.osgi/149/0/.cp/libswt-pi3-gtk-4924r25.so

RoiArthurB commented 5 years ago

Kevin tried my PPA with his student and neither w/ nor w/o JDK version is working. I'm working on it, I'll keep you updated with my progression on it.

RoiArthurB commented 5 years ago

Hello all! :smiley: The gama package (w/o JDK) should be working on my PPA, I'm working on the gama-jdk package currently. If someone with Ubuntu 18.04 LTS can try it and tell me if it's fine please ^^

AlexisDrogoul commented 5 years ago

What's the status of this Issue ? Is it working ? Is it created automatically ? Can we close it ?

RoiArthurB commented 5 years ago

Hello, Here's a demonstration about how to install Gama from the PPA and how to run headless from it :

    $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:    18.04
Codename:   bionic
    $ add-apt-repository ppa:roiarthurb/gama-platform && apt update
 GAMA is a modeling and simulation development environment for building spatially explicit agent-based simulations.
http://gama-platform.org
 More info: https://launchpad.net/~roiarthurb/+archive/ubuntu/gama-platform
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease   
> Get:2 http://ppa.launchpad.net/roiarthurb/gama-platform/ubuntu bionic InRelease [15.9 kB]
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease   
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                      
Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease                                   
Get:6 http://ppa.launchpad.net/roiarthurb/gama-platform/ubuntu bionic/main amd64 Packages [622 B]
Fetched 16.5 kB in 2s (10.3 kB/s)                   
Reading package lists... Done
Hit:1 http://ppa.launchpad.net/roiarthurb/gama-platform/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease             
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease        
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease          
Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done                      
Building dependency tree       
Reading state information... Done
All packages are up to date.
    $ apt install gama
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  gama
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 98.1 MB of archives.
After this operation, 109 MB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/roiarthurb/gama-platform/ubuntu bionic/main amd64 gama amd64 1.8.0-8 [98.1 MB]
Fetched 98.1 MB in 17s (5655 kB/s)                                                                                                                    
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package gama.
(Reading database ... 41990 files and directories currently installed.)
Preparing to unpack .../gama_1.8.0-8_amd64.deb ...
Unpacking gama (1.8.0-8) ...
Setting up gama (1.8.0-8) ...
Processing triggers for mime-support (3.60ubuntu1) ...
    $ chmod +x /usr/share/gama/headless/gama-headless.sh 
    $ /usr/share/gama/headless/gama-headless.sh /usr/share/gama/headless/samples/predatorPrey.xml /tmp/GamaHeadlessTest
/usr/share/gama/headless/gama-headless.sh
******************************************************************
* GAMA version 1.8                                               *
* http://gama-platform.org                                       *
* (c) 2007-2019 UMI 209 UMMISCO IRD/SU & Partners                *
******************************************************************
GAMA is starting...
Number of cpus used:4 (available: 4)
..................................................
Simulation duration: 1630ms
    $ ls /tmp/GamaHeadlessTest/ 
console-outputs-2.txt  simulation-outputs2.xml  snapshot
    $ head /tmp/GamaHeadlessTest/simulation-outputs2.xml 
<?xml version="1.0" encoding="UTF-8"?>
<Simulation id="2" >
    <Step id='0' >
        <Variable name='main_display' type='DISPLAY2D'>main_display2-0.png</Variable>
    </Step>
    <Step id='1' >
        <Variable name='main_display' type='DISPLAY2D'>NA</Variable>
    </Step>
    <Step id='2' >
        <Variable name='main_display' type='DISPLAY2D'>NA</Variable>

So everything is working on my newly created Ubuntu 18.04 LTS docker container. Maybe we should try it on a real Ubuntu laptop?

Otherwise yes, I think we can close the issue :smile:

AlexisDrogoul commented 5 years ago

All right. Thanks. Issue closed, then...