Comments (6)
This is something I've been meaning to do. I'll try to see if I can set this up better later today.
If you have everything setup already, feel free to make a pull request and I'll merge it. :)
from freetube.
I'm currently using electron-packager to build the app on my 64-bit system. I haven't tested it without the "--arch x64" option so I don't know if it will auto-detect the correct arch. I didn't want to create a pull request without knowing how these changes would affect 32-bit users. I'll try to test it further in the next couple of days.
from freetube.
I ran a bunch of tests and there's some good news and some bad news. The good news is that you can omit the arch from the electron-packager command. It will auto-detect the host system arch. So you only need one command to build on any host system (make:linux).
The bad news is that the command to package the app requires that you specify the arch. And the output folder from the build operation is auto-generated and named after the host system arch (e.g., freetube-linux-x64). So you'll have to know the output folder name along with the correct arch to build the package.
To further complicate the problem there are different arch terms based upon the distro. So a redhat package might use x86_64 as the arch but a debian package would use amd64. And electron packager has its own list of compatible arch terms. If you were to embed the arch into the package command then you would need a minimum of 4 commands per package type (package:deb32, package:deb64, package:debArm32, package:debArm64).
The only way to condense all of the packaging options into a single command is to create a separate bash script and provide it in the same folder as the package.json file.
"package:deb": "electron-installer-debian --src out/freetube-linux-$(./getArch dir)/ --dest out/packages/ --arch $(./getArch deb)",
"package:rpm": "electron-installer-redhat --src out/freetube-linux-$(./getArch dir)/ --dest out/packages/ --arch $(./getArch rpm)",
"make:linux": "electron-packager . freetube --platform linux --out out/",
"devDependencies": {
"electron-forge": "^5.1.1",
"electron-prebuilt-compile": "1.8.2",
"electron-winstaller": "^2.6.4",
"electron-installer-debian": "^0.8.1",
"electron-installer-redhat": "^0.5.0",
"electron-packager": "^11.1.0"
},
// yarn is only needed for electron-forge
example of the getArch bash script
#!/bin/bash
# get system arch
arch=$(uname -m)
if [ "${arch}" == "x86_64" ]; then
# if first option passed to bash script is "dir" then we return
# a string pointing to the output folder created by electron
# packager
if [ "${1}" == "dir" ]; then
echo -n "x64"
else
if [ "${1}" == "deb" ]; then
# return a debian compatible arch string
echo -n "amd64"
else
# return a redhat/rpm compatible arch string
echo -n "x86_64"
fi
fi
fi
To build and package
npm install --only=prod
npm install --only=dev
npm run make:linux
npm run package:deb
OR
npm run package:rpm
If you're interested in using the electron-packager/electron-installer/bash approach I'd be willing to put together the complete bash script. First step would be to compile the list of all possible arch variables. The final version of the bash script would use getopts instead of the $1 variable.
from freetube.
Hey sorry for the late reply. Yeah the way Electron Forge does it's packaging is that it automatically builds for the user's current platform as you've noticed. I appreciate you taking the time into looking into this as well. I'm perfectly okay with having the separate commands for building the packages. It should save you some scripting as well if we went that way. It would probably be better in the long run anyways that way the person building the application has a better idea on what's being built. If you already have the commands separated feel free to send a pull request. If you don't have time to do so then I will try to get to it this weekend.
Thanks again!
from freetube.
I added 8 new packaging options to provide 32/64 bit options for x86 and arm. The one arch that I left out is mips64el. It's supported by electron-packager but it seemed unnecessary. I didn't have time to test all of them. I believe the arch terms are correct and should work fine but it would require setting up 8 different VMs to test them all. No worries if it takes a few weeks before you merge the pull request or use a different approach. Thanks for the software.
from freetube.
I'll go ahead and close this issue as we have more options for downloading such as Flatpak and AUR.
from freetube.
Related Issues (20)
- [Feature Request]: Full-screen option without activation of playback bar. HOT 4
- comments HOT 1
- [Bug]: Local API error 400 (bad request) and falling back to Invidious API when loading videos or searches HOT 34
- [Bug]: Blank and unresponsive HOT 3
- [Bug]: Request to vtrue fails with 400 HOT 2
- [Feature Request]: Add tabs option. HOT 1
- [Feature Request]: Option to use grid display in playlists HOT 4
- [Bug]: Hide videos from channels option is messed up HOT 2
- [Bug]: packaging issue: the date and time stamps of archived files are missing in the 7z archives! HOT 2
- [Bug]: Subs getting bigger rewatching the same clip if their size is set to >100% HOT 1
- [Bug]: new version deleted all of my data! no pre-warning of replacing all files in install folder HOT 3
- [Feature Request]: Generate checksum file(s) during build
- [Feature Request]: Copy link to the tab you are on on an channel page (Playlists → /playlists)
- [Feature Request]: Settings search
- [Feature Request]: Add the "hide video" button HOT 1
- [Feature Request]: mark video as watched HOT 1
- [Feature Request]: Sorting options for Playlists HOT 1
- [Feature Request]: Disable the alt key menu HOT 2
- [Bug]: GPU load in background HOT 2
- [Feature Request]: add date specific search options or buttons on history page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freetube.