Skip to content

Commit

Permalink
Merge branch 'MythTV:master' into hambre/play-audio-cd-from-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
hambre authored Mar 23, 2024
2 parents f10251a + 01a4f04 commit 6b0142b
Show file tree
Hide file tree
Showing 422 changed files with 4,469 additions and 5,441 deletions.
490 changes: 490 additions & 0 deletions .github/workflows/build-mythtv.yml

Large diffs are not rendered by default.

185 changes: 0 additions & 185 deletions .github/workflows/buildmaster.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/cleanup-pr-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---

#
# Cleanup caches after PR closed
#
# Caches are scoped, and after a PR
# is closed, any caches associated
# with that branch are no longer
# useful. Delete them.
#
# Code copied from: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
#

name: Cleanup caches after PR closed

on: # yamllint disable-line rule:truthy
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
50 changes: 39 additions & 11 deletions cmake/SourceVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@ function(source_version_from_file filename version branch)
return()
endif()

# Unset variables in case they aren't included in the file.
unset(${version} PARENT_SCOPE)
unset(${branch} PARENT_SCOPE)

list(APPEND CMAKE_MESSAGE_INDENT " ")

# slurp the file
message(DEBUG "Git version file ${filename}")
file(STRINGS ${filename} lines REGEX "SOURCE_VERSION|BRANCH")
foreach(line IN LISTS lines)
message(DEBUG " line: ${line}")
if(line MATCHES "^ *SOURCE_VERSION *= *\" *([^ ]+) *\" *$")
if(line MATCHES "Format:")
continue()
elseif(line MATCHES "^ *SOURCE_VERSION *= *\" *([^ ]+) *\" *$")
set(${version}
"${CMAKE_MATCH_1}"
PARENT_SCOPE)
Expand Down Expand Up @@ -112,12 +118,34 @@ function(mythtv_find_source_version version version_major branch)
OUTPUT_VARIABLE versionString
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)

if(NOT versionString)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe
OUTPUT_VARIABLE versionString
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
endif()

# Branch
execute_process(
COMMAND ${GIT_EXECUTABLE} branch --show-current
OUTPUT_VARIABLE branchName
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)

# While this command appears to work for all cases, it does depend on the
# specific git output format, so use it only if the simplier command does
# not.
if(NOT branchName)
execute_process(
COMMAND ${GIT_EXECUTABLE} branch --no-color --omit-empty --sort=refname
--contains HEAD --merged HEAD
OUTPUT_VARIABLE branchNames
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
string(REGEX MATCHALL "[^\n\r]+" branchNamesList ${branchNames})
list(GET branchNamesList 0 branchName)
string(REGEX REPLACE "^[\\*\\+] " "" branchName ${branchName})
string(STRIP ${branchName} branchName)
endif()

if(versionString)
message(STATUS " version:${versionString} branch:${branchName}")
endif()
Expand All @@ -131,25 +159,27 @@ function(mythtv_find_source_version version version_major branch)
source_version_from_file(${filename} versionString branchName)

# Fix up version
if(NOT versionString MATCHES "^v[0-9]")
if(versionString AND NOT versionString MATCHES "^v[0-9]")
set(filename "${mythtv_source_dir}/SRC_VERSION")
if(EXISTS ${filename})
message(STATUS "Checking for version info in ${filename}")
source_version_from_file(${filename} prefix dummy)
set(versionString "${prefix}-${versionString}")
endif()
endif()

clean_branch_information(branchName)
message(STATUS " version:${versionString} branch:${branchName}")
if(versionString)
message(STATUS " version:${versionString} branch:${branchName}")
endif()
endif()

# Sill haven't found a vesion string. Check for a SRC_VERSION file.
if(NOT versionString)
set(filename "${mythtv_source_dir}/SRC_VERSION")
message(STATUS "Checking for version info in ${filename}")
if(EXISTS ${filename})
source_version_from_file(${filename} versionString dummy)
unset(branchName)
source_version_from_file(${filename} versionString branchName)
message(STATUS " version:${versionString}")
endif()
endif()
Expand All @@ -160,12 +190,10 @@ function(mythtv_find_source_version version version_major branch)
set(versionMajorString ${CMAKE_MATCH_1})
else()
message(WARNING "Invalid source version ${versionString}, must start "
"with v and a number, will use SRC_VERSION file instead")
set(filename "${mythtv_source_dir}/SRC_VERSION")
message(STATUS "Checking for version info in ${filename}")
source_version_from_file(${filename} versionString dummy)
unset(branchName)
message(STATUS " version:${versionString}")
"with v and a number. Setting it to unknown.")
set(versionString "Unknown")
set(versionMajorString "0")
set(branchName "Unknown")
endif()

# Pass data back to caller
Expand Down
4 changes: 2 additions & 2 deletions cmake/VersionInformation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ set(MYTHTV_VERSION_MAJMIN ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
# Qt Minimum Versions
#
include(VersionToNumber)
set(QT5_MIN_VERSION_STR "5.12")
set(QT6_MIN_VERSION_STR "6.0")
set(QT5_MIN_VERSION_STR "5.15.2")
set(QT6_MIN_VERSION_STR "6.4.0")
version_to_number(QT_MIN_VERSION ${QT${QT_VERSION_MAJOR}_MIN_VERSION_STR} FALSE)
version_to_number(QT_MIN_VERSION_HEX ${QT${QT_VERSION_MAJOR}_MIN_VERSION_STR}
TRUE)
Expand Down
4 changes: 2 additions & 2 deletions cmake/VersionToNumber.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ function(version_to_number out version hex)
if(hex)
set(_format HEXA)
endif()
if(version MATCHES "^([0-9]+)\.([0-9])+(\.([0-9]+))?")
if(version MATCHES "^([0-9]+)\.([0-9]+)(\.([0-9]+))?")
math(EXPR _value
"${CMAKE_MATCH_1} * 65536 + ${CMAKE_MATCH_2} * 256 + 0${CMAKE_MATCH_3}"
"${CMAKE_MATCH_1} * 65536 + ${CMAKE_MATCH_2} * 256 + 0${CMAKE_MATCH_4}"
OUTPUT_FORMAT ${_format}DECIMAL)
else()
message(FATAL_ERROR "Can't parse ${version} into maj/min/patch")
Expand Down
11 changes: 7 additions & 4 deletions cmake/externallibs/FindOrBuildExiv2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
#
# A comment from 2023-01-18 in a github Exiv issue #2406 discussing releases:
#
# Dear folks, Exiv2 v0.27.6 has been released! I'll start working on the v1.0.0
# major release based on 9ca161d.
# Dear folks, Exiv2 v0.27.6 has been released! I'll start working on the v1.0.0
# major release based on 9ca161d.
#
# However, Exiv2 v0.28 was released with C++17 support included, so we can use
# that version if the distro includes it.
#
function(find_or_build_exiv2)
pkg_check_modules(EXIV2 "exiv2>=1.0" QUIET IMPORTED_TARGET)
pkg_check_modules(EXIV2 "exiv2>=0.28" QUIET IMPORTED_TARGET)
if(NOT EXIV2_FOUND)
pkg_check_modules(EXIV2 "mythexiv2>=0.99" QUIET IMPORTED_TARGET)
pkg_check_modules(EXIV2 "mythexiv2>=0.28" QUIET IMPORTED_TARGET)
endif()
if(TARGET PkgConfig::EXIV2)
message(STATUS "Found Exiv2 ${EXIV2_VERSION} ${EXIV2_LINK_LIBRARIES}")
Expand Down
Loading

0 comments on commit 6b0142b

Please sign in to comment.