Skip to content

Commit

Permalink
chore: Add bazel build.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Sep 3, 2023
1 parent 8632be2 commit 3c88aca
Show file tree
Hide file tree
Showing 51 changed files with 669 additions and 27 deletions.
12 changes: 12 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
bazel-opt_task:
container:
image: toxchat/toktok-stack:latest-release
cpu: 2
memory: 6G
configure_script:
- /src/workspace/tools/inject-repo qtox
test_all_script:
- cd /src/workspace && bazel test -k
--remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST
//qtox/...
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.github/ @TokTok/admins
9 changes: 9 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
_extends: .github

repository:
name: qTox
description: Powerful Tox chat client that follows the Tox design guidelines.
homepage: https://qtox.github.io/
topics: tox, chat
has_issues: false
2 changes: 1 addition & 1 deletion .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build, test, and deploy
on: [pull_request, push]
#on: [pull_request, push]
jobs:
update-nightly-tag:
name: Update nightly release tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commit-format.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Commit Format
on: pull_request
#on: pull_request
jobs:
verify-commit-format:
name: Verify Commit Format
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ target/

# Tarballs
*.tar.*

# Editor temp files
*.swp
56 changes: 56 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("//third_party/qt:build_defs.bzl", "qt_lconvert", "qt_rcc")
load("//tools/project:build_defs.bzl", "project")

package(features = ["layering_check"])

project()

qt_lconvert(
name = "qtox_qms",
srcs = glob(["translations/*.ts"]),
)

genrule(
name = "translations_qrc",
srcs = ["translations/translations.qrc"],
outs = ["translations/translations_local.qrc"],
cmd = "cp $< $@",
)

qt_rcc(
name = "translations",
srcs = [":translations_qrc"],
data = [":qtox_qms"],
)

qt_rcc(
name = "res",
srcs = [
"res.qrc",
"smileys/emojione.qrc",
"smileys/smileys.qrc",
],
data = glob([
"img/**/*",
"res/**/*",
"smileys/*/*",
"themes/**/*",
]),
)

cc_library(
name = "res_lib",
srcs = [
":res",
":translations",
],
visibility = ["//qtox:__subpackages__"],
alwayslink = True,
)

cc_binary(
name = "qtox",
visibility = ["//qtox:__subpackages__"],
deps = ["//qtox/src:main"],
)
9 changes: 5 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -664,11 +664,12 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
<http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

64 changes: 64 additions & 0 deletions audio/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//third_party/qt:build_defs.bzl", "qt_moc", "qt_rcc")

package(features = ["layering_check"])

qt_moc(
name = "audio_moc",
srcs = [
"include/audio/iaudiocontrol.h",
"include/audio/iaudiosource.h",
"src/backend/alsink.h",
"src/backend/alsource.h",
"src/backend/openal.h",
],
hdrs = glob(["**/*.h"]),
mocopts = ["-Iqtox/audio/include"],
deps = ["//qtox/util"],
)

qt_rcc(
name = "audio_res",
srcs = ["resources/audio_res.qrc"],
data = glob(["resources/*.pcm"]),
)

cc_library(
name = "audio_res_lib",
srcs = [":audio_res"],
visibility = ["//qtox:__subpackages__"],
alwayslink = True,
)

cc_library(
name = "audio",
srcs = [
":audio_moc",
] + glob(
[
"src/**/*.cpp",
],
),
hdrs = glob(["**/*.h"]),
copts = ["-Iqtox"] + select({
"//tools/config:freebsd": [],
"//tools/config:linux": ["-fPIC"],
"//tools/config:osx": [],
"//tools/config:windows": [],
}),
defines = [
"DEBUG",
#"DESKTOP_NOTIFICATIONS",
"QTOX_PLATFORM_EXT",
"QT_MESSAGELOGCONTEXT",
"UPDATE_CHECK_ENABLED",
],
includes = ["include"],
visibility = ["//qtox:__subpackages__"],
deps = [
":audio_res_lib",
"//qtox/util",
"@openal",
"@qt//:qt_core",
],
)
10 changes: 10 additions & 0 deletions osx/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("//third_party/qt:build_defs.bzl", "qt_mac_deploy")

package(features = ["layering_check"])

qt_mac_deploy(
name = "qtox",
app_icons = glob(["qtox.icns.xcassets/**"]),
bundle_id = "chat.tox.qtox",
deps = ["//qtox:qtox_main"],
)
68 changes: 68 additions & 0 deletions osx/qtox.icns.xcassets/qtox.icns.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "qtox.icns-16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "qtox.icns-32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "qtox.icns-128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "qtox.icns-256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "qtox.icns-512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "[email protected]",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion smileys/emojione.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,6 @@
<file>emojione/3297.svg</file>
<file>emojione/3299.svg</file>
<file>emojione/emoticons.xml</file>
<file>ASCII+emojione/emoticons.xml</file>
<file>ASCII-emojione/emoticons.xml</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion smileys/smileys.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,6 @@
<file>Universe/1f1f7-1f1fa.svg</file>
<file>Universe/1f1fa-1f1f8.svg</file>
<file>Universe/emoticons.xml</file>
<file>ASCII+Universe/emoticons.xml</file>
<file>ASCII-Universe/emoticons.xml</file>
</qresource>
</RCC>
Loading

0 comments on commit 3c88aca

Please sign in to comment.