Skip to content
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

Added deb to cargo.toml #1402

Closed
wants to merge 1 commit into from
Closed

Added deb to cargo.toml #1402

wants to merge 1 commit into from

Conversation

euri10
Copy link

@euri10 euri10 commented Jan 18, 2022

Greetings, this is a draft PR to check if there would be some interest in having the deb meta in the cargo.toml

The reason I'm proposing this is the following, I install i3status-rs as a deb package for each release.
In order to do that I run this small build.sh script, like ./build.sh -v 0.20.6 for instance. after I patched my fork with the added contents of that PR.

So having it in the base repo would alleviate the manual steps of having to patch it on my fork :)

No worries if that doesn't land, and thanks for the amazing bar !

#! /usr/bin/env bash

set -eux

IMAGE="debian:bullseye-slim"
TARGET="$(dirname "$0" | xargs realpath)"
VERSION="v0.21.1"

while getopts "v:i:h" opt
do
    case "$opt" in
        v)
            VERSION="$OPTARG"
            ;;
        h)
            echo "Usage: $0 [-i image] [-v version]"
            exit 0
            ;;
        *)
            exit 1
            ;;
    esac
done

main() {
	docker build --progress=plain -t i3status-build-$$ --build-arg VERSION=$VERSION .
	docker create --name i3status i3status-build-$$
	docker cp i3status:/target/i3status-rust_${VERSION}_amd64.deb "$TARGET" 
	docker rm i3status
}

main
FROM rust:1.58-slim-bullseye
ARG VERSION
RUN DEBIAN_FRONTEND=noninteractive && \
	apt-get update && \
	apt-get install -y git librust-libdbus-sys-dev libssl-dev libpulse-dev && \
	apt-get -y clean && \
	rm -rf /var/lib/apt/lists/*
RUN cargo install cargo-deb
RUN git clone -b v$VERSION.deb https://github.com/euri10/i3status-rust.git && \
	cd i3status-rust
WORKDIR /i3status-rust
RUN cargo deb -- --features=maildir
RUN mkdir /target && cp /i3status-rust/target/debian/*.deb /target

Verified

This commit was signed with the committer’s verified signature. The key has expired.
addaleax Anna Henningsen
@cfsmp3
Copy link
Contributor

cfsmp3 commented Jan 18, 2022

Looks like there's some work for .deb going on that might be nice to be unified.

I also have a .deb packager, but cargo deb creates a binary package, not a source package, which is not so useful for debian-derived distros (or debian itself).

https://github.com/cfsmp3/i3status-rust-docker-from-scratch

@ammgws ammgws added the packaging Issues related to distro packaging. label Jan 19, 2022
@ammgws
Copy link
Collaborator

ammgws commented Jan 19, 2022

@euri10 Have you had a look at the discussion in #431? If so how does this fit in with what's been tried so far?

@nivex
Copy link

nivex commented Apr 24, 2023

#431 talks about getting the package into Debian proper. While this would be ideal, I favor having the metadata in Cargo.toml as well. This would enable me (or any other user) to download a release tarball and invoke cargo deb and have a package that can be managed locally.

There have been some changes since this was proposed. Here's the added bits I use for 0.30.7:

[package.metadata.deb]
name = "i3status-rust"
extended-description = """\
Provides provides a way to display 'blocks' of system information (time, \
battery status, volume, etc) on the i3 (https://i3wm.org/) bar.
.
Also compatible with Sway (http://swaywm.org/).
.
For a list of available blocks, see the block documentation in \
usr/share/docs/i3status-rust/blocks.md."""
license-file = ["LICENSE", "0"]
depends = "$auto, libdbus-1-3 (>=1.6), libpulse0"
section = "utils"
priority = "optional"
assets = [
    ["target/release/i3status-rs", "usr/bin/", "755"],
    ["README.md", "usr/share/doc/i3status-rust/README", "644"],
    ["examples/*", "usr/share/doc/i3status-rust/examples/", "644"],
    ["examples/scripts/*", "usr/share/doc/i3status-rust/examples/scripts/", "644"],
    ["files/icons/*", "usr/share/i3status-rust/icons/", "644"],
    ["files/themes/*", "usr/share/i3status-rust/themes/", "644"],
    ["man/i3status-rs.1", "usr/share/man/man1/", "644"]
]

@ammgws ammgws closed this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Issues related to distro packaging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants