Compare commits

...
Author SHA1 Message Date
Automatic Release Builder 3c8b783710 Changes to create a debug build 2020-05-25 09:35:19 +01:00
legoboyvdlp R e34d02edbc Windows install: re-add js_demo.exe
The former is an advanced configuration tool for users' joysticks.
2020-05-25 09:26:12 +01:00
Florent Rougon 3810a31230 download_and_compile.sh: improve user-interaction
Since the prompt is repeated by _yes_no_quit_prompt() every time an
invalid answer is given, a short sentence is better than the empty
string.
2020-05-24 16:31:26 +02:00
Florent Rougon 00710497b0 download_and_compile.sh: add missing quoting
This is needed because $answer will be empty in case the default $2 is
empty and the user hits Enter at the prompt.
2020-05-24 11:39:27 +02:00
Florent Rougon 420034d5b5 download_and_compile.sh: make initial cloning of FGData easy and secure
Because cloning FGData from SourceForge using https does not work (this
has been the case for *years*) whereas normal updates of an existing
clone do work, and so does cloning the repository from its official
GitLab mirror using https, this commits implements a special case in
_gitDownload():

  If the assembled clone URL is
  <https://git.code.sf.net/p/flightgear/fgdata>, then ask the user if he
  agrees to automatically clone FGData from GitLab and arrange the
  repository setup to fetch subsequent updates from SourceForge. This
  should be fine because <https://gitlab.com/flightgear/fgdata> is an
  official mirror of FGData. The default answer is thus to do so. It is
  automatically chosen when download_and_compile.sh is called with
  --non-interactive (new option).

This implies that the initial use of download_and_compile.sh is again as
easy as subsequent ones.

This commits also adds the utility function _yes_no_quit_prompt() to
repeatedly ask a question ($1) until a valid answer has been provided.
The function automatically uses the default answer ($2) if
--non-interactive has been passed to download_and_compile.sh. See the
“discussion” at
<https://sourceforge.net/p/flightgear/mailman/message/37017469/>.
2020-05-24 11:14:36 +02:00
Florent Rougon b3893f7bda i18n Python scripts: allow autodetection of translation files
- Add class method availableTranslations() to AbstractFormatHandler in
  i18n.py.

- Use it in fg-update-translation-files to allow autodetection of the
  available translations when no LANGUAGE_CODE is passed to
  fg-update-translation-files.

This should address James' wish at
<https://sourceforge.net/p/flightgear/mailman/message/37003967/>.
2020-05-08 10:33:35 +02:00
James Turner 4e28b88c22 Windows: fixes for compositor builds 2020-05-03 19:02:26 +01:00
Florent Rougon fa0dcb5d4d download_and_compile.sh: add libssl-dev as mandatory dep for CMake
Unless SSL support is turned off, libssl-dev is needed to build CMake.
Thanks to Jeff Davis for the report.
2020-05-01 17:39:46 +02:00
James Turner 819074136a Re-enable ‘full-fat’ nightlies for macOS
May need to tweak the bundle IDs for notarization, let’s see.
2020-05-01 12:00:59 +01:00
James Turner 03ac46120c Windows: remove erroneous space breaking build
This was causing to pick the second prefix path as the source dir,
which doesn’t work so well.
2020-05-01 08:46:49 +01:00
James Turner cc76052038 Trunk FGAddon hangar: support 2020.* versions 2020-04-29 14:58:14 +01:00
legoboyvdlp R 3f38a3cf18 Add support for compositor to windows builds 2020-04-29 08:37:50 +01:00
James Turner 1c7dcaf5d5 macOS: package libSentry 2020-04-29 08:32:15 +01:00
James Turner dbdfc52a00 Adjust release script 2020-04-27 09:31:38 +01:00
James Turner d4489091e2 track submodule changes for release 2020-04-27 09:30:09 +01:00
James Turner 6fa2edf9d5 new version: 2020.2.0 2020-04-27 09:30:08 +01:00
James Turner 6e608907b4 new version: 2020.1.1 2020-04-27 09:30:08 +01:00
Florent Rougon ac504c70a2 download_and_compile.sh: fix typo in help text 2020-04-25 11:17:56 +02:00
Florent Rougon 2bb86ee6ea download_and_compile.sh: update address and branch for CMake
- The old URL for CMake's Git repository doesn't support https anymore;
  update it to match the one given at <https://cmake.org/>.

- Build the 'release' branch rather than 'master':
  download_and_compile.sh is not meant for CMake hackers!
2020-04-25 11:17:56 +02:00
James Turner a02dc9aad6 Window: update installer script for Sentry
Replace CrashRpt DLL and uploader with the corresponding ones for the
Sentry-native API.
2020-04-18 19:54:00 +01:00
Florent Rougon 69033f37f8 i18n Python scripts: declare plural forms for Catalan and Slovak
Regarding Slovak language, there was enough info in
<https://code.qt.io/cgit/qt/qttools.git/tree/src/linguist/shared/numerus.cpp>.
As for Catalan, I don't see anything there, so I put
"ca": ["singular", "plural"] based on the fact that [1] says:

  "Catalan has an inflectional grammar. Nouns have two genders
   (masculine, feminine), and two numbers (singular, plural)."

I suspect we'll be ahead of Qt Linguist for Catalan.

[1] https://en.wikipedia.org/wiki/Catalan_language
2020-04-15 11:40:26 +02:00
James Turner aa7770911b Revert "macOS: remove use of Ninja for now"
This reverts commit b954ad8cd7.
2020-04-11 16:38:43 +01:00
James Turner b954ad8cd7 macOS: remove use of Ninja for now
For some reason the slave doesn’t like Ninja, let’s disable it until
I figure out why.
2020-04-10 12:07:04 +01:00
James Turner 9158b1688e Update macoS/Win build scripts for symbol uploading 2020-04-08 16:14:38 +01:00
James Turner 9effd91f62 macOS: Use different bundle identifiers for nightly builds
Also switch so nightly builds are always ‘lite’ (not full) to save
bandwidth / computational load on Jenkins
2020-04-02 22:21:20 +01:00
James Turner 0ddf75b382 Copy Swift libraries on macOS 2020-03-30 13:32:57 +01:00
Julian Smith a2eb0d7b4c download_and_compile.sh: added --compositor option. 2020-03-24 22:21:01 +00:00
James Turner 14ee759409 Fix Python3 compatability 2020-03-24 14:27:27 +00:00
James Turner aff1ac0f69 Add more catalog tags based on what’s used 2020-03-24 14:24:29 +00:00
James Turner 9453e085b3 Add Mespieler aircraft mirror 2020-03-21 18:41:45 +00:00
James Turner da4cf552cb Bugfix, missed $ on global variable 2020-03-18 12:41:42 +00:00
James Turner 91e0f86a0b macOS: code-signing changes 2020-03-17 16:33:27 +00:00
James Turner aae488794e Notarization support in macOS packaging scripts 2020-03-13 16:59:14 +00:00
Edward d'Auvergne 4dffeeb56e Catalogs: Addition of an initial README.md file. 2019-11-18 11:23:27 +01:00
Edward d'Auvergne ed7075f4ba Catalogs: Python 3 compatibility for reading binary data.
IO data needs to be decoded, and the binary zip file needs to be opened in 'rb'
binary mode.
2019-11-18 10:26:40 +01:00
Edward d'Auvergne 185a10f7c5 Catalogs: Python3 does not have a 'long' integer type. 2019-11-18 10:10:22 +01:00
Edward d'Auvergne 5d3fcd3ba0 Catalogs: Converted all print statements into Python 3 compatible functions. 2019-11-18 10:06:24 +01:00
Edward d'Auvergne 3b1a3c51b1 Catalogs: Default to Python 3. 2019-11-18 09:58:58 +01:00
Edward d'Auvergne ea18939738 Catalogs: Addition of example configuration files for testing a single craft.
This is useful for aircraft authors to see what will be packed into the zip
archive.
2019-11-14 12:00:02 +01:00
Edward d'Auvergne d22ff42e42 Catalogs: The scm <update> XML tag is now used.
The tag can be overridden on the command line with the --update and --no-update options.
2019-11-14 11:59:56 +01:00
Edward d'Auvergne 190d789a54 Catalogs: Support for <include> tags to allow a subset of craft to be cataloged. 2019-11-13 22:26:11 +01:00
Edward d'Auvergne 8534a8aba4 Catalogs: Modification of the template file parsing.
The code is now a function in the 'catalog' module and checks for the existence
of the file are now performed.
2019-11-13 22:26:11 +01:00
Edward d'Auvergne 9ec3e015b2 Catalogs: Modification of the configuration file parsing.
The code is now a function in the 'catalog' module and checks for the existence
of the file are now performed.
2019-11-13 22:26:10 +01:00
Edward d'Auvergne b8c05410e3 Catalogs: Rewrite of the craft zip creation using the Python zipfile module.
If a 'zip-excludes.lst' file is found in the craft's base directory, that will
overwrite the global catalog exclusion list.

Three new unit tests have been created to test the functionality.
2019-11-13 22:25:49 +01:00
Edward d'Auvergne fd6fae3858 Catalogs: Expansion of the zip archive exclusion file.
This includes addition of the craft development directories 'dev', 'Dev',
'development', 'src', and 'Resources' and handling the common compressed gimp
file *.xcf.gz, a capitalised gimp file, and Blender *.blend[1-9] files.
2019-11-13 22:18:43 +01:00
Edward d'Auvergne ca4a2ca813 Catalogs: Bug fixes allowing the unit tests to pass again.
3 of the tests have been broken since 70dfd6b8d4,
the change to LXML.
2019-11-12 14:26:24 +01:00
Torsten Dreyer da0d245685 Script to create the scenery pack 2019-11-06 13:51:41 +01:00
Scott Giese e0568f4f63 Final 'white text' version 2019-09-29 22:41:01 -05:00
Scott Giese f61d0d35bd Add option for white text fix. 2019-09-29 17:50:58 -05:00
Scott Giese 61fbe94ee2 [fg-from-scratch] curl_debug library 2019-09-21 11:55:29 -05:00
Scott Giese 523fe108be [fg-from-scratch] PLIB and debug modules 2019-09-21 11:12:11 -05:00
Scott Giese 23e6b50aa9 [fg-from-scratch] improved SimGear options 2019-09-21 10:21:14 -05:00
Scott Giese 22337b2bdb [fg-from-scratch] improve FG and TG options 2019-09-19 19:58:26 -05:00
Scott Giese b38a53490c [fg-from-scratch] improve SimGear options 2019-09-18 23:13:53 -05:00
Scott Giese 326dd6e11d [fg-from-scratch] improve OSG build options 2019-09-18 22:33:33 -05:00
Scott Giese 40e5af8d57 VS2019 defaults to x64 2019-09-17 20:37:46 -05:00
Scott Giese eea7bac1e8 [fg-from-scratch]
Auto detect Qt5 install path
Auto detect latest VS version
Upgrade to OSG 3.6
Organize folder structure
2019-09-16 23:50:35 -05:00
Julian Smith a5e4c47f1d download_and_compile.sh: improved generation of run_fgfs*.sh scripts.
Use common code for run_fgfs.sh and run_fgfs_debug.sh. If OpenBSD, also add a
ulimit -d command to increase data segment size.
2019-09-04 13:35:30 +01:00
Julian Smith 9804df24a1 download_and_compile.sh: Added support for building fgfs on OpenBSD.
Added support for building zlib, because current openbsd-6.5's zlib is too old.

If OpenBSD:
    Default to not attempting to update or download packages - for now packages
    have to be installed manually with pkg_add.

    Use gnugetopt.

    Use ZLIB build for simgear and fgfs.

    For fgfs, use -DENABLE_QT=OFF -DENABLE_FGCOM=OFF.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This reverts commit 6caf43f9e7.

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

We may get reports of missing dependencies for some components as a side
effect of this change; we'll just have to add the missing dependencies
wherever they are required (this can happen if, for instance, some
particular dependency was so far listed in the comments only as a
TERRAGEAR dependency, but was actually required by *another component*
such as FGFS). Incorrect dependency information needs to be fixed,
that's all there is to it.
2019-04-09 10:34:30 +02:00
Florent Rougon 6caf43f9e7 download_and_compile.sh: add optional dependency on libcppunit-dev
The dependency is optional because CppUnit is shipped with the FG
sources. However, when installed via the distro package manager as we
are attempting here:
  - the FG build will be quicker;
  - libcppunit-dev will be updated like other distro packages (e.g.,
    it will receive security updates).
2019-04-09 09:40:28 +02:00
chris_blues 7b51c99439 FGmeta/Nasa2FGearthview
-----------------------
* merge contribution of eatdirt <chris@ringeval.com>
  add download, conversion and generation of normalmaps
  Big thanks Chris!
* update README and some minor updates to the script
2019-03-25 18:20:43 +01:00
Florent Rougon 1cf284bd6f download_and_compile.sh: add optional dependency on qttools5-dev
This package is needed to embed translations in the built-in launcher
(it contains Qt5LinguistToolsConfig.cmake). Thanks to Clm76 for the
feedback.
2019-03-25 11:09:13 +01:00
Florent Rougon 1f27f8e39a download_and_compile.sh: create openscenegraph dir only when OSG build is enabled
Dont create the 'openscenegraph' directory when the OSG build is
not selected (request from user ctesc356 of the French forum).
2019-03-23 14:34:51 +01:00
Torsten Dreyer caaad41e26 track submodule changes for release 2019-03-13 21:21:07 +01:00
Torsten Dreyer 120055fa43 new version: 2019.2.0 2019-03-13 21:21:07 +01:00
Torsten Dreyer 72bd67c6ef new version: 2019.1.1 2019-03-13 21:21:07 +01:00
Torsten Dreyer ac35f4d20f Prepare for 2019.1 2019-03-13 21:20:46 +01:00
Florent Rougon 56e1055dec download_and_compile.sh: improvements related to package installation
- When -pn has been passed (i.e., the user wants the 'apt-get install'
  step to be skipped), don't waste time checking the available
  dependencies. Rationale: someone using -pn has probably already
  installed the required packages either manually or during a previous
  run of download_and_compile.sh, and anything missing couldn't be fixed
  under -pn regime anyway, by definition. Assume that users passing -pn
  want to build with the packages they already have, and let them spare
  some time and CPU cycles.

- New options --package-manager and --sudo. The former defaults to
  'apt-get' as usual, but 'aptitude' can be used as well. The --sudo
  option specifies the sudo-like program to use. Passing --sudo=echo
  allows one to see the apt-get or aptitude commands without running
  them. Passing --sudo= or --sudo="" (i.e., giving an empty value)
  causes the package manager to be called directly, without any
  intermediate sudo-like program.

- The PKG variable is now a Bash array, which is a bit cleaner and
  blends better with the new, array-based implementations of
  _aptUpdate() and _aptInstall() (whose purpose is to allow the
  newly-added flexibility without multiplying the code paths).
2019-02-12 00:04:07 +01:00
James Turner ed88c630ea Add the git-mirror script uses on Jenkins
This is run on one of Jenkins Linux machines to mirror all the
SF repos for faster cloning and builds when SF is offline.
2019-01-14 13:19:01 +00:00
Scott Giese da0f443f62 Linux::fg-from-scratch
detect chipset architecture for compile/tune optimization
only compile vcpkg when file changes are detected
include cgal library
2019-01-01 14:50:49 -06:00
Scott Giese 2eac2b8546 fg-from-scratch:Linux
Initial commit
2018-12-10 14:40:29 -06:00
Florent Rougon 1d97e9f573 download_and_compile.sh: make generated scripts prepend to LD_LIBRARY_PATH instead of overwriting it
Thanks to Julian Smith for the report.
2018-10-24 11:56:39 +02:00
James Turner bd7ccccda6 Catalog configs from UKmirror 2018-10-23 12:01:58 +00:00
James Turner f0f047e6c5 Fix mirror URLs 2018-10-18 12:42:17 +00:00
James Turner 271f103ae3 Update catalogs config after discussion
Legacy catalog keeps the existing ID and URL, to avoid any problems
with older client versions
2018-10-18 13:37:17 +01:00
James Turner 99b893368b Catalogs: multiple download URLs (mirrors) supported 2018-10-17 14:16:40 +01:00
James Turner e4007bae99 Remove MD5 sum files from Git 2018-10-17 13:00:10 +00:00
James Turner 6e8b4c3ee7 Sharing logic tweaks 2018-10-17 13:00:10 +00:00
James Turner ccb35c7707 Catalog spec tweaks 2018-10-17 13:00:10 +00:00
James Turner 391ceaea11 Update-catalog.py: —quiet option 2018-10-17 11:04:11 +01:00
James Turner feae4a2d56 Tweaked catalog definitions 2018-10-17 09:26:08 +00:00
James Turner 70dfd6b8d4 Use LXML everywhere 2018-10-17 09:19:10 +00:00
James Turner a1f8e52ae8 Add three catalog setups, for UK mirror
The fgaddon-catalog was duplicated to avoid disturbing Curt’s config
he runs locally, until the new setup is working.
2018-10-15 11:39:56 +01:00
Florent Rougon a5525ba2b3 i18n Python scripts: remove class SysL10NResourceManager from i18n.py
This class isn't needed anymore now that
$FG_ROOT/Translations/default/sys.xml has a flat structure, like the
other FG XML i18n files that define the default translation. This is
related to

  https://sourceforge.net/p/flightgear/flightgear/ci/6d6e1809f00e3e2fa4e3f3dbf78967a39c474af1/

and more specifically to

  https://sourceforge.net/p/flightgear/fgdata/ci/587c60134585429921b998cb824abed01c6c475d/
2018-10-12 08:14:01 +02:00
Florent Rougon 1c5449fcd6 download_and_compile.sh: add optional dependencies qtbase5-dev-tools and qttools5-dev-tools
qtbase5-dev-tools contains the 'rcc' tool, and qttools5-dev-tools
contains 'lrelease'. Unless I'm mistaken, both are needed to compile the
Qt resources containing translations in the QM format for FlightGear's
built-in launcher.
2018-10-11 23:07:34 +02:00
Florent Rougon 359152c8d1 i18n Python scripts: fix Translation.__setitem__() and add docstrings
Translation.__setitem__() from flightgear/meta/i18n.py isn't used
anywhere here (it is not very useful), so no harm done, but that could
have confused potential readers.
2018-10-11 20:32:48 +02:00
James Turner 2c41742b99 Add Russian to the language list
Fix provided by Michael Danilov
2018-10-11 13:26:58 +01:00
Florent Rougon a20342ed48 download_and_compile.sh: cleaner log output, code simplification
The "DIRECTORY=..." was printed too late in the log file (after the apt
stuff). Fix that and make some code a bit easier to follow (e.g.,
LOGFILE is assigned only once now).
2018-10-11 14:07:33 +02:00
Florent Rougon d424cdaad3 download_and_compile.sh: minor changes
Consistent indentation for _printLog() vs. other functions, safety
measures for arguments possibly containing spaces, etc.
2018-10-11 13:22:49 +02:00
Florent Rougon 141bb7dec4 download_and_compile.sh: new function _log()
Introduce a new function _log() that allows one to factor out the
remaining explicit appends to $LOGFILE. Summary:

  _log        writes its arguments to $LOGFILE
  _printLog   ditto, and also prints them to the terminal
  _logOutput  echoes its standard input to the terminal and/or to $LOGFILE
              (depending on its first argument). Typically used in the
              last component of a pipeline.
2018-10-11 12:48:30 +02:00
Florent Rougon 2874e0eade download_and_compile.sh: new function _logOutput()
Use this function for all commands that produce output we want to see on
the terminal and in the log file. Actually, the first parmeter of the
function, which is optional, allows one to choose where we want the
output to be written to: the terminal and/or the log file (three
possibilities, since for none of these, '>/dev/null' redirection can be
used directly).
2018-10-11 12:48:24 +02:00
Florent Rougon 6520925c5b download_and_compile.sh: use _printLog() wherever appropriate
This is a logical follow-up for commit
8a7fd33b2b, which introduced the
_printLog() function.
2018-10-11 11:53:58 +02:00
James Turner 77384be44a Include the OSG .DDS loader plugin in Mac builds 2018-10-05 13:12:29 +01:00
Florent Rougon 7c5ad2405e download_and_compile.sh: cosmetic changes 2018-09-26 10:02:09 +02:00
Florent Rougon 250c0c54a8 download_and_compile.sh: fix difficult-to-read and sloppy checks
The new function _elementIn allows one to do these checks accurately and
in a more readable way.
2018-09-26 09:55:06 +02:00
Florent Rougon 2930727a87 download_and_compile.sh: take username verbatim (no conversion to lowercase)
Fix for commit 8a7fd33b2b: in argument to --git-clone-site-params,
take the username exactly as provided instead of converting it to
lowercase (the site and protocol are still converted to lowercase, but
*that* is intentional).
2018-09-26 09:27:53 +02:00
Florent Rougon a281b46214 download_and_compile.sh: add --version option 2018-09-26 00:17:29 +02:00
Florent Rougon 8a7fd33b2b download_and_compile.sh: give control over protocol and username for 'git clone'
This commit adds two new options:

--git-clone-default-proto=PROTO

  Default protocol to use for 'git clone' ('ssh', 'https' or git'). If
  the option is not specified, the default is still 'https'.

--git-clone-site-params=SITE=PROTOCOL[:USERNAME]

  Connect as USERNAME with PROTOCOL when cloning a Git repository hosted
  at SITE (sample sites: 'SourceForge', 'GitHub'; valid protocols:
  'ssh', 'https' and git'). USERNAME is required when using the 'ssh'
  protocol. The hosting site and protocol are matched in a
  case-insensitive way.

  This option may be passed several times with different sites, e.g.

    download_and_compile.sh --git-clone-default-proto=ssh \
                            --git-clone-site-params SourceForge=ssh:frougon \
                            --git-clone-site-params=GitHub=https

 (replace 'frougon' with your username at SourceForge)

  For repositories located at a hosting site specified with
  --git-clone-site-params, the protocol indicated with this option
  overrides the default protocol, be it the script default or the one
  given with --git-clone-default-proto.

  The above example shows that the argument of a long option, namely
  --git-clone-site-params in the example, may be given either separately
  or in the same shell argument as the option name, in which case an '='
  separator is needed.

When using the 'ssh' protocol, ssh-agent may be used to avoid having to
type the password once for each repository fetched with this protocol.
Also note that gpg-agent(1) can act as an SSH agent.
2018-09-26 00:17:29 +02:00
Florent Rougon 305a501ef3 download_and_compile.sh: use getopt instead of bash's getopts. Add --help.
The main advantage of getopt is that it allows one to define long
options. Help can now be obtained with 'download_and_compile.sh --help',
in addition to the already-existing '-h' option.

[ This is the getopt tool shipped in Debian's util-linux package,
  which is marked as Essential, therefore should always be present
  on a Debian system. ]

Try to improve formatting of the --help message, so that it is better
suited to document options that have a short as well as a long form.
Make the presentation of this help message a bit more standard.
2018-09-26 00:17:29 +02:00
Florent Rougon d073c54c0d download_and_compile.sh: move first main chunk of code after function definitions 2018-09-26 00:17:29 +02:00
Florent Rougon 705bd47bcd download_and_compile.sh: download FGData before building FG
This works better with the new translation system based on XLIFF files.
2018-09-26 00:17:29 +02:00
Florent Rougon 4128259e8e download_and_compile.sh: add missing deps and downgrade qt5-default, qtdeclarative5-dev
- add missing deps as suggested on the list
- downgrade qt5-default and qtdeclarative5-dev from mandatory to
  optional
2018-09-26 00:17:29 +02:00
Scott Giese 44bdb42fd0 fg-from-scratch: Improve handling of missing 'build' folders. 2018-09-24 18:35:57 -05:00
Torsten Dreyer 7de0f9f524 track submodule changes for release 2018-09-21 17:22:27 +02:00
Torsten Dreyer 1e3ac37c96 new version: 2018.4.0 2018-09-21 17:22:27 +02:00
54 changed files with 3240 additions and 913 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
dist dist
.DS_Store .DS_Store
install install*/
3rdParty 3rdParty
3rdParty.x64 3rdParty.x64
boost_1_44_0 boost_1_44_0
+14 -7
View File
@@ -21,10 +21,12 @@
#include "InstallConfig.iss" #include "InstallConfig.iss"
#define InstallDir32 "X:\install\msvc140" #define InstallDir32 "X:\install\msvc140"
#define InstallCompositor32 "X:\install\msvc140\compositor"
#define OSGInstallDir InstallDir32 + "\OpenSceneGraph" #define OSGInstallDir InstallDir32 + "\OpenSceneGraph"
#define OSGPluginsDir OSGInstallDir + "\bin\osgPlugins-" + OSGVersion #define OSGPluginsDir OSGInstallDir + "\bin\osgPlugins-" + OSGVersion
#define InstallDir64 "X:\install\msvc140-64" #define InstallDir64 "X:\install\msvc140-64"
#define InstallCompositor64 "X:\install\msvc140-64\compositor"
#define OSG64InstallDir InstallDir64 + "\OpenSceneGraph" #define OSG64InstallDir InstallDir64 + "\OpenSceneGraph"
#define OSG64PluginsDir OSG64InstallDir + "\bin\osgPlugins-" + OSGVersion #define OSG64PluginsDir OSG64InstallDir + "\bin\osgPlugins-" + OSGVersion
@@ -32,7 +34,7 @@
; we copy everything in install/<arch>/bin except these, which aren't ; we copy everything in install/<arch>/bin except these, which aren't
; useful to the end-user to ship ; useful to the end-user to ship
#define ExcludedBinaries "*smooth.exe,metar.exe,js_demo.exe" #define ExcludedBinaries "*smooth.exe,metar.exe"
[Setup] [Setup]
AppId=FlightGear AppId=FlightGear
@@ -74,6 +76,7 @@ Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "A
; 32 bits install ; 32 bits install
Source: "{#InstallDir32}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: not Is64BitInstallMode 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 ;locale only exists for fgrun - which has been disabled
;Source: "{#InstallDir32}\share\locale\*"; DestDir: "{app}\bin\locale"; Flags: ignoreversion recursesubdirs; Check: not Is64BitInstallMode ;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\libpng.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\libcurl.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\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\sentry.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty\bin\crashpad_handler.exe"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty\bin\dbus-1-3.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty\bin\event_core.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
; 64 bits install ; 64 bits install
Source: "{#InstallDir64}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode Source: "{#InstallDir64}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
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 ;locale only exists for fgrun - which has been disabled
;Source: "{#InstallDir64}\share\locale\*"; DestDir: "{app}\bin\locale"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode ;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\libpng.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\libcurl.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\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\sentry.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty.x64\bin\crashpad_handler.exe"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: Is64BitInstallMode Source: "{#ThirdPartyDir}\3rdParty.x64\bin\dbus-1-3.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\event_core.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
; Include the base package ; Include the base package
#if IncludeData == "TRUE" #if IncludeData == "TRUE"
@@ -190,6 +196,7 @@ Name: "{userdocs}\FlightGear\Custom Scenery"; Permissions: everyone-modify; Chec
[Icons] [Icons]
Name: "{userdesktop}\FlightGear {#FGVersion}"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin"; Tasks: desktopicon; 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"; 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 Manual"; Filename: "{app}\data\Docs\getstart.pdf"
Name: "{group}\FlightGear Documentation"; Filename: "{app}\data\Docs\index.html" Name: "{group}\FlightGear Documentation"; Filename: "{app}\data\Docs\index.html"
Name: "{group}\Flightgear Wiki"; Filename: "http://wiki.flightgear.org" Name: "{group}\Flightgear Wiki"; Filename: "http://wiki.flightgear.org"
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>fgfs</string> <string>fgfs</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.flightgear.FlightGear</string> <string><%= fgBundleIdentifier %></string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string><%= fgVersion %></string> <string><%= fgVersion %></string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
+107 -58
View File
@@ -1,96 +1,123 @@
# Nasa2FGearthview # Nasa2FGearthview
A bash-script to convert NASA satellite images to ready-to-use A bash-script to convert NASA satellite images to ready-to-use
textures for FG's EarthView using ImageMagick. textures for FG's EarthView using ImageMagick and normalmap
For info about FGearthview, see the forum thread: You can get "normalmap" there:
https://github.com/planrich/normalmap
For info about FGearthview, see the forum thread:\
https://forum.flightgear.org/viewtopic.php?f=6&t=15754 https://forum.flightgear.org/viewtopic.php?f=6&t=15754
or this FG-wiki-page:
or this FG-wiki-page:\
http://wiki.flightgear.org/Earthview http://wiki.flightgear.org/Earthview
### Caution!
Don't use this script on a server! It will most likely cause
Denial-of-service (DoS). When working on these huge images, the
harddisk throughput will cease occasionally and CPU / RAM usage will
spike tremendously! So, only use this script on your home desktop
computer, or if you don't mind several long server-outages...
------------------------------------ ------------------------------------
About: ## About:
This script runs on Linux (maybe Mac also?) in a Bash This script runs on Linux (maybe Mac also?) in a Bash
(Bourne Again Shell) - Windows is not supported (by the nature of the (Bourne Again Shell) - Windows is not supported (by the nature of the
script). Maybe it works on windows as well, I don't know, feel free script). Maybe it works on windows as well, I don't know, feel free
to try, and please let me know! :) to try, and please let me know! :)
This will download the raw images from http://visibleearth.nasa.gov -
their server is not very fast, so I provide an alternative download
location: https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
This one is much quicker! If you really want the images directly from
NASA, then provide "nasa" to the script (see below)
In the end you will have 8 world-textures in .png and .dds format. In the end you will have 8 world-textures in .png and .dds format.
Generally .dds is better in performance, but it won't work on some Generally .dds is better in performance, but it won't work on some
graphics cards. If this is the case for you, then try the .png files. graphics cards. If this is the case for you, then try the .png files.
For further information see: For further information see:\
http://wiki.flightgear.org/index.php?title=DDS_Textures_in_FlightGear&redirect=no http://wiki.flightgear.org/index.php?title=DDS_Textures_in_FlightGear&redirect=no
If you also converted the clouds, then you'll also find 8 cloud- If you also converted the clouds and the height maps, then you'll also
textures in the format .png. Because the .dds-format has trouble with find 8 cloud- and 8 height textures (as well as their conversion to
rendering heavy alpha images, which is because of it's compression normal maps) in the format .png. Because the .dds-format has trouble
algorythm [1], I think it's useless to also build faulty files. with rendering heavy alpha images, which is because of it's
However, this is not entirely true! It is possible to switch off the compression algorythm [1], I think it's useless to also build faulty
.dds/DXT compression. But this results in huge files and is rather files. However, this is not entirely true! It is possible to switch
heavy on the GPU's RAM. off the .dds/DXT compression. But this results in huge files and is
rather heavy on the GPU's RAM.
Buckaroo has created a nice overview on dds-compression: Buckaroo has created a nice overview on dds-compression:
[1] http://www.buckarooshangar.com/flightgear/tut_dds.html [1] http://www.buckarooshangar.com/flightgear/tut_dds.html
------------------------------------ ------------------------------------
Installation and usage: ## Installation and usage:
Simply copy "convert.sh" into a folder of your liking and run it: Simply copy "convert.sh" into a folder of your liking and run it:
$ ./convert.sh ```shell
./convert.sh
```
This will show a help text, since you didn't specify any target(s). This will show a help text, since you didn't specify any target(s).
Possible targets are: Possible targets are:
* world * world
* clouds * clouds
* heights
* all * all
Additionally, there are some options you could specify (further Additionally, there are some options you could specify (further
explained below): explained below):
* 1k | 2k | 4k | 8k | 16k * 1k | 2k | 4k | 8k | 16k
* nasa * download | no-download
* no-download * world
* clouds
* heights
* cleanup * cleanup
* rebuild * rebuild
* check * check
So your call could look sth like this: So your call could look sth like this:
$ ./convert.sh world no-download cleanup 8k ```shell
./convert.sh world download alt cleanup 8k
```
------------------------------------ ------------------------------------
Requirements: ## Requirements:
WARNING! WARNING!
This script uses a *lot* disk space! Make sure you have at least 90GB This script uses a *lot* disk space! In my last test run, which
available! generated all maps in all resolutions, the disk usage was about 330GB!
Beware!\
Also, I wouldn't recommend doing this on a SSD! While SSDs are
generally faster, they also get more wear-and-tear when write such
huge files. So this script might cause your SSD to die earlier as it
should. Generally speaking, this won't kill your SSD, but it might
cause it to die earlier. HDDs are much more robust in that respect.
Also, this script will run for a *very long* time! It might be best to Also, this script will run for a *very long* time! It might be best to
let it run over night - your computer might become unresponsive from let it run over night - your computer might become unresponsive from
time to time, due to the heavy CPU and memory load, which tends to time to time, due to the heavy CPU and memory load, which tends to
occur, when converting 54000x27000 images. ;-) occur, when converting 54000x27000 images. ;-)
I also recommend to deactivate swapping!
$ sudo swapoff -a
To reactivate swapping do:
$ sudo swapon -a
This script relies on wget and imagemagick. Both are easily installed I also recommend to deactivate swapping!
by your systems package-management-system. ```shell
(On Debian/Ubuntu this is "apt-get") sudo swapoff -a
```
To reactivate swapping do:
```shell
$ sudo swapon -a
```
This script relies on wget, ImageMagick and, for converting the height
maps to normal maps, on "normalmap". Some of these programs are easily
installed by your systems package-management-system.\ (On
Debian/Ubuntu this is "apt-get").
So, on Debian for instance, you only need to put the following into So, on Debian for instance, you only need to put the following into
the console: the console:
$ sudo apt-get install wget imagemagick ```shell
sudo apt-get install wget imagemagick
```
Depending on your distro, the package names might differ slightly! Use Depending on your distro, the package names might differ slightly! Use
a search engine of your choice to find out, how the packages are named a search engine of your choice to find out, how the packages are named
@@ -98,55 +125,77 @@ in your distro!
You may want to check: You may want to check:
$ apt search imagemagick ```shell
apt search imagemagick
```
### IMPORTANT!
Check out your ```/etc/ImageMagick-6/policy.xml```
On some distros, there are limits set, which will cause IM to abort
the conversion of images larger than
[rediculously small images](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860763).
Edit and set to our needs:
* width: at least 55000
* height: at least 55000
* area: less than your free RAM
### Normalmap
For normalmap, you can download and compile it from
https://github.com/planrich/normalmap
You can install the binary into your system, or just copy it next to
convert.sh - both should work.
------------------------------------ ------------------------------------
Targets: ## Targets:
world **world**\
Generates the world tiles, needed to run FG with EarthView. Generates the world tiles, needed to run FG with EarthView.
You will find the results in output/[$resolution]/*. Copy You will find the results in output/[$resolution]/\*. Copy
these into $FGDATA/Models/Astro/*. More about the installation these into $FGDATA/Models/Astro/\*. More about the installation
of these textures can be found here: of these textures can be found here:
http://wiki.flightgear.org/Earthview#Customization http://wiki.flightgear.org/Earthview#Customization
clouds **clouds**\
Generates the cloud tiles, needed to run FG with EarthView. Generates the cloud tiles, needed to run FG with EarthView.
The locations are the same as the other textures mentioned The locations are the same as the other textures mentioned
above. Note that clouds are only available with up to 8k above. Note that clouds are only available with up to 8k
resolution, due to the available data at NASA. resolution, due to the available data at NASA.
all **heights**\
Generates the height tiles, which are then converted to the
normal maps needed to run FG with EarthView. The locations are
the same as the other textures mentioned above. Note that
heights are only available with up to 8k resolution, due to the
available data at NASA.
**all**\
Converts everything needed for a full-blown earthview texture Converts everything needed for a full-blown earthview texture
set. Does the same as: set. Does the same as:
$ ./convert.sh world clouds ```./convert.sh world clouds heights```
Options: ## Options:
1k | 2k | 4k | 8k | 16k **1k | 2k | 4k | 8k | 16k**\
Lets you specify a desired resolution of the textures. Lets you specify a desired resolution of the textures.
Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is
specified, the script will generate all of the resolutions. specified, the script will generate all of the resolutions.
16k is only available for earth textures. 16k is recommended only for earth textures, it will induce
oversampling from clouds and height maps.
nasa **download**\
Causes the script to download directly from Causes the script to download the needed data, this is the
http://visibleearth.nasa.gov . If omitted the script will default behavior (and can be omitted).
download from
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
which is much faster!
Uses wget either way.
no-download **no-download**\
Causes the script to skip the download function. If you Causes the script to skip the download function. If you
already have the source images, then you don't need to already have the source images, then you don't need to
re-download them. (About 2.4GB!) re-download them. (About 2.4GB!)
If omitted, the script will download the source images from If omitted, the script will download the source images from
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z the default location.
cleanup **cleanup**\
Deletes the temporary files created during texture generation. Deletes the temporary files created during texture generation.
These can be found in tmp/ These can be found in tmp/
Note: if for some reason you later want some other resolution, Note: if for some reason you later want some other resolution,
@@ -155,13 +204,13 @@ cleanup
Frees up a lot of disk-space! Which would have to be Frees up a lot of disk-space! Which would have to be
regenerated if needed again. regenerated if needed again.
rebuild **rebuild**\
Deletes only the temporary files of the given target. So if Deletes only the temporary files of the given target. So if
you call './convert.sh rebuild world' the script will delete you call ```./convert.sh rebuild world``` the script will delete
all corresponding temp-files of the target world, which will all corresponding temp-files of the target world, which will
trigger a complete regeneration of the relevant (instead of trigger a complete regeneration of the relevant (instead of
skipping existing files) skipping existing files)
check **check**\
Creates mosaics of the tiles, so you can look at them and see Creates mosaics of the tiles, so you can look at them and see
if all went well. if all went well.
+518 -74
View File
@@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# convert.sh - a script to convert NASA sattelite images into textures for use with FGearthview (orbital rendering) # convert.sh - a script to convert NASA sattelite images into textures
# Copyright (C) 2016 Chris Schwarz <chris@musicchris.de> # for use with FGearthview (orbital rendering)
# Copyright (C) 2016 chris_blues <chris@musicchris.de>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -16,9 +17,12 @@
# You should have received a copy of the GNU General Public License along # You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc., # with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# v0.12: Chris Ringeval (eatdirt):
# -add normalmapping output + small improvements
VERSION="v0.11" VERSION="v0.13"
# make sure the script halts on error # make sure the script halts on error
set -e set -e
@@ -29,21 +33,21 @@ function showHelp
echo "https://github.com/chris-blues/Nasa2FGearthview" echo "https://github.com/chris-blues/Nasa2FGearthview"
echo echo
echo "Usage:" echo "Usage:"
echo "./convert.sh [ download world clouds 8k cleanup rebuild ]" echo "./convert.sh [ download no-download world clouds heights"
echo " 1k 2k 4k 8k 16k cleanup rebuild ]"
echo echo
echo "* Append \"nasa\" to download the needed images from NASA"
echo " -> This will download ca 2.4GB of data!"
echo " -> wget can continue interrupted downloads!"
echo " If omitted, it will download from my server, which is a lot"
echo " faster. See README for details."
echo "* Append \"no-download\" to the command to skip the download" echo "* Append \"no-download\" to the command to skip the download"
echo " process alltogether. Only makes sense if you already got" echo " process alltogether. Only makes sense if you already got"
echo " the necessary data." echo " the necessary data."
echo "* Append \"world\" to the command to generate the world tiles" echo "* Append \"world\" to the command to generate the world tiles"
echo "* Append \"clouds\" to the command to generate cloud tiles" echo "* Append \"clouds\" to the command to generate cloud tiles"
echo "* Append \"all\" to the command to generate both - world and" echo "* Append \"heights\" to the command to generate height tiles"
echo " clouds" echo " and the normalmaps needed by EarthView. Notice that you need"
echo "* Append the size of the tiles (1k, 2k, 4, 8k, 16k). If you" echo " the normalmap binary to be installed. You can get it from:"
echo " https://github.com/planrich/normalmap"
echo "* Append \"all\" to the command to generate all - world, clouds"
echo " and heights"
echo "* Append the size of the tiles (1k, 2k, 4k, 8k, 16k). If you"
echo " don't pass a resolution, then all resolutions will be" echo " don't pass a resolution, then all resolutions will be"
echo " generated." echo " generated."
echo "* Append \"cleanup\" to delete all temporary files in tmp/" echo "* Append \"cleanup\" to delete all temporary files in tmp/"
@@ -59,7 +63,7 @@ function showHelp
echo " Useful if the source files have changed." echo " Useful if the source files have changed."
echo "* Append \"check\" to let check the results. This will create" echo "* Append \"check\" to let check the results. This will create"
echo " mosaics of the existing tiles. If no target is specified," echo " mosaics of the existing tiles. If no target is specified,"
echo " all 3 layers will be built: clouds world and nightlights." echo " all layers will be built: clouds, heights, world and nightlights."
echo echo
echo "If, for some reason, the script aborts, then it will try to" echo "If, for some reason, the script aborts, then it will try to"
echo "skip the already completed steps, so you don't have to wait" echo "skip the already completed steps, so you don't have to wait"
@@ -102,11 +106,11 @@ if [ $1 == "-h" ] ; then showHelp ; fi
################################ ################################
for ARG in "$@" for ARG in "$@"
do do
if [ $ARG == "nasa" ] ; then DOWNLOAD="true" ; DL_LOCATION="NASA" ; echo "Downloading from visibleearth.nasa.gov" ; fi
if [ $ARG == "no-download" ] ; then DOWNLOAD="false" ; echo "Skipping the download process" ; fi if [ $ARG == "no-download" ] ; then DOWNLOAD="false" ; echo "Skipping the download process" ; fi
if [ $ARG == "world" ] ; then WORLD="true" ; fi if [ $ARG == "world" ] ; then WORLD="true" ; fi
if [ $ARG == "clouds" ] ; then CLOUDS="true" ; fi if [ $ARG == "clouds" ] ; then CLOUDS="true" ; fi
if [ $ARG == "all" ] ; then WORLD="true" ; CLOUDS="true" ; fi if [ $ARG == "heights" ] ; then HEIGHTS="true" ; fi
if [ $ARG == "all" ] ; then WORLD="true" ; CLOUDS="true" ; HEIGHTS="true" ; fi
if [ $ARG == "1k" ] ; then RESOLUTION="1024" ; fi if [ $ARG == "1k" ] ; then RESOLUTION="1024" ; fi
if [ $ARG == "2k" ] ; then RESOLUTION="2048" ; fi if [ $ARG == "2k" ] ; then RESOLUTION="2048" ; fi
if [ $ARG == "4k" ] ; then RESOLUTION="4096" ; fi if [ $ARG == "4k" ] ; then RESOLUTION="4096" ; fi
@@ -119,17 +123,22 @@ done
if [ -z $DOWNLOAD ] ; then DOWNLOAD="true" ; fi if [ -z $DOWNLOAD ] ; then DOWNLOAD="true" ; fi
if [ -z $WORLD ] ; then WORLD="false" ; fi if [ -z $WORLD ] ; then WORLD="false" ; fi
if [ -z $CLOUDS ] ; then CLOUDS="false" ; fi if [ -z $CLOUDS ] ; then CLOUDS="false" ; fi
if [ -z $HEIGHTS ] ; then HEIGHTS="false" ; fi
if [ -z $CLEANUP ] ; then CLEANUP="false" ; fi if [ -z $CLEANUP ] ; then CLEANUP="false" ; fi
if [ -z $REBUILD ] ; then REBUILD="false" ; fi if [ -z $REBUILD ] ; then REBUILD="false" ; fi
if [ -z $BUILDCHECKS ] ; then BUILDCHECKS="false" ; fi if [ -z $BUILDCHECKS ] ; then BUILDCHECKS="false" ; fi
CHECKWORLD=$WORLD CHECKWORLD=$WORLD
CHECKCLOUDS=$CLOUDS CHECKCLOUDS=$CLOUDS
CHECKHEIGHTS=$HEIGHTS
######################## ########################
## Set some variables ## ## Set some variables ##
######################## ########################
DL_LOCATION="NASA"
mkdir -p tmp mkdir -p tmp
export MAGICK_TMPDIR=${PWD}/tmp export MAGICK_TMPDIR=${PWD}/tmp
echo "tmp-dir: $MAGICK_TMPDIR" echo "tmp-dir: $MAGICK_TMPDIR"
@@ -139,21 +148,50 @@ TIME=$(date +"%Y-%m-%d_%H:%M:%S")
LOGFILE_GENERAL="logs/${TIME}.log" LOGFILE_GENERAL="logs/${TIME}.log"
LOGFILE_TIME="logs/${TIME}.time.log" LOGFILE_TIME="logs/${TIME}.time.log"
URLS_WORLD="http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A1.png #command line gimp plugin from https://github.com/planrich/normalmap
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A2.png #higher filters (5x5) create too sharp features (no rescaling, I
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B1.png #assume earthview do its own normalization)
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B2.png NORMALBIN="normalmap"
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C1.png NORMALOPTS="-s 1 -f FILTER_PREWITT_3x3"
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C2.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D1.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D2.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/79000/79765/dnb_land_ocean_ice.2012.54000x27000_geo.tif"
URLS_CLOUDS="http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.E.2001210.21600x21600.png URLS_WORLD="https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A1.png
http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.W.2001210.21600x21600.png" https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B1.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C1.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D1.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D2.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/79000/79765/dnb_land_ocean_ice.2012.54000x27000_geo.tif"
URLS_CLOUDS="https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.E.2001210.21600x21600.png
https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.W.2001210.21600x21600.png"
URLS_HEIGHTS="https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_A1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_A2_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_B1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_B2_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_C1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_C2_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_D1_grey_geo.tif
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_D2_grey_geo.tif"
if ! [ -x "$(command -v $NORMALBIN)" ]
then
if ! [ -x "./${NORMALBIN}" ]
then
echo ">>>>>>>>>>>> Error: $NORMALBIN binary not found! <<<<<<<<<<<<<"
echo "You can get it from: https://github.com/planrich/normalmap"
HEIGHTS="false"
else
NORMALBIN="./${NORMALBIN}"
fi
else
echo ">>>>>>>>>>>> Error: $NORMALBIN binary not found! <<<<<<<<<<<<<"
echo "You can get it from: https://github.com/planrich/normalmap"
HEIGHTS="false"
fi
ALTERNATE_URL="https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z"
ALTERNATE_FILENAME="raw-data-NASA.7z"
if [ -z $RESOLUTION ] if [ -z $RESOLUTION ]
then then
@@ -162,7 +200,7 @@ if [ -z $RESOLUTION ]
4096 4096
8192 8192
16384" 16384"
NO_RESOLUTION_GIVEN="true" NO_RESOLUTION_GIVEN="false"
RESOLUTION_MAX="16384" RESOLUTION_MAX="16384"
fi fi
if [ -z $RESOLUTION_MAX ] ; then RESOLUTION_MAX=$RESOLUTION ; fi if [ -z $RESOLUTION_MAX ] ; then RESOLUTION_MAX=$RESOLUTION ; fi
@@ -236,6 +274,18 @@ function rebuild
rm tmp/cloud* rm tmp/cloud*
} }
fi fi
if [ $HEIGHTS == "true" ]
then
{
echo
echo "#########################################"
echo "## Removing tmp-files of target heights##"
echo "#########################################"
rm tmp/height*
}
fi
} }
function cleanUp function cleanUp
@@ -244,9 +294,10 @@ function cleanUp
echo "############################" echo "############################"
echo "## Removing all tmp-files ##" echo "## Removing all tmp-files ##"
echo "############################" echo "############################"
rm -rv tmp/night* rm -rvf tmp/night*
rm -rv tmp/world* rm -rvf tmp/world*
rm -rv tmp/clouds* rm -rvf tmp/cloud*
rm -rvf tmp/height*
} }
function prettyTime function prettyTime
@@ -312,13 +363,18 @@ function downloadImages
{ {
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
echo "###################################################" | tee -a $LOGFILE_GENERAL echo "###################################################" | tee -a $LOGFILE_GENERAL
if [ ! -z $DL_LOCATION ] if [ -z $DL_LOCATION ]
then echo "## Downloading images from visibleearth.nasa.gov ##" | tee -a $LOGFILE_GENERAL then
else echo "## Downloading images from musicchris.de ##" | tee -a $LOGFILE_GENERAL DL_LOCATION="NASA"
fi fi
if [ $DL_LOCATION == "NASA" ]
then
echo "## Downloading images from visibleearth.nasa.gov ##" | tee -a $LOGFILE_GENERAL
fi
echo "###################################################" | tee -a $LOGFILE_GENERAL echo "###################################################" | tee -a $LOGFILE_GENERAL
if [ -z $DL_LOCATION ] ; then f=$ALTERNATE_URL ; DL_LOCATION="musicchris.de" ; fi
FILENAME=$(echo $f | sed 's@.*/@@')
if [ $WORLD == "true" ] if [ $WORLD == "true" ]
then then
if [ $DL_LOCATION == "NASA" ] if [ $DL_LOCATION == "NASA" ]
@@ -335,7 +391,13 @@ function downloadImages
fi fi
fi fi
if [ $DL_LOCATION == "musicchris.de" ] ; then downloadMusicchris ; fi if [ $HEIGHTS == "true" ]
then
if [ $DL_LOCATION == "NASA" ]
then
downloadHeights
fi
fi
} }
function downloadWorld function downloadWorld
@@ -345,10 +407,23 @@ function downloadWorld
for f in $URLS_WORLD for f in $URLS_WORLD
do do
FILENAME=$(echo $f | sed 's@.*/@@') FILENAME=$(echo $f | sed 's@.*/@@')
wget --output-document=input/$FILENAME --continue --show-progress $f 2>> $LOGFILE_GENERAL wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done done
} }
function downloadHeights
{
mkdir -p input
echo "Downloading height tiles..." | tee -a $LOGFILE_GENERAL
for f in $URLS_HEIGHTS
do
FILENAME=$(echo $f | sed 's@.*/@@')
wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done
}
function downloadClouds function downloadClouds
{ {
mkdir -p input mkdir -p input
@@ -356,24 +431,10 @@ function downloadClouds
for f in $URLS_CLOUDS for f in $URLS_CLOUDS
do do
FILENAME=$(echo $f | sed 's@.*/@@') FILENAME=$(echo $f | sed 's@.*/@@')
wget --output-document=input/$FILENAME --continue --show-progress $f 2>> $LOGFILE_GENERAL wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done done
} }
function downloadMusicchris
{
mkdir -p input
echo "Downloading raw images... (ca 2.2 GB)" | tee -a $LOGFILE_GENERAL
for p in 1 2 3 4 5
do
wget --output-document=input/${FILENAME}.00${p} --continue --show-progress $ALTERNATE_URL | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
done
echo "Unpacking raw images..." | tee -a $LOGFILE_GENERAL
cd input
7z e -bt -y raw-data-NASA.7z 2>> $LOGFILE_GENERAL
cd ..
}
function generateWorld function generateWorld
{ {
STARTTIME=$(date +%s) STARTTIME=$(date +%s)
@@ -419,7 +480,7 @@ function generateWorld
let "RESIZE_H = ( $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH ) ) * 2" let "RESIZE_H = ( $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH ) ) * 2"
if [ ! -s "tmp/nightlights_${RESIZE_W}x${RESIZE_H}.mpc" ] if [ ! -s "tmp/nightlights_${RESIZE_W}x${RESIZE_H}.mpc" ]
then then
for r in 16384 8192 4096 2048 for r in $RESOLUTION
do do
if [ $r -le $RESOLUTION_MAX ] if [ $r -le $RESOLUTION_MAX ]
then continue then continue
@@ -553,7 +614,7 @@ function generateWorld
do do
NASA2FG $t NASA2FG $t
FOUND_BIGGER_WORLD_PICTURE="false" FOUND_BIGGER_WORLD_PICTURE="false"
unset $TIMESAVER_SIZE unset TIMESAVER_SIZE
if [ ! -s "tmp/world_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ] if [ ! -s "tmp/world_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ]
then then
{ {
@@ -825,6 +886,10 @@ function generateWorld
echo echo
echo "--> Writing output/${r}/world_${t}.dds @ ${r}x${r}" echo "--> Writing output/${r}/world_${t}.dds @ ${r}x${r}"
# set -x # set -x
if [ ! -s "output/${r}/world_${t}.dds" ]
then
convert \ convert \
-monitor \ -monitor \
tmp/world_${RESOLUTION_MAX}_done_${t}.mpc \ tmp/world_${RESOLUTION_MAX}_done_${t}.mpc \
@@ -834,7 +899,15 @@ function generateWorld
output/${r}/world_${t}.dds output/${r}/world_${t}.dds
set +x set +x
echo echo
else echo "=> Skipping existing file: output/${r}/world_${t}.dds" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
echo "--> Writing output/${r}/world_${t}.png @ ${r}x${r}" echo "--> Writing output/${r}/world_${t}.png @ ${r}x${r}"
if [ ! -s "output/${r}/world_${t}.png" ]
then
# set -x # set -x
convert \ convert \
-monitor \ -monitor \
@@ -843,6 +916,10 @@ function generateWorld
output/${r}/world_${t}.png output/${r}/world_${t}.png
set +x set +x
echo echo
else echo "=> Skipping existing file: output/${r}/world_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
} }
done done
@@ -874,7 +951,11 @@ function generateClouds
{ {
if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi
# maximum cloud-tile resolution is 8192, since we have no big enough source files... # maximum cloud-tile resolution is 8192, since we have no big enough source files...
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128" let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )" let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1" let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
@@ -1071,7 +1152,9 @@ W"
echo "## propagate last pixels to the edge ##" | tee -a $LOGFILE_GENERAL echo "## propagate last pixels to the edge ##" | tee -a $LOGFILE_GENERAL
echo "#######################################" | tee -a $LOGFILE_GENERAL echo "#######################################" | tee -a $LOGFILE_GENERAL
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128" let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )" let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1" let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
@@ -1190,23 +1273,22 @@ W"
for r in $RESOLUTION for r in $RESOLUTION
do do
{ {
if [ $r -eq 16384 ]
then
if [ $NO_RESOLUTION_GIVEN == "true" ]
then
continue
else
r=8192
fi
fi
mkdir -p output/$r mkdir -p output/$r
echo
if [ ! -s "output/${r}/clouds_${t}.png" ]
then
echo "--> Writing output/${r}/clouds_${t}.png @ ${r}x${r}" | tee -a $LOGFILE_GENERAL echo "--> Writing output/${r}/clouds_${t}.png @ ${r}x${r}" | tee -a $LOGFILE_GENERAL
convert \ convert \
-monitor \ -monitor \
tmp/clouds_${RESOLUTION_MAX}_${t}_done.mpc \ tmp/clouds_${RESOLUTION_MAX}_${t}_done.mpc \
-resize ${r}x${r} \ -resize ${r}x${r} \
output/${r}/clouds_${t}.png output/${r}/clouds_${t}.png
echo
else echo "=> Skipping existing file: output/${r}/clouds_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
} }
done done
@@ -1231,6 +1313,322 @@ W"
echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
} }
function generateHeights
{
if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi
echo | tee -a $LOGFILE_GENERAL
echo "################################" | tee -a $LOGFILE_GENERAL
echo "#### Processing Heights ####" | tee -a $LOGFILE_GENERAL
echo "################################" | tee -a $LOGFILE_GENERAL
echo | tee -a $LOGFILE_GENERAL
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
let "IMAGE_WITH_BORDER_POS = $RESOLUTION_MAX - $BORDER_WIDTH"
let "SIZE = 2 * $IMAGE_BORDERLESS"
mkdir -p tmp
mkdir -p output
echo "################################################" | tee -a $LOGFILE_GENERAL
echo "## Resize the NASA-Originals to ${RESOLUTION_MAX}-(2*${BORDER_WIDTH}) ##" | tee -a $LOGFILE_GENERAL
echo "################################################" | tee -a $LOGFILE_GENERAL
for t in $NASA
do
NASA2FG $t
FOUND_BIGGER_WORLD_PICTURE="false"
unset TIMESAVER_SIZE
if [ ! -s "tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ]
then
{
for r in $RESOLUTION
do
if [ $r -le $RESOLUTION_MAX ]
then
continue
fi
let "IMAGE_SIZE = $r - ( 2 * ( $r / 128 ) )"
let "I_W = $IMAGE_SIZE * 4"
let "I_H = $IMAGE_SIZE * 2"
if [ -s tmp/heights_seamless_${IMAGE_SIZE}_${DEST}.mpc ]
then
if [ $IMAGE_SIZE -ge $IMAGE_BORDERLESS ]
then
FOUND_BIGGER_WORLD_PICTURE="true"
TIMESAVER_SIZE="$IMAGE_SIZE"
fi
fi
done
if [ $FOUND_BIGGER_WORLD_PICTURE != "true" ]
then
# set -x
convert \
-monitor \
-limit memory 32 \
-limit map 32 \
input/gebco_08_rev_elev_${t}_grey_geo.tif \
-resize ${IMAGE_BORDERLESS}x${IMAGE_BORDERLESS} \
tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc
set +x
else
echo "==> Timesaver:) Using existing file: tmp/heights_seamless_${TIMESAVER_SIZE}_${DEST}.mpc -> tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" | tee -a $LOGFILE_GENERAL
set -x
convert \
-monitor \
-limit memory 32 \
-limit map 32 \
tmp/heights_seamless_${TIMESAVER_SIZE}_${DEST}.mpc \
-resize ${IMAGE_BORDERLESS}x${IMAGE_BORDERLESS} \
tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc
set +x
fi
}
else echo "=> Skipping existing file: tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
done
# 3h, 12m, 9s
if [ -z $LASTTIME ] ; then LASTTIME=$STARTTIME ; fi
echo "input/gebco_08_rev_elev_[A-D][12]_grey_geo.tif -> tmp/heights_seamless_${IMAGE_BORDERLESS}_[NS][1-4].mpc" >> $LOGFILE_TIME
getProcessingTime
echo | tee -a $LOGFILE_GENERAL
echo "#####################################" | tee -a $LOGFILE_GENERAL
echo "## Put a ${BORDER_WIDTH}px border to each side ##" | tee -a $LOGFILE_GENERAL
echo "#####################################" | tee -a $LOGFILE_GENERAL
for t in $TILES
do
if [ ! -s "tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc" ]
then
# set -x
convert \
-monitor \
tmp/heights_seamless_${IMAGE_BORDERLESS}_${t}.mpc \
-bordercolor none \
-border ${BORDER_WIDTH} \
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc
set +x
echo
fi
if [ ! -s "tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc" ]
then
# set -x
cp tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
cp tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.cache tmp/heights_seams_${RESOLUTION_MAX}_${t}.cache
set +x
else echo "=> Skipping existing file: tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
done
# 11m, 24s
echo "-> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4]_emptyBorder.mpc -> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4].mpc" >> $LOGFILE_TIME
getProcessingTime
echo | tee -a $LOGFILE_GENERAL
echo "######################################################" | tee -a $LOGFILE_GENERAL
echo "## crop borderline pixels and propagate to the edge ##" | tee -a $LOGFILE_GENERAL
echo "######################################################" | tee -a $LOGFILE_GENERAL
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
fi
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
let "IMAGE_WITH_BORDER_POS = $RESOLUTION_MAX - $BORDER_WIDTH"
let "SIZE = 2 * $IMAGE_BORDERLESS"
CROP_TOP="${IMAGE_BORDERLESS}x1+${BORDER_WIDTH}+${BORDER_WIDTH}"
CROP_RIGHT="1x${IMAGE_BORDERLESS}+${IMAGE_WITH_BORDER}+${BORDER_WIDTH}"
CROP_BOTTOM="${IMAGE_BORDERLESS}x1+${BORDER_WIDTH}+${IMAGE_WITH_BORDER}"
CROP_LEFT="1x${IMAGE_BORDERLESS}+${BORDER_WIDTH}+${BORDER_WIDTH}"
CROP_TOPLEFT="1x1+${BORDER_WIDTH}+${BORDER_WIDTH}"
CROP_TOPRIGHT="1x1+${IMAGE_WITH_BORDER}+${BORDER_WIDTH}"
CROP_BOTTOMRIGHT="1x1+${IMAGE_WITH_BORDER}+${IMAGE_WITH_BORDER}"
CROP_BOTTOMLEFT="1x1+${BORDER_WIDTH}+${IMAGE_WITH_BORDER}"
## HORIZ meaning a horizontal bar, like the one on top
HORIZ_RESIZE="${IMAGE_BORDERLESS}x${BORDER_WIDTH}"
VERT_RESIZE="${BORDER_WIDTH}x${IMAGE_BORDERLESS}"
POS_TOP="+${BORDER_WIDTH}+0"
POS_RIGHT="+${IMAGE_WITH_BORDER_POS}+${BORDER_WIDTH}"
POS_BOTTOM="+${BORDER_WIDTH}+${IMAGE_WITH_BORDER_POS}"
POS_LEFT="+0+${BORDER_WIDTH}"
for t in $TILES
do
if [ ! -s "tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" ]
then
for b in $BORDERS
do
{
if [ $b == "top" ]
then
CROP=$CROP_TOP
RESIZE=$HORIZ_RESIZE
POSITION=$POS_TOP
CROPCORNER=$CROP_TOPRIGHT
CORNER_POS="+${IMAGE_WITH_BORDER_POS}+0"
CORNER_NAME="topRight"
fi
if [ $b == "right" ]
then
CROP=$CROP_RIGHT
RESIZE=$VERT_RESIZE
POSITION=$POS_RIGHT
CROPCORNER=$CROP_BOTTOMRIGHT
CORNER_POS="+${IMAGE_WITH_BORDER_POS}+${IMAGE_WITH_BORDER_POS}"
CORNER_NAME="bottomRight"
fi
if [ $b == "bottom" ]
then
CROP=$CROP_BOTTOM
RESIZE=$HORIZ_RESIZE
POSITION=$POS_BOTTOM
CROPCORNER=$CROP_BOTTOMLEFT
CORNER_POS="+0+${IMAGE_WITH_BORDER_POS}"
CORNER_NAME="bottomLeft"
fi
if [ $b == "left" ]
then
CROP=$CROP_LEFT
RESIZE=$VERT_RESIZE
POSITION=$POS_LEFT
CROPCORNER=$CROP_TOPLEFT
CORNER_POS="+0+0"
CORNER_NAME="topLeft"
fi
echo
# set -x
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc \
-crop $CROP \
-resize $RESIZE\! \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${b}.mpc
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc \
-crop $CROPCORNER \
-resize ${BORDER_WIDTH}x${BORDER_WIDTH}\! \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${CORNER_NAME}.mpc
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${b}.mpc \
-geometry $POSITION \
-composite \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
echo
convert \
-monitor \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc \
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${CORNER_NAME}.mpc \
-geometry $CORNER_POS \
-composite \
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
set +x
echo
}
done
echo
# set -x
cp -v tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc | tee -a $LOGFILE_GENERAL
cp -v tmp/heights_seams_${RESOLUTION_MAX}_${t}.cache tmp/heights_${RESOLUTION_MAX}_done_${t}.cache | tee -a $LOGFILE_GENERAL
set +x
else echo "=> Skipping existing file: tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
done
# 37m, 6s
echo "-> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4].mpc -> tmp/heights_${RESOLUTION_MAX}_done_[NS][1-4].mpc" >> $LOGFILE_TIME
getProcessingTime
for t in $TILES
do
echo | tee -a $LOGFILE_GENERAL
echo "#############################" | tee -a $LOGFILE_GENERAL
echo "## Final output of tile $t ##" | tee -a $LOGFILE_GENERAL
echo "## and normalmapping ##" | tee -a $LOGFILE_GENERAL
echo "#############################" | tee -a $LOGFILE_GENERAL
for r in $RESOLUTION
do
{
mkdir -p output/$r
set +x
echo
echo "--> Writing output/${r}/heights_${t}.png @ ${r}x${r}"
# set -x
if [ ! -s "output/${r}/heights_${t}.png" ]
then
convert \
-monitor \
tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc \
-resize ${r}x${r} \
output/${r}/heights_${t}.png
echo
else echo "=> Skipping existing file: tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
echo "--> Writing output/${r}/normalmap_earth_${t}.png @ ${r}x${r}"
if [ ! -s "output/${r}/normalmap_earth_${t}.png" ]
then
$NORMALBIN $NORMALOPTS output/${r}/heights_${t}.png output/${r}/normalmap_earth_${t}.png
else echo "=> Skipping existing file: output/${r}/normalmap_earth_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
fi
set +x
echo
}
done
echo | tee -a $LOGFILE_GENERAL
echo "Heights and Normal $t [ done ]" | tee -a $LOGFILE_GENERAL
echo | tee -a $LOGFILE_GENERAL
done
echo "###############################" | tee -a $LOGFILE_GENERAL
echo "#### Heights: [ done ] ####" | tee -a $LOGFILE_GENERAL
echo "###############################" | tee -a $LOGFILE_GENERAL
# 2h, 19m, 7s
# Overall processing time: 44089 s
# Overall processing time: 0 d, 2 h, 19 m, 7 s
echo "-> output/<\$RESOLUTIONS>/heights_[NS][1-4].png" >> $LOGFILE_TIME
getProcessingTime
echo
if [ $STARTTIME -eq $ENDTIME ]
then SECS=0
else let "SECS = $ENDTIME - $STARTTIME"
fi
echo "Overall processing time: $SECS s" | tee -a $LOGFILE_GENERAL
prettyTime
echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL
}
function checkResults function checkResults
{ {
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
@@ -1251,7 +1649,7 @@ function checkResults
let "HEIGHT = 2 * $RES" let "HEIGHT = 2 * $RES"
echo "Lowest available resolution is: $RES" | tee -a $LOGFILE_GENERAL echo "Lowest available resolution is: $RES" | tee -a $LOGFILE_GENERAL
if [ $CHECKCLOUDS == "true" ] if [[ $CHECKCLOUDS == "true" ]]
then then
{ {
echo "checking clouds..." | tee -a $LOGFILE_GENERAL echo "checking clouds..." | tee -a $LOGFILE_GENERAL
@@ -1292,7 +1690,51 @@ function checkResults
} }
fi fi
if [ $CHECKWORLD == "true" ]
if [[ $CHECKHEIGHTS == "true" ]]
then
{
echo "checking heights..." | tee -a $LOGFILE_GENERAL
echo | tee -a $LOGFILE_GENERAL
echo "Creating canvas ${WIDTH}x${HEIGHT}" | tee -a $LOGFILE_GENERAL
convert \
-size ${WIDTH}x${HEIGHT} \
xc:Black \
-alpha on \
check_heights.png
POS=0
for t in 1 2 3 4
do
convert \
-monitor \
check_heights.png \
output/${RES}/heights_N${t}.png \
-geometry +${POS}+0 \
-composite \
check_heights.png
echo
convert \
-monitor \
check_heights.png \
output/${RES}/heights_S${t}.png \
-geometry +${POS}+${RES} \
-composite \
check_heights.png
echo
let "POS += $RES"
done
mogrify \
-monitor \
-resize 4096x2048 \
check_heights.png
}
fi
if [[ $CHECKWORLD == "true" ]]
then then
{ {
echo "checking world..." | tee -a $LOGFILE_GENERAL echo "checking world..." | tee -a $LOGFILE_GENERAL
@@ -1366,6 +1808,7 @@ echo $TIME | tee -a $LOGFILE_TIME
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
printf "Target: " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME printf "Target: " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
if [ $CLOUDS == "true" ] ; then printf "clouds " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi if [ $CLOUDS == "true" ] ; then printf "clouds " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
if [ $HEIGHTS == "true" ] ; then printf "heights " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
if [ $WORLD == "true" ] ; then printf "world " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi if [ $WORLD == "true" ] ; then printf "world " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
echo | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME echo | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
echo "Will work in ${RESOLUTION_MAX}x${RESOLUTION_MAX} resolution and will output" | tee -a $LOGFILE_GENERAL echo "Will work in ${RESOLUTION_MAX}x${RESOLUTION_MAX} resolution and will output" | tee -a $LOGFILE_GENERAL
@@ -1377,12 +1820,13 @@ echo "--------------------------------------------------------------" | tee -a $
echo | tee -a $LOGFILE_GENERAL echo | tee -a $LOGFILE_GENERAL
if [ $REBUILD == "true" ] ; then rebuild ; fi if [[ $REBUILD == "true" ]] ; then rebuild ; fi
if [ $DOWNLOAD == "true" ] ; then downloadImages ; fi if [[ $DOWNLOAD == "true" ]] ; then downloadImages ; fi
if [ $WORLD == "true" ] ; then generateWorld ; fi if [[ $WORLD == "true" ]] ; then generateWorld ; fi
if [ $CLOUDS == "true" ] ; then generateClouds ; fi if [[ $CLOUDS == "true" ]] ; then generateClouds ; fi
if [ $BUILDCHECKS == "true" ] ; then checkResults ; fi if [[ $HEIGHTS == "true" ]]; then generateHeights; fi
if [ $CLEANUP == "true" ] ; then cleanUp ; fi if [[ $BUILDCHECKS == "true" ]] ; then checkResults ; fi
if [[ $CLEANUP == "true" ]] ; then cleanUp ; fi
+1 -1
View File
@@ -41,7 +41,7 @@ cp simgear-*.tar.bz2 ../output/.
##################################################################################### #####################################################################################
echo "Starting on FlightGear" echo "Starting on FlightGear"
cd ../fgBuild cd ../fgBuild
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" -DFG_BUILD_TYPE=Release ../flightgear cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" -DENABLE_SWIFT:BOOL=ON -DFG_BUILD_TYPE=Release ../flightgear
# compile # compile
make make
+42 -9
View File
@@ -20,6 +20,8 @@ SET OSG64=%WORKSPACE%\install\msvc140-64\OpenSceneGraph
REM 32bits REM 32bits
md build-sg32 md build-sg32
md build-fg32 md build-fg32
md build-fg32-compositor
cd build-sg32 cd build-sg32
cmake ..\simgear -G "Visual Studio 14" ^ cmake ..\simgear -G "Visual Studio 14" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^ -DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
@@ -33,11 +35,24 @@ cd ..\build-fg32
cmake ..\flightgear -G "Visual Studio 14" ^ cmake ..\flightgear -G "Visual Studio 14" ^
-DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^ -DMSVC_3RDPARTY_ROOT=%WORKSPACE%/windows-3rd-party/msvc140 ^
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140 ^ -DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140 ^
-DCMAKE_PREFIX_PATH:PATH=%WORKSPACE%/install/msvc140/OpenSceneGraph ^
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^ -DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^ -DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^ -DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^
-DFG_BUILD_TYPE=%FGBUILDTYPE% -DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON ^
-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 cmake --build . --config RelWithDebInfo --target INSTALL
cd .. cd ..
@@ -45,6 +60,7 @@ cd ..
REM 64 bits REM 64 bits
md build-sg64 md build-sg64
md build-fg64 md build-fg64
md build-fg64-compositor
cd build-sg64 cd build-sg64
cmake ..\SimGear -G "Visual Studio 14 Win64" ^ 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_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64 ^
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^ -DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^
-DOSG_FSTREAM_EXPORT_FIXED=1 ^ -DOSG_FSTREAM_EXPORT_FIXED=1 ^
-DFG_BUILD_TYPE=%FGBUILDTYPE% -DFG_BUILD_TYPE=%FGBUILDTYPE% ^
-DENABLE_SWIFT:BOOL=ON ^
-DENABLE_COMPOSITOR:BOOL=OFF
cmake --build . --config RelWithDebInfo --target INSTALL 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 .. cd ..
REM Qt5 deployment REM Qt5 deployment
SET QMLDIR=%WORKSPACE%/flightgear/src/GUI/qml 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/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/bin/fgfs.exe
%QT5SDK64%\bin\windeployqt --release --list target --qmldir %QMLDIR% %WORKSPACE%/install/msvc140-64/compositor/bin/fgfs.exe
REM build setup REM build setup
ECHO Packaging root is %WORKSPACE% 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 REM ensure output dir is clean since we upload the entirety of it
rmdir /S /Q output rmdir /S /Q output
SET CRASHFIX_UPLOAD_URL=http://crashes.flightgear.org/index.php/debugInfo/uploadExternal
SET FGFS_PDB=src\Main\RelWithDebInfo\fgfs.pdb 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 SET SENTRY_ORG=flightgear
copy %WORKSPACE%\build-fg64\%FGFS_PDB% %WORKSPACE%\Output\fgfs_64.pdb SET SENTRY_PROJECT=flightgear
copy %WORKSPACE%\build-fg32\%FGFS_PDB% %WORKSPACE%\Output\fgfs_32.pdb REM ensure SENTRY_AUTH_TOKEN is set in the environment
sentry-cli upload-dif %WORKSPACE%\build-fg32\%FGFS_PDB%
sentry-cli upload-dif %WORKSPACE%\build-fg64\%FGFS_PDB%
sentry-cli upload-dif %WORKSPACE%\build-fg32-compositor\%FGFS_PDB%
sentry-cli upload-dif %WORKSPACE%\build-fg64-compositor\%FGFS_PDB%
REM indirect way to get command output into an environment variable REM indirect way to get command output into an environment variable
set PATH=%OSG32%\bin;%PATH% set PATH=%OSG32%\bin;%PATH%
+63
View 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.
+158 -9
View File
@@ -2,17 +2,29 @@
import argparse import argparse
import datetime import datetime
import xml.etree.cElementTree as ET from fnmatch import fnmatch, translate
import lxml.etree as ET
import os import os
from os.path import exists, join, relpath
from os import F_OK, access, walk
import re import re
import sgprops import sgprops
import sys import sys
import catalogTags import catalogTags
import zipfile
CATALOG_VERSION = 4 CATALOG_VERSION = 4
quiet = False quiet = False
verbose = 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): def warning(msg):
if not quiet: if not quiet:
print(msg) print(msg)
@@ -100,7 +112,7 @@ def scan_set_file(aircraft_dir, set_file, includes):
if sim_node.hasChild('minimum-fg-version'): if sim_node.hasChild('minimum-fg-version'):
variant['minimum-fg-version'] = sim_node.getValue('minimum-fg-version', None) variant['minimum-fg-version'] = sim_node.getValue('minimum-fg-version', None)
#print ' ', variant #print(" %s" % variant)
return variant return variant
def extract_previews(previews_node, aircraft_dir): def extract_previews(previews_node, aircraft_dir):
@@ -139,13 +151,13 @@ def scan_aircraft_dir(aircraft_dir, includes):
files = os.listdir(aircraft_dir) files = os.listdir(aircraft_dir)
for file in sorted(files, key=lambda s: s.lower()): for file in sorted(files, key=lambda s: s.lower()):
if file.endswith('-set.xml'): if file.endswith('-set.xml'):
# print 'trying:', file # print('trying: %s' % file)
try: try:
d = scan_set_file(aircraft_dir, file, includes) d = scan_set_file(aircraft_dir, file, includes)
if d == None: if d == None:
continue continue
except: 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 continue
setDicts.append(d) setDicts.append(d)
@@ -155,13 +167,13 @@ def scan_aircraft_dir(aircraft_dir, includes):
elif d['variant-of'] == None: elif d['variant-of'] == None:
primaryAircraft.append(d) primaryAircraft.append(d)
# print setDicts # print(setDicts)
if len(setDicts) == 0: if len(setDicts) == 0:
return None, None return None, None
# use the first one # use the first one
if len(primaryAircraft) == 0: 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]] primaryAircraft = [setDicts[0]]
package = primaryAircraft[0] package = primaryAircraft[0]
@@ -212,9 +224,9 @@ def append_author_nodes(node, info):
# traditional single author string # traditional single author string
node.append( make_xml_leaf('author', info['author']) ) node.append( make_xml_leaf('author', info['author']) )
def make_aircraft_node(aircraftDirName, package, variants, downloadBase): def make_aircraft_node(aircraftDirName, package, variants, downloadBase, mirrors):
#print "package:", package #print("package: %s" % package)
#print "variants:", variants #print("variants: %s" % variants)
package_node = ET.Element('package') package_node = ET.Element('package')
package_node.append( make_xml_leaf('name', package['name']) ) package_node.append( make_xml_leaf('name', package['name']) )
package_node.append( make_xml_leaf('status', package['status']) ) package_node.append( make_xml_leaf('status', package['status']) )
@@ -261,9 +273,15 @@ def make_aircraft_node(aircraftDirName, package, variants, downloadBase):
package_node.append( make_xml_leaf('dir', aircraftDirName) ) package_node.append( make_xml_leaf('dir', aircraftDirName) )
# primary URL is first
download_url = downloadBase + aircraftDirName + '.zip' download_url = downloadBase + aircraftDirName + '.zip'
package_node.append( make_xml_leaf('url', download_url) ) package_node.append( make_xml_leaf('url', download_url) )
for m in mirrors:
mu = m + aircraftDirName + '.zip'
package_node.append( make_xml_leaf('url', mu) )
if 'thumbnail' in package: if 'thumbnail' in package:
thumbnail_url = downloadBase + 'thumbnails/' + aircraftDirName + '_' + package['thumbnail'] thumbnail_url = downloadBase + 'thumbnails/' + aircraftDirName + '_' + package['thumbnail']
package_node.append( make_xml_leaf('thumbnail', thumbnail_url) ) package_node.append( make_xml_leaf('thumbnail', thumbnail_url) )
@@ -279,3 +297,134 @@ def make_aircraft_node(aircraftDirName, package, variants, downloadBase):
package_node.append(package['urls']._createXMLElement()) package_node.append(package['urls']._createXMLElement())
return package_node 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')
+18
View File
@@ -11,12 +11,16 @@ aircraftTypeTags = [
"glider", "glider",
"groundvehicle", "groundvehicle",
"helicopter", "helicopter",
"interceptor",
"passenger",
"racer", "racer",
"spaceship", "spaceship",
"tanker", "tanker",
"trainer", "trainer",
"transport", "transport",
"ultralight", "ultralight",
"unpowered",
"uav",
"reconnaissance", "reconnaissance",
"seacraft", "seacraft",
"crop-duster", "crop-duster",
@@ -26,8 +30,10 @@ aircraftTypeTags = [
manufacturerTags = [ manufacturerTags = [
"airbus", "airbus",
"antonov", "antonov",
"arado",
"atr", "atr",
"avro", "avro",
"bae",
"bell", "bell",
"bleriot", "bleriot",
"boeing", "boeing",
@@ -53,6 +59,7 @@ manufacturerTags = [
"heinkel", "heinkel",
"ilyushin", "ilyushin",
"junkers", "junkers",
"kawasaki",
"lockheed", "lockheed",
"mc-donnell-douglas", "mc-donnell-douglas",
"messerschmitt", "messerschmitt",
@@ -64,6 +71,7 @@ manufacturerTags = [
"piper", "piper",
"republic", "republic",
"robin", "robin",
"rockwell",
"saab", "saab",
"short", "short",
"sopwith", "sopwith",
@@ -73,6 +81,7 @@ manufacturerTags = [
"tupolev", "tupolev",
"vickers", "vickers",
"vought", "vought",
"wright",
"yakovlev" "yakovlev"
] ]
@@ -105,6 +114,7 @@ featureTags = [
"biplane", "biplane",
"canard", "canard",
"castering-wheel", "castering-wheel",
"combat",
"delta", "delta",
"etops", "etops",
"experimental", "experimental",
@@ -112,10 +122,14 @@ featureTags = [
"fixed-gear", "fixed-gear",
"floats", "floats",
"glass-cockpit", "glass-cockpit",
"low-wing",
"mid-wing",
"high-wing", "high-wing",
"h-tail", "h-tail",
"hud", "hud",
"ifr", "ifr",
"lifting-body",
"pressurised",
"prototype", "prototype",
"refuel", "refuel",
"retractable-gear", "retractable-gear",
@@ -123,15 +137,18 @@ featureTags = [
"skis", "skis",
"stol", "stol",
"supersonic", "supersonic",
"supercharger",
"t-tail", "t-tail",
"tail-dragger", "tail-dragger",
"tricycle", "tricycle",
"tail-hook", "tail-hook",
"triplane", "triplane",
"twin-boom",
"v-tail", "v-tail",
"variable-geometry", "variable-geometry",
"vtol", "vtol",
"wing-fold" "wing-fold"
"water-drop"
] ]
propulsionTags = [ propulsionTags = [
@@ -147,6 +164,7 @@ propulsionTags = [
"supercharged", "supercharged",
"turboprop", "turboprop",
"twin-engine", "twin-engine",
"four-engine",
"variable-pitch", "variable-pitch",
"fixed-pitch" "fixed-pitch"
] ]
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<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>
<path>/home/fgaddon/fgaddon-trunk/Aircraft</path>
<skip>NTPS</skip>
<skip>c172</skip>
<skip>tu134</skip>
</scm>
<include-dir>/home/fgaddon/fgdata</include-dir>
<include-dir>/home/fgaddon/fgaddon-trunk</include-dir>
<!-- <scm>
<type>git</type>
<update type="bool">false</update>
<path>/Users/jmt/FGFS/fgdata</path>
<url>git://git.code.sf.net/p/flightgear/fgdata</url>
</scm> -->
<upload n="0">
<enabled type="bool">true</enabled>
<type>rsync-ssh</type>
<remote>ibiblio:/public/mirrors/flightgear/ftp/Aircraft</remote>
</upload>
</PropertyList>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<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>
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/catalog.xml</url>
<name>FlightGear aircraft distribution from fgaddon</name>
<description>This hangar provides aircraft officially supported and maintained by the FlightGear project,
under a free-software license. It tracks latest aircraft developments in the FGaddon repository.</description>
<!-- <de>
<description>Auf Deutsch</description>
</de>
<fr>
<description>En Francais</description>
</fr> -->
</template>
</PropertyList>
@@ -0,0 +1,11 @@
*/.svn/*
*.xcf*
*.XCF*
*.blend*
*.psd
*~
*/dev/*
*/Dev/*
*/development/*
*/src/*
*/Resources/*
+8 -2
View File
@@ -1,5 +1,11 @@
*/.svn/* */.svn/*
*.xcf *.xcf*
*.blend *.XCF*
*.blend*
*.psd *.psd
*~ *~
*/dev/*
*/Dev/*
*/development/*
*/src/*
*/Resources/*
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<local-output>/home/fgaddon/output/Aircraft</local-output>
<download-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft/</download-url>
<download-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft/</download-url>
<thumbnail-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft/thumbnails</thumbnail-url>
<thumbnail-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft/thumbnails</thumbnail-url>
<scm>
<type>svn</type>
<path>/home/fgaddon/fgaddon-legacy/Aircraft</path>
<skip>NTPS</skip>
<skip>c172</skip>
<skip>tu134</skip>
</scm>
<include-dir>/home/fgaddon/fgdata-legacy</include-dir>
<include-dir>/home/fgaddon/fgaddon-legacy</include-dir>
<upload n="0">
<enabled type="bool">true</enabled>
<type>rsync-ssh</type>
<remote>ibiblio:/public/mirrors/flightgear/ftp/Aircraft-legacy</remote>
</upload>
</PropertyList>
+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<template>
<version n="0">3.4.*</version>
<version n="1">3.5.*</version>
<version n="2">3.6.*</version>
<version n="3">3.7.*</version>
<version n="5">2016.*.*</version>
<version n="6">2017.*.*</version>
<version n="7">2018.*.*</version>
<!-- the legacy catalog has to have this ID, becuase this is what older FG
clients expect -->
<id>org.flightgear.fgaddon</id>
<license>GPL</license>
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft/catalog.xml</url>
<name>FlightGear aircraft(legacy support)</name>
<description>This hangar provides aircraft officially supported and maintained by the
FlightGear project, under a free-software license. Aircraft are intended for
use with FlightGear versions 2018.2 and older.</description>
<!-- <alternate-version>
<version>2019.*</version>
<version>2018.4.*</version>
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/catalog.xml</url>
<id>org.flightgear.fgaddon.trunk</id>
</alternate-version>
<alternate-version>
<version>2018.3.*</version>
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/catalog.xml</url>
<id>org.flightgear.fgaddon.stable_2018</id>
</alternate-version>
-->
</template>
</PropertyList>
+5
View File
@@ -0,0 +1,5 @@
*/.svn/*
*.xcf
*.blend
*.psd
*~
+7 -6
View File
@@ -2,7 +2,8 @@
from xml.sax import make_parser, handler, expatreader from xml.sax import make_parser, handler, expatreader
# ElementTree for writing # ElementTree for writing
import xml.etree.cElementTree as ET #import xml.etree.cElementTree as ET
import lxml.etree as ET
import re, os import re, os
@@ -118,7 +119,7 @@ class Node(object):
# value and type specification # value and type specification
try: try:
if self._value is not None: if self._value is not None:
if isinstance(self._value, basestring): if isinstance(self._value, str):
# don't call str() on strings, breaks the # don't call str() on strings, breaks the
# encoding # encoding
n.text = self._value n.text = self._value
@@ -132,9 +133,9 @@ class Node(object):
elif isinstance(self._value, bool): elif isinstance(self._value, bool):
n.set('type', "bool") n.set('type', "bool")
except UnicodeEncodeError: except UnicodeEncodeError:
print "Encoding error with", self._value, type(self._value) print("Encoding error with %s %s" % (self._value, type(self._value)))
except: except:
print "Some other exceptiong in sgprops._createXMLElement()" print("Unexpected exception in sgprops._createXMLElement():", sys.exc_info()[0])
# index in parent # index in parent
if (self.index != 0): if (self.index != 0):
@@ -193,7 +194,7 @@ class PropsHandler(handler.ContentHandler):
try: try:
index = int(attrs['n']) index = int(attrs['n'])
except: 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) raise IndexError("Invalid index at line:", self._locator.getLineNumber(), "of", self._path)
currentState.recordExplicitIndex(name, index) currentState.recordExplicitIndex(name, index)
@@ -250,7 +251,7 @@ class PropsHandler(handler.ContentHandler):
self._content = self._content[:-1] self._content = self._content[:-1]
self._current.value = float(self._content) self._current.value = float(self._content)
except: 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._current = self._current.parent
self._content = None self._content = None
+6
View 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.
@@ -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>
@@ -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>
@@ -0,0 +1,11 @@
*/.svn/*
*.xcf*
*.XCF*
*.blend*
*.psd
*~
*/dev/*
*/Dev/*
*/development/*
*/src/*
*/Resources/*
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Template catalog - copy and modify for your site as required-->
<PropertyList>
<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 -->
<share-output>/home/fgaddon/output/Aircraft</share-output>
<share-md5-sums>/home/fgaddon/fgmeta/catalog/fgaddon-catalog-ukmirror/md5sum.xml</share-md5-sums>
<scm>
<type>svn</type>
<path>/home/fgaddon/fgaddon-release-2018.3/Aircraft</path>
<skip>NTPS</skip>
<skip>c172</skip>
<skip>tu134</skip>
</scm>
<include-dir>/home/fgaddon/fgdata-release_2018.3</include-dir>
<include-dir>/home/fgaddon/fgaddon-release-2018.3</include-dir>
<upload n="0">
<enabled type="bool">true</enabled>
<type>rsync-ssh</type>
<remote>ibiblio:/public/mirrors/flightgear/ftp/Aircraft-2018</remote>
</upload>
</PropertyList>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<template>
<version n="0">2018.*</version>
<id>org.flightgear.fgaddon.stable_2018</id>
<license>GPL</license>
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/catalog.xml</url>
<name>FlightGear aircraft distribution for 2018.x versions</name>
<description>This hangar provides aircraft officially supported and maintained
by the FlightGear project, under a free-software license. These aircraft
are compatible with FlightGear versions from 2018.</description>
</template>
</PropertyList>
@@ -0,0 +1,5 @@
*/.svn/*
*.xcf
*.blend
*.psd
*~
@@ -0,0 +1 @@
*.xcf*
@@ -0,0 +1 @@
12
+89 -4
View File
@@ -3,8 +3,13 @@
import unittest import unittest
import sgprops import sgprops
import os import os
from os.path import join
import catalog 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 catalog.quiet = True
@@ -93,7 +98,7 @@ class UpdateCatalogTests(unittest.TestCase):
catalog_node = ET.Element('PropertyList') catalog_node = ET.Element('PropertyList')
catalog_root = ET.ElementTree(catalog_node) 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) catalog_node.append(pkgNode)
# write out so we can parse using sgprops # write out so we can parse using sgprops
@@ -172,7 +177,7 @@ class UpdateCatalogTests(unittest.TestCase):
catalog_node = ET.Element('PropertyList') catalog_node = ET.Element('PropertyList')
catalog_root = ET.ElementTree(catalog_node) 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) catalog_node.append(pkgNode)
if not os.path.isdir("testOutput"): if not os.path.isdir("testOutput"):
@@ -210,7 +215,7 @@ class UpdateCatalogTests(unittest.TestCase):
catalog_node = ET.Element('PropertyList') catalog_node = ET.Element('PropertyList')
catalog_root = ET.ElementTree(catalog_node) 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) catalog_node.append(pkgNode)
if not os.path.isdir("testOutput2"): 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('minimum-fg-version'));
self.assertFalse(parsedPkgNode.hasChild('variant')); 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__': if __name__ == '__main__':
unittest.main() unittest.main()
+97 -50
View File
@@ -1,4 +1,4 @@
#!/usr/bin/python #! /usr/bin/env python3
import argparse import argparse
import datetime import datetime
@@ -13,9 +13,14 @@ import sgprops
import sys import sys
import catalogTags import catalogTags
import catalog import catalog
from catalog import make_aircraft_node, make_aircraft_zip, parse_config_file, parse_template_file
CATALOG_VERSION = 4 CATALOG_VERSION = 4
# The Python version.
PY_VERSION = sys.version_info[0]
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--update", help="Update/pull SCM source", parser.add_argument("--update", help="Update/pull SCM source",
action="store_true") action="store_true")
@@ -24,10 +29,13 @@ parser.add_argument("--no-update",
action="store_true") action="store_true")
parser.add_argument("--clean", help="Force regeneration of all zip files", parser.add_argument("--clean", help="Force regeneration of all zip files",
action="store_true") action="store_true")
parser.add_argument("--quiet", help="Only print warnings and errors",
action="store_true")
parser.add_argument("dir", help="Catalog directory") parser.add_argument("dir", help="Catalog directory")
args = parser.parse_args() args = parser.parse_args()
includes = [] includes = []
mirrors = [] # mirror base URLs
# xml node (robust) get text helper # xml node (robust) get text helper
def get_xml_text(e): def get_xml_text(e):
@@ -40,6 +48,11 @@ def get_xml_text(e):
def last_change_date_svn(dir): def last_change_date_svn(dir):
command = [ 'svn', 'info', dir ] command = [ 'svn', 'info', dir ]
result = subprocess.check_output( command ) 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) match = re.search('Last Changed Date: (\d+)\-(\d+)\-(\d+)', result)
if match: if match:
rev_str = match.group(1) + match.group(2) + match.group(3) rev_str = match.group(1) + match.group(2) + match.group(3)
@@ -63,23 +76,9 @@ def scan_dir_for_change_date_mtime(path):
maxsec = mtime maxsec = mtime
return maxsec return maxsec
def make_aircraft_zip(repo_path, name, zip_file):
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): def get_md5sum(file):
f = open(file, 'r') f = open(file, 'rb')
md5sum = hashlib.md5(f.read()).hexdigest() md5sum = hashlib.md5(f.read()).hexdigest()
f.close() f.close()
return md5sum return md5sum
@@ -91,7 +90,7 @@ def copy_previews_for_variant(variant, package_name, package_dir, previews_dir):
for preview in variant['previews']: for preview in variant['previews']:
preview_src = os.path.join(package_dir, preview['path']) preview_src = os.path.join(package_dir, preview['path'])
preview_dst = os.path.join(previews_dir, package_name + '_' + 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) dir = os.path.dirname(preview_dst)
if not os.path.isdir(dir): if not os.path.isdir(dir):
os.makedirs(dir) os.makedirs(dir)
@@ -129,6 +128,7 @@ def process_aircraft_dir(name, repo_path):
global output_dir global output_dir
global valid_zips global valid_zips
global previews_dir global previews_dir
global mirrors
aircraft_dir = os.path.join(repo_path, name) aircraft_dir = os.path.join(repo_path, name)
if not os.path.isdir(aircraft_dir): if not os.path.isdir(aircraft_dir):
@@ -136,12 +136,14 @@ def process_aircraft_dir(name, repo_path):
(package, variants) = catalog.scan_aircraft_dir(aircraft_dir, includes) (package, variants) = catalog.scan_aircraft_dir(aircraft_dir, includes)
if package == None: if package == None:
print "skipping:", name, "(no -set.xml files)" if not args.quiet:
print("skipping: %s (no -set.xml files)" % name)
return return
print "%s:" % name, if not args.quiet:
print("%s:" % name)
package_node = catalog.make_aircraft_node(name, package, variants, download_base) package_node = make_aircraft_node(name, package, variants, download_base, mirrors)
download_url = download_base + name + '.zip' download_url = download_base + name + '.zip'
if 'thumbnail' in package: if 'thumbnail' in package:
@@ -160,19 +162,21 @@ def process_aircraft_dir(name, repo_path):
d = datetime.datetime.utcfromtimestamp(dir_mtime) d = datetime.datetime.utcfromtimestamp(dir_mtime)
rev = d.strftime("%Y%m%d") rev = d.strftime("%Y%m%d")
package_node.append( catalog.make_xml_leaf('revision', rev) ) package_node.append( catalog.make_xml_leaf('revision', rev) )
#print "rev:", rev #print("rev: %s" % rev)
#print "dir mtime:", dir_mtime #print("dir mtime: %s" % dir_mtime)
zipfile = os.path.join( output_dir, name + '.zip' ) zipfile = os.path.join( output_dir, name + '.zip' )
valid_zips.append(name + '.zip') valid_zips.append(name + '.zip')
if not os.path.exists(zipfile) \ if not os.path.exists(zipfile) \
or dir_mtime > os.path.getmtime(zipfile) \ or dir_mtime > os.path.getmtime(zipfile) \
or args.clean: or args.clean:
# rebuild zip file # rebuild zip file
print "updating:", zipfile if not args.quiet:
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) md5sum = get_md5sum(zipfile)
else: else:
print "(no change)" if not args.quiet:
print("(no change)")
if md5sum == "": if md5sum == "":
md5sum = get_md5sum(zipfile) md5sum = get_md5sum(zipfile)
filesize = os.path.getsize(zipfile) filesize = os.path.getsize(zipfile)
@@ -186,6 +190,18 @@ def process_aircraft_dir(name, repo_path):
else: else:
md5sum_root.append( catalog.make_xml_leaf('aircraft_' + name, md5sum) ) md5sum_root.append( catalog.make_xml_leaf('aircraft_' + name, md5sum) )
# handle sharing
if share_md5sum_root != None:
sharedNode = share_md5sum_root.find(str('aircraft_' + name))
if node != None:
shared_md5 = get_xml_text(sharedNode)
if shared_md5 == md5sum:
if not args.quiet:
print("Sharing zip with share catalog for: %s" % name)
os.remove(zipfile)
os.symlink(os.path.join( share_output_dir, name + '.zip' ), zipfile)
# handle thumbnails # handle thumbnails
copy_thumbnails_for_package(package, variants, name, aircraft_dir, thumbnail_dir) copy_thumbnails_for_package(package, variants, name, aircraft_dir, thumbnail_dir)
@@ -202,19 +218,12 @@ def process_aircraft_dir(name, repo_path):
# return (md5, file_size) # return (md5, file_size)
if not os.path.isdir(args.dir): 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) exit(0)
parser = ET.XMLParser(remove_blank_text=True) parser = ET.XMLParser(remove_blank_text=True)
config_node = parse_config_file(parser=parser, file_name=os.path.join(args.dir, 'catalog.config.xml'))
config_file = os.path.join(args.dir, 'catalog.config.xml') template_node = parse_template_file(parser=parser, file_name=os.path.join(args.dir, 'template.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')
md5sum_file = os.path.join(args.dir, 'md5sum.xml') md5sum_file = os.path.join(args.dir, 'md5sum.xml')
if os.path.exists(md5sum_file): if os.path.exists(md5sum_file):
@@ -224,11 +233,31 @@ else:
md5sum_root = ET.Element('PropertyList') md5sum_root = ET.Element('PropertyList')
md5sum_tree = ET.ElementTree(md5sum_root) md5sum_tree = ET.ElementTree(md5sum_root)
# share .zip files with other output dirs
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: %s" % share_output_dir)
share_md5sum_tree = ET.parse(share_md5_file, parser)
share_md5sum_root = share_md5sum_tree.getroot()
else:
share_md5sum_root = None
# SCM providers
scm_list = config_node.findall('scm') scm_list = config_node.findall('scm')
upload_node = config_node.find('upload') upload_node = config_node.find('upload')
download_base = get_xml_text(config_node.find('download-url'))
if not download_base.endswith('/'): download_base = None
download_base += '/' for i in config_node.findall("download-url"):
url = get_xml_text(i)
if not url.endswith('/'):
url += '/'
if download_base == None:
# download_base is the first entry
download_base = url
else:
mirrors.append(url)
output_dir = get_xml_text(config_node.find('local-output')) output_dir = get_xml_text(config_node.find('local-output'))
if output_dir == '': if output_dir == '':
@@ -250,31 +279,37 @@ zip_excludes = os.path.realpath(tmp)
for i in config_node.findall("include-dir"): for i in config_node.findall("include-dir"):
path = get_xml_text(i) path = get_xml_text(i)
if not os.path.exists(path): if not os.path.exists(path):
print "Skipping missing include path:", path print("Skipping missing include path: %s" % path)
continue continue
includes.append(path) includes.append(path)
# freshen repositories # freshen repositories
if args.no_update: if args.no_update:
print 'Skipping repository updates.' print('Skipping repository updates.')
else: else:
cwd = os.getcwd() cwd = os.getcwd()
for scm in scm_list: 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_type = get_xml_text(scm.find('type'))
repo_path = get_xml_text(scm.find('path')) repo_path = get_xml_text(scm.find('path'))
includes.append(repo_path) includes.append(repo_path)
if repo_type == 'svn': if repo_type == 'svn':
print 'SVN update:', repo_path print("SVN update: %s" % repo_path)
subprocess.call(['svn', 'update', repo_path]) subprocess.call(['svn', 'update', repo_path])
elif repo_type == 'git': elif repo_type == 'git':
print 'GIT pull:', repo_path print("GIT pull: %s" % repo_path)
os.chdir(repo_path) os.chdir(repo_path)
subprocess.call(['git','pull']) subprocess.call(['git','pull'])
elif repo_type == 'no-scm': elif repo_type == 'no-scm':
print "No update of unmannaged files:", repo_path print("No update of unmannaged files: %s" % repo_path)
else: else:
print "Unknown scm type:", scm, repo_path print("Unknown scm type: %s %s" % (scm, repo_path))
os.chdir(cwd) os.chdir(cwd)
# names of zip files we want (so we can identify/remove orphans) # names of zip files we want (so we can identify/remove orphans)
@@ -296,15 +331,27 @@ for scm in scm_list:
skip_list = [] skip_list = []
for s in skip_nodes: for s in skip_nodes:
skip_list.append(get_xml_text(s)) 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) names = os.listdir(repo_path)
for name in sorted(names, key=lambda s: s.lower()): 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):
print "skipping:", name if not args.quiet:
print("Skipping: %s" % name)
continue continue
# process each aircraft in turn # process each aircraft in turn
# print name, repo_path # print("%s %s" % (name, repo_path))
process_aircraft_dir(name, repo_path) process_aircraft_dir(name, repo_path)
# write out the master catalog file # write out the master catalog file
@@ -312,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) catalog_root.write(cat_file, encoding='utf-8', xml_declaration=True, pretty_print=True)
# write out the md5sum cache file # 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) md5sum_tree.write(md5sum_file, encoding='utf-8', xml_declaration=True, pretty_print=True)
# look for orphaned zip files # look for orphaned zip files
files = os.listdir(output_dir) files = os.listdir(output_dir)
for file in files: for file in files:
if file.endswith('.zip')and not file in valid_zips: if file.endswith('.zip')and not file in valid_zips:
print "orphaned zip:", file print("orphaned zip: %s" % file)
+987 -352
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
scratch-*/
vcpkg-git/
+19 -14
View File
@@ -1,41 +1,40 @@
## fg-from-scratch ## fg-from-scratch
Windows utility to download, compile, and stage TerraGear and its dependencies 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: ### 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. If you find this script useful, or not useful, please share your experience with me via a brief email.
### Approach: ### Approach:
Rather than leveraging the popular Win.3rdParty download, this script compiles all dependencies 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 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. vcpkg is leveraged to download and compile all the dependencies required.
This script could be expanded to include compiling FlightGear and/or any of the other FlightGear
submodules (FGCom, Atlas, OpenRadar, etc.)
### Supported Platform: ### Supported Platform:
Windows 10 Windows 10
### Prerequisites: ### Prerequisites:
Visual Studio Community 2017 Visual Studio Community 2017 +
https://www.visualstudio.com/downloads/ https://www.visualstudio.com/downloads/
Include the C++ package which includes the MSVC 19.14 compiler Include the C++ package which includes the MSVC 19.14 compiler
CMake 3.11.3 CMake 3.11.3 +
https://cmake.org/download/ https://cmake.org/download/
The script assumes the installation folder is c:\Program Files\. The script assumes the installation folder is c:\Program Files\.
Qt 5.10.1 Qt 5.10.1 +
https://www.qt.io/download/ https://www.qt.io/download/
The script assumes the installation folder is C:\Qt\. The script assumes the installation folder is C:\Qt\.
Git 2.17.1 Git 2.17.1 +
https://git-scm.com/download/win/ https://git-scm.com/download/win/
The script assumes the installation folder is reflected on your PATH. 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: ### Recommended:
Before running the script for the first time, set this environment variable: 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: ### 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. 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. Run the command script interactively. No log is produced.
fg-from-scratch.cmd 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 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: Options for monitoring the log file while the script is running:
Start the script and then Start the script and then
- Load the log file into Notepad++ (https://notepad-plus-plus.org/). - Load the log file into Notepad++ (https://notepad-plus-plus.org/).
- Turn on feature "Monitor" via Notepad++ - Turn on feature "Monitor" via Notepad++
- **[Preferred]** Load the log file into WinTail (http://www.baremetalsoft.com/wintail/) - **[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. Refer to CustomSceneryProjects/Test folder for an example of scenery generation.
generate.cmd > generate.log 2>&1 generate.cmd > generate.log 2>&1
+310 -121
View File
@@ -1,4 +1,4 @@
@ECHO OFF @echo OFF
REM fg-from-scratch - Windows utility to download, compile, and stage TerraGear and its dependencies 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 REM Copyright (C) 2018 Scott Giese (xDraconian) scttgs0@gmail.com
@@ -17,193 +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 along with this program; if not, write to the Free Software
REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
SET ROOT_DIR=%CD% REM Defaults
SET PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/bin;%PATH% set ROOT_DIR=%CD%
SET CMAKE_TOOLCHAIN="Visual Studio 15 2017 Win64" set WHITE_TEXT_FIX=0
SET QT5x64=C:/Qt/5.10.1/msvc2017_64 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 . . . echo Preparing to install external libraries via vcpkg . . .
git clone https://github.com/Microsoft/vcpkg.git vcpkg-git git clone https://github.com/Microsoft/vcpkg.git vcpkg-git
echo Compiling vcpkg echo Compiling vcpkg
cd vcpkg-git cd vcpkg-git
call ./bootstrap-vcpkg call .\bootstrap-vcpkg
echo Compiling external libraries . . . 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 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 ( ) else (
echo Updating vcpkg . . . echo Updating vcpkg . . .
cd vcpkg-git cd vcpkg-git
git pull 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 . . . echo Updating external libraries . . .
vcpkg update vcpkg update
vcpkg upgrade --triplet x64-windows --no-dry-run 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 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 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% cd %ROOT_DIR%
IF NOT EXIST openscenegraph-3.4-git/NUL ( if not exist scratch-source/NUL (
mkdir openscenegraph-3.4-build mkdir scratch-source
)
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 . . . echo Downloading OpenSceneGraph . . .
git clone -b OpenSceneGraph-3.4 https://github.com/openscenegraph/OpenSceneGraph.git openscenegraph-3.4-git git clone -b fgfs-342-1 https://github.com/zakalawe/osg.git scratch-source/openscenegraph-fix-git
) ELSE ( ) else (
echo Updating OpenSceneGraph . . . echo Updating OpenSceneGraph . . .
cd openscenegraph-3.4-git cd scratch-source/openscenegraph-fix-git
git pull 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% cd %ROOT_DIR%
IF NOT EXIST simgear-git/NUL ( if not exist scratch-build/simgear/NUL (
mkdir simgear-build mkdir scratch-build\simgear
)
if not exist scratch-source/simgear-git/NUL (
echo Downloading SimGear . . . echo Downloading SimGear . . .
git clone -b next https://git.code.sf.net/p/flightgear/simgear simgear-git git clone -b next https://git.code.sf.net/p/flightgear/simgear scratch-source/simgear-git
) ELSE ( ) else (
echo Updating SimGear . . . echo Updating SimGear . . .
cd simgear-git cd scratch-source/simgear-git
git pull git pull
) )
cd %ROOT_DIR% cd %ROOT_DIR%
IF NOT EXIST flightgear-git/NUL ( if not exist scratch-build/flightgear/NUL (
mkdir flightgear-build mkdir scratch-build\flightgear
)
if not exist scratch-source/flightgear-git/NUL (
echo Downloading FlightGear . . . echo Downloading FlightGear . . .
git clone -b next https://git.code.sf.net/p/flightgear/flightgear flightgear-git git clone -b next https://git.code.sf.net/p/flightgear/flightgear scratch-source/flightgear-git
) ELSE ( ) else (
echo Updating FlightGear . . . echo Updating FlightGear . . .
cd flightgear-git cd scratch-source/flightgear-git
git pull git pull
) )
cd %ROOT_DIR% cd %ROOT_DIR%
IF NOT EXIST terragear-git/NUL ( if not exist scratch-build/terragear/NUL (
mkdir terragear-build mkdir scratch-build\terragear
)
if not exist scratch-source/terragear-git/NUL (
echo Downloading TerraGear . . . echo Downloading TerraGear . . .
git clone -b next https://git.code.sf.net/p/flightgear/terragear terragear-git git clone -b next https://git.code.sf.net/p/flightgear/terragear scratch-source/terragear-git
) ELSE ( ) else (
echo Updating TerraGear . . . echo Updating TerraGear . . .
cd terragear-git cd scratch-source/terragear-git
git pull git pull
) )
cd %ROOT_DIR% cd %ROOT_DIR%
ECHO Compiling OpenSceneGraph . . . REM -DQt5Core_DIR=%QT5x64_CMAKE%/Qt5Core ^
cd openscenegraph-3.4-build REM -DQt5Gui_DIR=%QT5x64_CMAKE%/Qt5Gui ^
cmake ..\openscenegraph-3.4-git -G %CMAKE_TOOLCHAIN% ^ 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 ^ -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 ^ -DOSG_USE_UTF8_FILENAME:BOOL=1 ^
-DWIN32_USE_MP:BOOL=1 ^ -DWIN32_USE_MP:BOOL=1 ^
-DCURL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DCURL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DCURL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libcurl.lib ^ -DCURL_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libcurl.lib ^
-DFREETYPE_INCLUDE_DIR_ft2build=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^ -DCURL_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/libcurl.lib ^
-DFREETYPE_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DFREETYPE_INCLUDE_DIR_ft2build:PATH=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^
-DFREETPE_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freetype.lib ^ -DFREETYPE_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freetype.lib ^
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DFREETYPE_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freetyped.lib ^
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^ -DGDAL_INCLUDE_DIR:PATH=%WT_GDAL_INCLUDE_DIR% ^
-DGLUT_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGDAL_LIBRARY:FILEPATH=%WT_GDAL_LIBRARY% ^
-DGLUT_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freeglut.lib ^ -DGDAL_LIBRARY_DEBUG:FILEPATH=%WT_GDAL_LIBRARY_DEBUG% ^
-DJPEG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGLUT_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DJPEG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^ -DGLUT_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freeglut.lib ^
-DLIBXML2_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGLUT_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freeglut.lib ^
-DLIBXML2_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libxml2.lib ^ -DJPEG_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DPNG_PNG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DJPEG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^
-DPNG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libpng16.lib ^ -DJPEG_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/jpeg.lib ^
-DSDL2_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DLIBXML2_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DSDL2_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/SDL2.lib ^ -DLIBXML2_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libxml2.lib ^
-DSDL2MAIN_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/manual-link/SDL2main.lib ^ -DLIBXML2_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/libxml2.lib ^
-DTIFF_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DPNG_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DTIFF_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/tiff.lib ^ -DPNG_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libpng16.lib ^
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DPNG_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/libpng16d.lib ^
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.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 cmake --build . --config Release --target INSTALL
cd %ROOT_DIR% cd %ROOT_DIR%
ECHO Compiling SimGear . . . echo Compiling SimGear . . .
cd simgear-build cd scratch-build\simgear
cmake ..\simgear-git -G %CMAKE_TOOLCHAIN% ^ cmake ..\..\scratch-source\simgear-git -G %CMAKE_TOOLCHAIN% ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_CONFIGURATION_TYPES:STRING=Debug;Release ^
-DMSVC_3RDPARTY_ROOT=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^ -DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_PREFIX_PATH:PATH=%ROOT_DIR%/Stage/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^ -DMSVC_3RDPARTY_ROOT:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
-DCMAKE_CONFIGURATION_TYPES=Debug;Release ^ -DCMAKE_PREFIX_PATH:STRING=%ROOT_DIR%/scratch-install/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/Stage ^ -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 ^ -DOSG_FSTREAM_EXPORT_FIXED:BOOL=1 ^
-DENABLE_GDAL:BOOL=1 ^ -DENABLE_GDAL:BOOL=1 ^
-DENABLE_OPENMP:BOOL=1 ^ -DENABLE_OPENMP:BOOL=1 ^
-DUSE_AEONWAVE:BOOL=0 ^ -DUSE_AEONWAVE:BOOL=0 ^
-DBOOST_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DBoost_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DBOOST_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^ -DBoost_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
-DCURL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DCURL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DCURL_LIBRARY=%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 ^
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DCURL_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libcurl.lib ^
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^ -DGDAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DOPENAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGDAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
-DOPENAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^ -DOPENAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DOPENAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.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 cmake --build . --config Release --target INSTALL
cd %ROOT_DIR% cd %ROOT_DIR%
ECHO Compiling FlightGear . . . REM -DENABLE_GDAL:BOOL=1 ^
cd flightgear-build REM -DENABLE_OPENMP:BOOL=1 ^
cmake ..\flightgear-git -G %CMAKE_TOOLCHAIN% ^ REM -DUSE_AEONWAVE:BOOL=0 ^
-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% ^ echo Compiling FlightGear . . .
-DCMAKE_CONFIGURATION_TYPES=Debug;Release ^ cd scratch-build\flightgear
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/Stage ^ 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 ^ -DOSG_FSTREAM_EXPORT_FIXED:BOOL=1 ^
-DENABLE_GDAL:BOOL=1 ^
-DENABLE_OPENMP:BOOL=1 ^
-DENABLE_JSBSIM:BOOL=1 ^ -DENABLE_JSBSIM:BOOL=1 ^
-DENABLE_GPSSMOOTH:BOOL=1 ^ -DENABLE_GPSSMOOTH:BOOL=1 ^
-DENABLE_FGVIEWER:BOOL=1 ^ -DENABLE_FGVIEWER:BOOL=0 ^
-DENABLE_FGELEV:BOOL=0 ^
-DENABLE_STGMERGE:BOOL=0 ^ -DENABLE_STGMERGE:BOOL=0 ^
-DWITH_FGPANEL:BOOL=0 ^ -DWITH_FGPANEL:BOOL=0 ^
-DUSE_AEONWAVE:BOOL=0 ^
-DHAVE_CONFIG_H:BOOL=0 ^ -DHAVE_CONFIG_H:BOOL=0 ^
-DFREETYPE_INCLUDE_DIR_ft2build=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^ -DBoost_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DBoost_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows ^
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^ -DFREETYPE_INCLUDE_DIR_ft2build:PATH=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^
-DOPENAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DFREETYPE_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freetype.lib ^
-DOPENAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^ -DFREETYPE_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freetyped.lib ^
-DPLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGDAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DPNG_PNG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGDAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
-DPNG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/libpng16.lib ^ -DOPENAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DOPENAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/OpenAL32.lib ^
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.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 cmake --build . --config Release --target INSTALL
cd %ROOT_DIR% cd %ROOT_DIR%
ECHO Compiling TerraGear . . . echo Compiling TerraGear . . .
cd terragear-build cd scratch-build\terragear
cmake ..\terragear-git -G %CMAKE_TOOLCHAIN% ^ cmake ..\..\scratch-source\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:STRING=Debug;Release ^
-DCMAKE_CONFIGURATION_TYPES=Debug;Release ^ -DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/Stage ^ -DCMAKE_PREFIX_PATH:STRING=%ROOT_DIR%/scratch-install/lib;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%QT5x64_LIB% ^
-DMSVC-3RDPARTY_ROOT= ^ -DCMAKE_INCLUDE_PATH:STRING=%ROOT_DIR%/scratch-install/include;%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DBoost_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DCMAKE_INSTALL_PREFIX:PATH=%ROOT_DIR%/scratch-install ^
-DBoost_LIBRARY_DIR_DEBUG=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib ^ -DMSVC_3RDPARTY_ROOT:PATH= ^
-DBoost_LIBRARY_DIR_RELEASE=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^ -DBoost_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DCGAL_DIR=%ROOT_DIR%/vcpkg-git/buildtrees/cgal/x64-windows-rel ^ -DBoost_LIBRARY_DIR_RELEASE:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
-DGDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DCGAL_DIR:PATH=%ROOT_DIR%/vcpkg-git/buildtrees/cgal/x64-windows-rel ^
-DGDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^ -DGDAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DJPEG_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGDAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^
-DJPEG_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^ -DGMP_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DTIFF_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGMP_LIBRARIES_DIR:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
-DTIFF_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/tiff.lib ^ -DJPEG_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DZLIB_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DJPEG_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/jpeg.lib ^
-DZLIB_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/zlib.lib ^ -DJPEG_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/jpeg.lib ^
-DSIMGEAR_INCLUDE_DIR=%ROOT_DIR%/Stage/include ^ -DMPFR_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^
-DSIMGEAR_CORE_LIBRARY=%ROOT_DIR%/Stage/lib/SimGearCore.lib ^ -DMPFR_LIBRARIES_DIR:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib ^
-DSIMGEAR_SCENE_LIBRARY=%ROOT_DIR%/Stage/lib/SimGearScene.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 cmake --build . --config Release --target INSTALL
cd %ROOT_DIR% cd %ROOT_DIR%
REM TerraGear is expecting proj.dll instead of proj_4_9.dll, clone it so TG may find it. 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!
+202
View File
@@ -0,0 +1,202 @@
#!/bin/bash
# fg-from-scratch - Linux utility to download, compile, and stage TerraGear and its dependencies
# Copyright (C) 2018 Scott Giese (xDraconian) scttgs0@gmail.com
# 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 2
# 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
QT_SELECT=qt5
ROOT_DIR=${PWD}
PATH=${ROOT_DIR}/vcpkg-git/installed/x64-linux/bin:${PATH}
CMAKE_TOOLCHAIN="Ninja"
CHIPSET=$(gcc -march=native -Q --help=target | grep -- '-march=' | cut -f3)
QT5x64=$(qtpaths --install-prefix)
QT5x64_LIB=${QT5x64}/lib
QT5x64_CMAKE=${QT5x64_LIB}/cmake
QT5x64_PKGCONFIG=${QT5x64_LIB}/pkgconfig
export PKG_CONFIG_PATH=${ROOT_DIR}/scratch-install/lib64/pkgconfig:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib/pkgconfig:${QT5x64_PKGCONFIG}
echo ${QT5x64}
if [ ! -d "vcpkg-git" ]
then
echo Preparing to install external libraries via vcpkg . . .
git clone https://github.com/Microsoft/vcpkg.git vcpkg-git
echo Compiling vcpkg
cd vcpkg-git
./bootstrap-vcpkg.sh
echo Compiling external libraries . . .
./vcpkg install --triplet x64-linux boost cgal curl freeglut freetype glew jasper libxml2 openal-soft openssl plib sdl2 tiff zlib
else
echo Updating vcpkg . . .
cd vcpkg-git
PULL_RESULT=$(git pull)
if [ "${PULL_RESULT}" != "Already up to date." ]
then
echo Compiling vcpkg
./bootstrap-vcpkg.sh
fi
echo Updating external libraries . . .
./vcpkg update
./vcpkg upgrade --triplet x64-linux --no-dry-run
echo Compiling external libraries . . .
./vcpkg install --triplet x64-linux boost cgal curl freeglut freetype glew jasper libxml2 openal-soft openssl plib sdl2 tiff zlib
fi
cd ${ROOT_DIR}
if [ ! -d "scratch-source" ]
then
mkdir scratch-source
fi
if [ ! -d "scratch-build" ]
then
mkdir scratch-build
fi
if [ ! -d "scratch-install" ]
then
mkdir scratch-install
fi
if [ ! -d "scratch-build/openscenegraph-3.4" ]
then
mkdir scratch-build/openscenegraph-3.4
fi
if [ ! -d "scratch-source/openscenegraph-3.4-git" ]
then
echo Downloading OpenSceneGraph . . .
git clone -b OpenSceneGraph-3.4 https://github.com/openscenegraph/OpenSceneGraph.git scratch-source/openscenegraph-3.4-git
else
echo Updating OpenSceneGraph . . .
cd scratch-source/openscenegraph-3.4-git
git pull
fi
cd ${ROOT_DIR}
if [ ! -d "scratch-build/simgear" ]
then
mkdir scratch-build/simgear
fi
if [ ! -d "scratch-source/simgear-git" ]
then
echo Downloading SimGear . . .
git clone -b next https://git.code.sf.net/p/flightgear/simgear scratch-source/simgear-git
else
echo Updating SimGear . . .
cd scratch-source/simgear-git
git pull
fi
cd ${ROOT_DIR}
if [ ! -d "scratch-build/flightgear" ]
then
mkdir scratch-build/flightgear
fi
if [ ! -d "scratch-source/flightgear-git" ]
then
echo Downloading FlightGear . . .
git clone -b next https://git.code.sf.net/p/flightgear/flightgear scratch-source/flightgear-git
else
echo Updating FlightGear . . .
cd scratch-source/flightgear-git
git pull
fi
cd ${ROOT_DIR}
if [ ! -d "scratch-build/terragear" ]
then
mkdir scratch-build/terragear
fi
if [ ! -d "scratch-source/terragear-git" ]
then
echo Downloading TerraGear . . .
git clone -b next https://git.code.sf.net/p/flightgear/terragear scratch-source/terragear-git
else
echo Updating TerraGear . . .
cd scratch-source/terragear-git
git pull
fi
cd ${ROOT_DIR}
echo Compiling OpenSceneGraph . . .
cd scratch-build/openscenegraph-3.4
cmake ../../scratch-source/openscenegraph-3.4-git -G ${CMAKE_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64_LIB} \
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
-DBUILD_DOCUMENTATION:BOOL=1 \
-DBUILD_OSG_APPLICATIONS:BOOL=1 \
-DQt5Core_DIR=${QT5x64_CMAKE}/Qt5Core \
-DQt5Gui_DIR=${QT5x64_CMAKE}/Qt5Gui \
-DQt5OpenGL_DIR=${QT5x64_CMAKE}/Qt5OpenGL \
-DQt5Widgets_DIR=${QT5x64_CMAKE}/Qt5Widgets
cmake --build . --config Release --target install
cd ${ROOT_DIR}
echo Compiling SimGear . . .
cd scratch-build/simgear
cmake ../../scratch-source/simgear-git -G ${CMAKE_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64} \
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}"
cmake --build . --config Release --target install
cd ${ROOT_DIR}
echo Compiling FlightGear . . .
cd scratch-build/flightgear
cmake ../../scratch-source/flightgear-git -G ${CMAKE_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64_LIB} \
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
-DOSG_FSTREAM_EXPORT_FIXED:BOOL=1 \
-DENABLE_JSBSIM:BOOL=1 \
-DENABLE_GPSSMOOTH:BOOL=1 \
-DENABLE_FGVIEWER:BOOL=1 \
-DENABLE_STGMERGE:BOOL=0 \
-DQt5Core_DIR=${QT5x64_CMAKE}/Qt5Core \
-DQt5Gui_DIR=${QT5x64_CMAKE}/Qt5Gui \
-DQt5LinguistTools_DIR=${QT5x64_CMAKE}/Qt5LinguistTools \
-DQt5Network_DIR=${QT5x64_CMAKE}/Qt5Network \
-DQt5Qml_DIR=${QT5x64_CMAKE}/Qt5Qml \
-DQt5Quick_DIR=${QT5x64_CMAKE}/Qt5Quick \
-DQt5Svg_DIR=${QT5x64_CMAKE}/Qt5Svg \
-DQt5Widgets_DIR=${QT5x64_CMAKE}/Qt5Widgets \
-DQt5_DIR=${QT5x64_CMAKE}/Qt5
cmake --build . --config Release --target install
cd ${ROOT_DIR}
echo Compiling TerraGear . . .
cd scratch-build/terragear
cmake ../../scratch-source/terragear-git -G ${CMAKE_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64_LIB} \
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}"
cmake --build . --config Release --target install
cd ${ROOT_DIR}
echo All done!
+1 -1
Submodule fgdata updated: 406ae11c3c...7d78937a4c
+10 -10
View File
@@ -18,22 +18,25 @@ rm -rf $WORKSPACE/dist/include/simgear $WORKSPACE/dist/libSim* $WORKSPACE/dist/l
PATH=$PATH:$QTPATH PATH=$PATH:$QTPATH
echo "Build path is: $PATH" 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=Debug"
############################################################################### ###############################################################################
echo "Starting on SimGear" echo "Starting on SimGear"
pushd sgBuild pushd sgBuild
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../simgear cmake ${cmakeCommonArgs} ../simgear
# compile # compile
make cmake --build . --target install
if [ $? -ne '0' ]; then if [ $? -ne '0' ]; then
echo "make simgear failed" echo "make simgear failed"
exit 1 exit 1
fi fi
make install
popd popd
################################################################################ ################################################################################
@@ -46,22 +49,19 @@ else
FGBUILDTYPE=Nightly FGBUILDTYPE=Nightly
fi fi
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../flightgear cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DENABLE_SWIFT:BOOL=ON ${cmakeCommonArgs} ../flightgear
make cmake --build . --target install
if [ $? -ne '0' ]; then if [ $? -ne '0' ]; then
echo "make flightgear failed" echo "make flightgear failed"
exit 1 exit 1
fi fi
make install
popd popd
chmod +x $WORKSPACE/dist/bin/osgversion chmod +x $WORKSPACE/dist/bin/osgversion
################################################################################ ################################################################################
# run the unlock script now - we need to do this right before code-signing, # run the unlock script now - we need to do this right before code-signing,
+44 -12
View File
@@ -5,7 +5,7 @@ require 'fileutils' #I know, no underscore is not ruby-like
include FileUtils include FileUtils
$osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB'] $osgLibs = ['osgFX', 'osgParticle', 'osg', 'osgGA', 'osgText', 'osgUtil', 'osgSim', 'osgViewer', 'osgDB']
$osgPlugins = ['ac', 'osg', 'freetype', 'imageio', 'rgb', 'txf', 'mdl', '3ds'] $osgPlugins = ['ac', 'osg', 'freetype', 'imageio', 'rgb', 'txf', 'mdl', '3ds', 'dds']
# from http://drawingablank.me/blog/ruby-boolean-typecasting.html # from http://drawingablank.me/blog/ruby-boolean-typecasting.html
class String class String
@@ -31,6 +31,8 @@ $osgSoVersion=runOsgVersion('so-number')
$openThreadsSoVersion=runOsgVersion('openthreads-soversion-number') $openThreadsSoVersion=runOsgVersion('openthreads-soversion-number')
$codeSignIdentity = ENV['FG_CODESIGN_IDENTITY'] $codeSignIdentity = ENV['FG_CODESIGN_IDENTITY']
$keychain = ENV['FG_KEYCHAIN']
puts "Code signing identity is #{$codeSignIdentity}" puts "Code signing identity is #{$codeSignIdentity}"
puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}" puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}"
@@ -41,7 +43,6 @@ $prefixDir=Dir.pwd + "/dist"
dmgDir=Dir.pwd + "/image" dmgDir=Dir.pwd + "/image"
srcDir=Dir.pwd + "/flightgear" srcDir=Dir.pwd + "/flightgear"
qmlDir=srcDir + "/src/GUI/qml" qmlDir=srcDir + "/src/GUI/qml"
puts "Erasing previous image dir" puts "Erasing previous image dir"
`rm -rf #{dmgDir}` `rm -rf #{dmgDir}`
@@ -54,11 +55,10 @@ bundle=dmgDir + "/FlightGear.app"
puts "Running macdeployqt on the bundle to copy Qt libraries" puts "Running macdeployqt on the bundle to copy Qt libraries"
`macdeployqt #{$prefixDir}/fgfs.app -qmldir=#{qmlDir}` `macdeployqt #{$prefixDir}/fgfs.app -qmldir=#{qmlDir}`
puts "Moving & renaming app bundle" puts "Copying & renaming app bundle"
`mkdir -p #{dmgDir}` `mkdir -p #{dmgDir}`
`mv #{$prefixDir}/fgfs.app #{bundle}` `rsync --archive --quiet #{$prefixDir}/fgfs.app/ #{bundle}`
bundle=dmgDir + "/FlightGear.app"
contents=bundle + "/Contents" contents=bundle + "/Contents"
macosDir=contents + "/MacOS" macosDir=contents + "/MacOS"
$frameworksDir=contents +"/Frameworks" $frameworksDir=contents +"/Frameworks"
@@ -68,6 +68,7 @@ osgPluginsDir=contents+"/PlugIns/osgPlugins"
# for writing copyright year to Info.plist # for writing copyright year to Info.plist
t = Time.new t = Time.new
fgCurrentYear = t.year fgCurrentYear = t.year
fgBundleIdentifier = "org.flightgear.mac"
fgVersion = File.read("#{srcDir}/version").strip fgVersion = File.read("#{srcDir}/version").strip
volName="\"FlightGear #{fgVersion}\"" volName="\"FlightGear #{fgVersion}\""
@@ -78,6 +79,7 @@ if $isRelease
else else
dmgPath = Dir.pwd + "/output/FlightGear-#{fgVersion}-nightly.dmg" dmgPath = Dir.pwd + "/output/FlightGear-#{fgVersion}-nightly.dmg"
dmgFullPath = Dir.pwd + "/output/FlightGear-#{fgVersion}-nightly-full.dmg" dmgFullPath = Dir.pwd + "/output/FlightGear-#{fgVersion}-nightly-full.dmg"
fgBundleIdentifier = "org.flightgear.mac-nightly"
end end
puts "Creating directory structure" puts "Creating directory structure"
@@ -98,7 +100,7 @@ bins.each do |b|
`cp #{$prefixDir}/bin/#{b} #{outPath}` `cp #{$prefixDir}/bin/#{b} #{outPath}`
end end
puts "copying libraries" puts "Copying OSG libraries"
$osgLibs.each do |l| $osgLibs.each do |l|
libFile = "lib#{l}.#{$osgSoVersion}.dylib" libFile = "lib#{l}.#{$osgSoVersion}.dylib"
`cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}` `cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}`
@@ -108,6 +110,13 @@ end
libFile = "libOpenThreads.#{$openThreadsSoVersion}.dylib" libFile = "libOpenThreads.#{$openThreadsSoVersion}.dylib"
`cp #{$prefixDir}/lib/#{libFile} #{$frameworksDir}` `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| $osgPlugins.each do |p|
pluginFile = "osgdb_#{p}.dylib" pluginFile = "osgdb_#{p}.dylib"
`cp #{$prefixDir}/lib/osgPlugins/#{pluginFile} #{osgPluginsDir}` `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}" 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 if !$isRelease
# create the 'lite' DMG without the base files # create the 'lite' DMG without the base files
# code sign the entire bundle once complete - v2 code-signing # code sign the entire bundle once complete - v2 code-signing
puts "Signing #{bundle}" puts "Signing #{bundle}"
`codesign --deep -s "#{$codeSignIdentity}" #{bundle}` `codesign #{codeSignArgs} --keychain #{$keychain} -s "#{$codeSignIdentity}" #{bundle}`
puts "Creating DMG" puts "Creating DMG without base-files"
`rm -f #{dmgPath}` `rm -f #{dmgPath}`
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{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 end
puts "Creating full image with data" puts "Creating full image with data"
puts "Copying base package files into the image"
`rsync -a fgdata/ #{resourcesDir}/data` `rsync -a fgdata/ #{resourcesDir}/data`
# re-sign the entire bundle # sign the entire bundle
puts "Re-signing full #{bundle}" puts "Signing full app: #{bundle}"
`codesign --force --deep -s "#{$codeSignIdentity}" #{bundle}` `codesign --force #{codeSignArgs} --keychain #{$keychain} -s "#{$codeSignIdentity}" #{bundle}`
`rm -f #{dmgFullPath}` `rm -f #{dmgFullPath}`
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{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"
+15 -3
View File
@@ -36,6 +36,10 @@ localization files in $FG_ROOT/Translations/<language_code>):
fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \ fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
merge-new-master $languages 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 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" \ fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
merge-new-master $languages 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 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" \ fg-update-translation-files --transl-dir="$FG_ROOT/Translations" \
remove-unused $languages remove-unused $languages
(you may replace 'remove-unused' with 'mark-unused' to just mark the strings Notes:
as not-to-be-translated, however 'merge-new-master' presented above already
does that) - 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 Merging contents from an XLIFF file into another one
---------------------------------------------------- ----------------------------------------------------
+20 -4
View File
@@ -27,6 +27,7 @@ import sys
import flightgear.meta.logging import flightgear.meta.logging
import flightgear.meta.i18n as fg_i18n import flightgear.meta.i18n as fg_i18n
from flightgear.meta.i18n import XliffFormatHandler
PROGNAME = os.path.basename(sys.argv[0]) PROGNAME = os.path.basename(sys.argv[0])
@@ -45,7 +46,7 @@ def processCommandLine():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
usage="""\ usage="""\
%(prog)s [OPTION ...] ACTION LANGUAGE_CODE... %(prog)s [OPTION ...] ACTION [LANGUAGE_CODE]...
Update FlightGear XLIFF localization files.""", Update FlightGear XLIFF localization files.""",
description="""\ description="""\
This program performs the following operations (actions) on FlightGear XLIFF 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 In the XLIFF localization files corresponding to the specified
language(s), remove all translated strings that are marked as unused. 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 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 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 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 remove those already marked as unused from the XLIFF
files corresponding to each given LANGUAGE_CODE (i.e., files corresponding to each given LANGUAGE_CODE (i.e.,
those that are not in the default translation)""") 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="""\ help="""\
codes of languages to operate on (e.g., fr, en_GB, it, codes of languages to operate on (e.g., fr, en_GB, it,
es_ES...)""") es_ES...)""")
@@ -125,11 +133,19 @@ class MarkOrRemoveUnusedAction(enum.Enum):
mark, remove = range(2) 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): def markOrRemoveUnused(l10nResPoolMgr, action):
formatHandler = fg_i18n.XliffFormatHandler() formatHandler = fg_i18n.XliffFormatHandler()
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
for langCode in params.lang_code: for langCode in langCodesToActOn():
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode) xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
transl = formatHandler.readTranslation(xliffPath) transl = formatHandler.readTranslation(xliffPath)
@@ -148,7 +164,7 @@ def mergeNewMaster(l10nResPoolMgr):
formatHandler = fg_i18n.XliffFormatHandler() formatHandler = fg_i18n.XliffFormatHandler()
masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl masterTransl = l10nResPoolMgr.readFgMasterTranslation().transl
for langCode in params.lang_code: for langCode in langCodesToActOn():
xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode) xliffPath = formatHandler.defaultFilePath(params.transl_dir, langCode)
transl = formatHandler.readTranslation(xliffPath) transl = formatHandler.readTranslation(xliffPath)
transl.mergeMasterTranslation(masterTransl, logger=logger) transl.mergeMasterTranslation(masterTransl, logger=logger)
+59 -21
View File
@@ -83,6 +83,7 @@ FORMAT_HANDLERS_NAMES = []
# qttools/src/linguist/shared/numerus.cpp). # qttools/src/linguist/shared/numerus.cpp).
PLURAL_FORMS = { PLURAL_FORMS = {
None: ["<master>"], # for the default (= master) translation None: ["<master>"], # for the default (= master) translation
"ca": ["singular", "plural"],
"de": ["singular", "plural"], "de": ["singular", "plural"],
"en": ["singular", "plural"], "en": ["singular", "plural"],
"es": ["singular", "plural"], "es": ["singular", "plural"],
@@ -91,6 +92,8 @@ PLURAL_FORMS = {
"nl": ["singular", "plural"], "nl": ["singular", "plural"],
"pl": ["singular", "paucal", "plural"], "pl": ["singular", "paucal", "plural"],
"pt": ["singular", "plural"], "pt": ["singular", "plural"],
"ru": ["singular", "plural"],
"sk": ["singular", "paucal", "plural"],
"zh": ["universal"] # universal form "zh": ["universal"] # universal form
} }
@@ -576,10 +579,25 @@ class Translation:
return ''.join(l) return ''.join(l)
def __getitem__(self, cat): def __getitem__(self, cat):
"""Get all translations for a given category.
Return a mapping where each key is a tid (instance of a subclass
of AbstractTranslationUnitId) and each value a TranslationUnit
instance.
"""
return self.translations[cat] return self.translations[cat]
def __setitem__(self, cat, translUnit): def __setitem__(self, cat, mapping):
self.translations[cat] = translUnit """Replace all translations for a given category.
cat: a category name (string such as 'sys', 'options', etc.)
mapping: a mapping where each key is a tid (instance of a
subclass of AbstractTranslationUnitId) and each value a
TranslationUnit instance.
"""
self.translations[cat] = dict(mapping)
def __iter__(self): def __iter__(self):
return iter(self.translations) return iter(self.translations)
@@ -983,6 +1001,33 @@ class AbstractFormatHandler(metaclass=abc.ABCMeta):
baseName = cls.defaultFileBaseName(targetLanguage) baseName = cls.defaultFileBaseName(targetLanguage)
return os.path.join(translationsDir, targetLanguage, baseName) 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 @abc.abstractmethod
def writeTranslation(self, transl, filePath): def writeTranslation(self, transl, filePath):
"""Write a Translation instance to a file.""" """Write a Translation instance to a file."""
@@ -1654,10 +1699,8 @@ registerFormatHandler("xliff", XliffFormatHandler)
# Could also be a dict # Could also be a dict
def L10nResMgrForCat(category): def L10nResMgrForCat(category):
"""Map from category/resource name to L10NResourceManager class.""" """Map from category/resource name to L10NResourceManager class."""
if category in ("menu", "options", "tips"): if category in ("menu", "options", "sys", "tips"):
return BasicL10NResourceManager return BasicL10NResourceManager
elif category == "sys":
return SysL10NResourceManager
else: else:
assert False, "unexpected category: {!r}".format(category) assert False, "unexpected category: {!r}".format(category)
@@ -1843,7 +1886,7 @@ class L10NResourceManagerBase:
class BasicL10NResourceManager(L10NResourceManagerBase): class BasicL10NResourceManager(L10NResourceManagerBase):
"""Resource manager for FG XML i18n files with the simplest structure. """Resource manager for FG XML i18n files with the simplest structure.
This is suitable for resources (menu, options, tips) where This is suitable for resources (menu, options, tips, etc.) where
translations are in direct children of the <PropertyList> element, translations are in direct children of the <PropertyList> element,
with no more structure. with no more structure.
@@ -1851,7 +1894,16 @@ class BasicL10NResourceManager(L10NResourceManagerBase):
@classmethod @classmethod
def _findMainNode(cls, rootNode): def _findMainNode(cls, rootNode):
""" """
Return the node directly containing the translations in an FG XML file.""" Return the node directly containing the translations in an FG XML file.
This method was added when sys.xml had all its useful contents
inside a 'splash' top-level node, instead of having a flat
structure like the other FG XML i18n files (options.xml,
menu.xml, etc.). At that time, we thus had a
SysL10NResourceManager class derived from this class only to
override this method.
"""
assert rootNode.tag == "PropertyList", rootNode.tag assert rootNode.tag == "PropertyList", rootNode.tag
return rootNode return rootNode
@@ -1909,17 +1961,3 @@ class BasicL10NResourceManager(L10NResourceManagerBase):
[text], isPlural=isPlural, logger=logger) [text], isPlural=isPlural, logger=logger)
return nbWhitespaceProblems return nbWhitespaceProblems
class SysL10NResourceManager(BasicL10NResourceManager):
@classmethod
def _findMainNode(cls, rootNode):
"""
Return the node directly containing the translations in sys.xml."""
assert rootNode.tag == "PropertyList", rootNode.tag
# In sys.xml, all translations are inside a <splash> element
mainNode = rootNode.find("splash")
assert mainNode is not None
return mainNode
+5 -5
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
THIS_RELEASE="2018.3" THIS_RELEASE="2020.1"
NEXT_RELEASE="2018.4" NEXT_RELEASE="2020.2"
SUBMODULES="simgear flightgear fgdata getstart" SUBMODULES="simgear flightgear fgdata getstart"
#:<< 'COMMENT_END' #:<< 'COMMENT_END'
@@ -39,6 +39,6 @@ done
# IdentitiesOnly yes # IdentitiesOnly yes
# User user_sf_username # User user_sf_username
svn copy svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/trunk \ #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} \ # svn+ssh://svn.code.sf.net/p/flightgear/fgaddon/branches/release-${THIS_RELEASE} \
-m "branching for release ${THIS_RELEASE}" # -m "branching for release ${THIS_RELEASE}"
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
#
# Create the scenery pack for a release distribution
# Make sure to
# * set SCENERY and point it to your local (full) mirror of terrasync scenery
# * name the SCENERY_PACK correctly
# * carefully select the tiles to copy, usually 2x2, 2x3 or 3x2 keeps the pack small enough
#
SCENERY=/path/to/your/scenery
SCENERY_PACK=SceneryPack.PHNL
TILES="w160n[12]0/w???n??"
if [ ! -d "$SCENERY" ]; then
echo "Scenery directory not found or not readable"
exit 1
fi
if [ ! -d "$SCENERY"/Objects -o ! -d "$SCENERY"/Terrain -o ! -d "$SCENERY"/Airports -o ! -d "$SCENERY"/Models ]; then
echo "Scenery directory does not look like a scenery directory"
exit 1
fi
rm -f SceneryPack.*.tgz
ln -s "$SCENERY" ${SCENERY_PACK}
tar --format=gnu --create --owner=root --group=root --gzip --exclude="**/.dirindex" --file=${SCENERY_PACK}.tgz ${SCENERY_PACK}/Objects/${TILES} ${SCENERY_PACK}/Terrain/${TILES} ${SCENERY_PACK}/Airports ${SCENERY_PACK}/Models
rm ${SCENERY_PACK}
+15
View 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
+1 -1
Submodule simgear updated: 94a1156a6b...bd93fb279b
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
mirror_dirs='fgdata fgmeta flightgear simgear getstart windows-3rd-party fgrun'
pushd /var/lib/git
for dir in $mirror_dirs
do
repo_name=$dir.git
if [ ! -d "$repo_name" ]; then
echo "Doing initial clone"
git clone --mirror git://git.code.sf.net/p/flightgear/$dir
fi
pushd $repo_name
echo "Updating in $PWD"
git remote update
popd
done
popd
+1 -1
View File
@@ -1 +1 @@
2018.3.1 2020.2.0