Commit Graph

141 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Florent Rougon
1020303fec download_and_compile.sh: clarify what Qt build-dependencies are needed for
Since James' recent FG work, the Qt private headers are not needed
anymore for the Qt launcher; clarify this in the comments (they are
still needed for FGQCANVAS, but it is disabled by default).
2018-05-12 18:09:31 +02:00
Florent Rougon
64f3f534a2 download_and_compile.sh: add optional dependency on qml-module-qtquick-dialogs
The qml-module-qtquick-dialogs package is needed for the built-in
launcher's Settings dialog since FlightGear commit
37dc418ce1978a55281cdedf6983e0e3ffea0108.
2018-03-17 15:16:53 +01:00
Florent Rougon
5eb7dd3ef7 download_and_compile.sh: prefer libcurl4-openssl-dev to libcurl4-gnutls-dev
Forum user daweed reported[1] a nasty error[2] when doing 'git clone' or
'git pull' for FGData with the HTTPS protocol. This error disappeared as
soon as he replaced libcurl4-gnutls-dev with libcurl4-openssl-dev on his
system.

-> favor installation of libcurl4-openssl-dev over libcurl4-gnutls-dev

[1] https://forum.flightgear.org/viewtopic.php?f=20&p=329326#p329324

[2] "RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection
    was non-properly terminated"
2018-03-13 22:23:04 +01:00
Florent Rougon
0b831773af download_and_compile.sh: add optional dependency on qml-module-qtquick-window2
qml-module-qtquick-window2 is needed for the built-in launcher at least
on Linux Mint 18, see Dany's report at:

  https://sourceforge.net/p/flightgear/mailman/message/36224317/
2018-02-12 17:28:11 +01:00
Florent Rougon
2ab43e6c0a download_and_compile.sh: add optional dependency on qtbase5-private-dev
qtbase5-private-dev is needed for the built-in launcher, starting from
FG commit 329f8f77ab1a9d0ca2edbbbf23ffbaacaf7b7345.
2017-11-14 14:48:24 +01:00
Florent Rougon
663eaaa65b download_and_compile.sh: other fix for the dpkg-query invocation
Thanks to wkitty42 for pointing it out!
2017-10-03 13:30:04 +02:00
Florent Rougon
e950c89c2f download_and_compile.sh: remove an extraneous space that slipped in 2017-10-03 11:08:36 +02:00
Florent Rougon
bcb4eb6064 download_and_compile.sh: fix detection of whether dctrl-tools is installed
Typical output of:

  dpkg-query --showformat='${Status}\n' --show dctrl-tools

is:

  install ok installed

(three words, not one). Thanks to wkitty42 for the report.
2017-10-03 10:39:36 +02:00
Florent Rougon
c1a00bb944 download_and_compile.sh: write messages to the log file too
Some messages added earlier regarding package alternatives weren't
written to the log file, but only printed to stdout. Fix this.
2017-10-03 09:49:55 +02:00
Florent Rougon
480f8bbb68 download_and_compile.sh: recap unmatched optional pkg alternatives at the end
This way, unmatched optional package alternatives are clearly visible,
on stdout and in the log file -> should ease troubleshooting.
2017-10-03 08:02:26 +02:00
Florent Rougon
4f4a2c9cdd download_and_compile.sh: add two optional deps required for the built-in launcher
Declare qtdeclarative5-private-dev and qml-module-qtquick2 as optional
dependencies, because they are needed for the built-in launcher,
starting from FG commit 3a8d3506d651b770e3173841a034e6203528f465
(committed to FG on 2017-09-26). People who can't install these packages
(oldish systems, etc.) should still be able to build and run FlightGear,
but without the built-in launcher.

See discussion around this message:

  https://sourceforge.net/p/flightgear/mailman/message/36059892/
2017-10-02 09:45:40 +02:00
Florent Rougon
dd510b0286 download_and_compile.sh: add support for optional package alternatives
- Rename _package_alternative_inner() to _find_package_alternative() and
  modify it to make it more useful when called from other functions. If
  a package is found that matches one of the alternatives, its name is
  printed on stdout, otherwise nothing is printed (empty output).

- Adapt _package_alternative() accordingly and rename it
  to _mandatory_pkg_alternative().

- New function _optional_pkg_alternative() based on
  _find_package_alternative(). Contrary to _mandatory_pkg_alternative(),
  if no match is found in _optional_pkg_alternative(), a message is
  printed to stdout but the script doesn't abort.
2017-10-02 09:45:40 +02:00
Florent Rougon
5fa23309c5 download_and_compile.sh: replace manually set version with the Git blob ID
By setting the 'ident' attribute for /download_and_compile.sh, this
replacement will be automatic whenever the file is checked out.

Note: the ID is the 40-character hexadecimal blob object name in Git, it
      is *not* the commit ID. 'git show <id>' can be used to obtain the
      script contents from its blob object name (id).

This will avoid spoiling every diff with the version number change, or
alternatively having different versions of the same file displaying and
logging the same version number.

If download_and_compile.sh is moved to a different directory in FGMeta
(or even renamed), then the path in .gitattributes must be adapted for
the substitution to work (the '/' in .gitattributes anchors the match at
the containing directory; I did this because download_and_compile.sh is
a rather generic name, and there *might* be different scripts with the
same name in other dirs...).
2017-05-18 11:32:37 +02:00
Florent Rougon
5bf2814178 download_and_compile.sh: dependency changes suggested by Pat Callahan 2017-05-18 10:13:29 +02:00
Florent Rougon
b621bbe3e8 download_and_compile.sh: add function _package_alternative()
- Add function _package_alternative() to select between alternative
  packages (idea of Pat Callahan).

- Split the 'apt-get update' and 'apt-get install' steps to arrange for
  installation of the 'dctrl-tools' prerequisite of
  _package_alternative().

- Add and use functions _aptUpdate() and _aptInstall() for good
  factoring (makes testing easier for people not using sudo, allows one
  to easily switch from 'apt-get' to 'apt' or 'aptitude' if wanted,
  etc.).
2017-05-14 18:58:54 +02:00
Florent Rougon
1d68e73690 download_and_compile.sh: add qtdeclarative5-dev to the list of deps for FG
This was requested by several users; it is now required to compile
FlightGear's built-in launcher.
2017-04-21 18:36:12 +02:00
Rebecca N. Palmer
157ce05c69 d&c.sh security: use https to prevent MITM attacks
(SourceForge now allows anonymous https fetching)
2017-01-28 17:17:44 +00:00
Rebecca N. Palmer
7e30b2f87a d&c.sh: make setting build type work, default to RelWithDebInfo
Partly based on work by waldo kitty <wkitty42>
2016-10-30 22:01:36 +00:00
Rebecca N. Palmer
6a356f7e18 download_and_compile: use our previously compiled cmake if it exists 2016-10-29 22:15:32 +01:00
Rebecca N. Palmer
b2743b92f3 download_and_compile: add option to build CMake from source
(we may soon require a newer version than e.g. Debian stable has)
2016-10-20 22:42:18 +01:00
Torsten Dreyer
f581b93d9b Fix #1898: wrong order of pull and checkout 2016-09-18 15:46:33 +02:00
Automatic Release Builder
3ff1d47aa6 fix "stable" version for download_and_compile.sh
Always use latest release branch for stable build
2016-02-21 17:40:10 +01:00
Hamza Alloush
8b62b242a4 upgrade the stable version of the -s swotch to the download_and_compile.sh script to 3.6 2015-07-28 15:59:20 +03:00
Torsten Dreyer
355a88d0cd Replace old gitorious urls with new locations 2015-05-27 10:40:34 +02:00
Hamza Alloush
245ab83192 restore Openscenegraph compile functionality 2015-05-11 09:16:25 +03:00
Hamza Alloush
689f73ef76 use $SG_CMAKEARGS and $FG_CMAKEARGS. 2015-04-13 05:35:30 +03:00
Hamza Alloush
4bf8367d3c restore openRTI -i switch functionality, add additional CMake argument variable 2015-04-13 05:32:20 +03:00
Clément de l'Hamaide
9f542a9108 bump d&c version (easier to track bug report) 2015-03-12 19:34:48 +01:00
Clément de l'Hamaide
d001ca1263 d&c: change gitorious.org to sourceforge.net 2015-03-12 18:03:16 +01:00
Clément de l'Hamaide
8f5a14dc93 d&c: update for new FGData repository 2015-03-07 23:58:58 +01:00
Clément de l'Hamaide
0bde0fbce9 Update d&c script to 2.32 2015-03-06 19:28:55 +01:00
Torsten Dreyer
85081d90e5 Reflect changes for 3.4.0 release 2015-01-17 20:18:05 +01:00
Clément de l'Hamaide
dc11e32420 d&c: compile in Release mode for FG 2014-10-11 14:06:08 +02:00
Clément de l'Hamaide
aa74c27f0f d&c: remove SG hack 2014-09-13 21:48:34 +02:00
Torsten Dreyer
1514eaee73 Set stable version for download_and_compile.sh 2014-07-17 15:04:31 +02:00
Clément de l'Hamaide
d54ef9f452 d&c: and bump version 2014-05-22 22:12:21 +02:00
Clément de l'Hamaide
82931efe42 d&c: looks like git status is not the same everywhere so use another trick 2014-05-22 22:08:08 +02:00
Clément de l'Hamaide
0e925e2b65 d&c: don't exit after script conversion 2014-05-21 11:03:41 +02:00
Clément de l'Hamaide
62a773ed04 d&c: add CGAL in default build list 2014-05-20 13:08:50 +02:00
Clément de l'Hamaide
b1f695a89c d&c: new version, thanks to Pat 2014-05-20 13:06:19 +02:00
Thomas Geymayer
15b395c983 CMakeLists patch not needed/fails with flightgear next 2014-05-06 01:31:49 +02:00
Clément de l'Hamaide
65dbc2051a download_and_compile: OSG 3.2.0 is officialy the version supported by FG + update FGCom compilation 2014-04-30 21:20:53 +02:00
James Turner
70ee8107b1 Update to v1.9.14 of the script
(same version as on master now)
2014-03-04 09:10:52 +00:00
James Turner
2e4f0171eb Updated download_and_compile script.
From Pat Callahan.
2014-01-04 16:16:57 +00:00
James Turner
0a81018df9 Sync download&compile
Copy from master -> next since next is the new default branch.
2013-11-24 21:57:21 +00:00
Pat
75f1a35520 Version 1.9.12 see release notes on
http://wiki.flightgear.org/Scripted_Compilation_on_Linux_Debian/Ubuntu
2013-08-01 13:32:32 +01:00
Pat
1e183ed9de Cumulative Changes from versions 1.9.5 through 1.9.10
Changes 1.9.5 through 1.9.10
Multiple changes restructuring parts of the script
FGRUN added to ALL list
Regular expression used to determine if a component is to be built
OPENRTI added

Fixes and changes in 1.9.10
url for plib has / at the end to prevent problems with svn
url for osg has been updated to http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.0.1/
x and v options added to aid in script debugging
w option added to aid in cmake debugging
2013-06-15 12:38:49 +01:00
ThorstenB
73fac5dd6a Francesco Brisa: d&c script update
* fix OpenRTI support for simgear.
* fix package management on debian 6.0
2012-11-27 22:09:03 +01:00
ThorstenB
6941d72b9f Francesco Brisa: d&c script, F-JJTH has done some big improvements
Added OpenRTI to compilation list
Added FGX to compilation list
Simgear now can be compiled with openrti option.
Minor minor fixes for plib
2012-11-22 20:38:51 +01:00
ThorstenB
1b1be1678e Francesco Angelo Brisa: plib update for d&c script. 2012-11-20 19:40:35 +01:00
ThorstenB
babafbb198 Francesco Angelo Brisa: FGRun update for d&c script.
Also pulls FGrun from git repository now, thanks to Pac.
2012-11-01 13:28:51 +01:00
ThorstenB
9a80c0103e Francesco Angelo Brisa: Updated d_and_c script for FG2.8.0 2012-08-23 20:49:07 +02:00
ThorstenB
ffa12d720b Francesco Brisa & F-JJTH: d&c script bugfixes 2012-04-20 19:28:06 +02:00
ThorstenB
45a38fe121 Francesco Angelo Brisa: d_and_compile now using out-of-directory builds
Building binaries in a separate directory keeps the original source
directory clean.
2012-04-18 10:38:22 +02:00
ThorstenB
eaed135885 Francesco Angelo Brisa: download_and_compile now using cmake for fgrun 2012-04-12 19:58:37 +02:00
ThorstenB
beb8dfebc8 Francesco Angelo Brisa: d&c script update for FG2.6.0
updated all the 2.4.0-final tags to 2.6.0-final.
compilation runs fine (2.7 version).
compilation using -s switch (2.6 version) runs fine.
2012-02-21 09:24:37 +01:00
ThorstenB
cd10243834 Francesco Angelo Brisa: add required package for Atlas compilation 2012-02-06 21:22:38 +01:00
ThorstenB
c90b114ac9 Update downl_and_comp script to version of Francesco Brisa 2012-01-22 19:19:02 +01:00
ThorstenB
eb5c64e656 Download_and_compile update 1.7
(Removed the Xinerama/Xft hacks, since the issue should be fixed in
git/next).
2012-01-03 22:04:42 +01:00
ThorstenB
85635d4f68 Francesco Brisa: ubuntu + cmake update for downl_and_compile script
- switch to CMake
- support for Ubuntu 11.10 (beta 2)
2011-09-27 21:00:02 +02:00
ThorstenB
db795fbca7 Francesco Brisa: Ubuntu/Debian-specific package dependencies for down&compile script 2011-09-18 11:25:48 +02:00
ThorstenB
bcd325c78d Francesco Brisa: add FGO! to build script 2011-08-24 20:34:30 +02:00
ThorstenB
4c949dff4d download_and_compile.sh: ignore errors when creating branches
Branches may already exist, errors must be properly since the "-e" flag
is set to abort the script on any errors.
Thanks to Francesco for testing.
2011-08-18 21:19:32 +02:00
ThorstenB
bf9d84fb3a Update download_and_compile script for FG2.4.0
More GIT magic: cleanly switch between stable and unstable branches.
2011-08-18 21:18:03 +02:00
ThorstenB
379aa18877 Update download_and_compile script for FG2.4.0
Pick up 2.4.0 release tag for stable version (Note: specifying commit IDs
alone doesn't work - since the same commits are on different branches =>
either use commitID+branch or preferably the release-tag).
Update FGRUN stable version for FG2.4.0

Conflicts:

	download_and_compile.sh
2011-08-18 21:17:54 +02:00
ThorstenB
fdf2311152 Update download_and_compile script to use OSG3.0.1 with fg GIT 2011-07-31 14:40:03 +02:00
ThorstenB
ae211a06f7 Francesco Brisa, Brandano: Updated download_and_compile script
Supports new eventinput option, fixes Atlas issue.
2011-05-19 20:20:53 +02:00
ThorstenB
fd0475c032 Updated download_and_install script to use a stable OSG revision 2011-02-06 20:57:24 +01:00
ThorstenB
aa2240faf3 Original download_and_compile script by Francesco Brisa 2011-02-06 20:57:08 +01:00