at main 2.3 kB view raw
1{ 2 lib, 3 stdenvNoCC, 4 fetchurl, 5 appimageTools, 6 makeWrapper, 7 nativeWayland ? false, 8 9 version, 10 hash, 11}: 12 13let 14 pname = "osu-lazer-bin"; 15 16 src = fetchurl { 17 inherit hash; 18 url = "https://github.com/ppy/osu/releases/download/${version}/osu.AppImage"; 19 }; 20 21 meta = { 22 description = "Rhythm is just a *click* away (tachyon, patched drv)"; 23 homepage = "https://osu.ppy.sh"; 24 license = with lib.licenses; [ 25 mit 26 cc-by-nc-40 27 unfreeRedistributable # osu-framework contains libbass.so in repository 28 ]; 29 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 30 maintainers = with lib.maintainers; [ 31 gepbird 32 stepbrobd 33 Guanran928 34 soopyc 35 ]; 36 mainProgram = "osu!"; 37 platforms = [ 38 "x86_64-linux" 39 ]; 40 }; 41 42 passthru.updateScript = ./update.sh; 43in 44if stdenvNoCC.hostPlatform.isDarwin then 45 stdenvNoCC.mkDerivation { 46 inherit 47 pname 48 version 49 src 50 meta 51 passthru 52 ; 53 54 nativeBuildInputs = [ makeWrapper ]; 55 56 installPhase = '' 57 runHook preInstall 58 OSU_WRAPPER="$out/Applications/osu!.app/Contents" 59 OSU_CONTENTS="osu!.app/Contents" 60 mkdir -p "$OSU_WRAPPER/MacOS" 61 cp -r "$OSU_CONTENTS/Info.plist" "$OSU_CONTENTS/Resources" "$OSU_WRAPPER" 62 cp -r "osu!.app" "$OSU_WRAPPER/Resources/osu-wrapped.app" 63 makeWrapper "$OSU_WRAPPER/Resources/osu-wrapped.app/Contents/MacOS/osu!" "$OSU_WRAPPER/MacOS/osu!" --set OSU_EXTERNAL_UPDATE_PROVIDER 1 64 runHook postInstall 65 ''; 66 } 67else 68 appimageTools.wrapType2 { 69 inherit 70 pname 71 version 72 src 73 meta 74 passthru 75 ; 76 77 extraPkgs = pkgs: with pkgs; [ icu ]; 78 79 extraInstallCommands = 80 let 81 contents = appimageTools.extract { inherit pname version src; }; 82 in 83 '' 84 . ${makeWrapper}/nix-support/setup-hook 85 mv -v $out/bin/${pname} $out/bin/osu! 86 87 wrapProgram $out/bin/osu! \ 88 ${lib.optionalString nativeWayland "--set SDL_VIDEODRIVER wayland"} \ 89 --set OSU_EXTERNAL_UPDATE_PROVIDER 1 90 91 install -m 444 -D ${contents}/osu!.desktop -t $out/share/applications 92 for i in 16 32 48 64 96 128 256 512 1024; do 93 install -D ${contents}/osu.png $out/share/icons/hicolor/''${i}x$i/apps/osu.png 94 done 95 ''; 96 }