From 9aa9450e4ca99a855966aa460eeb8fbc17f7299f Mon Sep 17 00:00:00 2001 From: Ivar Scholten Date: Sun, 18 Sep 2022 21:33:03 +0200 Subject: [PATCH] sm64ex-coop: 0.pre+date=2022-05-14 -> 0.pre+date=2022-08-05, cleanup --- pkgs/games/sm64ex/coop.nix | 41 +++++++++++++++++++++++++++ pkgs/games/sm64ex/default.nix | 52 ++--------------------------------- pkgs/games/sm64ex/generic.nix | 5 ++-- pkgs/games/sm64ex/sm64ex.nix | 21 ++++++++++++++ 4 files changed, 68 insertions(+), 51 deletions(-) create mode 100644 pkgs/games/sm64ex/coop.nix create mode 100644 pkgs/games/sm64ex/sm64ex.nix diff --git a/pkgs/games/sm64ex/coop.nix b/pkgs/games/sm64ex/coop.nix new file mode 100644 index 000000000000..9e34e184adb7 --- /dev/null +++ b/pkgs/games/sm64ex/coop.nix @@ -0,0 +1,41 @@ +{ callPackage +, fetchFromGitHub +, autoPatchelfHook +, zlib +, stdenvNoCC +}: + +callPackage ./generic.nix { + pname = "sm64ex-coop"; + version = "0.pre+date=2022-08-05"; + + src = fetchFromGitHub { + owner = "djoslin0"; + repo = "sm64ex-coop"; + rev = "68634493de4cdd9db263e0f4f0b9b6772a60d30a"; + sha256 = "sha256-3Ve93WGyBd8SAA0TBrpIrhj+ernjn1q7qXSi9mp36cQ="; + }; + + extraNativeBuildInputs = [ + autoPatchelfHook + ]; + + extraBuildInputs = [ + zlib + ]; + + postInstall = + let + sharedLib = stdenvNoCC.hostPlatform.extensions.sharedLibrary; + in + '' + mkdir -p $out/lib + cp $src/lib/bass/libbass{,_fx}${sharedLib} $out/lib + cp $src/lib/discordsdk/libdiscord_game_sdk${sharedLib} $out/lib + ''; + + extraMeta = { + homepage = "https://github.com/djoslin0/sm64ex-coop"; + description = "Super Mario 64 online co-op mod, forked from sm64ex"; + }; +} diff --git a/pkgs/games/sm64ex/default.nix b/pkgs/games/sm64ex/default.nix index a6bf7202adcf..17fcfdd131ac 100644 --- a/pkgs/games/sm64ex/default.nix +++ b/pkgs/games/sm64ex/default.nix @@ -1,55 +1,9 @@ -{ lib -, stdenv -, fetchFromGitHub -, callPackage -, autoPatchelfHook +{ callPackage , branch }: { - sm64ex = callPackage ./generic.nix { - pname = "sm64ex"; - version = "0.pre+date=2021-11-30"; + sm64ex = callPackage ./sm64ex.nix { }; - src = fetchFromGitHub { - owner = "sm64pc"; - repo = "sm64ex"; - rev = "db9a6345baa5acb41f9d77c480510442cab26025"; - sha256 = "sha256-q7JWDvNeNrDpcKVtIGqB1k7I0FveYwrfqu7ZZK7T8F8="; - }; - - extraMeta = { - homepage = "https://github.com/sm64pc/sm64ex"; - description = "Super Mario 64 port based off of decompilation"; - }; - }; - - sm64ex-coop = callPackage ./generic.nix { - pname = "sm64ex-coop"; - version = "0.pre+date=2022-05-14"; - - src = fetchFromGitHub { - owner = "djoslin0"; - repo = "sm64ex-coop"; - rev = "8200b175607fe2939f067d496627c202a15fe24c"; - sha256 = "sha256-c1ZmMBtvYYcaJ/WxkZBVvNGVCeSXfm8NKe/BiAIJtks="; - }; - - extraNativeBuildInputs = [ - autoPatchelfHook - ]; - - postInstall = let - sharedLib = stdenv.hostPlatform.extensions.sharedLibrary; - in '' - mkdir -p $out/lib - cp $src/lib/bass/libbass{,_fx}${sharedLib} $out/lib - cp $src/lib/discordsdk/libdiscord_game_sdk${sharedLib} $out/lib - ''; - - extraMeta = { - homepage = "https://github.com/djoslin0/sm64ex-coop"; - description = "Super Mario 64 online co-op mod, forked from sm64ex"; - }; - }; + sm64ex-coop = callPackage ./coop.nix { }; }.${branch} diff --git a/pkgs/games/sm64ex/generic.nix b/pkgs/games/sm64ex/generic.nix index ab75ac70b9c5..95ba3be4a569 100644 --- a/pkgs/games/sm64ex/generic.nix +++ b/pkgs/games/sm64ex/generic.nix @@ -2,7 +2,8 @@ , version , src , extraNativeBuildInputs ? [ ] -, extraMeta ? {} +, extraBuildInputs ? [ ] +, extraMeta ? { } , compileFlags ? [ ] , postInstall ? "" , region ? "us" @@ -44,7 +45,7 @@ stdenv.mkDerivation rec { buildInputs = [ audiofile SDL2 - ]; + ] ++ extraBuildInputs; enableParallelBuilding = true; diff --git a/pkgs/games/sm64ex/sm64ex.nix b/pkgs/games/sm64ex/sm64ex.nix new file mode 100644 index 000000000000..66c84dd0b13c --- /dev/null +++ b/pkgs/games/sm64ex/sm64ex.nix @@ -0,0 +1,21 @@ +{ callPackage +, fetchFromGitHub +}: + +callPackage ./generic.nix { + pname = "sm64ex"; + version = "0.pre+date=2021-11-30"; + + src = fetchFromGitHub { + owner = "sm64pc"; + repo = "sm64ex"; + rev = "db9a6345baa5acb41f9d77c480510442cab26025"; + sha256 = "sha256-q7JWDvNeNrDpcKVtIGqB1k7I0FveYwrfqu7ZZK7T8F8="; + }; + + extraMeta = { + homepage = "https://github.com/sm64pc/sm64ex"; + description = "Super Mario 64 port based off of decompilation"; + }; +} +