Skip to content

Commit

Permalink
Test Linux CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ryukau committed Dec 28, 2023
1 parent 994cd6c commit d897f50
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 68 deletions.
128 changes: 64 additions & 64 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,69 +29,69 @@ jobs:
name: vst_ubuntu
path: vst_ubuntu

build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Run script
run: ci/ci_windows.ps1
- name: Upload
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: vst_windows
path: vst_windows
# build-windows:
# runs-on: windows-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: Run script
# run: ci/ci_windows.ps1
# - name: Upload
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
# uses: actions/upload-artifact@v3
# with:
# name: vst_windows
# path: vst_windows

build-macOS:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Run script
run: ci/ci_macOS.sh
- name: Upload
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: vst_macOS
path: vst_macOS
# build-macOS:
# runs-on: macos-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: Run script
# run: ci/ci_macOS.sh
# - name: Upload
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
# uses: actions/upload-artifact@v3
# with:
# name: vst_macOS
# path: vst_macOS

release-packaging:
needs: [build-ubuntu, build-windows, build-macOS]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/UhhyouPlugins') }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path:
ref: ${{ github.ref }}
submodules: recursive
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ${{ env.package_path }}
- name: Run package script
run: |
cd ${{ env.package_path }}
echo "Run pack.py"
python3 pack.py
echo "Run studiorack.py"
python3 studiorack.py
- name: Get Release Notes
run: 'echo "$(git tag -l --format="%(contents:body)" $GITHUB_REF_NAME)" > RELEASE_NOTES'
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_NOTES
files: |
${{ env.package_path }}/pack_macOS/*.zip
${{ env.package_path }}/pack/*.zip
${{ env.package_path }}/pack/*.png
${{ env.package_path }}/pack/plugins.json
${{ env.package_path }}/audiosample/*.flac
# release-packaging:
# needs: [build-ubuntu, build-windows, build-macOS]
# runs-on: ubuntu-latest
# if: ${{ startsWith(github.ref, 'refs/tags/UhhyouPlugins') }}
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# path:
# ref: ${{ github.ref }}
# submodules: recursive
# - name: Download Artifacts
# uses: actions/download-artifact@v3
# with:
# path: ${{ env.package_path }}
# - name: Run package script
# run: |
# cd ${{ env.package_path }}
# echo "Run pack.py"
# python3 pack.py
# echo "Run studiorack.py"
# python3 studiorack.py
# - name: Get Release Notes
# run: 'echo "$(git tag -l --format="%(contents:body)" $GITHUB_REF_NAME)" > RELEASE_NOTES'
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# body_path: RELEASE_NOTES
# files: |
# ${{ env.package_path }}/pack_macOS/*.zip
# ${{ env.package_path }}/pack/*.zip
# ${{ env.package_path }}/pack/*.png
# ${{ env.package_path }}/pack/plugins.json
# ${{ env.package_path }}/audiosample/*.flac
9 changes: 5 additions & 4 deletions ci/ci_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ sudo apt-get update
sudo apt-get install cmake gcc "libstdc++6" libx11-xcb-dev libxcb-util-dev libxcb-cursor-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev libfontconfig1-dev libcairo2-dev libgtkmm-3.0-dev libsqlite3-dev libxcb-keysyms1-dev

# Patch vst3sdk.
# - https://github.com/ryukau/VSTPlugins/issues/3
cp \
ci/linux_patch/cairocontext.cpp \
lib/vst3sdk/vstgui4/vstgui/lib/platform/linux/cairocontext.cpp
# - https://github.com/ryukau/VSTPlugins/issues/48
# - https://github.com/steinbergmedia/vstgui/issues/126
cd lib/vst3sdk/vstgui4/
git apply ../../../ci/linux_patch/cairographicscontext.patch
cd ../../../

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
Expand Down
54 changes: 54 additions & 0 deletions ci/linux_patch/cairographicscontext.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
diff --git a/vstgui/lib/platform/linux/cairographicscontext.cpp b/vstgui/lib/platform/linux/cairographicscontext.cpp
index ab620cc9..f9b735bf 100644
--- a/vstgui/lib/platform/linux/cairographicscontext.cpp
+++ b/vstgui/lib/platform/linux/cairographicscontext.cpp
@@ -406,15 +406,11 @@ bool CairoGraphicsDeviceContext::drawPolygon (const PointList& polygonPointList,
vstgui_assert (polygonPointList.empty () == false);
impl->doInContext ([&] () {
bool doPixelAlign = impl->state.drawMode.integralMode ();
- auto last = polygonPointList.back ();
- if (doPixelAlign)
- last = pixelAlign (impl->state.tm, last);
- cairo_move_to (impl->context, last.x, last.y);
- for (auto p : polygonPointList)
+ auto first = polygonPointList.front ();
+ cairo_move_to (impl->context, first.x, first.y);
+ for (auto p = polygonPointList.begin () + 1; p != polygonPointList.end (); ++p)
{
- if (doPixelAlign)
- p = pixelAlign (impl->state.tm, p);
- cairo_line_to (impl->context, p.x, p.y);
+ cairo_line_to (impl->context, (*p).x, (*p).y);
}
impl->draw (drawStyle);
});
@@ -448,15 +444,17 @@ bool CairoGraphicsDeviceContext::drawRect (CRect rect, PlatformGraphicsDrawStyle
return true;
}

-//------------------------------------------------------------------------
+//------------------------------cairo_restore (------------------------------------------
bool CairoGraphicsDeviceContext::drawArc (CRect rect, double startAngle1, double endAngle2,
PlatformGraphicsDrawStyle drawStyle) const
{
impl->doInContext ([&] () {
+ cairo_save (impl->context);
CPoint center = rect.getCenter ();
cairo_translate (impl->context, center.x, center.y);
- cairo_scale (impl->context, 2.0 / rect.getWidth (), 2.0 / rect.getHeight ());
- cairo_arc (impl->context, 0, 0, 1, startAngle1, endAngle2);
+ cairo_scale (impl->context, rect.getWidth () /2.0 , rect.getHeight () / 2.0);
+ cairo_arc (impl->context, 0, 0, 1, startAngle1 / 180.0 * M_PI, endAngle2 / 180.0 * M_PI);
+ cairo_restore (impl->context);
impl->draw (drawStyle);
});
return true;
@@ -468,7 +466,7 @@ bool CairoGraphicsDeviceContext::drawEllipse (CRect rect, PlatformGraphicsDrawSt
impl->doInContext ([&] () {
CPoint center = rect.getCenter ();
cairo_translate (impl->context, center.x, center.y);
- cairo_scale (impl->context, 2.0 / rect.getWidth (), 2.0 / rect.getHeight ());
+ cairo_scale (impl->context, rect.getWidth () / 2.0, rect.getHeight () / 2.0);
cairo_arc (impl->context, 0, 0, 1, 0, 2 * M_PI);
impl->draw (drawStyle);
});

0 comments on commit d897f50

Please sign in to comment.