nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, alsa-lib, boost, curl, ffmpeg_4, icoutils, libGLU
2, libmad, libogg, libpng, libsndfile, libvorbis, lua, miniupnpc, pkg-config
3, SDL2, SDL2_image, SDL2_net, SDL2_ttf, speex, zziplib, zlib, makeWrapper
4, makeDesktopItem, unzip, alephone }:
5
6let
7 self = stdenv.mkDerivation rec {
8 outputs = [ "out" "icons" ];
9 pname = "alephone";
10 version = "1.6.2";
11
12 src = fetchurl {
13 url = let date = "20230529";
14 in "https://github.com/Aleph-One-Marathon/alephone/releases/download/release-${date}/AlephOne-${date}.tar.bz2";
15 sha256 = "sha256-UqhZvOMOxU4W0eLRRTQvGXaqTpWD5KIdXULClHW7Iyc=";
16 };
17
18 nativeBuildInputs = [ pkg-config icoutils ];
19
20 buildInputs = [
21 alsa-lib
22 boost
23 curl
24 ffmpeg_4
25 libGLU
26 libmad
27 libsndfile
28 libogg
29 libpng
30 libvorbis
31 lua
32 miniupnpc
33 SDL2
34 SDL2_image
35 SDL2_net
36 SDL2_ttf
37 speex
38 zziplib
39 zlib
40 ];
41
42 configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ];
43 makeFlags = [ "AR:=$(AR)" ];
44
45 enableParallelBuilding = true;
46
47 postInstall = ''
48 mkdir $icons
49 icotool -x -i 5 -o $icons Resources/Windows/*.ico
50 pushd $icons
51 for x in *_5_48x48x32.png; do
52 mv $x ''${x%_5_48x48x32.png}.png
53 done
54 popd
55 '';
56
57 meta = with lib; {
58 description =
59 "Aleph One is the open source continuation of Bungie’s Marathon 2 game engine";
60 homepage = "https://alephone.lhowon.org/";
61 license = with licenses; [ gpl3 ];
62 maintainers = with maintainers; [ ehmry ];
63 platforms = platforms.linux;
64 };
65 };
66
67in self // {
68 makeWrapper = { pname, desktopName, version, zip, meta
69 , icon ? alephone.icons + "/alephone.png", ... }@extraArgs:
70 stdenv.mkDerivation ({
71 inherit pname version;
72
73 desktopItem = makeDesktopItem {
74 name = desktopName;
75 exec = pname;
76 genericName = pname;
77 categories = [ "Game" ];
78 comment = meta.description;
79 inherit desktopName icon;
80 };
81
82 src = zip;
83
84 nativeBuildInputs = [ makeWrapper unzip ];
85
86 dontConfigure = true;
87 dontBuild = true;
88
89 installPhase = ''
90 mkdir -p $out/bin $out/data/$pname $out/share/applications
91 cp -a * $out/data/$pname
92 cp $desktopItem/share/applications/* $out/share/applications
93 makeWrapper ${alephone}/bin/alephone $out/bin/$pname \
94 --add-flags $out/data/$pname
95 '';
96 } // extraArgs // {
97 meta = alephone.meta // {
98 license = lib.licenses.free;
99 hydraPlatforms = [ ];
100 } // meta;
101 });
102}