diff --git a/pkgs/development/libraries/tinyxml-2/default.nix b/pkgs/development/libraries/tinyxml-2/default.nix index c576405bb3b6..93500e17b7d4 100644 --- a/pkgs/development/libraries/tinyxml-2/default.nix +++ b/pkgs/development/libraries/tinyxml-2/default.nix @@ -2,17 +2,25 @@ stdenv.mkDerivation rec { pname = "tinyxml-2"; - version = "6.0.0"; + version = "9.0.0"; src = fetchFromGitHub { repo = "tinyxml2"; owner = "leethomason"; rev = version; - sha256 = "031fmhpah449h3rkyamzzdpzccrrfrvjb4qn6vx2vjm47jwc54qv"; + sha256 = "sha256-AQQOctXi7sWIH/VOeSUClX6hlm1raEQUOp+VoPjLM14="; }; nativeBuildInputs = [ cmake ]; + cmakeFlags = [ + # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly + # (setting it to an absolute path causes include files to go to $out/$out/include, + # because the absolute path is interpreted with root at $out). + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBDIR=lib" + ]; + meta = { description = "A simple, small, efficient, C++ XML parser"; homepage = "https://www.grinninglizard.com/tinyxml2/index.html"; diff --git a/pkgs/games/vvvvvv/default.nix b/pkgs/games/vvvvvv/default.nix new file mode 100644 index 000000000000..b6d0d59367e2 --- /dev/null +++ b/pkgs/games/vvvvvv/default.nix @@ -0,0 +1,93 @@ +{ stdenv +, lib +, fetchFromGitHub +, fetchurl +, cmake +, makeWrapper +, copyDesktopItems +, makeDesktopItem +, physfs +, SDL2 +, SDL2_mixer +, tinyxml-2 +, utf8cpp +, Foundation +, IOKit +, makeAndPlay ? false +}: + +stdenv.mkDerivation rec { + pname = "vvvvvv"; + version = "2.3.6"; + + src = fetchFromGitHub { + owner = "TerryCavanagh"; + repo = "VVVVVV"; + rev = version; + sha256 = "sha256-sLNO4vkmlirsqJmCV9YWpyNnIiigU1KMls7rOgWgSmQ="; + }; + sourceRoot = "source/desktop_version"; + dataZip = fetchurl { + url = "https://thelettervsixtim.es/makeandplay/data.zip"; + name = "data.zip"; + sha256 = "sha256-x2eAlZT2Ry2p9WE252ZX44ZA1YQWSkYRIlCsYpPswOo="; + meta.license = lib.licenses.unfree; + }; + + nativeBuildInputs = [ + cmake + makeWrapper + copyDesktopItems + ]; + + buildInputs = [ + physfs + SDL2 + SDL2_mixer + tinyxml-2 + utf8cpp + ] ++ lib.optionals stdenv.isDarwin [ Foundation IOKit ]; + + # Help CMake find SDL_mixer.h + NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2_mixer}/include/SDL2"; + + cmakeFlags = [ "-DBUNDLE_DEPENDENCIES=OFF" ] ++ lib.optional makeAndPlay "-DMAKEANDPLAY=ON"; + + desktopItems = [ + (makeDesktopItem { + type = "Application"; + name = "VVVVVV"; + desktopName = "VVVVVV"; + comment = meta.description; + exec = pname; + icon = "VVVVVV"; + terminal = false; + categories = [ "Game" ]; + }) + ]; + + installPhase = '' + runHook preInstall + + install -Dm755 VVVVVV $out/bin/${pname} + install -Dm644 "$src/desktop_version/icon.ico" "$out/share/pixmaps/VVVVVV.png" + + wrapProgram $out/bin/${pname} --add-flags "-assets ${dataZip}" + + runHook postInstall + ''; + + meta = with lib; { + description = "A retro-styled platform game" + lib.optionalString makeAndPlay " (redistributable, without original levels)"; + longDescription = '' + VVVVVV is a platform game all about exploring one simple mechanical + idea - what if you reversed gravity instead of jumping? + '' + lib.optionalString makeAndPlay '' + (Redistributable version, doesn't include the original levels.) + ''; + homepage = "https://thelettervsixtim.es"; + license = licenses.unfree; + maintainers = with maintainers; [ martfont ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 56fa5fd7f7b5..a2c26c8dddda 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35762,6 +35762,10 @@ with pkgs; libpng = libpng12; }; + vvvvvv = callPackage ../games/vvvvvv { + inherit (darwin.apple_sdk.frameworks) Foundation IOKit; + }; + wargus = callPackage ../games/wargus { }; warmux = callPackage ../games/warmux { };