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

packaging: Add Nix files for creating development environment and the package #3889

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

imincik
Copy link
Contributor

@imincik imincik commented Jun 18, 2024

Add couple of Nix files which will allow following:

  • Create full development environment using single command
  • Run GRASS from any GitHub revision

Nix installation

curl --proto '=https' --tlsv1.2 -sSf \
    -L https://install.determinate.systems/nix \
    | sh -s -- install

GRASS development environment

  • Run following command in source code root directory
nix develop
  • Optionally, use direnv to activate the environment automatically when
    moving to the source code directory
echo "use flake" > .envrc
direnv allow

Running GRASS directly from the source code

  • Run latest version from main branch
nix run github:OSGeo/grass#grass -- --text
  • Run version from specific Git branch
nix run github:OSGeo/grass/<GIT-BRANCH>#grass -- --text
  • Run version at specific Git revision
nix run github:OSGeo/grass/<GIT-REVISION>#grass -- --text

Usage documentation will be added to https://grasswiki.osgeo.org/wiki/Compile_and_Install

.gitignore Show resolved Hide resolved
@imincik imincik changed the title Add Nix files for creating development environment and the package dev: Add Nix files for creating development environment and the package Jun 18, 2024
@imincik imincik force-pushed the nixfile branch 4 times, most recently from 816549f to 1efcc84 Compare June 18, 2024 18:30
@imincik imincik marked this pull request as ready for review June 18, 2024 18:31
@imincik imincik requested a review from echoix June 18, 2024 18:49
@imincik
Copy link
Contributor Author

imincik commented Jun 18, 2024

@neteler , I think, this PR is good to go now.

@imincik imincik force-pushed the nixfile branch 3 times, most recently from acc20f3 to 2fa1f99 Compare June 19, 2024 09:09
echoix
echoix previously approved these changes Jun 19, 2024
@echoix
Copy link
Member

echoix commented Jun 20, 2024

@wenzeslaus what PR prefix is appropriate? Should this one be added too? Nix? Build?

@imincik imincik changed the title dev: Add Nix files for creating development environment and the package packaging: Add Nix files for creating development environment and the package Jun 20, 2024
@imincik
Copy link
Contributor Author

imincik commented Jun 20, 2024

I changed commit prefix to packaging.

@echoix
Copy link
Member

echoix commented Jun 20, 2024

Perfect!

@echoix echoix merged commit beda5b3 into OSGeo:main Jun 20, 2024
24 of 25 checks passed
@imincik
Copy link
Contributor Author

imincik commented Jun 20, 2024

And here we go, nix run github:OSGeo/grass#grass (latest dev version) on my Ubuntu machine:

grass-nix-run

/cc @landam @wenzeslaus @neteler

@echoix
Copy link
Member

echoix commented Jun 20, 2024

Isn't the (exported) in the version expected to be filled in from git info since a couple of months ago? I think this is the fallback.

@imincik
Copy link
Contributor Author

imincik commented Jun 20, 2024

Isn't the (exported) in the version expected to be filled in from git info since a couple of months ago? I think this is the fallback.

I think this kind of version detection from git can't work for Nix package.

@echoix
Copy link
Member

echoix commented Jun 20, 2024

If git and the git repo is available at configure time, it should be detected. Otherwise there were some changes made this winter/early spring for helping with reproducible builds

@imincik
Copy link
Contributor Author

imincik commented Jun 20, 2024

If git and the git repo is available at configure time

That's the issue. Git is not available during the build.

cyliang368 pushed a commit to cyliang368/grass that referenced this pull request Jun 22, 2024
imincik added a commit to imincik/grass that referenced this pull request Jun 24, 2024
@neteler neteler added this to the 8.5.0 milestone Jun 25, 2024
kritibirda26 pushed a commit to kritibirda26/grass that referenced this pull request Jun 29, 2024
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.

None yet

3 participants