endless sky: init at 0.9.4

authored by Linus Heckemann and committed by Robert Helgesson 9aca55e7 f9281609

+94 -1
+1
lib/maintainers.nix
··· 242 242 leonardoce = "Leonardo Cecchi <leonardo.cecchi@gmail.com>"; 243 243 lethalman = "Luca Bruno <lucabru@src.gnome.org>"; 244 244 lewo = "Antoine Eiche <lewo@abesis.fr>"; 245 + lheckemann = "Linus Heckemann <git@sphalerite.org>"; 245 246 lhvwb = "Nathaniel Baxter <nathaniel.baxter@gmail.com>"; 246 247 lihop = "Leroy Hopson <nixos@leroy.geek.nz>"; 247 248 linquize = "Linquize <linquize@yahoo.com.hk>";
+46
pkgs/games/endless-sky/default.nix
··· 1 + { stdenv, fetchFromGitHub 2 + , SDL2, libpng, libjpeg, glew, openal, scons 3 + }: 4 + 5 + let 6 + version = "0.9.4"; 7 + 8 + in 9 + stdenv.mkDerivation rec { 10 + name = "endless-sky-${version}"; 11 + 12 + src = fetchFromGitHub { 13 + owner = "endless-sky"; 14 + repo = "endless-sky"; 15 + rev = "v${version}"; 16 + sha256 = "1mirdcpap0a280j472lhmhqg605b7glvdr4l93qcapk8an8d46m7"; 17 + }; 18 + 19 + enableParallelBuilding = true; 20 + 21 + buildInputs = [ 22 + SDL2 libpng libjpeg glew openal scons 23 + ]; 24 + 25 + patches = [ 26 + ./fixes.patch 27 + ]; 28 + 29 + buildPhase = '' 30 + scons -j$NIX_BUILD_CORES PREFIX="$out" 31 + ''; 32 + 33 + installPhase = '' 34 + scons -j$NIX_BUILD_CORES install PREFIX="$out" 35 + ''; 36 + 37 + meta = with stdenv.lib; { 38 + description = "A sandbox-style space exploration game similar to Elite, Escape Velocity, or Star Control"; 39 + homepage = "https://endless-sky.github.io/"; 40 + license = with licenses; [ 41 + gpl3Plus cc-by-sa-30 cc-by-sa-40 publicDomain 42 + ]; 43 + maintainers = with maintainers; [ lheckemann ]; 44 + platforms = with platforms; allBut darwin; 45 + }; 46 + }
+45
pkgs/games/endless-sky/fixes.patch
··· 1 + diff --git a/SConstruct b/SConstruct 2 + index 48fd080..419b40d 100644 3 + --- a/SConstruct 4 + +++ b/SConstruct 5 + @@ -1,7 +1,7 @@ 6 + import os 7 + 8 + # Load any environment variables that alter the build. 9 + -env = Environment() 10 + +env = Environment(ENV = os.environ) 11 + if 'CCFLAGS' in os.environ: 12 + env.Append(CCFLAGS = os.environ['CCFLAGS']) 13 + if 'CXXFLAGS' in os.environ: 14 + @@ -55,7 +55,7 @@ sky = env.Program("endless-sky", Glob("build/" + env["mode"] + "/*.cpp")) 15 + 16 + 17 + # Install the binary: 18 + -env.Install("$DESTDIR$PREFIX/games", sky) 19 + +env.Install("$DESTDIR$PREFIX/bin", sky) 20 + 21 + # Install the desktop file: 22 + env.Install("$DESTDIR$PREFIX/share/applications", "endless-sky.desktop") 23 + diff --git a/source/Files.cpp b/source/Files.cpp 24 + index c8c8957..d196459 100644 25 + --- a/source/Files.cpp 26 + +++ b/source/Files.cpp 27 + @@ -114,15 +114,9 @@ void Files::Init(const char * const *argv) 28 + if(resources.back() != '/') 29 + resources += '/'; 30 + #if defined __linux__ || defined __FreeBSD__ || defined __DragonFly__ 31 + - // Special case, for Linux: the resource files are not in the same place as 32 + - // the executable, but are under the same prefix (/usr or /usr/local). 33 + - static const string LOCAL_PATH = "/usr/local/"; 34 + - static const string STANDARD_PATH = "/usr/"; 35 + - static const string RESOURCE_PATH = "share/games/endless-sky/"; 36 + - if(!resources.compare(0, LOCAL_PATH.length(), LOCAL_PATH)) 37 + - resources = LOCAL_PATH + RESOURCE_PATH; 38 + - else if(!resources.compare(0, STANDARD_PATH.length(), STANDARD_PATH)) 39 + - resources = STANDARD_PATH + RESOURCE_PATH; 40 + + // Workaround for NixOS. Not sure how to proceed with other OSes, feedback 41 + + // is welcome. 42 + + resources += "../share/games/endless-sky/"; 43 + #elif defined __APPLE__ 44 + // Special case for Mac OS X: the resources are in ../Resources relative to 45 + // the folder the binary is in.
+2 -1
pkgs/top-level/all-packages.nix
··· 1550 1550 1551 1551 emscriptenStdenv = stdenv // { mkDerivation = buildEmscriptenPackage; }; 1552 1552 1553 - 1554 1553 efibootmgr = callPackage ../tools/system/efibootmgr { }; 1555 1554 1556 1555 efivar = callPackage ../tools/system/efivar { }; ··· 15661 15660 eduke32 = callPackage ../games/eduke32 { }; 15662 15661 15663 15662 egoboo = callPackage ../games/egoboo { }; 15663 + 15664 + endless-sky = callPackage ../games/endless-sky { }; 15664 15665 15665 15666 eternity = callPackage ../games/eternity-engine { }; 15666 15667