Compare commits

..
Author SHA1 Message Date
Florent Rougon bad115cac0 download_and_compile.sh: add libopenal-dev as mandatory dependency of SimGear
Thanks to Clm76 for the report.
2019-07-06 12:19:42 +02:00
Florent Rougon 696829a260 download_and_compile.sh: add optional dependency on libevent-dev
This is needed for swift support (thanks to wkitty42 for the report).
2019-05-25 21:28:36 +02:00
James Turner 09cc52296d Put compositor back off for now
Need to figure out a way to handle it as another binary build, since
there is no runtime configuration option.
2019-05-24 13:55:59 +01:00
James Turner abc616b548 Enable Swift in nightly builds 2019-05-24 09:31:51 +01:00
James Turner c3b9b9a524 Enable compositor in nightly builds 2019-05-23 12:38:02 +01:00
James Turner 2277ba38c7 Fix a typo in DBus installer spec 2019-05-23 11:02:10 +01:00
Lars Toenning 97a72b4934 Add swift dlls to installer script 2019-05-17 10:54:29 +02:00
Florent Rougon ecd4b9aab3 download_and_compile.sh: fix path in generated default TerraGearGUI.conf
The 'flightgear' path in ~/.config/TerraGear/TerraGearGUI.conf is
supposed to point to $FG_ROOT, not to the FlightGear repository...
2019-05-02 01:36:00 +02:00
Florent Rougon 882ab6ae59 download_and_compile.sh: small fixes for TerraGear and TerraGear GUI
- make all generated scripts executable;
- use correct path for 'terragear' in the generated default config file
  ~/.config/TerraGear/TerraGearGUI.conf (not the 'bin' subdirectory);
- add default for the 'flightgear' path in the same file;
- don't write temporary TerraGearGUI.conf in $CBD (it's useless and
  might overwrite a user-created file);
- simplify a bit (esp. using a here document for generating
  run_terrageargui.sh).
2019-04-29 22:28:21 +02:00
Florent Rougon f3423dba60 download_and_compile.sh: respect the selected build type for TerraGear
So far, TerraGear was always built by d&c with
-DCMAKE_BUILD_TYPE="Debug". Following [1], d&c will now use, for
TerraGear, the build type selected with its -b option---which by default
is 'RelWithDebInfo'.

(In short: the 'Debug' build type has a very high negative performance
impact, therefore it should only be done intentionally.)

[1] https://sourceforge.net/p/flightgear/mailman/message/36650766/
2019-04-26 23:01:58 +02:00
Florent Rougon 39c1754a7f download_and_compile.sh: improve management of intercomponent dependencies
- new function _depends() to allow declaring intercomponent dependencies
  using a declarative style;

- declare that FGFS depends on SIMGEAR (TERRAGEAR depends on SIMGEAR as
  well, but this was already there---just not in the new, declarative
  style);

- print and log automatically-added components; when this happens, give
  a hint about --ignore-intercomponent-deps;

- log the value of IGNORE_INTERCOMPONENT_DEPS, which reflects whether
  --ignore-intercomponent-deps was used.
2019-04-26 13:14:38 +02:00
Florent Rougon f190773790 download_and_compile.sh: use proper string comparison in _elementIn()
In Bash, the [[ <foo> == <bar> ]] and [[ <foo> = <bar> ]] conditionals
interpret <bar> as a shell globbing pattern. This wasn't desired in
_elementIn(), where the <bar> string is provided by the caller, and
might contain pattern metacharacters. Replace this conditional with a
plain string comparison made with '[' (aka, the 'test' command).
2019-04-26 10:44:03 +02:00
Florent Rougon 5b34458439 download_and_compile.sh: add option --ignore-intercomponent-deps
Add option --ignore-intercomponent-deps which does the following:

  Ignore dependencies between components (default: don't).

  Example: TERRAGEAR depends on SIMGEAR. Because of this, running
  'download_and_compile.sh TERRAGEAR' would normally update, rebuild,
  etc. both SIMGEAR and TERRAGEAR. Passing the
  --ignore-intercomponent-deps option can be useful if you want to
  update, rebuild, etc. TERRAGEAR *without* doing the same for SIMGEAR
  (for instance, if you are doing repeated TERRAGEAR builds and you know
  your SIMGEAR is already fine and up-to-date).
2019-04-26 10:30:45 +02:00
Florent Rougon 59c9a55baa download_and_compile.sh: log whether this is a "stable build"
Log "Stable build: yes" or "Stable build: no" depending on whether
option -s has been passed.
2019-04-26 09:29:50 +02:00
Florent Rougon 92f566f1d3 download_and_compile.sh: fix "TERRAGEAR depends on SIMGEAR" implementation
The previous commit enforced this dependency only under the
[[ "$DOWNLOAD_PACKAGES" = "y" ]] condition, which was too restrictive.
2019-04-26 09:25:59 +02:00
Florent Rougon 5b6ba959d9 download_and_compile.sh: update TerraGear dependencies and branch selection
- update dependencies of the TERRAGEAR component (require SimGear,
  libboost-dev and zlib1g-dev apart from what was already listed
  following [0]);

- use TerraGear branch 'scenery/ws2.0' if the -s option has been given,
  otherwise use the 'next' branch.

References: [1] and Scott's reply[2].

[0] https://sourceforge.net/p/flightgear/fgmeta/ci/6661d1e10cae398154ada920551fdb7237ec035b/
[1] https://sourceforge.net/p/flightgear/mailman/message/36649774/
[2] https://sourceforge.net/p/flightgear/mailman/message/36650028/
2019-04-26 08:40:59 +02:00
Florent Rougon 675e7e6bdc download_and_compile.sh: new generated script: run_ldd.sh
This script can be useful to debug library problems.

$ ./run_ldd.sh --help
Usage: ./run_ldd.sh LDD_ARGUMENT...
Run 'ldd' with the same LD_LIBRARY_PATH setup as done inside run_fgfs.sh.

Examples: 'run_ldd.sh fgfs', 'run_ldd.sh fgcom', etc. (this can be used
for any binary in 'install/flightgear/bin').
2019-04-25 08:29:23 +02:00
Florent Rougon 07d1b0e882 download_and_compile.sh: update warning message 2019-04-24 19:18:57 +02:00
Florent Rougon f826f8c4b2 download_and_compile.sh: remove useless parameter in URL 2019-04-24 18:56:42 +02:00
Florent Rougon 82f3c85343 download_and_compile.sh: allow setting SG_CMAKEARGS and FG_CMAKEARGS from the environment
This allows one to add custom CMake options for the SG and/or FG
build(s) without modifying download_and_compile.sh.
2019-04-24 18:50:50 +02:00
Florent Rougon 3344c21c71 download_and_compile.sh: add quoting to the generated scripts
run_fgfs.sh and run_fgfs_debug.sh have been tested: now they work fine
when run from a directory whose path contains spaces.

The other scripts have been quickly updated, because the problems were
quite similar, but these haven't been tested (the FGo! startup script
had useless stuff, the FGx one had very weird things like "cd $ " which
probably had not been tested).
2019-04-21 13:37:35 +02:00
Florent Rougon b2274fbbed download_and_compile.sh: pass -DTRANSLATIONS_SRC_DIR when building FlightGear
When configuring FlightGear, flightgear/CMakeModules/Translations.cmake
checks for the presence of "${FGDATA_SRC_DIR}/Translations/${xlf_file}"
where ${xlf_file} is en_US/FlightGear-Qt.xlf, however this
${FGDATA_SRC_DIR} is *not* initialized from -DFG_DATA_DIR argument
passed on FlightGear's cmake command. The autodetection only works if
FGData is located in ../fgdata from the FlightGear source directory. In
the meantime, make download_and_compile.sh explicitly pass
-DTRANSLATIONS_SRC_DIR:PATH when configuring FG.

The -DFG_DATA_DIR:PATH vs. -DFG_DATA_DIR change is visible in
build/flightgear/CMakeCache.txt but not decisive here.
2019-04-21 11:45:28 +02:00
Florent Rougon cd80fffbe2 download_and_compile.sh: add quoting around variable expansions
Should behave better in case one of these variables contains whitespace.

Note: I didn't look inside the generated scripts such as run_fgfs.sh,
      they may have similar issues.
2019-04-21 08:39:34 +02:00
Florent Rougon 5e25bc9277 download_and_compile.sh: don't attempt to install libcppunit-dev anymore
According to Edward, installing the system CppUnit library is not really
useful and likely to cause problems.[1]

This reverts commit 6caf43f9e7.

[1] https://sourceforge.net/p/flightgear/mailman/message/36636483/
2019-04-11 10:34:29 +02:00
Florent Rougon 06d84d1d5b download_and_compile.sh: don't install CMake from distro package when we build it
Don't install the 'cmake' distro package when the CMAKE component has
been selected.
2019-04-09 10:34:39 +02:00
Florent Rougon 6661d1e10c download_and_compile.sh: only install dependencies for selected components
For instance, don't attempt to install TerraGear dependencies unless
TERRAGEAR is in WHATTOBUILD. This should significantly reduce the number
of packages downloaded by the first use of download_and_compile.sh that
doesn't have -pn in the options.

We may get reports of missing dependencies for some components as a side
effect of this change; we'll just have to add the missing dependencies
wherever they are required (this can happen if, for instance, some
particular dependency was so far listed in the comments only as a
TERRAGEAR dependency, but was actually required by *another component*
such as FGFS). Incorrect dependency information needs to be fixed,
that's all there is to it.
2019-04-09 10:34:30 +02:00
Florent Rougon 6caf43f9e7 download_and_compile.sh: add optional dependency on libcppunit-dev
The dependency is optional because CppUnit is shipped with the FG
sources. However, when installed via the distro package manager as we
are attempting here:
  - the FG build will be quicker;
  - libcppunit-dev will be updated like other distro packages (e.g.,
    it will receive security updates).
2019-04-09 09:40:28 +02:00
chris_blues 7b51c99439 FGmeta/Nasa2FGearthview
-----------------------
* merge contribution of eatdirt <chris@ringeval.com>
  add download, conversion and generation of normalmaps
  Big thanks Chris!
* update README and some minor updates to the script
2019-03-25 18:20:43 +01:00
Florent Rougon 1cf284bd6f download_and_compile.sh: add optional dependency on qttools5-dev
This package is needed to embed translations in the built-in launcher
(it contains Qt5LinguistToolsConfig.cmake). Thanks to Clm76 for the
feedback.
2019-03-25 11:09:13 +01:00
Florent Rougon 1f27f8e39a download_and_compile.sh: create openscenegraph dir only when OSG build is enabled
Dont create the 'openscenegraph' directory when the OSG build is
not selected (request from user ctesc356 of the French forum).
2019-03-23 14:34:51 +01:00
Torsten Dreyer caaad41e26 track submodule changes for release 2019-03-13 21:21:07 +01:00
Torsten Dreyer 120055fa43 new version: 2019.2.0 2019-03-13 21:21:07 +01:00
13 changed files with 1029 additions and 392 deletions
+4 -4
View File
@@ -1,11 +1,11 @@
[submodule "simgear"] [submodule "simgear"]
path = simgear path = simgear
url = ../simgear url = ../simgear
branch = release/2019.1 branch = next
[submodule "flightgear"] [submodule "flightgear"]
path = flightgear path = flightgear
url = ../flightgear url = ../flightgear
branch = release/2019.1 branch = next
[submodule "fgrun"] [submodule "fgrun"]
path = fgrun path = fgrun
url = ../fgrun url = ../fgrun
@@ -13,7 +13,7 @@
[submodule "fgdata"] [submodule "fgdata"]
path = fgdata path = fgdata
url = ../fgdata url = ../fgdata
branch = release/2019.1 branch = next
[submodule "windows-3rd-party"] [submodule "windows-3rd-party"]
path = windows-3rd-party path = windows-3rd-party
url = ../windows-3rd-party url = ../windows-3rd-party
@@ -21,4 +21,4 @@
[submodule "getstart"] [submodule "getstart"]
path = getstart path = getstart
url = ../getstart url = ../getstart
branch = release/2019.1 branch = next
+4
View File
@@ -85,6 +85,8 @@ Source: "{#ThirdPartyDir}\3rdParty\bin\libintl-8.dll"; DestDir: "{app}\bin"; Che
Source: "{#ThirdPartyDir}\3rdParty\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\dbus-1-3.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\event_core.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
; 64 bits install ; 64 bits install
Source: "{#InstallDir64}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode Source: "{#InstallDir64}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
@@ -99,6 +101,8 @@ Source: "{#ThirdPartyDir}\3rdParty.x64\bin\libintl-8.dll"; DestDir: "{app}\bin";
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty.x64\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\dbus-1-3.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\event_core.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
; Include the base package ; Include the base package
#if IncludeData == "TRUE" #if IncludeData == "TRUE"
+107 -58
View File
@@ -1,96 +1,123 @@
# Nasa2FGearthview # Nasa2FGearthview
A bash-script to convert NASA satellite images to ready-to-use A bash-script to convert NASA satellite images to ready-to-use
textures for FG's EarthView using ImageMagick. textures for FG's EarthView using ImageMagick and normalmap
For info about FGearthview, see the forum thread: You can get "normalmap" there:
https://github.com/planrich/normalmap
For info about FGearthview, see the forum thread:\
https://forum.flightgear.org/viewtopic.php?f=6&t=15754 https://forum.flightgear.org/viewtopic.php?f=6&t=15754
or this FG-wiki-page:
or this FG-wiki-page:\
http://wiki.flightgear.org/Earthview http://wiki.flightgear.org/Earthview
### Caution!
Don't use this script on a server! It will most likely cause
Denial-of-service (DoS). When working on these huge images, the
harddisk throughput will cease occasionally and CPU / RAM usage will
spike tremendously! So, only use this script on your home desktop
computer, or if you don't mind several long server-outages...
------------------------------------ ------------------------------------
About: ## About:
This script runs on Linux (maybe Mac also?) in a Bash This script runs on Linux (maybe Mac also?) in a Bash
(Bourne Again Shell) - Windows is not supported (by the nature of the (Bourne Again Shell) - Windows is not supported (by the nature of the
script). Maybe it works on windows as well, I don't know, feel free script). Maybe it works on windows as well, I don't know, feel free
to try, and please let me know! :) to try, and please let me know! :)
This will download the raw images from http://visibleearth.nasa.gov -
their server is not very fast, so I provide an alternative download
location: https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
This one is much quicker! If you really want the images directly from
NASA, then provide "nasa" to the script (see below)
In the end you will have 8 world-textures in .png and .dds format. In the end you will have 8 world-textures in .png and .dds format.
Generally .dds is better in performance, but it won't work on some Generally .dds is better in performance, but it won't work on some
graphics cards. If this is the case for you, then try the .png files. graphics cards. If this is the case for you, then try the .png files.
For further information see: For further information see:\
http://wiki.flightgear.org/index.php?title=DDS_Textures_in_FlightGear&redirect=no http://wiki.flightgear.org/index.php?title=DDS_Textures_in_FlightGear&redirect=no
If you also converted the clouds, then you'll also find 8 cloud- If you also converted the clouds and the height maps, then you'll also
textures in the format .png. Because the .dds-format has trouble with find 8 cloud- and 8 height textures (as well as their conversion to
rendering heavy alpha images, which is because of it's compression normal maps) in the format .png. Because the .dds-format has trouble
algorythm [1], I think it's useless to also build faulty files. with rendering heavy alpha images, which is because of it's
However, this is not entirely true! It is possible to switch off the compression algorythm [1], I think it's useless to also build faulty
.dds/DXT compression. But this results in huge files and is rather files. However, this is not entirely true! It is possible to switch
heavy on the GPU's RAM. off the .dds/DXT compression. But this results in huge files and is
rather heavy on the GPU's RAM.
Buckaroo has created a nice overview on dds-compression: Buckaroo has created a nice overview on dds-compression:
[1] http://www.buckarooshangar.com/flightgear/tut_dds.html [1] http://www.buckarooshangar.com/flightgear/tut_dds.html
------------------------------------ ------------------------------------
Installation and usage: ## Installation and usage:
Simply copy "convert.sh" into a folder of your liking and run it: Simply copy "convert.sh" into a folder of your liking and run it:
$ ./convert.sh ```shell
./convert.sh
```
This will show a help text, since you didn't specify any target(s). This will show a help text, since you didn't specify any target(s).
Possible targets are: Possible targets are:
* world * world
* clouds * clouds
* heights
* all * all
Additionally, there are some options you could specify (further Additionally, there are some options you could specify (further
explained below): explained below):
* 1k | 2k | 4k | 8k | 16k * 1k | 2k | 4k | 8k | 16k
* nasa * download | no-download
* no-download * world
* clouds
* heights
* cleanup * cleanup
* rebuild * rebuild
* check * check
So your call could look sth like this: So your call could look sth like this:
$ ./convert.sh world no-download cleanup 8k ```shell
./convert.sh world download alt cleanup 8k
```
------------------------------------ ------------------------------------
Requirements: ## Requirements:
WARNING! WARNING!
This script uses a *lot* disk space! Make sure you have at least 90GB This script uses a *lot* disk space! In my last test run, which
available! generated all maps in all resolutions, the disk usage was about 330GB!
Beware!\
Also, I wouldn't recommend doing this on a SSD! While SSDs are
generally faster, they also get more wear-and-tear when write such
huge files. So this script might cause your SSD to die earlier as it
should. Generally speaking, this won't kill your SSD, but it might
cause it to die earlier. HDDs are much more robust in that respect.
Also, this script will run for a *very long* time! It might be best to Also, this script will run for a *very long* time! It might be best to
let it run over night - your computer might become unresponsive from let it run over night - your computer might become unresponsive from
time to time, due to the heavy CPU and memory load, which tends to time to time, due to the heavy CPU and memory load, which tends to
occur, when converting 54000x27000 images. ;-) occur, when converting 54000x27000 images. ;-)
I also recommend to deactivate swapping!
$ sudo swapoff -a
To reactivate swapping do:
$ sudo swapon -a
This script relies on wget and imagemagick. Both are easily installed I also recommend to deactivate swapping!
by your systems package-management-system. ```shell
(On Debian/Ubuntu this is "apt-get") sudo swapoff -a
```
To reactivate swapping do:
```shell
$ sudo swapon -a
```
This script relies on wget, ImageMagick and, for converting the height
maps to normal maps, on "normalmap". Some of these programs are easily
installed by your systems package-management-system.\ (On
Debian/Ubuntu this is "apt-get").
So, on Debian for instance, you only need to put the following into So, on Debian for instance, you only need to put the following into
the console: the console:
$ sudo apt-get install wget imagemagick ```shell
sudo apt-get install wget imagemagick
```
Depending on your distro, the package names might differ slightly! Use Depending on your distro, the package names might differ slightly! Use
a search engine of your choice to find out, how the packages are named a search engine of your choice to find out, how the packages are named
@@ -98,55 +125,77 @@ in your distro!
You may want to check: You may want to check:
$ apt search imagemagick ```shell
apt search imagemagick
```
### IMPORTANT!
Check out your ```/etc/ImageMagick-6/policy.xml```
On some distros, there are limits set, which will cause IM to abort
the conversion of images larger than
[rediculously small images](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860763).
Edit and set to our needs:
* width: at least 55000
* height: at least 55000
* area: less than your free RAM
### Normalmap
For normalmap, you can download and compile it from
https://github.com/planrich/normalmap
You can install the binary into your system, or just copy it next to
convert.sh - both should work.
------------------------------------ ------------------------------------
Targets: ## Targets:
world **world**\
Generates the world tiles, needed to run FG with EarthView. Generates the world tiles, needed to run FG with EarthView.
You will find the results in output/[$resolution]/*. Copy You will find the results in output/[$resolution]/\*. Copy
these into $FGDATA/Models/Astro/*. More about the installation these into $FGDATA/Models/Astro/\*. More about the installation
of these textures can be found here: of these textures can be found here:
http://wiki.flightgear.org/Earthview#Customization http://wiki.flightgear.org/Earthview#Customization
clouds **clouds**\
Generates the cloud tiles, needed to run FG with EarthView. Generates the cloud tiles, needed to run FG with EarthView.
The locations are the same as the other textures mentioned The locations are the same as the other textures mentioned
above. Note that clouds are only available with up to 8k above. Note that clouds are only available with up to 8k
resolution, due to the available data at NASA. resolution, due to the available data at NASA.
all **heights**\
Generates the height tiles, which are then converted to the
normal maps needed to run FG with EarthView. The locations are
the same as the other textures mentioned above. Note that
heights are only available with up to 8k resolution, due to the
available data at NASA.
**all**\
Converts everything needed for a full-blown earthview texture Converts everything needed for a full-blown earthview texture
set. Does the same as: set. Does the same as:
$ ./convert.sh world clouds ```./convert.sh world clouds heights```
Options: ## Options:
1k | 2k | 4k | 8k | 16k **1k | 2k | 4k | 8k | 16k**\
Lets you specify a desired resolution of the textures. Lets you specify a desired resolution of the textures.
Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is
specified, the script will generate all of the resolutions. specified, the script will generate all of the resolutions.
16k is only available for earth textures. 16k is recommended only for earth textures, it will induce
oversampling from clouds and height maps.
nasa **download**\
Causes the script to download directly from Causes the script to download the needed data, this is the
http://visibleearth.nasa.gov . If omitted the script will default behavior (and can be omitted).
download from
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
which is much faster!
Uses wget either way.
no-download **no-download**\
Causes the script to skip the download function. If you Causes the script to skip the download function. If you
already have the source images, then you don't need to already have the source images, then you don't need to
re-download them. (About 2.4GB!) re-download them. (About 2.4GB!)
If omitted, the script will download the source images from If omitted, the script will download the source images from
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z the default location.
cleanup **cleanup**\
Deletes the temporary files created during texture generation. Deletes the temporary files created during texture generation.
These can be found in tmp/ These can be found in tmp/
Note: if for some reason you later want some other resolution, Note: if for some reason you later want some other resolution,
@@ -155,13 +204,13 @@ cleanup
Frees up a lot of disk-space! Which would have to be Frees up a lot of disk-space! Which would have to be
regenerated if needed again. regenerated if needed again.
rebuild **rebuild**\
Deletes only the temporary files of the given target. So if Deletes only the temporary files of the given target. So if
you call './convert.sh rebuild world' the script will delete you call ```./convert.sh rebuild world``` the script will delete
all corresponding temp-files of the target world, which will all corresponding temp-files of the target world, which will
trigger a complete regeneration of the relevant (instead of trigger a complete regeneration of the relevant (instead of
skipping existing files) skipping existing files)
check **check**\
Creates mosaics of the tiles, so you can look at them and see Creates mosaics of the tiles, so you can look at them and see
if all went well. if all went well.
+518 -74
View File
@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# convert.sh - a script to convert NASA sattelite images into textures for use with FGearthview (orbital rendering) # convert.sh - a script to convert NASA sattelite images into textures
# Copyright (C) 2016 Chris Schwarz <chris@musicchris.de> # for use with FGearthview (orbital rendering)
# Copyright (C) 2016 chris_blues <chris@musicchris.de>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -16,9 +17,12 @@
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# v0.12: Chris Ringeval (eatdirt):
# -add normalmapping output + small improvements
VERSION="v0.11" VERSION="v0.13"
# make sure the script halts on error # make sure the script halts on error
set -e set -e
@@ -29,21 +33,21 @@ function showHelp
echo "https://github.com/chris-blues/Nasa2FGearthview" echo "https://github.com/chris-blues/Nasa2FGearthview"
echo echo
echo "Usage:" echo "Usage:"
echo "./convert.sh [ download world clouds 8k cleanup rebuild ]" echo "./convert.sh [ download no-download world clouds heights"
echo " 1k 2k 4k 8k 16k cleanup rebuild ]"
echo echo
echo "* Append \"nasa\" to download the needed images from NASA"
echo " -> This will download ca 2.4GB of data!"
echo " -> wget can continue interrupted downloads!"
echo " If omitted, it will download from my server, which is a lot"
echo " faster. See README for details."
echo "* Append \"no-download\" to the command to skip the download" echo "* Append \"no-download\" to the command to skip the download"
echo " process alltogether. Only makes sense if you already got" echo " process alltogether. Only makes sense if you already got"
echo " the necessary data." echo " the necessary data."
echo "* Append \"world\" to the command to generate the world tiles" echo "* Append \"world\" to the command to generate the world tiles"
echo "* Append \"clouds\" to the command to generate cloud tiles" echo "* Append \"clouds\" to the command to generate cloud tiles"
echo "* Append \"all\" to the command to generate both - world and" echo "* Append \"heights\" to the command to generate height tiles"
echo " clouds" echo " and the normalmaps needed by EarthView. Notice that you need"
echo "* Append the size of the tiles (1k, 2k, 4, 8k, 16k). If you" echo " the normalmap binary to be installed. You can get it from:"
echo " https://github.com/planrich/normalmap"
echo "* Append \"all\" to the command to generate all - world, clouds"
echo " and heights"
echo "* Append the size of the tiles (1k, 2k, 4k, 8k, 16k). If you"
echo " don't pass a resolution, then all resolutions will be" echo " don't pass a resolution, then all resolutions will be"
echo " generated." echo " generated."
echo "* Append \"cleanup\" to delete all temporary files in tmp/" echo "* Append \"cleanup\" to delete all temporary files in tmp/"
@@ -59,7 +63,7 @@ function showHelp
echo " Useful if the source files have changed." echo " Useful if the source files have changed."
echo "* Append \"check\" to let check the results. This will create" echo "* Append \"check\" to let check the results. This will create"
echo " mosaics of the existing tiles. If no target is specified," echo " mosaics of the existing tiles. If no target is specified,"
echo " all 3 layers will be built: clouds world and nightlights." echo " all layers will be built: clouds, heights, world and nightlights."
echo echo
echo "If, for some reason, the script aborts, then it will try to" echo "If, for some reason, the script aborts, then it will try to"
echo "skip the already completed steps, so you don't have to wait" echo "skip the already completed steps, so you don't have to wait"
@@ -102,11 +106,11 @@ if [ $1 == "-h" ] ; then showHelp ; fi
################################ ################################
for ARG in "$@" for ARG in "$@"
do do
if [ $ARG == "nasa" ] ; then DOWNLOAD="true" ; DL_LOCATION="NASA" ; echo "Downloading from visibleearth.nasa.gov" ; fi
if [ $ARG == "no-download" ] ; then DOWNLOAD="false" ; echo "Skipping the download process" ; fi if [ $ARG == "no-download" ] ; then DOWNLOAD="false" ; echo "Skipping the download process" ; fi
if [ $ARG == "world" ] ; then WORLD="true" ; fi if [ $ARG == "world" ] ; then WORLD="true" ; fi
if [ $ARG == "clouds" ] ; then CLOUDS="true" ; fi if [ $ARG == "clouds" ] ; then CLOUDS="true" ; fi
if [ $ARG == "all" ] ; then WORLD="true" ; CLOUDS="true" ; fi if [ $ARG == "heights" ] ; then HEIGHTS="true" ; fi
if [ $ARG == "all" ] ; then WORLD="true" ; CLOUDS="true" ; HEIGHTS="true" ; fi
if [ $ARG == "1k" ] ; then RESOLUTION="1024" ; fi if [ $ARG == "1k" ] ; then RESOLUTION="1024" ; fi
if [ $ARG == "2k" ] ; then RESOLUTION="2048" ; fi if [ $ARG == "2k" ] ; then RESOLUTION="2048" ; fi
if [ $ARG == "4k" ] ; then RESOLUTION="4096" ; fi if [ $ARG == "4k" ] ; then RESOLUTION="4096" ; fi
@@ -119,17 +123,22 @@ done
if [ -z $DOWNLOAD ] ; then DOWNLOAD="true" ; fi if [ -z $DOWNLOAD ] ; then DOWNLOAD="true" ; fi
if [ -z $WORLD ] ; then WORLD="false" ; fi if [ -z $WORLD ] ; then WORLD="false" ; fi
if [ -z $CLOUDS ] ; then CLOUDS="false" ; fi if [ -z $CLOUDS ] ; then CLOUDS="false" ; fi
if [ -z $HEIGHTS ] ; then HEIGHTS="false" ; fi
if [ -z $CLEANUP ] ; then CLEANUP="false" ; fi if [ -z $CLEANUP ] ; then CLEANUP="false" ; fi
if [ -z $REBUILD ] ; then REBUILD="false" ; fi if [ -z $REBUILD ] ; then REBUILD="false" ; fi
if [ -z $BUILDCHECKS ] ; then BUILDCHECKS="false" ; fi if [ -z $BUILDCHECKS ] ; then BUILDCHECKS="false" ; fi
CHECKWORLD=$WORLD CHECKWORLD=$WORLD
CHECKCLOUDS=$CLOUDS CHECKCLOUDS=$CLOUDS
CHECKHEIGHTS=$HEIGHTS
######################## ########################
## Set some variables ## ## Set some variables ##
######################## ########################
DL_LOCATION="NASA"
mkdir -p tmp mkdir -p tmp
export MAGICK_TMPDIR=${PWD}/tmp export MAGICK_TMPDIR=${PWD}/tmp
echo "tmp-dir: $MAGICK_TMPDIR" echo "tmp-dir: $MAGICK_TMPDIR"
@@ -139,21 +148,50 @@ TIME=$(date +"%Y-%m-%d_%H:%M:%S")
LOGFILE_GENERAL="logs/${TIME}.log" LOGFILE_GENERAL="logs/${TIME}.log"
LOGFILE_TIME="logs/${TIME}.time.log" LOGFILE_TIME="logs/${TIME}.time.log"
URLS_WORLD="http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A1.png #command line gimp plugin from https://github.com/planrich/normalmap
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A2.png #higher filters (5x5) create too sharp features (no rescaling, I
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B1.png #assume earthview do its own normalization)
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B2.png NORMALBIN="normalmap"
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C1.png NORMALOPTS="-s 1 -f FILTER_PREWITT_3x3"
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C2.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D1.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D2.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/79000/79765/dnb_land_ocean_ice.2012.54000x27000_geo.tif"
URLS_CLOUDS="http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.E.2001210.21600x21600.png URLS_WORLD="https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A1.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.W.2001210.21600x21600.png" https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B1.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C1.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D1.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/79000/79765/dnb_land_ocean_ice.2012.54000x27000_geo.tif"
URLS_CLOUDS="https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.E.2001210.21600x21600.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.W.2001210.21600x21600.png"
URLS_HEIGHTS="https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_A1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_A2_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_B1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_B2_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_C1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_C2_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_D1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_D2_grey_geo.tif"
if ! [ -x "$(command -v $NORMALBIN)" ]
then
if ! [ -x "./${NORMALBIN}" ]
then
echo ">>>>>>>>>>>> Error: $NORMALBIN binary not found! <<<<<<<<<<<<<"
echo "You can get it from: https://github.com/planrich/normalmap"
HEIGHTS="false"
else
NORMALBIN="./${NORMALBIN}"
fi
else
echo ">>>>>>>>>>>> Error: $NORMALBIN binary not found! <<<<<<<<<<<<<"
echo "You can get it from: https://github.com/planrich/normalmap"
HEIGHTS="false"
fi
ALTERNATE_URL="https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z"
ALTERNATE_FILENAME="raw-data-NASA.7z"
if [ -z $RESOLUTION ] if [ -z $RESOLUTION ]
then then
@@ -162,7 +200,7 @@ if [ -z $RESOLUTION ]
4096 4096
8192 8192
16384" 16384"
NO_RESOLUTION_GIVEN="true" NO_RESOLUTION_GIVEN="false"
RESOLUTION_MAX="16384" RESOLUTION_MAX="16384"
fi fi
if [ -z $RESOLUTION_MAX ] ; then RESOLUTION_MAX=$RESOLUTION ; fi if [ -z $RESOLUTION_MAX ] ; then RESOLUTION_MAX=$RESOLUTION ; fi
@@ -236,6 +274,18 @@ function rebuild
rm tmp/cloud* rm tmp/cloud*
} }
fi fi
if [ $HEIGHTS == "true" ]
then
{
echo
echo "#########################################"
echo "## Removing tmp-files of target heights##"
echo "#########################################"
rm tmp/height*
}
fi
} }
function cleanUp function cleanUp
@@ -244,9 +294,10 @@ function cleanUp
echo "############################" echo "############################"
echo "## Removing all tmp-files ##" echo "## Removing all tmp-files ##"
echo "############################" echo "############################"
rm -rv tmp/night* rm -rvf tmp/night*
rm -rv tmp/world* rm -rvf tmp/world*
rm -rv tmp/clouds* rm -rvf tmp/cloud*
rm -rvf tmp/height*
} }
function prettyTime function prettyTime
@@ -312,13 +363,18 @@ function downloadImages
{ {
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
echo "###################################################" | tee -a $LOGFILE_GENERAL echo "###################################################" | tee -a $LOGFILE_GENERAL
if [ ! -z $DL_LOCATION ] if [ -z $DL_LOCATION ]
then echo "## Downloading images from visibleearth.nasa.gov ##" | tee -a $LOGFILE_GENERAL then
else echo "## Downloading images from musicchris.de ##" | tee -a $LOGFILE_GENERAL DL_LOCATION="NASA"
fi fi
if [ $DL_LOCATION == "NASA" ]
then
echo "## Downloading images from visibleearth.nasa.gov ##" | tee -a $LOGFILE_GENERAL
fi
echo "###################################################" | tee -a $LOGFILE_GENERAL echo "###################################################" | tee -a $LOGFILE_GENERAL
if [ -z $DL_LOCATION ] ; then f=$ALTERNATE_URL ; DL_LOCATION="musicchris.de" ; fi
FILENAME=$(echo $f | sed 's@.*/@@')
if [ $WORLD == "true" ] if [ $WORLD == "true" ]
then then
if [ $DL_LOCATION == "NASA" ] if [ $DL_LOCATION == "NASA" ]
@@ -335,7 +391,13 @@ function downloadImages
fi fi
fi fi
if [ $DL_LOCATION == "musicchris.de" ] ; then downloadMusicchris ; fi if [ $HEIGHTS == "true" ]
then
if [ $DL_LOCATION == "NASA" ]
then
downloadHeights
fi
fi
} }
function downloadWorld function downloadWorld
@@ -345,10 +407,23 @@ function downloadWorld
for f in $URLS_WORLD for f in $URLS_WORLD
do do
FILENAME=$(echo $f | sed 's@.*/@@') FILENAME=$(echo $f | sed 's@.*/@@')
wget --output-document=input/$FILENAME --continue --show-progress $f 2>> $LOGFILE_GENERAL wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done done
} }
function downloadHeights
{
mkdir -p input
echo "Downloading height tiles..." | tee -a $LOGFILE_GENERAL
for f in $URLS_HEIGHTS
do
FILENAME=$(echo $f | sed 's@.*/@@')
wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done
}
function downloadClouds function downloadClouds
{ {
mkdir -p input mkdir -p input
@@ -356,24 +431,10 @@ function downloadClouds
for f in $URLS_CLOUDS for f in $URLS_CLOUDS
do do
FILENAME=$(echo $f | sed 's@.*/@@') FILENAME=$(echo $f | sed 's@.*/@@')
wget --output-document=input/$FILENAME --continue --show-progress $f 2>> $LOGFILE_GENERAL wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done done
} }
function downloadMusicchris
{
mkdir -p input
echo "Downloading raw images... (ca 2.2 GB)" | tee -a $LOGFILE_GENERAL
for p in 1 2 3 4 5
do
wget --output-document=input/${FILENAME}.00${p} --continue --show-progress $ALTERNATE_URL | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done
echo "Unpacking raw images..." | tee -a $LOGFILE_GENERAL
cd input
7z e -bt -y raw-data-NASA.7z 2>> $LOGFILE_GENERAL
cd ..
}
function generateWorld function generateWorld
{ {
STARTTIME=$(date +%s) STARTTIME=$(date +%s)
@@ -419,7 +480,7 @@ function generateWorld
let "RESIZE_H = ( $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH ) ) * 2" let "RESIZE_H = ( $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH ) ) * 2"
if [ ! -s "tmp/nightlights_${RESIZE_W}x${RESIZE_H}.mpc" ] if [ ! -s "tmp/nightlights_${RESIZE_W}x${RESIZE_H}.mpc" ]
then then
for r in 16384 8192 4096 2048 for r in $RESOLUTION
do do
if [ $r -le $RESOLUTION_MAX ] if [ $r -le $RESOLUTION_MAX ]
then continue then continue
@@ -553,7 +614,7 @@ function generateWorld
do do
NASA2FG $t NASA2FG $t
FOUND_BIGGER_WORLD_PICTURE="false" FOUND_BIGGER_WORLD_PICTURE="false"
unset $TIMESAVER_SIZE unset TIMESAVER_SIZE
if [ ! -s "tmp/world_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ] if [ ! -s "tmp/world_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ]
then then
{ {
@@ -825,6 +886,10 @@ function generateWorld
echo echo
echo "--> Writing output/${r}/world_${t}.dds @ ${r}x${r}" echo "--> Writing output/${r}/world_${t}.dds @ ${r}x${r}"
# set -x # set -x
if [ ! -s "output/${r}/world_${t}.dds" ]
then
convert \ convert \
-monitor \ -monitor \
tmp/world_${RESOLUTION_MAX}_done_${t}.mpc \ tmp/world_${RESOLUTION_MAX}_done_${t}.mpc \
@@ -834,7 +899,15 @@ function generateWorld
output/${r}/world_${t}.dds output/${r}/world_${t}.dds
set +x set +x
echo echo
else echo "=> Skipping existing file: output/${r}/world_${t}.dds" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
echo "--> Writing output/${r}/world_${t}.png @ ${r}x${r}" echo "--> Writing output/${r}/world_${t}.png @ ${r}x${r}"
if [ ! -s "output/${r}/world_${t}.png" ]
then
# set -x # set -x
convert \ convert \
-monitor \ -monitor \
@@ -843,6 +916,10 @@ function generateWorld
output/${r}/world_${t}.png output/${r}/world_${t}.png
set +x set +x
echo echo
else echo "=> Skipping existing file: output/${r}/world_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
} }
done done
@@ -874,7 +951,11 @@ function generateClouds
{ {
if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi
# maximum cloud-tile resolution is 8192, since we have no big enough source files... # maximum cloud-tile resolution is 8192, since we have no big enough source files...
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128" let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )" let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1" let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
@@ -1071,7 +1152,9 @@ W"
echo "## propagate last pixels to the edge ##" | tee -a $LOGFILE_GENERAL echo "## propagate last pixels to the edge ##" | tee -a $LOGFILE_GENERAL
echo "#######################################" | tee -a $LOGFILE_GENERAL echo "#######################################" | tee -a $LOGFILE_GENERAL
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128" let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )" let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1" let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
@@ -1190,23 +1273,22 @@ W"
for r in $RESOLUTION for r in $RESOLUTION
do do
{ {
if [ $r -eq 16384 ]
then
if [ $NO_RESOLUTION_GIVEN == "true" ]
then
continue
else
r=8192
fi
fi
mkdir -p output/$r mkdir -p output/$r
echo
if [ ! -s "output/${r}/clouds_${t}.png" ]
then
echo "--> Writing output/${r}/clouds_${t}.png @ ${r}x${r}" | tee -a $LOGFILE_GENERAL echo "--> Writing output/${r}/clouds_${t}.png @ ${r}x${r}" | tee -a $LOGFILE_GENERAL
convert \ convert \
-monitor \ -monitor \
tmp/clouds_${RESOLUTION_MAX}_${t}_done.mpc \ tmp/clouds_${RESOLUTION_MAX}_${t}_done.mpc \
-resize ${r}x${r} \ -resize ${r}x${r} \
output/${r}/clouds_${t}.png output/${r}/clouds_${t}.png
echo
else echo "=> Skipping existing file: output/${r}/clouds_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
} }
done done
@@ -1231,6 +1313,322 @@ W"
echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
} }
function generateHeights
{
if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi
echo | tee -a $LOGFILE_GENERAL
echo "################################" | tee -a $LOGFILE_GENERAL
echo "#### Processing Heights ####" | tee -a $LOGFILE_GENERAL
echo "################################" | tee -a $LOGFILE_GENERAL
echo | tee -a $LOGFILE_GENERAL
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
let "IMAGE_WITH_BORDER_POS = $RESOLUTION_MAX - $BORDER_WIDTH"
let "SIZE = 2 * $IMAGE_BORDERLESS"
mkdir -p tmp
mkdir -p output
echo "################################################" | tee -a $LOGFILE_GENERAL
echo "## Resize the NASA-Originals to ${RESOLUTION_MAX}-(2*${BORDER_WIDTH}) ##" | tee -a $LOGFILE_GENERAL
echo "################################################" | tee -a $LOGFILE_GENERAL
for t in $NASA
do
NASA2FG $t
FOUND_BIGGER_WORLD_PICTURE="false"
unset TIMESAVER_SIZE
if [ ! -s "tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ]
then
{
for r in $RESOLUTION
do
if [ $r -le $RESOLUTION_MAX ]
then
continue
fi
let "IMAGE_SIZE = $r - ( 2 * ( $r / 128 ) )"
let "I_W = $IMAGE_SIZE * 4"
let "I_H = $IMAGE_SIZE * 2"
if [ -s tmp/heights_seamless_${IMAGE_SIZE}_${DEST}.mpc ]
then
if [ $IMAGE_SIZE -ge $IMAGE_BORDERLESS ]
then
FOUND_BIGGER_WORLD_PICTURE="true"
TIMESAVER_SIZE="$IMAGE_SIZE"
fi
fi
done
if [ $FOUND_BIGGER_WORLD_PICTURE != "true" ]
then
# set -x
convert \
-monitor \
-limit memory 32 \
-limit map 32 \
input/gebco_08_rev_elev_${t}_grey_geo.tif \
-resize ${IMAGE_BORDERLESS}x${IMAGE_BORDERLESS} \
tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc
set +x
else
echo "==> Timesaver:) Using existing file: tmp/heights_seamless_${TIMESAVER_SIZE}_${DEST}.mpc -> tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" | tee -a $LOGFILE_GENERAL
set -x
convert \
-monitor \
-limit memory 32 \
-limit map 32 \
tmp/heights_seamless_${TIMESAVER_SIZE}_${DEST}.mpc \
-resize ${IMAGE_BORDERLESS}x${IMAGE_BORDERLESS} \
tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc
set +x
fi
}
else echo "=> Skipping existing file: tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
done
# 3h, 12m, 9s
if [ -z $LASTTIME ] ; then LASTTIME=$STARTTIME ; fi
echo "input/gebco_08_rev_elev_[A-D][12]_grey_geo.tif -> tmp/heights_seamless_${IMAGE_BORDERLESS}_[NS][1-4].mpc" >> $LOGFILE_TIME
getProcessingTime
echo | tee -a $LOGFILE_GENERAL
echo "#####################################" | tee -a $LOGFILE_GENERAL
echo "## Put a ${BORDER_WIDTH}px border to each side ##" | tee -a $LOGFILE_GENERAL
echo "#####################################" | tee -a $LOGFILE_GENERAL
for t in $TILES
do
if [ ! -s "tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc" ]
then
# set -x
convert \
-monitor \
tmp/heights_seamless_${IMAGE_BORDERLESS}_${t}.mpc \
-bordercolor none \
-border ${BORDER_WIDTH} \
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc
set +x
echo
fi
if [ ! -s "tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc" ]
then
# set -x
cp tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
cp tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.cache tmp/heights_seams_${RESOLUTION_MAX}_${t}.cache
set +x
else echo "=> Skipping existing file: tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
done
# 11m, 24s
echo "-> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4]_emptyBorder.mpc -> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4].mpc" >> $LOGFILE_TIME
getProcessingTime
echo | tee -a $LOGFILE_GENERAL
echo "######################################################" | tee -a $LOGFILE_GENERAL
echo "## crop borderline pixels and propagate to the edge ##" | tee -a $LOGFILE_GENERAL
echo "######################################################" | tee -a $LOGFILE_GENERAL
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
let "IMAGE_WITH_BORDER_POS = $RESOLUTION_MAX - $BORDER_WIDTH"
let "SIZE = 2 * $IMAGE_BORDERLESS"
CROP_TOP="${IMAGE_BORDERLESS}x1+${BORDER_WIDTH}+${BORDER_WIDTH}"
CROP_RIGHT="1x${IMAGE_BORDERLESS}+${IMAGE_WITH_BORDER}+${BORDER_WIDTH}"
CROP_BOTTOM="${IMAGE_BORDERLESS}x1+${BORDER_WIDTH}+${IMAGE_WITH_BORDER}"
CROP_LEFT="1x${IMAGE_BORDERLESS}+${BORDER_WIDTH}+${BORDER_WIDTH}"
CROP_TOPLEFT="1x1+${BORDER_WIDTH}+${BORDER_WIDTH}"
CROP_TOPRIGHT="1x1+${IMAGE_WITH_BORDER}+${BORDER_WIDTH}"
CROP_BOTTOMRIGHT="1x1+${IMAGE_WITH_BORDER}+${IMAGE_WITH_BORDER}"
CROP_BOTTOMLEFT="1x1+${BORDER_WIDTH}+${IMAGE_WITH_BORDER}"
## HORIZ meaning a horizontal bar, like the one on top
HORIZ_RESIZE="${IMAGE_BORDERLESS}x${BORDER_WIDTH}"
VERT_RESIZE="${BORDER_WIDTH}x${IMAGE_BORDERLESS}"
POS_TOP="+${BORDER_WIDTH}+0"
POS_RIGHT="+${IMAGE_WITH_BORDER_POS}+${BORDER_WIDTH}"
POS_BOTTOM="+${BORDER_WIDTH}+${IMAGE_WITH_BORDER_POS}"
POS_LEFT="+0+${BORDER_WIDTH}"
for t in $TILES
do
if [ ! -s "tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" ]
then
for b in $BORDERS
do
{
if [ $b == "top" ]
then
CROP=$CROP_TOP
RESIZE=$HORIZ_RESIZE
POSITION=$POS_TOP
CROPCORNER=$CROP_TOPRIGHT
CORNER_POS="+${IMAGE_WITH_BORDER_POS}+0"
CORNER_NAME="topRight"
fi
if [ $b == "right" ]
then
CROP=$CROP_RIGHT
RESIZE=$VERT_RESIZE
POSITION=$POS_RIGHT
CROPCORNER=$CROP_BOTTOMRIGHT
CORNER_POS="+${IMAGE_WITH_BORDER_POS}+${IMAGE_WITH_BORDER_POS}"
CORNER_NAME="bottomRight"
fi
if [ $b == "bottom" ]
then
CROP=$CROP_BOTTOM
RESIZE=$HORIZ_RESIZE
POSITION=$POS_BOTTOM
CROPCORNER=$CROP_BOTTOMLEFT
CORNER_POS="+0+${IMAGE_WITH_BORDER_POS}"
CORNER_NAME="bottomLeft"
fi
if [ $b == "left" ]
then
CROP=$CROP_LEFT
RESIZE=$VERT_RESIZE
POSITION=$POS_LEFT
CROPCORNER=$CROP_TOPLEFT
CORNER_POS="+0+0"
CORNER_NAME="topLeft"
fi
echo
# set -x
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc \
-crop $CROP \
-resize $RESIZE\! \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${b}.mpc
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc \
-crop $CROPCORNER \
-resize ${BORDER_WIDTH}x${BORDER_WIDTH}\! \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${CORNER_NAME}.mpc
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${b}.mpc \
-geometry $POSITION \
-composite \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
echo
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${CORNER_NAME}.mpc \
-geometry $CORNER_POS \
-composite \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
set +x
echo
}
done
echo
# set -x
cp -v tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc | tee -a $LOGFILE_GENERAL
cp -v tmp/heights_seams_${RESOLUTION_MAX}_${t}.cache tmp/heights_${RESOLUTION_MAX}_done_${t}.cache | tee -a $LOGFILE_GENERAL
set +x
else echo "=> Skipping existing file: tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
done
# 37m, 6s
echo "-> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4].mpc -> tmp/heights_${RESOLUTION_MAX}_done_[NS][1-4].mpc" >> $LOGFILE_TIME
getProcessingTime
for t in $TILES
do
echo | tee -a $LOGFILE_GENERAL
echo "#############################" | tee -a $LOGFILE_GENERAL
echo "## Final output of tile $t ##" | tee -a $LOGFILE_GENERAL
echo "## and normalmapping ##" | tee -a $LOGFILE_GENERAL
echo "#############################" | tee -a $LOGFILE_GENERAL
for r in $RESOLUTION
do
{
mkdir -p output/$r
set +x
echo
echo "--> Writing output/${r}/heights_${t}.png @ ${r}x${r}"
# set -x
if [ ! -s "output/${r}/heights_${t}.png" ]
then
convert \
-monitor \
tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc \
-resize ${r}x${r} \
output/${r}/heights_${t}.png
echo
else echo "=> Skipping existing file: tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
echo "--> Writing output/${r}/normalmap_earth_${t}.png @ ${r}x${r}"
if [ ! -s "output/${r}/normalmap_earth_${t}.png" ]
then
$NORMALBIN $NORMALOPTS output/${r}/heights_${t}.png output/${r}/normalmap_earth_${t}.png
else echo "=> Skipping existing file: output/${r}/normalmap_earth_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
set +x
echo
}
done
echo | tee -a $LOGFILE_GENERAL
echo "Heights and Normal $t [ done ]" | tee -a $LOGFILE_GENERAL
echo | tee -a $LOGFILE_GENERAL
done
echo "###############################" | tee -a $LOGFILE_GENERAL
echo "#### Heights: [ done ] ####" | tee -a $LOGFILE_GENERAL
echo "###############################" | tee -a $LOGFILE_GENERAL
# 2h, 19m, 7s
# Overall processing time: 44089 s
# Overall processing time: 0 d, 2 h, 19 m, 7 s
echo "-> output/<\$RESOLUTIONS>/heights_[NS][1-4].png" >> $LOGFILE_TIME
getProcessingTime
echo
if [ $STARTTIME -eq $ENDTIME ]
then SECS=0
else let "SECS = $ENDTIME - $STARTTIME"
fi
echo "Overall processing time: $SECS s" | tee -a $LOGFILE_GENERAL
prettyTime
echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL
}
function checkResults function checkResults
{ {
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
@@ -1251,7 +1649,7 @@ function checkResults
let "HEIGHT = 2 * $RES" let "HEIGHT = 2 * $RES"
echo "Lowest available resolution is: $RES" | tee -a $LOGFILE_GENERAL echo "Lowest available resolution is: $RES" | tee -a $LOGFILE_GENERAL
if [ $CHECKCLOUDS == "true" ] if [[ $CHECKCLOUDS == "true" ]]
then then
{ {
echo "checking clouds..." | tee -a $LOGFILE_GENERAL echo "checking clouds..." | tee -a $LOGFILE_GENERAL
@@ -1292,7 +1690,51 @@ function checkResults
} }
fi fi
if [ $CHECKWORLD == "true" ]
if [[ $CHECKHEIGHTS == "true" ]]
then
{
echo "checking heights..." | tee -a $LOGFILE_GENERAL
echo | tee -a $LOGFILE_GENERAL
echo "Creating canvas ${WIDTH}x${HEIGHT}" | tee -a $LOGFILE_GENERAL
convert \
-size ${WIDTH}x${HEIGHT} \
xc:Black \
-alpha on \
check_heights.png
POS=0
for t in 1 2 3 4
do
convert \
-monitor \
check_heights.png \
output/${RES}/heights_N${t}.png \
-geometry +${POS}+0 \
-composite \
check_heights.png
echo
convert \
-monitor \
check_heights.png \
output/${RES}/heights_S${t}.png \
-geometry +${POS}+${RES} \
-composite \
check_heights.png
echo
let "POS += $RES"
done
mogrify \
-monitor \
-resize 4096x2048 \
check_heights.png
}
fi
if [[ $CHECKWORLD == "true" ]]
then then
{ {
echo "checking world..." | tee -a $LOGFILE_GENERAL echo "checking world..." | tee -a $LOGFILE_GENERAL
@@ -1366,6 +1808,7 @@ echo $TIME | tee -a $LOGFILE_TIME
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
printf "Target: " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME printf "Target: " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
if [ $CLOUDS == "true" ] ; then printf "clouds " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi if [ $CLOUDS == "true" ] ; then printf "clouds " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
if [ $HEIGHTS == "true" ] ; then printf "heights " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
if [ $WORLD == "true" ] ; then printf "world " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi if [ $WORLD == "true" ] ; then printf "world " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
echo | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME echo | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
echo "Will work in ${RESOLUTION_MAX}x${RESOLUTION_MAX} resolution and will output" | tee -a $LOGFILE_GENERAL echo "Will work in ${RESOLUTION_MAX}x${RESOLUTION_MAX} resolution and will output" | tee -a $LOGFILE_GENERAL
@@ -1377,12 +1820,13 @@ echo "--------------------------------------------------------------" | tee -a $
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
if [ $REBUILD == "true" ] ; then rebuild ; fi if [[ $REBUILD == "true" ]] ; then rebuild ; fi
if [ $DOWNLOAD == "true" ] ; then downloadImages ; fi if [[ $DOWNLOAD == "true" ]] ; then downloadImages ; fi
if [ $WORLD == "true" ] ; then generateWorld ; fi if [[ $WORLD == "true" ]] ; then generateWorld ; fi
if [ $CLOUDS == "true" ] ; then generateClouds ; fi if [[ $CLOUDS == "true" ]] ; then generateClouds ; fi
if [ $BUILDCHECKS == "true" ] ; then checkResults ; fi if [[ $HEIGHTS == "true" ]]; then generateHeights; fi
if [ $CLEANUP == "true" ] ; then cleanUp ; fi if [[ $BUILDCHECKS == "true" ]] ; then checkResults ; fi
if [[ $CLEANUP == "true" ]] ; then cleanUp ; fi
+1 -1
View File
@@ -41,7 +41,7 @@ cp simgear-*.tar.bz2 ../output/.
##################################################################################### #####################################################################################
echo "Starting on FlightGear" echo "Starting on FlightGear"
cd ../fgBuild cd ../fgBuild
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" -DFG_BUILD_TYPE=Release ../flightgear cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" -DENABLE_SWIFT:BOOL=ON -DFG_BUILD_TYPE=Release ../flightgear
# compile # compile
make make
+4 -2
View File
@@ -37,7 +37,8 @@ cmake ..\flightgear -G "Visual Studio 14" ^
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^ -DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^ -DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^ -DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^
-DFG_BUILD_TYPE=%FGBUILDTYPE% -DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON
cmake --build . --config RelWithDebInfo --target INSTALL cmake --build . --config RelWithDebInfo --target INSTALL
cd .. cd ..
@@ -62,7 +63,8 @@ cmake ..\flightgear -G "Visual Studio 14 Win64" ^
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64 ^ -DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64 ^
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^ -DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^ -DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DFG_BUILD_TYPE=%FGBUILDTYPE% -DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON
cmake --build . --config RelWithDebInfo --target INSTALL cmake --build . --config RelWithDebInfo --target INSTALL
cd .. cd ..
+249 -111
View File
@@ -49,7 +49,7 @@ _elementIn(){
shift shift
for e; do for e; do
if [[ "$e" == "$valueToCheck" ]]; then if [ "$e" = "$valueToCheck" ]; then
return 0 return 0
fi fi
done done
@@ -118,18 +118,18 @@ function _gitUpdate(){
if [ "$DOWNLOAD" != "y" ]; then if [ "$DOWNLOAD" != "y" ]; then
return return
fi fi
branch=$1 branch="$1"
set +e set +e
git diff --exit-code 2>&1 > /dev/null git diff --exit-code 2>&1 > /dev/null
if [ $? != 1 ]; then if [ $? != 1 ]; then
set -e set -e
git pull -r git pull -r
git checkout -f $branch git checkout -f "$branch"
else else
set -e set -e
git stash save -u -q git stash save -u -q
git pull -r git pull -r
git checkout -f $branch git checkout -f "$branch"
git stash pop -q git stash pop -q
fi fi
} }
@@ -186,8 +186,8 @@ function _gitDownload(){
function _make(){ function _make(){
if [ "$COMPILE" = "y" ]; then if [ "$COMPILE" = "y" ]; then
pkg=$1 pkg="$1"
cd "$CBD"/build/$pkg cd "$CBD/build/$pkg"
_printLog "MAKE $pkg" _printLog "MAKE $pkg"
make $JOPTION $OOPTION 2>&1 | _logOutput make $JOPTION $OOPTION 2>&1 | _logOutput
_printLog "INSTALL $pkg" _printLog "INSTALL $pkg"
@@ -278,6 +278,23 @@ function _find_package_alternative(){
fi fi
} }
# If component $1 is in WHATTOBUILD, add components $2, $3, etc., to
# WHATTOBUILD unless they are already there.
function _depends(){
local component="$1"
shift
if _elementIn "$component" "${WHATTOBUILD[@]}"; then
for dependency in "$@"; do
if ! _elementIn "$dependency" "${WHATTOBUILD[@]}"; then
_printLog "$component: adding depended-on component $dependency"
WHATTOBUILD+=("$dependency")
nb_added_intercomponent_deps=$((nb_added_intercomponent_deps + 1))
fi
done
fi
}
function _printVersion(){ function _printVersion(){
echo "$PROGNAME version $VERSION" echo "$PROGNAME version $VERSION"
echo echo
@@ -340,6 +357,12 @@ function _usage() {
echo " -j X pass -jX to the Make program" echo " -j X pass -jX to the Make program"
echo " -O X pass -OX to the Make program" echo " -O X pass -OX to the Make program"
echo " -r y|n y=reconfigure programs before compiling them, n=don't reconfigure default=y" echo " -r y|n y=reconfigure programs before compiling them, n=don't reconfigure default=y"
echo " --ignore-intercomponent-deps"
echo " Ignore dependencies between components (default: don't)."
echo " Example: TERRAGEAR depends on SIMGEAR. Passing the option can be"
echo " useful if you want to update, rebuild, etc. TERRAGEAR without"
echo " doing the same for SIMGEAR (e.g., if doing repeated TERRAGEAR"
echo " builds and you know your SIMGEAR is already fine and up-to-date)."
echo " -s compile only the last known stable versions" echo " -s compile only the last known stable versions"
} }
@@ -363,6 +386,7 @@ DOWNLOAD_PACKAGES="y"
COMPILE="y" COMPILE="y"
RECONFIGURE="y" RECONFIGURE="y"
DOWNLOAD="y" DOWNLOAD="y"
IGNORE_INTERCOMPONENT_DEPS="n"
SUDO="sudo" SUDO="sudo"
PKG_MGR="apt-get" PKG_MGR="apt-get"
@@ -371,7 +395,7 @@ PKG_MGR="apt-get"
# #
# - 'https' used to be fine, but is currently unreliable at SourceForge (esp. # - 'https' used to be fine, but is currently unreliable at SourceForge (esp.
# for FGData, see # for FGData, see
# <https://forum.flightgear.org/viewtopic.php?f=20&t=33620&start=90&sid=afb8b688a02c01ea4ea9306c35487bd0>); # <https://forum.flightgear.org/viewtopic.php?f=20&t=33620&start=90>);
# - 'git' is insecure (no way to guarantee you are downloading what you expect # - 'git' is insecure (no way to guarantee you are downloading what you expect
# to be downloading); # to be downloading);
# - 'ssh' is secure, but requires an account at SourceForge (may be created at # - 'ssh' is secure, but requires an account at SourceForge (may be created at
@@ -384,8 +408,10 @@ REPO_DEFAULT_USERNAME=''
JOPTION="" JOPTION=""
OOPTION="" OOPTION=""
BUILD_TYPE="RelWithDebInfo" BUILD_TYPE="RelWithDebInfo"
SG_CMAKEARGS=""
FG_CMAKEARGS="" # Non user-exposed variable used to decide whether to print a “helpful”
# message
declare -i nb_added_intercomponent_deps=0
declare -a UNMATCHED_OPTIONAL_PKG_ALTERNATIVES declare -a UNMATCHED_OPTIONAL_PKG_ALTERNATIVES
@@ -433,7 +459,7 @@ REPO_SITE[TERRAGEARGUI]="SourceForge"
# built-in function, it allows one to define long options. # built-in function, it allows one to define long options.
TEMP=$(getopt -o '+shc:p:a:d:r:j:O:ib:' \ TEMP=$(getopt -o '+shc:p:a:d:r:j:O:ib:' \
--longoptions git-clone-default-proto:,git-clone-site-params:,help \ --longoptions git-clone-default-proto:,git-clone-site-params:,help \
--longoptions package-manager:,sudo:,version \ --longoptions package-manager:,sudo:,ignore-intercomponent-deps,version \
-n "$PROGNAME" -- "$@") -n "$PROGNAME" -- "$@")
case $? in case $? in
@@ -504,6 +530,7 @@ while true; do
;; ;;
--package-manager) PKG_MGR="$2"; shift 2 ;; --package-manager) PKG_MGR="$2"; shift 2 ;;
--sudo) SUDO="$2"; shift 2 ;; --sudo) SUDO="$2"; shift 2 ;;
--ignore-intercomponent-deps) IGNORE_INTERCOMPONENT_DEPS="y"; shift ;;
-r) RECONFIGURE="$2"; shift 2 ;; -r) RECONFIGURE="$2"; shift 2 ;;
-j) JOPTION=" -j$2"; shift 2 ;; -j) JOPTION=" -j$2"; shift 2 ;;
-O) OOPTION=" -O$2"; shift 2 ;; -O) OOPTION=" -O$2"; shift 2 ;;
@@ -559,16 +586,18 @@ unset -v site
####################################################### #######################################################
# Warning about compilation time and size # Warning about compilation time and size
# Idea from Jester # Idea from Jester
echo "**************************************" echo '**********************************************************************'
echo "* *" echo '* *'
echo "* Warning, the compilation process *" echo '* Warning: a typical SimGear + FlightGear + FGData build requires *'
echo "* is going to use 12 or more Gbytes *" echo '* about 12 GiB of disk space. The compilation part may last from a *'
echo "* of space and at least a couple of *" echo '* few minutes to hours, depending on your computer. *'
echo "* hours to download and build FG. *" echo '* *'
echo "* *" echo '* Hint: use the -j option if your CPU has several cores, as in: *'
echo "* Please, be patient ...... *" echo '* *'
echo "* *" echo '* download_and_compile.sh -j$(nproc) *'
echo "**************************************" echo '* *'
echo '**********************************************************************'
echo
####################################################### #######################################################
####################################################### #######################################################
@@ -577,18 +606,59 @@ echo "$0 $*" > "$LOGFILE"
_log "VERSION=$VERSION" _log "VERSION=$VERSION"
_log "APT_GET_UPDATE=$APT_GET_UPDATE" _log "APT_GET_UPDATE=$APT_GET_UPDATE"
_log "DOWNLOAD_PACKAGES=$DOWNLOAD_PACKAGES" _log "DOWNLOAD_PACKAGES=$DOWNLOAD_PACKAGES"
_log "IGNORE_INTERCOMPONENT_DEPS=$IGNORE_INTERCOMPONENT_DEPS"
_log "COMPILE=$COMPILE" _log "COMPILE=$COMPILE"
_log "RECONFIGURE=$RECONFIGURE" _log "RECONFIGURE=$RECONFIGURE"
_log "DOWNLOAD=$DOWNLOAD" _log "DOWNLOAD=$DOWNLOAD"
_log "JOPTION=$JOPTION" _log "JOPTION=$JOPTION"
_log "OOPTION=$OOPTION" _log "OOPTION=$OOPTION"
_log "BUILD_TYPE=$BUILD_TYPE" _log "BUILD_TYPE=$BUILD_TYPE"
_log "SG_CMAKEARGS=$SG_CMAKEARGS"
_log "FG_CMAKEARGS=$FG_CMAKEARGS"
_log "DIRECTORY=$CBD" _log "DIRECTORY=$CBD"
if [ "$STABLE" = "STABLE" ]; then
_log "Stable build: yes"
else
_log "Stable build: no"
fi
_logSep _logSep
####################################################### #######################################################
####################################################### #######################################################
# ****************************************************************************
# * Inter-component Dependencies *
# ****************************************************************************
if [ "$IGNORE_INTERCOMPONENT_DEPS" = "n" ]; then
# FlightGear requires SimGear
_depends FGFS SIMGEAR
# TerraGear requires SimGear
_depends TERRAGEAR SIMGEAR
# Print a helpful message if some components were automatically added
if (( nb_added_intercomponent_deps > 0 )); then
if (( nb_added_intercomponent_deps > 1 )); then
comp_word='components'
else
comp_word='component'
fi
_printLog "$PROGNAME: automatically added $nb_added_intercomponent_deps" \
"$comp_word based on"
_printLog "intercomponent dependencies. Use option" \
"--ignore-intercomponent-deps if you"
_printLog "want to disable this behavior."
_printLog
unset -v comp_word
fi
fi
# ****************************************************************************
# * Component dependencies on distribution packages *
# ****************************************************************************
if [[ "$DOWNLOAD_PACKAGES" = "y" ]]; then if [[ "$DOWNLOAD_PACKAGES" = "y" ]]; then
if [[ "$APT_GET_UPDATE" = "y" ]]; then if [[ "$APT_GET_UPDATE" = "y" ]]; then
_aptUpdate _aptUpdate
@@ -601,25 +671,44 @@ if [[ "$DOWNLOAD_PACKAGES" = "y" ]]; then
fi fi
# Minimum # Minimum
PKG=(build-essential cmake git) PKG=(build-essential git)
_mandatory_pkg_alternative libcurl4-openssl-dev libcurl4-gnutls-dev _mandatory_pkg_alternative libcurl4-openssl-dev libcurl4-gnutls-dev
# cmake
# CMake
if _elementIn "CMAKE" "${WHATTOBUILD[@]}"; then
PKG+=(libarchive-dev libbz2-dev libexpat1-dev libjsoncpp-dev liblzma-dev PKG+=(libarchive-dev libbz2-dev libexpat1-dev libjsoncpp-dev liblzma-dev
libncurses5-dev procps zlib1g-dev) libncurses5-dev procps zlib1g-dev)
# TG else
PKG+=(libcgal-dev libgdal-dev libtiff5-dev) PKG+=(cmake)
# TGGUI/OpenRTI fi
# TerraGear
if _elementIn "TERRAGEAR" "${WHATTOBUILD[@]}"; then
PKG+=(libboost-dev libcgal-dev libgdal-dev libtiff5-dev zlib1g-dev)
fi
# TerraGear GUI and OpenRTI
if _elementIn "TERRAGEARGUI" "${WHATTOBUILD[@]}" || \
_elementIn "OPENRTI" "${WHATTOBUILD[@]}"; then
PKG+=(libqt4-dev) PKG+=(libqt4-dev)
# SG/FG fi
PKG+=(zlib1g-dev freeglut3-dev libglew-dev libboost-dev)
# SimGear and FlightGear
if _elementIn "SIMGEAR" "${WHATTOBUILD[@]}" || \
_elementIn "FGFS" "${WHATTOBUILD[@]}"; then
PKG+=(zlib1g-dev freeglut3-dev libglew-dev libopenal-dev libboost-dev)
_mandatory_pkg_alternative libopenscenegraph-3.4-dev libopenscenegraph-dev \ _mandatory_pkg_alternative libopenscenegraph-3.4-dev libopenscenegraph-dev \
'libopenscenegraph-[0-9]+\.[0-9]+-dev' 'libopenscenegraph-[0-9]+\.[0-9]+-dev'
# FG fi
PKG+=(libopenal-dev libudev-dev libdbus-1-dev libplib-dev)
# FlightGear
if _elementIn "FGFS" "${WHATTOBUILD[@]}"; then
PKG+=(libudev-dev libdbus-1-dev libplib-dev)
_mandatory_pkg_alternative libpng-dev libpng12-dev libpng16-dev _mandatory_pkg_alternative libpng-dev libpng12-dev libpng16-dev
# The following packages are needed for the built-in launcher # The following packages are needed for the built-in launcher
_optional_pkg_alternative qt5-default _optional_pkg_alternative qt5-default
_optional_pkg_alternative qtdeclarative5-dev _optional_pkg_alternative qtdeclarative5-dev
_optional_pkg_alternative qttools5-dev
_optional_pkg_alternative qtbase5-dev-tools # for rcc _optional_pkg_alternative qtbase5-dev-tools # for rcc
_optional_pkg_alternative qttools5-dev-tools # for lrelease _optional_pkg_alternative qttools5-dev-tools # for lrelease
_optional_pkg_alternative qml-module-qtquick2 _optional_pkg_alternative qml-module-qtquick2
@@ -636,16 +725,28 @@ if [[ "$DOWNLOAD_PACKAGES" = "y" ]]; then
PKG+=(fluid libbz2-dev libfltk1.3-dev libxi-dev libxmu-dev) PKG+=(fluid libbz2-dev libfltk1.3-dev libxi-dev libxmu-dev)
# FGAdmin # FGAdmin
PKG+=(libxinerama-dev libjpeg-dev libxft-dev) PKG+=(libxinerama-dev libjpeg-dev libxft-dev)
# ATC-Pie # swift
_optional_pkg_alternative libevent-dev
fi
# ATC-pie
if _elementIn "ATCPIE" "${WHATTOBUILD[@]}"; then
PKG+=(python3-pyqt5 python3-pyqt5.qtmultimedia libqt5multimedia5-plugins) PKG+=(python3-pyqt5 python3-pyqt5.qtmultimedia libqt5multimedia5-plugins)
# FGo fi
# FGo!
if _elementIn "FGO" "${WHATTOBUILD[@]}"; then
PKG+=(python-tk) PKG+=(python-tk)
# FGx (FGx is not compatible with Qt5, however we have installed Qt5 by default) fi
#PKG+=(libqt5xmlpatterns5-dev libqt5webkit5-dev)
# if _elementIn "FGX" "${WHATTOBUILD[@]}"; then
# FGx (FGx is not compatible with Qt5, however we have installed Qt5 by
# default)
# PKG+=(libqt5xmlpatterns5-dev libqt5webkit5-dev)
# fi
_aptInstall "${PKG[@]}" _aptInstall "${PKG[@]}"
else else
_printLog
_printLog "Note: option -p of $PROGNAME set to 'n' (no), therefore no" _printLog "Note: option -p of $PROGNAME set to 'n' (no), therefore no"
_printLog " package will be installed via ${PKG_MGR}. Compilation of" \ _printLog " package will be installed via ${PKG_MGR}. Compilation of" \
"some components" "some components"
@@ -690,7 +791,7 @@ _printLog
# cmake # cmake
####################################################### #######################################################
CMAKE_INSTALL_DIR=cmake CMAKE_INSTALL_DIR=cmake
INSTALL_DIR_CMAKE=$INSTALL_DIR/$CMAKE_INSTALL_DIR INSTALL_DIR_CMAKE="$INSTALL_DIR/$CMAKE_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "CMAKE" "${WHATTOBUILD[@]}"; then if _elementIn "CMAKE" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -725,7 +826,7 @@ fi
# PLIB # PLIB
####################################################### #######################################################
PLIB_INSTALL_DIR=plib PLIB_INSTALL_DIR=plib
INSTALL_DIR_PLIB=$INSTALL_DIR/$PLIB_INSTALL_DIR INSTALL_DIR_PLIB="$INSTALL_DIR/$PLIB_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "PLIB" "${WHATTOBUILD[@]}"; then if _elementIn "PLIB" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -754,7 +855,7 @@ fi
# OPENRTI # OPENRTI
####################################################### #######################################################
OPENRTI_INSTALL_DIR=openrti OPENRTI_INSTALL_DIR=openrti
INSTALL_DIR_OPENRTI=$INSTALL_DIR/$OPENRTI_INSTALL_DIR INSTALL_DIR_OPENRTI="$INSTALL_DIR/$OPENRTI_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "OPENRTI" "${WHATTOBUILD[@]}"; then if _elementIn "OPENRTI" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -788,15 +889,15 @@ fi
# OpenSceneGraph # OpenSceneGraph
####################################################### #######################################################
OSG_INSTALL_DIR=openscenegraph OSG_INSTALL_DIR=openscenegraph
INSTALL_DIR_OSG=$INSTALL_DIR/$OSG_INSTALL_DIR INSTALL_DIR_OSG="$INSTALL_DIR/$OSG_INSTALL_DIR"
cd "$CBD" cd "$CBD"
mkdir -p "openscenegraph"
if _elementIn "OSG" "${WHATTOBUILD[@]}"; then if _elementIn "OSG" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
_printLog "**************** OSG *******************" _printLog "**************** OSG *******************"
_printLog "****************************************" _printLog "****************************************"
cd "$CBD"/openscenegraph mkdir -p "openscenegraph"
cd "openscenegraph"
_gitDownload OSG _gitDownload OSG
_gitUpdate OpenSceneGraph-3.4 _gitUpdate OpenSceneGraph-3.4
@@ -830,7 +931,7 @@ fi
# SIMGEAR # SIMGEAR
####################################################### #######################################################
SIMGEAR_INSTALL_DIR=simgear SIMGEAR_INSTALL_DIR=simgear
INSTALL_DIR_SIMGEAR=$INSTALL_DIR/$SIMGEAR_INSTALL_DIR INSTALL_DIR_SIMGEAR="$INSTALL_DIR/$SIMGEAR_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "SIMGEAR" "${WHATTOBUILD[@]}"; then if _elementIn "SIMGEAR" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -840,7 +941,7 @@ if _elementIn "SIMGEAR" "${WHATTOBUILD[@]}"; then
mkdir -p "simgear" mkdir -p "simgear"
cd "$CBD"/simgear cd "$CBD"/simgear
_gitDownload SIMGEAR _gitDownload SIMGEAR
_gitUpdate $FGVERSION _gitUpdate "$FGVERSION"
if [ "$RECONFIGURE" = "y" ]; then if [ "$RECONFIGURE" = "y" ]; then
cd "$CBD" cd "$CBD"
@@ -861,7 +962,7 @@ fi
# FGFS # FGFS
####################################################### #######################################################
FGFS_INSTALL_DIR=flightgear FGFS_INSTALL_DIR=flightgear
INSTALL_DIR_FGFS=$INSTALL_DIR/$FGFS_INSTALL_DIR INSTALL_DIR_FGFS="$INSTALL_DIR/$FGFS_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "FGFS" "${WHATTOBUILD[@]}" || \ if _elementIn "FGFS" "${WHATTOBUILD[@]}" || \
_elementIn "DATA" "${WHATTOBUILD[@]}"; then _elementIn "DATA" "${WHATTOBUILD[@]}"; then
@@ -874,7 +975,7 @@ if _elementIn "FGFS" "${WHATTOBUILD[@]}" || \
_printLog "****************************************" _printLog "****************************************"
_gitDownload DATA _gitDownload DATA
_gitUpdate $FGVERSION _gitUpdate "$FGVERSION"
fi fi
mkdir -p "$CBD"/flightgear mkdir -p "$CBD"/flightgear
@@ -886,7 +987,7 @@ if _elementIn "FGFS" "${WHATTOBUILD[@]}" || \
_printLog "****************************************" _printLog "****************************************"
_gitDownload FGFS _gitDownload FGFS
_gitUpdate $FGVERSION _gitUpdate "$FGVERSION"
if [ "$RECONFIGURE" = "y" ]; then if [ "$RECONFIGURE" = "y" ]; then
cd "$CBD" cd "$CBD"
@@ -897,7 +998,8 @@ if _elementIn "FGFS" "${WHATTOBUILD[@]}" || \
-DENABLE_FLITE=ON \ -DENABLE_FLITE=ON \
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_FGFS" \ -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_FGFS" \
-DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR;$INSTALL_DIR_OSG;$INSTALL_DIR_OPENRTI;$INSTALL_DIR_PLIB" \ -DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR;$INSTALL_DIR_OSG;$INSTALL_DIR_OPENRTI;$INSTALL_DIR_PLIB" \
-DFG_DATA_DIR="$INSTALL_DIR_FGFS/fgdata" \ -DFG_DATA_DIR:PATH="$INSTALL_DIR_FGFS/fgdata" \
-DTRANSLATIONS_SRC_DIR:PATH="$INSTALL_DIR_FGFS/fgdata/Translations" \
$FG_CMAKEARGS \ $FG_CMAKEARGS \
../../flightgear 2>&1 | _logOutput ../../flightgear 2>&1 | _logOutput
fi fi
@@ -908,27 +1010,53 @@ if _elementIn "FGFS" "${WHATTOBUILD[@]}" || \
SCRIPT=run_fgfs.sh SCRIPT=run_fgfs.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd $SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin" >> $SCRIPT echo "cd '$SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin'" >> $SCRIPT
echo "export LD_LIBRARY_PATH=../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}" \ echo "export LD_LIBRARY_PATH='../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \
>> $SCRIPT >> $SCRIPT
echo "./fgfs --fg-root=\$PWD/../fgdata/ \$@" >> $SCRIPT echo "./fgfs --fg-root=\"\$PWD/../fgdata\" \"\$@\"" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
SCRIPT=run_fgfs_debug.sh SCRIPT=run_fgfs_debug.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd $SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin" >> $SCRIPT echo "cd '$SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin'" >> $SCRIPT
echo "export LD_LIBRARY_PATH=../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}" \ echo "export LD_LIBRARY_PATH='../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \
>> $SCRIPT >> $SCRIPT
echo "gdb --directory=$CBD/flightgear/src --args fgfs --fg-root=\$PWD/../fgdata/ \$@" >> $SCRIPT echo "gdb --directory='$CBD/flightgear/src' --args ./fgfs --fg-root=\"\$PWD/../fgdata\" \"\$@\"" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
# Useful for debugging library problems.
SCRIPT=run_ldd.sh
cat >"$SCRIPT" <<EndOfScriptText
#!/bin/sh
usage() {
echo "Usage: \$0 LDD_ARGUMENT..."
echo "Run 'ldd' with the same LD_LIBRARY_PATH setup as done inside run_fgfs.sh."
echo
echo "Examples: 'run_ldd.sh fgfs', 'run_ldd.sh fgcom', etc. (this can be used"
echo "for any binary in '$SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin')."
}
if [ \$# -eq 0 ] || [ "\$1" = "--help" ]; then
usage
exit 1
fi
cd "\$(dirname "\$0")"
cd '$SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin'
export LD_LIBRARY_PATH='../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib'"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}"
ldd "\$@"
EndOfScriptText
chmod 755 "$SCRIPT"
SCRIPT=run_fgcom.sh SCRIPT=run_fgcom.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd $SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin" >> $SCRIPT echo "cd '$SUB_INSTALL_DIR/$FGFS_INSTALL_DIR/bin'" >> $SCRIPT
echo "./fgcom \$@" >> $SCRIPT echo "./fgcom \"\$@\"" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
fi fi
@@ -936,7 +1064,7 @@ fi
# FGRUN # FGRUN
####################################################### #######################################################
FGRUN_INSTALL_DIR=fgrun FGRUN_INSTALL_DIR=fgrun
INSTALL_DIR_FGRUN=$INSTALL_DIR/$FGRUN_INSTALL_DIR INSTALL_DIR_FGRUN="$INSTALL_DIR/$FGRUN_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "FGRUN" "${WHATTOBUILD[@]}"; then if _elementIn "FGRUN" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -946,7 +1074,7 @@ if _elementIn "FGRUN" "${WHATTOBUILD[@]}"; then
mkdir -p "fgrun" mkdir -p "fgrun"
cd "$CBD"/fgrun cd "$CBD"/fgrun
_gitDownload FGRUN _gitDownload FGRUN
_gitUpdate $FGVERSION _gitUpdate "$FGVERSION"
if [ "$RECONFIGURE" = "y" ]; then if [ "$RECONFIGURE" = "y" ]; then
cd "$CBD" cd "$CBD"
@@ -965,11 +1093,11 @@ if _elementIn "FGRUN" "${WHATTOBUILD[@]}"; then
SCRIPT=run_fgrun.sh SCRIPT=run_fgrun.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd $SUB_INSTALL_DIR/$FGRUN_INSTALL_DIR/bin" >> $SCRIPT echo "cd '$SUB_INSTALL_DIR/$FGRUN_INSTALL_DIR/bin'" >> $SCRIPT
echo "export LD_LIBRARY_PATH=../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}" \ echo "export LD_LIBRARY_PATH='../../$SIMGEAR_INSTALL_DIR/lib:../../$OSG_INSTALL_DIR/lib:../../$OPENRTI_INSTALL_DIR/lib:../../$PLIB_INSTALL_DIR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \
>> $SCRIPT >> $SCRIPT
echo "./fgrun --fg-exe=\$PWD/../../$FGFS_INSTALL_DIR/bin/fgfs --fg-root=\$PWD/../../$FGFS_INSTALL_DIR/fgdata \$@" >> $SCRIPT echo "./fgrun --fg-exe=\"\$PWD\"/../../'$FGFS_INSTALL_DIR/bin/fgfs' --fg-root=\"\$PWD\"/../../'$FGFS_INSTALL_DIR/fgdata' \"\$@\"" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
fi fi
@@ -977,7 +1105,7 @@ fi
# FGO! # FGO!
####################################################### #######################################################
FGO_INSTALL_DIR=fgo FGO_INSTALL_DIR=fgo
INSTALL_DIR_FGO=$INSTALL_DIR/$FGO_INSTALL_DIR INSTALL_DIR_FGO="$INSTALL_DIR/$FGO_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "FGO" "${WHATTOBUILD[@]}"; then if _elementIn "FGO" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -996,11 +1124,10 @@ if _elementIn "FGO" "${WHATTOBUILD[@]}"; then
SCRIPT=run_fgo.sh SCRIPT=run_fgo.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd $SUB_INSTALL_DIR" >> $SCRIPT echo "cd '$SUB_INSTALL_DIR'" >> $SCRIPT
echo "p=\$(pwd)" >> $SCRIPT echo "cd '$FGO_INSTALL_DIR'" >> $SCRIPT
echo "cd $FGO_INSTALL_DIR" >> $SCRIPT echo "python ./fgo" >> $SCRIPT
echo "python fgo" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
fi fi
@@ -1008,7 +1135,7 @@ fi
# FGx # FGx
####################################################### #######################################################
FGX_INSTALL_DIR=fgx FGX_INSTALL_DIR=fgx
INSTALL_DIR_FGX=$INSTALL_DIR/$FGX_INSTALL_DIR INSTALL_DIR_FGX="$INSTALL_DIR/$FGX_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "FGX" "${WHATTOBUILD[@]}"; then if _elementIn "FGX" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -1036,13 +1163,13 @@ if _elementIn "FGX" "${WHATTOBUILD[@]}"; then
cd .. cd ..
if [ "$RECONFIGURE" = "y" ]; then if [ "$RECONFIGURE" = "y" ]; then
mkdir -p $INSTALL_DIR_FGX mkdir -p "$INSTALL_DIR_FGX"
cd $INSTALL_DIR_FGX cd "$INSTALL_DIR_FGX"
qmake ../../fgx/src qmake ../../fgx/src
fi fi
if [ "$COMPILE" = "y" ]; then if [ "$COMPILE" = "y" ]; then
cd $INSTALL_DIR_FGX cd "$INSTALL_DIR_FGX"
_printLog "MAKE AND INSTALL FGX" _printLog "MAKE AND INSTALL FGX"
_printLog "make $JOPTION $OOPTION" _printLog "make $JOPTION $OOPTION"
make $JOPTION $OOPTION 2>&1 | _logOutput make $JOPTION $OOPTION 2>&1 | _logOutput
@@ -1053,11 +1180,9 @@ if _elementIn "FGX" "${WHATTOBUILD[@]}"; then
SCRIPT=run_fgx.sh SCRIPT=run_fgx.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd $ " >> $SCRIPT echo "cd '$FGX_INSTALL_DIR'" >> $SCRIPT
echo "p=\$(pwd)" >> $SCRIPT echo "./fgx \"\$@\"" >> $SCRIPT
echo "cd $FGX_INSTALL_DIR" >> $SCRIPT
echo "./fgx" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
fi fi
@@ -1065,7 +1190,7 @@ fi
# ATC-PIE # ATC-PIE
####################################################### #######################################################
ATCPIE_INSTALL_DIR=atc-pie ATCPIE_INSTALL_DIR=atc-pie
INSTALL_DIR_ATCPIE=$INSTALL_DIR/$ATCPIE_INSTALL_DIR INSTALL_DIR_ATCPIE="$INSTALL_DIR/$ATCPIE_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "ATCPIE" "${WHATTOBUILD[@]}"; then if _elementIn "ATCPIE" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -1073,7 +1198,7 @@ if _elementIn "ATCPIE" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
mkdir -p "$INSTALL_DIR_ATCPIE" mkdir -p "$INSTALL_DIR_ATCPIE"
cd $INSTALL_DIR_ATCPIE cd "$INSTALL_DIR_ATCPIE"
_gitDownload ATCPIE _gitDownload ATCPIE
_gitUpdate master _gitUpdate master
@@ -1081,9 +1206,9 @@ if _elementIn "ATCPIE" "${WHATTOBUILD[@]}"; then
SCRIPT=run_atcpie.sh SCRIPT=run_atcpie.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd $SUB_INSTALL_DIR/$ATCPIE_INSTALL_DIR" >> $SCRIPT echo "cd '$SUB_INSTALL_DIR/$ATCPIE_INSTALL_DIR'" >> $SCRIPT
echo "./ATC-pie.py \$@" >> $SCRIPT echo "./ATC-pie.py \"\$@\"" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
fi fi
@@ -1091,7 +1216,7 @@ fi
# OPENRADAR # OPENRADAR
####################################################### #######################################################
OR_INSTALL_DIR=openradar OR_INSTALL_DIR=openradar
INSTALL_DIR_OR=$INSTALL_DIR/$OR_INSTALL_DIR INSTALL_DIR_OR="$INSTALL_DIR/$OR_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "OPENRADAR" "${WHATTOBUILD[@]}"; then if _elementIn "OPENRADAR" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -1107,7 +1232,7 @@ if _elementIn "OPENRADAR" "${WHATTOBUILD[@]}"; then
SCRIPT=run_openradar.sh SCRIPT=run_openradar.sh
echo "#!/bin/sh" > $SCRIPT echo "#!/bin/sh" > $SCRIPT
echo "cd \$(dirname \$0)" >> $SCRIPT echo "cd \"\$(dirname \"\$0\")\"" >> $SCRIPT
echo "cd install/OpenRadar" >> $SCRIPT echo "cd install/OpenRadar" >> $SCRIPT
echo "java -jar OpenRadar.jar" >> $SCRIPT echo "java -jar OpenRadar.jar" >> $SCRIPT
chmod 755 $SCRIPT chmod 755 $SCRIPT
@@ -1118,7 +1243,7 @@ fi
####################################################### #######################################################
TG_INSTALL_DIR=terragear TG_INSTALL_DIR=terragear
INSTALL_DIR_TG=$INSTALL_DIR/$TG_INSTALL_DIR INSTALL_DIR_TG="$INSTALL_DIR/$TG_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "TERRAGEAR" "${WHATTOBUILD[@]}"; then if _elementIn "TERRAGEAR" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -1128,14 +1253,21 @@ if _elementIn "TERRAGEAR" "${WHATTOBUILD[@]}"; then
mkdir -p "terragear" mkdir -p "terragear"
cd "$CBD"/terragear cd "$CBD"/terragear
_gitDownload TERRAGEAR _gitDownload TERRAGEAR
_gitUpdate scenery/ws2.0
if [ "$STABLE" = "STABLE" ]; then
branch='scenery/ws2.0'
else
branch='next'
fi
_gitUpdate "$branch"
if [ "$RECONFIGURE" = "y" ]; then if [ "$RECONFIGURE" = "y" ]; then
cd "$CBD" cd "$CBD"
mkdir -p build/terragear mkdir -p build/terragear
cd "$CBD"/build/terragear cd "$CBD"/build/terragear
rm -f CMakeCache.txt rm -f CMakeCache.txt
"$CMAKE" -DCMAKE_BUILD_TYPE="Debug" \ "$CMAKE" -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_TG" \ -DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_DIR_TG" \
-DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR;$INSTALL_DIR_CGAL" \ -DCMAKE_PREFIX_PATH="$INSTALL_DIR_SIMGEAR;$INSTALL_DIR_CGAL" \
../../terragear/ 2>&1 | _logOutput ../../terragear/ 2>&1 | _logOutput
@@ -1145,25 +1277,27 @@ if _elementIn "TERRAGEAR" "${WHATTOBUILD[@]}"; then
cd "$CBD" cd "$CBD"
echo "#!/bin/sh" > run_tg-construct.sh echo "#!/bin/sh" > run_tg-construct.sh
echo "cd $(dirname $0)" >> run_tg-construct.sh echo "cd \"\$(dirname \"\$0\")\"" >> run_tg-construct.sh
echo "cd install/terragear/bin" >> run_tg-construct.sh echo "cd install/terragear/bin" >> run_tg-construct.sh
echo "export LD_LIBRARY_PATH=$INSTALL_DIR_SIMGEAR/lib\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}" \ echo "export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \
>> run_tg-construct.sh >> run_tg-construct.sh
echo "./tg-construct \$@" >> run_tg-construct.sh echo "./tg-construct \"\$@\"" >> run_tg-construct.sh
echo "#!/bin/sh" > run_ogr-decode.sh echo "#!/bin/sh" > run_ogr-decode.sh
echo "cd $(dirname $0)" >> run_ogr-decode.sh echo "cd \"\$(dirname \"\$0\")\"" >> run_ogr-decode.sh
echo "cd install/terragear/bin" >> run_ogr-decode.sh echo "cd install/terragear/bin" >> run_ogr-decode.sh
echo "export LD_LIBRARY_PATH=$INSTALL_DIR_SIMGEAR/lib\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}" \ echo "export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \
>> run_ogr-decode.sh >> run_ogr-decode.sh
echo "./ogr-decode \$@" >> run_ogr-decode.sh echo "./ogr-decode \"\$@\"" >> run_ogr-decode.sh
echo "#!/bin/sh" > run_genapts850.sh echo "#!/bin/sh" > run_genapts850.sh
echo "cd $(dirname $0)" >> run_genapts850.sh echo "cd \"\$(dirname \"\$0\")\"" >> run_genapts850.sh
echo "cd install/terragear/bin" >> run_genapts850.sh echo "cd install/terragear/bin" >> run_genapts850.sh
echo "export LD_LIBRARY_PATH=$INSTALL_DIR_SIMGEAR/lib\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}" \ echo "export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'\"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}\"" \
>> run_genapts850.sh >> run_genapts850.sh
echo "./genapts850 \$@" >> run_genapts850.sh echo "./genapts850 \"\$@\"" >> run_genapts850.sh
chmod 755 run_tg-construct.sh run_ogr-decode.sh run_genapts850.sh
fi fi
_logSep _logSep
@@ -1172,7 +1306,7 @@ _logSep
####################################################### #######################################################
TGGUI_INSTALL_DIR=terrageargui TGGUI_INSTALL_DIR=terrageargui
INSTALL_DIR_TGGUI=$INSTALL_DIR/$TGGUI_INSTALL_DIR INSTALL_DIR_TGGUI="$INSTALL_DIR/$TGGUI_INSTALL_DIR"
cd "$CBD" cd "$CBD"
if _elementIn "TERRAGEARGUI" "${WHATTOBUILD[@]}"; then if _elementIn "TERRAGEARGUI" "${WHATTOBUILD[@]}"; then
_printLog "****************************************" _printLog "****************************************"
@@ -1198,22 +1332,26 @@ if _elementIn "TERRAGEARGUI" "${WHATTOBUILD[@]}"; then
_make terrageargui _make terrageargui
cd "$CBD" cd "$CBD"
# Fill TerraGear Root field
if [ ! -f ~/.config/TerraGear/TerraGearGUI.conf ]; then cfgFile="$HOME/.config/TerraGear/TerraGearGUI.conf"
_log "Fill TerraGear Root field" if [ ! -f "$cfgFile" ]; then
echo "[paths]" > TerraGearGUI.conf _log "Writing a default config file for TerraGear GUI: $cfgFile"
echo "terragear=$INSTALL_DIR_TG/bin" >> TerraGearGUI.conf
mkdir -p ~/.config/TerraGear mkdir -p ~/.config/TerraGear
mv TerraGearGUI.conf ~/.config/TerraGear echo "[paths]" > "$cfgFile"
echo "terragear=$INSTALL_DIR_TG" >> "$cfgFile"
echo "flightgear=$INSTALL_DIR_FGFS/fgdata" >> "$cfgFile"
fi fi
_log "Create run_terrageargui.sh" SCRIPT=run_terrageargui.sh
echo "#!/bin/sh" > run_terrageargui.sh _log "Creating $SCRIPT"
echo "cd \$(dirname \$0)" >> run_terrageargui.sh cat >"$SCRIPT" <<EndOfScriptText
echo "cd install/terrageargui/bin" >> run_terrageargui.sh #! /bin/sh
echo "export LD_LIBRARY_PATH=$INSTALL_DIR_SIMGEAR/lib\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}" \ cd "\$(dirname "\$0")"
>> run_terrageargui.sh cd '$SUB_INSTALL_DIR/$TGGUI_INSTALL_DIR/bin'
echo "./TerraGUI \$@" >> run_terrageargui.sh export LD_LIBRARY_PATH='$INSTALL_DIR_SIMGEAR/lib'"\${LD_LIBRARY_PATH:+:}\${LD_LIBRARY_PATH}"
./TerraGUI "\$@"
EndOfScriptText
chmod 755 "$SCRIPT"
fi fi
# Print optional package alternatives that didn't match (this helps with # Print optional package alternatives that didn't match (this helps with
+1 -1
Submodule fgdata updated: dade6b7218...dce80cbf83
+1 -1
View File
@@ -46,7 +46,7 @@ else
FGBUILDTYPE=Nightly FGBUILDTYPE=Nightly
fi fi
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../flightgear cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DENABLE_SWIFT:BOOL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ../flightgear
make make
+1 -1
Submodule simgear updated: d6bbad87c4...f964374027
+1 -1
View File
@@ -1 +1 @@
2019.1.2 2019.2.0