Skip to content

Commit

Permalink
Merge branch 'effect-api-port'
Browse files Browse the repository at this point in the history
To merge at this point in time is slightly arbitrary, but "main" has
been dormant for a while now, and the initial goal of the
"effect-api-port" branch is long since achieved (with the notable
exception of the Text effect).

May as well continue on the main branch and keep development more
visible that way.
  • Loading branch information
grandchild committed Jan 2, 2025
2 parents ed7e7a2 + 4d74e94 commit 4eb54d0
Show file tree
Hide file tree
Showing 456 changed files with 68,878 additions and 27,855 deletions.
9 changes: 9 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# default to 32-bit
[build]
target = "i686-unknown-linux-gnu"

# pass linker search path -- DOES NOT WORK, need to run like:
# RUSTFLAGS="-L build_linux" cargo build/run/...
# https://github.com/rust-lang/rust/issues/48409 closed without resolution
[target.i686-unknown-linux-gnu.avs-window]
rustc-link-search = ["native=build_linux"]
31 changes: 30 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ColumnLimit: 88
IndentWidth: 4
UseTab: Never

# Pointers are aligned with the type, not the variable/parameter name.
# Pointers are aligned with the type, not the variable/parameter name.
PointerAlignment: Left
# Clang-format homogenizes alignment to whatever was most used in the file before, but
# we want to enforce our alignment so we have to turn that off explicitly.
Expand Down Expand Up @@ -97,6 +97,31 @@ BinPackParameters: false
#
InsertTrailingCommas: Wrapped

# Insert braces around control flow statements. Single-line if/for/while-bodies are
# often prone to become multiline statements later. This prevents the common error of
# not adding the braces when this happens.
#
# So this:
#
# for(int i=0; i < length; i++)
# foo(i);
#
# becomes:
#
# for(int i=0; i < length; i++) {
# foo(i);
# }
#
# The documentation warns about possibly invalid code resulting from this option, but so
# far, no issues were found.
InsertBraces: true

# Ensure that all files have a trailing newline.
InsertNewlineAtEOF: true

# Remove unneded semicolons after function definitions.
RemoveSemicolon: true

# For an AVS effect in r_foo.cpp the main #includes are c_foo.h and (sometimes) r_foo.h.
# Make clang-format aware of these, so that it sorts them at the top. But clang-format
# only supports suffixes so this a bit hacky: Sort _any_ c_*.h or r_*.h header to the
Expand Down Expand Up @@ -182,3 +207,7 @@ PenaltyBreakComment: 1
# #define BAR_BAZ 2
#
AlignConsecutiveMacros: AcrossComments

# Compact switch-case blocks can be a boon to readability if the case lines are very
# similar.
AllowShortCaseLabelsOnASingleLine: true
34 changes: 0 additions & 34 deletions .github/workflows/build-on-linux-with-mingw.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/build-on-windows-with-msvc.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/check-and-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Build on Ubuntu with MinGW GCC

on:
- pull_request
- push

jobs:
check:
name: Enforce clean clang-format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Install clang-format
run: |-
clang_major_version=18
set -x -u -o pipefail
source /etc/os-release
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${clang_major_version} main"
sudo apt-get update
sudo apt-get install --yes --no-install-recommends -V clang-format-${clang_major_version}
echo "/usr/lib/llvm-${clang_major_version}/bin" >> "${GITHUB_PATH}"
- name: Dump clang-format config
run: |-
clang-format -dump-config -style=file
- name: Enforce clang-format clean
run: |-
clang_format_args=(
-i
-style=file
-verbose
)
set -x -u -o pipefail
shopt -s globstar # Enable **/ for recursive globbing
clang-format --version
git ls-files '*.c' '*.cpp' '*.h' \
| grep -vf <(grep -rl "^DisableFormat: *true" **/.clang-format \
| sed 's:/.clang-format::') \
| xargs clang-format "${clang_format_args[@]}"
git diff --exit-code # i.e. fail CI on non-empty diff
build-linux:
name: Build on Ubuntu with MinGW GCC
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Install build dependencies
run: |-
sudo apt update && sudo apt install --yes mingw-w64 libavformat-dev libavcodec-dev libswscale-dev
- name: Configure
run: |-
set -e
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=CMake-MingWcross-toolchain.txt ..
- name: Make
run: |-
make -C build VERBOSE=1
find build
mv build/vis_avs.dll build/vis_avs_281d_mingw_debug.dll
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: vis_avs_mingw
path: build/*.dll

build-windows:
name: Build on Windows with MSVC
runs-on: windows-latest
steps:
- uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0

- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Configure
shell: cmd
run: |-
md build
cd build
cmake -G"Visual Studio 17 2022" -A Win32 ..
- name: Make
run: msbuild "$env:GITHUB_WORKSPACE/build/vis_avs.sln" -m

- name: Copy DLL
shell: cmd
run: copy build/Debug/vis_avs.dll vis_avs_281d_msvc_debug.dll

- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: vis_avs_msvc
path: vis_avs_281d_msvc_debug.dll
36 changes: 0 additions & 36 deletions .github/workflows/enforce-clang-format-clean.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
image: gcc:8
image: gcc:9

build:
stage: build
before_script:
- apt update && apt -y install gcc-mingw-w64 g++-mingw-w64 cmake make
- >
apt update &&
apt -y install
gcc-mingw-w64 g++-mingw-w64 cmake make
libavformat-dev libavcodec-dev libswscale-dev
script:
- mkdir -p build
- cd build
Expand Down
25 changes: 25 additions & 0 deletions CMake-Linux32cross-toolchain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Set the toolchain target-triplet (<arch>-<vendor>-<os>) and the path prefix for the
# toolchain. We want to target 32bit Linux.
#
# Normally you'd only have to edit these two variables here, if at all. Refer to your
# distro's documentation on how to set up a Linux-32bit cross-compiler, and check for
# their naming convention.
SET(LIB32 /usr/lib32)
SET(ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig)

# the name of the target operating system
set(CMAKE_SYSTEM_NAME Linux)

# which compilers to use for C and C++
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
# target 32-bit
set(CMAKE_C_FLAGS -m32)
set(CMAKE_CXX_FLAGS -m32)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
# set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
# set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Loading

0 comments on commit 4eb54d0

Please sign in to comment.