LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-21-2019, 10:52 PM   #1
brokenshakles
LQ Newbie
 
Registered: Dec 2009
Posts: 12

Rep: Reputation: 0
Difficulty compiling multilib packages that depend on python3.


As part of setting up wayland and xwayland, I'm trying to (re)compile atk and friends on a Slackware64-Multilib system. I've been doing well so far, but trying to get gobject-introspection to compile causes barfing on a python3 header: https://pastebin.com/z4TTVZYe

Anyone know how to get this dep working for a multilib compile?
 
Old 09-22-2019, 06:21 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
This needs to be fixed in the Slackware python3 package itself.
The pyconfig.h header file is not multilib-ready and it should be renamed based on whether you build a 32bit or a 64bit package. Then a wrapper pyconfig.h should be put in its place which includes the appropriate pyconfig header for the architecture.

I can not fix this in my multilib repository where I do nothing more but re-packaging the 32bit Slackware packages.
 
Old 09-22-2019, 09:23 AM   #3
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
fedora does like this in their python3.spec
Code:
[...]
# For multilib support, files that are different between 32- and 64-bit arches
# need different filenames. Use "64" or "32" according to the word size.
# Currently, the best way to determine an architecture's word size happens to
# be checking %%{_lib}.
%if "%{_lib}" == "lib64"
%global wordsize 64
%else
%global wordsize 32
%endif
[...]
# Multilib support for pyconfig.h
# 32- and 64-bit versions of pyconfig.h are different. For multilib support
# (making it possible to install 32- and 64-bit versions simultaneously),
# we need to install them under different filenames, and to make the common
# "pyconfig.h" include the right file based on architecture.
# See https://bugzilla.redhat.com/show_bug.cgi?id=192747
# Filanames are defined here:
%global _pyconfig32_h pyconfig-32.h
%global _pyconfig64_h pyconfig-64.h
%global _pyconfig_h pyconfig-%{wordsize}.h
[...]
# Make python3-devel multilib-ready
  mv %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h \
     %{buildroot}%{_includedir}/python${LDVersion}/%{_pyconfig_h}
  cat > %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h << EOF
#include <bits/wordsize.h>

#if __WORDSIZE == 32
#include "%{_pyconfig32_h}"
#elif __WORDSIZE == 64
#include "%{_pyconfig64_h}"
#else
#error "Unknown word size"
#endif
EOF
[...]
 
Old 09-22-2019, 10:11 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
You could check with Pat whether he is willing to add this multilib support to the python3 package.
It will however have a larger chance of success if you provide a patch which produces the desired result, so he does not have to do the research for you.
 
Old 09-22-2019, 10:58 AM   #5
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Here is a quick patch for Pat's python3 SlackBuild based on the fedora spec file above, but I am not sure how to test the original issue. I am also not sure its correct for s390, arm or armel, but I have no way of testing those.

Code:
--- python3.SlackBuild.orig	2019-09-22 08:35:06.042816493 -0700
+++ python3.SlackBuild	2019-09-22 08:54:14.603323876 -0700
@@ -132,6 +132,23 @@
 # Fix permissions on dynamic libraries.
 find $PKG -type f -perm 555 -exec chmod 755 '{}' \;
 
+# Multilib support
+mv $PKG/usr/include/python${BRANCH_VERSION}m/pyconfig.h \
+  $PKG/usr/include/python${BRANCH_VERSION}m/pyconfig-${LIBDIRSUFFIX:-32}.h ||
+  exit 1
+
+cat > $PKG/usr/include/python${BRANCH_VERSION}m/pyconfig.h << EOF
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "pyconfig-32.h"
+#elif __WORDSIZE == 64
+#include "pyconfig-64.h"
+#else
+#error "Unknown word size"
+#endif
+EOF
+
 # Install docs.
 mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
 cp -a README.rst LICENSE Misc $PKG/usr/doc/$PKGNAM-$VERSION
 
Old 09-22-2019, 03:47 PM   #6
brokenshakles
LQ Newbie
 
Registered: Dec 2009
Posts: 12

Original Poster
Rep: Reputation: 0
O.O Thanks guys! I'm still working on trying to run Wayland/Enlightenment, running into other issues, but it's great to see that I have something to go on now, I will definitely apply the patch to the SlackBuild.
 
Old 09-22-2019, 04:38 PM   #7
brokenshakles
LQ Newbie
 
Registered: Dec 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Alien Bob View Post
This needs to be fixed in the Slackware python3 package itself.
The pyconfig.h header file is not multilib-ready and it should be renamed based on whether you build a 32bit or a 64bit package. Then a wrapper pyconfig.h should be put in its place which includes the appropriate pyconfig header for the architecture.

I can not fix this in my multilib repository where I do nothing more but re-packaging the 32bit Slackware packages.

Does convertpkg-compat32 strip header files from the package? I think this may be an issue for python3-compat32, since with the above patch we are expecting a pyconfig-32.h file in the package, and I'm not seeing it after running the package thru convertpkg-compat32.
 
Old 09-22-2019, 05:13 PM   #8
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by brokenshakles View Post
Does convertpkg-compat32 strip header files from the package? I think this may be an issue for python3-compat32, since with the above patch we are expecting a pyconfig-32.h file in the package, and I'm not seeing it after running the package thru convertpkg-compat32.
I think the convertpkg-compat32 script needs an exception for cases like this, I haven't tested this, but I think it should change this section.

Code:
# Stuff we need to keep, we move into KDEP/ and move it back later:
mkdir KEEP
if [ "$PKGNAM" = "mesa" ];
then
  cp -a --parents usr/share/vulkan/icd.d KEEP/
fi
To something like this.

Code:
# Stuff we need to keep, we move into KDEP/ and move it back later:
mkdir KEEP
if [ "$PKGNAM" = "mesa" ];
then
  cp -a --parents usr/share/vulkan/icd.d KEEP/
elif [ "$PKGNAM" = "python3" ];
then
  cp -a --parents usr/include/python*m/pyconfig-*.h KEEP/
fi
Or you could always add the file directory to the package directory and run makepkg manually just to test it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python3 -V returns Python 2.7.12, can't get python3 to work. gene_ Ubuntu 15 03-18-2019 10:39 AM
[SOLVED] making python3.6.4 default python3 Astral Axiom Linux - Newbie 17 04-14-2018 10:55 AM
[SOLVED] how to start python3.6 interpreter just by typing python in terminal not python3.6 bmohanraj91 Linux - Newbie 4 05-10-2017 07:51 AM
After upgrade python3.4 to python3.5.1 , not able to install packages "request" though pip3 YOGESHAS87 Linux - Software 1 08-03-2016 10:38 PM
How do I get list of which packages one rpm depend on? nadavvin Linux - General 10 01-04-2007 04:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration