Skip to content

Commit

Permalink
Merge pull request #48 (Linux support)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Nov 13, 2023
2 parents 8b7de62 + d0833cd commit 3d2843e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 6 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
triplet: arm64-osx-min1100
host_triplet: x64-osx-min1015
overlay_ports: vcpkg/overlay/osx:vcpkg/overlay/ports
ccache_path: ~/Library/Caches/ccache
cpack_generator: DragNDrop
package_extension: dmg
cmake_args: >-
Expand All @@ -34,10 +35,24 @@ jobs:
triplet: x64-osx-min1015
host_triplet: x64-osx-min1015
overlay_ports: vcpkg/overlay/osx:vcpkg/overlay/ports
ccache_path: ~/Library/Caches/ccache
cpack_generator: DragNDrop
package_extension: dmg
cmake_args: >-
-DMACOS_BUNDLE=ON
- name: Linux (x86_64)
os: ubuntu-latest
triplet: x64-linux
host_triplet: x64-linux
overlay_ports: vcpkg/overlay/ports
ccache_path: ~/.ccache
cpack_generator: TGZ
package_extension: tar.gz
# On Linux we build without battery support since this pulls in a
# dependency on GLib which is tricky to get right in a static linking scenario.
# See https://github.com/fwcd/m1xxx/pull/48#issuecomment-1807378063
cmake_args: >-
-DBATTERY=OFF
name: '${{ matrix.name }}'
runs-on: '${{ matrix.os }}'
Expand All @@ -62,6 +77,9 @@ jobs:
done
echo "mixxx_version=$(scripts/mixxx-version)" >> "$GITHUB_ENV"
shell: bash
- name: Set up Linux build environment
if: runner.os == 'Linux'
run: ${{ env.SCRIPTS_ROOT }}/install-apt-deps
- name: Set up macOS build environment
if: runner.os == 'macOS'
run: |
Expand Down Expand Up @@ -121,12 +139,12 @@ jobs:
- name: Set up build cache
uses: actions/cache@v3
with:
path: $HOME/Library/Caches/ccache
key: ccache-${{ env.mixxx_commit }}-${{ github.ref }}-${{ github.run_number }}
path: ${{ matrix.ccache_path }}
key: ccache-${{ matrix.triplet }}-${{ env.mixxx_commit }}-${{ github.ref }}-${{ github.run_number }}
restore-keys: |
ccache-${{ env.mixxx_commit }}-${{ github.ref }}-
ccache-${{ env.mixxx_commit }}-
ccache-
ccache-${{ matrix.triplet }}-${{ env.mixxx_commit }}-${{ github.ref }}-
ccache-${{ matrix.triplet }}-${{ env.mixxx_commit }}-
ccache-${{ matrix.triplet }}-
- name: Configure Mixxx build
run: >-
cmake
Expand All @@ -146,6 +164,13 @@ jobs:
- name: Build Mixxx
run: cmake --build build --target mixxx
working-directory: mixxx
- name: Save build cache
if: always()
uses: actions/cache/save@v3
with:
# TODO: Share the key with the setup step
path: ${{ matrix.ccache_path }}
key: ccache-${{ matrix.triplet }}-${{ env.mixxx_commit }}-${{ github.ref }}-${{ github.run_number }}
- name: Package Mixxx
run: cpack -G ${{ matrix.cpack_generator }} -V && mv *.${{ matrix.package_extension }} "mixxx-${{ matrix.triplet }}-${{ env.mixxx_version }}.${{ matrix.package_extension }}"
working-directory: mixxx/build
Expand Down
27 changes: 27 additions & 0 deletions scripts/install-apt-deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -e

echo "==> Installing system dependencies with APT..."
sudo apt-get update
sudo apt-get install -y \
autoconf-archive \
autotools-dev \
ccache \
cmake \
libasound2-dev \
'^libxcb.*-dev' \
libx11-xcb-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libsleef-dev \
libudev-dev \
libupower-glib-dev \
libtool \
libxrender-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
mesa-common-dev \
nasm \
ninja-build
5 changes: 5 additions & 0 deletions scripts/install-vcpkg-deps
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ ROOT = Path(__file__).resolve().parent.parent

TRIPLET_OSS = {
'Darwin': 'osx',
'Linux': 'linux',
}

TRIPLET_ARCHS = {
'x86_64': 'x64',
'arm64': 'arm64',
'aarch64': 'arm64',
}

# Packages to be built for the target architecture
Expand Down Expand Up @@ -67,6 +69,9 @@ PLATFORM_PACKAGES = {
'hss1394',
'qtkeychain-qt6', # libgcrypt seems to be unsupported on iOS
],
'linux': [
'qtkeychain-qt6',
],
}

# Packages to be built for the host architecture when crosscompiling
Expand Down

0 comments on commit 3d2843e

Please sign in to comment.