diff options
| author | mo khan <mo.khan@gmail.com> | 2020-08-04 14:51:49 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-08-04 18:18:36 -0600 |
| commit | 4b130604be2dcd96bde5f708e0f4dc91f86bd89b (patch) | |
| tree | b8333834b2be76fdd357a22fcda7212909e32eef /config/software/asdf_python.rb | |
| parent | ed6e39123472fecf4eb8fef1e75db28a3b4d1ff2 (diff) | |
Build debian packages for tools
Diffstat (limited to 'config/software/asdf_python.rb')
| -rw-r--r-- | config/software/asdf_python.rb | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/config/software/asdf_python.rb b/config/software/asdf_python.rb new file mode 100644 index 0000000..5a0e9c9 --- /dev/null +++ b/config/software/asdf_python.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +name "asdf_python" +default_version "3.8.5" + +dependency "bzip2" +dependency "libffi" +dependency "liblzma" +dependency "libsqlite3" +dependency "libuuid" +dependency "libyaml" +dependency "ncurses" +dependency "openssl" +dependency "zlib" + +source url: "https://python.org/ftp/python/#{version}/Python-#{version}.tar.xz" +relative_path "Python-#{version}" + +version("3.8.5") { source md5: "35b5a3d0254c1c59be9736373d429db7" } +version("3.8.4") { source md5: "e16df33cd7b58702e57e137f8f5d13e7" } +version("3.8.3") { source md5: "3000cf50aaa413052aef82fd2122ca78" } +version("3.8.2") { source md5: "e9d6ebc92183a177b8e8a58cad5b8d67" } +version("3.8.1") { source md5: "b3fb85fd479c0bf950c626ef80cacb57" } +version("3.8.0") { source md5: "dbac8df9d8b9edc678d0f4cacdb7dbb0" } +version("3.7.7") { source md5: "172c650156f7bea68ce31b2fd01fa766" } +version("3.7.6") { source md5: "c08fbee72ad5c2c95b0f4e44bf6fd72c" } +version("3.7.5") { source md5: "08ed8030b1183107c48f2092e79a87e2" } +version("3.7.4") { source md5: "d33e4aae66097051c2eca45ee3604803" } +version("3.7.3") { source md5: "93df27aec0cd18d6d42173e601ffbbfd" } +version("3.7.2") { source md5: "df6ec36011808205beda239c72f947cb" } +version("3.7.1") { source md5: "0a57e9022c07fad3dadb2eef58568edb" } +version("3.7.0") { source md5: "eb8c2a6b1447d50813c02714af4681f3" } +version("3.6.11") { source md5: "8f91c770b546a4938efbdb3064796c6c" } +version("3.5.9") { source md5: "ef7f82485e83c7f8f8bcb920a9c2457b" } +version("3.4.10") { source md5: "f88a98bce17a03c43a6a5f8a66ab2e62" } +version("3.3.7") { source md5: "84e2f12f044ca53b577f6224c53f82ac" } +version("3.2.6") { source md5: "e0ba4360dfcb4aec735e666cc0ae7b0e" } +version("3.1.5") { source md5: "20dd2b7f801dc97db948dd168df4dd52" } +version("3.0.1") { source md5: "7291eac6a9a7a3642e309c78b8d744e5" } + +version("2.7.18") { source md5: "fd6cc8ec0a78c44036f825e739f36e5a" } + +build do + env = with_standard_compiler_flags(with_embedded_path) + configure_command = [ + "--enable-shared", + "--enable-ipv6", + "--prefix=#{install_dir}/embedded", + "--with-ssl=#{install_dir}/embedded", + "--with-dbmliborder=", + "--without-dtrace", + "--without-valgrind" + ] + configure(*configure_command, env: env) + make "-j #{workers}", env: env + make "-j #{workers} install", env: env + command "ln -s #{install_dir}/embedded/bin #{install_dir}/bin" +end + +build do + if version.start_with?('3.') + command "ln -s #{install_dir}/bin/python3 #{install_dir}/bin/python" + command "ln -s #{install_dir}/bin/pip3 #{install_dir}/bin/pip" + end + + if File.exist?("#{install_dir}/bin/pip") + command "#{install_dir}/bin/pip install --upgrade pip" + else + case version + when /^3\.2\./ + command "curl https://bootstrap.pypa.io/3.2/get-pip.py -o #{project_dir}/get-pip.py" + when /^3\.3\./ + command "curl https://bootstrap.pypa.io/3.3/get-pip.py -o #{project_dir}/get-pip.py" + when /^3\.4\./ + command "curl https://bootstrap.pypa.io/3.4/get-pip.py -o #{project_dir}/get-pip.py" + when /^2\.6\./ + command "curl https://bootstrap.pypa.io/2.6/get-pip.py -o #{project_dir}/get-pip.py" + else + command "curl https://bootstrap.pypa.io/get-pip.py -o #{project_dir}/get-pip.py" + end + + command "#{install_dir}/bin/python #{project_dir}/get-pip.py \"pip<20.0\"" + end + command "#{install_dir}/bin/pip install pipenv virtualenv" + command "#{install_dir}/bin/pip install conan" if version == default_version +end + +build do + command "find #{install_dir} -type f -name '*.exe' -exec rm {} +" + command "find #{install_dir} -type d -name '__pycache__' -exec rm -r {} +" + command "find #{install_dir} -type d -name 'test' -exec rm -r {} +" + command "find #{install_dir} -type d -name 'tests' -exec rm -r {} +" + delete "#{install_dir}/embedded/bin/sqlite3" + delete "#{install_dir}/embedded/lib/python*/unittest" + delete "#{install_dir}/embedded/lib/python*/lib-dynload/_bsddb*" + delete "#{install_dir}/embedded/lib/python*/lib-dynload/readline*" + delete "#{install_dir}/embedded/man" + delete "#{install_dir}/embedded/share" +end |
