This commit is contained in:
68
util/Dockerfile
Normal file
68
util/Dockerfile
Normal file
@ -0,0 +1,68 @@
|
||||
FROM fedora:41
|
||||
|
||||
RUN dnf update -y
|
||||
|
||||
###############################################################################
|
||||
# Install gosu
|
||||
|
||||
RUN dnf install -y curl
|
||||
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.10/gosu-amd64"
|
||||
RUN chmod +x /usr/local/bin/gosu
|
||||
|
||||
###############################################################################
|
||||
# Install dev tools
|
||||
|
||||
RUN dnf install -y clang \
|
||||
llvm \
|
||||
libasan \
|
||||
mingw64-gcc-c++ \
|
||||
cmake \
|
||||
make \
|
||||
git \
|
||||
vim \
|
||||
sudo \
|
||||
fuse-devel \
|
||||
findutils \
|
||||
ninja-build \
|
||||
libcxx-devel libcxxabi-devel \
|
||||
unzip \
|
||||
ccache \
|
||||
pacman \
|
||||
python3-pip \
|
||||
libglvnd-devel \
|
||||
gtk3-devel
|
||||
|
||||
###############################################################################
|
||||
# Install devkitARM
|
||||
|
||||
RUN pacman-key --init
|
||||
RUN pacman-key --recv BC26F752D25B92CE272E0F44F7FD5492264BB9D0 --keyserver keyserver.ubuntu.com
|
||||
RUN pacman-key --lsign BC26F752D25B92CE272E0F44F7FD5492264BB9D0
|
||||
RUN curl -o devkitpro-keyring.pkg.tar.xz https://pkg.devkitpro.org/devkitpro-keyring.pkg.tar.xz
|
||||
RUN pacman -Syu --noconfirm
|
||||
RUN pacman -U --noconfirm devkitpro-keyring.pkg.tar.xz
|
||||
ADD devenv/pacman.conf /etc/pacman.conf
|
||||
RUN pacman -Syu --noconfirm gba-dev
|
||||
ENV DEVKITPRO /opt/devkitpro
|
||||
ENV DEVKITARM /opt/devkitpro/devkitARM
|
||||
|
||||
###############################################################################
|
||||
# Setup sudoers
|
||||
|
||||
ADD devenv/sudoers /etc/sudoers
|
||||
|
||||
###############################################################################
|
||||
# Setup working directory
|
||||
|
||||
RUN mkdir /usr/src/project
|
||||
WORKDIR /usr/src/project
|
||||
|
||||
###############################################################################
|
||||
# Setup entrypoint
|
||||
|
||||
ADD devenv/entrypoint.sh /
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
ENV CC clang
|
||||
ENV CXX clang++
|
||||
ENV VCPKG_DIR_BASE /var/vcpkg/
|
23
util/devenv/entrypoint.sh
Executable file
23
util/devenv/entrypoint.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# script from Deni Bertovic
|
||||
# https://denibertovic.com/posts/handling-permissions-with-docker-volumes/
|
||||
|
||||
# Add local user
|
||||
# Either use the LOCAL_USER_ID if passed in at runtime or
|
||||
# fallback
|
||||
|
||||
USER_ID=${LOCAL_USER_ID:-9001}
|
||||
|
||||
if [[ $(id -u user 2> /dev/null) != $USER_ID ]]; then
|
||||
useradd --shell /bin/bash -u $USER_ID -o -c "" -m user
|
||||
export HOME=/home/user
|
||||
echo "set -o vi" >> $HOME/.bashrc
|
||||
echo "export PATH=\${PATH}:/opt/devkitPro/devkitARM/bin/" >> $HOME/.bashrc
|
||||
echo "export DEVKITPRO=/opt/devkitPro" >> $HOME/.bashrc
|
||||
echo "export DEVKITARM=/opt/devkitPro/devkitARM" >> $HOME/.bashrc
|
||||
echo "export CC=/usr/bin/clang" >> $HOME/.bashrc
|
||||
echo "export CXX=/usr/bin/clang++" >> $HOME/.bashrc
|
||||
fi
|
||||
|
||||
exec "$@"
|
89
util/devenv/pacman.conf
Normal file
89
util/devenv/pacman.conf
Normal file
@ -0,0 +1,89 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
# See the pacman.conf(5) manpage for option and repository directives
|
||||
|
||||
#
|
||||
# GENERAL OPTIONS
|
||||
#
|
||||
[options]
|
||||
# The following paths are commented out with their default values listed.
|
||||
# If you wish to use different paths, uncomment and update the paths.
|
||||
#RootDir = /
|
||||
#DBPath = /var/lib/pacman/
|
||||
#CacheDir = /var/cache/pacman/pkg/
|
||||
#LogFile = /var/log/pacman.log
|
||||
#GPGDir = /etc/pacman.d/gnupg/
|
||||
#HookDir = /etc/pacman.d/hooks/
|
||||
HoldPkg = pacman glibc
|
||||
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
|
||||
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
|
||||
#CleanMethod = KeepInstalled
|
||||
Architecture = auto
|
||||
|
||||
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
|
||||
#IgnorePkg =
|
||||
#IgnoreGroup =
|
||||
|
||||
#NoUpgrade =
|
||||
#NoExtract =
|
||||
|
||||
# Misc options
|
||||
#UseSyslog
|
||||
#Color
|
||||
#TotalDownload
|
||||
CheckSpace
|
||||
#VerbosePkgLists
|
||||
|
||||
# PGP signature checking
|
||||
#SigLevel = Optional
|
||||
#LocalFileSigLevel = Optional
|
||||
#RemoteFileSigLevel = Optional
|
||||
|
||||
#
|
||||
# REPOSITORIES
|
||||
# - can be defined here or included from another file
|
||||
# - pacman will search repositories in the order defined here
|
||||
# - local/custom mirrors can be added here or in separate files
|
||||
# - repositories listed first will take precedence when packages
|
||||
# have identical names, regardless of version number
|
||||
# - URLs will have $repo replaced by the name of the current repo
|
||||
# - URLs will have $arch replaced by the name of the architecture
|
||||
#
|
||||
# Repository entries are of the format:
|
||||
# [repo-name]
|
||||
# Server = ServerName
|
||||
# Include = IncludePath
|
||||
#
|
||||
# The header [repo-name] is crucial - it must be present and
|
||||
# uncommented to enable the repo.
|
||||
#
|
||||
|
||||
# An example of a disabled remote package repository with multiple servers
|
||||
# available. To enable, uncomment the following lines. You can add preferred
|
||||
# servers immediately after the header and they will be used before the
|
||||
# default mirrors.
|
||||
#[core]
|
||||
#SigLevel = Required
|
||||
#Server = ftp://ftp.example.com/foobar/$repo/os/$arch/
|
||||
# The file referenced here should contain a list of 'Server = ' lines.
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
# An example of a custom package repository. See the pacman manpage for
|
||||
# tips on creating your own repositories.
|
||||
#[custom]
|
||||
#SigLevel = Optional TrustAll
|
||||
#Server = file:///home/custompkgs
|
||||
#[core]
|
||||
#SigLevel = Required DatabaseOptional
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
#
|
||||
#[extra]
|
||||
#SigLevel = Required DatabaseOptional
|
||||
#Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[dkp-libs]
|
||||
Server = https://downloads.devkitpro.org/packages
|
||||
|
||||
[dkp-linux]
|
||||
Server = https://downloads.devkitpro.org/packages/linux/$arch/
|
9
util/devenv/sudoers
Normal file
9
util/devenv/sudoers
Normal file
@ -0,0 +1,9 @@
|
||||
##
|
||||
## User privilege specification
|
||||
##
|
||||
root ALL=(ALL) ALL
|
||||
%wheel ALL=(ALL) ALL
|
||||
user ALL=NOPASSWD: ALL
|
||||
|
||||
# Long timeout
|
||||
Defaults env_reset,timestamp_timeout=9999999999
|
39
util/scripts/pkg-gba.py
Executable file
39
util/scripts/pkg-gba.py
Executable file
@ -0,0 +1,39 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
#
|
||||
# Copyright 2016 - 2023 gary@drinkingtea.net
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
os = platform.system().lower()
|
||||
arch = platform.machine()
|
||||
host_env = f'{os}-{arch}'
|
||||
|
||||
# get current build type
|
||||
with open(".current_build", "r") as f:
|
||||
current_build = f.readlines()[0]
|
||||
if current_build[len(current_build) - 1] == '\n':
|
||||
current_build = current_build[:len(current_build) - 1]
|
||||
|
||||
project_dir = sys.argv[1]
|
||||
project_name = sys.argv[2]
|
||||
bin = f'./build/{host_env}-{current_build}/bin/'
|
||||
project_bin = f'build/gba-release/bin/{project_name}.bin'
|
||||
project_gba = f'{project_name}.gba'
|
||||
project_manifest = f'{project_name}-manifest.json'
|
||||
|
||||
shutil.copyfile(project_bin, project_gba)
|
||||
subprocess.run([
|
||||
f'{bin}/{project_name}-pack',
|
||||
'-src', project_dir,
|
||||
'-rom-bin', project_gba,
|
||||
'-manifest', project_manifest])
|
||||
subprocess.run(['gbafix', project_gba])
|
Reference in New Issue
Block a user