Skip to content

Commit 48aa1cc

Browse files
committed
Port build-script from SDL3
[ci skip]
1 parent 15bc3f2 commit 48aa1cc

File tree

7 files changed

+821
-365
lines changed

7 files changed

+821
-365
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ build
1515
gen
1616
Build
1717
buildbot
18-
/VERSION.txt
18+
/REVISION.txt
1919
dist
2020

2121
*.so

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,8 +3081,8 @@ endif()
30813081

30823082
# Compat helpers for the configuration files
30833083

3084-
if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION.txt")
3085-
file(READ "${PROJECT_SOURCE_DIR}/VERSION.txt" SDL_SOURCE_VERSION)
3084+
if(EXISTS "${PROJECT_SOURCE_DIR}/REVISION.txt")
3085+
file(READ "${PROJECT_SOURCE_DIR}/REVISION.txt" SDL_SOURCE_VERSION)
30863086
string(STRIP "${SDL_SOURCE_VERSION}" SDL_SOURCE_VERSION)
30873087
endif()
30883088

build-scripts/build-release.py

Lines changed: 764 additions & 295 deletions
Large diffs are not rendered by default.

build-scripts/create-release.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import argparse
44
from pathlib import Path
@@ -10,17 +10,18 @@
1010
ROOT = Path(__file__).resolve().parents[1]
1111

1212

13-
def determine_project() -> str:
13+
def determine_remote() -> str:
1414
text = (ROOT / "build-scripts/release-info.json").read_text()
1515
release_info = json.loads(text)
16+
if "remote" in release_info:
17+
return release_info["remote"]
1618
project_with_version = release_info["name"]
1719
project, _ = re.subn("([^a-zA-Z_])", "", project_with_version)
18-
return project
20+
return f"libsdl-org/{project}"
1921

2022

2123
def main():
22-
project = determine_project()
23-
default_remote = f"libsdl-org/{project}"
24+
default_remote = determine_remote()
2425

2526
current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=ROOT, text=True).strip()
2627

build-scripts/release-info.json

Lines changed: 45 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "SDL2",
3+
"remote": "libsdl-org/SDL",
34
"version": {
45
"file": "include/SDL_version.h",
56
"re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$",
@@ -23,10 +24,15 @@
2324
"autotools": {
2425
"archs": ["x86", "x64"],
2526
"args": [
26-
]
27+
],
28+
"files": {
29+
"@<@TRIPLET@>@/include/SDL2": [
30+
"include/SDL_config*.h"
31+
]
32+
}
2733
},
2834
"files": {
29-
"/": [
35+
"": [
3036
"mingw/pkg-support/INSTALL.txt",
3137
"mingw/pkg-support/Makefile",
3238
"BUGS.txt",
@@ -36,15 +42,12 @@
3642
"LICENSE.txt",
3743
"README.md"
3844
],
39-
"/cmake/": [
45+
"cmake": [
4046
"mingw/pkg-support/cmake/sdl2-config.cmake",
4147
"mingw/pkg-support/cmake/sdl2-config-version.cmake"
4248
],
43-
"/docs/": [
49+
"docs": [
4450
"docs/*"
45-
],
46-
"/@TRIPLET@/include/SDL2/": [
47-
"include/SDL_config*.h"
4851
]
4952
}
5053
},
@@ -59,61 +62,44 @@
5962
"VisualC/SDLmain/SDLmain.vcxproj",
6063
"VisualC/SDLtest/SDLtest.vcxproj"
6164
],
62-
"files": [
63-
{
64-
"lib": "",
65-
"devel": "lib/@ARCH@",
66-
"paths": [
67-
"VisualC/SDL/@PLATFORM@/@CONFIGURATION@/SDL2.dll"
68-
]
69-
},
70-
{
71-
"devel": "lib/@ARCH@",
72-
"paths": [
73-
"VisualC/SDL/@PLATFORM@/@CONFIGURATION@/SDL2.lib",
74-
"VisualC/SDL/@PLATFORM@/@CONFIGURATION@/SDL2.pdb",
75-
"VisualC/SDLmain/@PLATFORM@/@CONFIGURATION@/SDL2main.lib",
76-
"VisualC/SDLtest/@PLATFORM@/@CONFIGURATION@/SDL2test.lib"
77-
]
78-
}
79-
]
80-
},
81-
"files": [
82-
{
83-
"devel": "",
84-
"lib": "",
85-
"paths": [
86-
"README-SDL.txt"
87-
]
88-
},
89-
{
90-
"devel": "",
91-
"paths": [
92-
"BUGS.txt",
93-
"LICENSE.txt",
94-
"README.md",
95-
"WhatsNew.txt"
96-
]
97-
},
98-
{
99-
"devel": "cmake",
100-
"paths": [
101-
"VisualC/pkg-support/cmake/sdl2-config.cmake",
102-
"VisualC/pkg-support/cmake/sdl2-config-version.cmake"
103-
]
104-
},
105-
{
106-
"devel": "docs",
107-
"paths": [
108-
"docs/*"
65+
"files-lib": {
66+
"": [
67+
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll"
10968
]
11069
},
111-
{
112-
"devel": "include",
113-
"paths": [
114-
"include/*.h"
70+
"files-devel": {
71+
"lib/@<@ARCH@>@": [
72+
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.dll",
73+
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.lib",
74+
"VisualC/SDL/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2.pdb",
75+
"VisualC/SDLmain/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2main.lib",
76+
"VisualC/SDLtest/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL2test.lib"
11577
]
11678
}
117-
]
79+
},
80+
"files-lib": {
81+
"": [
82+
"README-SDL.txt"
83+
]
84+
},
85+
"files-devel": {
86+
"": [
87+
"README-SDL.txt",
88+
"BUGS.txt",
89+
"LICENSE.txt",
90+
"README.md",
91+
"WhatsNew.txt"
92+
],
93+
"cmake": [
94+
"VisualC/pkg-support/cmake/sdl2-config.cmake",
95+
"VisualC/pkg-support/cmake/sdl2-config-version.cmake"
96+
],
97+
"docs": [
98+
"docs/*"
99+
],
100+
"include": [
101+
"include/*.h"
102+
]
103+
}
118104
}
119105
}

build-scripts/showrev.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
SDL_ROOT=$(dirname $0)/..
66
cd $SDL_ROOT
77

8-
if [ -e ./VERSION.txt ]; then
9-
cat ./VERSION.txt
8+
if [ -e ./REVISION.txt ]; then
9+
cat ./REVISION.txt
1010
exit 0
1111
fi
1212

build-scripts/updaterev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ done
2929
rev=`sh showrev.sh 2>/dev/null`
3030
if [ "$rev" != "" ]; then
3131
if [ -n "$dist" ]; then
32-
echo "$rev" > "$outdir/VERSION.txt"
32+
echo "$rev" > "$outdir/REVISION.txt"
3333
fi
3434
echo "/* Generated by updaterev.sh, do not edit */" >"$header.new"
3535
if [ -n "$vendor" ]; then

0 commit comments

Comments
 (0)