LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-15-2024, 03:28 AM   #16
theodore.s
Member
 
Registered: Jul 2018
Location: Athens, Greece
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 34
Thanks!


Quote:
Originally Posted by rizitis View Post
About VERSION, ID, SNAP_VERSION, etc...
save it as snap-find.py
Thanks a lot!

I sent a mail to the slackbuild maintainer with the link of this thread. But I don't know how easy would be to maintain an updated slackbuild in the slackbuilds.org style (with a static "source" download link). For example, when a new version is released, the download link of the old version would still be valid or it will disappear?
 
1 members found this post helpful.
Old 05-15-2024, 04:12 AM   #17
rizitis
Member
 
Registered: Mar 2009
Location: Greece,Crete
Distribution: Slackware64-current, Slint
Posts: 705
Blog Entries: 1

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Code:
import sys
import requests
import json

if len(sys.argv) != 2:
    print("Usage: python snap-find.py <package>")
    sys.exit(1)

snap_name = sys.argv[1]

url = f"https://api.snapcraft.io/api/v1/snaps/details/{snap_name}"

# hm...
headers = {
    "X-Ubuntu-Series": "16"  
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    snap_details = response.json()
    # Convert JSON to a more human-readable format
    for key, value in snap_details.items():
        if isinstance(value, list):
            value = ', '.join(value)
        elif value is None:
            value = "None"
        elif isinstance(value, bool):
            value = "True" if value else "False"
        print(f"{key}: {value}")
else:
    print(f"Error: {response.status_code}")
import json in python (which I hate tbh...)
now we have a better output for example for minecraft

Code:
python snap-find.py mc-installer
aliases: None
anon_download_url: https://api.snapcraft.io/api/v1/snaps/download/VcdcPCY35DfyUSApgyijx9oes01cIFKX_627.snap
apps: mc-installer
architecture: amd64
base: core22
binary_filesize: 110620672
channel: stable
common_ids: 
confinement: strict
contact: None
content: application
date_published: 2018-12-14T01:15:45.329187Z
deltas: 
description: A simple installer for Minecraft - Java Edition.
developer_id: jyL6NPmmwE6knQhm89MUOgpM4FSKEUJa
developer_name: James Tigert
developer_validation: unproven
download_sha3_384: cfd3164b1cf208891fcc93cb5f9e1e9ab74c4842242b86d9be8864a0f5914c4b8ae3c23a3923eb84df8fa58a36861165
download_sha512: 102373a045e88010358b8971d467ae3a3a19e064b42c7a10d3d8fcb7b9e070e77504c81e1afc75857b69a06ff8b5b772a597f83fc15d2b1d2dbb6743de429a07
download_url: https://api.snapcraft.io/api/v1/snaps/download/VcdcPCY35DfyUSApgyijx9oes01cIFKX_627.snap
epoch: 0
gated_snap_ids: 
icon_url: https://dashboard.snapcraft.io/site_media/appmedia/2024/04/mcinstaller.png
last_updated: 2024-04-26T18:26:30.414842+00:00
license: MIT
links: {'contact': [], 'donations': [], 'issues': [], 'source': [], 'website': []}
name: mc-installer.kz6fittycent
origin: kz6fittycent
package_name: mc-installer
prices: {}
private: False
publisher: James Tigert
ratings_average: 0.0
release: 16
revision: 627
screenshot_urls: https://dashboard.snapcraft.io/site_media/appmedia/2020/03/Screenshot_from_2020-03-26_00-16-15.png, https://dashboard.snapcraft.io/site_media/appmedia/2018/12/Screenshot_from_2018-12-14_22-24-14.png, https://dashboard.snapcraft.io/site_media/appmedia/2018/12/Screenshot_from_2018-12-14_22-23-51.png
snap_id: VcdcPCY35DfyUSApgyijx9oes01cIFKX
summary: A simple installer for Minecraft - Java Edition
support_url: 
title: Minecraft Installer
version: 14.0
website:
All infos are here (better format) this way for every snap package. Now if you can install it, thats other question...
But thats why we are here, to help each other #slack-rulles
 
1 members found this post helpful.
Old 05-15-2024, 04:26 AM   #18
theodore.s
Member
 
Registered: Jul 2018
Location: Athens, Greece
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 34
import json not needed

Quote:
Originally Posted by rizitis View Post
import json in python (which I hate tbh...)
now we have a better output for example for minecraft
Or you could just print the values needed for the slackbuild, without importing json:

Code:
if response.status_code == 200:
    snap_details = response.json()
    print(snap_details['version'])
    print(snap_details['download_url'],)
else:
    print(f"Error: {response.status_code}")
...and call it directly from skypeforlinux.SlackBuild
 
1 members found this post helpful.
Old 05-15-2024, 04:28 AM   #19
rizitis
Member
 
Registered: Mar 2009
Location: Greece,Crete
Distribution: Slackware64-current, Slint
Posts: 705
Blog Entries: 1

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
Quote:
Originally Posted by theodore.s View Post
Thanks a lot!

I sent a mail to the slackbuild maintainer with the link of this thread. But I don't know how easy would be to maintain an updated slackbuild in the slackbuilds.org style (with a static "source" download link). For example, when a new version is released, the download link of the old version would still be valid or it will disappear?
I think thats up to every developer policy...
But now we dont speaking for general , but for 1-3 specific packages that we have to build from snap or no package...
In such case , I think there is a SlackBuild repo for source code old and abandonment or specially packages etc
If maintainer want and agree can store there the *.snap so even if new package exist in snap repo and old is deleted we have np...
But of cource we are speaking for a few maybe only one (skype) packages that there is a real problem because only snap exist and nothing else...

In any case that is "my opinion" but SBo people knows better than me and everything they decide that the correct...

EDIT:
Quote:
Originally Posted by theodore.s View Post
Or you could just print the values needed for the slackbuild, without importing json:

Code:
if response.status_code == 200:
    snap_details = response.json()
    print(snap_details['version'])
    print(snap_details['download_url'],)
else:
    print(f"Error: {response.status_code}")
...and call it directly from skypeforlinux.SlackBuild
Did i said i hate python?

Last edited by rizitis; 05-15-2024 at 04:32 AM.
 
2 members found this post helpful.
Old 05-15-2024, 05:10 AM   #20
theodore.s
Member
 
Registered: Jul 2018
Location: Athens, Greece
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 34
A more complete version.

Save this as snap-find.py in slackbuild dir:

Code:
import sys
import requests

# Slackware snap-find command :D
# Run python3 snap-find.py <package>
# First line is what you need:
# {'aliases': None, 'anon_download_url': 'https://api.snapcraft.io/api/v1/snaps/download/QRDEfjn4WJYnm0FzDKwqqRZZI77awQEV_348.snap', 'apps':
# If you see "Error: 404" means package has different name. 
# και τώρα ξέρεις ;) 

if len(sys.argv) != 2:
    print("Usage: python snap-find.py <package>")
    sys.exit(1)

snap_name = sys.argv[1]

url = f"https://api.snapcraft.io/api/v1/snaps/details/{snap_name}"

# hm...
headers = {
    "X-Ubuntu-Series": "16"  
}

response = requests.get(url, headers=headers)


if response.status_code == 200:
    snap_details = response.json()
    print(snap_details['version'])
    print(snap_details['download_url'])
    print(snap_details['snap_id'])
    print(snap_details['revision'])
else:
    print(f"Error: {response.status_code}")
And use this as skypeforlinux.SlackBuild:

Code:
#!/bin/bash

#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=skypeforlinux

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
       *) ARCH=$( uname -m ) ;;
  esac
fi

TAG=${TAG:-_snap}
PKGTYPE=${PKGTYPE:-tlz}
TMP=${TMP:-/tmp/snap}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
BUILD=${BUILD:-3}

declare RESULT=($(/usr/bin/python3 ./snap-find.py skype))
VERSION=${RESULT[0]}
DLINK=${RESULT[1]}
ID=${RESULT[2]}
SNAP_VERSION=${RESULT[3]}

if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi


if [ "$ARCH" != "x86_64" ]; then
  echo "$ARCH is not supported."
  exit 1
fi

set -e

rm -rf $TMP $PKG
mkdir -p $TMP $PKG $OUTPUT

cd $TMP
wget -c "$DLINK"

unsquashfs "$ID"_"$SNAP_VERSION".snap

mkdir -p $PKG/opt
mkdir -p $PKG/usr/share/applications/
mkdir -p $PKG/usr/share/icons/"$PRGNAM"

mv  $TMP/squashfs-root/usr/share/skypeforlinux -t $PKG/opt/
cp $TMP/squashfs-root/meta/gui/skypeforlinux.png  $PKG/usr/share/icons/"$PRGNAM"/
cp $TMP/squashfs-root/meta/gui/skypeforlinux.desktop $PKG/usr/share/applications/
sed -i -E 's/^Exec=.*/Exec=\/opt\/skypeforlinux\/skypeforlinux/; s/^Icon=.*/Icon=skypeforlinux/'  $PKG/usr/share/applications/skypeforlinux.desktop

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
mv squashfs-root/usr/share/doc/* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l n -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
...to build a Slackware package from the latest snap in one step.
 
1 members found this post helpful.
Old 05-15-2024, 09:09 AM   #21
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 935

Rep: Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527
Quote:
Originally Posted by rizitis View Post
This SlackBuild build skypeforlinux from snap
you can test it i dont use skype.

EDIT:UPDATE ATTACHMENT
One more thing, the icon dir is /usr/share/icons/hicolor/256x256/apps.
Thanks again
 
3 members found this post helpful.
Old 05-15-2024, 09:38 PM   #22
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,075

Rep: Reputation: 149Reputation: 149
You can use Skype in libpurple programs (BitlBee, Pidgin), Ferdium, etc.
 
Old 05-16-2024, 02:57 PM   #23
rizitis
Member
 
Registered: Mar 2009
Location: Greece,Crete
Distribution: Slackware64-current, Slint
Posts: 705
Blog Entries: 1

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
If you want check this Its the snap command written from scratch for no systemd systems. Named snapV
version-1.0.alpha...
 
1 members found this post helpful.
Old 05-16-2024, 03:06 PM   #24
qunying
Member
 
Registered: Jun 2002
Distribution: Slackware
Posts: 258

Rep: Reputation: 147Reputation: 147
I used to use skype a lot, but never bother to install a dedicated app. The web interface is good enough for my usage https://web.skype.com/, in case someone does not know about it. Besides, new skype is based on Electron, which basically is running a browser instance inside.

Last edited by qunying; 05-16-2024 at 04:43 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
skype: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by skype Xeratul Debian 6 11-24-2012 02:12 AM
latest skype Skype 2.2.0.25 and Slackware --current anti_user Slackware 10 04-07-2011 02:22 PM
qt4-x11 >= 4.2 is needed by skype-2.1.0.47-fc10.i586 (From Installation of SKYPE)RHEL miaomiaoga Linux - Software 8 08-28-2010 07:15 AM
noise in skype to skype calls in skype v2.1 beta for fedora mq15 Linux - Software 0 01-20-2010 12:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration