diff --git a/pkgs/development/libraries/span-lite/default.nix b/pkgs/development/libraries/span-lite/default.nix new file mode 100644 index 000000000000..1af8466a4d07 --- /dev/null +++ b/pkgs/development/libraries/span-lite/default.nix @@ -0,0 +1,29 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +}: + +stdenv.mkDerivation rec { + pname = "span-lite"; + version = "0.10.3"; + + src = fetchFromGitHub { + owner = "martinmoene"; + repo = "span-lite"; + rev = "v${version}"; + hash = "sha256-WfoyyPLBqXSGGATWN/wny6P++3aCmQMOMLCARhB+R3c="; + }; + + nativeBuildInputs = [ + cmake + ]; + + meta = { + description = "A C++20-like span for C++98, C++11 and later in a single-file header-only library"; + homepage = "https://github.com/martinmoene/span-lite"; + license = lib.licenses.bsd1; + maintainers = with lib.maintainers; [ icewind1991 ]; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/games/openloco/default.nix b/pkgs/games/openloco/default.nix new file mode 100644 index 000000000000..c884c39dafa2 --- /dev/null +++ b/pkgs/games/openloco/default.nix @@ -0,0 +1,57 @@ +{ lib +, stdenv +, fetchFromGitHub +, SDL2 +, cmake +, libpng +, libzip +, openal +, pkg-config +, span-lite +, yaml-cpp +}: + +stdenv.mkDerivation rec { + pname = "openloco"; + version = "23.02"; + + src = fetchFromGitHub { + owner = "OpenLoco"; + repo = "OpenLoco"; + rev = "v${version}"; + hash = "sha256-35g7tnKez4tnTdZzavfU+X8f3btFG6EbLkU+cqL6Qek="; + }; + + # the upstream build process determines the version tag from git; since we + # are not using a git checkout, we patch it manually + postPatch = '' + sed -i '/#define NAME "OpenLoco"/a#define OPENLOCO_VERSION_TAG "${version}"' src/OpenLoco/src/Version.cpp + ''; + + NIX_CFLAGS_COMPILE = "-Wno-error=null-dereference"; + + cmakeFlags = [ + "-DOPENLOCO_BUILD_TESTS=NO" + ]; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + buildInputs = [ + SDL2 + libpng + libzip + openal + yaml-cpp + span-lite + ]; + + meta = { + description = "An open source re-implementation of Chris Sawyer's Locomotion"; + homepage = "https://github.com/OpenLoco/OpenLoco"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ icewind1991 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 615361633af8..c35469aa8f0e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23431,6 +23431,8 @@ with pkgs; soundtouch = callPackage ../development/libraries/soundtouch {}; + span-lite = callPackage ../development/libraries/span-lite { }; + spandsp = callPackage ../development/libraries/spandsp {}; spandsp3 = callPackage ../development/libraries/spandsp/3.nix {}; @@ -35622,6 +35624,8 @@ with pkgs; openjk = callPackage ../games/openjk { }; + openloco = pkgsi686Linux.callPackage ../games/openloco { }; + openmw = libsForQt5.callPackage ../games/openmw { }; openmw-tes3mp = libsForQt5.callPackage ../games/openmw/tes3mp.nix { };