2024-07-01 15:47:52 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchurl,
|
|
|
|
makeDesktopItem,
|
|
|
|
copyDesktopItems,
|
|
|
|
testers,
|
|
|
|
opensupaplex,
|
|
|
|
SDL2,
|
|
|
|
SDL2_mixer,
|
2022-01-25 03:21:06 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# Doesn't seem to be included in tagged releases, but does exist on master.
|
|
|
|
icon = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/sergiou87/open-supaplex/b102548699cf16910b59559f689ecfad88d2a7d2/open-supaplex.svg";
|
|
|
|
sha256 = "sha256-nKeSBUGjSulbEP7xxc6smsfCRjyc/xsLykH0o3Rq5wo=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opensupaplex";
|
|
|
|
version = "7.1.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sergiou87";
|
|
|
|
repo = "open-supaplex";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-hP8dJlLXE5J/oxPhRkrrBl1Y5e9MYbJKi8OApFM3+GU=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
SDL2 # For "sdl2-config"
|
|
|
|
copyDesktopItems
|
|
|
|
];
|
|
|
|
buildInputs = [ SDL2_mixer ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
2022-01-25 03:21:06 +00:00
|
|
|
"-DFILE_DATA_PATH=${placeholder "out"}/lib/opensupaplex"
|
|
|
|
"-DFILE_FHS_XDG_DIRS"
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
# Makefile is located in this directory
|
|
|
|
pushd linux
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,lib,share/icons/hicolor/scalable/apps}
|
|
|
|
|
|
|
|
install -D ./linux/opensupaplex $out/bin/opensupaplex
|
|
|
|
cp -R ./resources $out/lib/opensupaplex
|
|
|
|
cp ${icon} $out/share/icons/hicolor/scalable/apps/open-supaplex.svg
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2022-01-25 03:21:06 +00:00
|
|
|
package = opensupaplex;
|
|
|
|
command = "opensupaplex --help";
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "opensupaplex";
|
|
|
|
exec = meta.mainProgram;
|
|
|
|
icon = "open-supaplex";
|
|
|
|
desktopName = "OpenSupaplex";
|
|
|
|
comment = meta.description;
|
|
|
|
categories = [
|
|
|
|
"Application"
|
|
|
|
"Game"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
2022-01-25 03:21:06 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
meta = {
|
2022-01-25 03:21:06 +00:00
|
|
|
description = "A decompilation of Supaplex in C and SDL";
|
|
|
|
homepage = "https://github.com/sergiou87/open-supaplex";
|
|
|
|
changelog = "https://github.com/sergiou87/open-supaplex/blob/master/changelog/v${version}.txt";
|
2024-07-01 15:47:52 +00:00
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
maintainers = with lib.maintainers; [ matteopacini ];
|
|
|
|
platforms = lib.platforms.linux; # Many more are supported upstream, but only linux is tested.
|
2022-01-25 03:21:06 +00:00
|
|
|
mainProgram = "opensupaplex";
|
|
|
|
};
|
|
|
|
}
|