blob: 1d79d013a69b2233816778a877a91588694b86ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
{
description = "mixxx";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.05";
unstable-nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, flake-utils, nixpkgs, unstable-nixpkgs, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
};
unstable = import unstable-nixpkgs {
inherit system;
};
allLv2Plugins = [
pkgs.x42-plugins
pkgs.zam-plugins
pkgs.rkrlv2
pkgs.mod-distortion
pkgs.infamousPlugins
pkgs.artyFX
];
git-clang-format = pkgs.stdenv.mkDerivation {
name = "git-clang-format";
version = "2019-06-21";
src = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/llvm-mirror/clang/2bb8e0fe002e8ffaa9ce5fa58034453c94c7e208/tools/clang-format/git-clang-format";
sha256 = "1kby36i80js6rwi11v3ny4bqsi6i44b9yzs23pdcn9wswffx1nlf";
executable = true;
};
nativeBuildInputs = [
pkgs.makeWrapper
];
buildInputs = [
pkgs.clang-tools
pkgs.python3
];
unpackPhase = ":";
installPhase = ''
mkdir -p $out/opt $out/bin
cp $src $out/opt/git-clang-format
makeWrapper $out/opt/git-clang-format $out/bin/git-clang-format \
--add-flags --binary \
--add-flags ${pkgs.clang-tools}/bin/clang-format
'';
};
shell-configure = pkgs.writeShellScriptBin "configure" ''
mkdir -p cbuild
cd cbuild
cmake .. "$@"
cd ..
'';
shell-build = pkgs.writeShellScriptBin "build" ''
if [ ! -d "cbuild" ]; then
>&2 echo "First you have to run configure."
exit 1
fi
cd cbuild
cmake --build . --parallel $NIX_BUILD_CORES "$@"
source ${pkgs.makeWrapper}/nix-support/setup-hook
wrapProgram mixxx --prefix LV2_PATH : ${pkgs.lib.makeSearchPath "lib/lv2" allLv2Plugins}
'';
shell-run = pkgs.writeShellScriptBin "run" ''
if [ ! -f "cbuild/mixxx" ]; then
>&2 echo "First you have to run build."
exit 1
fi
cd cbuild
./mixxx --resourcePath res/ "$@"
'';
shell-debug = pkgs.writeShellScriptBin "debug" ''
if [ ! -f "cbuild/mixxx" ]; then
>&2 echo "First you have to run build."
exit 1
fi
cd cbuild
LV2_PATH=${pkgs.lib.makeSearchPath "lib/lv2" allLv2Plugins} gdb --args ./.mixxx-wrapped --resourcePath res/ "$@"
'';
mixxx = pkgs.stdenv.mkDerivation {
pname = "mixxx";
version = "development";
src = pkgs.nix-gitignore.gitignoreSource ''
/cbuild
/.envrc
/result
/shell.nix
/venv
'' ./.;
nativeBuildInputs = with pkgs; [
cmake
ccache
gdb
git-clang-format
clang-tools
# for pre-commit installation since nixpkg.pre-commit may be to old
python3
python3Packages.virtualenv
python3Packages.pip
python3Packages.setuptools
shell-configure
shell-build
shell-run
shell-debug
];
buildInputs = with pkgs; [
chromaprint
fftw
flac
libid3tag
libmad
libopus
libshout
libsndfile
libusb1
libvorbis
libebur128
pkgconfig
portaudio
portmidi
protobuf
qt5.full
rubberband
sqlite
taglib
soundtouch
vamp.vampSDK
opusfile
upower
hidapi
git
glib
freetype
fontconfig
xorg.xorgproto
xorg.libX11
xorg.libXt
xorg.libXft
xorg.libXext
xorg.libSM
xorg.libICE
libGLU
lilv
lame
lv2
makeWrapper
qt5.qtbase
pcre
utillinux
libselinux
libsepol
libsForQt5.qtkeychain
ffmpeg
libmodplug
mp4v2
wavpack
] ++ allLv2Plugins;
postInstall = ''
wrapProgram $out/bin/mixxx --prefix LV2_PATH : ${pkgs.lib.makeSearchPath "lib/lv2" allLv2Plugins}
'';
};
in
rec {
checks = { };
packages = {
default = packages.mixxx;
inherit mixxx;
};
apps = {
default = apps.mixxx;
inherit mixxx;
};
devShells.default = devShells.mixxx;
devShells.mixxx = pkgs.mkShell {
buildInputs = [
];
nativeBuildInputs = [
git-clang-format
];
shellHook = ''
export PYTHONPATH=venv/lib/python3.7/site-packages/:$PYTHONPATH
export SOURCE_DATE_EPOCH=315532800
echo -e "Mixxx development shell. Available commands:\n"
echo " configure - configures cmake (only has to run once)"
echo " build - compiles Mixxx"
echo " run - runs Mixxx with development settings"
echo " debug - runs Mixxx inside gdb"
'';
};
}
);
}
|