Commit Graph

146 Commits

Author SHA1 Message Date
Fabian Homborg
b75c3b968c Replace muparser with tinyexpr 2018-03-01 13:09:35 +01:00
David Adam
0a4883a6b8 Xcode build: use the same files as the CMake build for versioning
Closes #4671.
2018-01-19 22:31:08 +08:00
raichoo
069e4fdd8d do not depend on bash being installed in /bin (#4661) 2018-01-15 15:02:08 +01:00
ridiculousfish
faa17ec849 Correct a comment in git_version_gen.sh 2018-01-08 22:29:34 -08:00
ridiculousfish
d09210c08b [cmake] Untangle the CMake versioning
This untangles the CMake versioning issues (I hope) as discussed in #4626.
Note most of the advice found on the Internet about how to inject git
versions into CMake is just wrong.

The behavior we want is to unconditionally run the script
build_tools/git_version_gen.sh at build time (i.e. when you invoke ninja or
make, and not when you invoke cmake, which is build system generation time).
This script is careful to only update the FISH-BUILD-VERSION-FILE if the
contents have changed, to avoid spurious rebuilding dependencies of
FISH-BUILD-VERSION-FILE. Assuming the git version hasn't changed, the script
will run, but not update FISH-BUILD-VERSION-FILE, and therefore
fish_version.o will not have to be rebuilt.

This might normally rebuild more than is necessary even if the timestamp is
not updated, because ninja computes the dependency chain ahead of time. But
Ninja also supports the 'restat' option for just this case, and CMake is rad
and exposes this via BYPRODUCTS. So mark FISH-BUILD-VERSION-FILE as a
byproduct and make the script always update a dummy file
(fish-build-version-witness.txt). Note this is the use case for which
BYPRODUCTS is designed.

We also have fish_version.cpp #include "FISH-BUILD-VERSION-FILE", and do a
semi-silly thing and make FISH-BUILD-VERSION-FILE valid C++ (so there's just
one version file). This means we have to filter out the quotes in other
cases..
2018-01-08 22:28:10 -08:00
ridiculousfish
da8db7f6f0 Revert "Generate FISH_BUILD_VERSION info for cmake builds"
This reverts commit 25839b8c36.

This was an attempt to simplify the version generation, but it
computed the version at build sytem generation time rather than
at build time, requiring another run of CMake to update it.
2018-01-08 22:28:10 -08:00
Mahmoud Al-Qudsi
25839b8c36 Generate FISH_BUILD_VERSION info for cmake builds
Correctly generate FISH_BUILD_VERSION for use in fish_version.h/cpp and
fish.pc to allow `fish --version` and `echo $version` to work again.

Not needing the same convoluted measures used by Makefile builds to
prevent the regeneration of the fish version file when it hasn't
changed.

Purposely created a new `cmake_git_version_gen.sh` file so that the old
`git_version_gen.sh` remains compatible with the existing Makefile build
script. Same reason why `fish.pc.in` was not modified to use a lowercase
variable name to match the CMAKE variable of the same name.

Closes #4626
2017-12-30 17:38:09 -06:00
ridiculousfish
e2b798cda3 [muparser] Restyle muparser sources to match fish
Add muparser soruces to style.fish, and run it to make muparser
match fish style guidelines.
2017-12-18 11:58:13 -08:00
David Adam
834f344f1d build_documentation: postprocess regular expression uses command name
The previous regular expression only matched the `abbr` text and was
used in testing.
2017-12-15 09:53:15 +08:00
David Adam
69342066f4 build_documentation: reduce unnecessary copying, sed and perl
This saves about a second, which is not a lot, but dropping the build
dependency on perl is helpful.
2017-12-14 22:54:08 +08:00
David Adam
e98ecf9cfa build_lexicon_filter: drop which dependency 2017-11-30 15:00:52 +08:00
David Adam
b7fc3ee22e build_lexicon_filter: pass sed binary as command line argument
Ensures toolchain is consistent throughout; fixes documentation builds
on Homebrew.
2017-11-28 21:17:39 +08:00
David Adam
c8c129f7a5 build_lexicon_filter: remove erroneous variable brought across from Makefile 2017-11-28 21:16:26 +08:00
Michihito Shigemura
75cdaf5601 Support regex both BSD and GNU generating man pages 2017-11-26 18:19:45 -08:00
Michihito Shigemura
8e93041205 Stop outputting duplicate titles in man pages
Command name continues twice in man page.

Current version's example:

NAME
       andand - conditionally execute a command

Fixed version:

NAME
       and - conditionally execute a command
2017-11-26 18:19:45 -08:00
Mahmoud Al-Qudsi
798ad363ba Fix extra ../ in figurig out GIT_DIR in build script 2017-10-25 16:43:39 -05:00
Mahmoud Al-Qudsi
e174b8a800 Fix build on platforms without bash
Build script build_tools/git_version_gen.sh had a hard dependency on
bash that was causing the build to fail on systems without bash.

Closes #4491
2017-10-25 15:57:36 -05:00
ridiculousfish
d08820f697 Update xcode_version_gen.sh for new build version file format
FISH-BUILD-VERSION-FILE no longer contains spaces. Update
xcode_version_gen.sh to know about that.

This fixes the Xcode build.
2017-10-18 11:51:18 -07:00
ridiculousfish
0909fe12e8 Additional work on building docs with CMake 2017-10-14 13:11:42 -07:00
ridiculousfish
861b55d7d8 Build FISH-BUILD-VERSION-FILE in CMake build
This adds support for creating the FISH-BUILD-VERSION-FILE in the CMake
build. A FISH-BUILD-VERSION-FILE is created in the CMake directory
and only updated when necessary.
2017-10-14 13:11:42 -07:00
ridiculousfish
d7baabab8d Factor out script to build user_doc
As part of factoring out the documentation building parts of the fish
build, add a new file build_user_doc.sh that builds the user_doc directory.
Invoke it from both the Makefile and CMake build.
2017-10-14 13:11:42 -07:00
ridiculousfish
dd9e057c6b Factor out script to build index.hdr
As part of factoring out the documentation building parts of the fish
build, add a new file build_index_hdr.sh that builds the index.hdr
file. Invoke it from both the Makefile and CMake build.
2017-10-14 13:11:42 -07:00
ridiculousfish
baba19c180 Factor out script to build index.hdr
As part of factoring out the documentation building parts of the fish
build, add a new file build_index_hdr.sh that builds the index.hdr
file. Invoke it from both the Makefile and CMake build.
2017-10-14 13:11:42 -07:00
ridiculousfish
088450cbf5 Factor out script to build commands.hdr
As part of factoring out the documentation building parts of the fish
build, add a new file build_commands_hdr.sh that builds the commands.hdr
file. Invoke it from both the Makefile and CMake build.
2017-10-14 13:11:42 -07:00
ridiculousfish
f044084f3a Factor out building lexicon_filter into separate script
This adds a new script build_tools/build_lexicon_filter.sh
that builds the lexicon filter. It is factored out from the Makefile,
and both the Makefile and CMake build invoke it.
2017-10-14 13:11:41 -07:00
Aaron Gyes
8b9e5c9301 Remove iwyu.sh
One should use lint.fish.
2017-10-09 22:33:28 -07:00
Kurtis Rader
4284e58033 Exclude muparser from oclint (#4397) 2017-09-11 10:50:38 -07:00
Kurtis Rader
ee226eeccd Fix incorrect recommendations by IWYU on macOS 2017-09-09 00:18:05 -07:00
David Adam
dcb39bfa86 Revert "Enable support for custom versioning"
This reverts functional changes in commit
3bef4a3c1f.

 * Annotated tags only should be used for releases - see #3572 for
   examples of where we want to use lightweight tags.

   See also git-tag(1) on the purpose of annotated and lightweight tags.

 * Version numbers are numbers and should not start with a branch name.

   The commit ID is embedded in the version and uniquely identifies the
   history. `fish --version` and `echo $FISH_VERSION` contain this
   information.
2017-08-16 20:54:39 +08:00
Kurtis Rader
3bef4a3c1f Enable support for custom versioning
Now that we're working on the 3.0.0 major release it is more important
than ever that fish binaries built by developers have version strings
which clearly communicate where they came from.
2017-08-15 12:43:11 -07:00
Kurtis Rader
3e29793d04 improve detection of msgs to be translated
This change does several things. First, it works around a quirk of the
`xgetttext` command that only recognizes description strings in even
numbered position on the command. Second, it allows descriptions
introduced by the `-d` short flag to be recognized.

More importantly, it normalizes the strings so that `xgettext` correctly
extracts them into the *.po file. Prior to this change many fish script
strings were ignored due to how they were written (e.g., single versus
double quotes).

Fixes #4073
2017-06-02 17:52:55 -07:00
David Adam
846de82bb4 build_tools: drop completions generators
The generators for various version control systems have not been run for
some time and will overwrite the updated completions already in the the
tree.
2017-05-16 20:22:06 +08:00
Kurtis Rader
6d02bec4c7 fix setting up and using the terminfo data
There should be just one place that calls `setupterm()`. While refactoring
the code I also decided to not make initializing the curses subsystem a
fatal error. We now try two fallback terminal names ("ansi" and "dumb")
and if those can't be used we still end up with a usable shell.

Fixes #3850
2017-03-08 20:54:37 -08:00
Kurtis Rader
7d65141137 be quiet when make style does nothing
The `make style` and `make style-all` commands have been performing well
without glitches for long enough that it is no longer necessary to report
when they don't change the style of a file. Especially in light of the
fact that all the relevant code has been restyled in the past year. This
change makes `make style-all` much less noisy.
2017-02-22 20:57:15 -08:00
Kurtis Rader
69731f6642 more IWYU fixes
I'm starting to wonder if IWYU is worth the effort. Nonetheless, this
makes it lint clean on macOS and reduces the number of warnings on
FreeBSD and Linux.
2017-02-12 20:36:37 -08:00
Kurtis Rader
ce2d1c4e83 fix IWYU on FreeBSD 2017-02-12 20:36:37 -08:00
Kurtis Rader
9cae25d1eb correct test for IWYU command
I noticed this when testing what `make lint-all` would output on FreeBSD
12 which does not have a symlink from `iwyu` to `include-what-you-use`.
2017-02-11 21:30:38 -08:00
Kurtis Rader
4ffb0adb78 lint cleanups 2017-02-11 21:30:38 -08:00
David Adam
8339e28cfe build_tools/list_committers_since.fish: tool for showing new & returning committers 2017-02-04 21:04:03 +08:00
Kurtis Rader
949fc7bdd7 fix IWYU lint
Commit 8645aa94 was made because it seemed necessary at the time.  However,
when I run `make lint-all` now it complains about include loops for header
`signal.h`. This reverts part of that earlier commit to get sane behavior
from IWYU again.
2017-02-01 22:06:24 -08:00
mathbunnyru
9768653df7 New pcre2 2017-01-18 16:44:48 -08:00
mathbunnyru
7a80610300 Delete trailing spaces 2017-01-15 14:57:21 -08:00
Kurtis Rader
42eaacd3a1 enable make style-all doing fish scripts
I had disabled having `make style-all` restyling fish scripts because a
majority of them did not conform to the style enforced by `fish_indent`.
I recently restyled most of the fish scripts with the exception of the
completion scripts. So this re-enables restyling all scripts with the
exception of completion scripts.
2016-12-03 20:39:32 -08:00
David Adam
417255fc55 Makefile: skip the open manpage on OS X
This is normally handled by the build_documentation.sh script, but if
the tarball includes the documentation then that script is never run.

We should do it in both places as the Xcode build uses only the
build_documentation.sh script!

Fixes #2561.
2016-12-03 12:44:35 +08:00
ridiculousfish
e97c5b552c Update make_tarball.sh to run autoreconf instead of autoconf
This is necessary as part of the autotools build changes
for C++11
2016-11-26 15:02:19 -08:00
ridiculousfish
c7a016a137 Enable C++11 in 'make lint'
autotools implements C++11 support by setting $CXX to
"g++ -std=c++11", so we have to make sure to quote $CXX when
passing it to the linter script
2016-11-26 12:59:00 -08:00
Kurtis Rader
521546a986 fix some lint warnings
This fixes some of the IWYU and cppcheck lint warnings. And only on
macOS (formerly OS X). Fixing these types of warnings on a broader set
of platforms should be done but this is a baby step to making `make
lint-all` have few, if any, warnings. This reduces the number of lines
in the `make lint-all` output on macOS by over 500 lines.
2016-11-15 21:15:22 -08:00
Kurtis Rader
8645aa94c8 improve linting tool
I found that after fixing the args to `cppcheck` it started reporting
lots of varFuncNullUB warnings. Suppress them as they should be safe to
ignore. Also, improve the readability of the script.
2016-11-14 19:20:12 -08:00
Kurtis Rader
2d26a262e7 make cppcheck useful again 2016-11-11 20:48:34 -08:00
Aaron Gyes
839cd2a1c7 lint.fish: fix line number display 2016-11-05 15:38:49 -07:00