[vlc-commits] [Git][videolan/vlc][master] 7 commits: win32: package: build inside the output directory

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 24 10:04:58 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
385db2b1 by Steve Lhomme at 2022-11-24T09:55:17+01:00
win32: package: build inside the output directory

So we don't need to include windows style path. By default light.exe looks for
files in the current directory.

- - - - -
6151644c by Steve Lhomme at 2022-11-24T09:55:17+01:00
configure: detect how to transform windows pathes

winepath, wslpath and cygpath have a compatible syntax (at least -w and -u).

They should be used depending on what is available in the build environment
rather than hardcoding "wine winepath".

- - - - -
268d209e by Steve Lhomme at 2022-11-24T09:55:18+01:00
win32: msi: use the detected way to handle windows pathes

Rather than hardcoding "wine winepath".

- - - - -
a9f4e219 by Steve Lhomme at 2022-11-24T09:55:18+01:00
configure: add an option to set the PATH to WIX

In the CI the path is in a wine location. If we build WIX in contribs, we can
use that path instead.

We default to the contrib path unless set by the user.

- - - - -
ef0c6a51 by Steve Lhomme at 2022-11-24T09:55:18+01:00
package/win32: build.sh: add an option to set the WIX path

- - - - -
8e167abc by Steve Lhomme at 2022-11-24T09:55:18+01:00
CI: set the path to the WIX install in Docker images

- - - - -
a5ea1181 by Steve Lhomme at 2022-11-24T09:55:49+01:00
win32: package: use the configured path to the WIX binaries

- - - - -


6 changed files:

- configure.ac
- extras/ci/gitlab-ci.yml
- extras/package/win32/build.sh
- extras/package/win32/msi.mak
- extras/package/win32/msi/config.wxi.in
- extras/package/win32/msi/msi-heat.py


Changes:

=====================================
configure.ac
=====================================
@@ -1406,6 +1406,43 @@ if test "${ac_cv_c_attribute_packed}" != "no"; then
   AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
 fi
 
+WIN32_PATH_CMD=
+AS_IF([test "${SYS}" = "mingw32"], [
+    AC_MSG_CHECKING([how to transform windows pathes])
+    win32_path_cmd=no
+    for win_path in "cygpath" "wslpath" "wine winepath"
+    do
+      ac_try="$win_path -u c: >/dev/null"
+      (eval "$ac_try") 2>&5
+      ac_status=$?
+      if test $ac_status = 0; then
+        win32_path_cmd=$win_path
+        break
+      fi
+    done
+    AS_IF([test "x${win32_path_cmd}" != "xno"],[
+      WIN32_PATH_CMD=${win32_path_cmd}
+      AC_MSG_RESULT([using '${win32_path_cmd}'])
+    ],[
+      AC_MSG_RESULT([not possible])
+    ])
+])
+
+AC_SUBST([WIN32_PATH_CMD])
+
+AC_ARG_WITH([wix],
+    AS_HELP_STRING([--with-wix=DIR], [location of WIX binary (default: contribs)])
+)
+AS_IF([test -z "${with_wix}"], [
+    AS_IF([test -n "${CONTRIB_DIR}"], [
+        with_wix="${CONTRIB_DIR}/bin"
+    ])
+])
+AS_IF([test "${with_wix}" != "no"], [
+    WIXPATH="${with_wix}"
+])
+AC_SUBST([WIXPATH])
+
 dnl
 dnl  Check the CPU
 dnl


=====================================
extras/ci/gitlab-ci.yml
=====================================
@@ -46,18 +46,21 @@ variables:
         VLCARCH: win32
         HOST_ARCH: i686
         TRIPLET: $HOST_ARCH-w64-mingw32
+        WIX_PATH: '-W/home/videolan/.wine/dosdevices/c:/Program Files (x86)/Windows Installer XML v3.5/bin'
 
 .variables-win64: &variables-win64
         SHORTARCH: win64
         VLCARCH: win64
         HOST_ARCH: x86_64
         TRIPLET: $HOST_ARCH-w64-mingw32
+        WIX_PATH: '-W/home/videolan/.wine/dosdevices/c:/Program Files (x86)/Windows Installer XML v3.5/bin'
 
 .variables-win64-arm: &variables-win64-arm
         SHORTARCH: arm64
         VLCARCH: winarm64
         HOST_ARCH: aarch64
         TRIPLET: $HOST_ARCH-w64-mingw32
+        WIX_PATH: '-W/home/videolan/.wine/dosdevices/c:/Program Files (x86)/Windows Installer XML v3.5/bin'
 
 .variables-macos-x86_64: &variables-macos-x86_64
         VLC_PATH: /Users/videolanci/sandbox/bin
@@ -144,7 +147,7 @@ variables:
         if [ "${CI_COMMIT_BRANCH}" = "${CI_DEFAULT_BRANCH}" ]; then
             EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -c"
         fi
-        extras/package/win32/build.sh -a $HOST_ARCH $EXTRA_BUILD_FLAGS $LIBVLC_EXTRA_BUILD_FLAGS $UWP_EXTRA_BUILD_FLAGS
+        extras/package/win32/build.sh -a $HOST_ARCH $EXTRA_BUILD_FLAGS $LIBVLC_EXTRA_BUILD_FLAGS $UWP_EXTRA_BUILD_FLAGS "${WIX_PATH}"
         if [ "${CI_JOB_NAME}" = "win64" ]; then
           cmake -DLIBVLC_SDK_INC:STRING=${CI_PROJECT_DIR}/include -DLIBVLC_SDK_LIB:STRING=${CI_PROJECT_DIR}/${VLCARCH}/lib/.libs -H${CI_PROJECT_DIR}/doc/libvlc -B${CI_PROJECT_DIR}/doc/libvlc/build \
                 -G Ninja -DCMAKE_C_COMPILER=${TRIPLET}-gcc -DCMAKE_CXX_COMPILER=${TRIPLET}-g++ -DCMAKE_SYSTEM_NAME=Windows


=====================================
extras/package/win32/build.sh
=====================================
@@ -25,6 +25,7 @@ OPTIONS:
    -c            Create a Prebuilt contrib package (rarely used)
    -l            Enable translations (can be slow)
    -i <n|r|u|m>  Create an Installer (n: nightly, r: release, u: unsigned release archive, m: msi only)
+   -W <wix_path> Set the path to the WIX binaries
    -s            Interactive shell (get correct environment variables for build)
    -b <url>      Enable breakpad support and send crash reports to this URL
    -d            Create PDB files during the build
@@ -40,7 +41,7 @@ EOF
 }
 
 ARCH="x86_64"
-while getopts "hra:pcli:sb:dD:xS:uwzo:" OPTION
+while getopts "hra:pcli:W:sb:dD:xS:uwzo:" OPTION
 do
      case $OPTION in
          h)
@@ -66,6 +67,9 @@ do
          i)
              INSTALLER=$OPTARG
          ;;
+         W)
+             WIXPATH=--with-wix="$OPTARG"
+         ;;
          s)
              INTERACTIVE="yes"
          ;;
@@ -405,7 +409,7 @@ if [ ! -z "$INSTALL_PATH" ]; then
     CONFIGFLAGS="$CONFIGFLAGS --with-packagedir=$INSTALL_PATH"
 fi
 
-${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$CONTRIB_PREFIX $CONFIGFLAGS
+${SCRIPT_PATH}/configure.sh --host=$TRIPLET --with-contrib=../contrib/$CONTRIB_PREFIX "$WIXPATH" $CONFIGFLAGS
 
 info "Compiling"
 make -j$JOBS


=====================================
extras/package/win32/msi.mak
=====================================
@@ -3,22 +3,19 @@ BUILT_SOURCES_distclean += \
 	extras/package/win32/msi/config.wxi
 endif
 
-WIXPATH=`wine winepath -u 'C:\\Program Files (x86)\\Windows Installer XML v3.5\\bin'`
 HEAT=$(MSIDIR)/msi-heat.py
-CANDLE=wine "$(WIXPATH)/candle.exe"
-LIGHT=wine "$(WIXPATH)/light.exe"
+CANDLE=wine "@WIXPATH@/candle.exe"
+LIGHT=wine "@WIXPATH@/light.exe"
 VLCDIR=@PACKAGE_DIR@
 MSIDIR=$(abs_srcdir)/extras/package/win32/msi
-W_MSIDIR=`wine winepath -w '$(MSIDIR)'`
+W_MSIDIR=`$(WIN32_PATH_CMD) -w '$(MSIDIR)'`
 MSIBUILDDIR=$(abs_top_builddir)/extras/package/win32/msi
-W_MSIBUILDDIR=`wine winepath -w '$(MSIBUILDDIR)'`
+W_MSIBUILDDIR=`$(WIN32_PATH_CMD) -w '$(MSIBUILDDIR)'`
 if HAVE_WIN64
 MSIOUTFILE=vlc-$(VERSION)-win64.msi
 else
 MSIOUTFILE=vlc-$(VERSION)-win32.msi
 endif
-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 $(MSIBUILDDIR)/Plugins.fragment.wxs
@@ -34,9 +31,7 @@ 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
 
 $(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 $@
+	$(AM_V_GEN)cd vlc- at VERSION@ && $(LIGHT) -sval -spdb -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -b $(W_MSIDIR) $(W_MSIBUILDDIR)/product.wixobj $(W_MSIBUILDDIR)/axvlc.wixobj $(W_MSIBUILDDIR)/extensions.wixobj $(W_MSIBUILDDIR)/*.fragment.wixobj -o ../$@
 	chmod 644 $@
 
 package-msi: $(MSIOUTFILE)


=====================================
extras/package/win32/msi/config.wxi.in
=====================================
@@ -14,10 +14,7 @@
     <?define Version = "$(var.VerMajor).$(var.VerMinor).$(var.VerPatch)" ?>
     <?define VersionLong = "$(var.Version).$(var.VerExtra)" ?>
 
-    <?define SourceDir = "vlc- at VERSION@" ?>
-    <!--<?define PluginsPath = "$(var.BinPath)\plugins" ?>
-    <?define LocalePath = "$(var.BinPath)\locale" ?>
-    <?define SdkPath = "$(var.BinPath)\sdk" ?>-->
+    <?define SourceDir = "." ?>
 
     <?define Platform= "@WINDOWS_ARCH@" ?>
 


=====================================
extras/package/win32/msi/msi-heat.py
=====================================
@@ -65,11 +65,11 @@ def outputDir(top, parent: str, dir: str, with_pdb: bool):
             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)
+                    outname = os.path.join(top.name, file.relative_to(top))
                     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('                        <File Id="{}" Name="{}" KeyPath="yes" Source="{}"/>\r\n'.format(generate_id('fil', outname), file.name, outname))
                     args.out.write('                    </Component>\r\n')
         # then sub directories
         for file in cwd.iterdir():



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/74361e27dd77f0c9aba963167ba1532972818b10...a5ea1181bc66e2f7aed3100ee94daa9ba5bff6cb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/74361e27dd77f0c9aba963167ba1532972818b10...a5ea1181bc66e2f7aed3100ee94daa9ba5bff6cb
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