Commit d501c722 authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Vitaly Lipatov

epm play: add losless-cut (eterbug #17355)

parent 2490fb8f
#!/bin/sh
TAR="$1"
RETURNTARNAME="$2"
URL="$4"
. $(dirname $0)/common.sh
erc unpack $TAR || fatal
mkdir -p opt
mv Loss* opt/$PRODUCT
VERSION=$(echo "$URL" | grep -oP 'v\K[0-9]+\.[0-9]+\.[0-9]+')
[ -n "$VERSION" ] || fatal "Can't get package version"
install_file https://raw.githubusercontent.com/mifi/lossless-cut/master/src/renderer/src/icon.svg /usr/share/icons/hicolor/scalable/apps/$PRODUCT.svg
# create desktop file
cat <<EOF | create_file /usr/share/applications/$PRODUCT.desktop
[Desktop Entry]
Type=Application
Name=LosslessCut
Comment=GUI tool for lossless trimming/cutting of media files
Exec=$PRODUCT
Categories=AudioVideo;
Icon=$PRODUCT
StartupWMClass=losslesscut
EOF
PKGNAME=$PRODUCT-$VERSION
erc pack $PKGNAME.tar opt usr || fatal
return_tar $PKGNAME.tar
......@@ -77,11 +77,13 @@ epm()
$EPM "$@"
}
eget()
{
epm tool eget "$@"
}
is_supported_arch()
{
local i
......@@ -159,16 +161,26 @@ get_latest_version()
get_github_version()
{
is_command jq || fatal "jq not found, please install jq"
local url="$1"
local user_and_repo=${url#https://github.com/}
local user_and_repo=${user_and_repo%/}
local asset_name="$2"
if [ "$3" == "prerelease" ] ; then
curl -s "https://api.github.com/repos/${user_and_repo}/releases" | jq -r '.[] | .assets[].browser_download_url' | grep "$2" | head -n1
curl -s "https://api.github.com/repos/${user_and_repo}/releases" | grep 'browser_download_url' | grep -iEo 'https.*download.*' | grep "$2" | head -n1
else
curl -s "https://api.github.com/repos/${user_and_repo}/releases" | jq -r '.[] | select(.prerelease == false) | .assets[].browser_download_url' | grep "$2" | head -n1
curl -s "https://api.github.com/repos/${user_and_repo}/releases" \
| awk '{
if ($0 ~ /"prerelease": false/) {
prerelease = 0;
} else if ($0 ~ /"prerelease": true/) {
prerelease = 1;
}
if (!prerelease && $0 ~ /"browser_download_url":/) {
match($0, /"browser_download_url": "(https[^"]*)"/, arr);
print arr[1];
}
}' | grep "$2" | head -1
fi
}
......
#!/bin/sh
PKGNAME=lossless-cut
SUPPORTEDARCHES="x86_64 aarch64 armhf"
VERSION="$2"
DESCRIPTION='The swiss army knife of lossless video/audio editing'
URL="https://github.com/mifi/lossless-cut"
. $(dirname $0)/common.sh
case "$(epm print info -a)" in
x86_64)
arch="x64" ;;
aarch64)
arch="arm64" ;;
armhf)
arch="armv7l" ;;
esac
if [ "$VERSION" = "*" ] ; then
PKGURL=$(get_github_version "https://github.com/mifi/lossless-cut/" "LosslessCut-linux-$arch.tar.bz2")
else
PKGURL="https://github.com/mifi/lossless-cut/releases/download/v$VERSION/LosslessCut-linux-$arch.tar.bz2"
fi
install_pack_pkgurl
#!/bin/sh -x
# It will be run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
. $(dirname $0)/common.sh
add_libs_requires
add_electron_deps
fix_chrome_sandbox
add_bin_exec_command $PRODUCT $PRODUCTDIR/losslesscut
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment