Package Details: gnatstudio 1:25.0w-1

Git Clone URL: https://aur.archlinux.org/gnatstudio.git (read-only, click to copy)
Package Base: gnatstudio
Description: GNAT Programming Studio for Ada.
Upstream URL: https://github.com/AdaCore/gps
Licenses: GPL
Conflicts: gnat-gps, gnatstudio-bin
Submitter: charlie5
Maintainer: charlie5
Last Packager: charlie5
Votes: 22
Popularity: 0.000000
First Submitted: 2023-06-09 07:53 (UTC)
Last Updated: 2024-05-31 06:44 (UTC)

Pinned Comments

charlie5 commented on 2023-07-09 16:42 (UTC)

This package is available in the Arch Ada Repository.

https://wiki.archlinux.org/title/Ada

charlie5 commented on 2023-06-25 17:14 (UTC) (edited on 2023-06-25 17:15 (UTC) by charlie5)

hi @GaryScottMartin,

'gnat-gps' has been recently deprecated in favour of 'gnatstudio'.

https://aur.archlinux.org/packages/gnatstudio

Regards.

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 8 9 .. 11 Next › Last »

charlie5 commented on 2021-11-18 03:40 (UTC)

Hi @DHouck,

The PKGBUILD does in fact build the gps binary from the adacore gitub source. The tarball I host on github only contains the gps 'assets' which are taken from the ada libre community edition. The assets end up in /usr/share/gnatstudio. This was required because the assets in the github version did not work, whilst the assets from the community edition did. The problems were mostly related to python2/3 mismatches.

Any improvements to the PKGBUILD would be very welcome. GPS has been notoriously difficult to build for many years. Using the assets tarball is admittedly ugly but was really the only practical way. So, yes, very interested in any helpful patches.

Regards.

DHouck commented on 2021-11-17 13:31 (UTC)

Iʼm sorry for my tone. I was suspicious because this is an AUR package (not even named with a -bin suffix) which downloads a binary I couldnʼt find the source of, and I try to at least somewhat audit AUR packages before installing them, but thatʼs no excuse for my aggression.

As for building it myself, Iʼll try editing the PKGBUILD to incorporate the suggested change in https://github.com/AdaCore/gps/issues/98 and see how it goes. If that doesnʼt work, Iʼll probably at least want to try changing it to use the scripts at https://github.com/AdaCore/gnat_community_install_script.

If I manage that (presumably only the second one will work right), would you be interested in a patch to the PKGBUILD to help other people who try to verify AUR packages seem safe before installing?

charlie5 commented on 2021-11-17 10:51 (UTC)

@DHouck

"Why does this package require a binary file from a repository you personally manage on GitHub, instead of packages from the AdaCore GitHub organization or website?".

In a nutshell, version (python-2/3 and dependent ada libs) mismatches. By all means, try building it yourself.

You can get an 'official' binary of gnatstudio from the ada libre site.

https://community.download.adacore.com/v1/f3a99d283f7b3d07293b2e1d07de00e31e332325?filename=gnat-2021-20210519-x86_64-linux-bin&rand=841

I wish you good luck and better tact in the future.

DHouck commented on 2021-11-17 07:07 (UTC)

Why does this package require a binary file from a repository you personally manage on GitHub, instead of packages from the AdaCore GitHub organization or website? How do you get a copy of gnatstudio from more official sources?

charlie5 commented on 2020-11-20 14:15 (UTC) (edited on 2020-11-23 11:08 (UTC) by charlie5)

@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 (UTC)

@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 (UTC)

@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 (UTC)

@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 (UTC)

@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 (UTC) (edited on 2020-11-17 02:11 (UTC) by ccorn)

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.