Files
chromebrew/packages/python3.rb
Cassandra Watergate 30d028499d libffi => 3.4.2 & python3 => 3.10.1, and all downstream packages requiring updates (#6295)
* python3.10ize mypaint

* python3.10ize oci_cli

* python3.10ize py3_agate

* python3.10ize py3_agate_dfb

* python3.10ize py3_agate_excel

* python3.10ize py3_agate_sql

* python3.10ize py3_alabaster

* python3.10ize py3_appdirs

* python3.10ize py3_argcomplete

* python3.10ize py3_arrow

* python3.10ize py3_attrs

* python3.10ize py3_babel

* python3.10ize py3_beautifulsoup4

* python3.10ize py3_certifi

* python3.10ize py3_cffi

* python3.10ize py3_chardet

* python3.10ize py3_click

* python3.10ize py3_colorama

* python3.10ize py3_configparser

* python3.10ize py3_cryptography

* python3.10ize py3_cssselect

* python3.10ize py3_cython

* python3.10ize py3_dateutil

* python3.10ize py3_dbfread

* python3.10ize py3_decorator

* python3.10ize py3_dicttoxml

* python3.10ize py3_distlib

* python3.10ize py3_dnspython

* python3.10ize py3_docutils

* python3.10ize py3_docx2txt

* python3.10ize py3_ebooklib

* python3.10ize py3_et_xmlfile

* python3.10ize py3_extract_msg

* python3.10ize py3_fasteners

* python3.10ize py3_filelock

* python3.10ize py3_flask

* python3.10ize py3_future

* python3.10ize py3_greenlet

* python3.10ize py3_idna

* python3.10ize py3_imagesize

* python3.10ize py3_imapclient

* python3.10ize py3_impacket

* python3.10ize py3_importlib_metadata

* python3.10ize py3_iniconfig

* python3.10ize py3_isodate

* python3.10ize py3_itsdangerous

* python3.10ize py3_jeepney

* python3.10ize py3_jinja2

* python3.10ize py3_jmespath

* python3.10ize py3_json2xml

* python3.10ize py3_keyring

* python3.10ize py3_ldap3

* python3.10ize py3_ldapdomaindump

* python3.10ize py3_leather

* python3.10ize py3_libevdev

* python3.10ize py3_libxml2

* python3.10ize py3_lxml

* python3.10ize py3_magic

* python3.10ize py3_mako

* python3.10ize py3_markdown

* python3.10ize py3_markupsafe

* python3.10ize py3_minidb

* python3.10ize py3_nuitka

* python3.10ize py3_numpy

* python3.10ize py3_oci

* python3.10ize py3_olefile

* python3.10ize py3_openpyxl

* python3.10ize py3_parsedatetime

* python3.10ize py3_pathspec

* python3.10ize py3_pdfminer_six

* python3.10ize py3_pillow

* python3.10ize py3_pipdeptree

* python3.10ize py3_pluggy

* python3.10ize py3_ply

* python3.10ize py3_pptx

* python3.10ize py3_psutil

* python3.10ize py3_py

* python3.10ize py3_pyasn1

* python3.10ize py3_pycairo

* python3.10ize py3_pycryptodome

* python3.10ize py3_pycryptodomex

* python3.10ize py3_pyelftools

* python3.10ize py3_pygments

* python3.10ize py3_pyicu

* python3.10ize py3_pyopenssl

* python3.10ize py3_pyparsing

* python3.10ize py3_pystemmer

* python3.10ize py3_pyte

* python3.10ize py3_pytest

* python3.10ize py3_pytimeparse

* python3.10ize py3_pytz

* python3.10ize py3_pyudev

* python3.10ize py3_pyyaml

* python3.10ize py3_requests

* python3.10ize py3_retrying

* python3.10ize py3_secretstorage

* python3.10ize py3_semantic_version

* python3.10ize py3_setuptools

* python3.10ize py3_setuptools_rust

* python3.10ize py3_six

* python3.10ize py3_slugify

* python3.10ize py3_smartypants

* python3.10ize py3_snowballstemmer

* python3.10ize py3_sortedcontainers

* python3.10ize py3_speechrecognition

* python3.10ize py3_sphinxcontrib_applehelp

* python3.10ize py3_sphinxcontrib_devhelp

* python3.10ize py3_sphinxcontrib_htmlhelp

* python3.10ize py3_sphinxcontrib_jsmath

* python3.10ize py3_sphinxcontrib_qthelp

* python3.10ize py3_sphinxcontrib_serializinghtml

* python3.10ize py3_sqlalchemy

* python3.10ize py3_terminaltables

* python3.10ize py3_text_unidecode

* python3.10ize py3_toml

* python3.10ize py3_tox

* python3.10ize py3_typogrify

* python3.10ize py3_tzlocal

* python3.10ize py3_urllib3

* python3.10ize py3_urwid

* python3.10ize py3_virtualenv

* python3.10ize py3_wcwidth

* python3.10ize py3_werkzeug

* python3.10ize py3_wheel

* python3.10ize py3_xlrd

* python3.10ize py3_xlsxwriter

* python3.10ize py3_xmltodict

* python3.10ize py3_yamllint

* python3.10ize py3_zipp

* python3.10ize pygobject

* python3.10ize s3cmd

* python3.10ize speedtest_cli

* python3.10ize sphinx

* python3.10ize sshuttle

* python3.10ize textract

* python3.10ize thefuck

* python3.10ize urlwatch

* python3.10ize xcb_proto

* python3.10ize youtube_dl

* python3.10ize youtubedl

* Add initial x86_64 packages

* Add armv7l binaries

* fix duplicity version

* add x86_64 and armv7l binaries

* Add x86_64 llvm builds (note stage1 is needed to build main package).

* cairo libffi rebuild

* Add pygobject and wayland binary with version bump

* Add py3_libxml2

* add cairo builds

* add more binaries

* Add armv7l llvm_stage1 binaries

* llvm binaries for armv7l

* add more binaries

* add more libffi-ed x86_64 binaries

* Add more binaries

* add gjs

* add more armv7l builds

* add gnome libffi deps

* Add armv7l binaries

* update binaries for libffi, itstool, py3_pygments

* i686 test

* add more i686 binaries

* add llvm i686 patch

* Add i686 llvm binaries

* more i686 builds

* add more i686 builds

* add more i686 builds

* more i686

* Add i686 tesseract

* fix llvm for i686

* Add i686 ffmpeg

* replace i686 binary for glib

* add more gnutls builds

* Add armv7l gnutls

* add binaries

* Add meson 0.60.0

* Add i686 binary for gsettings_desktop_schemas

* Fix youtube_dl version number

* initial add of openmp (removed from llvm)

* fix openmp package

* update llvm and openmp

* mpv -> 0.34.0

* glib -> 2.70.1

* meson -> 0.60.1

* Update llvm for x86, armv7l building...

* Add new armv7l llvm build

* Add new i686 llvm build

* i686 llvm_stage1 rebuild

* vulkan -> 1.2.200

* add vulkan binaries

* glib -> 2.70.2

* pre-rebuild of wireshark which depends upon libffi

* add mesa and vulkan updates

* libcurl -> 7.80.0

* update binaries for c_ares libmaxminddb

* update libdrm

* update llvm, add new binaries for wireshark, libdrm

* add more fixed i686 binaries

* add llvm x86_64 binary

* update gtk4, add llvm build for i686

* rebuilds and i686 additions

* more i686 builds

* update cairo and add i686 build

* update libx11

* add llvm armv7l binary

* update mesa i686 binaey

* more i686 rebuilds

* update xorg_server builds

* update glib

* add glib dep to wireshark

* add i686 binary for libxcvt

* updates to remove iconv dep

* update ffmpeg

* add x86_64 rebuilds

* working ffmpeg 4.4.1

* add armv7l builds

* Add python abimap (needed by libssh)

* add binaries for py3_abimap

* add libx11 binaries

* add new builds

* add builds

* add i686 binaries

* add numpy armv7l binaries

* Add mypaint binaries

* use cmake for c_ares

* update xorg_cf_files

* fix curl for i686

* add libxcb binaries

* add armv7l oci_cli binaries

* add asciinema binaries

* add mutter comment about compat

* add mpv binary

* add armv7l binary

* Add more binaries

* add binaries for youtube_dl

* add note about gsd compatibility

* update xcb packages with armv7l binaries

* update packages, python -> 3.10.1

* Add explanation to curl postinstall

Co-authored-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Satadru Pramanik <satadru@umich.edu>
2021-12-09 08:32:59 -06:00

146 lines
5.9 KiB
Ruby

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.10.1'
version @_ver
license 'PSF-2.0'
compatibility 'all'
source_url "https://www.python.org/ftp/python/#{@_ver}/Python-#{@_ver}.tar.xz"
source_sha256 'a7f1265b6e1a5de1ec5c3ec7019ab53413469934758311e9d240c46e5ae6e177'
binary_url({
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.10.1_armv7l/python3-3.10.1-chromeos-armv7l.tpxz',
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.10.1_armv7l/python3-3.10.1-chromeos-armv7l.tpxz',
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.10.1_i686/python3-3.10.1-chromeos-i686.tpxz',
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/python3/3.10.1_x86_64/python3-3.10.1-chromeos-x86_64.tpxz'
})
binary_sha256({
aarch64: '1d9b9ddff46e783c73b1d4e7efb4962863fb6530ba0f5177882e933349491672',
armv7l: '1d9b9ddff46e783c73b1d4e7efb4962863fb6530ba0f5177882e933349491672',
i686: 'e713a032139323ecf1b69ef28dba4ce5504fb589abd5ee0abddee6bb3a0c54db',
x86_64: 'abc558170fc98b73d41c15b2fd36fc595a32479fa4a73ab9ffacfe34fa350b95'
})
depends_on 'autoconf_archive' => :build
depends_on 'krb5' => :build
depends_on 'libtirpc' => :build
depends_on 'bz2' # R
depends_on 'expat' # R
depends_on 'gdbm' # R
depends_on 'glibc' # R
depends_on 'libdb' # R
depends_on 'libffi' # R
depends_on 'ncurses' # R
depends_on 'openssl' # R
depends_on 'readline' # R
depends_on 'sqlite' # R
depends_on 'xzutils' # R
depends_on 'zlibpkg' # R
# depends_on 'tcl' # Needed for tkinter support
# depends_on 'tk' # Needed for tkinter support
def self.patch
system "sed -i -e 's:#{CREW_LIB_PREFIX}:\$(get_libdir):g' \
Lib/distutils/command/install.py \
Lib/distutils/sysconfig.py \
Lib/site.py \
Lib/sysconfig.py \
Lib/test/test_site.py \
Makefile.pre.in \
Modules/getpath.c \
setup.py"
end
def self.prebuild
# Ensure that internal copies of expat, libffi and zlib aren't used
FileUtils.rm_rf 'Modules/expat'
FileUtils.rm_rf Dir.glob('Modules/_ctypes/libffi*')
FileUtils.rm_rf 'Modules/zlib'
end
def self.build
@cppflags = "-I#{CREW_PREFIX}/include/ncursesw"
# python requires /usr/local/lib, so leave as is but specify -rpath
@ldflags = "-Wl,-rpath,-L#{CREW_LIB_PREFIX}"
# CREW_ENV_OPTIONS don't work so we have to make our own
@py_common_flags = "'-O2 -pipe -fuse-ld=gold -flto-partition=none -ffat-lto-objects -flto'"
# Using /tmp breaks test_distutils, test_subprocess.
# Proxy setting breaks test_httpservers, test_ssl,
# test_urllib, test_urllib2, test_urllib2_localnet.
# So, modifying environment variable to make pass tests.
system 'autoreconf -fiv'
Dir.mkdir 'builddir'
Dir.chdir 'builddir' do
system "env OPT='-g0' CFLAGS=#{@py_common_flags} CXXFLAGS=#{@py_common_flags} \
CC='#{CREW_TGT}-gcc -pthread' \
CXX='#{CREW_TGT}-g++' \
CPPFLAGS='#{@cppflags}' \
LDFLAGS='#{@ldflags}' \
../configure #{CREW_OPTIONS} \
--with-computed-gotos \
--enable-loadable-sqlite-extensions \
--without-ensurepip \
--enable-optimizations \
--with-platlibdir='lib#{CREW_LIB_SUFFIX}' \
--with-system-ffi \
--with-system-expat \
--with-system-libmpdec \
--with-libc= \
--enable-shared"
system 'make'
end
end
def self.check
# Chromebook doesn't allow SIGHUP, so disable SIGHUP test
system 'sed', '-i', 'Lib/test/test_asyncio/test_events.py', '-e', "/Don't have SIGHUP/s/win32/linux/"
system 'sed', '-i', 'Lib/test/test_asyncio/test_subprocess.py', '-e', "/Don't have SIGHUP/s/win32/linux/"
# Chromebook returns EINVAL for F_NOTIFY DN_MULTISHOT, so disable test_fcntl_64_bit
system 'sed', '-i', 'Lib/test/test_fcntl.py', '-e', '/ARM Linux returns EINVAL for F_NOTIFY DN_MULTISHOT/s/$/\
@unittest.skipIf(platform.system() == '"'Linux'"', "Chromeos returns EINVAL for F_NOTIFY DN_MULTISHOT")/'
# imaplib test used to use a kind of security hole on a server in university and the hole is closed now.
# See https://bugs.python.org/issue30175 and https://github.com/python/cpython/pull/1320/files for details.
system 'sed', '-i', 'Lib/test/test_imaplib.py',
'-e', '/test_logincapa_with_client_certfile/i\ \ \ \ @unittest.skipIf(True,\
"bpo-30175: FIXME: cyrus.andrew.cmu.edu doesn\'t accept "\
"our randomly generated client x509 certificate anymore")',
'-e', '/test_logincapa_with_client_ssl_context/i\ \ \ \ @unittest.skipIf(True,\
"bpo-30175: FIXME: cyrus.andrew.cmu.edu doesn\'t accept "\
"our randomly generated client x509 certificate anymore")'
# Using /tmp breaks test_distutils, test_subprocess
# Proxy setting breaks test_httpservers, test_ssl,
# test_urllib, test_urllib2, test_urllib2_localnet
# system "http_proxy= https_proxy= ftp_proxy= make test"
end
def self.install
Dir.chdir 'builddir' do
system 'make', "DESTDIR=#{CREW_DEST_DIR}", 'install'
end
# remove static libraries
# system "find #{CREW_DEST_PREFIX} -name 'libpython*.a' -print | xargs -r rm"
# create symbolic links in lib64 for other applications which use libpython
# Not needed as --libdir is passed to ./configure
# unless Dir.exist? CREW_DEST_LIB_PREFIX
# FileUtils.mkdir_p CREW_DEST_LIB_PREFIX
# system "cd #{CREW_DEST_LIB_PREFIX} && ln -s ../lib/libpython*.so* ."
# end
# Remove conflicting binaries
FileUtils.rm "#{CREW_DEST_PREFIX}/bin/wheel" if File.exist? "#{CREW_DEST_PREFIX}/bin/wheel"
# Make python3 the default python
FileUtils.ln_sf 'python3', "#{CREW_DEST_PREFIX}/bin/python"
end
end