nixpkgs-suyu/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 02:40:41 +01:00
{ lib
, stdenv
, gccStdenv
, autoreconfHook
, pkg-config
, fetchurl
, fetchFromGitHub
, openal
, libtool
, enet
, SDL2
, curl
, gettext
, libiconv
}:
let
2022-04-30 02:45:35 +02:00
pname = "7kaa";
version = "2.15.4p1";
2022-02-02 02:40:41 +01:00
2022-04-30 02:45:35 +02:00
music = stdenv.mkDerivation {
pname = "7kaa-music";
version = lib.versions.majorMinor version;
2022-02-02 02:40:41 +01:00
src = fetchurl {
2022-04-30 02:45:35 +02:00
url = "https://www.7kfans.com/downloads/7kaa-music-${lib.versions.majorMinor version}.tar.bz2";
2022-02-02 02:40:41 +01:00
sha256 = "sha256-sNdntuJXGaFPXzSpN0SoAi17wkr2YnW+5U38eIaVwcM=";
};
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
meta.license = lib.licenses.unfree;
};
in
gccStdenv.mkDerivation rec {
2022-04-30 02:45:35 +02:00
inherit pname version;
2022-02-02 02:40:41 +01:00
src = fetchFromGitHub {
owner = "the3dfxdude";
repo = pname;
rev = "9db2a43e1baee25a44b7aa7e9cedde9a107ed34b";
sha256 = "sha256-OAKaRuPP0/n8pO3wIUvGKs6n+U+EmZXUTywXYDAan1o=";
};
nativeBuildInputs = [ autoreconfHook pkg-config ];
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 ];
};
}