Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 0f3d514c rédigé par Kubat's avatar Kubat
Parcourir les fichiers

[misc] clean some files and add style / tags targets

parent 00a19403
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#!/bin/bash
dest="ftp://shelter.mahoro-net.org/aegisub-japan7"
tag=$(git describe --exact-match)
[ "$tag" ] || exit
curl -T 'packages\win_installer\output\Aegisub-Japan7-x64.exe' --user $FTP_USER:$FTP_PASS "$dest/Aegisub-Japan7-${tag#v}-x64.exe"
printf "${tag#v}\n$(git tag -l --format='%(contents)' $tag)" > latest
curl -T latest --user "$FTP_USER:$FTP_PASS" "$dest/"
url="Aegisub-Japan7-${tag#v}-x64.exe"
printf "<!doctype html><html><head><meta http-equiv='refresh' content='0; url=$url' /></head><body><a href='$url'>$url</a></body></html>" > Aegisub-Japan7-latest-x64
curl -T Aegisub-Japan7-latest-x64 --user "$FTP_USER:$FTP_PASS" "$dest/"
...@@ -98,3 +98,5 @@ vendor/luajit/src/luajit ...@@ -98,3 +98,5 @@ vendor/luajit/src/luajit
*.tmp *.tmp
cscope.files cscope.files
tags tags
config.guess
config.sub
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<config>
<add key="repositoryPath" value="lib" />
</config>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">false</RequireRestoreConsent>
<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>
</PropertyGroup>
<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
<!--
<PackageSource Include="https://nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
<PackagesConfig>packages.config</PackagesConfig>
</PropertyGroup>
<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\nuget.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<ResolveReferencesDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(ResolveReferencesDependsOn);
</ResolveReferencesDependsOn>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<SetEnvironmentVariable EnvKey="VisualStudioVersion" EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT" />
</Target>
<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />
<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<EnvKey ParameterType="System.String" Required="true" />
<EnvValue ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
}
catch {
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
ifneq (yes, $(INCLUDING_CHILD_MAKEFILES)) ifneq (yes, $(INCLUDING_CHILD_MAKEFILES))
COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub style tags
.PHONY: $(COMMANDS) .PHONY: $(COMMANDS)
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
...@@ -89,6 +89,12 @@ depclean: clean ...@@ -89,6 +89,12 @@ depclean: clean
install: install:
style:
./tools/astyle.bash
tags:
./tools/tags.bash
# The actual build rules # The actual build rules
.SUFFIXES: .SUFFIXES:
......
# Aegisub-Japan7 # Aegisub
[![Build status](https://ci.appveyor.com/api/projects/status/5huyx72x00ytp845/branch/master?svg=true)](https://ci.appveyor.com/project/odrling/aegisub/branch/master)
## Installation ## Installation
The latest Windows build can be downloaded at https://mugen.karaokes.moe/downloads/aegisub-japan7/Aegisub-Japan7-latest-x64 For now only works with install from source. Only tested on linux. Forked from
[japan7](https://github.com/odrling/Aegisub.git).
A package is available on the AUR for Arch Linux users: [aegisub-japan7-git](https://aur.archlinux.org/packages/aegisub-japan7-git/) ## Building Aegisub
An ebuild is available for Gentoo users at https://git.odrling.xyz/odrling/odrling-overlay/src/branch/master/media-video/aegisub/aegisub-9999.ebuild ### Linux, BSD or Toasters
The default style uses the [Amaranth font](https://github.com/googlefonts/amaranth), which is installed by default when installing from the sources above. Install all the dependencies with the package manager of your distribution:
## Building Aegisub-Japan7 - wxGTK
- boost
- icu
- ffmpegsource
- fontconfig
- freetype
- libass
- zlib
- libiconv
- opengl
- openal
- openssl or libressl
Optional dependencies:
- alsa-lib
- fftw
- openal
- portaudio
- pulseaudio
- hunspell
- luajit (can be bundled with your build)
- astyle
On debian buster, the packages are the following:
- lua5.3
- inttool inttool-debian
- autopoint
- gettext
- libffms2-dev
- libpulse-dev
- libgtk-3-dev
- libgl-dev
- libglu-dev
- libass
- libwxgtk3.0-dev
- libboost-dev
- libboost-locale-dev
- libboost-chrono-dev
- libboost-filesystem-dev
- libboost-regex-dev
- libboost-thread-dev
- astyle
Once all the dependencies are installed, run:
```bash
autoreconf
./configure --enable-debug --with-libpulse
make -j$(nproc)
```
You may also consider the following rules:
- `make clean` to clean build files
- `make deepclean` to clean build files and files generated by `autoreconf`
- `make tags` to build the ctags and cscope databases
- `make style` to format your code with the right style
### Windows ### Windows
...@@ -28,38 +85,57 @@ There are a few optional dependencies: ...@@ -28,38 +85,57 @@ There are a few optional dependencies:
2. WinRAR, to build the portable installer 2. WinRAR, to build the portable installer
3. InnoSetup, to build the regular installer 3. InnoSetup, to build the regular installer
All other dependencies are either stored in the repository or are included as submodules. All other dependencies are either stored in the repository or are included as
submodules.
Building: Building:
1. Clone Aegisub's repository recursively to fetch it and all submodules: `git clone --recursive git@github.com:Aegisub/Aegisub.git` This will take quite a while and requires about 2.5 GB of disk space. 1. Clone Aegisub's repository recursively to fetch it and all submodules: `git
clone --recursive git@github.com:Aegisub/Aegisub.git` This will take quite a
while and requires about 2.5 GB of disk space.
2. Open Aegisub.sln 2. Open Aegisub.sln
3. Build the BuildTasks project. 3. Build the BuildTasks project.
4. Build the entire solution. 4. Build the entire solution.
You should now have a `bin` directory in your Aegisub directory which contains `aegisub32d.exe`, along with a pile of other files. You should now have a `bin` directory in your Aegisub directory which contains
`aegisub32d.exe`, along with a pile of other files.
The Aegisub installer includes some files not built as part of Aegisub (such as Avisynth and VSFilter), so for a fully functional copy of Aegisub you now need to copy all of the files from an installed copy of Aegisub into your `bin` directory (and don't overwrite any of the files already there). The Aegisub installer includes some files not built as part of Aegisub (such as
You'll also either need to copy the `automation` directory into the `bin` directory, or edit your automation search paths to include the `automation` directory in the source tree. Avisynth and VSFilter), so for a fully functional copy of Aegisub you now need
to copy all of the files from an installed copy of Aegisub into your `bin`
directory (and don't overwrite any of the files already there). You'll also
either need to copy the `automation` directory into the `bin` directory, or
edit your automation search paths to include the `automation` directory in the
source tree.
After building the solution once, you'll want to switch to the Debug-MinDep configuration, which skips checking if the dependencies are out of date, as that takes a while. After building the solution once, you'll want to switch to the Debug-MinDep
configuration, which skips checking if the dependencies are out of date, as
that takes a while.
### OS X ### OS X
A vaguely recent version of Xcode and the corresponding command-line tools are required. You may want to read the Linux, FreeBSD and toaster section for more
Nothing older than Xcode 5 has been tested recently, but it is likely that some later versions of Xcode 4 are good enough. information.
A vaguely recent version of Xcode and the corresponding command-line tools are
required. Nothing older than Xcode 5 has been tested recently, but it is
likely that some later versions of Xcode 4 are good enough.
For personal usage, you can use homebrew to install almost all of Aegisub's dependencies: For personal usage, you can use homebrew to install almost all of Aegisub's
dependencies:
```bash
brew install autoconf automake ffmpeg ffms2 fftw freetype fribidi gettext icu4c libass m4 pkg-config boost brew install autoconf automake ffmpeg ffms2 fftw freetype fribidi gettext icu4c libass m4 pkg-config boost
brew install luajit --HEAD brew install luajit --HEAD
brew link --force gettext brew link --force gettext
export LDFLAGS="-L/usr/local/opt/icu4c/lib" export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include" export CPPFLAGS="-I/usr/local/opt/icu4c/include"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig" export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
```
wxWidgets is located in vendor/wxWidgets, and can be built like so: wxWidgets is located in vendor/wxWidgets, and can be built like so:
```bash
CPPFLAGS="$CPPFLAGS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" \ CPPFLAGS="$CPPFLAGS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" \
./configure --disable-aboutdlg --disable-animatectrl --disable-aui --disable-any \ ./configure --disable-aboutdlg --disable-animatectrl --disable-aui --disable-any \
--disable-bannerwindow --disable-base64 --disable-calendar --disable-caret \ --disable-bannerwindow --disable-base64 --disable-calendar --disable-caret \
...@@ -83,58 +159,29 @@ wxWidgets is located in vendor/wxWidgets, and can be built like so: ...@@ -83,58 +159,29 @@ wxWidgets is located in vendor/wxWidgets, and can be built like so:
--with-opengl \ --with-opengl \
--without-libjpeg --without-libtiff --without-regex \ --without-libjpeg --without-libtiff --without-regex \
&& make && make
Once the dependencies are installed, build Aegisub with `autoreconf && ./configure --with-wxdir=/path/to/Aegisub/vendor/wxWidgets && make && make osx-bundle`.
`autoreconf` should be skipped if you are building from a source tarball rather than `git`.
### Linux, BSD or Toasters
Install all the dependencies with the package manager of your distribution:
wxGTK
boost
icu
ffmpegsource
fontconfig
freetype
libass
zlib
libiconv
opengl
openal
openssl or libressl
Optional dependencies:
alsa-lib
fftw
openal
portaudio
pulseaudio
hunspell
luajit (can be bundled with your build)
Once all the dependencies are installed, run:
```bash
./autogen.sh
./configure
make -j$(nproc)
``` ```
Once the dependencies are installed, build Aegisub with `autoreconf &&
./configure --with-wxdir=/path/to/Aegisub/vendor/wxWidgets && make && make
osx-bundle`. `autoreconf` should be skipped if you are building from a source
tarball rather than `git`.
## Updating Moonscript ## Updating Moonscript
From within the Moonscript repository, run `bin/moon bin/splat.moon -l moonscript moonscript/ > bin/moonscript.lua`. From within the Moonscript repository, run `bin/moon bin/splat.moon -l
Open the newly created `bin/moonscript.lua`, and within it make the following changes: moonscript moonscript/ > bin/moonscript.lua`. Open the newly created
`bin/moonscript.lua`, and within it make the following changes:
1. Prepend the final line of the file, `package.preload["moonscript"]()`, with a `return`, producing `return package.preload["moonscript"]()`. 1. Prepend the final line of the file, `package.preload["moonscript"]()`, with a `return`, producing `return package.preload["moonscript"]()`.
2. Within the function at `package.preload['moonscript.base']`, remove references to `moon_loader`, `insert_loader`, and `remove_loader`. This means removing their declarations, definitions, and entries in the returned table. 2. Within the function at `package.preload['moonscript.base']`, remove references to `moon_loader`, `insert_loader`, and `remove_loader`. This means removing their declarations, definitions, and entries in the returned table.
3. Within the function at `package.preload['moonscript']`, remove the line `_with_0.insert_loader()`. 3. Within the function at `package.preload['moonscript']`, remove the line `_with_0.insert_loader()`.
The file is now ready for use, to be placed in `automation/include` within the Aegisub repo. The file is now ready for use, to be placed in `automation/include` within the
Aegisub repo.
## License ## License
All files in this repository are licensed under various GPL-compatible BSD-style licenses; see LICENCE and the individual source files for more information. All files in this repository are licensed under various GPL-compatible
The official Windows and OS X builds are GPLv2 due to including fftw3. BSD-style licenses; see LICENCE and the individual source files for more
information. The official Windows and OS X builds are GPLv2 due to including
fftw3.
#!/bin/sh
set -e
echo Running autoreconf...
autoreconf -ivf "$@"
echo Now run ./configure and then make to build Aegisub
AC_PREREQ(2.57) AC_PREREQ(2.57)
#######
# Setup
#######
AC_INIT([Aegisub], [aegisub_version],, [aegisub])
: ${CFLAGS=""}
: ${CXXFLAGS=""}
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADER([acconf.h])
AC_CONFIG_MACRO_DIR([m4macros])
AC_GNU_SOURCE
AC_CANONICAL_HOST
AM_SILENT_RULES([yes])
################### ###################
# Required packages # Required packages
################### ###################
...@@ -17,18 +30,6 @@ m4_define([pkgconfig_required_version], [0.20]) ...@@ -17,18 +30,6 @@ m4_define([pkgconfig_required_version], [0.20])
m4_define([portaudio_required_version], [19]) m4_define([portaudio_required_version], [19])
m4_define([wx_required_version], [3.0.0]) m4_define([wx_required_version], [3.0.0])
#######
# Setup
#######
AC_INIT([Aegisub], [aegisub_version],, [aegisub])
: ${CFLAGS=""}
: ${CXXFLAGS=""}
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADER([acconf.h])
AC_GNU_SOURCE
AC_CANONICAL_HOST
AM_SILENT_RULES([yes])
########################### ###########################
# Check host architecture # Check host architecture
########################### ###########################
......
Fichier déplacé
#!/bin/bash
# OPTIONS='
# --style=linux -s4
# --pad-oper --pad-header --pad-comma
# --align-pointer=name --align-reference=name
# --break-one-line-headers
# --remove-braces
# --break-return-type
# --convert-tabs
# --close-templates
# --max-code-length=101
# --mode=c
# --lineend=linux
# --attach-inlines
# --indent-labels
# --indent-col1-comments
# --indent-preproc-block'
OPTIONS='
--style=stroustrup
--lineend=linux
--attach-inlines --attach-namespaces --attach-classes --attach-extern-c --attach-closing-while --close-templates
--min-conditional-indent=0
--indent=tab
--pad-oper --pad-comma --pad-header
--align-pointer=name --align-reference=name
--break-closing-braces
--keep-one-line-blocks --keep-one-line-statements
'
SRC='./src ./automation ./libaegisub'
if [ $# -gt 0 ] && [ "$1" = "--check" ] ; then
astyle $OPTIONS --dry-run -R ./*.c | grep Formatted
[ $? -eq 1 ] && exit 0 || exit 1
fi
find $SRC -name '*.c' -exec astyle $OPTIONS --quiet {} \;
find $SRC -name '*.h' -exec astyle $OPTIONS --quiet {} \;
find $SRC -name '*.hpp' -exec astyle $OPTIONS --quiet {} \;
find $SRC -name '*.cpp' -exec astyle $OPTIONS --quiet {} \;
find $SRC -name '*.orig' -exec rm {} \;
#!/bin/sh
echo "# Create cscope.files database"
find . -iname '*.c' -o -iname '*.h' | egrep -v '^\.\/docs|depends|build|vendor|tests.*\/' > cscope.files
echo "# Create cscope.out database"
cscope -b -i cscope.files -f cscope.out
echo "# Create ctags database"
ctags -R ./automation ./src ./libaegisub
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter