Re: Installing Python2.7 in 14-RELEASE

From: Odhiambo Washington <odhiambo_at_gmail.com>
Date: Tue, 14 May 2024 12:29:49 UTC
On Tue, May 14, 2024 at 3:01 PM Yasuhiro Kimura <yasu@freebsd.org> wrote:

> From: Odhiambo Washington <odhiambo@gmail.com>
> Subject: Re: Installing Python2.7 in 14-RELEASE
> Date: Tue, 14 May 2024 11:39:30 +0300
>
> > I am using openssl from the ports.
> > I checked the build log and saw:
> >
> > ```
> > #warning "Make sure new member of socket address initialized"
> >  ^
> > 1 warning generated.
> > warning: openssl 0x00000000 is too old for _hashlib
> > building dbm using ndbm
> >
> > Python build finished, but the necessary bits to build these modules
> were not found:
> > _bsddb             _hashlib           dl
> > imageop            linuxaudiodev      spwd
> > sunaudiodev
> > To find the necessary bits, look in setup.py in detect_modules() for the
> module's name.
> >
> > ===>  Staging for python27-2.7.18
> > ===>   python27-2.7.18 depends on file: /usr/local/lib/libcrypto.so.12 -
> found
> > ===>   Generating temporary packing list
> > install  -s -m 555 python
> /usr/ports/lang/python27/work/stage/usr/local/bin/python2.7
> > if test -f libpython2.7.so; then  if test -n "" ; then  install  -s -m
> 0644  /usr/ports/lang/python27/work/stage/usr/local/
> > bin;  else  install  -s -m 0644 libpython2.7.so
> /usr/ports/lang/python27/work/stage/usr/local/lib/libpython2.7.so.1;  if
> > test libpython2.7.so != libpython27.so.1; then  (cd
> /usr/ports/lang/python27/work/stage/usr/local/lib; ln -sf
> > libpython2.7.so.1 libpython2.7.so)  fi  fi;  else true;  fi
> > warning: openssl 0x00000000 is too old for _hashlib
> > ```
> > root@gw:/usr/ports/lang/python27 # /usr/local/bin/openssl version
> > OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
> > root@gw:/usr/ports/lang/python27 # ls -al  /usr/local/bin/openssl
> > -rwxr-xr-x  1 root wheel 828656 May 14 11:22 /usr/local/bin/openssl
> > root@gw:/usr/ports/lang/python27 # ls -al /usr/bin/openssl
> > -r-xr-xr-x  1 root wheel 970624 Nov 25 14:13 /usr/bin/openssl
> > root@gw: /usr/ports/lang/python27  # /usr/bin/openssl version
> > OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)
> >
> > I have DEFAULT_VERSIONS+=ssl=openssl
>
> Please try following patch.
>
> diff --git a/lang/python27/Makefile b/lang/python27/Makefile
> index 8aeab6d28008..245835f5be22 100644
> --- a/lang/python27/Makefile
> +++ b/lang/python27/Makefile
> @@ -120,7 +120,8 @@ post-patch:
>  # openssl/opensslv.h so setup.py just detects the string as 00000000
>  # However care should be taken for the OSVERSION. If OpenSSL 3.0.9
>  # lands later the OSVERSION string should be fixed accordingly
> -.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400092 && (${SSL_DEFAULT} ==
> base || ${SSL_DEFAULT:Mopenssl3*} )
> +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400092 && (${SSL_DEFAULT} ==
> base || \
> +       ${SSL_DEFAULT} == openssl || ${SSL_DEFAULT:Mopenssl3*} )
>         @${REINPLACE_CMD} -e 's|00907000|00000000|' \
>                 ${WRKSRC}/setup.py
>  .endif
>
> Regards.
>
> ---
> Yasuhiro Kimura


Thank you. I applied this patch, but the installation still fails somehow:

[snip]
running install_scripts
copying build/scripts-2.7/idle2.7 ->
/usr/ports/lang/python27/work/stage/usr/local/bin
copying build/scripts-2.7/pydoc2.7 ->
/usr/ports/lang/python27/work/stage/usr/local/bin
copying build/scripts-2.7/2to3-2.7 ->
/usr/ports/lang/python27/work/stage/usr/local/bin
changing mode of /usr/ports/lang/python27/work/stage/usr/local/bin/idle2.7
to 755
changing mode of /usr/ports/lang/python27/work/stage/usr/local/bin/pydoc2.7
to 755
changing mode of /usr/ports/lang/python27/work/stage/usr/local/bin/2to3-2.7
to 755
running install_egg_info
Writing
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/Python-2.7.18-py2.7.egg-info
rm
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/_sysconfigdata.py*
install  -m 0644 ./Misc/python.man
 /usr/ports/lang/python27/work/stage/usr/local/share/man/man1/python2.7.1
if test "xno" != "xno"  ; then  case no in  upgrade)
ensurepip="--altinstall --upgrade --no-default-pip" ;;  install|*)
ensurepip="--altinstall --no-default-pip" ;;  esac;
 LD_LIBRARY_PATH=/usr/ports/lang/python27/work/Python-2.7.18 ./python -E -m
ensurepip  $ensurepip --root=/usr/ports/lang/python27/work/stage/ ;  fi
for i in
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/*.so;
do  /usr/bin/strip $i; done                                              #
Strip shared extensions
install  -m 0644
/usr/ports/lang/python27/work/Python-2.7.18/Tools/gdb/libpython.py
 /usr/ports/lang/python27/work/stage/usr/local/lib/libpython2.7.so.1-gdb.py
====> Compressing man pages (compress-man)

*root@gw:/usr/ports/lang/python27 #  find work/stage -name
"_hashlib.so"work/stage/usr/local/lib/python2.7/lib-dynload/_hashlib.so*
root@gw:/usr/ports/lang/python27 # make install
===>  Installing for python27-2.7.18
===>  Checking if python27 is already installed
===>   Registering installation for python27-2.7.18
pkg-static: Unable to access file
/usr/ports/lang/python27/work/stage//lib/python2.7/lib-dynload/_hashlib.so:No
such file or directory

                               ^^^ why is it that usr/local is not showing
here?
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/python27
root@gw:/usr/ports/lang/python27 #


-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
 In an Internet failure case, the #1 suspect is a constant: DNS.
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]