chrisknepper / android-messages-desktop

Android Messages as a Cross-platform Desktop App
MIT License
1.01k stars 116 forks source link

Linux testing (Arch Linux) #30

Closed Buttars closed 6 years ago

Buttars commented 6 years ago

I'm going to attempt building and get this working on my Arch machine. I'm also going to build a PKGBUILD to put on the AUR.

jacob-swenson commented 6 years ago

Let me know if you have any success. I haven't been able to get the AppImage to work.

Gyges88 commented 6 years ago

I tested the latest AppImage on Manjaro Plasma 5.12.5. It failed with a memory access error.

jjgalvez commented 6 years ago

Did you have any success? I just did the same thing using debtap to give me someplace to start. My packages is working now. let me know if your interested, or if anyone wants the package

yochananmarqos commented 6 years ago

@Buttars Were you able to build it successfully? I'm trying the following but it errors out at error android-messages-desktop@0.2.0 postinstall: electron-builder install-app-deps.

package() {
    cd $srcdir/$pkgname-$pkgver
    npm install -g --user root --prefix "$pkgdir"/usr
    find "${pkgdir}"/usr -type d -exec chmod 755 {} +
}
andersvos commented 6 years ago

I tried the AppImage on Arch. Got this error :

module.js:545 throw err; ^

Error: Cannot find module '/tmp/.mount_androiWB9FJn/resources/electron.asar/browser/init.js' at Function.Module._resolveFilename (module.js:543:15) at Function.Module._load (module.js:473:25) at Function.Module.runMain (module.js:683:10) at startup (bootstrap_node.js:196:16) at bootstrap_node.js:622:3

jjgalvez commented 6 years ago

I added pacman to the build list. I can get it to build normally and it creates a pacman file which installs. Granted it installs in /opt rather than /usr but I can live with that

yochananmarqos commented 6 years ago

@jjgalvez I don't understand a single thing you just said. I'm guessing you mean you created a PKGBUILD that installs in /opt? How did you get it to build?

jjgalvez commented 6 years ago

sorry I wasn't very clear. I didn't have any trouble building from source. All I did was npm install, followed by npm build. in the package.json file in the build section I added "pacman" to the list of supported builds and node created a .pacman file that I was able to install with sudo pacman -U.The build ended up in /opt which is typical for electron based apps

yochananmarqos commented 6 years ago

@jjgalvez That's a little beyond my knowledge. I don't know much about building electron packages.

MrFobwatch commented 6 years ago

I can confirm a simple repackage of the deb with debtap then installing with pacman works perfectly on Manjaro Linux (Arch based).

jacob-swenson commented 6 years ago

debtap worked for me as well, using Arch

yochananmarqos commented 6 years ago

No need for debtap.

pkgname=android-messages-desktop-bin
_pkgname=android-messages-desktop
pkgver=0.3.0
pkgrel=1
pkgdesc="Android Messages as a cross-platform desktop app"
arch=('x86_64')
url="https://github.com/chrisknepper/android-messages-desktop"
license=('MIT')
depends=('electron')
provides=(android-messages-desktop)
source=("$url/releases/download/v${pkgver}/${_pkgname}_${pkgver}_amd64.deb")
md5sums=('cf56270fc29d367f0a7218ecd05ad716')

package() {
    tar -xf data.tar.xz
    cp -r usr/ ${pkgdir}
    cp -r opt/ ${pkgdir}
    mkdir /usr/bin
    ln -sf "/opt/Android Messages/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
}
uttarayan21 commented 6 years ago

I modified it a bit to always remain up to date with releases

# Maintainer: Your Name <youremail@domain.com>
pkgname=android-messages-desktop
pkgver=0.3.0
# pkgver=$(curl --silent https://api.github.com/repos/chrisknepper/android-messages-desktop/releases/latest | grep tag_name | cut -d: -f2 | tr -d '"v,')
pkgrel=1
pkgdesc="Android Messages as a Cross-platform Desktop App"
arch=(x86_64)
url="https://github.com/chrisknepper/android-messages-desktop"
license=('MIT')
groups=()
depends=('electron')
makedepends=('curl')
provides=("android-messages-desktop")
conflicts=("android-messages-desktop")
replaces=()
backup=()
options=()
install=
# source=("$url/releases/download/v${pkgver}/${pkgname}_${pkgver}_amd64.deb")
source=("$(curl -s https://api.github.com/repos/chrisknepper/android-messages-desktop/releases/latest | grep -E 'browser_download_url.*amd64.deb' | cut -d: -f2- | tr -d '"')")
noextract=()
md5sums=('SKIP')

latest_ver() {
    curl --silent https://api.github.com/repos/chrisknepper/android-messages-desktop/releases/latest | grep tag_name | cut -d: -f2 | tr -d '"v,'
}

prepare() {
    if [[ $pkgver < $(latest_ver) ]]; then
        sed -e "s/$pkgver/$(latest_ver)/g" -i ../PKGBUILD
        echo There is a new release available please rerun makepkg
        exit 0
    fi
}

build() {
    tar xf data.tar.xz
}

check() {
    tar xf control.tar.gz ./md5sums --to-command='md5sum -c -'
}

package() {
    mv ${srcdir}/usr ${pkgdir}/usr
    mv ${srcdir}/opt ${pkgdir}/opt
    mkdir ${pkgdir}/usr/bin
    ln -sf "${pkgdir}/opt/Android Messages/android-messages-desktop" "${pkgdir}/usr/bin/android-messages-desktop"

}

Thanks to @yochananmarqos for pointing out the errors

yochananmarqos commented 6 years ago

@uttarayan21 I tried your PKGBUILD, but your source line might have a typo:

$ makepkg -si
==> Making package: android-messages-desktop 0.3.0-1 (Wed 11 Jul 2018 09:41:20 AM MDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> ERROR: Unknown download protocol:  https
    Aborting...
uttarayan21 commented 6 years ago

Perhaps your /etc/makepkg.conf doesnt have the

DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
          'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

https /line or maybe your version of curl was compiled without ssl I just tried it in my machine it seems to work fine

Edit: Oops it was my mistake I forgot to remove the whitespace preceding the url Fixed now

yochananmarqos commented 6 years ago

@uttarayan21 My DLAGENTS section matches yours. I have curl 7.60.0-1. It's a core package, so I don't see how it would be compiled any differently.

uttarayan21 commented 6 years ago

It really was a typo thanks for pointing that out, I modified my local version and forgot to update it here

yochananmarqos commented 6 years ago

@uttarayan21 I'm not sure the symlink is necessary, but either way it didn't work:

==> Starting package()...
ln: failed to create symbolic link '/home/yochanan/Documents/pkgbuilds/android-messages-desktop/pkg/android-messages-desktop/usr/bin/android-messages-desktop': No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...
uttarayan21 commented 6 years ago

The symlink is not necessary unless you want to launch it from shell. I use i3-gaps so its need it to launch it from shell. The deb package also creates a symlink so I just copied the postinst and postrm to the install file

yochananmarqos commented 6 years ago

@uttarayan21 This worked:

package() {
    cp -r ${srcdir}/usr ${pkgdir}/usr
    cp -r ${srcdir}/opt ${pkgdir}/opt
        mkdir ${pkgdir}/usr/bin
    ln -sf "${pkgdir}/opt/Android Messages/android-messages-desktop" "${pkgdir}/usr/bin/android-messages-desktop"
}
uttarayan21 commented 6 years ago

Hmm.. Does it launch when you call it from shell ? I think it will look for the build time position of

${pkgdir}/opt/Android Messages/android-messages-desktop

when called instead of

/opt/Android Messages/android-messages-desktop

But I might be wrong

yochananmarqos commented 6 years ago

@uttarayan21 Yes, it launches from shell.

uttarayan21 commented 6 years ago

Hmmm it works ... updating the script and removing the .install file. I actually did that before and suspected it might not work so changed it before trying to test it.

chrisknepper commented 6 years ago

Hey all,

The latest version (0.4.0) includes a .pacman file which, from my understanding, should be sufficient for running on Arch. Would you all be able to let me know how that works?

jjgalvez commented 6 years ago

downloaded and installed with sudo pacman -U updated from version .3 just fine

Jose

On 7/14/18 6:05 PM, Chris Knepper wrote:

Hey all,

The latest version (0.4.0) includes a .pacman file which, from my understanding, should be sufficient for running on Arch. Would you all be able to let me know how that works?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chrisknepper/android-messages-desktop/issues/30#issuecomment-405052956, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLa_In08ngziCLyh24LPbBzcT72TEn6ks5uGms8gaJpZM4U-NBC.

yochananmarqos commented 6 years ago

It works great, thanks @chrisknepper! There was one oddity, however. Running it from the terminal produced the following:

APPIMAGE env is not defined, current application is not an AppImage

Obviously it doesn't effect anything, just thought I'd let you know.

Here's a PKGBUILD for it I'm thinking of uploading to the AUR. It installed successfully, so it should be good to go. However, if anyone has any critiques or suggestions before I upload it, let me know. Anyone here is welcome to be a Co-Maintainer.

pkgname=android-messages-desktop
pkgver=0.4.0
pkgrel=1
pkgdesc="Android Messages as a cross-platform desktop app"
arch=('i686' 'x86_64')
url="https://github.com/chrisknepper/android-messages-desktop"
license=('MIT')
depends=('electron')
provides=(android-messages-desktop)
source=("${url}/releases/download/v${pkgver}/${pkgname}-${pkgver}.pacman")
md5sums=('fd08bc795496e7060d240c00b569d322')

package() {
    install -d "${pkgdir}/opt"
    cp -R "${srcdir}/opt/Android Messages" "${pkgdir}/opt/"
    install -D -m644 "${srcdir}/usr/share/applications/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
    for icon_size in 16 24 32 48 64 128 256 512 1024; do
        icons_dir="/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps"
        install -d "${pkgdir}/${icons_dir}"
        install -m644 "${srcdir}${icons_dir}/${pkgname}.png" \
                      "${pkgdir}${icons_dir}/${pkgname}.png"
    done
    mkdir ${pkgdir}/usr/bin
    ln -sf "${pkgdir}/opt/Android Messages/android-messages-desktop" "${pkgdir}/usr/bin/android-messages-desktop"
}
jacob-swenson commented 6 years ago

@yochananmarqos Your PKGBUILD worked for me. I'd love to see this up in the AUR. I'd be willing to help maintain but I'm not a maintainer there and haven't worked much with actually editing and updating these. I may be able to help with small tweaks here and there if needed however. Not sure what it takes to get access to maintain. Pretty sure you need to be endorsed, or am I remembering wrong?

yochananmarqos commented 6 years ago

android-messages-desktop is now in the AUR. If you already have Android Messages Desktop installed in any shape or form, uninstall it and install it via an AUR helper like yay to make sure you receive updates.

@jacob-swenson All you have to do is register (if you haven't already), provide me with your username and I'll add you as a Co-Maintainer.

jacob-swenson commented 6 years ago

@yochananmarqos my username is jswenson91. Go ahead and add me. It will be a good learning experience for me.

jjgalvez commented 6 years ago

Shouldn't you list the additional dependencies listed in the pacman file? Jose

yochananmarqos commented 6 years ago

@jacob-swenson It said jswenson91 was an invalid username.

@jjgalvez Whoops, good catch. They're almost all dependencies for electron, but it turns out electron isn't actually required. I added them and pushed an update. Could you edit your above post and remove the unnecessary spaces and quote? Replying via an email client apparently is not ideal.

@chrisknepper I added a PR to add the link to the AUR package to the README.

jacob-swenson commented 6 years ago

@yochananmarqos sorry it's jswenson without the 91

jjgalvez commented 6 years ago

@yochananmarqos edited, and thanks for putting this up on AUR, makes keeping it up to date much simpler.

yochananmarqos commented 6 years ago

@jacob-swenson I added you and also added @chrisknepper as the Packager.

jjgalvez commented 6 years ago

@yochananmarqos just wanted to say thanks again for putting this up on AUR. This morning I did an update using pikaur (my current favourite AUR helper) and it picked up that android -messanger needed to be updated and updated it. No need to remove it first. I love it when this stuff works like its supposed to.

jacob-swenson commented 6 years ago

I've updated the AUR package. Let me know if there are any issues with it.

yochananmarqos commented 6 years ago

@jacob-swenson Thanks! I hadn't even noticed 0.50 was released yet.

jacob-swenson commented 6 years ago

@yochananmarqos Take a look at my changes. Let me know if I missed anything.

yochananmarqos commented 6 years ago

@jacob-swenson It was just an easy version bump, you did fine. 😉

jacob-swenson commented 6 years ago

Is anybody else having issues since the recent set of Arch updates? I ran a Syu today and now Android Messages just segfaults. I've even tried rebuilding from source with the same problem. I'm guessing there's some package that needs to be rebuilt from source (had a few already due to the Python 3.7 update) but can't see which one is the problem here. Any input or thoughts would be greatly appreciated!

Thanks!

yochananmarqos commented 6 years ago

@jacob-swenson What packages updated besides python? Did any electron apps break? I'm using Manjaro, so I won't see those updates for a week or so.

jacob-swenson commented 6 years ago

@yochananmarqos quite a bit. Here's my updates from today: https://pastebin.com/m82vs7Kw

yochananmarqos commented 6 years ago

@jacob-swenson I'm not sure. I guess I'll see what happens when the updates hit Manjaro Stable.

jjgalvez commented 6 years ago

I'm having the same issue

jjgalvez commented 6 years ago

I edited the pkgbuild file so that it no longer puts everyting under opt, but rather depends on electron and puts the application under usr/lib as other applications.

Please consider changing the pkgbuild file. I am attaching my pkgbuild file for reference

Maintainer: Mark Wagie yochanan.marqos@gmail.com

Co-Maintainer: jswenson

Packager: Chris Knepper chris82thekid@gmail.com

pkgname=android-messages-desktop pkgver=0.7.0 pkgrel=1 pkgdesc="Android Messages as a cross-platform desktop app" arch=('x86_64') url="https://github.com/chrisknepper/android-messages-desktop" license=('MIT') depends=('electron' 'c-ares' 'ffmpeg' 'gtk3' 'http-parser' 'libevent' 'libvpx' 'libxslt' 'libxss' 'minizip' 'nss' 're2' 'snappy' 'libnotify' 'libappindicator-gtk2' 'libappindicator-gtk3' 'libappindicator-sharp') provides=(android-messages-desktop) source=("${url}/releases/download/v${pkgver}/${pkgname}-${pkgver}.pacman") md5sums=('d61810468879d8da2fa543448b84e251')

package() { install -D -m644 "${srcdir}/opt/Android Messages/resources/app.asar" \ "${pkgdir}/usr/lib/${pkgname}/resources/app.asar" install -D -m644 "${srcdir}/opt/Android Messages/resources/electron.asar" \ "${pkgdir}/usr/lib/${pkgname}/resources/electron.asar"

sed -i "s|\"/opt/Android Messages/android-messages-desktop\"|/usr/bin/electron /usr/lib/${pkgname}/resources/app.asar|" "${srcdir}/usr/share/applications/${pkgname}.desktop"

install -D -m644 "${srcdir}/usr/share/applications/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" for icon_size in 16 24 32 48 64 128 256 512 1024; do icons_dir="/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps" install -d "${pkgdir}/${icons_dir}" install -m644 "${srcdir}${icons_dir}/${pkgname}.png" \ "${pkgdir}${icons_dir}/${pkgname}.png" done }

yochananmarqos commented 6 years ago

@jjgalvez Great idea! Since electron is now being used, we don't need it's dependencies separately. I also tweaked the sed line. I'll go ahead and push it to the AUR.

# Maintainer: Mark Wagie <yochanan.marqos@gmail.com>
# Co-Maintainer: jswenson
# Packager: Chris Knepper <chris82thekid@gmail.com>
pkgname=android-messages-desktop
pkgver=0.7.0
pkgrel=2
pkgdesc="Android Messages as a cross-platform desktop app"
arch=('x86_64')
url="https://github.com/chrisknepper/android-messages-desktop"
license=('MIT')
depends=('electron' 'libnotify' 'libappindicator-gtk2' 'libappindicator-gtk3' 'libappindicator-sharp')
provides=(android-messages-desktop)
source=("${url}/releases/download/v${pkgver}/${pkgname}-${pkgver}.pacman")
md5sums=('d61810468879d8da2fa543448b84e251')

package() {
    install -D -m644 "${srcdir}/opt/Android Messages/resources/app.asar" "${pkgdir}/usr/lib/${pkgname}/resources/app.asar"
    install -D -m644 "${srcdir}/opt/Android Messages/resources/electron.asar" "${pkgdir}/usr/lib/${pkgname}/resources/electron.asar"
    sed -i 's|Exec="/opt/Android Messages/android-messages-desktop"|Exec=electron /usr/lib/android-messages-desktop/resources/app.asar|g' "${srcdir}/usr/share/applications/${pkgname}.desktop"
    install -D -m644 "${srcdir}/usr/share/applications/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
    for icon_size in 16 24 32 48 64 128 256 512 1024; do
        icons_dir="/usr/share/icons/hicolor/${icon_size}x${icon_size}/apps"
        install -d "${pkgdir}/${icons_dir}"
        install -m644 "${srcdir}${icons_dir}/${pkgname}.png" "${pkgdir}${icons_dir}/${pkgname}.png"
    done
}
jjgalvez commented 6 years ago

Fantastic thanks Jose

Buttars commented 6 years ago

As for now, I see this issue / project has been taken care of. Shout out to @yochananmarqosout and all those who put in the time to make this work. I really appreciate it. Although, I am going to close this issue in favor of the AUR page for issue tracking relating the PKGBUILD.