Skip to content

Add option to make the binary's name lower case#3138

Merged
ten9876 merged 1 commit into
aethersdr:mainfrom
dawkagaming:linux_lower_case_binary
May 25, 2026
Merged

Add option to make the binary's name lower case#3138
ten9876 merged 1 commit into
aethersdr:mainfrom
dawkagaming:linux_lower_case_binary

Conversation

@dawkagaming
Copy link
Copy Markdown
Contributor

Hello,

I think it might be useful to add an option for lower case binary naming, as usually the binaries in Linux distributions looks like that.

Thanks,
Dawid SP9SKA

@dawkagaming dawkagaming requested review from a team as code owners May 25, 2026 15:19
Copy link
Copy Markdown
Contributor

@aethersdr-agent aethersdr-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, @dawkagaming — lowercase binary names are very much the Linux convention and a sensible packaging option to expose. A few issues to address before this is mergeable:

1. Desktop file is unconditionally broken when the option is OFF.

The option defaults to OFF, so by default the binary is still installed as AetherSDR, but AetherSDR.desktop now points at Exec=aethersdr. That means desktop-menu launching will silently fail for every existing Linux user the moment this lands. The desktop file's Exec= must match whatever the build actually produced.

The cleanest fix is to template the desktop file:

if(UNIX AND NOT APPLE AND LINUX_LOWER_CASE_BINARY_NAME)
    set(AETHERSDR_BINARY_NAME aethersdr)
else()
    set(AETHERSDR_BINARY_NAME AetherSDR)
endif()
configure_file(
    ${CMAKE_SOURCE_DIR}/packaging/linux/AetherSDR.desktop.in
    ${CMAKE_BINARY_DIR}/packaging/linux/AetherSDR.desktop @ONLY)

…and change the checked-in file to AetherSDR.desktop.in with Exec=@AETHERSDR_BINARY_NAME@. Same set_target_properties block can then key off ${AETHERSDR_BINARY_NAME} too, which keeps the two in sync by construction.

2. if(LINUX ...) is not portable to this project's CMake floor.

The LINUX variable was added in CMake 3.25, but CMakeLists.txt:1 declares cmake_minimum_required(VERSION 3.20). On CMake 3.20–3.24 your conditional silently evaluates to false, so the rename never happens and the user just gets a confusing "option did nothing" experience. The existing code already uses the portable idiom — see CMakeLists.txt:67 (if(UNIX AND NOT APPLE)). Please match that.

3. option() is missing its help string.

option(LINUX_LOWER_CASE_BINARY_NAME OFF)

With no help text, CMake treats "OFF" as the docstring and the default value falls back to OFF — it works by accident. Every other option in this file (CMakeLists.txt:45, :120, :215, etc.) uses the proper 3-arg form. Please align:

option(LINUX_LOWER_CASE_BINARY_NAME "Install the Linux binary as 'aethersdr' instead of 'AetherSDR' (matches distro packaging convention)" OFF)

No other concerns — the change itself is small and the intent is good. Once the desktop file and the LINUX check are sorted, this should be ready.


🤖 aethersdr-agent · cost: $6.9300 · model: claude-opus-4-7

@dawkagaming dawkagaming force-pushed the linux_lower_case_binary branch from ac98a20 to 7dfe723 Compare May 25, 2026 16:19
@aethersdr-agent
Copy link
Copy Markdown
Contributor

Hi @dawkagaming — thanks for the PR! This will be helpful for distro packagers. The CI build job failed at the Configure step (log). Two things to fix:

1. CMake minimum version bump is too aggressive (the actual failure)

In CMakeLists.txt:

-cmake_minimum_required(VERSION 3.20)
+cmake_minimum_required(VERSION 3.31)

The CI container is built on ubuntu:24.04 (see .github/docker/Dockerfile), which ships CMake 3.28, so 3.31 fails to configure. Nothing your patch uses (option(), configure_file(... @ONLY), set_target_properties) needs anything past 3.20. Please revert that line back to 3.20 — it should just work.

2. Typo in the .desktop.in file

In packaging/linux/AetherSDR.desktop.in:

-Exec=AetherSDR
+Exec=Exec=@AETHERSDR_OUTPUT_BINARY_NAME@

The Exec= prefix got duplicated. It should be:

Exec=@AETHERSDR_OUTPUT_BINARY_NAME@

Otherwise the rendered .desktop file will have Exec=Exec=aethersdr, which desktop environments won't be able to launch.

Minor optional polish (not blocking)

  • The LINUX variable isn't auto-defined by CMake — you usually want if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LINUX_LOWER_CASE_BINARY_NAME) or if(UNIX AND NOT APPLE AND LINUX_LOWER_CASE_BINARY_NAME). With the current code the branch may never be taken even when the option is enabled, so the else() always wins. (See CMake docs on platform vars.)
  • configure_file(...) is currently unconditional — that's fine, but it means the generated .desktop always lands in the build tree even on non-Linux platforms. Not a blocker, just a heads-up.

Once those two fixes are in, the Configure step should pass and the rest of CI can run. Thanks again for tackling this — distro packaging support is genuinely useful, and 73 from one packager-friendly project to another!


🤖 aethersdr-agent · cost: $9.8075 · model: claude-opus-4-7

@ten9876
Copy link
Copy Markdown
Collaborator

ten9876 commented May 25, 2026

Claude here.

The core idea here is solid — lowercase binary names are a long-standing Linux convention (/usr/bin/aethersdr, not /usr/bin/AetherSDR), and the OUTPUT_NAME + .desktop.in templating approach is the right shape.

There are a few mechanical issues blocking the merge though:

1. The CMake version bump is the immediate CI failure

CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.31 or higher is required.  You are running version 3.28.3

The diff bumps cmake_minimum_required from 3.20 → 3.31. That's both unrelated to the feature and too aggressive — CMake 3.31 shipped November 2024 and most distro stable archives don't have it yet (Debian Bookworm: 3.25.1; Ubuntu 22.04 LTS: 3.22.1).

Fix: revert that line. Keep 3.20.

2. The LINUX variable requires CMake 3.25+

The if (LINUX AND LINUX_LOWER_CASE_BINARY_NAME) check uses the LINUX platform variable, which was only added in CMake 3.25. Even if we wanted to bump the minimum, going to 3.25 (vs. 3.31) would still exclude some LTS distros.

Fix: use the portable check that works at 3.20:

if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LINUX_LOWER_CASE_BINARY_NAME)

That's the standard recipe for "Linux but not macOS/BSD" detection on any modern CMake.

3. configure_file is writing to the source tree

configure_file(
    packaging/linux/AetherSDR.desktop.in
    packaging/linux/AetherSDR.desktop   this is the source tree
    @ONLY
)

CMake convention is that generated files live in the build tree, never the source tree (otherwise out-of-source builds dirty the working copy and git status lights up after every configure).

Fix: route the output through ${CMAKE_CURRENT_BINARY_DIR}:

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/AetherSDR.desktop.in
    ${CMAKE_CURRENT_BINARY_DIR}/packaging/linux/AetherSDR.desktop
    @ONLY
)

Then the install(FILES …) rule further down in CMakeLists.txt needs to consume the build-tree path:

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/packaging/linux/AetherSDR.desktop
    DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
)

(Currently it's installing packaging/linux/AetherSDR.desktop from the source tree — that's the file you renamed to .desktop.in, so the install rule needs updating either way.)

One small naming nit

LINUX_LOWER_CASE_BINARY_NAME is the option name today. The LINUX_ prefix is implied by the platform guard already, and CMake convention tends toward shorter feature-style names. Consider just LOWER_CASE_BINARY_NAME or AETHERSDR_LOWERCASE_BINARY. Bikeshed — not a blocker.

Easy revisions, all worth doing

If you want to push the fixes as a fixup commit on this same branch, that's perfect. If you'd rather we handle it from here, no problem — happy to land it with your name on the commit. Just say the word.

And by the way — the #3143 256x256 icon PR has been merged (commit 581ae220). Clean Lintian fix. Thank you.

73, Jeremy KK7GWY & Claude (AI dev partner)

@dawkagaming dawkagaming force-pushed the linux_lower_case_binary branch 2 times, most recently from b0a52c9 to 78357e2 Compare May 25, 2026 17:28
@dawkagaming dawkagaming force-pushed the linux_lower_case_binary branch from 78357e2 to 3d1566c Compare May 25, 2026 17:29
@ten9876 ten9876 merged commit 64eedbc into aethersdr:main May 25, 2026
5 checks passed
@ten9876
Copy link
Copy Markdown
Collaborator

ten9876 commented May 25, 2026

Claude here.

Merged at 64eedbc. Clean revision — took every piece of feedback and the diff stays minimal. AetherSDR is now packageable with a lowercased binary name via cmake -DLOWER_CASE_BINARY_NAME=ON, and the .desktop file's Exec= line gets the matching substitution.

Thanks Dawid — this is the third of your packaging-readiness PRs to land (after #3074 and #3143), and the rebuilt iteration here was textbook: CMake-version-aware platform check, build-tree output for generated files, install rule consuming the configured artifact. Exactly how this kind of multi-distro plumbing should look.

A small downstream note for whoever's doing the actual packaging: this bumps cmake_minimum_required from 3.20 → 3.25, which excludes Ubuntu 22.04 LTS (CMake 3.22.1). Debian Bookworm 3.25.1, Fedora 39+, Arch rolling, and Ubuntu 24.04+ are all fine. 22.04 packagers would need the Kitware PPA or pip install cmake. Worth a release-note line when we tag.

73, Jeremy KK7GWY & Claude (AI dev partner)

ten9876 added a commit to dawkagaming/AetherSDR that referenced this pull request May 25, 2026
…TT placement

Conflict resolutions in CMakeLists.txt:

* Option block conflict (top of file) — combined Dawid's centralised
  USE_SYSTEM_* + build-feature option block with main's
  LOWER_CASE_BINARY_NAME option (PR aethersdr#3138).
* Link-libraries block conflict (~line 875) — kept both the new
  USE_SYSTEM_* target_link_libraries calls and main's new
  LOWER_CASE_BINARY_NAME OUTPUT_NAME logic.  Independent additions,
  both retained.

Additional fixes on top:

* Dropped cmake_minimum_required from 3.25 back to 3.20.  After the
  switch from cmake_pkg_config to pkg_check_modules(IMPORTED_TARGET ...)
  nothing in the new code needs 3.25.  Restoring the original 3.20 keeps
  Debian 12 (cmake 3.25) friendly and matches what the rest of the file
  was written against.

* HAVE_MQTT / HAVE_MQTT_TLS placement — the previous form nested
  `target_compile_definitions(... HAVE_MQTT)` inside
  `if (NOT USE_SYSTEM_LIBMOSQUITTO)`, so USE_SYSTEM_LIBMOSQUITTO=ON would
  link against the system package but leave HAVE_MQTT undefined, meaning
  every `#ifdef HAVE_MQTT` block in the rest of the codebase compiled out.
  Moved HAVE_MQTT to the outer ENABLE_MQTT scope, and route HAVE_MQTT_TLS
  on the system-mosquitto branch through the existing MQTT_TLS option
  (distro mosquitto packages are conventionally TLS-enabled).

Local build clean against the bundled defaults (USE_SYSTEM_* all OFF).

Co-Authored-By: dawkagaming <147207983+dawkagaming@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants