physfs.py 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. physfs_py-0.3.0/CMakeLists.txt +33 -0
  2. physfs_py-0.3.0/MANIFEST.in +14 -0
  3. physfs_py-0.3.0/PKG-INFO +77 -0
  4. physfs_py-0.3.0/README.md +55 -0
  5. physfs_py-0.3.0/libs/physfs/CMakeLists.txt +344 -0
  6. physfs_py-0.3.0/libs/physfs/LICENSE.txt +17 -0
  7. physfs_py-0.3.0/libs/physfs/src/Makefile.os2 +94 -0
  8. physfs_py-0.3.0/libs/physfs/src/physfs.c +3468 -0
  9. physfs_py-0.3.0/libs/physfs/src/physfs.h +3930 -0
  10. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_7z.c +433 -0
  11. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_csm.c +123 -0
  12. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_dir.c +196 -0
  13. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_grp.c +116 -0
  14. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_hog.c +170 -0
  15. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_iso9660.c +387 -0
  16. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_mvl.c +110 -0
  17. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_qpak.c +127 -0
  18. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_slb.c +136 -0
  19. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_unpacked.c +305 -0
  20. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_vdf.c +169 -0
  21. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_wad.c +135 -0
  22. physfs_py-0.3.0/libs/physfs/src/physfs_archiver_zip.c +1718 -0
  23. physfs_py-0.3.0/libs/physfs/src/physfs_byteorder.c +137 -0
  24. physfs_py-0.3.0/libs/physfs/src/physfs_casefolding.h +2758 -0
  25. physfs_py-0.3.0/libs/physfs/src/physfs_internal.h +787 -0
  26. physfs_py-0.3.0/libs/physfs/src/physfs_lzmasdk.h +6031 -0
  27. physfs_py-0.3.0/libs/physfs/src/physfs_miniz.h +710 -0
  28. physfs_py-0.3.0/libs/physfs/src/physfs_platform_android.c +117 -0
  29. physfs_py-0.3.0/libs/physfs/src/physfs_platform_apple.m +201 -0
  30. physfs_py-0.3.0/libs/physfs/src/physfs_platform_haiku.cpp +186 -0
  31. physfs_py-0.3.0/libs/physfs/src/physfs_platform_ogc.c +437 -0
  32. physfs_py-0.3.0/libs/physfs/src/physfs_platform_os2.c +812 -0
  33. physfs_py-0.3.0/libs/physfs/src/physfs_platform_playdate.c +287 -0
  34. physfs_py-0.3.0/libs/physfs/src/physfs_platform_posix.c +449 -0
  35. physfs_py-0.3.0/libs/physfs/src/physfs_platform_qnx.c +169 -0
  36. physfs_py-0.3.0/libs/physfs/src/physfs_platform_unix.c +371 -0
  37. physfs_py-0.3.0/libs/physfs/src/physfs_platform_windows.c +1028 -0
  38. physfs_py-0.3.0/libs/physfs/src/physfs_platform_winrt.cpp +41 -0
  39. physfs_py-0.3.0/libs/physfs/src/physfs_platforms.h +86 -0
  40. physfs_py-0.3.0/libs/physfs/src/physfs_unicode.c +572 -0
  41. physfs_py-0.3.0/physfs.py.egg-info/PKG-INFO +77 -0
  42. physfs_py-0.3.0/physfs.py.egg-info/SOURCES.txt +54 -0
  43. {physfs_py-0.2.0 → physfs_py-0.3.0}/pyproject.toml +9 -2
  44. {physfs_py-0.2.0 → physfs_py-0.3.0}/setup.py +4 -2
  45. physfs_py-0.3.0/src/CMakeLists.txt +24 -0
  46. physfs_py-0.3.0/src/main.cpp +20 -0
  47. physfs_py-0.3.0/src/shim.cpp +286 -0
  48. physfs_py-0.3.0/src/shim.h +11 -0
  49. physfs_py-0.3.0/tests/example.zip +0 -0
  50. {physfs_py-0.2.0 → physfs_py-0.3.0}/tests/test.py +1 -1
  51. physfs_py-0.2.0/PKG-INFO +0 -73
  52. physfs_py-0.2.0/README.md +0 -60
  53. physfs_py-0.2.0/physfs.py.egg-info/PKG-INFO +0 -73
  54. physfs_py-0.2.0/physfs.py.egg-info/SOURCES.txt +0 -11
  55. {physfs_py-0.2.0 → physfs_py-0.3.0}/LICENSE +0 -0
  56. {physfs_py-0.2.0 → physfs_py-0.3.0}/physfs.py.egg-info/dependency_links.txt +0 -0
  57. {physfs_py-0.2.0 → physfs_py-0.3.0}/physfs.py.egg-info/not-zip-safe +0 -0
  58. {physfs_py-0.2.0 → physfs_py-0.3.0}/physfs.py.egg-info/requires.txt +0 -0
  59. {physfs_py-0.2.0 → physfs_py-0.3.0}/physfs.py.egg-info/top_level.txt +0 -0
  60. {physfs_py-0.2.0 → physfs_py-0.3.0}/setup.cfg +0 -0
@@ -0,0 +1,33 @@
1
+ # CMakeList.txt: 顶层 CMake 项目文件,在此处执行全局配置
2
+ # 并包含子项目。
3
+ #
4
+ cmake_minimum_required (VERSION 3.15)
5
+
6
+ # Enable Hot Reload for MSVC compilers if supported.
7
+ if (POLICY CMP0141)
8
+ cmake_policy(SET CMP0141 NEW)
9
+ set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
10
+ endif()
11
+
12
+ # Enable VCPKG if VCPKG_ROOT defined.
13
+ if (DEFINED ENV{VCPKG_ROOT})
14
+ set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH "")
15
+ endif()
16
+
17
+ project ("physfs.py")
18
+
19
+ set(CMAKE_CXX_STANDARD 17)
20
+ set(PHYSFS_BUILD_STATIC ON CACHE BOOL "Build the bundled static PhysicsFS library" FORCE)
21
+ set(PHYSFS_BUILD_SHARED OFF CACHE BOOL "Disable the bundled shared PhysicsFS library" FORCE)
22
+ set(PHYSFS_BUILD_TEST OFF CACHE BOOL "Disable bundled PhysicsFS tests" FORCE)
23
+ set(PHYSFS_BUILD_DOCS OFF CACHE BOOL "Disable bundled PhysicsFS documentation" FORCE)
24
+ set(PHYSFS_DISABLE_INSTALL ON CACHE BOOL "Disable bundled PhysicsFS install rules" FORCE)
25
+
26
+ add_subdirectory(libs/physfs)
27
+ # 指定 PhysFS 编译参数
28
+ target_compile_options(physfs-static PRIVATE -fPIC)
29
+
30
+
31
+ set(PYBIND11_FINDPYTHON ON CACHE BOOL "Use CMake's modern FindPython support" FORCE)
32
+ find_package(pybind11 CONFIG REQUIRED)
33
+ add_subdirectory(src)
@@ -0,0 +1,14 @@
1
+ include CMakeLists.txt
2
+
3
+ graft src
4
+
5
+ include libs/physfs/CMakeLists.txt
6
+ include libs/physfs/LICENSE.txt
7
+ graft libs/physfs/src
8
+
9
+ include libs/pybind11/CMakeLists.txt
10
+ include libs/pybind11/LICENSE
11
+ graft libs/pybind11/include
12
+ graft libs/pybind11/tools
13
+
14
+ graft tests
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.4
2
+ Name: physfs.py
3
+ Version: 0.3.0
4
+ Summary: PhysFS.py is a python wrapper for the PhysicsFS library.
5
+ Home-page: https://github.com/shabbywu/physfs.py
6
+ Author: shabbywu
7
+ Author-email: shabbywu@qq.com
8
+ Requires-Python: >=3.8
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Provides-Extra: test
12
+ Requires-Dist: pytest; extra == "test"
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: home-page
18
+ Dynamic: license-file
19
+ Dynamic: provides-extra
20
+ Dynamic: requires-python
21
+ Dynamic: summary
22
+
23
+ PhysFS.py
24
+ ==============
25
+
26
+ ![github-stars][stars-badge]
27
+
28
+ | CI | status |
29
+ |----|--------|
30
+ | Source install | [![CI status][actions-ci-badge]][actions-ci-link] |
31
+ | [`cibuildwheel`][] release | [![Release status][actions-release-badge]][actions-release-link] |
32
+
33
+ [stars-badge]: https://img.shields.io/github/stars/shabbywu/physfs.py?style=social
34
+ [actions-ci-link]: https://github.com/shabbywu/physfs.py/actions/workflows/ci.yml
35
+ [actions-ci-badge]: https://github.com/shabbywu/physfs.py/actions/workflows/ci.yml/badge.svg?branch=master
36
+ [actions-release-link]: https://github.com/shabbywu/physfs.py/actions/workflows/release.yml
37
+ [actions-release-badge]: https://github.com/shabbywu/physfs.py/actions/workflows/release.yml/badge.svg
38
+ [`cibuildwheel`]: https://cibuildwheel.pypa.io
39
+
40
+ PhysFS.py is a python wrapper for the PhysicsFS library.
41
+
42
+ Installation
43
+ ------------
44
+
45
+ - `pip install physfs.py`
46
+
47
+ Requirements
48
+ ------------
49
+
50
+ - CPython 3.8 or newer.
51
+ - CMake 3.15 or newer, pybind11 2.10 or newer, and a C++17 compiler when
52
+ building from source. pip installs the build dependencies automatically.
53
+ - Prebuilt macOS wheels target Apple Silicon (`arm64`) only; Intel macOS uses the source distribution.
54
+
55
+ Features
56
+ ------------
57
+ physfs.py provides an encapsulation of the basic interface of PhysFS, including `init`, `deinit`, `mount`, `mount_memory`, `unmount`, `ls`, `read(cat)`, `stat`.
58
+
59
+ Enables python to use PhysFS at a minimum.
60
+
61
+ License
62
+ -------
63
+
64
+ pybind11 is provided under a BSD-style license that can be found in the LICENSE
65
+ file. By using, distributing, or contributing to this project, you agree to the
66
+ terms and conditions of this license.
67
+
68
+ Test call
69
+ ---------
70
+
71
+ ```python
72
+ import physfs
73
+ physfs.init()
74
+
75
+ physfs.mount("./example.zip")
76
+ physfs.ls()
77
+ ```
@@ -0,0 +1,55 @@
1
+ PhysFS.py
2
+ ==============
3
+
4
+ ![github-stars][stars-badge]
5
+
6
+ | CI | status |
7
+ |----|--------|
8
+ | Source install | [![CI status][actions-ci-badge]][actions-ci-link] |
9
+ | [`cibuildwheel`][] release | [![Release status][actions-release-badge]][actions-release-link] |
10
+
11
+ [stars-badge]: https://img.shields.io/github/stars/shabbywu/physfs.py?style=social
12
+ [actions-ci-link]: https://github.com/shabbywu/physfs.py/actions/workflows/ci.yml
13
+ [actions-ci-badge]: https://github.com/shabbywu/physfs.py/actions/workflows/ci.yml/badge.svg?branch=master
14
+ [actions-release-link]: https://github.com/shabbywu/physfs.py/actions/workflows/release.yml
15
+ [actions-release-badge]: https://github.com/shabbywu/physfs.py/actions/workflows/release.yml/badge.svg
16
+ [`cibuildwheel`]: https://cibuildwheel.pypa.io
17
+
18
+ PhysFS.py is a python wrapper for the PhysicsFS library.
19
+
20
+ Installation
21
+ ------------
22
+
23
+ - `pip install physfs.py`
24
+
25
+ Requirements
26
+ ------------
27
+
28
+ - CPython 3.8 or newer.
29
+ - CMake 3.15 or newer, pybind11 2.10 or newer, and a C++17 compiler when
30
+ building from source. pip installs the build dependencies automatically.
31
+ - Prebuilt macOS wheels target Apple Silicon (`arm64`) only; Intel macOS uses the source distribution.
32
+
33
+ Features
34
+ ------------
35
+ physfs.py provides an encapsulation of the basic interface of PhysFS, including `init`, `deinit`, `mount`, `mount_memory`, `unmount`, `ls`, `read(cat)`, `stat`.
36
+
37
+ Enables python to use PhysFS at a minimum.
38
+
39
+ License
40
+ -------
41
+
42
+ pybind11 is provided under a BSD-style license that can be found in the LICENSE
43
+ file. By using, distributing, or contributing to this project, you agree to the
44
+ terms and conditions of this license.
45
+
46
+ Test call
47
+ ---------
48
+
49
+ ```python
50
+ import physfs
51
+ physfs.init()
52
+
53
+ physfs.mount("./example.zip")
54
+ physfs.ls()
55
+ ```
@@ -0,0 +1,344 @@
1
+ # PhysicsFS; a portable, flexible file i/o abstraction.
2
+ #
3
+ # Please see the file LICENSE.txt in the source's root directory.
4
+
5
+ # The CMake project file is meant to get this compiling on all sorts of
6
+ # platforms quickly, and serve as the way Unix platforms and Linux distros
7
+ # package up official builds, but you don't _need_ to use this; we have
8
+ # built PhysicsFS to (hopefully) be able to drop into your project and
9
+ # compile, using preprocessor checks for platform-specific bits instead of
10
+ # testing in here.
11
+
12
+ set(PHYSFS_VERSION 3.3.0)
13
+
14
+ cmake_minimum_required(VERSION 3.5)
15
+
16
+ project(PhysicsFS VERSION ${PHYSFS_VERSION} LANGUAGES C )
17
+
18
+ include(GNUInstallDirs)
19
+
20
+ # Increment this if/when we break backwards compatibility.
21
+ set(PHYSFS_SOVERSION 1)
22
+
23
+ set(PHYSFS_M_SRCS)
24
+ set(PHYSFS_CPP_SRCS)
25
+
26
+ if(WIN32)
27
+ list(APPEND OPTIONAL_LIBRARY_LIBS advapi32 shell32)
28
+ endif()
29
+
30
+ if(APPLE)
31
+ set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework IOKit -framework Foundation")
32
+ list(APPEND PHYSFS_M_SRCS src/physfs_platform_apple.m)
33
+ endif()
34
+
35
+ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
36
+ add_compile_options(-Wall)
37
+ endif()
38
+
39
+ if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
40
+ add_definitions(-erroff=E_EMPTY_TRANSLATION_UNIT)
41
+ add_definitions(-xldscope=hidden)
42
+ endif()
43
+
44
+ if(HAIKU)
45
+ # We add this explicitly, since we don't want CMake to think this
46
+ # is a C++ project unless we're on Haiku.
47
+ list(APPEND PHYSFS_CPP_SRCS src/physfs_platform_haiku.cpp)
48
+ find_library(BE_LIBRARY be)
49
+ find_library(ROOT_LIBRARY root)
50
+ list(APPEND OPTIONAL_LIBRARY_LIBS ${BE_LIBRARY} ${ROOT_LIBRARY})
51
+ endif()
52
+
53
+ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
54
+ set(WINRT TRUE)
55
+ endif()
56
+
57
+ if(WINRT)
58
+ list(APPEND PHYSFS_CPP_SRCS src/physfs_platform_winrt.cpp)
59
+ endif()
60
+
61
+ if(UNIX AND NOT WIN32 AND NOT APPLE) # (MingW and such might be UNIX _and_ WINDOWS!)
62
+ find_library(PTHREAD_LIBRARY pthread)
63
+ if(PTHREAD_LIBRARY)
64
+ list(APPEND OPTIONAL_LIBRARY_LIBS ${PTHREAD_LIBRARY})
65
+ endif()
66
+ endif()
67
+
68
+ if(PHYSFS_CPP_SRCS)
69
+ enable_language(CXX)
70
+ endif()
71
+
72
+ # Almost everything is "compiled" here, but things that don't apply to the
73
+ # build are #ifdef'd out. This is to make it easy to embed PhysicsFS into
74
+ # another project or bring up a new build system: just compile all the source
75
+ # code and #define the things you want.
76
+ set(PHYSFS_SRCS
77
+ src/physfs.c
78
+ src/physfs_byteorder.c
79
+ src/physfs_unicode.c
80
+ src/physfs_platform_posix.c
81
+ src/physfs_platform_unix.c
82
+ src/physfs_platform_windows.c
83
+ src/physfs_platform_ogc.c
84
+ src/physfs_platform_os2.c
85
+ src/physfs_platform_qnx.c
86
+ src/physfs_platform_android.c
87
+ src/physfs_platform_playdate.c
88
+ src/physfs_archiver_dir.c
89
+ src/physfs_archiver_unpacked.c
90
+ src/physfs_archiver_grp.c
91
+ src/physfs_archiver_hog.c
92
+ src/physfs_archiver_7z.c
93
+ src/physfs_archiver_mvl.c
94
+ src/physfs_archiver_qpak.c
95
+ src/physfs_archiver_wad.c
96
+ src/physfs_archiver_csm.c
97
+ src/physfs_archiver_zip.c
98
+ src/physfs_archiver_slb.c
99
+ src/physfs_archiver_iso9660.c
100
+ src/physfs_archiver_vdf.c
101
+ ${PHYSFS_CPP_SRCS}
102
+ ${PHYSFS_M_SRCS}
103
+ )
104
+
105
+
106
+ # Archivers ...
107
+ # These are (mostly) on by default now, so these options are only useful for
108
+ # disabling them.
109
+
110
+ option(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE)
111
+ if(NOT PHYSFS_ARCHIVE_ZIP)
112
+ add_definitions(-DPHYSFS_SUPPORTS_ZIP=0)
113
+ endif()
114
+
115
+ option(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE)
116
+ if(NOT PHYSFS_ARCHIVE_7Z)
117
+ add_definitions(-DPHYSFS_SUPPORTS_7Z=0)
118
+ endif()
119
+
120
+ option(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE)
121
+ if(NOT PHYSFS_ARCHIVE_GRP)
122
+ add_definitions(-DPHYSFS_SUPPORTS_GRP=0)
123
+ endif()
124
+
125
+ option(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE)
126
+ if(NOT PHYSFS_ARCHIVE_WAD)
127
+ add_definitions(-DPHYSFS_SUPPORTS_WAD=0)
128
+ endif()
129
+
130
+ option(PHYSFS_ARCHIVE_CSM "Enable Chasm: The Rift CSM.BIN support" TRUE)
131
+ if(NOT PHYSFS_ARCHIVE_CSM)
132
+ add_definitions(-DPHYSFS_SUPPORTS_CSM=0)
133
+ endif()
134
+
135
+ option(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE)
136
+ if(NOT PHYSFS_ARCHIVE_HOG)
137
+ add_definitions(-DPHYSFS_SUPPORTS_HOG=0)
138
+ endif()
139
+
140
+ option(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE)
141
+ if(NOT PHYSFS_ARCHIVE_MVL)
142
+ add_definitions(-DPHYSFS_SUPPORTS_MVL=0)
143
+ endif()
144
+
145
+ option(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE)
146
+ if(NOT PHYSFS_ARCHIVE_QPAK)
147
+ add_definitions(-DPHYSFS_SUPPORTS_QPAK=0)
148
+ endif()
149
+
150
+ option(PHYSFS_ARCHIVE_SLB "Enable I-War / Independence War SLB support" TRUE)
151
+ if(NOT PHYSFS_ARCHIVE_SLB)
152
+ add_definitions(-DPHYSFS_SUPPORTS_SLB=0)
153
+ endif()
154
+
155
+ option(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE)
156
+ if(NOT PHYSFS_ARCHIVE_ISO9660)
157
+ add_definitions(-DPHYSFS_SUPPORTS_ISO9660=0)
158
+ endif()
159
+
160
+ option(PHYSFS_ARCHIVE_VDF "Enable Gothic I/II VDF archive support" TRUE)
161
+ if(NOT PHYSFS_ARCHIVE_VDF)
162
+ add_definitions(-DPHYSFS_SUPPORTS_VDF=0)
163
+ endif()
164
+
165
+
166
+ option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
167
+ if(PHYSFS_BUILD_STATIC)
168
+ add_library(physfs-static STATIC ${PHYSFS_SRCS})
169
+ add_library(PhysFS::PhysFS-static ALIAS physfs-static)
170
+ set_target_properties(physfs-static PROPERTIES EXPORT_NAME PhysFS-static)
171
+ # Don't rename this on Windows, since DLLs will also produce an import
172
+ # library named "physfs.lib" which would conflict; Unix tend to like the
173
+ # same library name with a different extension for static libs, but
174
+ # Windows can just have a separate name.
175
+ if(NOT MSVC)
176
+ set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
177
+ endif()
178
+ if(WINRT)
179
+ # Ignore LNK4264 warnings; we don't author any WinRT components, just consume them, so we're okay in a static library.
180
+ set_target_properties(physfs-static PROPERTIES VS_WINRT_COMPONENT True)
181
+ set_target_properties(physfs-static PROPERTIES STATIC_LIBRARY_FLAGS "/ignore:4264")
182
+ endif()
183
+ if(WIN32 OR WINRT OR OS2)
184
+ # no dll exports from the static library
185
+ target_compile_definitions(physfs-static PRIVATE "PHYSFS_STATIC")
186
+ endif()
187
+ target_include_directories(physfs-static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
188
+ target_link_libraries(physfs-static PRIVATE ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
189
+ set(PHYSFS_LIB_TARGET PhysFS::PhysFS-static)
190
+ list(APPEND PHYSFS_INSTALL_TARGETS "physfs-static")
191
+ endif()
192
+
193
+ option(PHYSFS_BUILD_SHARED "Build shared library" TRUE)
194
+ if(PHYSFS_BUILD_SHARED)
195
+ add_library(physfs SHARED ${PHYSFS_SRCS})
196
+ add_library(PhysFS::PhysFS ALIAS physfs)
197
+ set_target_properties(physfs PROPERTIES MACOSX_RPATH 1)
198
+ set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION})
199
+ set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION})
200
+ set_target_properties(physfs PROPERTIES EXPORT_NAME PhysFS)
201
+ if(WINRT)
202
+ set_target_properties(physfs PROPERTIES VS_WINRT_COMPONENT TRUE)
203
+ endif()
204
+ if(OS2) # OS/2 does not support a DLL name longer than 8 characters.
205
+ set_target_properties(physfs PROPERTIES OUTPUT_NAME "physfs")
206
+ endif()
207
+ target_include_directories(physfs PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
208
+ target_link_libraries(physfs PRIVATE ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
209
+ set(PHYSFS_LIB_TARGET PhysFS::PhysFS)
210
+ list(APPEND PHYSFS_INSTALL_TARGETS "physfs")
211
+ endif()
212
+
213
+ if(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
214
+ message(FATAL "Both shared and static libraries are disabled!")
215
+ endif()
216
+
217
+ option(PHYSFS_BUILD_TEST "Build stdio test program." TRUE)
218
+ mark_as_advanced(PHYSFS_BUILD_TEST)
219
+ if(PHYSFS_BUILD_TEST)
220
+ add_executable(test_physfs test/test_physfs.c)
221
+ target_link_libraries(test_physfs PRIVATE ${PHYSFS_LIB_TARGET} ${OTHER_LDFLAGS})
222
+
223
+ find_path(READLINE_H readline/readline.h)
224
+ find_path(HISTORY_H readline/history.h)
225
+ find_library(READLINE_LIBRARY readline)
226
+ find_package(Curses)
227
+ if(READLINE_H AND HISTORY_H AND READLINE_LIBRARY AND CURSES_FOUND)
228
+ set(HAVE_SYSTEM_READLINE TRUE)
229
+ target_link_libraries(test_physfs PRIVATE ${READLINE_LIBRARY} ${CURSES_LIBRARIES})
230
+ target_include_directories(test_physfs SYSTEM PRIVATE ${READLINE_H} ${HISTORY_H})
231
+ target_compile_definitions(test_physfs PRIVATE PHYSFS_HAVE_READLINE=1)
232
+ endif()
233
+ list(APPEND PHYSFS_INSTALL_TARGETS test_physfs)
234
+ endif()
235
+
236
+ option(PHYSFS_DISABLE_INSTALL "Disable installing PhysFS" OFF)
237
+ if(NOT PHYSFS_DISABLE_INSTALL)
238
+
239
+ install(TARGETS ${PHYSFS_INSTALL_TARGETS} EXPORT PhysFSExport
240
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
241
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
242
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
243
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
244
+ install(FILES src/physfs.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
245
+
246
+ install(EXPORT PhysFSExport
247
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/PhysFS"
248
+ FILE PhysFSConfig.cmake
249
+ NAMESPACE PhysFS::
250
+ )
251
+
252
+ if(NOT MSVC)
253
+ configure_file(
254
+ "extras/physfs.pc.in"
255
+ "extras/physfs.pc"
256
+ @ONLY
257
+ )
258
+
259
+ install(
260
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/extras/physfs.pc"
261
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
262
+ )
263
+ endif()
264
+ endif()
265
+
266
+ option(PHYSFS_BUILD_DOCS "Build doxygen based documentation" TRUE)
267
+ if(PHYSFS_BUILD_DOCS)
268
+ find_package(Doxygen)
269
+ if(DOXYGEN_FOUND)
270
+ set(PHYSFS_OUTPUT_DOXYFILE "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
271
+ configure_file(
272
+ "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile"
273
+ "${PHYSFS_OUTPUT_DOXYFILE}"
274
+ COPYONLY
275
+ )
276
+ file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n\n# Below auto-generated by cmake...\n\n")
277
+ file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "PROJECT_NUMBER = \"${PHYSFS_VERSION}\"\n")
278
+ file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "OUTPUT_DIRECTORY = \"${CMAKE_CURRENT_BINARY_DIR}/docs\"\n")
279
+ file(APPEND "${PHYSFS_OUTPUT_DOXYFILE}" "\n# End auto-generated section.\n\n")
280
+
281
+ set(PHYSFS_TARGETNAME_DOCS "docs" CACHE STRING "Name of 'docs' build target")
282
+
283
+ add_custom_target(
284
+ ${PHYSFS_TARGETNAME_DOCS}
285
+ ${DOXYGEN_EXECUTABLE} "${PHYSFS_OUTPUT_DOXYFILE}"
286
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
287
+ COMMENT "Building documentation in 'docs' directory..."
288
+ )
289
+
290
+ else()
291
+ message(STATUS "Doxygen not found. You won't be able to build documentation.")
292
+ endif()
293
+ endif()
294
+
295
+ if(UNIX)
296
+ set(PHYSFS_TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/../physfs-${PHYSFS_VERSION}.tar.gz")
297
+
298
+ set(PHYSFS_TARGETNAME_DIST "dist" CACHE STRING "Name of 'dist' build target")
299
+ add_custom_target(
300
+ ${PHYSFS_TARGETNAME_DIST}
301
+ git archive --prefix="physfs-${PHYSFS_VERSION}/" --output="${PHYSFS_TARBALL}" HEAD
302
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
303
+ COMMENT "Building source tarball '${PHYSFS_TARBALL}'..."
304
+ )
305
+
306
+ set(PHYSFS_TARGETNAME_UNINSTALL "uninstall" CACHE STRING "Name of 'uninstall' build target")
307
+ add_custom_target(
308
+ ${PHYSFS_TARGETNAME_UNINSTALL}
309
+ "${CMAKE_CURRENT_SOURCE_DIR}/extras/uninstall.sh"
310
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
311
+ COMMENT "Uninstall the project..."
312
+ )
313
+ endif()
314
+
315
+
316
+ macro(message_bool_option _NAME _VALUE)
317
+ if(${_VALUE})
318
+ message(STATUS " ${_NAME}: enabled")
319
+ else()
320
+ message(STATUS " ${_NAME}: disabled")
321
+ endif()
322
+ endmacro()
323
+
324
+ message(STATUS "PhysicsFS will build with the following options:")
325
+ message_bool_option("ZIP support" PHYSFS_ARCHIVE_ZIP)
326
+ message_bool_option("7zip support" PHYSFS_ARCHIVE_7Z)
327
+ message_bool_option("GRP support" PHYSFS_ARCHIVE_GRP)
328
+ message_bool_option("WAD support" PHYSFS_ARCHIVE_WAD)
329
+ message_bool_option("CSM support" PHYSFS_ARCHIVE_CSM)
330
+ message_bool_option("HOG support" PHYSFS_ARCHIVE_HOG)
331
+ message_bool_option("MVL support" PHYSFS_ARCHIVE_MVL)
332
+ message_bool_option("QPAK support" PHYSFS_ARCHIVE_QPAK)
333
+ message_bool_option("SLB support" PHYSFS_ARCHIVE_SLB)
334
+ message_bool_option("VDF support" PHYSFS_ARCHIVE_VDF)
335
+ message_bool_option("ISO9660 support" PHYSFS_ARCHIVE_ISO9660)
336
+ message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
337
+ message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
338
+ message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
339
+ message_bool_option("Build Doxygen documentation" PHYSFS_BUILD_DOCS)
340
+ if(PHYSFS_BUILD_TEST)
341
+ message_bool_option(" Use readline in test program" HAVE_SYSTEM_READLINE)
342
+ endif()
343
+
344
+ # end of CMakeLists.txt ...
@@ -0,0 +1,17 @@
1
+ Copyright (c) 2001-2022 Ryan C. Gordon <icculus@icculus.org> and others.
2
+
3
+ This software is provided 'as-is', without any express or implied
4
+ warranty. In no event will the authors be held liable for any damages
5
+ arising from the use of this software.
6
+
7
+ Permission is granted to anyone to use this software for any purpose,
8
+ including commercial applications, and to alter it and redistribute it
9
+ freely, subject to the following restrictions:
10
+
11
+ 1. The origin of this software must not be misrepresented; you must not
12
+ claim that you wrote the original software. If you use this software
13
+ in a product, an acknowledgment in the product documentation would be
14
+ appreciated but is not required.
15
+ 2. Altered source versions must be plainly marked as such, and must not be
16
+ misrepresented as being the original software.
17
+ 3. This notice may not be removed or altered from any source distribution.
@@ -0,0 +1,94 @@
1
+ # Open Watcom makefile to build PhysicsFS for OS/2
2
+ # wmake -f Makefile.os2
3
+
4
+ LIBNAME = physfs
5
+ VERSION = 3.3.0
6
+
7
+ LIBFILE = $(LIBNAME).lib
8
+ DLLFILE = $(LIBNAME).dll
9
+ LNKFILE = $(LIBNAME).lnk
10
+
11
+ TITLENAME = $(LIBNAME) $(VERSION)
12
+
13
+ SRCS = physfs.c &
14
+ physfs_byteorder.c &
15
+ physfs_unicode.c &
16
+ physfs_platform_os2.c &
17
+ physfs_archiver_dir.c &
18
+ physfs_archiver_unpacked.c &
19
+ physfs_archiver_grp.c &
20
+ physfs_archiver_hog.c &
21
+ physfs_archiver_7z.c &
22
+ physfs_archiver_mvl.c &
23
+ physfs_archiver_qpak.c &
24
+ physfs_archiver_wad.c &
25
+ physfs_archiver_zip.c &
26
+ physfs_archiver_slb.c &
27
+ physfs_archiver_iso9660.c &
28
+ physfs_archiver_csm.c &
29
+ physfs_archiver_vdf.c
30
+
31
+
32
+ OBJS = $(SRCS:.c=.obj)
33
+
34
+ CFLAGS_BASE = -bt=os2 -d0 -q -bm -5s -fp5 -fpi87 -sg -oeatxh -ei -j
35
+ CFLAGS_BASE+= -DNDEBUG
36
+ # warnings:
37
+ CFLAGS_BASE+= -wx
38
+ # newer OpenWatcom versions enable W303 by default
39
+ CFLAGS_BASE+= -wcd=303
40
+ # include paths:
41
+ CFLAGS_BASE+= -I"$(%WATCOM)/h/os2" -I"$(%WATCOM)/h"
42
+ CFLAGS = $(CFLAGS_BASE)
43
+ # to build a dll:
44
+ CFLAGS+= -bd
45
+
46
+ .extensions:
47
+ .extensions: .lib .dll .obj .c
48
+
49
+ all: $(DLLFILE) test_physfs.exe
50
+
51
+ .c: decoders
52
+ .c: examples
53
+
54
+ $(LIBFILE): $(DLLFILE)
55
+ @echo * Create library: $@...
56
+ wlib -b -n -q -c -pa -s -t -zld -ii -io $@ $(DLLFILE)
57
+
58
+ $(DLLFILE): $(OBJS) $(MODPLIB) $(TIMILIB) $(LNKFILE)
59
+ @echo * Link: $@
60
+ wlink @$(LNKFILE)
61
+
62
+ $(LNKFILE):
63
+ @%create $@
64
+ @%append $@ SYSTEM os2v2_dll INITINSTANCE TERMINSTANCE
65
+ @%append $@ NAME $(LIBNAME)
66
+ @for %i in ($(OBJS)) do @%append $@ FILE %i
67
+ @%append $@ OPTION QUIET
68
+ @%append $@ OPTION DESCRIPTION '@$#icculus org:$(VERSION)$#@PhysicsFS'
69
+ @%append $@ OPTION MAP=$^&.map
70
+ @%append $@ OPTION ELIMINATE
71
+ @%append $@ OPTION MANYAUTODATA
72
+ @%append $@ OPTION OSNAME='OS/2 and eComStation'
73
+ @%append $@ OPTION SHOWDEAD
74
+
75
+ .c.obj:
76
+ wcc386 $(CFLAGS) -fo=$^@ $<
77
+
78
+ test_physfs.obj: "../test/test_physfs.c"
79
+ wcc386 $(CFLAGS_BASE) -fo=$^@ $<
80
+
81
+ test_physfs.exe: $(LIBFILE) test_physfs.obj
82
+ @echo * Link: $@
83
+ wlink SYS os2v2 LIBR {$(LIBFILE)} op q op el F {test_physfs.obj} N test_physfs.exe
84
+
85
+ clean: .SYMBOLIC
86
+ @echo * Clean: $(TITLENAME)
87
+ @if exist *.obj rm *.obj
88
+ @if exist *.err rm *.err
89
+ @if exist $(LNKFILE) rm $(LNKFILE)
90
+ distclean: .SYMBOLIC clean
91
+ @if exist $(DLLFILE) rm $(DLLFILE)
92
+ @if exist $(LIBFILE) rm $(LIBFILE)
93
+ @if exist *.map rm *.map
94
+ @if exist *.exe rm *.exe