Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 760684 - sci-mathematics/giac: import from sage-on-gentoo overlay
Summary: sci-mathematics/giac: import from sage-on-gentoo overlay
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michael Orlitzky
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-19 01:12 UTC by Michael Orlitzky
Modified: 2021-04-01 21:48 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
giac-1.7.0.1.ebuild (giac-1.7.0.1.ebuild,3.90 KB, text/plain)
2021-03-30 22:35 UTC, Michael Orlitzky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2020-12-19 01:12:59 UTC
SageMath gained the ability to detect giac on the system in

  https://trac.sagemath.org/ticket/29541

The overlay ebuild looks relatively unscary... hopefully no surprises.
Comment 1 François Bissey 2020-12-19 01:27:11 UTC
Ok, but only the 1.5.x for now. 1.6.x has broken bits upstream that I haven't fixed yet. OK, I am waiting for upstream to fix them since they have acknowledged the brokeness https://trac.sagemath.org/ticket/30537#comment:28
Comment 2 Michael Orlitzky gentoo-dev 2020-12-19 01:36:33 UTC
Ah, good to know. I will probably just wait a few days, then, and try 1.6.0.43.

I need to figure out how to get the docs into the right place anyhow...
Comment 3 François Bissey 2020-12-19 01:38:41 UTC
Sage only works with 1.5 at the moment too.
Comment 4 François Bissey 2020-12-19 01:43:32 UTC
Hum, we only have pari-2.11+ left in the tree, I should remove the conditional in case we have an older pari.
Comment 5 Michael Orlitzky gentoo-dev 2020-12-19 03:20:40 UTC
It looks like the build system supports --docdir, but the value /usr/share/giac/doc is hard-coded throughout the source =/
Comment 6 Michael Orlitzky gentoo-dev 2020-12-19 03:37:04 UTC
Another thing I stumbled upon in the README:

  The French documentation is *not* released under the GPL. It is (c)
  by Renee de Graeve. It can be freely distributed for non commercial purpose.
  Other kind of redistributions require the consent of the copyright holder.

Looks like that will have to go.
Comment 7 François Bissey 2020-12-19 03:43:57 UTC
(In reply to Michael Orlitzky from comment #6)
> Another thing I stumbled upon in the README:
> 
>   The French documentation is *not* released under the GPL. It is (c)
>   by Renee de Graeve. It can be freely distributed for non commercial
> purpose.
>   Other kind of redistributions require the consent of the copyright holder.
> 
> Looks like that will have to go.

That's relatively easy to do. And yes it is known, that's why sage doesn't ship it either.
Comment 8 François Bissey 2020-12-19 10:11:20 UTC
Cleaned the ebuild a little. For 1.6.0, I am really waiting for the next iteration that should also have configure options to disable micropython from building.
Comment 9 Michael Orlitzky gentoo-dev 2020-12-19 15:16:46 UTC
I don't think that last commit is going to delete the french docs. Removing "fr" from LANGS skips the line,

  rm -rf "${ED}"/usr/share/giac/doc/"${lang}"

A few other easy things while I fight with the docs:

  1. You can drop the pax stuff. There are no more pax kernels in Gentoo.

  2. The desktop and icon files should be added to (or removed from) the
     cache upon (de)installation:

     inherit ... xdg-utils

     pkg_postinst(){
         if use fltk; then
             xdg_desktop_database_update
             xdg_icon_cache_update
         fi
     }

     pkg_postrm(){
         if use fltk; then
             xdg_desktop_database_update
             xdg_icon_cache_update
         fi
     }

  3. We have a global USE=gui flag now that I think would be a lot more
     obvious than USE=fltk to enable the GUI.
Comment 10 Michael Orlitzky gentoo-dev 2020-12-19 15:50:53 UTC
Ok, so one secret to the docs is that you have to set the language to e.g. english in XCAS, and then choose Help -> Rebuild help cache from the menu. Otherwise all of the "Help" URLs contain a nonsense "local" component.

Aside from that it mostly seems to be working if I,

  1. Install everything to /usr/share/giac/doc
  2. Move that to /usr/share/doc/${PF}
  3. Symlink /usr/share/giac/doc to /usr/share/doc/${PF}
Comment 11 François Bissey 2020-12-19 20:14:56 UTC
(In reply to Michael Orlitzky from comment #9)
> I don't think that last commit is going to delete the french docs. Removing
> "fr" from LANGS skips the line,
> 
>   rm -rf "${ED}"/usr/share/giac/doc/"${lang}"
> 

You are right, it is not enough.

> A few other easy things while I fight with the docs:
> 
>   1. You can drop the pax stuff. There are no more pax kernels in Gentoo.
> 

OK.

>   2. The desktop and icon files should be added to (or removed from) the
>      cache upon (de)installation:
> 
>      inherit ... xdg-utils
> 
>      pkg_postinst(){
>          if use fltk; then
>              xdg_desktop_database_update
>              xdg_icon_cache_update
>          fi
>      }
> 
>      pkg_postrm(){
>          if use fltk; then
>              xdg_desktop_database_update
>              xdg_icon_cache_update
>          fi
>      }
> 

Didn't know that.

>   3. We have a global USE=gui flag now that I think would be a lot more
>      obvious than USE=fltk to enable the GUI.

Right.
Comment 12 François Bissey 2020-12-20 03:59:35 UTC
I still have https://github.com/cschwan/sage-on-gentoo/issues/608 on my todo list but it is not really towards the top of my priorities, feel free to do something about it.
Comment 13 Michael Orlitzky gentoo-dev 2020-12-24 03:59:40 UTC
I applied for a giac forum account but have yet to be approved. I would at least like to report the $(docdir) problems. It seems like the author prefers /usr/share/giac/doc to the default docdir, but rather than changing --docdir, he's made copies of everything in /usr/share/giac/doc and hard-coded that path in a lot of places.

If he just doesn't know about --docdir, it might save a lot of trouble if /usr/share/giac/doc was replaced with $docdir everywhere, and --docdir=/usr/share/giac/doc was used by default.

Aside from that... I've got something working for now. I'll deal with the rest of the USE=doc issues when the bugfix release arrives.
Comment 14 Michael Orlitzky gentoo-dev 2021-03-30 22:35:57 UTC
Created attachment 696300 [details]
giac-1.7.0.1.ebuild

How's v1.7.0.1? Here's the ebuild I've got. Most of the changes are somersaults that allow us to put the docs in the correct location.
Comment 15 François Bissey 2021-03-30 22:40:35 UTC
That's a lot of stuff in src_install. Cursory look feels OK. I need to have a closer look this afternoon but I have some trust in your work.
Comment 16 Michael Orlitzky gentoo-dev 2021-03-30 22:50:13 UTC
All I've really done is set docdir to the wrong location (the one upstream prefers) so that everything, including the docs with hard-coded paths, gets installed to the same place. That makes it easy to move it all to the correct place (/usr/share/doc/${PF}) with a single command. Afterwards I symlink the two.

This works around the fact that many things hard-code the path /usr/share/giac even when you specify --docdir=<something-else>.

In any case, I was just checking in. If v1.7.0.1 won't work with sage yet, I'm happy to keep waiting. (I've CCed myself on those trac tickets.)
Comment 17 François Bissey 2021-03-30 22:53:48 UTC
Antonio Rojas from arch says it does - he opened a ticket. I haven't tried yet but I believe him.
Comment 18 François Bissey 2021-03-30 22:54:28 UTC
We are talking about 9.3 when it is released of course. Not 9.2.
Comment 19 Michael Orlitzky gentoo-dev 2021-04-01 20:43:06 UTC
I'm trying one more time to create a forum account to report the docdir issue upstream. Aside from that, v1.7.0.1 does work fine in the latest sage beta, so I'll merge it soon.
Comment 20 Michael Orlitzky gentoo-dev 2021-04-01 21:06:58 UTC
One more tiny change: I've added RESTRICT=mirror because of the French documentation license.
Comment 21 Larry the Git Cow gentoo-dev 2021-04-01 21:48:55 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=320334104e3e56e4fff1f1f821e74f7a122dfd57

commit 320334104e3e56e4fff1f1f821e74f7a122dfd57
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2021-03-31 12:42:19 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2021-04-01 21:48:37 +0000

    sci-mathematics/giac: new package for the Giac/Xcas math systems.
    
    We have bugzilla requests for this package going back to 2005! The
    SageMath suite has recently gained the ability to use Giac from the
    system, so now is an especially good time to add it to the tree.
    François Bissey has been maintaining this package for years in the
    sage-on-gentoo overlay and contributing fixes upstream, so the ebuild
    required only minor changes at this point. I personally thank him and
    you should too.
    
    Closes: https://bugs.gentoo.org/94539
    Closes: https://bugs.gentoo.org/94542
    Closes: https://bugs.gentoo.org/760684
    Package-Manager: Portage-3.0.13, Repoman-3.0.2
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sci-mathematics/giac/Manifest                      |   1 +
 .../giac/files/giac-1.6.0-pari-2.11.patch          |  17 +++
 .../giac/files/giac-1.7.0.1-gsl_lapack.patch       |  84 +++++++++++
 sci-mathematics/giac/giac-1.7.0.1.ebuild           | 163 +++++++++++++++++++++
 sci-mathematics/giac/metadata.xml                  |  39 +++++
 5 files changed, 304 insertions(+)