evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / sy / synthesia / package.nix
blob78c82dd010ddf751a2a21e46c925b28e503846e2
1 { lib
2 , fetchurl
3 , stdenvNoCC
4 , runtimeShell
5 , copyDesktopItems
6 , makeDesktopItem
7 , wineWowPackages
8 }:
10 let
11   icon = fetchurl {
12     name = "synthesia.png";
13     url = "https://cdn.synthesia.app/images/headerIcon.png";
14     hash = "sha256-M9cQqHwwjko5pchdNtIMjYwd4joIvBphAYnpw73qYzM=";
15   };
17 stdenvNoCC.mkDerivation rec {
18   pname = "synthesia";
19   version = "10.9";
21   desktopItems = [
22     (makeDesktopItem {
23       name = "synthesia";
24       desktopName = "Synthesia";
25       comment = meta.description;
26       exec = "synthesia";
27       icon = "synthesia";
28       categories = [ "Game" "Audio" ];
29       startupWMClass = "synthesia.exe";
30     })
31   ];
33   nativeBuildInputs = [
34     copyDesktopItems
35     wineWowPackages.stable
36   ];
38   src = fetchurl {
39     url = "https://cdn.synthesia.app/files/Synthesia-${version}-installer.exe";
40     hash = "sha256-BFTsbesfMqxY1731ss6S0w8BcUaoqjVrr62VeU1BfrU=";
41   };
43   dontUnpack = true;
45   dontBuild = true;
47   installPhase = ''
48     runHook preInstall
49     mkdir -p $out/bin
50     cat <<'EOF' > $out/bin/synthesia
51     #!${runtimeShell}
52     export PATH=${wineWowPackages.stable}/bin:$PATH
53     export WINEARCH=win64
54     export WINEPREFIX="''${SYNTHESIA_HOME:-"''${XDG_DATA_HOME:-"''${HOME}/.local/share"}/synthesia"}/wine"
55     export WINEDLLOVERRIDES="mscoree=" # disable mono
56     if [ ! -d "$WINEPREFIX" ] ; then
57       mkdir -p "$WINEPREFIX"
58       wine ${src} /S
59     fi
60     wine "$WINEPREFIX/drive_c/Program Files (x86)/Synthesia/Synthesia.exe"
61     EOF
62     chmod +x $out/bin/synthesia
63     install -Dm644 ${icon} $out/share/icons/hicolor/48x48/apps/synthesia.png
64     runHook postInstall
65   '';
67   meta = with lib; {
68     description = "A fun way to learn how to play the piano";
69     homepage = "https://synthesiagame.com/";
70     downloadPage = "https://synthesiagame.com/download";
71     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
72     license = licenses.unfree;
73     maintainers = with maintainers; [ ners ];
74     platforms = wineWowPackages.stable.meta.platforms;
75   };