]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
install python modules to purelib and platlib
authorRyan Carsten Schmidt <git@ryandesign.com>
Fri, 26 Apr 2024 02:35:13 +0000 (02:35 +0000)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 6 May 2024 09:12:25 +0000 (11:12 +0200)
Don't assume that python modules go into $(libdir)/$$ver/site-packages;
get the correct values by asking sysconfig for its platlib and purelib.
This requires python 2.7 or later or python 3.2 or later.

Makefile.in

index 7534abe30e90f0c898c420868f5e39a106f53c25..1741ee757359d7d365fb142a239276ffed310b0e 100644 (file)
@@ -161,10 +161,15 @@ endif
 
 install-py: _snack.$(SOEXT)
 ifneq ($(PYTHONVERS),)
-       for ver in $(PYTHONVERS); do \
-          [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\
-          install -m 755 $$ver/_snack.$(SOEXT) $(instroot)/$(libdir)/$$ver/site-packages ;\
-          install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
+       @for ver in $(PYTHONVERS); do \
+               PLATLIB=`$$ver -c "import sysconfig; print(sysconfig.get_path('platlib'))"`; \
+               PURELIB=`$$ver -c "import sysconfig; print(sysconfig.get_path('purelib'))"`; \
+               [ -d $(instroot)/$$PLATLIB ] || install -m 755 -d $(instroot)/$$PLATLIB ;\
+               [ -d $(instroot)/$$PURELIB ] || install -m 755 -d $(instroot)/$$PURELIB ;\
+               echo install -m 755 $$ver/_snack.$(SOEXT) $(instroot)/$$PLATLIB;\
+               install -m 755 $$ver/_snack.$(SOEXT) $(instroot)/$$PLATLIB;\
+               echo install -m 644 snack.py $(instroot)/$$PURELIB;\
+               install -m 644 snack.py $(instroot)/$$PURELIB;\
        done
 endif