Bug 296480 - [NEW PORT] deskutils/rpi-imager: Raspberry Pi Imaging Utility
Summary: [NEW PORT] deskutils/rpi-imager: Raspberry Pi Imaging Utility
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Siva Mahadevan
URL: https://github.com/jainnimish/rpi-ima...
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-03 06:16 UTC by Nimish Jain
Modified: 2026-07-07 15:50 UTC (History)
4 users (show)

See Also:


Attachments
Makefile, pkg-* (9.00 KB, patch)
2026-07-03 06:16 UTC, Nimish Jain
no flags Details | Diff
Makefiles and pkg files (3.30 KB, patch)
2026-07-03 06:22 UTC, Nimish Jain
no flags Details | Diff
Updates as suggested (3.49 KB, patch)
2026-07-03 16:07 UTC, Nimish Jain
no flags Details | Diff
put tools:build in right location (3.49 KB, patch)
2026-07-03 16:21 UTC, Nimish Jain
no flags Details | Diff
final patch (3.58 KB, patch)
2026-07-03 19:31 UTC, Nimish Jain
no flags Details | Diff
Update to proposed rpi-imager port (3.50 KB, patch)
2026-07-04 23:08 UTC, Jim Chen
no flags Details | Diff
Update to proposed rpi-imager port (3.54 KB, patch)
2026-07-05 00:15 UTC, Jim Chen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nimish Jain 2026-07-03 06:16:55 UTC
Created attachment 272424 [details]
Makefile, pkg-*

User-friendly tool for creating bootable media for Raspberry Pi devices.
Ported from https://github.com/raspberrypi/rpi-imager.
Comment 1 Nimish Jain 2026-07-03 06:22:14 UTC
Created attachment 272425 [details]
Makefiles and pkg files
Comment 2 Siva Mahadevan freebsd_committer freebsd_triage 2026-07-03 13:39:41 UTC
Awesome work! Couple of initial comments before testing it out locally:

1. Any new port also requires a change to ../Makefile (in the same category) to add the port.

2. I've run `portlint -A` on it (you can also try it out from ports-mgmt/portlint), here are the findings:

[x470.1] rpi-imager) portlint -A
FATAL: Makefile: [1]: use a tab (not space) after a variable name
FATAL: Makefile: [2]: use a tab (not space) after a variable name
FATAL: Makefile: [3]: use a tab (not space) after a variable name
FATAL: Makefile: [4]: use a tab (not space) after a variable name
FATAL: Makefile: [6]: use a tab (not space) after a variable name
FATAL: Makefile: [7]: use a tab (not space) after a variable name
FATAL: Makefile: [8]: use a tab (not space) after a variable name
FATAL: Makefile: [10]: use a tab (not space) after a variable name
FATAL: Makefile: [11]: use a tab (not space) after a variable name
FATAL: Makefile: [18]: use a tab (not space) after a variable name
WARN: Makefile: [19]: use a tab (not space) after a variable name
FATAL: Makefile: [22]: use a tab (not space) after a variable name
FATAL: Makefile: [23]: use a tab (not space) after a variable name
FATAL: Makefile: [25]: use a tab (not space) after a variable name
FATAL: Makefile: [26]: use a tab (not space) after a variable name
FATAL: Makefile: [28]: use a tab (not space) after a variable name
FATAL: Makefile: [31]: use a tab (not space) after a variable name
FATAL: Makefile: [32]: use a tab (not space) after a variable name
WARN: Makefile: [34]: use a tab (not space) after a variable name
FATAL: Makefile: [35]: use a tab (not space) after a variable name
FATAL: Makefile: [38]: use a tab (not space) after a variable name
FATAL: Makefile: [39]: use a tab (not space) after a variable name
WARN: Makefile: [44]: use a tab (not space) after a variable name

Keep running that until it comes back clean. I'll test it locally in the meantime.

3. LICENSE_FILE= ${WRKDIR}/${PORTNAME}-${PORTVERSION}/license.txt

This can just be ${WRKSRC}/license.txt. That expands to the same thing.

4. OPTIONS_DEFINE= LINGUIST 

Honestly, if the 'tools:build' QT dependency isn't too large and it doesn't add too much extra complexity, I'd just remove this option and unconditionally add it. Language translations are always a good thing.
Comment 3 Nimish Jain 2026-07-03 16:07:07 UTC
Created attachment 272455 [details]
Updates as suggested

I have done everything except the LICENSE thing. I set WRKSRC_SUBDIR, so I cannot use ${WRKSRC}/license.txt. If I try it anyway, the build fails saying there's no license file in ${WRKSRC}.
Comment 4 Nimish Jain 2026-07-03 16:19:23 UTC
Comment on attachment 272455 [details]
Updates as suggested

>From 550052d78881b96869630861484dce77f6d5a825 Mon Sep 17 00:00:00 2001
>From: Nimish Jain <njain15@protonmail.com>
>Date: Fri, 3 Jul 2026 03:37:07 +0000
>Subject: [NEW PORT] Add rpi-imager port
>
>This port allows users to flash bootable media onto a Raspberry Pi device.
>
>Co-authored-by: Jim Chen <jim.chen.1827@gmail.com>
>---
> deskutils/Makefile             |  1 +
> deskutils/rpi-imager/Makefile  | 38 ++++++++++++++++++++++++++++++++++
> deskutils/rpi-imager/distinfo  |  3 +++
> deskutils/rpi-imager/pkg-descr |  3 +++
> deskutils/rpi-imager/pkg-plist |  8 +++++++
> 5 files changed, 53 insertions(+)
> create mode 100644 deskutils/rpi-imager/Makefile
> create mode 100644 deskutils/rpi-imager/distinfo
> create mode 100644 deskutils/rpi-imager/pkg-descr
> create mode 100644 deskutils/rpi-imager/pkg-plist
>
>diff --git a/deskutils/Makefile b/deskutils/Makefile
>index 1f9e6a3738b2..feafb6454fd0 100644
>--- a/deskutils/Makefile
>+++ b/deskutils/Makefile
>@@ -254,6 +254,7 @@
>     SUBDIR += rednotebook
>     SUBDIR += remind
>     SUBDIR += rolo
>+    SUBDIR += rpi-imager
>     SUBDIR += rubygem-shellplay
>     SUBDIR += rubygem-taskjuggler
>     SUBDIR += rwpspread
>diff --git a/deskutils/rpi-imager/Makefile b/deskutils/rpi-imager/Makefile
>new file mode 100644
>index 000000000000..3a252ed61623
>--- /dev/null
>+++ b/deskutils/rpi-imager/Makefile
>@@ -0,0 +1,38 @@
>+PORTNAME=	rpi-imager
>+DISTVERSIONPREFIX=v
>+DISTVERSION=	2.0.10
>+CATEGORIES=	deskutils
>+
>+MAINTAINER=	njain15@protonmail.com
>+COMMENT=	Raspberry Pi Imaging Utility
>+WWW=		https://github.com/jainnimish/rpi-imager
>+
>+LICENSE=	APACHE20
>+LICENSE_FILE=	${WRKDIR}/${PORTNAME}-${PORTVERSION}/license.txt
>+
>+LIB_DEPENDS=	libcurl.so:ftp/curl \
>+		libgnutls.so:security/gnutls \
>+		libidn2.so:dns/libidn2 \
>+		libnettle.so:security/nettle
>+
>+FLAVORS=	default cli
>+FLAVOR?=	${FLAVORS:[1]}
>+cli_PKGNAMESUFFIX=-cli
>+
>+USES=		qt:6 cmake pkgconfig desktop-file-utils libarchive:run
>+USE_QT=	base tools:build
>+
>+USE_GITHUB=	yes
>+GH_ACCOUNT=	jainnimish
>+
>+WRKSRC_SUBDIR=	src
>+
>+.if ${FLAVOR} == cli
>+CMAKE_ON=	BUILD_CLI_ONLY
>+PLIST_SUB=	GUI="@comment " CLI=""
>+.else
>+USE_QT+=	svg declarative imageformats:run
>+PLIST_SUB=	CLI="@comment " GUI=""
>+.endif
>+
>+.include <bsd.port.mk>
>diff --git a/deskutils/rpi-imager/distinfo b/deskutils/rpi-imager/distinfo
>new file mode 100644
>index 000000000000..1e4f1b138678
>--- /dev/null
>+++ b/deskutils/rpi-imager/distinfo
>@@ -0,0 +1,3 @@
>+TIMESTAMP = 1783051961
>+SHA256 (jainnimish-rpi-imager-v2.0.10_GH0.tar.gz) = 3fbdfb5703e70f7fb9b4ebcf3a8ab180dfd307d4a7ca334e5d2c22f32005efa1
>+SIZE (jainnimish-rpi-imager-v2.0.10_GH0.tar.gz) = 6894479
>diff --git a/deskutils/rpi-imager/pkg-descr b/deskutils/rpi-imager/pkg-descr
>new file mode 100644
>index 000000000000..35127c8610aa
>--- /dev/null
>+++ b/deskutils/rpi-imager/pkg-descr
>@@ -0,0 +1,3 @@
>+User-friendly tool for creating bootable media for Raspberry Pi devices.
>+
>+CLI and GUI flavors are available. Both use the Qt6 framework.
>diff --git a/deskutils/rpi-imager/pkg-plist b/deskutils/rpi-imager/pkg-plist
>new file mode 100644
>index 000000000000..d4c82055fd0e
>--- /dev/null
>+++ b/deskutils/rpi-imager/pkg-plist
>@@ -0,0 +1,8 @@
>+%%CLI%%bin/rpi-imager-cli
>+%%GUI%%bin/rpi-imager
>+%%CLI%%share/applications/com.raspberrypi.rpi-imager-cli.desktop
>+%%GUI%%share/applications/com.raspberrypi.rpi-imager.desktop
>+share/icons/hicolor/scalable/apps/rpi-imager.svg
>+%%GUI%%share/metainfo/com.raspberrypi.rpi-imager.metainfo.xml
>+%%GUI%%share/mime/packages/com.raspberrypi.rpi-imager-manifest.xml
>+%%GUI%%share/polkit-1/actions/com.raspberrypi.rpi-imager.policy
>-- 
>2.53.0
>
Comment 5 Nimish Jain 2026-07-03 16:21:56 UTC
Created attachment 272456 [details]
put tools:build in right location

Sorry, ignore the previous comment. I thought you could edit attachments as comments then save the new one.
Comment 6 Nimish Jain 2026-07-03 19:31:35 UTC
Created attachment 272465 [details]
final patch

Fixes all stage Q/A warnings. Updates distinfo, since some changes were made to release.
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2026-07-04 18:11:51 UTC
This should use upstream repo and pull PR / patches / commits. Preferably give upstream some time to review.

Since CLI pulls in most of QT anyway it makes little sense to split this up as flavors?
Comment 9 Jim Chen 2026-07-04 23:08:36 UTC
Created attachment 272499 [details]
Update to proposed rpi-imager port

I've addressed the following:

- Remove redundant CLI flavor offering
- Disable version checking and telemetry
- Removed git dependency for determining version string (changed in Nimish's branch as well)
- Disabled setting of build flags
- Explicitly declared C++20 dependency in Makefile

With regards to your concern about the upstream in the Makefile being Nimish's personal Github, that is a temporary measure so that our port can be tested. A pull request is open upstream right now.
Comment 10 Jim Chen 2026-07-05 00:15:25 UTC
Created attachment 272501 [details]
Update to proposed rpi-imager port

Sorted lists and embedded ${PORTVERSION} rather than having a separate version string.
Comment 11 Jim Chen 2026-07-05 00:18:33 UTC
Nimish would also like to clarify a few things:

1. v2.0.10 is the current version, meaning that once the PR is reviewed and accepted, we will need to edit the port and wait for v2.0.11
2. We sought early review so that we can add to our PR that rpi-imager will be available in the FreeBSD ports tree
3. We chose not to use the existing upstream and hold patches in the ports tree since it would amount to more than 5000 lines of code