-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
{ # https://stackoverflow.com/a/21100710 | ||
|
||
## Re-generate the buildkit.nix file - with the current 'master' branch. | ||
|
||
set -e | ||
|
||
if [ ! -f "nix/buildkit.nix" ]; then | ||
echo >&2 "Must run in project root" | ||
exit 1 | ||
fi | ||
|
||
now=$( date -u '+%Y-%m-%d %H:%M %Z' ) | ||
commit=$( git ls-remote https://github.com/civicrm/civicrm-buildkit.git | awk '/refs\/heads\/master$/ { print $1 }' ) | ||
url="https://github.com/civicrm/civicrm-buildkit/archive/${commit}.tar.gz" | ||
hash=$( nix-prefetch-url "$url" --type sha256 --unpack ) | ||
|
||
function render_file() { | ||
echo "{ pkgs ? import <nixpkgs> {} }:" | ||
echo "" | ||
echo "## Get civicrm-buildkit from github." | ||
echo "## Based on \"master\" branch circa $now" | ||
echo "import (pkgs.fetchzip {" | ||
echo " url = \"$url\";" | ||
echo " sha256 = \"$hash\";" | ||
echo "})" | ||
echo | ||
echo "## Get a local copy of civicrm-buildkit. (Useful for developing patches.)" | ||
echo "# import ((builtins.getEnv \"HOME\") + \"/buildkit/default.nix\")" | ||
echo "# import ((builtins.getEnv \"HOME\") + \"/bknix/default.nix\")" | ||
} | ||
render_file > nix/buildkit.nix | ||
|
||
exit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
## Get civicrm-buildkit from github. | ||
## Based on "master" branch circa 2023-08-22 10:32 UTC | ||
import (pkgs.fetchzip { | ||
url = "https://github.com/civicrm/civicrm-buildkit/archive/04b338a52bbf0bdc21edafe564b875138c1db12c.tar.gz"; | ||
sha256 = "1r6m830lyv6xf0yxz392izhwlnbahhc7s4r71riyqryzkr6psfyd"; | ||
}) | ||
|
||
## Get a local copy of civicrm-buildkit. (Useful for developing patches.) | ||
# import ((builtins.getEnv "HOME") + "/buildkit/default.nix") | ||
# import ((builtins.getEnv "HOME") + "/bknix/default.nix") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters