Recent

Author Topic: Online Package Manager  (Read 834809 times)

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Online Package Manager
« Reply #2085 on: November 06, 2021, 11:59:04 am »
After installing the Laz v2.2RC2 and adjusting my usual settings, I noticed that CSVDocument is included in OPM now - maybe it has been there for a long time, I did not notice.

CSVDocument, however, is already included in the standard FPC installations (folder packages/fcl-base) where it is maintained (last bug fix 2 years ago) while the CCR version from which the OPM version originates has seen its last change in 2014.

To avoid confusion I'd strongly vote for removing CSVDocument from OPM.

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #2086 on: November 07, 2021, 08:02:11 am »
Hello GetMem !!! update please Ray4Laz

https://github.com/GuvaCode/Ray4Laz
Done. Thanks for the new version.


After installing the Laz v2.2RC2 and adjusting my usual settings, I noticed that CSVDocument is included in OPM now - maybe it has been there for a long time, I did not notice.

CSVDocument, however, is already included in the standard FPC installations (folder packages/fcl-base) where it is maintained (last bug fix 2 years ago) while the CCR version from which the OPM version originates has seen its last change in 2014.

To avoid confusion I'd strongly vote for removing CSVDocument from OPM.
I received CSVDocument via the Submit button(OPM->Options->Create Repository Package->Submit). I have no idea who sent it. I removed now to avoid confusion. Thanks!

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1088
  • Professional amateur ;-P
I need GetMem to clarify this one...
« Reply #2087 on: November 09, 2021, 11:54:54 pm »
Hey GetMem,

I was having a discussion about building a CLI version of a package manager on a Discord server and, obviously, the question arose: You can use the OPM JSON data to base that CLI on.

So, please could you share what were you smoking when you decided to implement this:
Code: Javascript  [Select][+][-]
  1. {
  2.   "PackageData0" : {
  3.     "Name" : "Abbrevia",
  4.     "DisplayName" : "Abbrevia",
  5.     "Category" : "Other",
  6.     "CommunityDescription" : "Compression toolkit. Supports PKZip, CAB, tar, gzip, bzip2, zlib formats, and the creation of self-extracting executables.",
  7.     "ExternalDependecies" : "",
  8.     "OrphanedPackage" : 0,
  9.     "RepositoryFileName" : "Abbrevia.zip",
  10.     "RepositoryFileSize" : 1746862,
  11.     "RepositoryFileHash" : "00cce6329d1f283b8f8b0884d87334d5",
  12.     "RepositoryDate" : 4.3096719915462963E+004,
  13.     "PackageBaseDir" : "Abbrevia\\/",
  14.     "HomePageURL" : "http://tpabbrevia.sourceforge.net/",
  15.     "DownloadURL" : "",
  16.     "SVNURL" : ""
  17.   },
  18.   "PackageFiles0" : [
  19.     {
  20.       "Name" : "abbrevia.lpk",
  21.       "Description" : "Abbrevia: Advanced data compression toolkit\r\n  http://tpabbrevia.sourceforge.net",
  22.       "Author" : "Abbrevia Group",
  23.       "License" : "Mozilla Public License (MPL) 1.1",
  24.       "RelativeFilePath" : "packages\\/Lazarus\\/",
  25.       "VersionAsString" : "5.0.0.0",
  26.       "LazCompatibility" : "1.8.0, 1.8.2, 1.8.4, 1.8.5, 2.0.0, 2.0.2, 2.0.4, 2.0.6, Trunk",
  27.       "FPCCompatibility" : "3.0.0, 3.0.2, 3.0.4",
  28.       "SupportedWidgetSet" : "win32/win64, gtk2, carbon",
  29.       "PackageType" : 0,
  30.       "DependenciesAsString" : "LCL, FCL(1.0)"
  31.     }],
  32. /* etc, etc */
  33. }

Instead of something more like this:
Code: Javascript  [Select][+][-]
  1. [
  2.   {
  3.     "Name" : "Abbrevia",
  4.     "DisplayName" : "Abbrevia",
  5.     "Category" : "Other",
  6.     "CommunityDescription" : "Compression toolkit. Supports PKZip, CAB, tar, gzip, bzip2, zlib formats, and the creation of self-extracting executables.",
  7.     "ExternalDependecies" : "",
  8.     "OrphanedPackage" : 0,
  9.     "RepositoryFileName" : "Abbrevia.zip",
  10.     "RepositoryFileSize" : 1746862,
  11.     "RepositoryFileHash" : "00cce6329d1f283b8f8b0884d87334d5",
  12.     "RepositoryDate" : 4.3096719915462963E+004,
  13.     "PackageBaseDir" : "Abbrevia\\/",
  14.     "HomePageURL" : "http://tpabbrevia.sourceforge.net/",
  15.     "DownloadURL" : "",
  16.     "SVNURL" : ""
  17.     "Files": [
  18.       {
  19.         "Name" : "abbrevia.lpk",
  20.         "Description" : "Abbrevia: Advanced data compression toolkit\r\n  http://tpabbrevia.sourceforge.net",
  21.         "Author" : "Abbrevia Group",
  22.         "License" : "Mozilla Public License (MPL) 1.1",
  23.         "RelativeFilePath" : "packages\\/Lazarus\\/",
  24.         "VersionAsString" : "5.0.0.0",
  25.         "LazCompatibility" : "1.8.0, 1.8.2, 1.8.4, 1.8.5, 2.0.0, 2.0.2, 2.0.4, 2.0.6, Trunk",
  26.         "FPCCompatibility" : "3.0.0, 3.0.2, 3.0.4",
  27.         "SupportedWidgetSet" : "win32/win64, gtk2, carbon",
  28.         "PackageType" : 0,
  29.         "DependenciesAsString" : "LCL, FCL(1.0)"
  30.       }
  31.     ]
  32.   },
  33. /* etc etc */
  34. ]

Or something that made a bit more sense with an array of choices and not an object with infinite members that have a number at the end to signify index?

Just wanted to ask this because we all thought the JSON was rather strangely conceived :)

Cheers,
Gus

PS: Please don't take this the wrong way!!
I respect your work and I publicise it as often as I can cuz what you do for free is rather invaluable!!!
Take this with a pinch of salt and in a banter kind of context :)
« Last Edit: November 10, 2021, 02:30:27 am by Gustavo 'Gus' Carreno »
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #2088 on: November 10, 2021, 07:00:22 am »
@Gustavo 'Gus' Carreno

Quote
So, please could you share what were you smoking when you decided to implement this
I don't smoke, but maybe I was drunk.  :D

Quote
Or something that made a bit more sense with an array of choices and not an object with infinite members that have a number at the end to signify index?
It makes sense to me, the JSON is directly parsed into an object, instance of a class to be more precise. Please take a look at opkman_serializablepackages.pas for more details. The number in the end makes the JSON validators happy, like this one: https://jsonlint.com/.

Quote
Just wanted to ask this because we all thought the JSON was rather strangely conceived
I can't argue with that. It's a valid JSON and is fast enough for OPM.

Quote
PS: Please don't take this the wrong way!!
I respect your work and I publicise it as often as I can cuz what you do for free is rather invaluable!!!
Take this with a pinch of salt and in a banter kind of context :)
No problem. Constructive criticism is always good.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1088
  • Professional amateur ;-P
Re: Online Package Manager
« Reply #2089 on: November 11, 2021, 02:34:39 am »
Hey GetMem,

I don't smoke, but maybe I was drunk.  :D

LOL :D Touché :D

It makes sense to me, the JSON is directly parsed into an object, instance of a class to be more precise. Please take a look at opkman_serializablepackages.pas for more details. The number in the end makes the JSON validators happy, like this one: https://jsonlint.com/.

Of course it makes sense to you, LOL, you were the one that came up with it, eheheh!!!

Nonetheless, making an object with infinite members is just odd when you could just have an array of objects.
This array of objects could then be nicely un-marshaled into a TObjectList, or a TFPObjectList or even using generics a TFPGObjectList.
It then can be tracked so much easily with an index on the Items default property. It even marries well with the ItemIndex of a TListBox or any other component that will have a corresponding thing.
I've been doing a ton of marshaling and un-marshaling of JSON and I welcome the nicety of an array of objects getting translated to a collection of Objects in Pascal.
Your solution works, obviously, but I'm guessing that you never considered that your JSON would be used by anyone but yourself, which, again, is rather understandable :)

I will, eventually, have a look at opkman_serializablepackages.pas, cuz I need to finish my setup-lazarus GitHub action to implement dependencies and multi-packages. ATM its failing rather embarrassingly on that aspect.
Maybe before I complete the setup-lazarus GH Action, I'll probably write a bit of code that will translate your massive Father Object into a TFPObjectList of custom made Object Pascal classes that will support your JSON data in a manner that is more bag of objects, than object of objects, if that makes sense :)

And this translation work could be the beginning of a command line package manager. Maybe opm-cli or something of the sorts :)

There's a person on the Discord server that really doesn't like Lazarus. He prefers VS Code/Vim cuz for his needs the GUI is un-welcomed. He proclaims to be a CLI man only :)
There is already a Python command only package manager, called LPM(Lazarus Package Manager), made by Warfley, that has the option to use your JSON data and can also get stuff from GitHub, but a native Object Pascal solution wouldn't be a bad thing, right?

No problem. Constructive criticism is always good.

I'm so glad you took it that way, cuz it is what I intended ;)

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: Online Package Manager
« Reply #2090 on: December 02, 2021, 06:21:16 pm »
GetMem, could you please update the JVCLLaz packages in OPM. The new version, 1.0.7, is a bug fix because there was a compilation issue with Laz 2.0.x (https://sourceforge.net/p/lazarus-ccr/bugs/49/).

zip file: https://sourceforge.net/projects/lazarus-ccr/files/jvcllaz/jvcllaz-1.0.7.zip/download
update json: https://sourceforge.net/projects/lazarus-ccr/files/jvcllaz/OPM/update_jvcllaz.json/download

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #2091 on: December 02, 2021, 06:41:20 pm »
@wp

Done. Thanks for the new version.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: Online Package Manager
« Reply #2092 on: December 04, 2021, 09:46:02 pm »
Hi, GetMan!

Please, can "OPM" get LAMW packages  directly from this link: 

https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip

So we could avoid some noise.... [keeping it synchronized]


Thank you!
« Last Edit: December 05, 2021, 03:21:14 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

dsiders

  • Hero Member
  • *****
  • Posts: 1045
Re: Online Package Manager
« Reply #2093 on: December 05, 2021, 12:28:24 am »
Hi, GetMan!

Please, can "OPM" get LAMW packages  directly from this link: 
https://github.com/jmpessoa/lazandroidmodulewizard/archive/refs/heads/master.zip
So we could avoid some noise....
Thank you!

A couple of suggestions:

Create a tagged release. This will give him a specific target to pull, and not just the head of your repository. https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases

Create an update_lamw.json file that OPM can publish for you.

Reduce the noise for GetMem too.

 
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: Online Package Manager
« Reply #2094 on: December 05, 2021, 01:45:18 am »
Hi, dsiders!

Yes,  if need by OPM I can "create a targed release"
(although at the current stage of development LAMW only exists while "master")

My doubt is how difficult [and costly] to GetMan handle  frequent update requests

for  the file  "update_lamw.json"


Can you explain to me how this process works?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

dsiders

  • Hero Member
  • *****
  • Posts: 1045
Re: Online Package Manager
« Reply #2095 on: December 05, 2021, 03:26:06 am »
Hi, dsiders!

Yes,  if need by OPM I can "create a targed release"
(although at the current stage of development LAMW only exists while "master")

My doubt is how difficult [and costly] to GetMan handle  frequent update requests

for  the file  "update_lamw.json"


Can you explain to me how this process works?

Not really. I would defer to GetMem for that. But I can in the .json files that it identifies the packages affectedm theior version number, and the url where the "release" can be downloaded. That has to make it easier than it would be without it.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #2096 on: December 05, 2021, 06:04:44 pm »
Hi jmpessoa,

Unfortunately trunk/main versions may contain bugs and the bug tracker will be flooded with issues about third party packages. Actually this already happened in the past, so it was decided(not by me), that OPM should only target stable version of a particular package. Package maintainers however, can push a newer version via the "external update" feature(see image1). There is a catch though, in order for the external update to work, you have to enable it from options(see image2). It's disabled by default because some users did not like the fact the OPM connects to various sites. So even if you create a target release and an update json, novice users most likely wouldn't be able to update, because they are not familiar with the procedure. The situation is far from ideal, but until a new update method is developed we have to cope with the current system.
In my opinion the best solution is(for now) to update the packages manually, it only takes about 3-5 minutes for me. All you have to do is to leave a message here and I will update the package in 24 hours, except weekends.
« Last Edit: December 05, 2021, 08:38:16 pm by GetMem »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: Online Package Manager
« Reply #2097 on: December 05, 2021, 07:41:27 pm »
Quote
In my opinion the best solution is(for now) to update the packages manually, it only takes about 3-5 minutes for me...

Accepted!

I will try to bother only in case of critical situations or important developments.

Thank you very much!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

balazsszekely

  • Guest
Re: Online Package Manager
« Reply #2098 on: December 05, 2021, 09:10:55 pm »
@jmpessoa
Quote
Accepted!

I will try to bother only in case of critical situations or important developments.

Thank you very much!
You're welcome! I updated LAMW a few minutes ago. Thanks for the new version.

funlw65

  • Full Member
  • ***
  • Posts: 148
    • Visual Pin Configurator for Nucleo 64pin boards
Re: Online Package Manager
« Reply #2099 on: December 17, 2021, 04:34:36 pm »
Ray4Laz 4.0 needs a (re)update as the author added support for physac.h and raygui.h, changed the name of the units to reflect the original names of the C library, modified all examples to reflect the changes and added two more examples.

So, it is still version 4.0 but this time is complete. Thank you very much!

BTW, at this version, the C library of raylib needs some attention from the user regarding configuration, to include the raygui and physac modules in the generated library...
Ray4Laz 4 assumes that the user did this already.
FreePascal 3.2.2, C 10.2.1, D 1.24 under Linux(init,musl,glibc), DragonflyBSD, NetBSD
gui: gtk2, qt5, raylib4.x+raygui3.x, nanovg 
tui: freevision, tvision2, termbox2+widgets, finalcut
db: typhoon-1.11...

 

TinyPortal © 2005-2018