Commit graph

224 commits

Author SHA1 Message Date
Jools Wills
4cf07a67c1 packages - use a single associative array for module info
rather than multiple arrays for each module info we now use a single array with

__mod_info(ID/KEY) where key is type/desc/help/licence/flags etc

we still keep __mod_id() - a standard indexed array with every module id (used for setup menus etc) and
__mod_idx() which references the index # from the id

this will make it easier to extend in the future
2021-01-23 01:48:07 +00:00
Jools Wills
f7a74457f1 packages - shorten __section array initialisation 2021-01-23 01:34:53 +00:00
Jools Wills
1d92a12075 setup / packages - switch to using curl / check curl return values 2021-01-21 05:18:32 +00:00
Jools Wills
16a4a26723 packages - split out / rework install/install_bin logic
We don't want to remove install folder before we download a binary - in the case of a download failure we could end up
just removing the installed version which isn't wanted. Added the removal to before the tar unpacking / verification.

Remove some checks for function existing for cases where it had been done earlier and move some logic for
install/install_bin to later case statement to clean up logic a bit
2021-01-07 05:10:02 +00:00
Jools Wills
acdb1ddac8 Switch to associative arrays for module data and storage
Previously all the module data was in indexed arrays with matching offsets.
Each scriptmodule folder had an initial index and it was incremented per module.

Many package functions expected an index. Indexes were never unique and could change
depending on added modules etc. We also had to convert between them and module IDs.

Now it's all done by module id. There is a numbered index of all modules found, that
increments which is used in the GUI setup menus. But it's not needed by any packaging functions.

md_idx is dropped and the few modules that used it for install checks etc now use md_id.

all packaging functions use the id.

retropie_packages.sh now accepts the module id only.
2021-01-07 05:10:02 +00:00
Jools Wills
82cb6d8671 setup - don't clean up sources on failure unless we are calling from setup gui
This adds a __setup global variable which is used for this (set to 1 during setup_depends).

In the past, sources were not cleaned on error which was an issue for some users when an
upstream source changed causing a custom patch to fail or upstream url code changed. It was
changed so source folders were cleaned up on error which was useful for end users.

This wasn't helpful for development and testing though, so when using retropie_packages
directly, the source folder won't be removed. When building a module and testing via
./retropie_packages.sh MODULE sources, it was  nuisance to have the source folder removed on
a patch failure, especially on larger repositories.
2020-12-02 00:14:03 +00:00
Jools Wills
d380574e45 helpers / packages - split off signing a file to function signFile for use by modules 2020-09-10 06:49:17 +01:00
Jools Wills
7842e33871 helpers / packages - split out download / sig check functionality to downloadAndVerify 2020-09-10 06:25:51 +01:00
Jools Wills
ddabb2a902 system / packages - added signing of binary packages
* default signing key can be overridden with __gpg_signing_key
 * added gpg dependency by default
 * download retropie key from ubuntu keyserver if it doesn't exist in keyring
 * added download helper function
 * rework logic for rp_installBin and rp_createBin
 * copy secret key to chroots for package building
2020-09-10 06:25:45 +01:00
Jools Wills
84d7ab9b60 packages - check for install directory for retropie.pkg
* some admin modules (eg stats) may not create an $md_inst folder and could output error messages (albeit harmless)
2020-07-10 19:05:39 +01:00
Jools Wills
731bb20a30 added depends package section and show in setup gui
this allows switching dependencies between binary/source installs and removal if needed - useful in some cases,
as it's possible if our server was offline for a source install to be used, which with the new packaging will be
rememebered - so this allows switching back to binary.

added golang / mesa-drm  omxiv / sdl1 and sdl2 to depends section
2020-03-23 04:17:06 +00:00
Jools Wills
6758f0e2bb
Merge pull request #3019 from joolswills/packaging_improvements
sdl1 / sdl2 - add __binary_url functions and rework packaging logic
2020-03-20 23:36:14 +00:00
cmitu
a13ec9a691 packages: fix erros shown during build for source installs 2020-03-17 18:23:01 +00:00
Jools Wills
12414f49eb sdl1 / sdl2 - add __binary_url functions and rework packaging logic
* create a rp_getBinaryUrl function to get the binary url of a package
 * if a module has a __binary_url and it returns an empty string, treat this as no binary available - this allows removing hardcoded logic for sdl1/sdl2 from getDepends
 * if a module doesn't have this function but it has its own install_bin don't test for a binary and assume it's ok
2020-03-17 04:37:02 +00:00
Jools Wills
f844b67f36 packages - added _autoupdate_ parameter to install then update on later calls
* add remove function to runcommand to remove mesa-drm
 * use _autoupdate_ for runcommand and splashscreen for dependent modules
2020-03-13 07:43:54 +00:00
Jools Wills
1984284643 packages / setup - add per section update option
* make sure we don't try and update a package that isn't installed (shouldn't happen via the gui, but useful for commandline)
2020-03-13 05:19:10 +00:00
Jools Wills
47d6979d69 packages / setup - better handling of network failures / error handling cleanup
* display ERRMSGS at the end of retropie_packages
 * no need to reset ERRMSGS  / INFSGS until they are displayed in setup
2020-03-13 05:19:10 +00:00
Jools Wills
68af1b0a7c packages - handle package info for a few source packages that don't have a install_ function
* check at end of build stage if install function exists - if not set the pkg info then - this adds package info for a few drivers such as xpad and mkarcadejoystick etc
2020-03-13 05:19:10 +00:00
Jools Wills
2a0ee8f3f6 packages - add an _update_ function and adjust logic for _binary_
* now make _binary_ always update/reinstall - but add an _update_ function to automatically update if needed - this enables us to force an update via _auto_ or use _update_ to check
2020-03-13 01:57:25 +00:00
Jools Wills
4dfeafa5c3 packages - add additional return code of 2 for unknown cases and logic rework
* eg debian packages or binaries from sources we don't handle, or when there is no pkg_date (eg from older retropie) - we don't know if there is an update or not
 * in this case, we display the message "Binary update may be available" in the gui, and we will try and update
 * default pkg_origin to unknown, and adjust _auto_ logic. Check for binary before passing over the _binary_ install
 * rework setup menu logic for individual package management
2020-03-13 01:57:25 +00:00
Jools Wills
43effd05fc packages - only update binaries when there is a newer binary than installed
* added remote binary date to the retropie.pkg and compare on binary update - this speeds up updating from binary, and also should help with our server bandwidth :-)
 * allow modules using 3rd party binaries to echo binary url in __binary_url_MODULEID
 * set pkg_date on source installs also
2020-03-13 01:57:25 +00:00
Jools Wills
0abd8502a8 packages - added initial retropie.pkg to install folder to track install method
* rework rp_installModule / rp_callModule logic to use this, which will also de-dupe some logic in retropie-setup
 * you can now call retropie_packages.sh with parameters _auto_ _binary_ _source_ after the module name to update via last method used (auto), or force binary or source. no parameters works the same as before which is the same as using _source_
2020-03-13 01:57:25 +00:00
Jools Wills
a749d3c94a packages - fix rp_hasModule
* completely broken - oops. should have been -n but the lookup was incorrect (missing $) - but better to use our function
2020-03-13 01:56:29 +00:00
Jools Wills
8c78673a15 packages - added rp_hasModule to check if a module_id is available 2020-03-10 01:48:35 +00:00
Jools Wills
2d9cd61ee0 packages - expand platform flags to allow excluding all platforms and including certain ones
This should be backward compatible with the previous behaviour. By default all platforms are included.
Previously if you wanted a rpi+videocore only module you had to use lots of flags to exclude other platforms - eg

!x86 !mali !kms

which isn't ideal as new platforms are added.
Now this can be changed now by using a !all flag

!all videocore

which would first exclude all platforms, then enable the module just for videocore.
2020-02-22 00:15:26 +00:00
Jools Wills
92dbe1223d Merge remote-tracking branch 'retropie/master' into fkms_rpi4
Conflicts:
	scriptmodules/emulators/atari800.sh
2019-12-19 02:20:06 +00:00
Jools Wills
d7ee53c366
Merge pull request #2912 from joolswills/platform_based_sections
packages - added the ability to set a package section based on platfo…
2019-12-19 01:14:49 +00:00
Jools Wills
af59243172 packages - allow ignoring of package flags via __ignore_flags env var
* needed by the stats code and useful for testing / development
 * initialise / clear global package arrays in rp_registerAllModules so we can regenerate from that function
2019-12-18 11:05:30 +00:00
Jools Wills
5386d05299 packages - added the ability to set a package section based on platform flags
The module/package variable rp_module_section used to need a single string containing
the section for the module - eg "core" "main" "opt".

With this change, you can provide additional space separated parameters to specify the
section for a specific platform flag. This is useful for example to have a module by default
in "opt", but then promote it to "main" for certain systems.

eg for mame4all (mostly useful for slower armv6 devices) you could do

rp_module_section="opt armv6=main"

which would place it in the main section only for armv6
2019-12-05 00:47:59 +00:00
Jools Wills
1c04edcf6f system / packages - add kms to path for kms binaries
* always set binary_url even if no binaries are available
2019-10-22 00:49:38 +01:00
Conn O'Griofa
e0286ce338 Replace zdoom with lzdoom (for buster/fkms)
* Use OpenGL acceleration for Mesa (RPI3/4) & X11
* Use software rendering for other GLES targets (including
  videocore)

Rationale for switching to lzdoom:
* zdoom is no longer maintained and doesn't build against GCC 8.
* lzdoom is actively maintained as a recommended GZDoom fork for legacy systems.
* lzdoom supports software rendering (for GLES2 targets).
* lzdoom supports OpenGL 2.1 rendering (for Mesa/X11 targets).
* Using a more up-to-date fork brings better compatibility with popular mods such as FreeDoom and Brutal Doom.
2019-08-02 05:18:46 +01:00
Jools Wills
04586851d5 packages - fix up logic when checking for required files / installing files
* always check for required files even if previous errors to be more verbose
 * logic was broken so you could not use both md_ret_require and md_ret_files
2018-03-16 15:07:52 +00:00
Jools Wills
9c570ea6f6 packages - no need for remove parameter as we use md_mode 2017-12-28 12:07:56 +00:00
Jools Wills
e8f2901c95 packages - print error before cleaning sources. 2017-12-28 09:40:04 +00:00
Jools Wills
083e32c898 remove newbrcmlibs flag as all binaries that link against the libraries have been rebuilt 2017-11-22 19:23:04 +00:00
Luis Felipe Strano Moraes
276ca85f3a Fixing a few typos around the project. 2017-10-16 13:18:15 -07:00
Jools Wills
ee41a3f613 added new flag "newbrcmlibs" for management of switch to renamed libbrcm* gles libs #2091
* flag is set in module, and file RP-NEWBRCMLIBS is created in "$md_inst" on install (not on binary install,
   but updated binaries will include the file when created)
 * runcommand checks for the file, and if it doesn't exist, switches SDL to use the old library names.
   this will allow us to add the flag for new modules so we have compatibility during the switcher. the
   flag / logic from runcommand can be removed in the future
2017-10-08 15:26:23 +01:00
Jools Wills
a455392378 packages - add md_ret_info to popular __INFMSGS as we do with __ERRMSGS
not currently used by anything, but it give a way for a module to return some information to the user after installing via retropie_setup or packages
2017-04-05 21:21:47 +01:00
Jools Wills
5084a2d8e7 packages - added rp_module_licence field
* should contain abbreviated code (GPL2 GPL3 MIT NONCOM OTHER), followed by a space then url to the raw licence if possible.
2017-03-01 00:36:16 +00:00
Jools Wills
1a36ae6977 packages - include module id in error message 2017-02-09 02:50:59 +00:00
Jools Wills
165be4789b packages - put back in removing previous install folders, but with a noinstclean flag for those emulators that save user data still in $md_inst 2017-02-07 00:37:00 +00:00
Jools Wills
85bc1dac44 packages - match against debian for binary exclusions on armv7 userland 2017-02-05 12:22:25 +00:00
Jools Wills
7f505d1097 packages - exclude some threaded c++ apps from binary install on armv7 OSMC due to abi incompatibility 2017-02-05 11:58:37 +00:00
Jools Wills
8a0f36c739 helpers - added dirIsEmpty / don't archive empty folders in rp_createBin 2016-11-19 00:50:33 +00:00
Jools Wills
4831258dba added __persistent_repos variable to avoid removing/checking out source from scratch 2016-11-11 00:10:37 +00:00
Jools Wills
165c5a3fe8 packages - added rp_getIdFromIdx / return 2 if no module found 2016-10-22 21:54:08 +01:00
Jools Wills
f5ffcfa631 add a new md_data variable for quick access to a modules additional data files 2016-10-19 21:56:38 +01:00
Jools Wills
643851edab packages - fix binary archive creation path 2016-10-17 23:04:10 +01:00
Jools Wills
4a7a2e40b2 packages - put comment back in the right place 2016-10-17 03:09:38 +01:00
Jools Wills
204e9cf9c1 update modules to use new __os_* variables 2016-10-09 05:50:40 +01:00