Compare commits
170 Commits
version/20
...
version/20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
631b408ae0 | ||
|
|
598e95efba | ||
|
|
305e5ce889 | ||
|
|
9ef14b590d | ||
|
|
025f335be1 | ||
|
|
195e84cfd5 | ||
|
|
eb4efb28ce | ||
|
|
4f9dd89fca | ||
|
|
a7e2623c8d | ||
|
|
c442fefb93 | ||
|
|
34ff55ad37 | ||
|
|
8b266f75da | ||
|
|
aeaebbbb10 | ||
|
|
33cbcf51f7 | ||
|
|
caeaa32ba8 | ||
|
|
ea7524899e | ||
|
|
29edfba044 | ||
|
|
1beae6304b | ||
|
|
73248547f9 | ||
|
|
49b584ffe7 | ||
|
|
06c7bbf557 | ||
|
|
399a3075c9 | ||
|
|
c24c41a998 | ||
|
|
94c09416d5 | ||
|
|
be5880ee19 | ||
|
|
500cf2e82c | ||
|
|
92c46f14c7 | ||
|
|
62ca4bb577 | ||
|
|
d7873fe00c | ||
|
|
9fcb01f81e | ||
|
|
04a518c23e | ||
|
|
598c65d3e9 | ||
|
|
cfb0f907e4 | ||
|
|
328fcda3f2 | ||
|
|
0fa6277203 | ||
|
|
06be626360 | ||
|
|
18cc06fa95 | ||
|
|
31c79982bf | ||
|
|
333dbb4aef | ||
|
|
71f48ae217 | ||
|
|
60eb8c32b6 | ||
|
|
cd500b70af | ||
|
|
aee62fc9e7 | ||
|
|
f88c149a3d | ||
|
|
5977af70aa | ||
|
|
9a6c1ee6e5 | ||
|
|
f416a7bcf7 | ||
|
|
fd4c8d8ffc | ||
|
|
714c4ac51c | ||
|
|
f17ed95af1 | ||
|
|
58608042ab | ||
|
|
87ebbd0d0e | ||
|
|
c5710b9877 | ||
|
|
a8cb045967 | ||
|
|
72916771df | ||
|
|
6501bf7731 | ||
|
|
c6d0ad04e6 | ||
|
|
0ceeec3cbf | ||
|
|
5ab8f3f350 | ||
|
|
ee9004d072 | ||
|
|
90360ebfd9 | ||
|
|
c43b8e0c07 | ||
|
|
05a3445a7f | ||
|
|
7d8d08097c | ||
|
|
d3828f3d68 | ||
|
|
ae84a587c6 | ||
|
|
f76fa38fed | ||
|
|
ef30051973 | ||
|
|
95e607c190 | ||
|
|
6db76c656c | ||
|
|
73b45b17a9 | ||
|
|
e61f4cbf9f | ||
|
|
cca622a860 | ||
|
|
aec7fcf83a | ||
|
|
72edacaaad | ||
|
|
80ed4b5ab4 | ||
|
|
35657c786f | ||
|
|
d90c55c215 | ||
|
|
40b6272570 | ||
|
|
a82e6f7f6b | ||
|
|
e34d02edbc | ||
|
|
3810a31230 | ||
|
|
00710497b0 | ||
|
|
420034d5b5 | ||
|
|
b3893f7bda | ||
|
|
4e28b88c22 | ||
|
|
fa0dcb5d4d | ||
|
|
819074136a | ||
|
|
03ac46120c | ||
|
|
cc76052038 | ||
|
|
3f38a3cf18 | ||
|
|
1c7dcaf5d5 | ||
|
|
dbdfc52a00 | ||
|
|
d4489091e2 | ||
|
|
6fa2edf9d5 | ||
|
|
6e608907b4 | ||
|
|
ac504c70a2 | ||
|
|
2bb86ee6ea | ||
|
|
a02dc9aad6 | ||
|
|
69033f37f8 | ||
|
|
aa7770911b | ||
|
|
b954ad8cd7 | ||
|
|
9158b1688e | ||
|
|
9effd91f62 | ||
|
|
0ddf75b382 | ||
|
|
a2eb0d7b4c | ||
|
|
14ee759409 | ||
|
|
aff1ac0f69 | ||
|
|
9453e085b3 | ||
|
|
da4cf552cb | ||
|
|
91e0f86a0b | ||
|
|
aae488794e | ||
|
|
4dffeeb56e | ||
|
|
ed7075f4ba | ||
|
|
185a10f7c5 | ||
|
|
5d3fcd3ba0 | ||
|
|
3b1a3c51b1 | ||
|
|
ea18939738 | ||
|
|
d22ff42e42 | ||
|
|
190d789a54 | ||
|
|
8534a8aba4 | ||
|
|
9ec3e015b2 | ||
|
|
b8c05410e3 | ||
|
|
fd6fae3858 | ||
|
|
ca4a2ca813 | ||
|
|
da0d245685 | ||
|
|
e0568f4f63 | ||
|
|
f61d0d35bd | ||
|
|
61fbe94ee2 | ||
|
|
523fe108be | ||
|
|
23e6b50aa9 | ||
|
|
22337b2bdb | ||
|
|
b38a53490c | ||
|
|
326dd6e11d | ||
|
|
40e5af8d57 | ||
|
|
eea7bac1e8 | ||
|
|
a5e4c47f1d | ||
|
|
9804df24a1 | ||
|
|
bad115cac0 | ||
|
|
696829a260 | ||
|
|
09cc52296d | ||
|
|
abc616b548 | ||
|
|
c3b9b9a524 | ||
|
|
2277ba38c7 | ||
|
|
97a72b4934 | ||
|
|
ecd4b9aab3 | ||
|
|
882ab6ae59 | ||
|
|
f3423dba60 | ||
|
|
39c1754a7f | ||
|
|
f190773790 | ||
|
|
5b34458439 | ||
|
|
59c9a55baa | ||
|
|
92f566f1d3 | ||
|
|
5b6ba959d9 | ||
|
|
675e7e6bdc | ||
|
|
07d1b0e882 | ||
|
|
f826f8c4b2 | ||
|
|
82f3c85343 | ||
|
|
3344c21c71 | ||
|
|
b2274fbbed | ||
|
|
cd80fffbe2 | ||
|
|
5e25bc9277 | ||
|
|
06d84d1d5b | ||
|
|
6661d1e10c | ||
|
|
6caf43f9e7 | ||
|
|
7b51c99439 | ||
|
|
1cf284bd6f | ||
|
|
1f27f8e39a | ||
|
|
caaad41e26 | ||
|
|
120055fa43 |
10
.gitmodules
vendored
10
.gitmodules
vendored
@@ -1,11 +1,11 @@
|
||||
[submodule "simgear"]
|
||||
path = simgear
|
||||
url = ../simgear
|
||||
branch = release/2019.1
|
||||
branch = release/2020.3
|
||||
[submodule "flightgear"]
|
||||
path = flightgear
|
||||
url = ../flightgear
|
||||
branch = release/2019.1
|
||||
branch = release/2020.3
|
||||
[submodule "fgrun"]
|
||||
path = fgrun
|
||||
url = ../fgrun
|
||||
@@ -13,12 +13,12 @@
|
||||
[submodule "fgdata"]
|
||||
path = fgdata
|
||||
url = ../fgdata
|
||||
branch = release/2019.1
|
||||
branch = release/2020.3
|
||||
[submodule "windows-3rd-party"]
|
||||
path = windows-3rd-party
|
||||
url = ../windows-3rd-party
|
||||
branch = master
|
||||
branch = release/2020.3
|
||||
[submodule "getstart"]
|
||||
path = getstart
|
||||
url = ../getstart
|
||||
branch = release/2019.1
|
||||
branch = release/2020.3
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
#include "InstallConfig.iss"
|
||||
|
||||
#define InstallDir32 "X:\install\msvc140"
|
||||
#define InstallCompositor32 "X:\install\msvc140\compositor"
|
||||
#define OSGInstallDir InstallDir32 + "\OpenSceneGraph"
|
||||
#define OSGPluginsDir OSGInstallDir + "\bin\osgPlugins-" + OSGVersion
|
||||
|
||||
#define InstallDir64 "X:\install\msvc140-64"
|
||||
#define InstallCompositor64 "X:\install\msvc140-64\compositor"
|
||||
#define OSG64InstallDir InstallDir64 + "\OpenSceneGraph"
|
||||
#define OSG64PluginsDir OSG64InstallDir + "\bin\osgPlugins-" + OSGVersion
|
||||
|
||||
@@ -32,7 +34,7 @@
|
||||
|
||||
; we copy everything in install/<arch>/bin except these, which aren't
|
||||
; useful to the end-user to ship
|
||||
#define ExcludedBinaries "*smooth.exe,metar.exe,js_demo.exe"
|
||||
#define ExcludedBinaries "*smooth.exe,metar.exe"
|
||||
|
||||
[Setup]
|
||||
AppId=FlightGear
|
||||
@@ -74,6 +76,7 @@ Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "A
|
||||
; 32 bits install
|
||||
|
||||
Source: "{#InstallDir32}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: not Is64BitInstallMode
|
||||
Source: "{#InstallCompositor32}\bin\fgfs.exe"; DestDir: "{app}\bin"; DestName: "fgfs-compositor.exe"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: not Is64BitInstallMode
|
||||
;locale only exists for fgrun - which has been disabled
|
||||
;Source: "{#InstallDir32}\share\locale\*"; DestDir: "{app}\bin\locale"; Flags: ignoreversion recursesubdirs; Check: not Is64BitInstallMode
|
||||
|
||||
@@ -82,12 +85,14 @@ Source: "{#ThirdPartyDir}\3rdParty\bin\OpenAL32.dll"; DestDir: "{app}\bin"; Chec
|
||||
Source: "{#ThirdPartyDir}\3rdParty\bin\libpng.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty\bin\libcurl.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty\bin\libintl-8.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\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty\bin\sentry.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty\bin\crashpad_handler.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
|
||||
Source: "{#InstallDir64}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
|
||||
Source: "{#InstallCompositor64}\bin\fgfs.exe"; DestDir: "{app}\bin"; DestName: "fgfs-compositor.exe"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
|
||||
;locale only exists for fgrun - which has been disabled
|
||||
;Source: "{#InstallDir64}\share\locale\*"; DestDir: "{app}\bin\locale"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
|
||||
|
||||
@@ -96,9 +101,10 @@ Source: "{#ThirdPartyDir}\3rdParty.x64\bin\OpenAL32.dll"; DestDir: "{app}\bin";
|
||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\libpng.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\libcurl.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\libintl-8.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\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\sentry.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\crashpad_handler.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
|
||||
#if IncludeData == "TRUE"
|
||||
@@ -190,6 +196,7 @@ Name: "{userdocs}\FlightGear\Custom Scenery"; Permissions: everyone-modify; Chec
|
||||
[Icons]
|
||||
Name: "{userdesktop}\FlightGear {#FGVersion}"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin"; Tasks: desktopicon;
|
||||
Name: "{group}\FlightGear"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin";
|
||||
Name: "{group}\FlightGear - Compositor"; Filename: "{app}\bin\fgfs-compositor.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin";
|
||||
Name: "{group}\FlightGear Manual"; Filename: "{app}\data\Docs\getstart.pdf"
|
||||
Name: "{group}\FlightGear Documentation"; Filename: "{app}\data\Docs\index.html"
|
||||
Name: "{group}\Flightgear Wiki"; Filename: "http://wiki.flightgear.org"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>fgfs</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.flightgear.FlightGear</string>
|
||||
<string><%= fgBundleIdentifier %></string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string><%= fgVersion %></string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
|
||||
@@ -1,96 +1,123 @@
|
||||
# Nasa2FGearthview
|
||||
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
|
||||
or this FG-wiki-page:
|
||||
|
||||
or this FG-wiki-page:\
|
||||
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
|
||||
(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
|
||||
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.
|
||||
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.
|
||||
For further information see:
|
||||
For further information see:\
|
||||
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-
|
||||
textures in the format .png. Because the .dds-format has trouble with
|
||||
rendering heavy alpha images, which is because of it's compression
|
||||
algorythm [1], I think it's useless to also build faulty files.
|
||||
However, this is not entirely true! It is possible to switch off the
|
||||
.dds/DXT compression. But this results in huge files and is rather
|
||||
heavy on the GPU's RAM.
|
||||
If you also converted the clouds and the height maps, then you'll also
|
||||
find 8 cloud- and 8 height textures (as well as their conversion to
|
||||
normal maps) in the format .png. Because the .dds-format has trouble
|
||||
with rendering heavy alpha images, which is because of it's
|
||||
compression algorythm [1], I think it's useless to also build faulty
|
||||
files. However, this is not entirely true! It is possible to switch
|
||||
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:
|
||||
[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:
|
||||
|
||||
$ ./convert.sh
|
||||
```shell
|
||||
./convert.sh
|
||||
```
|
||||
|
||||
This will show a help text, since you didn't specify any target(s).
|
||||
Possible targets are:
|
||||
* world
|
||||
* clouds
|
||||
* heights
|
||||
* all
|
||||
|
||||
Additionally, there are some options you could specify (further
|
||||
explained below):
|
||||
* 1k | 2k | 4k | 8k | 16k
|
||||
* nasa
|
||||
* no-download
|
||||
* download | no-download
|
||||
* world
|
||||
* clouds
|
||||
* heights
|
||||
* cleanup
|
||||
* rebuild
|
||||
* check
|
||||
|
||||
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!
|
||||
|
||||
This script uses a *lot* disk space! Make sure you have at least 90GB
|
||||
available!
|
||||
This script uses a *lot* disk space! In my last test run, which
|
||||
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
|
||||
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
|
||||
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
|
||||
by your systems package-management-system.
|
||||
(On Debian/Ubuntu this is "apt-get")
|
||||
I also recommend to deactivate swapping!
|
||||
```shell
|
||||
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
|
||||
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
|
||||
a search engine of your choice to find out, how the packages are named
|
||||
@@ -98,70 +125,92 @@ in your distro!
|
||||
|
||||
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
|
||||
Generates the world tiles, needed to run FG with EarthView.
|
||||
You will find the results in output/[$resolution]/*. Copy
|
||||
these into $FGDATA/Models/Astro/*. More about the installation
|
||||
of these textures can be found here:
|
||||
http://wiki.flightgear.org/Earthview#Customization
|
||||
**world**\
|
||||
Generates the world tiles, needed to run FG with EarthView.
|
||||
You will find the results in output/[$resolution]/\*. Copy
|
||||
these into $FGDATA/Models/Astro/\*. More about the installation
|
||||
of these textures can be found here:
|
||||
http://wiki.flightgear.org/Earthview#Customization
|
||||
|
||||
clouds
|
||||
Generates the cloud tiles, needed to run FG with EarthView.
|
||||
The locations are the same as the other textures mentioned
|
||||
above. Note that clouds are only available with up to 8k
|
||||
resolution, due to the available data at NASA.
|
||||
**clouds**\
|
||||
Generates the cloud tiles, needed to run FG with EarthView.
|
||||
The locations are the same as the other textures mentioned
|
||||
above. Note that clouds 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
|
||||
set. Does the same as:
|
||||
$ ./convert.sh world clouds
|
||||
**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
|
||||
set. Does the same as:
|
||||
```./convert.sh world clouds heights```
|
||||
|
||||
|
||||
Options:
|
||||
## Options:
|
||||
|
||||
1k | 2k | 4k | 8k | 16k
|
||||
Lets you specify a desired resolution of the textures.
|
||||
Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is
|
||||
specified, the script will generate all of the resolutions.
|
||||
16k is only available for earth textures.
|
||||
**1k | 2k | 4k | 8k | 16k**\
|
||||
Lets you specify a desired resolution of the textures.
|
||||
Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is
|
||||
specified, the script will generate all of the resolutions.
|
||||
16k is recommended only for earth textures, it will induce
|
||||
oversampling from clouds and height maps.
|
||||
|
||||
nasa
|
||||
Causes the script to download directly from
|
||||
http://visibleearth.nasa.gov . If omitted the script will
|
||||
download from
|
||||
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
|
||||
which is much faster!
|
||||
Uses wget either way.
|
||||
**download**\
|
||||
Causes the script to download the needed data, this is the
|
||||
default behavior (and can be omitted).
|
||||
|
||||
no-download
|
||||
Causes the script to skip the download function. If you
|
||||
already have the source images, then you don't need to
|
||||
re-download them. (About 2.4GB!)
|
||||
If omitted, the script will download the source images from
|
||||
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
|
||||
**no-download**\
|
||||
Causes the script to skip the download function. If you
|
||||
already have the source images, then you don't need to
|
||||
re-download them. (About 2.4GB!)
|
||||
If omitted, the script will download the source images from
|
||||
the default location.
|
||||
|
||||
cleanup
|
||||
Deletes the temporary files created during texture generation.
|
||||
These can be found in tmp/
|
||||
Note: if for some reason you later want some other resolution,
|
||||
then it's good to have the data there. So only do this, when
|
||||
you're quite sure that you're done.
|
||||
Frees up a lot of disk-space! Which would have to be
|
||||
regenerated if needed again.
|
||||
**cleanup**\
|
||||
Deletes the temporary files created during texture generation.
|
||||
These can be found in tmp/
|
||||
Note: if for some reason you later want some other resolution,
|
||||
then it's good to have the data there. So only do this, when
|
||||
you're quite sure that you're done.
|
||||
Frees up a lot of disk-space! Which would have to be
|
||||
regenerated if needed again.
|
||||
|
||||
rebuild
|
||||
Deletes only the temporary files of the given target. So if
|
||||
you call './convert.sh rebuild world' the script will delete
|
||||
all corresponding temp-files of the target world, which will
|
||||
trigger a complete regeneration of the relevant (instead of
|
||||
skipping existing files)
|
||||
**rebuild**\
|
||||
Deletes only the temporary files of the given target. So if
|
||||
you call ```./convert.sh rebuild world``` the script will delete
|
||||
all corresponding temp-files of the target world, which will
|
||||
trigger a complete regeneration of the relevant (instead of
|
||||
skipping existing files)
|
||||
|
||||
check
|
||||
Creates mosaics of the tiles, so you can look at them and see
|
||||
if all went well.
|
||||
**check**\
|
||||
Creates mosaics of the tiles, so you can look at them and see
|
||||
if all went well.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
98
build_appimage.sh
Executable file
98
build_appimage.sh
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# builds Appimage on Centos 7 using linuxdeployqt from continuous build
|
||||
# expects to work in $WORKSPACE, uses the contents of dist/{bin,share,lib64} copied into an appdir
|
||||
# missing qt plugins are copied in manually, as are osgPlugins
|
||||
# libcurl in SIMGEAR needs a setting to find the tls certificate, and OSG needs LD_LIBRARY_PATH so it can find osgPlugins
|
||||
# currently not including FGDATA, but this could be done easily once FG is updated to change Nav database checks from path to some kind of checksum
|
||||
#
|
||||
# issues/errors:
|
||||
# can't find qt translations - missing something in my build?
|
||||
#
|
||||
# errors/comments to enrogue@gmail.com
|
||||
|
||||
#clean up any previous build
|
||||
|
||||
rm -rf appdir
|
||||
|
||||
#create basic structure
|
||||
|
||||
mkdir -p appdir/usr/bin
|
||||
mkdir -p appdir/usr/lib
|
||||
mkdir -p appdir/usr/share
|
||||
mkdir -p appdir/usr/qml
|
||||
mkdir -p appdir/usr/ssl
|
||||
|
||||
#copy everything we need in
|
||||
|
||||
cp dist/bin/* appdir/usr/bin
|
||||
|
||||
cp -a dist/lib64/* appdir/usr/lib
|
||||
|
||||
# remove SimGearCore,Scene and any other static libs which leaked
|
||||
rm appdir/usr/lib/lib*.a
|
||||
|
||||
cp -a dist/lib64/osgPlugins-3.4.2 appdir/usr/lib
|
||||
|
||||
# adjust the rpath on the copied plugins, so they don't
|
||||
# require LD_LIBRARY_PATH to be set to load their dependencies
|
||||
# correctly
|
||||
patchelf --set-rpath \$ORIGIN/../ appdir/usr/lib/osgPlugins-3.4.2/*.so
|
||||
|
||||
cp -r dist/share appdir/usr
|
||||
|
||||
cp -a /usr/lib64/qt5/qml/QtQuick.2 appdir/usr/qml
|
||||
|
||||
cp /usr/lib64/libsoftokn3.* appdir/usr/lib
|
||||
cp /usr/lib64/libnsspem.so appdir/usr/lib
|
||||
cp /usr/lib64/libfreebl* appdir/usr/lib
|
||||
cp /etc/pki/tls/certs/ca-bundle.crt appdir/usr/ssl/cacert.pem
|
||||
|
||||
#modify the desktop file so that linuxdeployqt doesn't barf (version to 1.0, add semicolon to end of certain line types)
|
||||
sed -i 's/^Categor.*/&;/ ; s/^Keyword.*/&;/ ; s/1\.1/1\.0/' appdir/usr/share/applications/org.flightgear.FlightGear.desktop
|
||||
|
||||
#generate AppRun script
|
||||
|
||||
# Note: don't set LD_LIBRARY_PATH here.
|
||||
# if you do, you need to add code to unset it *sinde* FlightGear (eg, bootstrap.cxx),
|
||||
# so that fork-ed processes don't inherit the value. For an example see:
|
||||
# https://github.com/KDAB/hotspot/blob/master/src/main.cpp#L87
|
||||
|
||||
cat << 'EOF' > appdir/AppRun
|
||||
#!/bin/bash
|
||||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
export SIMGEAR_TLS_CERT_PATH=$HERE/usr/ssl/cacert.pem
|
||||
export OSG_LIBRARY_PATH=${HERE}/usr/lib
|
||||
|
||||
if [[ $# -eq 0 ]]; then
|
||||
echo "Started with no arguments; assuming --launcher"
|
||||
exec "${HERE}/usr/bin/fgfs" --launcher
|
||||
else
|
||||
exec "${HERE}/usr/bin/fgfs" "$@"
|
||||
fi
|
||||
EOF
|
||||
|
||||
|
||||
chmod +x appdir/AppRun
|
||||
|
||||
#grab continuous linuxdeployqt
|
||||
wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
|
||||
chmod +x linuxdeployqt-continuous-x86_64.AppImage
|
||||
|
||||
#set VERSION for AppImage creation
|
||||
export VERSION=`cat flightgear/flightgear-version`
|
||||
|
||||
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/org.flightgear.FlightGear.desktop -appimage
|
||||
@@ -5,7 +5,9 @@ if [ "$WORKSPACE" == "" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION=`cat flightgear/version`
|
||||
cmakeGenerator=Ninja
|
||||
cmakeCommonArgs="-DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||
VERSION=`cat flightgear/flightgear-version`
|
||||
|
||||
#####################################################################################
|
||||
# ensure fgrcc can run when linked against libSimGearCore, for example
|
||||
@@ -22,43 +24,68 @@ rm -rf output/*
|
||||
#####################################################################################
|
||||
echo "Starting on SimGear"
|
||||
cd sgBuild
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DENABLE_DNS:BOOL="ON" -DSIMGEAR_SHARED:BOOL="ON" ../simgear
|
||||
cmake -G $cmakeGenerator $cmakeCommonArgs ../simgear
|
||||
|
||||
# compile
|
||||
make
|
||||
ninja
|
||||
|
||||
if [ $? -ne '0' ]; then
|
||||
echo "make simgear failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make install
|
||||
ninja install
|
||||
|
||||
# build source package and copy to output
|
||||
make package_source
|
||||
ninja package_source
|
||||
cp simgear-*.tar.bz2 ../output/.
|
||||
|
||||
#####################################################################################
|
||||
echo "Starting on FlightGear"
|
||||
cd ../fgBuild
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" -DFG_BUILD_TYPE=Release ../flightgear
|
||||
cmake -G $cmakeGenerator $cmakeCommonArgs -DENABLE_SWIFT:BOOL=ON -DFG_BUILD_TYPE=Release ../flightgear
|
||||
|
||||
# compile
|
||||
make
|
||||
ninja
|
||||
|
||||
if [ $? -ne '0' ]; then
|
||||
echo "make flightgear failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make install
|
||||
ninja install
|
||||
|
||||
# build source package and copy to output
|
||||
make package_source
|
||||
ninja package_source
|
||||
cp flightgear-*.tar.bz2 ../output/.
|
||||
|
||||
#####################################################################################
|
||||
|
||||
if which sentry-cli >/dev/null; then
|
||||
echo "Uploading symbols"
|
||||
|
||||
export SENTRY_ORG=flightgear
|
||||
export SENTRY_PROJECT=flightgear
|
||||
|
||||
# set in the Jenkins environment for the builder
|
||||
# export SENTRY_AUTH_TOKEN=YOUR_AUTH_TOKEN
|
||||
|
||||
ERROR=$(sentry-cli upload-dif --include-sources "$WORKSPACE/dist/bin/fgfs" 2>&1 >/dev/null)
|
||||
if [ ! $? -eq 0 ]; then
|
||||
echo "warning: sentry-cli - $ERROR"
|
||||
fi
|
||||
else
|
||||
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
|
||||
fi
|
||||
|
||||
# now we uploaded symnbols, strip the binaries
|
||||
|
||||
strip --strip-debug $WORKSPACE/dist/bin/fgfs
|
||||
strip --strip-debug $WORKSPACE/dist/bin/fgviewer
|
||||
strip --strip-debug $WORKSPACE/dist/bin/fgjs
|
||||
|
||||
#####################################################################################
|
||||
|
||||
echo "Assembling base package"
|
||||
cd $WORKSPACE
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ SET OSG64=%WORKSPACE%\install\msvc140-64\OpenSceneGraph
|
||||
REM 32bits
|
||||
md build-sg32
|
||||
md build-fg32
|
||||
md build-fg32-compositor
|
||||
|
||||
cd build-sg32
|
||||
cmake ..\simgear -G "Visual Studio 14" ^
|
||||
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
|
||||
@@ -33,11 +35,24 @@ cd ..\build-fg32
|
||||
cmake ..\flightgear -G "Visual Studio 14" ^
|
||||
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140 ^
|
||||
-DCMAKE_PREFIX_PATH:PATH=%WORKSPACE%/install/msvc140/OpenSceneGraph ^
|
||||
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
|
||||
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
||||
-DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^
|
||||
-DFG_BUILD_TYPE=%FGBUILDTYPE%
|
||||
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
|
||||
-DENABLE_SWIFT:BOOL=ON ^
|
||||
-DENABLE_COMPOSITOR:BOOL=OFF
|
||||
cmake --build . --config RelWithDebInfo --target INSTALL
|
||||
|
||||
cd ..\build-fg32-compositor
|
||||
cmake ..\flightgear -G "Visual Studio 14" ^
|
||||
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140/compositor ^
|
||||
-DCMAKE_PREFIX_PATH:PATH=%QT5SDK32%;%OSG32%;%WORKSPACE%/install/msvc140/ ^
|
||||
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
|
||||
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
||||
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
|
||||
-DENABLE_SWIFT:BOOL=ON ^
|
||||
-DENABLE_COMPOSITOR:BOOL=ON
|
||||
cmake --build . --config RelWithDebInfo --target INSTALL
|
||||
|
||||
cd ..
|
||||
@@ -45,6 +60,7 @@ cd ..
|
||||
REM 64 bits
|
||||
md build-sg64
|
||||
md build-fg64
|
||||
md build-fg64-compositor
|
||||
|
||||
cd build-sg64
|
||||
cmake ..\SimGear -G "Visual Studio 14 Win64" ^
|
||||
@@ -62,15 +78,30 @@ cmake ..\flightgear -G "Visual Studio 14 Win64" ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64 ^
|
||||
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^
|
||||
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
||||
-DFG_BUILD_TYPE=%FGBUILDTYPE%
|
||||
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
|
||||
-DENABLE_SWIFT:BOOL=ON ^
|
||||
-DENABLE_COMPOSITOR:BOOL=OFF
|
||||
cmake --build . --config RelWithDebInfo --target INSTALL
|
||||
|
||||
cd ..\build-fg64-compositor
|
||||
cmake ..\flightgear -G "Visual Studio 14 Win64" ^
|
||||
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
|
||||
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64/compositor ^
|
||||
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64%;%WORKSPACE%/install/msvc140-64/ ^
|
||||
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
||||
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
|
||||
-DENABLE_SWIFT:BOOL=ON ^
|
||||
-DENABLE_COMPOSITOR:BOOL=ON
|
||||
cmake --build . --config RelWithDebInfo --target INSTALL
|
||||
cd ..
|
||||
|
||||
REM Qt5 deployment
|
||||
SET QMLDIR=%WORKSPACE%/flightgear/src/GUI/qml
|
||||
%QT5SDK32%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140/bin/fgfs.exe
|
||||
%QT5SDK32%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140/compositor/bin/fgfs.exe
|
||||
%QT5SDK64%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140-64/bin/fgfs.exe
|
||||
%QT5SDK64%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140-64/compositor/bin/fgfs.exe
|
||||
|
||||
REM build setup
|
||||
ECHO Packaging root is %WORKSPACE%
|
||||
@@ -81,14 +112,16 @@ subst X: %WORKSPACE%.
|
||||
REM ensure output dir is clean since we upload the entirety of it
|
||||
rmdir /S /Q output
|
||||
|
||||
SET CRASHFIX_UPLOAD_URL=http://crashes.flightgear.org/index.php/debugInfo/uploadExternal
|
||||
SET FGFS_PDB=src\Main\RelWithDebInfo\fgfs.pdb
|
||||
ECHO Uploading PDB files to %CRASHFIX_UPLOAD_URL%
|
||||
upload -v -u %CRASHFIX_UPLOAD_URL% FlightGear %WORKSPACE%\build-fg32\%FGFS_PDB% %WORKSPACE%\build-fg64\%FGFS_PDB%
|
||||
|
||||
REM also save the PDB to Output\ so they get uploaded
|
||||
copy %WORKSPACE%\build-fg64\%FGFS_PDB% %WORKSPACE%\Output\fgfs_64.pdb
|
||||
copy %WORKSPACE%\build-fg32\%FGFS_PDB% %WORKSPACE%\Output\fgfs_32.pdb
|
||||
SET SENTRY_ORG=flightgear
|
||||
SET SENTRY_PROJECT=flightgear
|
||||
REM ensure SENTRY_AUTH_TOKEN is set in the environment
|
||||
|
||||
sentry-cli upload-dif --include-sources %WORKSPACE%\build-fg32\%FGFS_PDB%
|
||||
sentry-cli upload-dif --include-sources %WORKSPACE%\build-fg64\%FGFS_PDB%
|
||||
sentry-cli upload-dif --include-sources %WORKSPACE%\build-fg32-compositor\%FGFS_PDB%
|
||||
sentry-cli upload-dif --include-sources %WORKSPACE%\build-fg64-compositor\%FGFS_PDB%
|
||||
|
||||
REM indirect way to get command output into an environment variable
|
||||
set PATH=%OSG32%\bin;%PATH%
|
||||
@@ -96,7 +129,7 @@ osgversion --so-number > %TEMP%\osg-so-number.txt
|
||||
osgversion --version-number > %TEMP%\osg-version.txt
|
||||
osgversion --openthreads-soversion-number > %TEMP%\openthreads-so-number.txt
|
||||
|
||||
SET /P FLIGHTGEAR_VERSION=<flightgear\version
|
||||
SET /P FLIGHTGEAR_VERSION=<flightgear\flightgear-version
|
||||
SET /P OSG_VERSION=<%TEMP%\osg-version.txt
|
||||
SET /P OSG_SO_NUMBER=<%TEMP%\osg-so-number.txt
|
||||
SET /P OT_SO_NUMBER=<%TEMP%\openthreads-so-number.txt
|
||||
|
||||
63
catalog/README.md
Normal file
63
catalog/README.md
Normal file
@@ -0,0 +1,63 @@
|
||||
Introduction
|
||||
============
|
||||
|
||||
This is the directory containing the script for updating aircraft, or other
|
||||
craft, catalogs. It will create the `catalog.xml` file used to add a hangar to
|
||||
FlightGear, as well as the zip archives of each craft in the hangar and the
|
||||
md5sums, thumbnails, and previews of these. It consists of the script:
|
||||
|
||||
* update-catalog.py
|
||||
|
||||
And its Python modules:
|
||||
|
||||
* catalog.py
|
||||
* catalogTags.py
|
||||
* sgprogs.py
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
The script can be run directly from this directory, or the script and its
|
||||
modules can be copied together and run from any location. The steps to use
|
||||
these are:
|
||||
|
||||
* Create an output directory where the catalog and zip files will be located.
|
||||
* Copy the configuration files `catalog.config.xml`, `template.xml`, and
|
||||
`zip-excludes.lst` from one of the `*catalog*` example directories into the
|
||||
output directory.
|
||||
* Modify these files as required.
|
||||
|
||||
Then run the script with:
|
||||
|
||||
`$ $FGMETA/catalog/update-catalog.py dir`
|
||||
|
||||
where `dir` is the output directory. The script will create the following
|
||||
files:
|
||||
|
||||
* `md5sum.xml`: A file containing checksums of all craft zip archives in the
|
||||
base output directory.
|
||||
* `ftp/catalog.xml`: The XML catalog to upload to a server and advertise to
|
||||
FlightGear users.
|
||||
* `ftp/*.zip`: The zip archives of each craft in the hangar.
|
||||
* `ftp/previews/*_Splashs/`: A directory per craft containing the splash screen
|
||||
graphics.
|
||||
* `ftp/thumbnails/`: The collection of thumbnail graphics for the hangar.
|
||||
|
||||
The `ftp` directory is to be uploaded to a server which can be configured via
|
||||
the `catalog.config.xml` file.
|
||||
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
A number of example configuration files are located in this directory. These
|
||||
include:
|
||||
|
||||
* `fgaddon-catalog/`: The configuration files used for the [official FGAddon
|
||||
hangar](http://wiki.flightgear.org/FGAddon).
|
||||
* `stable-2018-catalog/': The configuration files used for the 2018 long term
|
||||
stability release.
|
||||
* `single-craft-catalog-test/`: Configuration files used for testing the
|
||||
catalog and zip archive creation for a single craft. These are for content
|
||||
developers to test their craft.
|
||||
@@ -2,18 +2,29 @@
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
#import xml.etree.cElementTree as ET
|
||||
from fnmatch import fnmatch, translate
|
||||
import lxml.etree as ET
|
||||
import os
|
||||
from os.path import exists, join, relpath
|
||||
from os import F_OK, access, walk
|
||||
import re
|
||||
import sgprops
|
||||
import sys
|
||||
import catalogTags
|
||||
import zipfile
|
||||
|
||||
CATALOG_VERSION = 4
|
||||
quiet = False
|
||||
verbose = False
|
||||
|
||||
# The Python version.
|
||||
PY_VERSION = sys.version_info[0]
|
||||
|
||||
# Python 2 and 3 compatibility.
|
||||
if PY_VERSION == 3:
|
||||
long = int
|
||||
|
||||
|
||||
def warning(msg):
|
||||
if not quiet:
|
||||
print(msg)
|
||||
@@ -101,7 +112,7 @@ def scan_set_file(aircraft_dir, set_file, includes):
|
||||
if sim_node.hasChild('minimum-fg-version'):
|
||||
variant['minimum-fg-version'] = sim_node.getValue('minimum-fg-version', None)
|
||||
|
||||
#print ' ', variant
|
||||
#print(" %s" % variant)
|
||||
return variant
|
||||
|
||||
def extract_previews(previews_node, aircraft_dir):
|
||||
@@ -140,13 +151,13 @@ def scan_aircraft_dir(aircraft_dir, includes):
|
||||
files = os.listdir(aircraft_dir)
|
||||
for file in sorted(files, key=lambda s: s.lower()):
|
||||
if file.endswith('-set.xml'):
|
||||
# print 'trying:', file
|
||||
# print('trying: %s' % file)
|
||||
try:
|
||||
d = scan_set_file(aircraft_dir, file, includes)
|
||||
if d == None:
|
||||
continue
|
||||
except:
|
||||
print "Skipping set file since couldn't be parsed:", os.path.join(aircraft_dir, file), sys.exc_info()[0]
|
||||
print("Skipping set file since couldn't be parsed: %s %s" % os.path.join(aircraft_dir, file), sys.exc_info()[0])
|
||||
continue
|
||||
|
||||
setDicts.append(d)
|
||||
@@ -156,13 +167,13 @@ def scan_aircraft_dir(aircraft_dir, includes):
|
||||
elif d['variant-of'] == None:
|
||||
primaryAircraft.append(d)
|
||||
|
||||
# print setDicts
|
||||
# print(setDicts)
|
||||
if len(setDicts) == 0:
|
||||
return None, None
|
||||
|
||||
# use the first one
|
||||
if len(primaryAircraft) == 0:
|
||||
print "Aircraft has no primary aircraft at all:", aircraft_dir
|
||||
print("Aircraft has no primary aircraft at all: %s" % aircraft_dir)
|
||||
primaryAircraft = [setDicts[0]]
|
||||
|
||||
package = primaryAircraft[0]
|
||||
@@ -214,8 +225,8 @@ def append_author_nodes(node, info):
|
||||
node.append( make_xml_leaf('author', info['author']) )
|
||||
|
||||
def make_aircraft_node(aircraftDirName, package, variants, downloadBase, mirrors):
|
||||
#print "package:", package
|
||||
#print "variants:", variants
|
||||
#print("package: %s" % package)
|
||||
#print("variants: %s" % variants)
|
||||
package_node = ET.Element('package')
|
||||
package_node.append( make_xml_leaf('name', package['name']) )
|
||||
package_node.append( make_xml_leaf('status', package['status']) )
|
||||
@@ -286,3 +297,134 @@ def make_aircraft_node(aircraftDirName, package, variants, downloadBase, mirrors
|
||||
package_node.append(package['urls']._createXMLElement())
|
||||
|
||||
return package_node
|
||||
|
||||
|
||||
def make_aircraft_zip(repo_path, craft_name, zip_file, global_zip_excludes, verbose=True):
|
||||
"""Create a zip archive of the given aircraft."""
|
||||
|
||||
# Printout.
|
||||
if verbose:
|
||||
print("Zip file creation: %s.zip" % craft_name)
|
||||
|
||||
# Go to the directory of crafts to catalog.
|
||||
savedir = os.getcwd()
|
||||
os.chdir(repo_path)
|
||||
|
||||
# Clear out the old file.
|
||||
if exists(zip_file):
|
||||
os.remove(zip_file)
|
||||
|
||||
# Use the Python zipfile module to create the zip file.
|
||||
zip_handle = zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED)
|
||||
|
||||
# Find a per-craft exclude list.
|
||||
craft_path = join(repo_path, craft_name)
|
||||
exclude_file = join(craft_path, 'zip-excludes.lst')
|
||||
if exists(exclude_file):
|
||||
if verbose:
|
||||
print("Found the craft specific exclusion list '%s'" % exclude_file)
|
||||
|
||||
# Otherwise use the catalog default exclusion list.
|
||||
else:
|
||||
exclude_file = global_zip_excludes
|
||||
|
||||
# Process the exclusion list and find all matching file names.
|
||||
blacklist = fetch_zip_exclude_list(craft_name, craft_path, exclude_file)
|
||||
|
||||
# Walk over all craft files.
|
||||
print_format = " %-30s '%s'"
|
||||
for root, dirs, files in walk(craft_path):
|
||||
# Loop over the files.
|
||||
for file in files:
|
||||
# The directory and relative and absolute paths.
|
||||
dir = relpath(root, start=repo_path)
|
||||
full_path = join(root, file)
|
||||
rel_path = relpath(full_path, start=repo_path)
|
||||
|
||||
# Skip blacklist files or directories.
|
||||
skip = False
|
||||
if file == 'zip-excludes.lst':
|
||||
if verbose:
|
||||
print(print_format % ("Skipping the file:", join(dir, 'zip-excludes.lst')))
|
||||
skip = True
|
||||
if dir in blacklist:
|
||||
if verbose:
|
||||
print(print_format % ("Skipping the file:", join(dir, file)))
|
||||
skip = True
|
||||
for name in blacklist:
|
||||
if fnmatch(rel_path, name):
|
||||
if verbose:
|
||||
print(print_format % ("Skipping the file:", rel_path))
|
||||
skip = True
|
||||
break
|
||||
if skip:
|
||||
continue
|
||||
|
||||
# Otherwise add the file.
|
||||
zip_handle.write(rel_path)
|
||||
|
||||
# Clean up.
|
||||
os.chdir(savedir)
|
||||
zip_handle.close()
|
||||
|
||||
|
||||
def fetch_zip_exclude_list(name, path, exclude_path):
|
||||
"""Use Unix style path regular expression to find all files to exclude."""
|
||||
|
||||
# Init.
|
||||
blacklist = []
|
||||
file = open(exclude_path)
|
||||
exclude_list = file.readlines()
|
||||
file.close()
|
||||
old_path = os.getcwd()
|
||||
os.chdir(path)
|
||||
|
||||
# Process each exclusion path or regular expression, converting to Python RE objects.
|
||||
reobj_list = []
|
||||
for i in range(len(exclude_list)):
|
||||
reobj_list.append(re.compile(translate(exclude_list[i].strip())))
|
||||
|
||||
# Recursively loop over all files, finding the ones to exclude.
|
||||
for root, dirs, files in walk(path):
|
||||
for file in files:
|
||||
full_path = join(root, file)
|
||||
rel_path = join(name, relpath(full_path, start=path))
|
||||
|
||||
# Skip Unix shell-style wildcard matches
|
||||
for i in range(len(reobj_list)):
|
||||
if reobj_list[i].match(rel_path):
|
||||
blacklist.append(rel_path)
|
||||
break
|
||||
|
||||
# Return to the original path.
|
||||
os.chdir(old_path)
|
||||
|
||||
# Return the list.
|
||||
return blacklist
|
||||
|
||||
|
||||
def parse_config_file(parser=None, file_name=None):
|
||||
"""Test and parse the catalog configuration file."""
|
||||
|
||||
# Check for the file.
|
||||
if not access(file_name, F_OK):
|
||||
print("CatalogError: The catalog configuration file '%s' cannot be found." % file_name)
|
||||
sys.exit(1)
|
||||
|
||||
# Parse the XML and return the root node.
|
||||
config = ET.parse(file_name, parser)
|
||||
return config.getroot()
|
||||
|
||||
|
||||
def parse_template_file(parser=None, file_name=None):
|
||||
"""Test and parse the catalog configuration file."""
|
||||
|
||||
# Check for the file.
|
||||
if not access(file_name, F_OK):
|
||||
print("CatalogError: The catalog template file '%s' cannot be found." % file_name)
|
||||
sys.exit(1)
|
||||
|
||||
# Parse the XML and return the template node.
|
||||
template = ET.parse(file_name, parser)
|
||||
template_root = template.getroot()
|
||||
return template_root.find('template')
|
||||
|
||||
@@ -11,12 +11,16 @@ aircraftTypeTags = [
|
||||
"glider",
|
||||
"groundvehicle",
|
||||
"helicopter",
|
||||
"interceptor",
|
||||
"passenger",
|
||||
"racer",
|
||||
"spaceship",
|
||||
"tanker",
|
||||
"trainer",
|
||||
"transport",
|
||||
"ultralight",
|
||||
"unpowered",
|
||||
"uav",
|
||||
"reconnaissance",
|
||||
"seacraft",
|
||||
"crop-duster",
|
||||
@@ -26,8 +30,10 @@ aircraftTypeTags = [
|
||||
manufacturerTags = [
|
||||
"airbus",
|
||||
"antonov",
|
||||
"arado",
|
||||
"atr",
|
||||
"avro",
|
||||
"bae",
|
||||
"bell",
|
||||
"bleriot",
|
||||
"boeing",
|
||||
@@ -53,6 +59,7 @@ manufacturerTags = [
|
||||
"heinkel",
|
||||
"ilyushin",
|
||||
"junkers",
|
||||
"kawasaki",
|
||||
"lockheed",
|
||||
"mc-donnell-douglas",
|
||||
"messerschmitt",
|
||||
@@ -64,6 +71,7 @@ manufacturerTags = [
|
||||
"piper",
|
||||
"republic",
|
||||
"robin",
|
||||
"rockwell",
|
||||
"saab",
|
||||
"short",
|
||||
"sopwith",
|
||||
@@ -73,6 +81,7 @@ manufacturerTags = [
|
||||
"tupolev",
|
||||
"vickers",
|
||||
"vought",
|
||||
"wright",
|
||||
"yakovlev"
|
||||
]
|
||||
|
||||
@@ -105,6 +114,7 @@ featureTags = [
|
||||
"biplane",
|
||||
"canard",
|
||||
"castering-wheel",
|
||||
"combat",
|
||||
"delta",
|
||||
"etops",
|
||||
"experimental",
|
||||
@@ -112,10 +122,14 @@ featureTags = [
|
||||
"fixed-gear",
|
||||
"floats",
|
||||
"glass-cockpit",
|
||||
"low-wing",
|
||||
"mid-wing",
|
||||
"high-wing",
|
||||
"h-tail",
|
||||
"hud",
|
||||
"ifr",
|
||||
"lifting-body",
|
||||
"pressurised",
|
||||
"prototype",
|
||||
"refuel",
|
||||
"retractable-gear",
|
||||
@@ -123,15 +137,18 @@ featureTags = [
|
||||
"skis",
|
||||
"stol",
|
||||
"supersonic",
|
||||
"supercharger",
|
||||
"t-tail",
|
||||
"tail-dragger",
|
||||
"tricycle",
|
||||
"tail-hook",
|
||||
"triplane",
|
||||
"twin-boom",
|
||||
"v-tail",
|
||||
"variable-geometry",
|
||||
"vtol",
|
||||
"wing-fold"
|
||||
"water-drop"
|
||||
]
|
||||
|
||||
propulsionTags = [
|
||||
@@ -147,6 +164,7 @@ propulsionTags = [
|
||||
"supercharged",
|
||||
"turboprop",
|
||||
"twin-engine",
|
||||
"four-engine",
|
||||
"variable-pitch",
|
||||
"fixed-pitch"
|
||||
]
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
<local-output>/home/fgaddon/output/Aircraft-trunk</local-output>
|
||||
<download-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/</download-url>
|
||||
<download-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft-trunk/</download-url>
|
||||
<download-url n="2">https://cdn.merspieler.tk/fgaddon/Aircraft-trunk/</download-url>
|
||||
|
||||
<thumbnail-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/thumbnails</thumbnail-url>
|
||||
<thumbnail-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft-trunk/thumbnails</thumbnail-url>
|
||||
<thumbnail-url n="2">https://cdn.merspieler.tk/fgaddon/Aircraft-trunk/thumbnails</thumbnail-url>
|
||||
|
||||
<scm>
|
||||
<type>svn</type>
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<template>
|
||||
<version n="0">2019.*</version>
|
||||
<version n="1">2018.*</version>
|
||||
<version n="2">2020.1.*</version>
|
||||
<version n="3">2020.2.*</version>
|
||||
|
||||
<id>org.flightgear.fgaddon.trunk</id>
|
||||
<license>GPL</license>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
*/.svn/*
|
||||
*.xcf
|
||||
*.blend
|
||||
*.xcf*
|
||||
*.XCF*
|
||||
*.blend*
|
||||
*.psd
|
||||
*~
|
||||
*/dev/*
|
||||
*/Dev/*
|
||||
*/development/*
|
||||
*/src/*
|
||||
*/Resources/*
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
*/.svn/*
|
||||
*.xcf
|
||||
*.blend
|
||||
*.xcf*
|
||||
*.XCF*
|
||||
*.blend*
|
||||
*.psd
|
||||
*~
|
||||
*/dev/*
|
||||
*/Dev/*
|
||||
*/development/*
|
||||
*/src/*
|
||||
*/Resources/*
|
||||
|
||||
@@ -119,7 +119,7 @@ class Node(object):
|
||||
# value and type specification
|
||||
try:
|
||||
if self._value is not None:
|
||||
if isinstance(self._value, basestring):
|
||||
if isinstance(self._value, str):
|
||||
# don't call str() on strings, breaks the
|
||||
# encoding
|
||||
n.text = self._value
|
||||
@@ -133,9 +133,9 @@ class Node(object):
|
||||
elif isinstance(self._value, bool):
|
||||
n.set('type', "bool")
|
||||
except UnicodeEncodeError:
|
||||
print "Encoding error with", self._value, type(self._value)
|
||||
print("Encoding error with %s %s" % (self._value, type(self._value)))
|
||||
except:
|
||||
print "Some other exceptiong in sgprops._createXMLElement()"
|
||||
print("Unexpected exception in sgprops._createXMLElement():", sys.exc_info()[0])
|
||||
|
||||
# index in parent
|
||||
if (self.index != 0):
|
||||
@@ -194,7 +194,7 @@ class PropsHandler(handler.ContentHandler):
|
||||
try:
|
||||
index = int(attrs['n'])
|
||||
except:
|
||||
print "Invalid index at line:", self._locator.getLineNumber(), "of", self._path
|
||||
print("Invalid index at line: %s of %s" % (self._locator.getLineNumber(), self._path))
|
||||
raise IndexError("Invalid index at line:", self._locator.getLineNumber(), "of", self._path)
|
||||
|
||||
currentState.recordExplicitIndex(name, index)
|
||||
@@ -251,7 +251,7 @@ class PropsHandler(handler.ContentHandler):
|
||||
self._content = self._content[:-1]
|
||||
self._current.value = float(self._content)
|
||||
except:
|
||||
print "Parse error for value:", self._content, "at line:", self._locator.getLineNumber(), "of:", self._path
|
||||
print("Parse error for value: %s at line: %s of: %s" % (self._content, self._locator.getLineNumber(), self._path))
|
||||
|
||||
self._current = self._current.parent
|
||||
self._content = None
|
||||
|
||||
6
catalog/single-craft-catalog-test/README
Normal file
6
catalog/single-craft-catalog-test/README
Normal file
@@ -0,0 +1,6 @@
|
||||
Configuration files for testing the catalog updating script on a single aircraft. This is useful for seeing what will be packed into the zip archive. To use these:
|
||||
|
||||
* Copy all *.xml and *.lst files into a local testing directory X.
|
||||
* Modify the *.xml files:
|
||||
* Replace all instances of '/data/fgaddon_catalog_p51d/' with the directory X.
|
||||
* Update any other tags as necessary.
|
||||
12
catalog/single-craft-catalog-test/catalog.config.xml
Normal file
12
catalog/single-craft-catalog-test/catalog.config.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--Template catalog - copy and modify for your site as required-->
|
||||
<PropertyList>
|
||||
<local-output>/data/fgaddon-catalog_p51d/ftp</local-output>
|
||||
<download-url n="0">/data/fgaddon-catalog_p51d/ftp/Aircraft/</download-url>
|
||||
<scm>
|
||||
<type>svn</type>
|
||||
<update type="bool">false</update>
|
||||
<path>/flightgear/flightgear-fgaddon/Aircraft</path>
|
||||
<include>p51d</include>
|
||||
</scm>
|
||||
</PropertyList>
|
||||
12
catalog/single-craft-catalog-test/template.xml
Normal file
12
catalog/single-craft-catalog-test/template.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--Template catalog - copy and modify for your site as required-->
|
||||
<PropertyList>
|
||||
<template>
|
||||
<version n="0">HEAD</version>
|
||||
<id>localhost</id>
|
||||
<license>GPL</license>
|
||||
<url>/data/fgaddon-catalog_p51d/ftp/Aircraft/catalog.xml</url>
|
||||
<name>p51d FGAddon aircraft test</name>
|
||||
<description>This is a test of the catalog updating script to allow aircraft authors to see what will be present in the zip archive of their aircraft.</description>
|
||||
</template>
|
||||
</PropertyList>
|
||||
11
catalog/single-craft-catalog-test/zip-excludes.lst
Normal file
11
catalog/single-craft-catalog-test/zip-excludes.lst
Normal file
@@ -0,0 +1,11 @@
|
||||
*/.svn/*
|
||||
*.xcf*
|
||||
*.XCF*
|
||||
*.blend*
|
||||
*.psd
|
||||
*~
|
||||
*/dev/*
|
||||
*/Dev/*
|
||||
*/development/*
|
||||
*/src/*
|
||||
*/Resources/*
|
||||
@@ -4,9 +4,11 @@
|
||||
<local-output>/home/fgaddon/output/Aircraft-2018</local-output>
|
||||
<download-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/</download-url>
|
||||
<download-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft-2018/</download-url>
|
||||
<download-url n="2">https://cdn.merspieler.tk/fgaddon/Aircraft-2018/</download-url>
|
||||
|
||||
<thumbnail-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/thumbnails</thumbnail-url>
|
||||
<thumbnail-url n="1">http://ukmirror.flightgear.org/official/Aircraft-2018/thumbnails</thumbnail-url>
|
||||
<thumbnail-url n="2">https://cdn.merspieler.tk/fgaddon/Aircraft-2018/thumbnails</thumbnail-url>
|
||||
|
||||
|
||||
<!-- share zips with the trunk catalog where possible -->
|
||||
|
||||
0
catalog/testData/Aircraft/c150/Resources/x.xcf.gz
Normal file
0
catalog/testData/Aircraft/c150/Resources/x.xcf.gz
Normal file
0
catalog/testData/Aircraft/c150/gimp.xcf.gz
Normal file
0
catalog/testData/Aircraft/c150/gimp.xcf.gz
Normal file
1
catalog/testData/Aircraft/c150/zip-excludes.lst
Normal file
1
catalog/testData/Aircraft/c150/zip-excludes.lst
Normal file
@@ -0,0 +1 @@
|
||||
*.xcf*
|
||||
1
catalog/testData/Aircraft/dc3/.svn/entries
Normal file
1
catalog/testData/Aircraft/dc3/.svn/entries
Normal file
@@ -0,0 +1 @@
|
||||
12
|
||||
0
catalog/testData/Aircraft/dc3/gimp.xcf
Normal file
0
catalog/testData/Aircraft/dc3/gimp.xcf
Normal file
@@ -3,8 +3,13 @@
|
||||
import unittest
|
||||
import sgprops
|
||||
import os
|
||||
from os.path import join
|
||||
import catalog
|
||||
import xml.etree.cElementTree as ET
|
||||
import lxml.etree as ET
|
||||
from shutil import rmtree
|
||||
from tempfile import mkdtemp
|
||||
import zipfile
|
||||
|
||||
|
||||
catalog.quiet = True
|
||||
|
||||
@@ -93,7 +98,7 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
catalog_node = ET.Element('PropertyList')
|
||||
catalog_root = ET.ElementTree(catalog_node)
|
||||
|
||||
pkgNode = catalog.make_aircraft_node('f16', pkg, variants, "http://foo.com/testOutput/")
|
||||
pkgNode = catalog.make_aircraft_node('f16', pkg, variants, "http://foo.com/testOutput/", [])
|
||||
catalog_node.append(pkgNode)
|
||||
|
||||
# write out so we can parse using sgprops
|
||||
@@ -172,7 +177,7 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
catalog_node = ET.Element('PropertyList')
|
||||
catalog_root = ET.ElementTree(catalog_node)
|
||||
|
||||
pkgNode = catalog.make_aircraft_node('dc3', pkg, variants, "http://foo.com/testOutput/")
|
||||
pkgNode = catalog.make_aircraft_node('dc3', pkg, variants, "http://foo.com/testOutput/", [])
|
||||
catalog_node.append(pkgNode)
|
||||
|
||||
if not os.path.isdir("testOutput"):
|
||||
@@ -210,7 +215,7 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
catalog_node = ET.Element('PropertyList')
|
||||
catalog_root = ET.ElementTree(catalog_node)
|
||||
|
||||
pkgNode = catalog.make_aircraft_node('c150', pkg, variants, "http://foo.com/testOutput/")
|
||||
pkgNode = catalog.make_aircraft_node('c150', pkg, variants, "http://foo.com/testOutput/", [])
|
||||
catalog_node.append(pkgNode)
|
||||
|
||||
if not os.path.isdir("testOutput2"):
|
||||
@@ -234,5 +239,85 @@ class UpdateCatalogTests(unittest.TestCase):
|
||||
self.assertFalse(parsedPkgNode.hasChild('minimum-fg-version'));
|
||||
self.assertFalse(parsedPkgNode.hasChild('variant'));
|
||||
|
||||
|
||||
class ZipTests(unittest.TestCase):
|
||||
"""Specific craft zip file creation tests."""
|
||||
|
||||
def check_zip(self, file_name, expected_content=None):
|
||||
"""General checks for the zip file."""
|
||||
|
||||
# Check for file existence.
|
||||
self.assert_(os.access(file_name, os.F_OK))
|
||||
|
||||
# Check the contents.
|
||||
file = zipfile.ZipFile(file_name)
|
||||
zip_contents = file.namelist()
|
||||
if len(zip_contents) != len(expected_content):
|
||||
print("Zip contents:\n %s" % zip_contents)
|
||||
print("Expected contents:\n %s" % expected_content)
|
||||
self.assertEqual(len(zip_contents), len(expected_content))
|
||||
for i in range(len(zip_contents)):
|
||||
self.assertEqual(zip_contents[i], expected_content[i])
|
||||
|
||||
|
||||
def setUp(self):
|
||||
"""Common set up for these system tests."""
|
||||
|
||||
# Store the current directory.
|
||||
self._cwd = os.getcwd()
|
||||
|
||||
# Create a temporary directory for dumping files.
|
||||
self.tmpdir = mkdtemp()
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
"""Delete temp files."""
|
||||
|
||||
# Force return to the correct directory.
|
||||
os.chdir(self._cwd)
|
||||
|
||||
# Remove temporary file (if there is a deletion failure, continue to allow the test suite to survive).
|
||||
try:
|
||||
rmtree(self.tmpdir)
|
||||
except:
|
||||
pass
|
||||
|
||||
# Remove the variable.
|
||||
del self.tmpdir
|
||||
|
||||
|
||||
def test_zip_creation(self):
|
||||
"""Test the creation of a basic craft zip archive."""
|
||||
|
||||
# Create a basic zip file.
|
||||
name = "c172"
|
||||
catalog.make_aircraft_zip(join(os.getcwd(), "testData/Aircraft"), name, join(self.tmpdir, name+'.zip'), join(os.getcwd(), 'fgaddon-catalog/zip-excludes.lst'), verbose=False)
|
||||
|
||||
# Checks.
|
||||
self.check_zip(join(self.tmpdir, name+'.zip'), expected_content=['c172/c172-set.xml'])
|
||||
|
||||
|
||||
def test_zip_exclusion_global(self):
|
||||
"""Test file exclusion in a craft zip archive using the global catalog exclusion list."""
|
||||
|
||||
# Create a basic zip file.
|
||||
name = "dc3"
|
||||
catalog.make_aircraft_zip(join(os.getcwd(), "testData/Aircraft"), name, join(self.tmpdir, name+'.zip'), join(os.getcwd(), 'fgaddon-catalog/zip-excludes.lst'), verbose=False)
|
||||
|
||||
# Checks.
|
||||
self.check_zip(join(self.tmpdir, name+'.zip'), expected_content=['dc3/dc3-set.xml'])
|
||||
|
||||
|
||||
def test_zip_exclusion_local(self):
|
||||
"""Test file exclusion in a craft zip archive using a local catalog exclusion list."""
|
||||
|
||||
# Create a basic zip file.
|
||||
name = "c150"
|
||||
catalog.make_aircraft_zip(join(os.getcwd(), "testData/Aircraft"), name, join(self.tmpdir, name+'.zip'), join(os.getcwd(), 'testData/Aircraft/c150/zip-excludes.lst'), verbose=False)
|
||||
|
||||
# Checks.
|
||||
self.check_zip(join(self.tmpdir, name+'.zip'), expected_content=['c150/c150-set.xml', 'c150/Resources/crazy_20Gb_file'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
@@ -13,9 +13,14 @@ import sgprops
|
||||
import sys
|
||||
import catalogTags
|
||||
import catalog
|
||||
from catalog import make_aircraft_node, make_aircraft_zip, parse_config_file, parse_template_file
|
||||
|
||||
|
||||
CATALOG_VERSION = 4
|
||||
|
||||
# The Python version.
|
||||
PY_VERSION = sys.version_info[0]
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--update", help="Update/pull SCM source",
|
||||
action="store_true")
|
||||
@@ -43,6 +48,11 @@ def get_xml_text(e):
|
||||
def last_change_date_svn(dir):
|
||||
command = [ 'svn', 'info', dir ]
|
||||
result = subprocess.check_output( command )
|
||||
|
||||
# Python 3 compatibility.
|
||||
if PY_VERSION == 3:
|
||||
result = result.decode('utf8')
|
||||
|
||||
match = re.search('Last Changed Date: (\d+)\-(\d+)\-(\d+)', result)
|
||||
if match:
|
||||
rev_str = match.group(1) + match.group(2) + match.group(3)
|
||||
@@ -66,24 +76,9 @@ def scan_dir_for_change_date_mtime(path):
|
||||
maxsec = mtime
|
||||
return maxsec
|
||||
|
||||
def make_aircraft_zip(repo_path, name, zip_file):
|
||||
if (not args.quiet):
|
||||
print "Updating:", name + '.zip'
|
||||
savedir = os.getcwd()
|
||||
os.chdir(repo_path)
|
||||
if os.path.exists(zip_file):
|
||||
os.remove(zip_file)
|
||||
command = ['zip', '-rq', '-9']
|
||||
if os.path.exists(zip_excludes):
|
||||
command += ['-x@' + zip_excludes]
|
||||
else:
|
||||
print "warning: no zip-excludes.lst file provided", zip_excludes
|
||||
command += [zip_file, name]
|
||||
subprocess.call(command)
|
||||
os.chdir(savedir)
|
||||
|
||||
def get_md5sum(file):
|
||||
f = open(file, 'r')
|
||||
f = open(file, 'rb')
|
||||
md5sum = hashlib.md5(f.read()).hexdigest()
|
||||
f.close()
|
||||
return md5sum
|
||||
@@ -95,7 +90,7 @@ def copy_previews_for_variant(variant, package_name, package_dir, previews_dir):
|
||||
for preview in variant['previews']:
|
||||
preview_src = os.path.join(package_dir, preview['path'])
|
||||
preview_dst = os.path.join(previews_dir, package_name + '_' + preview['path'])
|
||||
#print preview_src, preview_dst, preview['path']
|
||||
#print(preview_src, preview_dst, preview['path'])
|
||||
dir = os.path.dirname(preview_dst)
|
||||
if not os.path.isdir(dir):
|
||||
os.makedirs(dir)
|
||||
@@ -142,13 +137,13 @@ def process_aircraft_dir(name, repo_path):
|
||||
(package, variants) = catalog.scan_aircraft_dir(aircraft_dir, includes)
|
||||
if package == None:
|
||||
if not args.quiet:
|
||||
print "skipping:", name, "(no -set.xml files)"
|
||||
print("skipping: %s (no -set.xml files)" % name)
|
||||
return
|
||||
|
||||
if not args.quiet:
|
||||
print "%s:" % name,
|
||||
print("%s:" % name)
|
||||
|
||||
package_node = catalog.make_aircraft_node(name, package, variants, download_base, mirrors)
|
||||
package_node = make_aircraft_node(name, package, variants, download_base, mirrors)
|
||||
|
||||
download_url = download_base + name + '.zip'
|
||||
if 'thumbnail' in package:
|
||||
@@ -167,8 +162,8 @@ def process_aircraft_dir(name, repo_path):
|
||||
d = datetime.datetime.utcfromtimestamp(dir_mtime)
|
||||
rev = d.strftime("%Y%m%d")
|
||||
package_node.append( catalog.make_xml_leaf('revision', rev) )
|
||||
#print "rev:", rev
|
||||
#print "dir mtime:", dir_mtime
|
||||
#print("rev: %s" % rev)
|
||||
#print("dir mtime: %s" % dir_mtime)
|
||||
zipfile = os.path.join( output_dir, name + '.zip' )
|
||||
valid_zips.append(name + '.zip')
|
||||
if not os.path.exists(zipfile) \
|
||||
@@ -176,12 +171,12 @@ def process_aircraft_dir(name, repo_path):
|
||||
or args.clean:
|
||||
# rebuild zip file
|
||||
if not args.quiet:
|
||||
print "updating:", zipfile
|
||||
make_aircraft_zip(repo_path, name, zipfile)
|
||||
print("updating: %s" % zipfile)
|
||||
make_aircraft_zip(repo_path, name, zipfile, zip_excludes, verbose=not args.quiet)
|
||||
md5sum = get_md5sum(zipfile)
|
||||
else:
|
||||
if not args.quiet:
|
||||
print "(no change)"
|
||||
print("(no change)")
|
||||
if md5sum == "":
|
||||
md5sum = get_md5sum(zipfile)
|
||||
filesize = os.path.getsize(zipfile)
|
||||
@@ -202,7 +197,7 @@ def process_aircraft_dir(name, repo_path):
|
||||
shared_md5 = get_xml_text(sharedNode)
|
||||
if shared_md5 == md5sum:
|
||||
if not args.quiet:
|
||||
print "Sharing zip with share catalog for:",name
|
||||
print("Sharing zip with share catalog for: %s" % name)
|
||||
os.remove(zipfile)
|
||||
os.symlink(os.path.join( share_output_dir, name + '.zip' ), zipfile)
|
||||
|
||||
@@ -223,19 +218,12 @@ def process_aircraft_dir(name, repo_path):
|
||||
# return (md5, file_size)
|
||||
|
||||
if not os.path.isdir(args.dir):
|
||||
print "A valid catalog directory must be provided"
|
||||
print("A valid catalog directory must be provided")
|
||||
exit(0)
|
||||
|
||||
parser = ET.XMLParser(remove_blank_text=True)
|
||||
|
||||
config_file = os.path.join(args.dir, 'catalog.config.xml')
|
||||
config = ET.parse(config_file, parser)
|
||||
config_node = config.getroot()
|
||||
|
||||
template_file = os.path.join(args.dir, 'template.xml')
|
||||
template = ET.parse(template_file, parser)
|
||||
template_root = template.getroot()
|
||||
template_node = template_root.find('template')
|
||||
config_node = parse_config_file(parser=parser, file_name=os.path.join(args.dir, 'catalog.config.xml'))
|
||||
template_node = parse_template_file(parser=parser, file_name=os.path.join(args.dir, 'template.xml'))
|
||||
|
||||
md5sum_file = os.path.join(args.dir, 'md5sum.xml')
|
||||
if os.path.exists(md5sum_file):
|
||||
@@ -249,7 +237,7 @@ else:
|
||||
share_output_dir = get_xml_text(config_node.find('share-output'))
|
||||
share_md5_file = get_xml_text(config_node.find('share-md5-sums'))
|
||||
if share_output_dir != '' and share_md5_file != '':
|
||||
print 'Output shared with:', share_output_dir
|
||||
print("Output shared with: %s" % share_output_dir)
|
||||
share_md5sum_tree = ET.parse(share_md5_file, parser)
|
||||
share_md5sum_root = share_md5sum_tree.getroot()
|
||||
else:
|
||||
@@ -291,31 +279,37 @@ zip_excludes = os.path.realpath(tmp)
|
||||
for i in config_node.findall("include-dir"):
|
||||
path = get_xml_text(i)
|
||||
if not os.path.exists(path):
|
||||
print "Skipping missing include path:", path
|
||||
print("Skipping missing include path: %s" % path)
|
||||
continue
|
||||
includes.append(path)
|
||||
|
||||
# freshen repositories
|
||||
if args.no_update:
|
||||
print 'Skipping repository updates.'
|
||||
print('Skipping repository updates.')
|
||||
else:
|
||||
cwd = os.getcwd()
|
||||
for scm in scm_list:
|
||||
# XML mandated skip, with command line override.
|
||||
if not args.update:
|
||||
skip = get_xml_text(scm.find('update'))
|
||||
if skip == 'false':
|
||||
continue
|
||||
|
||||
repo_type = get_xml_text(scm.find('type'))
|
||||
repo_path = get_xml_text(scm.find('path'))
|
||||
includes.append(repo_path)
|
||||
|
||||
if repo_type == 'svn':
|
||||
print 'SVN update:', repo_path
|
||||
print("SVN update: %s" % repo_path)
|
||||
subprocess.call(['svn', 'update', repo_path])
|
||||
elif repo_type == 'git':
|
||||
print 'GIT pull:', repo_path
|
||||
print("GIT pull: %s" % repo_path)
|
||||
os.chdir(repo_path)
|
||||
subprocess.call(['git','pull'])
|
||||
elif repo_type == 'no-scm':
|
||||
print "No update of unmannaged files:", repo_path
|
||||
print("No update of unmannaged files: %s" % repo_path)
|
||||
else:
|
||||
print "Unknown scm type:", scm, repo_path
|
||||
print("Unknown scm type: %s %s" % (scm, repo_path))
|
||||
os.chdir(cwd)
|
||||
|
||||
# names of zip files we want (so we can identify/remove orphans)
|
||||
@@ -337,16 +331,27 @@ for scm in scm_list:
|
||||
skip_list = []
|
||||
for s in skip_nodes:
|
||||
skip_list.append(get_xml_text(s))
|
||||
print 'skip list:', skip_list
|
||||
|
||||
# Selective list of craft to include, overriding the skip list.
|
||||
include_nodes = scm.findall('include')
|
||||
include_list = []
|
||||
for node in include_nodes:
|
||||
include_list.append(get_xml_text(node))
|
||||
if len(include_list):
|
||||
skip_list = []
|
||||
|
||||
print("Skip list: %s" % skip_list)
|
||||
print("Include list: %s" % include_list)
|
||||
|
||||
names = os.listdir(repo_path)
|
||||
for name in sorted(names, key=lambda s: s.lower()):
|
||||
if name in skip_list:
|
||||
if name in skip_list or (len(include_list) and name not in include_list):
|
||||
if not args.quiet:
|
||||
print "skipping:", name
|
||||
print("Skipping: %s" % name)
|
||||
continue
|
||||
|
||||
# process each aircraft in turn
|
||||
# print name, repo_path
|
||||
# print("%s %s" % (name, repo_path))
|
||||
process_aircraft_dir(name, repo_path)
|
||||
|
||||
# write out the master catalog file
|
||||
@@ -354,11 +359,11 @@ cat_file = os.path.join(output_dir, 'catalog.xml')
|
||||
catalog_root.write(cat_file, encoding='utf-8', xml_declaration=True, pretty_print=True)
|
||||
|
||||
# write out the md5sum cache file
|
||||
print md5sum_file
|
||||
print(md5sum_file)
|
||||
md5sum_tree.write(md5sum_file, encoding='utf-8', xml_declaration=True, pretty_print=True)
|
||||
|
||||
# look for orphaned zip files
|
||||
files = os.listdir(output_dir)
|
||||
for file in files:
|
||||
if file.endswith('.zip')and not file in valid_zips:
|
||||
print "orphaned zip:", file
|
||||
print("orphaned zip: %s" % file)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,41 +1,40 @@
|
||||
## fg-from-scratch
|
||||
Windows utility to download, compile, and stage TerraGear and its dependencies
|
||||
Copyright (C) 2018 Scott Giese (xDraconian) scttgs0@gmail.com
|
||||
Copyright (C) 2018-2019 Scott Giese (xDraconian) scttgs0@gmail.com
|
||||
|
||||
### Purpose:
|
||||
Simplify the process of producing a working version of the TerraGear tools for Windows users.
|
||||
Simplify the process of producing a working version of the OSG, SimGear, FlightGear, and TerraGear for Windows users.
|
||||
If you find this script useful, or not useful, please share your experience with me via a brief email.
|
||||
|
||||
### Approach:
|
||||
Rather than leveraging the popular Win.3rdParty download, this script compiles all dependencies
|
||||
on your hardware. This eliminates many of the problems associated with mixed compilation in which
|
||||
your compiled binary become in conflict with 3rd-party binaries.
|
||||
your compiled binary comes into conflict with 3rd-party binaries.
|
||||
|
||||
vcpkg is leveraged to download and compile all the dependencies required by TerraGear.
|
||||
|
||||
This script could be expanded to include compiling FlightGear and/or any of the other FlightGear
|
||||
submodules (FGCom, Atlas, OpenRadar, etc.)
|
||||
vcpkg is leveraged to download and compile all the dependencies required.
|
||||
|
||||
### Supported Platform:
|
||||
Windows 10
|
||||
|
||||
### Prerequisites:
|
||||
Visual Studio Community 2017
|
||||
Visual Studio Community 2017 +
|
||||
https://www.visualstudio.com/downloads/
|
||||
Include the C++ package which includes the MSVC 19.14 compiler
|
||||
|
||||
CMake 3.11.3
|
||||
CMake 3.11.3 +
|
||||
https://cmake.org/download/
|
||||
The script assumes the installation folder is c:\Program Files\.
|
||||
|
||||
Qt 5.10.1
|
||||
Qt 5.10.1 +
|
||||
https://www.qt.io/download/
|
||||
The script assumes the installation folder is C:\Qt\.
|
||||
|
||||
Git 2.17.1
|
||||
Git 2.17.1 +
|
||||
https://git-scm.com/download/win/
|
||||
The script assumes the installation folder is reflected on your PATH.
|
||||
|
||||
Author's configuration: Visual Studio Community 2019, CMake 3.15.3, Qt 5.13.1, Git 2.18.0
|
||||
|
||||
### Recommended:
|
||||
|
||||
Before running the script for the first time, set this environment variable:
|
||||
@@ -47,23 +46,29 @@ You can execute the above command via a Command Terminal or via Powershell Admin
|
||||
### Usage:
|
||||
The script is intended to be run multiple times. During the first execution, all the packages are downloaded and compiled. Any time the script is executed afterward, the packages will update themselves.
|
||||
|
||||
<i>Note: Because failures can sometimes occur, the script will download packages after the first execution. Once you confirm that all packages have successfully been downloaded, you can optimize the script by adding <b>REM</b> at the beginning of the line. Refer to the comments within the script.</i>
|
||||
<i>Note: Because failures can occur, the script will continue to download packages even after the first execution.</i>
|
||||
|
||||
Run the command script interactively. No log is produced.
|
||||
|
||||
fg-from-scratch.cmd
|
||||
|
||||
Runs the command script and routes STDOUT and STDERR to a log file. **The prompts have been removed, so it is no longer necessary to monitor the log while it is running.**
|
||||
Run the command script and routes STDOUT and STDERR to a log file.
|
||||
|
||||
fg-from-scratch.cmd > scratch.log 2>&1
|
||||
|
||||
**Fix for the "White Text" issue** - pass either -wt or - -whitetext as an argument:
|
||||
|
||||
fg-from-scratch.cmd -wt > scratch.log 2>&1
|
||||
|
||||
The above command will force the usage of James' customized OSG source repo to leverage his workaround.
|
||||
|
||||
Options for monitoring the log file while the script is running:
|
||||
Start the script and then
|
||||
- Load the log file into Notepad++ (https://notepad-plus-plus.org/).
|
||||
- Turn on feature "Monitor" via Notepad++
|
||||
- **[Preferred]** Load the log file into WinTail (http://www.baremetalsoft.com/wintail/)
|
||||
|
||||
### Example Project
|
||||
### TerraGear Example Project
|
||||
Refer to CustomSceneryProjects/Test folder for an example of scenery generation.
|
||||
|
||||
generate.cmd > generate.log 2>&1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@ECHO OFF
|
||||
@echo OFF
|
||||
|
||||
REM fg-from-scratch - Windows utility to download, compile, and stage TerraGear and its dependencies
|
||||
REM Copyright (C) 2018 Scott Giese (xDraconian) scttgs0@gmail.com
|
||||
@@ -17,201 +17,382 @@ REM You should have received a copy of the GNU General Public License
|
||||
REM along with this program; if not, write to the Free Software
|
||||
REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
SET ROOT_DIR=%CD%
|
||||
SET PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/bin;%PATH%
|
||||
SET CMAKE_TOOLCHAIN="Visual Studio 15 2017 Win64"
|
||||
SET QT5x64=C:/Qt/5.10.1/msvc2017_64
|
||||
REM Defaults
|
||||
set ROOT_DIR=%CD%
|
||||
set WHITE_TEXT_FIX=0
|
||||
set OSG_SOURCE_PATH=scratch-source/openscenegraph-3.6-git
|
||||
set OSG_BUILD_PATH=scratch-build/openscenegraph-3.6
|
||||
set WT_GDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include
|
||||
set WT_GDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib
|
||||
set WT_GDAL_LIBRARY_DEBUG=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/gdald.lib
|
||||
|
||||
IF NOT EXIST vcpkg-git/NUL (
|
||||
REM Process arguments
|
||||
:parse
|
||||
if "%~1"=="" goto endparse
|
||||
if "%~1"=="-wt" (
|
||||
set WHITE_TEXT_FIX=1
|
||||
set OSG_SOURCE_PATH=scratch-source/openscenegraph-fix-git
|
||||
set OSG_BUILD_PATH=scratch-build/openscenegraph-fix
|
||||
set WT_GDAL_INCLUDE_DIR=
|
||||
set WT_GDAL_LIBRARY=
|
||||
set WT_GDAL_LIBRARY_DEBUG=
|
||||
)
|
||||
if "%~1"=="--whitetext" (
|
||||
set WHITE_TEXT_FIX=1
|
||||
set OSG_SOURCE_PATH=scratch-source/openscenegraph-fix-git
|
||||
set OSG_BUILD_PATH=scratch-build/openscenegraph-fix
|
||||
set WT_GDAL_INCLUDE_DIR=
|
||||
set WT_GDAL_LIBRARY=
|
||||
set WT_GDAL_LIBRARY_DEBUG=
|
||||
)
|
||||
SHIFT
|
||||
goto parse
|
||||
:endparse
|
||||
|
||||
echo White Text Fix: %WHITE_TEXT_FIX%
|
||||
echo %OSG_SOURCE_PATH%
|
||||
echo %OSG_BUILD_PATH%
|
||||
|
||||
set PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/bin;%ROOT_DIR%/vcpkg-git/installed/x64-windows/include;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%PATH%
|
||||
|
||||
REM Determine location of Qt5
|
||||
set QT_SELECT=qt5
|
||||
for /f %%i in ('"qtpaths.exe --install-prefix"') do set QT5x64=%%i
|
||||
set QT5x64_LIB=%QT5x64%/lib
|
||||
set QT5x64_CMAKE=%QT5x64_LIB%/cmake
|
||||
echo QT Folder: %QT5x64%
|
||||
|
||||
REM Determine CMake toolchain
|
||||
set CMAKE_TOOLCHAIN=Visual Studio 14 2015 Win64
|
||||
for /f %%v in ('"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere" -latest -property catalog_productlineversion') do set VSx64=%%v
|
||||
if %VSx64%==2019 (set CMAKE_TOOLCHAIN="Visual Studio 16 2019")
|
||||
if %VSx64%==2017 (set CMAKE_TOOLCHAIN="Visual Studio 15 2017 Win64")
|
||||
if %VSx64%==2015 (set CMAKE_TOOLCHAIN="Visual Studio 14 2015 Win64")
|
||||
echo CMake Toolchain: %CMAKE_TOOLCHAIN%
|
||||
|
||||
if not exist vcpkg-git/NUL (
|
||||
echo Preparing to install external libraries via vcpkg . . .
|
||||
git clone https://github.com/Microsoft/vcpkg.git vcpkg-git
|
||||
|
||||
echo Compiling vcpkg
|
||||
cd vcpkg-git
|
||||
call ./bootstrap-vcpkg
|
||||
call .\bootstrap-vcpkg
|
||||
|
||||
echo Compiling external libraries . . .
|
||||
vcpkg install --triplet x64-windows boost cgal curl freeglut freetype gdal glew jasper libxml2 openal-soft openjpeg openssl plib sdl2 tiff zlib
|
||||
) ELSE (
|
||||
vcpkg install --triplet x64-windows boost cgal curl freeglut freetype gdal glew jasper libpng libxml2 mpfr openal-soft openjpeg openssl plib sdl2 tiff zlib
|
||||
) else (
|
||||
echo Updating vcpkg . . .
|
||||
cd vcpkg-git
|
||||
git pull
|
||||
|
||||
REM for /f "delims=" %%G in ('"git pull"') do if not %%G == "Already up to date." (
|
||||
echo Compiling vcpkg
|
||||
call .\bootstrap-vcpkg
|
||||
REM break
|
||||
REM )
|
||||
|
||||
echo Updating external libraries . . .
|
||||
vcpkg update
|
||||
vcpkg upgrade --triplet x64-windows --no-dry-run
|
||||
|
||||
REM Okay to comment out this line once all the packages have been confirmed to have been installed
|
||||
vcpkg install --triplet x64-windows boost cgal curl freeglut freetype gdal glew jasper libxml2 openal-soft openjpeg openssl plib sdl2 tiff zlib
|
||||
echo Compiling external libraries . . .
|
||||
vcpkg install --triplet x64-windows boost cgal curl freeglut freetype gdal glew jasper libxml2 libpng mpfr openal-soft openjpeg openssl plib sdl2 tiff zlib
|
||||
)
|
||||
cd %ROOT_DIR%
|
||||
|
||||
IF NOT EXIST openscenegraph-3.4-build/NUL (
|
||||
mkdir openscenegraph-3.4-build
|
||||
if not exist scratch-source/NUL (
|
||||
mkdir scratch-source
|
||||
)
|
||||
IF NOT EXIST openscenegraph-3.4-git/NUL (
|
||||
echo Downloading OpenSceneGraph . . .
|
||||
git clone -b OpenSceneGraph-3.4 https://github.com/openscenegraph/OpenSceneGraph.git openscenegraph-3.4-git
|
||||
) ELSE (
|
||||
echo Updating OpenSceneGraph . . .
|
||||
cd openscenegraph-3.4-git
|
||||
git pull
|
||||
if not exist scratch-build/NUL (
|
||||
mkdir scratch-build
|
||||
)
|
||||
if not exist scratch-install/NUL (
|
||||
mkdir scratch-install
|
||||
)
|
||||
|
||||
if %WHITE_TEXT_FIX%==1 (
|
||||
if not exist scratch-build/openscenegraph-fix/NUL (
|
||||
mkdir scratch-build\openscenegraph-fix
|
||||
)
|
||||
if not exist scratch-source/openscenegraph-fix-git/NUL (
|
||||
echo Downloading OpenSceneGraph . . .
|
||||
git clone -b fgfs-342-1 https://github.com/zakalawe/osg.git scratch-source/openscenegraph-fix-git
|
||||
) else (
|
||||
echo Updating OpenSceneGraph . . .
|
||||
cd scratch-source/openscenegraph-fix-git
|
||||
git pull
|
||||
)
|
||||
) else (
|
||||
if not exist scratch-build/openscenegraph-3.6/NUL (
|
||||
mkdir scratch-build\openscenegraph-3.6
|
||||
)
|
||||
if not exist scratch-source/openscenegraph-3.6-git/NUL (
|
||||
echo Downloading OpenSceneGraph . . .
|
||||
git clone -b OpenSceneGraph-3.6 https://github.com/openscenegraph/OpenSceneGraph.git scratch-source/openscenegraph-3.6-git
|
||||
) else (
|
||||
echo Updating OpenSceneGraph . . .
|
||||
cd scratch-source/openscenegraph-3.6-git
|
||||
git pull
|
||||
)
|
||||
)
|
||||
cd %ROOT_DIR%
|
||||
|
||||
IF NOT EXIST simgear-build/NUL (
|
||||
mkdir simgear-build
|
||||
if not exist scratch-build/simgear/NUL (
|
||||
mkdir scratch-build\simgear
|
||||
)
|
||||
IF NOT EXIST simgear-git/NUL (
|
||||
if not exist scratch-source/simgear-git/NUL (
|
||||
echo Downloading SimGear . . .
|
||||
git clone -b next https://git.code.sf.net/p/flightgear/simgear simgear-git
|
||||
) ELSE (
|
||||
git clone -b next https://git.code.sf.net/p/flightgear/simgear scratch-source/simgear-git
|
||||
) else (
|
||||
echo Updating SimGear . . .
|
||||
cd simgear-git
|
||||
cd scratch-source/simgear-git
|
||||
git pull
|
||||
)
|
||||
cd %ROOT_DIR%
|
||||
|
||||
IF NOT EXIST flightgear-build/NUL (
|
||||
mkdir flightgear-build
|
||||
if not exist scratch-build/flightgear/NUL (
|
||||
mkdir scratch-build\flightgear
|
||||
)
|
||||
IF NOT EXIST flightgear-git/NUL (
|
||||
if not exist scratch-source/flightgear-git/NUL (
|
||||
echo Downloading FlightGear . . .
|
||||
git clone -b next https://git.code.sf.net/p/flightgear/flightgear flightgear-git
|
||||
) ELSE (
|
||||
git clone -b next https://git.code.sf.net/p/flightgear/flightgear scratch-source/flightgear-git
|
||||
) else (
|
||||
echo Updating FlightGear . . .
|
||||
cd flightgear-git
|
||||
cd scratch-source/flightgear-git
|
||||
git pull
|
||||
)
|
||||
cd %ROOT_DIR%
|
||||
|
||||
IF NOT EXIST terragear-build/NUL (
|
||||
mkdir terragear-build
|
||||
if not exist scratch-build/terragear/NUL (
|
||||
mkdir scratch-build\terragear
|
||||
)
|
||||
IF NOT EXIST terragear-git/NUL (
|
||||
if not exist scratch-source/terragear-git/NUL (
|
||||
echo Downloading TerraGear . . .
|
||||
git clone -b next https://git.code.sf.net/p/flightgear/terragear terragear-git
|
||||
) ELSE (
|
||||
git clone -b next https://git.code.sf.net/p/flightgear/terragear scratch-source/terragear-git
|
||||
) else (
|
||||
echo Updating TerraGear . . .
|
||||
cd terragear-git
|
||||
cd scratch-source/terragear-git
|
||||
git pull
|
||||
)
|
||||
cd %ROOT_DIR%
|
||||
|
||||
ECHO Compiling OpenSceneGraph . . .
|
||||
cd openscenegraph-3.4-build
|
||||
cmake ..\openscenegraph-3.4-git -G %CMAKE_TOOLCHAIN% ^
|
||||
REM -DQt5Core_DIR=%QT5x64_CMAKE%/Qt5Core ^
|
||||
REM -DQt5Gui_DIR=%QT5x64_CMAKE%/Qt5Gui ^
|
||||
REM -DQt5OpenGL_DIR=%QT5x64_CMAKE%/Qt5OpenGL ^
|
||||
REM -DQt5Widgets_DIR=%QT5x64_CMAKE%/Qt5Widgets ^
|
||||
|
||||
echo Compiling OpenSceneGraph . . .
|
||||
cd %OSG_BUILD_PATH%
|
||||
cmake ..\..\%OSG_SOURCE_PATH% -G %CMAKE_TOOLCHAIN% ^
|
||||
-DCMAKE_CONFIGURATION_TYPES:STRING=Debug;Release ^
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/scratch-install ^
|
||||
-DCMAKE_PREFIX_PATH:STRING=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib ^
|
||||
-DACTUAL_3RDPARTY_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DCMAKE_CONFIGURATION_TYPES=Debug;Release ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/Stage ^
|
||||
-DOSG_USE_UTF8_FILENAME:BOOL=1 ^
|
||||
-DWIN32_USE_MP:BOOL=1 ^
|
||||
-DCURL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DCURL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libcurl.lib ^
|
||||
-DFREETYPE_INCLUDE_DIR_ft2build=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^
|
||||
-DFREETYPE_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DFREETPE_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freetype.lib ^
|
||||
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
|
||||
-DGLUT_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGLUT_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freeglut.lib ^
|
||||
-DJPEG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DJPEG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^
|
||||
-DLIBXML2_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DLIBXML2_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libxml2.lib ^
|
||||
-DPNG_PNG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DPNG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libpng16.lib ^
|
||||
-DSDL2_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DSDL2_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/SDL2.lib ^
|
||||
-DSDL2MAIN_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/manual-link/SDL2main.lib ^
|
||||
-DTIFF_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DTIFF_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/tiff.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib
|
||||
-DCURL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DCURL_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libcurl.lib ^
|
||||
-DCURL_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/libcurl.lib ^
|
||||
-DFREETYPE_INCLUDE_DIR_ft2build:PATH=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^
|
||||
-DFREETYPE_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freetype.lib ^
|
||||
-DFREETYPE_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freetyped.lib ^
|
||||
-DGDAL_INCLUDE_DIR:PATH=%WT_GDAL_INCLUDE_DIR% ^
|
||||
-DGDAL_LIBRARY:FILEPATH=%WT_GDAL_LIBRARY% ^
|
||||
-DGDAL_LIBRARY_DEBUG:FILEPATH=%WT_GDAL_LIBRARY_DEBUG% ^
|
||||
-DGLUT_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGLUT_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freeglut.lib ^
|
||||
-DGLUT_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freeglut.lib ^
|
||||
-DJPEG_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DJPEG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^
|
||||
-DJPEG_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/jpeg.lib ^
|
||||
-DLIBXML2_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DLIBXML2_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libxml2.lib ^
|
||||
-DLIBXML2_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/libxml2.lib ^
|
||||
-DPNG_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DPNG_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libpng16.lib ^
|
||||
-DPNG_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/libpng16d.lib ^
|
||||
-DSDL2_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DSDL2_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/SDL2.lib ^
|
||||
-DSDL2MAIN_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/manual-link/SDL2main.lib ^
|
||||
-DTIFF_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DTIFF_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/tiff.lib ^
|
||||
-DTIFF_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/tiffd.lib ^
|
||||
-DZLIB_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib ^
|
||||
-DZLIB_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/zlibd.lib
|
||||
cmake --build . --config Release --target INSTALL
|
||||
cd %ROOT_DIR%
|
||||
|
||||
ECHO Compiling SimGear . . .
|
||||
cd simgear-build
|
||||
cmake ..\simgear-git -G %CMAKE_TOOLCHAIN% ^
|
||||
-DCMAKE_BUILD_TYPE=Release ^
|
||||
-DMSVC_3RDPARTY_ROOT=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DCMAKE_PREFIX_PATH:PATH=%ROOT_DIR%/Stage/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
|
||||
-DCMAKE_CONFIGURATION_TYPES=Debug;Release ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/Stage ^
|
||||
echo Compiling SimGear . . .
|
||||
cd scratch-build\simgear
|
||||
cmake ..\..\scratch-source\simgear-git -G %CMAKE_TOOLCHAIN% ^
|
||||
-DCMAKE_CONFIGURATION_TYPES:STRING=Debug;Release ^
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release ^
|
||||
-DMSVC_3RDPARTY_ROOT:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DCMAKE_PREFIX_PATH:STRING=%ROOT_DIR%/scratch-install/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
|
||||
-DCMAKE_INCLUDE_PATH:STRING=%ROOT_DIR%/scratch-install/include;%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/scratch-install ^
|
||||
-DOSG_FSTREAM_EXPORT_FIXED:BOOL=1 ^
|
||||
-DENABLE_GDAL:BOOL=1 ^
|
||||
-DENABLE_OPENMP:BOOL=1 ^
|
||||
-DUSE_AEONWAVE:BOOL=0 ^
|
||||
-DBOOST_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DBOOST_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DCURL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DCURL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libcurl.lib ^
|
||||
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
|
||||
-DOPENAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DOPENAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib
|
||||
-DBoost_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DBoost_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DCURL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DCURL_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/libcurl.lib ^
|
||||
-DCURL_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libcurl.lib ^
|
||||
-DGDAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGDAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
|
||||
-DOPENAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DOPENAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^
|
||||
-DOPENTHREADS_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOPENTHREADS_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/OpenThreads.lib ^
|
||||
-DOPENTHREADS_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGDB_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGDB_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGDB_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgDB.lib ^
|
||||
-DOSGGA_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGGA_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGGA_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgGA.lib ^
|
||||
-DOSGPARTICLE_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGPARTICLE_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGPARTICLE_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgParticle.lib ^
|
||||
-DOSGSIM_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGSIM_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGSIM_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgSim.lib ^
|
||||
-DOSGTEXT_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGTEXT_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGTEXT_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgText.lib ^
|
||||
-DOSGUTIL_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGUTIL_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGUTIL_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgUtil.lib ^
|
||||
-DOSGVIEWER_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGVIEWER_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGVIEWER_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgViewer.lib ^
|
||||
-DOSG_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSG_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osg.lib ^
|
||||
-DZLIB_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/zlibd.lib ^
|
||||
-DZLIB_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib
|
||||
cmake --build . --config Release --target INSTALL
|
||||
cd %ROOT_DIR%
|
||||
|
||||
ECHO Compiling FlightGear . . .
|
||||
cd flightgear-build
|
||||
cmake ..\flightgear-git -G %CMAKE_TOOLCHAIN% ^
|
||||
-DMSVC_3RDPARTY_ROOT=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DCMAKE_PREFIX_PATH:PATH=%ROOT_DIR%/Stage/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%QT5x64% ^
|
||||
-DCMAKE_CONFIGURATION_TYPES=Debug;Release ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/Stage ^
|
||||
REM -DENABLE_GDAL:BOOL=1 ^
|
||||
REM -DENABLE_OPENMP:BOOL=1 ^
|
||||
REM -DUSE_AEONWAVE:BOOL=0 ^
|
||||
|
||||
echo Compiling FlightGear . . .
|
||||
cd scratch-build\flightgear
|
||||
cmake ..\..\scratch-source\flightgear-git -G %CMAKE_TOOLCHAIN% ^
|
||||
-DCMAKE_CONFIGURATION_TYPES:STRING=Debug;Release ^
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release ^
|
||||
-DMSVC_3RDPARTY_ROOT:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DCMAKE_PREFIX_PATH:STRING=%ROOT_DIR%/scratch-install/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%QT5x64_LIB% ^
|
||||
-DCMAKE_INCLUDE_PATH:STRING=%ROOT_DIR%/scratch-install/include;%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/scratch-install ^
|
||||
-DSimGear_DIR:PATH=%ROOT_DIR%/scratch-install/lib/cmake/SimGear ^
|
||||
-DOSG_FSTREAM_EXPORT_FIXED:BOOL=1 ^
|
||||
-DENABLE_GDAL:BOOL=1 ^
|
||||
-DENABLE_OPENMP:BOOL=1 ^
|
||||
-DENABLE_JSBSIM:BOOL=1 ^
|
||||
-DENABLE_GPSSMOOTH:BOOL=1 ^
|
||||
-DENABLE_FGVIEWER:BOOL=1 ^
|
||||
-DENABLE_FGVIEWER:BOOL=0 ^
|
||||
-DENABLE_FGELEV:BOOL=0 ^
|
||||
-DENABLE_STGMERGE:BOOL=0 ^
|
||||
-DWITH_FGPANEL:BOOL=0 ^
|
||||
-DUSE_AEONWAVE:BOOL=0 ^
|
||||
-DHAVE_CONFIG_H:BOOL=0 ^
|
||||
-DFREETYPE_INCLUDE_DIR_ft2build=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^
|
||||
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
|
||||
-DOPENAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DOPENAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^
|
||||
-DPLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DPNG_PNG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DPNG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libpng16.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib
|
||||
-DBoost_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DBoost_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
|
||||
-DFREETYPE_INCLUDE_DIR_ft2build:PATH=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^
|
||||
-DFREETYPE_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freetype.lib ^
|
||||
-DFREETYPE_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freetyped.lib ^
|
||||
-DGDAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGDAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
|
||||
-DOPENAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DOPENAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^
|
||||
-DOPENTHREADS_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOPENTHREADS_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/OpenThreads.lib ^
|
||||
-DOPENTHREADS_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGDB_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGDB_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGDB_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgDB.lib ^
|
||||
-DOSGFX_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGFX_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGFX_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgFX.lib ^
|
||||
-DOSGGA_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGGA_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGGA_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgGA.lib ^
|
||||
-DOSGPARTICLE_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGPARTICLE_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGPARTICLE_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgParticle.lib ^
|
||||
-DOSGSIM_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGSIM_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGSIM_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgSim.lib ^
|
||||
-DOSGTEXT_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGTEXT_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGTEXT_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgText.lib ^
|
||||
-DOSGUTIL_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGUTIL_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGUTIL_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgUtil.lib ^
|
||||
-DOSGVIEWER_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSGVIEWER_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSGVIEWER_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osgViewer.lib ^
|
||||
-DOSG_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DOSG_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DOSG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/scratch-install/lib/osg.lib ^
|
||||
-DPLIB_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DPLIB_FNT_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DPLIB_FNT_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/plib_fnt.lib ^
|
||||
-DPLIB_PUAUX_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DPLIB_PUAUX_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/plib_puAux.lib ^
|
||||
-DPLIB_PUI_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DPLIB_PUI_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/plib_pui.lib ^
|
||||
-DPLIB_SG_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DPLIB_SG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/plib_sg.lib ^
|
||||
-DPLIB_UL_LIBRARY_DEBUG:FILEPATH= ^
|
||||
-DPLIB_UL_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/plib_ul.lib ^
|
||||
-DPNG_PNG_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DPNG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libpng16.lib ^
|
||||
-DZLIB_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/zlibd.lib ^
|
||||
-DZLIB_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib
|
||||
cmake --build . --config Release --target INSTALL
|
||||
cd %ROOT_DIR%
|
||||
|
||||
ECHO Compiling TerraGear . . .
|
||||
cd terragear-build
|
||||
cmake ..\terragear-git -G %CMAKE_TOOLCHAIN% ^
|
||||
-DCMAKE_PREFIX_PATH:PATH=%ROOT_DIR%/Stage/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%QT5x64% ^
|
||||
-DCMAKE_CONFIGURATION_TYPES=Debug;Release ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/Stage ^
|
||||
-DMSVC-3RDPARTY_ROOT= ^
|
||||
-DBoost_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DBoost_LIBRARY_DIR_DEBUG=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib ^
|
||||
-DBoost_LIBRARY_DIR_RELEASE=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
|
||||
-DCGAL_DIR=%ROOT_DIR%/vcpkg-git/buildtrees/cgal/x64-windows-rel ^
|
||||
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
|
||||
-DJPEG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DJPEG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^
|
||||
-DTIFF_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DTIFF_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/tiff.lib ^
|
||||
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib ^
|
||||
-DSIMGEAR_INCLUDE_DIR=%ROOT_DIR%/Stage/include ^
|
||||
-DSIMGEAR_CORE_LIBRARY=%ROOT_DIR%/Stage/lib/SimGearCore.lib ^
|
||||
-DSIMGEAR_SCENE_LIBRARY=%ROOT_DIR%/Stage/lib/SimGearScene.lib
|
||||
echo Compiling TerraGear . . .
|
||||
cd scratch-build\terragear
|
||||
cmake ..\..\scratch-source\terragear-git -G %CMAKE_TOOLCHAIN% ^
|
||||
-DCMAKE_CONFIGURATION_TYPES:STRING=Debug;Release ^
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release ^
|
||||
-DCMAKE_PREFIX_PATH:STRING=%ROOT_DIR%/scratch-install/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%QT5x64_LIB% ^
|
||||
-DCMAKE_INCLUDE_PATH:STRING=%ROOT_DIR%/scratch-install/include;%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/scratch-install ^
|
||||
-DMSVC_3RDPARTY_ROOT:PATH= ^
|
||||
-DBoost_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DBoost_LIBRARY_DIR_RELEASE:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
|
||||
-DCGAL_DIR:PATH=%ROOT_DIR%/vcpkg-git/buildtrees/cgal/x64-windows-rel ^
|
||||
-DGDAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGDAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
|
||||
-DGMP_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DGMP_LIBRARIES_DIR:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
|
||||
-DJPEG_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DJPEG_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/jpeg.lib ^
|
||||
-DJPEG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^
|
||||
-DMPFR_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DMPFR_LIBRARIES_DIR:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
|
||||
-DTIFF_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DTIFF_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/tiffd.lib ^
|
||||
-DTIFF_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/tiff.lib ^
|
||||
-DZLIB_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
|
||||
-DZLIB_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/zlibd.lib ^
|
||||
-DZLIB_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib ^
|
||||
-DSIMGEAR_INCLUDE_DIR:PATH=%ROOT_DIR%/scratch-install/include ^
|
||||
-DSIMGEAR_CORE_LIBRARY_RELEASE=%ROOT_DIR%/scratch-install/lib/SimGearCore.lib ^
|
||||
-DSIMGEAR_SCENE_LIBRARY_RELEASE=%ROOT_DIR%/scratch-install/lib/SimGearScene.lib
|
||||
cmake --build . --config Release --target INSTALL
|
||||
cd %ROOT_DIR%
|
||||
|
||||
REM TerraGear is expecting proj.dll instead of proj_4_9.dll, clone it so TG may find it.
|
||||
for %%i in (vcpkg-git\installed\x64-windows\bin\proj*.dll) do copy /Y %%i Stage\bin\proj.dll
|
||||
for %%i in (vcpkg-git\installed\x64-windows\bin\proj*.dll) do copy /Y %%i scratch-install\bin\proj.dll
|
||||
|
||||
ECHO All done!
|
||||
echo All done!
|
||||
|
||||
2
fgdata
2
fgdata
Submodule fgdata updated: dade6b7218...c8dc824b88
Submodule flightgear updated: d8dd148245...cafae9111a
2
getstart
2
getstart
Submodule getstart updated: d83b8723ea...ad1cb914bc
@@ -18,22 +18,26 @@ rm -rf $WORKSPACE/dist/include/simgear $WORKSPACE/dist/libSim* $WORKSPACE/dist/l
|
||||
PATH=$PATH:$QTPATH
|
||||
echo "Build path is: $PATH"
|
||||
|
||||
# this shoudl not be needed, since this is inside CMAKE_INSTALL_PREFIX, but seemed
|
||||
# to be necessary all the same
|
||||
#export PKG_CONFIG_PATH=$WORKSPACE/dist/lib/pkgconfig
|
||||
|
||||
cmakeCommonArgs="-G Ninja -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||
|
||||
###############################################################################
|
||||
echo "Starting on SimGear"
|
||||
pushd sgBuild
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../simgear
|
||||
cmake ${cmakeCommonArgs} ../simgear
|
||||
|
||||
# compile
|
||||
make
|
||||
cmake --build . --target debug_symbols
|
||||
cmake --build . --target install
|
||||
|
||||
if [ $? -ne '0' ]; then
|
||||
echo "make simgear failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make install
|
||||
|
||||
|
||||
popd
|
||||
|
||||
################################################################################
|
||||
@@ -46,21 +50,27 @@ else
|
||||
FGBUILDTYPE=Nightly
|
||||
fi
|
||||
|
||||
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../flightgear
|
||||
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DENABLE_SWIFT:BOOL=ON ${cmakeCommonArgs} ../flightgear
|
||||
|
||||
make
|
||||
cmake --build . --target debug_symbols
|
||||
cmake --build . --target install
|
||||
|
||||
if [ $? -ne '0' ]; then
|
||||
echo "make flightgear failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make install
|
||||
|
||||
popd
|
||||
|
||||
chmod +x $WORKSPACE/dist/bin/osgversion
|
||||
|
||||
crashpad_bin_path=$WORKSPACE/dist/fgfs.app/Contents/MacOS/crashpad_handler
|
||||
if [ -f $crashpad_bin_path ]; then
|
||||
chmod +x $crashpad_bin_path
|
||||
fi
|
||||
|
||||
chmod +x $WORKSPACE/dist/bin/osgversion
|
||||
echo "Running symbol upload script"
|
||||
./sentry-dSYM-upload-mac.sh
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@ $osgSoVersion=runOsgVersion('so-number')
|
||||
$openThreadsSoVersion=runOsgVersion('openthreads-soversion-number')
|
||||
|
||||
$codeSignIdentity = ENV['FG_CODESIGN_IDENTITY']
|
||||
$keychain = ENV['FG_KEYCHAIN']
|
||||
|
||||
puts "Code signing identity is #{$codeSignIdentity}"
|
||||
puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}"
|
||||
|
||||
@@ -41,7 +43,6 @@ $prefixDir=Dir.pwd + "/dist"
|
||||
dmgDir=Dir.pwd + "/image"
|
||||
srcDir=Dir.pwd + "/flightgear"
|
||||
qmlDir=srcDir + "/src/GUI/qml"
|
||||
|
||||
puts "Erasing previous image dir"
|
||||
`rm -rf #{dmgDir}`
|
||||
|
||||
@@ -54,11 +55,10 @@ bundle=dmgDir + "/FlightGear.app"
|
||||
puts "Running macdeployqt on the bundle to copy Qt libraries"
|
||||
`macdeployqt #{$prefixDir}/fgfs.app -qmldir=#{qmlDir}`
|
||||
|
||||
puts "Moving & renaming app bundle"
|
||||
puts "Copying & renaming app bundle"
|
||||
`mkdir -p #{dmgDir}`
|
||||
`mv #{$prefixDir}/fgfs.app #{bundle}`
|
||||
`rsync --archive --quiet #{$prefixDir}/fgfs.app/ #{bundle}`
|
||||
|
||||
bundle=dmgDir + "/FlightGear.app"
|
||||
contents=bundle + "/Contents"
|
||||
macosDir=contents + "/MacOS"
|
||||
$frameworksDir=contents +"/Frameworks"
|
||||
@@ -68,8 +68,9 @@ osgPluginsDir=contents+"/PlugIns/osgPlugins"
|
||||
# for writing copyright year to Info.plist
|
||||
t = Time.new
|
||||
fgCurrentYear = t.year
|
||||
fgBundleIdentifier = "org.flightgear.mac"
|
||||
|
||||
fgVersion = File.read("#{srcDir}/version").strip
|
||||
fgVersion = File.read("#{srcDir}/flightgear-version").strip
|
||||
volName="\"FlightGear #{fgVersion}\""
|
||||
|
||||
if $isRelease
|
||||
@@ -78,6 +79,7 @@ if $isRelease
|
||||
else
|
||||
dmgPath = Dir.pwd + "/output/FlightGear-#{fgVersion}-nightly.dmg"
|
||||
dmgFullPath = Dir.pwd + "/output/FlightGear-#{fgVersion}-nightly-full.dmg"
|
||||
fgBundleIdentifier = "org.flightgear.mac-nightly"
|
||||
end
|
||||
|
||||
puts "Creating directory structure"
|
||||
@@ -98,7 +100,7 @@ bins.each do |b|
|
||||
`cp #{$prefixDir}/bin/#{b} #{outPath}`
|
||||
end
|
||||
|
||||
puts "copying libraries"
|
||||
puts "Copying OSG libraries"
|
||||
$osgLibs.each do |l|
|
||||
libFile = "lib#{l}.#{$osgSoVersion}.dylib"
|
||||
`cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}`
|
||||
@@ -108,6 +110,13 @@ end
|
||||
libFile = "libOpenThreads.#{$openThreadsSoVersion}.dylib"
|
||||
`cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}`
|
||||
|
||||
# DBus and libEvent needed for SWIFT
|
||||
# Sentry is crash reporting
|
||||
otherLibs = ['dbus-1.3', 'event_core-2.2.1', 'sentry']
|
||||
otherLibs.each do |l|
|
||||
`cp #{$prefixDir}/lib/lib#{l}.dylib #{$frameworksDir}`
|
||||
end
|
||||
|
||||
$osgPlugins.each do |p|
|
||||
pluginFile = "osgdb_#{p}.dylib"
|
||||
`cp #{$prefixDir}/lib/osgPlugins/#{pluginFile} #{osgPluginsDir}`
|
||||
@@ -135,27 +144,50 @@ File.open("#{contents}/Info.plist", 'w') { |f|
|
||||
|
||||
createArgs = "-format UDBZ -imagekey bzip2-level=9 -quiet -volname #{volName}"
|
||||
|
||||
# enable the hardened runtime and timestamp options, so notarization works
|
||||
codeSignArgs = "--deep --options=runtime --timestamp"
|
||||
|
||||
if !$isRelease
|
||||
# create the 'lite' DMG without the base files
|
||||
|
||||
|
||||
# code sign the entire bundle once complete - v2 code-signing
|
||||
puts "Signing #{bundle}"
|
||||
`codesign --deep -s "#{$codeSignIdentity}" #{bundle}`
|
||||
puts "Creating DMG"
|
||||
`codesign #{codeSignArgs} --keychain #{$keychain} -s "#{$codeSignIdentity}" #{bundle}`
|
||||
puts "Creating DMG without base-files"
|
||||
|
||||
`rm -f #{dmgPath}`
|
||||
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{dmgPath}`
|
||||
|
||||
puts "Notarizing DMG #{dmgPath}"
|
||||
`xcrun altool --notarize-app \
|
||||
--primary-bundle-id "#{fgBundleIdentifier}" \
|
||||
--username "zakalawe@mac.com" \
|
||||
--password "@keychain:FlightGearAppStoreConnectUserName" \
|
||||
--file #{dmgPath}`
|
||||
|
||||
|
||||
end
|
||||
|
||||
puts "Creating full image with data"
|
||||
|
||||
puts "Copying base package files into the image"
|
||||
`rsync -a fgdata/ #{resourcesDir}/data`
|
||||
|
||||
# re-sign the entire bundle
|
||||
puts "Re-signing full #{bundle}"
|
||||
`codesign --force --deep -s "#{$codeSignIdentity}" #{bundle}`
|
||||
# sign the entire bundle
|
||||
puts "Signing full app: #{bundle}"
|
||||
`codesign --force #{codeSignArgs} --keychain #{$keychain} -s "#{$codeSignIdentity}" #{bundle}`
|
||||
|
||||
`rm -f #{dmgFullPath}`
|
||||
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{dmgFullPath}`
|
||||
|
||||
puts "Notarizing DMG #{dmgFullPath}"
|
||||
|
||||
`xcrun altool --notarize-app \
|
||||
--primary-bundle-id "#{fgBundleIdentifier}" \
|
||||
--username "zakalawe@mac.com" \
|
||||
--password "@keychain:FlightGearAppStoreConnectUserName" \
|
||||
--file #{dmgFullPath}`
|
||||
|
||||
|
||||
puts "Packaging complete"
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ localization files in $FG_ROOT/Translations/<language_code>):
|
||||
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
||||
merge-new-master $languages
|
||||
|
||||
Note: you may omit $languages in the fg-update-translation-files command if
|
||||
you want to autodetect the FlightGear-nonQt.xlf files present in
|
||||
$FG_ROOT/Translations.
|
||||
|
||||
Updating XLIFF files to reflect changes in the default translation
|
||||
------------------------------------------------------------------
|
||||
|
||||
@@ -45,6 +49,9 @@ modified or removed, or categories added or removed[3]):
|
||||
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
||||
merge-new-master $languages
|
||||
|
||||
Note: you may omit $languages in this command if you want to autodetect the
|
||||
FlightGear-nonQt.xlf files present in $FG_ROOT/Translations.
|
||||
|
||||
Updating XLIFF files to mark or remove obsolete translated strings
|
||||
------------------------------------------------------------------
|
||||
|
||||
@@ -53,9 +60,14 @@ To remove unused translated strings (not to be done too often in my opinion):
|
||||
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
|
||||
remove-unused $languages
|
||||
|
||||
(you may replace 'remove-unused' with 'mark-unused' to just mark the strings
|
||||
as not-to-be-translated, however 'merge-new-master' presented above already
|
||||
does that)
|
||||
Notes:
|
||||
|
||||
- You may omit $languages in this command if you want to autodetect the
|
||||
FlightGear-nonQt.xlf files present in $FG_ROOT/Translations.
|
||||
|
||||
- It is possible to replace 'remove-unused' with 'mark-unused' to just mark
|
||||
the strings as not-to-be-translated; however, 'merge-new-master' presented
|
||||
above already does that.
|
||||
|
||||
Merging contents from an XLIFF file into another one
|
||||
----------------------------------------------------
|
||||
|
||||
@@ -27,6 +27,7 @@ import sys
|
||||
|
||||
import flightgear.meta.logging
|
||||
import flightgear.meta.i18n as fg_i18n
|
||||
from flightgear.meta.i18n import XliffFormatHandler
|
||||
|
||||
|
||||
PROGNAME = os.path.basename(sys.argv[0])
|
||||
@@ -45,7 +46,7 @@ def processCommandLine():
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
usage="""\
|
||||
%(prog)s [OPTION ...] ACTION LANGUAGE_CODE...
|
||||
%(prog)s [OPTION ...] ACTION [LANGUAGE_CODE]...
|
||||
Update FlightGear XLIFF localization files.""",
|
||||
description="""\
|
||||
This program performs the following operations (actions) on FlightGear XLIFF
|
||||
@@ -68,6 +69,13 @@ translation files (*.xlf):
|
||||
In the XLIFF localization files corresponding to the specified
|
||||
language(s), remove all translated strings that are marked as unused.
|
||||
|
||||
If no LANGUAGE_CODE is provided as an argument, then assuming $transl_dir
|
||||
represents the value passed to --transl-dir, all directories $d such that a
|
||||
file named FlightGear-nonQt.xlf is found in $transl_dir/$d will be acted on as
|
||||
if they had been passed as LANGUAGE_CODE arguments (actually, the directory
|
||||
$transl_dir/default is not considered as a candidate; it is simply skipped).
|
||||
Typically, $transl_dir is /path/to/FGData/Translations.
|
||||
|
||||
A translated string that is marked as unused is still present in the XLIFF
|
||||
localization file; it is just presented in a way that tells translators they
|
||||
don't need to worry about it. On the other hand, when a translated string is
|
||||
@@ -105,7 +113,7 @@ general on the short or mid-term: they only take some space.
|
||||
remove those already marked as unused from the XLIFF
|
||||
files corresponding to each given LANGUAGE_CODE (i.e.,
|
||||
those that are not in the default translation)""")
|
||||
parser.add_argument("lang_code", metavar="LANGUAGE_CODE", nargs="+",
|
||||
parser.add_argument("lang_code", metavar="LANGUAGE_CODE", nargs="*",
|
||||
help="""\
|
||||
codes of languages to operate on (e.g., fr, en_GB, it,
|
||||
es_ES...)""")
|
||||
@@ -125,11 +133,19 @@ class MarkOrRemoveUnusedAction(enum.Enum):
|
||||
mark, remove = range(2)
|
||||
|
||||
|
||||
def langCodesToActOn():
|
||||
"""Return an iterable of all language codes we were told to work on."""
|
||||
if params.lang_code:
|
||||
return params.lang_code
|
||||
else:
|
||||
return XliffFormatHandler.availableTranslations(params.transl_dir)
|
||||
|
||||
|
||||
def markOrRemoveUnused(l10nResPoolMgr, action):
|
||||
formatHandler = fg_i18n.XliffFormatHandler()
|
||||
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
|
||||
|
||||
for langCode in params.lang_code:
|
||||
for langCode in langCodesToActOn():
|
||||
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
|
||||
transl = formatHandler.readTranslation(xliffPath)
|
||||
|
||||
@@ -148,7 +164,7 @@ def mergeNewMaster(l10nResPoolMgr):
|
||||
formatHandler = fg_i18n.XliffFormatHandler()
|
||||
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
|
||||
|
||||
for langCode in params.lang_code:
|
||||
for langCode in langCodesToActOn():
|
||||
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
|
||||
transl = formatHandler.readTranslation(xliffPath)
|
||||
transl.mergeMasterTranslation(masterTransl, logger=logger)
|
||||
|
||||
@@ -83,6 +83,7 @@ FORMAT_HANDLERS_NAMES = []
|
||||
# qttools/src/linguist/shared/numerus.cpp).
|
||||
PLURAL_FORMS = {
|
||||
None: ["<master>"], # for the default (= master) translation
|
||||
"ca": ["singular", "plural"],
|
||||
"de": ["singular", "plural"],
|
||||
"en": ["singular", "plural"],
|
||||
"es": ["singular", "plural"],
|
||||
@@ -92,6 +93,7 @@ PLURAL_FORMS = {
|
||||
"pl": ["singular", "paucal", "plural"],
|
||||
"pt": ["singular", "plural"],
|
||||
"ru": ["singular", "plural"],
|
||||
"sk": ["singular", "paucal", "plural"],
|
||||
"zh": ["universal"] # universal form
|
||||
}
|
||||
|
||||
@@ -999,6 +1001,33 @@ class AbstractFormatHandler(metaclass=abc.ABCMeta):
|
||||
baseName = cls.defaultFileBaseName(targetLanguage)
|
||||
return os.path.join(translationsDir, targetLanguage, baseName)
|
||||
|
||||
@classmethod
|
||||
def availableTranslations(cls, translationsDir):
|
||||
"""Return a list of all available translations in translationsDir.
|
||||
|
||||
This method expects a particular layout for translation files:
|
||||
the one used in $FG_ROOT/Translations. More precisely, it looks
|
||||
for all files named LANG_CODE/NAME in translationsDir, where
|
||||
NAME is cls.defaultFileBaseName(LANG_CODE). The special
|
||||
directory translationsDir/DEFAULT_LANG_DIR is not explored;
|
||||
thus, the result cannot contain DEFAULT_LANG_DIR.
|
||||
|
||||
Return a list of language codes, sorted with list.sort().
|
||||
|
||||
"""
|
||||
res = []
|
||||
with os.scandir(translationsDir) as it:
|
||||
for entry in it:
|
||||
if (entry.name != DEFAULT_LANG_DIR and entry.is_dir() and
|
||||
os.path.isfile(
|
||||
os.path.join(
|
||||
translationsDir, entry.name,
|
||||
cls.defaultFileBaseName(entry.name)))):
|
||||
res.append(entry.name)
|
||||
|
||||
res.sort()
|
||||
return res
|
||||
|
||||
@abc.abstractmethod
|
||||
def writeTranslation(self, transl, filePath):
|
||||
"""Write a Translation instance to a file."""
|
||||
|
||||
@@ -42,8 +42,8 @@ NEXT_MINOR_VERSION=${VERSION_A[1]}
|
||||
setVersionTo() {
|
||||
local V="$1"
|
||||
echo "setting version to $V"
|
||||
echo "$V" > version
|
||||
git add version
|
||||
echo "$V" > flightgear-version
|
||||
git add flightgear-version
|
||||
echo "new version: $V" | git commit --file=-
|
||||
# git tag "version/$V"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
THIS_RELEASE="2019.1"
|
||||
NEXT_RELEASE="2019.2"
|
||||
THIS_RELEASE="2020.2"
|
||||
NEXT_RELEASE="2020.3"
|
||||
SUBMODULES="simgear flightgear fgdata getstart"
|
||||
|
||||
#:<< 'COMMENT_END'
|
||||
@@ -39,6 +39,6 @@ done
|
||||
# IdentitiesOnly yes
|
||||
# User user_sf_username
|
||||
|
||||
svn copy svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/trunk \
|
||||
svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/branches/release-${THIS_RELEASE} \
|
||||
-m "branching for release ${THIS_RELEASE}"
|
||||
#svn copy svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/trunk \
|
||||
# svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/branches/release-${THIS_RELEASE} \
|
||||
# -m "branching for release ${THIS_RELEASE}"
|
||||
|
||||
30
release_builder/create_scenerypack.sh
Executable file
30
release_builder/create_scenerypack.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# the name to create
|
||||
SCENERY_PACK=SceneryPack.BIKF
|
||||
|
||||
# the tiles to select
|
||||
TILES="w030n60/w???n??";
|
||||
|
||||
# tiles for PHNL for C172 tutorials
|
||||
TUTORIAL_TILES="w160n[12]0/w???n??";
|
||||
|
||||
rm -f SceneryPack.*.tgz
|
||||
|
||||
# note the path to the TerraSync root here
|
||||
ln -s /var/www/uk-mirror/fgscenery ${SCENERY_PACK}
|
||||
|
||||
tar --format=gnu --create --owner=root --group=root --gzip --file=${SCENERY_PACK}.tgz \
|
||||
${SCENERY_PACK}/Objects/${TILES} \
|
||||
${SCENERY_PACK}/Terrain/${TILES} \
|
||||
${SCENERY_PACK}/Objects/${TUTORIAL_TILES} \
|
||||
${SCENERY_PACK}/Terrain/${TUTORIAL_TILES} \
|
||||
${SCENERY_PACK}/Airports/B/I/K \
|
||||
${SCENERY_PACK}/Airports/P/H \
|
||||
${SCENERY_PACK}/Airports_archive.tgz \
|
||||
${SCENERY_PACK}/Models
|
||||
|
||||
rm ${SCENERY_PACK}
|
||||
|
||||
# upload to frs.sourceforge.net /home/frs/project/fl/flightgear/scenery/
|
||||
|
||||
34
release_builder/reset-git-author.sh
Executable file
34
release_builder/reset-git-author.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
#This file is part of FlightGear
|
||||
#
|
||||
#FlightGear is free software: you can redistribute it and/or modify
|
||||
#it under the terms of the GNU General Public License as published by
|
||||
#the Free Software Foundation, either version 2 of the License, or
|
||||
#(at your option) any later version.
|
||||
#
|
||||
#FlightGear is distributed in the hope that it will be useful,
|
||||
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
#GNU General Public License for more details.
|
||||
#
|
||||
#You should have received a copy of the GNU General Public License
|
||||
#along with FlightGear If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if [ -z "$1" -o -z "$2" ]; then
|
||||
echo "usage: author email"
|
||||
exit
|
||||
fi
|
||||
|
||||
resetAuthor() {
|
||||
pushd $3 > /dev/null
|
||||
git config user.name "$1"
|
||||
git config user.email $2
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
resetAuthor "$1" $2 flightgear
|
||||
resetAuthor "$1" $2 simgear
|
||||
resetAuthor "$1" $2 fgdata
|
||||
resetAuthor "$1" $2 getstart
|
||||
resetAuthor "$1" $2 .
|
||||
|
||||
@@ -33,9 +33,9 @@ MICRO_VERSION=${VERSION_A[2]}
|
||||
|
||||
setVersionTo() {
|
||||
local V="$1"
|
||||
echo "setting version to $V"
|
||||
echo "$V" > version
|
||||
git add version
|
||||
echo "setting version to $V in $2"
|
||||
echo "$V" > $2
|
||||
git add $2
|
||||
echo "new version: $V" | git commit --file=-
|
||||
git tag "version/$V"
|
||||
}
|
||||
@@ -43,9 +43,22 @@ setVersionTo() {
|
||||
while [ $# -gt 0 ]; do
|
||||
echo "Processing $1"
|
||||
pushd $1 > /dev/null
|
||||
|
||||
case $1 in
|
||||
flightgear)
|
||||
versionFileName="flightgear-version"
|
||||
;;
|
||||
simgear)
|
||||
versionFileName="simgear-version"
|
||||
;;
|
||||
*)
|
||||
versionFileName="version"
|
||||
;;
|
||||
esac
|
||||
|
||||
git config user.name "Automatic Release Builder"
|
||||
git config user.email "build@flightgear.org"
|
||||
setVersionTo "${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}"
|
||||
setVersionTo "${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}" $versionFileName
|
||||
popd > /dev/null
|
||||
shift
|
||||
done
|
||||
|
||||
15
sentry-dSYM-upload-mac.sh
Executable file
15
sentry-dSYM-upload-mac.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
DWARF_DSYM_FOLDER_PATH=$WORKSPACE/dist/symbols
|
||||
|
||||
if which sentry-cli >/dev/null; then
|
||||
export SENTRY_ORG=flightgear
|
||||
export SENTRY_PROJECT=flightgear
|
||||
# export SENTRY_AUTH_TOKEN=YOUR_AUTH_TOKEN
|
||||
ERROR=$(sentry-cli upload-dif "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
|
||||
if [ ! $? -eq 0 ]; then
|
||||
echo "warning: sentry-cli - $ERROR"
|
||||
fi
|
||||
else
|
||||
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
|
||||
fi
|
||||
2
simgear
2
simgear
Submodule simgear updated: d6bbad87c4...ca5f66da9f
Submodule windows-3rd-party updated: 790648cd69...d53acc79f1
Reference in New Issue
Block a user