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



* David H. Gutteridge <david%gutteridge.ca@localhost> [2019-02-25 01:56 -0500]:
After reading through all of these it seems like Fedora took the
positition that removing the options from the prebuilt packages was
the right thing to do. I also have been thinking about this from the
user's perspective, and thought adding an option might be the least
destructive option: something that would only take effect when
activated by the user, but would indicate to the package how to
handle nis (omit entirely or include per existing logic).

Do you think that would be a reasonable solution to this issue? It
doesn't solve the problem, but I'm not sure I know how to solve it in
an automated way.

Well, there's more than one way around the issue. One method (for
Fedora, anyway) is to install the libnsl2-devel and libtirpc-devel
packages. Then the build should succeed with the the pkgsrc make file
unaltered. One could argue this is a distro-specific "gotcha" that's no
different than some of the other similar considerations about needing
to install particular "devel" or "dev" distro packages of headers to
get packages to build. (Another random example that may confuse people
is that Fedora installs GCC by default, but only the C compiler, not
the C++ compiler.)

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. 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

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index