vifm: 0.13 -> 0.14 (#380559)
[NixPkgs.git] / pkgs / by-name / te / tenacity / package.nix
blob645549e63b36e1bb618c3edea3149d675e23ab8f
2   stdenv,
3   lib,
4   fetchFromGitea,
5   cmake,
6   wxGTK32,
7   gtk3,
8   pkg-config,
9   python3,
10   gettext,
11   glib,
12   file,
13   lame,
14   libvorbis,
15   libmad,
16   libjack2,
17   lv2,
18   lilv,
19   makeWrapper,
20   serd,
21   sord,
22   sqlite,
23   sratom,
24   suil,
25   alsa-lib,
26   libsndfile,
27   soxr,
28   flac,
29   twolame,
30   expat,
31   libid3tag,
32   libopus,
33   ffmpeg,
34   soundtouch,
35   pcre,
36   portaudio,
37   linuxHeaders,
38   at-spi2-core,
39   dbus,
40   libepoxy,
41   libXdmcp,
42   libXtst,
43   libpthreadstubs,
44   libselinux,
45   libsepol,
46   libxkbcommon,
47   util-linux,
50 stdenv.mkDerivation rec {
51   pname = "tenacity";
52   version = "1.3.3";
54   src = fetchFromGitea {
55     domain = "codeberg.org";
56     owner = "tenacityteam";
57     repo = pname;
58     fetchSubmodules = true;
59     rev = "v${version}";
60     hash = "sha256-UU3iKfab6en4IyGlpNLUhOil3snzaZ2nI6JMqoL6DUs=";
61   };
63   postPatch = ''
64     mkdir -p build/src/private
65     touch build/src/private/RevisionIdent.h
67     substituteInPlace libraries/lib-files/FileNames.cpp \
68          --replace /usr/include/linux/magic.h \
69                    ${linuxHeaders}/include/linux/magic.h
70   '';
72   postFixup = ''
73     rm $out/tenacity
74     wrapProgram "$out/bin/tenacity" \
75       --suffix AUDACITY_PATH : "$out/share/tenacity" \
76       --suffix AUDACITY_MODULES_PATH : "$out/lib/tenacity/modules" \
77       --prefix LD_LIBRARY_PATH : "$out/lib/tenacity" \
78       --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH"
79   '';
81   env.NIX_CFLAGS_COMPILE = "-D GIT_DESCRIBE=\"\"";
83   # tenacity only looks for ffmpeg at runtime, so we need to link it in manually
84   NIX_LDFLAGS = toString [
85     "-lavcodec"
86     "-lavdevice"
87     "-lavfilter"
88     "-lavformat"
89     "-lavutil"
90     "-lpostproc"
91     "-lswresample"
92     "-lswscale"
93   ];
95   nativeBuildInputs =
96     [
97       cmake
98       gettext
99       makeWrapper
100       pkg-config
101       python3
102     ]
103     ++ lib.optionals stdenv.hostPlatform.isLinux [
104       linuxHeaders
105     ];
107   buildInputs =
108     [
109       alsa-lib
110       expat
111       ffmpeg
112       file
113       flac
114       glib
115       lame
116       libid3tag
117       libjack2
118       libmad
119       libopus
120       libsndfile
121       libvorbis
122       lilv
123       lv2
124       pcre
125       portaudio
126       serd
127       sord
128       soundtouch
129       soxr
130       sqlite
131       sratom
132       suil
133       twolame
134       wxGTK32
135       gtk3
136     ]
137     ++ lib.optionals stdenv.hostPlatform.isLinux [
138       at-spi2-core
139       dbus
140       libepoxy
141       libXdmcp
142       libXtst
143       libpthreadstubs
144       libxkbcommon
145       libselinux
146       libsepol
147       util-linux
148     ];
150   cmakeFlags = [
151     # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
152     "-DCMAKE_SKIP_BUILD_RPATH=ON"
153   ];
155   meta = with lib; {
156     description = "Sound editor with graphical UI";
157     mainProgram = "tenacity";
158     homepage = "https://tenacityaudio.org/";
159     license = licenses.gpl2Plus;
160     maintainers = with maintainers; [ irenes ];
161     platforms = platforms.linux;
162   };