From 7b41f437a019681ecc6702fce367429c18261195 Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Sun, 2 Apr 2023 10:39:18 +0100 Subject: [PATCH 1/4] Use -u when unsetting env for better portability. Fixes the MacOS build. --- mk/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/config.mk b/mk/config.mk index cdd69bd..3c28853 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -23,7 +23,7 @@ CONTAINERFILE?=podman/redox-base-containerfile # Per host variables # TODO: get host arch automatically HOST_ARCH=x86_64 -HOST_CARGO=env --unset=RUSTUP_TOOLCHAIN cargo +HOST_CARGO=env -u RUSTUP_TOOLCHAIN cargo UNAME := $(shell uname) ifeq ($(UNAME),Darwin) FUMOUNT=sudo umount From 9463599948774ac07dacd3f68910af2461e7523c Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Sun, 2 Apr 2023 10:42:31 +0100 Subject: [PATCH 2/4] Remove unnecessary sudo from MacOS umount --- mk/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/config.mk b/mk/config.mk index 3c28853..fdf99fb 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -26,7 +26,7 @@ HOST_ARCH=x86_64 HOST_CARGO=env -u RUSTUP_TOOLCHAIN cargo UNAME := $(shell uname) ifeq ($(UNAME),Darwin) - FUMOUNT=sudo umount + FUMOUNT=umount export NPROC=sysctl -n hw.ncpu export REDOX_MAKE=make PREFIX_BINARY=0 From 09eca87a413314141a99c69ee3141b4108f013f1 Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Sun, 2 Apr 2023 11:09:43 +0100 Subject: [PATCH 3/4] Fix missing ftruncate on MacOS --- mk/config.mk | 3 +++ mk/disk.mk | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mk/config.mk b/mk/config.mk index fdf99fb..0756ca4 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -33,6 +33,7 @@ ifeq ($(UNAME),Darwin) VB_AUDIO=coreaudio VBM=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage HOST_TARGET ?= $(HOST_ARCH)-apple-darwin + ALLOC_FILE=truncate -s "$(FILESYSTEM_SIZE)m" else ifeq ($(UNAME),FreeBSD) FUMOUNT=sudo umount export NPROC=sysctl -n hw.ncpu @@ -41,6 +42,7 @@ else ifeq ($(UNAME),FreeBSD) VB_AUDIO=pulse # To check, will probaly be OSS on most setups VBM=VBoxManage HOST_TARGET ?= $(HOST_ARCH)-unknown-freebsd + ALLOC_FILE=fallocate --posix --length "$(FILESYSTEM_SIZE)MiB" else # Detect which version of the fusermount binary is available. ifneq (, $(shell which fusermount3)) @@ -54,6 +56,7 @@ else VB_AUDIO=pulse VBM=VBoxManage HOST_TARGET ?= $(HOST_ARCH)-unknown-linux-gnu + ALLOC_FILE=fallocate --posix --length "$(FILESYSTEM_SIZE)MiB" endif # Automatic variables diff --git a/mk/disk.mk b/mk/disk.mk index f00ca65..9353883 100644 --- a/mk/disk.mk +++ b/mk/disk.mk @@ -2,7 +2,7 @@ $(BUILD)/harddrive.img: $(FSTOOLS_TAG) $(REPO_TAG) mkdir -p $(BUILD) rm -rf $@ $@.partial -$(FUMOUNT) /tmp/redox_installer || true - fallocate --posix --length "$(FILESYSTEM_SIZE)MiB" $@.partial + ${ALLOC_FILE} $@.partial umask 002 && $(INSTALLER) -c $(FILESYSTEM_CONFIG) $@.partial mv $@.partial $@ @@ -10,7 +10,7 @@ $(BUILD)/livedisk.iso: $(FSTOOLS_TAG) $(REPO_TAG) mkdir -p $(BUILD) rm -rf $@ $@.partial -$(FUMOUNT) /tmp/redox_installer || true - fallocate --posix --length "$(FILESYSTEM_SIZE)MiB" $@.partial + ${ALLOC_FILE} $@.partial umask 002 && $(INSTALLER) -c $(FILESYSTEM_CONFIG) --live $@.partial mv $@.partial $@ @@ -19,7 +19,7 @@ $(BUILD)/filesystem.img: $(FSTOOLS_TAG) $(REPO_TAG) -$(FUMOUNT) $(BUILD)/filesystem/ || true rm -rf $@ $@.partial $(BUILD)/filesystem/ -$(FUMOUNT) /tmp/redox_installer || true - fallocate --posix --length "$(FILESYSTEM_SIZE)MiB" $@.partial + ${ALLOC_FILE} $@.partial redoxfs/target/release/redoxfs-mkfs $(REDOXFS_MKFS_FLAGS) $@.partial mkdir -p $(BUILD)/filesystem/ redoxfs/target/release/redoxfs $@.partial $(BUILD)/filesystem/ From 8f90fc620ae903a393fb8b0bb7d1d289bb1e0003 Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Sun, 2 Apr 2023 11:29:15 +0100 Subject: [PATCH 4/4] Add MacOS ninja and po4a build dependencies --- bootstrap.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index b562c99..4f14417 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -106,6 +106,8 @@ osx_macports() install_macports_pkg "osxfuse" install_macports_pkg "x86_64-elf-gcc" install_macports_pkg "cmake" + install_macports_pkg "ninja" + install_macports_pkg "po4a" } ############################################################################### @@ -137,6 +139,8 @@ osx_homebrew() install_brew_pkg "gcc@7" "gcc-7" install_brew_pkg "pkg-config" install_brew_pkg "cmake" + install_brew_pkg "ninja" + install_brew_pkg "po4a" install_brew_pkg "Caskroom/cask/osxfuse" install_brew_pkg "redox-os/gcc_cross_compilers/x86_64-elf-gcc" "x86_64-elf-gcc"