Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
ca5df44e
Commit
ca5df44e
authored
10 years ago
by
Pavel Puchkin
Committed by
Loic Blot
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Standalone bundle for OSX (w/ dependencies!)
parent
76859692
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CMakeLists.txt
+14
-22
14 additions, 22 deletions
CMakeLists.txt
README.txt
+4
-4
4 additions, 4 deletions
README.txt
misc/Info.plist
+2
-2
2 additions, 2 deletions
misc/Info.plist
src/CMakeLists.txt
+14
-1
14 additions, 1 deletion
src/CMakeLists.txt
src/porting.cpp
+14
-23
14 additions, 23 deletions
src/porting.cpp
with
48 additions
and
52 deletions
CMakeLists.txt
+
14
−
22
View file @
ca5df44e
...
@@ -41,7 +41,7 @@ else()
...
@@ -41,7 +41,7 @@ else()
endif
()
endif
()
set
(
BUILD_CLIENT 1 CACHE BOOL
"Build client"
)
set
(
BUILD_CLIENT 1 CACHE BOOL
"Build client"
)
if
(
WIN32
)
if
(
WIN32
OR APPLE
)
set
(
BUILD_SERVER 0 CACHE BOOL
"Build server"
)
set
(
BUILD_SERVER 0 CACHE BOOL
"Build server"
)
else
()
else
()
set
(
BUILD_SERVER 1 CACHE BOOL
"Build server"
)
set
(
BUILD_SERVER 1 CACHE BOOL
"Build server"
)
...
@@ -72,11 +72,13 @@ if(WIN32)
...
@@ -72,11 +72,13 @@ if(WIN32)
set
(
EXAMPLE_CONF_DIR
"."
)
set
(
EXAMPLE_CONF_DIR
"."
)
set
(
LOCALEDIR
"locale"
)
set
(
LOCALEDIR
"locale"
)
elseif
(
APPLE
)
elseif
(
APPLE
)
set
(
SHAREDIR
"."
)
set
(
BUNDLE_NAME
${
PROJECT_NAME
}
.app
)
set
(
BINDIR
"."
)
set
(
BUNDLE_PATH
"
${
BUNDLE_NAME
}
"
)
set
(
DOCDIR
"./doc/
${
PROJECT_NAME
}
"
)
set
(
BINDIR
${
BUNDLE_NAME
}
/Contents/MacOS
)
set
(
SHAREDIR
${
BUNDLE_NAME
}
/Contents/Resources
)
set
(
DOCDIR
"
${
SHAREDIR
}
/
${
PROJECT_NAME
}
"
)
set
(
EXAMPLE_CONF_DIR
${
DOCDIR
}
)
set
(
EXAMPLE_CONF_DIR
${
DOCDIR
}
)
set
(
LOCALEDIR
"locale"
)
set
(
LOCALEDIR
"
${
SHAREDIR
}
/
locale"
)
elseif
(
UNIX
)
# Linux, BSD etc
elseif
(
UNIX
)
# Linux, BSD etc
if
(
RUN_IN_PLACE
)
if
(
RUN_IN_PLACE
)
set
(
SHAREDIR
"."
)
set
(
SHAREDIR
"."
)
...
@@ -176,6 +178,11 @@ if(UNIX AND NOT APPLE)
...
@@ -176,6 +178,11 @@ if(UNIX AND NOT APPLE)
install
(
FILES
"misc/minetest-icon.svg"
DESTINATION
"
${
ICONDIR
}
/hicolor/scalable/apps"
)
install
(
FILES
"misc/minetest-icon.svg"
DESTINATION
"
${
ICONDIR
}
/hicolor/scalable/apps"
)
endif
()
endif
()
if
(
APPLE
)
install
(
FILES
"misc/minetest-icon.icns"
DESTINATION
"
${
SHAREDIR
}
"
)
install
(
FILES
"misc/Info.plist"
DESTINATION
"
${
BUNDLE_PATH
}
/Contents"
)
endif
()
#
#
# Subdirectories
# Subdirectories
# Be sure to add all relevant definitions above this
# Be sure to add all relevant definitions above this
...
@@ -193,15 +200,6 @@ set(CPACK_PACKAGE_VENDOR "celeron55")
...
@@ -193,15 +200,6 @@ set(CPACK_PACKAGE_VENDOR "celeron55")
set
(
CPACK_PACKAGE_CONTACT
"Perttu Ahola <celeron55@gmail.com>"
)
set
(
CPACK_PACKAGE_CONTACT
"Perttu Ahola <celeron55@gmail.com>"
)
if
(
WIN32
)
if
(
WIN32
)
# For some reason these aren't copied otherwise
# NOTE: For some reason now it seems to work without these
#if(BUILD_CLIENT)
# install(FILES bin/minetest.exe DESTINATION bin)
#endif()
#if(BUILD_SERVER)
# install(FILES bin/minetestserver.exe DESTINATION bin)
#endif()
if
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
if
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
set
(
CPACK_PACKAGE_FILE_NAME
"
${
PROJECT_NAME
}
-
${
VERSION_STRING
}
-win64"
)
set
(
CPACK_PACKAGE_FILE_NAME
"
${
PROJECT_NAME
}
-
${
VERSION_STRING
}
-win64"
)
else
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
else
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
...
@@ -209,16 +207,10 @@ if(WIN32)
...
@@ -209,16 +207,10 @@ if(WIN32)
endif
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
endif
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
set
(
CPACK_GENERATOR ZIP
)
set
(
CPACK_GENERATOR ZIP
)
# This might be needed for some installer
#set(CPACK_PACKAGE_EXECUTABLES bin/minetest.exe "Minetest" bin/minetestserver.exe "Minetest Server")
elseif
(
APPLE
)
elseif
(
APPLE
)
set
(
CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0
)
set
(
CPACK_PACKAGE_FILE_NAME
"
${
PROJECT_NAME
}
-
${
VERSION_STRING
}
-osx"
)
set
(
CPACK_PACKAGE_FILE_NAME
"
${
PROJECT_NAME
}
-
${
VERSION_STRING
}
-osx"
)
set
(
CPACK_PACKAGE_ICON
${
CMAKE_CURRENT_SOURCE_DIR
}
/misc/minetest-icon.icns
)
set
(
CPACK_GENERATOR ZIP
)
set
(
CPACK_BUNDLE_NAME
${
PROJECT_NAME
}
)
set
(
CPACK_BUNDLE_ICON
${
CPACK_PACKAGE_ICON
}
)
set
(
CPACK_BUNDLE_PLIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/misc/Info.plist
)
set
(
CPACK_GENERATOR
"Bundle"
)
else
()
else
()
set
(
CPACK_PACKAGE_FILE_NAME
"
${
PROJECT_NAME
}
-
${
VERSION_STRING
}
-linux"
)
set
(
CPACK_PACKAGE_FILE_NAME
"
${
PROJECT_NAME
}
-
${
VERSION_STRING
}
-linux"
)
set
(
CPACK_GENERATOR TGZ
)
set
(
CPACK_GENERATOR TGZ
)
...
...
This diff is collapsed.
Click to expand it.
README.txt
+
4
−
4
View file @
ca5df44e
Minetest
Minetest
========
========
An InfiniMiner/Minecraft inspired game.
An InfiniMiner/Minecraft inspired game.
...
@@ -78,9 +78,9 @@ $share = /usr/share/minetest
...
@@ -78,9 +78,9 @@ $share = /usr/share/minetest
$user = ~/.minetest
$user = ~/.minetest
OS X:
OS X:
$bin =
?
$bin =
Contents/MacOS
$share =
?
$share =
Contents/Resources
$user = ~/Library/Application Support/minetest
$user =
Contents/User OR
~/Library/Application Support/minetest
World directory
World directory
----------------
----------------
...
...
This diff is collapsed.
Click to expand it.
misc/Info.plist
+
2
−
2
View file @
ca5df44e
...
@@ -5,9 +5,9 @@
...
@@ -5,9 +5,9 @@
<key>
CFBundleDevelopmentRegion
</key>
<key>
CFBundleDevelopmentRegion
</key>
<string>
English
</string>
<string>
English
</string>
<key>
CFBundleExecutable
</key>
<key>
CFBundleExecutable
</key>
<string>
../Resources/
minetest
</string>
<string>
minetest
</string>
<key>
CFBundleIconFile
</key>
<key>
CFBundleIconFile
</key>
<string>
minetest.icns
</string>
<string>
minetest
-icon
.icns
</string>
<key>
CFBundleIdentifier
</key>
<key>
CFBundleIdentifier
</key>
<string>
net.minetest.minetest
</string>
<string>
net.minetest.minetest
</string>
</dict>
</dict>
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
14
−
1
View file @
ca5df44e
...
@@ -737,7 +737,20 @@ if(WIN32)
...
@@ -737,7 +737,20 @@ if(WIN32)
endif
()
endif
()
if
(
BUILD_CLIENT
)
if
(
BUILD_CLIENT
)
install
(
TARGETS
${
PROJECT_NAME
}
DESTINATION
${
BINDIR
}
)
install
(
TARGETS
${
PROJECT_NAME
}
RUNTIME DESTINATION
${
BINDIR
}
LIBRARY DESTINATION
${
BINDIR
}
ARCHIVE DESTINATION
${
BINDIR
}
BUNDLE DESTINATION .
)
if
(
APPLE
)
install
(
CODE
"
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(
\"\$
{CMAKE_INSTALL_PREFIX}/
${
BUNDLE_PATH
}
\"
\"\"
\"\$
{CMAKE_INSTALL_PREFIX}/
${
BINDIR
}
\"
)
"
COMPONENT Runtime
)
endif
()
if
(
USE_GETTEXT
)
if
(
USE_GETTEXT
)
foreach
(
LOCALE
${
GETTEXT_AVAILABLE_LOCALES
}
)
foreach
(
LOCALE
${
GETTEXT_AVAILABLE_LOCALES
}
)
...
...
This diff is collapsed.
Click to expand it.
src/porting.cpp
+
14
−
23
View file @
ca5df44e
...
@@ -387,16 +387,16 @@ void initializePaths()
...
@@ -387,16 +387,16 @@ void initializePaths()
*/
*/
#elif defined(__APPLE__)
#elif defined(__APPLE__)
//https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/dyld.3.html
CFBundleRef
main_bundle
=
CFBundleGetMainBundle
();
//TODO: Test this code
CFURLRef
resources_url
=
CFBundleCopyResourcesDirectoryURL
(
main_bundle
);
char
buf
[
BUFSIZ
];
char
path
[
PATH_MAX
];
uint32_t
len
=
sizeof
(
buf
);
if
(
CFURLGetFileSystemRepresentation
(
resources_url
,
TRUE
,
(
UInt8
*
)
path
,
PATH_MAX
))
{
FATAL_ERROR_IF
(
_NSGetExecutablePath
(
buf
,
&
len
)
==
-
1
,
""
);
path_share
=
std
::
string
(
path
);
path_user
=
std
::
string
(
path
)
+
"/../User"
;
pathRemoveFile
(
buf
,
'/'
);
}
else
{
dstream
<<
"WARNING: Could not determine bundle resource path"
<<
std
::
endl
;
path_share
=
std
::
string
(
buf
)
+
"/.."
;
}
path_user
=
std
::
string
(
buf
)
+
"/.."
;
CFRelease
(
resources_url
)
;
/*
/*
FreeBSD
FreeBSD
...
@@ -523,24 +523,15 @@ void initializePaths()
...
@@ -523,24 +523,15 @@ void initializePaths()
*/
*/
#elif defined(__APPLE__)
#elif defined(__APPLE__)
// Code based on
// http://stackoverflow.com/questions/516200/relative-paths-not-working-in-xcode-c
CFBundleRef
main_bundle
=
CFBundleGetMainBundle
();
CFBundleRef
main_bundle
=
CFBundleGetMainBundle
();
CFURLRef
resources_url
=
CFBundleCopyResourcesDirectoryURL
(
main_bundle
);
CFURLRef
resources_url
=
CFBundleCopyResourcesDirectoryURL
(
main_bundle
);
char
path
[
PATH_MAX
];
char
path
[
PATH_MAX
];
if
(
CFURLGetFileSystemRepresentation
(
resources_url
,
TRUE
,
(
UInt8
*
)
path
,
PATH_MAX
))
if
(
CFURLGetFileSystemRepresentation
(
resources_url
,
TRUE
,
(
UInt8
*
)
path
,
PATH_MAX
))
{
{
path_share
=
std
::
string
(
path
);
dstream
<<
"Bundle resource path: "
<<
path
<<
std
::
endl
;
}
else
{
//chdir(path);
dstream
<<
"WARNING: Could not determine bundle resource path"
<<
std
::
endl
;
path_share
=
std
::
string
(
path
)
+
DIR_DELIM
+
STATIC_SHAREDIR
;
}
else
{
// error!
dstream
<<
"WARNING: Could not determine bundle resource path"
<<
std
::
endl
;
}
}
CFRelease
(
resources_url
);
CFRelease
(
resources_url
);
path_user
=
std
::
string
(
getenv
(
"HOME"
))
+
"/Library/Application Support/"
+
PROJECT_NAME
;
path_user
=
std
::
string
(
getenv
(
"HOME"
))
+
"/Library/Application Support/"
+
PROJECT_NAME
;
#else // FreeBSD, and probably many other POSIX-like systems.
#else // FreeBSD, and probably many other POSIX-like systems.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment