Skip to content

Commit 923e274

Browse files
authored
ardour: 8.12 -> 9.0 (#487577)
2 parents 955bae7 + 61dfeb6 commit 923e274

File tree

4 files changed

+324
-3
lines changed

4 files changed

+324
-3
lines changed

pkgs/by-name/ar/ardour/package.nix

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
libusb1,
3737
libuv,
3838
libwebsockets,
39+
libxi,
3940
libxml2,
4041
libxslt,
4142
lilv,
@@ -71,14 +72,14 @@ stdenv.mkDerivation (
7172
in
7273
{
7374
pname = "ardour";
74-
version = "8.12";
75+
version = "9.0";
7576

7677
# We can't use `fetchFromGitea` here, as attempting to fetch release archives from git.ardour.org
7778
# result in an empty archive. See https://tracker.ardour.org/view.php?id=7328 for more info.
7879
src = fetchgit {
7980
url = "git://git.ardour.org/ardour/ardour.git";
8081
rev = finalAttrs.version;
81-
hash = "sha256-4IgBQ53cwPA35YwNQyo+qBqsMGv+TLn6w1zaDX97erE=";
82+
hash = "sha256-zgWNKYN45qa2xLWnL3W/UWfRVBJN3+hya9dpIZLLJvo=";
8283
};
8384

8485
bundledContent = fetchzip {
@@ -146,6 +147,7 @@ stdenv.mkDerivation (
146147
libusb1
147148
libuv
148149
libwebsockets
150+
libxi
149151
libxml2
150152
libxslt
151153
lilv
@@ -190,6 +192,15 @@ stdenv.mkDerivation (
190192
]
191193
++ lib.optional optimize "--optimize";
192194

195+
env.NIX_CFLAGS_COMPILE = toString [
196+
# 'ioprio_set' syscall support:
197+
"-D_GNU_SOURCE"
198+
# compiler doesn't find headers without these:
199+
"-I${lib.getDev serd}/include/serd-0"
200+
"-I${lib.getDev sratom}/include/sratom-0"
201+
"-I${lib.getDev sord}/include/sord-0"
202+
];
203+
193204
postInstall = ''
194205
# wscript does not install these for some reason
195206
install -vDm 644 "build/gtk2_ardour/ardour.xml" \
@@ -231,7 +242,7 @@ stdenv.mkDerivation (
231242
'';
232243
homepage = "https://ardour.org/";
233244
license = lib.licenses.gpl2Plus;
234-
mainProgram = "ardour8";
245+
mainProgram = "ardour9";
235246
platforms = lib.platforms.linux;
236247
maintainers = with lib.maintainers; [
237248
magnetophon
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- a/libs/ardour/wscript
2+
+++ b/libs/ardour/wscript
3+
@@ -379,8 +379,7 @@ def build(bld):
4+
5+
# remove '${DEFINES_ST:DEFINES}' from run_str.
6+
# x86_64-w64-mingw32-as (mingw) -D flag is for debug messages
7+
- if bld.env['build_target'] == 'mingw':
8+
- class asm(Task.classes['asm']): run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
9+
+ class asm(Task.classes['asm']): run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
10+
11+
# operate on copy to avoid adding sources twice
12+
sources = list(libardour_sources)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
From 1217722e4bf6c65b5c24da17a7de4bf712ca6775 Mon Sep 17 00:00:00 2001
2+
From: Tamara Schmitz <tamara.zoe.schmitz@posteo.de>
3+
Date: Sat, 17 Jun 2023 14:05:53 +0200
4+
Subject: [PATCH] add NixOS plugin paths as default search paths
5+
6+
Since NixOS uses unusual paths, we should tell Ardour about this. During
7+
first launch, Ardour does indeed check for environmentals but not when
8+
you press the "Reset to Defaults" button in the Settings menu. This
9+
path fixes this by including NixOS paths in the defaults.
10+
---
11+
libs/ardour/plugin_manager.cc | 5 +++--
12+
libs/ardour/search_paths.cc | 4 ++++
13+
2 files changed, 7 insertions(+), 2 deletions(-)
14+
15+
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
16+
index a572ed55dd..3dd6c2fda6 100644
17+
--- a/libs/ardour/plugin_manager.cc
18+
+++ b/libs/ardour/plugin_manager.cc
19+
@@ -305,7 +305,8 @@ PluginManager::PluginManager ()
20+
if (lxvst_path.length() == 0) {
21+
lxvst_path = "/usr/local/lib64/lxvst:/usr/local/lib/lxvst:/usr/lib64/lxvst:/usr/lib/lxvst:"
22+
"/usr/local/lib64/linux_vst:/usr/local/lib/linux_vst:/usr/lib64/linux_vst:/usr/lib/linux_vst:"
23+
- "/usr/lib/vst:/usr/local/lib/vst";
24+
+ "/usr/lib/vst:/usr/local/lib/vst:$HOME/.nix-profile/lib/vst:"
25+
+ "$HOME/.lxvst:$HOME/.nix-profile/lib/lxvst:/run/current-system/sw/lib/lxvst:/etc/profiles/per-user/$USER/lib/lxvst";
26+
}
27+
28+
/* first time setup, use 'default' path */
29+
@@ -2040,7 +2041,7 @@ PluginManager::vst3_refresh (bool cache_only)
30+
std::string prog = PBD::get_win_special_folder_path (CSIDL_PROGRAM_FILES);
31+
vst3_discover_from_path (Glib::build_filename (prog, "Common Files", "VST3"), cache_only);
32+
#else
33+
- vst3_discover_from_path ("~/.vst3:/usr/local/lib/vst3:/usr/lib/vst3", cache_only);
34+
+ vst3_discover_from_path ("~/.vst3:/usr/local/lib/vst3:/usr/lib/vst3:~/.nix-profile/lib/vst3:/run/current-system/sw/lib/vst3:/etc/profiles/per-user/$USER/lib/vst3", cache_only);
35+
#endif
36+
}
37+
38+
diff --git a/libs/ardour/search_paths.cc b/libs/ardour/search_paths.cc
39+
index e6d8744369..b9774cb006 100644
40+
--- a/libs/ardour/search_paths.cc
41+
+++ b/libs/ardour/search_paths.cc
42+
@@ -112,6 +112,10 @@ ladspa_search_path ()
43+
spath.push_back ("/usr/local/lib/ladspa");
44+
spath.push_back ("/usr/lib64/ladspa");
45+
spath.push_back ("/usr/lib/ladspa");
46+
+ spath.push_back ("/run/current-system/sw/lib/ladspa");
47+
+ spath.push_back (path_expand ("$HOME/.ladspa"));
48+
+ spath.push_back (path_expand ("$HOME/.nix-profile/lib/ladspa"));
49+
+ spath.push_back (path_expand ("/etc/profiles/per-user/$USER/lib/ladspa"));
50+
#endif
51+
52+
#ifdef __APPLE__
53+
--
54+
2.40.1
55+
Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchgit,
5+
fetchzip,
6+
alsa-lib,
7+
aubio,
8+
boost,
9+
cairomm,
10+
cppunit,
11+
curl,
12+
dbus,
13+
doxygen,
14+
ffmpeg,
15+
fftw,
16+
fftwSinglePrec,
17+
flac,
18+
fluidsynth,
19+
glibc,
20+
glibmm,
21+
graphviz,
22+
harvid,
23+
hidapi,
24+
itstool,
25+
kissfft,
26+
libarchive,
27+
libjack2,
28+
liblo,
29+
libltc,
30+
libogg,
31+
libpulseaudio,
32+
librdf_rasqal,
33+
libsamplerate,
34+
libsigcxx,
35+
libsndfile,
36+
libusb1,
37+
libuv,
38+
libwebsockets,
39+
libxml2,
40+
libxslt,
41+
lilv,
42+
lrdf,
43+
lv2,
44+
makeWrapper,
45+
pango,
46+
pangomm,
47+
perl,
48+
pkg-config,
49+
python3,
50+
qm-dsp,
51+
readline,
52+
rubberband,
53+
serd,
54+
sord,
55+
soundtouch,
56+
sratom,
57+
suil,
58+
taglib,
59+
vamp-plugin-sdk,
60+
wafHook,
61+
xjadeo,
62+
libxrandr,
63+
libxinerama,
64+
optimize ? true, # disable to print Lua DSP script output to stdout
65+
videoSupport ? true,
66+
}:
67+
stdenv.mkDerivation (
68+
finalAttrs:
69+
let
70+
majorVersion = lib.versions.major finalAttrs.version;
71+
in
72+
{
73+
pname = "ardour";
74+
version = "8.12";
75+
76+
# We can't use `fetchFromGitea` here, as attempting to fetch release archives from git.ardour.org
77+
# result in an empty archive. See https://tracker.ardour.org/view.php?id=7328 for more info.
78+
src = fetchgit {
79+
url = "git://git.ardour.org/ardour/ardour.git";
80+
rev = finalAttrs.version;
81+
hash = "sha256-4IgBQ53cwPA35YwNQyo+qBqsMGv+TLn6w1zaDX97erE=";
82+
};
83+
84+
bundledContent = fetchzip {
85+
url = "https://web.archive.org/web/20221026200824/http://stuff.ardour.org/loops/ArdourBundledMedia.zip";
86+
hash = "sha256-IbPQWFeyMuvCoghFl1ZwZNNcSvLNsH84rGArXnw+t7A=";
87+
# archive does not contain a single folder at the root
88+
stripRoot = false;
89+
};
90+
91+
patches = [
92+
# AS=as in the environment causes build failure https://tracker.ardour.org/view.php?id=8096
93+
./as-flags.patch
94+
./default-plugin-search-paths.patch
95+
];
96+
97+
# Ardour's wscript requires git revision and date to be available.
98+
# Since they are not, let's generate the file manually.
99+
postPatch = ''
100+
printf '#include "libs/ardour/ardour/revision.h"\nnamespace ARDOUR { const char* revision = "${finalAttrs.version}"; const char* date = ""; }\n' > libs/ardour/revision.cc
101+
sed 's|/usr/include/libintl.h|${glibc.dev}/include/libintl.h|' -i wscript
102+
patchShebangs ./tools/
103+
substituteInPlace libs/ardour/video_tools_paths.cc \
104+
--replace-fail 'ffmpeg_exe = X_("");' 'ffmpeg_exe = X_("${ffmpeg}/bin/ffmpeg");' \
105+
--replace-fail 'ffprobe_exe = X_("");' 'ffprobe_exe = X_("${ffmpeg}/bin/ffprobe");'
106+
'';
107+
108+
nativeBuildInputs = [
109+
doxygen
110+
graphviz # for dot
111+
itstool
112+
makeWrapper
113+
perl
114+
pkg-config
115+
python3
116+
wafHook
117+
];
118+
119+
buildInputs = [
120+
alsa-lib
121+
aubio
122+
boost
123+
cairomm
124+
cppunit
125+
curl
126+
dbus
127+
ffmpeg
128+
fftw
129+
fftwSinglePrec
130+
flac
131+
fluidsynth
132+
glibmm
133+
hidapi
134+
itstool
135+
kissfft
136+
libarchive
137+
libjack2
138+
liblo
139+
libltc
140+
libogg
141+
libpulseaudio
142+
librdf_rasqal
143+
libsamplerate
144+
libsigcxx
145+
libsndfile
146+
libusb1
147+
libuv
148+
libwebsockets
149+
libxml2
150+
libxslt
151+
lilv
152+
lrdf
153+
lv2
154+
pango
155+
pangomm
156+
perl
157+
python3
158+
qm-dsp
159+
readline
160+
rubberband
161+
serd
162+
sord
163+
soundtouch
164+
sratom
165+
suil
166+
taglib
167+
vamp-plugin-sdk
168+
libxinerama
169+
libxrandr
170+
]
171+
++ lib.optionals videoSupport [
172+
harvid
173+
xjadeo
174+
];
175+
176+
wafConfigureFlags = [
177+
"--cxx17"
178+
"--docs"
179+
"--freedesktop"
180+
"--no-phone-home"
181+
"--ptformat"
182+
"--run-tests"
183+
"--test"
184+
# since we don't have https://github.com/agfline/LibAAF yet,
185+
# we need to use some of ardours internal libs, see:
186+
# https://discourse.ardour.org/t/ardour-8-2-released/109615/6
187+
# and
188+
# https://discourse.ardour.org/t/ardour-8-2-released/109615/8
189+
# "--use-external-libs"
190+
]
191+
++ lib.optional optimize "--optimize";
192+
193+
postInstall = ''
194+
# wscript does not install these for some reason
195+
install -vDm 644 "build/gtk2_ardour/ardour.xml" \
196+
-t "$out/share/mime/packages"
197+
install -vDm 644 "build/gtk2_ardour/ardour${majorVersion}.desktop" \
198+
-t "$out/share/applications"
199+
for size in 16 22 32 48 256 512; do
200+
install -vDm 644 "gtk2_ardour/resources/Ardour-icon_''${size}px.png" \
201+
"$out/share/icons/hicolor/''${size}x''${size}/apps/ardour${majorVersion}.png"
202+
done
203+
install -vDm 644 "ardour.1"* -t "$out/share/man/man1"
204+
205+
# install additional bundled beats, chords and progressions
206+
cp -rp "${finalAttrs.bundledContent}"/* "$out/share/ardour${majorVersion}/media"
207+
''
208+
+ lib.optionalString videoSupport ''
209+
# `harvid` and `xjadeo` must be accessible in `PATH` for video to work.
210+
wrapProgram "$out/bin/ardour${majorVersion}" \
211+
--prefix PATH : "${
212+
lib.makeBinPath [
213+
harvid
214+
xjadeo
215+
]
216+
}"
217+
'';
218+
219+
LINKFLAGS = "-lpthread";
220+
221+
meta = {
222+
description = "Multi-track hard disk recording software";
223+
longDescription = ''
224+
Ardour is a digital audio workstation (DAW), You can use it to
225+
record, edit and mix multi-track audio and midi. Produce your
226+
own CDs. Mix video soundtracks. Experiment with new ideas about
227+
music and sound.
228+
229+
Please consider supporting the ardour project financially:
230+
https://community.ardour.org/donate
231+
'';
232+
homepage = "https://ardour.org/";
233+
license = lib.licenses.gpl2Plus;
234+
mainProgram = "ardour8";
235+
platforms = lib.platforms.linux;
236+
maintainers = with lib.maintainers; [
237+
magnetophon
238+
mitchmindtree
239+
ryand56
240+
];
241+
};
242+
}
243+
)

0 commit comments

Comments
 (0)