Skip to content

Commit

Permalink
Port SDL3 release scripts to SDL2
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
madebr committed Sep 16, 2024
1 parent 1b26b54 commit 5516dbd
Show file tree
Hide file tree
Showing 8 changed files with 1,127 additions and 0 deletions.
403 changes: 403 additions & 0 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ gen
Build
buildbot
/VERSION.txt
dist

*.so
*.so.*
Expand Down
633 changes: 633 additions & 0 deletions build-scripts/build-release.py

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions build-scripts/cmake-toolchain-mingw64-i686.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86)

find_program(CMAKE_C_COMPILER NAMES i686-w64-mingw32-gcc)
find_program(CMAKE_CXX_COMPILER NAMES i686-w64-mingw32-g++)
find_program(CMAKE_RC_COMPILER NAMES i686-w64-mingw32-windres windres)

if(NOT CMAKE_C_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.")
endif()

if(NOT CMAKE_CXX_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.")
endif()

if(NOT CMAKE_RC_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.")
endif()
18 changes: 18 additions & 0 deletions build-scripts/cmake-toolchain-mingw64-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

find_program(CMAKE_C_COMPILER NAMES x86_64-w64-mingw32-gcc)
find_program(CMAKE_CXX_COMPILER NAMES x86_64-w64-mingw32-g++)
find_program(CMAKE_RC_COMPILER NAMES x86_64-w64-mingw32-windres windres)

if(NOT CMAKE_C_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.")
endif()

if(NOT CMAKE_CXX_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.")
endif()

if(NOT CMAKE_RC_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.")
endif()
6 changes: 6 additions & 0 deletions build-scripts/create-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

commit=$(git rev-parse HEAD)
echo "Creating release workflow for commit $commit"
gh workflow run release.yml --ref main -f commit=$commit

18 changes: 18 additions & 0 deletions mingw/pkg-support/INSTALL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

The 32-bit files are in i686-w64-mingw32
The 64-bit files are in x86_64-w64-mingw32

To install SDL for native development:
make native

To install SDL for cross-compiling development:
make cross

Look at the example programs in ./test, and check out online documentation:
http://wiki.libsdl.org/

Join the SDL developer mailing list if you want to join the community:
http://www.libsdl.org/mailing-list.php

That's it!
Sam Lantinga <slouken@libsdl.org>
30 changes: 30 additions & 0 deletions mingw/pkg-support/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Makefile for installing the mingw32 version of the SDL library

CROSS_PATH := /usr/local
ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32

all install:
@echo "Type \"make native\" to install 32-bit to /usr"
@echo "Type \"make cross\" to install 32-bit and 64-bit to $(CROSS_PATH)"

native:
make install-package arch=i686-w64-mingw32 prefix=/usr

cross:
for arch in $(ARCHITECTURES); do \
make install-package arch=$$arch prefix=$(CROSS_PATH)/$$arch; \
done

install-package:
@if test -d $(arch) && test -d $(prefix); then \
(cd $(arch) && cp -rv bin include lib share $(prefix)/); \
sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/bin/sdl2-config >$(prefix)/bin/sdl2-config; \
chmod 755 $(prefix)/bin/sdl2-config; \
sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2.la >$(prefix)/lib/libSDL2.la; \
sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2main.la >$(prefix)/lib/libSDL2main.la; \
sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/lib/pkgconfig/sdl2.pc >$(prefix)/lib/pkgconfig/sdl2.pc; \
else \
echo "*** ERROR: $(arch) or $(prefix) does not exist!"; \
exit 1; \
fi

0 comments on commit 5516dbd

Please sign in to comment.