nixpkgs-suyu/pkgs/games/alephone/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

103 lines
2.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, alsa-lib, boost, curl, ffmpeg_4, icoutils, libGLU
, libmad, libogg, libpng, libsndfile, libvorbis, lua, miniupnpc, pkg-config
, SDL2, SDL2_image, SDL2_net, SDL2_ttf, speex, zziplib, zlib, makeWrapper
, makeDesktopItem, unzip, alephone }:
let
self = stdenv.mkDerivation rec {
outputs = [ "out" "icons" ];
pname = "alephone";
2023-05-31 19:42:18 +02:00
version = "1.6.2";
src = fetchurl {
2023-05-31 19:42:18 +02:00
url = let date = "20230529";
2020-12-09 14:47:30 +01:00
in "https://github.com/Aleph-One-Marathon/alephone/releases/download/release-${date}/AlephOne-${date}.tar.bz2";
2023-05-31 19:42:18 +02:00
sha256 = "sha256-UqhZvOMOxU4W0eLRRTQvGXaqTpWD5KIdXULClHW7Iyc=";
};
2021-01-17 03:04:36 +01:00
nativeBuildInputs = [ pkg-config icoutils ];
buildInputs = [
alsa-lib
boost
curl
2022-02-07 19:28:55 +01:00
ffmpeg_4
2020-12-09 14:47:30 +01:00
libGLU
libmad
libsndfile
libogg
libpng
libvorbis
lua
miniupnpc
2020-12-09 14:47:30 +01:00
SDL2
SDL2_image
SDL2_net
SDL2_ttf
speex
zziplib
zlib
];
configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ];
makeFlags = [ "AR:=$(AR)" ];
enableParallelBuilding = true;
postInstall = ''
mkdir $icons
icotool -x -i 5 -o $icons Resources/Windows/*.ico
pushd $icons
for x in *_5_48x48x32.png; do
mv $x ''${x%_5_48x48x32.png}.png
done
popd
'';
meta = with lib; {
description =
"Aleph One is the open source continuation of Bungies Marathon 2 game engine";
homepage = "https://alephone.lhowon.org/";
license = with licenses; [ gpl3 ];
maintainers = with maintainers; [ ehmry ];
platforms = platforms.linux;
};
};
in self // {
makeWrapper = { pname, desktopName, version, zip, meta
, icon ? alephone.icons + "/alephone.png", ... }@extraArgs:
stdenv.mkDerivation ({
inherit pname version;
desktopItem = makeDesktopItem {
name = desktopName;
exec = pname;
genericName = pname;
categories = [ "Game" ];
comment = meta.description;
inherit desktopName icon;
};
src = zip;
nativeBuildInputs = [ makeWrapper unzip ];
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin $out/data/$pname $out/share/applications
cp -a * $out/data/$pname
cp $desktopItem/share/applications/* $out/share/applications
makeWrapper ${alephone}/bin/alephone $out/bin/$pname \
--add-flags $out/data/$pname
'';
2022-02-20 15:27:54 +01:00
} // extraArgs // {
meta = alephone.meta // {
2021-01-15 05:31:39 +01:00
license = lib.licenses.free;
hydraPlatforms = [ ];
} // meta;
2022-02-20 15:27:54 +01:00
});
}