$OpenBSD: patch-SConstruct,v 1.4 2020/05/17 21:08:07 bcallah Exp $

Remove hardcoded -O3
Install to the correct locations.

Index: SConstruct
--- SConstruct.orig
+++ SConstruct
@@ -16,7 +16,6 @@ if 'SCHROOT_CHROOT_NAME' in os.environ and 'steamrt' i
 
 opts = Variables()
 opts.Add(PathVariable("PREFIX", "Directory to install under", "/usr/local", PathVariable.PathIsDirCreate))
-opts.Add(PathVariable("DESTDIR", "Destination root directory", "", PathVariable.PathAccept))
 opts.Add(EnumVariable("mode", "Compilation mode", "release", allowed_values=("release", "debug", "profile")))
 opts.Add(PathVariable("BUILDDIR", "Build directory", "build", PathVariable.PathIsDirCreate))
 opts.Update(env)
@@ -24,8 +23,6 @@ opts.Update(env)
 Help(opts.GenerateHelpText(env))
 
 flags = ["-std=c++11", "-Wall"]
-if env["mode"] != "debug":
-	flags += ["-O3"]
 if env["mode"] == "debug":
 	flags += ["-g"]
 if env["mode"] == "profile":
@@ -69,7 +66,7 @@ sky = env.Program("endless-sky", RecursiveGlob("*.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")
@@ -95,12 +92,6 @@ if env.get("PREFIX").startswith("/usr/"):
 		icons,
 		"gtk-update-icon-cache -t $DESTDIR$PREFIX/share/icons/hicolor/")
 
-# Install the man page.
-env.Command(
-	"$DESTDIR$PREFIX/share/man/man6/endless-sky.6.gz",
-	"endless-sky.6",
-	"gzip -c $SOURCE > $TARGET")
-
 # Install the data files.
 def RecursiveInstall(env, target, source):
 	rootIndex = len(env.Dir(source).abspath) + 1
@@ -110,11 +101,11 @@ def RecursiveInstall(env, target, source):
 			RecursiveInstall(env, os.path.join(target, name), node.abspath)
 		else:
 			env.Install(target, node)
-RecursiveInstall(env, "$DESTDIR$PREFIX/share/games/endless-sky/data", "data")
-RecursiveInstall(env, "$DESTDIR$PREFIX/share/games/endless-sky/images", "images")
-RecursiveInstall(env, "$DESTDIR$PREFIX/share/games/endless-sky/sounds", "sounds")
-env.Install("$DESTDIR$PREFIX/share/games/endless-sky", "credits.txt")
-env.Install("$DESTDIR$PREFIX/share/games/endless-sky", "keys.txt")
+RecursiveInstall(env, "$DESTDIR$PREFIX/share/endless-sky/data", "data")
+RecursiveInstall(env, "$DESTDIR$PREFIX/share/endless-sky/images", "images")
+RecursiveInstall(env, "$DESTDIR$PREFIX/share/endless-sky/sounds", "sounds")
+env.Install("$DESTDIR$PREFIX/share/endless-sky", "credits.txt")
+env.Install("$DESTDIR$PREFIX/share/endless-sky", "keys.txt")
 
 # Make the word "install" in the command line do an installation.
 env.Alias("install", "$DESTDIR$PREFIX")
