2019-10-13 15:13:39 +00:00
|
|
|
# ##########################################################
|
2019-01-03 19:25:08 +00:00
|
|
|
# FlatCAM: 2D Post-processing for Manufacturing #
|
|
|
|
# http://flatcam.org #
|
|
|
|
# Author: Juan Pablo Caram (c) #
|
2019-03-10 13:22:16 +00:00
|
|
|
# Date: 12/20/2018 #
|
2019-01-03 19:25:08 +00:00
|
|
|
# MIT Licence #
|
|
|
|
# #
|
2019-03-10 13:22:16 +00:00
|
|
|
# Creates a portable copy of FlatCAM, including Python #
|
2019-01-03 19:25:08 +00:00
|
|
|
# itself and all dependencies. #
|
|
|
|
# #
|
|
|
|
# This is not an aid to install FlatCAM from source on #
|
|
|
|
# Windows platforms. It is only useful when FlatCAM is up #
|
|
|
|
# and running and ready to be packaged. #
|
2019-10-13 15:13:39 +00:00
|
|
|
# ##########################################################
|
2019-01-03 19:25:08 +00:00
|
|
|
|
2019-10-13 15:13:39 +00:00
|
|
|
# ##########################################################
|
|
|
|
# File Modified: Marius Adrian Stanciu #
|
2019-03-10 13:22:16 +00:00
|
|
|
# Date: 3/10/2019 #
|
2019-10-13 15:13:39 +00:00
|
|
|
# ##########################################################
|
2019-03-10 13:22:16 +00:00
|
|
|
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
# Files not needed: Qt, tk.dll, tcl.dll, tk/, tcl/, vtk/,
|
|
|
|
# scipy.lib.lapack.flapack.pyd, scipy.lib.blas.fblas.pyd,
|
|
|
|
# numpy.core._dotblas.pyd, scipy.sparse.sparsetools._bsr.pyd,
|
|
|
|
# scipy.sparse.sparsetools._csr.pyd, scipy.sparse.sparsetools._csc.pyd,
|
|
|
|
# scipy.sparse.sparsetools._coo.pyd
|
|
|
|
|
2019-11-18 21:03:04 +00:00
|
|
|
import os
|
|
|
|
import site
|
|
|
|
import sys
|
|
|
|
import platform
|
2019-01-03 19:25:08 +00:00
|
|
|
from cx_Freeze import setup, Executable
|
|
|
|
|
|
|
|
# this is done to solve the tkinter not being found
|
|
|
|
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
|
|
|
|
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
|
|
|
|
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
|
|
|
|
|
|
|
|
# Get the site-package folder, not everybody will install
|
|
|
|
# Python into C:\PythonXX
|
|
|
|
site_dir = site.getsitepackages()[1]
|
|
|
|
|
|
|
|
include_files = []
|
|
|
|
|
|
|
|
include_files.append((os.path.join(site_dir, "shapely"), "shapely"))
|
|
|
|
include_files.append((os.path.join(site_dir, "svg"), "svg"))
|
|
|
|
include_files.append((os.path.join(site_dir, "svg/path"), "svg"))
|
|
|
|
include_files.append((os.path.join(site_dir, "vispy"), "vispy"))
|
|
|
|
include_files.append((os.path.join(site_dir, "vispy/app"), "vispy/app"))
|
|
|
|
include_files.append((os.path.join(site_dir, "vispy/app/backends"), "vispy/app/backends"))
|
2019-09-26 18:49:58 +00:00
|
|
|
# include_files.append((os.path.join(site_dir, "matplotlib"), "matplotlib"))
|
2019-01-03 19:25:08 +00:00
|
|
|
include_files.append((os.path.join(site_dir, "rtree"), "rtree"))
|
|
|
|
|
|
|
|
if platform.architecture()[0] == '64bit':
|
|
|
|
include_files.append((os.path.join(site_dir, "google"), "google"))
|
|
|
|
include_files.append((os.path.join(site_dir, "google/protobuf"), "google/protobuf"))
|
|
|
|
include_files.append((os.path.join(site_dir, "ortools"), "ortools"))
|
|
|
|
|
2019-03-18 01:30:47 +00:00
|
|
|
include_files.append(("locale", "lib/locale"))
|
2019-12-06 21:00:43 +00:00
|
|
|
include_files.append(("preprocessors", "lib/preprocessors"))
|
2020-04-28 11:37:34 +00:00
|
|
|
include_files.append(("assets", "lib/assets"))
|
|
|
|
include_files.append(("assets/examples", "lib/assets/examples"))
|
|
|
|
include_files.append(("assets/linux", "lib/assets/linux"))
|
|
|
|
include_files.append(("assets/resources", "lib/assets/resources"))
|
2020-04-28 14:23:49 +00:00
|
|
|
# include_files.append(("share", "lib/share"))
|
2019-08-14 23:18:13 +00:00
|
|
|
include_files.append(("flatcamGUI/VisPyData", "lib/vispy"))
|
2019-08-14 23:47:09 +00:00
|
|
|
include_files.append(("config", "lib/config"))
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
include_files.append(("README.md", "README.md"))
|
|
|
|
include_files.append(("LICENSE", "LICENSE"))
|
|
|
|
|
|
|
|
base = None
|
|
|
|
|
|
|
|
# Lets not open the console while running the app
|
|
|
|
if sys.platform == "win32":
|
|
|
|
base = "Win32GUI"
|
|
|
|
|
|
|
|
if platform.architecture()[0] == '64bit':
|
|
|
|
buildOptions = dict(
|
|
|
|
include_files=include_files,
|
2019-11-18 21:03:04 +00:00
|
|
|
excludes=['scipy', 'pytz'],
|
2019-01-03 19:25:08 +00:00
|
|
|
# packages=['OpenGL','numpy','vispy','ortools','google']
|
2019-02-16 12:43:26 +00:00
|
|
|
# packages=['numpy','google', 'rasterio'] # works for Python 3.7
|
2019-11-17 13:58:58 +00:00
|
|
|
packages=['opengl', 'numpy', 'google', 'rasterio'], # works for Python 3.6.5 and Python 3.7.1
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
else:
|
|
|
|
buildOptions = dict(
|
|
|
|
include_files=include_files,
|
|
|
|
excludes=['scipy', 'pytz'],
|
|
|
|
# packages=['OpenGL','numpy','vispy','ortools','google']
|
2019-02-16 12:43:26 +00:00
|
|
|
# packages=['numpy', 'rasterio'] # works for Python 3.7
|
2019-11-17 13:58:58 +00:00
|
|
|
packages=['opengl', 'numpy', 'rasterio'], # works for Python 3.6.5 and Python 3.7.1
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|
|
|
|
|
2019-11-17 13:58:58 +00:00
|
|
|
if sys.platform == "win32":
|
|
|
|
buildOptions["include_msvcr"] = True
|
|
|
|
|
2019-01-03 19:25:08 +00:00
|
|
|
print("INCLUDE_FILES", include_files)
|
|
|
|
|
2019-11-07 22:14:23 +00:00
|
|
|
|
|
|
|
def getTargetName():
|
|
|
|
my_OS = platform.system()
|
|
|
|
if my_OS == 'Linux':
|
|
|
|
return "FlatCAM"
|
|
|
|
elif my_OS == 'Windows':
|
|
|
|
return "FlatCAM.exe"
|
|
|
|
else:
|
|
|
|
return "FlatCAM.dmg"
|
|
|
|
|
|
|
|
|
2020-04-28 14:23:49 +00:00
|
|
|
exe = Executable("FlatCAM.py", icon='assets/resources/flatcam_icon48.ico', base=base, targetName=getTargetName())
|
2019-01-03 19:25:08 +00:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name="FlatCAM",
|
2020-04-24 05:12:21 +00:00
|
|
|
author="Community effort",
|
2019-02-16 12:43:26 +00:00
|
|
|
version="8.9",
|
2020-04-24 05:12:21 +00:00
|
|
|
description="FlatCAM Evo: 2D Computer Aided PCB Manufacturing",
|
2019-01-03 19:25:08 +00:00
|
|
|
options=dict(build_exe=buildOptions),
|
2019-11-07 22:14:23 +00:00
|
|
|
executables=[exe]
|
2019-01-03 19:25:08 +00:00
|
|
|
)
|