nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchzip,
5 pkg-config,
6 autoreconfHook,
7 gtk2,
8 alsa-lib,
9 SDL,
10 jack2,
11 audiofile,
12 goocanvas_1, # graphical envelope editing
13 libxml2,
14 libsndfile,
15 libpulseaudio,
16 glib,
17}:
18
19stdenv.mkDerivation (finalAttrs: {
20 pname = "soundtracker";
21 version = "1.0.5.1";
22
23 src = fetchzip {
24 # Past releases get moved to the "old releases" directory.
25 # Only the latest release is at the top level.
26 # Nonetheless, only the name of the file seems to affect which file is
27 # downloaded, so this path should be fine both for old and current releases.
28 url = "mirror://sourceforge/soundtracker/soundtracker-${finalAttrs.version}.tar.xz";
29 hash = "sha256-pvBCPPu8jBq9CFbSlKewEI+3t092zmtq+pbNLeJWU/8=";
30 };
31
32 postPatch = ''
33 substituteInPlace configure.ac \
34 --replace-fail 'AM_PATH_XML2(2.6.0, [], AC_MSG_ERROR(Fatal error: Need libxml2 >= 2.6.0))' \
35 'PKG_CHECK_MODULES([XML], [libxml-2.0 >= 2.6.0])' \
36 --replace-fail 'XML_CPPFLAGS' 'XML_CFLAGS'
37 ''
38 + lib.optionalString stdenv.hostPlatform.isDarwin ''
39 # Darwin binutils don't support D option for ar
40 # ALSA macros are missing on Darwin, causing error
41 substituteInPlace configure.ac \
42 --replace ARFLAGS=crD ARFLAGS=cru \
43 --replace AM_PATH_ALSA '#AM_PATH_ALSA'
44 # Avoid X11-specific workaround code on more than just Windows
45 substituteInPlace app/keys.c \
46 --replace '!defined(_WIN32)' '!defined(_WIN32) && !defined(__APPLE__)'
47 # "The application with bundle ID (null) is running setugid(), which is not allowed."
48 sed -i -e '/seteuid/d' -e '/setegid/d' app/main.c
49 '';
50
51 configureFlags = [
52 "--with-graphics-backend=gdk"
53 ]
54 ++ lib.optionals stdenv.hostPlatform.isDarwin [
55 "--disable-alsa"
56 ];
57
58 enableParallelBuilding = true;
59
60 strictDeps = true;
61
62 nativeBuildInputs = [
63 pkg-config
64 autoreconfHook
65 SDL # AM_PATH_SDL
66 glib # glib-genmarshal
67 ]
68 ++ lib.optionals stdenv.hostPlatform.isLinux [
69 alsa-lib # AM_PATH_ALSA
70 ];
71
72 buildInputs = [
73 gtk2
74 SDL # found by AM_PATH_SDL
75 jack2
76 audiofile
77 goocanvas_1
78 libxml2 # found by PKG_CHECK_MODULES
79 libsndfile
80 ]
81 ++ lib.optionals stdenv.hostPlatform.isLinux [
82 alsa-lib # found by AM_PATH_ALSA
83 libpulseaudio # found by PKG_CHECK_MODULES
84 ];
85
86 meta = {
87 description = "Music tracking tool similar in design to the DOS program FastTracker and the Amiga legend ProTracker";
88 longDescription = ''
89 SoundTracker is a pattern-oriented music editor (similar to the DOS
90 program 'FastTracker'). Samples are lined up on tracks and patterns
91 which are then arranged to a song. Supported module formats are XM and
92 MOD; the player code is the one from OpenCP. A basic sample recorder
93 and editor is also included.
94 '';
95 homepage = "http://www.soundtracker.org/";
96 downloadPage = "https://sourceforge.net/projects/soundtracker/files/";
97 license = lib.licenses.gpl2Plus;
98 maintainers = with lib.maintainers; [ fgaz ];
99 platforms = lib.platforms.all;
100 hydraPlatforms = lib.platforms.linux; # sdl-config times out on darwin
101 };
102})