# Copyright: 2016-2023 Paul Obermeier (obermeier@tcl3d.org) # Distributed under BSD license. # # BuildType Windows: Copy # # HowTo: Create a Python distribution file for use with BAWT. # # 1. Install standard Python distribution from www.python.org: # 64-bit version: python-X.Y.Z-amd64.exe # # First page: # Use installation type: "Customize installation". # Second page: # Optional Features: Only install "Documentation" and "pip" packages. # Third page: # Advanced options: Deselect all. # Install location: C:\opt\Python # # 2. Open DOS shell and install the following Python packages: # > python -m pip install numpy scipy matplotlib # If using Python 3.6.4, this will install the following versions: # NumPy 1.16.1 # SciPy 1.2.1 # MatPlotLib 3.0.2 # If using Python 3.7.7, this will install the following versions: # NumPy 1.19.0 # SciPy 1.5.0 # MatPlotLib 3.2.2 # # 3. Copy the header files of NumPy into the Python include directory: # Copy file Python-NumPy-NUMPY_VERSION-IncludeDir.7z to c:\opt\Python\include # Extract the 7z file. # # 4. Make BAWT distribution file: # Rename c:\opt\Python to C:\opt\Python-X.Y.Z-64 # Zip C:\opt\Python-X.Y.Z-64 to a 7z file. # # - To generate a 32-bit distribution # Step 1: Use 32-bit Python distribution: python-X.Y.Z.exe # Step 4: Rename Python directory to Python-X.Y.Z-32 proc Init_Python { libName libVersion } { SetScriptAuthor $libName "Paul Obermeier" "obermeier@tcl3d.org" SetLibHomepage $libName "http://www.python.org/" SetLibDependencies $libName "None" SetPlatforms $libName "Windows" } proc Env_Python { libName libVersion buildDir instDir devDir distDir } { SetEnvVar "PYTHONHOME" "$devDir/[GetPythonDir]" AddToPathEnv "$devDir/opt/$libName" } proc Build_Python { libName libVersion buildDir instDir devDir distDir } { if { [UseStage "Extract" $libName] } { ExtractLibrary $libName $buildDir } if { [UseStage "Distribute" $libName] } { MultiFileCopy "$buildDir" "$distDir/opt/$libName" "*" true MultiFileCopy "$buildDir" "$devDir/opt/$libName" "*" true } return true }