lbryio / lbry-desktop

A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
https://lbry.tech
MIT License
3.56k stars 413 forks source link

Is it possible to provide linux .deb file for arm64 kernel? #7318

Open blackmennewstyle opened 2 years ago

blackmennewstyle commented 2 years ago

Hello,

I would love to have some .deb files compatible with arm64 kernel. I wanted to use LBRY on my Raspberry Pi 4 8GB running GNU/Linux Debian 11 with kernel 5.10.0-9-arm64. Currently your .deb file is compatible with amd64 kernel. Is it something you guys could consider in the future? Also, is it possible to build lbry-desktop for arm64 architecture with the sources?

jessopb commented 2 years ago

Looks like github actions doesn't support native, but one could use this sort of docker build. However one commenter said it took "5 times as long". https://github.com/abhinavsingh/proxy.py/pull/797

blackmennewstyle commented 2 years ago

Looks like github actions doesn't support native, but one could use this sort of docker build. However one commenter said it took "5 times as long". abhinavsingh/proxy.py#797

Thanks for your answer. I managed to build the lbry-desktop for my architecture using the source files, the documentation is pretty clear i have to say. I never installed an app using nodejs before, it's a little bit special compared to compile a bunch of QT and C++ libraries. Have a great weekend and keep it up the great job :)

blackmennewstyle commented 2 years ago

There is actually an issue with Debian 11, electron has a dependency for libappindicator1 but it has been removed, as listed here: https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#noteworthy-obsolete-packages - It has been replaced with a package called: libayatana-appindicator3

jessopb commented 2 years ago

https://github.com/electron/electron/issues/27527 It seems you're not the first. I will keep an eye on this.

jessopb commented 2 years ago

Actually since you're building - can you try building removing it from this line https://github.com/lbryio/lbry-desktop/blob/00cdb5197ce8e4f334e649377d9f637f2f49cb28/electron-builder.json#L85 ? I do'nt hvae a debian vm

blackmennewstyle commented 2 years ago

Actually since you're building - can you try building removing it from this line

https://github.com/lbryio/lbry-desktop/blob/00cdb5197ce8e4f334e649377d9f637f2f49cb28/electron-builder.json#L85 ? I do'nt hvae a debian vm

Nice. thanks for sharing, i ended downloading libappindicator1 and libnotify7 from Debian 10 Buster arm64 and installed them on my Debian 11 machine. That did the trick for me :)

blackmennewstyle commented 2 years ago

In case anyone wants to build lbry-desktop for Raspberry Pi running Debian 11 with arm64 kernel, here the procedure which worked for me.

Install all required packages for building the sources: With root privileges

apt-get install build-essential git curl libtool autotools-dev automake pkg-config bsdmainutils python3
apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
apt install ruby ruby-dev
gem install fpm

Install the required version of nodejs, please refers to the documentation, at the time i'm writing this post, it's v14. I used this tutorial With root privileges

curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs

Install yarn With root privileges

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update && apt-get install yarn

Download the latest lbry-desktop release, here i used v0.51.2 Without root privileges

wget https://github.com/lbryio/lbry-desktop/archive/refs/tags/v0.51.2.tar.gz
tar -xvf v0.51.2.tar.gz
cd lbry-desktop-0.51.2
yarn
export SNAPCRAFT_BUILD_ENVIRONMENT=host
export USE_SYSTEM_FPM=true
yarn build --linux deb --arm64

At this point, we should have a .deb file compatible with an arm64 kernel, however, electron seems to have an old dependency to a package which has been sadly removed since Debian 11, if we want to install the lbry-desktop .deb file, we need to download and install the following packages. With root privileges

apt-get install gconf2 gconf-service libdbusmenu-gtk4
wget http://ftp.tw.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_arm64.deb
dpkg -i libindicator7_0.5.0-4_arm64.deb
rm libindicator7_0.5.0-4_arm64.deb
wget http://ftp.tw.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-7_arm64.deb
dpkg -i libappindicator1_0.4.92-7_arm64.deb
rm libappindicator1_0.4.92-7_arm64.deb

Finally, we can install lbry-desktop With root privileges

dpkg -i dist/electron/LBRY_0.51.2.deb
jessopb commented 2 years ago

I'm removing the dependency and testing. electron says notify trays are builtin now.

ghost commented 2 years ago

Hey all, I have successfully built the LBRY desktop client along with the lbrynet daemon for ARM64. It wasn't easy, took lots of time, effort, energy and perseverance.

In the build guides is a way that I initially got LBRY to work, the method is rather inefficient though and the shellscript at the bottom does the building of the lbry-sdk using a python venv not a whole Debian chroot. Why is Python <3.10 && >=3.7 needed? the code of lbrynet has not yet been ported to Python3.10, thus the lbrynet binary will not work due to the unneeded loop functionality in Python3.10. That's where the virtual environment comes in handy.

English build guide for LBRY on ARM64: https://dpaste.com/DZA578LS5 German build guide for LBRY on ARM64: https://dpaste.com/E87SJUBR4

Built project: https://anonfiles.com/B7C7tb0dy1/linux-arm64-unpacked.tar_gz

Idea of a shellscript for updating and auto-maintaining:

(${XDG_PROJECTS_DIR} is defined as: "$HOME/Projects")

#!/bin/zsh

if [[ $(cat ${XDG_PROJECTS_DIR}/verfiles/lbry-ver) != $(curl --silent "https://api.github.com/repos/lbryio/lbry-desktop/releases/latest" | jq -r .tag_name | tr -d 'v') && $(cat ${XDG_PROJECTS_DIR}/verfiles/lbrynet-ver) != $(curl --silent "https://api.github.com/repos/lbryio/lbry-sdk/releases/latest" | jq -r .tag_name | tr -d 'v') ]]

then
        export LBRY_VER=$(curl --silent "https://api.github.com/repos/lbryio/lbry-desktop/releases/latest" | jq -r .tag_name | tr -d 'v')
        export LBRYNET_VER=$(curl --silent "https://api.github.com/repos/lbryio/lbry-sdk/releases/latest" | jq -r .tag_name | tr -d 'v')

        cd ${XDG_PROJECTS_DIR};
        rm -r lbry-desktop;
        wget https://github.com/lbryio/lbry-desktop/archive/refs/tags/v${LBRY_VER}.tar.gz;
        tar -xvf v${LBRY_VER}.tar.gz; rm -r v${LBRY_VER}.tar.gz;
        mv lbry-desktop-${LBRY_VER} lbry-desktop;
        cd lbry-desktop; mkdir static/daemon
        yarn;
        export SNAPCRAFT_BUILD_ENVIRONMENT=host
        export USE_SYSTEM_FPM=true
        yarn build --linux --arm64;

        cd ..

        rm -r lbry-sdk
        wget https://github.com/lbryio/lbry-sdk/archive/v${LBRYNET_VER}.tar.gz;
        tar -xvf v${LBRYNET_VER}.tar.gz; rm -r v${LBRYNET_VER}.tar.gz;
        mv lbry-sdk-${LBRYNET_VER} lbry-sdk
        cd lbry-sdk/

        python3.9 -m venv lbry-venv
        source lbry-venv/bin/activate

        pip3 install --upgrade 'setuptools<45.0.0'
        pip3 install pyinstaller pyparsing protobuf==3.20.0 aiohttp aioupnp appdirs certifi colorama distro base58 cffi cryptography msgpack prometheus_client ecdsa pyyaml docopt hachoir multidict coincurve pbkdf2 attrs pylru elasticsearch grpcio filetype

        pip3 install -e .
        lbry-venv/bin/pyinstaller --onefile --name lbrynet lbry/extras/cli.py;

        cp -r dist/lbrynet ${XDG_PROJECTS_DIR}/lbry-desktop/static/daemon/
        cp -r dist/lbrynet ${XDG_PROJECTS_DIR}/lbry-desktop/dist/electron/daemon/
        cp -r dist/lbrynet ${XDG_PROJECTS_DIR}/lbry-desktop/dist/electron/static/daemon/
        cp -r dist/lbrynet ${XDG_PROJECTS_DIR}/lbry-desktop/dist/electron/linux-arm64-unpacked/resources/static/daemon/

        echo ${LBRY_VER} > ${XDG_PROJECTS_DIR}/verfiles/lbry-ver
        echo ${LBRYNET_VER} > ${XDG_PROJECTS_DIR}/verfiles/lbrynet-ver

fi