hplip-plugin compatibility

Hey, I have a minor suggestion. Is it possible for the distro to distribute hplip-plugin so printers that aren't supported with just hplip itself will work? Or at the very least provide an ujust script for it? Currently I have to maintain my own custom image just to get printer drivers working which is okay for someone like me who is willing to put in the effort and knows how to do it, but this is probably a deal-breaker for someone who's less capable
11 Replies
dreamyuki
dreamyuki•3d ago
hplip-plugin is hard to ship since it basically write the plugin at /usr
asen23
asen23•3d ago
hopefully this can be added in the future using a sysext
dreamyuki
dreamyuki•2d ago
Will also not work Hplip-plugin is not one package for all printer It downloaded the plugin for detected printer And then extract the plugin at /usr Which is dumb as shit holyfuck Why not just put the plugin at /usr/local or even better in user homedir 😭
Marcus Lee
Marcus LeeOP•2d ago
It's very wack I have to rely on someone's gitlab which builds an RPM of hplip-plugin then install it via ostree and I automate it by making my own custom image, build the RPM there, then install the ostree
dreamyuki
dreamyuki•2d ago
Hmm him wonder if this can be legally distributed in ublue image
Marcus Lee
Marcus LeeOP•2d ago
No clue lol, I'm not a lawyer
dreamyuki
dreamyuki•2d ago
this obviously can't be distribute at copr repo since the plugin is proprietary
Marcus Lee
Marcus LeeOP•2d ago
yeah
# Build HP plugin
FROM fedora-minimal:38 as builder

# Install build tools
RUN dnf5 install -y git rpmdevtools crudini

# Prepare build directory
RUN rpmdev-setuptree && \

# Download the .spec for building an RPM
git clone 'https://gitlab.com/greysector/rpms/hplip-plugin.git' && \
mv hplip-plugin/hplip-plugin.spec /root/rpmbuild/SPECS/ && \
mv hplip-plugin/* /root/rpmbuild/SOURCES/ && \

# Download HP's plugins and move it to SOURCES
HPLIP_VERSION=`grep -Eo '[0-9]\.[0-9].\.[0-9]' /root/rpmbuild/SPECS/hplip-plugin.spec | head -1` && \
curl -Lo hplip-${HPLIP_VERSION}-plugin.run https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${HPLIP_VERSION}-plugin.run && \
curl -Lo hplip-${HPLIP_VERSION}-plugin.run.asc https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${HPLIP_VERSION}-plugin.run.asc && \
mv hplip-${HPLIP_VERSION}-plugin.* /root/rpmbuild/SOURCES/

RUN echo "Building hplip-plugin RPM" && \
cd /root/rpmbuild && \

# Confirm that the file exists
ls -lh /root/rpmbuild/SPECS/hplip-plugin.spec && \
rpmbuild -bb /root/rpmbuild/SPECS/hplip-plugin.spec

RUN ls /root/rpmbuild/RPMS/x86_64/hplip-plugin-*-1.x86_64.rpm && \
HPLIP_VERSION=`ls /root/rpmbuild/RPMS/x86_64/hplip-plugin-*-1.x86_64.rpm | grep -Eo '[0-9]\.[0-9].\.[0-9]'` && \
mv /root/rpmbuild/RPMS/x86_64/hplip-plugin-${HPLIP_VERSION}-1.x86_64.rpm /root/rpmbuild/RPMS/x86_64/hplip-plugin-latest-1.x86_64.rpm

### 2. SOURCE IMAGE
## this is a standard Containerfile FROM using the build ARGs above to select the right upstream image
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG}
ENV OS_VERSION=41

# Copy build artifact
# ARG HPLIP_VERSION="3.24.4" # HPLIP version that's used
COPY --from=builder /root/rpmbuild/RPMS/x86_64/hplip-plugin-latest-1.x86_64.rpm /tmp

### 3. MODIFICATIONS
## make modifications desired in your image and install packages by modifying the build.sh script
## the following RUN directive does all the things required to run "build.sh" as recommended.

COPY build.sh /root/build.sh

RUN mkdir -p /var/lib/alternatives && \
/root/build.sh && \
ostree container commit
# Build HP plugin
FROM fedora-minimal:38 as builder

# Install build tools
RUN dnf5 install -y git rpmdevtools crudini

# Prepare build directory
RUN rpmdev-setuptree && \

# Download the .spec for building an RPM
git clone 'https://gitlab.com/greysector/rpms/hplip-plugin.git' && \
mv hplip-plugin/hplip-plugin.spec /root/rpmbuild/SPECS/ && \
mv hplip-plugin/* /root/rpmbuild/SOURCES/ && \

# Download HP's plugins and move it to SOURCES
HPLIP_VERSION=`grep -Eo '[0-9]\.[0-9].\.[0-9]' /root/rpmbuild/SPECS/hplip-plugin.spec | head -1` && \
curl -Lo hplip-${HPLIP_VERSION}-plugin.run https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${HPLIP_VERSION}-plugin.run && \
curl -Lo hplip-${HPLIP_VERSION}-plugin.run.asc https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${HPLIP_VERSION}-plugin.run.asc && \
mv hplip-${HPLIP_VERSION}-plugin.* /root/rpmbuild/SOURCES/

RUN echo "Building hplip-plugin RPM" && \
cd /root/rpmbuild && \

# Confirm that the file exists
ls -lh /root/rpmbuild/SPECS/hplip-plugin.spec && \
rpmbuild -bb /root/rpmbuild/SPECS/hplip-plugin.spec

RUN ls /root/rpmbuild/RPMS/x86_64/hplip-plugin-*-1.x86_64.rpm && \
HPLIP_VERSION=`ls /root/rpmbuild/RPMS/x86_64/hplip-plugin-*-1.x86_64.rpm | grep -Eo '[0-9]\.[0-9].\.[0-9]'` && \
mv /root/rpmbuild/RPMS/x86_64/hplip-plugin-${HPLIP_VERSION}-1.x86_64.rpm /root/rpmbuild/RPMS/x86_64/hplip-plugin-latest-1.x86_64.rpm

### 2. SOURCE IMAGE
## this is a standard Containerfile FROM using the build ARGs above to select the right upstream image
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG}
ENV OS_VERSION=41

# Copy build artifact
# ARG HPLIP_VERSION="3.24.4" # HPLIP version that's used
COPY --from=builder /root/rpmbuild/RPMS/x86_64/hplip-plugin-latest-1.x86_64.rpm /tmp

### 3. MODIFICATIONS
## make modifications desired in your image and install packages by modifying the build.sh script
## the following RUN directive does all the things required to run "build.sh" as recommended.

COPY build.sh /root/build.sh

RUN mkdir -p /var/lib/alternatives && \
/root/build.sh && \
ostree container commit
Here's a snippet from my containerfile if anyone's curious It's very scuffed but it works Some lines are commented because I don't use them anymore
Kyle Gospo
Kyle Gospo•2d ago
Build an RPM in distrobox and then layer it No need for a custom image
Marcus Lee
Marcus LeeOP•2d ago
Hmm, if that's possible... I wonder if we can set up a ujust script for that

Did you find this page helpful?