Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Switch to libdragon toolchain generation. #17

Merged
merged 57 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
45d3a83
test new package creation
networkfusion Dec 31, 2022
2bb2750
fix yaml
networkfusion Dec 31, 2022
d447481
fix checkout
networkfusion Dec 31, 2022
204c3e4
remove checkout path
networkfusion Dec 31, 2022
9f5088e
Work on CI.
networkfusion Dec 31, 2022
2d8c3dd
Fix environment variable
networkfusion Jan 1, 2023
a03aba7
GCC path version tests
networkfusion Jan 1, 2023
3a9fd2a
Only output the version from GCC string.
networkfusion Jan 1, 2023
1ea6a03
Try with P option
networkfusion Jan 1, 2023
6da283e
Improve release paths
networkfusion Jan 1, 2023
4fdbf39
Use output var (rather than env)
networkfusion Jan 1, 2023
4afcf0b
Test fix release variable set
networkfusion Jan 1, 2023
12d7a05
fix var?
networkfusion Jan 1, 2023
2474fb8
Dont use tag.
networkfusion Jan 1, 2023
18fae0f
Generate automated changelog
networkfusion Jan 2, 2023
8696a8b
Improve changelog for release.
networkfusion Jan 2, 2023
7149997
Always use `latest` for release
networkfusion Jan 2, 2023
14aefb9
Update build-toolchain.yml
networkfusion Jan 2, 2023
1d159fe
Fix artifact path
networkfusion Jan 3, 2023
716c6be
Merge branch 'use-libdragon' of https://github.com/N64-tools/mips64-g…
networkfusion Jan 3, 2023
3d91157
Compress windows toolchain in release job
networkfusion Jan 3, 2023
0e7961a
Include makefile in build for windows.
networkfusion Jan 3, 2023
5ede029
Fix changelog
networkfusion Jan 3, 2023
2088960
Test changelog
networkfusion Jan 3, 2023
db34dce
fix windows artifacts on release
networkfusion Jan 3, 2023
1cf30d1
Fix release name
networkfusion Jan 3, 2023
0a8992c
fix yaml
networkfusion Jan 3, 2023
46af91e
Further fix yaml
networkfusion Jan 3, 2023
75007be
Further fix invalid yaml
networkfusion Jan 3, 2023
f664967
Fix changelog text and win path.
networkfusion Jan 3, 2023
81e02b4
upload whole path
networkfusion Jan 4, 2023
40365e0
try new path
networkfusion Jan 5, 2023
d693ad4
test package changes
networkfusion Jan 5, 2023
d15a9a2
Zip windows artifact
networkfusion Jan 5, 2023
28dd238
Improve zip file upload.
networkfusion Jan 5, 2023
c7e3bd6
further attempt at zip of windows artifacts
networkfusion Jan 5, 2023
50fbd87
Work on changelog.
networkfusion Jan 5, 2023
a9bc67c
Fix zip generation?
networkfusion Jan 5, 2023
acd900a
Fix yaml for zip generation
networkfusion Jan 5, 2023
808b7eb
Revert ruby change, got a permission error
networkfusion Jan 5, 2023
94c4613
Revert changelog to something likely to work.
networkfusion Jan 6, 2023
b7df223
Include makefile in build for windows.
networkfusion Jan 3, 2023
34df3c0
Fix spacing error.
networkfusion Jan 6, 2023
7676c4b
Merge branch 'use-libdragon' of https://github.com/N64-tools/mips64-g…
networkfusion Jan 6, 2023
464ac65
Test changlog CRLF
networkfusion Jan 6, 2023
3b2f119
Update changelog to use html line breaks
networkfusion Jan 7, 2023
7d05f08
Final fixups.
networkfusion Jan 7, 2023
10c0873
Add package environment variable generation.
networkfusion Jan 7, 2023
feb734d
Fix command
networkfusion Jan 7, 2023
2db89cf
Improve step variables.
networkfusion Jan 7, 2023
56d73ab
Fix CI environment variable
networkfusion Jan 7, 2023
5e562b0
Minor improvements.
networkfusion Jan 8, 2023
cd0d2d9
Generate releases based on branch.
networkfusion Jan 8, 2023
e5b7e6e
Fix binutils variable version.
networkfusion Jan 8, 2023
f543314
Improve size by removing un-necessary files
networkfusion Jan 8, 2023
28e0ce6
Enable dockerfile build and release.
networkfusion Jan 13, 2023
30abbf8
Fix dockerfile
networkfusion Jan 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) NetworkFusion 2023
# See LICENSE file in the project root for full license information.

name: Build Docker Container

env:
GCR_FILE: Dockerfile

on:
push:
branches:
- master
paths:
- '**Dockerfile'

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.CONTAINER_BUILD_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
file: ${{ env.GCR_FILE }}
push: true # Will only build if this is not here
tags: |
# ${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }}
${{ env.GCR_IMAGE }}:latest
365 changes: 262 additions & 103 deletions .github/workflows/build-toolchain.yml

Large diffs are not rendered by default.

57 changes: 6 additions & 51 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,54 +1,9 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
# Generated debug files
*.zip
*.bin
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
*.tar.*
*.deb
*.rpm

.vs/
67 changes: 67 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# syntax=docker/dockerfile:1
# V0 - Use this comment to force a re-build without changing the contents

# Stage 1 - Build the toolchain
FROM debian:stable-slim AS toolchain-builder
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

# Install required dependencies
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils \
&& apt-get install -y \
curl \
bzip2 \
make \
file \
libmpfr-dev \
libmpc-dev \
zlib1g-dev \
texinfo \
git \
gcc \
g++

ARG N64_INST=/n64_toolchain
ENV N64_INST=${N64_INST}

# Build
ADD https://raw.githubusercontent.com/DragonMinded/libdragon/trunk/tools/build-toolchain.sh /tmp/tools/build-toolchain.sh
WORKDIR /tmp/tools
RUN chmod 755 "./build-toolchain.sh" && ./build-toolchain.sh

# Remove locale strings which are not so important in our use case
RUN rm -rf ${N64_INST}/share/locale/*

# Stage 2 - Prepare minimal image
FROM debian:stable-slim
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# Setup paths for the libgragon toolchain
ARG N64_INST=/n64_toolchain
ENV N64_INST=${N64_INST}
ENV PATH="${N64_INST}/bin:$PATH"

# Install dependencies for building libdragon tools and ROMS (using makefiles and CMake)
# and (commented out) ability to use it as a vs-code devcontainer.
RUN apt-get update && \
apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 &&\
apt-get install -yq \
gcc \
g++ \
make \
libpng-dev \
git \
curl \
cmake \
ninja-build

COPY --from=toolchain-builder ${N64_INST} ${N64_INST}

# Clean up downloaded files
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog
18 changes: 18 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Installing packages

## Operating System


### Debian
Download and install the debian (.deb) package:
`$ sudo dpkg -i <packagename>.deb`

### RPM
Download and install the RPM (.rpm) package.
`rpm -i <packagename>.rpm`

### Windows
Download the .zip file and extract it.
Move the folder.
Add the file path to an environment variable
Enjoy!
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
NOTE: This repo will be updated or deprecated in the near future as the libDragon toolchain now supports the ability to do the same thing using:
```
sudo apt-get install -y mingw-w64
cd ./tools/
sudo N64_INST=/usr/local/n64/ HOST=x86_64-w64-mingw32 ./build-toolchain.sh
```
**NOTE:** This repo uses the [official libDragon](dragonminded/libdragon) toolchain build script to generate its artifacts. However, it may also include features or abilities that have not yet been added.

# Windows mips64-gcc-toolchain for the N64
# mips64-gcc-toolchain for the N64

This repo automatically generates the MIPS64 GCC toolchain to allow cross compilation for the N64.
The binaries can be downloaded and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment.

[![Azure Pipeline CI](https://dev.azure.com/n64-tools/N64-Tools/_apis/build/status/N64-tools.mips64-gcc-toolchain)](https://dev.azure.com/n64-tools/N64-Tools/_build/latest?definitionId=1)
The binaries can be downloaded (from releases) and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment (without using docker).

[![Github Action CI](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml/badge.svg)](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml)

Architecture | Download Links
--- | ---
Windows x64 | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-win64.zip)
Windows i386 | none currently available!
Windows x86_x64 | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-win64.zip)
Debian | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-linux64.deb)
Redhat | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-linux64.rpm)
92 changes: 0 additions & 92 deletions azure-pipelines.yml

This file was deleted.

39 changes: 0 additions & 39 deletions build.sh

This file was deleted.

Loading