forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / so / soundtracker / package.nix
blob36f90e67a6394f7a0f6a0c23f59f328a35e4fef4
1 { lib, stdenv
2 , fetchzip
3 , pkg-config
4 , autoreconfHook
5 , gtk2
6 , alsa-lib
7 , SDL
8 , jack2
9 , audiofile
10 , goocanvas # graphical envelope editing
11 , libxml2
12 , libsndfile
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "soundtracker";
17   version = "1.0.5";
19   src = fetchzip {
20     # Past releases get moved to the "old releases" directory.
21     # Only the latest release is at the top level.
22     # Nonetheless, only the name of the file seems to affect which file is
23     # downloaded, so this path should be fine both for old and current releases.
24     url = "mirror://sourceforge/soundtracker/soundtracker-${finalAttrs.version}.tar.xz";
25     hash = "sha256-g96Z1SdFGMq7WFI6x+UtmAHPZF0C+tHUOjNhmK2ld8I=";
26   };
28   postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
29     # Darwin binutils don't support D option for ar
30     # ALSA macros are missing on Darwin, causing error
31     substituteInPlace configure.ac \
32       --replace ARFLAGS=crD ARFLAGS=cru \
33       --replace AM_PATH_ALSA '#AM_PATH_ALSA'
34     # Avoid X11-specific workaround code on more than just Windows
35     substituteInPlace app/keys.c \
36       --replace '!defined(_WIN32)' '!defined(_WIN32) && !defined(__APPLE__)'
37     # "The application with bundle ID (null) is running setugid(), which is not allowed."
38     sed -i -e '/seteuid/d' -e '/setegid/d' app/main.c
39   '';
41   configureFlags = [
42     "--with-graphics-backend=gdk"
43   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
44     "--disable-alsa"
45   ];
47   enableParallelBuilding = true;
49   nativeBuildInputs = [
50     pkg-config
51     autoreconfHook
52   ];
54   buildInputs = [
55     gtk2
56     SDL
57     jack2
58     audiofile
59     goocanvas
60     libxml2
61     libsndfile
62   ] ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib;
64   meta = with lib; {
65     description = "Music tracking tool similar in design to the DOS program FastTracker and the Amiga legend ProTracker";
66     longDescription = ''
67       SoundTracker is a pattern-oriented music editor (similar to the DOS
68       program 'FastTracker'). Samples are lined up on tracks and patterns
69       which are then arranged to a song. Supported module formats are XM and
70       MOD; the player code is the one from OpenCP. A basic sample recorder
71       and editor is also included.
72     '';
73     homepage = "http://www.soundtracker.org/";
74     downloadPage = "https://sourceforge.net/projects/soundtracker/files/";
75     license = licenses.gpl2Plus;
76     maintainers = with maintainers; [ fgaz ];
77     platforms = platforms.all;
78     hydraPlatforms = platforms.linux; # sdl-config times out on darwin
79   };