sm64ex-coop: init at 0.pre+date=2022-05-14

+134 -61
+44 -60
pkgs/games/sm64ex/default.nix
··· 1 - { lib, stdenv 1 + { lib 2 + , stdenv 2 3 , fetchFromGitHub 3 - , python3 4 - , pkg-config 5 - , audiofile 6 - , SDL2 7 - , hexdump 8 - , requireFile 9 - , compileFlags ? [ ] 10 - , region ? "us" 11 - , baseRom ? requireFile { 12 - name = "baserom.${region}.z64"; 13 - message = '' 14 - This nix expression requires that baserom.${region}.z64 is 15 - already part of the store. To get this file you can dump your Super Mario 64 cartridge's contents 16 - and add it to the nix store with nix-store --add-fixed sha256 <FILE>. 17 - Note that if you are not using a US baserom, you must overwrite the "region" attribute with either "eu" or "jp". 18 - ''; 19 - sha256 = { 20 - "us" = "17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91"; 21 - "eu" = "c792e5ebcba34c8d98c0c44cf29747c8ee67e7b907fcc77887f9ff2523f80572"; 22 - "jp" = "9cf7a80db321b07a8d461fe536c02c87b7412433953891cdec9191bfad2db317"; 23 - }.${region}; 24 - } 4 + , callPackage 5 + , autoPatchelfHook 6 + , branch 25 7 }: 26 8 27 - stdenv.mkDerivation rec { 28 - pname = "sm64ex"; 29 - version = "unstable-2021-11-30"; 30 - 31 - src = fetchFromGitHub { 32 - owner = "sm64pc"; 33 - repo = "sm64ex"; 34 - rev = "db9a6345baa5acb41f9d77c480510442cab26025"; 35 - sha256 = "sha256-q7JWDvNeNrDpcKVtIGqB1k7I0FveYwrfqu7ZZK7T8F8="; 36 - }; 37 - 38 - nativeBuildInputs = [ python3 pkg-config ]; 39 - buildInputs = [ audiofile SDL2 hexdump ]; 9 + { 10 + sm64ex = callPackage ./generic.nix { 11 + pname = "sm64ex"; 12 + version = "0.pre+date=2021-11-30"; 40 13 41 - makeFlags = [ "VERSION=${region}" ] ++ compileFlags 42 - ++ lib.optionals stdenv.isDarwin [ "OSX_BUILD=1" ]; 14 + src = fetchFromGitHub { 15 + owner = "sm64pc"; 16 + repo = "sm64ex"; 17 + rev = "db9a6345baa5acb41f9d77c480510442cab26025"; 18 + sha256 = "sha256-q7JWDvNeNrDpcKVtIGqB1k7I0FveYwrfqu7ZZK7T8F8="; 19 + }; 43 20 44 - inherit baseRom; 21 + extraMeta = { 22 + homepage = "https://github.com/sm64pc/sm64ex"; 23 + description = "Super Mario 64 port based off of decompilation"; 24 + }; 25 + }; 45 26 46 - preBuild = '' 47 - patchShebangs extract_assets.py 48 - cp $baseRom ./baserom.${region}.z64 49 - ''; 27 + sm64ex-coop = callPackage ./generic.nix { 28 + pname = "sm64ex-coop"; 29 + version = "0.pre+date=2022-05-14"; 50 30 51 - installPhase = '' 52 - mkdir -p $out/bin 53 - cp build/${region}_pc/sm64.${region}.f3dex2e $out/bin/sm64ex 54 - ''; 31 + src = fetchFromGitHub { 32 + owner = "djoslin0"; 33 + repo = "sm64ex-coop"; 34 + rev = "8200b175607fe2939f067d496627c202a15fe24c"; 35 + sha256 = "sha256-c1ZmMBtvYYcaJ/WxkZBVvNGVCeSXfm8NKe/BiAIJtks="; 36 + }; 55 37 56 - enableParallelBuilding = true; 38 + extraNativeBuildInputs = [ 39 + autoPatchelfHook 40 + ]; 57 41 58 - meta = with lib; { 59 - homepage = "https://github.com/sm64pc/sm64ex"; 60 - description = "Super Mario 64 port based off of decompilation"; 61 - longDescription = '' 62 - Super Mario 64 port based off of decompilation. 63 - Note that you must supply a baserom yourself to extract assets from. 64 - If you are not using an US baserom, you must overwrite the "region" attribute with either "eu" or "jp". 65 - If you would like to use patches sm64ex distributes as makeflags, add them to the "compileFlags" attribute. 42 + postInstall = let 43 + sharedLib = stdenv.hostPlatform.extensions.sharedLibrary; 44 + in '' 45 + mkdir -p $out/lib 46 + cp $src/lib/bass/libbass{,_fx}${sharedLib} $out/lib 47 + cp $src/lib/discordsdk/libdiscord_game_sdk${sharedLib} $out/lib 66 48 ''; 67 - license = licenses.unfree; 68 - maintainers = with maintainers; [ ivar ]; 69 - platforms = platforms.unix; 49 + 50 + extraMeta = { 51 + homepage = "https://github.com/djoslin0/sm64ex-coop"; 52 + description = "Super Mario 64 online co-op mod, forked from sm64ex"; 53 + }; 70 54 }; 71 - } 55 + }.${branch}
+83
pkgs/games/sm64ex/generic.nix
··· 1 + { pname 2 + , version 3 + , src 4 + , extraNativeBuildInputs ? [ ] 5 + , extraMeta ? {} 6 + , compileFlags ? [ ] 7 + , postInstall ? "" 8 + , region ? "us" 9 + 10 + , lib 11 + , stdenv 12 + , fetchFromGitHub 13 + , python3 14 + , pkg-config 15 + , audiofile 16 + , SDL2 17 + , hexdump 18 + , requireFile 19 + , baseRom ? requireFile { 20 + name = "baserom.${region}.z64"; 21 + message = '' 22 + This nix expression requires that baserom.${region}.z64 is 23 + already part of the store. To get this file you can dump your Super Mario 64 cartridge's contents 24 + and add it to the nix store with nix-store --add-fixed sha256 <FILE>. 25 + Note that if you are not using a US baserom, you must overwrite the "region" attribute with either "eu" or "jp". 26 + ''; 27 + sha256 = { 28 + "us" = "17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91"; 29 + "eu" = "c792e5ebcba34c8d98c0c44cf29747c8ee67e7b907fcc77887f9ff2523f80572"; 30 + "jp" = "9cf7a80db321b07a8d461fe536c02c87b7412433953891cdec9191bfad2db317"; 31 + }.${region}; 32 + } 33 + }: 34 + 35 + stdenv.mkDerivation rec { 36 + inherit pname version src postInstall; 37 + 38 + nativeBuildInputs = [ 39 + python3 40 + pkg-config 41 + hexdump 42 + ] ++ extraNativeBuildInputs; 43 + 44 + buildInputs = [ 45 + audiofile 46 + SDL2 47 + ]; 48 + 49 + enableParallelBuilding = true; 50 + 51 + makeFlags = [ 52 + "VERSION=${region}" 53 + ] ++ lib.optionals stdenv.isDarwin [ 54 + "OSX_BUILD=1" 55 + ] ++ compileFlags; 56 + 57 + preBuild = '' 58 + patchShebangs extract_assets.py 59 + ln -s ${baseRom} ./baserom.${region}.z64 60 + ''; 61 + 62 + installPhase = '' 63 + runHook preInstall 64 + 65 + mkdir -p $out/bin 66 + cp build/${region}_pc/sm64.${region}.f3dex2e $out/bin/sm64ex 67 + 68 + runHook postInstall 69 + ''; 70 + 71 + meta = with lib; { 72 + longDescription = 73 + extraMeta.description or "Super Mario 64 port based off of decompilation" + "\n" + '' 74 + Note that you must supply a baserom yourself to extract assets from. 75 + If you are not using an US baserom, you must overwrite the "region" attribute with either "eu" or "jp". 76 + If you would like to use patches sm64ex distributes as makeflags, add them to the "compileFlags" attribute. 77 + ''; 78 + mainProgram = "sm64ex"; 79 + license = licenses.unfree; 80 + maintainers = with maintainers; [ ivar ]; 81 + platforms = platforms.unix; 82 + } // extraMeta; 83 + }
+7 -1
pkgs/top-level/all-packages.nix
··· 31411 31411 31412 31412 runescape = callPackage ../games/runescape-launcher { }; 31413 31413 31414 - sm64ex = callPackage ../games/sm64ex { }; 31414 + sm64ex = callPackage ../games/sm64ex { 31415 + branch = "sm64ex"; 31416 + }; 31417 + 31418 + sm64ex-coop = callPackage ../games/sm64ex { 31419 + branch = "sm64ex-coop"; 31420 + }; 31415 31421 31416 31422 snipes = callPackage ../games/snipes { }; 31417 31423