Compare commits

...

283 Commits
2.0 ... master

Author SHA1 Message Date
Raoul Snyman 337479e1cf Merge branch 'update-pkg-for-macos' into 'master'
Update pkg for macos

See merge request openlp/packaging!24
2023-09-15 06:37:49 +00:00
Raoul Snyman 931faa3775 Add arch to dmg name, bundle applescript, parse pep440 version number 2023-09-14 11:46:34 -07:00
Tim Bentley cdd1851f2d Merge branch 'fix-appveyor-more' into 'master'
Fix the build number for the PortableApps installer, which was also causing a hang somewhere

See merge request openlp/packaging!23
2023-09-13 20:42:20 +00:00
Raoul Snyman 03bdf87994
Fix the build number for the PortableApps installer, which was also causing a hang somewhere 2023-09-09 21:22:00 -07:00
Raoul Snyman a6e556e524
Merge branch 'fix-wix-build-numbers' into 'master'
Convert a PEP440 version number to a Windows version number

See merge request openlp/packaging!22
2023-09-08 14:06:41 +00:00
Raoul Snyman c69cfab237 Convert a PEP440 version number to a Windows version number 2023-09-07 23:15:32 -07:00
Tomas Groth d32a48727b Merge branch 'update-to-pyro5' into 'master'
Update the builder to bundle Pyro5

See merge request openlp/packaging!21
2023-08-26 06:54:55 +00:00
Raoul Snyman 6789a46057 Update the builder to bundle Pyro5 2023-08-25 20:02:06 -07:00
Tim Bentley 140d073f64 Merge branch 'add-vlc-to-macos' into 'master'
Copy VLC files into macOS

See merge request openlp/packaging!19
2023-05-17 07:24:58 +00:00
Raoul Snyman bb5d483936
Copy VLC files into macOS 2023-05-08 21:43:42 -07:00
Raoul Snyman 34aca98b1a Use the correct license. 2023-04-27 05:21:10 +00:00
Raoul Snyman 9dbb7d99cd Add LICENSE 2023-04-27 03:36:59 +00:00
Raoul Snyman 9a6cd69af7 Merge branch 'add-nsappleeventusagedesc' into 'master'
Adds NSAppleEventsUsageDescription to macOS build to tricker better permission handling.

See merge request openlp/packaging!18
2023-01-19 17:36:00 +00:00
Tomas Groth 31ebdc537a Adds NSAppleEventsUsageDescription to macOS build to tricker better permission handling. 2023-01-18 23:02:06 +01:00
Raoul Snyman 5b42f3260d Merge branch 'dmgbuild-fix' into 'master'
Fix to make dmgbuild work

See merge request openlp/packaging!17
2021-11-22 05:43:57 +00:00
Tomas Groth 854dba8e86 Fix to make dmgbuild work 2021-11-22 05:43:56 +00:00
Tomas Groth f3450e30f2 Merge branch 'fix-path-to-lrelease' into 'master'
Add a 'home' variable for the config files

See merge request openlp/packaging!16
2021-11-07 09:43:29 +00:00
Raoul Snyman 2e9751f690
Add a 'home' variable for the config files 2021-09-16 15:37:33 -07:00
Raoul Snyman 09e63c0a04 Merge branch 'update-qt-appveyor-path' into 'master'
Update Qt path in appveyor

See merge request openlp/packaging!15
2021-09-03 15:56:42 +00:00
Tomas Groth 7be279bb17 Update Qt path in appveyor 2021-09-03 13:21:29 +02:00
Tomas Groth f08beb7001 Merge branch 'update-macos-build' into 'master'
Some updates to the macOS builder

See merge request openlp/packaging!14
2021-09-03 09:09:40 +00:00
Raoul Snyman 128de147e0
Some updates to the macOS builder
- Apparently we don't need to sign the app anymore
- Add hooks for websockets
2021-09-02 17:57:02 -07:00
Tim Bentley cfdbeb7176 Merge branch 'new-pyqt5-path' into 'master'
Update windows Qt5 path for translations.

See merge request openlp/packaging!13
2021-03-26 10:13:18 +00:00
Tomas Groth 3aa582ca10 Update windows Qt5 path for translations. 2021-03-25 20:32:05 +00:00
Raoul Snyman 5afca33db1 Merge branch 'reenable-macos-dark' into 'master'
Re-enable dark mode on Mac OS now that pyinstaller supports it.

See merge request openlp/packaging!12
2020-12-04 05:14:27 +00:00
Tomas Groth 398510517f Re-enable dark mode on Mac OS now that pyinstaller supports it. 2020-12-04 06:07:35 +01:00
Raoul Snyman 565baaa2f6 Merge branch 'keynote-include' into 'master'
Fix typo that prevent inclusion of the keynotecontroller.

See merge request openlp/packaging!11
2020-09-30 20:04:02 +00:00
Tomas Groth 206e306c37 Fix typo that prevent inclusion of the keynotecontroller. 2020-09-30 21:46:18 +02:00
Raoul Snyman dcaebecb40 Merge branch 'wix-fixes' into 'master'
Make the windows installer able to start OpenLP directly after install.

See merge request openlp/packaging!10
2020-09-30 06:40:51 +00:00
Tomas Groth 4905e575de Try to make the windows installer able to start OpenLP directly after install. Also try to compress better. 2020-09-30 06:40:51 +00:00
Raoul Snyman de9ee75694 Merge branch 'mac-fixes' into 'master'
Fix a few mac related issues.

See merge request openlp/packaging!9
2020-09-20 20:09:09 +00:00
Tomas Groth f13b412e12 Fix a few mac related issues. 2020-09-20 21:55:26 +02:00
Tim Bentley b6edde850a Merge branch 'appveyor-macos' into 'master'
Fixes for MacOS build and enable using appveyor for macos

See merge request openlp/packaging!8
2020-07-10 19:43:13 +00:00
Tomas Groth b7cd96f662 Fixes for MacOS build and enable using appveyor for macos 2020-07-10 19:43:13 +00:00
Tomas Groth a645888667 Merge branch 'pymediainfo-hook' into 'master'
Pymediainfo hook

Closes #2

See merge request openlp/packaging!7
2019-12-21 22:20:11 +00:00
Raoul Snyman 62c6150942 Add a pymediainfo hook which also tells PyInstaller to copy the dll/dylib file 2019-12-21 15:15:46 -07:00
Raoul Snyman d419a9f7de Merge branch 'master' of gitlab.com:openlp/packaging 2019-12-21 15:15:33 -07:00
Tomas Groth 83da7f600f Merge branch 'make-release-export-optional' into 'master'
Make the export optional when running a release build

See merge request openlp/packaging!6
2019-12-20 06:03:49 +00:00
Raoul Snyman 1dccab556d Make the export optional when running a release build 2019-12-20 06:03:49 +00:00
Raoul Snyman 3f41bf12b8 Merge branch 'htmlhelp-x86-appveyor' into 'master'
Set htmlhelp to use progfilesx86 path.

See merge request openlp/packaging!5
2019-12-19 21:09:43 +00:00
Tomas Groth 95227423bd Set htmlhelp to use progfilesx86 path. 2019-12-19 21:09:43 +00:00
Raoul Snyman b745f7fcf8 Merge branch 'fix-macos-build' into 'master'
Fix various parts of the build script for the macOS build

See merge request openlp/packaging!4
2019-12-10 04:07:44 +00:00
Raoul Snyman bb1b6b773b Fix various parts of the build script for the macOS build 2019-12-10 04:07:44 +00:00
Tomas Groth 2a26e6c03d Merge branch 'fix-msi-pyinstaller' into 'master'
Fix MSI and PyInstaller builds

Closes #2

See merge request openlp/packaging!3
2019-11-13 21:34:04 +00:00
Raoul Snyman 08313281ea Fix MSI and PyInstaller builds 2019-11-13 21:34:04 +00:00
Raoul Snyman 9c12f4eec8 Fixed #2 with MSI build; fixed PyInstaller build 2019-11-13 08:33:41 -07:00
Raoul Snyman a762877cc5 Merge branch 'gitlab-packaging' into 'master'
Some updates to get packaing working after the gitlab migration.

See merge request openlp/packaging!2
2019-09-24 18:47:13 +00:00
Tomas Groth ce5b55ef1a Some updates to get packaing working after the gitlab migration. 2019-09-24 18:47:13 +00:00
Raoul Snyman 81e4db7463 Merge branch 'bzr2git' into 'master'
First stab at converting to use git while packaging.

See merge request openlp/packaging!1
2019-09-13 19:32:30 +00:00
Tomas Groth c9af8d577f First stab at converting to use git while packaging. 2019-09-13 19:32:29 +00:00
Raoul Snyman 1e1c642087 Package the VLC plugins too.
bzr-revno: 47
2019-07-16 13:20:59 +02:00
Raoul Snyman 9dee47520e Correct path to VLC libs on macOS, fix call to copytree 2019-07-03 23:33:08 -07:00
Raoul Snyman bd2abb355b Update Windows and macOS builders to copy VLC plugins 2019-07-03 23:23:21 -07:00
Raoul Snyman 2f90f0ea4a Add Pyro4 into the Mac build, update some license headers, and add a hidden import for sqlalchemy.ext.baked
bzr-revno: 46
2019-06-05 23:37:19 -07:00
Raoul Snyman bac0c45002 Fix up license headers 2019-06-04 23:04:54 -07:00
Raoul Snyman 9eb89fcf27 Update the year 2019-05-25 00:27:08 -07:00
Raoul Snyman a9691be825 HEAD 2019-05-22 14:55:08 -07:00
Raoul Snyman 0cde5d0981 Build a Windows Installer (MSI) file instead of using InnoSetup
bzr-revno: 45
2019-05-22 10:14:13 -07:00
Raoul Snyman c04282e102 Fix reference to a directory 2019-05-20 15:17:13 -07:00
Raoul Snyman 7a30015296 Fix some paths 2019-05-15 21:37:10 -07:00
Raoul Snyman a3088e878b Remove debugging 2019-05-15 16:02:19 -07:00
Raoul Snyman 919a96f0bc Add some debugging to figure out what's wrong with the program files variable 2019-05-15 15:57:56 -07:00
Raoul Snyman e88f99966e No need to find 32-bit Program Files because OpenLP is 64-bit; Only copy MuPDF if PyMuPDF is not installed; Use the proper Program Files directory for VLC 2019-05-15 15:39:12 -07:00
Raoul Snyman cccbb6d246 Revert version number inclusion, it doesn't work like I want it to. 2019-05-04 22:10:04 -07:00
Raoul Snyman 62a2d3f779 Version => ProductVersion 2019-05-04 14:54:14 -07:00
Raoul Snyman e9d5057083 Add a 256x256 icon size 2019-05-04 14:45:15 -07:00
Raoul Snyman 52b016075d Use the variables everywhere, and set the version in the name. Also register oszl files in macOS 2019-05-04 14:43:52 -07:00
Raoul Snyman ad1eb56234 Remove old InnoSetup installer 2019-05-02 22:08:14 -07:00
Raoul Snyman b7323b69d1 Copy the right icon file 2019-05-02 13:40:11 -07:00
Raoul Snyman 697cc77641 Fix the icon references 2019-05-01 23:18:53 -07:00
Raoul Snyman 2f386dbd67 Try to correct the icon by referencing the full path 2019-05-01 23:11:54 -07:00
Raoul Snyman 7b89228ab2 See if added a space helps 2019-05-01 23:07:24 -07:00
Raoul Snyman 6cd8d8909b Use the correct reference 2019-05-01 22:38:33 -07:00
Raoul Snyman 1ccfbe23f7 Icon is a reference to an Icon element 2019-05-01 22:30:12 -07:00
Raoul Snyman c4db85becd Continue to try to solve an issue with the Icon property 2019-05-01 22:18:40 -07:00
Raoul Snyman 3af1ec38a4 Try to solve an issue with the Icon property 2019-05-01 22:09:56 -07:00
Raoul Snyman 8940ca6833 Update service icon file name, and copy it into the dist directory as well 2019-04-30 23:21:19 -07:00
Raoul Snyman 06d323cda1 Update macOS license file 2019-04-30 23:20:58 -07:00
Raoul Snyman 2cecfb63c3 Use the right file name 2019-04-30 23:09:43 -07:00
Raoul Snyman d4166602ea Fix a variable 2019-04-30 23:06:17 -07:00
Raoul Snyman 6dd78d9b40 Add file association 2019-04-30 22:23:38 -07:00
Raoul Snyman b4bd034d2f Make sure the Firewall rule is only added to a single component 2019-04-25 15:27:54 -07:00
Raoul Snyman a88d398587 Id is not a GUID 2019-04-25 15:18:54 -07:00
Raoul Snyman 5e0a3a5a49 Try to figure out how to get lxml to add the namespace 2019-04-25 15:12:10 -07:00
Raoul Snyman 10d421b619 Add Firewall extension to candle and light 2019-04-25 14:54:48 -07:00
Raoul Snyman d9e3a66fe8 Try to fix up Firewall extension namespacing 2019-04-25 14:42:08 -07:00
Raoul Snyman 3344018f79 Add license back in, this time as GPL3 2019-04-25 14:13:06 -07:00
Raoul Snyman 19ef167ca9 Add Firewall exception to Windows installer 2019-04-25 14:10:53 -07:00
Raoul Snyman 51f0385ba7 Remove old assets, update existing assets, add upgrade logic to installer 2019-04-24 23:25:03 -07:00
Raoul Snyman 42c2026837 Remove license agreement screen 2019-04-13 14:15:15 -07:00
Raoul Snyman 596c633b13 Add import hook to see if that helps fix a problem 2019-04-12 11:50:36 -07:00
Raoul Snyman 94574b356a Fix for how os.path.join() works on Windows 2019-04-11 15:58:44 -07:00
Raoul Snyman 86f646beb3 Try to fix path to libvlc 2019-04-11 15:46:24 -07:00
Raoul Snyman ee809f1633 Bundle libvlc 2019-04-11 15:25:20 -07:00
Raoul Snyman 2151a84908 Add architecture into MSI file name 2019-04-11 09:54:19 -07:00
Raoul Snyman 2878cc7198 Use high compression 2019-04-11 09:51:13 -07:00
Raoul Snyman a422276ff3 Remain in the correct directory 2019-04-10 21:56:12 -07:00
Raoul Snyman e354f0304a Make WiX export to the base 'dist' directory 2019-04-10 21:41:53 -07:00
Raoul Snyman 965b779dbb Remove debugging 2019-04-10 21:06:11 -07:00
Raoul Snyman 10dab342bf Correct md5 hash 2019-04-10 15:11:20 -07:00
Raoul Snyman 66c32e6e79 Debugging -_- 2019-04-10 15:03:30 -07:00
Raoul Snyman 9c1c7443d9 Mark components as 64-bit 2019-04-10 14:59:40 -07:00
Raoul Snyman c0e6dfc226 Handle 64-bit apps properly in WiX 2019-04-10 14:27:09 -07:00
Raoul Snyman 96070b52a5 Change references to use md5 hashes 2019-04-10 14:17:03 -07:00
Raoul Snyman a0b803432b Add missing GPL license file 2019-04-10 13:56:59 -07:00
Raoul Snyman bffdbcff58 String needs to be encoded when passed to hashlib 2019-04-10 13:46:17 -07:00
Raoul Snyman 5bb973c118 Merge Tomas' fixes 2019-04-10 13:14:01 -07:00
Raoul Snyman 119b551afd Use md5 hashes instead of the file name and path 2019-04-10 12:59:51 -07:00
Tomas Groth 65082417e4 Check for msi to exist before trying to delete it. 2019-04-10 21:17:39 +02:00
Tomas Groth 52a9793686 Use the right path variable 2019-04-10 21:06:38 +02:00
Tomas Groth e8d780bf81 Fix for xml handling 2019-04-10 21:01:32 +02:00
Tomas Groth 40f1c24ecd Use a different approach to get platform info in wxs 2019-04-10 20:51:28 +02:00
Tomas Groth 85ead230a4 More fixes 2019-04-10 20:36:12 +02:00
Raoul Snyman f0b3ce65a1 Fix up errors in builder 2019-04-10 10:50:00 -07:00
Tomas Groth b3d31418ff More fixes and removal of inno setup stuff 2019-04-09 22:30:17 +02:00
Tomas Groth dbd350889b Assume xml is text rather than binary. 2019-04-09 21:28:25 +02:00
Tomas Groth 4b81713954 Small adjustments for wix packaging 2019-04-09 21:14:26 +02:00
Raoul Snyman 76ded370db HEAD 2019-04-08 21:18:23 -07:00
Raoul Snyman a0ebb0a926 Use WiX instead of InnoSetup 2019-04-08 21:14:43 -07:00
Tomas Groth d55d1209fd Fix some issues in windows packaging related to portable setup.
bzr-revno: 44
2019-03-14 21:44:37 +01:00
Tomas Groth 215fbc23cc remove debug print 2019-03-13 22:00:05 +01:00
Tomas Groth 293571a69a Add missing param 2019-03-13 21:39:11 +01:00
Tomas Groth 933325e9d1 Try to fix appveyor build of portable installer 2019-03-13 21:21:15 +01:00
Tomas Groth 9381311d7d Add a missing s 2019-03-11 14:46:12 +01:00
Tomas Groth d583f9a3cb Try to fix portable apps version. Also added oszl as file type. 2019-03-11 14:11:56 +01:00
Raoul Snyman f98ae61bce Fix up a problem where the macOS builder expected a variable to be set, but it was being skipped due to a dependent variable not being available yet. Used the `setup_extra()` hook so that it runs after all the other setup.
bzr-revno: 43
2019-03-10 20:53:29 +01:00
Raoul Snyman 03971e7e22 Fix macOS builder to set up `mutool_lib` in `setup_extra` rather than overriding `setup_paths`, which was causing issues. 2019-03-10 09:33:37 -07:00
Tomas Groth 41f9dbc828 Fix copying Qt translations on windows and add x86 or x64 to the windows installer files.
bzr-revno: 42
2019-03-09 21:36:19 +01:00
Tomas Groth 39a14d029d Fix copying Qt translations and add x86 or x64 to the bundled files. 2019-03-08 22:20:20 +01:00
Tomas Groth b32cc6d693 Update the packaging scripts to work on windows (and appveyor) with the new webengine bacnkend.
bzr-revno: 41
2019-03-07 20:28:24 +01:00
Tomas Groth f95a43be24 Make the windows builder more bit-aware 2019-03-05 20:55:59 +01:00
Tomas Groth b049edfb48 fix c/p error 2019-02-18 21:10:59 +01:00
Tomas Groth 03c3ea4319 fix typo 2019-02-18 21:04:40 +01:00
Tomas Groth fdc1afa8e8 fix syntax error 2019-02-18 20:59:28 +01:00
Tomas Groth 2827fdf90b copy font and display files 2019-02-18 20:48:44 +01:00
Tomas Groth 78a7c9bcda fix c/p error 2019-02-17 22:28:05 +01:00
Tomas Groth 815ef71a54 create folder before copying font 2019-02-17 22:23:18 +01:00
Tomas Groth 80eef6fc5b include font in package 2019-02-17 22:12:05 +01:00
Tomas Groth b2cb30f31b remove debug print again 2019-02-17 21:26:29 +01:00
Tomas Groth ccc6b44e2c support program files path on x64 2019-02-16 22:13:16 +01:00
Tomas Groth 64a22bd80c some debug print 2019-02-16 22:01:03 +01:00
Tomas Groth 936fa3fc78 reorder initialization again 2019-02-16 21:34:36 +01:00
Tomas Groth 3ae58f56df reorder initialization 2019-02-16 21:19:52 +01:00
Tomas Groth 6fc4e61f9f try to load config earlier 2019-02-15 23:12:48 +01:00
Tomas Groth 888a61ec2b try to load paths before exe 2019-02-15 23:06:24 +01:00
Tomas Groth fb4a66d47b debug print 2019-02-15 22:41:41 +01:00
Tomas Groth 75abfc27d9 debug print 2019-02-15 22:34:14 +01:00
Tomas Groth eb4711d70d try some new values 2019-02-15 22:12:24 +01:00
Tomas Groth aace963ea6 remove pptlibview build 2019-02-15 21:50:35 +01:00
Tomas Groth ba1564c7be try some new values 2019-02-15 21:43:26 +01:00
Tomas Groth eb853ebff9 update 2019-02-15 21:19:31 +01:00
Raoul Snyman 2753aaa5a6 macOS codesigning fails on Apps with periods in file names. Incorporated fixes from PyInstaller's wiki and also updated the version number to match our new versioning scheme.
bzr-revno: 40
2018-12-02 23:01:50 -07:00
Raoul Snyman 16a8037d44 Use new version number format 2018-12-01 23:07:08 -07:00
Raoul Snyman 499847bbcd Fix Qt paths so that code signing works 2018-10-27 10:35:03 -07:00
Raoul Snyman e17dfb2dad Fix builder script to use new OpenLP run script name.
bzr-revno: 39
2018-10-27 18:12:07 +02:00
Raoul Snyman 57caf4e5bb Fix builder script to use new OpenLP run script name. 2018-10-26 23:08:24 -07:00
Tomas Groth 1872fd58f6 Add an option for providing tag and revision to avoid using bzr. Useful on Appveyor where bzr does not work.
bzr-revno: 38
2018-07-13 21:19:14 +02:00
Tomas Groth afcc047ee3 Add an option for providing tag and revision to avoid using bzr. 2018-07-12 21:41:00 +02:00
Tomas Groth d05247ea47 Change method name 2017-09-28 21:25:51 +02:00
Tomas Groth 2df10e780d forgot to import glob 2017-09-27 22:53:43 +02:00
Tomas Groth 645a55b3b3 fix method call 2017-09-27 22:39:45 +02:00
Tomas Groth 770caefae7 Fix idention. 2017-09-27 22:33:01 +02:00
Tomas Groth d13c07c58e Try some backslash escaping 2017-09-27 22:26:18 +02:00
Tomas Groth 1b12ae51e1 Fix idention. 2017-09-27 22:15:53 +02:00
Tomas Groth 0ad2a6186a Try to include new ucrt distributables in win build. 2017-09-26 23:58:42 +02:00
Tomas Groth 9ae3703f76 Revert some changes. 2017-09-26 22:06:28 +02:00
Tomas Groth 42741cbfb2 forgot a s. 2017-09-26 21:58:20 +02:00
Tomas Groth 6ecb97abe7 fix copy/paste error 2017-09-26 21:39:33 +02:00
Tomas Groth d6784e38cb try some things 2017-09-26 21:34:59 +02:00
Tomas Groth 4d8962b7e5 clean up config file 2017-09-26 20:30:22 +02:00
Tomas Groth 40116f03f0 Load paths before executables. 2017-09-26 20:24:18 +02:00
Tomas Groth 468f1a22c8 hardcode python script path 2017-09-25 22:59:43 +02:00
Tomas Groth c42ac962b1 update settings 2017-09-25 22:31:41 +02:00
Tomas Groth beb92f149b Try to update packaging. 2017-09-25 21:58:43 +02:00
Raoul Snyman dacbab0e4e Change icons, logos and artwork for 2.6 builds on macOS
bzr-revno: 37
2017-06-03 12:25:56 -07:00
Raoul Snyman 4e4f53e717 Change icons, logos and artwork for 2.6 builds on macOS 2017-05-31 22:09:38 -07:00
Raoul Snyman ce600ef332 Change icons, logos and artwork for 2.6 builds on macOS 2017-05-31 22:09:25 -07:00
Tomas Groth a193e55ff8 Update to the appveyor config.
bzr-revno: 36
2017-05-04 23:02:26 +02:00
Tomas Groth 4da9929462 Update to use appveyors qt installation for lrelease 2017-05-02 22:21:06 +02:00
Raoul Snyman f69aa011c0 Fix bug #1676163 by copying in all the Qt translation files (they were broken out into different files in Qt5)
bzr-revno: 35
2017-03-27 22:27:39 -07:00
Raoul Snyman 7aed09ad84 Copy all the Qt translations, not just some of them 2017-03-27 17:05:46 -07:00
Raoul Snyman 507c43d547 Make debug mode explicit.
bzr-revno: 34
2016-12-15 17:53:07 +02:00
Raoul Snyman f23d42f67a HEAD 2016-12-15 17:24:20 +02:00
Raoul Snyman eece48fb3d Only perform a debug PyInstaller build if the '--debug' flag is set 2016-12-15 17:20:00 +02:00
Raoul Snyman 6759718d9b Refactor the Windowsand macOS builders to reuse common code. Fix the issue with dud builds when using PyInstaller 3.2.
bzr-revno: 33
2016-12-13 22:43:22 +02:00
Raoul Snyman c5654e4256 Always put the revision number at the end of the portable build number 2016-12-12 21:02:33 +02:00
Raoul Snyman 8efeae39f1 Merge from remote 2016-12-12 19:48:13 +02:00
Raoul Snyman 648afbef34 dist_path is weird 2016-12-12 18:43:19 +02:00
Raoul Snyman 6fe60a1c94 Path needs to be absolute 2016-12-12 12:00:31 +02:00
Raoul Snyman 19b5a489cf (hopefully) Fix the portable build once and for all 2016-12-11 14:20:35 +02:00
Raoul Snyman a2c416b09b Try to get the portable filename right 2016-12-10 23:12:38 +02:00
Raoul Snyman 4ad35f87c5 Fix up some messages, make some messages only show in verbose mode, and add some more logging for debugging 2016-12-09 11:52:33 +02:00
Raoul Snyman 2a52c24fa3 Fix indentation 2016-12-09 01:39:07 +02:00
Raoul Snyman 5c2b25c233 Fix a typo 2016-12-09 01:38:22 +02:00
Raoul Snyman 47ad69b9ae metavar is not needed with a flag 2016-12-07 23:49:54 +02:00
Raoul Snyman 1d27ba766d Make portable argument a flag 2016-12-07 19:09:07 +02:00
Raoul Snyman dc3f564082 Make portable argument a flag 2016-12-07 19:08:40 +02:00
Raoul Snyman aa3c2d2f13 Fix up version numbers for InnoSetup and PortableApps 2016-12-07 15:18:50 +02:00
Raoul Snyman ea2c3b7be1 Put some more stuff in the config file - makes referencing it later easier 2016-12-06 23:02:14 +02:00
Raoul Snyman 6eb26bf183 Remove refences to script_path and change them to config_dir/config_path 2016-12-06 22:51:27 +02:00
Raoul Snyman 9425cd40f0 Oops, can't reference a value before it exists 2016-12-06 22:27:46 +02:00
Raoul Snyman 7d98b5ab2a Move some logging around and fix up a path to the icon file 2016-12-06 22:11:10 +02:00
Raoul Snyman 77c9b883a9 Add some more debug logging to figure out what's going on with the paths 2016-12-06 21:58:41 +02:00
Raoul Snyman 2f7e689c99 Add some more debug logging to figure out what's going on with the paths 2016-12-06 21:43:40 +02:00
Raoul Snyman 0a2a90794e Make provision for Microsoft's exceptional wisdom in making an exit code of 1 be a success 2016-12-06 21:03:42 +02:00
Raoul Snyman 71f000a5c8 Make stdout a string instead of bytes, update AppVeyor config 2016-12-06 00:57:59 +02:00
Raoul Snyman 6e6f6ddf2d Absolute paths 2016-12-05 23:39:17 +02:00
Raoul Snyman 5ce4f143fa %(here)s should be the directory of the config file 2016-12-05 23:36:20 +02:00
Raoul Snyman 751e771bb1 Update AppVeyor config 2016-12-05 23:22:29 +02:00
Raoul Snyman 4cdcc9b7b1 Translation locations are different on different platforms 2016-12-05 23:18:21 +02:00
Raoul Snyman f4f7fc9cad A few fixes to the macOS builder, and fix up the Windows builder 2016-12-05 20:23:50 +02:00
Raoul Snyman 05dde36a9e Fix up the rest of the macOS builder 2016-12-03 17:22:08 +02:00
Raoul Snyman dbd59b9a3c Refactor the builders so that we can inherit as much common code as possible 2016-12-03 13:23:23 +02:00
second@tgc.dk 86629d4e42 Added support for MediaInfo windows builds.
Added a appveyor specific config file.
Updated some docs in windows-builder.py.

bzr-revno: 32
2016-12-01 09:09:05 +01:00
Tomas Groth b5b2b358a6 Added mediainfo support in packaging 2016-11-29 14:38:50 +01:00
Tomas Groth 73deeba30b Added config for AppVeyor 2016-11-29 13:57:11 +01:00
Raoul Snyman 42f6facc30 Add support for the new LibreOffice presentations on macOS via Pyro4 2016-11-26 00:45:27 +02:00
raoul@snyman.info ea2cf8459f Update the macOS build system to use dmgbuild instead of manually running hdiutil and AppleScript.
bzr-revno: 31
2016-11-12 13:58:52 +02:00
Raoul Snyman 5fd896e2f0 Add extra file for mutool 2016-11-10 22:33:23 +02:00
Raoul Snyman 6c48676954 Use dmgbuild instead of all the manual nonsense 2016-09-24 23:46:19 +02:00
raoul@snyman.info 36e1961b9d "Various updates to the OS X packaging scripts:
1. Further attempts to make the DMG layout and background stick (still not working)
2. Create a shiny new icon for the DMG with the OpenLP logo on it
3. Create new versions of the app and DMG icons with the new logo for when we move to that
4. Make the builder script work better"

bzr-revno: 30
2016-05-17 22:55:19 +02:00
Raoul Snyman b5fab5c8f7 Add a proper icon for the DMG image, plus versions of the new OpenLP logo; Also try to fix the background and placing fail 2016-05-03 22:04:45 +02:00
second@tgc.dk 6f227290d5 Update windows building for qt5.
bzr-revno: 29
2016-01-05 21:14:09 +01:00
Tomas Groth 846bd214ff Update windows building for qt5 2016-01-03 22:10:14 +01:00
springermac@gmail.com a2a5def091 Changes for Qt5
bzr-revno: 28
2015-12-26 22:50:51 +01:00
Jonathan Springer 27d9136229 merge trunk 2015-12-23 12:16:13 -05:00
Jonathan Springer 8e2fa9d7ef Changes for Qt5 2015-12-23 12:14:43 -05:00
Jonathan Springer 1dbacbb634 Merge trunk 2015-10-17 08:28:04 -04:00
raoul@snyman.info 1a05686931 "[Windows] Rename OpenLP-2.0.iss.default to OpenLP.iss.default and update all references to it."
bzr-revno: 27
Fixes: https://launchpad.net/bugs/1489338
2015-10-14 23:30:59 +02:00
Raoul Snyman fa3832de1f [Windows] Update all references to the ISS file after renaming it 2015-10-13 21:56:37 +02:00
Raoul Snyman 87364a9c7a Move and update InnoSetup file -> make the Start Menu group name just 'OpenLP' 2015-10-13 14:13:29 +02:00
springermac@gmail.com fe32bfd7fe "Fix windows-builder
Fix ssl hook due to PyInstaller changes"

bzr-revno: 26
2015-10-05 22:51:52 +02:00
Jonathan Springer 44c92cd89a Fix windows-builder
Fix ssl hook due to PyInstaller changes
2015-09-28 13:33:21 -04:00
Jonathan Springer 3143ef9ec1 Add missed values in default config(OS X)
bzr-revno: 25
2015-08-30 22:17:29 +02:00
Jonathan Springer 188cb87a5a Add missed values in default config(OS X). 2015-08-28 16:36:44 -04:00
Jonathan Springer a4fbaa6d7f Add codesigning(OS X). Add apple help file(OS X). Add missed ssl runtime hook(OS X).
bzr-revno: 24
2015-08-28 21:31:35 +02:00
urs.rau@gmail.com 6c3619f246 This adds the openLP version number into the windows uninstaller registry keys. Inno setup does all the heavy lifting, all we had to do was tell the inno iss script the openLP version number.
bzr-revno: 23
Fixes: https://launchpad.net/bugs/1488081
2015-08-28 20:28:25 +02:00
Jonathan Springer b8e5d2c169 Add missing ssl runtime hook(OS X)
bzr-revno: 22
2015-08-26 22:59:06 +02:00
Jonathan Springer 653ac17b57 Add missing ssl runtime hook(OS X) 2015-08-26 15:04:40 -04:00
TheBigBear 00a6dccc52 fixed bug #1488081 has no "DisplayVersion" in uninstaller reg key
Fixes: https://launchpad.net/bugs/1488081
2015-08-25 09:45:08 +01:00
Jonathan Springer 86edfe1e9a merge trunk 2015-08-24 15:32:33 -04:00
Jonathan Springer a3b8e89c40 Show PyInstaller DEBUG output when run with verbose option.
Use debug bootloader when building devel version.
Add ssl hook and runtime hook to include certificates for Mac OS X(OS X).
Fix release app version(OS X).
Fix converting bytes to megabytes(OS X).
Fix argument to cp command(OS X).

bzr-revno: 21
Fixes: https://launchpad.net/bugs/1450596
2015-08-24 21:28:12 +02:00
Jonathan Springer a31003335a Add codesigning(OS X).
Add apple help file(OS X).
2015-08-24 14:14:55 -04:00
Jonathan Springer 3bd987ffcf Show PyInstaller DEBUG output when run with verbose option.
Use debug bootloader when building devel version.
Add ssl hook and runtime hook to include certificates for Mac OS X(OS X).
Fix release app version(OS X).
Fix converting bytes to megabytes(OS X).
Fix argument to cp command(OS X).
2015-08-23 20:53:43 -04:00
Jonathan Springer 38550840d8 merge trunk 2015-07-27 12:58:33 -04:00
Tomas Groth 00e459da7a Rename hook to make it work.
bzr-revno: 20
2015-07-14 21:57:23 +02:00
Tomas Groth 4ab98b6387 Rename hook to make it work. 2015-06-28 10:51:28 +01:00
Tomas Groth ea7a2e4f12 Changes to make windows building on CI easier 2015-06-28 10:50:54 +01:00
Raoul Snyman 0d66066160 Add mysql-connector-python to hidden imports for PyInstaller
bzr-revno: 19
2015-06-16 22:47:59 +02:00
Raoul Snyman 62d86bb4d0 Fixed copyright for TRB143 2015-06-16 22:07:34 +02:00
Raoul Snyman ba50833965 Add mysql-connector-python to hidden imports 2015-06-12 22:57:23 +02:00
Raoul Snyman 031a9a0ce7 Add the build scripts from the server into the packaging repo
bzr-revno: 18
2015-06-09 21:47:48 +02:00
Jonathan Springer 119c10b009 Fix bundle identifier for Mac OS X
bzr-revno: 17
2015-05-28 00:16:39 +02:00
Jonathan Springer e131a61ba9 Fix bundle identifier for Mac OS X 2015-05-25 22:50:06 -04:00
Raoul Snyman 2a65831fe6 Add the build scripts from the server into the packaging repo 2015-05-23 19:58:14 -04:00
Raoul Snyman ee9075cc14 Modify OS X builder to build specific release versions
bzr-revno: 16
2014-11-25 23:33:24 +02:00
Raoul Snyman 99c942d277 Modify OS X builder to build specific release versions 2014-11-09 01:47:37 +02:00
Jonathan Springer c29a1a04d2 Fix mudraw location for Mac OS X and change sphinx build to use the python 3.4 version
bzr-revno: 15
2014-10-29 18:37:57 +00:00
Jonathan Springer 5d1f7cf9f0 Fix mudraw location for Mac OS X and change sphinx build to use the python 3.4 version 2014-10-29 11:51:28 -04:00
Stevan Pettit b06ffcbb40 Changed the location of the Windows innosetup executable to match the current location that is being use in the 2.0.x builds.
bzr-revno: 14
2014-10-28 20:34:31 +02:00
Steve Pettit elderp@rwoodupc.org c678df4fc6 Changed file location of Windows executable to avoid conflict with portable build 2014-10-26 20:08:27 -04:00
Tomas Groth c6a20d66f0 Removed workarounds for fixed PyInstaller issues.
Moved mudrawbin option to config.ini.
Updated documentation in the comments.

bzr-revno: 13
2014-09-06 07:46:07 +01:00
Tomas Groth 300ed9159d Fixed typo 2014-09-02 20:17:54 +01:00
Tomas Groth 39e5d9a741 Removed workaround for another fixed PyInstaller issue. 2014-09-02 16:09:51 +02:00
Tomas Groth 621fde2f44 Removed workaround for fixed PyInstaller issues. Moved mudrawbin option to config.ini. 2014-09-02 15:07:50 +02:00
Jonathan Springer d4844ce03b Link mudraw binary to bundled libraries on Mac OS X
Add Retina support for Mac
Add bzrignore

bzr-revno: 12
2014-06-14 15:51:38 +02:00
Jonathan Springer 3ddaec0046 Add config.ini to bzrignore 2014-06-13 23:40:58 -04:00
Jonathan Springer a4d4d233b0 Link mudraw binary to bundled libraries on Mac OS X 2014-06-13 23:40:12 -04:00
Jonathan Springer 8b446d6819 merge trunk 2014-06-08 17:51:10 -04:00
Tomas Groth b9033fe04f Fix for windows packaging of 2.1 Also bundles mudraw for pdf support.
Includes some temporary workarounds for pyinstaller issues.

bzr-revno: 11
2014-06-08 21:27:04 +01:00
Tomas Groth 9a512a548c Fixes for packaging on windows. Also added packaging of mudraw for Pdf support. 2014-05-30 10:59:26 +02:00
Jonathan Springer 7dab89c343 Add Retina support for mac 2014-05-26 10:41:32 -04:00
Jonathan Springer 922bb1ce04 Add a bzrignore file 2014-05-26 10:41:06 -04:00
Jonathan Springer bbe296c19c Migrate to python 3
bzr-revno: 10
2014-05-17 20:27:11 +01:00
Jonathan Springer ec7df6dd5a Fix getting bzr tags 2014-05-06 16:05:05 -04:00
Jonathan Springer c0cbc8a014 Fix python3 issues and include the default theme json file 2014-05-06 15:51:27 -04:00
Jonathan Springer b66db894fd Change to 120 charcter limit 2014-05-06 12:04:21 -04:00
Jonathan Springer 4bd0610ad8 Run 2to3 2014-05-06 11:52:07 -04:00
Martin Zibricky df91c7144c Reflect renaming of openlp.pyw -> openlp.py in windows/osx build scripts.
bzr-revno: 9
Fixes: https://launchpad.net/bugs/779201, https://launchpad.net/bugs/814838
2013-02-05 20:45:39 +01:00
Martin Zibricky f981c590a2 Main script was renamed openl.pyw -> openlp.py. Packaging scripts updated. 2013-02-03 15:56:42 +01:00
Martin Zibricky f59703015a Merge with packaging trunk. 2013-02-03 15:54:34 +01:00
Stevan Pettit 57e7709c04 Added code so current version info is displayed to user during the Inno setup.
bzr-revno: 8
2013-01-24 22:10:36 +02:00
ElderP d3a1f07108 Display current version info during the Inno setup 2013-01-20 18:10:49 -05:00
65 changed files with 4806 additions and 2368 deletions

37
.bzrignore Normal file
View File

@ -0,0 +1,37 @@
*.pyc
*.*~
\#*\#
*.eric4project
*.eric5project
*.ropeproject
*.e4*
.eric4project
.komodotools
*.komodoproject
list
openlp.org 2.0.e4*
documentation/build/html
documentation/build/doctrees
*.log*
dist
OpenLP.egg-info
build
resources/innosetup/Output
_eric4project
.pylint.d
*.qm
openlp/core/resources.py.old
*.qm
resources/windows/warnOpenLP.txt
openlp.cfg
.idea
openlp.pro
.kdev4
tests.kdev4
*.nja
*.orig
__pycache__
*.dll
*.DS_Store
config.ini
*.dmg

2
.flake8 Normal file
View File

@ -0,0 +1,2 @@
[flake8]
max-line-length=120

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
__pycache__
*.pyc
config.ini
*.spec

674
LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

594
builders/builder.py Normal file
View File

@ -0,0 +1,594 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
"""
Base class for the Windows and macOS builders.
"""
import os
import re
import runpy
import sys
from argparse import ArgumentParser
from configparser import ConfigParser
from io import StringIO
from pathlib import Path
from shutil import copy, rmtree
from subprocess import Popen, PIPE
BUILDER_DESCRIPTION = 'Build OpenLP for {platform}. Options are provided on both the command line and a ' \
'configuration file. Options in the configuration file are overridden by the command line options.\n\n' \
'This build system can produce either development or release builds. A development release uses the ' \
'code as-is in the specified branch directory. The release build exports a tag from git and uses the ' \
'exported code for building. The two modes are invoked by the presence or absence of the --release ' \
'option. If this option is omitted, a development build is built, while including the --release ' \
'option with a version number will produce a build of that exact version.'
PEP440 = re.compile(r'(?P<major>\d)\.(?P<minor>\d)(\.(?P<fix>\d))?((?P<pre>a|b|rc)(?P<rel>\d))?')
def _which(program):
"""
Return absolute path to a command found on system PATH.
"""
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath and is_exe(os.path.abspath(program)):
return os.path.abspath(program)
else:
for path in os.environ['PATH'].split(os.pathsep):
path = path.strip('"')
exe_file = os.path.join(path, program)
if is_exe(exe_file):
return exe_file
return None
class Builder(object):
"""
A Generic class to base other operating system specific builders on
"""
def __init__(self):
self.setup_args()
self.setup_system_paths()
self.read_config()
self.setup_paths()
self.setup_executables()
self.setup_extra()
def _print(self, text, *args):
"""
Print stuff out. Later we might want to use a log file.
"""
if len(args) > 0:
text = text % tuple(args)
print(text)
def _print_verbose(self, text, *args):
"""
Print output, obeying "verbose" mode.
"""
if self.args.verbose:
self._print(text, *args)
def _run_command(self, cmd, err_msg, exit_code=0):
"""
Run command in subprocess and print error message in case of Exception.
Return text from stdout.
"""
proc = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
output, error = proc.communicate()
code = proc.wait()
if code != exit_code:
self._print(output)
self._print(error)
raise Exception(err_msg)
return output, error
def _run_module(self, module, argv, err_msg, run_name=None):
"""
Run a python module as if python -m <module>
"""
self._run_runpy('module', module, argv, err_msg, run_name)
def _run_path(self, path, argv, err_msg, run_name=None):
"""
Run a python script as if python <path>
"""
self._run_runpy('path', path, argv, err_msg, run_name)
def _run_runpy(self, run_type, exe_arg, argv, err_msg, run_name=None):
"""
Run a python script or module
"""
# Capture stdout and stderr
stdout_back = sys.stdout
stderr_back = sys.stderr
new_stdout = StringIO()
new_stderr = StringIO()
sys.stdout = new_stdout
sys.stderr = new_stderr
# Set args
sys.argv = argv
exit_code = 0
try:
self._print_verbose('... {}'.format(' '.join(argv)))
if run_type == 'module':
runpy.run_module(exe_arg, run_name=run_name)
else:
runpy.run_path(exe_arg, run_name=run_name)
except SystemExit as se:
if se.code and se.code != 0:
exit_code = se.code
finally:
# Set stdout and stderr back to standard
sys.stdout = stdout_back
sys.stderr = stderr_back
if exit_code != 0:
self._print(new_stdout.getvalue())
self._print(new_stderr.getvalue())
raise Exception(err_msg)
else:
self._print_verbose(new_stdout.getvalue())
self._print_verbose(new_stderr.getvalue())
def _git(self, command, work_path, args=[], err_msg='There was an error running git'):
"""
Update the code in the branch.
"""
os.chdir(work_path)
output, _ = self._run_command(['git', command] + args, err_msg)
return output
def parse_pep440_version(self, version: str) -> dict:
"""Parse a PEP440-compatible version number into a dictionary"""
if m := PEP440.match(version):
groups = m.groupdict()
if not groups.get('fix'):
groups['fix'] = '0'
return groups
else:
return None
def get_platform(self):
"""
Return the platform we're building for
"""
return 'unspecified'
def get_config_defaults(self):
"""
Build some default values for the config file
"""
return {
'here': os.path.dirname(self.config_path),
'home': str(Path.home())
}
def get_sphinx_build(self):
"""
Get the type of build we should be running for Sphinx. Defaults to html.
"""
return 'html'
def get_qt_translations_path(self):
"""
Return the path to Qt's translation files
"""
return ''
def add_extra_args(self, parser):
"""
Add extra arguments to the argument parser
"""
pass
def setup_args(self):
"""
Set up an argument parser and parse the command line arguments.
"""
parser = ArgumentParser(description=BUILDER_DESCRIPTION.format(platform=self.get_platform()))
parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', default=False,
help='Print out additional information')
parser.add_argument('-c', '--config', metavar='FILENAME', required=True,
help='Specify the path to the configuration file')
parser.add_argument('-b', '--branch', metavar='PATH', help='Specify the path to the branch you wish to build')
parser.add_argument('-r', '--release', metavar='VERSION', default=None,
help='Build a release version of OpenLP with the version specified')
parser.add_argument('-x', '--export', dest='can_export', action='store_true', default=False,
help='Export when building a release. Defaults to false, ignored for non-release builds')
parser.add_argument('-d', '--documentation', metavar='PATH', default=None,
help='Specify the path to the documentation branch')
parser.add_argument('-t', '--update-translations', action='store_true', default=False,
help='Update the translations from Transifex')
parser.add_argument('-u', '--transifex-user', metavar='USERNAME', default=None, help='Transifex username')
parser.add_argument('-p', '--transifex-pass', metavar='PASSWORD', default=None, help='Transifex password')
parser.add_argument('--skip-update', action='store_true', default=False,
help='Do NOT update the branch before building')
parser.add_argument('--skip-translations', action='store_true', default=False,
help='Do NOT update the language translation files')
parser.add_argument('--debug', action='store_true', default=False, help='Create a debug build')
parser.add_argument('--tag-override', metavar='<tag>.dev<revision-count>+<commit-hash>', default=None,
help='Override tag and revision, should be in format <tag>.dev<revision-count>+<commit-hash>') # noqa
self.add_extra_args(parser)
self.args = parser.parse_args()
def read_config(self):
"""
Read the configuration from the configuration file.
"""
self.config = ConfigParser(defaults=self.get_config_defaults())
self.config.read(self.config_path)
def setup_system_paths(self):
"""
Set up some system paths.
"""
self.python = sys.executable
self.script_path = os.path.dirname(os.path.abspath(__file__))
self.config_path = os.path.abspath(self.args.config)
self._print_verbose('System paths:')
self._print_verbose(' {:.<20}: {}'.format('python: ', self.python))
self._print_verbose(' {:.<20}: {}'.format('script: ', self.script_path))
self._print_verbose(' {:.<20}: {}'.format('config: ', self.config_path))
def setup_executables(self):
"""
Set up the paths to the executables we use.
"""
self._print_verbose('Executables:')
for executable in self.config.options('executables'):
path = self.config.get('executables', executable)
if not path.strip():
path = None
else:
path = _which(path)
setattr(self, '{exe}_exe'.format(exe=executable), path)
self._print_verbose(' {exe:.<20} {path}'.format(exe=executable + ': ', path=path))
def setup_paths(self):
"""
Set up a variety of paths that we use throughout the build process.
"""
self._print_verbose('Paths:')
for name in self.config.options('paths'):
path = os.path.abspath(self.config.get('paths', name))
setattr(self, '{name}_path'.format(name=name), path)
self._print_verbose(' {name:.<20} {path}'.format(name=name + ': ', path=path))
# Make any command line options override the config file
if self.args.branch:
self.branch_path = os.path.abspath(self.args.branch)
if self.args.documentation:
self.documentation_path = os.path.abspath(self.args.documentation)
if self.args.release:
self.version = self.args.release
else:
self.version = None
if self.args.release and self.args.can_export:
self.work_path = os.path.abspath(os.path.join(self.branch_path, '..', 'OpenLP-' + self.version))
else:
self.work_path = self.branch_path
self.openlp_script = os.path.abspath(os.path.join(self.work_path, 'openlp', '__main__.py'))
self.source_path = os.path.join(self.work_path, 'openlp')
self.manual_path = os.path.join(self.documentation_path, 'manual')
self.manual_build_path = os.path.join(self.manual_path, 'build')
self.i18n_utils = os.path.join(self.work_path, 'scripts', 'translation_utils.py')
self.i18n_path = os.path.join(self.work_path, 'resources', 'i18n')
self.build_path = os.path.join(self.work_path, 'build')
# Print out all the values
self._print_verbose(' {:.<20} {}'.format('openlp script: ', self.openlp_script))
self._print_verbose(' {:.<20} {}'.format('source: ', self.source_path))
self._print_verbose(' {:.<20} {}'.format('manual path: ', self.manual_path))
self._print_verbose(' {:.<20} {}'.format('manual build path: ', self.manual_build_path))
self._print_verbose(' {:.<20} {}'.format('i18n utils: ', self.i18n_utils))
self._print_verbose(' {:.<20} {}'.format('i18n path: ', self.i18n_path))
self._print_verbose(' {:.<20} {}'.format('build path: ', self.build_path))
self._print_verbose('Overrides:')
self._print_verbose(' {:.<20} {}'.format('branch **: ', self.branch_path))
self._print_verbose(' {:.<20} {}'.format('documentation **: ', self.documentation_path))
self._print_verbose(' {:.<20} {}'.format('version: ', self.version))
self._print_verbose(' {:.<20} {}'.format('work path: ', self.work_path))
def setup_extra(self):
"""
Extra setup to run
"""
pass
def update_code(self):
"""
Update the code in the branch.
"""
self._print('Reverting any changes to the code...')
self._git('reset', self.branch_path, ['--hard'], err_msg='Error reverting the code')
self._print('Cleaning any extra files...')
self._git('clean', self.branch_path, ['--quiet', '--force', '-d'],
err_msg='Error cleaning up extra files')
self._print('Updating the code...')
self._git('pull', self.branch_path, ['--rebase'], err_msg='Error updating the code')
def export_release(self):
"""
Export a particular release
"""
if os.path.exists(self.work_path):
rmtree(self.work_path)
self._print('Exporting the release version...')
# Note that it is very important that the prefix ends with a slash to get the files into the folder
self._git('checkout-index', self.branch_path, ['-f', '-a', '--prefix={folder}/'.format(folder=self.work_path)],
'Error exporting the code')
def get_extra_parameters(self):
"""
Return a list of any extra parameters we wish to use
"""
return []
def run_pyinstaller(self):
"""
Run PyInstaller on the branch to build an executable.
"""
self._print('Running PyInstaller...')
os.chdir(self.work_path)
cmd = ['pyinstaller'
'--clean',
'--noconfirm',
'--windowed',
'--noupx',
'--additional-hooks-dir', self.hooks_path,
'--runtime-hook', os.path.join(self.hooks_path, 'rthook_ssl.py'),
# Import to make sqlalchemy work.
# Can't be in the custom hook folder because it will conflict with PyInstallers hook
'--hidden-import', 'sqlalchemy.ext.baked',
'-i', self.icon_path,
'-n', 'OpenLP',
*self.get_extra_parameters(), # Adds any extra parameters we wish to use
self.openlp_script
]
if self.args.verbose:
cmd.append('--log-level=DEBUG')
else:
cmd.append('--log-level=ERROR')
if self.args.debug:
cmd.append('-d')
self._run_module('PyInstaller', cmd, 'Error running PyInstaller', run_name='__main__')
def write_version_file(self):
"""
Write the version number to a file for reading once installed.
"""
self._print('Writing version file...')
if not self.args.release:
if self.args.tag_override:
self.version = self.args.tag_override
else:
# This is a development build, get the version info based on tags
git_version = self._git('describe', self.branch_path, ['--tags'], err_msg='Error running git describe')
if not git_version or len(git_version.strip()) == 0:
self.version = '0.0.0'
else:
self.version = '+'.join(git_version.strip().rsplit('-g', 1))
self.version = '.dev'.join(self.version.rsplit('-', 1))
try:
os.makedirs(self.dist_path)
except FileExistsError:
pass
# Write the version to the version file
with open(os.path.join(self.dist_path, '.version'), 'w') as version_file:
version_file.write(str(self.version))
def copy_default_theme(self):
"""
Copy the default theme to the correct directory for OpenLP.
"""
self._print('Copying default theme...')
source = os.path.join(self.source_path, 'core', 'lib', 'json')
dest = os.path.join(self.dist_path, 'core', 'lib', 'json')
for root, _, files in os.walk(source):
for filename in files:
if filename.endswith('.json'):
dest_path = os.path.join(dest, root[len(source) + 1:])
if not os.path.exists(dest_path):
os.makedirs(dest_path)
self._print_verbose('... %s', filename)
copy(os.path.join(root, filename), os.path.join(dest_path, filename))
def copy_plugins(self):
"""
Copy all the plugins to the correct directory so that OpenLP sees that
it has plugins.
"""
self._print('Copying plugins...')
source = os.path.join(self.source_path, 'plugins')
dest = os.path.join(self.dist_path, 'plugins')
for root, _, files in os.walk(source):
for filename in files:
if not filename.endswith('.pyc'):
dest_path = os.path.join(dest, root[len(source) + 1:])
if not os.path.exists(dest_path):
os.makedirs(dest_path)
self._print_verbose('... %s', filename)
copy(os.path.join(root, filename), os.path.join(dest_path, filename))
def copy_media_player(self):
"""
Copy the media players to the correct directory for OpenLP.
"""
self._print('Copying media player...')
source = os.path.join(self.source_path, 'core', 'ui', 'media')
dest = os.path.join(self.dist_path, 'core', 'ui', 'media')
for root, _, files in os.walk(source):
for filename in files:
if not filename.endswith('.pyc'):
dest_path = os.path.join(dest, root[len(source) + 1:])
if not os.path.exists(dest_path):
os.makedirs(dest_path)
self._print_verbose('... %s', filename)
copy(os.path.join(root, filename), os.path.join(dest_path, filename))
def copy_font_files(self):
"""
Copy OpenLP font files
"""
self._print('Copying OpenLP fonts files...')
src_dir = os.path.join(self.source_path, 'core', 'ui', 'fonts')
dst_dir = os.path.join(self.dist_path, 'core', 'ui', 'fonts')
font_files = ['OpenLP.ttf', 'openlp-charmap.json']
try:
os.makedirs(dst_dir)
except FileExistsError:
pass
for font_file in font_files:
src = os.path.join(src_dir, font_file)
dst = os.path.join(dst_dir, font_file)
copy(src, dst)
def copy_display_files(self):
"""
Copy OpenLP display HTML files
"""
self._print('Copying OpenLP HTML display files...')
src_dir = os.path.join(self.source_path, 'core', 'display', 'html')
dst_dir = os.path.join(self.dist_path, 'core', 'display', 'html')
try:
os.makedirs(dst_dir)
except FileExistsError:
pass
for display_file in os.listdir(src_dir):
src = os.path.join(src_dir, display_file)
dst = os.path.join(dst_dir, display_file)
copy(src, dst)
def copy_extra_files(self):
"""
Copy any extra files which are particular to a platform
"""
pass
def update_translations(self):
"""
Update the translations.
"""
self._print('Updating translations...')
username = None
password = None
if self.args.transifex_user:
username = self.args.transifex_user
if self.args.transifex_password:
password = self.args.transifex_pass
if (not username or not password) and not self.config.has_section('transifex'):
raise Exception('No section named "transifex" found.')
elif not username and not self.config.has_option('transifex', 'username'):
raise Exception('No option named "username" found.')
elif not password and not self.config.has_option('transifex', 'password'):
raise Exception('No option named "password" found.')
if not username:
username = self.config.get('transifex', 'username')
if not password:
password = self.config.get('transifex', 'password')
os.chdir(os.path.split(self.i18n_utils)[0])
self._run_command([self.python, self.i18n_utils, '-qdpu', '-U', username, '-P', password],
err_msg='Error running translation_utils.py')
def compile_translations(self):
"""
Compile the translations for Qt.
"""
self._print('Compiling translations...')
if not os.path.exists(os.path.join(self.dist_path, 'i18n')):
os.makedirs(os.path.join(self.dist_path, 'i18n'))
for filename in os.listdir(self.i18n_path):
if filename.endswith('.ts'):
self._print_verbose('... %s', filename)
source_path = os.path.join(self.i18n_path, filename)
dest_path = os.path.join(self.dist_path, 'i18n', filename.replace('.ts', '.qm'))
self._run_command((self.lrelease_exe, '-compress', '-silent', source_path, '-qm', dest_path),
err_msg='Error running lconvert on %s' % source_path)
self._print('Copying Qt translation files...')
source = self.get_qt_translations_path()
for filename in os.listdir(source):
if filename.startswith('qt') and filename.endswith('.qm'):
self._print_verbose('... %s', filename)
copy(os.path.join(source, filename), os.path.join(self.dist_path, 'i18n', filename))
def run_sphinx(self):
"""
Run Sphinx to build the manual
"""
self._print('Running Sphinx...')
self._print_verbose('... Deleting previous help manual build... %s', self.manual_build_path)
if os.path.exists(self.manual_build_path):
rmtree(self.manual_build_path)
os.chdir(self.manual_path)
sphinx_build = self.get_sphinx_build()
args = ['sphinx', '-b', sphinx_build, '-d', 'build/doctrees', 'source', 'build/{}'.format(sphinx_build)]
self._run_module('sphinx', args, 'Error running sphinx', run_name='__main__')
self.after_run_sphinx()
def after_run_sphinx(self):
"""
Run some extra commands after sphinx.
"""
pass
def build_package(self):
"""
Actually package the resultant build
"""
pass
def main(self):
"""
The main function to run the builder.
"""
self._print_verbose('OpenLP main script: ......%s', self.openlp_script)
self._print_verbose('Script path: .............%s', self.script_path)
self._print_verbose('Branch path: .............%s', self.branch_path)
self._print_verbose('')
if not self.args.skip_update:
self.update_code()
if self.args.release and self.args.can_export:
self.export_release()
self.run_pyinstaller()
self.write_version_file()
self.copy_default_theme()
self.copy_plugins()
self.copy_media_player()
self.copy_font_files()
self.copy_display_files()
if os.path.exists(self.manual_path):
self.run_sphinx()
else:
self._print('')
self._print('WARNING: Documentation trunk not found')
self._print(' Help file will not be included in build')
self._print(' Manual path: %s', self.manual_path)
self._print('')
self.copy_extra_files()
if not self.args.skip_translations:
if self.args.update_translations:
self.update_translations()
self.compile_translations()
self.build_package()
self._print('Done.')
raise SystemExit()

432
builders/macosx-builder.py Normal file
View File

@ -0,0 +1,432 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
"""
Mac OS X Build Script
--------------------
This script is used to build the Mac OS X app bundle and pack it into dmg file.
For this script to work out of the box, it depends on a number of things:
Python 3.7
PyQt5
You should already have this installed, OpenLP doesn't work without it. The
version the script expects is the packaged one available from River Bank
Computing.
PyEnchant
This script expects the precompiled, installable version of PyEnchant to be
installed. You can find this on the PyEnchant site.
Sphinx
This is used to build the documentation. The documentation trunk must be at
the same directory level as OpenLP trunk and named "documentation".
PyInstaller
PyInstaller can be installed with pip
Git
You need the command line "git" client installed.
OpenLP
A checkout of the latest code, in a branch directory, which is in a Bazaar
shared repository directory. This means your code should be in a directory
structure like this: "openlp\branch-name".
macosx-builder.py
This script, of course. It should be in the "osx-package" directory
at the same level as OpenLP trunk.
Mako
Mako Templates for Python. This package is required for building the
remote plugin.
Alembic
Required for upgrading the databases used in OpenLP.
PyMuPDF
Required for PDF support in OpenLP. Install using pip.
MachOLib
Python library to analyze and edit Mach-O headers, the executable format
used by Mac OS X. Used to relink the mudraw binary from MuPDF to the bundled
libraries. Install using macports or pip.
config.ini.default
The configuration file contains settings of the version string to include
in the bundle as well as directory and file settings for different
purposes (e.g. PyInstaller location or installer background image)
To install everything you should install latest python 3.7 from python.org. It
is recommended to create virtual environment. You can install all dependencies
like this:
$ python -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 \
lxml Mako mysql-connector-python pytest mock psycopg2-binary \
websockets asyncio waitress six webob requests QtAwesome PyQt5 \
PyQtWebEngine pymediainfo PyMuPDF==1.16.7 QDarkStyle python-vlc \
Pyro4 zeroconf flask-cors pytest-qt pyenchant pysword pyobjc-core \
pyobjc-framework-Cocoa dmgbuild sphinx PyInstaller
"""
import glob
import os
import platform
from pathlib import Path
from shutil import copy, copytree, move, rmtree
from macholib.MachO import MachO
from macholib.util import in_system_path
from builder import Builder
class MacOSXBuilder(Builder):
"""
The :class:`MacosxBuilder` class encapsulates everything that is needed
to build a Mac OS X .dmg file.
"""
def _pep440_to_mac_version(self, version: str) -> str:
"""Convert a PEP440-compatible version to a Mac compatible version"""
if pep440 := self.parse_pep440_version(version):
return f'{pep440["major"]}.{pep440["minor"]}.{pep440["fix"]}'
else:
return '0.0.0'
def _get_directory_size(self, directory):
"""
Return directory size - size of everything in the dir.
"""
dir_size = 0
for (path, dirs, files) in os.walk(directory):
for file in files:
filename = os.path.join(path, file)
dir_size += os.path.getsize(filename)
return dir_size
def _create_symlink(self, folder):
"""
Create the appropriate symlink in the MacOS folder pointing to the Resources folder.
"""
sibling = Path(str(folder).replace('MacOS', ''))
# PyQt5/Qt/qml/QtQml/Models.2
root = str(sibling).partition('Contents')[2].lstrip('/')
# ../../../../
backward = '../' * len(root.split('/'))
# ../../../../Resources/PyQt5/Qt/qml/QtQml/Models.2
good_path = f'{backward}Resources/{root}'
folder.symlink_to(good_path)
def _fix_qt_dll(self, dll_file):
"""
Fix the DLL lookup paths to use relative ones for Qt dependencies.
Inspiration: PyInstaller/depend/dylib.py:mac_set_relative_dylib_deps()
Currently one header is pointing to (we are in the Resources folder):
@loader_path/../../../../QtCore (it is referencing to the old MacOS folder)
It will be converted to:
@loader_path/../../../../../../MacOS/QtCore
"""
def match_func(pth):
"""
Callback function for MachO.rewriteLoadCommands() that is
called on every lookup path setted in the DLL headers.
By returning None for system libraries, it changes nothing.
Else we return a relative path pointing to the good file
in the MacOS folder.
"""
basename = os.path.basename(pth)
if not basename.startswith('Qt'):
return None
return f'@loader_path{good_path}/{basename}'
# Skip it if it's not a dylib file
if dll_file.suffix != '.dylib':
return
# Resources/PyQt5/Qt/qml/QtQuick/Controls.2/Fusion
root = str(dll_file.parent).partition('Contents')[2][1:]
# /../../../../../../..
backward = '/..' * len(root.split('/'))
# /../../../../../../../MacOS
good_path = f'{backward}/MacOS'
# Rewrite Mach headers with corrected @loader_path
dll = MachO(dll_file)
dll.rewriteLoadCommands(match_func)
with open(dll.filename, 'rb+') as f:
for header in dll.headers:
f.seek(0)
dll.write(f)
f.seek(0, 2)
f.flush()
def _find_problematic_qt_folders(self, folder):
"""
Recursively yields problematic folders (containing a dot in their name).
"""
for path in folder.iterdir():
if not path.is_dir() or path.is_symlink():
# Skip simlinks as they are allowed (even with a dot)
continue
if path.name == 'qml':
yield path
else:
yield from self._find_problematic_qt_folders(path)
def _move_contents_to_resources(self, folder):
"""
Recursively move any non symlink file from a problematic folder to the sibling one in Resources.
"""
for path in folder.iterdir():
if path.is_symlink():
continue
if path.is_dir():
yield from self._move_contents_to_resources(path)
else:
sibling = Path(str(path).replace('MacOS', 'Resources'))
sibling.parent.mkdir(parents=True, exist_ok=True)
move(path, sibling)
yield sibling
def _fix_qt_paths(self):
"""
Fix the Qt paths
"""
app_path = Path(self.dist_app_path) / 'Contents' / 'MacOS'
for folder in self._find_problematic_qt_folders(app_path):
for problematic_file in self._move_contents_to_resources(folder):
self._fix_qt_dll(problematic_file)
rmtree(folder)
self._create_symlink(folder)
def _relink_binary(self, bin_name):
"""
Relink bundled libraries
"""
self._print('Linking {bin_name} with bundled libraries...'.format(bin_name=bin_name))
libname = os.path.join(self.dist_path, bin_name)
distname = os.path.relpath(self.dist_path, libname)
self._print_verbose('... {bin_name} path {path}'.format(bin_name=bin_name, path=libname))
# Determine how many directories up is the directory with shared
# dynamic libraries. '../'
# E.g. ./qt4_plugins/images/ -> ./../../
parent_dir = ''
# Check if distname is not only base filename.
if os.path.dirname(distname):
parent_level = len(os.path.dirname(distname).split(os.sep))
parent_dir = parent_level * (os.pardir + os.sep)
def match_func(pth):
"""
For system libraries leave path unchanged.
"""
# Match non system dynamic libraries.
if not in_system_path(pth):
# Use relative path to dependend dynamic libraries bases on
# location of the executable.
pth = os.path.join('@loader_path', parent_dir, os.path.basename(pth))
self._print_verbose('... %s', pth)
return pth
# Rewrite mach headers with @loader_path.
dll = MachO(libname)
dll.rewriteLoadCommands(match_func)
# Write changes into file.
# Write code is based on macholib example.
try:
self._print_verbose('... writing new library paths')
with open(dll.filename, 'rb+') as dll_file:
for header in dll.headers:
dll_file.seek(0)
dll.write(dll_file)
dll_file.seek(0, 2)
except Exception:
pass
def _install_pyro5(self):
"""
Install Pyro5 into the vendor directory
"""
self._print('Installing Pyro5 for LibreOffice')
target = os.path.join(self.dist_path, 'plugins', 'presentations', 'lib', 'vendor')
argv = ['pip', 'install', 'Pyro5', '-t', target, '--disable-pip-version-check', '--no-compile']
self._run_module('pip', argv, 'Error installing Pyro5 with pip', run_name='__main__')
egg_info_glob = glob.glob(os.path.join(target, '*.egg-info'))
egg_info_glob.extend(glob.glob(os.path.join(target, '*.dist-info')))
self._print_verbose('... glob: {}'.format(egg_info_glob))
for path in egg_info_glob:
rmtree(path, True)
def _copy_vlc_files(self):
"""
Copy the VLC files into the app bundle
"""
self._print('Copying VLC files')
vlc_path = '/Applications/VLC.app/Contents/MacOS/'
vlc_dest = os.path.join(self.dist_path, 'vlc')
if not os.path.exists(vlc_dest):
os.makedirs(vlc_dest)
for fname in ['libvlc.dylib', 'libvlccore.dylib']:
self._print_verbose('... {}'.format(fname))
dest_file = os.readlink(os.path.join(vlc_path, 'lib', fname))
copy(os.path.join(vlc_path, 'lib', dest_file), os.path.join(vlc_dest, fname))
self._relink_binary(os.path.join('vlc', fname))
if os.path.exists(os.path.join(vlc_dest, 'plugins')):
rmtree(os.path.join(vlc_dest, 'plugins'))
self._print_verbose('... copying VLC plugins')
copytree(os.path.join(vlc_path, 'plugins'), os.path.join(vlc_dest, 'plugins'))
def _copy_bundle_files(self):
"""
Copy Info.plist and OpenLP.icns to app bundle.
"""
self._print_verbose('... OpenLP.icns')
try:
os.makedirs(os.path.join(self.dist_app_path, 'Contents', 'Resources'))
except FileExistsError:
pass
copy(self.icon_path, os.path.join(self.dist_app_path, 'Contents', 'Resources',
os.path.basename(self.icon_path)))
self._print_verbose('... Info.plist')
# Add OpenLP version to Info.plist and add it to app bundle.
with open(os.path.join(self.dist_app_path, 'Contents', os.path.basename(self.bundle_info_path)), 'w') as fw, \
open(self.bundle_info_path, 'r') as fr:
text = fr.read()
text = text % {'openlp_version': self._pep440_to_mac_version(self.version)}
fw.write(text)
def _copy_macosx_files(self):
"""
Copy all the OSX-specific files.
"""
self._print_verbose('... LICENSE.txt')
copy(self.license_path, os.path.join(self.dist_path, 'LICENSE.txt'))
def _code_sign(self):
certificate = self.config.get('codesigning', 'certificate')
self._print('Checking for certificate...')
if not certificate:
self._print('Certificate not set, skipping code signing!')
return
self._run_command(['security', 'find-certificate', '-c', certificate],
'Could not find certificate "{certificate}" in keychain, '.format(certificate=certificate) +
'codesigning will not work without a certificate')
self._print('Codesigning app...')
self._run_command(['codesign', '--deep', '-s', certificate, self.dist_app_path], 'Error running codesign')
def _create_dmg(self):
"""
Create .dmg file.
"""
self._print('Creating dmg file...')
arch = platform.machine()
dmg_name = f'OpenLP-{self.version}-{arch}.dmg'
dmg_title = f'OpenLP {self.version}'
self.dmg_file = os.path.join(self.work_path, 'dist', dmg_name)
# Remove dmg if it exists.
if os.path.exists(self.dmg_file):
os.remove(self.dmg_file)
# Get size of the directory in bytes, convert to MB, and add padding
size = self._get_directory_size(self.dist_app_path)
size = size / (1000 * 1000)
size += 10
os.chdir(os.path.dirname(self.dmg_settings_path))
argv = ['dmgbuild', '-s', self.dmg_settings_path, '-D', 'size={size}M'.format(size=size),
'-D', 'icon={icon_path}'.format(icon_path=self.icon_path),
'-D', 'app={dist_app_path}'.format(dist_app_path=self.dist_app_path), dmg_title, self.dmg_file]
self._run_module('dmgbuild', argv, 'Error running dmgbuild', run_name='__main__')
self._print('Finished creating dmg file, resulting file: %s' % self.dmg_file)
def get_platform(self):
"""
Return the plaform we're building for
"""
return 'Mac OS X'
def get_sphinx_build(self):
"""
The type of build Sphinx should be doing
"""
return 'applehelp'
def get_qt_translations_path(self):
"""
Return the path to Qt translation files on macOS
"""
from PyQt5.QtCore import QCoreApplication
qt_library_path = QCoreApplication.libraryPaths()[0]
return os.path.join(os.path.dirname(qt_library_path), 'translations')
def setup_extra(self):
"""
Extra setup to run
"""
if hasattr(self, 'mutool_exe'):
self.mutool_lib = os.path.abspath(
os.path.join(os.path.dirname(self.mutool_exe), '..', 'lib', 'libjbig2dec.0.dylib'))
self.dist_app_path = os.path.join(self.work_path, 'dist', 'OpenLP.app')
self.dist_path = os.path.join(self.work_path, 'dist', 'OpenLP.app', 'Contents', 'MacOS')
def copy_extra_files(self):
"""
Copy any extra files which are particular to a platform
"""
self._print('Copying extra files for macOS...')
# Exclude VLC for now, at least
# self._copy_vlc_files()
self._copy_bundle_files()
self._copy_macosx_files()
self._install_pyro5()
def after_run_sphinx(self):
"""
Run Sphinx to build an HTML Help project.
"""
self._print('Copying help file...')
source = os.path.join(self.manual_build_path, 'applehelp')
files = os.listdir(source)
for filename in files:
if filename.endswith('.help'):
self._print_verbose('... %s', filename)
copytree(os.path.join(source, filename),
os.path.join(self.dist_app_path, 'Contents', 'Resources', filename))
def build_package(self):
"""
Build the actual DMG
"""
self._fix_qt_paths()
# self._code_sign()
self._create_dmg()
if __name__ == '__main__':
MacOSXBuilder().main()

526
builders/windows-builder.py Normal file
View File

@ -0,0 +1,526 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
"""
Windows Build Script
--------------------
This script is used to build the Windows binary and the accompanying installer.
For this script to work out of the box, it depends on a number of things:
Python 3.7
PyQt5
You should already have this installed, OpenLP doesn't work without it. The
version the script expects is the packaged one available from pypi.
PyEnchant
This script expects the precompiled, installable version of PyEnchant to be
installed. You can find this on the PyEnchant site.
WiX Toolset
The toolset should be installed into "C:\\%PROGRAMFILES%\\WiX Toolset v3.11"
or similar.
Sphinx
This is used to build the documentation. The documentation trunk must be at
the same directory level as OpenLP trunk and named "documentation".
HTML Help Workshop
This is used to create the help file.
PyInstaller
PyInstaller can be installed from pypi.
Git
You need the command line "git" client installed.
OpenLP
A checkout of the latest code, in a branch directory, which is in a Bazaar
shared repository directory. This means your code should be in a directory
structure like this: "openlp\\branch-name".
windows-builder.py
This script, of course. It should be in the "windows-installer" directory
at the same level as OpenLP trunk.
Mako
Mako Templates for Python. This package is required for building the
remote plugin. It can be installed by going to your
python_directory\\scripts\\.. and running "easy_install Mako". If you do not
have easy_install, the Mako package can be obtained here:
http://www.makotemplates.org/download.html
MuPDF
Required for PDF support in OpenLP. Download the windows build from
mupdf.com, extract it, and set the mutoolbin option in the config file to
point to mutool.exe.
Portable App Builds
The following are required if you are planning to make a portable build of
OpenLP. The portable build conforms to the standards published by
PortableApps.com:
http://portableapps.com/development/portableapps.com_format
PortableApps.com Installer:
http://portableapps.com/apps/development/portableapps.com_installer
PortableApps.com Launcher:
http://portableapps.com/apps/development/portableapps.com_launcher
NSIS Portable (Unicode version):
http://portableapps.com/apps/development/nsis_portable
"""
import os
import glob
import sys
from distutils import dir_util
from hashlib import md5
from shutil import copy, copytree, move, rmtree
from lxml.etree import ElementTree
from lxml.builder import E, ElementMaker
from lxml.objectify import fromstring
from builder import Builder
class WindowsBuilder(Builder):
"""
The :class:`WindowsBuilder` class encapsulates everything that is needed
to build a Windows installer.
"""
# Make mypy happy
program_files: str
candle_exe: str
light_exe: str
htmlhelp_exe: str
mutool_exe: str
dist_path: str
icon_path: str
license_path: str
portable_source_path: str
portable_dest_path: str
portablelauncher_exe: str
portableinstaller_exe: str
def _pep440_to_windows_version(self, version: str) -> str:
"""Convert a PEP440-compatible version string to a Windows version string"""
if pep440 := self.parse_pep440_version(version):
build_number = 5000
if pep440.get('pre'):
if pep440['pre'] == 'a':
build_number = 1000
elif pep440['pre'] == 'b':
build_number = 2000
elif pep440['pre'] == 'rc':
build_number = 3000
if pep440.get('rel'):
try:
rel = int(pep440['rel'])
build_number += rel
except ValueError:
pass
return f'{pep440["major"]}.{pep440["minor"]}.{pep440["fix"]}.{build_number}'
else:
return '0.0.0.0'
def _walk_dirs(self, dir_dict, path):
"""
Walk a dictionary according to path
"""
parts = path.split(os.sep)
search_key = parts.pop(0)
if search_key in dir_dict.keys():
if not parts:
return dir_dict[search_key]
else:
return self._walk_dirs(dir_dict[search_key], os.sep.join(parts))
else:
return None
def _get_dirs_and_files(self, install_dir, start_dir):
"""
Walk down a directory recursively and build up the XML for WiX
"""
self._openlp_id = None
start_base, start_path = os.path.split(start_dir)
element = install_dir
directories = {start_path: {'__dir__': element}}
components = []
component_ids = []
FxE = ElementMaker(namespace='http://schemas.microsoft.com/wix/FirewallExtension',
nsmap={'fw': 'http://schemas.microsoft.com/wix/FirewallExtension'})
for root, _, files in os.walk(start_dir):
parent = os.sep.join(root.replace(os.path.join(start_base, ''), '').split(os.sep)[:-1])
base = os.path.basename(root)
if root != start_dir:
dir_id = 'd_{}'.format(md5(os.path.join(parent, base).encode('utf8')).hexdigest())
new_element = E.Directory(Id=dir_id, Name=base)
element.append(new_element)
element = new_element
new_dir = {'__dir__': element}
parent_dir = self._walk_dirs(directories, parent)
parent_dir[base] = new_dir
parent_dir['__dir__'].append(element)
for fname in files:
source = os.path.join(root, fname)
source_id = 'f_{}'.format(md5(source.encode('utf8')).hexdigest())
component_ids.append(source_id)
if self.arch == 'x64':
file_ = E.File(Id=source_id, Name=fname, Source=source, ProcessorArchitecture='x64')
component = E.Component(file_, Id=source_id, Guid='*', DiskId='1', Win64='yes')
else:
file_ = E.File(Id=source_id, Name=fname, Source=source)
component = E.Component(file_, Id=source_id, Guid='*', DiskId='1')
if source.endswith('OpenLP.exe'):
self._openlp_id = source_id
file_.set('KeyPath', 'yes')
fw_program = '[#{}]'.format(source_id)
component.append(FxE.FirewallException(Id='OpenLP_TCP', Name='$(var.ProductName)',
IgnoreFailure='yes', Program=fw_program,
Protocol='tcp', Scope='any'))
component.append(FxE.FirewallException(Id='OpenLP_UDP', Name='$(var.ProductName)',
IgnoreFailure='yes', Program=fw_program,
Protocol='udp', Scope='any'))
component.append(E.Shortcut(Id='ApplicationStartMenuShortcut', Name='$(var.ProductName)',
Description='$(var.Description)', Directory='ProgramMenuDir',
Icon='OpenLP.ico', Advertise='yes', WorkingDirectory='INSTALLDIR'))
component.append(E.Shortcut(Id='DebugStartMenuShortcut', Name='$(var.ProductName) (Debug)',
Description='Run $(var.ProductName) with debug logging enabled',
Directory='ProgramMenuDir', Arguments='--log-level debug',
Icon='OpenLP.ico', Advertise='yes', WorkingDirectory='INSTALLDIR'))
component.append(E.ProgId(
E.Extension(
E.Verb(Id="Open", Command="Open", Argument=" &quot;%1&quot;"),
E.MIME(Advertise="yes", ContentType="application/-x-openlp-service", Default="yes"),
Id="osz"
),
E.Extension(
E.Verb(Id="Open", Command="Open", Argument=" &quot;%1&quot;"),
E.MIME(Advertise="yes", ContentType="application/-x-openlp-service-lite", Default="yes"),
Id="oszl"
),
Id="OpenLP.Service",
Description="OpenLP Service File",
Icon="service_file.ico",
Advertise="yes"
))
elif source.endswith('OpenLP.chm'):
component.append(E.Shortcut(Id='HelpStartMenuShortcut', Name='$(var.ProductName) Help',
Description='Help file for $(var.ProductName)',
Target='[#{}]'.format(source_id), WorkingDirectory='INSTALLDIR'))
element.append(component)
components.append(component)
return component_ids
def _create_wix_file(self):
"""
Create a WiX project file
"""
self._print('Creating WiX file...')
config_dir = os.path.dirname(self.config_path)
self._print_verbose('Reading base WiX file')
with open(os.path.join(config_dir, 'OpenLP-base.wxs'), 'rt') as base_file:
xml = base_file.read()
if '.dev' in self.version:
windows_version = self.version.replace('.dev', '.')
windows_version = windows_version.rsplit('+', 1)[0]
else:
windows_version = self._pep440_to_windows_version(self.version)
xml = xml % {
'dialog': os.path.join(config_dir, 'WizardMain.bmp'),
'banner': os.path.join(config_dir, 'WizardBanner.bmp'),
'license': os.path.join(config_dir, 'LICENSE.rtf'),
'platform': self.arch,
'progfilefolder': 'ProgramFiles64Folder' if self.arch == 'x64' else 'ProgramFilesFolder',
'systemfolder': 'System64Folder' if self.arch == 'x64' else 'SystemFolder',
'version': windows_version
}
root = fromstring(xml.encode('utf8'))
# Find the INSTALLDIR directory component and populate it with our files and folders
install_dir = root.xpath('//wix:Directory[@Id="INSTALLDIR"]',
namespaces={'wix': 'http://schemas.microsoft.com/wix/2006/wi'})[0]
self._print_verbose('Creating XML fragments from files and directories')
component_ids = self._get_dirs_and_files(install_dir, self.dist_path)
# Write the property for the "Run OpenLP" checkbox
product = root.xpath('//wix:Product',
namespaces={'wix': 'http://schemas.microsoft.com/wix/2006/wi'})[0]
product.append(E.Property(Id='WixShellExecTarget', Value='[#{}]'.format(self._openlp_id)))
# Set the component ids for the feature
feature = root.xpath('//wix:Feature',
namespaces={'wix': 'http://schemas.microsoft.com/wix/2006/wi'})[0]
for component_id in component_ids:
feature.append(E.ComponentRef(Id=component_id))
self._print_verbose('Writing new WiX file')
tree = ElementTree(root)
with open(os.path.join(config_dir, 'OpenLP.wxs'), 'wb') as f:
tree.write(f, encoding='utf-8', xml_declaration=True, pretty_print=True)
def _run_wix_tools(self):
"""
Run the WiX toolset to create an installer
"""
self._print('Running WiX tools...')
if self.arch == 'x64':
version = '{}-x64'.format(self.version)
else:
version = self.version
msi_file = os.path.abspath(os.path.join(self.dist_path, '..', 'OpenLP-{}.msi'.format(version)))
if os.path.exists(msi_file):
self._print_verbose('Removing old MSI file')
os.unlink(msi_file)
config_dir = os.path.dirname(self.config_path)
os.chdir(self.dist_path)
self._run_command([self.candle_exe, '-ext', 'WiXUtilExtension', '-ext', 'WixUIExtension',
'-ext', 'WixFirewallExtension', os.path.join(config_dir, 'OpenLP.wxs')],
'Error running WiX tool: candle')
self._run_command([self.light_exe, '-ext', 'WiXUtilExtension', '-ext', 'WixUIExtension',
'-ext', 'WixFirewallExtension', 'OpenLP.wixobj', '-o', msi_file],
'Error running WiX tool: light')
def _create_portableapp_structure(self):
"""
Checks the PortableApp directory structure amd creates
missing subdirs
"""
self._print('... Checking PortableApps directory structure...')
launcher_path = os.path.join(self.portable_dest_path, 'App', 'Appinfo', 'Launcher')
if not os.path.exists(launcher_path):
os.makedirs(launcher_path)
settings_path = os.path.join(self.portable_dest_path, 'Data', 'Settings')
if not os.path.exists(settings_path):
os.makedirs(settings_path)
def _create_portableapps_appinfo_file(self):
"""
Create a Portabbleapps appinfo.ini file.
"""
self._print_verbose('... Creating PortableApps appinfo file ...')
config_dir = os.path.dirname(self.config_path)
if '.dev' in self.version:
version, revision = self.version.split('.dev')
version = version + '.0' * (2 - version.count('.'))
self.portable_version = version + '.' + revision.split('+')[0]
else:
self.portable_version = self._pep440_to_windows_version(self.version)
with open(os.path.join(config_dir, 'appinfo.ini.default'), 'r') as input_file, \
open(os.path.join(self.portable_dest_path, 'App', 'Appinfo', 'appinfo.ini'), 'w') as output_file:
content = input_file.read()
content = content.replace('%(display_version)s', self.portable_version)
content = content.replace('%(package_version)s', self.portable_version)
content = content.replace('%(arch)s', self.arch)
output_file.write(content)
def _run_portableapp_builder(self):
"""
Creates a portable installer.
1 Copies the distribution to the portable apps directory
2 Builds the PortableApps Launcher
3 Builds the PortableApps Install
"""
self._print('Running PortableApps Builder...')
self._print_verbose('... Clearing old files')
# Remove previous contents of portableapp build directory.
if os.path.exists(self.portable_dest_path):
rmtree(self.portable_dest_path)
self._print_verbose('... Creating PortableApps build directory')
# Copy the contents of the OpenLPPortable directory to the portable
# build directory.
dir_util.copy_tree(self.portable_source_path, self.portable_dest_path)
self._create_portableapp_structure()
self._create_portableapps_appinfo_file()
# Copy distribution files to portableapp build directory.
self._print_verbose('... Copying distribution files')
portable_app_path = os.path.join(self.portable_dest_path, 'App', 'OpenLP')
dir_util.copy_tree(self.dist_path, portable_app_path)
# Copy help files to portableapp build directory.
if os.path.isfile(os.path.join(self.helpfile_path, 'OpenLP.chm')):
self._print_verbose('... Copying help files')
dir_util.copy_tree(self.helpfile_path, os.path.join(portable_app_path, 'help'))
else:
self._print('... WARNING: Windows help file not found')
# Build the launcher.
self._print_verbose('... Building PortableApps Launcher')
self._run_command([self.portablelauncher_exe, self.portable_dest_path],
'Error creating PortableApps Launcher')
# Build the portable installer.
self._print_verbose('... Building PortableApps Installer')
self._run_command([self.portableinstaller_exe, self.portable_dest_path],
'Error running PortableApps Installer')
portable_exe_name = 'OpenLPPortable_{ver}-{arch}.paf.exe'.format(ver=self.portable_version, arch=self.arch)
portable_exe_path = os.path.abspath(os.path.join(self.portable_dest_path, '..', portable_exe_name))
self._print_verbose('... Portable Build: {}'.format(portable_exe_path))
if os.path.exists(portable_exe_path):
move(portable_exe_path, os.path.join(self.dist_path, '..', portable_exe_name))
self._print('PortableApp build complete')
else:
raise Exception('PortableApp failed to build')
def get_platform(self):
"""
Return the platform we're building for
"""
return 'Windows'
def get_config_defaults(self):
"""
Build some default values for the config file
"""
config_defaults = super().get_config_defaults()
config_defaults.update({
'pyroot': self.python_root,
'progfiles': self.program_files,
'progfilesx86': self.program_files_x86,
'sitepackages': self.site_packages,
'projects': os.path.abspath(os.path.join(self.script_path, '..', '..'))
})
return config_defaults
def get_sphinx_build(self):
"""
Tell Sphinx we want to build HTML help
"""
return "htmlhelp"
def get_qt_translations_path(self):
"""
Return the path to Qt translation files on macOS
"""
return os.path.join(self.site_packages, 'PyQt5', 'Qt5', 'translations')
def add_extra_args(self, parser):
"""
Add extra arguments to the command line argument parser
"""
parser.add_argument('--portable', action='store_true', default=False,
help='Build a PortableApps.com build of OpenLP too')
def setup_system_paths(self):
"""
Set up some system paths.
"""
super().setup_system_paths()
self.python_root = os.path.dirname(self.python)
self.site_packages = os.path.join(self.python_root, 'Lib', 'site-packages')
self.program_files = os.environ['PROGRAMFILES']
self.program_files_x86 = os.getenv('PROGRAMFILES(x86)')
self._print_verbose(' {:.<20}: {}'.format('site packages: ', self.site_packages))
self._print_verbose(' {:.<20}: {}'.format('program files: ', self.program_files))
self._print_verbose(' {:.<20}: {}'.format('program files x86: ', self.program_files_x86))
def setup_paths(self):
"""
Set up a variety of paths that we use throughout the build process.
"""
super().setup_paths()
self.dist_path = os.path.join(self.work_path, 'dist', 'OpenLP')
self.helpfile_path = os.path.join(self.manual_build_path, 'htmlhelp')
self.winres_path = os.path.join(self.branch_path, 'resources', 'windows')
def setup_extra(self):
"""
Extra setup to run
"""
# Detect python instance bit size
self.arch = 'x86' if sys.maxsize == 0x7fffffff else 'x64'
def copy_extra_files(self):
"""
Copy all the Windows-specific files.
"""
self._print('Copying extra files for Windows...')
self._print_verbose('... OpenLP.ico')
copy(self.icon_path, os.path.join(self.dist_path, 'OpenLP.ico'))
self._print_verbose('... LICENSE.txt')
copy(self.license_path, os.path.join(self.dist_path, 'LICENSE.txt'))
self._print_verbose('... service_file.ico')
config_dir = os.path.dirname(self.config_path)
copy(os.path.join(config_dir, 'service_file.ico'), os.path.join(self.dist_path, 'service_file.ico'))
if os.path.isfile(os.path.join(self.helpfile_path, 'OpenLP.chm')):
self._print_verbose('... OpenLP.chm')
copy(os.path.join(self.helpfile_path, 'OpenLP.chm'), os.path.join(self.dist_path, 'OpenLP.chm'))
else:
self._print('... WARNING: Windows help file not found')
try:
# Check if PyMuPDF is installed
import fitz # noqa
HAS_PYMUPDF = True
except ImportError:
HAS_PYMUPDF = False
if not HAS_PYMUPDF:
self._print_verbose('... mutool.exe')
if self.mutool_exe and os.path.isfile(self.mutool_exe):
copy(os.path.join(self.mutool_exe), os.path.join(self.dist_path, 'mutool.exe'))
else:
self._print('... WARNING: mutool.exe not found')
vlc_path = os.path.join(self.program_files, 'VideoLAN', 'VLC')
vlc_dest = os.path.join(self.dist_path, 'vlc')
if not os.path.exists(vlc_dest):
os.makedirs(vlc_dest)
for fname in ['libvlc.dll', 'libvlccore.dll']:
self._print_verbose('... {}'.format(fname))
copy(os.path.join(vlc_path, fname), os.path.join(vlc_dest, fname))
if os.path.exists(os.path.join(vlc_dest, 'plugins')):
rmtree(os.path.join(vlc_dest, 'plugins'))
self._print_verbose('... copying VLC plugins')
copytree(os.path.join(vlc_path, 'plugins'), os.path.join(vlc_dest, 'plugins'))
def after_run_sphinx(self):
"""
Run HTML Help Workshop to convert the Sphinx output into a manual.
"""
self._print('Running HTML Help Workshop...')
os.chdir(os.path.join(self.manual_build_path, 'htmlhelp'))
self._run_command([self.htmlhelp_exe, 'OpenLP.chm'], 'Error running HTML Help Workshop', exit_code=1)
def build_package(self):
"""
Build the installer
"""
self._create_wix_file()
self._run_wix_tools()
if self.args.portable:
self._run_portableapp_builder()
def get_extra_parameters(self):
"""
Return a list of any extra parameters we wish to use
"""
parameters = []
dll_path = '{pf}\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\{arch}\\*.dll'.format(pf=self.program_files_x86,
arch=self.arch)
# Finds the UCRT DDLs available from the Windows 10 SDK
for binary in glob.glob(dll_path):
parameters.append('--add-binary')
parameters.append(binary + ";.")
return parameters
if __name__ == '__main__':
WindowsBuilder().main()

View File

@ -1,5 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Copyright 2010 Jaak Ristioja
# Copyright 2015 OpenLP Developers
# Distributed under the terms of the GNU General Public License v2
# $Header: $
@ -15,7 +16,7 @@ LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 x86-fbsd x86-freebsd amd64-linux x86-linux x86-macos x86-solaris"
RDEPEND=">=dev-lang/python-2.5.0
RDEPEND=">=dev-lang/python-3.4.0
dev-python/beautifulsoup
dev-python/chardet
dev-python/lxml
@ -24,7 +25,7 @@ RDEPEND=">=dev-lang/python-2.5.0
dev-python/sqlalchemy"
DEPEND="${RDEPEND}"
PYTHON_DEPEND="2:2.5"
PYTHON_DEPEND="3:3.4"
PYTHON_MODNAME="openlp"
S=${WORKDIR}/OpenLP-${PV}-src

View File

@ -4,7 +4,7 @@ Upstream-Maintainer: OpenLP Developers <openlp-dev@lists.launchpad.net>
Upstream-Source: http://openlp.org/
Files: *
Copyright: (c) 2008-2009 Raoul Snyman
Copyright: (c) 2008-2015 OpenLP Developers
License: GPL-2
X-Comment: On Debian GNU/Linux systems, the complete text of the
GPL-2 License can be found in /usr/share/common-licenses/GPL-2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

View File

@ -1,125 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtension</key>
<array>
<string>osz</string>
</array>
<key>CFBundleTypeIconFiles</key>
<array>
<string>OpenLP.icns</string>
</array>
<key>CFBundleTypeName</key>
<string>OpenLP Service</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openlp.osz</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtension</key>
<array>
<string>otz</string>
</array>
<key>CFBundleTypeIconFiles</key>
<array>
<string>OpenLP.icns</string>
</array>
<key>CFBundleTypeName</key>
<string>OpenLP Theme</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openlp.otz</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>org.openlp.osz</string>
<key>UTTypeDescription</key>
<string>OpenLP Service</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>osz</string>
</array>
<key>public.mime-type</key>
<array>
<string>application/x-openlp-service</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>org.openlp.otz</string>
<key>UTTypeDescription</key>
<string>OpenLP Theme</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>otz</string>
</array>
<key>public.mime-type</key>
<array>
<string>application/x-openlp-theme</string>
</array>
</dict>
</dict>
</array>
<key>CFBundleIdentifier</key>
<string>org.openlp</string>
<key>CFBundleShortVersionString</key>
<string>%(openlp_version)s</string>
<key>CFBundleVersion</key>
<string>%(openlp_version)s</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDisplayName</key>
<string>OpenLP</string>
<key>CFBundleIconFile</key>
<string>OpenLP.icns</string>
<key>CFBundleExecutable</key>
<string>MacOS/OpenLP</string>
<key>CFBundleName</key>
<string>OpenLP</string>
<key>CFBundleGetInfoString</key>
<string>OpenLP %(openlp_version)s</string>
<key>LSHasLocalizedDisplayName</key>
<false/>
<key>NSAppleScriptEnabled</key>
<false/>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSBackgroundOnly</key>
<false/>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtension</key>
<array>
<string>osz</string>
</array>
<key>CFBundleTypeIconFiles</key>
<array>
<string>OpenLP.icns</string>
</array>
<key>CFBundleTypeName</key>
<string>OpenLP Service</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openlp.service</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtension</key>
<array>
<string>oszl</string>
</array>
<key>CFBundleTypeIconFiles</key>
<array>
<string>OpenLP.icns</string>
</array>
<key>CFBundleTypeName</key>
<string>OpenLP Service</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openlp.servicelite</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtension</key>
<array>
<string>otz</string>
</array>
<key>CFBundleTypeIconFiles</key>
<array>
<string>OpenLP.icns</string>
</array>
<key>CFBundleTypeName</key>
<string>OpenLP Theme</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>org.openlp.theme</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>org.openlp.osz</string>
<key>UTTypeDescription</key>
<string>OpenLP Service</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>osz</string>
</array>
<key>public.mime-type</key>
<array>
<string>application/x-openlp-service</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>org.openlp.otz</string>
<key>UTTypeDescription</key>
<string>OpenLP Theme</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>otz</string>
</array>
<key>public.mime-type</key>
<array>
<string>application/x-openlp-theme</string>
</array>
</dict>
</dict>
</array>
<key>CFBundleIdentifier</key>
<string>org.openlp.OpenLP</string>
<key>CFBundleShortVersionString</key>
<string>%(openlp_version)s</string>
<key>CFBundleVersion</key>
<string>%(openlp_version)s</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDisplayName</key>
<string>OpenLP</string>
<key>CFBundleIconFile</key>
<string>OpenLP.icns</string>
<key>CFBundleExecutable</key>
<string>MacOS/OpenLP</string>
<key>CFBundleName</key>
<string>OpenLP</string>
<key>CFBundleGetInfoString</key>
<string>OpenLP %(openlp_version)s</string>
<key>LSHasLocalizedDisplayName</key>
<false/>
<key>NSAppleScriptEnabled</key>
<false/>
<key>NSAppleEventsUsageDescription</key>
<string>OpenLP needs to control System Events to be able control Keynote and PowerPoint</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>CFBundleHelpBookFolder</key>
<string>OpenLP.help</string>
<key>CFBundleHelpBookName</key>
<string>org.openlp.OpenLP.help</string>
<key>NSRequiresAquaSystemAppearance</key>
<false/>
</dict>
</plist>

View File

@ -1,285 +1,626 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
TERMS AND CONDITIONS
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
0. Definitions.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
"This License" refers to version 3 of the GNU General Public License.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
A "covered work" means either the unmodified Program or a work based
on the Program.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
1. Source Code.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
The Corresponding Source for a work in source code form is that
same work.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
2. Basic Permissions.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
14. Revised Versions of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
END OF TERMS AND CONDITIONS
16. Limitation of Liability.
How to Apply These Terms to Your New Programs
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

BIN
osx/OpenLP-Background.tiff Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,31 +0,0 @@
on run
-- wait for virus scanner
delay 2
tell application "Finder"
tell disk "%s"
open
set current view of container window to icon view
set toolbar visible of container window to false
set statusbar visible of container window to false
set the bounds of container window to {400, 100, 1100, 500}
set theViewOptions to the icon view options of container window
set arrangement of theViewOptions to not arranged
set icon size of theViewOptions to 128
set background picture of theViewOptions to file ".background:installer-background.png"
set position of item "%s" of container window to {160, 200}
set position of item "Applications" of container window to {550, 200}
set position of item ".background" of container window to {100, 500}
set position of item ".DS_Store" of container window to {200, 500}
set position of item ".fseventsd" of container window to {300, 500}
set position of item ".Trashes" of container window to {400, 500}
set position of item ".VolumeIcon.icns" of container window to {500, 500}
open
close
update without registering applications
-- wait until the virus scan completes
delay 5
-- eject
end tell
end tell
end run

18
osx/config-appveyor.ini Normal file
View File

@ -0,0 +1,18 @@
[executables]
lrelease = %(home)s/Qt/5.15/clang_64/bin/lrelease
[paths]
branch = path/to/openlp/trunk
documentation = path/to/openlp/documentation
icon = %(here)s/OpenLP.icns
bundle_info = %(here)s/Info.plist
hooks = %(here)s/../pyinstaller-hooks
dmg_settings = %(here)s/settings.py
license = %(here)s/LICENSE.txt
[transifex]
username =
password =
[codesigning]
certificate =

View File

@ -1,19 +1,18 @@
[executables]
sphinx = sphinx-build-2.7
pyinstaller = %(projects)s/pyinstaller/pyinstaller.py
lrelease = lrelease
diskutil = diskutil
hdiutil = hdiutil
osascript = osascript
lrelease = /opt/local/libexec/qt5/bin/lrelease
[paths]
branch = %(projects)s/trunk
documentation = %(projects)s/documentation
macicon = %(here)s/OpenLP.icns
bundleinfo = %(here)s/Info.plist
branch = path/to/openlp/trunk
documentation = path/to/openlp/documentation
icon = %(here)s/OpenLP.icns
bundle_info = %(here)s/Info.plist
hooks = %(here)s/../pyinstaller-hooks
dmg_background = %(here)s/DmgImageInstallBackground.png
dmg_settings = %(here)s/settings.py
license = %(here)s/LICENSE.txt
[transifex]
username =
password =
[codesigning]
certificate = org.openlp.OpenLP

View File

@ -1,706 +0,0 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
# Jeffrey Smith, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode #
# Woldsund #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
Mac OS X Build Script
--------------------
This script is used to build the Mac OS X app bundle and pack it into dmg file.
For this script to work out of the box, it depends on a number of things:
Python 2.6/2.7
PyQt4
You should already have this installed, OpenLP doesn't work without it. The
version the script expects is the packaged one available from River Bank
Computing.
PyEnchant
This script expects the precompiled, installable version of PyEnchant to be
installed. You can find this on the PyEnchant site.
Sphinx
This is used to build the documentation. The documentation trunk must be at
the same directory level as OpenLP trunk and named "documentation".
PyInstaller
PyInstaller should be a checkout of revision 1355 of trunk, and in a
directory which is configured in the openlp.cfg. The revision is very
important as there is just included a fix for builds on OS X.
To install PyInstaller, first checkout trunk from Subversion. The
easiest way is to do a
svn co http://svn.pyinstaller.org/trunk
Then you need to copy the two hook-*.py files from the "pyinstaller"
subdirectory in OpenLP's "resources" directory into PyInstaller's
"hooks" directory.
Bazaar
You need the command line "bzr" client installed.
OpenLP
A checkout of the latest code, in a branch directory, which is in a Bazaar
shared repository directory. This means your code should be in a directory
structure like this: "openlp\branch-name".
macosx-builder.py
This script, of course. It should be in the "osx-package" directory
at the same level as OpenLP trunk.
Mako
Mako Templates for Python. This package is required for building the
remote plugin. It can be installed by going to your
python_directory\scripts\.. and running "easy_install Mako". If you do not
have easy_install, the Mako package can be obtained here:
http://www.makotemplates.org/download.html
SQLAlchemy Migrate
Required for the databases used in OpenLP. The package can be
obtained here:
http://code.google.com/p/sqlalchemy-migrate/
config.ini.default
The configuration file contains settings of the version string to include
in the bundle as well as directory and file settings for different
purposes (e.g. PyInstaller location or installer background image)
To start the build process do a
make
The result should be a {openlp_dmgname}.dmg
file in the same directory. If something went wrong - this sometimes happen
with the graphical commands in the Apple script - do a
make clean
and start the build process again. If you want to execute only parts of the
build process you can specify different make targets
make view -- runs the Apple scripts to set the icons
make package -- creates the dmg file and copies the application files
make bundle -- compresses the dmg file and sets the dmg file icon
"""
import os
import plistlib
import signal
import subprocess
import sys
from shutil import copy, rmtree
from subprocess import Popen, PIPE
from ConfigParser import SafeConfigParser as ConfigParser
from argparse import ArgumentParser
def _which(command):
"""
Return absolute path to a command found on system PATH.
"""
for path in os.environ["PATH"].split(os.pathsep):
if os.access(os.path.join(path, command), os.X_OK):
print "%s/%s" % (path, command)
return "%s/%s" % (path, command)
class MacosxBuilder(object):
"""
The :class:`MacosxBuilder` class encapsulates everything that is needed
to build a Mac OS X .dmg file.
"""
def __init__(self):
self.setup_args()
self.setup_system_paths()
self.read_config()
self.setup_executables()
self.setup_paths()
def _print(self, text, *args):
"""
Print stuff out. Later we might want to use a log file.
"""
if len(args) > 0:
text = text % tuple(args)
print text
def _print_verbose(self, text, *args):
"""
Print output, obeying "verbose" mode.
"""
if self.args.verbose:
self._print(text, *args)
def _run_command(self, cmd, err_msg):
"""
Run command in subprocess and print error message in case of Exception.
Return text from stdout.
"""
proc = Popen(cmd, stdout=PIPE, stderr=PIPE)
output, error = proc.communicate()
code = proc.wait()
if code != 0:
self._print(output)
self._print(error)
raise Exception(err_msg)
return output
def _get_directory_size(self, directory):
"""
Return directory size - size of everything in the dir.
"""
dir_size = 0
for (path, dirs, files) in os.walk(directory):
for file in files:
filename = os.path.join(path, file)
dir_size += os.path.getsize(filename)
return dir_size
def _get_mountpoints(self):
"""
Return list of mounted disks on Mac.
"""
# Get the output in plist format.
paths = []
output = self._run_command([self.hdiutil, 'info', '-plist'],
u'Detecting mount points failed.')
pl = plistlib.readPlistFromString(output)
for image in pl['images']:
for se in image['system-entities']:
if se.get('mount-point'):
paths.append(se.get('mount-point'))
return paths
def setup_args(self):
"""
Set up an argument parser and parse the command line arguments.
"""
parser = ArgumentParser()
parser.add_argument('-b', '--branch', metavar='BRANCH', dest='branch',
help='Specify the path to the branch you wish to build.')
parser.add_argument('--devel', dest='devel',
action='store_true', default=False,
help='Development build does not have set icons for .dmg file '
'and .dmg filename contains bzr revision number.')
parser.add_argument('-d', '--documentation', metavar='DOCS',
dest='docs',
help='Specify the path to the documentation branch.')
parser.add_argument('-c', '--config', metavar='CONFIG', dest='config',
help='Specify the path to the configuration file.',
default=os.path.abspath(os.path.join('.', 'config.ini.default')))
parser.add_argument('-u', '--skip-update', dest='skip_update',
action='store_true', default=False,
help='Do NOT update the branch before building.')
parser.add_argument('-t', '--skip-translations',
dest='skip_translations', action='store_true', default=False,
help='Do NOT update the language translation files.')
parser.add_argument('--transifex',
dest='update_translations', action='store_true', default=False,
help='Update the language translation from Transifex.')
parser.add_argument('--transifex-user',
dest='transifex_user', help='Transifex username.')
parser.add_argument('--transifex-pass',
dest='transifex_pass', help='Transifex password.')
parser.add_argument('-v', '--verbose', dest='verbose',
action='store_true', default=False,
help='Print out additional information.')
self.args = parser.parse_args()
def read_config(self):
"""
Read the configuration from the configuration file.
"""
self.config = ConfigParser(defaults={
u'here': self.script_path,
u'projects': os.path.abspath(os.path.join(self.script_path,
'..', '..')),
})
self.config.read(os.path.abspath(self.args.config))
def setup_system_paths(self):
"""
Set up some system paths.
"""
self.script_path = os.path.dirname(os.path.abspath(__file__))
self.python = sys.executable
def setup_executables(self):
"""
Set up the paths to the executables we use.
"""
self.sphinx = _which(self.config.get(u'executables', u'sphinx'))
self.pyinstaller = os.path.abspath(
self.config.get(u'executables', u'pyinstaller'))
self.lrelease = _which(self.config.get(u'executables', u'lrelease'))
self.diskutil = _which(self.config.get(u'executables', u'diskutil'))
self.hdiutil = _which(self.config.get(u'executables', u'hdiutil'))
self.osascript = _which(self.config.get(u'executables', u'osascript'))
def setup_paths(self):
"""
Set up a variety of paths that we use throughout the build process.
"""
if self.args.branch:
self.branch_path = os.path.abspath(self.args.branch)
else:
self.branch_path = self.config.get(u'paths', u'branch')
if self.args.docs:
self.docs_path = os.path.abspath(self.args.docs)
else:
self.docs_path = self.config.get(u'paths', u'documentation')
self.openlp_script = os.path.abspath(
os.path.join(self.branch_path, u'openlp.pyw'))
self.hooks_path = os.path.abspath(os.path.join(
self.branch_path, self.config.get(u'paths', u'hooks')))
self.mac_icon = os.path.abspath(
self.config.get(u'paths', u'macicon'))
self.bundle_info = os.path.abspath(
self.config.get(u'paths', u'bundleinfo'))
self.dmg_background_img = os.path.abspath(
self.config.get(u'paths', u'dmg_background'))
self.i18n_utils = os.path.join(self.branch_path, u'scripts',
u'translation_utils.py')
self.source_path = os.path.join(self.branch_path, u'openlp')
self.manual_path = os.path.join(self.docs_path, u'manual')
self.manual_build_path = os.path.join(self.manual_path, u'build')
self.i18n_path = os.path.join(self.branch_path, u'resources', u'i18n')
self.build_path = os.path.join(self.branch_path, u'build')
self.dist_app_path = os.path.join(self.branch_path, u'dist', u'OpenLP.app')
self.dist_path = os.path.join(self.branch_path, u'dist', u'OpenLP.app',
'Contents', 'MacOS')
# Path to Qt translation files.
from PyQt4.QtCore import QCoreApplication
qt_plug_dir = str(list(QCoreApplication.libraryPaths())[0])
self.qt_translat_path = os.path.join(os.path.dirname(qt_plug_dir),
'translations')
def update_code(self):
"""
Update the code in the branch.
"""
os.chdir(self.branch_path)
self._print(u'Reverting any changes to the code...')
bzr = Popen((u'bzr', u'revert'), stdout=PIPE)
output = bzr.communicate()[0]
code = bzr.wait()
if code != 0:
self._print(output)
raise Exception(u'Error reverting the code')
self._print(u'Updating the code...')
bzr = Popen((u'bzr', u'update'), stdout=PIPE)
output = bzr.communicate()[0]
code = bzr.wait()
if code != 0:
self._print(output)
raise Exception(u'Error updating the code')
def run_pyinstaller(self):
"""
Run PyInstaller on the branch to build an executable.
"""
self._print(u'Running PyInstaller...')
os.chdir(self.branch_path)
pyinstaller = Popen((self.python,
self.pyinstaller,
u'--noconfirm',
u'--windowed',
u'--noupx',
u'--additional-hooks-dir', self.hooks_path,
u'--runtime-hook', os.path.join(self.hooks_path, 'rthook_openlp_pyqt4.py'),
u'--log-level=ERROR',
u'-o', self.branch_path,
#u'-i', self.mac_icon,
u'-p', self.branch_path,
u'-n', u'OpenLP',
self.openlp_script),
stdout=PIPE)
output = pyinstaller.communicate()[0]
code = pyinstaller.wait()
if code != 0:
self._print(output)
raise Exception(u'Error running PyInstaller')
def write_version_file(self):
"""
Write the version number to a file for reading once installed.
"""
self._print(u'Writing version file...')
os.chdir(self.branch_path)
bzr = Popen((u'bzr', u'tags', u'--sort', u'time'), stdout=PIPE)
output = bzr.communicate()[0]
code = bzr.wait()
if code != 0:
raise Exception(u'Error running bzr tags')
lines = output.splitlines()
if len(lines) == 0:
tag = u'0.0.0'
revision = u'0'
else:
tag, revision = lines[-1].split()
bzr = Popen((u'bzr', u'log', u'--line', u'-r', u'-1'), stdout=PIPE)
output, error = bzr.communicate()
code = bzr.wait()
if code != 0:
raise Exception(u'Error running bzr log')
output_ascii = unicode(output, errors=u'ignore')
latest = output_ascii.split(u':')[0]
self.version_string = u'%s-bzr%s' % (tag, latest)
self.version_tag = tag
version_file = open(os.path.join(self.dist_path, u'.version'), u'w')
# Release version does not contain revision in .dmg name.
if self.args.devel:
version_file.write(self.version_string)
else:
version_file.write(self.version_tag)
version_file.close()
def copy_plugins(self):
"""
Copy all the plugins to the correct directory so that OpenLP sees that
it has plugins.
"""
self._print(u'Copying plugins...')
source = os.path.join(self.source_path, u'plugins')
dest = os.path.join(self.dist_path, u'plugins')
for root, dirs, files in os.walk(source):
for filename in files:
if not filename.endswith(u'.pyc'):
dest_path = os.path.join(dest, root[len(source)+1:])
if not os.path.exists(dest_path):
os.makedirs(dest_path)
self._print_verbose(u'... %s', filename)
copy(os.path.join(root, filename),
os.path.join(dest_path, filename))
def copy_media_player(self):
"""
Copy the media players to the correct directory for OpenLP.
"""
self._print(u'Copying media player...')
source = os.path.join(self.source_path, u'core', u'ui', u'media')
dest = os.path.join(self.dist_path, u'core', u'ui', u'media')
for root, dirs, files in os.walk(source):
for filename in files:
if not filename.endswith(u'.pyc'):
dest_path = os.path.join(dest, root[len(source)+1:])
if not os.path.exists(dest_path):
os.makedirs(dest_path)
self._print_verbose(u'... %s', filename)
copy(os.path.join(root, filename),
os.path.join(dest_path, filename))
def copy_mac_bundle_files(self):
"""
Copy Info.plist and OpenLP.icns to app bundle.
"""
copy(self.mac_icon, os.path.join(self.dist_app_path,
'Contents', 'Resources', os.path.basename(self.mac_icon)))
# Add OpenLP version to Info.plist and put it to app bundle.
fr = open(self.bundle_info, u'r')
fw = open(os.path.join(self.dist_app_path,
'Contents', os.path.basename(self.bundle_info)), 'w')
text = fr.read()
text = text % {'openlp_version': self.version_string}
fw.write(text)
fr.close()
fw.close()
def copy_macosx_files(self):
"""
Copy all the OSX-specific files.
"""
self._print(u'Copying extra files for Mac OS X...')
self._print_verbose(u'... LICENSE.txt')
copy(os.path.join(self.script_path, u'LICENSE.txt'),
os.path.join(self.dist_path, u'LICENSE.txt'))
def update_translations(self):
"""
Update the translations.
"""
self._print(u'Updating translations...')
if not self.config.has_section('transifex'):
raise Exception(u'No section named "transifex" found.')
if not self.config.has_option('transifex', 'username'):
raise Exception(u'No option named "username" found.')
if not self.config.has_option('transifex', 'password'):
raise Exception(u'No option named "password" found.')
if self.args.transifex_user:
username = self.args.transifex_user
else:
username = self.config.get(u'transifex', u'username')
if self.args.transifex_pass:
password = self.args.transifex_pass
else:
password = self.config.get(u'transifex', u'password')
os.chdir(os.path.split(self.i18n_utils)[0])
translation_utils = Popen([self.python, self.i18n_utils, u'-qdpu',
u'-U', username, u'-P', password])
code = translation_utils.wait()
if code != 0:
raise Exception(u'Error running translation_utils.py')
def compile_translations(self):
"""
Compile the translations for Qt.
"""
self._print(u'Compiling translations...')
files = os.listdir(self.i18n_path)
if not os.path.exists(os.path.join(self.dist_path, u'i18n')):
os.makedirs(os.path.join(self.dist_path, u'i18n'))
for file in files:
if file.endswith(u'.ts'):
self._print_verbose(u'... %s', file)
source_path = os.path.join(self.i18n_path, file)
dest_path = os.path.join(self.dist_path, u'i18n',
file.replace(u'.ts', u'.qm'))
lconvert = Popen((self.lrelease, u'-compress', u'-silent',
source_path, u'-qm', dest_path))
code = lconvert.wait()
if code != 0:
raise Exception(u'Error running lconvert on %s' % \
source_path)
self._print(u'Copying qm files...')
source = self.qt_translat_path
files = os.listdir(source)
for filename in files:
if filename.startswith(u'qt_') and filename.endswith(u'.qm') and \
len(filename) == 8:
self._print_verbose(u'... %s', filename)
copy(os.path.join(source, filename),
os.path.join(self.dist_path, u'i18n', filename))
def run_sphinx(self):
"""
Run Sphinx to build an HTML Help project.
"""
self._print(u'Deleting previous manual build... %s',
self.manual_build_path)
if os.path.exists(self.manual_build_path):
rmtree(self.manual_build_path)
self._print(u'Running Sphinx...')
os.chdir(self.manual_path)
sphinx = Popen((self.sphinx, u'-b', u'htmlhelp', u'-d',
u'build/doctrees', u'source', u'build/htmlhelp'), stdout=PIPE)
output, error = sphinx.communicate()
code = sphinx.wait()
if code != 0:
self._print(output)
raise Exception(u'Error running Sphinx')
def create_dmg_file(self):
"""
Create .dmg file.
"""
self._print(u'Creating dmg file...')
# Release version does not contain revision in .dmg name.
if self.args.devel:
dmg_name = 'OpenLP-' + self.version_string + '.dmg'
else:
dmg_name = 'OpenLP-' + self.version_tag + '.dmg'
dmg_file = os.path.join(self.branch_path, 'build', dmg_name)
# Remove dmg if it exists.
if os.path.exists(dmg_file):
os.remove(dmg_file)
# Create empty dmg file.
size = self._get_directory_size(self.dist_app_path) # in bytes.
size = size / (1024 * 1024) # Convert to megabytes.
size += 10 # Additional space in .dmg for other files.
self._print(u'... dmg disk size: %s' % size)
self._run_command([self.hdiutil, 'create', dmg_file,
'-ov', '-megabytes', str(size),
'-fs', 'HFS+', '-volname', 'OpenLP'],
u'Could not create dmg file.'
)
# Mount empty dmg file.
old_mounts = self._get_mountpoints()
self._print(u'... mounting the dmg file: %s' % dmg_file)
self._run_command([self.hdiutil, 'attach', dmg_file],
u'Could not mount dmg file, cannot continue.'
)
new_mounts = self._get_mountpoints()
# Get the mount point from difference between paths
# after mounting and before mounting the dmg file.
dmg_volume_path = list(set(new_mounts) - set(old_mounts))[0]
# Copy OpenLP.app and other files to .dmg
# TODO more reliable way to determine dmg_volume_path
self._print(u'... Copying the app to the dmg: ' + dmg_volume_path)
self._run_command(['cp', '-r', self.dist_app_path,
dmg_volume_path],
u'Could not copy app bundle, dmg creation failed.'
)
# Set icon for dmg file.
# http://endrift.com/blog/2010/06/14/dmg-files-volume-icons-cli/
self._print('... Setting the dmg icon.')
dmg_icon = os.path.join(dmg_volume_path, '.VolumeIcon.icns')
self._run_command(['cp', self.mac_icon, dmg_icon],
u'Could not copy the dmg icon file, dmg creation failed.'
)
# Set proper dmg icon attributes.
self._run_command(['SetFile', '-c', 'icnC', dmg_icon],
'Could not set dmg icon attributes.')
# Ensures dmg icon will be used while mounted.
self._run_command(['SetFile', '-a', 'C', dmg_volume_path],
'Could not set dmg icon attributes.')
# Create symlink in dmg pointing to the /Applications directory on OS X.
self._print('... Creating symlink to /Applications.')
os.symlink('/Applications', os.path.join(dmg_volume_path, 'Applications'))
# Set dmg background. Requires running Mac OS X gui.
# TODO: better formatting and code refactoring
if not self.args.devel:
self._print('... Setting the background image.')
os.mkdir(os.path.join(dmg_volume_path, '.background'))
self._run_command(['cp', self.dmg_background_img,
os.path.join(dmg_volume_path,
'.background/installer-background.png')],
u'Could not copy the background image, dmg creation failed.'
)
self.adjust_dmg_view(os.path.basename(dmg_volume_path))
## Unmount dmg file.
self._print('... unmounting the dmg.')
# Sometimes it could happen that OSX Finder is blocking umount.
# We need to find this process and kill it.
try:
output = subprocess.check_output(['fuser', dmg_volume_path]).strip()
if output:
blocking_proc_pid = int(output.split()[0])
os.kill(int(blocking_proc_pid), signal.SIGKILL)
except Exception as e:
print str(e)
self._print('... failed to kill process using %s' % dmg_volume_path)
# Unmount dmg file.
self._run_command([self.hdiutil, 'detach', dmg_volume_path],
'Could not unmount the dmg file, dmg creation failed.'
)
# Compress dmg file.
self._print('... compressing the dmg file')
compressed_dmg = os.path.join(self.branch_path, 'dist',
os.path.basename(dmg_file)) # Put dmg to 'dist' dir.
# Remove dmg if it exists.
if os.path.exists(compressed_dmg):
os.remove(compressed_dmg)
self._run_command([self.hdiutil,
'convert', dmg_file, '-format', 'UDZO',
'-imagekey', 'zlib-level=9', '-o', compressed_dmg],
u'Could not compress the dmg file, dmg creation failed.'
)
# Jenkins integration.
# Continuous integration server needs to know the filename of dmg.
# Write java property file. For uploading dmg to openlp.
if self.args.devel:
fpath = os.path.join(self.branch_path, 'openlp.properties')
self._print('... writing property file for jenkins: %s' %
fpath)
f = open(fpath, 'w')
f.write('OPENLP_DMGNAME=' + os.path.basename(dmg_file) + '\n')
f.close()
# Dmg done.
self._print('Finished creating dmg file, resulting file: %s' %
compressed_dmg)
self.dmg_file = compressed_dmg
def adjust_dmg_view(self, dmg_volume_name):
try:
# TODO: Use only one applescript file. Remove one for osx 10.5.
f = open(os.path.join(self.script_path,
'applescript-adjust-dmg-view.master'))
p = Popen([self.osascript], stdin=PIPE)
p.communicate(f.read() % (dmg_volume_name, 'OpenLP'))
f.close()
result = p.returncode
if (result != 0):
self._print('Adjusting dmg view failed (non-zero exit code).')
except (IOError, OSError):
self._print('Adjusting dmg view failed.')
def main(self):
"""
The main function to run the Mac OS X builder.
"""
self._print_verbose(u'OpenLP main script: ......%s',
self.openlp_script)
self._print_verbose(u'Script path: .............%s',
os.path.split(os.path.abspath(__file__))[0])
self._print_verbose(u'Branch path: .............%s', self.branch_path)
self._print_verbose(u'Source path: .............%s', self.source_path)
self._print_verbose(u'"dist.app" path: .........%s', self.dist_app_path)
self._print_verbose(u'"dist" path: .............%s', self.dist_path)
self._print_verbose(u'"hooks" path: ............%s', self.hooks_path)
self._print_verbose(u'PyInstaller: .............%s', self.pyinstaller)
self._print_verbose(u'Documentation branch path:%s', self.docs_path)
self._print_verbose(u'')
if not self.args.skip_update:
self.update_code()
self.run_pyinstaller()
self.write_version_file()
self.copy_mac_bundle_files()
self.copy_plugins()
self.copy_media_player()
# TODO creating help on Mac
if os.path.exists(self.manual_path):
self.run_sphinx()
else:
self._print(u'')
self._print(u'WARNING: Documentation trunk not found. Mac OS X')
self._print(u' Help file will not be included in build')
self._print(u'')
self.copy_macosx_files()
if not self.args.skip_translations:
if self.args.update_translations:
self.update_translations()
self.compile_translations()
self.create_dmg_file()
self._print(u'Done.')
raise SystemExit()
if __name__ == u'__main__':
MacosxBuilder().main()

48
osx/settings.py Normal file
View File

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
"""
This is the settings file for building the DMG. Run dmgbuild like so::
$ dmgbuild -s dmg-settings.py -D size=<size>,app=<path/to/OpenLP.app> "OpenLP" OpenLP-{version}.dmg
"""
import os
HERE = os.getcwd()
format = 'UDBZ'
size = '850M'
files = [defines.get('app', '/Applications/OpenLP.app')]
symlinks = { 'Applications': '/Applications' }
badge_icon = os.path.join(HERE, 'OpenLP.icns')
icon_locations = {
'OpenLP.app': (130, 110),
'Applications': (400, 110)
}
background = os.path.join(HERE, 'OpenLP-Background.tiff')
window_rect = ((100, 100), (530, 360))
default_view = 'icon-view'
show_icon_preview = False
arrange_by = None
grid_offset = (0, 0)
label_pos = 'bottom' # or 'right'
text_size = 16
icon_size = 128

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
hiddenimports = ['mysql.connector']

View File

@ -1,32 +1,25 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
hiddenimports = ['openlp.core.ui.media.phononplayer',
hiddenimports = ['openlp.core.ui.media.systemplayer',
'openlp.core.ui.media.vlcplayer',
'openlp.core.ui.media.webkitplayer']

View File

@ -4,14 +4,7 @@
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
# Copyright (c) 2008-2019 OpenLP Developers #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
@ -27,24 +20,4 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
# PyQt4 supports two different APIs: version 1 (default on Python 2) and
# version 2 (default on Python 3). For OpenLP we want to use the version 2 API
# with Python 2.
#
# The v2 API has to be set before any import of PyQt4 modules.
# However, the executable created by PyInstaller overrides qt_plugins directory
# (it uses PyQt4) before any code from OpenLP gets executed.
#
# The following code is bundled with the created executable and executed
# before any other code.
import sip
sip.setapi(u'QDate', 2)
sip.setapi(u'QDateTime', 2)
sip.setapi(u'QString', 2)
sip.setapi(u'QTextStream', 2)
sip.setapi(u'QTime', 2)
sip.setapi(u'QUrl', 2)
sip.setapi(u'QVariant', 2)
hiddenimports = ['applescript']

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
hiddenimports = ['Pyro5']

View File

@ -1,32 +1,29 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
hiddenimports = ['openlp.plugins.presentations.lib.impresscontroller',
hiddenimports = ['openlp.plugins.presentations.lib.applescriptbasecontroller',
'openlp.plugins.presentations.lib.impresscontroller',
'openlp.plugins.presentations.lib.keynotecontroller',
'openlp.plugins.presentations.lib.maclocontroller',
'openlp.plugins.presentations.lib.pdfcontroller',
'openlp.plugins.presentations.lib.powerpointcontroller',
'openlp.plugins.presentations.lib.pptviewcontroller']
'openlp.plugins.presentations.lib.powerpointmaccontroller']

View File

@ -1,38 +1,34 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2013 Raoul Snyman #
# Portions copyright (c) 2008-2013 Tim Bentley, Gerald Britton, Jonathan #
# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub, #
# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer. #
# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru, #
# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock, #
# Frode Woldsund, Martin Zibricky, Patrick Zimmermann #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
hiddenimports = ['plugins.songs.songsplugin',
'plugins.bibles.bibleplugin',
'plugins.presentations.presentationplugin',
'plugins.media.mediaplugin',
'plugins.images.imageplugin',
'plugins.custom.customplugin',
'plugins.songusage.songusageplugin',
'plugins.remotes.remoteplugin',
'plugins.alerts.alertsplugin']
hiddenimports = [
'openlp.plugins.songs.songsplugin',
'openlp.plugins.bibles.bibleplugin',
'openlp.plugins.presentations.presentationplugin',
'openlp.plugins.media.mediaplugin',
'openlp.plugins.images.imageplugin',
'openlp.plugins.custom.customplugin',
'openlp.plugins.songusage.songusageplugin',
'openlp.plugins.remotes.remoteplugin',
'openlp.plugins.alerts.alertsplugin',
'openlp.plugins.planningcenter.planningcenterplugin'
]

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
import os
import sys
import pymediainfo
if os.name.startswith('nt'):
dll = 'MediaInfo.dll'
elif sys.platform.startswith('darwin'):
dll = 'libmediainfo.0.dylib'
dll_path = os.path.join(os.path.dirname(pymediainfo.__file__), dll)
hiddenimports = ['pymediainfo']
binaries = [(dll_path, '.')]

View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
from PyInstaller.compat import is_darwin
from PyInstaller.utils.hooks import exec_statement
if is_darwin: # TODO check if this is needed on linux
datas = []
files = exec_statement("""
import ssl
print(ssl.get_default_verify_paths().cafile)""").strip().split()
for file in files:
datas.append((file, 'lib')) # TODO find a way to make sure the bundled cafile is always named 'cert.pem'

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
import websockets.legacy.client
import websockets.legacy.server
hiddenimports = ['websockets.legacy.server', 'websockets.legacy.client']

View File

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
import os
import sys
if sys.platform == 'darwin': # TODO check if this is needed on linux
os.environ['SSL_CERT_FILE'] = os.path.join(sys._MEIPASS, 'lib', 'cert.pem')

12
scripts/backup_georss.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
FILENAME=`date +%Y%m%d-%H%M%S`.rss
BACKUPDIR=~/georss
BACKUPDAYS=14
# Delete files older than $BACKUPDAYS days ago
find $BACKUPDIR -mtime $BACKUPDAYS -exec rm -f {} \;
# Get the latest GeoRSS from our map
wget -c -O $BACKUPDIR/$FILENAME 'http://maps.google.com/maps/ms?ie=UTF8&source=embed&msa=0&output=georss&msid=113314234297482809599.00047e88b1985e07ad495'

46
scripts/build_dev_deb.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
###############################################################################
# PPA Build Script for OpenLP #
###############################################################################
OPENLP_VERSION=$1
RELEASE_NAME=$2
PROJECT_DIR=$HOME/Projects/OpenLP
UPLOADS_DIR=$PROJECT_DIR/Uploads
PACKAGING_DIR=$HOME/Packaging
UBUNTU_DIR=$PACKAGING_DIR/debian-package
TARGT_TARBALL=$PACKAGING_DIR/Tarballs/openlp_${OPENLP_VERSION}.orig.tar.gz
export DEBFULLNAME="Raoul Snyman"
export DEBEMAIL="raoul@snyman.info"
echo -n "Copying source tarball..."
cd $UPLOADS_DIR
if [[ ! -f "$UPLOADS_DIR/OpenLP-${OPENLP_VERSION}.tar.gz" ]]; then
echo "$UPLOADS_DIR/OpenLP-${OPENLP_VERSION}.tar.gz NOT FOUND, exiting."
exit 1
fi
cp $UPLOADS_DIR/OpenLP-${OPENLP_VERSION}.tar.gz $TARGT_TARBALL
echo done.
echo -n "Backing up changelog..."
cd $UBUNTU_DIR
cp $UBUNTU_DIR/debian/changelog $PACKAGING_DIR/changelog.bak
echo done.
echo "Building package..."
dch --force-distribution -D $RELEASE_NAME -v $OPENLP_VERSION-0ubuntu1~${RELEASE_NAME}1 Autobuild
bzr bd --builder='debuild -S -m"Raoul Snyman <raoulsnyman@openlp.org>"' --orig-dir="$PACKAGING_DIR/Tarballs" --build-dir="$PACKAGING_DIR/Builds"
if [[ $? -ne 0 ]]; then
echo "Failed to build package, exiting..."
exit 1
fi
echo "Uploading package source..."
cd $PACKAGING_DIR/Builds
dput openlp-dev openlp_$OPENLP_VERSION-0ubuntu1~${RELEASE_NAME}1_source.changes
echo -n "Removing generated files..."
rm $PACKAGING_DIR/Tarballs/*
rm -r $PACKAGING_DIR/Builds/*
echo done.
echo -n "Restoring changelog..."
cd $UBUNTU_DIR
cp $PACKAGING_DIR/changelog.bak $UBUNTU_DIR/debian/changelog
echo "done."

39
scripts/build_docs.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
DOCSTYPE=$1
OLD_PATH=$PATH
PATH=/usr/local/bin:$PATH
if [[ "$DOCSTYPE" == "api" ]]; then
DOCSTITLE="API"
DOCSDIR="api"
TARBALL="docs"
else
if [[ "$DOCSTYPE" == "manual" ]]; then
DOCSTITLE="Manual"
DOCSDIR="manual"
TARBALL="manual"
else
DOCSTITLE="User Guide"
DOCSDIR="user-guide"
TARBALL="user-guide"
fi
fi
echo "Building $DOCSTITLE documentation..."
cd /home/openlp/Projects/documentation/trunk
bzr up
cd $DOCSDIR
echo $DOCSDIR
pwd
rm -fR build
make html
echo "Creating tarball..."
cd build
cp -R html $TARBALL
tar -czvf ${TARBALL}.tar.gz $TARBALL
echo "Uploading tarball..."
scp ${TARBALL}.tar.gz openlp@openlp.org:public_html/
ssh openlp@openlp.org "cd ~/public_html && tar -xzvf ${TARBALL}.tar.gz"
echo "Finished $DOCSTITLE run."
PATH=$OLD_PATH

47
scripts/build_nightly_deb.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
###############################################################################
# PPA Build Script for OpenLP #
###############################################################################
RELEASE_NAME=$1
PROJECT_DIR=$HOME/Projects/OpenLP
SOURCE_DIR=$PROJECT_DIR/trunk
UPLOADS_DIR=$PROJECT_DIR/Uploads
OPENLP_VERSION=`~/bin/openlp_version.py $SOURCE_DIR`
PACKAGING_DIR=$HOME/Packaging
UBUNTU_DIR=$PACKAGING_DIR/debian-package
TARGT_TARBALL=$PACKAGING_DIR/Tarballs/openlp_${OPENLP_VERSION}.orig.tar.gz
export DEBFULLNAME="Raoul Snyman"
export DEBEMAIL="raoul@snyman.info"
echo -n "Copying source tarball..."
cd $UPLOADS_DIR
if [[ ! -f "$UPLOADS_DIR/OpenLP-${OPENLP_VERSION}.tar.gz" ]]; then
echo "$UPLOADS_DIR/OpenLP-${OPENLP_VERSION}.tar.gz NOT FOUND, exiting."
exit 1
fi
cp $UPLOADS_DIR/OpenLP-${OPENLP_VERSION}.tar.gz $TARGT_TARBALL
echo done.
echo -n "Backing up changelog..."
cd $UBUNTU_DIR
cp $UBUNTU_DIR/debian/changelog $PACKAGING_DIR/changelog.bak
echo done.
echo "Building package..."
dch --force-distribution -D $RELEASE_NAME -v $OPENLP_VERSION-0ubuntu1~${RELEASE_NAME}1 Autobuild
bzr bd --builder='debuild -S -m"Raoul Snyman <raoulsnyman@openlp.org>"' --orig-dir="$PACKAGING_DIR/Tarballs" --build-dir="$PACKAGING_DIR/Builds"
if [[ $? -ne 0 ]]; then
echo "Failed to build package, exiting..."
exit 1
fi
echo "Uploading package source..."
cd $PACKAGING_DIR/Builds
dput openlp-nightly openlp_$OPENLP_VERSION-0ubuntu1~${RELEASE_NAME}1_source.changes
#echo -n "Removing generated files..."
rm $PACKAGING_DIR/Tarballs/*
rm -r $PACKAGING_DIR/Builds/*
#echo done.
echo -n "Restoring changelog..."
cd $UBUNTU_DIR
cp $PACKAGING_DIR/changelog.bak $UBUNTU_DIR/debian/changelog
echo "done."

19
scripts/build_release_deb.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
###############################################################################
# Debian Build Script for OpenLP #
###############################################################################
DEB_VERSION=$1
RELEASE_NAME=$2
export RELEASE_NAME
ROOT_DIR=~/Projects/OpenLP
SDIST_TARBALL=$ROOT_DIR/release-${DEB_VERSION}/dist/OpenLP-$DEB_VERSION.tar.gz
TARGT_TARBALL=$ROOT_DIR/tarballs/openlp_$DEB_VERSION.orig.tar.gz
echo "Copying $SDIST_TARBALL to $TARGT_TARBALL"
cp $SDIST_TARBALL $TARGT_TARBALL
cd $ROOT_DIR/debian-package
dch --force-distribution -D $RELEASE_NAME -v $DEB_VERSION-0ubuntu1~${RELEASE_NAME}1 Autobuild -b
bzr bd --builder='debuild -S -sa -m"Raoul Snyman <raoul.snyman@saturnlaboratories.co.za>"' --orig-dir="$ROOT_DIR/tarballs"
cd $ROOT_DIR/build-area
dput openlp-release openlp_$DEB_VERSION-0ubuntu1~${RELEASE_NAME}1_source.changes
cd $ROOT_DIR/debian-package
bzr revert

42
scripts/deb_version.py Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
from bzrlib.branch import Branch
from natsort import nsorted
b = Branch.open_containing('.')[0]
b.lock_read()
try:
# Get the branch's latest revision number.
revno = b.revno()
# Convert said revision number into a bzr revision id.
revision_id = b.dotted_revno_to_revision_id((revno,))
# Get a dict of tags, with the revision id as the key.
tags = b.tags.get_reverse_tag_dict()
# Check if the latest
if revision_id in tags:
print tags[revision_id][0]
else:
print '%s+bzr%s' % (nsorted(b.tags.get_tag_dict().keys())[-1], revno)
finally:
b.unlock()

42
scripts/dev_build.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
VERSION=$1
PROJECTS_DIR=/home/openlp/Projects
SOURCE_DIR=$PROJECTS_DIR/OpenLP/trunk
RELEASE_DIR=release-$VERSION
UPLOADS_DIR=/home/openlp/Projects/OpenLP/Uploads
FILENAME=OpenLP-$VERSION.tar.gz
#TSDIR=$RELEASE/resources/i18n
#QMDIR=$RELEASE/openlp/i18n
echo Starting the OpenLP Development Build Script
echo --------------------------------------------
echo -ne "Updating trunk...\r"
cd $SOURCE_DIR
bzr update -q
echo "Updating trunk...done."
echo -ne "Branching release tag (${VERSION})...\r"
cd ..
bzr branch trunk $RELEASE_DIR -r tag:$VERSION -q
echo "Branching release tag (${VERSION})...done."
echo -n "Creating source distribution..."
cd /home/openlp/Projects/OpenLP/$RELEASE_DIR
python setup.py sdist
echo "done."
echo -n "Copying release tarball..."
cp dist/$FILENAME $UPLOADS_DIR/
echo "done."
echo -n "Updating Version File..."
echo "$VERSION" > dev_version.txt
scp dev_version.txt openlp@openlp.org:public_html/files/dev_version.txt
rm dev_version.txt
echo "Building sources for PPA..."
~/bin/build_dev_deb.sh $VERSION trusty
~/bin/build_dev_deb.sh $VERSION utopic
~/bin/build_dev_deb.sh $VERSION vivid
echo -n "Cleaning up..."
cd /home/openlp/Projects/OpenLP
rm -r $RELEASE_DIR
echo "done."
echo --------------------------------------------
echo Finished the OpenLP Development Build Script

32
scripts/fix_bzr.py Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
import sys
from bzrlib import initialize
from bzrlib.plugin import load_plugins
from bzrlib.upgrade import Convert
initialize()
load_plugins()
Convert(sys.argv[1])

35
scripts/natsort.py Normal file
View File

@ -0,0 +1,35 @@
# ---------------------------------------------------------
# natsort.py: Natural string sorting.
# ---------------------------------------------------------
# By Seo Sanghyeon. Some changes by Connelly Barnes.
def try_int(s):
"Convert to integer if possible."
try: return int(s)
except: return s
def natsort_key(s):
"Used internally to get a tuple by which s is sorted."
import re
return map(try_int, re.findall(r'(\d+|\D+)', s))
def natcmp(a, b):
"Natural string comparison, case sensitive."
return cmp(natsort_key(a), natsort_key(b))
def natcasecmp(a, b):
"Natural string comparison, ignores case."
return natcmp(a.lower(), b.lower())
def natsort(seq, cmp=natcmp):
"In-place natural string sort."
seq.sort(cmp)
def natsorted(seq, cmp=natcmp):
"Returns a copy of seq, sorted by natural string sort."
import copy
temp = copy.copy(seq)
natsort(temp, cmp)
return temp

78
scripts/nightly_build.sh Executable file
View File

@ -0,0 +1,78 @@
#!/bin/bash
###############################################################################
# Nightly Build Script for OpenLP #
###############################################################################
REGEX='OpenLP-([0-9]\.[0-9]\.[0-9])-bzr([0-9]+)[.|-]'
PROJECT_DIR=/home/openlp/Projects/OpenLP
SOURCE_DIR=$PROJECT_DIR/trunk
VERSION_FILE=$SOURCE_DIR/openlp/.version
PACKAGING_DIR=/home/openlp/Packaging
UPLOADS_DIR=$PROJECT_DIR/Uploads
echo Starting the OpenLP 2.2 Nightly Build Script
echo --------------------------------------------
echo -ne "Updating code...\r"
cd $SOURCE_DIR
bzr update -q
echo "Updating code...done."
# We can't get the version number until after updating the code
# otherwise the version number we get is out-of-date
OPENLP_VERSION=`~/bin/openlp_version.py $SOURCE_DIR`
UPLOAD_TARBALL=OpenLP-${OPENLP_VERSION}.tar.gz
PACKAGE_TARBALL=$PACKAGING_DIR/Tarballs/openlp_${OPENLP_VERSION}.orig.tar.gz
echo -n "Checking revision..."
if [[ -f "$VERSION_FILE" && "`bzr revno`" -eq "`cat $VERSION_FILE`" ]]; then
echo done.
echo OpenLP is already at the latest revision, aborting build.
echo --------------------------------------------
echo Finished OpenLP 2.2 Nightly Build Script
exit
fi
echo done.
echo -n "Writing version number..."
bzr revno > $VERSION_FILE
echo done.
echo -n "Exporting source for $OPENLP_VERSION ..."
if [[ -d "../OpenLP-$OPENLP_VERSION" ]]; then
rm -r ../OpenLP-$OPENLP_VERSION
fi
bzr export ../OpenLP-$OPENLP_VERSION
echo done.
echo -n "Creating source tarball $UPLOADS_DIR/$UPLOAD_TARBALL ..."
cd $PROJECT_DIR
tar -czf $UPLOADS_DIR/$UPLOAD_TARBALL OpenLP-$OPENLP_VERSION
echo done.
echo -n "Uploading tarball to download location..."
cd $UPLOADS_DIR
scp -q $UPLOADS_DIR/$UPLOAD_TARBALL openlp@openlp.org:public_html/files/
ssh -q openlp@openlp.org "python update_builds.py source $UPLOAD_TARBALL"
echo done.
echo -n "Updating Version File..."
echo "$VERSION" > nightly_version.txt
scp -q nightly_version.txt openlp@openlp.org:public_html/files/nightly_version.txt
rm nightly_version.txt
echo done.
echo -n "Notifying Twitter..."
if [[ $UPLOAD_TARBALL =~ $REGEX ]]; then
VERSION_STRING="version ${BASH_REMATCH[1]}, build ${BASH_REMATCH[2]}"
else
VERSION_STRING="version ${OPENLP_VERSION}"
fi
~/bin/openlp_tweeter.py openlp_dev "Latest nightly source tarball of OpenLP 2.2 available at http://openlp.org/files/latest.tar.gz - ${VERSION_STRING}."
echo done.
echo Building sources for PPA...
~/bin/build_nightly_deb.sh trusty
~/bin/build_nightly_deb.sh utopic
~/bin/build_nightly_deb.sh vivid
echo -n "Notifying Twitter..."
~/bin/openlp_tweeter.py openlp_dev "Latest Ubuntu nightly package of OpenLP 2.2 queued for building in the Nightly PPA (ppa:openlp-core/nightly) - ${VERSION_STRING}."
echo done.
echo -n "Cleaning up..."
rm -r $UPLOADS_DIR/*
rm $PACKAGE_TARBALL
echo done.
echo --------------------------------------------
echo Finished OpenLP 2.2 Nightly Build Script

40
scripts/notify_build.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: `basename $0` {filename} {windows|osx|portable} [delete]"
exit 5
fi
FILENAME=$1
BASEFILE=`basename $FILENAME`
BUILDTYPE=$2
REGEX='(OpenLP-|OpenLPPortable_)([0-9]\.[0-9]\.[0-9]+)(-bzr|\.)([0-9]+)[.|-]'
if [ $# -eq 3 -a "$3" == "delete" ]; then
AUTODELETE=1
else
AUTODELETE=0
fi
if [ "${BUILDTYPE}x" == "x" ]; then
$BUILDTYPE=windows
fi
if [[ $BASEFILE =~ $REGEX ]]; then
if [ "$BUILDTYPE" == "windows" ]; then
PLATFORM="Windows"
EXT=".exe"
elif [ "$BUILDTYPE" == "osx" ]; then
PLATFORM="Mac OS X"
EXT=".dmg"
elif [ "$BUILDTYPE" == "portable" ]; then
PLATFORM="PortableApps"
EXT="-portable.exe"
fi
echo "Notifying Twitter..."
/home/openlp/bin/openlp_tweeter.py openlp_dev "Latest $PLATFORM development build of OpenLP 2.0 available at http://openlp.org/files/latest$EXT - version ${BASH_REMATCH[2]} build ${BASH_REMATCH[4]}."
if [ $? -ne 0 ]; then
exit 4
fi
fi

63
scripts/openlp_tweeter.py Executable file
View File

@ -0,0 +1,63 @@
#!/home/openlp/VirtualEnv/stats/bin/python
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
import sys
import tweepy
CONSUMER_KEY = 'MYPnldPBzlbueaSvD1rnw'
CONSUMER_SECRET = 'yyDJ4TTADxv7MELAju0dtrNSEGnKa88zplDFoPiw'
AUTH_TOKENS = {
'openlp_dev': {
'key': '703540082-qTYyENzdhoDNMDP9kc95BL0yd98rz0EaVRiirya4',
'secret': 'sm9uSck8yoXUBvPkPT3fISiM5Z46KREskgmxTZ8B0'
},
'openlp': {
'key': '72314330-rUzaA2hRQAaEum6KIhFnOWNUPFqt1nkwgIC0ZS7IG',
'secret': 'UGMGO6oAcjHKADM8TZnMAos5cK11HL1Jd7CTQVWpJc8'
}
}
ACCESS_KEY = '72314330-rUzaA2hRQAaEum6KIhFnOWNUPFqt1nkwgIC0ZS7IG'
ACCESS_SECRET = 'UGMGO6oAcjHKADM8TZnMAos5cK11HL1Jd7CTQVWpJc8'
if __name__ == u'__main__':
# Don't bother to do anything if there's nothing to tweet.
if len(sys.argv) == 1:
print 'Nothing to tweet!'
sys.exit(1)
try:
if len(sys.argv) == 2:
account = 'openlp_dev'
message = sys.argv[1]
else:
account = sys.argv[1]
message = sys.argv[2]
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(AUTH_TOKENS[account]['key'], AUTH_TOKENS[account]['secret'])
api = tweepy.API(auth)
api.update_status(message)
print 'Successfully sent tweet.'
sys.exit()
except tweepy.error.TweepError as error:
print error
sys.exit(2)

61
scripts/openlp_version.py Executable file
View File

@ -0,0 +1,61 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
import sys
import os
from bzrlib.branch import Branch
from natsort import natsorted
def get_version(path):
b = Branch.open_containing(path)[0]
b.lock_read()
result = '0.0.0'
try:
# Get the branch's latest revision number.
revno = b.revno()
# Convert said revision number into a bzr revision id.
revision_id = b.dotted_revno_to_revision_id((revno,))
# Get a dict of tags, with the revision id as the key.
tags = b.tags.get_reverse_tag_dict()
# Check if the latest
if revision_id in tags:
result = tags[revision_id][0]
else:
result = '%s-bzr%s' % (natsorted(b.tags.get_tag_dict().keys())[-1], revno)
finally:
b.unlock()
return result
def get_path():
if len(sys.argv) > 1:
return os.path.abspath(sys.argv[1])
else:
return os.path.abspath('.')
if __name__ == u'__main__':
path = get_path()
print get_version(path)

50
scripts/openlptweet.py Executable file
View File

@ -0,0 +1,50 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
##########################################################################
# OpenLP - Open Source Lyrics Projection #
# ---------------------------------------------------------------------- #
# Copyright (c) 2008-2019 OpenLP Developers #
# ---------------------------------------------------------------------- #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
##########################################################################
from optparse import OptionParser
from twitter import Api, Status
def main():
parser = OptionParser()
#parser.add_option("-m", "--message", dest="message", metavar="MESSAGE",
# help="Status message to post to Twitter", metavar="MESSAGE")
parser.add_option("-u", "--username", dest="username", metavar="USERNAME",
help="The username to post as, required for authentication.")
parser.add_option("-p", "--password", dest="password", metavar="PASSWORD",
help="The password for the username, required for authentication.")
(options, args) = parser.parse_args()
if len(args) == 0:
parser.error("You haven't provided a message.")
if not options.username or not options.password:
parser.error("You need to supply a username and a password.")
message = args[0]
api = Api(username=options.username, password=options.password)
status = api.PostUpdate(message)
if not status:
print "There was a problem posting your status."
else:
print "Successfully posted your status!"
if __name__ == "__main__":
main()

34
scripts/release_build.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
VERSION=$1
RELEASE=release-$VERSION
FILENAME=OpenLP-$VERSION.tar.gz
#TSDIR=$RELEASE/resources/i18n
#QMDIR=$RELEASE/openlp/i18n
echo Starting the OpenLP 2.0 Release Build Script
echo --------------------------------------------
echo -ne "Updating trunk-2.0...\r"
cd /home/openlp/Projects/OpenLP/trunk-2.0
bzr update -q
echo "Updating trunk-2.0...done."
echo -ne "Branching release tag...\r"
cd /home/openlp/Projects/OpenLP
bzr branch trunk-2.0 $RELEASE -r tag:$VERSION -q
echo "Branching release tag...done."
echo -n "Creating source distribution..."
cd /home/openlp/Projects/OpenLP/$RELEASE
python setup.py sdist
echo "done."
#echo -n "Updating Version File..."
#echo "$VERSION" > version.txt
#scp version.txt openlp@openlp.org:public_html/files/version.txt
#rm version.txt
echo "Building sources for PPA..."
~/bin/build_release_deb.sh $VERSION utopic
echo -n "Cleaning up..."
cd /home/openlp/Projects/OpenLP
rm -fR $RELEASE
echo "done."
echo --------------------------------------------
echo Finished OpenLP 2.0 Release Build Script

59
scripts/upload_build.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: `basename $0` {filename} {windows|osx|portable} [delete]"
exit 5
fi
FILENAME=$1
BASEFILE=`basename $FILENAME`
BUILDTYPE=$2
REGEX='(OpenLP-|OpenLPPortable_)([0-9]\.[0-9]\.[0-9]+)(-bzr|\.)([0-9]+)[.|-]'
if [ $# -eq 3 -a "$3" == "delete" ]; then
AUTODELETE=1
else
AUTODELETE=0
fi
if [ ! -f $FILENAME ]; then
echo "$FILENAME does not exist, exiting."
exit 1
fi
if [ "${BUILDTYPE}x" == "x" ]; then
$BUILDTYPE=windows
fi
echo "Uploading file..."
scp $FILENAME openlp@openlp.org:public_html/files/
if [ $? -ne 0 ]; then
echo "Failed to upload ${FILENAME}."
exit 2
fi
echo "Updating build information on server..."
ssh openlp@openlp.org "python update_builds.py $BUILDTYPE $BASEFILE"
if [ $? -ne 0 ]; then
echo "Failed to update build ${BUILDTYPE} ${BASEFILE}."
exit 3
fi
if [ $AUTODELETE -eq 1 ]; then
rm $FILENAME
fi
if [[ $BASEFILE =~ $REGEX ]]; then
if [ "$BUILDTYPE" == "windows" ]; then
PLATFORM="Windows"
EXT=".exe"
elif [ "$BUILDTYPE" == "osx" ]; then
PLATFORM="Mac OS X"
EXT=".dmg"
elif [ "$BUILDTYPE" == "portable" ]; then
PLATFORM="PortableApps"
EXT="-portable.exe"
fi
echo "Notifying Twitter..."
/home/openlp/bin/openlp_tweeter.py openlp_dev "Latest $PLATFORM development build of OpenLP 2.2 available at http://openlp.org/files/latest$EXT - version ${BASH_REMATCH[2]} build ${BASH_REMATCH[4]}."
if [ $? -ne 0 ]; then
exit 4
fi
fi

35
tests/test_version.py Normal file
View File

@ -0,0 +1,35 @@
import re
import pytest
PEP440 = re.compile(r'(?P<major>\d)\.(?P<minor>\d)(\.(?P<fix>\d))?((?P<pre>a|b|rc)(?P<rel>\d))?')
def _pep440_to_windows_version(version: str) -> str:
"""Convert a PEP440-compatible version string to a Windows version string"""
if m := PEP440.match(version):
groups = m.groupdict()
if not groups.get('fix'):
groups['fix'] = '0'
build_number = 5000
if groups.get('pre'):
if groups['pre'] == 'a':
build_number = 1000
elif groups['pre'] == 'b':
build_number = 2000
elif groups['pre'] == 'rc':
build_number = 3000
if groups.get('rel'):
try:
rel = int(groups['rel'])
build_number += rel
except ValueError:
pass
return f'{groups["major"]}.{groups["minor"]}.{groups["fix"]}.{build_number}'
else:
return '0.0.0.0'
@pytest.mark.parametrize('pep440_version, windows_version', [
('2.9.1', '2.9.1.5000'), ('3.1rc1', '3.1.0.3001'), ('3.0.2b2', '3.0.2.2002'), ('1.9a1', '1.9.0.1001')])
def test_pep440_to_windows_version(pep440_version, windows_version):
assert _pep440_to_windows_version(pep440_version) == windows_version

View File

@ -1,285 +1,626 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
TERMS AND CONDITIONS
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
0. Definitions.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
"This License" refers to version 3 of the GNU General Public License.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
A "covered work" means either the unmodified Program or a work based
on the Program.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
1. Source Code.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
The Corresponding Source for a work in source code form is that
same work.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
2. Basic Permissions.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
14. Revised Versions of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
END OF TERMS AND CONDITIONS
16. Limitation of Liability.
How to Apply These Terms to Your New Programs
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -1,184 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "OpenLP"
#define AppVerName "OpenLP 2.0"
#define AppPublisher "OpenLP Developers"
#define AppURL "http://openlp.org/"
#define AppExeName "OpenLP.exe"
#define FileHandle FileOpen("%(branch)s\dist\OpenLP\.version")
#define FileLine FileRead(FileHandle)
#define RealVersion FileLine
#expr FileClose(FileHandle)
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppID={{AA7699FA-B2D2-43F4-8A70-D497D03C9485}
AppName={#AppName}
AppVerName={#AppVerName}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppVerName}
AllowNoIcons=true
LicenseFile=LICENSE.txt
OutputDir=%(branch)s\dist
OutputBaseFilename=OpenLP-{#RealVersion}-setup
Compression=lzma/Max
SolidCompression=true
SetupIconFile=OpenLP.ico
WizardImageFile=WizImageBig.bmp
WizardSmallImageFile=WizImageSmall.bmp
ChangesAssociations=true
[Languages]
Name: english; MessagesFile: compiler:Default.isl
Name: basque; MessagesFile: compiler:Languages\Basque.isl
Name: brazilianportuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
Name: catalan; MessagesFile: compiler:Languages\Catalan.isl
Name: czech; MessagesFile: compiler:Languages\Czech.isl
Name: danish; MessagesFile: compiler:Languages\Danish.isl
Name: dutch; MessagesFile: compiler:Languages\Dutch.isl
Name: finnish; MessagesFile: compiler:Languages\Finnish.isl
Name: french; MessagesFile: compiler:Languages\French.isl
Name: german; MessagesFile: compiler:Languages\German.isl
Name: hebrew; MessagesFile: compiler:Languages\Hebrew.isl
Name: hungarian; MessagesFile: compiler:Languages\Hungarian.isl
Name: italian; MessagesFile: compiler:Languages\Italian.isl
Name: japanese; MessagesFile: compiler:Languages\Japanese.isl
Name: norwegian; MessagesFile: compiler:Languages\Norwegian.isl
Name: polish; MessagesFile: compiler:Languages\Polish.isl
Name: portuguese; MessagesFile: compiler:Languages\Portuguese.isl
Name: russian; MessagesFile: compiler:Languages\Russian.isl
Name: slovak; MessagesFile: compiler:Languages\Slovak.isl
Name: slovenian; MessagesFile: compiler:Languages\Slovenian.isl
Name: spanish; MessagesFile: compiler:Languages\Spanish.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; OnlyBelowVersion: 0, 6.1
[Files]
Source: %(branch)s\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
; DLL used to check if the target program is running at install time
Source: psvince.dll; flags: dontcopy
; psvince is installed in {app} folder, so it will be loaded at
; uninstall time to check if the target program is running
Source: psvince.dll; DestDir: {app}
[Icons]
Name: {group}\{#AppName}; Filename: {app}\{#AppExeName}
Name: {group}\{#AppName} (Debug); Filename: {app}\{#AppExeName}; Parameters: -l debug
Name: {group}\{#AppName} Help; Filename: {app}\{#AppName}.chm; Check: FileExists(ExpandConstant('{app}\{#AppName}.chm'))
Name: {group}\{cm:ProgramOnTheWeb,{#AppName}}; Filename: {#AppURL}
Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe}
Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: desktopicon
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: quicklaunchicon
[Run]
Filename: {app}\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent
[Registry]
Root: HKCR; Subkey: .osz; ValueType: string; ValueName: ; ValueData: OpenLP; Flags: uninsdeletevalue
Root: HKCR; Subkey: OpenLP; ValueType: string; ValueName: ; ValueData: OpenLP Service; Flags: uninsdeletekey
Root: HKCR; Subkey: OpenLP\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\OpenLP.exe,0
Root: HKCR; Subkey: OpenLP\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\OpenLP.exe"" ""%1"""
[UninstallDelete]
; Remove support directory created when program is run:
Type: filesandordirs; Name: {app}\support
; Remove program directory if empty:
Name: {app}; Type: dirifempty
[Code]
// Function to call psvince.dll at install time
function IsModuleLoadedInstall(modulename: AnsiString ): Boolean;
external 'IsModuleLoaded@files:psvince.dll stdcall setuponly';
// Function to call psvince.dll at uninstall time
function IsModuleLoadedUninstall(modulename: AnsiString ): Boolean;
external 'IsModuleLoaded@{app}\psvince.dll stdcall uninstallonly' ;
function GetUninstallString(): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
function IsUpgrade(): Boolean;
begin
Result := (GetUninstallString() <> '');
end;
// Return Values:
// 1 - uninstall string is empty
// 2 - error executing the UnInstallString
// 3 - successfully executed the UnInstallString
function UnInstallOldVersion(): Integer;
var
sUnInstallString: String;
iResultCode: Integer;
begin
Result := 0;
sUnInstallString := GetUninstallString();
if sUnInstallString <> '' then
begin
sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3
else
Result := 2;
end
else
Result := 1;
end;
function InitializeSetup(): Boolean;
begin
Result := true;
while IsModuleLoadedInstall( 'OpenLP.exe' ) and Result do
begin
if MsgBox( 'Openlp is currently running, please close it to continue the install.',
mbError, MB_OKCANCEL ) = IDCANCEL then
begin
Result := false;
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep=ssInstall) then
begin
if (IsUpgrade()) then
begin
UnInstallOldVersion();
end;
end;
end;
function InitializeUninstall(): Boolean;
begin
Result := true;
while IsModuleLoadedUninstall( 'OpenLP.exe' ) and Result do
begin
if MsgBox( 'Openlp is currently running, please close it to continue the uninstall.',
mbError, MB_OKCANCEL ) = IDCANCEL then
begin
Result := false;
end;
end;
// Unload psvince.dll, otherwise it is not deleted
UnloadDLL(ExpandConstant('{app}\psvince.dll'));
end;

129
windows/OpenLP-base.wxs Normal file
View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define ProductName="OpenLP"?>
<?define ProductCode="*"?>
<?define ProductVersion="%(version)s"?>
<?define Manufacturer="OpenLP Developers"?>
<?define Description="Open Source Worship Presentation Software"?>
<?define Comments="OpenLP is open source under the GNU General Public License"?>
<?define UpgradeCode="8C5881AC-8F1E-4937-BB99-B823FABF18F0"?>
<?define Platform="%(platform)s"?>
<Product Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)" Id="$(var.ProductCode)"
UpgradeCode="$(var.UpgradeCode)" Language="1033" Version="$(var.ProductVersion)">
<Package Id="*" Keywords="Installer" Description="$(var.Description)" Comments="$(var.Comments)"
Manufacturer="$(var.Manufacturer)" InstallerVersion="400" Compressed="yes" Platform="$(var.Platform)"/>
<Condition Message="You need to be an administrator to install this product.">Privileged</Condition>
<Media Id="1" Cabinet="OpenLP.cab" EmbedCab="yes" CompressionLevel="high"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<Property Id="ARPPRODUCTICON" Value="OpenLP.ico" />
<UIRef Id="WixUI_Common" />
<UI Id="WixUI_OpenLP">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="InstallDir" />
<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="1">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
<Property Id="ARPNOMODIFY" Value="1" />
</UI>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Start $(var.ProductName)" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<WixVariable Id="WixUIDialogBmp" Value="%(dialog)s" />
<WixVariable Id="WixUIBannerBmp" Value="%(banner)s" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="%(progfilefolder)s">
<Directory Id="INSTALLDIR" Name="$(var.ProductName)"/>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="$(var.ProductName)">
<Component Id="ProgramMenuDir" Guid="{7AABE54C-5B03-4049-AA85-E18B787A19C7}">
<RemoveFolder Id="ProgramMenuDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\$(var.ProductName)\$(var.ProductName)" Type="string" Value="" KeyPath="yes" />
<util:InternetShortcut Id="OpenLPWebSite"
Name="$(var.ProductName) on the Web"
Target="http://openlp.org/"/>
<util:InternetShortcut Id="OpenLPForums"
Name="Get support for $(var.ProductName)"
Target="http://forums.openlp.org/"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall $(var.ProductName)"
Target="[%(systemfolder)s]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Removes $(var.ProductName) from your computer" />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
<Feature Id="Complete" Title="Complete" Description="The $(var.ProductName) program files" Level="1"
ConfigurableDirectory="INSTALLDIR" AllowAdvertise="no" InstallDefault="local" Absent="disallow">
<ComponentRef Id="ProgramMenuDir"/>
</Feature>
<Icon Id="OpenLP.ico" SourceFile="OpenLP.ico"/>
<Icon Id="service_file.ico" SourceFile="service_file.ico"/>
<Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion Minimum="$(var.ProductVersion)" IncludeMinimum="no" OnlyDetect="yes"
Property="NEWPRODUCTFOUND" />
<UpgradeVersion Minimum="2.4.6" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="no"
Property="UPGRADEFOUND" />
</Upgrade>
<InstallExecuteSequence>
<Custom Action='PreventDowngrading' After='FindRelatedProducts'>NEWPRODUCTFOUND</Custom>
<RemoveExistingProducts Before='InstallInitialize' />
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action='PreventDowngrading' After='FindRelatedProducts'>NEWPRODUCTFOUND</Custom>
</InstallUISequence>
<CustomAction Id='PreventDowngrading' Error='Newer version already installed' />
<Property Id='INNO_UNINSTALLER_64'>
<RegistrySearch Id='LocateInnoUninstaller64' Type='file' Root='HKLM'
Key='SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AA7699FA-B2D2-43F4-8A70-D497D03C9485}_is1'
Name='UninstallString'>
<FileSearch Id='InnoUninstallerExe64' Name='unins000.exe' />
</RegistrySearch>
</Property>
<Property Id='INNO_UNINSTALLER_32'>
<RegistrySearch Id='LocateInnoUninstaller32' Type='file' Root='HKLM'
Key='SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AA7699FA-B2D2-43F4-8A70-D497D03C9485}_is1'
Name='UninstallString'>
<FileSearch Id='InnoUninstallerExe32' Name='unins000.exe' />
</RegistrySearch>
</Property>
<CustomAction Id="ca.RemoveInno64" Property="INNO_UNINSTALLER_64" ExeCommand="/SILENT" Return="check" />
<CustomAction Id="ca.RemoveInno32" Property="INNO_UNINSTALLER_32" ExeCommand="/SILENT" Return="check" />
<InstallExecuteSequence>
<Custom Action="ca.RemoveInno64" Before="InstallFiles">INNO_UNINSTALLER_64</Custom>
<Custom Action="ca.RemoveInno32" Before="InstallFiles"><![CDATA[INNO_UNINSTALLER_32 AND NOT INNO_UNINSTALLER_64]]></Custom>
</InstallExecuteSequence>
</Product>
</Wix>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
windows/WizardBanner.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

BIN
windows/WizardMain.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 KiB

View File

@ -18,7 +18,7 @@ Freeware=true
CommercialUse=true
[Version]
DisplayVersion=%(display_version)s
DisplayVersion=%(display_version)s-%(arch)s
PackageVersion=%(package_version)s
[Control]
@ -27,6 +27,8 @@ Start=OpenLPPortable.exe
[Associations]
FileType=osz
FileType=oszl
[FileTypeIcons]
osz=app
oszl=app

View File

@ -0,0 +1,20 @@
[executables]
htmlhelp = %(progfilesx86)s\HTML Help Workshop\hhc.exe
lrelease = C:\Qt\5.15\msvc2019\bin\lrelease.exe
portablelauncher = %(here)s\..\..\PortableApps.comLauncher\PortableApps.comLauncherGenerator.exe
portableinstaller = %(here)s\..\..\PortableApps.comInstaller\PortableApps.comInstaller.exe
candle = %(progfilesx86)s\WiX Toolset v3.11\bin\candle.exe
light = %(progfilesx86)s\WiX Toolset v3.11\bin\light.exe
[paths]
branch = %(projects)s\openlp-branch
documentation = %(projects)s\documentation
icon = %(here)s\OpenLP.ico
hooks = %(here)s\..\pyinstaller-hooks
license = %(here)s\LICENSE.txt
portable_source = %(here)s\OpenLPPortable
portable_dest = %(projects)s\OpenLPPortable
[transifex]
username =
password =

View File

@ -1,20 +1,19 @@
[executables]
innosetup = %(progfiles)s\Inno Setup 5\ISCC.exe
sphinx = %(pyroot)s\Scripts\sphinx-build.exe
pyinstaller = %(here)s\..\pyinstaller\pyinstaller.py
vcbuild = %(progfiles)s\Microsoft Visual Studio 9.0\VC\vcpackages\vcbuild.exe
htmlhelp = %(progfiles)s\HTML Help Workshop\hhc.exe
psvince = %(here)s\psvince.dll
lrelease = %(sitepackages)s\PyQt4\bin\lrelease.exe
lrelease = %(sitepackages)s\PyQt5\bin\lrelease.exe
portablelauncher = %(progfiles)s\PortableApps.comLauncher\PortableApps.comLauncherGenerator.exe
portableinstaller = %(progfiles)s\PortableApps.comInstaller\PortableApps.comInstaller.exe
candle = %(progfiles)s\WiX Toolset v3.11\bin\candle.exe
light = %(progfiles)s\WiX Toolset v3.11\bin\light.exe
[paths]
branch = %(projects)s\trunk
documentation = %(projects)s\documentation
win32icon = %(here)s\OpenLP.ico
hooks = %(here)s\..\pyinstaller-hooks
portable = %(projects)s\OpenLPPortable
icon = %(here)s\windows\OpenLP.ico
hooks = %(here)s\pyinstaller-hooks
license = %(here)s\LICENSE.txt
portable_source = %(here)s\windows\OpenLPPortable
portable_dest = %(projects)s\OpenLPPortable
[transifex]
username =

Binary file not shown.

BIN
windows/service_file.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -1,678 +0,0 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2011 Raoul Snyman #
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
# Jeffrey Smith, Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode #
# Woldsund #
# --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
# under the terms of the GNU General Public License as published by the Free #
# Software Foundation; version 2 of the License. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
# more details. #
# #
# You should have received a copy of the GNU General Public License along #
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
Windows Build Script
--------------------
This script is used to build the Windows binary and the accompanying installer.
For this script to work out of the box, it depends on a number of things:
Python 2.6/2.7
PyQt4
You should already have this installed, OpenLP doesn't work without it. The
version the script expects is the packaged one available from River Bank
Computing.
PyEnchant
This script expects the precompiled, installable version of PyEnchant to be
installed. You can find this on the PyEnchant site.
Inno Setup 5
Inno Setup should be installed into "C:\%PROGRAMFILES%\Inno Setup 5"
Sphinx
This is used to build the documentation. The documentation trunk must be at
the same directory level as OpenLP trunk and named "documentation".
HTML Help Workshop
This is used to create the help file.
PyInstaller
PyInstaller should be a checkout of revision 1470 of trunk, and in a
directory called, "pyinstaller" on the same level as OpenLP's Bazaar shared
repository directory. The revision is very important as there is currently
a major regression in HEAD.
To install PyInstaller, first checkout trunk from Subversion. The easiest
way is to install TortoiseSVN and then checkout the following URL to a
directory called "pyinstaller"::
http://svn.pyinstaller.org/trunk
Bazaar
You need the command line "bzr" client installed.
OpenLP
A checkout of the latest code, in a branch directory, which is in a Bazaar
shared repository directory. This means your code should be in a directory
structure like this: "openlp\branch-name".
Visual C++ 2008 Express Edition
This is to build pptviewlib.dll, the library for controlling the
PowerPointViewer.
windows-builder.py
This script, of course. It should be in the "windows-installer" directory
at the same level as OpenLP trunk.
psvince.dll
This dll is used during the actual install of OpenLP to check if OpenLP is
running on the users machine prior to the setup. If OpenLP is running,
the install will fail. The dll can be obtained from here:
http://www.vincenzo.net/isxkb/index.php?title=PSVince)
The dll is presently included with this script.
Mako
Mako Templates for Python. This package is required for building the
remote plugin. It can be installed by going to your
python_directory\scripts\.. and running "easy_install Mako". If you do not
have easy_install, the Mako package can be obtained here:
http://www.makotemplates.org/download.html
SQLAlchemy Migrate
Required for the databases used in OpenLP. The package can be
obtained here:
http://code.google.com/p/sqlalchemy-migrate/
Portable App Builds
The following are required if you are planning to make a portable build of
OpenLP. The portable build conforms to the standards published by
PortableApps.com:
http://portableapps.com/development/portableapps.com_format
PortableApps.com Installer:
http://portableapps.com/apps/development/portableapps.com_installer
PortableApps.com Launcher:
http://portableapps.com/apps/development/portableapps.com_launcher
NSIS Portable (Unicode version):
http://portableapps.com/apps/development/nsis_portable
"""
import os
import sys
from shutil import copy, rmtree, move
from distutils import dir_util
from subprocess import Popen, PIPE
from ConfigParser import SafeConfigParser as ConfigParser
from argparse import ArgumentParser
class WindowsBuilder(object):
"""
The :class:`WindowsBuilder` class encapsulates everything that is needed
to build a Windows installer.
"""
def __init__(self):
self.setup_args()
self.setup_system_paths()
self.read_config()
self.setup_executables()
self.setup_paths()
self.version = u''
def _print(self, text, *args):
"""
Print stuff out. Later we might want to use a log file.
"""
if len(args) > 0:
text = text % tuple(args)
print text
def _print_verbose(self, text, *args):
"""
Print output, obeying "verbose" mode.
"""
if self.args.verbose:
self._print(text, *args)
def setup_args(self):
"""
Set up an argument parser and parse the command line arguments.
"""
parser = ArgumentParser()
parser.add_argument('-b', '--branch', metavar='BRANCH', dest='branch',
help='Specify the path to the branch you wish to build.',
default=None)
parser.add_argument('-d', '--documentation', metavar='DOCS',
dest='docs', default=None,
help='Specify the path to the documentation branch.')
parser.add_argument('-c', '--config', metavar='CONFIG', dest='config',
help='Specify the path to the configuration file.',
default=os.path.abspath(os.path.join('.', 'config.ini')))
parser.add_argument('-u', '--skip-update', dest='skip_update',
action='store_true', default=False,
help='Do NOT update the branch before building.')
parser.add_argument('-p', '--portable', metavar='PORTABLE',
dest='portable', default=None,
help='Specify the path to build the portable installation.')
parser.add_argument('-t', '--skip-translations',
dest='skip_translations', action='store_true', default=False,
help='Do NOT update the language translation files.')
parser.add_argument('-v', '--verbose', dest='verbose',
action='store_true', default=False,
help='Print out additional information.')
self.args = parser.parse_args()
def read_config(self):
"""
Read the configuration from the configuration file.
"""
self.config = ConfigParser(defaults={
u'pyroot': self.python_root,
u'progfiles': self.program_files,
u'sitepackages': self.site_packages,
u'here': self.script_path
})
self.config.read(os.path.abspath(self.args.config))
def setup_system_paths(self):
"""
Set up some system paths.
"""
self.script_path = os.path.split(os.path.abspath(__file__))[0]
self.python = sys.executable
self.python_root = os.path.split(self.python)[0]
self.site_packages = os.path.join(self.python_root,
u'Lib', u'site-packages')
self.program_files = os.getenv(u'PROGRAMFILES')
def setup_executables(self):
"""
Set up the paths to the executables we use.
"""
self.innosetup = os.path.abspath(
self.config.get(u'executables', u'innosetup'))
self.sphinx = os.path.abspath(
self.config.get(u'executables', u'sphinx'))
self.pyinstaller = os.path.abspath(
self.config.get(u'executables', u'pyinstaller'))
self.vcbuild = os.path.abspath(
self.config.get(u'executables', u'vcbuild'))
self.hhc = os.path.abspath(
self.config.get(u'executables', u'htmlhelp'))
self.psvince = os.path.abspath(
self.config.get(u'executables', u'psvince'))
self.portableinstaller = os.path.abspath(
self.config.get(u'executables', u'portableinstaller'))
self.portablelauncher = os.path.abspath(
self.config.get(u'executables', u'portablelauncher'))
if os.path.exists(os.path.join(self.site_packages, u'PyQt4', u'bin')):
# Older versions of the PyQt4 Windows installer put their binaries
# in the "bin" directory
self.lrelease = os.path.join(self.site_packages, u'PyQt4',
u'bin', u'lrelease.exe')
else:
# Newer versions of the PyQt4 Windows installer put their binaries
# in the base directory of the installation
self.lrelease = os.path.join(self.site_packages, u'PyQt4',
u'lrelease.exe')
def setup_paths(self):
"""
Set up a variety of paths that we use throughout the build process.
"""
if self.args.branch:
branch_path = self.args.branch
else:
branch_path = self.config.get(u'paths', u'branch')
self.branch_path = os.path.abspath(branch_path)
if self.args.docs:
docs_path = self.args.docs
else:
docs_path = self.config.get(u'paths', u'documentation')
self.docs_path = os.path.abspath(docs_path)
if self.args.portable:
portable_path = self.args.portable
else:
try:
portable_path = self.config.get(u'paths', u'portable')
except:
portable_path = u''
if portable_path:
self.portable_path = os.path.abspath(portable_path)
self.args.portable = self.portable_path
else:
self.portable_path = u''
self.openlp_script = os.path.abspath(
os.path.join(branch_path, u'openlp.pyw'))
self.hooks_path = os.path.abspath(self.config.get(u'paths', u'hooks'))
self.win32_icon = os.path.abspath(
self.config.get(u'paths', u'win32icon'))
self.i18n_utils = os.path.join(self.branch_path, u'scripts',
u'translation_utils.py')
self.source_path = os.path.join(self.branch_path, u'openlp')
self.manual_path = os.path.join(self.docs_path, u'manual')
self.manual_build_path = os.path.join(self.manual_path, u'build')
self.helpfile_path = os.path.join(self.manual_build_path, u'htmlhelp')
self.i18n_path = os.path.join(self.branch_path, u'resources', u'i18n')
self.winres_path = os.path.join(self.branch_path, u'resources',
u'windows')
self.build_path = os.path.join(self.branch_path, u'build')
self.dist_path = os.path.join(self.branch_path, u'dist', u'OpenLP')
self.pptviewlib_path = os.path.join(self.source_path, u'plugins',
u'presentations', u'lib', u'pptviewlib')
def update_code(self):
"""
Update the code in the branch.
"""
os.chdir(self.branch_path)
self._print(u'Reverting any changes to the code...')
bzr = Popen((u'bzr', u'revert'), stdout=PIPE)
output = bzr.communicate()[0]
code = bzr.wait()
if code != 0:
self._print(output)
raise Exception(u'Error reverting the code')
self._print(u'Updating the code...')
bzr = Popen((u'bzr', u'update'), stdout=PIPE)
output = bzr.communicate()[0]
code = bzr.wait()
if code != 0:
self._print(output)
raise Exception(u'Error updating the code')
def run_pyinstaller(self):
"""
Run PyInstaller on the branch to build an executable.
"""
self._print(u'Running PyInstaller...')
os.chdir(self.branch_path)
pyinstaller = Popen((self.python, self.pyinstaller,
u'--noconfirm',
u'--windowed',
u'--noupx',
u'--additional-hooks-dir', self.hooks_path,
u'--runtime-hook', os.path.join(self.hooks_path, 'rthook_openlp_pyqt4.py'),
u'--log-level=ERROR',
u'-o', self.branch_path,
u'-i', self.win32_icon,
u'-p', self.branch_path,
u'-n', u'OpenLP',
self.openlp_script),
stdout=PIPE)
output = pyinstaller.communicate()[0]
code = pyinstaller.wait()
if code != 0:
self._print(output)
raise Exception(u'Error running PyInstaller')
def write_version_file(self):
"""
Write the version number to a file for reading once installed.
"""
self._print(u'Writing version file...')
os.chdir(self.branch_path)
bzr = Popen((u'bzr', u'tags', u'--sort', u'time'), stdout=PIPE)
output = bzr.communicate()[0]
code = bzr.wait()
if code != 0:
raise Exception(u'Error running bzr tags')
lines = output.splitlines()
if len(lines) == 0:
tag = u'0.0.0'
revision = u'0'
else:
tag, revision = lines[-1].split()
bzr = Popen((u'bzr', u'log', u'--line', u'-r', u'-1'), stdout=PIPE)
output, error = bzr.communicate()
code = bzr.wait()
if code != 0:
raise Exception(u'Error running bzr log')
output_ascii = unicode(output, errors=u'ignore')
latest = output_ascii.split(u':')[0]
version_string = latest == revision and tag or \
u'%s-bzr%s' % (tag, latest)
# Save decimal version in case we need to do a portable build.
self.version = latest == revision and tag or\
u'%s.%s' % (tag, latest)
version_file = open(os.path.join(self.dist_path, u'.version'), u'w')
version_file.write(version_string)
version_file.close()
def copy_plugins(self):
"""
Copy all the plugins to the correct directory so that OpenLP sees that
it has plugins.
"""
self._print(u'Copying plugins...')
source = os.path.join(self.source_path, u'plugins')
dest = os.path.join(self.dist_path, u'plugins')
for root, dirs, files in os.walk(source):
for filename in files:
if not filename.endswith(u'.pyc'):
dest_path = os.path.join(dest, root[len(source)+1:])
if not os.path.exists(dest_path):
os.makedirs(dest_path)
self._print_verbose(u'... %s', filename)
copy(os.path.join(root, filename),
os.path.join(dest_path, filename))
def copy_media_player(self):
"""
Copy the media players to the correct directory for OpenLP.
"""
self._print(u'Copying media player...')
source = os.path.join(self.source_path, u'core', u'ui', u'media')
dest = os.path.join(self.dist_path, u'core', u'ui', u'media')
for root, dirs, files in os.walk(source):
for filename in files:
if not filename.endswith(u'.pyc'):
dest_path = os.path.join(dest, root[len(source)+1:])
if not os.path.exists(dest_path):
os.makedirs(dest_path)
self._print_verbose(u'... %s', filename)
copy(os.path.join(root, filename),
os.path.join(dest_path, filename))
def copy_windows_files(self):
"""
Copy all the Windows-specific files.
"""
self._print(u'Copying extra files for Windows...')
self._print_verbose(u'... OpenLP.ico')
copy(os.path.join(self.script_path, u'OpenLP.ico'),
os.path.join(self.dist_path, u'OpenLP.ico'))
self._print_verbose(u'... LICENSE.txt')
copy(os.path.join(self.script_path, u'LICENSE.txt'),
os.path.join(self.dist_path, u'LICENSE.txt'))
self._print_verbose(u'... psvince.dll')
copy(self.psvince, os.path.join(self.dist_path, u'psvince.dll'))
if os.path.isfile(os.path.join(self.helpfile_path, u'OpenLP.chm')):
self._print_verbose(u'... OpenLP.chm')
copy(os.path.join(self.helpfile_path, u'OpenLP.chm'),
os.path.join(self.dist_path, u'OpenLP.chm'))
else:
self._print(u'... WARNING: Windows help file not found')
def update_translations(self):
"""
Update the translations.
"""
self._print(u'Updating translations...')
if not self.config.has_section('transifex'):
raise Exception(u'No section named "transifex" found.')
if not self.config.has_option('transifex', 'username'):
raise Exception(u'No option named "username" found.')
if not self.config.has_option('transifex', 'password'):
raise Exception(u'No option named "password" found.')
username = self.config.get(u'transifex', u'username')
password = self.config.get(u'transifex', u'password')
os.chdir(os.path.split(self.i18n_utils)[0])
translation_utils = Popen([self.python, self.i18n_utils, u'-qdpu',
u'-U', username, u'-P', password])
code = translation_utils.wait()
if code != 0:
raise Exception(u'Error running translation_utils.py')
def compile_translations(self):
"""
Compile the translations for Qt.
"""
self._print(u'Compiling translations...')
files = os.listdir(self.i18n_path)
if not os.path.exists(os.path.join(self.dist_path, u'i18n')):
os.makedirs(os.path.join(self.dist_path, u'i18n'))
for file in files:
if file.endswith(u'.ts'):
self._print_verbose(u'... %s', file)
source_path = os.path.join(self.i18n_path, file)
dest_path = os.path.join(self.dist_path, u'i18n',
file.replace(u'.ts', u'.qm'))
lconvert = Popen((self.lrelease, u'-compress', u'-silent',
source_path, u'-qm', dest_path))
code = lconvert.wait()
if code != 0:
raise Exception(u'Error running lconvert on %s' % \
source_path)
self._print(u'Copying qm files...')
source = os.path.join(self.site_packages, u'PyQt4', u'translations')
files = os.listdir(source)
for filename in files:
if filename.startswith(u'qt_') and filename.endswith(u'.qm') and \
len(filename) == 8:
self._print_verbose(u'... %s', filename)
copy(os.path.join(source, filename),
os.path.join(self.dist_path, u'i18n', filename))
def run_sphinx(self):
"""
Run Sphinx to build an HTML Help project.
"""
self._print(u'Deleting previous help manual build... %s',
self.manual_build_path)
if os.path.exists(self.manual_build_path):
rmtree(self.manual_build_path)
self._print(u'Running Sphinx...')
os.chdir(self.manual_path)
sphinx = Popen((self.sphinx, u'-b', u'htmlhelp', u'-d',
u'build/doctrees', u'source', u'build/htmlhelp'), stdout=PIPE)
output, error = sphinx.communicate()
code = sphinx.wait()
if code != 0:
self._print(output)
raise Exception(u'Error running Sphinx')
def run_htmlhelp(self):
"""
Run HTML Help Workshop to convert the Sphinx output into a manual.
"""
self._print(u'Running HTML Help Workshop...')
os.chdir(os.path.join(self.manual_build_path, u'htmlhelp'))
hhc = Popen((self.hhc, u'OpenLP.chm'), stdout=PIPE)
output, error = hhc.communicate()
code = hhc.wait()
if code != 1:
self._print(u'Exit code:', code)
self._print(output)
raise Exception(u'Error running HTML Help Workshop')
def create_innosetup_file(self):
"""
Create an InnoSetup file pointing to the branch being built.
"""
self._print(u'Creating Inno Setup file...')
input = open(os.path.join(self.script_path,
u'OpenLP-2.0.iss.default'), u'r').read()
output = input.replace(u'%(branch)s', self.branch_path)
outfile = open(os.path.join(self.script_path,
u'OpenLP-2.0.iss'), u'w')
outfile.write(output)
outfile.close()
def check_portableapp_directory(self):
"""
Checks the PortableApp directory structure amd creates
missing subdirs
"""
self._print(u' Checking PortableApps directory structure...')
launcher_path = os.path.join(self.portable_path, u'App',
u'Appinfo', u'Launcher')
if not os.path.exists(launcher_path):
os.makedirs(launcher_path)
settings_path = os.path.join(self.portable_path, u'Data',
u'Settings')
if not os.path.exists(settings_path):
os.makedirs(settings_path)
def create_portableapps_appinfo_file(self):
"""
Create a Portabbleapps appinfo.ini file.
"""
self._print(u' Creating PortableApps appinfo file ...')
portable_version = self.version + '.0' * (3-self.version.count('.'))
input = open(os.path.join(self.script_path,
u'appinfo.ini.default'), u'r').read()
output = input.replace(u'%(display_version)s', self.version)
output = output.replace(u'%(package_version)s', portable_version)
outfile = open(os.path.join(self.portable_path, u'App',
u'Appinfo', u'appinfo.ini'), u'w')
outfile.write(output)
outfile.close()
def run_innosetup(self):
"""
Run InnoSetup to create an installer.
"""
self._print(u'Running Inno Setup...')
os.chdir(self.script_path)
innosetup = Popen((self.innosetup,
os.path.join(self.script_path, u'OpenLP-2.0.iss'), u'/q'))
code = innosetup.wait()
if code != 0:
raise Exception(u'Error running Inno Setup')
def run_portableapp_builder(self):
"""
Creates a portable installer.
1 Copies the distribution to the portable apps directory
2 Builds the PortableApps Launcher
3 Builds the PortableApps Install
"""
self._print(u'Running PortableApps Builder...')
self._print(u' Clearing old files')
# Remove previous contents of portableapp build directory.
if os.path.exists(self.portable_path):
rmtree(self.portable_path)
self._print(u' Creating PortableApps build directory')
# Copy the contents of the OpenLPPortable directory to the portable
# build directory.
dir_util.copy_tree(os.path.join(self.script_path, u'OpenLPPortable'),
self.portable_path)
self.check_portableapp_directory()
self.create_portableapps_appinfo_file()
# Copy distribution files to portableapp build directory.
self._print(u' Copying distribution files')
portable_app_path = os.path.join(self.portable_path, u'App', u'OpenLP')
dir_util.copy_tree(self.dist_path, portable_app_path)
# Copy help files to portableapp build directory.
self._print(u' Copying help files')
dir_util.copy_tree(self.helpfile_path,
os.path.join(portable_app_path, u'help'))
# Build the launcher.
self._print(u' Building PortableApps Launcher')
portableapps = Popen((self.portablelauncher, self.portable_path),
stdout=PIPE)
code = portableapps.wait()
if code != 0:
raise Exception(u'Error creating PortableAppa Launcher')
# Build the portable installer.
self._print(u' Building PortableApps Installer')
portableapps = Popen((self.portableinstaller, self.portable_path),
stdout=PIPE)
code = portableapps.wait()
if code != 0:
raise Exception(u'Error running PortableApps Installer')
portable_app = os.path.abspath(os.path.join(self.portable_path, u'..',
u'OpenLPPortable_%s.paf.exe' % self.version))
if os.path.exists(portable_app):
move(portable_app, os.path.abspath(
os.path.join(self.dist_path, u'..')))
self._print(u' PortableApp build complete')
else:
raise Exception(u'PortableApp failed to build')
def build_pptviewlib(self):
"""
Build the PowerPoint Viewer DLL using Visual Studio.
"""
self._print(u'Building PPTVIEWLIB.DLL...')
vcbuild = Popen((self.vcbuild, u'/rebuild',
os.path.join(self.pptviewlib_path, u'pptviewlib.vcproj'),
u'Release|Win32'))
code = vcbuild.wait()
if code != 0:
raise Exception(u'Error building pptviewlib.dll')
copy(os.path.join(self.pptviewlib_path, u'Release',
u'pptviewlib.dll'), self.pptviewlib_path)
def main(self):
"""
The main function to run the Windows builder.
"""
self._print_verbose(u'OpenLP main script: ......%s',
self.openlp_script)
self._print_verbose(u'Script path: .............%s',
os.path.split(os.path.abspath(__file__))[0])
self._print_verbose(u'Branch path: .............%s', self.branch_path)
self._print_verbose(u'Source path: .............%s', self.source_path)
self._print_verbose(u'Dist path: ...............%s', self.dist_path)
self._print_verbose(u'Portable path: ...........%s',
self.portable_path)
self._print_verbose(u'PyInstaller: .............%s', self.pyinstaller)
self._print_verbose(u'Documentation branch path:%s', self.docs_path)
self._print_verbose(u'Help file build path: ....%s',
self.helpfile_path)
self._print_verbose(u'Inno Setup path: .........%s', self.innosetup)
self._print_verbose(u'PortableApp Launcher......%s',
self.portablelauncher)
self._print_verbose(u'PortableApp Installer.....%s',
self.portableinstaller)
self._print_verbose(u'Windows resources: .......%s', self.winres_path)
self._print_verbose(u'VCBuild path: ............%s', self.vcbuild)
self._print_verbose(u'PPTVIEWLIB path: .........%s',
self.pptviewlib_path)
self._print_verbose(u'')
if not self.args.skip_update:
self.update_code()
self.build_pptviewlib()
self.run_pyinstaller()
self.write_version_file()
self.copy_plugins()
self.copy_media_player()
if os.path.exists(self.manual_path):
self.run_sphinx()
self.run_htmlhelp()
else:
self._print(u'')
self._print(u'WARNING: Documentation trunk not found. Windows')
self._print(u' Help file will not be included in build')
self._print(u'')
self.copy_windows_files()
if not self.args.skip_translations:
self.update_translations()
self.compile_translations()
self.create_innosetup_file()
self.run_innosetup()
if self.args.portable:
self.run_portableapp_builder()
self._print(u'Done.')
if __name__ == u'__main__':
WindowsBuilder().main()