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

Support SerenityOS #5

Merged
merged 1 commit into from
Mar 2, 2025
Merged

Support SerenityOS #5

merged 1 commit into from
Mar 2, 2025

Conversation

matyalatte
Copy link
Owner

@matyalatte matyalatte commented Mar 2, 2025

SerenityOS is a modern Unix-like system with retro UI. A test case (envuSetEnvEmpy) fails but I think it's SerenityOS's issue.

TEST(UtilTest, envuSetEnvEmpty) {
    // This should do nothing.
    int ret = envuSetEnv("", "test");
    EXPECT_EQ(-1, ret);
    char* env = envuGetEnv("");
    ASSERT_EQ(NULL, env);
}
Commands I executed
# on Ubuntu 24.04
sudo apt update
# Required for OS
sudo apt install git build-essential cmake curl libmpfr-dev libmpc-dev libgmp-dev e2fsprogs ninja-build qemu-system-gui qemu-system-x86 qemu-utils ccache rsync unzip texinfo libssl-dev
# Required for Ports
sudo apt install imagemagick zlib1g-dev m4 gettext

# Clone repo
git clone https://github.com/SerenityOS/serenity.git
cd serenity

# Build OS and toolchain
./Meta/serenity.sh build
./Toolchain/BuildPython.sh

# Include ports
# Note: You can't do "./Ports/*/package.sh"
# Note: You should build gcc before building python3
for dir in bash curl git pkgconf gcc ninja python3; do
    (cd "Ports/$dir" && ./package.sh)
done

# Copy certificate files from host machine. (python's ssl module uses them.)
cp /usr/lib/ssl/certs/* Build/x86_64/Root/usr/local/ssl/certs/

# Build and run Serenity OS
Meta/serenity.sh run

# -------------------------
# on Serenity OS
cd ~/
git clone --depth 1 https://github.com/mesonbuild/meson.git
git clone https://github.com/matyalatte/c-env-utils.git
cd c-env-utils

# Build and test
python3 ~/meson/meson.py setup build
python3 ~/meson/meson.py compile -C build
python3 ~/meson/meson.py test -C build
./build/env_utils_cli

@matyalatte matyalatte merged commit 2e60d2e into main Mar 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant