add nx-hbmenu and nx-hbloader in build

This commit is contained in:
Peter Galonza 2024-05-14 23:45:47 +03:00
parent 40cc6dc560
commit 9979c2f565
4 changed files with 47 additions and 4 deletions

View File

@ -4,6 +4,8 @@ WORKDIR /app/
COPY ./requirements.txt /opt/requirements.txt
RUN apt-get install -y --no-install-recommends jq curl
RUN apt-get install -y --no-install-recommends python3-venv && \
python3 -m venv /opt/venv && \
. /opt//venv/bin/activate && \

View File

@ -12,6 +12,10 @@ ATMOSPHERE_MICRO_VERSION := $(shell grep 'define ATMOSPHERE_RELEAS
ATMOSPHERE_SUPPORTED_HOS_MAJOR_VERSION := $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_SUPPORTED_HOS_MINOR_VERSION := $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
ATMOSPHERE_SUPPORTED_HOS_MICRO_VERSION := $(shell grep 'define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO\b' $(ATMOSPHERE_LIBRARIES_DIR)/libvapours/include/vapours/ams/ams_api_version.h | tr -s [:blank:] | cut -d' ' -f3)
NX_HBMENU_VERSION := $(shell curl -s https://api.github.com/repos/switchbrew/nx-hbmenu/releases/latest | jq ".tag_name" | tr -d [v])
NX_HBLOADER_VERSION := $(shell curl -s https://api.github.com/repos/switchbrew/nx-hbloader/releases/latest | jq ".tag_name" | tr -d [v])
NX_HBMENU_DOWNLOAD := $(shell curl -s https://api.github.com/repos/switchbrew/nx-hbmenu/releases/latest | jq ".assets[0].browser_download_url")
NX_HBLOADER_DOWNLOAD := $(shell curl -s https://api.github.com/repos/switchbrew/nx-hbloader/releases/latest | jq ".assets[0].browser_download_url")
ATMOSPHERE_VERSION := $(ATMOSPHERE_MAJOR_VERSION).$(ATMOSPHERE_MINOR_VERSION).$(ATMOSPHERE_MICRO_VERSION)-$(ATMOSPHERE_GIT_REVISION)
@ -109,7 +113,10 @@ dist-no-debug: package3 $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)
cp troposphere/reboot_to_payload/reboot_to_payload.nro $(DIST_DIR)/switch/reboot_to_payload.nro
cp troposphere/daybreak/daybreak.nro $(DIST_DIR)/switch/daybreak.nro
cp troposphere/haze/haze.nro $(DIST_DIR)/switch/haze.nro
cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION).zip ./*; cd ../;
chmod +x $(CURRENT_DIRECTORY)/software.sh; $(CURRENT_DIRECTORY)/software.sh $(DIST_DIR);
$(eval NX_HBMENU_VERSION = $(curl -s https://api.github.com/repos/switchbrew/nx-hbmenu/releases/latest | jq -r ".tag_name" | tr -d [v]))
$(eval NX_HBLOADER_VERSION = $(curl -s https://api.github.com/repos/switchbrew/nx-hbloader/releases/latest | jq -r ".tag_name" | tr -d [v]))
cd $(DIST_DIR); zip -r ../atmosphere-$(ATMOSPHERE_VERSION)-hbl-$(NX_HBLOADER_VERSION)+hbmenu-$(NX_HBMENU_VERSION).zip ./*; cd ../;
rm -rf $(DIST_DIR)
cp fusee/$(ATMOSPHERE_BOOT_OUT_DIR)/fusee.bin $(CURRENT_DIRECTORY)/$(ATMOSPHERE_OUT_DIR)/fusee.bin
@ -118,7 +125,7 @@ package3: emummc fusee stratosphere mesosphere exosphere troposphere
@echo "Built package3!"
emummc:
$(MAKE) -C $(CURRENT_DIRECTORY)/emummc all
$(MAKE) -C $(CURRENT_DIRECTORY)/emummc
fusee: libexosphere_boot
@$(MAKE) --no-print-directory -C $(CURRENT_DIRECTORY)/fusee -f $(CURRENT_DIRECTORY)/fusee/fusee.mk ATMOSPHERE_CPU="$(strip $(ATMOSPHERE_BOOT_CPU))"

View File

@ -8,6 +8,8 @@ Building Atmosphère is a very straightforward process that relies almost exclus
+ [LZ4](https://pypi.org/project/lz4)
+ [PyCryptodome](https://pypi.org/project/pycryptodome) (optional)
+ [hactool](https://github.com/SciresM/hactool)
* [JQ](https://github.com/jqlang/jq)
* [Curl](https://github.com/curl/curl)
## Instructions
1. Follow the guide located [here](https://devkitpro.org/wiki/Getting_Started) to install and configure all the tools necessary for the build process.
@ -20,7 +22,11 @@ Building Atmosphère is a very straightforward process that relies almost exclus
+ `devkitarm-rules`
+ `hactool`
3. Install the following library via python's package manager `pip`, required by [exosphere](components/exosphere.md):
3. Install he following packages via apt/dnf/yum/pacman
+ `curl`
+ `jq`
4. Install the following library via python's package manager `pip`, required by [exosphere](components/exosphere.md):
+ `lz4`
4. Finally, clone the Atmosphère repository and run `make` under its root directory.
5. Finally, clone the Atmosphère repository and run `make` under its root directory.

28
software.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/bash
set -o errexit
set -o xtrace
TMP_DIR="$(dirname $0)/tmp"
BUILD_DIR=$(if [[ -z $1 ]]; then echo "./"; else echo $1; fi)
UNZIP_COMMAND="unzip -o"
prepare_nx_hbmenu() {
download_url=$(curl -s https://api.github.com/repos/switchbrew/nx-hbmenu/releases/latest | jq -r ".assets[0].browser_download_url")
curl -O -L $download_url --output-dir $TMP_DIR
$UNZIP_COMMAND $TMP_DIR/nx-hbmenu_*.zip -d $BUILD_DIR
}
prepare_nx_hbloader() {
download_url=$(curl -s https://api.github.com/repos/switchbrew/nx-hbloader/releases/latest | jq -r ".assets[0].browser_download_url")
curl -O -L $download_url --output-dir $TMP_DIR
cp $TMP_DIR/hbl.nsp -d $BUILD_DIR/atmosphere
}
mkdir $TMP_DIR
prepare_nx_hbloader
prepare_nx_hbmenu
rm -rf $TMP_DIR