cool tech zone zone
Gentoo Ebuild for Tangara Companion Application - Printable Version

+- cool tech zone zone (https://forum.cooltech.zone)
+-- Forum: Tangara (https://forum.cooltech.zone/forumdisplay.php?fid=3)
+--- Forum: General (https://forum.cooltech.zone/forumdisplay.php?fid=5)
+--- Thread: Gentoo Ebuild for Tangara Companion Application (/showthread.php?tid=72)



Gentoo Ebuild for Tangara Companion Application - ayumi - 2024-12-14

Hi!

I’ve wrote an ebuild for Tangara Companion (and discovered a Cargo bug in the process), so I can have it ready to go when my Tangara arrives (I’m still waiting for it to be shipped). While it’s not unlikely that I’m the only (future) Tangara owner that also uses Gentoo, maybe this can help other people who would like to package the application for their distributions of choice.
Code:
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Autogenerated by pycargoebuild 0.13.4

EAPI=8

CRATES='
    addr2line@0.21.0
    adler@1.0.2
    aho-corasick@1.1.2
    ansi_term@0.12.1
    anstream@0.6.11
    anstyle-parse@0.2.3
    anstyle-query@1.0.2
    anstyle-wincon@3.0.2
    anstyle@1.0.6
    anyhow@1.0.79
    array-init@2.1.0
    async-channel@2.2.0
    atomic-polyfill@1.0.3
    atty@0.2.14
    autocfg@1.1.0
    backtrace-ext@0.2.1
    backtrace@0.3.69
    base64@0.21.7
    binrw@0.12.0
    binrw_derive@0.12.0
    bitflags@1.3.2
    bitflags@2.4.2
    bitvec@1.0.1
    block-buffer@0.10.4
    bytemuck@1.14.3
    bytemuck_derive@1.5.0
    byteorder@1.5.0
    cairo-rs@0.19.1
    cairo-sys-rs@0.19.1
    cc@1.0.83
    cfg-expr@0.15.6
    cfg-if@1.0.0
    clap@2.34.0
    colorchoice@1.0.0
    concurrent-queue@2.4.0
    console@0.15.8
    convert_case@0.4.0
    core-foundation-sys@0.8.6
    cpufeatures@0.2.12
    crc32fast@1.3.2
    critical-section@1.1.2
    crossbeam-utils@0.8.19
    crypto-common@0.1.6
    csv-core@0.1.11
    csv@1.3.0
    darling@0.14.4
    darling_core@0.14.4
    darling_macro@0.14.4
    deku@0.16.0
    deku_derive@0.16.0
    derive_more@0.99.17
    digest@0.10.7
    either@1.10.0
    encode_unicode@0.3.6
    env_filter@0.1.0
    env_logger@0.11.1
    equivalent@1.0.1
    esp-idf-part@0.4.1
    espflash@2.1.0
    event-listener-strategy@0.5.0
    event-listener@5.0.0
    field-offset@0.3.6
    flate2@1.0.28
    fnv@1.0.7
    funty@2.0.0
    futures-channel@0.3.30
    futures-core@0.3.30
    futures-executor@0.3.30
    futures-io@0.3.30
    futures-macro@0.3.30
    futures-sink@0.3.30
    futures-task@0.3.30
    futures-util@0.3.30
    futures@0.3.30
    gdk-pixbuf-sys@0.19.0
    gdk-pixbuf@0.19.0
    gdk4-sys@0.8.0
    gdk4@0.8.0
    generic-array@0.14.7
    gimli@0.28.1
    gio-sys@0.19.0
    gio@0.19.0
    glib-macros@0.19.0
    glib-sys@0.19.0
    glib@0.19.0
    gobject-sys@0.19.0
    graphene-rs@0.19.0
    graphene-sys@0.19.0
    gsk4-sys@0.8.0
    gsk4@0.8.0
    gtk4-macros@0.8.0
    gtk4-sys@0.8.0
    gtk4@0.8.0
    hash32@0.2.1
    hashbrown@0.14.3
    heapless@0.7.17
    heck@0.3.3
    heck@0.4.1
    hermit-abi@0.1.19
    hermit-abi@0.3.6
    humantime@2.1.0
    ident_case@1.0.1
    indexmap@2.1.0
    indicatif@0.17.8
    instant@0.1.12
    io-kit-sys@0.4.0
    is-terminal@0.4.12
    is_ci@1.2.0
    itoa@1.0.10
    lazy_static@1.4.0
    libadwaita-sys@0.6.0
    libadwaita@0.6.0
    libc@0.2.152
    libudev-sys@0.1.4
    libudev@0.3.0
    lock_api@0.4.11
    log@0.4.20
    mach2@0.4.2
    md5@0.7.0
    memchr@2.7.1
    memoffset@0.9.0
    miette-derive@5.10.0
    miette@5.10.0
    miniz_oxide@0.7.1
    nix@0.26.4
    num-traits@0.2.18
    number_prefix@0.4.0
    object@0.32.2
    once_cell@1.19.0
    owo-colors@3.5.0
    pango-sys@0.19.0
    pango@0.19.0
    parking@2.2.0
    parse_int@0.6.0
    pin-project-lite@0.2.13
    pin-utils@0.1.0
    pkg-config@0.3.29
    portable-atomic@1.6.0
    proc-macro-crate@1.3.1
    proc-macro-crate@3.1.0
    proc-macro-error-attr@1.0.4
    proc-macro-error@1.0.4
    proc-macro2@1.0.76
    quote@1.0.35
    radium@0.7.0
    regex-automata@0.4.3
    regex-syntax@0.8.2
    regex@1.10.2
    rustc-demangle@0.1.23
    rustc_version@0.4.0
    rustversion@1.0.14
    ryu@1.0.16
    same-file@1.0.6
    scopeguard@1.2.0
    semver@1.0.21
    serde@1.0.195
    serde_derive@1.0.195
    serde_json@1.0.111
    serde_plain@1.0.2
    serde_spanned@0.6.5
    sha2@0.10.8
    slab@0.4.9
    slip-codec@0.3.4
    smallvec@1.12.0
    smawk@0.3.2
    spin@0.9.8
    stable_deref_trait@1.2.0
    static_assertions@1.1.0
    strsim@0.10.0
    strsim@0.8.0
    structopt-derive@0.4.18
    structopt@0.3.26
    strum@0.24.1
    strum@0.25.0
    strum_macros@0.24.3
    strum_macros@0.25.3
    supports-color@2.1.0
    supports-hyperlinks@2.1.0
    supports-unicode@2.1.0
    syn@1.0.109
    syn@2.0.48
    system-deps@6.2.0
    tap@1.0.1
    target-lexicon@0.12.13
    terminal_size@0.1.17
    textwrap@0.11.0
    textwrap@0.15.2
    thiserror-impl@1.0.56
    thiserror@1.0.56
    thread-executor@0.1.0
    toml@0.8.10
    toml_datetime@0.6.5
    toml_edit@0.19.15
    toml_edit@0.21.1
    toml_edit@0.22.4
    tree-sitter-lua@0.0.19
    tree-sitter@0.20.10
    typenum@1.17.0
    unescaper@0.1.3
    unicode-ident@1.0.12
    unicode-linebreak@0.1.5
    unicode-segmentation@1.11.0
    unicode-width@0.1.11
    utf8parse@0.2.1
    vec_map@0.8.2
    version-compare@0.1.1
    version_check@0.9.4
    walkdir@2.4.0
    winapi-i686-pc-windows-gnu@0.4.0
    winapi-util@0.1.6
    winapi-x86_64-pc-windows-gnu@0.4.0
    winapi@0.3.9
    windows-sys@0.52.0
    windows-targets@0.52.0
    windows_aarch64_gnullvm@0.52.0
    windows_aarch64_msvc@0.52.0
    windows_i686_gnu@0.52.0
    windows_i686_msvc@0.52.0
    windows_x86_64_gnu@0.52.0
    windows_x86_64_gnullvm@0.52.0
    windows_x86_64_msvc@0.52.0
    winnow@0.5.34
    wyz@0.5.1
    xmas-elf@0.9.1
    zero@0.1.3
    zip@0.6.6
'

declare -A GIT_CRATES=(
    [serialport]='https://github.com/haileys/serialport-rs;254368237a0e5185cc6e08a060964d033e01a382;serialport-rs-%commit%'
)

inherit cargo

DESCRIPTION='Tangara music player companion application'
HOMEPAGE='https://cooltech.zone/tangara/'
SRC_URI="
    https://github.com/haileys/${PN}/archive/refs/tags/v${PV}.tar.gz
    ${CARGO_CRATE_URIS}
"

LICENSE='GPL-3'
# Dependent crate licenses
LICENSE+='
    Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD ISC MIT MPL-2.0
    Unicode-DFS-2016
'
SLOT='0'
KEYWORDS='~amd64'

DEPEND='
    >=gui-libs/gtk-4.12
    >=gui-libs/libadwaita-1.4
    dev-libs/glib
    x11-libs/gdk-pixbuf
    x11-libs/pango
    virtual/udev
'
BDEPEND='
    virtual/pkgconfig
    sys-apps/sed
    app-alternatives/awk
'
RDEPEND="${DEPEND}"

src_prepare() {
    default
    sed -e 's/git = "https:\/\/github\.com\/haileys\/serialport-rs", branch = "tangara-flasher"/'"path = \"${WORKDIR//\//\\/}\/serialport-rs-$(echo ${GIT_CRATES[serialport]} | awk 'BEGIN{FS=";"}; END{print $2}')\"/" -i Cargo.toml || die
}

src_configure() {
    export PKG_CONFIG_ALLOW_CROSS=1
    cargo_src_configure
}
P.S. Sorry for puting it in a [code] block, but the forum software didn’t want to attach it the normal way.


RE: Gentoo Ebuild for Tangara Companion Application - ayumi - 2024-12-16

Here is an updated ebuild for the v0.4.3 (and coincidently also v0.4.2, since dependences didn’t seem to change between those versions):
Code:
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Autogenerated by pycargoebuild 0.13.4

EAPI=8

CRATES='
    addr2line@0.24.2
    adler2@2.0.0
    aho-corasick@1.1.3
    ansi_term@0.12.1
    anstream@0.6.18
    anstyle-parse@0.2.6
    anstyle-query@1.1.2
    anstyle-wincon@3.0.6
    anstyle@1.0.10
    array-init@2.1.0
    async-channel@2.3.1
    atomic-polyfill@1.0.3
    atty@0.2.14
    autocfg@1.4.0
    backtrace-ext@0.2.1
    backtrace@0.3.74
    base64@0.21.7
    binrw@0.12.0
    binrw_derive@0.12.0
    bitflags@1.3.2
    bitflags@2.6.0
    bitvec@1.0.1
    block-buffer@0.10.4
    bumpalo@3.16.0
    bytemuck@1.20.0
    bytemuck_derive@1.8.0
    byteorder@1.5.0
    cairo-rs@0.20.5
    cairo-sys-rs@0.20.0
    cc@1.2.1
    cfg-expr@0.17.1
    cfg-if@1.0.0
    clap@2.34.0
    colorchoice@1.0.3
    concurrent-queue@2.5.0
    console@0.15.8
    convert_case@0.4.0
    core-foundation-sys@0.8.7
    cpufeatures@0.2.15
    crc32fast@1.4.2
    critical-section@1.2.0
    crossbeam-utils@0.8.20
    crypto-common@0.1.6
    csv-core@0.1.11
    csv@1.3.1
    darling@0.14.4
    darling_core@0.14.4
    darling_macro@0.14.4
    deku@0.16.0
    deku_derive@0.16.0
    derive_more@0.99.18
    digest@0.10.7
    either@1.13.0
    encode_unicode@0.3.6
    env_filter@0.1.2
    env_logger@0.11.5
    equivalent@1.0.1
    esp-idf-part@0.4.1
    espflash@2.1.0
    event-listener-strategy@0.5.2
    event-listener@5.3.1
    field-offset@0.3.6
    flate2@1.0.35
    fnv@1.0.7
    funty@2.0.0
    futures-channel@0.3.31
    futures-core@0.3.31
    futures-executor@0.3.31
    futures-io@0.3.31
    futures-macro@0.3.31
    futures-sink@0.3.31
    futures-task@0.3.31
    futures-util@0.3.31
    futures@0.3.31
    gdk-pixbuf-sys@0.20.4
    gdk-pixbuf@0.20.4
    gdk4-sys@0.9.4
    gdk4@0.9.4
    generic-array@0.14.7
    gimli@0.31.1
    gio-sys@0.20.6
    gio@0.20.6
    glib-macros@0.20.5
    glib-sys@0.20.6
    glib@0.20.6
    gobject-sys@0.20.4
    graphene-rs@0.20.4
    graphene-sys@0.20.4
    gsk4-sys@0.9.4
    gsk4@0.9.4
    gtk4-macros@0.9.3
    gtk4-sys@0.9.4
    gtk4@0.9.4
    hash32@0.2.1
    hashbrown@0.15.1
    heapless@0.7.17
    heck@0.3.3
    heck@0.4.1
    heck@0.5.0
    hermit-abi@0.1.19
    hermit-abi@0.4.0
    humantime@2.1.0
    ident_case@1.0.1
    indexmap@2.6.0
    indicatif@0.17.9
    io-kit-sys@0.4.1
    is-terminal@0.4.13
    is_ci@1.2.0
    is_terminal_polyfill@1.70.1
    itoa@1.0.11
    js-sys@0.3.72
    lazy_static@1.5.0
    libadwaita-sys@0.7.1
    libadwaita@0.7.1
    libc@0.2.164
    libudev-sys@0.1.4
    libudev@0.3.0
    lock_api@0.4.12
    log@0.4.22
    mach2@0.4.2
    md5@0.7.0
    memchr@2.7.4
    memoffset@0.9.1
    miette-derive@5.10.0
    miette@5.10.0
    miniz_oxide@0.8.0
    nix@0.26.4
    num-traits@0.2.19
    number_prefix@0.4.0
    object@0.36.5
    once_cell@1.20.2
    owo-colors@3.5.0
    pango-sys@0.20.4
    pango@0.20.6
    parking@2.2.1
    parse_int@0.6.0
    pin-project-lite@0.2.15
    pin-utils@0.1.0
    pkg-config@0.3.31
    portable-atomic@1.9.0
    proc-macro-crate@1.3.1
    proc-macro-crate@3.2.0
    proc-macro-error-attr@1.0.4
    proc-macro-error@1.0.4
    proc-macro2@1.0.89
    quote@1.0.37
    radium@0.7.0
    regex-automata@0.4.9
    regex-syntax@0.8.5
    regex@1.11.1
    rustc-demangle@0.1.24
    rustc_version@0.4.1
    rustversion@1.0.18
    ryu@1.0.18
    same-file@1.0.6
    scopeguard@1.2.0
    semver@1.0.23
    serde@1.0.215
    serde_derive@1.0.215
    serde_json@1.0.133
    serde_plain@1.0.2
    serde_spanned@0.6.8
    sha2@0.10.8
    shlex@1.3.0
    slab@0.4.9
    slip-codec@0.3.4
    smallvec@1.13.2
    smawk@0.3.2
    spin@0.9.8
    stable_deref_trait@1.2.0
    static_assertions@1.1.0
    strsim@0.10.0
    strsim@0.8.0
    structopt-derive@0.4.18
    structopt@0.3.26
    strum@0.24.1
    strum@0.25.0
    strum_macros@0.24.3
    strum_macros@0.25.3
    supports-color@2.1.0
    supports-hyperlinks@2.1.0
    supports-unicode@2.1.0
    syn@1.0.109
    syn@2.0.87
    system-deps@7.0.3
    tap@1.0.1
    target-lexicon@0.12.16
    terminal_size@0.1.17
    textwrap@0.11.0
    textwrap@0.15.2
    thiserror-impl@1.0.69
    thiserror@1.0.69
    thread-executor@0.2.0
    toml@0.8.19
    toml_datetime@0.6.8
    toml_edit@0.19.15
    toml_edit@0.22.22
    tree-sitter-lua@0.0.19
    tree-sitter@0.20.10
    typenum@1.17.0
    unescaper@0.1.5
    unicode-ident@1.0.13
    unicode-linebreak@0.1.5
    unicode-segmentation@1.12.0
    unicode-width@0.1.14
    unicode-width@0.2.0
    utf8parse@0.2.2
    vec_map@0.8.2
    version-compare@0.2.0
    version_check@0.9.5
    walkdir@2.5.0
    wasm-bindgen-backend@0.2.95
    wasm-bindgen-macro-support@0.2.95
    wasm-bindgen-macro@0.2.95
    wasm-bindgen-shared@0.2.95
    wasm-bindgen@0.2.95
    web-time@1.1.0
    winapi-i686-pc-windows-gnu@0.4.0
    winapi-util@0.1.9
    winapi-x86_64-pc-windows-gnu@0.4.0
    winapi@0.3.9
    windows-sys@0.52.0
    windows-sys@0.59.0
    windows-targets@0.52.6
    windows_aarch64_gnullvm@0.52.6
    windows_aarch64_msvc@0.52.6
    windows_i686_gnu@0.52.6
    windows_i686_gnullvm@0.52.6
    windows_i686_msvc@0.52.6
    windows_x86_64_gnu@0.52.6
    windows_x86_64_gnullvm@0.52.6
    windows_x86_64_msvc@0.52.6
    winnow@0.5.40
    winnow@0.6.20
    wyz@0.5.1
    xmas-elf@0.9.1
    zero@0.1.3
    zip@0.6.6
'

declare -A GIT_CRATES=(
    [serialport]='https://github.com/haileys/serialport-rs;254368237a0e5185cc6e08a060964d033e01a382;serialport-rs-%commit%'
)

inherit cargo

DESCRIPTION='Tangara music player companion application'
HOMEPAGE='https://cooltech.zone/tangara/'
SRC_URI="
    https://github.com/haileys/${PN}/archive/refs/tags/v${PV}.tar.gz
    ${CARGO_CRATE_URIS}
"

LICENSE='GPL-3'
# Dependent crate licenses
LICENSE+='
    Apache-2.0 Apache-2.0-with-LLVM-exceptions ISC MIT MPL-2.0
    Unicode-DFS-2016
'
SLOT='0'
KEYWORDS='~amd64'

DEPEND='
    >=gui-libs/gtk-4.10
    >=gui-libs/libadwaita-1.4
    >=dev-libs/glib-2
    x11-libs/gdk-pixbuf
    x11-libs/pango
    virtual/udev
'
BDEPEND='
    virtual/pkgconfig
    sys-apps/sed
    app-alternatives/awk
'
RDEPEND="${DEPEND}"

src_prepare() {
    default
    sed -e 's/git = "https:\/\/github\.com\/haileys\/serialport-rs", branch = "tangara-flasher"/'"path = \"${WORKDIR//\//\\/}\/serialport-rs-$(echo ${GIT_CRATES[serialport]} | awk 'BEGIN{FS=";"}; END{print $2}')\"/" -i Cargo.toml || die
}

src_configure() {
    export PKG_CONFIG_ALLOW_CROSS=1
    cargo_src_configure
}
I’m considering making an ebuild repository/overlay for those, if no one from Cool Tech Zone has any objections.


RE: Gentoo Ebuild for Tangara Companion Application - jacqueline - 2024-12-16

If I don't have to do anything then I have no objections. Thanks for doing this!


RE: Gentoo Ebuild for Tangara Companion Application - ayumi - 2024-12-17

Assuming that I didn’t make any mistakes, the repository (together with instructions on how to use it) is here.


RE: Gentoo Ebuild for Tangara Companion Application - vimja - 2024-12-21

Hei wow, this is so cool. I actually tried to make one of my own but gave up at the serialport crate.

Could you add the ~arm64 keyword? I just successfully built and ran both the cli and the companion app on my rk3588 powered mnt reform. Used the companion to flash the 1.0.2 firmware, in fact.

You should try getting your overlay added to the eselect list. I found the process to be surprisingly simple!


RE: Gentoo Ebuild for Tangara Companion Application - ayumi - 2024-12-22

(2024-12-21, 10:43 PM)vimja Wrote: Could you add the ~arm64 keyword? I just successfully built and ran both the cli and the companion app on my rk3588 powered mnt reform. Used the companion to flash the 1.0.2 firmware, in fact.
I keyworded both ebuilds, thanks for letting me know that they do work on arm64. I’m considering blindly keywording future versions too, though I’m not sure if that’s a good idea, since I can only test them on amd64.
(2024-12-21, 10:43 PM)vimja Wrote: You should try getting your overlay added to the eselect list. I found the process to be surprisingly simple!
I can consider doing this in the future, though I would need to get an email address that I wouldn’t have a problem sharing publicly first and I would need to check what exact policies the Overlays project has — some Gentoo projects (like GURU for example) have quite strict policies about what exactly is required out of their participants.