pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/python27 fails to install on Fedora 29



On Mon, 25 Feb 2019, at 19:53:57 -0500, David J. Weller-Fahy wrote:
> Good point: I'd been thinking about automated fixes so the user never
> even notices, but chasing every single one of these would (I assume) be
> maddening and futile. However, since this is my itch, I think I'll
> scratch.
> 
>     At present, the nis option isn't meant to be user-settable, so changing
>     that would require reworking things into options.mk. Instead of (or in
>     addition to) that, a check could be added to look for the header files
>     that Python expects to find, and act accordingly. (The Python
>     configuration code itself looks for rpcsvc/yp_prot.h in the include
>     paths it's searching.) But, again, it may make more sense just to
>     document somewhere the specific extra distro packages that need to be
>     installed on Fedora to get some pkgsrc packages to build.
> 
> 
> It might, but I'm not sure of the proper location for such
> documentation. 

The bootstrap directory has various README.OS files in it, those
typically document considerations like this. (Though there's also
separate documentation found on the NetBSD Wiki too:
https://wiki.netbsd.org/pkgsrc/how_to_use_pkgsrc_on_linux/) Regardless
of what's done for this particular item, there might be ways to draw
more attention to this documentation.

> I did, however, have another thought - if the goal is to
> have it build with the options detected by python, then checking for
> that particular file in the existing include paths should be sufficient.
> In that case, something like the following should work:
> 
> - Check to see if the build is OPSYS=Linux, and OS_VARIANT=redhat
> 
> - If so, get include paths from output of the following command.
> 
> #v+
> cpp -v /dev/null -o /dev/null 2>&1 \
>    | sed '/^#include </,/^End of/{//!b};d'
> #v-
> 
>  On my system, that results in the following directories:
>  /usr/lib/gcc/x86_64-redhat-linux/8/include, /usr/local/include, and
>  /usr/include.
> 
> - Check for existence of rpcsvc/yp_prot.h in each (which, on my system,
>  would result in /usr/include/rpcsvc/yp_prot.h being detected.
> 
> So, something like the attached diff should be suitable. It works on my
> Fedora 29 system. When libnsl2-devel libtirpc-devel are installed
> PLIST.nis==yes, and when they are not PLIST.nis is undefined.
> 
> Let me know if you see any gotchas - especially in how I find the
> include paths. If you don't see anything horrible, then I'll submit a PR
> with the patch to fix installation on Fedora.
> 
> Regards,
>  -dave
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvsroot/pkgsrc/lang/python27/Makefile,v
> retrieving revision 1.75
> diff -u -p -r1.75 Makefile
> --- Makefile	28 Sep 2018 11:01:37 -0000	1.75
> +++ Makefile	26 Feb 2019 00:51:34 -0000
> @@ -114,6 +114,14 @@ PLIST.nis=	yes
>  PLIST.dll=	yes
>  .  if ${OPSYS} == "MirBSD" || "${OS_VARIANT}" == "chromeos"
>  # neither nis nor no-nis
> +.  elif ${OPSYS} == "Linux" && "${OS_VARIANT}" == "redhat"
> +includedirs!=	cpp -v /dev/null -o /dev/null 2>&1 | sed '/^\#include </,/^End of/{//!b};d'
> +.    for includedir in ${includedirs}
> +check_file:=	${includedir}/rpcsvc/yp_prot.h
> +.      if exists(${check_file})
> +PLIST.nis=	yes
> +.      endif
> +.    endfor
>  .  elif ${OPSYS} != "NetBSD" || exists(/usr/bin/ypcat)
>  PLIST.nis=	yes
>  .  else

I'm not one of the main pkgsrc pythonistas, so we'd need some consensus
from them on this. A PR is probably a good idea for this.

I don't feel it's necessary to confine the check to a particular
distro (or family of them). For any that use glibc, it's simply a
question of when they integrate the version that's made this change.
(And how, I suppose, as they might handle it differently than Fedora
did. I saw in one of the Python bug reports there seemed to be
uncertainty about this.)

Thanks for the work you've done on this,

Dave




Home | Main Index | Thread Index | Old Index