Skip to content

Conversation

@dot-asm
Copy link
Collaborator

@dot-asm dot-asm commented Nov 2, 2023

Compile latest release tag and install it as pkg-config package.

@dot-asm
Copy link
Collaborator Author

dot-asm commented Nov 2, 2023

To give it a shot execute following commands

mkdir -p /tmp/foo/include
mkdir -p /tmp/foo/lib/pkgconfig
curl -sSf https://raw.githubusercontent.com/dot-asm/blst/pkg-install.sh/build/pkg-install.sh | env PKG_CONFIG_PATH=/tmp/foo/lib/pkgconfig sh`

Examine /tmp/foo tree structure and cleanup as deemed appropriate.

@arrowd
Copy link

arrowd commented Jan 28, 2024

Bumped into this when porting libblst to FreeBSD. For now I just added my own .pc file to the downstream package, so it'd be great to have this PR merged in.

git clone ${SRC:-"https://github.com/supranational/blst"} blst.$$
( trap '[ $? -ne 0 ] && rm "${DST}/blst.pc" 2>/dev/null' 0
cd blst.$$
tag=`git tag --sort=v:refname | tail -1`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git tag version is currently v0.3.16 and the leading v messes up version comparisons.

I had to modify that line to:

  tag=`git tag --sort=v:refname | tail -1 | sed "s/^v//"`

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the next line. I've pushed a fixup...

@erikd
Copy link

erikd commented Oct 2, 2025

So glad to have found this. Saved me at least half an hour.

Compile latest release tag and install it as pkg-config package.
cd ${TMPDIR:-/tmp}

trap 'rm -rf blst.$$' 0
git clone ${SRC:-"https://github.com/supranational/blst"} blst.$$
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please have a way to override invoking git via env vars?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I genuinely don't understand. What is the goal? Why specifically via environment variables? Note that git is used to figure out version...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to package blst in a downstream project (FreeBSD). Package building infrastructure usually disable any networking access during the build, so in this case I'd need a way to prevent this script from calling git.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $SRC is assigned, it's a local directory, so that git won't use network.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still has to be a git repository. At least RPM and FreeBSD ports do not usually use git to fetch the distribution files, so in these contexts there would be no git repo at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FreeBSD ports do not usually use git to fetch the distribution files,

But they have to use something and hence they could use git. Yes, it would be unusual, but in the essence it's just a download.

Again, the suggested script uses git for unambiguous versioning while also preserving custody. It's argued that it's reasonable trade-off for the unconventional download method.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are common and established ways to build software (meson, CMake, git tags and GitHub releases, etc.), which are easily connected to downstream package building infrastructures. When a project goes its own way with custom building scripts it immediately makes it much harder to be properly packaged. But that's my problem anyways, so do whatever you want.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants