mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-09 02:48:07 +08:00
ci : update + packages (#146)
* Add simple Debian package * Update CI configuration * Add cpack Deb package for libggwave-dev * Add `make deb` top level target and CI job * Ensure `make deb` packages are deterministic Update CMakeLists.txt to make cpack generated Debian packages deterministic build outputs by: - Setting SOURCE_DATE_EPOCH to 0 - Executing `git log -1 --pretty=%ct` and storing the result in SOURCE_DATE_EPOCH, overriding 0 - Export SOURCE_DATE_EPOCH to the environment - Explicitly prefix the execution of the cpack command in the custom target `deb_c_library` with SOURCE_DATE_EPOCH Update `README.md-tmpl.md` and `README.md` to document new `make deb` target. The Makefile for the Python bindings already handle deterministic building with the same strategy. * libc6, not libc
This commit is contained in:
@@ -1,12 +1,29 @@
|
||||
default: build
|
||||
|
||||
PKG_NAME := ggwave
|
||||
DEST := dist/
|
||||
VER := $(shell cat setup.py | grep version |cut -d\" -f2)
|
||||
VERSION := $(strip $(VER))
|
||||
ORIG_TGZ := $(PKG_NAME)_$(VERSION).orig.tar.gz
|
||||
ARCH := $(shell dpkg --print-architecture)
|
||||
DEB_BUILD_OPTIONS := nocheck
|
||||
DEB_BUILD_DIR := $(DEST)$(PKG_NAME)-$(VERSION)
|
||||
DEB_VER := 0
|
||||
DEB := python3-$(PKG_NAME)_$(VERSION)-$(DEB_VER)_$(ARCH).deb
|
||||
SOURCE_DATE_EPOCH := $(shell git log -1 --pretty=%ct)
|
||||
SOURCE_PKG_CMD := python -m build --sdist
|
||||
DEB_BUILD_CMD := dpkg-buildpackage -rfakeroot -uc -us
|
||||
COGAPP ?= $(shell which cog || which cogapp)
|
||||
|
||||
.PHONY:
|
||||
ggwave:
|
||||
# create a clean (maybe updated) copy of ggwave src
|
||||
rm -rf ggwave && mkdir ggwave && cp -r ../../include ggwave/ && cp -r ../../src ggwave/
|
||||
|
||||
deps:
|
||||
echo python -m pip install cogapp cython twine
|
||||
|
||||
pyggwave.bycython.cpp: ggwave.pyx cggwave.pxd
|
||||
python -m pip install cython
|
||||
cython --cleanup=3 --cplus ggwave.pyx -o ggwave.bycython.cpp
|
||||
|
||||
# To build package, README.rst is needed, because it goes into long description of package,
|
||||
@@ -17,12 +34,30 @@ pyggwave.bycython.cpp: ggwave.pyx cggwave.pxd
|
||||
|
||||
BUILD_SOURCE_FILES=ggwave pyggwave.bycython.cpp setup.py
|
||||
|
||||
$(DEST)$(DEB): $(DEST)$(ORIG_TGZ)
|
||||
-rm -r $(DEB_BUILD_DIR)
|
||||
tar -C $(DEST) -xf $(DEST)$(ORIG_TGZ)
|
||||
cp -arp debian $(DEB_BUILD_DIR)
|
||||
cd $(DEB_BUILD_DIR) && \
|
||||
DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONS) $(DEB_BUILD_CMD)
|
||||
|
||||
deb_sdist: $(BUILD_SOURCE_FILES) README.rst
|
||||
SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) $(SOURCE_PKG_CMD)
|
||||
mv $(DEST)$(PKG_NAME)-$(VERSION).tar.gz $(DEST)$(ORIG_TGZ)
|
||||
|
||||
_deb:
|
||||
@$(eval COGAPP=cogapp)
|
||||
|
||||
deb: _deb deb_sdist $(DEST)$(DEB)
|
||||
dpkg --contents $(DEST)$(DEB)
|
||||
ls -alh $(DEST)*$(PKG_NAME)*
|
||||
sha256sum $(DEST)$(DEB)
|
||||
|
||||
buildWithoutREADME.rst: ${BUILD_SOURCE_FILES}
|
||||
GGWAVE_OMIT_README_RST=1 python setup.py build_ext -i
|
||||
|
||||
README.rst: buildWithoutREADME.rst README-tmpl.rst
|
||||
python -m pip install cogapp
|
||||
cog -d -o README.rst README-tmpl.rst
|
||||
$(COGAPP) -d -o README.rst README-tmpl.rst
|
||||
|
||||
BUILD_FILES=${BUILD_SOURCE_FILES} README.rst
|
||||
|
||||
|
||||
5
bindings/python/debian/changelog
Normal file
5
bindings/python/debian/changelog
Normal file
@@ -0,0 +1,5 @@
|
||||
ggwave (0.4.2-0) unstable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- Georgi Gerganov <ggerganov@gmail.com> Sat, 15 Mar 2025 11:17:22 +0000
|
||||
40
bindings/python/debian/control
Normal file
40
bindings/python/debian/control
Normal file
@@ -0,0 +1,40 @@
|
||||
Source: ggwave
|
||||
Section: python
|
||||
Priority: optional
|
||||
Maintainer: Georgi Gerganov <ggerganov@gmail.com>
|
||||
Build-Depends: debhelper-compat (= 13),
|
||||
dh-python,
|
||||
cython3,
|
||||
python3-all-dev,
|
||||
python3-setuptools,
|
||||
Standards-Version: 4.6.2.0
|
||||
Testsuite: autopkgtest-pkg-pybuild
|
||||
Homepage: https://github.com/ggerganov/ggwave
|
||||
Rules-Requires-Root: no
|
||||
|
||||
Package: python3-ggwave
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends},
|
||||
Description: Tiny data-over-sound library
|
||||
Tiny data-over-sound library.
|
||||
.
|
||||
.
|
||||
.. code:: python
|
||||
.
|
||||
# generate audio waveform for string "hello python"
|
||||
waveform = ggwave.encode("hello python")
|
||||
.
|
||||
# decode audio waveform
|
||||
text = ggwave.decode(instance, waveform)
|
||||
.
|
||||
.
|
||||
--------
|
||||
Features
|
||||
--------
|
||||
.
|
||||
* Audible and ultrasound transmissions available
|
||||
* Bandwidth of 8-16 bytes/s (depending on the transmission protocol)
|
||||
* Robust FSK modulation
|
||||
* Reed-Solomon based error correction
|
||||
.
|
||||
------------
|
||||
14
bindings/python/debian/copyright
Normal file
14
bindings/python/debian/copyright
Normal file
@@ -0,0 +1,14 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: ggwave
|
||||
Upstream-Contact: Georgi Gerganov <ggerganov@gmail.com>
|
||||
Source: https://github.com/ggerganov/ggwave
|
||||
|
||||
Files: *
|
||||
Copyright: Georgi Gerganov <ggerganov@gmail.com>
|
||||
License: MIT
|
||||
|
||||
Files: debian/*
|
||||
Copyright: Georgi Gerganov <ggerganov@gmail.com>
|
||||
License: MIT
|
||||
|
||||
License: MIT
|
||||
1
bindings/python/debian/python3-ggwave.docs
Normal file
1
bindings/python/debian/python3-ggwave.docs
Normal file
@@ -0,0 +1 @@
|
||||
README.rst
|
||||
5
bindings/python/debian/rules
Executable file
5
bindings/python/debian/rules
Executable file
@@ -0,0 +1,5 @@
|
||||
#! /usr/bin/make -f
|
||||
|
||||
export PYBUILD_NAME=ggwave
|
||||
%:
|
||||
dh $@ --with python3 --buildsystem=pybuild
|
||||
1
bindings/python/debian/source/format
Normal file
1
bindings/python/debian/source/format
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
||||
1
bindings/python/debian/source/options
Normal file
1
bindings/python/debian/source/options
Normal file
@@ -0,0 +1 @@
|
||||
extend-diff-ignore="^[^/]+.(egg-info|dist-info)/"
|
||||
Reference in New Issue
Block a user