mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 07:04:01 -06:00
util: Fix versioning when gitdir is absent (#809)
The gitdir previously could be absent and produce a version of "" in spite of checks for it. Fixed. Parent directories with shlex-interpreted characters in their names could be misinterpreted. Removed shlex parsing. Packagers may want to remove the git history to slim down the package size, so add an option for using a file 'version' in the klippy directory to set version without using git. Signed-Off-By: Lucas Fink <software@lfcode.ca>
This commit is contained in:
parent
f57c29442c
commit
a33792f07e
4 changed files with 88 additions and 12 deletions
31
docs/Packaging.md
Normal file
31
docs/Packaging.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Packaging klipper
|
||||
|
||||
Klipper is somewhat of a packaging anomaly among python programs, as it doesn't
|
||||
use setuptools to build and install. Some notes regarding how best to package it
|
||||
are as follows:
|
||||
|
||||
## C modules
|
||||
|
||||
Klipper uses a C module to handle some kinematics calculations more quickly.
|
||||
This module needs to be compiled at packaging time to avoid introducing a
|
||||
runtime dependency on a compiler. To compile the C module, run `python2
|
||||
klippy/chelper/__init__.py`.
|
||||
|
||||
## Compiling python code
|
||||
|
||||
Many distributions have a policy of compiling all python code before packaging
|
||||
to improve startup time. You can do this by running `python2 -m compileall
|
||||
klippy`.
|
||||
|
||||
## Versioning
|
||||
|
||||
If you are building a package of Klipper from git, it is usual practice not to
|
||||
ship a .git directory, so the versioning must be handled without git. To do
|
||||
this, use the script shipped in `scripts/make_version.py` which should be run as
|
||||
follows: `python2 scripts/make_version.py YOURDISTRONAME > klippy/.version`.
|
||||
|
||||
## Sample packaging script
|
||||
|
||||
klipper-git is packaged for Arch Linux, and has a PKGBUILD (package build
|
||||
script) available at
|
||||
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=klipper-git.
|
Loading…
Add table
Add a link
Reference in a new issue