Skip to content
Snippets Groups Projects
Select Git revision
  • db4fba725ea7e8e551873983c2382144329b987e
  • dev default protected
  • vainamoinen197-transactiondocument-replace-vec-fields-by-smallvec-2
  • dvermd/200-keypairs-dewif
  • elois/wot
  • jawaka/155-dbex-add-dump-fork-tree-command
  • elois/195-bcdbwriteop
  • elois/deps-crypto
  • elois/gva-monetary-mass
  • elois/191-sled
  • elois/195
  • ji_emme/gva-humantimefield
  • 184-gva-rename-commontime-field-to-blockchaintime
  • ji_emme/182-gva-implement-block-meta-data
  • ji_emme/rml14
  • hugo/151-ws2pv2-sync
  • ji_emme/181-gva-implement-identity-request
  • ji_emme/89-implement-client-api-gva-graphql-verification-api
  • logo
  • test-juniper-from-schema
  • elois/exemple-gva-global-context
  • v0.2.0-a4 protected
  • v0.2.0-a2 protected
  • v0.2.0-a protected
  • v0.1.1-a1 protected
  • documents/v0.10.0-b1 protected
  • crypto/v0.4.0-b1 protected
  • crypto/v0.3.0-b3 protected
  • crypto/v0.3.0-b2 protected
  • crypto/v0.3.0-b1 protected
  • wot/v0.8.0-a0.9 protected
  • wot/v0.8.0-a0.8 protected
  • 0.1.0-a0.1 protected
  • v0.0.1-a0.12 protected
  • v0.0.1-a0.11 protected
  • v0.0.1-a0.10 protected
  • v0.0.1-a0.9 protected
  • v0.0.1-a0.8 protected
  • v0.0.1-a0.7 protected
  • v0.0.1-a0.6 protected
  • v0.0.1-a0.5 protected
41 results

lib.rs

Blame
  • setup.py 3.44 KiB
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    
    # source d'inspiration: http://wiki.wxpython.org/cx_freeze
    
    import sys, os, subprocess, multiprocessing
    from cx_Freeze import setup, Executable
    from PyQt5 import QtCore
    
    #############################################################################
    # preparation des options
    sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src')))
    
    print(sys.path)
    print("Environnement:")
    print(os.environ)
    includes = ["sip", "re", "json", "logging",
                "hashlib", "os", "urllib",
                "ucoinpy", "pylibscrypt"]
    exclude = ['.git']
    packages = ["libnacl", "encodings"]
    
    includefiles = []
    
    if sys.platform == "win32":
        app = QtCore.QCoreApplication(sys.argv)
        libEGL_path = ""
        libsodium_path = ""
        print(QtCore.QCoreApplication.libraryPaths())
        for path in QtCore.QCoreApplication.libraryPaths():
            if os.path.isfile(os.path.join(os.path.dirname(path), "libEGL.dll")):
                libEGL_path = os.path.join(os.path.dirname(path), "libEGL.dll")
    
        if 'CONDA_DEFAULT_ENV' in os.environ:
            # Check if we are in Conda env
            path = QtCore.QCoreApplication.libraryPaths()[0]
            libEGL_path = os.path.join(path, "Scripts", "libEGL.dll")
            libsodium_path = os.path.join(path, "Scripts", "libsodium.dll")
    
            files = lambda mypath: [ f for f in os.listdir(mypath) if os.path.isfile(os.path.join(mypath,f)) ]
            for f in files(os.path.join(path, "Scripts", "plugins", "platforms")):
                includefiles.append((os.path.join(path, "Scripts", "plugins", "platforms", f), os.path.join("platforms", f) ))
    
            for f in files(os.path.join(path, "Scripts", "plugins", "imageformats")):
                includefiles.append((os.path.join(path, "Scripts", "plugins", "imageformats", f), os.path.join("imageformats", f) ))
    
            for f in files(os.path.join(path, "Scripts", "plugins", "iconengines")):
                includefiles.append((os.path.join(path, "Scripts", "plugins", "iconengines", f), os.path.join("iconengines", f) ))
        includefiles.append(libEGL_path)
        includefiles.append(libsodium_path)
    elif sys.platform == "darwin":
        pass
    else:
        libsodium_path = ""
        print(QtCore.QCoreApplication.libraryPaths())
        # Check if we are in Conda env
        if 'CONDA_DEFAULT_ENV' in os.environ:
            libsodium_path = os.path.join(os.environ['CONDA_DEFAULT_ENV'], "lib",
                                          "libsodium.so.13")
            includefiles.append((libsodium_path, "libsodium.so.13"))
    
    print("Includes : ")
    print(includes)
    print("Excludes : ")
    print(exclude)
    print("Include files : ")
    print(includefiles)
    print("Packages : ")
    print(packages)
    print(sys.path)
    
    options = {"path": sys.path,
               "includes": includes,
               "include_files": includefiles,
               "excludes": exclude,
               "packages": packages,
               }
    
    #############################################################################
    # preparation des cibles
    base = None
    file_type=""
    icon="cutecoin.png"
    if sys.platform == "win32":
        base = "Win32GUI"
        file_type=".exe"
        icon="cutecoin.ico"
    
    target = Executable(
        script = "src/cutecoin/main.py",
        targetName="cutecoin"+file_type,
        base = base,
        icon = icon,
        )
    
    #############################################################################
    # creation du setup
    setup(
        name = "cutecoin",
        version = "0.11",
        description = "UCoin client",
        author = "Inso",
        options = {"build_exe": options},
        executables = [target]
        )