[vlc-devel] [PATCH] win32: build.sh: add an interactive mode

Rémi Denis-Courmont remi at remlab.net
Wed Apr 18 18:04:31 CEST 2018


Le keskiviikkona 18. huhtikuuta 2018, 18.55.39 EEST Simon Latapie a écrit :
> Adds an option to get a shell with the right environment set to build
> VLC.
> ---
>  extras/package/win32/build.sh | 28 +++++++++++++++++++++++-----
>  1 file changed, 23 insertions(+), 5 deletions(-)
> 
> diff --git a/extras/package/win32/build.sh b/extras/package/win32/build.sh
> index fac89cabb7..a82f8df799 100755
> --- a/extras/package/win32/build.sh
> +++ b/extras/package/win32/build.sh
> @@ -25,12 +25,13 @@ OPTIONS:
>     -c            Create a Prebuilt contrib package (rarely used)
>     -l            Enable translations (can be slow)
>     -i <n|r|u>    Create an Installer (n: nightly, r: release, u: unsigned
> release archive) +   -s            Interactive shell (get correct
> environment variables for build) -b <url>      Enable breakpad support and
> send crash reports to this URL EOF
>  }
> 
>  ARCH="x86_64"
> -while getopts "hra:pcli:b:" OPTION
> +while getopts "hra:pcli:sb:" OPTION
>  do
>       case $OPTION in
>           h)
> @@ -56,6 +57,9 @@ do
>           i)
>               INSTALLER=$OPTARG
>           ;;
> +         s)
> +             INTERACTIVE="yes"
> +         ;;
>           b)
>               BREAKPAD=$OPTARG
>           ;;
> @@ -87,13 +91,30 @@ TRIPLET=$ARCH-w64-mingw32
> 
>  info "Building extra tools"
>  cd extras/tools
> +# bootstrap only if needed in interactive mode
> +if [ "$INTERACTIVE" != "yes" || ! -f ./Makefile ]; then
>  ./bootstrap
> +fi
>  make -j$JOBS
>  export PATH=$PWD/build/bin:$PATH
>  cd ../../
> 
> -info "Building contribs"
>  export USE_FFMPEG=1
> +export PKG_CONFIG_LIBDIR=$PWD/contrib/$TRIPLET/lib/pkgconfig
> +export PATH=$PWD/contrib/$TRIPLET/bin:$PATH
> +
> +if [ "$INTERACTIVE" = "yes" ]; then
> +if [ "x$SHELL" != "x" ]; then
> +eval $SHELL

This will spawn a shell to spawn a shell from within a shell interpreting the 
script, probably from a user shell...

You probably mean exec. Ditto below.

> +else
> +/bin/sh
> +fi
> +exit $?
> +fi

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list