-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from iamsergio/work/sergio
brew improvements
- Loading branch information
Showing
22 changed files
with
422 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: | ||
- macos-14 | ||
- macos-15 | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
# Cache brew packages | ||
- uses: tecolicom/actions-use-homebrew-tools@v1 | ||
with: | ||
tools: "graphviz qt@5 qt@6" | ||
|
||
- name: Brew install | ||
run: | | ||
brew install --build-from-source --formula ./kdstatemachineeditor-qt5.rb | ||
brew install --build-from-source --formula ./kdstatemachineeditor-qt6.rb | ||
brew install --build-from-source --formula ./kdsoap-qt5.rb | ||
brew install --build-from-source --formula ./kdsoap-qt6.rb | ||
brew install --build-from-source --formula ./kdreports-qt5.rb | ||
brew install --build-from-source --formula ./kdreports-qt6.rb | ||
brew install --build-from-source --formula ./kdsingleapplication-qt5.rb | ||
brew install --build-from-source --formula ./kdsingleapplication-qt6.rb | ||
brew install --build-from-source --formula ./kddockwidgets-qt5.rb | ||
brew install --build-from-source --formula ./kddockwidgets-qt6.rb | ||
brew install --build-from-source --formula ./gammaray-qt5.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/usr/bin/env python3 | ||
# SPDX-License-Identifier: MIT | ||
|
||
# prints packages that have an outdated version in brew than in github | ||
# they are candidates for update.py | ||
# | ||
|
||
from utils import * | ||
|
||
formulas = { | ||
'kddockwidgets-qt5.rb': {"repo": "KDAB/KDDockWidgets"}, | ||
'kddockwidgets-qt6.rb': {"repo": "KDAB/KDDockWidgets"}, | ||
'kdsingleapplication-qt5.rb': {"repo": "KDAB/KDSingleApplication"}, | ||
'kdsingleapplication-qt6.rb': {"repo": "KDAB/KDSingleApplication"}, | ||
'kdsoap-qt5.rb': {"repo": "KDAB/KDSoap"}, | ||
'kdsoap-qt6.rb': {"repo": "KDAB/KDSoap"}, | ||
'kdchart-qt5.rb': {"repo": "KDAB/KDChart"}, | ||
'kdchart-qt6.rb': {"repo": "KDAB/KDChart"}, | ||
'kdreports-qt5.rb': {"repo": "KDAB/KDReports"}, | ||
'kdreports-qt6.rb': {"repo": "KDAB/KDReports"}, | ||
'gammaray-qt5.rb': {"repo": "KDAB/Gammaray"}, | ||
'kdmactouchbar-qt5.rb': {"repo": "KDAB/KDMacTouchBar"}, | ||
# 'kdstatemachineeditor-qt5.rb': {"repo": "KDAB/KDStateMachineEditor"}, | ||
# 'kdstatemachineeditor-qt6.rb': {"repo": "KDAB/KDStateMachineEditor"}, | ||
} | ||
|
||
def unique_repos(): | ||
seen_repos = set() | ||
unique_repo_list = [] | ||
|
||
for filename in formulas: | ||
repo = formulas[filename]["repo"] | ||
if repo not in seen_repos: | ||
unique_repo_list.append(repo) | ||
seen_repos.add(repo) | ||
|
||
return unique_repo_list | ||
|
||
def run_command_with_output(command): | ||
output = os.popen(command).read() | ||
return output | ||
|
||
# Gets the package version from an .rb file | ||
def get_version_in_brew(filename): | ||
lines = run_command_with_output(f"brew info --formula {filename}").split('\n') | ||
|
||
# example: ==> kdstatemachineeditor-qt6: stable 2.0.0-beta2, HEAD | ||
first_line = lines[0] | ||
return first_line.split(' ')[3].rstrip(',') | ||
|
||
def get_latest_version_in_github(repo, strip_tag = True): | ||
lines = run_command_with_output(f"gh release list --repo {repo} --limit 1").split('\n') | ||
# example: | ||
# TITLE TYPE TAG NAME PUBLISHED | ||
# KDReports 2.3.0 Latest kdreports-2.3.0 about 2 months ago | ||
version = lines[0].split('\t')[2] | ||
|
||
if strip_tag: | ||
version = version.replace('v', '') | ||
version = version.split('-')[-1] | ||
|
||
return version | ||
|
||
def print_current_brew_versions(): | ||
print("\nCurrent Homebrew versions:") | ||
for filename in formulas: | ||
version = get_version_in_brew(filename) | ||
filename = filename.ljust(30) | ||
print(f"{filename}: {version}") | ||
|
||
def print_latest_github_versions(): | ||
print("\nLatest Github versions:") | ||
for repo in unique_repos(): | ||
version = get_latest_version_in_github(repo) | ||
repo = repo.ljust(30) | ||
print(f"{repo}: {version}") | ||
|
||
def print_outdated_packages(): | ||
print("\nOutdated packages:") | ||
has_outdated = False | ||
|
||
for filename in formulas: | ||
current_version = get_version_in_brew(filename) | ||
github_version = get_latest_version_in_github(formulas[filename]["repo"]) | ||
|
||
if current_version != github_version: | ||
has_outdated = True | ||
filename = filename.ljust(30) | ||
print(f"{filename}: {current_version} => {github_version}") | ||
|
||
if not has_outdated: | ||
print("No outdated packages found") | ||
|
||
# print_latest_github_versions() | ||
# print_current_brew_versions() | ||
print_outdated_packages() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
class KddockwidgetsQt5 < Formula | ||
desc "Advanced Dock Widget Framework for Qt5" | ||
homepage "https://github.com/KDAB/KDDockWidgets" | ||
url "https://github.com/KDAB/KDDockWidgets/releases/download/v2.0.0/kddockwidgets-2.0.0.tar.gz" | ||
sha256 "10514846c8111812d575eaec701c7fef2d3a169d4ef2256fa50f52f70f508598" | ||
url "https://github.com/KDAB/KDDockWidgets/releases/download/v2.1.0/kddockwidgets-2.1.0.tar.gz" | ||
sha256 "cf3242b8fde8988b2661366b6a9597bcb67164074c4f31d03ec2999b475a25d7" | ||
head "https://github.com/KDAB/KDDockWidgets.git" | ||
|
||
depends_on "qt5" => "with-d-bus" | ||
depends_on "qt@5" => "with-d-bus" | ||
depends_on "cmake" => :build | ||
depends_on "ninja" => :build | ||
|
||
|
||
def install | ||
system "cmake", ".", *std_cmake_args | ||
system "make" | ||
system "make", "install" | ||
system "cmake", ".", "-G", "Ninja", "-DKDDockWidgets_NO_SPDLOG=ON", *std_cmake_args | ||
system "ninja" | ||
system "ninja", "install" | ||
end | ||
|
||
test do | ||
system "make", "test" | ||
system "ctest" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
class KddockwidgetsQt6 < Formula | ||
desc "Advanced Dock Widget Framework for Qt6" | ||
homepage "https://github.com/KDAB/KDDockWidgets" | ||
url "https://github.com/KDAB/KDDockWidgets/releases/download/v2.0.0/kddockwidgets-2.0.0.tar.gz" | ||
sha256 "10514846c8111812d575eaec701c7fef2d3a169d4ef2256fa50f52f70f508598" | ||
url "https://github.com/KDAB/KDDockWidgets/releases/download/v2.1.0/kddockwidgets-2.1.0.tar.gz" | ||
sha256 "cf3242b8fde8988b2661366b6a9597bcb67164074c4f31d03ec2999b475a25d7" | ||
head "https://github.com/KDAB/KDDockWidgets.git" | ||
|
||
depends_on "qt6" => "with-d-bus" | ||
depends_on "qt@6" => "with-d-bus" | ||
depends_on "cmake" => :build | ||
depends_on "ninja" => :build | ||
|
||
def install | ||
system "cmake", ".", "-DKDDockWidgets_QT6=True", *std_cmake_args | ||
system "make" | ||
system "make", "install" | ||
system "cmake", ".", "-G", "Ninja", "-DKDDockWidgets_NO_SPDLOG=ON", "-DKDDockWidgets_QT6=True", *std_cmake_args | ||
system "ninja" | ||
system "ninja", "install" | ||
end | ||
|
||
test do | ||
system "make", "test" | ||
system "ctest" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.