Skip to content
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

Add Termux package repository #628

Closed
philippgille opened this issue Jun 1, 2018 · 17 comments
Closed

Add Termux package repository #628

philippgille opened this issue Jun 1, 2018 · 17 comments

Comments

@philippgille
Copy link

Termux is a very popular terminal app for Android and it has a package manager on its own. There are already lots of packages and you can install things like OpenSSH, Python, the Go compiler etc. without rooting the Android phone.

The packages are in this repository: https://github.com/termux/termux-packages

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 2, 2018

Duplicate of #406. Unfortunately there's still no machine readable metadata available.

@fornwall
Copy link
Contributor

fornwall commented Jun 8, 2018

@AMDmi3 Which kind of metadata is needed? The packages are provided in apt repositories (e.g. http://termux.net/dists/stable/main/binary-aarch64/Packages for aarch64) - is that enough or is more metadata needed?

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 8, 2018

Oh, I've missed that. The Debian repository format is suitable (and already supported), but binary repositories are not, because they contain subpackages (from -dev, -doc, -dbg to less predictable patterns) which require manual work to merge them back into projects, and architecture discrepancies (e.g. some package may not be available for some architectures, and pulling all architectures create too much noise).

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 9, 2018

@fornwall don't you have source packages? That would be usable. Otherwise if you're interested in repology support you could set up a regular dump of data extracted directly from build.sh files. This could be even better as it's possible to include TERMUX_PKG_SRCURL in there, which won't be available other way but repology could make use of it.

@fornwall
Copy link
Contributor

@AMDmi3 Thanks for the explanation! We don't have source packages at the moment, as the packages are cross-compiled with the NDK toolchain and many cannot be built on devices directly.

So a scheduled daily dump of data is probably the way forward now! I could set it up and publish it on an URL. Do you have a specification or similar how the data should be formatted?

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 11, 2018

Do you have a specification or similar how the data should be formatted?

Well I think that repositories should just publish complete metadata on their packages in any format convenient to them without adjusting to Repology, as it may be useful for other consumers, and Repology is fine with supporting any format. If you ask me, JSON is most widely supported and easily parsable, and the following structure is obvious for Termux, reflecting the fields of build.sh files:

[
  {
    "name": "gegl",
    "version": "0.4.2",
    "description": "Data flow based image processing framework",
    "homepage": "http://gegl.org/",
    "srcurl": "https://download.gimp.org/pub/gegl/0.4/gegl-0.4.2.tar.bz2",
    "depends": ["libandroid-support", "libmpfr", "libgmp", "readline"],
    "maintainer": "Fredrik Fornwall @fornwall"
  },
  {
    "name": ...
  },
  ...
]

note that Repology doesn't currently use depends, but other consumers may use it, and repology may support it in future.

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 18, 2018

@fornwall any progress?

@fornwall
Copy link
Contributor

@AMDmi3 I generated https://fornwall.net/termux-packages.json as a first attempt. What do you think about that file?

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 21, 2018

Looks mostly good, apart from couple minor problems:

  • It would be more consistent to just skip keys for nonexisting values instead of adding empty values (e.g. "srcurl": "").
  • Some versions are missing (dx, libc++, ndk-multilib, ndk-stl, ndk-sysroot). There seem to depend on external variables which are set in build-package.sh, I guess it is not sourced in the process of this .json generation.

Also, golang has version of 2:1.10.3. Is this an epoch? Is this format reliable, e.g. I could just drop everything up to semicolon?

AMDmi3 added a commit that referenced this issue Jun 21, 2018
Not enabled yet pending regular data dump.
@fornwall
Copy link
Contributor

@AMDmi3 Thanks! I've updated the file at https://fornwall.net/termux-packages.json to skip keys for empty values (and I'm looking at fixing srcurl for some packages). Also, I fixed the version missing on some packages.

Also, golang has version of 2:1.10.3. Is this an epoch? Is this format reliable, e.g. I could just drop everything up to semicolon?

Yes, the format is reliable, so just drop everything up to the semicolon!

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 22, 2018

dx still has empty version. And I forgot to mention, empty depends are actually OK and it's better to leave them there, as empty dependency list is a known valid value (while empty srcurl is not). Otherwise the termux support is ready to be enabled.

@fornwall
Copy link
Contributor

dx still has empty version

Thanks, fixed!

I forgot to mention, empty depends are actually OK and it's better to leave them there, as empty dependency list is a known valid value (while empty srcurl is not).

Ok, I've left empty dependency lists in now!

Otherwise the termux support is ready to be enabled.

Great! I've setup publishing of the package metadata to https://termux.net/dists/stable/packages.json now! Let me know if there are any problems.

@AMDmi3 AMDmi3 closed this as completed in e32b253 Jun 24, 2018
@AMDmi3
Copy link
Member

AMDmi3 commented Jun 24, 2018

It's in production, have fun!

@fornwall
Copy link
Contributor

Thanks a lot, very useful! Let me know if I can improve the package layout or metadata to be more useful for repology.

@AMDmi3
Copy link
Member

AMDmi3 commented Jun 26, 2018

The metadata is good. If I may suggest to the build.sh file format though, I'd add dedicated field for the epoch. It would be more explicit and it will simplify parsing (e.g. version can be extracted without string manipulation logic).

Regarding the packages, you can look at this list. Brown ones are supposedly fake versions which could be fixed in the repo (unless I marked them incorrectly). Others are (more or less apparently looking like) snapshots and are tolerable, see #345 for more on this.

There's also a bunch of renames, of which I particularly don't like espeak -> espeak-ng espeak-ng which are related, but different projects. Maybe also non-that-common name little-cms for lcms2.

@AMDmi3
Copy link
Member

AMDmi3 commented Nov 19, 2019

@fornwall Hi, termux-packages.json seem to lack information on which repository the package comes from. E.g. vim-gtk seem to come from https://github.com/termux/x11-packages, but there's no way of knowing that. Because of that, Repology cannot construct working link to package sources. Could such information be included?

@AMDmi3
Copy link
Member

AMDmi3 commented Jan 20, 2022

@fornwall json is currently broken:

  ...
  {
    "name": "2048-c",
    "version": "2021.04.22",
    "description": "Console version of the game "2048" for GNU/Linux",
    "homepage": "https://github.com/mevdschee/2048.c",
    "depends": [],
    "srcurl": "https://github.com/mevdschee/2048.c.git",
    "maintainer": "@termux"
  },
  ...

See also the previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants