Re: cygport build/package issues
Thomas Wolff via Cygwin-apps <[email protected]> Thu, 25 Sep 2025 03:09:12 +0200
| Newsgroups | gmane.os.cygwin.applications |
|---|---|
| Message-ID | <[email protected]> |
Am 24.09.2025 um 21:22 schrieb Brian Inglis via Cygwin-apps:
> On 2025-09-23 16:08, Thomas Wolff via Cygwin-apps wrote:
>>
>>
>> Am 20.09.2025 um 19:07 schrieb Thomas Wolff via Cygwin-apps:
>>>
>>> Am 20.09.2025 um 00:37 schrieb Brian Inglis via Cygwin-apps:
>>>> On 2025-09-19 10:24, Thomas Wolff via Cygwin-apps wrote:
>>>>>
>>>>>
>>>>> Am 18.09.2025 um 05:32 schrieb Brian Inglis via Cygwin-apps:
>>>>>> On 2025-09-16 15:42, Thomas Wolff via Cygwin-apps wrote:
>>>>>>> questions for a new package:
>>>>>>> * Is there a way to specify a git clone for download rather
>>>>>>> than a download URI?
>>>>>>
>>>>>> See:
>>>>>>
>>>>>> https://cygwin.github.io/cygport/git_cygclass.html
>>>>>>
>>>>>> for example:
>>>>>>
>>>>>> GIT_URI=https://github.com/$NAME/$NAME
>>>>>> GIT_BRANCH=$NAME
>>>>>> GIT_TAG=v$VERSION
>>>>>> GIT_REV=
>>>>>>
>>>>>> inherit git
>>>>>>
>
>>>>>>> * Is there a way to specify files (like the build script in this
>>>>>>> case)
>>>>>>> to be included in the source package?
>>>>>> SRC_URI+=" https://..."
>>>>>> SRC_URI+=" filename"
>>>>>>
>>>>>> The intent is for all packages to be built using cygport to
>>>>>> support CI and any policies and approaches desired, and automate
>>>>>> a *LOT* of any grunt work commonly required!
>>>>>>
>>>>>> The desire is to eventually have validated deployments only via
>>>>>> cygport, scallywag, and calm, or successors.
>>>>>>
>>>>>> Post the build script, or a link to the package definition, spec,
>>>>>> ebuild, etc. on other distros or sites, for advice, suggestions,
>>>>>> and help porting it to cygport.
>>>>>>
>>>>> Thanks for the SRC_URI+= hint. The GIT_URI, GIT_TAG hint did not
>>>>> work, nothing was downloaded. Also it's a huge repository and I'd
>>>>> prefer shallow clone (-- depth 1) and sparse checkout.
>
>> Actually, the SRC_URI trick fixes the package step but spoils the
>> prep step:
>> /bin/cp: failed to access 'emojis-noto-v2.051-1.noarch': No such file
>> or directory
>> *** ERROR: cp -t emojis-noto-v2.051-1.noarch getnoto failed
Which it does while in subdirectory origsrc but it did not copy the
scripts there before. Looks like a bug for me.
>
> Using git.cygclass also handles conversion to tar used as SRC_URI and
> fixing up the SRC_DIR.
> > Bundling a build script with the cygport does not seem to be
> supported. It could
>> be injected as a patch perhaps.
>> As the two scripts are actually also part of mintty, I guess I'll add
>> them as a downloadable source.
> After `inherit git`, you could add:
inherit git only works with GIT_URI set, but I don't have one (for the
sparse checkout issue...)
>
> MINTTY=https://github.com/mintty/mintty/raw/refs/heads/master/tools/
> SRC_URI+=" $MINTTY/getnoto "
>
> or
>
> MINTTY_TOOLS=https://github.com/mintty/mintty/raw/refs/heads/master/tools/
>
> SRC_URI+=" $MINTTY_TOOLS/getnoto "
>
> and so on, or local file:// equivalents, or use git submodules.
>
>>>> Cygport git cygclass defaults to --depth 1, and retries without if
>>>> that fails because shallow clones are not supported by the
>>>> upstream, after issuing a message to that effect.
>>>>
>>>>> I've uploaded a source package of my proposed package to
>>>>> http://towo.net/ cygwin/ emojis-noto-v2.048-1-src.tar.xz for
>>>>> consideration.
>
> It is usual to attach the .cygport as text/plain so we don't have to
> download and unpack the tar to be able to comment.
Attaching my current work version here.
>
>>>> Did you notice the `inherit git` *AFTER* the definitions hint above?
>
>>> No, thanks. However, that still does not give me sparse (partial)
>>> checkout.
>
> It does use --depth 1: you could define your own git() { ... }
> function in your .cygport(s) to add --sparse after "$@" if $@[1] ==
> clone, although I don't *KNOW* that git uses or supports GNU style
> flexible getopt?
> It could also DTRT on checkout, submodule, and so on, if required.
Logging the git function shows it's calling git submodule update (what's
the purpose of that?) and hanging there.
>
>>> Also it seems to stall after checkout:
>>> git checkout tags/v2.051
>>> Updating files: 100% (20100/20100), done.
>>> HEAD is now at 8998f5dd Merge pull request #515 from googlefonts/e17
>>> - then nothing; waited for 5 min.
>
> It does take a while to tar ~0.5GB, and unpack and copy that into
> ~1.5GB {origsrc,src,temp} of repo, which if installed and packaged
> could become ~2.5GB workspace!
Why should it tar the download to copy it over to src or where else;
sure it's doing that?
>
>>>> https://cygwin.github.io/cygport/git_cygclass.html#git.cygclass
>>>>
>>>> Also `inherit font` gives you font cygclass functions to store
>>>> fonts in the appropriate places for use by *ALL* Cygwin apps newer
>>>> than those supporting only legacy Adobe types.
>
>>> I assigned this package to the Fonts category but it's not really a
>>> font...
>
> Then set it to "Shells Graphics" perhaps instead, as Cygwin seems to
> categorize terminal emulators as "Shells".
Maybe just "Shells" then, as there are no data packages in Graphics.
>
>>>> https://cygwin.github.io/cygport/git_cygclass.html#git.cygclass
>>>>
>>>> Note the existing package, whose cygport would need some tweaks to
>>>> get up to date since 2017:
>>>>
>>>> https://cygwin.com/cgit/cygwin-packages/noto-emoji-fonts
>
>>> My proposed package does not replace the other one; it does not
>>> provide the font but the emoji graphics (.png files) as used by mintty.
>
> You may then want to select only some resolution(s) of some glyph
> variations (single codepoint only?) and convert to usable size and
> more compact format such as webp using say ImageMagick `mogrify -path
> webp -format webp svg/*.svg` which shrinks svg from 40MB to 16MB,
> png/512 from 100MB to 40MB, and similar.
Right now I'm selecting the 128x128 resolution png files which I
consider suitable.
emojis-noto.cygport
(text/plain, 1.3 KB)
NAME="emojis-noto"
SUMMARY="graphic emojis from Google Noto Emoji font, enables mintty emojis"
DESCRIPTION="Google Noto Emoji graphic images for shared installation."
LICENSE=Apache-2.0
#CATEGORY="Fonts"
CATEGORY="Shells"
#CATEGORY="Shells Graphics"
HOMEPAGE="https://github.com/googlefonts/noto-emoji"
VERSION=v2.051
RELEASE=1
ARCH=noarch
SRC_DIR="emojis-noto-$VERSION-$RELEASE.$ARCH"
# git "download" would also provide shallow clone but not sparse checkout,
# also it fails to finish, so use the git download in script getnoto below
#GIT_URI="https://github.com/googlefonts/noto-emoji.git"
#GIT_TAG=$VERSION
#inherit git
#SRC_URI+=" getnoto getflags"
# this fails:
inherit git
tools=https://raw.githubusercontent.com/mintty/mintty/refs/heads/master/tools
SRC_URI="$tools/getnoto $tools/getflags"
BUILD_REQUIRES=""
REQUIRES=""
git() {
echo ------------ cygport calling git $*
/bin/git "$@"
}
src_compile() {
cd ${B}
# the getnoto script downloads the repository
# using shallow clone and sparse checkout
# to limit download and storage volume
../../getnoto --tag ${VERSION}
# getnoto also calls the script getflags to transform
# flags emojis filenames to a format searchable by
# Unicode codepoint sequences
}
src_install() {
cd ${B}
insinto /usr/share/emojis/common
doins common/*.png
insinto /usr/share/emojis/noto
doins noto/*.png
}