diff --git a/pkgs/by-name/so/solarus-launcher/github-fetches.patch b/pkgs/by-name/so/solarus-launcher/github-fetches.patch new file mode 100644 index 000000000000..181acbd56123 --- /dev/null +++ b/pkgs/by-name/so/solarus-launcher/github-fetches.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 80b9aab..e56ca84 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,8 +88,7 @@ include(FetchContent) + + # Qlementine Icons: an SVG icon library made for Qt. + FetchContent_Declare(qlementine-icons +- GIT_REPOSITORY "https://github.com/oclero/qlementine-icons.git" +- GIT_TAG v1.8.0 ++ SOURCE_DIR "@qlementine-icons-src@" + ) + FetchContent_MakeAvailable(qlementine-icons) + set_target_properties(qlementine-icons +@@ -99,8 +98,7 @@ set_target_properties(qlementine-icons + + # Qlementine: the QStyle library to have a modern look n' feel. + FetchContent_Declare(qlementine +- GIT_REPOSITORY "https://github.com/oclero/qlementine.git" +- GIT_TAG v1.2.0 ++ SOURCE_DIR "@qlementine-src@" + ) + FetchContent_MakeAvailable(qlementine) + set_target_properties(qlementine +@@ -109,8 +107,7 @@ set_target_properties(qlementine + ) + + FetchContent_Declare(QtAppInstanceManager +- GIT_REPOSITORY "https://github.com/oclero/qtappinstancemanager.git" +- GIT_TAG v1.3.0 ++ SOURCE_DIR "@qtappinstancemanager-src@" + ) + FetchContent_MakeAvailable(QtAppInstanceManager) + set_target_properties(QtAppInstanceManager diff --git a/pkgs/by-name/so/solarus-launcher/package.nix b/pkgs/by-name/so/solarus-launcher/package.nix new file mode 100644 index 000000000000..ce8cd109a307 --- /dev/null +++ b/pkgs/by-name/so/solarus-launcher/package.nix @@ -0,0 +1,109 @@ +{ + lib, + stdenv, + fetchFromGitLab, + fetchFromGitHub, + replaceVars, + cmake, + ninja, + luajit, + SDL2, + SDL2_image, + SDL2_ttf, + physfs, + openal, + libmodplug, + libvorbis, + solarus, + glm, + qt6Packages, + kdePackages, +}: + +let + qlementine-icons-src = fetchFromGitHub { + owner = "oclero"; + repo = "qlementine-icons"; + tag = "v1.8.0"; + hash = "sha256-FPndzMEOQvYNYUbT2V6iDlwoYqOww38GW/T3zUID3g0="; + }; + + qlementine-src = fetchFromGitHub { + owner = "oclero"; + repo = "qlementine"; + tag = "v1.2.1"; + hash = "sha256-CPQMmTXyUW+CyLjHYx+IdXY4I2mVPudOmAksjd+izPA="; + }; + + qtappinstancemanager-src = fetchFromGitHub { + owner = "oclero"; + repo = "qtappinstancemanager"; + tag = "v1.3.0"; + hash = "sha256-/zvNR/RHNV19ZI8d+58sotWxY16q2a7wWIBuKO52H5M="; + }; + + inherit (qt6Packages) + qtbase + qttools + wrapQtAppsHook + ; +in +stdenv.mkDerivation (finalAttrs: { + pname = "solarus-launcher"; + version = "2.0.0"; + + src = fetchFromGitLab { + owner = "solarus-games"; + repo = "solarus-launcher"; + tag = "v${finalAttrs.version}"; + hash = "sha256-zBJnHzYJyhfzP1m6TgMkDLRA3EXC1oG8PC0Jq/fC2+Q="; + }; + + patches = [ + (replaceVars ./github-fetches.patch { + inherit qlementine-src qlementine-icons-src qtappinstancemanager-src; + }) + ]; + + strictDeps = true; + nativeBuildInputs = [ + cmake + ninja + qttools + wrapQtAppsHook + ]; + + buildInputs = [ + luajit + SDL2 + SDL2_image + SDL2_ttf + physfs + openal + libmodplug + libvorbis + solarus + qtbase + kdePackages.qtsvg + glm + ]; + + meta = { + description = "Launcher for the Zelda-like ARPG game engine, Solarus"; + longDescription = '' + Solarus is a game engine for Zelda-like ARPG games written in lua. + Many full-fledged games have been writen for the engine. + Games can be created easily using the editor. + ''; + homepage = "https://www.solarus-games.org"; + mainProgram = "solarus-launcher"; + license = with lib.licenses; [ + # code + gpl3Plus + # assets + cc-by-sa-40 + ]; + maintainers = with lib.maintainers; [ marcin-serwin ]; + platforms = lib.platforms.linux; + }; +})