Bug 246007 - astro/astrometry: Installation error, if math/gsl is also installed
Summary: astro/astrometry: Installation error, if math/gsl is also installed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias C. Berner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-28 18:46 UTC by Rainer Hurling
Modified: 2020-07-05 16:04 UTC (History)
2 users (show)

See Also:


Attachments
v1 (1.27 KB, patch)
2020-04-28 18:56 UTC, Tobias C. Berner
no flags Details | Diff
astro/astrometry: standard places for bin, libs, data and more (24.55 KB, patch)
2020-04-30 11:36 UTC, Rainer Hurling
no flags Details | Diff
astro/astrometry: taking maintainership and standard places for bin, libs, data (25.61 KB, patch)
2020-05-01 08:40 UTC, Rainer Hurling
no flags Details | Diff
astro/astrometry: (v2) taking maintainership, standard places for bin, libs, data (24.58 KB, patch)
2020-05-17 14:39 UTC, Rainer Hurling
rhurlin: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Hurling freebsd_committer freebsd_triage 2020-04-28 18:46:23 UTC
On a real life box with math/gsl installed, astro/astrometry fails to install after successful build with the following error:

[..snip..]
===>   Registering installation for astrometry-0.80
pkg-static: Unable to access file /usr/ports/astro/astrometry/work/stage/usr/local/astrometry/lib/libgsl-an.a:No such file or directory
*** Error code 74
Stop.
make: stopped in /usr/ports/astro/astrometry



The astrometry website[1] describes in its 'gsl section' the possibility to use systems gsl. Something like

LIB_DEPENDS+=	libgsl.so:math/gsl
MAKE_ARGS=	SYSTEM_GSL=yes \
		GSL_INC="-I${LOCALBASE}/include/gsl" \
		GSL_LIB="-L${LOCALBASE}/lib -lgsl"

should work, but fails for me. I have no clue what to do next.


[1] http://astrometry.net/doc/build.html#build
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-28 18:48:05 UTC
Moin moin 

I think it would be preferable to use systme-gsl instead of a bundled one.


mfg Tobias
Comment 2 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-28 18:56:34 UTC
Created attachment 213893 [details]
v1

does this work for you?
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-28 18:59:21 UTC
(In reply to Rainer Hurling from comment #0)

Note the issue is likely here:
		GSL_INC="-I${LOCALBASE}/include/gsl" \
this should only be ${LOCALBASE}/include as the headers are included with the gsl/ prefix already in the sources.

But USES=localbase already covers that. 

mfg Tobias
Comment 4 Rainer Hurling freebsd_committer freebsd_triage 2020-04-28 19:12:16 UTC
(In reply to Tobias C. Berner from comment #3)

Thanks Tobias,
For this extremly quick response, your explanations and the solution :) 
And yes, I can confirm, that your changes do work. I also would prefer to use SYSTEM_GSL=yes instead of the built in one.

For the Makefile I would suggest to move libgsl.so:math/gsl two lines up.


More problematic could be, that 'portlint -AC' complains about pkg-plist:

FATAL: /usr/ports/astro/astrometry/pkg-plist: [272]: Unpacked man file an-fitstopnm.1 listed.  Must be gzipped.
... and 30 more lines like that.
Comment 5 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-28 19:17:09 UTC
(In reply to Rainer Hurling from comment #4)
The man's are just not installed into the proper place and therefore not gzipped by the framework :)
Comment 6 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-28 19:20:05 UTC
(In reply to Tobias C. Berner from comment #5)
util/makefile.common
31:MAN1_INSTALL_DIR ?= $(INSTALL_DIR)/share/man/man1

Makefile
152:    $(MKDIR) '$(MAN1_INSTALL_DIR)'
156:    $(CP) man/*.1 '$(MAN1_INSTALL_DIR)'


looking at this, you should be able to fix this, by just defining MAN1_INSTALL_DIR in the port-makefile.

Can I leave this to you?


mfg Tobias
Comment 7 Rainer Hurling freebsd_committer freebsd_triage 2020-04-28 19:24:10 UTC
(In reply to Tobias C. Berner from comment #6)

Wrong place for man pages, ok. I just did not thought in that direction.

Yes, I will try to come back with a complete patch, tested in Poudriere. This will take some time, of course.
Comment 8 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-28 19:25:32 UTC
(In reply to Rainer Hurling from comment #7)
No worries, let me know if you need any help :)
Comment 9 Rainer Hurling freebsd_committer freebsd_triage 2020-04-28 20:15:01 UTC
(In reply to Tobias C. Berner from comment #8)

I have difficulties to find a better place to astrometry man1 pages. Actually, they are under ${PREFIX}${PORTNAME}/share/man/man1.

Standard places like ${PREFIX}/man/man1 are problematic, because one is not able to conclude from the man pages name to the port.

I tend to use ${PREFIX}${PORTNAME}/man/man1, what do you think?
Comment 10 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-29 10:25:16 UTC
(In reply to Rainer Hurling from comment #9)
AFAIK man pages are never prefixed by portname and just installed to ${LOCALBASE}/man/man<section> in general.
Comment 11 Rainer Hurling freebsd_committer freebsd_triage 2020-04-29 11:57:58 UTC
(In reply to Tobias C. Berner from comment #10)

After investigating some hours looking into the ports tree, there seem to be many ports with non standard places for man pages. Many of them are unreachable via standard man path. For example, see /usr/local/openjdk8/man/man1/, 'man 1 keytool' does not find the page.

I decided to change the path for the ports man pages to ${PREFIX}/man/man1. Now the are usable like expected, e.g. 'man astrometry-engine'.


Right now, I am stumbling upon two other issues:

- The binaries install under ${PREFIX}/astrometry/ and are not reachable directly. Wouldn't it also be better to move them one level higher into ${PREFIX}?

- Other than states in pkg-message, there is no ${PREFIX}/astrometry/doc/GETTING-INDEXES and no other index files. There is a target install-indexes, but for some reason it does not install?
Comment 12 Rainer Hurling freebsd_committer freebsd_triage 2020-04-30 11:36:30 UTC
Created attachment 213941 [details]
astro/astrometry: standard places for bin, libs, data and more

Here is the newest patch of astro/astrometry with some more changes towards 'normalized' places for files and directories, I hope. Patch 'v1' from Tobias is integrated, thanks.


What this (unready) patch does so far:
- Bump PORTREVISION
- Better ports comment
- New LIB_DEPENDS for math/gsl and astro/wcslib
- Add USES=localbase
- Change USE_LDCONFIG from path to 'yes'
- Make man pages usable
- Move bin, libs, data to standard places
- Initial hints for automatic 'index' downloads
- Adapt pkg-message
- Update pkg-plist


I am thinking about an option, to disable (default) or enable the download of index data during the installation of the port. The index data files are many and big. Without download and installing index files (one, several, all), the port is not really usefull [1][2].


[1] http://astrometry.net/doc/readme.html
[2] http://astrometry.net/use.html
Comment 13 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-30 18:35:25 UTC
You've missed the 
MAINTAINER=	ports@FreeBSD.org
line in your patch :D  -- interested?

mfg Tobias
Comment 14 Rainer Hurling freebsd_committer freebsd_triage 2020-04-30 18:59:05 UTC
(In reply to Tobias C. Berner from comment #13)

In principle, yes. But this port is not in a good condition until now. If I would take maintainership, I is likely that I need some help here and there.
Comment 15 Tobias C. Berner freebsd_committer freebsd_triage 2020-04-30 19:00:23 UTC
(In reply to Rainer Hurling from comment #14)
I don't think that is a problem :)
Comment 16 Rainer Hurling freebsd_committer freebsd_triage 2020-05-01 08:40:21 UTC
Created attachment 213972 [details]
astro/astrometry: taking maintainership and standard places for bin, libs, data

Updated patch, with maintainer and removed silence (@) from ${INSTALL_DATA}.

Other changes, see comment #12.


Tested on Poudriere (11.3a/i, 12.1a/i, HEADa/i), 'portlint -AC' seems happy.
Comment 17 Tobias C. Berner freebsd_committer freebsd_triage 2020-05-17 13:06:03 UTC
Moin moin 

Sorry got a bit side-tracked :)

Could you rebase your patch, against the ports-tree, it seem that at the same time that you were working on it (end of april), fernape@ also updated it to 0.80 in r533236.


mfg Tobias
Comment 18 Rainer Hurling freebsd_committer freebsd_triage 2020-05-17 14:39:47 UTC
Created attachment 214586 [details]
astro/astrometry: (v2) taking maintainership, standard places for bin, libs, data

Moin Tobias,

Thanks for moving on.

I attached a similar patch, this time against 0.80. Most issues of the patch are described in comment #12.
Comment 19 commit-hook freebsd_committer freebsd_triage 2020-07-05 15:57:43 UTC
A commit references this bug:

Author: tcberner
Date: Sun Jul  5 15:57:01 UTC 2020
New revision: 541286
URL: https://svnweb.freebsd.org/changeset/ports/541286

Log:
  astro/astrometry: switch maintainer and improve port a bit

  - Give maintainership to Rainer Hurling
  - New LIB_DEPENDS for math/gsl and astro/wcslib
  - Add USES=localbase
  - Change USE_LDCONFIG from path to 'yes'
  - Make man pages usable
  - Move bin, libs, data to standard places
  - Initial hints for automatic 'index' downloads
  - Adapt pkg-message
  - Update pkg-plist

  PR:		246007
  Submitted by:	Rainer Hurling <rhurlin@gwdg.de>

Changes:
  head/astro/astrometry/Makefile
  head/astro/astrometry/files/os-features-config.h
  head/astro/astrometry/files/pkg-message.in
  head/astro/astrometry/pkg-plist
Comment 20 Tobias C. Berner freebsd_committer freebsd_triage 2020-07-05 16:04:52 UTC
Finally committed -- sorry for taking so long with it :/