- Edited
I installed whisper with pip3 (https://github.com/openai/whisper) which works very well and better than other speech to test I had tried, or I was wondering if there is also the possibility of transforming these programs installed via pip into one solus package, in which case I was wondering how, I asked Gemini and it answered me like this:
Yes, it is possible to create a Solus package of Whisper instead of installing it directly via pip3. Here are the steps on how to do it:
Download the Whisper source code. Bash
git clone https://github.com/openai/whisper.git
...
Create a Solus package directory.
Bash
mkdir whisper-pkg
Usa il codice con cautela.
Copy the Whisper source code to the package directory.
Bash
cp -r whisper whisper-pkg
...
Create a PKGINFO file in the package directory.
Bashecho 'Name: whisper' > whisper-pkg/PKGINFO echo 'Version: 0.0.1' >> whisper-pkg/PKGINFO echo 'Release: 1' >> whisper-pkg/PKGINFO echo 'Summary: A speech-to-text model' >> whisper-pkg/PKGINFO echo 'Description: Whisper is a speech-to-text model that can be used to transcribe audio recordings into text.' >> whisper-pkg/PKGINFO echo 'License: Apache-2.0' >> whisper-pkg/PKGINFO echo 'Homepage: https://github.com/openai/whisper' >> whisper-pkg/PKGINFO echo 'Maintainer: <your name> <your email address>' >> whisper-pkg/PKGINFO
...
Create a desktopfile file in the package directory.
Bashecho '[Desktop Entry]' > whisper-pkg/whisper.desktop echo 'Name=Whisper' >> whisper-pkg/whisper.desktop echo 'Comment=A speech-to-text model' >> whisper-pkg/whisper.desktop echo 'Exec=/usr/bin/whisper' >> whisper-pkg/whisper.desktop echo 'Icon=/usr/share/icons/hicolor/128x128/apps/whisper.png' >> whisper-pkg/whisper.desktop echo 'Terminal=false' >> whisper-pkg/whisper.desktop echo 'Type=Application' >> whisper-pkg/whisper.desktop echo 'Categories=Audio;Science;' >> whisper-pkg/whisper.desktop
Usa il codice con cautela.
Create an install script in the package directory.
Bash#!/bin/bash set -e mkdir -p /usr/bin mkdir -p /usr/share/icons/hicolor/128x128/apps mkdir -p /usr/share/doc/whisper cp whisper /usr/bin/whisper cp whisper.png /usr/share/icons/hicolor/128x128/apps/whisper.png cp README.md /usr/share/doc/whisper/README.md
desktopfile=/usr/share/applications/whisper.desktop echo "[Desktop Entry]" > $desktopfile echo "Name=Whisper" >> $desktopfile echo "Comment=A speech-to-text model" >> $desktopfile echo "Exec=/usr/bin/whisper" >> $desktopfile echo "Icon=/usr/share/icons/hicolor/128x128/apps/whisper.png" >> $desktopfile echo "Terminal=false" >> $desktopfile echo "Type=Application" >> $desktopfile echo "Categories=Audio;Science;" >> $desktopfile
xdg-desktop-menu install $desktopfile
...
Build the Solus package.
Bash
pbuilder -c solus -m whisper-pkg
...
Install the Solus package.
Bash
sudo eopkg install whisper-0.0.1-1.x86_64.pkg
I read that pbuild is a Debian program...
I then asked Chatgpt:
Steps to Create a Solus Package for Whisper
Set Up the Development Environment: Ensure you have Solus installed and updated. Install the necessary development tools: bash
sudo eopkg it -c system.devel
Clone the Whisper Repository:
Clone the official Whisper repository (or the repository containing the source code you want to package). bash
git clone https://github.com/openai/whisper.git cd whisper
Create the Package Structure:
Create a directory for the Solus package and its structure. bash
mkdir -p solus-whisper/package cd solus-whisper/package mkdir -p files/usr/bin
Write the pspec.xml File:
The pspec.xml file describes how to build the package. Create a file named pspec.xml in the solus-whisper/package directory with the following content:
xml <PisiSource> <Source> <Name>whisper</Name> <Homepage>https://github.com/openai/whisper</Homepage> <Packager> <Name>Your Name</Name> <Email>your.email@example.com</Email> </Packager> <License>MIT</License> <IsA>library</IsA> <Summary>Whisper is a general-purpose speech recognition model by OpenAI</Summary> <Description> Whisper is a general-purpose speech recognition model. This package provides the Whisper Python library. </Description> <Archive sha1sum="calculate-your-sha1sum"> <Uri>https://github.com/openai/whisper/archive/refs/heads/main.zip</Uri> </Archive> </Source> <Package> <Name>whisper</Name> <License>MIT</License> <Summary>Whisper Python library</Summary> <Description> Whisper is a general-purpose speech recognition model by OpenAI. </Description> <RuntimeDependencies> <Dependency>python3</Dependency> <Dependency>pip</Dependency> <!-- Add other necessary dependencies --> </RuntimeDependencies> </Package> </PisiSource>
Write the actions.py File:
The actions.py file contains the commands to build and install the package. Create a file named actions.py in the same directory with the following content: ```
python
from pisi.actionsapi import autotools, pythonmodules, pisitools def build(): pythonmodules.compile() def install(): pythonmodules.install() # Copy any executable scripts to the correct directory pisitools.insinto("/usr/bin", "whisper.py")
>
> Build the Package:
Go back to the main package directory and build the package. bash ```
cd solus-whisper
sudo eopkg build package
>
> Install the Package:
After building the package, you can install it on your system. bash ` sudo eopkg it whisper-*.eopkg`
Final Considerations
This is a basic example and may require adjustments to fit the specific configuration of Whisper and its dependencies. You may need to adapt the installation commands in the actions.py file based on how Whisper handles its installations and dependencies. Also, always verify the necessary dependencies and ensure they are correctly included in the pspec.xml file.
I don't have the adequate knowledge to comment, but what do you think?