Compare commits
26 Commits
56fc90dddb
...
v0.1.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
| 518969e2c9 | |||
| 3b4d6cee18 | |||
| 5901e3e317 | |||
| 44c8ab3212 | |||
| 36660bcf38 | |||
| caafc898f3 | |||
| 797197b562 | |||
| 74e192bb05 | |||
| d3f2aee3c3 | |||
| 35f1d46e81 | |||
| 5959c1229f | |||
| 7aeb3ab967 | |||
| 57bd32ea77 | |||
| 4107bf9df4 | |||
| fe004342de | |||
| 9eb5f90a2e | |||
| 9a1e45f9e3 | |||
| ac01f7f2aa | |||
| b979f9a579 | |||
| 0aa4ab377c | |||
| a644c84827 | |||
| 20af74f962 | |||
|
|
aae31f8a25 | ||
|
|
1e3ba6c54c | ||
|
74bc3a4d42
|
|||
|
f3ee885fa2
|
@@ -2,7 +2,8 @@ name: Build
|
||||
run-name: Building docker container.
|
||||
on:
|
||||
push:
|
||||
branches: stable
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -13,10 +14,14 @@ jobs:
|
||||
- name: Gather dependencies.
|
||||
run: apt install -y docker.io
|
||||
- name: Log into Docker registry.
|
||||
run: "echo ${{secrets.QUIK_API_KEY}} > docker login -u themixedupstuff --password-stdin git.mixedup.dev"
|
||||
run: "echo ${{secrets.REFUEL_API_KEY}} | docker login -u ${{vars.DOCKER_USER_NAME}} --password-stdin git.mixedup.dev"
|
||||
- name: Check repository out.
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Docker Image
|
||||
run: docker build -t git.mixedup.dev/QUIK/docker-cross-compiler .
|
||||
run: "docker build -t git.mixedup.dev/refuel/docker-cross-compiler:${{gitea.ref_name}} ."
|
||||
- name: Upload Docker Image
|
||||
name: docker push git.mixedup.dev/QUIK/docker-cross-compiler
|
||||
run: "docker push git.mixedup.dev/refuel/docker-cross-compiler:${{gitea.ref_name}}"
|
||||
- name: Alias image as latest and push.
|
||||
run: |
|
||||
docker tag git.mixedup.dev/refuel/docker-cross-compiler:${{gitea.ref_name}} git.mixedup.dev/refuel/docker-cross-compiler:latest && \
|
||||
docker push git.mixedup.dev/refuel/docker-cross-compiler:latest
|
||||
|
||||
28
Dockerfile
28
Dockerfile
@@ -26,40 +26,56 @@ RUN echo docker_cross_compiler > /etc/hostname
|
||||
cmake \
|
||||
clang \
|
||||
cpio \
|
||||
curl \
|
||||
dotnet-sdk-6.0 \
|
||||
gcc-arm-linux-gnueabihf \
|
||||
gcc-aarch64-linux-gnu \
|
||||
gcc-i686-linux-gnu \
|
||||
git \
|
||||
libbz2-dev \
|
||||
libharfbuzz-dev \
|
||||
libpng-dev \
|
||||
libssl-dev \
|
||||
libxml2-dev \
|
||||
llvm \
|
||||
lzma-dev \
|
||||
mingw-w64 \
|
||||
meson \
|
||||
nuget \
|
||||
ninja-build \
|
||||
nodejs \
|
||||
patch \
|
||||
python3 \
|
||||
uuid \
|
||||
xz-utils \
|
||||
zlib1g-dev
|
||||
|
||||
# Clone osxcross
|
||||
# Let's do this later.
|
||||
# RUN git clone https://github.com/tpoechtrager/osxcross.git osxcross
|
||||
RUN git clone --recurse-submodules "https://github.com/tpoechtrager/osxcross.git" osxcross
|
||||
|
||||
# Download packaged SDK from this random github (very safe i know)
|
||||
WORKDIR /root/osxcross/tarballs
|
||||
RUN wget "https://github.com/joseluisq/macosx-sdks/releases/download/14.0/MacOSX14.0.sdk.tar.xz" -O "MacOSX14.0.sdk.tar.xz"
|
||||
|
||||
WORKDIR /root/osxcross
|
||||
ENV UNATTENDED=1 TARGET_DIR=/usr/local SDK_DIR=/usr/local/osxcross-sdk
|
||||
RUN bash -c "./build.sh"
|
||||
|
||||
# Setup interactive shell.
|
||||
# Setup sudo. Remove password prompt for group "wheel".
|
||||
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/quik_sudo_conf
|
||||
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/refuel_sudo_conf
|
||||
|
||||
# Create a default user and switch.
|
||||
RUN adduser --comment "" --disabled-password quik
|
||||
USER quik
|
||||
WORKDIR /home/quik
|
||||
RUN adduser --comment "" --disabled-password refuel
|
||||
RUN addgroup wheel
|
||||
RUN usermod -aG wheel refuel
|
||||
USER refuel
|
||||
WORKDIR /home/refuel
|
||||
|
||||
# Copy bashrc
|
||||
RUN cp /etc/bash.bashrc ~/.bashrc
|
||||
RUN echo source $HOME/src/sh/bashrc.sh >> ~/.bashrc
|
||||
COPY sh/bashrc.sh /home/refuel/.bashrc
|
||||
|
||||
# Execute an interactive shell.
|
||||
CMD bash
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# QUIK Toolchain file for Linux-arm systems.
|
||||
# ReFuel Toolchain file for Linux-arm systems.
|
||||
# Copyright (C) 2023
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# QUIK Toolchain file for Linux-arm64 (aarch64) systems.
|
||||
# ReFuel Toolchain file for Linux-arm64 (aarch64) systems.
|
||||
# Copyright (C) 2023
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# QUIK Toolchain file for Linux-x64 (amd64) systems.
|
||||
# ReFuel Toolchain file for Linux-x64 (amd64) systems.
|
||||
# Copyright (C) 2023
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# QUIK Toolchain file for Linux-x86 (i386) systems.
|
||||
# ReFuel Toolchain file for Linux-x86 (i386) systems.
|
||||
# Copyright (C) 2023
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
|
||||
14
cmake/osx-arm64.cmake
Normal file
14
cmake/osx-arm64.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
# ReFuel Toolchain file for OSX-ARM64 systems.
|
||||
# Copyright (C) 2024
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
set(CMAKE_C_COMPILER aarch64-apple-darwin23-clang)
|
||||
set(CMAKE_CXX_COMPILER aarch64-apple-darwin23-clang++)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH "/usr/local/SDK/MacOSX14.0.sdk/usr"
|
||||
"/usr/local/SDK/MacOSX14.0.sdk/System")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
14
cmake/osx-x64.cmake
Normal file
14
cmake/osx-x64.cmake
Normal file
@@ -0,0 +1,14 @@
|
||||
# ReFuel Toolchain file for OSX-ARM64 systems.
|
||||
# Copyright (C) 2024
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
|
||||
set(CMAKE_C_COMPILER x86_64-apple-darwin23-clang)
|
||||
set(CMAKE_CXX_COMPILER x86_64-apple-darwin23-clang++)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH "/usr/local/SDK/MacOSX14.0.sdk/usr"
|
||||
"/usr/local/SDK/MacOSX14.0.sdk/System")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
@@ -1,4 +1,4 @@
|
||||
# QUIK Toolchain file for Windows-x64 systems.
|
||||
# ReFuel Toolchain file for Windows-x64 systems.
|
||||
# Copyright (C) 2023
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# QUIK Toolchain file for Windows-x86 systems.
|
||||
# ReFuel Toolchain file for Windows-x86 systems.
|
||||
# Copyright (C) 2023
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
|
||||
54
include/rf_common.h
Normal file
54
include/rf_common.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef _REFUEL_COMMON_H_
|
||||
#define _REFUEL_COMMON_H_
|
||||
|
||||
#include "stdlib.h"
|
||||
#include "stdio.h"
|
||||
|
||||
#if __GNUC__ || _MSC_VER
|
||||
#define __REFUEL_FUNCTION__ __FUNCTION__
|
||||
#else
|
||||
#define __REFUEL_FUNCTION__ NULL
|
||||
#endif
|
||||
|
||||
#if WIN32 || _MSC_VER > 0 || __MINGW__
|
||||
#define RFEXTERN __declspec(dllexport)
|
||||
#else
|
||||
#define RFEXTERN
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Callback for failed assert function for QUIK redist libraries.
|
||||
* @param[in] expr The expression that failed.
|
||||
* @param[in] file The failing file (if available)
|
||||
* @param[in] line The failing line number (if available)
|
||||
* @param[in] func The failing function (if available)
|
||||
*/
|
||||
typedef void (*rf_failed_assert_cb_t)(const char *expr, const char *file, int line, const char* func);
|
||||
|
||||
#define DECLARE_ASSERT_CB(NAME) \
|
||||
RFEXTERN rf_failed_assert_cb_t NAME##_failed_assert
|
||||
#define DECLARE_ASSERT_STORE(NAME) \
|
||||
RFEXTERN void NAME##_failed_assert_store(rf_failed_assert_cb_t cb)
|
||||
|
||||
#define DEFINE_ASSERT_CB(NAME) \
|
||||
rf_failed_assert_cb_t NAME##_failed_assert
|
||||
#define DEFINE_ASSERT_STORE(NAME) \
|
||||
void NAME##_failed_assert_store(rf_failed_assert_cb_t cb) { \
|
||||
NAME##_failed_assert = cb != NULL ? cb : rf_default_assert; \
|
||||
}
|
||||
|
||||
#define REFUEL_DECLARE_LIB(NAME) \
|
||||
DECLARE_ASSERT_CB(NAME); \
|
||||
DECLARE_ASSERT_STORE(NAME);
|
||||
|
||||
#define REFUEL_DEFINE_LIB(NAME) \
|
||||
DEFINE_ASSERT_CB(NAME); \
|
||||
DEFINE_ASSERT_STORE(NAME);
|
||||
|
||||
inline static void rf_default_assert(const char *expr, const char *file, int line, const char *function)
|
||||
{
|
||||
fprintf(stderr, "Assert failed at %s:%d in %s()\n %s", file, line, function, expr);
|
||||
abort();
|
||||
}
|
||||
|
||||
#endif
|
||||
1
sh/.gitattributes
vendored
Normal file
1
sh/.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.sh text eof=lf
|
||||
@@ -1,5 +1,4 @@
|
||||
source $HOME/src/sh/init.sh
|
||||
echo QUIK Project Copyright \(C\) 2023
|
||||
echo ReFuel Project - Copyright \(C\) 2023
|
||||
echo
|
||||
echo This is an interactive shell for QUIK build image.
|
||||
echo This is an interactive shell for ReFuel build image.
|
||||
echo SuperUser \(su/sudo\) commands are enabled without a password. Beware.
|
||||
|
||||
20
sh/quik_build_native.sh → sh/build_native.sh
Normal file → Executable file
20
sh/quik_build_native.sh → sh/build_native.sh
Normal file → Executable file
@@ -3,6 +3,7 @@
|
||||
# $1 Source path of the project.
|
||||
# $2 Target architecture list.
|
||||
# DST is the destination directory.
|
||||
# NOINSTALL = 1 to skip installing.
|
||||
|
||||
SRC=$1
|
||||
ARCHS=$2
|
||||
@@ -15,7 +16,7 @@ fi
|
||||
|
||||
if [ -z "$ARCHS" ]
|
||||
then
|
||||
ARCHS="linux-arm linux-arm64 linux-x64 win-x64 win-x86"
|
||||
ARCHS="linux-arm linux-arm64 linux-x64 win-x64 win-x86 osx-arm64 osx-x64"
|
||||
fi
|
||||
|
||||
if [ -z "$DST" ]
|
||||
@@ -23,13 +24,18 @@ then
|
||||
DST=$PWD
|
||||
fi
|
||||
|
||||
if [ -z "$CMAKE_DIR"]
|
||||
then
|
||||
CMAKE_DIR="$SRC/docker-cross-compiler/cmake"
|
||||
fi
|
||||
|
||||
for ARCH in $ARCHS; do
|
||||
# Output directory.
|
||||
PREFIX=$DST/runtimes/$ARCH/native
|
||||
# Build directory.
|
||||
BUILD=$DST/out/$ARCH
|
||||
# Cmake toolchain file.
|
||||
TOOLCHAIN=$DST/../cmake/$ARCH.cmake
|
||||
TOOLCHAIN=$CMAKE_DIR/$ARCH.cmake
|
||||
|
||||
# Create directories.
|
||||
mkdir -p $PREFIX $BUILD
|
||||
@@ -37,13 +43,15 @@ for ARCH in $ARCHS; do
|
||||
cmake -B $BUILD -S $SRC \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_C_FLAGS=-static-libgcc \
|
||||
-DCMAKE_CXX_FLAGS=-static-libgcc \
|
||||
-DCMAKE_INSTALL_PREFIX=$PREFIX \
|
||||
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN \
|
||||
$QUIK_ADDITIONAL_CMAKE
|
||||
$REFUEL_ADDITIONAL_CMAKE
|
||||
|
||||
# Build and install.
|
||||
ninja -C $BUILD all
|
||||
ninja -C $BUILD install
|
||||
|
||||
if [ ! $NOINSTALL ]
|
||||
then
|
||||
ninja -C $BUILD install
|
||||
fi
|
||||
done
|
||||
30
sh/publish.sh
Normal file
30
sh/publish.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
if [-z "$1"]
|
||||
then
|
||||
$1 = $(dirname "$0")
|
||||
fi
|
||||
|
||||
if [ -z "$NUGET_API_KEY" ]
|
||||
then
|
||||
echo "Please define NUGET_API_KEY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$NUGET_USER_NAME" ]
|
||||
then
|
||||
echo "Please define NUGET_USER_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$NUGET_INDEX" ]
|
||||
then
|
||||
echo "Please define NUGET_INDEX"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $1
|
||||
dotnet nuget add source \
|
||||
-n ReFuel -u "$NUGET_USER_NAME" -p "$NUGET_API_KEY" \
|
||||
--store-password-in-clear-text \
|
||||
"$NUGET_INDEX"
|
||||
dotnet nuget push -s ReFuel bin/*/*.nupkg
|
||||
Reference in New Issue
Block a user