3
0
Fork 0
forked from mirrors/nixpkgs

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).
This commit is contained in:
B. Kelly 2019-08-09 22:05:43 -04:00 committed by Rebecca Kelly
parent 17325b20e6
commit c5d61a5e93
9 changed files with 161 additions and 1 deletions

View file

@ -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

View file

@ -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@";

View file

@ -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 {};
}

View file

@ -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 ];
};
}

View file

@ -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 = [];
};
}

View file

@ -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 ];
};
}

View file

@ -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 ];
};
}

View file

@ -29110,6 +29110,9 @@ in
cuyo = callPackage ../games/cuyo { };
inherit (import ../games/deliantra pkgs)
deliantra-server deliantra-arch deliantra-maps deliantra-data;
devilutionx = callPackage ../games/devilutionx {};
dhewm3 = callPackage ../games/dhewm3 {};

View file

@ -5607,7 +5607,7 @@ let
};
propagatedBuildInputs = [ AnyEvent CompressLZF JSONXS commonsense ];
meta = {
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
license = with lib.licenses; [ artistic1 gpl1Plus ];
};
};