Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bzlmod #25

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 81 additions & 81 deletions .github/workflows/bazel_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ on:
push: {}

jobs:
build_and_test_ubuntu20:
name: Linux Ubuntu 20.04 build <GCC 9.4.0>
runs-on: ubuntu-20.04
# build_and_test_ubuntu20:
# name: Linux Ubuntu 20.04 build <GCC 9.4.0>
# runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
# steps:
# - uses: actions/checkout@v3

- name: Mount bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel
# - name: Mount bazel cache
# uses: actions/cache@v3
# with:
# path: "/home/runner/.cache/bazel"
# key: bazel

- name: Build
run: |
cd tests
bazelisk build --config=gcc9 //...
# - name: Build
# run: |
# cd tests
# bazelisk build --config=gcc9 //...

build_and_test_ubuntu22:
name: Linux Ubuntu 22.04 build <GCC 11.3.0>
Expand All @@ -41,23 +41,23 @@ jobs:
cd tests
bazelisk build --config=gcc11 //...

build_and_test_windows10:
name: Windows Server 2019 build <Visual Studio 2019>
runs-on: windows-2019
# build_and_test_windows10:
# name: Windows Server 2019 build <Visual Studio 2019>
# runs-on: windows-2019

steps:
- uses: actions/checkout@v3
# steps:
# - uses: actions/checkout@v3

- name: Mount bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel
# - name: Mount bazel cache
# uses: actions/cache@v3
# with:
# path: "/home/runner/.cache/bazel"
# key: bazel

- name: Build
run: |
cd tests
bazelisk build --config=vs2019 //...
# - name: Build
# run: |
# cd tests
# bazelisk build --config=vs2019 //...

build_and_test_windows11:
name: Windows Server 2022 build <Visual Studio 2022>
Expand All @@ -77,61 +77,61 @@ jobs:
cd tests
bazelisk build --config=vs2022 //...

build_and_test_macos11:
name: macOS 11 Bazel build <Apple Clang13>
runs-on: macOS-11

steps:
- uses: actions/checkout@v3

- name: Mount bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel

- name: Print info
run: |
echo "OS info:"
sw_vers
uname
echo "Compiler info:"
clang --version
# build_and_test_macos11:
# name: macOS 11 Bazel build <Apple Clang13>
# runs-on: macOS-11

# steps:
# - uses: actions/checkout@v3

# - name: Mount bazel cache
# uses: actions/cache@v3
# with:
# path: "/home/runner/.cache/bazel"
# key: bazel

# - name: Print info
# run: |
# echo "OS info:"
# sw_vers
# uname
# echo "Compiler info:"
# clang --version

- name: Build
run: |
brew install qt@6
#brew link qt@6
cd tests
bazelisk build --config=macos //...

build_and_test_macos12:
name: macOS 12 Bazel build <Apple Clang14>
runs-on: macOS-12

steps:
- uses: actions/checkout@v3

- name: Mount bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel

- name: Print info
run: |
echo "OS info:"
sw_vers
uname
echo "Compiler info:"
clang --version
# - name: Build
# run: |
# brew install qt@6
# #brew link qt@6
# cd tests
# bazelisk build --config=macos //...

# build_and_test_macos12:
# name: macOS 12 Bazel build <Apple Clang14>
# runs-on: macOS-12

# steps:
# - uses: actions/checkout@v3

# - name: Mount bazel cache
# uses: actions/cache@v3
# with:
# path: "/home/runner/.cache/bazel"
# key: bazel

# - name: Print info
# run: |
# echo "OS info:"
# sw_vers
# uname
# echo "Compiler info:"
# clang --version

- name: Build
run: |
brew install qt@6
#brew link qt@6
cd tests
bazelisk build --config=macos //...
# - name: Build
# run: |
# brew install qt@6
# #brew link qt@6
# cd tests
# bazelisk build --config=macos //...

build_and_test_macos13:
name: macOS 13 Bazel build <Apple Clang14>
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bazel-*
.vscode
*.bazel.lock
21 changes: 21 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module(
name = "rules_qt",
version = "1.0.0",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_skylib", version = "1.7.1")

qt = use_extension("@rules_qt//:extensions.bzl", "qt")
qt.fetch()
use_repo(
qt,
"qt_linux_x86_64",
"qt_windows_x86_64",
"qt_mac_aarch64",
)
register_toolchains(
"@rules_qt//tools:all",
dev_dependency = True,
)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The following tools should be installed:
*All platforms:*

```shell
git clone https://github.com/Vertexwahn/rules_qt6
cd tests
git clone https://github.com/Vertexwahn/rules_qt6 &&
cd rules_qt6/tests
```

*Run Hello World demo with Windows 10/11 x64 with Visual Studio 2019:*
Expand Down
15 changes: 15 additions & 0 deletions extensions.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@rules_qt//:fetch_qt.bzl", "fetch_qt6")

def _qt_impl(ctx):
for mod in ctx.modules:
if mod.name == "rules_qt":
fetch_qt6()

_fetch = tag_class(attrs = {})

qt = module_extension(
implementation = _qt_impl,
tag_classes = {
"fetch": _fetch,
},
)
45 changes: 11 additions & 34 deletions fetch_qt.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,28 @@ def fetch_qt6():
http_archive(
name = "qt_windows_x86_64",
urls = [
"https://vertexwahn.de/lfs/v1/qt_6.4.0_windows_desktop_win64_msvc2019_64.zip",
"https://dl.dropboxusercontent.com/scl/fi/a75eyqtu0542t203eyie2/qt_6.8.0_windows_msvc2022_64_gamepad.zip?rlkey=l2ucxa4by8c8tp3xioqoamm89&dl=0",
],
sha256 = "e3c20b441ddd8bb803e46de32bf2fc5563fda125409d62dcd12b5647ae5a9c7e",
strip_prefix = "6.4.0/msvc2019_64",
sha256 = "59aa42d34a1b5f15dfc915830a1dbebd90c7b418cf1b726eff8d0fa2766d9827",
build_file = "@rules_qt//:qt_windows_x86_64.BUILD",
)

#native.new_local_repository(
# name = "qt_windows_x86_64",
# path = "C:\\Qt\\6.4.0\\msvc2019_64",
# build_file = "@rules_qt//:qt_windows_x86_64.BUILD",
#)

http_archive(
name = "qt_linux_x86_64",
urls = [
"https://vertexwahn.de/lfs/v1/qt_6.4.0_linux_desktop_gcc_64.tar.xz",
"https://dl.dropboxusercontent.com/scl/fi/n5aelrs4qg6lweuitb795/qt_6.8.0_linux_desktop_gcc_64_gamepad.tar.xz?rlkey=miuhkfeat53z7xk85y8abi7o3&dl=0",
],
sha256 = "809919895e2ac0567df9290676d4ec6cd1ed39c432dc5da0722b3104681fd376",
strip_prefix = "6.4.0/gcc_64",
sha256 = "fc18569262fa23c19009a66cfe39ce5761c8e99bc161820cb971be0beec0bb8b",
strip_prefix = "Qt-6.8.0",
build_file = "@rules_qt//:qt_linux_x86_64.BUILD",
)

#http_archive(
# name = "qt_mac_x86_64",
# urls = ["https://vertexwahn.de/lfs/v1/qt_mac_x86_64.zip"],
# sha256 = "9543aa178a6fe6aa138e4319fb07a106375b7fef11be150d154d5c1b8a321721",
# strip_prefix = "6.2.4/macos",
# build_file = "@rules_qt////:qt_mac_x86_64.BUILD",
#)

# On macOS we make use of an system installed Qt6
# installation works via:
# $ brew install qt@6
# $ brew link qt@6

# Check if path exists
native.new_local_repository(
name = "qt_mac_x86_64",
path = "/usr/local/opt/qt@6", #"/usr/local/opt/qt@6",
build_file = "@rules_qt//:qt_mac_x86_64.BUILD",
)

native.new_local_repository(
http_archive(
name = "qt_mac_aarch64",
path = "/opt/homebrew/", # after brew link, is't ok just use /opt/homebrew
urls = [
"https://dl.dropboxusercontent.com/scl/fi/8io4wc9cx2kd2vfwswjmg/qt_6.8.0_mac_aarch64_gamepad.tar.xz?rlkey=afkk9qrub9i1gmelv7vktgtci&dl=0",
],
sha256 = "07be3436bfb31b3a2e629907ca39a8652febe563046094cdc7373b7ff28228c4",
strip_prefix = "Qt-6.8.0",
build_file = "@rules_qt//:qt_mac_aarch64.BUILD",
)
Loading
Loading