From 16e746c41901138a5131efd7724f60508b6917e8 Mon Sep 17 00:00:00 2001 From: yen Date: Fri, 28 Mar 2025 12:35:03 +0100 Subject: [PATCH 1/3] Add nix flake with a dev shell to build Mixxx --- tools/flake.lock | 61 ++++++++++++++++++++++++++++++++++++++ tools/flake.nix | 76 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 tools/flake.lock create mode 100644 tools/flake.nix diff --git a/tools/flake.lock b/tools/flake.lock new file mode 100644 index 000000000000..552b01ade3a7 --- /dev/null +++ b/tools/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1743080597, + "narHash": "sha256-UQwJgAe80hyILxk8sNSH2DCGDpHTYjtzld8uZv0nUes=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2332f3658f3f9c0b7c5c8357329c0737d5757331", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/tools/flake.nix b/tools/flake.nix new file mode 100644 index 000000000000..e81fc2bb0f36 --- /dev/null +++ b/tools/flake.nix @@ -0,0 +1,76 @@ +{ + inputs = { + utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; + }; + outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + # Building Mixxx + qt6.full + cmake + chromaprint + glib + libebur128 + fftw + flac + lame + libogg + libvorbis + portaudio + portmidi + protobuf + rubberband + libsndfile + soundtouch + taglib + upower + openssl + microsoft-gsl + kdePackages.qtkeychain + hidapi + wavpack + libid3tag + libusb1 + libmad + libopus + opusfile + libshout + lilv + libxkbcommon + sqlite + gtest + clang-tools + mp4v2 + vulkan-loader + xorg.libX11 + ffmpeg + libmodplug + vamp-plugin-sdk + ccache + libGLU + pcre + libselinux + utillinux + libdjinterop + libkeyfinder + cups + lv2 + + # Git pre-commits + pre-commit + nodejs + rustup + ]; + shellHook = '' + pre-commit install + pre-commit install -t pre-push + ''; + }; + } + ); +} From 348914cd41fe8ae2d0a744be2ff3a1a9bdbfff84 Mon Sep 17 00:00:00 2001 From: yen Date: Sun, 30 Mar 2025 21:27:00 +0200 Subject: [PATCH 2/3] explicitly install required qt6 libraries instead of qt6.full --- tools/flake.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/flake.nix b/tools/flake.nix index e81fc2bb0f36..118ef98e887b 100644 --- a/tools/flake.nix +++ b/tools/flake.nix @@ -6,12 +6,19 @@ outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; + qt6Env = with pkgs.qt6; env "qt-custom-${qtbase.version}" + [ + qt5compat + qtshadertools + qtsvg + qtdeclarative + ]; in { devShell = pkgs.mkShell { buildInputs = with pkgs; [ # Building Mixxx - qt6.full + qt6Env cmake chromaprint glib From c4c9d263260e7f24a7f61e39cc68e0c268627f6d Mon Sep 17 00:00:00 2001 From: yen Date: Tue, 1 Apr 2025 01:29:16 +0200 Subject: [PATCH 3/3] fix clang-format pre-commit hook --- tools/flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/flake.nix b/tools/flake.nix index 118ef98e887b..e6f33efa10c3 100644 --- a/tools/flake.nix +++ b/tools/flake.nix @@ -72,10 +72,13 @@ pre-commit nodejs rustup + stdenv.cc.cc ]; shellHook = '' pre-commit install pre-commit install -t pre-push + # Needed for clang-format pre-commit because it downloads and executes its own clang-format elf-binary + export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib/:$LD_LIBRARY_PATH" ''; }; }