audiobookshelf: 2.18.1 -> 2.19.0 (#378967)
[NixPkgs.git] / pkgs / by-name / ul / ultrastardx / package.nix
blob483b9e95785f8aef94f2ca86dd38630f95565241
2   lib,
3   stdenv,
4   autoreconfHook,
5   fetchFromGitHub,
6   pkg-config,
7   lua,
8   fpc,
9   pcre,
10   portaudio,
11   freetype,
12   libpng,
13   SDL2,
14   SDL2_image,
15   SDL2_gfx,
16   SDL2_mixer,
17   SDL2_net,
18   SDL2_ttf,
19   ffmpeg,
20   sqlite,
21   zlib,
22   libX11,
23   libGLU,
24   libGL,
27 let
28   sharedLibs = [
29     pcre
30     portaudio
31     freetype
32     SDL2
33     SDL2_image
34     SDL2_gfx
35     SDL2_mixer
36     SDL2_net
37     SDL2_ttf
38     sqlite
39     lua
40     zlib
41     libX11
42     libGLU
43     libGL
44     ffmpeg
45   ];
48 stdenv.mkDerivation rec {
49   pname = "ultrastardx";
50   version = "2025.1.0";
52   src = fetchFromGitHub {
53     owner = "UltraStar-Deluxe";
54     repo = "USDX";
55     rev = "v${version}";
56     hash = "sha256-8/qFzPP3Gw9YAGsnyI+wJUP3Jo8UoZkihRgYg4P5MVo=";
57   };
59   nativeBuildInputs = [
60     pkg-config
61     autoreconfHook
62   ];
63   buildInputs = [
64     fpc
65     libpng
66   ] ++ sharedLibs;
68   postPatch = ''
69     substituteInPlace src/config.inc.in \
70       --subst-var-by libpcre_LIBNAME libpcre.so.1
71   '';
73   preBuild =
74     let
75       items = lib.concatMapStringsSep " " (x: "-rpath ${lib.getLib x}/lib") sharedLibs;
76     in
77     ''
78       export NIX_LDFLAGS="$NIX_LDFLAGS ${items}"
79     '';
81   # dlopened libgcc requires the rpath not to be shrinked
82   dontPatchELF = true;
84   meta = with lib; {
85     homepage = "https://usdx.eu/";
86     description = "Free and open source karaoke game";
87     mainProgram = "ultrastardx";
88     license = licenses.gpl2Plus;
89     maintainers = with maintainers; [ Profpatsch ];
90     platforms = platforms.linux;
91   };