From: Ryan Carsten Schmidt Date: Fri, 26 Apr 2024 02:35:13 +0000 (+0000) Subject: install python modules to purelib and platlib X-Git-Tag: r0-52-25~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecd43ab512e7;p=thirdparty%2Fnewt.git install python modules to purelib and platlib 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. --- diff --git a/Makefile.in b/Makefile.in index 7534abe..1741ee7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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