nixpkgs/pkgs/by-name/al/alephone/package.nix

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

136 lines
2.6 KiB
Nix
Raw Normal View History

2023-11-28 15:34:44 +00:00
{ lib
, stdenv
, fetchurl
, alsa-lib
, boost
, curl
, ffmpeg_4
, icoutils
, libGLU
, libmad
, libogg
, libpng
, libsndfile
, libvorbis
, lua
, makeDesktopItem
, makeWrapper
, miniupnpc
, openal
, pkg-config
, SDL2
, SDL2_image
, SDL2_net
, SDL2_ttf
, speex
, unzip
, zlib
, zziplib
, alephone
}:
2023-11-28 15:34:44 +00:00
stdenv.mkDerivation (finalAttrs: {
outputs = [ "out" "icons" ];
pname = "alephone";
version = "1.7";
2023-11-28 15:34:44 +00:00
src = fetchurl {
url =
let date = "20231125";
2020-12-09 13:47:30 +00:00
in "https://github.com/Aleph-One-Marathon/alephone/releases/download/release-${date}/AlephOne-${date}.tar.bz2";
2023-11-28 15:34:44 +00:00
sha256 = "sha256-qRHmtkzPi6PKeAzoMPdSbboiilG+L2fCXvXXu3vIchs=";
};
2023-11-28 15:34:44 +00:00
nativeBuildInputs = [ pkg-config icoutils ];
2023-11-28 15:34:44 +00:00
buildInputs = [
alsa-lib
boost
curl
ffmpeg_4
libGLU
libmad
libogg
libpng
libsndfile
libvorbis
lua
miniupnpc
openal
SDL2
SDL2_image
SDL2_net
SDL2_ttf
speex
zlib
zziplib
];
2023-11-28 15:34:44 +00:00
configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ];
makeFlags = [ "AR:=$(AR)" ];
2023-11-28 15:34:44 +00:00
enableParallelBuilding = true;
2023-11-28 15:34:44 +00:00
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
'';
2023-11-28 15:34:44 +00:00
meta = {
description =
"Aleph One is the open source continuation of Bungies Marathon 2 game engine";
homepage = "https://alephone.lhowon.org/";
license = [ lib.licenses.gpl3 ];
maintainers = with lib.maintainers; [ ehmry ];
platforms = lib.platforms.linux;
};
2023-11-28 15:34:44 +00:00
passthru.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 14:27:54 +00:00
} // extraArgs // {
meta = alephone.meta // {
2021-01-15 04:31:39 +00:00
license = lib.licenses.free;
2023-11-28 15:34:44 +00:00
mainProgram = pname;
hydraPlatforms = [ ];
} // meta;
2022-02-20 14:27:54 +00:00
});
2023-11-28 15:34:44 +00:00
})