python3 -> 3.11.1 (#7734)

* python3 -> 3.11.1

* update binaries

* add pip updating in postinstall

* remove awk
This commit is contained in:
Satadru Pramanik
2022-12-14 11:17:57 -05:00
committed by GitHub
parent 29cc2961dd
commit 43f578fa17

View File

@@ -3,24 +3,24 @@ require 'package'
class Python3 < Package
description 'Python is a programming language that lets you work quickly and integrate systems more effectively.'
homepage 'https://www.python.org/'
@_ver = '3.11.0'
@_ver = '3.11.1'
version @_ver
license 'PSF-2.0'
compatibility 'all'
source_url "https://www.python.org/ftp/python/#{@_ver}/Python-#{@_ver}.tar.xz"
source_sha256 'a57dc82d77358617ba65b9841cee1e3b441f386c3789ddc0676eca077f2951c3'
source_sha256 '85879192f2cffd56cb16c092905949ebf3e5e394b7f764723529637901dfb58f'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.0_armv7l/python3-3.11.0-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.0_armv7l/python3-3.11.0-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.0_i686/python3-3.11.0-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.0_x86_64/python3-3.11.0-chromeos-x86_64.tar.zst'
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.1_armv7l/python3-3.11.1-chromeos-armv7l.tar.zst',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.1_armv7l/python3-3.11.1-chromeos-armv7l.tar.zst',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.1_i686/python3-3.11.1-chromeos-i686.tar.zst',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.11.1_x86_64/python3-3.11.1-chromeos-x86_64.tar.zst'
})
binary_sha256({
aarch64: '45af8d33fe7d419c83a1cb829e318cc97f6de6a78d522845f52829ee9642ea41',
armv7l: '45af8d33fe7d419c83a1cb829e318cc97f6de6a78d522845f52829ee9642ea41',
i686: '2d07bfb72df0a579b0854c02ba1d9a32264ad2e149e4a0f5a1b26622010cb2b7',
x86_64: '87cab9510346a3061cab055f6b071931ff79f5479c75d7875530a124e9004ede'
aarch64: '7a85f7ac7fa1cb5f1521ac4e14a82f6ac58d90b560f3b47b3b383e42917c00b4',
armv7l: '7a85f7ac7fa1cb5f1521ac4e14a82f6ac58d90b560f3b47b3b383e42917c00b4',
i686: '23e9f83a36a1e5fcecefcb6fb6b34be4e21a602272fe33482a9baace22ed9a69',
x86_64: 'e11b219c4a8d43a7af5cac2444aa4cb627452480e9fbf3e26d07654dddccc938'
})
depends_on 'autoconf_archive' => :build
@@ -85,20 +85,22 @@ class Python3 < Package
# test_urllib, test_urllib2, test_urllib2_localnet.
# So, modifying environment variable to make pass tests.
FileUtils.mkdir_p 'builddir'
Dir.chdir 'builddir' do
system CREW_ENV_OPTIONS_HASH.transform_values { |v| "#{v} #{@cppflags}" }, "../configure #{CREW_OPTIONS} \
--with-computed-gotos \
--enable-loadable-sqlite-extensions \
--with-ensurepip \
--enable-optimizations \
--with-platlibdir='lib#{CREW_LIB_SUFFIX}' \
--with-system-ffi \
--with-system-expat \
--with-system-libmpdec \
--with-libc= \
--enable-shared"
system 'mold -run make'
unless Dir.exist?('builddir')
FileUtils.mkdir_p 'builddir'
Dir.chdir 'builddir' do
system CREW_ENV_OPTIONS_HASH.transform_values { |v| "#{v} #{@cppflags}" }, "../configure #{CREW_OPTIONS} \
--with-computed-gotos \
--enable-loadable-sqlite-extensions \
--with-ensurepip \
--enable-optimizations \
--with-platlibdir='lib#{CREW_LIB_SUFFIX}' \
--with-system-ffi \
--with-system-expat \
--with-system-libmpdec \
--with-libc= \
--enable-shared"
system 'mold -run make'
end
end
end
@@ -130,13 +132,20 @@ class Python3 < Package
def self.install
Dir.chdir 'builddir' do
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
system "#{CREW_DEST_PREFIX}/bin/python3 -m ensurepip --upgrade --default-pip"
system "sed -i 's,#{CREW_DEST_PREFIX}/bin/python3,#{CREW_PREFIX}/bin/python3,g' #{CREW_DEST_PREFIX}/bin/pip3"
end
# Make python3 the default python
FileUtils.ln_sf 'python3', "#{CREW_DEST_PREFIX}/bin/python"
FileUtils.ln_sf 'pip3', "#{CREW_DEST_PREFIX}/bin/pip"
end
def self.postinstall
system 'pip3 install --upgrade pip'
puts 'Updating pip packages...'.lightblue
@piplist = `pip list | cut -d' ' -f1`.split
@piplist.drop(2).each do |pip_pkg|
system "pip install #{pip_pkg} -U", exception: false
end
end
end