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.
Bash

echo '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.
Bash

echo '[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?

  • Staudey replied to this.
  • FAb7D but in case in the future I want to create a package of this type, pip3 -install -U how do I make it into a package.yml?

    Generally pip isn't directly invoked in a package recipe. Instead the source release of a, for example, pypi package is used as the basis, and operated on with the %python3_setup and %python3_install actions, like for example here: https://github.com/getsolus/packages/blob/main/packages/py/python-moddb/package.yml

    This is pretty much the easiest case, but sometimes things get more complicated, depending on how the project is structured (and how much effort they invested in making it distributable).

    I asked the goblin man I saw in my dream about Gemini's instructions, and he answered like this:

    Create a PKGINFO file in the package directory.

    Nope, nope, nope. Solus uses the package.yml format. 👺
    Some of those fields are similar than the ones used in a package.yml (though there they are exclusively lower case), but e.g. "Maintainer" doesn't exist at all. Also there are no build instructions at all.

    FAb7D Create a desktopfile file in the package directory.

    ...maybe, if whisper doesn't provide its own. Though it should of course be in a files subdirectory when you pacakge for Solus. 👺

    Create an install script in the package directory.

    Also not a thing in Solus packaging. The install instructions are in the package.yml 👺

    desktopfile=/usr/share/applications/whisper.desktop
    [...]

    Why is it recreating the desktop file contents? And doing it differently than the first time?! 👺

    pbuilder -c solus -m whisper-pkg

    Not even close to a Solus packaging command (I'd allow go-task (if you're doing it inside the repository folder), solbuild, ypkg) 👺

    sudo eopkg install whisper-0.0.1-1.x86_64.pkg

    Close, but no cigar. It should be whisper-0.0.1-1-1-x86_64.eopkg 👺

    Then I asked the dream goblin about the ChatGPT instructions, and it answered like this:

    sudo eopkg it -c system.devel

    Good start, but not quite what you want for packaging. For that, see here: https://help.getsol.us/docs/packaging/prepare-for-packaging/ 👺

    mkdir -p files/usr/bin

    ...what? 👺

    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:

    No, no, no! We no longer manually create pspec.xml files. It's all package.yml now!
    If you want me to analyze the pspec.xml structure you'll have to bring me a witches toenail first! 👺

    Write the actions.py File:

    Same here 👺

    sudo eopkg build package

    No, no, that wouldn't even be correct old way. You have to point it to the pspec.xml, not a folder. 👺

    sudo eopkg it whisper-*.eopkg

    Smart, it avoided trying to piece together the full name. The best AI packager is a lazy AI packager 👺

      Incredible. I think literally every part that it told you was completely wrong. Or at the very least, used methodology that is many years out of date.

        • [deleted]

        Could we replace help center and forums with a GPT bot?

        Staudey You should get your dream goblin to work on the Help Center. Seems like he knows his stuff.

        Joking aside, I assume you want to either package Whisper yourself or request it be added to the repository. If you'd like more info about packaging, you can find that here. Note that python packages can be somewhat tricky (last time I checked they were, anyways. YMMV). If instead you'd like to request that it be added to the official Solus package repo, you can make a package request here.

          EbonJaeger
          Staudey
          Thank you very much for the explanations, yes I already know a little about making Solus packages, but it was always a question of using make or cmake, never pip3. I had also searched for the package.yml of gtts-cli without finding it (in fact it didn't work unlike the one installed via pip) to see how they had resolved the issue .
          But gtts was the only example I knew of and so I tried with Gimini and ChatGPT since everyone speaks well of them(it was my first use, on the wave of enthusiasm for whisper), which gave me the answers above, I would have also accepted Goblin's advice 🫣 as far as I'm concerned 😆
          I don't know phyton.
          It's about using these macros maybe?
          https://help.getsol.us/docs/packaging/package.yml#python-actionable-macros.
          but in case in the future I want to create a package of this type, pip3 -install -U how do I make it into a package.yml?
          If it's a complicated matter to explain here, would you perhaps have a couple of examples of packages that have addressed this problem so I can look at the package.ymls?

            infinitymdm Thanks, I think I'll make a request, because it seems like a nice program, beyond the fact that it's easy to install via pip and as I wrote above I was actually curious to understand if there was a simple way to create packages from this kind of programs, but from your answer I seem to understand that this is not the case. As I was saying, I have already packaged some simple things according to the Solus guidelines.

            FAb7D but in case in the future I want to create a package of this type, pip3 -install -U how do I make it into a package.yml?

            Generally pip isn't directly invoked in a package recipe. Instead the source release of a, for example, pypi package is used as the basis, and operated on with the %python3_setup and %python3_install actions, like for example here: https://github.com/getsolus/packages/blob/main/packages/py/python-moddb/package.yml

            This is pretty much the easiest case, but sometimes things get more complicated, depending on how the project is structured (and how much effort they invested in making it distributable).