Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BasedOnStyle: LLVM
IndentWidth: 4
BreakBeforeBraces: Allman
AllowShortFunctionsOnASingleLine: None
38 changes: 38 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
root = true

[*]
# please only ever use utf-8
charset = utf-8

; C and friends
[**.{c,cpp,h,hh,m,mm}]
# indent 4 spaces, BSD-style
indent_style = space
indent_size = 4
indent_brace_style = BSD

## let git handle proper EOL
#end_of_line = lf

trim_trailing_whitespace = true
insert_final_newline = true

max_line_length = 80

#continuation_indent_size = 4
spaces_around_operators = true

; applies only to Makefiles
[makefile]
indent_style = tab
tab_width = 4
[**.am]
indent_style = tab
tab_width = 4

[**.tcl]
indent_style = space
indent_size = 4
#continuation_indent_size = 8
#curly_bracket_next_line = false

17 changes: 17 additions & 0 deletions .github/actions/setup-pd/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Setup Pure Data
description: Checkout code and setup Pure Data dependencies

runs:
using: composite
steps:
- name: get pdlibbuilder
shell: bash
run: |
git submodule init
git submodule update

- name: get pd
uses: actions/checkout@v6
with:
repository: pure-data/pure-data
path: pure-data
83 changes: 83 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Cross-Platform Compile
description: Compiles on multiple platforms and publishes to deken when tags are pushed

on:
workflow_dispatch:

push:
branches:
- main
paths:
- "include/**"
- "src/**"
- "Makefile"
- "config.sh"

tags:
- 'v*'

pull_request:
paths:
- "include/**"
- "src/**"
- "Makefile"
- "config.sh"

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash

env:
PDVERSION: pd-0.56-2

steps:
- uses: actions/checkout@v6

# ---- platform-specific setup ----
- name: setup pd (unix)
if: matrix.os != 'windows-latest'
uses: ./.github/actions/setup-pd

- name: install mac deps
if: matrix.os == 'macos-latest'
run: brew install automake autoconf libtool

- name: setup windows deps
if: matrix.os == 'windows-latest'
run: |
echo "local_short_commands=true" >> $GITHUB_ENV
git submodule init && git submodule update
curl -O "http://msp.ucsd.edu/Software/$PDVERSION.msw.zip"
unzip "$PDVERSION.msw.zip"

# ---- build ----
- name: configure
run: bash config.sh

- name: make (unix)
if: matrix.os != 'windows-latest'
run: make PDINCLUDEDIR=pure-data/src

- name: make (windows)
if: matrix.os == 'windows-latest'
run: make pdbinpath="$PDVERSION/bin" PDINCLUDEDIR="$PDVERSION/src" CFLAGS=-march=x86-64

# ---- package ----
- name: package library
run: |
bash scripts/package_lib.sh "${{ matrix.os }}"

- name: upload artifact
uses: actions/upload-artifact@v6
with:
name: "boids-${{ github.ref_name }}-${{ matrix.os }}-build"
path: "${{ matrix.os }}"
if-no-files-found: error
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.pd_linux
*.o
compile_commands.json
.cache/
21 changes: 8 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@
# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
# settings and rules.


# library name
lib.name = boids

lib.setup.sources = src/boids.c
# input source file (class name == source file basename)
class.sources = \
boids2d.c \
boids3d.c \
$(empty)
class.sources = src/boids.c
common.sources = src/boid_params.c src/vec.c

# all extra files to be included in binary distribution of the library
datafiles = \
boids-meta.pd \
boids2d-help.pd \
boids3d-help.pd \
README.txt LICENSE.txt
datafiles = boids-meta.pd README.txt LICENSE.txt $(wildcard boids/*.pd) $(wildcard help/*.pd)

datadirs = examples boids

datadirs = \
examples \
$(empty)
cflags = -O0 -g3 -fno-inline -fno-omit-frame-pointer -Wall -Wextra -Wpedantic

# include Makefile.pdlibbuilder from submodule directory 'pd-lib-builder'
PDLIBBUILDER_DIR=pd-lib-builder/
Expand Down
Loading
Loading