summaryrefslogtreecommitdiff
path: root/package/windows
diff options
context:
space:
mode:
Diffstat (limited to 'package/windows')
-rw-r--r--package/windows/README.rst37
-rw-r--r--package/windows/bootstrap-silx-view.py12
-rw-r--r--package/windows/bootstrap.py16
-rw-r--r--package/windows/pyinstaller-silx-view.spec54
-rw-r--r--package/windows/pyinstaller.spec54
-rw-r--r--package/windows/silx.icobin0 -> 4286 bytes
6 files changed, 173 insertions, 0 deletions
diff --git a/package/windows/README.rst b/package/windows/README.rst
new file mode 100644
index 0000000..a7f3702
--- /dev/null
+++ b/package/windows/README.rst
@@ -0,0 +1,37 @@
+Generate silx fat binary for Windows
+====================================
+
+Pre-requisites
+--------------
+
+- PyInstaller must be installed.
+ It is best to use the development version to use package specific hooks up-to-date.
+ Run either::
+
+ pip install -r requirements-dev.txt
+
+ or::
+
+ pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
+
+- silx and all its dependencies must be INSTALLED::
+
+ pip install silx[full]
+
+ or from the source directory::
+
+ pip install .[full]
+
+
+Procedure
+---------
+
+- Go to the `package/windows` folder in the source directory
+- Run `pyinstaller pyinstaller.spec`.
+ This generates a fat binary in `package/windows/dist/silx/` for the generic launcher `silx.exe`.
+- Run `pyinstaller pyinstaller-silx-view.spec`.
+ This generates a fat binary in `package/windows/dist/silx-view/` for the silx view command `silx-view.exe`.
+- Copy `silx-view.exe` and `silx-view.exe.manifest` to `package/windows/dist/silx/`.
+ This is a hack until PyInstaller supports multiple executables (see https://github.com/pyinstaller/pyinstaller/issues/1527).
+- Zip `package\windows\dist\silx` to make the application available as a single zip file.
+
diff --git a/package/windows/bootstrap-silx-view.py b/package/windows/bootstrap-silx-view.py
new file mode 100644
index 0000000..f8da02d
--- /dev/null
+++ b/package/windows/bootstrap-silx-view.py
@@ -0,0 +1,12 @@
+# coding: utf-8
+
+import logging
+
+logging.basicConfig()
+
+import sys
+from silx.app.view.main import main
+
+if __name__ == "__main__":
+ main(sys.argv)
+
diff --git a/package/windows/bootstrap.py b/package/windows/bootstrap.py
new file mode 100644
index 0000000..3c6e887
--- /dev/null
+++ b/package/windows/bootstrap.py
@@ -0,0 +1,16 @@
+# coding: utf-8
+
+import logging
+
+logging.basicConfig()
+
+# Import here for static analysis to work
+import silx.app.view.main
+import silx.app.convert
+import silx.app.test_
+
+from silx.__main__ import main
+
+if __name__ == "__main__":
+ main()
+
diff --git a/package/windows/pyinstaller-silx-view.spec b/package/windows/pyinstaller-silx-view.spec
new file mode 100644
index 0000000..6f36128
--- /dev/null
+++ b/package/windows/pyinstaller-silx-view.spec
@@ -0,0 +1,54 @@
+# -*- mode: python -*-
+import os.path
+from PyInstaller.utils.hooks import collect_data_files
+
+datas = []
+
+PROJECT_PATH = os.path.abspath(os.path.join(SPECPATH, "..", ".."))
+datas.append((os.path.join(PROJECT_PATH, "README.rst"), "."))
+datas.append((os.path.join(PROJECT_PATH, "LICENSE"), "."))
+datas.append((os.path.join(PROJECT_PATH, "copyright"), "."))
+
+
+datas += collect_data_files("silx.resources")
+
+
+block_cipher = None
+
+
+a = Analysis(['bootstrap-silx-view.py'],
+ pathex=[],
+ binaries=[],
+ datas=datas,
+ hiddenimports=[],
+ hookspath=[],
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher,
+ noarchive=False)
+
+pyz = PYZ(a.pure,
+ a.zipped_data,
+ cipher=block_cipher)
+
+exe = EXE(pyz,
+ a.scripts,
+ [],
+ exclude_binaries=True,
+ name='silx-view',
+ debug=False,
+ bootloader_ignore_signals=False,
+ strip=False,
+ upx=False,
+ console=False,
+ icon='silx.ico')
+
+coll = COLLECT(exe,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ strip=False,
+ upx=False,
+ name='silx-view')
diff --git a/package/windows/pyinstaller.spec b/package/windows/pyinstaller.spec
new file mode 100644
index 0000000..74d6a0f
--- /dev/null
+++ b/package/windows/pyinstaller.spec
@@ -0,0 +1,54 @@
+# -*- mode: python -*-
+import os.path
+from PyInstaller.utils.hooks import collect_data_files
+
+datas = []
+
+PROJECT_PATH = os.path.abspath(os.path.join(SPECPATH, "..", ".."))
+datas.append((os.path.join(PROJECT_PATH, "README.rst"), "."))
+datas.append((os.path.join(PROJECT_PATH, "LICENSE"), "."))
+datas.append((os.path.join(PROJECT_PATH, "copyright"), "."))
+
+
+datas += collect_data_files("silx.resources")
+
+
+block_cipher = None
+
+
+a = Analysis(['bootstrap.py'],
+ pathex=[],
+ binaries=[],
+ datas=datas,
+ hiddenimports=[],
+ hookspath=[],
+ runtime_hooks=[],
+ excludes=[],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher,
+ noarchive=False)
+
+pyz = PYZ(a.pure,
+ a.zipped_data,
+ cipher=block_cipher)
+
+exe = EXE(pyz,
+ a.scripts,
+ [],
+ exclude_binaries=True,
+ name='silx',
+ debug=False,
+ bootloader_ignore_signals=False,
+ strip=False,
+ upx=False,
+ console=True,
+ icon='silx.ico')
+
+coll = COLLECT(exe,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ strip=False,
+ upx=False,
+ name='silx')
diff --git a/package/windows/silx.ico b/package/windows/silx.ico
new file mode 100644
index 0000000..9db7313
--- /dev/null
+++ b/package/windows/silx.ico
Binary files differ