Ports: Update milkytracker's patches to use git patches

This commit is contained in:
Ali Mohammad Pur 2022-05-17 21:21:11 +04:30 committed by Ali Mohammad Pur
parent e1a5f63e1a
commit 37857a629d
10 changed files with 157 additions and 60 deletions

View file

@ -0,0 +1,24 @@
From c91a634240ee82739c68dc49aad2bd1b6916fedd Mon Sep 17 00:00:00 2001
From: "jake.westrip" <jake.westrip@lonsec.com.au>
Date: Tue, 27 Apr 2021 18:34:53 +1000
Subject: [PATCH 1/5] Include strings.h
---
src/ppui/BasicTypes.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/ppui/BasicTypes.h b/src/ppui/BasicTypes.h
index 20eba8b..e353345 100644
--- a/src/ppui/BasicTypes.h
+++ b/src/ppui/BasicTypes.h
@@ -30,6 +30,7 @@ typedef signed short pp_int16;
typedef unsigned int pp_uint32;
typedef signed int pp_int32;
+#include <strings.h>
#include "ScanCodes.h"
#if defined(WIN32) || defined(_WIN32_WCE)
--
2.36.1

View file

@ -1,5 +1,16 @@
--- MilkyTracker-1.03.00/src/ppui/sdl/DisplayDevice_SDL.cpp 2021-04-27 15:17:42.529000000 +1000
+++ MilkyTracker-1.03.00/src/ppui/sdl/DisplayDevice_SDL.cpp 2021-04-27 15:17:42.529000000 +1000
From f02afb523d34a56d8da426cee6fb56d3f57b4882 Mon Sep 17 00:00:00 2001
From: "jake.westrip" <jake.westrip@lonsec.com.au>
Date: Tue, 27 Apr 2021 18:34:53 +1000
Subject: [PATCH 2/5] Remove OpenGL
---
src/ppui/sdl/DisplayDevice_SDL.cpp | 42 ++----------------------------
1 file changed, 2 insertions(+), 40 deletions(-)
diff --git a/src/ppui/sdl/DisplayDevice_SDL.cpp b/src/ppui/sdl/DisplayDevice_SDL.cpp
index a4b966c..7ecedc7 100644
--- a/src/ppui/sdl/DisplayDevice_SDL.cpp
+++ b/src/ppui/sdl/DisplayDevice_SDL.cpp
@@ -26,30 +26,8 @@
SDL_Window* PPDisplayDevice::CreateWindow(pp_int32& w, pp_int32& h, pp_int32& bpp, Uint32 flags)
{
@ -32,7 +43,7 @@
if (theWindow == NULL)
{
@@ -59,7 +37,7 @@
@@ -59,7 +37,7 @@ SDL_Window* PPDisplayDevice::CreateWindow(pp_int32& w, pp_int32& h, pp_int32& bp
w = getDefaultWidth();
h = getDefaultHeight();
@ -41,7 +52,7 @@
if (theWindow == NULL)
{
@@ -69,21 +47,6 @@
@@ -69,21 +47,6 @@ SDL_Window* PPDisplayDevice::CreateWindow(pp_int32& w, pp_int32& h, pp_int32& bp
}
}
@ -63,11 +74,14 @@
// Prevent window from being resized below minimum
SDL_SetWindowMinimumSize(theWindow, w, h);
fprintf(stderr, "SDL: Minimum window size set to %dx%d.\n", w, h);
@@ -105,7 +68,6 @@
@@ -105,7 +68,6 @@ PPDisplayDevice::PPDisplayDevice(pp_int32 width,
bFullScreen = fullScreen;
- drv_index = -1;
initMousePointers();
}
}
--
2.36.1

View file

@ -0,0 +1,37 @@
From 5db35a017501fd2e8975d931d77591fdd8d40ed7 Mon Sep 17 00:00:00 2001
From: "jake.westrip" <jake.westrip@lonsec.com.au>
Date: Tue, 27 Apr 2021 18:34:53 +1000
Subject: [PATCH 3/5] Set C++ standard to C++20 and remove some unnecessary
subdirectories
---
CMakeLists.txt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4bdecf1..a64b843 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,8 +22,8 @@
cmake_minimum_required(VERSION 3.10)
project(MilkyTracker)
-# Set C++ standard to C++98
-set(CMAKE_CXX_STANDARD 98)
+# Set C++ standard to C++20
+set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
# Enable IDE solution folders
@@ -220,8 +220,6 @@ if(APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${SUFFIXES_ORIG})
endif()
-add_subdirectory(docs)
-add_subdirectory(resources/music)
add_subdirectory(src/compression)
add_subdirectory(src/fx)
add_subdirectory(src/milkyplay)
--
2.36.1

View file

@ -0,0 +1,24 @@
From 356ec6ffc3184d83e28ba6ad6c4667ac67b6d074 Mon Sep 17 00:00:00 2001
From: "jake.westrip" <jake.westrip@lonsec.com.au>
Date: Wed, 28 Apr 2021 21:19:03 +1000
Subject: [PATCH 4/5] Link against the needed serenity libraries
---
src/tracker/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/tracker/CMakeLists.txt b/src/tracker/CMakeLists.txt
index f4243a0..02f67c0 100644
--- a/src/tracker/CMakeLists.txt
+++ b/src/tracker/CMakeLists.txt
@@ -374,4 +374,7 @@ else()
set(INSTALL_DEST ${CMAKE_INSTALL_BINDIR})
endif()
+target_link_libraries(tracker -lSDL2 -lgui -lipc -lm)
+set(INSTALL_DEST bin)
+
install(TARGETS tracker DESTINATION ${INSTALL_DEST})
--
2.36.1

View file

@ -0,0 +1,25 @@
From 8938812509ede61e6f50b65ebba94b8809eb0cf5 Mon Sep 17 00:00:00 2001
From: "jake.westrip" <jake.westrip@lonsec.com.au>
Date: Tue, 27 Apr 2021 18:34:53 +1000
Subject: [PATCH 5/5] Replace tmpnam with mkstemp
---
src/ppui/osinterface/posix/PPSystem_POSIX.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ppui/osinterface/posix/PPSystem_POSIX.cpp b/src/ppui/osinterface/posix/PPSystem_POSIX.cpp
index 9b84cfe..03b22b4 100644
--- a/src/ppui/osinterface/posix/PPSystem_POSIX.cpp
+++ b/src/ppui/osinterface/posix/PPSystem_POSIX.cpp
@@ -67,7 +67,7 @@ const SYSCHAR* System::getTempFileName()
// instead of a file name.
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- if ((tmpnam(buffer) == NULL))
+ if ((mkstemp(buffer) == NULL))
#pragma clang diagnostic pop
{
// should not be the case, if it is the case, create something that
--
2.36.1

View file

@ -1,10 +0,0 @@
--- MilkyTracker-1.03.00/src/ppui/BasicTypes.h 2021-04-27 15:17:42.529000000 +1000
+++ MilkyTracker-1.03.00/src/ppui/BasicTypes.h 2021-04-27 15:17:42.529000000 +1000
@@ -30,6 +30,7 @@
typedef unsigned int pp_uint32;
typedef signed int pp_int32;
+#include <strings.h>
#include "ScanCodes.h"
#if defined(WIN32) || defined(_WIN32_WCE)

View file

@ -0,0 +1,27 @@
# Patches for milkytracker on SerenityOS
## `0001-Include-strings.h.patch`
Include strings.h
## `0002-Remove-OpenGL.patch`
Remove OpenGL
## `0003-Set-C-standard-to-C-20-and-remove-some-unnecessary-s.patch`
Set C++ standard to C++20 and remove some unnecessary subdirectories
## `0004-Link-against-the-needed-serenity-libraries.patch`
Link against the needed serenity libraries
## `0005-Replace-tmpnam-with-mkstemp.patch`
Replace tmpnam with mkstemp

View file

@ -1,22 +0,0 @@
--- MilkyTracker-1.03.00/CMakeLists.txt 2021-04-27 15:17:42.529000000 +1000
+++ MilkyTracker-1.03.00/CMakeLists.txt 2021-04-27 15:17:50.388987606 +1000
@@ -22,8 +22,8 @@
cmake_minimum_required(VERSION 3.10)
project(MilkyTracker)
-# Set C++ standard to C++98
-set(CMAKE_CXX_STANDARD 98)
+# Set C++ standard to C++20
+set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
# Enable IDE solution folders
@@ -220,8 +220,6 @@
set(CMAKE_FIND_LIBRARY_SUFFIXES ${SUFFIXES_ORIG})
endif()
-add_subdirectory(docs)
-add_subdirectory(resources/music)
add_subdirectory(src/compression)
add_subdirectory(src/fx)
add_subdirectory(src/milkyplay)

View file

@ -1,11 +0,0 @@
--- MilkyTracker-1.03.00/src/tracker/CMakeLists.txt 2021-04-27 15:17:42.529000000 +1000
+++ MilkyTracker-1.03.00/src/tracker/CMakeLists.txt 2021-04-27 15:17:42.529000000 +1000
@@ -374,4 +375,7 @@
set(INSTALL_DEST ${CMAKE_INSTALL_BINDIR})
endif()
+target_link_libraries(tracker -lSDL2 -lgui -lipc -lm)
+set(INSTALL_DEST bin)
+
install(TARGETS tracker DESTINATION ${INSTALL_DEST})

View file

@ -1,11 +0,0 @@
--- MilkyTracker-1.03.00/src/ppui/osinterface/posix/PPSystem_POSIX.cpp 2021-04-27 15:17:42.529000000 +1000
+++ MilkyTracker-1.03.00/src/ppui/osinterface/posix/PPSystem_POSIX.cpp 2021-04-27 15:17:42.529000000 +1000
@@ -67,7 +69,7 @@
// instead of a file name.
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- if ((tmpnam(buffer) == NULL))
+ if ((mkstemp(buffer) == NULL))
#pragma clang diagnostic pop
{
// should not be the case, if it is the case, create something that