6

I want to create a .deb file for Cozy from its GitHub repository. How do I make it? I don't want to use the Flathub version.

I'm on Ubuntu 20.04.

2

3 Answers 3

11

There is no need to create a deb-package manually.

The Cozy Stable Releases PPA is already available.
It provides deb-packages for Ubuntu 20.10 (groovy, EOL), 21.04 (hirsute) and 21.10 (impish, development) – here Cozy may be installed as simple as

sudo add-apt-repository ppa:cozy-team/cozy
sudo apt-get update
sudo apt-get install cozy

Installation on Ubuntu 20.04 LTS needs some hacks. You will need to manually install libhandy-1-0, and install updated versions of python3-peewee and python3-mutagen (otherwise cozy won't load chapters in m4b audiobooks):

sudo add-apt-repository ppa:apandada1/libhandy-1
sudo apt-get install libhandy-1-0

cd ~/Downloads
wget -c http://old-releases.ubuntu.com/ubuntu/pool/universe/p/peewee/python3-peewee_3.13.1+dfsg-1_amd64.deb
sudo apt-get install ./python3-peewee_3.13.1+dfsg-1_amd64.deb

wget -c http://archive.ubuntu.com/ubuntu/pool/universe/m/mutagen/python3-mutagen_1.45.1-2_all.deb
sudo apt-get install ./python3-mutagen_1.45.1-2_all.deb

sudo add-apt-repository ppa:cozy-team/cozy
sudo sed -i "s/focal/hirsute/" /etc/apt/sources.list.d/cozy-team-ubuntu-cozy-focal.list
sudo apt-get update
sudo apt-get install cozy

Then you can launch Cozy from dash or by using com.github.geigi.cozy command.

Note: This answer works for Ubuntu and its official flavors. In some derivatives of Ubuntu, the repository is saved in cozy-team-cozy-focal.list instead of cozy-team-ubuntu-cozy-focal.list.

0
4

It seems that OP does not want to use the PPA, which can be found in N0rbert's answer. There is a way to directly generate the .deb package from the source without using the PPA.

  1. Install the build dependencies.

    sudo apt-get update
    sudo apt-get install git build-essential appstream debhelper desktop-file-utils libgranite-dev libdazzle-1.0-dev meson libgtk-3-dev python3 python3-pip python3-setuptools python3-distro python3-requests python3-tz python3-gst-1.0 python3-cairo python3-apsw sed
    

    Ubuntu 20.04 LTS does not provide libhandy-1, so we need to build it locally using sources from Ubuntu 21.04:

    sudo apt-get install debhelper-compat gtk-doc-tools libgirepository1.0-dev libgladeui-dev libglib2.0-doc libgnome-desktop-3-dev libgtk-3-doc libxml2-utils valac xvfb
    cd ~/Downloads
    wget -c http://archive.ubuntu.com/ubuntu/pool/main/libh/libhandy-1/libhandy-1_1.2.0.orig.tar.gz
    tar -xf libhandy-1_1.2.0.orig.tar.gz
    cd libhandy-1-1.2.0
    wget -c http://archive.ubuntu.com/ubuntu/pool/main/libh/libhandy-1/libhandy-1_1.2.0-1.debian.tar.xz
    tar -xf libhandy-1_1.2.0-1.debian.tar.xz
    rm libhandy-1_1.2.0-1.debian.tar.xz
    
    dpkg-buildpackage -uc -us -d
    sudo apt-get install ../gir1.2-handy-1_1.2.0-1_amd64.deb ../libhandy-1-0_1.2.0-1_amd64.deb ../libhandy-1-dev_1.2.0-1_amd64.deb
    
  2. In Ubuntu 20.04, manually download a recent version of python3-peewee and python3-mutagen (in later versions of Ubuntu, you can install it from the repositories.),

    cd ~/Downloads
    wget -c http://old-releases.ubuntu.com/ubuntu/pool/universe/p/peewee/python3-peewee_3.13.1+dfsg-1_amd64.deb
    wget -c http://archive.ubuntu.com/ubuntu/pool/universe/m/mutagen/python3-mutagen_1.45.1-2_all.deb
    

    Install them

    sudo apt-get install ./python3-peewee_3.13.1+dfsg-1_amd64.deb
    sudo apt-get install ./python3-mutagen_1.45.1-2_all.deb
    
  3. Install all the runtime dependencies

    sudo apt-get install gobject-introspection python3 python3-distro python3-gi-cairo python3-requests python3-packaging python3-tz python3-mutagen python3-gst-1.0 python3-gi python3-cairo python3-apsw file libgstreamer1.0-0 libgstreamer-plugins-base1.0-0 gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-libav gir1.2-granite-1.0 gir1.2-dazzle-1.0
    
  4. Download the source from GitHub:

    cd ~/Downloads
    git clone https://github.com/geigi/cozy.git -b 1.2.0
    
  5. Download the debian/ directory from http://github.com/apandada1/cozy/tree/deb-dir and place it inside the source directory of cozy.

    cd ~/Downloads
    git clone https://github.com/apandada1/cozy -b deb-dir debian
    mv debian/debian cozy/
    
  6. Now build the .deb package and install it with

    cd ~/Downloads/cozy
    dpkg-buildpackage -uc -us -b
    
    sudo apt-get install ../cozy_1.2.0_all.deb
    
0

Since the programming language of Cozy is Python. You can probably install it via Python as well. You must install Requirements and then download the tar.gz Latest release file.

The installation command is probably something like this:

python3 -m pip install --user cozy-1.1.0.tar.gz

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .