← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/vlc-plugins into lp:openlp/packaging

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/vlc-plugins into lp:openlp/packaging.

Commit message:
Package the VLC plugins too.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/vlc-plugins/+merge/370013

Package the VLC plugins too.
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/vlc-plugins into lp:openlp/packaging.
=== modified file 'builders/macosx-builder.py'
--- builders/macosx-builder.py	2019-06-05 06:04:54 +0000
+++ builders/macosx-builder.py	2019-07-11 17:18:19 +0000
@@ -285,26 +285,41 @@
         for path in egg_info_glob:
             rmtree(path, True)
 
+    def _copy_vlc_files(self):
+        """
+        Copy the VLC files into the app bundle
+        """
+        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))
+            copy(os.path.join(vlc_path, 'lib', 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 _copy_bundle_files(self):
         """
         Copy Info.plist and OpenLP.icns to app bundle.
         """
+        self._print_verbose('... OpenLP.icns')
         copy(self.icon_path, os.path.join(self.dist_app_path, 'Contents', 'Resources',
                                           os.path.basename(self.icon_path)))
-        # Add OpenLP version to Info.plist and put it to app bundle.
-        fr = open(self.bundle_info_path, 'r')
-        fw = open(os.path.join(self.dist_app_path, 'Contents', os.path.basename(self.bundle_info_path)), 'w')
-        text = fr.read()
-        text = text % {'openlp_version': self.version}
-        fw.write(text)
-        fr.close()
-        fw.close()
+        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.version}
+            fw.write(text)
 
     def _copy_macosx_files(self):
         """
         Copy all the OSX-specific files.
         """
-        self._print('Copying extra files for Mac OS X...')
         self._print_verbose('... LICENSE.txt')
         copy(self.license_path, os.path.join(self.dist_path, 'LICENSE.txt'))
         self._print_verbose('... mudraw')
@@ -388,6 +403,8 @@
         """
         Copy any extra files which are particular to a platform
         """
+        self._print('Copying extra files for macOS...')
+        self._copy_vlc_files()
         self._copy_bundle_files()
         self._copy_macosx_files()
 

=== modified file 'builders/windows-builder.py'
--- builders/windows-builder.py	2019-06-05 06:04:54 +0000
+++ builders/windows-builder.py	2019-07-11 17:18:19 +0000
@@ -100,7 +100,7 @@
 import sys
 from distutils import dir_util
 from hashlib import md5
-from shutil import copy, move, rmtree
+from shutil import copy, copytree, move, rmtree
 
 from lxml.etree import fromstring, parse, tostring
 from lxml.builder import E, ElementMaker
@@ -410,9 +410,16 @@
             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(self.dist_path, 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):
         """


Follow ups