Skip to content

Commit

Permalink
meta: Initial support for darwin and clang 18.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Apr 26, 2024
1 parent b1c3913 commit 3b380c6
Show file tree
Hide file tree
Showing 24 changed files with 347 additions and 103 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/check-darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Checks (Darwin)

on: [push, pull_request]

jobs:
build-all:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'

- name: Set up the build environment
run: ./skift.sh tools setup && ./skift.sh tools doctor

- name: Build Userspace (Host)
run: ./skift.sh builder build

- name: Test Userspace (Host)
run: ./skift.sh builder test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Checks
name: Checks (Ubuntu)

on: [push, pull_request]

Expand Down
3 changes: 3 additions & 0 deletions meta/scripts/env-darwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

export PATH=$(brew --prefix llvm)/bin:$PATH
3 changes: 3 additions & 0 deletions meta/scripts/setup-darwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

brew install nasm llvm sdl2 python3 ninja
3 changes: 1 addition & 2 deletions meta/targets/host-any.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"cmd": "{shell.latest('clang++')}"
},
"ld": {
"cmd": "{shell.latest('clang++')}",
"rule": "-o $out $objs -Wl,--whole-archive $wholeLibs -Wl,--no-whole-archive $libs $flags"
"cmd": "{shell.latest('clang++')}"
},
"ar": {
"cmd": "{shell.latest('llvm-ar')}",
Expand Down
12 changes: 12 additions & 0 deletions project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@
"cute-engineering/ce-stdcpp": {
"git": "https://github.com/cute-engineering/ce-stdcpp.git",
"tag": "v1.1.0"
},
"sdl2": {
"description": "A cross-platform development library designed to provide low level access to hardware",
"names": [
"sdl2"
]
},
"uring": {
"description": "Linux io_uring library",
"names": [
"liburing"
]
}
}
}
17 changes: 16 additions & 1 deletion skift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ function is_ubuntu() {
return 1
}

function is_darwin() {
if [ "$(uname)" == "Darwin" ]; then
return 0
fi
return 1
}

if [ "$EUID" -eq 0 ]; then
echo "Please do not run this script as root."

Expand All @@ -28,7 +35,7 @@ if [ "$CUTEKIT_NOVENV" == "1" ]; then
fi

if [ "$1" == "tools" -a "$2" == "nuke" ]; then
rm -rf .cutekit/tools .cutekit/venv
rm -rf .cutekit/tools .cutekit/venv .cutekit/tools-ready
exit 0
fi

Expand All @@ -50,6 +57,9 @@ if [ ! -f .cutekit/tools-ready ]; then
if is_ubuntu; then
echo "Detected Ubuntu, installing dependencies automatically..."
sudo ./meta/scripts/setup-ubuntu.sh
elif is_darwin; then
echo "Detected macOS, installing dependencies automatically..."
./meta/scripts/setup-darwin.sh
fi

mkdir -p .cutekit
Expand All @@ -64,13 +74,18 @@ if [ ! -f .cutekit/tools-ready ]; then

touch .cutekit/tools-ready
echo "Done!"
exit 0
fi

if [ "$1" == "tools" -a "$2" == "setup" ]; then
echo "Tools already installed."
exit 0
fi

if is_darwin; then
source ./meta/scripts/env-darwin.sh
fi

source .cutekit/venv/bin/activate
export PATH="$PATH:.cutekit/venv/bin"

Expand Down
8 changes: 4 additions & 4 deletions src/apps/hideo-base/scafold.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ struct Scafold : public Meta::NoCopy {
String title;
TitlebarStyle titlebar = TitlebarStyle::DEFAULT;

Opt<Ui::Slots> startTools;
Opt<Ui::Slots> midleTools;
Opt<Ui::Slots> endTools;
Opt<Ui::Slot> sidebar;
Opt<Ui::Slots> startTools = NONE;
Opt<Ui::Slots> midleTools = NONE;
Opt<Ui::Slots> endTools = NONE;
Opt<Ui::Slot> sidebar = NONE;
Ui::Slot body;

Math::Vec2i size = {800, 600};
Expand Down
2 changes: 1 addition & 1 deletion src/apps/hideo-shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Ui::Child appStack(State const &state) {
usize index = state.surfaces.len() - 1;
for (auto &s : iterRev(state.surfaces)) {
apps.pushBack(
scafold(Scafold{
scafold({
.icon = s.entry.icon.icon,
.title = s.entry.name,
.body = slot$(Ui::empty()),
Expand Down
2 changes: 1 addition & 1 deletion src/apps/hideo-shell/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct State {
Media::Image background;
Vec<Noti> noti;
Vec<MenuEntry> entries;
Vec<Surface> surfaces;
Vec<Surface> surfaces{};
};

struct ToggleTablet {};
Expand Down
6 changes: 3 additions & 3 deletions src/apps/hideo-shell/tray-sys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Hideo::Shell {
struct QuickSettingProps {
Mdi::Icon icon;
Opt<String> name;
bool state;
Ui::OnPress press;
Ui::OnPress more;
bool state = false;
Ui::OnPress press = NONE;
Ui::OnPress more = NONE;
};

Ui::Child quickSetting(QuickSettingProps props) {
Expand Down
37 changes: 0 additions & 37 deletions src/extern/sdl2/manifest.json

This file was deleted.

40 changes: 0 additions & 40 deletions src/extern/uring/manifest.json

This file was deleted.

Loading

0 comments on commit 3b380c6

Please sign in to comment.