3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/video/epgstation/generate.sh

35 lines
900 B
Bash
Raw Normal View History

2018-10-20 19:14:34 +01:00
#!/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
2020-08-10 15:45:08 +01:00
pushd ../../../development/node-packages \
2018-10-20 19:14:34 +01:00
&& ./generate.sh
2020-08-10 15:45:08 +01:00
popd
# generate default streaming settings for EPGStation
pushd ../../../../nixos/modules/services/video/epgstation \
&& cat "$(./generate)" > streaming.json
popd
2018-10-20 19:14:34 +01:00
}
jq() {
"$JQ_BIN" "$@"
}
main "@"