nixpkgs/pkgs/games/7kaa/default.nix

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

77 lines
1.7 KiB
Nix
Raw Normal View History

2022-02-02 01:40:41 +00:00
{ lib
, stdenv
, gccStdenv
, autoreconfHook
2023-06-07 22:56:43 +00:00
, autoconf-archive
2022-02-02 01:40:41 +00:00
, pkg-config
, fetchurl
, fetchFromGitHub
, openal
, libtool
, enet
, SDL2
, curl
, gettext
, libiconv
}:
let
2023-09-24 06:54:35 +00:00
version = "2.15.6";
2022-02-02 01:40:41 +00:00
2023-06-07 22:56:43 +00:00
musicVersion = lib.versions.majorMinor version;
2022-04-30 00:45:35 +00:00
music = stdenv.mkDerivation {
pname = "7kaa-music";
2023-06-07 22:56:43 +00:00
version = musicVersion;
2022-02-02 01:40:41 +00:00
src = fetchurl {
2023-06-07 22:56:43 +00:00
url = "https://www.7kfans.com/downloads/7kaa-music-${musicVersion}.tar.bz2";
hash = "sha256-sNdntuJXGaFPXzSpN0SoAi17wkr2YnW+5U38eIaVwcM=";
2022-02-02 01:40:41 +00:00
};
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
meta.license = lib.licenses.unfree;
};
in
2023-09-24 06:54:35 +00:00
gccStdenv.mkDerivation (finalAttrs: {
pname = "7kaa";
inherit version;
2022-02-02 01:40:41 +00:00
src = fetchFromGitHub {
owner = "the3dfxdude";
2023-09-24 06:54:35 +00:00
repo = "7kaa";
rev = "v${finalAttrs.version}";
hash = "sha256-kkM+kFQ+tGHS5NrVPeDMRWFQb7waESt8xOLfFGaGdgo=";
2022-02-02 01:40:41 +00:00
};
2023-06-07 22:56:43 +00:00
nativeBuildInputs = [ autoreconfHook autoconf-archive pkg-config ];
2022-02-02 01:40:41 +00:00
buildInputs = [ openal enet SDL2 curl gettext libiconv ];
preAutoreconf = ''
autoupdate
'';
hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ];
postInstall = ''
mkdir $out/share/7kaa/MUSIC
cp -R ${music}/MUSIC $out/share/7kaa/
cp ${music}/COPYING-Music.txt $out/share/7kaa/MUSIC
cp ${music}/COPYING-Music.txt $out/share/doc/7kaa
'';
# Multiplayer is auto-disabled for non-x86 system
meta = with lib; {
homepage = "https://www.7kfans.com";
description = "GPL release of the Seven Kingdoms with multiplayer (available only on x86 platforms)";
license = licenses.gpl2Only;
platforms = platforms.x86_64 ++ platforms.aarch64;
maintainers = with maintainers; [ _1000101 ];
};
2023-09-24 06:54:35 +00:00
})