forked from git-for-windows/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmingw-use-X11-like-path-layout.patch
106 lines (97 loc) · 3.87 KB
/
mingw-use-X11-like-path-layout.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
diff -Naur blender-2.72-orig/intern/ghost/intern/GHOST_SystemPathsWin32.cpp blender-2.72/intern/ghost/intern/GHOST_SystemPathsWin32.cpp
--- blender-2.72-orig/intern/ghost/intern/GHOST_SystemPathsWin32.cpp 2014-10-08 00:07:23.583905600 +0100
+++ blender-2.72/intern/ghost/intern/GHOST_SystemPathsWin32.cpp 2014-10-08 00:08:46.678658400 +0100
@@ -69,6 +69,44 @@
{
}
+#if defined(__MINGW32__)
+
+const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
+{
+ static char knownpath[MAX_PATH * 3 + 128] = {0};
+
+ char temppath[MAX_PATH + 1];
+ char temppath2[MAX_PATH + 1];
+ const GHOST_TUns8 *binary_dir = getBinaryDir();
+ strcpy(temppath2, reinterpret_cast<const char*>(binary_dir));
+ char* lastslash = strrchr(temppath2, '\\');
+ if (lastslash != NULL) {
+ *lastslash = '\0';
+ }
+ snprintf(temppath, sizeof(temppath), "%s\\..\\share\\blender\\%s", temppath2, versionstr);
+ temppath[MAX_PATH] = '\0';
+ GetFullPathNameA(temppath, sizeof(knownpath), knownpath, NULL);
+ return (GHOST_TUns8*)knownpath;
+}
+
+const GHOST_TUns8 *GHOST_SystemPathsWin32::getUserDir(int, const char *versionstr) const
+{
+ static char knownpath[MAX_PATH * 3 + 128] = {0};
+
+ char temppath[MAX_PATH + 1];
+ char temppath2[MAX_PATH + 1];
+ const GHOST_TUns8 *binary_dir = getBinaryDir();
+ strcpy(temppath2, reinterpret_cast<const char*>(binary_dir));
+ char* lastslash = strrchr(temppath2, '\\');
+ if (lastslash != NULL) {
+ *lastslash = '\0';
+ }
+ snprintf(temppath, sizeof(temppath), "%s\\..\\..\\home\\%s\\.blender\\%s", temppath2, getenv("USERNAME") ?: "unknown", versionstr);
+ temppath[MAX_PATH] = '\0';
+ GetFullPathNameA(temppath, sizeof(knownpath), knownpath, NULL);
+ return (GHOST_TUns8*)knownpath;
+}
+#else
const GHOST_TUns8 *GHOST_SystemPathsWin32::getSystemDir(int, const char *versionstr) const
{
static char knownpath[MAX_PATH * 3 + 128] = {0}; /* 1 utf-16 might translante into 3 utf-8. 2 utf-16 translates into 4 utf-8*/
@@ -105,6 +143,8 @@
return NULL;
}
+#endif
+
const GHOST_TUns8 *GHOST_SystemPathsWin32::getBinaryDir() const
{
static char fullname[MAX_PATH * 3] = {0};
diff -Naur blender-2.72-orig/source/creator/CMakeLists.txt blender-2.72/source/creator/CMakeLists.txt
--- blender-2.72-orig/source/creator/CMakeLists.txt 2014-09-24 19:29:55.000000000 +0400
+++ blender-2.72/source/creator/CMakeLists.txt 2014-10-07 09:16:00.095600000 +0400
@@ -256,7 +256,7 @@
# -----------------------------------------------------------------------------
# Platform Specific Var: TARGETDIR_VER
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
if(WITH_INSTALL_PORTABLE)
set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
else()
@@ -393,13 +393,13 @@
# -----------------------------------------------------------------------------
# Install Targets (Platform Specific)
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR MINGW)
if(NOT WITH_PYTHON_MODULE)
if(WITH_DOC_MANPAGE)
add_custom_target(
blender_man_page ALL
- COMMAND ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
+ COMMAND python3 ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1.py
${EXECUTABLE_OUTPUT_PATH}/blender
${CMAKE_CURRENT_BINARY_DIR}/blender.1)
add_dependencies(blender_man_page blender)
@@ -1003,7 +1003,7 @@
install(TARGETS blender blender-launcher
COMPONENT Blender
- DESTINATION ".")
+ DESTINATION bin)
if(MSVC12_REDIST_DIR)
if(CMAKE_CL_64)
diff -Naur blender-2.72-orig/source/blenderplayer/CMakeLists.txt blender-2.72/source/blenderplayer/CMakeLists.txt
--- blender-2.72-orig/source/blenderplayer/CMakeLists.txt 2014-09-24 19:29:55.000000000 +0400
+++ blender-2.72/source/blenderplayer/CMakeLists.txt 2014-10-07 09:16:00.095600000 +0400
@@ -58,7 +58,7 @@
install(TARGETS blenderplayer
COMPONENT Blenderplayer
- DESTINATION ".")
+ DESTINATION bin)
elseif(APPLE)
add_executable(blenderplayer ${EXETYPE} bad_level_call_stubs/stubs.c)