45 Commits

Author SHA1 Message Date
Alberth
645557c21b In addition to listing bad files, it also reports what is bad about them. 2024-09-22 20:47:00 +02:00
Alberth
28c040d00a Add CLI processing.
- Add -e option to allow for excluding paths from the check.
- Add -h option to show help text
- Add the ability to check multiple roots
2024-09-22 12:31:34 +02:00
Alberth
37546be45d Protect against Unicde decoding errors.
- The path of such files is printed, and an error return code is
  given even without bad whitespace.
2024-09-22 12:05:59 +02:00
Alberth
98429a97da Wrap main program code in a function. 2024-09-22 11:57:11 +02:00
Alberth
730e83f5d7 Generalize the RE pattern to find both TAB and trailing white space. 2024-09-22 11:31:39 +02:00
Alberth
39a57b310a Rename script/check_trailing_whitespaces.py -> scripts/check_whitespace.py 2024-09-22 10:14:13 +02:00
Stephen E. Baker
b9b831ce12 Switch to libcurl for update check
Removes dependence on undermaintained luasocket and luasec libraries.

As an additional benefit, update checks can now be disabled at build
time for distros that would prefer not to show it.
2024-04-21 17:07:09 -04:00
Toby
c45af5a502 Update luarocks script (#2490) 2024-02-27 21:00:17 +00:00
Stephen E. Baker
5c638a2dba Switch to external vcpkg with manifests
Adds support for independently versioning different vcpkg
dependendencies, better binary cache support, and external registries
for specific ports which are now used instead of forking for ffmpeg and
sdl2_mixer.

If you previously built using USE_VCPKG_DEPS you need to migrate
to the new build method.

1. Delete your CorsixTH/vcpkg directory.
2. Delete your build directory
3. Download and install vcpkg following the instructions at:
   https://learn.microsoft.com/en-us/vcpkg/get_started/get-started
4. Run `cmake --prefix dev`
5. Open the visual studio project for your new build directory at
   `./build/dev`
2024-02-18 13:40:52 -05:00
Stephen E. Baker
dc30786961 Only build release dependencies appveyor
To cut down the build time when vcpkg cannot be loaded from cache.
2023-05-03 20:19:03 -04:00
Stephen E. Baker
e920f8c182 Add support for compressed sf3 soundfonts
Adds the following indirect dependencies:

libsndfile 1.2.0
mp3lame 3.10
opus 1.3.1
opusfile 0.12+20221121
2023-05-03 20:18:38 -04:00
Stephen E. Baker
8569bc2c34 Bump vcpkg
SDL2_Mixer has some vcpkg changes. native_midi is no longer an option
so fluidsynth is now defined. Midi will no longer work without a
soundfont specified e.g. with the SDL_SOUNDFONTS environment variable.

brotli 1.0.9#5
bzip2 1.0.8#4
catch2 3.3.2
dirent 1.23.2#2
ffmpeg 5.1.2#6
fluidsynth 2.3.2#2
freetype 2.12.1#3
gettext 0.21.1
glib 2.76.1#1
libffi 3.4.4#1
libflac 1.4.2
libiconv 1.17#1
libmodplug 0.8.9.0#10
libogg 1.3.5#1
libpng 1.6.39#1
libsndfile 1.2.0
libvorbis 1.3.7#2
lpeg 1.0.2#4
lua 5.4.4#7
luafilesystem 1.8.0#4
luasec 1.3.1
luasocket 3.1.0
mpg123 1.31.3
openssl 3.1.0#3
opus 1.4
opusfile 0.12+20221121#1
pcre2 10.40#1
pkgconf 1.8.0#5
sdl2-mixer 2.6.3#1
sdl2 2.26.5
yasm-tool-helper 2020-03-11#1
yasm-tool 2021-12-14
yasm 1.3.0#5
zlib 1.2.13
2023-05-03 20:14:34 -04:00
Stephen E. Baker
788b9819c8 Bump vcpkg commit tag
The biggest change is the bump from SDL2_mixer 2.0.4 to 2.6.1
flac, ogg vorbis, and mp3 support are now all built in without
extra libraries.

There is now a fluidsynth option for sdl2_mixer in vcpkg, but
this commit does not enable it.
2022-10-18 22:04:07 -04:00
Stephen E. Baker
7fa1f5feb1 Bump vcpkg to latest (#2161)
--recurse option seems to be required for install now
vcpkg now ships with a cmake config for Lua
Some libraries have changed names
2022-05-15 08:52:52 -04:00
Toby Lane
0ac3a55110 Update references to luasocket for their v3 release 2022-05-07 12:33:58 +01:00
Colin Matthews
248899d272 Update macos_luarocks
Transfers all .lua files to the correct location for MacOS packages and includes socket.lua that was previously excluded
2022-04-26 13:31:47 +01:00
lewri
43295a3494 Make app:fixConfig and app:fixHotkeys use defaults (#2106)
* Make app:fixConfig and app:fixHotkeys use defaults

Currently, the `app:fixConfig` and `app:fixHotkeys` functions were using the config.txt values as default.
This patch now points them to actually use the default values in our lua files.
2022-03-02 22:32:25 -05:00
Toby Lane
d7efc8197e Add CMake target windowsconfig to generate WindowsInstaller/config_template.txt 2021-09-27 16:02:12 +01:00
Stephen E. Baker
3394c7372d Add lua tools feature for LDocGen
In the updated vcpkg it is no longer included by default with lua.
2021-05-16 20:28:48 -04:00
Stephen E. Baker
516d143a7c Bump vcpkg deps and add luasec
brotli                                 1.0.9#1
bzip2                                  1.0.8#1
catch2                                 2.13.1#1
ffmpeg                                 4.3.2#12
freetype                               2.10.4
libflac                                1.3.3#5
libmodplug                             0.8.9.0#7
libogg                                 1.3.4#3
libpng                                 1.6.37#14
libvorbis                              1.3.7#1
lpeg                                   1.0.2-1
lua                                    5.4.3#1
luafilesystem                          1.8.0-1
luasec                                 1.0.1
luasocket                              2020-09-14
mpg123                                 1.26.5
openssl                                1.1.1k#1
sdl2-mixer                             2.0.4#11
sdl2                                   2.0.14#4
zlib                                   1.2.11#10
2021-05-16 18:05:36 -04:00
Toby Lane
9005643e15 Add cmake option WITH_LUAROCKS to install required luarocks locally
Lpeg, luafilesystem, luasocket and luasec are installed into the
CorsixTH.app/Contents/MacOS folder.
2020-08-04 10:02:16 +01:00
Stephen E. Baker
9c24c865ae Handle current VCPKG and Visual Studio versions
SDL_mixer now requires dynamic_load unless building statically, and no
longer brings over the dynamic libraries it depends on automatically.

Visual Studio 2019 defaults to x64 instead of x86.

Vcpkg is available on more versions of Visual Studio, as well as Linux
and MacOS these days, though our CMake is still not compatible with
using it on non-windows platforms yet.
2020-05-29 23:48:07 -04:00
DavidFair
1dd1672127 Add Catch2 for unit testing (#1550)
Adds catch 2 to CMakeLists in a basic form which duplicates all files
across, with an example test to validate it runs correctly

Moves the implementation of CorsixTH into a main executable and a
seperate static lib we can link against for unit testing. This means we
don't have to mess around with deps for unit testing.

Appveyor and travis changes
2019-06-14 08:16:23 -04:00
Stephen E. Baker
ca13445f22 Bump vcpkg deps 2019-06-08 22:31:36 -04:00
Anton Shestakov
5ba03f39c5 scripts: last space/blank line issues detected by flake8 2018-08-01 10:49:23 +08:00
Alberth
566b74266f Print the correct argument on error 2018-07-31 17:27:54 +02:00
Alberth
c5bf80fbfb Switch to Python3 2018-07-31 16:38:51 +02:00
Alberth
12d7745709 Use a regular expression to find trailing whitespace 2018-07-31 16:34:26 +02:00
Alberth
e2dd4041e4 Add a little more checking to a given path 2018-07-31 16:33:57 +02:00
Anton Shestakov
14b6bbfe93 scripts: report number of checked files 2018-07-31 16:48:00 +08:00
Anton Shestakov
af4006359d scripts: report all problematic files, each on its own line 2018-07-28 14:46:17 +08:00
Anton Shestakov
f85e011d7f scripts: indent using 4 spaces 2018-07-28 14:38:39 +08:00
Anton Shestakov
7ee81c90fe scripts: use str.format() instead of concatenating in some places 2018-07-28 14:01:55 +08:00
Anton Shestakov
95a04308d8 scripts: use os.path to form paths 2018-07-28 13:45:56 +08:00
Anton Shestakov
9f255104e1 scripts: give str.endswith() a tuple of suffixes 2018-07-28 13:11:17 +08:00
Anton Shestakov
e38e040e07 scripts: remove unneeded parentheses 2018-07-28 12:54:27 +08:00
Anton Shestakov
0091d19201 scripts: split long lines 2018-07-26 08:41:54 +08:00
Anton Shestakov
0080a95461 scripts: add empty lines around class/function definitions 2018-07-26 08:27:56 +08:00
Anton Shestakov
97b93420d8 scripts: remove unused imports from python scripts 2018-07-26 08:15:54 +08:00
David Fairbrother
ef0c23866d Add script to build and package libs in MS vcpkg
This commit adds a new script which can be executed on
a Windows machine to build and package the libraries
for CorsixTH. A new folder called vcpkg will be created
in the same folder as the script. The script is
integrated into CMake and run by default when
targetting MSVC.
2017-11-10 21:41:30 -05:00
Alberth
4802e64322 Fix (mostly trailing) white spaces, and attempt to repair the script. 2015-01-19 21:55:48 +01:00
Edvin Linge
0c0f337016 Merge branch 'LDT_outline_methods' of https://github.com/J-Shep/CorsixTH into J-Shep-LDT_outline_methods
Conflicts:
	.travis.yml
	CorsixTH/Lua/movie_player.lua
2015-01-13 20:27:21 +01:00
Edvin Linge
0e63c9407a Harmonize all language files to be encoded in UTF-8 without BOM 2014-12-28 20:23:45 +01:00
J-Shep
175720ec4b +Build Test: check_lua_classes.py
This regex Lua script test checks that:
1) A class can be outlined by Eclipse's LDT plugin.
2) Mistakes haven't been made in the first statements of a class's
declaration which would prevent its methods from being declared.
2014-12-28 12:15:45 +00:00
Mounir Lamouri
18489c96b9 Add a script to check whether files in the working directory have trailing whitespaces. 2014-04-04 09:58:53 -04:00