From ac01f7f2aaa50f3270c6a476239c2bb546c33cd5 Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Tue, 19 Mar 2024 18:17:44 +0300 Subject: [PATCH 1/3] [v1.0] Add automatic build action. Try adding secrets to the workflow script. Fix workflow. Fix typo. fix docker name conflict. Removed cmake files from this repository and added node and meson to the apt packages list. Update .gitea/workflows/build.yaml node -> nodejs --- .gitea/workflows/build.yaml | 22 +++++++++++++++++ Dockerfile | 2 ++ cmake/linux-arm.cmake | 13 ---------- cmake/linux-arm64.cmake | 13 ---------- cmake/linux-x64.cmake | 9 ------- cmake/linux-x86.cmake | 14 ----------- cmake/win-x64.cmake | 14 ----------- cmake/win-x86.cmake | 14 ----------- sh/quik_build_native.sh | 49 ------------------------------------- 9 files changed, 24 insertions(+), 126 deletions(-) create mode 100644 .gitea/workflows/build.yaml delete mode 100644 cmake/linux-arm.cmake delete mode 100644 cmake/linux-arm64.cmake delete mode 100644 cmake/linux-x64.cmake delete mode 100644 cmake/linux-x86.cmake delete mode 100644 cmake/win-x64.cmake delete mode 100644 cmake/win-x86.cmake delete mode 100644 sh/quik_build_native.sh diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..ec8f54b --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,22 @@ +name: Build +run-name: Building docker container. +on: + push: + branches: stable + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Update Package Repository. + run: apt update -y + - 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" + - name: Check repository out. + uses: actions/checkout@v3 + - name: Build Docker Image + run: docker build -t git.mixedup.dev/quik/docker-cross-compiler . + - name: Upload Docker Image + run: docker push git.mixedup.dev/quik/docker-cross-compiler diff --git a/Dockerfile b/Dockerfile index 4ce945f..6b25077 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,8 +37,10 @@ RUN echo docker_cross_compiler > /etc/hostname libxml2-dev \ lzma-dev \ mingw-w64 \ + meson \ nuget \ ninja-build \ + nodejs \ patch \ python3 \ xz-utils \ diff --git a/cmake/linux-arm.cmake b/cmake/linux-arm.cmake deleted file mode 100644 index a973557..0000000 --- a/cmake/linux-arm.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# QUIK Toolchain file for Linux-arm systems. -# Copyright (C) 2023 - -set(CMAKE_SYSTEM_NAME Linux) - -set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) -set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) - -set(CMAKE_FIND_ROOT_PATH "/usr/arm-linux-gnueabihf") - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/linux-arm64.cmake b/cmake/linux-arm64.cmake deleted file mode 100644 index 5008591..0000000 --- a/cmake/linux-arm64.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# QUIK Toolchain file for Linux-arm64 (aarch64) systems. -# Copyright (C) 2023 - -set(CMAKE_SYSTEM_NAME Linux) - -set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) -set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) - -set(CMAKE_FIND_ROOT_PATH "/usr/aarch64-linux-gnu") - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/linux-x64.cmake b/cmake/linux-x64.cmake deleted file mode 100644 index 1366483..0000000 --- a/cmake/linux-x64.cmake +++ /dev/null @@ -1,9 +0,0 @@ -# QUIK Toolchain file for Linux-x64 (amd64) systems. -# Copyright (C) 2023 - -set(CMAKE_SYSTEM_NAME Linux) - -set(CMAKE_C_COMPILER gcc) -set(CMAKE_CXX_COMPILER g++) - -add_compile_options(-m64) diff --git a/cmake/linux-x86.cmake b/cmake/linux-x86.cmake deleted file mode 100644 index 2f2a27b..0000000 --- a/cmake/linux-x86.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# QUIK Toolchain file for Linux-x86 (i386) systems. -# Copyright (C) 2023 - -set(CMAKE_SYSTEM_NAME Linux) - -set(CMAKE_C_COMPILER i686-linux-gnu-gcc) -set(CMAKE_CXX_COMPILER i686-linux-gnu-g++) - -add_compile_options(-m32 -march=i686) - -set(CMAKE_FIND_ROOT_PATH "/usr/i686-linux-gnu") -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/win-x64.cmake b/cmake/win-x64.cmake deleted file mode 100644 index 7224a0d..0000000 --- a/cmake/win-x64.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# QUIK Toolchain file for Windows-x64 systems. -# Copyright (C) 2023 - -set(CMAKE_SYSTEM_NAME Windows) - -set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) -set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) - -set(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") -add_compile_options(-m64) - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/win-x86.cmake b/cmake/win-x86.cmake deleted file mode 100644 index 1808cc4..0000000 --- a/cmake/win-x86.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# QUIK Toolchain file for Windows-x86 systems. -# Copyright (C) 2023 - -set(CMAKE_SYSTEM_NAME Windows) - -set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) -set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) - -set(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") -add_compile_options(-m32) - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/sh/quik_build_native.sh b/sh/quik_build_native.sh deleted file mode 100644 index cc5b191..0000000 --- a/sh/quik_build_native.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# $1 Source path of the project. -# $2 Target architecture list. -# DST is the destination directory. - -SRC=$1 -ARCHS=$2 - -if [ -z "$SRC" ] -then - echo You need to provide a source path. - return -fi - -if [ -z "$ARCHS" ] -then - ARCHS="linux-arm linux-arm64 linux-x64 win-x64 win-x86" -fi - -if [ -z "$DST" ] -then - DST=$PWD -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 - - # Create directories. - mkdir -p $PREFIX $BUILD - # Configure CMAKE. - 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 - - # Build and install. - ninja -C $BUILD all - ninja -C $BUILD install -done From fe004342dec3d54d0f373a0d103090a850be84e6 Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Thu, 13 Jun 2024 20:49:00 +0300 Subject: [PATCH 2/3] Reintroduce build essentials into this repository. --- cmake/linux-arm.cmake | 13 +++++++++ cmake/linux-arm64.cmake | 13 +++++++++ cmake/linux-x64.cmake | 9 +++++++ cmake/linux-x86.cmake | 14 ++++++++++ cmake/osx-arm64.cmake | 14 ++++++++++ cmake/osx-x64.cmake | 14 ++++++++++ cmake/win-x64.cmake | 14 ++++++++++ cmake/win-x86.cmake | 14 ++++++++++ include/quik_common.h | 52 ++++++++++++++++++++++++++++++++++++ sh/.gitattributes | 1 + sh/publish.sh | 18 +++++++++++++ sh/quik_build_native.sh | 59 +++++++++++++++++++++++++++++++++++++++++ 12 files changed, 235 insertions(+) create mode 100644 cmake/linux-arm.cmake create mode 100644 cmake/linux-arm64.cmake create mode 100644 cmake/linux-x64.cmake create mode 100644 cmake/linux-x86.cmake create mode 100644 cmake/osx-arm64.cmake create mode 100644 cmake/osx-x64.cmake create mode 100644 cmake/win-x64.cmake create mode 100644 cmake/win-x86.cmake create mode 100644 include/quik_common.h create mode 100644 sh/.gitattributes create mode 100644 sh/publish.sh create mode 100644 sh/quik_build_native.sh diff --git a/cmake/linux-arm.cmake b/cmake/linux-arm.cmake new file mode 100644 index 0000000..a973557 --- /dev/null +++ b/cmake/linux-arm.cmake @@ -0,0 +1,13 @@ +# QUIK Toolchain file for Linux-arm systems. +# Copyright (C) 2023 + +set(CMAKE_SYSTEM_NAME Linux) + +set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) +set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) + +set(CMAKE_FIND_ROOT_PATH "/usr/arm-linux-gnueabihf") + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/linux-arm64.cmake b/cmake/linux-arm64.cmake new file mode 100644 index 0000000..5008591 --- /dev/null +++ b/cmake/linux-arm64.cmake @@ -0,0 +1,13 @@ +# QUIK Toolchain file for Linux-arm64 (aarch64) systems. +# Copyright (C) 2023 + +set(CMAKE_SYSTEM_NAME Linux) + +set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) + +set(CMAKE_FIND_ROOT_PATH "/usr/aarch64-linux-gnu") + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/linux-x64.cmake b/cmake/linux-x64.cmake new file mode 100644 index 0000000..1366483 --- /dev/null +++ b/cmake/linux-x64.cmake @@ -0,0 +1,9 @@ +# QUIK Toolchain file for Linux-x64 (amd64) systems. +# Copyright (C) 2023 + +set(CMAKE_SYSTEM_NAME Linux) + +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_COMPILER g++) + +add_compile_options(-m64) diff --git a/cmake/linux-x86.cmake b/cmake/linux-x86.cmake new file mode 100644 index 0000000..2f2a27b --- /dev/null +++ b/cmake/linux-x86.cmake @@ -0,0 +1,14 @@ +# QUIK Toolchain file for Linux-x86 (i386) systems. +# Copyright (C) 2023 + +set(CMAKE_SYSTEM_NAME Linux) + +set(CMAKE_C_COMPILER i686-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER i686-linux-gnu-g++) + +add_compile_options(-m32 -march=i686) + +set(CMAKE_FIND_ROOT_PATH "/usr/i686-linux-gnu") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/osx-arm64.cmake b/cmake/osx-arm64.cmake new file mode 100644 index 0000000..b708f77 --- /dev/null +++ b/cmake/osx-arm64.cmake @@ -0,0 +1,14 @@ +# QUIK Toolchain file for OSX-ARM64 systems. +# Copyright (C) 2024 + +set(CMAKE_SYSTEM_NAME OSX) + +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) diff --git a/cmake/osx-x64.cmake b/cmake/osx-x64.cmake new file mode 100644 index 0000000..5af58d8 --- /dev/null +++ b/cmake/osx-x64.cmake @@ -0,0 +1,14 @@ +# QUIK Toolchain file for OSX-ARM64 systems. +# Copyright (C) 2024 + +set(CMAKE_SYSTEM_NAME OSX) + +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) diff --git a/cmake/win-x64.cmake b/cmake/win-x64.cmake new file mode 100644 index 0000000..7224a0d --- /dev/null +++ b/cmake/win-x64.cmake @@ -0,0 +1,14 @@ +# QUIK Toolchain file for Windows-x64 systems. +# Copyright (C) 2023 + +set(CMAKE_SYSTEM_NAME Windows) + +set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) + +set(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") +add_compile_options(-m64) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/win-x86.cmake b/cmake/win-x86.cmake new file mode 100644 index 0000000..1808cc4 --- /dev/null +++ b/cmake/win-x86.cmake @@ -0,0 +1,14 @@ +# QUIK Toolchain file for Windows-x86 systems. +# Copyright (C) 2023 + +set(CMAKE_SYSTEM_NAME Windows) + +set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) + +set(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") +add_compile_options(-m32) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/include/quik_common.h b/include/quik_common.h new file mode 100644 index 0000000..055f48c --- /dev/null +++ b/include/quik_common.h @@ -0,0 +1,52 @@ +#ifndef _QUIK_COMMON_H_ +#define _QUIK_COMMON_H_ + +#include "stdlib.h" + +#if __GNUC__ || _MSC_VER + #define __QUIK_FUNCTION__ __FUNCTION__ +#else + #define __QUIK_FUNCTION__ NULL +#endif + +#if WIN32 || _MSC_VER > 0 || __MINGW__ + #define QEXTERN __declspec(dllexport) +#else + #define QEXTERN +#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 (*quik_failed_assert_cb_t)(const char *expr, const char *file, int line, const char* func); + +#define DECLARE_ASSERT_CB(NAME) \ + QEXTERN quik_failed_assert_cb_t NAME##_failed_assert +#define DECLARE_ASSERT_STORE(NAME) \ + QEXTERN void NAME##_failed_assert_store(quik_failed_assert_cb_t cb) + +#define DEFINE_ASSERT_CB(NAME) \ + quik_failed_assert_cb_t NAME##_failed_assert +#define DEFINE_ASSERT_STORE(NAME) \ + void NAME##_failed_assert_store(quik_failed_assert_cb_t cb) { \ + NAME##_failed_assert = cb != NULL ? cb : quik_default_assert; \ + } + +#define QUIK_DECLARE_LIB(NAME) \ + DECLARE_ASSERT_CB(NAME); \ + DECLARE_ASSERT_STORE(NAME); + +#define QUIK_DEFINE_LIB(NAME) \ + DEFINE_ASSERT_CB(NAME); \ + DEFINE_ASSERT_STORE(NAME); + +inline static void quik_default_assert(const char *expr, const char *file, int line, const char *function) +{ + abort(); +} + +#endif diff --git a/sh/.gitattributes b/sh/.gitattributes new file mode 100644 index 0000000..f7a4cb0 --- /dev/null +++ b/sh/.gitattributes @@ -0,0 +1 @@ +*.sh text eof=lf \ No newline at end of file diff --git a/sh/publish.sh b/sh/publish.sh new file mode 100644 index 0000000..40d69d0 --- /dev/null +++ b/sh/publish.sh @@ -0,0 +1,18 @@ +#!/bin/bash +if [-z "$1"] +then + $1 = $(dirname "$0") +fi + +if [ -z "$QUIK_API_KEY" ] +then + echo "Please define QUIK_API_KEY" + exit 1 +fi + +cd $1 +dotnet nuget add source \ + -n QUIK -u themixedupstuff -p "$QUIK_API_KEY" \ + --store-password-in-clear-text \ + https://git.mixedup.dev/api/packages/QUIK/nuget/index.json +dotnet nuget push -s QUIK bin/*/*.nupkg diff --git a/sh/quik_build_native.sh b/sh/quik_build_native.sh new file mode 100644 index 0000000..ca6cf16 --- /dev/null +++ b/sh/quik_build_native.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# $1 Source path of the project. +# $2 Target architecture list. +# DST is the destination directory. +# NOINSTALL = 1 to skip installing. + +SRC=$1 +ARCHS=$2 + +if [ -z "$SRC" ] +then + echo You need to provide a source path. + return +fi + +if [ -z "$ARCHS" ] +then + ARCHS="linux-arm linux-arm64 linux-x64 win-x64 win-x86" +fi + +if [ -z "$DST" ] +then + DST=$PWD +fi + +if [ -z "$CMAKE_DIR"] +then + CMAKE_DIR="$SRC/Quik.Common/cmake" +fi + +for ARCH in $ARCHS; do + # Output directory. + PREFIX=$DST/runtimes/$ARCH/native + # Build directory. + BUILD=$DST/out/$ARCH + # Cmake toolchain file. + TOOLCHAIN=$CMAKE_DIR/$ARCH.cmake + + # Create directories. + mkdir -p $PREFIX $BUILD + # Configure CMAKE. + 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 + + # Build and install. + ninja -C $BUILD all + + if [ ! $NOINSTALL ] + then + ninja -C $BUILD install + fi +done From 4107bf9df48fb21c6c14c71f33e2ec6904d2f076 Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Thu, 13 Jun 2024 20:57:08 +0300 Subject: [PATCH 3/3] Rebrand as ReFuel. --- Dockerfile | 12 ++--- cmake/linux-arm.cmake | 2 +- cmake/linux-arm64.cmake | 2 +- cmake/linux-x64.cmake | 2 +- cmake/linux-x86.cmake | 2 +- cmake/osx-arm64.cmake | 2 +- cmake/osx-x64.cmake | 2 +- cmake/win-x64.cmake | 2 +- cmake/win-x86.cmake | 2 +- include/quik_common.h | 52 ------------------- include/rf_common.h | 54 ++++++++++++++++++++ sh/bashrc.sh | 4 +- sh/{quik_build_native.sh => build_native.sh} | 2 +- sh/publish.sh | 20 ++++++-- 14 files changed, 87 insertions(+), 73 deletions(-) delete mode 100644 include/quik_common.h create mode 100644 include/rf_common.h rename sh/{quik_build_native.sh => build_native.sh} (95%) diff --git a/Dockerfile b/Dockerfile index 19f8bff..fe7441c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,18 +64,18 @@ RUN echo docker_cross_compiler > /etc/hostname # 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 + RUN adduser --comment "" --disabled-password refuel RUN addgroup wheel - RUN usermod -aG wheel quik - USER quik - WORKDIR /home/quik + RUN usermod -aG wheel refuel + USER refuel + WORKDIR /home/refuel # Copy bashrc RUN cp /etc/bash.bashrc ~/.bashrc - COPY sh/bashrc.sh /home/quik/.bashrc + COPY sh/bashrc.sh /home/refuel/.bashrc # Execute an interactive shell. CMD bash diff --git a/cmake/linux-arm.cmake b/cmake/linux-arm.cmake index a973557..a5651bb 100644 --- a/cmake/linux-arm.cmake +++ b/cmake/linux-arm.cmake @@ -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) diff --git a/cmake/linux-arm64.cmake b/cmake/linux-arm64.cmake index 5008591..378c9b8 100644 --- a/cmake/linux-arm64.cmake +++ b/cmake/linux-arm64.cmake @@ -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) diff --git a/cmake/linux-x64.cmake b/cmake/linux-x64.cmake index 1366483..913664b 100644 --- a/cmake/linux-x64.cmake +++ b/cmake/linux-x64.cmake @@ -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) diff --git a/cmake/linux-x86.cmake b/cmake/linux-x86.cmake index 2f2a27b..9ad5b01 100644 --- a/cmake/linux-x86.cmake +++ b/cmake/linux-x86.cmake @@ -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) diff --git a/cmake/osx-arm64.cmake b/cmake/osx-arm64.cmake index b708f77..9ff796d 100644 --- a/cmake/osx-arm64.cmake +++ b/cmake/osx-arm64.cmake @@ -1,4 +1,4 @@ -# QUIK Toolchain file for OSX-ARM64 systems. +# ReFuel Toolchain file for OSX-ARM64 systems. # Copyright (C) 2024 set(CMAKE_SYSTEM_NAME OSX) diff --git a/cmake/osx-x64.cmake b/cmake/osx-x64.cmake index 5af58d8..4b7026e 100644 --- a/cmake/osx-x64.cmake +++ b/cmake/osx-x64.cmake @@ -1,4 +1,4 @@ -# QUIK Toolchain file for OSX-ARM64 systems. +# ReFuel Toolchain file for OSX-ARM64 systems. # Copyright (C) 2024 set(CMAKE_SYSTEM_NAME OSX) diff --git a/cmake/win-x64.cmake b/cmake/win-x64.cmake index 7224a0d..c0e8c8e 100644 --- a/cmake/win-x64.cmake +++ b/cmake/win-x64.cmake @@ -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) diff --git a/cmake/win-x86.cmake b/cmake/win-x86.cmake index 1808cc4..ad70d98 100644 --- a/cmake/win-x86.cmake +++ b/cmake/win-x86.cmake @@ -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) diff --git a/include/quik_common.h b/include/quik_common.h deleted file mode 100644 index 055f48c..0000000 --- a/include/quik_common.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _QUIK_COMMON_H_ -#define _QUIK_COMMON_H_ - -#include "stdlib.h" - -#if __GNUC__ || _MSC_VER - #define __QUIK_FUNCTION__ __FUNCTION__ -#else - #define __QUIK_FUNCTION__ NULL -#endif - -#if WIN32 || _MSC_VER > 0 || __MINGW__ - #define QEXTERN __declspec(dllexport) -#else - #define QEXTERN -#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 (*quik_failed_assert_cb_t)(const char *expr, const char *file, int line, const char* func); - -#define DECLARE_ASSERT_CB(NAME) \ - QEXTERN quik_failed_assert_cb_t NAME##_failed_assert -#define DECLARE_ASSERT_STORE(NAME) \ - QEXTERN void NAME##_failed_assert_store(quik_failed_assert_cb_t cb) - -#define DEFINE_ASSERT_CB(NAME) \ - quik_failed_assert_cb_t NAME##_failed_assert -#define DEFINE_ASSERT_STORE(NAME) \ - void NAME##_failed_assert_store(quik_failed_assert_cb_t cb) { \ - NAME##_failed_assert = cb != NULL ? cb : quik_default_assert; \ - } - -#define QUIK_DECLARE_LIB(NAME) \ - DECLARE_ASSERT_CB(NAME); \ - DECLARE_ASSERT_STORE(NAME); - -#define QUIK_DEFINE_LIB(NAME) \ - DEFINE_ASSERT_CB(NAME); \ - DEFINE_ASSERT_STORE(NAME); - -inline static void quik_default_assert(const char *expr, const char *file, int line, const char *function) -{ - abort(); -} - -#endif diff --git a/include/rf_common.h b/include/rf_common.h new file mode 100644 index 0000000..a076da1 --- /dev/null +++ b/include/rf_common.h @@ -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 diff --git a/sh/bashrc.sh b/sh/bashrc.sh index 7bafa63..5b52cef 100644 --- a/sh/bashrc.sh +++ b/sh/bashrc.sh @@ -1,5 +1,5 @@ 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. diff --git a/sh/quik_build_native.sh b/sh/build_native.sh similarity index 95% rename from sh/quik_build_native.sh rename to sh/build_native.sh index ca6cf16..cf1dbf7 100644 --- a/sh/quik_build_native.sh +++ b/sh/build_native.sh @@ -26,7 +26,7 @@ fi if [ -z "$CMAKE_DIR"] then - CMAKE_DIR="$SRC/Quik.Common/cmake" + CMAKE_DIR="$SRC/docker-cross-compiler/cmake" fi for ARCH in $ARCHS; do diff --git a/sh/publish.sh b/sh/publish.sh index 40d69d0..90ba63c 100644 --- a/sh/publish.sh +++ b/sh/publish.sh @@ -4,15 +4,27 @@ then $1 = $(dirname "$0") fi -if [ -z "$QUIK_API_KEY" ] +if [ -z "$NUGET_API_KEY" ] then echo "Please define QUIK_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 QUIK -u themixedupstuff -p "$QUIK_API_KEY" \ + -n ReFuel -u "$NUGET_USER_NAME" -p "$NUGET_API_KEY" \ --store-password-in-clear-text \ - https://git.mixedup.dev/api/packages/QUIK/nuget/index.json -dotnet nuget push -s QUIK bin/*/*.nupkg + "$NUGET_INDEX" +dotnet nuget push -s ReFuel bin/*/*.nupkg