diff options
author | B. Kelly <bk@ancilla.ca> | 2019-08-09 22:05:43 -0400 |
---|---|---|
committer | Rebecca Kelly <btk@google.com> | 2021-08-28 16:23:32 -0400 |
commit | c5d61a5e93dc7753a3059c5b3ea7f37ed21fef3a (patch) | |
tree | 28e9e9ede92f4168d85b27b4a37c8a37aa183178 /pkgs/games/deliantra | |
parent | 17325b20e67ddee7f34d4776a4d8a765e2a02ba4 (diff) |
deliantra-server: init at 3.1
Includes deliantra-arch, deliantra-maps, and deliantra-data (a combined
package that includes the compiled archetypes and maps and the static
data shipped with the server itself).
Diffstat (limited to 'pkgs/games/deliantra')
-rw-r--r-- | pkgs/games/deliantra/0001-abs.patch | 17 | ||||
-rw-r--r-- | pkgs/games/deliantra/0002-datadir.patch | 11 | ||||
-rw-r--r-- | pkgs/games/deliantra/default.nix | 10 | ||||
-rw-r--r-- | pkgs/games/deliantra/deliantra-arch.nix | 25 | ||||
-rw-r--r-- | pkgs/games/deliantra/deliantra-data.nix | 21 | ||||
-rw-r--r-- | pkgs/games/deliantra/deliantra-maps.nix | 25 | ||||
-rw-r--r-- | pkgs/games/deliantra/deliantra-server.nix | 48 |
7 files changed, 157 insertions, 0 deletions
diff --git a/pkgs/games/deliantra/0001-abs.patch b/pkgs/games/deliantra/0001-abs.patch new file mode 100644 index 000000000000..d116317e243a --- /dev/null +++ b/pkgs/games/deliantra/0001-abs.patch @@ -0,0 +1,17 @@ +--- a/utils/cfhq2xa.C ++++ b/utils/cfhq2xa.C +@@ -182,10 +182,10 @@ static inline bool Diff (pixel w1, pixel w2) + pixel YUV1 = RGBAtoYUVA (w1); + pixel YUV2 = RGBAtoYUVA (w2); + +- return ((abs (((YUV1 >> Rshift) & Cmask) - ((YUV2 >> Rshift) & Cmask)) > trY) || +- (abs (((YUV1 >> Gshift) & Cmask) - ((YUV2 >> Gshift) & Cmask)) > trU) || +- (abs (((YUV1 >> Bshift) & Cmask) - ((YUV2 >> Bshift) & Cmask)) > trV) || +- (abs (((YUV1 >> Ashift) & Cmask) - ((YUV2 >> Ashift) & Cmask)) > trA) ); ++ return ((abs ((signed int)((YUV1 >> Rshift) & Cmask) - (signed int)((YUV2 >> Rshift) & Cmask)) > trY) || ++ (abs ((signed int)((YUV1 >> Gshift) & Cmask) - (signed int)((YUV2 >> Gshift) & Cmask)) > trU) || ++ (abs ((signed int)((YUV1 >> Bshift) & Cmask) - (signed int)((YUV2 >> Bshift) & Cmask)) > trV) || ++ (abs ((signed int)((YUV1 >> Ashift) & Cmask) - (signed int)((YUV2 >> Ashift) & Cmask)) > trA) ); + } + + static void diff --git a/pkgs/games/deliantra/0002-datadir.patch b/pkgs/games/deliantra/0002-datadir.patch new file mode 100644 index 000000000000..1c8e847d88c6 --- /dev/null +++ b/pkgs/games/deliantra/0002-datadir.patch @@ -0,0 +1,11 @@ +--- a/utils/cfutil.in ++++ b/utils/cfutil.in +@@ -27,7 +27,7 @@ use common::sense; + my $prefix = "@prefix@"; + my $exec_prefix = "@exec_prefix@"; + my $datarootdir = "@datarootdir@"; +-my $DATADIR = "@datadir@/@PACKAGE@"; ++my $DATADIR = $ENV{'DELIANTRA_DATADIR'} || "@datadir@/@PACKAGE@"; + + my $CONVERT = "@CONVERT@"; + my $IDENTIFY = "@IDENTIFY@"; diff --git a/pkgs/games/deliantra/default.nix b/pkgs/games/deliantra/default.nix new file mode 100644 index 000000000000..76a06c960187 --- /dev/null +++ b/pkgs/games/deliantra/default.nix @@ -0,0 +1,10 @@ +pkgs: + +let + callPackage = pkgs.callPackage; +in { + deliantra-server = callPackage ./deliantra-server.nix {}; + deliantra-arch = callPackage ./deliantra-arch.nix {}; + deliantra-maps = callPackage ./deliantra-maps.nix {}; + deliantra-data = callPackage ./deliantra-data.nix {}; +} diff --git a/pkgs/games/deliantra/deliantra-arch.nix b/pkgs/games/deliantra/deliantra-arch.nix new file mode 100644 index 000000000000..2201ca2d1f5f --- /dev/null +++ b/pkgs/games/deliantra/deliantra-arch.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchurl, deliantra-server }: + +stdenv.mkDerivation rec { + pname = "deliantra-arch"; + version = "3.1"; + + src = fetchurl { + url = "http://dist.schmorp.de/deliantra/${pname}-${version}.tar.xz"; + sha256 = "1xzhv48g90hwkzgx9nfjm81ivg6hchkik9ldimi8ijb4j393kvsz"; + }; + + installPhase = '' + mkdir -p "$out" + export DELIANTRA_DATADIR="$out" + ${deliantra-server}/bin/cfutil --install-arch . + ''; + + meta = with lib; { + description = "Archetype data for the Deliantra free MMORPG"; + homepage = "http://www.deliantra.net/"; + license = with licenses; [ gpl2Plus agpl3Plus ]; + platforms = platforms.linux; + maintainers = with maintainers; [ ToxicFrog ]; + }; +} diff --git a/pkgs/games/deliantra/deliantra-data.nix b/pkgs/games/deliantra/deliantra-data.nix new file mode 100644 index 000000000000..31ed7d0f0118 --- /dev/null +++ b/pkgs/games/deliantra/deliantra-data.nix @@ -0,0 +1,21 @@ +{ stdenv, lib, fetchurl, deliantra-maps, deliantra-arch, deliantra-server, symlinkJoin }: + +symlinkJoin rec { + name = "deliantra-data-${version}"; + version = "M${deliantra-maps.version}+A${deliantra-arch.version}"; + + paths = [ + deliantra-maps + deliantra-arch + "${deliantra-server}/share/deliantra-server" + ]; + + meta = with lib; { + description = "Combined game data (maps + archetypes) for the Deliantra free MMORPG"; + homepage = "http://www.deliantra.net/"; + license = with licenses; [ gpl2Plus agpl3Plus ]; + platforms = platforms.linux; + maintainers = with maintainers; [ ToxicFrog ]; + hydraPlatforms = []; + }; +} diff --git a/pkgs/games/deliantra/deliantra-maps.nix b/pkgs/games/deliantra/deliantra-maps.nix new file mode 100644 index 000000000000..1f87178102a0 --- /dev/null +++ b/pkgs/games/deliantra/deliantra-maps.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchurl, deliantra-server }: + +stdenv.mkDerivation rec { + pname = "deliantra-maps"; + version = "3.1"; + + src = fetchurl { + url = "http://dist.schmorp.de/deliantra/${pname}-${version}.tar.xz"; + sha256 = "0zbwzya28s1xpnbrmqkqvfrzns03zdjd8a9w9nk665aif6rw2zbz"; + }; + + installPhase = '' + mkdir -p "$out/maps" + export DELIANTRA_DATADIR="$out" + ${deliantra-server}/bin/cfutil --install-maps . + ''; + + meta = with lib; { + description = "Map data for the Deliantra free MMORPG"; + homepage = "http://www.deliantra.net/"; + license = with licenses; [ gpl2Plus agpl3Plus ]; + platforms = platforms.linux; + maintainers = with maintainers; [ ToxicFrog ]; + }; +} diff --git a/pkgs/games/deliantra/deliantra-server.nix b/pkgs/games/deliantra/deliantra-server.nix new file mode 100644 index 000000000000..e333b7a472f5 --- /dev/null +++ b/pkgs/games/deliantra/deliantra-server.nix @@ -0,0 +1,48 @@ +{ stdenv, lib, fetchurl, perlPackages +, autoconf, perl, gperf, optipng, pngnq, rsync, imagemagick, blitz +, pkg-config, glib, boost, makeWrapper +}: + +let + perl-deps = with perlPackages; [ + AnyEvent AnyEventAIO AnyEventBDB AnyEventIRC + CompressLZF commonsense Coro CoroEV + Deliantra DigestSHA1 EV PodPOM SafeHole URI YAMLLibYAML + ]; +in +stdenv.mkDerivation rec { + pname = "deliantra-server"; + version = "3.1"; + + src = fetchurl { + url = "http://dist.schmorp.de/deliantra/${pname}-${version}.tar.xz"; + sha256 = "0v0m2m9fxq143aknh7jb3qj8bnpjrs3bpbbx07c18516y3izr71d"; + }; + + nativeBuildInputs = [ + autoconf perl gperf optipng pngnq rsync imagemagick + pkg-config makeWrapper + ]; + propagatedBuildInputs = perl-deps; + buildInputs = [ + blitz boost glib + ]; + + hardeningDisable = [ "format" ]; + patches = [ + ./0001-abs.patch + ./0002-datadir.patch + ]; + postFixup = '' + wrapProgram $out/bin/cfutil --prefix PERL5LIB : $PERL5LIB + wrapProgram $out/bin/deliantra-server --prefix PERL5LIB : $PERL5LIB + ''; + + meta = with lib; { + description = "Server for the Deliantra free MMORPG"; + homepage = "http://www.deliantra.net/"; + license = with licenses; [ gpl2Plus agpl3Plus ]; + platforms = platforms.linux; + maintainers = with maintainers; [ ToxicFrog ]; + }; +} |