[vlc-commits] [Git][videolan/vlc][master] 7 commits: contrib: ignore the new python-venv

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Nov 18 16:46:44 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
51d7e624 by Steve Lhomme at 2022-11-18T15:49:19+00:00
contrib: ignore the new python-venv

- - - - -
4375deb7 by Steve Lhomme at 2022-11-18T15:49:19+00:00
msi: restrict the MSI package to Windows 7+

We don't support versions lower than that on 4.0.

- - - - -
672c356c by Steve Lhomme at 2022-11-18T15:49:19+00:00
msi: use a UNIX path for the config.wxi

Wix is OK with it and UNIX MSI tools will not handle the Windows path.

- - - - -
4f82ee8a by Steve Lhomme at 2022-11-18T15:49:19+00:00
win32: package: use forward slash for Windows pathes

wix has no problem with that

- - - - -
4649dc4f by Steve Lhomme at 2022-11-18T15:49:19+00:00
win32: package: group the wine path for the virtual build drive

- - - - -
59d7186b by Steve Lhomme at 2022-11-18T15:49:19+00:00
win32: package: use the output .msi file as a target

So we can show when we generate it.

- - - - -
6f996ffa by Steve Lhomme at 2022-11-18T15:49:19+00:00
win32: replace Wix heat with a python script

It allows showing friendly names in the .msi for each file rather than some hash.

For now we never keep the .pdb files.

- - - - -


4 changed files:

- contrib/.gitignore
- extras/package/win32/msi.mak
- + extras/package/win32/msi/msi-heat.py
- extras/package/win32/msi/product.wxs


Changes:

=====================================
contrib/.gitignore
=====================================
@@ -1,4 +1,5 @@
 bin
+python-venv
 vlc-contrib-*.tar.xz
 vlc-contrib-*.tar.bz2
 /*-*-*/


=====================================
extras/package/win32/msi.mak
=====================================
@@ -4,10 +4,10 @@ BUILT_SOURCES_distclean += \
 endif
 
 WIXPATH=`wine winepath -u 'C:\\Program Files (x86)\\Windows Installer XML v3.5\\bin'`
-HEAT=wine "$(WIXPATH)/heat.exe"
+HEAT=$(MSIDIR)/msi-heat.py
 CANDLE=wine "$(WIXPATH)/candle.exe"
 LIGHT=wine "$(WIXPATH)/light.exe"
-VLCDIR=`wine winepath -s \`wine winepath -w '$(abs_top_builddir)/vlc-$(VERSION)'\``
+VLCDIR=$(abs_top_builddir)/vlc-$(VERSION)
 MSIDIR=$(abs_srcdir)/extras/package/win32/msi
 W_MSIDIR=`wine winepath -w '$(MSIDIR)'`
 MSIBUILDDIR=$(abs_top_builddir)/extras/package/win32/msi
@@ -17,28 +17,29 @@ MSIOUTFILE=vlc-$(VERSION)-win64.msi
 else
 MSIOUTFILE=vlc-$(VERSION)-win32.msi
 endif
-WINE_C=`wine winepath c:`
+W_WINE_C=c:/v
+WINE_C=`wine winepath $(W_WINE_C)`
 
 heat: package-win-strip
-	$(HEAT) dir $(VLCDIR)/plugins -cg CompPluginsGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(W_MSIBUILDDIR)/Plugins.fragment.wxs
-	$(HEAT) dir $(VLCDIR)/locale -cg CompLocaleGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(W_MSIBUILDDIR)/Locale.fragment.wxs
+	$(HEAT) --dir $(VLCDIR)/plugins -cg CompPluginsGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(MSIBUILDDIR)/Plugins.fragment.wxs
+	$(HEAT) --dir $(VLCDIR)/locale -cg CompLocaleGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(MSIBUILDDIR)/Locale.fragment.wxs
 if BUILD_LUA
-	$(HEAT) dir $(VLCDIR)/lua -cg CompLuaGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(W_MSIBUILDDIR)/Lua.fragment.wxs
+	$(HEAT) --dir $(VLCDIR)/lua -cg CompLuaGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(MSIBUILDDIR)/Lua.fragment.wxs
 endif
 if BUILD_SKINS
-	$(HEAT) dir $(VLCDIR)/skins -cg CompSkinsGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(W_MSIBUILDDIR)/Skins.fragment.wxs
+	$(HEAT) --dir $(VLCDIR)/skins -cg CompSkinsGroup -gg -scom -sreg -sfrag -dr APPLICATIONFOLDER -out $(MSIBUILDDIR)/Skins.fragment.wxs
 endif
 
 candle: heat
-	$(am__cd) $(MSIBUILDDIR) && $(CANDLE) -arch $(WINDOWS_ARCH) -ext WiXUtilExtension $(W_MSIDIR)\\product.wxs $(W_MSIDIR)\\axvlc.wxs $(W_MSIDIR)\\extensions.wxs $(W_MSIBUILDDIR)\\*.fragment.wxs
+	$(am__cd) $(MSIBUILDDIR) && $(CANDLE) -arch $(WINDOWS_ARCH) -ext WiXUtilExtension $(W_MSIDIR)/product.wxs $(W_MSIDIR)/axvlc.wxs $(W_MSIDIR)/extensions.wxs $(W_MSIBUILDDIR)/*.fragment.wxs
 
-light: candle
-	test ! -d "$(WINE_C)/v" -o ! -f "$(WINE_C)/v"
-	ln -Tsf "$(abs_top_builddir)/vlc-$(VERSION)" "$(WINE_C)"/v
-	$(LIGHT) -sval -spdb -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -b $(W_MSIDIR) -b C:/v/plugins -b C:/v/locale -b C:/v/lua -b C:/v/skins $(W_MSIBUILDDIR)\\product.wixobj $(W_MSIBUILDDIR)\\axvlc.wixobj $(W_MSIBUILDDIR)\\extensions.wixobj $(W_MSIBUILDDIR)\\*.fragment.wixobj -o $(MSIOUTFILE)
-	chmod 644 $(MSIOUTFILE)
+$(MSIOUTFILE): candle
+	test ! -d "$(WINE_C)" -o ! -f "$(WINE_C)"
+	ln -Tsf "$(abs_top_builddir)/vlc-$(VERSION)" "$(WINE_C)"
+	$(AM_V_GEN)$(LIGHT) -sval -spdb -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -b $(W_MSIDIR) -b $(W_WINE_C)/plugins -b $(W_WINE_C)/locale -b $(W_WINE_C)/lua -b $(W_WINE_C)/skins $(W_MSIBUILDDIR)/product.wixobj $(W_MSIBUILDDIR)/axvlc.wixobj $(W_MSIBUILDDIR)/extensions.wixobj $(W_MSIBUILDDIR)/*.fragment.wixobj -o $@
+	chmod 644 $@
 
-package-msi: light
+package-msi: $(MSIOUTFILE)
 
 cleanmsi:
 	-rm -f $(MSIBUILDDIR)/*.wixobj
@@ -48,4 +49,4 @@ cleanmsi:
 distcleanmsi: cleanmsi
 	-rm -f $(MSIOUTFILE)
 
-.PHONY: heat candle light cleanmsi distcleanmsi package-msi
+.PHONY: heat candle cleanmsi distcleanmsi package-msi


=====================================
extras/package/win32/msi/msi-heat.py
=====================================
@@ -0,0 +1,97 @@
+#!/usr/bin/env python3
+
+# Copyright © 2022 VideoLabs, VLC authors and VideoLAN
+#
+# Authors: Steve Lhomme <robux4 at videolabs.io>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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.
+
+import argparse
+import os
+import pathlib
+import hashlib
+
+# Argument parsing
+parser = argparse.ArgumentParser(description="Generate WIX compatible wxs listing")
+parser.add_argument('-d', "--dir", type=pathlib.Path, help='directory with files to list')
+parser.add_argument('-out', type=argparse.FileType('w', encoding='UTF-8'), help="output file")
+parser.add_argument('-pdb', action=argparse.BooleanOptionalAction, help='keep PDB files', default=False)
+parser.add_argument('-dr', "--directory-reference", help='directory reference')
+parser.add_argument('-cg', "--component-group", help='component group')
+args, remaining = parser.parse_known_args()
+
+# print(args.out)
+# print(args.dir)
+
+def generate_id(prefix='', file=''):
+    joined = prefix + file
+    hash_object = hashlib.sha1(joined.encode('ascii'))
+    pbHash = hash_object.hexdigest()
+    return prefix + pbHash.upper()
+
+args.out.write('<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n')
+args.out.write('<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">\r\n')
+args.out.write('    <Fragment>\r\n')
+args.out.write('        <DirectoryRef Id="{}">\r\n'.format(args.directory_reference))
+
+# args.out.write('            <Directory Id="{}" Name="{}">\r\n'.format(generate_id('dir', args.dir.name), args.dir.name))
+
+fileIdList =[]
+
+def outputDir(top, parent: str, dir: str, with_pdb: bool):
+    cwd = top.joinpath(parent).joinpath(dir)
+    dirName = os.path.join(parent, dir)
+    if dir=='':
+        dir = top.name
+        dirId = generate_id('dir', os.path.join(top.name, dir))
+    else:
+        dirId = generate_id('dir', os.path.join(parent, dir))
+    args.out.write('                <Directory Id="{}" Name="{}">\r\n'.format(dirId, dir))
+    if cwd.is_dir():
+        # first list files
+        for file in cwd.iterdir():
+            if not file.is_dir():
+                # args.out.write('          file   <{}>\r\n'.format(file))
+                if not file.name.endswith('.pdb'):
+                    outname = os.path.join(dirName, file.name)
+                    fileId = generate_id('cmp', outname)
+                    args.out.write('                    <Component Id="{}" Guid="*">\r\n'.format(fileId))
+                    fileIdList.append(fileId)
+                    args.out.write('                        <File Id="{}" Name="{}" KeyPath="yes" Source="SourceDir/{}"/>\r\n'.format(generate_id('fil', outname), file.name, outname))
+                    args.out.write('                    </Component>\r\n')
+        # then sub directories
+        for file in cwd.iterdir():
+            if file.is_dir():
+                # args.out.write('         dir    <{}>\r\n'.format(file))
+                outputDir(top, dirName, file.name, with_pdb)
+
+    args.out.write('                </Directory>\r\n')
+
+print(args.dir.parent)
+print(args.dir.name)
+outputDir(args.dir, '', '', args.pdb)
+
+# args.out.write('            </Directory>\r\n')
+args.out.write('        </DirectoryRef>\r\n')
+args.out.write('    </Fragment>\r\n')
+
+args.out.write('    <Fragment>\r\n')
+args.out.write('        <ComponentGroup Id="{}">\r\n'.format(args.component_group))
+for name in fileIdList:
+    args.out.write('                    <ComponentRef Id="{}"/>\r\n'.format(name))
+args.out.write('        </ComponentGroup>\r\n')
+args.out.write('    </Fragment>\r\n')
+
+args.out.write('</Wix>\r\n')


=====================================
extras/package/win32/msi/product.wxs
=====================================
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 
 -->
-<?include $(sys.CURRENTDIR)\config.wxi?>
+<?include $(sys.CURRENTDIR)/config.wxi?>
 <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
     <Product
@@ -39,8 +39,8 @@
             Compressed='yes'
             Platform="$(var.Platform)" />
 
-        <Condition Message="This application is only supported on Windows XP or higher.">
-            <![CDATA[Installed OR (VersionNT >= 501)]]>
+        <Condition Message="This application is only supported on Windows 7 or higher.">
+            <![CDATA[Installed OR (VersionNT >= 601)]]>
         </Condition>
 
         <MajorUpgrade Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f22e2b370aa2eab411040350b9aade8fa5d4e1a6...6f996ffa27a620e1a25cffc2039a322eb4fdabc2

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f22e2b370aa2eab411040350b9aade8fa5d4e1a6...6f996ffa27a620e1a25cffc2039a322eb4fdabc2
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list