nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 alsa-lib,
6 libjack2,
7 pkg-config,
8 libX11,
9 libXext,
10 xorgproto,
11 libpulseaudio,
12 copyDesktopItems,
13 makeDesktopItem,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "bristol";
18 version = "0.60.11";
19
20 src = fetchurl {
21 url = "mirror://sourceforge/bristol/${pname}-${version}.tar.gz";
22 hash = "sha256-fR8LvQ19MD/HfGuVSbYXCNeoO03AB4GAEbH1XR+pIro=";
23 };
24
25 nativeBuildInputs = [
26 pkg-config
27 copyDesktopItems
28 ];
29
30 buildInputs = [
31 alsa-lib
32 libjack2
33 libpulseaudio
34 libX11
35 libXext
36 xorgproto
37 ];
38
39 postPatch = ''
40 sed -i '41,43d' libbristolaudio/audioEngineJack.c # disable alsa/iatomic
41 sed -i '35i void doPitchWheel(Baudio *baudio);' bristol/bristolmemorymoog.c
42 '';
43
44 configureFlags = [
45 "--enable-jack-default-audio"
46 "--enable-jack-default-midi"
47 ];
48
49 # Workaround build failure on -fno-common toolchains like upstream
50 # gcc-10. Otherwise build fails as:
51 # ld: brightonCLI.o:/build/bristol-0.60.11/brighton/brightonCLI.c:139: multiple definition of
52 # `event'; brightonMixerMenu.o:/build/bristol-0.60.11/brighton/brightonMixerMenu.c:1182: first defined here
53 env.NIX_CFLAGS_COMPILE = "-fcommon -Wno-implicit-int";
54
55 preInstall = ''
56 sed -e "s@\`which bristol\`@$out/bin/bristol@g" -i bin/startBristol
57 sed -e "s@\`which brighton\`@$out/bin/brighton@g" -i bin/startBristol
58 '';
59
60 postInstall = ''
61 mkdir -p $out/share/icons/hicolor/scalable/apps/
62 ln -s $out/share/bristol/bitmaps/bicon.svg $out/share/icons/hicolor/scalable/apps/
63 '';
64
65 desktopItems = [
66 (makeDesktopItem {
67 name = "Bristol";
68 exec = "bristol";
69 icon = "bicon";
70 desktopName = "Bristol";
71 comment = "Graphical user interface for the Bristol synthesizer emulator";
72 categories = [ "AudioVideo" ];
73 })
74 ];
75
76 meta = {
77 description = "Range of synthesiser, electric piano and organ emulations";
78 homepage = "https://bristol.sourceforge.net";
79 license = lib.licenses.gpl3;
80 platforms = [
81 "x86_64-linux"
82 "i686-linux"
83 ];
84 maintainers = [ ];
85 };
86}