summary refs log tree commit diff
path: root/pkgs/applications/audio/soundtracker/default.nix
blob: 251725ea6b29c048241f57df9dcd97ce6da3c358 (plain) (blame)
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
{ lib, stdenv
, fetchurl
, pkg-config
, autoreconfHook
, gtk2
, alsa-lib
, SDL
, jack2
, audiofile
, goocanvas # graphical envelope editing
}:

stdenv.mkDerivation rec {
  pname = "soundtracker";
  version = "1.0.2.1";

  src = fetchurl {
    # Past releases get moved to the "old releases" directory.
    # Only the latest release is at the top level.
    # Nonetheless, only the name of the file seems to affect which file is
    # downloaded, so this path should be fine both for old and current releases.
    url = "mirror://sourceforge/soundtracker/soundtracker-${version}.tar.xz";
    sha256 = "0nh0dwz8nldc040q6n06vlazhss8ms42r2dffhjcrqj3hbrvfx82";
  };

  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    # Darwin binutils don't support D option for ar
    # ALSA macros are missing on Darwin, causing error
    substituteInPlace configure.ac \
      --replace ARFLAGS=crD ARFLAGS=cru \
      --replace AM_PATH_ALSA '#AM_PATH_ALSA'
    # Avoid X11-specific workaround code on more than just Windows
    substituteInPlace app/keys.c \
      --replace '!defined(_WIN32)' '!defined(_WIN32) && !defined(__APPLE__)'
    # "The application with bundle ID (null) is running setugid(), which is not allowed."
    sed -i -e '/seteuid/d' -e '/setegid/d' app/main.c
  '';

  configureFlags = [
    "--with-graphics-backend=gdk"
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    "--disable-alsa"
  ];

  enableParallelBuilding = true;

  nativeBuildInputs = [
    pkg-config
    autoreconfHook
  ];

  buildInputs = [
    gtk2
    SDL
    jack2
    audiofile
    goocanvas
  ] ++ lib.optional stdenv.isLinux alsa-lib;

  meta = with lib; {
    description = "A music tracking tool similar in design to the DOS program FastTracker and the Amiga legend ProTracker";
    longDescription = ''
      SoundTracker is a pattern-oriented music editor (similar to the DOS
      program 'FastTracker'). Samples are lined up on tracks and patterns
      which are then arranged to a song. Supported module formats are XM and
      MOD; the player code is the one from OpenCP. A basic sample recorder
      and editor is also included.
    '';
    homepage = "http://www.soundtracker.org/";
    downloadPage = "https://sourceforge.net/projects/soundtracker/files/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ fgaz ];
    platforms = platforms.all;
  };
}