From 4bd66c8fb3cb9b8afdc84adfedfee411cc0b3296 Mon Sep 17 00:00:00 2001 From: sbarex Date: Wed, 11 Dec 2024 10:33:29 +0100 Subject: [PATCH] Better error prevention with some video types and the FFMpeg engine. --- CHANGELOG.md | 12 +++ MediaInfo.xcodeproj/project.pbxproj | 42 +++++----- .../xcshareddata/WorkspaceSettings.xcsettings | 8 ++ .../xcshareddata/swiftpm/Package.resolved | 33 ++++++++ .../xcschemes/MediaInfo (en).xcscheme | 2 +- .../MediaInfo Finder Extension.xcscheme | 3 +- .../xcschemes/MediaInfo Helper XPC.xcscheme | 2 +- .../xcschemes/MediaInfo Settings XPC.xcscheme | 2 +- .../xcshareddata/xcschemes/MediaInfo.xcscheme | 2 +- .../xcshareddata/xcschemes/ffmpeg.xcscheme | 2 +- .../xcschemes/libarchive.xcscheme | 2 +- .../xcshareddata/xcschemes/libb2.xcscheme | 2 +- .../xcschemes/libjpeg-turbo.xcscheme | 2 +- .../xcshareddata/xcschemes/liblz4.xcscheme | 2 +- .../xcshareddata/xcschemes/liblzma.xcscheme | 2 +- .../xcshareddata/xcschemes/liblzstd.xcscheme | 2 +- .../xcshareddata/xcschemes/libpng.xcscheme | 2 +- .../xcshareddata/xcschemes/libwebp.xcscheme | 2 +- MediaInfoHelperXPC/FFMpegMediaUtils.swift | 80 ++++++++++--------- dependencies/Makefile-ffmpeg | 12 +-- dependencies/Makefile-libarchive | 14 ++-- dependencies/Makefile-libb2 | 12 +-- dependencies/Makefile-libjpeg | 8 +- dependencies/Makefile-liblz4 | 2 + dependencies/Makefile-liblzma | 14 ++-- dependencies/Makefile-libpng | 12 +-- dependencies/Makefile-libwebp | 12 +-- dependencies/Makefile-libzstd | 2 + 28 files changed, 188 insertions(+), 104 deletions(-) create mode 100644 MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/CHANGELOG.md b/CHANGELOG.md index 97bdba3..6cd61b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ Changelog ======= +### 1.7.4 (24) +New features: +- Dependencies updated: + - libarchive to 3.7.7 + - ffmpeg to 7.1 + - xz to 5.6.3 + +Bugfix: +- Updated the makefiles to support homebrew on Arm architecture. +- Better error prevention with some video types and the FFMpeg engine. + + ### 1.7.3 (23) New features: - Information about macOS Sequoia. diff --git a/MediaInfo.xcodeproj/project.pbxproj b/MediaInfo.xcodeproj/project.pbxproj index 634e714..5683593 100644 --- a/MediaInfo.xcodeproj/project.pbxproj +++ b/MediaInfo.xcodeproj/project.pbxproj @@ -2128,7 +2128,7 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1160; - LastUpgradeCheck = 1600; + LastUpgradeCheck = 1610; ORGANIZATIONNAME = sbarex; TargetAttributes = { 83203D3924F0556500F8CBC0 = { @@ -2624,6 +2624,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -2688,6 +2690,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOLS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -2748,7 +2752,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; @@ -2775,7 +2779,7 @@ "$(BUILT_PRODUCTS_DIR)/libpng/lib", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.MediaInfo; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2793,7 +2797,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; @@ -2820,7 +2824,7 @@ "$(BUILT_PRODUCTS_DIR)/libpng/lib", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.MediaInfo; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2838,7 +2842,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "MediaInfo\\ Finder\\ Extension/Assets_menu.xcassets"; DEVELOPMENT_TEAM = ""; @@ -2864,7 +2868,7 @@ "$(BUILT_PRODUCTS_DIR)/libpng/lib", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = "org.sbarex.MediaInfo.Finder-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2882,7 +2886,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "MediaInfo\\ Finder\\ Extension/Assets_menu.xcassets"; DEVELOPMENT_TEAM = ""; @@ -2908,7 +2912,7 @@ "$(BUILT_PRODUCTS_DIR)/libpng/lib", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = "org.sbarex.MediaInfo.Finder-Extension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2989,7 +2993,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; @@ -3018,7 +3022,7 @@ "$(PROJECT_DIR)", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.MediaInfoHelperXPC; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -3036,7 +3040,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; @@ -3064,7 +3068,7 @@ "$(PROJECT_DIR)", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.MediaInfoHelperXPC; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3201,7 +3205,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; @@ -3214,7 +3218,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.MediaInfoSettingsXPC; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -3230,7 +3234,7 @@ CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = YES; @@ -3243,7 +3247,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.7.3; + MARKETING_VERSION = 1.7.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.MediaInfoSettingsXPC; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3606,7 +3610,7 @@ repositoryURL = "https://github.com/weichsel/ZIPFoundation.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 0.9.9; + minimumVersion = 0.9.19; }; }; 83E6CB89265D6395002D89F0 /* XCRemoteSwiftPackageReference "Kanna" */ = { @@ -3614,7 +3618,7 @@ repositoryURL = "https://github.com/tid-kijyun/Kanna.git"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 5.2.7; + minimumVersion = 5.3.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..1d1946b --- /dev/null +++ b/MediaInfo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,33 @@ +{ + "originHash" : "bec77e9f1731de0098fc88bb204322b7ae2f89a560c6f06e7386d0aeda65e3ab", + "pins" : [ + { + "identity" : "kanna", + "kind" : "remoteSourceControl", + "location" : "https://github.com/tid-kijyun/Kanna.git", + "state" : { + "revision" : "41c3d28ea0eac07e4551b28def9de1ede702e739", + "version" : "5.3.0" + } + }, + { + "identity" : "sparkle", + "kind" : "remoteSourceControl", + "location" : "https://github.com/sparkle-project/Sparkle", + "state" : { + "branch" : "2.x", + "revision" : "73695f6913dfcfb918f6db44bf6dc47502de77a3" + } + }, + { + "identity" : "zipfoundation", + "kind" : "remoteSourceControl", + "location" : "https://github.com/weichsel/ZIPFoundation.git", + "state" : { + "revision" : "02b6abe5f6eef7e3cbd5f247c5cc24e246efcfe0", + "version" : "0.9.19" + } + } + ], + "version" : 3 +} diff --git a/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo (en).xcscheme b/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo (en).xcscheme index 8545fdc..c1b1800 100644 --- a/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo (en).xcscheme +++ b/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo (en).xcscheme @@ -1,6 +1,6 @@ diff --git a/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo Helper XPC.xcscheme b/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo Helper XPC.xcscheme index 089e1b6..3f48521 100644 --- a/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo Helper XPC.xcscheme +++ b/MediaInfo.xcodeproj/xcshareddata/xcschemes/MediaInfo Helper XPC.xcscheme @@ -1,6 +1,6 @@ !, key: String, previou } func getFFMpegChapters(context pFormatCtx: UnsafeMutablePointer!) -> [Chapter] { + guard let pFormatCtx_pointee = pFormatCtx?.pointee else { + return [] + } var chapters: [Chapter] = [] - let n_chapters = Int(pFormatCtx.pointee.nb_chapters) + let n_chapters = Int(pFormatCtx_pointee.nb_chapters) for i in 0 ..< n_chapters { - guard let ch = pFormatCtx.pointee.chapters[i]?.pointee else { + guard let ch = pFormatCtx_pointee.chapters[i]?.pointee else { continue } @@ -396,6 +399,9 @@ func getFFMpegChapters(context pFormatCtx: UnsafeMutablePointer } func getFFMpegLang(data: UnsafeMutablePointer!) -> String? { + guard let data = data else { + return nil + } let lang: String? if let t = av_dict_get(data, "language", nil, 0), let ll = ff_convert_lang_to(t.pointee.value, AV_LANG_ISO639_1) { let l = String(cString: ll) @@ -436,7 +442,7 @@ func getFFMpegVideoInfo(forFile file: URL) -> VideoInfo? { os_log("Fetch info for video %{private}@ with FFMpeg…", log: OSLog.infoExtraction, type: .debug, file.path) var pFormatCtx: UnsafeMutablePointer! = initFFMpeg(forFile: file) - guard pFormatCtx != nil else { + guard let pFormatCtx_pointee = pFormatCtx?.pointee else { os_log("Unable to open the video %{private}@ with FFMpeg!", log: OSLog.infoExtraction, type: .error, file.path) return nil } @@ -454,23 +460,23 @@ func getFFMpegVideoInfo(forFile file: URL) -> VideoInfo? { } let name: String? // A comma separated list of short names for the format. - if let s = pFormatCtx.pointee.iformat.pointee.name { + if let s = pFormatCtx_pointee.iformat?.pointee.name { name = String(cString: s) } else { name = nil } let long_name: String? // Descriptive name for the format, meant to be more human-readable than name. - if let s = pFormatCtx.pointee.iformat.pointee.long_name { + if let s = pFormatCtx.pointee.iformat?.pointee.long_name { long_name = String(cString: s) } else { long_name = nil } - let title: String? = av_dict_get(data: pFormatCtx.pointee.metadata, key: "title", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) - let encoder: String? = av_dict_get(data: pFormatCtx.pointee.metadata, key: "encoder", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) + let title: String? = av_dict_get(data: pFormatCtx_pointee.metadata, key: "title", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) + let encoder: String? = av_dict_get(data: pFormatCtx_pointee.metadata, key: "encoder", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) - let lang = getFFMpegLang(data: pFormatCtx.pointee.metadata) + let lang = getFFMpegLang(data: pFormatCtx_pointee.metadata) var t: UnsafeMutablePointer? repeat { @@ -480,14 +486,14 @@ func getFFMpegVideoInfo(forFile file: URL) -> VideoInfo? { * encoder: "libebml v1.4.1 + libmatroska v1.6.2" * creation_time: "2021-03-05T18:17:38.000000Z" */ - t = av_dict_get(pFormatCtx.pointee.metadata, "", t, AV_DICT_IGNORE_SUFFIX) + t = av_dict_get(pFormatCtx_pointee.metadata, "", t, AV_DICT_IGNORE_SUFFIX) if let tt = t?.pointee, let key = String(cString: tt.key), let value = String(cString: tt.value) { print("\(key): \(value)") } } while t != nil - let duration: Double? = getFFMpegTime(t: pFormatCtx.pointee.duration) - let start_time: Double? = getFFMpegTime(t: pFormatCtx.pointee.start_time) + let duration: Double? = getFFMpegTime(t: pFormatCtx_pointee.duration) + let start_time: Double? = getFFMpegTime(t: pFormatCtx_pointee.start_time) let chapters = getFFMpegChapters(context: pFormatCtx) @@ -517,7 +523,7 @@ func getFFMpegAudioInfo(forFile file: URL) -> AudioInfo? { os_log("Fetch info for audio %{private}@ with FFMpeg…", log: OSLog.infoExtraction, type: .debug, file.path) var pFormatCtx: UnsafeMutablePointer! = initFFMpeg(forFile: file) - guard pFormatCtx != nil else { + guard let pFormatCtx_pointee = pFormatCtx?.pointee else { os_log("Unable to open the audio %{private}@ with FFMpeg!", log: OSLog.infoExtraction, type: .error, file.path) return nil } @@ -535,26 +541,26 @@ func getFFMpegAudioInfo(forFile file: URL) -> AudioInfo? { } let name: String? // A comma separated list of short names for the format. - if let s = pFormatCtx.pointee.iformat.pointee.name { + if let s = pFormatCtx_pointee.iformat?.pointee.name { name = String(cString: s) } else { name = nil } let long_name: String? // Descriptive name for the format, meant to be more human-readable than name. - if let s = pFormatCtx.pointee.iformat.pointee.long_name { + if let s = pFormatCtx_pointee.iformat?.pointee.long_name { long_name = String(cString: s) } else { long_name = nil } - let title: String? = av_dict_get(data: pFormatCtx.pointee.metadata, key: "title", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) - let encoder: String? = av_dict_get(data: pFormatCtx.pointee.metadata, key: "encoder", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) + let title: String? = av_dict_get(data: pFormatCtx_pointee.metadata, key: "title", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) + let encoder: String? = av_dict_get(data: pFormatCtx_pointee.metadata, key: "encoder", previous: nil, flags: AV_DICT_IGNORE_SUFFIX) - let lang = getFFMpegLang(data: pFormatCtx.pointee.metadata) + let lang = getFFMpegLang(data: pFormatCtx_pointee.metadata) - let duration: Double? = getFFMpegTime(t: pFormatCtx.pointee.duration) - let start_time: Double? = getFFMpegTime(t: pFormatCtx.pointee.start_time) + let duration: Double? = getFFMpegTime(t: pFormatCtx_pointee.duration) + let start_time: Double? = getFFMpegTime(t: pFormatCtx_pointee.start_time) let chapters = getFFMpegChapters(context: pFormatCtx) @@ -593,16 +599,16 @@ func getFFMpegMediaStreams(forFile file: URL) -> [BaseInfo] { func getFFMpegMediaStreams(forFile file: URL, with pFormatCtx: inout UnsafeMutablePointer!) -> [BaseInfo] { - guard pFormatCtx != nil else { + guard let pFormatCtx_pointee = pFormatCtx?.pointee else { return [] } - let mainDuration: Int64 = getFFMpegTime(t: pFormatCtx.pointee.duration) + let mainDuration: Int64 = getFFMpegTime(t: pFormatCtx_pointee.duration) var streams: [BaseInfo] = [] - for i in 0 ..< Int(pFormatCtx.pointee.nb_streams) { - guard let st = pFormatCtx.pointee.streams[i]?.pointee else { + for i in 0 ..< Int(pFormatCtx_pointee.nb_streams) { + guard let st = pFormatCtx_pointee.streams[i]?.pointee else { continue } let codec: UnsafePointer? @@ -675,7 +681,7 @@ func getFFMpegMediaStreams(forFile file: URL, with pFormatCtx: inout UnsafeMutab if let t = av_dict_get(st.metadata, "BPS", nil, AV_DICT_IGNORE_SUFFIX), let n = Int64(String(cString: t.pointee.value)) { bit_rate = n } else { - bit_rate = pFormatCtx.pointee.bit_rate + bit_rate = pFormatCtx_pointee.bit_rate } */ @@ -728,19 +734,21 @@ func getFFMpegMediaStreams(forFile file: URL, with pFormatCtx: inout UnsafeMutab var frames = st.nb_frames if frames == 0 { var found = false - for i in 0 ..< Int(st.metadata.pointee.count) { - let tag = st.metadata.pointee.elems.advanced(by: i).pointee - switch String(cString: tag.key)?.uppercased() { - case "NUMBER_OF_FRAMES": - if let v = Int64(String(cString: tag.value)) { - frames = v + if let metadata = st.metadata { + for i in 0 ..< Int(metadata.pointee.count) { + let tag = st.metadata.pointee.elems.advanced(by: i).pointee + switch String(cString: tag.key)?.uppercased() { + case "NUMBER_OF_FRAMES": + if let v = Int64(String(cString: tag.value)) { + frames = v + } + found = true + default: + break + } + if found { + break } - found = true - default: - break - } - if found { - break } } if !found && fps != 0 { diff --git a/dependencies/Makefile-ffmpeg b/dependencies/Makefile-ffmpeg index 7277aaf..d6710b2 100644 --- a/dependencies/Makefile-ffmpeg +++ b/dependencies/Makefile-ffmpeg @@ -1,6 +1,6 @@ .DEFAULT_GOAL:=all -FFMPEG_VERSION := n7.0.2 +FFMPEG_VERSION := n7.1 # Output all commands. ifeq ($(VERBOSE),1) @@ -47,7 +47,7 @@ FLAGS = FLAGS_x86_64 = FLAGS_arm64 = -ifeq (, $(shell PATH="/usr/local/bin:${PATH}" which yasm)) +ifeq (, $(shell PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" which yasm)) @echo "${bold}*** WARNING: missing yasm in PATH{normal} ($(PATH))" @echo "${bold}try install yasm with homebrew${normal}) FLAGS += --disable-x86asm @@ -149,6 +149,8 @@ ${BUILD_DIR}/ffmpeg/x86_64/Makefile : ARCH := x86_64 git : ${SOURCE_ROOT}/ffmpeg/configure # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/ffmpeg" describe --tags | xargs),$(FFMPEG_VERSION)) + git -C "${SOURCE_ROOT}/ffmpeg" checkout master + git -C "${SOURCE_ROOT}/ffmpeg" pull @echo "${bold}Checkout git to tag ${FFMPEG_VERSION}${normal}" git -C "${SOURCE_ROOT}/ffmpeg" checkout "${FFMPEG_VERSION}" --force else @@ -160,18 +162,18 @@ $(makefiles) : @echo "" @echo "${bold}ffmpeg ${FFMPEG_VERSION} configuration for ${ARCH} platform…${normal}" @mkdir -p "${FFMPEG_INSTALL_DIR}" - @cd "${FFMPEG_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/clang -target ${ARCH}-apple-macos" PATH="/usr/local/bin:${PATH}" LIBPNG_CONFIG=${BUILD_DIR}/libpng ${SOURCE_ROOT}/ffmpeg/configure --prefix="${FFMPEG_INSTALL_DIR}" --disable-stripping --enable-gpl --enable-nonfree --enable-version3 --disable-pthreads --disable-indevs --disable-outdevs --disable-network --disable-avdevice --disable-muxers --disable-encoders --disable-bsfs --disable-filters --disable-protocols --enable-muxer=image2 --enable-encoder=png --enable-protocol=file --disable-programs --disable-ffprobe --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages $(LIB_FLAGS) --arch=$(ARCH) --extra-cflags='-fno-stack-check' --pkg-config-flags=--static --enable-runtime-cpudetect + @cd "${FFMPEG_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/clang -target ${ARCH}-apple-macos" PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" LIBPNG_CONFIG=${BUILD_DIR}/libpng ${SOURCE_ROOT}/ffmpeg/configure --prefix="${FFMPEG_INSTALL_DIR}" --disable-stripping --enable-gpl --enable-nonfree --enable-version3 --disable-pthreads --disable-indevs --disable-outdevs --disable-network --disable-avdevice --disable-muxers --disable-encoders --disable-bsfs --disable-filters --disable-protocols --enable-muxer=image2 --enable-encoder=png --enable-protocol=file --disable-programs --disable-ffprobe --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages $(LIB_FLAGS) --arch=$(ARCH) --extra-cflags='-fno-stack-check' --pkg-config-flags=--static --enable-runtime-cpudetect ${MAKE} -C "${FFMPEG_INSTALL_DIR}" -j${N_CPU} clean # Build the library for a CPU architecture. $(ffmpeg_files) : @echo "" @echo "${bold}Compiling ffmpeg ${FFMPEG_VERSION} for ${ARCH} platform…${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${FFMPEG_INSTALL_DIR}" -j${N_CPU} + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${FFMPEG_INSTALL_DIR}" -j${N_CPU} @echo "" @echo "${bold}Installing ffmpeg ${FFMPEG_VERSION} for ${ARCH} platform on ${FFMPEG_INSTALL_DIR} …${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${FFMPEG_INSTALL_DIR}" -j${N_CPU} install + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${FFMPEG_INSTALL_DIR}" -j${N_CPU} install # Build the libraries. diff --git a/dependencies/Makefile-libarchive b/dependencies/Makefile-libarchive index 95f615c..0906235 100644 --- a/dependencies/Makefile-libarchive +++ b/dependencies/Makefile-libarchive @@ -1,6 +1,6 @@ .DEFAULT_GOAL:=all -ARCHIVE_VERSION = v3.7.6 +ARCHIVE_VERSION = v3.7.7 # Output all commands. ifeq ($(VERBOSE),1) @@ -122,6 +122,8 @@ clean: git : ${SOURCE_ROOT}/libarchive/configure.ac # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/libarchive" describe --tags | xargs), $(ARCHIVE_VERSION)) + git -C "${SOURCE_ROOT}/libarchive" checkout master + git -C "${SOURCE_ROOT}/libarchive" pull @echo "Checkout git to tag ${ARCHIVE_VERSION}" git -C "${SOURCE_ROOT}/libarchive" checkout "${ARCHIVE_VERSION}" --force else @@ -143,10 +145,10 @@ ${SOURCE_ROOT}/libarchive/configure.ac : ${SOURCE_ROOT}/libarchive/configure : @echo "" @echo "${bold}Autogen configuration files…${normal}" - cd "${SOURCE_ROOT}/libarchive" && PATH="/usr/local/bin:${PATH}" sh ./build/autogen.sh + cd "${SOURCE_ROOT}/libarchive" && PATH="/opt/homebrew/bin:usr/local/bin:${PATH}" sh ./build/autogen.sh autogen: -ifeq (, $(shell PATH="/usr/local/bin:${PATH}" which autoreconf)) +ifeq (, $(shell PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" which autoreconf)) $(error ${bold}No autoreconf in PATH${normal} ($(PATH)), ${bold}try install autogen tools with homebrew${normal}) endif @@ -176,17 +178,17 @@ $(makefiles) : @echo "" @echo "${bold}libarchive ${ARCHIVE_VERSION} configuration for ${ARCH} platform…${normal}" @mkdir -p "${LIBARCHIVE_INSTALL_DIR}" - @cd "${LIBARCHIVE_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" ${SOURCE_ROOT}/libarchive/configure --host=${HOST} --prefix="${LIBARCHIVE_INSTALL_DIR}" --enable-shared=no --enable-static=yes --disable-bsdtar + @cd "${LIBARCHIVE_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${SOURCE_ROOT}/libarchive/configure --host=${HOST} --prefix="${LIBARCHIVE_INSTALL_DIR}" --enable-shared=no --enable-static=yes --disable-bsdtar # Build the library for a CPU architecture. $(libarchive_files) : @echo "" @echo "${bold}Compiling libarchive ${ARCHIVE_VERSION} for ${ARCH} platform…${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${LIBARCHIVE_INSTALL_DIR}" -j${N_CPU} + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${LIBARCHIVE_INSTALL_DIR}" -j${N_CPU} @echo "" @echo "${bold}Installing libarchive ${ARCHIVE_VERSION} for ${ARCH} platform on ${LIBARCHIVE_INSTALL_DIR} …${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${LIBARCHIVE_INSTALL_DIR}" -j${N_CPU} install + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${LIBARCHIVE_INSTALL_DIR}" -j${N_CPU} install # Build the library. ${BUILD_DIR}/libarchive/libarchive.a : ${libarchive_files} diff --git a/dependencies/Makefile-libb2 b/dependencies/Makefile-libb2 index 6990295..9c255e1 100644 --- a/dependencies/Makefile-libb2 +++ b/dependencies/Makefile-libb2 @@ -99,6 +99,8 @@ clean: git : ${SOURCE_ROOT}/zstd/Makefile # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/libb2" describe --tags | xargs), ${B2_VERSION}) + git -C "${SOURCE_ROOT}/libb2" checkout master + git -C "${SOURCE_ROOT}/libb2" pull @echo "${bold}Checkout git to tag ${B2_VERSION}${normal}" git -C "${SOURCE_ROOT}/libb2" checkout "${B2_VERSION}" --force else @@ -118,10 +120,10 @@ ${SOURCE_ROOT}/libb2/configure.ac : ${SOURCE_ROOT}/libb2/configure : @echo "" @echo "${bold}Autogen configuration files…${normal}" - cd "${SOURCE_ROOT}/libb2" && PATH="/usr/local/bin:${PATH}" sh ./autogen.sh + cd "${SOURCE_ROOT}/libb2" && PATH="/opt/homebrew/bin:usr/local/bin:${PATH}" sh ./autogen.sh autogen: -ifeq (, $(shell PATH="/usr/local/bin:${PATH}" which autoreconf)) +ifeq (, $(shell PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" which autoreconf)) $(error ${bold}No autoreconf in PATH${normal} ($(PATH)), ${bold}try install autogen tools with homebrew${normal}) endif @@ -150,18 +152,18 @@ $(makefiles) : @echo "" @echo "${bold}libb2 ${B2_VERSION} configuration for ${ARCH} platform…${normal}" @mkdir -p "${B2_INSTALL_DIR}" - @cd "${B2_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" ${SOURCE_ROOT}/libb2/configure --host=${HOST} --prefix="${B2_INSTALL_DIR}" --enable-shared=no --enable-static=yes + @cd "${B2_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${SOURCE_ROOT}/libb2/configure --host=${HOST} --prefix="${B2_INSTALL_DIR}" --enable-shared=no --enable-static=yes ${MAKE} -C "${B2_INSTALL_DIR}" -j${N_CPU} clean # Build the library for a CPU architecture. $(libb2_files) : $(makefiles) @echo "" @echo "${bold}Compiling libb2 ${B2_VERSION} for ${ARCH} platform…${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${B2_INSTALL_DIR}" -j${N_CPU} + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${B2_INSTALL_DIR}" -j${N_CPU} @echo "" @echo "${bold}Installing libb2 ${B2_VERSION} for ${ARCH} platform on ${B2_INSTALL_DIR} …${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${B2_INSTALL_DIR}" -j${N_CPU} install + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${B2_INSTALL_DIR}" -j${N_CPU} install # Build the library. ${BUILD_DIR}/libb2/libb2.a : ${libb2_files} diff --git a/dependencies/Makefile-libjpeg b/dependencies/Makefile-libjpeg index 85df2c4..db16a1a 100644 --- a/dependencies/Makefile-libjpeg +++ b/dependencies/Makefile-libjpeg @@ -90,6 +90,8 @@ clean: git : ${SOURCE_ROOT}/libjpeg-turbo/CMakeLists.txt # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/libjpeg-turbo" describe --tags | xargs), $(JPG_VERSION)) + git -C "${SOURCE_ROOT}/libjpeg-turbo" checkout master + git -C "${SOURCE_ROOT}/libjpeg-turbo" pull @echo "${bold}Checkout git to tag ${JPG_VERSION}${normal}" git -C "${SOURCE_ROOT}/libjpeg-turbo" checkout "${JPG_VERSION}" --force else @@ -134,18 +136,18 @@ $(makefiles) &: @echo "set(CMAKE_OSX_DEPLOYMENT_TARGET $(MIN_OS))" >> "${BUILD_DIR}/libjpeg-turbo/${ARCH}/toolchain.cmake" @echo "set(CMAKE_OSX_SYSROOT $(SDK_PATH))" >> "${BUILD_DIR}/libjpeg-turbo/${ARCH}/toolchain.cmake" - @cd "${BUILD_DIR}/libjpeg-turbo/${ARCH}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/clang -target ${ARCH}-apple-macos" cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake --install-prefix "${BUILD_DIR}/libjpeg-turbo/${ARCH}" ${SOURCE_ROOT}/libjpeg-turbo + @cd "${BUILD_DIR}/libjpeg-turbo/${ARCH}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/clang -target ${ARCH}-apple-macos" PATH="/opt/homebrew/bin:usr/local/bin:${PATH}" cmake -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake --install-prefix "${BUILD_DIR}/libjpeg-turbo/${ARCH}" ${SOURCE_ROOT}/libjpeg-turbo ${MAKE} -C "${BUILD_DIR}/libjpeg-turbo/${ARCH}" -j${N_CPU} clean # Build the library for a CPU architecture. $(libjpeg_files) : @echo "" @echo "${bold}Compiling libjpeg-turbo ${JPG_VERSION} for ${ARCH} platform…${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libjpeg-turbo/${ARCH}" -j${N_CPU} + PATH="/opt/homebrew/bin:usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libjpeg-turbo/${ARCH}" -j${N_CPU} @echo "" @echo "${bold}Installing libjpeg-turbo ${JPG_VERSION} for ${ARCH} platform on ${BUILD_DIR}/libjpeg-turbo/${ARCH} …${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libjpeg-turbo/${ARCH}" -j${N_CPU} install + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libjpeg-turbo/${ARCH}" -j${N_CPU} install # Build the library. ${BUILD_DIR}/libjpeg-turbo/lib/libjpeg.a : ${libjpeg_files} diff --git a/dependencies/Makefile-liblz4 b/dependencies/Makefile-liblz4 index fac598d..386c318 100644 --- a/dependencies/Makefile-liblz4 +++ b/dependencies/Makefile-liblz4 @@ -87,6 +87,8 @@ liblz4: git ${BUILD_DIR}/liblz4/liblz4.a # Checkout the repository tag. git : ${SOURCE_ROOT}/lz4/Makefile ifneq ($(shell git -C "${SOURCE_ROOT}/lz4" describe --tags | xargs), ${LZ4_VERSION}) + git -C "${SOURCE_ROOT}/lz4" checkout master + git -C "${SOURCE_ROOT}/lz4" pull @echo "${bold}Checkout git to tag ${LZ4_VERSION}${normal}" @git -C "${SOURCE_ROOT}/lz4" checkout "${LZ4_VERSION}" --force else diff --git a/dependencies/Makefile-liblzma b/dependencies/Makefile-liblzma index e958291..1be48ad 100644 --- a/dependencies/Makefile-liblzma +++ b/dependencies/Makefile-liblzma @@ -1,6 +1,6 @@ .DEFAULT_GOAL:=all -XZ_VERSION = v5.6.2 +XZ_VERSION = v5.6.3 # Output all commands. ifeq ($(VERBOSE),1) @@ -93,6 +93,8 @@ liblzma: git $(makefiles) ${BUILD_DIR}/liblzma/lib/liblzma.a git : ${SOURCE_ROOT}/xz/configure.ac ${SOURCE_ROOT}/xz/configure # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/xz" describe --tags | xargs), $(XZ_VERSION)) + git -C "${SOURCE_ROOT}/xz" checkout master + git -C "${SOURCE_ROOT}/xz" pull @echo "${bold}Checkout git to tag ${XZ_VERSION}${normal}" git -C "${SOURCE_ROOT}/xz" checkout "${XZ_VERSION}" --force else @@ -110,10 +112,10 @@ ${SOURCE_ROOT}/xz/configure.ac : ${SOURCE_ROOT}/xz/configure : @echo "" @echo "${bold}Autogen configuration files…${normal}" - cd "${SOURCE_ROOT}/xz" && PATH="/usr/local/bin:${PATH}" sh ./autogen.sh --no-po4a --no-doxygen + cd "${SOURCE_ROOT}/xz" && PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" sh ./autogen.sh --no-po4a --no-doxygen autogen: -ifeq (, $(shell PATH="/usr/local/bin:${PATH}" which autoreconf)) +ifeq (, $(shell PATH="/opt/homebrew/bin:usr/local/bin:${PATH}" which autoreconf)) $(error ${bold}No autoreconf in PATH${normal} ($(PATH)), ${bold}try install autogen tools with homebrew${normal}) endif @@ -138,18 +140,18 @@ $(makefiles) &: @echo "" @echo "${bold}liblzma ${XZ_VERSION} configuration for ${ARCH} platform…${normal}" @mkdir -p "${BUILD_DIR}/liblzma/${ARCH}" - @cd "${BUILD_DIR}/liblzma/${ARCH}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" ${SOURCE_ROOT}/xz/configure --host=${HOST} --prefix="${BUILD_DIR}/liblzma/${ARCH}" --enable-shared=no --enable-static=yes + @cd "${BUILD_DIR}/liblzma/${ARCH}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${SOURCE_ROOT}/xz/configure --host=${HOST} --prefix="${BUILD_DIR}/liblzma/${ARCH}" --enable-shared=no --enable-static=yes ${MAKE} -C "${BUILD_DIR}/liblzma/${ARCH}" -j${N_CPU} clean # Build the library for a CPU architecture. $(liblzma_files) : @echo "" @echo "${bold}Compiling liblzma ${XZ_VERSION} for ${ARCH} platform…${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/liblzma/${ARCH}" -j${N_CPU} + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/liblzma/${ARCH}" -j${N_CPU} @echo "" @echo "${bold}Installing liblzma ${XZ_VERSION} for ${ARCH} platform on ${BUILD_DIR}/liblzma/${ARCH} …${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/liblzma/${ARCH}" -j${N_CPU} install + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/liblzma/${ARCH}" -j${N_CPU} install # Build the library. ${BUILD_DIR}/liblzma/lib/liblzma.a : ${liblzma_files} diff --git a/dependencies/Makefile-libpng b/dependencies/Makefile-libpng index 7c8ffc2..ce5b973 100644 --- a/dependencies/Makefile-libpng +++ b/dependencies/Makefile-libpng @@ -91,6 +91,8 @@ clean: git : ${SOURCE_ROOT}/libpng/configure.ac # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/libpng" describe --tags | xargs), $(PNG_VERSION)) + git -C "${SOURCE_ROOT}/libpng" checkout master + git -C "${SOURCE_ROOT}/libpng" pull @echo "${bold}Checkout git to tag ${PNG_VERSION}${normal}" git -C "${SOURCE_ROOT}/libpng" checkout "${PNG_VERSION}" --force else @@ -110,10 +112,10 @@ ${SOURCE_ROOT}/libpng/configure.ac : ${SOURCE_ROOT}/libpng/configure : @echo "" @echo "${bold}Autogen configuration files…${normal}" - cd "${SOURCE_ROOT}/libpng" && PATH="/usr/local/bin:${PATH}" sh ./autogen.sh + cd "${SOURCE_ROOT}/libpng" && PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" sh ./autogen.sh autogen: -ifeq (, $(shell PATH="/usr/local/bin:${PATH}" which autoreconf)) +ifeq (, $(shell PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" which autoreconf)) $(error ${bold}No autoreconf in PATH${normal} ($(PATH)), ${bold}try install autogen tools with homebrew${normal}) endif @@ -138,18 +140,18 @@ $(makefiles) &: @echo "" @echo "${bold}libpng ${PNG_VERSION} configuration for ${ARCH} platform…${normal}" @mkdir -p "${BUILD_DIR}/libpng/${ARCH}" - @cd "${BUILD_DIR}/libpng/${ARCH}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" ${SOURCE_ROOT}/libpng/configure --host=${HOST} --prefix="${BUILD_DIR}/libpng/${ARCH}" --enable-shared=no --enable-static=yes + @cd "${BUILD_DIR}/libpng/${ARCH}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${SOURCE_ROOT}/libpng/configure --host=${HOST} --prefix="${BUILD_DIR}/libpng/${ARCH}" --enable-shared=no --enable-static=yes ${MAKE} -C "${BUILD_DIR}/libpng/${ARCH}" -j${N_CPU} clean # Build the library for a CPU architecture. $(libpng_files) : @echo "" @echo "${bold}Compiling libpng ${PNG_VERSION} for ${ARCH} platform…${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libpng/${ARCH}" -j${N_CPU} + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libpng/${ARCH}" -j${N_CPU} @echo "" @echo "${bold}Installing libpng ${PNG_VERSION} for ${ARCH} platform on ${BUILD_DIR}/libpng/${ARCH} …${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libpng/${ARCH}" -j${N_CPU} install + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${BUILD_DIR}/libpng/${ARCH}" -j${N_CPU} install # Build the library. ${BUILD_DIR}/libpng/lib/libpng.a : ${makefiles} ${libpng_files} diff --git a/dependencies/Makefile-libwebp b/dependencies/Makefile-libwebp index 876e209..9b5caa9 100644 --- a/dependencies/Makefile-libwebp +++ b/dependencies/Makefile-libwebp @@ -112,6 +112,8 @@ source-libwebp : autogen git ${SOURCE_ROOT}/libwebp/configure git : ${SOURCE_ROOT}/libwebp/configure.ac # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/libwebp" describe --tags | xargs), $(WEBP_VERSION)) + git -C "${SOURCE_ROOT}/libwebp" checkout master + git -C "${SOURCE_ROOT}/libwebp" pull @echo "Checkout git to tag ${WEBP_VERSION}" git -C "${SOURCE_ROOT}/libwebp" checkout "${WEBP_VERSION}" --force else @@ -126,10 +128,10 @@ ${SOURCE_ROOT}/libwebp/configure.ac : ${SOURCE_ROOT}/libwebp/configure : @echo "" @echo "${bold}Autogen configuration files…${normal}" - cd "${SOURCE_ROOT}/libwebp" && PATH="/usr/local/bin:${PATH}" sh ./autogen.sh + cd "${SOURCE_ROOT}/libwebp" && PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" sh ./autogen.sh autogen: -ifeq (, $(shell PATH="/usr/local/bin:${PATH}" which autoreconf)) +ifeq (, $(shell PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" which autoreconf)) $(error ${bold}No autoreconf in PATH${normal} ($(PATH)), ${bold}try install autogen tools with homebrew${normal}) endif @@ -158,17 +160,17 @@ $(makefiles) : @echo "" @echo "${bold}libwebp ${WEBP_VERSION} configuration for ${ARCH} platform…${normal}" @mkdir -p "${LIBWEBP_INSTALL_DIR}" - @cd "${LIBWEBP_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" LIBPNG_CONFIG=${BUILD_DIR}/libpng/libpng-config ${SOURCE_ROOT}/libwebp/configure --host=${HOST} --prefix="${LIBWEBP_INSTALL_DIR}" --enable-shared=yes --enable-static=yes --with-pngincludedir=${BUILD_DIR}/libpng/include --with-pnglibdir=${BUILD_DIR}/libpng/lib + @cd "${LIBWEBP_INSTALL_DIR}" && CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="/usr/bin/cc -target ${ARCH}-apple-macos" LIBPNG_CONFIG=${BUILD_DIR}/libpng/libpng-config PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${SOURCE_ROOT}/libwebp/configure --host=${HOST} --prefix="${LIBWEBP_INSTALL_DIR}" --enable-shared=yes --enable-static=yes --with-pngincludedir=${BUILD_DIR}/libpng/include --with-pnglibdir=${BUILD_DIR}/libpng/lib # Build the library for a CPU architecture. $(libwebp_files) : @echo "" @echo "${bold}Compiling libwebp ${WEBP_VERSION} for ${ARCH} platform…${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${LIBWEBP_INSTALL_DIR}" -j${N_CPU} + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${LIBWEBP_INSTALL_DIR}" -j${N_CPU} @echo "" @echo "${bold}Installing libwebp ${WEBP_VERSION} for ${ARCH} platform on ${LIBWEBP_INSTALL_DIR} …${normal}" - PATH="/usr/local/bin:${PATH}" ${MAKE} -C "${LIBWEBP_INSTALL_DIR}" -j${N_CPU} install + PATH="/opt/homebrew/bin:/usr/local/bin:${PATH}" ${MAKE} -C "${LIBWEBP_INSTALL_DIR}" -j${N_CPU} install # Build the library. ${BUILD_DIR}/libwebp/libwebp.a : $(makefiles) ${libwebp_files} diff --git a/dependencies/Makefile-libzstd b/dependencies/Makefile-libzstd index 88fa004..3f5173e 100644 --- a/dependencies/Makefile-libzstd +++ b/dependencies/Makefile-libzstd @@ -99,6 +99,8 @@ libzstd: git ${BUILD_DIR}/libzstd/libzstd.a git : ${SOURCE_ROOT}/zstd/Makefile # @echo "check tag…" ifneq ($(shell git -C "${SOURCE_ROOT}/zstd" describe --tags | xargs), ${ZSTD_VERSION}) + git -C "${SOURCE_ROOT}/zstd" checkout master + git -C "${SOURCE_ROOT}/zstd" pull @echo "${bold}Checkout git to tag ${ZSTD_VERSION}${normal}" git -C "${SOURCE_ROOT}/zstd" checkout "${ZSTD_VERSION}" --force else