Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 May 2024 15:29:49 +0300
From:      Odhiambo Washington <odhiambo@gmail.com>
To:        questions@freebsd.org
Subject:   Re: Installing Python2.7 in 14-RELEASE
Message-ID:  <CAAdA2WPsuJ=swrt%2B5DJ5UyGeR=gCGpofuybGc3RVTP4S8wxMrg@mail.gmail.com>
In-Reply-To: <20240514.210052.2236519631855646969.yasu@FreeBSD.org>
References:  <CAAdA2WPxWhD0CeNJ7e6kutTSXMkzYuFTWT_gWrsY39Da9uCjug@mail.gmail.com> <87r0e57t3l.wl-herbert@gojira.at> <CAAdA2WNbzX00nzKQAHU23GwG%2BAuboivy9b-_eRNa=ka_J2yGTg@mail.gmail.com> <20240514.210052.2236519631855646969.yasu@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000099e5720618692a75
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, May 14, 2024 at 3:01=E2=80=AFPM 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 th=
e
> module's name.
> >
> > =3D=3D=3D>  Staging for python27-2.7.18
> > =3D=3D=3D>   python27-2.7.18 depends on file: /usr/local/lib/libcrypto.=
so.12 -
> found
> > =3D=3D=3D>   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 !=3D 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+=3Dssl=3Dopenssl
>
> 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} =3D=3D FreeBSD && ${OSVERSION} >=3D 1400092 && (${SSL_DEFAU=
LT} =3D=3D
> base || ${SSL_DEFAULT:Mopenssl3*} )
> +.if ${OPSYS} =3D=3D FreeBSD && ${OSVERSION} >=3D 1400092 && (${SSL_DEFAU=
LT} =3D=3D
> base || \
> +       ${SSL_DEFAULT} =3D=3D 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/Pyt=
hon-2.7.18-py2.7.egg-info
rm
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/_sy=
sconfigdata.py*
install  -m 0644 ./Misc/python.man
 /usr/ports/lang/python27/work/stage/usr/local/share/man/man1/python2.7.1
if test "xno" !=3D "xno"  ; then  case no in  upgrade)
ensurepip=3D"--altinstall --upgrade --no-default-pip" ;;  install|*)
ensurepip=3D"--altinstall --no-default-pip" ;;  esac;
 LD_LIBRARY_PATH=3D/usr/ports/lang/python27/work/Python-2.7.18 ./python -E =
-m
ensurepip  $ensurepip --root=3D/usr/ports/lang/python27/work/stage/ ;  fi
for i in
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dynload/*.s=
o;
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
=3D=3D=3D=3D> 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
=3D=3D=3D>  Installing for python27-2.7.18
=3D=3D=3D>  Checking if python27 is already installed
=3D=3D=3D>   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 #


--=20
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 '^$|^.*#' =C2=AF\_(=E3=83=84)_/=C2=AF :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]

--00000000000099e5720618692a75
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, May 14, 2024 at 3:01=E2=80=AF=
PM Yasuhiro Kimura &lt;<a href=3D"mailto:yasu@freebsd.org">yasu@freebsd.org=
</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
From: Odhiambo Washington &lt;<a href=3D"mailto:odhiambo@gmail.com" target=
=3D"_blank">odhiambo@gmail.com</a>&gt;<br>
Subject: Re: Installing Python2.7 in 14-RELEASE<br>
Date: Tue, 14 May 2024 11:39:30 +0300<br>
<br>
&gt; I am using openssl from the ports.<br>
&gt; I checked the build log and saw:<br>
&gt; <br>
&gt; ```<br>
&gt; #warning &quot;Make sure new member of socket address initialized&quot=
;<br>
&gt; =C2=A0^<br>
&gt; 1 warning generated.<br>
&gt; warning: openssl 0x00000000 is too old for _hashlib<br>
&gt; building dbm using ndbm<br>
&gt; <br>
&gt; Python build finished, but the necessary bits to build these modules w=
ere not found:<br>
&gt; _bsddb =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 _hashlib =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 dl<br>
&gt; imageop =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0linuxaudiodev =C2=A0 =
=C2=A0 =C2=A0spwd<br>
&gt; sunaudiodev<br>
&gt; To find the necessary bits, look in setup.py in detect_modules() for t=
he module&#39;s name.<br>
&gt; <br>
&gt; =3D=3D=3D&gt; =C2=A0Staging for python27-2.7.18<br>
&gt; =3D=3D=3D&gt; =C2=A0 python27-2.7.18 depends on file: /usr/local/lib/l=
ibcrypto.so.12 - found<br>
&gt; =3D=3D=3D&gt; =C2=A0 Generating temporary packing list<br>
&gt; install =C2=A0-s -m 555 python /usr/ports/lang/python27/work/stage/usr=
/local/bin/python2.7<br>
&gt; if test -f <a href=3D"http://libpython2.7.so" rel=3D"noreferrer" targe=
t=3D"_blank">libpython2.7.so</a>; then =C2=A0if test -n &quot;&quot; ; then=
 =C2=A0install =C2=A0-s -m 0644 =C2=A0/usr/ports/lang/python27/work/stage/u=
sr/local/<br>
&gt; bin; =C2=A0else =C2=A0install =C2=A0-s -m 0644 <a href=3D"http://libpy=
thon2.7.so" rel=3D"noreferrer" target=3D"_blank">libpython2.7.so</a> /usr/p=
orts/lang/python27/work/stage/usr/local/lib/libpython2.7.so.1; =C2=A0if<br>
&gt; test <a href=3D"http://libpython2.7.so" rel=3D"noreferrer" target=3D"_=
blank">libpython2.7.so</a> !=3D libpython27.so.1; then =C2=A0(cd /usr/ports=
/lang/python27/work/stage/usr/local/lib; ln -sf<br>
&gt; libpython2.7.so.1 <a href=3D"http://libpython2.7.so" rel=3D"noreferrer=
" target=3D"_blank">libpython2.7.so</a>) =C2=A0fi =C2=A0fi; =C2=A0else true=
; =C2=A0fi<br>
&gt; warning: openssl 0x00000000 is too old for _hashlib<br>
&gt; ```<br>
&gt; root@gw:/usr/ports/lang/python27 # /usr/local/bin/openssl version<br>
&gt; OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)<br>
&gt; root@gw:/usr/ports/lang/python27 # ls -al =C2=A0/usr/local/bin/openssl=
<br>
&gt; -rwxr-xr-x =C2=A01 root wheel 828656 May 14 11:22 /usr/local/bin/opens=
sl<br>
&gt; root@gw:/usr/ports/lang/python27 # ls -al /usr/bin/openssl<br>
&gt; -r-xr-xr-x =C2=A01 root wheel 970624 Nov 25 14:13 /usr/bin/openssl<br>
&gt; root@gw: /usr/ports/lang/python27=C2=A0 # /usr/bin/openssl version<br>
&gt; OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)<br>
&gt; <br>
&gt; I have DEFAULT_VERSIONS+=3Dssl=3Dopenssl<br>
<br>
Please try following patch.<br>
<br>
diff --git a/lang/python27/Makefile b/lang/python27/Makefile<br>
index 8aeab6d28008..245835f5be22 100644<br>
--- a/lang/python27/Makefile<br>
+++ b/lang/python27/Makefile<br>
@@ -120,7 +120,8 @@ post-patch:<br>
=C2=A0# openssl/opensslv.h so setup.py just detects the string as 00000000<=
br>
=C2=A0# However care should be taken for the OSVERSION. If OpenSSL 3.0.9<br=
>
=C2=A0# lands later the OSVERSION string should be fixed accordingly<br>
-.if ${OPSYS} =3D=3D FreeBSD &amp;&amp; ${OSVERSION} &gt;=3D 1400092 &amp;&=
amp; (${SSL_DEFAULT} =3D=3D base || ${SSL_DEFAULT:Mopenssl3*} )<br>
+.if ${OPSYS} =3D=3D FreeBSD &amp;&amp; ${OSVERSION} &gt;=3D 1400092 &amp;&=
amp; (${SSL_DEFAULT} =3D=3D base || \<br>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0${SSL_DEFAULT} =3D=3D openssl || ${SSL_DEFAULT:=
Mopenssl3*} )<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @${REINPLACE_CMD} -e &#39;s|00907000|00000000|&=
#39; \<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${WRKSRC}/setup.py<=
br>
=C2=A0.endif<br>
<br>
Regards.<br>
<br>
---<br>
Yasuhiro Kimura</blockquote><div></div></div><br>Thank you. I applied this =
patch, but the installation still fails somehow:<div><br></div><div>[snip]<=
/div><div>running install_scripts<br>copying build/scripts-2.7/idle2.7 -&gt=
; /usr/ports/lang/python27/work/stage/usr/local/bin<br>copying build/script=
s-2.7/pydoc2.7 -&gt; /usr/ports/lang/python27/work/stage/usr/local/bin<br>c=
opying build/scripts-2.7/2to3-2.7 -&gt; /usr/ports/lang/python27/work/stage=
/usr/local/bin<br>changing mode of /usr/ports/lang/python27/work/stage/usr/=
local/bin/idle2.7 to 755<br>changing mode of /usr/ports/lang/python27/work/=
stage/usr/local/bin/pydoc2.7 to 755<br>changing mode of /usr/ports/lang/pyt=
hon27/work/stage/usr/local/bin/2to3-2.7 to 755<br>running install_egg_info<=
br>Writing /usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-=
dynload/Python-2.7.18-py2.7.egg-info<br>rm /usr/ports/lang/python27/work/st=
age/usr/local/lib/python2.7/lib-dynload/_sysconfigdata.py*<br>install =C2=
=A0-m 0644 ./Misc/python.man =C2=A0/usr/ports/lang/python27/work/stage/usr/=
local/share/man/man1/python2.7.1<br>if test &quot;xno&quot; !=3D &quot;xno&=
quot; =C2=A0; then =C2=A0case no in =C2=A0upgrade) ensurepip=3D&quot;--alti=
nstall --upgrade --no-default-pip&quot; ;; =C2=A0install|*) ensurepip=3D&qu=
ot;--altinstall --no-default-pip&quot; ;; =C2=A0esac; =C2=A0LD_LIBRARY_PATH=
=3D/usr/ports/lang/python27/work/Python-2.7.18 ./python -E -m ensurepip =C2=
=A0$ensurepip --root=3D/usr/ports/lang/python27/work/stage/ ; =C2=A0fi<br>f=
or i in /usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/lib-dyn=
load/*.so; do =C2=A0/usr/bin/strip $i; done =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Strip shared exten=
sions<br>install =C2=A0-m 0644 /usr/ports/lang/python27/work/Python-2.7.18/=
Tools/gdb/libpython.py =C2=A0/usr/ports/lang/python27/work/stage/usr/local/=
lib/<a href=3D"http://libpython2.7.so.1-gdb.py">libpython2.7.so.1-gdb.py</a=
><br>=3D=3D=3D=3D&gt; Compressing man pages (compress-man)<br><b>root@gw:/u=
sr/ports/lang/python27 # =C2=A0find work/stage -name &quot;_hashlib.so&quot=
;<br>work/stage/usr/local/lib/python2.7/lib-dynload/_hashlib.so</b><br>root=
@gw:/usr/ports/lang/python27 # make install<br>=3D=3D=3D&gt; =C2=A0Installi=
ng for python27-2.7.18<br>=3D=3D=3D&gt; =C2=A0Checking if python27 is alrea=
dy installed<br>=3D=3D=3D&gt; =C2=A0 Registering installation for python27-=
2.7.18<br>pkg-static: Unable to access file /usr/ports/lang/python27/work/s=
tage//lib/python2.7/lib-dynload/_hashlib.so:No such file or directory</div>=
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0^^^ why is it that usr/local is not showing here?<br>*** Error=
 code 1<br><br>Stop.<br>make: stopped in /usr/ports/lang/python27<br>root@g=
w:/usr/ports/lang/python27 #</div><div><br clear=3D"all"><div><br></div><sp=
an class=3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" class=3D=
"gmail_signature"><div dir=3D"ltr"><div dir=3D"ltr"><div>Best regards,<br>O=
dhiambo WASHINGTON,<br>Nairobi,KE<br>+254 7 3200 0004/+254 7 2274 3223</div=
><div><span style=3D"color:rgb(34,34,34)">=C2=A0In=C2=A0</span><span style=
=3D"color:rgb(34,34,34)">an Internet failure case, the #1 suspect is a cons=
tant: DNS.</span><br>&quot;<span style=3D"font-size:12.8px">Oh, the cruft.<=
/span><span style=3D"font-size:12.8px">&quot;,=C2=A0</span><span style=3D"f=
ont-size:12.8px">egrep -v &#39;^$|^.*#&#39;=C2=A0</span><span style=3D"back=
ground-color:rgb(34,34,34);color:rgb(238,238,238);font-family:&quot;Lucida =
Console&quot;,Consolas,&quot;Courier New&quot;,monospace;font-size:13.6px">=
=C2=AF\_(=E3=83=84)_/=C2=AF</span><span style=3D"font-size:12.8px">=C2=A0:-=
)</span></div><div><span style=3D"font-size:12.8px">[How to ask smart quest=
ions:=C2=A0</span><span style=3D"font-size:12.8px"><a href=3D"http://www.ca=
tb.org/~esr/faqs/smart-questions.html" target=3D"_blank">http://www.catb.or=
g/~esr/faqs/smart-questions.html</a>]</span></div></div></div></div></div><=
/div>

--00000000000099e5720618692a75--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAdA2WPsuJ=swrt%2B5DJ5UyGeR=gCGpofuybGc3RVTP4S8wxMrg>