Port build-script from SDL3

[ci skip]
This commit is contained in:
Anonymous Maarten 2024-11-01 23:08:36 +01:00
parent 15bc3f25ee
commit 48aa1cccf7
7 changed files with 816 additions and 360 deletions

2
.gitignore vendored
View file

@ -15,7 +15,7 @@ build
gen gen
Build Build
buildbot buildbot
/VERSION.txt /REVISION.txt
dist dist
*.so *.so

View file

@ -3081,8 +3081,8 @@ endif()
# Compat helpers for the configuration files # Compat helpers for the configuration files
if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION.txt") if(EXISTS "${PROJECT_SOURCE_DIR}/REVISION.txt")
file(READ "${PROJECT_SOURCE_DIR}/VERSION.txt" SDL_SOURCE_VERSION) file(READ "${PROJECT_SOURCE_DIR}/REVISION.txt" SDL_SOURCE_VERSION)
string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION) string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION)
endif() endif()

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import argparse import argparse
from pathlib import Path from pathlib import Path
@ -10,17 +10,18 @@ import subprocess
ROOT = Path(__file__).resolve().parents[1] ROOT = Path(__file__).resolve().parents[1]
def determine_project() -> str: def determine_remote() -> str:
text = (ROOT / "build-scripts/release-info.json").read_text() text = (ROOT / "build-scripts/release-info.json").read_text()
release_info = json.loads(text) release_info = json.loads(text)
if "remote" in release_info:
return release_info["remote"]
project_with_version = release_info["name"] project_with_version = release_info["name"]
project, _ = re.subn("([^a-zA-Z_])", "", project_with_version) project, _ = re.subn("([^a-zA-Z_])", "", project_with_version)
return project return f"libsdl-org/{project}"
def main(): def main():
project = determine_project() default_remote = determine_remote()
default_remote = f"libsdl-org/{project}"
current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip() current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()

View file

@ -1,5 +1,6 @@
{ {
"name": "SDL2", "name": "SDL2",
"remote": "libsdl-org/SDL",
"version": { "version": {
"file": "include/SDL_version.h", "file": "include/SDL_version.h",
"re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$", "re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$",
@ -23,10 +24,15 @@
"autotools": { "autotools": {
"archs": ["x86", "x64"], "archs": ["x86", "x64"],
"args": [ "args": [
] ],
"files": {
"@<@TRIPLET@>@/include/SDL2": [
"include/SDL_config*.h"
]
}
}, },
"files": { "files": {
"/": [ "": [
"mingw/pkg-support/INSTALL.txt", "mingw/pkg-support/INSTALL.txt",
"mingw/pkg-support/Makefile", "mingw/pkg-support/Makefile",
"BUGS.txt", "BUGS.txt",
@ -36,15 +42,12 @@
"LICENSE.txt", "LICENSE.txt",
"README.md" "README.md"
], ],
"/cmake/": [ "cmake": [
"mingw/pkg-support/cmake/sdl2-config.cmake", "mingw/pkg-support/cmake/sdl2-config.cmake",
"mingw/pkg-support/cmake/sdl2-config-version.cmake" "mingw/pkg-support/cmake/sdl2-config-version.cmake"
], ],
"/docs/": [ "docs": [
"docs/*" "docs/*"
],
"/@TRIPLET@/include/SDL2/": [
"include/SDL_config*.h"
] ]
} }
}, },
@ -59,61 +62,44 @@
"VisualC/SDLmain/SDLmain.vcxproj", "VisualC/SDLmain/SDLmain.vcxproj",
"VisualC/SDLtest/SDLtest.vcxproj" "VisualC/SDLtest/SDLtest.vcxproj"
], ],
"files": [ "files-lib": {
{ "": [
"lib": "", "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll"
"devel": "lib/@ARCH@",
"paths": [
"VisualC/SDL/@PLATFORM@/@CONFIGURATION@/SDL2.dll"
]
},
{
"devel": "lib/@ARCH@",
"paths": [
"VisualC/SDL/@PLATFORM@/@CONFIGURATION@/SDL2.lib",
"VisualC/SDL/@PLATFORM@/@CONFIGURATION@/SDL2.pdb",
"VisualC/SDLmain/@PLATFORM@/@CONFIGURATION@/SDL2main.lib",
"VisualC/SDLtest/@PLATFORM@/@CONFIGURATION@/SDL2test.lib"
]
}
]
},
"files": [
{
"devel": "",
"lib": "",
"paths": [
"README-SDL.txt"
] ]
}, },
{ "files-devel": {
"devel": "", "lib/@<@ARCH@>@": [
"paths": [ "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll",
"BUGS.txt", "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.lib",
"LICENSE.txt", "VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.pdb",
"README.md", "VisualC/SDLmain/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2main.lib",
"WhatsNew.txt" "VisualC/SDLtest/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2test.lib"
]
},
{
"devel": "cmake",
"paths": [
"VisualC/pkg-support/cmake/sdl2-config.cmake",
"VisualC/pkg-support/cmake/sdl2-config-version.cmake"
]
},
{
"devel": "docs",
"paths": [
"docs/*"
]
},
{
"devel": "include",
"paths": [
"include/*.h"
] ]
} }
] },
"files-lib": {
"": [
"README-SDL.txt"
]
},
"files-devel": {
"": [
"README-SDL.txt",
"BUGS.txt",
"LICENSE.txt",
"README.md",
"WhatsNew.txt"
],
"cmake": [
"VisualC/pkg-support/cmake/sdl2-config.cmake",
"VisualC/pkg-support/cmake/sdl2-config-version.cmake"
],
"docs": [
"docs/*"
],
"include": [
"include/*.h"
]
}
} }
} }

View file

@ -5,8 +5,8 @@
SDL_ROOT=$(dirname $0)/.. SDL_ROOT=$(dirname $0)/..
cd $SDL_ROOT cd $SDL_ROOT
if [ -e ./VERSION.txt ]; then if [ -e ./REVISION.txt ]; then
cat ./VERSION.txt cat ./REVISION.txt
exit 0 exit 0
fi fi

View file

@ -29,7 +29,7 @@ done
rev=`sh showrev.sh 2>/dev/null` rev=`sh showrev.sh 2>/dev/null`
if [ "$rev" != "" ]; then if [ "$rev" != "" ]; then
if [ -n "$dist" ]; then if [ -n "$dist" ]; then
echo "$rev" > "$outdir/VERSION.txt" echo "$rev" > "$outdir/REVISION.txt"
fi fi
echo "/* Generated by updaterev.sh, do not edit */" >"$header.new" echo "/* Generated by updaterev.sh, do not edit */" >"$header.new"
if [ -n "$vendor" ]; then if [ -n "$vendor" ]; then