diff --git a/contrib/packaging/pyoxidizer/pyoxidizer.toml b/contrib/packaging/pyoxidizer/pyoxidizer.toml new file mode 100644 --- /dev/null +++ b/contrib/packaging/pyoxidizer/pyoxidizer.toml @@ -0,0 +1,120 @@ +# This file controls the PyOxidizer build configuration. See the +# pyoxidizer crate's documentation for extensive documentation +# on this file format. + +[[build]] +application_name = "hg" + +[[embedded_python_config]] +raw_allocator = "jemalloc" + +# dont_write_bytecode = true +# ignore_environment = true + +# TODO: enable one or both of these, so that extensions with a separate python +# module like mercurial_keyring can load. +# no_site = true +# no_user_site_directory = true + + +# optimize_level = 0 +# stdio_encoding = "utf-8:strict" + +# Otherwise `hg pull` status is delayed. No sign of a progress bar either way. +unbuffered_stdio = true +# write_modules_directory_env = "PYOXIDIZER_WRITE_MODULES_DIR" +sys_frozen = true +# sys_meipass = false + +# Windows doesn't support jemalloc. +[[embedded_python_config]] +build_target = "i686-pc-windows-msvc" +raw_allocator = "system" + +[[embedded_python_config]] +build_target = "x86_64-pc-windows-msvc" +raw_allocator = "system" + +[[packaging_rule]] +type = "stdlib-extensions-policy" + +# Package all available extension modules from the Python distribution. +# The Python interpreter will be fully featured. +policy = "all" + +# Package the entire Python standard library without sources. +[[packaging_rule]] +type = "stdlib" +include_source = false + +# Write out license files next to the produced binary. +[[packaging_rule]] +type = "write-license-files" +path = "" + + +# XXX: This doesn't seem to work? (Or at least it still warns about __file__ +# in these, both when here and if `type = "stdlib"`) +[[packaging_rule]] +type = "stdlib-extensions-explicit-excludes" +excludes = ["setuptools", "pip", "pip._vendor", "distutils", "lib2to3", + "unittest" ] + + +# NOTE: in order to successfully bundle the C extensions with this, you must +# `make -C /path/to/hg/repo clean` and touch this file before *each* +# `pyoxidizer build`. This also doesn't currently work on Windows- use +# `type = "virtualenv"` instead. +[[packaging_rule]] +type = "setup-py-install" +package_path = "/Users/mharbison/mercurial_py3" +include_source = false + + +[[packaging_rule]] +type = "pip-install-simple" +package = "hg-evolve==9.2.1" +include_source = false + + +# TODO: figure out how to convince it to run the hg script in the repo root. +[[embedded_python_run]] +mode = "eval" +code = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()" + + + +[[distribution]] +type = "wix" + +# END OF COMMON USER-ADJUSTED SETTINGS. +# +# Everything below this is typically managed by PyOxidizer and doesn't need +# to be updated by people. + +[[python_distribution]] +build_target = "i686-pc-windows-msvc" +url = "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-windows-x86-20191025T0549.tar.zst" +sha256 = "388d37bcffee183bc23f5fec9c263779c59d298d35c9e4445b407d95f94db19c" +[[python_distribution]] +build_target = "x86_64-apple-darwin" +url = "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-macos-20191026T0535.tar.zst" +sha256 = "e8d0710627c017213d9c5c6496577539a5adceb56d3060e07954ce9bf59f39ae" +[[python_distribution]] +build_target = "x86_64-pc-windows-msvc" +url = "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-windows-amd64-20191025T0540.tar.zst" +sha256 = "86a3260edabeed314c6f32a931e60dd097fa854b1346561443353e1bc90e3edd" +[[python_distribution]] +build_target = "x86_64-unknown-linux-gnu" +url = "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-linux64-20191025T0506.tar.zst" +sha256 = "608871543e6d2cb80e958638e31158355c578c114e12c77765ea5fb996a5a2c2" +[[python_distribution]] +build_target = "x86_64-unknown-linux-musl" +url = "https://github.com/indygreg/python-build-standalone/releases/download/20191025/cpython-3.7.5-linux64-musl-20191026T0603.tar.zst" +sha256 = "9d46c1964e32f77f22fec96c8acb905e8d4ff54594ca9a2660467f974dca3a53" + + +[[pyoxidizer]] +version = "0.4.0" +commit = "" +