mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-09-14 04:36:00 -05:00
Merge pull request #329 from lhearachel/make-venv
Some checks are pending
build / build (push) Waiting to run
Some checks are pending
build / build (push) Waiting to run
Pull Meson as a subproject
This commit is contained in:
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@@ -11,26 +11,24 @@ on:
|
||||
|
||||
env:
|
||||
LM_LICENSE_FILE: "${{ github.workspace }}/tools/cw/license.dat"
|
||||
CALCROM_DISCORD_WEBHOOK_AVATAR_URL: "https://i.imgur.com/38BQHdd.png"
|
||||
CALCROM_DISCORD_WEBHOOK_USERNAME: "OK"
|
||||
CALCROM_WEBHOOK_URL: "${{ secrets.WEBHOOKURL }}"
|
||||
BUILD: /var/tmp/pokeplatinum
|
||||
WINEARCH: win32
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Install Software
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo mkdir -pm755 /etc/apt/keyrings
|
||||
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
||||
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y --install-recommends python3-pip ninja-build winehq-stable binutils-arm-none-eabi gcc-arm-none-eabi flex bison
|
||||
pip install --user meson pyelftools
|
||||
sudo apt-get install -y bison flex g++ gcc-arm-none-eabi git make ninja-build pkg-config python3
|
||||
sudo apt-get install -y --install-recommends winehq-stable
|
||||
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v2
|
||||
@@ -41,14 +39,6 @@ jobs:
|
||||
- name: Build Repo
|
||||
run: make check
|
||||
|
||||
- name: Webhook
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
env:
|
||||
arm9name: ${{ vars.BUILD }}
|
||||
run: |
|
||||
.github/calcrom/webhook.sh "$CALCROM_WEBHOOK_URL" "$BUILD"
|
||||
continue-on-error: true
|
||||
|
||||
- name: Checkout xMAP
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
uses: actions/checkout@v4
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -20,6 +20,7 @@
|
||||
/subprojects/narc/
|
||||
/subprojects/metang/
|
||||
/subprojects/rapidjson-*/
|
||||
/subprojects/meson-*/
|
||||
|
||||
# CLion folders
|
||||
.idea/
|
||||
|
||||
22
Dockerfile
22
Dockerfile
@@ -1,28 +1,14 @@
|
||||
FROM ubuntu:jammy
|
||||
FROM ubuntu:noble
|
||||
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y \
|
||||
git \
|
||||
build-essential \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-venv \
|
||||
python3-pip \
|
||||
python-is-python3 \
|
||||
flex \
|
||||
bison \
|
||||
binutils-arm-none-eabi \
|
||||
gcc-arm-none-eabi \
|
||||
wget
|
||||
RUN apt-get install -y bison flex g++ gcc-arm-none-eabi git make ninja-build pkg-config python3 wget ninja-build
|
||||
|
||||
RUN dpkg --add-architecture i386
|
||||
RUN mkdir -pm755 /etc/apt/keyrings
|
||||
RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
||||
RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
|
||||
RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y --install-recommends winehq-stable
|
||||
RUN python -m venv .venv
|
||||
RUN . .venv/bin/activate
|
||||
RUN pip install meson ninja
|
||||
RUN hash -r
|
||||
|
||||
CMD [ "/bin/sh" ]
|
||||
|
||||
46
INSTALL.md
46
INSTALL.md
@@ -118,27 +118,10 @@ install to a more recent version of `Ubuntu`:
|
||||
registry:
|
||||
|
||||
```bash
|
||||
sudo apt install git flex bison build-essential binutils-arm-none-eabi gcc-arm-none-eabi ninja-build
|
||||
apt install bison flex g++ gcc-arm-none-eabi git make ninja-build pkg-config python3
|
||||
```
|
||||
|
||||
2. Run the following to install additional dependencies via `pip`:
|
||||
|
||||
```bash
|
||||
sudo apt install pip
|
||||
pip install --user meson
|
||||
```
|
||||
|
||||
You may see `pip` respond with a warning saying `"The script meson is
|
||||
installed in '/home/<YOUR_USER>/.local/bin', which is not on PATH.` To resolve
|
||||
this issue, run the following commands, filling `<path/to/install/directory>`
|
||||
with the path reported by `pip` above:
|
||||
|
||||
```bash
|
||||
echo 'export PATH="<path/to/install/directory>:$PATH"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
3. [Download the repository](#2-downloading-the-repository).
|
||||
2. [Download the repository](#2-downloading-the-repository).
|
||||
|
||||
### Windows with MSYS2
|
||||
|
||||
@@ -169,7 +152,7 @@ the following commands to install necessary build dependencies:
|
||||
```bash
|
||||
echo 'export PATH=${PATH}:/mingw64/bin' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
pacman -S git meson gcc flex bison base-devel mingw-w64-x86_64-arm-none-eabi-{binutils,gcc}
|
||||
pacman -S bison flex gcc git make ninja python mingw-w64-x86_64-arm-none-eabi-gcc
|
||||
```
|
||||
|
||||
Press 'Y' when prompted to confirm the installation.
|
||||
@@ -191,7 +174,7 @@ the following commands:
|
||||
|
||||
```zsh
|
||||
brew update
|
||||
brew install gcc@14 meson libpng pkg-config arm-none-eabi-binutils arm-none-eabi-gcc
|
||||
brew install gcc@14 ninja libpng pkg-config arm-none-eabi-gcc
|
||||
brew install --cask wine-stable
|
||||
```
|
||||
|
||||
@@ -228,36 +211,31 @@ the repository](#2-downloading-the-repository).
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo mkdir -pm755 /etc/apt/keyrings
|
||||
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
||||
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
|
||||
sudo apt update
|
||||
sudo apt install --install-recommends wine-stable
|
||||
```
|
||||
|
||||
2. Install the following packages via `apt`:
|
||||
|
||||
```bash
|
||||
sudo apt install git flex bison ninja-build build-essential binutils-arm-none-eabi gcc-arm-none-eabi pkg-config
|
||||
```
|
||||
|
||||
3. Install `meson` via `pip`:
|
||||
|
||||
```bash
|
||||
pip3 install --user meson
|
||||
echo "export PATH=~/.local/bin:$PATH" >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
```bash
|
||||
sudo apt install bison flex g++ gcc-arm-none-eabi git make ninja-build pkg-config python3
|
||||
```
|
||||
|
||||
#### Arch Linux (and derivatives)
|
||||
|
||||
Enable the [multilib repository](https://wiki.archlinux.org/title/Multilib).
|
||||
|
||||
Install dependencies via `pacman`:
|
||||
|
||||
```bash
|
||||
sudo pacman -S git flex bison build-essentials arm-none-eabi-binutils arm-none-eabi-gcc pkg-config wine meson
|
||||
sudo pacman -S arm-none-eabi-gcc bison flex gcc git make ninja python wine
|
||||
```
|
||||
|
||||
#### Fedora (and derivatives)
|
||||
|
||||
```bash
|
||||
sudo yum install git flex bison gcc make arm-none-eabi-bintuils-cs arm-none-eabi-gcc-cs pkg-config wine meson ninja-build
|
||||
sudo dnf install arm-none-eabi-gcc-cs bison flex gcc-c++ git make ninja-build python3 wine-core.i686 wine-core.x86_64
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
35
Makefile
35
Makefile
@@ -1,8 +1,13 @@
|
||||
.PHONY: all release debug check rom data target format clean distclean setup_release setup_debug configure
|
||||
.PHONY: all release debug check rom data target format clean distclean purge update setup_release setup_debug configure meson
|
||||
|
||||
MESON ?= meson
|
||||
MESON_VER := 1.7.0
|
||||
MESON_DIR := subprojects/meson-$(MESON_VER)
|
||||
MESON_SUB := $(MESON_DIR)/meson.py
|
||||
|
||||
MESON ?= $(MESON_SUB)
|
||||
NINJA ?= ninja
|
||||
WINELOADER ?= wine
|
||||
GIT ?= git
|
||||
|
||||
BUILD ?= build
|
||||
ROOT_INI := $(BUILD)/root.ini
|
||||
@@ -86,12 +91,20 @@ format: $(BUILD)/build.ninja
|
||||
clean: $(BUILD)/build.ninja
|
||||
$(MESON) compile -C $(BUILD) --clean
|
||||
|
||||
update: $(BUILD)/build.ninja
|
||||
$(MESON) subprojects update
|
||||
|
||||
distclean:
|
||||
rm -rf $(BUILD) $(MWRAP)
|
||||
|
||||
purge: distclean
|
||||
ifeq ($(MESON),$(MESON_SUB))
|
||||
! test -f $(MESON) || $(MESON) subprojects purge --confirm
|
||||
rm -rf $(dir $(MESON_SUB))
|
||||
else
|
||||
$(MESON) subprojects purge --confirm
|
||||
endif
|
||||
|
||||
update: meson
|
||||
$(MESON) subprojects update
|
||||
|
||||
setup_release: $(BUILD)/build.ninja
|
||||
$(MESON) configure build -Dgdb_debugging=false
|
||||
|
||||
@@ -100,7 +113,7 @@ setup_debug: $(BUILD)/build.ninja
|
||||
|
||||
configure: $(BUILD)/build.ninja
|
||||
|
||||
$(BUILD)/build.ninja: $(ROOT_INI) $(DOT_MWCONFIG) | $(BUILD)
|
||||
$(BUILD)/build.ninja: $(ROOT_INI) $(DOT_MWCONFIG) | $(BUILD) meson
|
||||
MWCONFIG=$(abspath $(DOT_MWCONFIG)) $(MESON) setup \
|
||||
--wrap-mode=nopromote \
|
||||
--native-file=meson/$(NATIVE) \
|
||||
@@ -137,9 +150,17 @@ endif
|
||||
$(BUILD):
|
||||
mkdir -p -- $(BUILD)
|
||||
|
||||
$(MWRAP):
|
||||
$(MWRAP): | meson
|
||||
rm -rf $(MWRAP) $(WRAP_BUILD)
|
||||
$(MESON) setup $(WRAP_BUILD) $(WRAP)
|
||||
$(MESON) compile -C $(WRAP_BUILD)
|
||||
install -m755 $(WRAP_BUILD)/$(@F) $@
|
||||
rm -rf $(WRAP_BUILD)
|
||||
|
||||
meson: ;
|
||||
ifeq ($(MESON),$(MESON_SUB))
|
||||
meson: $(MESON_SUB)
|
||||
endif
|
||||
|
||||
$(MESON_SUB):
|
||||
$(GIT) clone --depth=1 -b $(MESON_VER) https://github.com/mesonbuild/meson $(@D)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/ntrtwl/NitroWiFi.git
|
||||
revision = 8f4f0a60d5ecf6f7d90bfd1f85dce252ee12e692
|
||||
revision = 0bb999007564dbe913cb8f6df8bfb27ac775221f
|
||||
depth = 1
|
||||
directory = NitroWiFi-2.1.30003
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
project('metrowerks', ['c', 'cpp'],
|
||||
project('metrowerks', 'c',
|
||||
default_options : ['warning_level=2'])
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
@@ -6,13 +6,13 @@ if host_machine.system() == 'windows'
|
||||
'-mconsole',
|
||||
'-municode'
|
||||
]
|
||||
add_project_arguments(winflags, language : ['c', 'cpp'])
|
||||
add_project_link_arguments(winflags, language : ['c', 'cpp'])
|
||||
add_project_arguments(winflags, language : 'c')
|
||||
add_project_link_arguments(winflags, language : 'c')
|
||||
add_project_arguments(
|
||||
'-DUNICODE',
|
||||
'-D_UNICODE',
|
||||
'-D_CRT_SECURE_NO_WARNINGS',
|
||||
language : ['c', 'cpp'])
|
||||
language : 'c')
|
||||
endif
|
||||
|
||||
executable('mwrap', 'mwrap.c')
|
||||
|
||||
Reference in New Issue
Block a user