0022-apple-build-add-more-options.patch 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. From 09d0077a8c0a674c2d676501040aef6cf8f24c25 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
  3. Date: Wed, 27 Nov 2019 18:08:32 +0100
  4. Subject: [PATCH 22/24] apple/build: add more options
  5. This exposes the verbose option, adds disable-debug and compiles the sources on all the cores by default.
  6. Additionally, this downloads all the contrib packages before compiling a single one of them.
  7. ---
  8. extras/package/apple/build.sh | 41 +++++++++++++++++++++++++----------
  9. 1 file changed, 30 insertions(+), 11 deletions(-)
  10. diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh
  11. index f35dcd4de0..8643f11d74 100755
  12. --- a/extras/package/apple/build.sh
  13. +++ b/extras/package/apple/build.sh
  14. @@ -89,6 +89,11 @@ VLC_USE_PREBUILT_CONTRIBS=0
  15. # User-provided URL from where to fetch contribs, empty
  16. # for the default chosen by contrib system
  17. VLC_PREBUILT_CONTRIBS_URL=${VLC_PREBUILT_CONTRIBS_URL:-""}
  18. +# The number of cores to compile on
  19. +CORE_COUNT=`sysctl -n machdep.cpu.core_count`
  20. +let VLC_USE_NUMBER_OF_CORES=$CORE_COUNT+1
  21. +# whether to disable debug mode (the default) or not
  22. +VLC_DISABLE_DEBUG=0
  23. ##########################################################
  24. # Helper functions #
  25. @@ -98,10 +103,12 @@ VLC_PREBUILT_CONTRIBS_URL=${VLC_PREBUILT_CONTRIBS_URL:-""}
  26. usage()
  27. {
  28. echo "Usage: $VLC_SCRIPT_NAME [options]"
  29. - echo " --arch=ARCH Architecture to build for"
  30. - echo " (i386|x86_64|armv7|armv7s|arm64)"
  31. - echo " --sdk=SDK Name of the SDK to build with (see 'xcodebuild -showsdks')"
  32. - echo " --help Print this help"
  33. + echo " --arch=ARCH Architecture to build for"
  34. + echo " (i386|x86_64|armv7|armv7s|arm64)"
  35. + echo " --sdk=SDK Name of the SDK to build with (see 'xcodebuild -showsdks')"
  36. + echo " --disable-debug Disable libvlc debug mode (for release)"
  37. + echo " --verbose Print verbose output and disable multi-core use"
  38. + echo " --help Print this help"
  39. echo ""
  40. echo "Advanced options:"
  41. echo " --package-contribs Create a prebuilt contrib package"
  42. @@ -362,6 +369,10 @@ do
  43. ;;
  44. --verbose)
  45. VLC_SCRIPT_VERBOSE=1
  46. + VLC_USE_NUMBER_OF_CORES=1
  47. + ;;
  48. + --disable-debug)
  49. + VLC_DISABLE_DEBUG=1
  50. ;;
  51. --arch=*)
  52. VLC_HOST_ARCH="${1#--arch=}"
  53. @@ -420,12 +431,13 @@ readonly VLC_PSEUDO_TRIPLET="${VLC_HOST_ARCH}-apple-${VLC_HOST_PLATFORM}_${VLC_D
  54. # Contrib install dir
  55. readonly VLC_CONTRIB_INSTALL_DIR="$VLC_BUILD_DIR/contrib/$VLC_PSEUDO_TRIPLET"
  56. # VLC install dir
  57. -readonly VLC_INSTALL_DIR="$VLC_BUILD_DIR/vlc-$VLC_PSEUDO_TRIPLET"
  58. +readonly VLC_INSTALL_DIR="$VLC_BUILD_DIR/vlc-${VLC_APPLE_SDK_NAME}-${VLC_HOST_ARCH}"
  59. echo "Build configuration"
  60. -echo " Platform: $VLC_HOST_PLATFORM"
  61. -echo " Architecture: $VLC_HOST_ARCH"
  62. -echo " SDK Version: $VLC_APPLE_SDK_VERSION"
  63. +echo " Platform: $VLC_HOST_PLATFORM"
  64. +echo " Architecture: $VLC_HOST_ARCH"
  65. +echo " SDK Version: $VLC_APPLE_SDK_VERSION"
  66. +echo " Number of Cores: $VLC_USE_NUMBER_OF_CORES"
  67. echo ""
  68. ##########################################################
  69. @@ -475,7 +487,7 @@ echo "Building needed tools (if missing)"
  70. cd "$VLC_SRC_DIR/extras/tools" || abort_err "Failed cd to tools dir"
  71. ./bootstrap || abort_err "Bootstrapping tools failed"
  72. -$MAKE || abort_err "Building tools failed"
  73. +$MAKE -j$VLC_USE_NUMBER_OF_CORES || abort_err "Building tools failed"
  74. echo ""
  75. @@ -533,8 +545,11 @@ else
  76. # Print list of contribs that will be built
  77. $MAKE list
  78. + # Download source packages
  79. + $MAKE fetch -j$VLC_USE_NUMBER_OF_CORES
  80. +
  81. # Build contribs
  82. - $MAKE || abort_err "Building contribs failed"
  83. + $MAKE -j$VLC_USE_NUMBER_OF_CORES || abort_err "Building contribs failed"
  84. # Make prebuilt contribs package
  85. if [ "$VLC_MAKE_PREBUILT_CONTRIBS" -gt "0" ]; then
  86. @@ -564,6 +579,10 @@ elif [ "$VLC_HOST_OS" = "tvos" ]; then
  87. VLC_CONFIG_OPTIONS+=( "${VLC_CONFIG_OPTIONS_TVOS[@]}" )
  88. fi
  89. +if [ "$VLC_DISABLE_DEBUG" -gt "0" ]; then
  90. + VLC_CONFIG_OPTIONS+=( "--disable-debug" )
  91. +fi
  92. +
  93. # Bootstrap VLC
  94. cd "$VLC_SRC_DIR" || abort_err "Failed cd to VLC source dir"
  95. ./bootstrap
  96. @@ -582,7 +601,7 @@ mkdir -p "$VLC_INSTALL_DIR"
  97. "${VLC_CONFIG_OPTIONS[@]}" \
  98. || abort_err "Configuring VLC failed"
  99. -$MAKE || abort_err "Building VLC failed"
  100. +$MAKE -j$VLC_USE_NUMBER_OF_CORES || abort_err "Building VLC failed"
  101. $MAKE install || abort_err "Installing VLC failed"
  102. --
  103. 2.21.0 (Apple Git-122.2)