fetch-kde-qt.sh: modularize script allowing multiple versions

Changed files
+25 -96
maintainers
pkgs
desktops
kde-5
development
libraries
kde-frameworks
qt-5
+14 -5
maintainers/scripts/fetch-kde-qt.sh
···
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils findutils gnused nix wget
+
SRCS=
+
if [ -d "$1" ]; then
+
SRCS="$(pwd)/$1/srcs.nix"
+
. "$1/fetch.sh"
+
else
+
SRCS="$(pwd)/$(dirname $1)/srcs.nix"
+
. "$1"
+
fi
+
tmp=$(mktemp -d)
pushd $tmp >/dev/null
-
wget -nH -r -c --no-parent "$@" >/dev/null
+
wget -nH -r -c --no-parent "${WGET_ARGS[@]}" >/dev/null
csv=$(mktemp)
find . -type f | while read src; do
···
echo "$name,$version,$src,$filename" >>$csv
done
-
cat <<EOF
-
# DO NOT EDIT! This file is generated automatically by fetchsrcs.sh
+
cat >"$SRCS" <<EOF
+
# DO NOT EDIT! This file is generated automatically by fetch-kde-qt.sh
{ fetchurl, mirror }:
{
···
filename=$(gawk -F , "/^$name,$latestVersion,/ { print \$4 }" $csv)
url="${src:2}"
sha256=$(nix-hash --type sha256 --base32 --flat "$src")
-
cat <<EOF
+
cat >>"$SRCS" <<EOF
$name = {
version = "$latestVersion";
src = fetchurl {
···
EOF
done
-
echo "}"
+
echo "}" >>"$SRCS"
popd >/dev/null
rm -fr $tmp >/dev/null
-5
maintainers/scripts/generate-kde-applications.sh
···
-
#!/bin/sh
-
-
./maintainers/scripts/fetch-kde-qt.sh \
-
http://download.kde.org/stable/applications/16.08.0/ -A '*.tar.xz' \
-
>pkgs/desktops/kde-5/applications/srcs.nix
-5
maintainers/scripts/generate-kde-frameworks.sh
···
-
#!/bin/sh
-
-
./maintainers/scripts/fetch-kde-qt.sh \
-
http://download.kde.org/stable/frameworks/5.24/ -A '*.tar.xz' \
-
>pkgs/desktops/kde-5/frameworks/srcs.nix
-5
maintainers/scripts/generate-kde-plasma.sh
···
-
#!/bin/sh
-
-
./maintainers/scripts/fetch-kde-qt.sh \
-
http://download.kde.org/stable/plasma/5.7.3/ -A '*.tar.xz' \
-
>pkgs/desktops/kde-5/plasma/srcs.nix
-6
maintainers/scripts/generate-qt.sh
···
-
#!/bin/sh
-
-
./maintainers/scripts/fetch-kde-qt.sh \
-
http://download.qt.io/official_releases/qt/5.7/5.7.0/submodules/ \
-
-A '*.tar.xz' \
-
>pkgs/development/libraries/qt-5/5.7/srcs.nix
+1
pkgs/desktops/kde-5/applications/fetch.sh
···
+
WGET_ARGS=( http://download.kde.org/stable/applications/16.08.0/ -A '*.tar.xz' )
+1
pkgs/desktops/kde-5/plasma/fetch.sh
···
+
WGET_ARGS=( http://download.kde.org/stable/plasma/5.7.4/ -A '*.tar.xz' )
-16
pkgs/desktops/kde-5/plasma/plasma-mediacenter.nix
···
-
{ plasmaPackage, ecm, baloo, kactivities, kconfig
-
, kcoreaddons, kdeclarative, kguiaddons, ki18n, kio, kservice
-
, kfilemetadata, plasma-framework, qtdeclarative, qtmultimedia
-
, taglib
-
}:
-
-
plasmaPackage rec {
-
name = "plasma-mediacenter";
-
nativeBuildInputs = [
-
ecm
-
];
-
propagatedBuildInputs = [
-
baloo kactivities kdeclarative kfilemetadata ki18n kio plasma-framework
-
kconfig kcoreaddons kguiaddons kservice qtdeclarative qtmultimedia taglib
-
];
-
}
+1
pkgs/development/libraries/kde-frameworks/fetch.sh
···
+
WGET_ARGS=( http://download.kde.org/stable/frameworks/5.24/ -A '*.tar.xz' )
+3
pkgs/development/libraries/qt-5/5.5/fetch.sh
···
+
WGET_ARGS=( http://download.qt.io/official_releases/qt/5.5/5.5.1/submodules/ \
+
http://download.qt.io/community_releases/5.5/5.5.1/ \
+
-A '*.tar.xz' )
-54
pkgs/development/libraries/qt-5/5.5/fetchsrcs.sh
···
-
#! /usr/bin/env nix-shell
-
#! nix-shell -i bash -p coreutils findutils gnused nix wget
-
-
set -x
-
-
MAJOR_VERSION="5.5"
-
VERSION="${MAJOR_VERSION}.1"
-
# The trailing slash at the end is necessary!
-
RELEASE_URLS=(
-
"http://download.qt.io/official_releases/qt/$MAJOR_VERSION/$VERSION/submodules/"
-
"http://download.qt.io/community_releases/$MAJOR_VERSION/$VERSION/"
-
)
-
EXTRA_WGET_ARGS='-A *.tar.xz'
-
-
mkdir tmp; cd tmp
-
-
for url in "${RELEASE_URLS[@]}"; do
-
wget -nH -r -c --no-parent $url $EXTRA_WGET_ARGS
-
done
-
-
cat >../srcs.nix <<EOF
-
# DO NOT EDIT! This file is generated automatically by fetchsrcs.sh
-
{ fetchurl, mirror }:
-
-
{
-
EOF
-
-
workdir=$(pwd)
-
-
find . | sort | while read src; do
-
if [[ -f "${src}" ]]; then
-
url="${src:2}"
-
# Sanitize file name
-
filename=$(basename "$src" | tr '@' '_')
-
nameversion="${filename%.tar.*}"
-
name=$(echo "$nameversion" | sed -e 's,-[[:digit:]].*,,' | sed -e 's,-opensource-src$,,')
-
version=$(echo "$nameversion" | sed -e 's,^\([[:alpha:]][[:alnum:]]*-\)\+,,')
-
sha256=$(nix-hash --type sha256 --base32 --flat "$src")
-
cat >>../srcs.nix <<EOF
-
$name = {
-
version = "$version";
-
src = fetchurl {
-
url = "\${mirror}/$url";
-
sha256 = "$sha256";
-
name = "$filename";
-
};
-
};
-
EOF
-
fi
-
done
-
-
echo "}" >>../srcs.nix
-
-
cd ..
+3
pkgs/development/libraries/qt-5/5.6/fetch.sh
···
+
WGET_ARGS=( http://download.qt.io/official_releases/qt/5.6/5.6.1-1/submodules/ \
+
http://download.qt.io/community_releases/5.6/5.6.1/ \
+
-A '*.tar.xz' )
+2
pkgs/development/libraries/qt-5/5.7/fetch.sh
···
+
WGET_ARGS=( http://download.qt.io/official_releases/qt/5.7/5.7.0/submodules/ \
+
-A '*.tar.xz' )