Package Details: gnat-gps 2020-8

Git Clone URL: https://aur.archlinux.org/gnat-gps.git (read-only, click to copy)
Package Base: gnat-gps
Description: GNAT Programming Studio for Ada
Upstream URL: https://github.com/AdaCore/gps
Licenses: GPL
Submitter: None
Maintainer: charlie5 (xiretza)
Last Packager: charlie5
Votes: 20
Popularity: 0.145228
First Submitted: 2009-07-17 04:43
Last Updated: 2020-11-19 15:09

Pinned Comments

charlie5 commented on 2020-09-27 04:25

Workaround for bad line numbering => Disable 'code folding' in preferences.

To enable 'Find All References' => Append 'GPS.LSP.ADA_SUPPORT=no' to ~/.gnatstudio/traces.cfg.

pacaur fails to build this package in a variety of ways, most notably with honouring make-depends.

pikaur does a better job but does not install libiconv required by gnatcoll-iconv. When this happens, do '$ pikaur -S libiconv' and then repeat the '$ pikaur -S gnat-gps' command. Or more simply, just install libiconv before building gnat-gps.

Latest Comments

1 2 3 4 5 6 ... Next › Last »

charlie5 commented on 2020-11-20 14:15

@ccorn

Good to hear :) ... Thanks again for the suggested pip2 approach and also for all the testing you have done.

Regards.

ccorn commented on 2020-11-19 23:37

@charlie5: Works like a charm!

And thanks for adding the extra test: Without it, pip2 would detect an existing sphinx installation, but using it would need the un-renaming symlink (as before). I should have thought of that myself.

I have tested your PKGBUILD in chroot builds both with and without preinstalled python2-sphinx package. The resulting package file lists are the same, and the documentation looks OK. All lights green here.

charlie5 commented on 2020-11-19 15:15

@ccorn

I've applied your mods and tested on an arch OS where python2-sphinx is already installed via pacman and also on a bare bones arch OS w/o pacman install of python2-sphinx.

Would you be able to take a look at the new PKGBUILD and perhaps test it in a chroot environment and let me know of any probs ?

Cheers.

charlie5 commented on 2020-11-17 16:43

@ccorn

Thanks for the alternative method. It looks very good. And cheers for clearing up my python2-gobject2 confusion. I'll try to add your mods in tomorrow.

Regards.

ccorn commented on 2020-11-17 03:03

@charlie5: Same runtime behavior here:

On my system, python2-gobject is needed else gnatstudio crashes with an > 'ImportError: No module named gi' error message.

But when building in a chroot, python2-gobject2 is needed, otherwise the following fatal error occurs:

/build/gnat-gps/src/gps-21.0w-20200427-15496-src/gnatcoll_extras/src/python_support_gtk.c:19:10: fatal error: 'pygobject.h' file not found

In my checkout, I have now added both to depends.

ccorn commented on 2020-11-17 02:11

Because of the signature issue and the hassle of having to specify fallback packages, I have tried another approach: Just using

  export PYTHONUSERBASE="$srcdir/.local"
  export PATH="$srcdir/.local/bin:$PATH"
  pip2 install --user --cache-dir "$startdir/.cache/pip2" sphinx

This works both in chroot and local builds without unduly affecting the host system while still using persistent caching to avoid repeated downloads. It needs python2-pip in makedepends however.

I have checked that the file list of the resulting package is the same as in the previous revision, including documentation.

Here is the diff to the PKGBUILD:

diff --git a/PKGBUILD b/PKGBUILD
index ecf9ba1..c9d7fd9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,7 +18,7 @@ depends=("clang" "libadalang"
          "gnome-icon-theme" "gnome-icon-theme-extras" "gnome-icon-theme-symbolic" 
          "python2-gobject2")
 optdepends=('python2-jedi')
-makedepends=('gprbuild' 'texlive-latexextra' 'graphviz')
+makedepends=('gprbuild' 'texlive-latexextra' 'graphviz' 'python2-pip')

 _gps_version=21.0w-20200427-15496
 _gps_checksum=bfa68dd61a9288c79e9c08676878cac95e0fe628
@@ -49,6 +49,13 @@ sha1sums=("$_gps_checksum"

 prepare()
 {
+  # Install python2 packages that cannot be auto-installed via makedepends.
+  # Note that exports made here are visible in build() and package() as well.
+  # Use a persistent but package-specific download cache.
+  export PYTHONUSERBASE="$srcdir/.local"
+  export PATH="$srcdir/.local/bin:$PATH"
+  pip2 install --user --cache-dir "$startdir/.cache/pip2" sphinx
+
   cd "$srcdir/gps-$_gps_version-src"

   patch -p1 < "$srcdir/0002-Ignore-absence-of-version-number-in-user_guide.patch"
@@ -57,23 +64,13 @@ prepare()
   patch -p1 < "$srcdir/0005-Fix-recursive-make-in-docs.patch"

   # Force use of python2
-  rm -fr temp_bin
-  mkdir  temp_bin
-  ln -s /usr/bin/python2        temp_bin/python
-  ln -s /usr/bin/python2-config temp_bin/python-config
-  ln -s /usr/bin/sphinx-build2  temp_bin/sphinx-build
+  # Destination directory already populated by pip2 install
+  ln -sfT /usr/bin/python2        "$srcdir/.local/bin/python"
+  ln -sfT /usr/bin/python2-config "$srcdir/.local/bin/python-config"

   # Link libadalang-tools and ada_language_server into the GPS source tree
   ln -sf "$srcdir/libadalang-tools-$_laltools_ver-src" "$srcdir/gps-$_gps_version-src/laltools"
   ln -sf "$srcdir/als-$_als_ver-src"                   "$srcdir/gps-$_gps_version-src/ada_language_server"
-
-  # Install missing (obsolete) python2 packages from archives.
-  sudo pacman -U https://archive.archlinux.org/packages/p/python2-babel/python2-babel-2.8.0-5-any.pkg.tar.zst
-  sudo pacman -U https://archive.archlinux.org/packages/p/python2-imagesize/python2-imagesize-1.2.0-1-any.pkg.tar.xz
-  sudo pacman -U https://archive.archlinux.org/packages/p/python2-snowballstemmer/python2-snowballstemmer-2.0.0-3-any.pkg.tar.xz
-  sudo pacman -U https://archive.archlinux.org/packages/p/python2-sphinx-alabaster-theme/python2-sphinx-alabaster-theme-0.7.12-3-any.pkg.tar.xz
-  sudo pacman -U https://archive.archlinux.org/packages/p/python2-sphinxcontrib-websupport/python2-sphinxcontrib-websupport-1.1.2-3-any.pkg.tar.xz
-  sudo pacman -U https://archive.archlinux.org/packages/p/python2-sphinx/python2-sphinx-1.8.5-5-any.pkg.tar.zst
 }


@@ -83,9 +80,6 @@ build()

   export OS=unix

-  # Force use of python2
-  export PATH="$srcdir/gps-$_gps_version-src/temp_bin:$PATH"
-
   ./configure --prefix=/usr

   # the release tarball contains a bunch of sphinx build artefacts
@@ -105,9 +99,6 @@ package()

   export OS=unix

-  # Force use of python2
-  export PATH="$srcdir/gps-$_gps_version/temp_bin:$PATH"
-
   make DESTDIR="$pkgdir/" install

   # Add the desktop config.

charlie5 commented on 2020-11-16 23:57

Hi again @xiretza

I just noticed you've replaced python2-gobject with python2-gobject2. On my system, python2-gobject is needed else gnatstudio crashes with an 'ImportError: No module named gi' error message.

Also, I have built and ran gps without python2-gobject2 being needed.

charlie5 commented on 2020-11-16 22:51

Hi @xiretza ... thanks for bumping up the package version.

charlie5 commented on 2020-11-16 22:47

Hi @Armag67

You need to ...

$ sudo rm /var/cache/pacman/pkg/python2-imagesize-1.2.0-1-any.pkg.tar.xz

$ sudo rm /var/cache/pacman/pkg/python2-imagesize-1.2.0-1-any.pkg.tar.xz.sig

The same applies to several other obsolete python2 packages, which will show the same error message (so delete those also).

For the other problem, perhaps try pacaur or pikaur started in a terminal.

Armag67 commented on 2020-11-16 21:29

Hello, With today's update on Manjaro, pamac returns:

sudo: un terminal est requis pour lire le mot de passe; utilisez soit l'option -S pour lire depuis l'entrée standard ou configurez un outil askpass de demande de mot de passe
==> ERREUR : Une erreur s’est produite dans prepare().
    Abandon…

and:

git clone https://aur.archlinux.org/gnat-gps.git
cd gnat-gps
makepkg -si

after identification returns:

erreur : '/var/cache/pacman/pkg/python2-imagesize-1.2.0-1-any.pkg.tar.xz': paquet pour lequel la signature requise est manquante
==> ERREUR : Une erreur s’est produite dans prepare().
    Abandon…

I will try to modify PKGBUILD.

After marking as comment these lines for the Python2 modules already up to date on my box:

  # sudo pacman -U https://archive.archlinux.org/packages/p/python2-imagesize/python2-imagesize-1.2.0-1-any.pkg.tar.xz
  # sudo pacman -U https://archive.archlinux.org/packages/p/python2-snowballstemmer/python2-snowballstemmer-2.0.0-3-any.pkg.tar.xz
  # sudo pacman -U https://archive.archlinux.org/packages/p/python2-sphinx-alabaster-theme/python2-sphinx-alabaster-theme-0.7.12-3-any.pkg.tar.xz
  # sudo pacman -U https://archive.archlinux.org/packages/p/python2-sphinxcontrib-websupport/python2-sphinxcontrib-websupport-1.1.2-3-any.pkg.tar.xz
  # sudo pacman -U https://archive.archlinux.org/packages/p/python2-sphinx/python2-sphinx-1.8.5-5-any.pkg.tar.zst

It seems to work, keep our fingers crossed...

IT WORKS!