-
Notifications
You must be signed in to change notification settings - Fork 64
Add scripts and CI workflows to build debian package #733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sashacmc
wants to merge
7
commits into
main
Choose a base branch
from
debian_package_support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2ef4aa7
Add scripts and CI workflows to build debian package
sashacmc 69110d1
fix: remove arch-specific glibc version from deb description
sashacmc ed2f824
fix: add argument validation and include dist-info in deb package
sashacmc b5a86bb
fix: guard against multiple wheels matching glob in build-debian job
sashacmc 2ee0adc
fix: use array for dist-info lookup and enable nullglob for wheel glob
sashacmc 9ef9ea1
fix: keep RECORD in dist-info and derive versioned libc6 dep from whe…
sashacmc 988efa3
fix: add INSTALLER marker and quote version in workflow
sashacmc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Copyright (c) 2026 ZettaScale Technology | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Eclipse Public License 2.0 which is available at | ||
| # http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
| # which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
| # | ||
| # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
| # | ||
| # Contributors: | ||
| # ZettaScale Zenoh Team, <zenoh@zettascale.tech> | ||
| # | ||
| # Usage: wheel-to-deb.sh <wheel_file> <package_name> <version> <debian_arch> | ||
| # Example: | ||
| # wheel-to-deb.sh eclipse_zenoh-1.0.0-cp39-abi3-manylinux_2_17_x86_64.whl \ | ||
| # python3-eclipse-zenoh 1.0.0 amd64 | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [[ $# -ne 4 ]]; then | ||
| echo "Usage: $0 <wheel_file> <package_name> <version> <debian_arch>" >&2 | ||
| echo "Example: $0 eclipse_zenoh-1.0.0-cp39-abi3-manylinux_2_17_x86_64.whl python3-eclipse-zenoh 1.0.0 amd64" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| WHEEL=$1 | ||
| PKG=$2 | ||
| VER=$3 | ||
| ARCH=$4 | ||
|
sashacmc marked this conversation as resolved.
|
||
|
|
||
| WORKDIR=$(mktemp -d) | ||
| trap 'rm -rf "$WORKDIR"' EXIT | ||
|
|
||
| unzip -q "$WHEEL" -d "$WORKDIR/contents" | ||
|
|
||
| DIST_PKG="$WORKDIR/deb/usr/lib/python3/dist-packages" | ||
| mkdir -p "$DIST_PKG" | ||
|
|
||
| cp -r "$WORKDIR/contents/zenoh" "$DIST_PKG/" | ||
|
|
||
|
sashacmc marked this conversation as resolved.
sashacmc marked this conversation as resolved.
|
||
| # Copy dist-info for importlib.metadata and pip compatibility | ||
| mapfile -t DIST_INFO_DIRS < <(find "$WORKDIR/contents" -maxdepth 1 -name "*.dist-info" -type d) | ||
| if [[ ${#DIST_INFO_DIRS[@]} -gt 1 ]]; then | ||
| echo "Expected at most one dist-info directory, found: ${DIST_INFO_DIRS[*]}" >&2 | ||
| exit 1 | ||
| fi | ||
| if [[ ${#DIST_INFO_DIRS[@]} -eq 1 ]]; then | ||
| cp -r "${DIST_INFO_DIRS[0]}" "$DIST_PKG/" | ||
| # Mark as dpkg-managed so pip does not attempt to uninstall these files | ||
| echo "dpkg" > "$DIST_PKG/$(basename "${DIST_INFO_DIRS[0]}")/INSTALLER" | ||
| fi | ||
|
|
||
| # Derive minimum glibc version from the manylinux tag in the wheel filename | ||
| # e.g. manylinux_2_17 -> libc6 (>= 2.17), manylinux_2_28 -> libc6 (>= 2.28) | ||
| LIBC6_DEP="libc6" | ||
| if [[ "$WHEEL" =~ manylinux_([0-9]+)_([0-9]+) ]]; then | ||
| LIBC6_DEP="libc6 (>= ${BASH_REMATCH[1]}.${BASH_REMATCH[2]})" | ||
| fi | ||
|
sashacmc marked this conversation as resolved.
|
||
|
|
||
| mkdir -p "$WORKDIR/deb/DEBIAN" | ||
| cat > "$WORKDIR/deb/DEBIAN/control" <<CTRL | ||
| Package: $PKG | ||
| Version: $VER | ||
| Architecture: $ARCH | ||
| Maintainer: ZettaScale Zenoh Team <zenoh@zettascale.tech> | ||
| Depends: python3 (>= 3.9), $LIBC6_DEP | ||
| Section: python | ||
|
sashacmc marked this conversation as resolved.
|
||
| Priority: optional | ||
|
sashacmc marked this conversation as resolved.
|
||
| Homepage: https://zenoh.io | ||
| Description: Eclipse Zenoh Python bindings | ||
| Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute. | ||
| . | ||
| This package provides the Python bindings for Eclipse Zenoh, enabling | ||
| pub/sub, queryable and geo-distributed storage in Python. | ||
| . | ||
| Built from manylinux wheels. | ||
| CTRL | ||
|
|
||
| dpkg-deb --build --root-owner-group "$WORKDIR/deb" "${PKG}_${VER}_${ARCH}.deb" | ||
| echo "Built: ${PKG}_${VER}_${ARCH}.deb" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.