pk3make 1.1__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.
- pk3make-1.1/.github/workflows/python-publish.yml +70 -0
- pk3make-1.1/.gitignore +171 -0
- pk3make-1.1/LICENSE +157 -0
- pk3make-1.1/PKG-INFO +138 -0
- pk3make-1.1/README.md +117 -0
- pk3make-1.1/examples/PK3Makefile +41 -0
- pk3make-1.1/examples/music.PK3Makefile +11 -0
- pk3make-1.1/pyproject.toml +38 -0
- pk3make-1.1/requirements.txt +4 -0
- pk3make-1.1/src/pk3make/__init__.py +0 -0
- pk3make-1.1/src/pk3make/__main__.py +297 -0
- pk3make-1.1/src/pk3make/modules/doomglob.py +34 -0
- pk3make-1.1/src/pk3make/modules/doompic.py +354 -0
- pk3make-1.1/src/pk3make/modules/pk3makefile.py +65 -0
- pk3make-1.1/src/pk3make/modules/pk3zip.py +84 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
# This workflow will upload a Python Package to PyPI when a release is created
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
3
|
+
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
5
|
+
# They are provided by a third-party and are governed by
|
6
|
+
# separate terms of service, privacy policy, and support
|
7
|
+
# documentation.
|
8
|
+
|
9
|
+
name: Upload Python Package
|
10
|
+
|
11
|
+
on:
|
12
|
+
release:
|
13
|
+
types: [published]
|
14
|
+
|
15
|
+
permissions:
|
16
|
+
contents: read
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
release-build:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v4
|
24
|
+
|
25
|
+
- uses: actions/setup-python@v5
|
26
|
+
with:
|
27
|
+
python-version: "3.x"
|
28
|
+
|
29
|
+
- name: Build release distributions
|
30
|
+
run: |
|
31
|
+
# NOTE: put your own distribution build steps here.
|
32
|
+
python -m pip install build
|
33
|
+
python -m build
|
34
|
+
|
35
|
+
- name: Upload distributions
|
36
|
+
uses: actions/upload-artifact@v4
|
37
|
+
with:
|
38
|
+
name: release-dists
|
39
|
+
path: dist/
|
40
|
+
|
41
|
+
pypi-publish:
|
42
|
+
runs-on: ubuntu-latest
|
43
|
+
needs:
|
44
|
+
- release-build
|
45
|
+
permissions:
|
46
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
47
|
+
id-token: write
|
48
|
+
|
49
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
50
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
51
|
+
environment:
|
52
|
+
name: pypi
|
53
|
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
|
54
|
+
# url: https://pypi.org/p/YOURPROJECT
|
55
|
+
#
|
56
|
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
|
57
|
+
# ALTERNATIVE: exactly, uncomment the following line instead:
|
58
|
+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
|
59
|
+
|
60
|
+
steps:
|
61
|
+
- name: Retrieve release distributions
|
62
|
+
uses: actions/download-artifact@v4
|
63
|
+
with:
|
64
|
+
name: release-dists
|
65
|
+
path: dist/
|
66
|
+
|
67
|
+
- name: Publish release distributions to PyPI
|
68
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
69
|
+
with:
|
70
|
+
packages-dir: dist/
|
pk3make-1.1/.gitignore
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
2
|
+
__pycache__/
|
3
|
+
*.py[cod]
|
4
|
+
*$py.class
|
5
|
+
|
6
|
+
# C extensions
|
7
|
+
*.so
|
8
|
+
|
9
|
+
# Distribution / packaging
|
10
|
+
.Python
|
11
|
+
build/
|
12
|
+
develop-eggs/
|
13
|
+
dist/
|
14
|
+
downloads/
|
15
|
+
eggs/
|
16
|
+
.eggs/
|
17
|
+
lib/
|
18
|
+
lib64/
|
19
|
+
parts/
|
20
|
+
sdist/
|
21
|
+
var/
|
22
|
+
wheels/
|
23
|
+
share/python-wheels/
|
24
|
+
*.egg-info/
|
25
|
+
.installed.cfg
|
26
|
+
*.egg
|
27
|
+
MANIFEST
|
28
|
+
|
29
|
+
# PyInstaller
|
30
|
+
# Usually these files are written by a python script from a template
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32
|
+
*.manifest
|
33
|
+
*.spec
|
34
|
+
|
35
|
+
# Installer logs
|
36
|
+
pip-log.txt
|
37
|
+
pip-delete-this-directory.txt
|
38
|
+
|
39
|
+
# Unit test / coverage reports
|
40
|
+
htmlcov/
|
41
|
+
.tox/
|
42
|
+
.nox/
|
43
|
+
.coverage
|
44
|
+
.coverage.*
|
45
|
+
.cache
|
46
|
+
nosetests.xml
|
47
|
+
coverage.xml
|
48
|
+
*.cover
|
49
|
+
*.py,cover
|
50
|
+
.hypothesis/
|
51
|
+
.pytest_cache/
|
52
|
+
cover/
|
53
|
+
|
54
|
+
# Translations
|
55
|
+
*.mo
|
56
|
+
*.pot
|
57
|
+
|
58
|
+
# Django stuff:
|
59
|
+
*.log
|
60
|
+
local_settings.py
|
61
|
+
db.sqlite3
|
62
|
+
db.sqlite3-journal
|
63
|
+
|
64
|
+
# Flask stuff:
|
65
|
+
instance/
|
66
|
+
.webassets-cache
|
67
|
+
|
68
|
+
# Scrapy stuff:
|
69
|
+
.scrapy
|
70
|
+
|
71
|
+
# Sphinx documentation
|
72
|
+
docs/_build/
|
73
|
+
|
74
|
+
# PyBuilder
|
75
|
+
.pybuilder/
|
76
|
+
target/
|
77
|
+
|
78
|
+
# Jupyter Notebook
|
79
|
+
.ipynb_checkpoints
|
80
|
+
|
81
|
+
# IPython
|
82
|
+
profile_default/
|
83
|
+
ipython_config.py
|
84
|
+
|
85
|
+
# pyenv
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
88
|
+
# .python-version
|
89
|
+
|
90
|
+
# pipenv
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94
|
+
# install all needed dependencies.
|
95
|
+
#Pipfile.lock
|
96
|
+
|
97
|
+
# UV
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
100
|
+
# commonly ignored for libraries.
|
101
|
+
#uv.lock
|
102
|
+
|
103
|
+
# poetry
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
106
|
+
# commonly ignored for libraries.
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
108
|
+
#poetry.lock
|
109
|
+
|
110
|
+
# pdm
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
112
|
+
#pdm.lock
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
114
|
+
# in version control.
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
116
|
+
.pdm.toml
|
117
|
+
.pdm-python
|
118
|
+
.pdm-build/
|
119
|
+
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
121
|
+
__pypackages__/
|
122
|
+
|
123
|
+
# Celery stuff
|
124
|
+
celerybeat-schedule
|
125
|
+
celerybeat.pid
|
126
|
+
|
127
|
+
# SageMath parsed files
|
128
|
+
*.sage.py
|
129
|
+
|
130
|
+
# Environments
|
131
|
+
.env
|
132
|
+
.venv
|
133
|
+
env/
|
134
|
+
venv/
|
135
|
+
ENV/
|
136
|
+
env.bak/
|
137
|
+
venv.bak/
|
138
|
+
|
139
|
+
# Spyder project settings
|
140
|
+
.spyderproject
|
141
|
+
.spyproject
|
142
|
+
|
143
|
+
# Rope project settings
|
144
|
+
.ropeproject
|
145
|
+
|
146
|
+
# mkdocs documentation
|
147
|
+
/site
|
148
|
+
|
149
|
+
# mypy
|
150
|
+
.mypy_cache/
|
151
|
+
.dmypy.json
|
152
|
+
dmypy.json
|
153
|
+
|
154
|
+
# Pyre type checker
|
155
|
+
.pyre/
|
156
|
+
|
157
|
+
# pytype static type analyzer
|
158
|
+
.pytype/
|
159
|
+
|
160
|
+
# Cython debug symbols
|
161
|
+
cython_debug/
|
162
|
+
|
163
|
+
# PyCharm
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
168
|
+
#.idea/
|
169
|
+
|
170
|
+
# PyPI configuration file
|
171
|
+
.pypirc
|
pk3make-1.1/LICENSE
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
# GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
|
3
|
+
Version 3, 29 June 2007
|
4
|
+
|
5
|
+
Copyright (C) 2007 Free Software Foundation, Inc.
|
6
|
+
<https://fsf.org/>
|
7
|
+
|
8
|
+
Everyone is permitted to copy and distribute verbatim copies of this
|
9
|
+
license document, but changing it is not allowed.
|
10
|
+
|
11
|
+
This version of the GNU Lesser General Public License incorporates the
|
12
|
+
terms and conditions of version 3 of the GNU General Public License,
|
13
|
+
supplemented by the additional permissions listed below.
|
14
|
+
|
15
|
+
## 0. Additional Definitions.
|
16
|
+
|
17
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
18
|
+
General Public License, and the "GNU GPL" refers to version 3 of the
|
19
|
+
GNU General Public License.
|
20
|
+
|
21
|
+
"The Library" refers to a covered work governed by this License, other
|
22
|
+
than an Application or a Combined Work as defined below.
|
23
|
+
|
24
|
+
An "Application" is any work that makes use of an interface provided
|
25
|
+
by the Library, but which is not otherwise based on the Library.
|
26
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
27
|
+
of using an interface provided by the Library.
|
28
|
+
|
29
|
+
A "Combined Work" is a work produced by combining or linking an
|
30
|
+
Application with the Library. The particular version of the Library
|
31
|
+
with which the Combined Work was made is also called the "Linked
|
32
|
+
Version".
|
33
|
+
|
34
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
35
|
+
Corresponding Source for the Combined Work, excluding any source code
|
36
|
+
for portions of the Combined Work that, considered in isolation, are
|
37
|
+
based on the Application, and not on the Linked Version.
|
38
|
+
|
39
|
+
The "Corresponding Application Code" for a Combined Work means the
|
40
|
+
object code and/or source code for the Application, including any data
|
41
|
+
and utility programs needed for reproducing the Combined Work from the
|
42
|
+
Application, but excluding the System Libraries of the Combined Work.
|
43
|
+
|
44
|
+
## 1. Exception to Section 3 of the GNU GPL.
|
45
|
+
|
46
|
+
You may convey a covered work under sections 3 and 4 of this License
|
47
|
+
without being bound by section 3 of the GNU GPL.
|
48
|
+
|
49
|
+
## 2. Conveying Modified Versions.
|
50
|
+
|
51
|
+
If you modify a copy of the Library, and, in your modifications, a
|
52
|
+
facility refers to a function or data to be supplied by an Application
|
53
|
+
that uses the facility (other than as an argument passed when the
|
54
|
+
facility is invoked), then you may convey a copy of the modified
|
55
|
+
version:
|
56
|
+
|
57
|
+
- a) under this License, provided that you make a good faith effort
|
58
|
+
to ensure that, in the event an Application does not supply the
|
59
|
+
function or data, the facility still operates, and performs
|
60
|
+
whatever part of its purpose remains meaningful, or
|
61
|
+
- b) under the GNU GPL, with none of the additional permissions of
|
62
|
+
this License applicable to that copy.
|
63
|
+
|
64
|
+
## 3. Object Code Incorporating Material from Library Header Files.
|
65
|
+
|
66
|
+
The object code form of an Application may incorporate material from a
|
67
|
+
header file that is part of the Library. You may convey such object
|
68
|
+
code under terms of your choice, provided that, if the incorporated
|
69
|
+
material is not limited to numerical parameters, data structure
|
70
|
+
layouts and accessors, or small macros, inline functions and templates
|
71
|
+
(ten or fewer lines in length), you do both of the following:
|
72
|
+
|
73
|
+
- a) Give prominent notice with each copy of the object code that
|
74
|
+
the Library is used in it and that the Library and its use are
|
75
|
+
covered by this License.
|
76
|
+
- b) Accompany the object code with a copy of the GNU GPL and this
|
77
|
+
license document.
|
78
|
+
|
79
|
+
## 4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that, taken
|
82
|
+
together, effectively do not restrict modification of the portions of
|
83
|
+
the Library contained in the Combined Work and reverse engineering for
|
84
|
+
debugging such modifications, if you also do each of the following:
|
85
|
+
|
86
|
+
- a) Give prominent notice with each copy of the Combined Work that
|
87
|
+
the Library is used in it and that the Library and its use are
|
88
|
+
covered by this License.
|
89
|
+
- b) Accompany the Combined Work with a copy of the GNU GPL and this
|
90
|
+
license document.
|
91
|
+
- c) For a Combined Work that displays copyright notices during
|
92
|
+
execution, include the copyright notice for the Library among
|
93
|
+
these notices, as well as a reference directing the user to the
|
94
|
+
copies of the GNU GPL and this license document.
|
95
|
+
- d) Do one of the following:
|
96
|
+
- 0) Convey the Minimal Corresponding Source under the terms of
|
97
|
+
this License, and the Corresponding Application Code in a form
|
98
|
+
suitable for, and under terms that permit, the user to
|
99
|
+
recombine or relink the Application with a modified version of
|
100
|
+
the Linked Version to produce a modified Combined Work, in the
|
101
|
+
manner specified by section 6 of the GNU GPL for conveying
|
102
|
+
Corresponding Source.
|
103
|
+
- 1) Use a suitable shared library mechanism for linking with
|
104
|
+
the Library. A suitable mechanism is one that (a) uses at run
|
105
|
+
time a copy of the Library already present on the user's
|
106
|
+
computer system, and (b) will operate properly with a modified
|
107
|
+
version of the Library that is interface-compatible with the
|
108
|
+
Linked Version.
|
109
|
+
- e) Provide Installation Information, but only if you would
|
110
|
+
otherwise be required to provide such information under section 6
|
111
|
+
of the GNU GPL, and only to the extent that such information is
|
112
|
+
necessary to install and execute a modified version of the
|
113
|
+
Combined Work produced by recombining or relinking the Application
|
114
|
+
with a modified version of the Linked Version. (If you use option
|
115
|
+
4d0, the Installation Information must accompany the Minimal
|
116
|
+
Corresponding Source and Corresponding Application Code. If you
|
117
|
+
use option 4d1, you must provide the Installation Information in
|
118
|
+
the manner specified by section 6 of the GNU GPL for conveying
|
119
|
+
Corresponding Source.)
|
120
|
+
|
121
|
+
## 5. Combined Libraries.
|
122
|
+
|
123
|
+
You may place library facilities that are a work based on the Library
|
124
|
+
side by side in a single library together with other library
|
125
|
+
facilities that are not Applications and are not covered by this
|
126
|
+
License, and convey such a combined library under terms of your
|
127
|
+
choice, if you do both of the following:
|
128
|
+
|
129
|
+
- a) Accompany the combined library with a copy of the same work
|
130
|
+
based on the Library, uncombined with any other library
|
131
|
+
facilities, conveyed under the terms of this License.
|
132
|
+
- b) Give prominent notice with the combined library that part of it
|
133
|
+
is a work based on the Library, and explaining where to find the
|
134
|
+
accompanying uncombined form of the same work.
|
135
|
+
|
136
|
+
## 6. Revised Versions of the GNU Lesser General Public License.
|
137
|
+
|
138
|
+
The Free Software Foundation may publish revised and/or new versions
|
139
|
+
of the GNU Lesser General Public License from time to time. Such new
|
140
|
+
versions will be similar in spirit to the present version, but may
|
141
|
+
differ in detail to address new problems or concerns.
|
142
|
+
|
143
|
+
Each version is given a distinguishing version number. If the Library
|
144
|
+
as you received it specifies that a certain numbered version of the
|
145
|
+
GNU Lesser General Public License "or any later version" applies to
|
146
|
+
it, you have the option of following the terms and conditions either
|
147
|
+
of that published version or of any later version published by the
|
148
|
+
Free Software Foundation. If the Library as you received it does not
|
149
|
+
specify a version number of the GNU Lesser General Public License, you
|
150
|
+
may choose any version of the GNU Lesser General Public License ever
|
151
|
+
published by the Free Software Foundation.
|
152
|
+
|
153
|
+
If the Library as you received it specifies that a proxy can decide
|
154
|
+
whether future versions of the GNU Lesser General Public License shall
|
155
|
+
apply, that proxy's public statement of acceptance of any version is
|
156
|
+
permanent authorization for you to choose that version for the
|
157
|
+
Library.
|
pk3make-1.1/PKG-INFO
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: pk3make
|
3
|
+
Version: 1.1
|
4
|
+
Summary: Build system for Weissblatt PK3 files
|
5
|
+
Project-URL: Homepage, https://github.com/liquidunderground/pk3make
|
6
|
+
Project-URL: GitHub, https://github.com/liquidunderground/pk3make
|
7
|
+
Project-URL: Issues, https://github.com/liquidunderground/pk3make/issues
|
8
|
+
Author-email: Zibon Badi <zibonbadi@gmail.com>
|
9
|
+
License-Expression: LGPL-3.0-or-later
|
10
|
+
License-File: LICENSE
|
11
|
+
Classifier: Environment :: Console
|
12
|
+
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
|
13
|
+
Classifier: Operating System :: OS Independent
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Topic :: Software Development :: Build Tools
|
16
|
+
Requires-Python: >=3.12
|
17
|
+
Requires-Dist: colormath2
|
18
|
+
Requires-Dist: natsort
|
19
|
+
Requires-Dist: pillow
|
20
|
+
Description-Content-Type: text/markdown
|
21
|
+
|
22
|
+
# PK3Make
|
23
|
+
|
24
|
+
"Make" for Weissblatt PK3 files
|
25
|
+
|
26
|
+
## Installation
|
27
|
+
|
28
|
+
1. Set up a [virtual environment](https://docs.python.org/3/library/venv.html)
|
29
|
+
2. Install dependencies `pip install -r requirements.txt`
|
30
|
+
|
31
|
+
## How to use
|
32
|
+
|
33
|
+
PK3Make supplies multiple subcommands. To get an overview type:
|
34
|
+
|
35
|
+
./pk3make.py --help
|
36
|
+
|
37
|
+
To fully build your project akin to a makefile, simply type:
|
38
|
+
|
39
|
+
./pk3make.py make ./PK3Makefile # Default PK3Makefile
|
40
|
+
|
41
|
+
### Notes, Tips and Caveats
|
42
|
+
|
43
|
+
All text files are assumed to be UTF-8 encoded. PK3Make will automatically attempt to convert CRLF to LF newlines but using LF newlines is recommended.
|
44
|
+
|
45
|
+
PK3Make will not find hidden files. To avoid `DuplicateLumpError`s, place
|
46
|
+
your workfiles in a hidden directory, for example `.local/`.
|
47
|
+
|
48
|
+
Should your project contain custom palettes, place it's corresponding
|
49
|
+
LUMPDEF before any `graphic`, `flat` or `fade`. That way, PK3Make can
|
50
|
+
cache your palettes and speed up build times by reducing thread idle.
|
51
|
+
|
52
|
+
|
53
|
+
## But why?
|
54
|
+
|
55
|
+
To put it bluntly: No other tools suited Weissblatt.
|
56
|
+
|
57
|
+
Although the PK3 specification for Weissblatt's engine is based on
|
58
|
+
[ZDoom PK3](https://zdoom.org/wiki/Using_ZIPs_as_WAD_replacement),
|
59
|
+
it's directory namespaces are very different. This made Doom's usual
|
60
|
+
autobuild toolkit [DoomTools](https://mtrop.github.io/DoomTools/) a
|
61
|
+
poor fit for development. Due to the size of the Weissblatt project, manual
|
62
|
+
assembly using SLADE was also out of the question.
|
63
|
+
|
64
|
+
I chose Python as the basis for PK3Make because it is platform-independent,
|
65
|
+
easy-to-read and ubiquitous and although some Doom/Weissblatt-specific
|
66
|
+
modules needed to be written from scratch for PK3Make, Python's vast
|
67
|
+
standard library and otherwise mature PyPI repository helped stem some
|
68
|
+
of the heavy lifting for things such as image processing.
|
69
|
+
|
70
|
+
# PK3Makefile reference
|
71
|
+
|
72
|
+
PK3Make uses it's own build definition language called `PK3Makefile`, inspired by the `METAINFO` spec from
|
73
|
+
[Matt Tropiano's dImgConv](https://mtrop.github.io/DoomTools/dimgconv.html).
|
74
|
+
|
75
|
+
`PK3Makefile`s are processed line-by-line with everything following `#`
|
76
|
+
being treated as a comment. Otherwise it is split into *Build Options*,
|
77
|
+
which define PK3Make's general behavior and *LUMPDEFS*, which define what
|
78
|
+
files to put into your PK3 and how to build them.
|
79
|
+
|
80
|
+
## Build options
|
81
|
+
|
82
|
+
Build options are specified per-line and follow the pattern
|
83
|
+
|
84
|
+
?<OPTION>: <PARAM>
|
85
|
+
|
86
|
+
PK3Make supports the following options:
|
87
|
+
|
88
|
+
`?srcdir: <DIR>` specifies the directory to pull it's base assets from.
|
89
|
+
PK3Make will attempt to find all defined lumps within this folder and
|
90
|
+
mirror it's path within `?workdir` after compilation.
|
91
|
+
|
92
|
+
`?workdir: <DIR>` specifies the temporary working directory. PK3Make will
|
93
|
+
check the timestamps between this and `?srcdir` and rebuild/copy any
|
94
|
+
outdated files into `?workdir` during the compilation process.
|
95
|
+
|
96
|
+
`?palette:` defines the main color palette, by `LUMPNAME` (`PLAYPAL` by default)
|
97
|
+
|
98
|
+
`?destfile:` describes a filepath to the destination PK3. This is where
|
99
|
+
`?workdir` will get copied to during packing.
|
100
|
+
|
101
|
+
|
102
|
+
## Lump definitions
|
103
|
+
|
104
|
+
Lump definitions follow the following pattern:
|
105
|
+
|
106
|
+
<LUMPNAME> <TYPE> <OFFSET>
|
107
|
+
|
108
|
+
`LUMPNAME` describes the filename as used in-engine. Just like the engine,
|
109
|
+
it is matched against the first eight characters of the basename in a
|
110
|
+
case-insensitive manner. [Globbing] such as `D_*.mid` is allowed, in which
|
111
|
+
case `TYPE` and `OFFSET` are applied to all matching lumps. `LUMPNAME`s
|
112
|
+
starting with a "/" are treated as explicit file paths and match against
|
113
|
+
the full file path, starting at the source directory.
|
114
|
+
|
115
|
+
[Globbing]: <https://en.wikipedia.org/wiki/Glob_(programming)>
|
116
|
+
|
117
|
+
`TYPE` determines how the file is treated during compilation. It can be one
|
118
|
+
of the following:
|
119
|
+
|
120
|
+
- `colormap`: File is a Colormap. OFFSET specifies the lump name for the palette from which it is generated
|
121
|
+
- `fade`|`flat`: File is an image and should be converted to a flat. Only PNG images are supported.
|
122
|
+
- `graphic`: File is an image and should be converted to a Doom Picture using `OFFSET` (see below) as a picture offset. If missing, the offset is assumed to be `0 0`.
|
123
|
+
- `marker`: File does not exist and is a 0-byte marker. Explicit path definition required.
|
124
|
+
- `palette`: File is a graphic and should be converted to a color palette. Only PNG images supported.
|
125
|
+
- `raw`: Copy the file over as-is. When `preserve_filename` is given in the offset, the original filename will be preserved.
|
126
|
+
- `tinttab`: File is a TINTTAB. OFFSET is defined as `<PALETTE> <WEIGHT>`. Upon generation, `PALETTE` orthogonally maps each color index against one another, `WEIGHT` specifies a bias towards horizontal/vertical colors between 0 and 1.
|
127
|
+
- `udmf`: (Not supported yet.) File is a UDMF TEXTMAP. PK3Make will generate a directory named LUMPNAME featuring:
|
128
|
+
- `<LUMPNAME>`: Marker
|
129
|
+
- `TEXTMAP`: Original TEXTMAP file (renamed)
|
130
|
+
- `ZNODES`: UDMF BSP tree generated by PK3Make
|
131
|
+
- `ENDMAP`: Marker
|
132
|
+
|
133
|
+
`OFFSET` defines the offset of doom pictures. For convenience, these can be either:
|
134
|
+
|
135
|
+
- `<x> <y>`: Explicit X/Y-coordinates
|
136
|
+
- `center`: Sets the offset to the center of the image
|
137
|
+
- `sprite`: Sets the offset to `width/2 (height-4)`. This is a very common
|
138
|
+
offset for sprites placed in the game world.
|
pk3make-1.1/README.md
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
# PK3Make
|
2
|
+
|
3
|
+
"Make" for Weissblatt PK3 files
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
1. Set up a [virtual environment](https://docs.python.org/3/library/venv.html)
|
8
|
+
2. Install dependencies `pip install -r requirements.txt`
|
9
|
+
|
10
|
+
## How to use
|
11
|
+
|
12
|
+
PK3Make supplies multiple subcommands. To get an overview type:
|
13
|
+
|
14
|
+
./pk3make.py --help
|
15
|
+
|
16
|
+
To fully build your project akin to a makefile, simply type:
|
17
|
+
|
18
|
+
./pk3make.py make ./PK3Makefile # Default PK3Makefile
|
19
|
+
|
20
|
+
### Notes, Tips and Caveats
|
21
|
+
|
22
|
+
All text files are assumed to be UTF-8 encoded. PK3Make will automatically attempt to convert CRLF to LF newlines but using LF newlines is recommended.
|
23
|
+
|
24
|
+
PK3Make will not find hidden files. To avoid `DuplicateLumpError`s, place
|
25
|
+
your workfiles in a hidden directory, for example `.local/`.
|
26
|
+
|
27
|
+
Should your project contain custom palettes, place it's corresponding
|
28
|
+
LUMPDEF before any `graphic`, `flat` or `fade`. That way, PK3Make can
|
29
|
+
cache your palettes and speed up build times by reducing thread idle.
|
30
|
+
|
31
|
+
|
32
|
+
## But why?
|
33
|
+
|
34
|
+
To put it bluntly: No other tools suited Weissblatt.
|
35
|
+
|
36
|
+
Although the PK3 specification for Weissblatt's engine is based on
|
37
|
+
[ZDoom PK3](https://zdoom.org/wiki/Using_ZIPs_as_WAD_replacement),
|
38
|
+
it's directory namespaces are very different. This made Doom's usual
|
39
|
+
autobuild toolkit [DoomTools](https://mtrop.github.io/DoomTools/) a
|
40
|
+
poor fit for development. Due to the size of the Weissblatt project, manual
|
41
|
+
assembly using SLADE was also out of the question.
|
42
|
+
|
43
|
+
I chose Python as the basis for PK3Make because it is platform-independent,
|
44
|
+
easy-to-read and ubiquitous and although some Doom/Weissblatt-specific
|
45
|
+
modules needed to be written from scratch for PK3Make, Python's vast
|
46
|
+
standard library and otherwise mature PyPI repository helped stem some
|
47
|
+
of the heavy lifting for things such as image processing.
|
48
|
+
|
49
|
+
# PK3Makefile reference
|
50
|
+
|
51
|
+
PK3Make uses it's own build definition language called `PK3Makefile`, inspired by the `METAINFO` spec from
|
52
|
+
[Matt Tropiano's dImgConv](https://mtrop.github.io/DoomTools/dimgconv.html).
|
53
|
+
|
54
|
+
`PK3Makefile`s are processed line-by-line with everything following `#`
|
55
|
+
being treated as a comment. Otherwise it is split into *Build Options*,
|
56
|
+
which define PK3Make's general behavior and *LUMPDEFS*, which define what
|
57
|
+
files to put into your PK3 and how to build them.
|
58
|
+
|
59
|
+
## Build options
|
60
|
+
|
61
|
+
Build options are specified per-line and follow the pattern
|
62
|
+
|
63
|
+
?<OPTION>: <PARAM>
|
64
|
+
|
65
|
+
PK3Make supports the following options:
|
66
|
+
|
67
|
+
`?srcdir: <DIR>` specifies the directory to pull it's base assets from.
|
68
|
+
PK3Make will attempt to find all defined lumps within this folder and
|
69
|
+
mirror it's path within `?workdir` after compilation.
|
70
|
+
|
71
|
+
`?workdir: <DIR>` specifies the temporary working directory. PK3Make will
|
72
|
+
check the timestamps between this and `?srcdir` and rebuild/copy any
|
73
|
+
outdated files into `?workdir` during the compilation process.
|
74
|
+
|
75
|
+
`?palette:` defines the main color palette, by `LUMPNAME` (`PLAYPAL` by default)
|
76
|
+
|
77
|
+
`?destfile:` describes a filepath to the destination PK3. This is where
|
78
|
+
`?workdir` will get copied to during packing.
|
79
|
+
|
80
|
+
|
81
|
+
## Lump definitions
|
82
|
+
|
83
|
+
Lump definitions follow the following pattern:
|
84
|
+
|
85
|
+
<LUMPNAME> <TYPE> <OFFSET>
|
86
|
+
|
87
|
+
`LUMPNAME` describes the filename as used in-engine. Just like the engine,
|
88
|
+
it is matched against the first eight characters of the basename in a
|
89
|
+
case-insensitive manner. [Globbing] such as `D_*.mid` is allowed, in which
|
90
|
+
case `TYPE` and `OFFSET` are applied to all matching lumps. `LUMPNAME`s
|
91
|
+
starting with a "/" are treated as explicit file paths and match against
|
92
|
+
the full file path, starting at the source directory.
|
93
|
+
|
94
|
+
[Globbing]: <https://en.wikipedia.org/wiki/Glob_(programming)>
|
95
|
+
|
96
|
+
`TYPE` determines how the file is treated during compilation. It can be one
|
97
|
+
of the following:
|
98
|
+
|
99
|
+
- `colormap`: File is a Colormap. OFFSET specifies the lump name for the palette from which it is generated
|
100
|
+
- `fade`|`flat`: File is an image and should be converted to a flat. Only PNG images are supported.
|
101
|
+
- `graphic`: File is an image and should be converted to a Doom Picture using `OFFSET` (see below) as a picture offset. If missing, the offset is assumed to be `0 0`.
|
102
|
+
- `marker`: File does not exist and is a 0-byte marker. Explicit path definition required.
|
103
|
+
- `palette`: File is a graphic and should be converted to a color palette. Only PNG images supported.
|
104
|
+
- `raw`: Copy the file over as-is. When `preserve_filename` is given in the offset, the original filename will be preserved.
|
105
|
+
- `tinttab`: File is a TINTTAB. OFFSET is defined as `<PALETTE> <WEIGHT>`. Upon generation, `PALETTE` orthogonally maps each color index against one another, `WEIGHT` specifies a bias towards horizontal/vertical colors between 0 and 1.
|
106
|
+
- `udmf`: (Not supported yet.) File is a UDMF TEXTMAP. PK3Make will generate a directory named LUMPNAME featuring:
|
107
|
+
- `<LUMPNAME>`: Marker
|
108
|
+
- `TEXTMAP`: Original TEXTMAP file (renamed)
|
109
|
+
- `ZNODES`: UDMF BSP tree generated by PK3Make
|
110
|
+
- `ENDMAP`: Marker
|
111
|
+
|
112
|
+
`OFFSET` defines the offset of doom pictures. For convenience, these can be either:
|
113
|
+
|
114
|
+
- `<x> <y>`: Explicit X/Y-coordinates
|
115
|
+
- `center`: Sets the offset to the center of the image
|
116
|
+
- `sprite`: Sets the offset to `width/2 (height-4)`. This is a very common
|
117
|
+
offset for sprites placed in the game world.
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# === Example PK3Makefile ===
|
2
|
+
#
|
3
|
+
# This is a simple example PK3Makefile, more meant to demonstrate what you
|
4
|
+
# can do with the format than actually being useful.
|
5
|
+
#
|
6
|
+
# Use this for reference when writing your own.
|
7
|
+
|
8
|
+
# --- Build options ---
|
9
|
+
#
|
10
|
+
# These are your general project options.
|
11
|
+
# Please note that PK3Make will attempt to replicate
|
12
|
+
# the file tree in your ?srcdir as needed
|
13
|
+
#
|
14
|
+
|
15
|
+
?srcdir: src # Base file tree where your PNGs, OGGs, etc. are.
|
16
|
+
?workdir: build # Working directory to store compiled files. Useful for Out-Of-Date checking and debugging
|
17
|
+
?palette: PLAYPAL # Conventionally PLAYPAL. For use w/ graphics/flats/fades. Used as a basis for COLORMAPs and TINTTABs
|
18
|
+
?destfile: bin/whatever.pk3
|
19
|
+
|
20
|
+
|
21
|
+
# --- LUMPDEFs ---
|
22
|
+
#
|
23
|
+
# LUMPDEFs are read sequentially, so take care where to
|
24
|
+
# place your "marker" types. The engine will break if you don't.
|
25
|
+
#
|
26
|
+
# Although you will need a palette in your ?srcdir,
|
27
|
+
# "palette" types will be dumped into your PK3.
|
28
|
+
# To define a default palette for your graphics, use ?palette
|
29
|
+
|
30
|
+
PLAYPAL palette
|
31
|
+
PAL* palette
|
32
|
+
CLM0031 colormap PAL0031
|
33
|
+
COLORMAP colormap PLAYPAL
|
34
|
+
TRANS50 tinttab PAL0031 0.5
|
35
|
+
D_*.mid raw
|
36
|
+
/Music/S_DIGITL marker
|
37
|
+
O_*.ogg raw
|
38
|
+
NUMSPR* graphic sprite
|
39
|
+
NUMFLT* flat
|
40
|
+
FADE* fade # For now they're flats, let's see if the engine cares
|
41
|
+
Maps/MAP* udmf # unsupported, use compiled WADs w/ "raw" for now
|