# -*- coding: utf-8 -*-
########################################################################
# Copyright (C) 2018 by Marek Wojciechowski
# <mwojc@p.lodz.pl>
#
# Distributed under the terms of GPL-2.0 license
# https://opensource.org/licenses/GPL-2.0
########################################################################
from __future__ import print_function
import sys
import os
import platform
import tarfile
import zipfile
from distutils import sysconfig
from distutils.core import setup
if sys.version_info.major == 2:
from urllib2 import urlopen
else:
from urllib.request import urlopen
if __name__ == "__main__":
server = 'http://gmsh.info/bin'
version = '4.0.4'
iversion = version+'-1' # installer number
system = platform.system().lower()
machine = platform.machine().lower()
plat = None
plat = 'Linux64' if 'linux' in system and '64' in machine else plat
plat = 'Linux32' if 'linux' in system and '64' not in machine else plat
plat = 'Windows64' if 'windows' in system and '64' in machine else plat
plat = 'Windows32' if 'windows' in system and '64' not in machine else plat
plat = 'MacOSX' if 'darwin' in system else plat
if plat is None:
raise TypeError(
"Platform '{}' is not supported.".format(system+'-'+machine))
name = "gmsh-{}-{}-sdk".format(version, plat)
ext = '.zip' if plat.startswith('Windows') else '.tgz'
fname = name + ext
if plat.startswith('Linux'):
url = server + "/Linux/" + fname
elif plat.startswith('Windows'):
url = server + "/Windows/" + fname
else:
url = server + "/MacOSX/" + fname
if not os.path.isfile('.downloaded'):
print('Downloading {}, please wait...'.format(url))
with open(fname, "wb") as f:
f.write(urlopen(url).read())
with open('.downloaded', 'a'):
pass
if not os.path.isfile('.extracted'):
print('Extracting {}, please wait...'.format(fname))
tar = tarfile.open(fname) if ext == '.tgz' else zipfile.ZipFile(fname, 'r')
tar.extractall()
with open('.extracted', 'a'):
pass
pth = open('gmsh.pth', 'w')
pth.write(name+'/lib\n')
pth.write(name+'/bin')
pth.close()
site_dirpath = sysconfig.get_python_lib(prefix='')
dirs = [site_dirpath]
files = [['gmsh.pth']]
for (dirpath, dirnames, filenames) in os.walk(name):
dirs += [os.path.join(site_dirpath, dirpath)]
files += [[os.path.join(dirpath, file) for file in filenames]]
data_files = list(zip(dirs, files))
scripts = ['gmsh', 'gmsh.bat'] if plat.startswith('Windows') else ['gmsh']
setup(name = 'gmsh-sdk',
version = iversion,
description = 'Gmsh SDK installer. Gmsh is a three-dimensional finite element mesh generator.',
long_description = open('README.rst', 'r').read(),
long_description_content_type='text/markdown',
maintainer = 'Marek Wojciechowski',
maintainer_email = 'mrkwjc@gmail.com',
keywords = ['fem', 'mesh', 'finite element method'],
url = 'https://github.com/mrkwjc/gmsh-sdk',
license = 'GPL-2',
platforms = 'Posix, Windows',
classifiers = ['Development Status :: 5 - Production/Stable',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: C',
'Programming Language :: C++',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering'],
data_files=data_files,
scripts=scripts
)
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
最新资源
- 基于Vue.js+express+echarts开发可视化大屏数据展示项目,大屏以深色背景为主。详细文档+全部资料+源码.zip
- 基于Springboot+通用Mapper+Redis 开发的旅游大数据可视化平台详细文档+全部资料+源码.zip
- 基于Vue + Echarts 构建的数据可视化平台,酷炫大屏展示模板和组件库,持续更新各行各业实用模板和炫酷小组件详细文档+全部资料+源码.zip
- 基于vue2.x构建的大屏数据可视化项目详细文档+全部资料+源码.zip
- 基于Vue3.0的“数据可视化大屏”设计与编辑器详细文档+全部资料+源码.zip
- 基于vue2+vuex+router+echarts的数据可视化大屏,使用缩放进行了屏幕的适配详细文档+全部资料+源码.zip
- 基于vue的大数据表格详细文档+全部资料+源码.zip
- 基于vue3.0的大数据分析系统,包含各种echarts和vue3.0新API详细文档+全部资料+源码.zip
- 基于vue3的数据可视化大屏基础组件详细文档+全部资料+源码.zip
- 基于WIFI探针的商业大数据分析技术详细文档+全部资料+源码.zip
- 上市公司数字经济专利申请数据(1999-2023年).zip
- Mysql配置文件优化内容 my.cnf
- 基于wifi抓取信息的大数据查询分析系统详细文档+全部资料+源码.zip
- 基于大模型LLMs的智能文本SQL生成能力,结合数据可视化,实现下一代对话式系统自动生成图表展示和dashboard、数据分析的BI系统。详细文档+全部资料+源码.zip
- 基于大航杯“智造扬中”电力AI大赛数据挖掘管道搭建示例详细文档+全部资料+源码.zip
- 基于标签的用户行为日志大数据分析系统详细文档+全部资料+源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈