summary refs log tree commit diff
path: root/pkgs/games/endless-sky/fixes.patch
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2016-12-09 00:02:44 +0000
committerRobert Helgesson <robert@rycee.net>2016-12-11 08:57:35 +0100
commit9aca55e79d62468ef230350026b41947d0472309 (patch)
treed5ea50e078fe0ab4cd5e38693b068fe69e7421a2 /pkgs/games/endless-sky/fixes.patch
parentf9281609aef096cac905cd1081aacc9193ad273f (diff)
downloadnixpkgs-9aca55e79d62468ef230350026b41947d0472309.tar
nixpkgs-9aca55e79d62468ef230350026b41947d0472309.tar.gz
nixpkgs-9aca55e79d62468ef230350026b41947d0472309.tar.bz2
nixpkgs-9aca55e79d62468ef230350026b41947d0472309.tar.lz
nixpkgs-9aca55e79d62468ef230350026b41947d0472309.tar.xz
nixpkgs-9aca55e79d62468ef230350026b41947d0472309.tar.zst
nixpkgs-9aca55e79d62468ef230350026b41947d0472309.zip
endless sky: init at 0.9.4
Diffstat (limited to 'pkgs/games/endless-sky/fixes.patch')
-rw-r--r--pkgs/games/endless-sky/fixes.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/games/endless-sky/fixes.patch b/pkgs/games/endless-sky/fixes.patch
new file mode 100644
index 00000000000..cad7a6acaed
--- /dev/null
+++ b/pkgs/games/endless-sky/fixes.patch
@@ -0,0 +1,45 @@
+diff --git a/SConstruct b/SConstruct
+index 48fd080..419b40d 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -1,7 +1,7 @@
+ import os
+ 
+ # Load any environment variables that alter the build.
+-env = Environment()
++env = Environment(ENV = os.environ)
+ if 'CCFLAGS' in os.environ:
+ 	env.Append(CCFLAGS = os.environ['CCFLAGS'])
+ if 'CXXFLAGS' in os.environ:
+@@ -55,7 +55,7 @@ sky = env.Program("endless-sky", Glob("build/" + env["mode"] + "/*.cpp"))
+ 
+ 
+ # Install the binary:
+-env.Install("$DESTDIR$PREFIX/games", sky)
++env.Install("$DESTDIR$PREFIX/bin", sky)
+ 
+ # Install the desktop file:
+ env.Install("$DESTDIR$PREFIX/share/applications", "endless-sky.desktop")
+diff --git a/source/Files.cpp b/source/Files.cpp
+index c8c8957..d196459 100644
+--- a/source/Files.cpp
++++ b/source/Files.cpp
+@@ -114,15 +114,9 @@ void Files::Init(const char * const *argv)
+ 	if(resources.back() != '/')
+ 		resources += '/';
+ #if defined __linux__ || defined __FreeBSD__ || defined __DragonFly__
+-	// Special case, for Linux: the resource files are not in the same place as
+-	// the executable, but are under the same prefix (/usr or /usr/local).
+-	static const string LOCAL_PATH = "/usr/local/";
+-	static const string STANDARD_PATH = "/usr/";
+-	static const string RESOURCE_PATH = "share/games/endless-sky/";
+-	if(!resources.compare(0, LOCAL_PATH.length(), LOCAL_PATH))
+-		resources = LOCAL_PATH + RESOURCE_PATH;
+-	else if(!resources.compare(0, STANDARD_PATH.length(), STANDARD_PATH))
+-		resources = STANDARD_PATH + RESOURCE_PATH;
++	// Workaround for NixOS. Not sure how to proceed with other OSes, feedback
++	// is welcome.
++	resources += "../share/games/endless-sky/";
+ #elif defined __APPLE__
+ 	// Special case for Mac OS X: the resources are in ../Resources relative to
+ 	// the folder the binary is in.