8000 Add Motrix by proletarius101 · Pull Request #2334 · flathub/flathub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Motrix #2334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig helps developers define and maintain consistent coding styles
# between different editors and IDEs (editorconfig.org)

root = true

[*]
continuation_indent_size = 4
indent_size = 2
indent_style = space
max_line_length = 120

# Keep these unchanged
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
# https://help.github.com/articles/dealing-with-line-endings/#platform-all
* text eol=lf
50 changes: 50 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Modifed from https://github.com/flathub/net.veloren.veloren/raw/master/net.veloren.veloren.yaml

name: Auto update

env:
BUILDER_TOOLS_URL: https://github.com/flatpak/flatpak-builder-tools
BUILDER_TOOLS_BRANCH: master
YQ_VERSION: "v4.6.1"
YQ_BINARY: yq_linux_amd64

on:
push:

jobs:
update:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
set -e
sudo apt install python3-toml python3-aiohttp

- uses: actions/checkout@v2

- name: Download flatpak-builder-tools
run: |
git clone -b ${BUILDER_TOOLS_BRANCH} \
${BUILDER_TOOLS_URL} \
builder-tools

# Rather than track the tip of a branch
- name: Get the current tag
run: |
set -e

mkdir ~/bin
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BINARY} -O ~/bin/yq && \
chmod +x ~/bin/yq

TAG=`~/bin/yq e '.modules.[] | select(.name == "motrix") | .sources.[] | select(.url == "https://github.com/agalwood/Motrix.git") | .tag' net.agalwood.Motrix.yml`

echo "TAG=$TAG" >> $GITHUB_ENV

- name: Run update
run: |
set -e
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config user.name "Workflow trigger"
python3 ./update.py net.agalwood.Motrix-git.json --ref ${{ env.TAG }} -g builder-tools/node/flatpak-node-generator.py --generator-arg=--electron-node-headers --generator-arg=--xdg-layout --generator-arg=-r --generator-arg=yarn --generator-arg=yarn.lock
git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Excludes
.flatpak-builder/
.idea/
build/
flatpak-builder-tools/
spellchecker/
standard-notes/
.flatpak
.DS_Store
Thumbs.db
*.iml

#
# Includes
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "shared-modules"]
path = shared-modules
url = https://github.com/flathub/shared-modules
9,029 changes: 9,029 additions & 0 deletions generated-sources.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions net.agalwood.Motrix-git.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "git",
"url": "https://github.com/agalwood/Motrix.git",
"ref": "v1.6.10"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file isn't referenced anywhere in the manifest.

Copy link
Author
@proletarius101 proletarius101 May 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13 changes: 13 additions & 0 deletions net.agalwood.Motrix.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Desktop Entry]
Categories=Network;FileTransfer;
Exec=start-motrix %U
GenericName=Torrent Client
Icon=net.agalwood.Motrix
Keywords=Torrent;Bittorrent;Download;
Name=Motrix
Comment=A full-featured download manager
StartupNotify=true
StartupWMClass=motrix
Terminal=false
Type=Application
MimeType=application/x-bittorrent;x-scheme-handler/magnet;x-scheme-handler/mo;x-scheme-handler/motrix;x-scheme-handler/thunder;
116 changes: 116 additions & 0 deletions net.agalwood.Motrix.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>net.agalwood.Motrix</id>

<name>Motrix</name>
<summary>A full-featured download manager</summary>

<developer_name>AGALWOOD</developer_name>

<project_license>MIT</project_license>
<metadata_license>CC0-1.0</metadata_license>

<recommends>
<control>pointing</control>
<control>keyboard</control>
<control>touch</control>
</recommends>

<categories>
<category>Network</category>
<category>FileTransfer</category>
</categories>

<description>
<p>
A full-featured download manager that supports downloading HTTP, FTP, BitTorrent, Magnet, etc.
</p>
<ul>
<li>
&#x1f579;
Simple and clear user interface
</li>
<li>
&#x1f984;
Support BitTorrent &amp; Magnet
</li>
<li>
&#x2611;&#xfe0f;
BitTorrent selective download
</li>
<li>
&#x1f4e1;
Update tracker list every day automatically
</li>
<li>
&#x1f50c;
UPnP &amp; NAT-PMP Port Mapping
</li>
<li>
&#x1f39b;
Up to 10 tasks concurrently download
</li>
<li>
&#x1f680;
Single task maximum support 64 thread download
</li>
<li>
&#x1f576;
Mock User-Agent
</li>
<li>
&#x1f514;
Download completed Notification
</li>
<li>
&#x1f4bb;
Ready for Touch Bar (Mac only)
</li>
<li>
&#x1f916;
Resident system tray for quick operation
</li>
<li>
&#x1f311;
Dark mode
</li>
<li>
&#x1f5d1;
Delete related files when removing tasks (optional)
</li>
<li>
&#x1f30d;
I18n
</li>
<li>
&#x1f6e0;
More features in development
</li>
</ul>
</description>

<launchable type="desktop-id">net.agalwood.Motrix.desktop</launchable>

<url type="homepage">https://motrix.app/</url>
<url type="bugtracker">https://github.com/agalwood/Motrix/issues/</url>
<url type="help">https://github.com/agalwood/Motrix/wiki</url> F438
<url type="translate">https://github.com/agalwood/Motrix/blob/master/CONTRIBUTING.md#-translation-guide</url>

<content_rating type="oars-1.1" />

<screenshots>
<screenshot type="default">
<image>https://github.com/agalwood/Motrix/raw/master/screenshots/electron-apps-banner.png</image>
</screenshot>
<screenshot>
<image>https://github.com/agalwood/Motrix/raw/master/screenshots/motrix-task-list-downloading-light%402x.png</image>
</screenshot>
<screenshot>
<image>https://github.com/agalwood/Motrix/raw/master/screenshots/motrix-task-list-downloading-dark%402x.png</image>
</screenshot>
</screenshots>

<releases>
<release version="1.6.10" date="2021-05-07" />
</releases>
</component>
140 changes: 140 additions & 0 deletions net.agalwood.Motrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
app-id: net.agalwood.Motrix
runtime: org.freedesktop.Platform
runtime-version: "20.08"
sdk: org.freedesktop.Sdk
base: org.electronjs.Electron2.BaseApp
base-version: "20.08"
sdk-extensions:
- org.freedesktop.Sdk.Extension.node14
# Electron doesn't use a traditional locale format so separate-locales is useless.
separate-locales: false
command: start-motrix
finish-args:
- --device=dri
- --filesystem=xdg-download
- --filesystem=xdg-documents
- --share=ipc
- --share=network
- --socket=x11
- --talk-name=org.freedesktop.Notifications
modules:
- shared-modules/libsecret/libsecret.json

- name: yarn
buildsystem: simple
build-commands:
- cp -a * $FLATPAK_DEST
# Only used for building, so clean it up afterwards.
cleanup:
- "*"
sources:
- type: archive
url: https://github.com/yarnpkg/yarn/releases/download/v1.22.10/yarn-v1.22.10.tar.gz
sha256: 7e433d4a77e2c79e6a7ae4866782608a8e8bcad3ec6783580577c59538381a6e
x-checker-data:
type: anitya
project-id: 13363
url-template: https://github.com/yarnpkg/yarn/releases/download/$version/yarn-v$version.tar.gz
- name: motrix
buildsystem: simple
build-options:
# Add the node bin directory.
append-path: /usr/lib/sdk/node14/bin:/app/yarn/bin:/run/build/motrix/flatpak-node/chromedrive
env:
# Don't add ELECTRON_CACHE
XDG_CACHE_HOME: /run/build/motrix/flatpak-node/cache
# npm_config_nodedir: /usr/lib/sdk/node14
npm_config_offline: "true"
npm_config_no_save: "true"
npm_config_cache: /run/build/motrix/flatpak-node/npm-cache
npm_config_loglevel: verbose
# https://stackoverflow.com/questions/25146976/can-i-get-npm-gyp-to-use-ccache
CXX: ccache g++
CC: ccache gcc
arch:
# https://github.com/sass/node-sass/issues/3033#issuecomment-763180778
# The architecture of Electron, see https://electronjs.org/docs/tutorial/support#supported-platforms
# for supported architectures.
i386:
env:
npm_config_arch: ia32
npm_config_target_arch: ia32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neither i386 nor arm are supported anymore by the runtime so it's unnecessary.

(it's harmless though, just clutter)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, let's just leave it there? As they are supported by electron and someone might find it useful

x86_64:
env:
npm_config_arch: x64
npm_config_target_arch: x64
arm:
env:
npm_config_arch: armv7l
npm_config_target_arch: armv7l
aarch64:
env:
npm_config_arch: arm64
npm_config_target_arch: arm64

build-commands:
# Use the offline mirror.
- HOME=$PWD yarn config --offline set yarn-offline-mirror $FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn-mirror

# Translated from .travis.yml
# - yarn --offline add -g xvfb-maybe
- yarn --offline --pure-lockfile --$npm_config_arch

- node $FLATPAK_BUILDER_BUILDDIR/.electron-vue/build.js
- yarn --offline run electron-builder --linux dir --$npm_config_arch -c.linux.target=dir
--publish=never

# Remove unneeded files
- rm $FLATPAK_BUILDER_BUILDDIR/release/linux*-unpacked/chrome-sandbox

# Copy the resulting, unpacked directory to $FLATPAK_DEST.
- cp -r $FLATPAK_BUILDER_BUILDDIR/release/linux*-unpacked $FLATPAK_DEST/motrix

# Retire this at some point when an SVG is available
- for size in 512; do [[ -e "static/${size}x${size}.png" ]] && install
-Dm644 "$FLATPAK_BUILDER_BUILDDIR/static/${size}x${size}.png" "/app/share/icons/hicolor/${size}x${size}/apps/${FLATPAK_ID}.png";
done
- install -Dm644 "$FLATPAK_BUILDER_BUILDDIR/static/mo-tray-dark-normal@2x.png" "/app/share/icons/hicolor/symbolic/apps/${FLATPAK_ID}-symbolic.png"
- cp -r $FLATPAK_BUILDER_BUILDDIR/extra/linux/. $FLATPAK_DEST/motrix
sources:
- type: git
url: https://github.com/agalwood/Motrix.git
tag: v1.6.10
commit: 166aba77474df5dd65da20ee1548004c9f078bdd
x-checker-data:
type: anitya
project-id: 197314
tag-template: v$version
stable-only: true
# Add the flatpak-node-generator generated sources.
# Note to generate recursively with -r since the repo is composed by submodules
# No need to generate a separate one for ./app
- generated-sources.json
- name: start-script
buildsystem: simple
build-commands:
# Install the wrapper script to start it.
- install -Dm 755 start-motrix.sh $FLATPAK_DEST/bin/start-motrix
sources:
# Our runner script.
- type: script
dest-filename: start-motrix.sh
commands:
# Use zypak to call the electron binary to enable sandboxing and prevents no sandbox error
# Note the hyphen
- export TMPDIR=$XDG_RUNTIME_DIR/app/$FLATPAK_ID
- zypak-wrapper /app/motrix/motrix "$@"
- name: metainfo
buildsystem: simple
build-commands:
- install -Dm644 net.agalwood.Motrix.metainfo.xml $FLATPAK_DEST/share/metainfo/$FLATPAK_ID.metainfo.xml
sources:
- type: file
path: net.agalwood.Motrix.metainfo.xml
- name: desktop-entry
buildsystem: simple
build-commands:
- install -Dm644 net.agalwood.Motrix.desktop $FLATPAK_DEST/share/applications/$FLATPAK_ID.desktop
sources:
- type: file
path: net.agalwood.Motrix.desktop
1 change: 1 addition & 0 deletions shared-modules
Submodule shared-modules added at 72cfdd
Loading
0