uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
68
pkgs/applications/networking/misc/zammad/update.sh
Executable file
68
pkgs/applications/networking/misc/zammad/update.sh
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -gt 2 ] || [[ "$1" == -* ]]; then
|
||||
echo "Regenerates packaging data for the zammad packages."
|
||||
echo "Usage: $0 [package name] [zammad directory in nixpkgs]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION=$(curl -s https://ftp.zammad.com/ | grep -v latest | grep tar.gz | sed "s/<a href=\".*\">zammad-//" | sort -h | tail -n 1 | awk '{print $1}' | sed 's/.tar.gz<\/a>//')
|
||||
TARGET_DIR="$2"
|
||||
WORK_DIR=$(mktemp -d)
|
||||
SOURCE_DIR=$WORK_DIR/zammad-$VERSION
|
||||
|
||||
pushd $TARGET_DIR
|
||||
|
||||
rm -rf \
|
||||
./source.json \
|
||||
./gemset.nix \
|
||||
./yarn.lock \
|
||||
./yarn.nix
|
||||
|
||||
|
||||
# Check that working directory was created.
|
||||
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
|
||||
echo "Could not create temporary directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Delete the working directory on exit.
|
||||
function cleanup {
|
||||
rm -rf "$WORK_DIR"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
|
||||
pushd $WORK_DIR
|
||||
|
||||
echo ":: Creating source.json"
|
||||
nix-prefetch-github zammad zammad --rev $VERSION --json --fetch-submodules | jq 'del(.leaveDotGit) | del(.deepClone)' > $TARGET_DIR/source.json
|
||||
echo >> $TARGET_DIR/source.json
|
||||
|
||||
echo ":: Fetching source"
|
||||
curl -L https://github.com/zammad/zammad/archive/$VERSION.tar.gz --output source.tar.gz
|
||||
tar zxf source.tar.gz
|
||||
|
||||
if [[ ! "$SOURCE_DIR" || ! -d "$SOURCE_DIR" ]]; then
|
||||
echo "Source directory does not exists."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pushd $SOURCE_DIR
|
||||
|
||||
echo ":: Creating gemset.nix"
|
||||
bundix --lockfile=./Gemfile.lock --gemfile=./Gemfile --gemset=$TARGET_DIR/gemset.nix
|
||||
|
||||
echo ":: Creating yarn.nix"
|
||||
yarn install
|
||||
cp yarn.lock $TARGET_DIR
|
||||
yarn2nix > $TARGET_DIR/yarn.nix
|
||||
|
||||
# needed to avoid import from derivation
|
||||
jq --arg VERSION "$VERSION" '. += {name: "Zammad", version: $VERSION}' package.json > $TARGET_DIR/package.json
|
||||
|
||||
popd
|
||||
popd
|
||||
popd
|
||||
Loading…
Add table
Add a link
Reference in a new issue