depot/third_party/nixpkgs/pkgs/applications/video/epgstation/generate.sh
Default email 58f8944c92 Project import generated by Copybara.
GitOrigin-RevId: 5aba0fe9766a7201a336249fd6cb76e0d7ba2faf
2020-09-24 23:45:31 -05:00

34 lines
900 B
Bash
Executable file

#!/usr/bin/env bash
# Script to generate the Nix package definition for EPGStation. Run this script
# when bumping the package version.
VERSION="1.7.4"
URL="https://raw.githubusercontent.com/l3tnun/EPGStation/v$VERSION/package.json"
JQ_BIN="$(nix-build ../../../.. --no-out-link -A jq)/bin/jq"
set -eu -o pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
main() {
# update package.json
curl -sSfL "$URL" \
| jq '. + {"dependencies": (.devDependencies + .dependencies)} | del(.devDependencies)' \
> package.json
# regenerate node packages to update the actual Nix package
pushd ../../../development/node-packages \
&& ./generate.sh
popd
# generate default streaming settings for EPGStation
pushd ../../../../nixos/modules/services/video/epgstation \
&& cat "$(./generate)" > streaming.json
popd
}
jq() {
"$JQ_BIN" "$@"
}
main "@"