Iosevka icon indicating copy to clipboard operation
Iosevka copied to clipboard

building from source on linux (trying to create an official debian package)

Open alexmyczko opened this issue 3 years ago • 14 comments

The problem is npm during build downloads stuff. How easy would it be to turn the downloads off and still use the same build system? How hard to switch to another build system?

http://sid.ethz.ch/debian/fonts-iosevka/

(Debian builds may not access internet during build)

alexmyczko avatar Nov 05 '20 13:11 alexmyczko

Fontship would be one alternative build system for this, but that isn't packaged on Debian yet either. The build tooling for this repo is considerably more complicated than your average Font repo. Switching it out for something else will not be trivial.

NPM allows for offline usage by specifying a module cache dir and warming it up with the necessary packages in a pre-build step, then builds can happen offline. I know Debian does this for other packages (as does Arch Linux).

alerque avatar Nov 05 '20 13:11 alerque

Ok fontship you say here we go fontship -V says fontship v0.6.2, it was fun to build from source... with npm build i'd download one half of the internet, and to build fontship (cargo) it would download the other half of the internet.

ok, now what?

alexmyczko avatar Nov 06 '20 11:11 alexmyczko

Ha ha. You forgot about the half that pip would need to download ;-)

Now what? This font project isn't arranged quite right to use it yet. Someday I'll look at porting the current build rules for the various flavors of the font to Fontship rules. I wasn't proposing you could build this font with it now, just that it is an alternative build system that could be considered for the project. Just like many C++ projects could be built with either CMake or GNU Make or Meson but projects typically only support one of the above, so for font projects. Most projects use totally hand baked (or copy pasted) build scripts and a hodge-podge of Python stuff. With Fontship I'm trying to organize that a bit into best practices for automated font builds so that a bunch of Mac based designer types don't have to keep re-inventing the wheel on the code side.

This font project is a bit more advanced than most though, so it's not the one I'm starting with.

alerque avatar Nov 06 '20 12:11 alerque

Well, this font is just a huge Node.Js program that generates TTF, and all the geometries are procedurally generated. It may be possible to do a rollup for all the JS it depends into a single file, and calling it via CLI or a thin wrapper. Put into 4.x.

be5invis avatar Nov 06 '20 17:11 be5invis

I would only need to build ttf with autohint, or better otf but i could not find otf building support..

how likely would it fit before end of year to match https://release.debian.org/bullseye/freeze_policy.html ?

alexmyczko avatar Nov 06 '20 17:11 alexmyczko

@alexmyczko I do not think I have enough bandwidth on that.

be5invis avatar Nov 06 '20 17:11 be5invis

meanwhile i missed the bookworm freeze, while others have it https://repology.org/project/fonts:iosevka/versions

and my sid.ethz.ch repo has 22.0.0 now

for reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973995

alexmyczko avatar Mar 07 '23 20:03 alexmyczko

meanwhile i missed the bookworm freeze, while others have it https://repology.org/project/fonts:iosevka/versions

and my sid.ethz.ch repo has 22.0.0 now

The link from the Iosevka README.md goes to phd-sid.ethz.ch which is stuck on version 7. Is that fixable? Thanks!

hackerb9 avatar Mar 16 '24 00:03 hackerb9

@hackerb9 the link really is sid.ethz.ch, please don't call it phd-sid (this is an internal name that can change any time, i'm not authority for it, but sid is mine)

Anyways, the main problem is that our web server is not configured to sort the way convenient for human beings, but if you do this:

links2 -dump sid.ethz.ch/debian/fonts-iosevka |sort -V

it's a bit better and shows there's packaging for 22.0.0. for transparency and efficiency (not wasting time removing old stuff), i keep old stuff around (which i look up for reasons)

HTH

alexmyczko avatar Mar 20 '24 05:03 alexmyczko

Okay. I think I understand now.

The README for Iosevka directly links to phd-sid. The code reads:

 * Ubuntu Linux: Install one of the [fonts-iosevka packages](http://phd-sid.ethz.ch/debian/fonts-iosevka/).

Is it worth filing a new issue for this with the Iosevka project?

(By the way, thank you for creating a Debian package! I hope it gets accepted into the official repository soon.)

hackerb9 avatar Mar 25 '24 01:03 hackerb9

https://github.com/be5invis/Iosevka/issues/715#issuecomment-723037191

it will not unless someone fixes ghe building part. building is building, not downloading stuff from internet (forbidden).

alexmyczko avatar Mar 25 '24 02:03 alexmyczko

#715 (comment)

it will not unless someone fixes the building part. building is building, not downloading stuff from internet (forbidden).

While I certainly would prefer a package that generates the font, I thought that wasn't a strict requirement for Debian. For example, fonts-terminus (which is under the SIL Open Font License) just copies the .ttf.

The Debian Font Packaging Policy Wiki does not directly mention building but does link to a draft of a Debian fonts-policy which reads:

Generation of binary packages

To preserve the forms of the fonts as intended by the original authors, packagers MAY opt, for fonts distributed in a final, usable form (e.g., .ttf, .otf etc.), to ship those files in the binary packages, without any build step.

For packages that only provide sources in Fontforge's format, custom scripts MAY be used, if upstream does not provide them.

Despite the suggestion of shipping fonts that are as close as possible to what upstream ships, some manipulation is allowed and even encouraged, for the removal of glyphs for reduction of the size to fit in installation media.

In any case, the package SHOULD clearly state that the font was manipulated in the README.Debian file of the generated binary package.

Would it be possible to release an interim package using the binary files, at least until the building part works?

hackerb9 avatar Mar 26 '24 21:03 hackerb9

Yes that is absolutely possible, but then I prefer the fnt tool which works on Debian and macOS, and according the issues there is a plan to have own sources as in any URL... https://github.com/alexmyczko/fnt

I will need some time, what is frustrating is building it from source is good, but I don't remember what was not good about it. It can not easily be fixed?

alexmyczko avatar Mar 26 '24 22:03 alexmyczko

If you look into the DistUnhintedTTF recipe in verdafile you could find it eventually does a "function call" to packages/font/src/index.mjs with some parameters as a JSON object. Maybe you can try capture it and call it with a bundled version of packages/font/src/index.mjs...

(But, well I am not good at dealing with bundlers, so you may need to write a github action that syncs Iosevka and creates the bundled JS file.)

be5invis avatar Mar 27 '24 00:03 be5invis