Skip to content

Commit

Permalink
cleanup: Rename BUILD.* to *.BUILD.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Dec 30, 2024
1 parent 96dce06 commit 264fd9c
Show file tree
Hide file tree
Showing 69 changed files with 76 additions and 177 deletions.
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4.1
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,31 @@ jobs:
sed -i -e 's/ --remote_download_outputs=all//' tools/built/src/setup-dev.sh
docker build -t toxchat/toktok-stack:latest-dev -f tools/built/src/Dockerfile.dev .
local-build:
runs-on: ubuntu-22.04
if: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download bazelisk
run: |
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-amd64.deb -o bazelisk-amd64.deb
sudo apt-get install ./bazelisk-amd64.deb
- name: Install nix
run: |
curl -L https://nixos.org/nix/install -o install.sh
sh install.sh --no-channel-add --yes
rm install.sh
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
nix-channel --add https://github.com/NixOS/nixpkgs/archive/a81bbdfb658428a45c69a42aa73d4bd18127c467.tar.gz nixpkgs
nix-channel --update
- name: Build
run: |
. /home/runner/.nix-profile/etc/profile.d/nix.sh
nix-shell -p patchelf --run "patchelf --version"
bazel build --config=local //...
mypy:
runs-on: ubuntu-22.04
steps:
Expand Down
110 changes: 35 additions & 75 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -222,49 +222,49 @@ nixpkgs_python_configure(

nixpkgs_package(
name = "diffutils",
build_file = "//third_party:BUILD.diffutils",
build_file = "//third_party:diffutils.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "autoconf",
build_file = "//third_party:BUILD.autoconf",
build_file = "//third_party:autoconf.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "automake",
build_file = "//third_party:BUILD.automake",
build_file = "//third_party:automake.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "libtool",
build_file = "//third_party:BUILD.libtool",
build_file = "//third_party:libtool.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "m4",
build_file = "//third_party:BUILD.m4",
build_file = "//third_party:m4.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "cmake",
build_file = "//third_party:BUILD.cmake",
build_file = "//third_party:cmake.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "gnumake",
build_file = "//third_party:BUILD.gnumake",
build_file = "//third_party:gnumake.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "perl",
build_file = "//third_party:BUILD.perl",
build_file = "//third_party:perl.BUILD",
repository = "@nixpkgs",
)

Expand Down Expand Up @@ -383,7 +383,7 @@ haskell_register_ghc_nixpkgs(

[nixpkgs_package(
name = "haskellPackages." + tool,
build_file = "//third_party/haskell:BUILD." + tool,
build_file = "//third_party/haskell:" + tool + ".BUILD",
repository = "@nixpkgs",
) for tool in [
"alex",
Expand Down Expand Up @@ -452,7 +452,7 @@ nixpkgs_package(
nixpkgs_package(
name = "asound",
attribute_path = "alsa-lib.dev",
build_file = "//third_party:BUILD.asound",
build_file = "//third_party:asound.BUILD",
repository = "@nixpkgs",
)

Expand All @@ -465,30 +465,30 @@ nixpkgs_package(
nixpkgs_package(
name = "openssl",
attribute_path = "openssl.dev",
build_file = "//third_party:BUILD.openssl",
build_file = "//third_party:openssl.BUILD",
repository = "@nixpkgs",
)

# https://ftp.gnu.org/pub/gnu/ncurses
http_archive(
name = "ncurses",
build_file = "@toktok//third_party:BUILD.ncurses",
build_file = "@toktok//third_party:ncurses.BUILD",
integrity = "sha256-E22RvCaamleF5fnpgLx2q1dCj2BM4+WlqQzrx2eXHMY=",
strip_prefix = "ncurses-6.5",
urls = ["https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.5.tar.gz"],
)

http_archive(
name = "ev",
build_file = "@toktok//third_party:BUILD.ev",
build_file = "@toktok//third_party:ev.BUILD",
sha256 = "507eb7b8d1015fbec5b935f34ebed15bf346bed04a11ab82b8eee848c4205aea",
strip_prefix = "libev-4.33",
urls = ["http://dist.schmorp.de/libev/libev-4.33.tar.gz"],
)

http_archive(
name = "bzip2",
build_file = "@toktok//third_party:BUILD.bzip2",
build_file = "@toktok//third_party:bzip2.BUILD",
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
strip_prefix = "bzip2-1.0.8",
urls = ["https://www.sourceware.org/pub/bzip2/bzip2-latest.tar.gz"],
Expand Down Expand Up @@ -521,7 +521,7 @@ new_github_archive(
# https://ffmpeg.org/releases
http_archive(
name = "ffmpeg",
build_file = "@toktok//third_party:BUILD.ffmpeg",
build_file = "@toktok//third_party:ffmpeg.BUILD",
sha256 = "fd59e6160476095082e94150ada5a6032d7dcc282fe38ce682a00c18e7820528",
strip_prefix = "ffmpeg-7.1",
urls = ["https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2"],
Expand All @@ -530,7 +530,7 @@ http_archive(
# https://ftp.gnu.org/pub/gnu/gettext
http_archive(
name = "gettext",
build_file = "@toktok//third_party:BUILD.gettext",
build_file = "@toktok//third_party:gettext.BUILD",
sha256 = "ec1705b1e969b83a9f073144ec806151db88127f5e40fe5a94cb6c8fa48996a0",
strip_prefix = "gettext-0.22.5",
urls = ["https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz"],
Expand All @@ -545,7 +545,7 @@ nixpkgs_package(
nixpkgs_package(
name = "gl",
attribute_path = "libGL.dev",
build_file = "@toktok//third_party:BUILD.gl",
build_file = "@toktok//third_party:gl.BUILD",
repository = "@nixpkgs",
)

Expand All @@ -558,22 +558,22 @@ nixpkgs_package(
nixpkgs_package(
name = "glvnd",
attribute_path = "libglvnd.dev",
build_file = "@toktok//third_party:BUILD.glvnd",
build_file = "@toktok//third_party:glvnd.BUILD",
repository = "@nixpkgs",
)

# https://github.com/nlohmann/json
http_archive(
name = "json",
build_file = "@toktok//third_party:BUILD.json",
build_file = "@toktok//third_party:json.BUILD",
sha256 = "a22461d13119ac5c78f205d3df1db13403e58ce1bb1794edc9313677313f4a9d",
strip_prefix = "include",
urls = ["https://github.com/nlohmann/json/releases/download/v3.11.3/include.zip"],
)

http_archive(
name = "libcap",
build_file = "@toktok//third_party:BUILD.libcap",
build_file = "@toktok//third_party:libcap.BUILD",
sha256 = "db7de848064e656a0bb528dae6d53ff20c82e849d509cecd015a04d2fec8369d",
strip_prefix = "libcap-2.33",
urls = ["https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.33.tar.gz"],
Expand All @@ -589,7 +589,7 @@ new_github_archive(

http_archive(
name = "libidn2",
build_file = "@toktok//third_party:BUILD.libidn2",
build_file = "@toktok//third_party:libidn2.BUILD",
sha256 = "e1cb1db3d2e249a6a3eb6f0946777c2e892d5c5dc7bd91c74394fc3a01cab8b5",
strip_prefix = "libidn2-2.3.0",
urls = ["https://ftp.gnu.org/gnu/libidn/libidn2-2.3.0.tar.gz"],
Expand Down Expand Up @@ -648,36 +648,36 @@ new_github_archive(

http_archive(
name = "pthread_w32",
build_file = "@toktok//third_party:BUILD.pthread_w32",
build_file = "@toktok//third_party:pthread_w32.BUILD",
sha256 = "e6aca7aea8de33d9c8580bcb3a0ea3ec0a7ace4ba3f4e263ac7c7b66bc95fb4d",
strip_prefix = "pthreads-w32-2-9-1-release",
urls = ["https://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.tar.gz"],
)

new_local_repository(
name = "pthread",
build_file = "//third_party:BUILD.pthread",
build_file = "//third_party:pthread.BUILD",
path = "third_party/pthread",
)

new_local_repository(
name = "psocket",
build_file = "//third_party:BUILD.psocket",
build_file = "//third_party:psocket.BUILD",
path = "third_party",
)

# https://github.com/tukaani-project/xz/releases
http_archive(
name = "libxz",
build_file = "@toktok//third_party:BUILD.libxz",
build_file = "@toktok//third_party:libxz.BUILD",
sha256 = "b1d45295d3f71f25a4c9101bd7c8d16cb56348bbef3bbc738da0351e17c73317",
strip_prefix = "xz-5.6.3",
urls = ["https://github.com/tukaani-project/xz/releases/download/v5.6.3/xz-5.6.3.tar.gz"],
)

http_archive(
name = "sdl2",
build_file = "@toktok//third_party:BUILD.sdl2",
build_file = "@toktok//third_party:sdl2.BUILD",
sha256 = "349268f695c02efbc9b9148a70b85e58cefbbf704abd3e91be654db7f1e2c863",
strip_prefix = "SDL2-2.0.12",
urls = ["https://github.com/libsdl-org/SDL/releases/download/release-2.0.12/SDL2-2.0.12.tar.gz"],
Expand All @@ -703,46 +703,6 @@ new_github_archive(
version = "a18a9d248b4794c7a0c70698c2575bc78d3c1ae4",
)

nixpkgs_package(
name = "libnotify.out",
attribute_path = "libnotify",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "libnotify",
attribute_path = "libnotify.dev",
build_file = "@toktok//third_party:BUILD.libnotify",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "gdk-pixbuf.out",
attribute_path = "gdk-pixbuf",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "gdk-pixbuf",
attribute_path = "gdk-pixbuf.dev",
build_file = "@toktok//third_party:BUILD.gdk-pixbuf",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "glib.out",
attribute_path = "glib.out",
build_file = "@toktok//third_party:BUILD.glib.out",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "glib",
attribute_path = "glib.dev",
build_file = "@toktok//third_party:BUILD.glib",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "x11.out",
attribute_path = "xorg.libX11.out",
Expand All @@ -752,7 +712,7 @@ nixpkgs_package(
nixpkgs_package(
name = "x11",
attribute_path = "xorg.libX11.dev",
build_file = "@toktok//third_party:BUILD.x11",
build_file = "@toktok//third_party:x11.BUILD",
repository = "@nixpkgs",
)

Expand All @@ -765,7 +725,7 @@ nixpkgs_package(
nixpkgs_package(
name = "xcb",
attribute_path = "xorg.libxcb.dev",
build_file = "@toktok//third_party:BUILD.xcb",
build_file = "@toktok//third_party:xcb.BUILD",
repository = "@nixpkgs",
)

Expand All @@ -778,7 +738,7 @@ nixpkgs_package(
nixpkgs_package(
name = "xext",
attribute_path = "xorg.libXext.dev",
build_file = "@toktok//third_party:BUILD.xext",
build_file = "@toktok//third_party:xext.BUILD",
repository = "@nixpkgs",
)

Expand All @@ -791,21 +751,21 @@ nixpkgs_package(
nixpkgs_package(
name = "xxf86vm",
attribute_path = "xorg.libXxf86vm.dev",
build_file = "@toktok//third_party:BUILD.xxf86vm",
build_file = "@toktok//third_party:xxf86vm.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "xproto",
attribute_path = "xorg.xorgproto.out",
build_file = "@toktok//third_party:BUILD.xproto",
build_file = "@toktok//third_party:xproto.BUILD",
repository = "@nixpkgs",
)

nixpkgs_package(
name = "xss",
attribute_path = "xorg.libXScrnSaver",
build_file = "@toktok//third_party:BUILD.xss",
build_file = "@toktok//third_party:xss.BUILD",
repository = "@nixpkgs",
)

Expand Down Expand Up @@ -864,20 +824,20 @@ QT_LIBS = [

[nixpkgs_package(
name = "qt6.qt%s.out" % lib,
build_file = "//third_party/qt:BUILD.qt%s.out" % lib,
build_file = "//third_party/qt:qt%s.out.BUILD" % lib,
repository = "@nixpkgs",
) for lib in QT_LIBS]

[nixpkgs_package(
name = "qt6.qt%s" % lib,
build_file = "//third_party/qt:BUILD.qt%s.dev" % lib,
build_file = "//third_party/qt:qt%s.dev.BUILD" % lib,
repository = "@nixpkgs",
) for lib in QT_LIBS]

nixpkgs_package(
name = "qt",
attribute_path = "qt6.qttools.dev",
build_file = "//third_party:BUILD.qt",
build_file = "//third_party:qt.BUILD",
repository = "@nixpkgs",
)

Expand Down
19 changes: 9 additions & 10 deletions third_party/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ filegroup(
name = "third_party",
srcs = select({
"@toktok//tools/config:arm64": [],
"@toktok//tools/config:linux-x86_64": ["@{pkg}//:{pkg}".format(pkg = pkg[len("BUILD."):]) for pkg in glob(
["BUILD.*"],
"@toktok//tools/config:linux-x86_64": ["@{pkg}//:{pkg}".format(pkg = pkg[:-len(".BUILD")]) for pkg in glob(
["*.BUILD"],
exclude = [
"BUILD.bazel*",
"BUILD.*.out",
"*.out.BUILD",
# TODO
"BUILD.asound",
"BUILD.ffmpeg",
"BUILD.openal",
"BUILD.openssl",
"BUILD.sdl2",
"BUILD.x264",
"asound.BUILD",
"ffmpeg.BUILD",
"openal.BUILD",
"openssl.BUILD",
"sdl2.BUILD",
"x264.BUILD",
],
)] + [
"@com_google_googletest//:gtest",
Expand Down
Loading

0 comments on commit 264fd9c

Please sign in to comment.