diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ce6e85 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +# ### > generated by mulle-sde (extensions/mulle-sde/sde/init) +# Tweak GitHub language statistics + +# .inc is generally C + +*.inc linguist-language=C + +# remove boring files +.mulle/** linguist-generated +.idea/** linguist-generated +.vscode/** linguist-generated +cmake/** linguist-generated + +# ### < generated by mulle-sde (extensions/mulle-sde/sde/init) + diff --git a/.github/workflows/dockerfile-ci.yml b/.github/workflows/dockerfile-ci.yml new file mode 100644 index 0000000..c800398 --- /dev/null +++ b/.github/workflows/dockerfile-ci.yml @@ -0,0 +1,17 @@ +name: DockerfileCI + +on: [push,workflow_dispatch] + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + if: ${{ ! env.ACT }} + + - name: Build Docker image + if: ${{ ! env.ACT }} + run: docker build . + diff --git a/.github/workflows/mulle-sde-ci.yml b/.github/workflows/mulle-sde-ci.yml new file mode 100644 index 0000000..4a61b92 --- /dev/null +++ b/.github/workflows/mulle-sde-ci.yml @@ -0,0 +1,59 @@ +name: CI + +on: [push,workflow_dispatch] + +env: + BUILD_TYPE: release + OTHER_PROJECTS: "mulle-core/mulle-core-developer; +mulle-c/mulle-c-developer;" + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest] + + steps: + - name: Set MULLE_HOSTNAME + run: | + name="${GITHUB_REF##*/}" + MULLE_HOSTNAME="${MULLE_HOSTNAME:-ci-${name##*-}}" + echo "MULLE_HOSTNAME=${MULLE_HOSTNAME}" >> $GITHUB_ENV + + - name: Add to path + run: echo "$HOME/bin" >> $GITHUB_PATH + + - name: Dump Environment + run: env | sort + + - uses: actions/checkout@v3 + + - uses: mulle-sde/github-ci@v1 + + - name: List extensions + run: | + mulle-sde -DMULLE_SDE_EXTENSION_BASE_PATH="${PWD}/src" extension show + + - name: mulle-core Library + run: | + mulle-sde -DMULLE_SDE_EXTENSION_BASE_PATH="${PWD}/src" init -d lib -m mulle-core/c-developer library && + cd lib && + mulle-sde hostname && + mulle-sde environment && + echo "Adding environment-host-ci-prerelease file from MulleObjC/test" >&2 && + curl -L --output .mulle/etc/env/environment-host-ci-prerelease.sh "https://raw.githubusercontent.com/mulle-core/MulleObjC/prerelease/test/.mulle/etc/env/environment-host-ci-prerelease.sh" >&2 && + mulle-sde craft + + - name: mulle-core Executable + run: | + mulle-sde -DMULLE_SDE_EXTENSION_BASE_PATH="${PWD}/src" extension show && + mulle-sde -DMULLE_SDE_EXTENSION_BASE_PATH="${PWD}/src" init -d exe -m mulle-core/c-developer executable && + cd exe && + echo "Adding environment-host-ci-prerelease file from MulleObjC/test" >&2 && + curl -L --output .mulle/etc/env/environment-host-ci-prerelease.sh "https://raw.githubusercontent.com/mulle-core/MulleObjC/prerelease/test/.mulle/etc/env/environment-host-ci-prerelease.sh" >&2 && + mulle-sde craft --release && + [ -x "./kitchen/Release/exe" -o "./kitchen/exe" ] && + ( [ ! -x "./kitchen/Release/exe" ] || "./kitchen/Release/exe" ) && + ( [ ! -x "./kitchen/exe" ] || "./kitchen/exe" ) + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dbb5c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +.DS_Store +._.DS_Store + +publisher-info.sh +VENDOR_NAME/ +# ### > generated by mulle-sde (extensions/mulle-sde/sde/init) + +# generally /var directories are not interesting +var/ + +environment-host-*.sh +environment-user-*.sh + +# stash is generally boring +stash/ + +# build stuff is boring too +build/ +kitchen/ +dependency/ +addiction/ +*.tmp/ +tmp.*/ + +# ### < generated by mulle-sde (extensions/mulle-sde/sde/init) + +mulle-core-developer.sublime-workspace +.mulle-make-build-dir +version.old +.gdb_history +.ackrc +wilted/ +mulle-template-composer-* +mulle-markdown-preview-*.html +build-* +coverage*.html +*.gcda +*.gcno +cola/wilted/ diff --git a/.mulle/.gitignore b/.mulle/.gitignore new file mode 100644 index 0000000..711d4da --- /dev/null +++ b/.mulle/.gitignore @@ -0,0 +1,3 @@ +var/ +environment-host-*.sh +!environment-host-ci-*.sh diff --git a/.mulle/README.md b/.mulle/README.md new file mode 100644 index 0000000..4d152ff --- /dev/null +++ b/.mulle/README.md @@ -0,0 +1,25 @@ +# .mulle + +This `.mulle` folder is used by [mulle-sde](//mulle-sde.github.io) to +store project information. + +## Structure + +* `etc` is user editable, changes will be preserved. +* `share` is read only, changes will be lost on the next upgrade. +* `var` is ephemeral. You can delete and it will get recreated. + +Every mulle-sde tool may have its own subfolder within those three folders. +It's name will be the name of the tool without the "mulle-" prefix. + +You can edit the files in `etc` with any editor, but for consistency and +ease of use, it's usually better to use the appropriate mulle-sde tool. + +## Remove .mulle + +The share folder is often write protected, to prevent accidental user edits. + +``` +chmod -R ugo+rwX .mulle && rm -rf .mulle +``` + diff --git a/.mulle/etc/env/auxscope b/.mulle/etc/env/auxscope new file mode 100644 index 0000000..3128909 --- /dev/null +++ b/.mulle/etc/env/auxscope @@ -0,0 +1 @@ +project;20 diff --git a/.mulle/etc/env/environment-project.sh b/.mulle/etc/env/environment-project.sh new file mode 100644 index 0000000..bd5c5ff --- /dev/null +++ b/.mulle/etc/env/environment-project.sh @@ -0,0 +1,42 @@ +# +# +# +export PROJECT_NAME="mulle-core-developer" + + +# +# +# +export PROJECT_TYPE="extension" + + +# +# +# +export PROJECT_SOURCE_DIR="src" + + +# +# +# +export PROJECT_LANGUAGE="none" + + +# +# +# + + + +# +# +# + + + +# +# +# + + + diff --git a/.mulle/etc/env/optionaltool.darwin b/.mulle/etc/env/optionaltool.darwin new file mode 100644 index 0000000..8beb63e --- /dev/null +++ b/.mulle/etc/env/optionaltool.darwin @@ -0,0 +1 @@ +fswatch diff --git a/.mulle/etc/env/tool b/.mulle/etc/env/tool new file mode 100644 index 0000000..235d783 --- /dev/null +++ b/.mulle/etc/env/tool @@ -0,0 +1,2 @@ +cmake +cmake.exe diff --git a/.mulle/etc/env/tool.windows b/.mulle/etc/env/tool.windows new file mode 100644 index 0000000..82ae2f5 --- /dev/null +++ b/.mulle/etc/env/tool.windows @@ -0,0 +1 @@ +nmake.exe diff --git a/.mulle/etc/project/formula-info.sh b/.mulle/etc/project/formula-info.sh new file mode 100755 index 0000000..72a563d --- /dev/null +++ b/.mulle/etc/project/formula-info.sh @@ -0,0 +1,21 @@ +# -- Formula Info -- +# If you don't have this file, there will be no homebrew +# formula operations. +# +PROJECT="mulle-objc-developer" # your project/repository name +DESC="🎩 mulle-objc developer kit for mulle-sde" + +# LANGUAGE="c" # c,cpp, objc, bash ... +# NAME="${PROJECT}" # formula filename without .rb extension + +# +# Specify needed homebrew packages by name as you would when saying +# `brew install`. +# +# Use the ${DEPENDENCY_TAP} prefix for non-official dependencies. +# DEPENDENCIES and BUILD_DEPENDENCIES will be evaled later! +# So keep them single quoted. +# +DEPENDENCIES='${MULLE_C_TAP}mulle-c-developer' + +DEBIAN_DEPENDENCIES='mulle-c-developer' diff --git a/.mulle/etc/project/generate-formula.sh b/.mulle/etc/project/generate-formula.sh new file mode 100755 index 0000000..90aa711 --- /dev/null +++ b/.mulle/etc/project/generate-formula.sh @@ -0,0 +1,15 @@ +# +# Generate your `def install` `test do` lines here. echo them to stdout. +# +generate_brew_formula_build() +{ + local project="$1" + local name="$2" + local version="$3" + + cat <&2 +fi + +if [ -z "${MULLE_UNAME}" ] +then + MULLE_UNAME="`PATH=/bin:/usr/bin uname -s 2> /dev/null | tr '[:upper:]' '[:lower:]'`" + MULLE_UNAME="${MULLE_UNAME:-unknown}" + echo "Using ${MULLE_UNAME} as MULLE_UNAME for your convenience" >&2 +fi + +# +# now read in custom envionment (required) +# +. "${MULLE_VIRTUAL_ROOT}/.mulle/share/env/include-environment.sh" + +# +# basic setup for interactive shells +# +case "${MULLE_SHELL_MODE}" in + *INTERACTIVE*) + # + # Set PS1 so that we can see, that we are in a mulle-env + # + envname="`PATH=/bin:/usr/bin basename -- "${MULLE_VIRTUAL_ROOT}"`" + + case "${PS1}" in + *\\h\[*) + ;; + + *\\h*) + PS1="$(sed 's/\\h/\\h\['${envname}'\]/' <<< "${PS1}" )" + ;; + + *) + PS1='\u@\h['${envname}'] \W$ ' + ;; + esac + export PS1 + + unset envname + + # install cd catcher + if [ ! -z "${MULLE_ENV_LIBEXEC_DIR}" ] + then + . "${MULLE_ENV_LIBEXEC_DIR}/mulle-env-cd.sh" + unset MULLE_ENV_LIBEXEC_DIR + fi + + # install mulle-env-reload + + alias mulle-env-reload='. "${MULLE_VIRTUAL_ROOT}/.mulle/share/env/include-environment.sh"' + + # + # source in any bash completion files + # + DEFAULT_IFS="${IFS}" + IFS=$'\n' + # memo: nullglob not easily done on both bash and zsh + for FILENAME in "${MULLE_VIRTUAL_ROOT}/.mulle/share/env/libexec"/*-bash-completion.sh + do + if [ -f "${FILENAME}" ] + then + . "${FILENAME}" + fi + done + IFS="${DEFAULT_IFS}" + + unset DEFAULT_IFS + unset FILENAME + + vardir="${MULLE_VIRTUAL_ROOT}/.mulle/var/${MULLE_HOSTNAME:-unknown-host}" + [ -d "${vardir}" ] || mkdir -p "${vardir}" + + HISTFILE="${vardir}/bash_history" + export HISTFILE + + unset vardir + + # + # show motd, if any + # + if [ -z "${NO_MOTD}" ] + then + if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle/etc/env/motd" ] + then + cat "${MULLE_VIRTUAL_ROOT}/.mulle/etc/env/motd" + else + if [ -f "${MULLE_VIRTUAL_ROOT}/.mulle/share/env/motd" ] + then + cat "${MULLE_VIRTUAL_ROOT}/.mulle/share/env/motd" + fi + fi + fi + ;; +esac + +# remove some uglies +unset NO_MOTD +unset TRACE + +####### +### mulle startup +####### + +case "${MULLE_SHELL_MODE}" in + *INTERACTIVE*) + if [ -z "" ] + then + alias craftorder="mulle-sde craftorder" + alias clean="mulle-sde clean" + alias craft="mulle-sde craft" + alias dependency="mulle-sde dependency" + alias environment="mulle-sde environment" + alias extension="mulle-sde extension" + alias fetch="mulle-sde fetch" + alias show="mulle-sde show" + alias list="mulle-sde list" + alias library="mulle-sde library" + alias log="mulle-sde log" + alias match="mulle-sde match" + alias monitor="mulle-sde monitor" + alias reflect="mulle-sde reflect" + alias patternfile="mulle-sde patternfile" + alias subproject="mulle-sde subproject" + fi + + if [ -z "" ] + then + alias c="mulle-sde craft" + alias C="mulle-sde clean; mulle-sde craft" + alias CC="mulle-sde clean all; mulle-sde craft" + alias t="mulle-sde test rerun --serial" + alias tt="mulle-sde test craft ; mulle-sde test rerun --serial" + alias T="mulle-sde test craft ; mulle-sde test" + alias TT="mulle-sde test clean all; mulle-sde test" + alias r="mulle-sde reflect" + alias l="mulle-sde list --files" + fi + ;; +esac diff --git a/.mulle/share/env/include-environment.sh b/.mulle/share/env/include-environment.sh new file mode 100644 index 0000000..decbf1f --- /dev/null +++ b/.mulle/share/env/include-environment.sh @@ -0,0 +1,88 @@ +[ -z "${MULLE_VIRTUAL_ROOT}" -o -z "${MULLE_UNAME}" ] && \ + echo "Your script needs to setup MULLE_VIRTUAL_ROOT \ +and MULLE_UNAME properly" >&2 && exit 1 + +MULLE_ENV_SHARE_DIR="${MULLE_VIRTUAL_ROOT}/.mulle/share/env" +MULLE_ENV_ETC_DIR="${MULLE_VIRTUAL_ROOT}/.mulle/etc/env" +# Top/down order of inclusion. +# Keep these files (except environment-custom.sh) clean off manual edits so +# that mulle-env can read and set environment variables. +# +# .mulle/etc/env | .mulle/share/env +# --------------------------------------|-------------------- +# | environment-plugin.sh +# | environment-plugin-os-${MULLE_UNAME}.sh +# environment-project.sh | +# environment-global.sh | +# environment-os-${MULLE_UNAME}.sh | +# environment-host-${MULLE_HOSTNAME}.sh | +# environment-user-${MULLE_USERNAME}.sh | +# environment-custom.sh | +# environment-post-global.sh | +# +scopes="s:plugin;5 +s:plugin-os-${MULLE_UNAME};15 +e:global;40 +e:os-${MULLE_UNAME};60 +e:host-${MULLE_HOSTNAME};80 +e:user-${MULLE_USERNAME};100 +e:custom;1000 +e:post-global;2000" + +if [ -f "${MULLE_ENV_ETC_DIR}/auxscope" ] +then + auxscopes="`PATH=/bin:/usr/bin sed -e 's/^/e:/' \ + -e "s/\${MULLE_UNAME}/${MULLE_UNAME}/" \ + -e "s/\${MULLE_HOSTNAME}/${MULLE_HOSTNAME}/" \ + -e "s/\${MULLE_USERNAME}/${MULLE_USERNAME}/" \ + "${MULLE_ENV_ETC_DIR}/auxscope"`" + scopes="${scopes}"$'\n'"${auxscopes}" +fi + +if [ -f "${MULLE_ENV_SHARE_DIR}/auxscope" ] +then + auxscopes="`PATH=/bin:/usr/bin sed -e 's/^/s:/' \ + -e "s/\${MULLE_UNAME}/${MULLE_UNAME}/" \ + -e "s/\${MULLE_HOSTNAME}/${MULLE_HOSTNAME}/" \ + -e "s/\${MULLE_USERNAME}/${MULLE_USERNAME}/" \ + "${MULLE_ENV_SHARE_DIR}/auxscope"`" + scopes="${scopes}"$'\n'"${auxscopes}" +fi + +# +# Load scopes according to priority now +# put in local var for crazy old bashes +# +prioscopes=`printf "%s\n" "${scopes}" \ + | PATH=/bin:/usr/bin sort -t';' -k2n -k1 \ + | PATH=/bin:/usr/bin sed -n -e 's/\(.*\);.*$/\1/p'` + +for scope in ${prioscopes} +do + case "${scope}" in + e:*) + includefile="${MULLE_ENV_ETC_DIR}/environment-${scope#?:}.sh" + ;; + + s:*) + includefile="${MULLE_ENV_SHARE_DIR}/environment-${scope#?:}.sh" + ;; + + *) + continue; + ;; + esac + + if [ -f "${includefile}" ] + then + . "${includefile}" + fi +done + +unset scope +unset scopes +unset auxscopes +unset includefile + +unset MULLE_ENV_ETC_DIR +unset MULLE_ENV_SHARE_DIR diff --git a/.mulle/share/env/motd b/.mulle/share/env/motd new file mode 100644 index 0000000..4e223cb --- /dev/null +++ b/.mulle/share/env/motd @@ -0,0 +1,2 @@ +Run external commands with mudo +Project is ready to craft diff --git a/.mulle/share/env/style b/.mulle/share/env/style new file mode 100644 index 0000000..9caa548 --- /dev/null +++ b/.mulle/share/env/style @@ -0,0 +1 @@ +mulle/relax diff --git a/.mulle/share/env/tool-extension b/.mulle/share/env/tool-extension new file mode 100644 index 0000000..b5bc014 --- /dev/null +++ b/.mulle/share/env/tool-extension @@ -0,0 +1 @@ +clion diff --git a/.mulle/share/env/tool-plugin b/.mulle/share/env/tool-plugin new file mode 100644 index 0000000..da5adfe --- /dev/null +++ b/.mulle/share/env/tool-plugin @@ -0,0 +1,85 @@ +autoconf +autoreconf +awk;required +base64 +basename;required +bash +bash;optional +cat;required +chgrp;required +chmod;required +chown;required +clear +column +cp;required +curl +cut;required +date;required +dd +df +dirname;required +dmesg +echo;required +ed +egrep +emacs +env;required +expr;required +false;required +fgrep +file +find;required +grep;required +head;required +hostname +kill;required +less +ln;required +login +ls;required +make +mkdir;required +mknod +more +more;required +mount +mulle-column +mv;required +nano +ninja +ps +pwd;required +readlink;required +rmdir;required +rm;required +sed;required +shasum +sh;required +sleep;required +sort;required +stat;required +stty +su +sw_vers +sync +sysctl +tail;required +tee;required +test;required +touch;required +tr;required +true;required +tty +umount +uname;required +uptime +uuidgen +vi +wc;required +wget +which;required +xargs +xcodebuild +xcrun +zsh +zsh;optional diff --git a/.mulle/share/env/version b/.mulle/share/env/version new file mode 100644 index 0000000..831446c --- /dev/null +++ b/.mulle/share/env/version @@ -0,0 +1 @@ +5.1.0 diff --git a/.mulle/share/sde/extension b/.mulle/share/sde/extension new file mode 100644 index 0000000..d379940 --- /dev/null +++ b/.mulle/share/sde/extension @@ -0,0 +1,4 @@ +mulle-sde/extension-developer;meta +mulle-sde/extension;runtime +mulle-sde/extension-cmake;buildtool +mulle-sde/idea;extra diff --git a/.mulle/share/sde/version/mulle-sde/extension b/.mulle/share/sde/version/mulle-sde/extension new file mode 100644 index 0000000..d21d277 --- /dev/null +++ b/.mulle/share/sde/version/mulle-sde/extension @@ -0,0 +1 @@ +0.25.0 diff --git a/.mulle/share/sde/version/mulle-sde/extension-cmake b/.mulle/share/sde/version/mulle-sde/extension-cmake new file mode 100644 index 0000000..d21d277 --- /dev/null +++ b/.mulle/share/sde/version/mulle-sde/extension-cmake @@ -0,0 +1 @@ +0.25.0 diff --git a/.mulle/share/sde/version/mulle-sde/extension-developer b/.mulle/share/sde/version/mulle-sde/extension-developer new file mode 100644 index 0000000..8854156 --- /dev/null +++ b/.mulle/share/sde/version/mulle-sde/extension-developer @@ -0,0 +1 @@ +0.21.0 diff --git a/.mulle/share/sde/version/mulle-sde/idea b/.mulle/share/sde/version/mulle-sde/idea new file mode 100644 index 0000000..4e8f395 --- /dev/null +++ b/.mulle/share/sde/version/mulle-sde/idea @@ -0,0 +1 @@ +0.26.0 diff --git a/.touch b/.touch new file mode 100644 index 0000000..6ecdabd --- /dev/null +++ b/.touch @@ -0,0 +1 @@ +e0ffd73d-70f9-4905-915e-80031e8f9f10 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b2eb9ad --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required( VERSION 3.14) + +project( mulle-core-developer NONE) + +set( PROJECT_VERSION 0.0.1) + + +if( APPLE) + set( SCRIPTS + mulle-clang-add-to-xcode + ) +endif() + +set( EXTENSIONS + src/ #backslash is important +) + +set( PIX + pix/mulle-logo-48x48.txt + pix/mulle-objc-logo-opaque-48x48.txt +) + +INSTALL( FILES ${SCRIPTS} + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ + GROUP_EXECUTE GROUP_READ + WORLD_EXECUTE WORLD_READ + DESTINATION "bin" +) + +install( DIRECTORY ${EXTENSIONS} + DESTINATION "share/mulle-sde/extensions" + USE_SOURCE_PERMISSIONS + PATTERN "*._DS_Store|.ignore" EXCLUDE +) + +install( FILES ${PIX} + DESTINATION "share/mulle-sde/pix" +) + + +###### +# +# must be after CPACK_PACKAGE_VERSION +include( CMakePackage.cmake) # need extension +include( CPack) diff --git a/CMakePackage.cmake b/CMakePackage.cmake new file mode 100644 index 0000000..d5df41f --- /dev/null +++ b/CMakePackage.cmake @@ -0,0 +1,17 @@ +# +# CPack and project specific stuff +# +###### + +set( CPACK_PACKAGE_NAME "${PROJECT_NAME}") +set( CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") +set( CPACK_PACKAGE_CONTACT "nat@mulle-kybernetik.de") +set( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") +set( CPACK_PACKAGE_DESCRIPTION_SUMMARY "🎩 mulle-objc developer kit for mulle-sde") +set( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") +set( CPACK_STRIP_FILES false) + + +set( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/mulle-objc/${PROJECT_NAME}") +set( CPACK_DEBIAN_PACKAGE_DEPENDS "mulle-c-developer, mulle-clang") +set( CPACK_RPM_PACKAGE_VENDOR "mulle-objc") diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2a2626 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:latest + +# make it fresh +# add en UTF-8 as a locale +ENV OTHER_PROJECTS \ +mulle-sde/mulle-sde-developer; \ +mulle-c/mulle-c-developer; \ +mulle-core/mulle-core-developer; + +ENV SDE_PROJECTS mulle-test + +# Uncomment for prerelease +# ENV MULLE_SDE_DEFAULT_VERSION prerelease +# ENV MULLE_HOSTNAME ci-prerelease + +# && apt-get -y install locales \ +# && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen \ + +# bsdmainutils for column +# in theory we could use the tools from mulle-clang instead of build-essential +# but they are untested... + +RUN DEBIAN_FRONTEND=noninteractive \ + apt-get update \ + && apt-get -y install cmake curl git ninja-build build-essential uuid-runtime bsdmainutils wget \ +\ + && wget "https://raw.githubusercontent.com/mulle-sde/mulle-sde/${MULLE_SDE_DEFAULT_VERSION:-release}/bin/installer-all" \ + && chmod 755 installer-all \ + && ./installer-all /usr no \ +\ + && wget "https://github.com/mulle-cc/mulle-clang-project/releases/download/14.0.6.2/mulle-clang-14.0.6.2-bullseye-amd64.deb" \ + && dpkg --install "mulle-clang-14.0.6.2-bullseye-amd64.deb" + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..979cbf4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018, nat +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..9166411 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# mulle-core-developer + +#### 🤠 mulle-core developer kit for mulle-sde + +This is a collection of [mulle-sde](//github.com/mulle-sde) +*extensions* to support C-only development of code, that uses the +[mulle-core](//github.com/mulle-core) library. + +It inherits all the functionality from [mulle-c-developer](//github.com/mulle-c/mulle-c-developer) + + + + + + + + +### You are here + +![Overview](overview.dot.svg) + + + + + + + + +## Author + +[Nat!](https://mulle-kybernetik.com/weblog) for Mulle kybernetiK + + + diff --git a/RELEASENOTES.md b/RELEASENOTES.md new file mode 100644 index 0000000..3b4ffbf --- /dev/null +++ b/RELEASENOTES.md @@ -0,0 +1,4 @@ +## 0.0.1 + +* Mercyful Release + diff --git a/bin/installer b/bin/installer new file mode 100755 index 0000000..7592af2 --- /dev/null +++ b/bin/installer @@ -0,0 +1,196 @@ +#! /bin/sh +# +# (c) 2015, coded by Nat!, Mulle KybernetiK +# +[ "${TRACE}" = 'YES' ] && set -x && : "$0" "$@" + +if [ "${MULLE_NO_COLOR}" != 'YES' ] +then + # Escape sequence and resets + C_RESET="\033[0m" + + # Useable Foreground colours, for black/white white/black + C_RED="\033[0;31m" C_GREEN="\033[0;32m" + C_BLUE="\033[0;34m" C_MAGENTA="\033[0;35m" + C_CYAN="\033[0;36m" + + C_BR_RED="\033[0;91m" + C_BOLD="\033[1m" + + # + # restore colors if stuff gets wonky + # + trap 'printf "${C_RESET} >&2 ; exit 1"' TERM INT +fi + + +installer_fail() +{ + printf "${C_BR_RED}Error: $*${C_RESET}\n" >&2 + exit 1 +} + +# +# https://github.com/hoelzro/useful-scripts/blob/master/decolorize.pl +# + +# +# stolen from: +# http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac +# ---- +# +_installer_prepend_path_if_relative() +{ + case "$2" in + /*) + printf "%s\n" "$2" + ;; + + *) + printf "%s/%s\n" "$1" "$2" + ;; + esac +} + + +installer_resolve_symlinks() +{ + filepath="`readlink "$1"`" + if [ $? -eq 0 ] + then + dir_context=`dirname -- "$1"` + installer_resolve_symlinks "`_installer_prepend_path_if_relative "$dir_context" "$filepath"`" + else + printf "%s\n" "$1" + fi +} + + +installer_canonicalize_path() +{ + if [ -d "$1" ] + then + ( + cd "$1" 2>/dev/null && pwd -P + ) + else + dir="`dirname "$1"`" + file="`basename -- "$1"`" + ( + cd "${dir}" 2>/dev/null && + echo "`pwd -P`/${file}" + ) + fi +} + + +installer_realpath() +{ + installer_canonicalize_path "`installer_resolve_symlinks "$1"`" +} + + +installer_get_windows_path() +{ + directory="$1" + if [ -z "${directory}" ] + then + return 1 + fi + + ( cd "$directory" ; pwd -PW ) || installer_fail "installer_failed to get pwd" + return 0 +} + + +installer_get_sh_windows_path() +{ + directory="`which sh`" + directory="`dirname -- "${directory}"`" + directory="`installer_get_windows_path "${directory}"`" + + if [ -z "${directory}" ] + then + installer_fail "could not find sh.exe" + fi + printf "%s\n" "${directory}/sh.exe" +} + + +installer_sed_mangle_escape_slashes() +{ + sed -e 's|/|\\\\|g' +} + + +r_installer_install_prefix() +{ + prefix="`installer_realpath "$1" 2> /dev/null`" + if [ ! -d "${prefix}" ] + then + installer_fail "\"${prefix}\" does not exist" + fi + + directory="`dirname -- "$0"`" + cd "${directory}" || installer_fail "Could not cd to \"$directory\" ($PWD)" + cd .. || installer_fail "Could not cd to \"..\" ($PWD)" # compensate for installer being in bin + + bindir="${prefix}/bin" + if [ -d "${bindir}" ] + then + bindir="`installer_realpath "${bindir}"`" + fi + RVAL="`dirname -- "${bindir}"`" +} + + +main() +{ + prefix=${1:-"/usr/local"} + [ $# -eq 0 ] || shift + mode=${1:-755} + [ $# -eq 0 ] || shift + libexecdirname="${1:-libexec}" + [ $# -eq 0 ] || shift + + if [ -z "${prefix}" -o "${prefix}" = "--help" ] || [ -z "${mode}" ] + then + installer_fail "usage: installer [prefix] [mode] [libexecdirname]" + fi + + r_installer_install_prefix "${prefix}" + prefix="${RVAL}" + + bin="${prefix}/bin" + share="${prefix}/share/mulle-sde" + + mkdir -p "${share}" || installer_fail "could not create ${share}" +# mkdir -p "${libexec}" || installer_fail "could not create ${libexec}" + + case "`uname`" in + *arwin*) + mkdir -p "${bin}" || installer_fail "could not create ${bin}" + install ${VERBOSE} -m "${mode}" "mulle-clang-add-to-xcode" "${bin}/mulle-clang-add-to-xcode" || exit 1 + printf "install: ${C_MAGENTA}${C_BOLD}%s${C_RESET}\n" "${bin}/mulle-clang-add-to-xcode" >&2 + ;; + esac + + EXTENSION_DIR="${share}/extensions" + mkdir -p "${EXTENSION_DIR}" || exit 1 + cp -Rp ${VERBOSE} "src/mulle-objc" "${EXTENSION_DIR}/" || exit 1 + + PIX_DIR="${share}/pix" + mkdir -p "${PIX_DIR}" || exit 1 + + for i in pix/*logo*.txt + do + cp -p ${VERBOSE} "${i}" "${PIX_DIR}/" || exit 1 + done + + EXTENSION_DIR="${share}/extensions" + mkdir -p "${EXTENSION_DIR}" 2> /dev/null + cp -Rp "src/mulle-objc" "${EXTENSION_DIR}/" || installer_fail "copy to ${EXTENSION_DIR} failed" +} + +main "$@" + diff --git a/cola/config.plist b/cola/config.plist new file mode 100644 index 0000000..5151560 --- /dev/null +++ b/cola/config.plist @@ -0,0 +1,7 @@ +{ + config = + { + skipAdd = YES; + skipInstall = YES; + }; +} \ No newline at end of file diff --git a/cola/description.md.bud b/cola/description.md.bud new file mode 100644 index 0000000..868fb0d --- /dev/null +++ b/cola/description.md.bud @@ -0,0 +1,5 @@ +This is a collection of [mulle-sde](//github.com/mulle-sde) +*extensions* to support C-only development of code, that uses the +[mulle-core](//github.com/mulle-core) library. + +It inherits all the functionality from [mulle-c-developer](//github.com/mulle-c/mulle-c-developer) diff --git a/cola/executables.md.bud b/cola/executables.md.bud new file mode 100644 index 0000000..db95e0a --- /dev/null +++ b/cola/executables.md.bud @@ -0,0 +1,7 @@ +## Extension + +| Extension | Type | Description +|----------------------------|-----------|----------------------------------- +| mulle-core/c-developer | meta | Create C projects that use mulle-core + + diff --git a/cola/properties.plist b/cola/properties.plist new file mode 100644 index 0000000..6598710 --- /dev/null +++ b/cola/properties.plist @@ -0,0 +1,12 @@ +{ + project = + { + description="🤠 mulle-core developer kit for mulle-sde"; + domain="github"; + name="mulle-core-developer"; + user="mulle-core"; + repo="mulle-core-developer"; + homepage="https://github.com/mulle-core/mulle-core-developer"; + license="BSD-3-Clause"; + }; +} diff --git a/mulle-core-developer.sublime-project b/mulle-core-developer.sublime-project new file mode 100644 index 0000000..2213120 --- /dev/null +++ b/mulle-core-developer.sublime-project @@ -0,0 +1,30 @@ +{ + "folders": + [ + { + "path": ".", + "file_exclude_patterns": [ + "*~", + "*~.*", + "*.chk", + ".DS_Store", + "._.DS_Store", + "*.sublime-workspace", + "tmp.*" + ], + "folder_exclude_patterns": [ + "package", + "stash", + "build", + "kitchen", + "addiction", + "dependency", + "stash", + ".mulle-env", + ".mulle-sde", + ".git*" + ], + + } + ] +} diff --git a/overview.dot b/overview.dot new file mode 100644 index 0000000..2279aef --- /dev/null +++ b/overview.dot @@ -0,0 +1,10 @@ +digraph sourcetree +{ + rankdir = TD; + node [ shape="box"; style="filled" ] + "mulle-core-developer" [ fillcolor="yellow"] + "mulle-c-developer" [ fillcolor="white"] + "mulle-sde-developer" [ fillcolor="white"] + + "mulle-core-developer" -> "mulle-c-developer" -> "mulle-sde-developer" +} diff --git a/overview.dot.svg b/overview.dot.svg new file mode 100644 index 0000000..5aca0bd --- /dev/null +++ b/overview.dot.svg @@ -0,0 +1,43 @@ + + + + + + +sourcetree + + + +mulle-core-developer + +mulle-core-developer + + + +mulle-c-developer + +mulle-c-developer + + + +mulle-core-developer->mulle-c-developer + + + + + +mulle-sde-developer + +mulle-sde-developer + + + +mulle-c-developer->mulle-sde-developer + + + + + diff --git a/src/mulle-core/c-developer/inherit b/src/mulle-core/c-developer/inherit new file mode 100644 index 0000000..bc1c7c6 --- /dev/null +++ b/src/mulle-core/c-developer/inherit @@ -0,0 +1,8 @@ +mulle-core/c;runtime +mulle-c/c-cmake;buildtool + +# +# We don't inherit mulle-sde anymore, because it doesn't have mulle-c11 +# and we want to use MULLE_C_GLOBAL_EXTERN +# +mulle-c/c-demo;extra diff --git a/src/mulle-core/c-developer/type b/src/mulle-core/c-developer/type new file mode 100644 index 0000000..63131b8 --- /dev/null +++ b/src/mulle-core/c-developer/type @@ -0,0 +1 @@ +meta diff --git a/src/mulle-core/c-developer/usage b/src/mulle-core/c-developer/usage new file mode 100644 index 0000000..44d158d --- /dev/null +++ b/src/mulle-core/c-developer/usage @@ -0,0 +1 @@ +C project with the mulle-core library and cmake diff --git a/src/mulle-core/c-developer/version b/src/mulle-core/c-developer/version new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/src/mulle-core/c-developer/version @@ -0,0 +1 @@ +0.0.1 diff --git a/src/mulle-core/c/inherit b/src/mulle-core/c/inherit new file mode 100644 index 0000000..26c7f94 --- /dev/null +++ b/src/mulle-core/c/inherit @@ -0,0 +1,2 @@ +# dont want the mulle-c11 header we would inherit from mulle-c/c +mulle-sde/c diff --git a/src/mulle-core/c/project-oneshot/all/PROJECT_SOURCE_DIR/generic/include-private.h b/src/mulle-core/c/project-oneshot/all/PROJECT_SOURCE_DIR/generic/include-private.h new file mode 100644 index 0000000..2806cd4 --- /dev/null +++ b/src/mulle-core/c/project-oneshot/all/PROJECT_SOURCE_DIR/generic/include-private.h @@ -0,0 +1,31 @@ +#ifndef <|PROJECT_DOWNCASE_IDENTIFIER|>_include_private_h__ +#define <|PROJECT_DOWNCASE_IDENTIFIER|>_include_private_h__ + + +/* DO: #include this files in sources + + DONT: #include this files in headers + #import this file anywhere (except in import-private.h) + */ + + +/* This is a central include file to keep dependencies out of the library + C files. It is usually included by .h files only. + + As the name "include-private.h" is standardized across mulle-sde projects, + .c files are now motile. They can be moved to other projects and don't need + to be edited. + + If you delete it, it will not be regenerated. +*/ + +#include "include.h" + +/* + * Include the header file generated by mulle-sde reflect. + */ +#include "_<|PROJECT_NAME|>-include-private.h" + +/* You can add some more include statements here */ + +#endif diff --git a/src/mulle-core/c/project-oneshot/all/PROJECT_SOURCE_DIR/generic/include.h b/src/mulle-core/c/project-oneshot/all/PROJECT_SOURCE_DIR/generic/include.h new file mode 100644 index 0000000..21c572f --- /dev/null +++ b/src/mulle-core/c/project-oneshot/all/PROJECT_SOURCE_DIR/generic/include.h @@ -0,0 +1,47 @@ +#ifndef <|PROJECT_DOWNCASE_IDENTIFIER|>_include_h__ +#define <|PROJECT_DOWNCASE_IDENTIFIER|>_include_h__ + +// this is a global symbol that is exposed, which can be used to detect +// if this library is available + +#define HAVE_INCLUDE_<|PROJECT_UPCASE_IDENTIFIER|> + +/* DO: #include this files in public headers. + + DONT: #include this files in private headers. + #include this file directly in sources. + #import this file anywhere (except in import.h) + */ + + +/* This is a central include file to keep dependencies out of the library + C files. It is usually included by .h files only. + + As the name "include.h" is standardized across mulle-sde projects, + .c and .h files are now motile. They can be moved to other projects and + don't need to be edited. + + If you delete it, it will not be regenerated. +*/ + +/* + * Include the header file generated by mulle-sde reflect. + */ + +#include "_<|PROJECT_NAME|>-include.h" + +#ifndef <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL +# ifdef <|PROJECT_UPCASE_IDENTIFIER|>_BUILD +# define <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL MULLE_C_GLOBAL +# else +# if defined( <|PROJECT_UPCASE_IDENTIFIER|>_INCLUDE_DYNAMIC) || (defined( MULLE_INCLUDE_DYNAMIC) && ! defined( <|PROJECT_UPCASE_IDENTIFIER|>_INCLUDE_STATIC)) +# define <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL MULLE_C_GLOBAL +# else +# define <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL extern +# endif +# endif +#endif + +/* You can add some more include statements here */ + +#endif diff --git a/src/mulle-core/c/project-oneshot/executable/PROJECT_SOURCE_DIR/generic/include.h b/src/mulle-core/c/project-oneshot/executable/PROJECT_SOURCE_DIR/generic/include.h new file mode 100644 index 0000000..be68b29 --- /dev/null +++ b/src/mulle-core/c/project-oneshot/executable/PROJECT_SOURCE_DIR/generic/include.h @@ -0,0 +1,43 @@ +#ifndef <|PROJECT_DOWNCASE_IDENTIFIER|>_include_h__ +#define <|PROJECT_DOWNCASE_IDENTIFIER|>_include_h__ + +#define HAVE_INCLUDE_<|PROJECT_UPCASE_IDENTIFIER|> + +/* This is a central include file to keep dependencies out of the library + C files. It is usally included by .h files only. + + The advantage is that now .c and .h files become motile. They can + be moved to other projects and don't need to be edited. Also less typing... + + Therefore it is important that this file is called "include.h" and + not "<|PROJECT_NAME|>-include.h" to keep the #include statements in the + library code uniform. + + The C-compiler will pick up the nearest one. +*/ + +/* Include the header file automatically generated by mulle-sourcetree-to-c. + Here the prefix is harmless and serves disambiguation. If you have no + sourcetree, then you don't need it. + */ + +#include "_<|PROJECT_NAME|>-include.h" + +#ifndef <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL +# ifdef <|PROJECT_UPCASE_IDENTIFIER|>_BUILD +# define <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL MULLE_C_GLOBAL +# else +# if defined( <|PROJECT_UPCASE_IDENTIFIER|>_INCLUDE_DYNAMIC) || (defined( MULLE_INCLUDE_DYNAMIC) && ! defined( <|PROJECT_UPCASE_IDENTIFIER|>_INCLUDE_STATIC)) +# define <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL MULLE_C_GLOBAL +# else +# define <|PROJECT_UPCASE_IDENTIFIER|>_GLOBAL extern +# endif +# endif +#endif + +/* You can add some more include statements here */ + +#include "<|PROJECT_NAME|>-version.h" + +#endif + diff --git a/src/mulle-core/c/project-oneshot/none/.empty b/src/mulle-core/c/project-oneshot/none/.empty new file mode 100644 index 0000000..e69de29 diff --git a/src/mulle-core/c/sourcetree b/src/mulle-core/c/sourcetree new file mode 100644 index 0000000..b7fb683 --- /dev/null +++ b/src/mulle-core/c/sourcetree @@ -0,0 +1 @@ +--nodetype '${MULLE__CORE_NODETYPE:-tar}' --marks 'no-all-load,no-cmake-loader,no-cmake-searchpath,no-import,no-singlephase' --url '${MULLE__CORE_URL:-https://github.com/mulle-core/mulle-core/archive/${MULLE_TAG}.tar.gz}' --branch '${MULLE__CORE_BRANCH}' --tag '${MULLE__CORE_TAG:-latest}' 'mulle-core' diff --git a/src/mulle-core/c/type b/src/mulle-core/c/type new file mode 100644 index 0000000..e4d05d9 --- /dev/null +++ b/src/mulle-core/c/type @@ -0,0 +1 @@ +runtime diff --git a/src/mulle-core/c/version b/src/mulle-core/c/version new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/src/mulle-core/c/version @@ -0,0 +1 @@ +0.0.1 diff --git a/src/mulle-core/github-actions/project/all/.github/workflows/mulle-sde-ci.yml b/src/mulle-core/github-actions/project/all/.github/workflows/mulle-sde-ci.yml new file mode 100644 index 0000000..7ea9f56 --- /dev/null +++ b/src/mulle-core/github-actions/project/all/.github/workflows/mulle-sde-ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + push: + branches: + - release + pull_request: + workflow_dispatch: + + +env: + BUILD_TYPE: release + OTHER_PROJECTS: "mulle-objc/mulle-objc-developer; +mulle-c/mulle-c-developer;" + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest] # macos-latest, + + steps: + - name: Set MULLE_HOSTNAME + run: | + name="${GITHUB_REF##*/}" + MULLE_HOSTNAME="${MULLE_HOSTNAME:-ci-${name##*-}}" + echo "MULLE_HOSTNAME=${MULLE_HOSTNAME}" >> $GITHUB_ENV + + - name: Add to path + run: echo "$HOME/bin" >> $GITHUB_PATH + + - name: Dump Environment + run: env | sort + + - uses: actions/checkout@v3 + + - uses: mulle-sde/github-ci@v1 + + - uses: mulle-cc/github-ci@v4 + + - name: Dump Project Environment + run: | + [ ! -d .mulle/etc/env ] || ls -l .mulle/etc/env/environment*.sh + mulle-sde environment + + - name: Mulle-SDE Fetch + run: mulle-sde fetch + + - name: Mulle-SDE Craft + run: mulle-sde craft --${BUILD_TYPE:-release} + + - name: Mulle-SDE Test + run: | + [ ! -d test ] || mulle-sde test diff --git a/src/mulle-core/github-actions/type b/src/mulle-core/github-actions/type new file mode 100644 index 0000000..0f22871 --- /dev/null +++ b/src/mulle-core/github-actions/type @@ -0,0 +1 @@ +extra diff --git a/src/mulle-core/github-actions/usage b/src/mulle-core/github-actions/usage new file mode 100644 index 0000000..a978cab --- /dev/null +++ b/src/mulle-core/github-actions/usage @@ -0,0 +1,3 @@ +Adds a .github/workflows/mulle-sde-ci.yml file to your project. +Your project will be built with mulle-sde and tested with mulle-test with +github actions. (if a test folder is present). diff --git a/src/mulle-core/github-actions/version b/src/mulle-core/github-actions/version new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/src/mulle-core/github-actions/version @@ -0,0 +1 @@ +0.0.1