Monday, August 05, 2019

Building Python 3.7 on Solaris 11.4 using solaris-userland

As we know Python 3.7 is not out for Oracle Solaris 11.4 yet, but could be out soon, so if you can't wait or you want the latest version then use the official Solaris userland source code to build it

I have blogged about this before so if you want more details see Building FFmpeg on Solaris 11.4 using solaris-userland but will start from scratch anyway, but with a little less detail.

$ echo $PATH  
/usr/bin:/usr/sbin:/opt/developerstudio12.6/bin:/usr/gnu/bin  
   
New Build$ mkdir /scratch  
New Build$ cd /scratch  
New Build$ git clone https://github.com/oracle/solaris-userland.git  
or  
Update Build$ cd /scrach/solaris-userland  
Update Build$ git pull 

Need to change a couple of settings (Your LOCAL REPO and COMPILER being used) 
$ gsed -i 's/^CANONICAL_REPO.*$/CANONICAL_REPO \?= http:\/\/pkg.oracle.com\/solaris\/release/' make-rules/ips-buildinfo.mk     
$ gsed -i 's/^INTERNAL_ARCHIVE_MIRROR/#INTERNAL_ARCHIVE_MIRROR/; s/^SPRO_VROOT.*$/SPRO_VROOT \?= \$(SPRO_ROOT)\/developerstudio12.6/' make-rules/shared-macros.mk
$ gmake setup  
$ cd components/python/python37  
$ gmake download  
   
If you are happy with the download version then you can build Python. 
If you want a different version then edit Makefile (i.e. COMPONENT_VERSION)
   
$ gmake install 
....long wait.....  

$ gmake publish

$ pkg info -r -g file:/scratch/solaris-userland/i386/repo python-37
          Name: runtime/python-37
       Summary: The Python interpreter, libraries and utilities
      Category: Development/Python
         State: Not installed
     Publisher: nightly
       Version: 3.7.4
        Branch: 11.5.0.0.0.52.0
Packaging Date: August  5, 2019 at  1:27:43 PM
          Size: 51.69 MB
          FMRI: pkg://nightly/runtime/python-37@3.7.4-11.5.0.0.0.52.0:20190805T132743Z
   Project URL: https://python.org/
    Source URL: https://python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz

$ pkg install -n -v -g file:/scratch/solaris-userland/i386/repo python-37
            Packages to update:         1
     Estimated space available: 233.73 GB
Estimated space to be consumed: 490.08 MB
       Create boot environment:        No
Create backup boot environment:       Yes
          Rebuild boot archive:        No

Changed packages:
nightly
  runtime/python-37
    3.7.1-11.5.0.0.0.44.0 -> 3.7.4-11.5.0.0.0.52.0

Formatting: I now use http://codeformatter.blogspot.co.uk for code formatting.

1 comment:

A. Freeman said...

I found your blog from searching for info on joining Solaris to an AD domain, specifically this post: http://notallmicrosoft.blogspot.com/2012/10/solaris-11-authentication-login-with.html

I think comments are closed on the article, but I was wondering if you could help me? I'm on omnios-r151030-521a1fc4d1

I notice you do a lot of compiling from source. Do you ever use Joyent's fork of NetBSD pkgsrc? https://pkgsrc.joyent.com/