diff --git a/pkgs/by-name/li/lilypond-unstable/package.nix b/pkgs/by-name/li/lilypond-unstable/package.nix new file mode 100644 index 000000000000..1fe01def478a --- /dev/null +++ b/pkgs/by-name/li/lilypond-unstable/package.nix @@ -0,0 +1,25 @@ +{ + lib, + fetchzip, + lilypond, + writeScript, +}: + +lilypond.overrideAttrs ( + finalAttrs: prevAttrs: { + version = "2.25.32"; + + src = fetchzip { + url = "https://lilypond.org/download/sources/v${lib.versions.majorMinor finalAttrs.version}/lilypond-${finalAttrs.version}.tar.gz"; + hash = "sha256-j7Avb9WSy27yQCak3KV7OB24M+T76b/tLcLoINLSEbo="; + }; + + passthru.updateScript = writeScript "update-lilypond-unstable" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts curl + version="$(curl -s 'https://gitlab.com/lilypond/lilypond/-/raw/master/VERSION' | grep 'VERSION_DEVEL=' | cut -d= -f2)" + update-source-version lilypond-unstable "$version" \ + --file=pkgs/by-name/li/lilypond-unstable/package.nix + ''; + } +) diff --git a/pkgs/misc/lilypond/with-fonts.nix b/pkgs/by-name/li/lilypond-with-fonts/package.nix similarity index 75% rename from pkgs/misc/lilypond/with-fonts.nix rename to pkgs/by-name/li/lilypond-with-fonts/package.nix index 95bb75318e05..8c4f2c902a89 100644 --- a/pkgs/misc/lilypond/with-fonts.nix +++ b/pkgs/by-name/li/lilypond-with-fonts/package.nix @@ -14,7 +14,11 @@ lib.appendToName "with-fonts" (symlinkJoin { meta ; - paths = [ lilypond ] ++ openlilylib-fonts.all; + paths = [ + lilypond + ] + # relevant for lilypond-unstable-with-fonts + ++ (openlilylib-fonts.override { inherit lilypond; }).all; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/misc/lilypond/default.nix b/pkgs/by-name/li/lilypond/package.nix similarity index 84% rename from pkgs/misc/lilypond/default.nix rename to pkgs/by-name/li/lilypond/package.nix index 9bd6351bd2b1..c81b8a6df53d 100644 --- a/pkgs/misc/lilypond/default.nix +++ b/pkgs/by-name/li/lilypond/package.nix @@ -40,9 +40,10 @@ metafont ] ), + writeScript, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "lilypond"; version = "2.24.4"; outputs = [ @@ -51,7 +52,7 @@ stdenv.mkDerivation rec { ]; src = fetchzip { - url = "http://lilypond.org/download/sources/v${lib.versions.majorMinor version}/lilypond-${version}.tar.gz"; + url = "http://lilypond.org/download/sources/v${lib.versions.majorMinor finalAttrs.version}/lilypond-${finalAttrs.version}.tar.gz"; hash = "sha256-UYdORvodrVchxslOxpMiXrAh7DtB9sWp9yqZU/jeB9Y="; }; @@ -120,10 +121,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - passthru.updateScript = { - command = [ ./update.sh ]; - supportedFeatures = [ "commit" ]; - }; + passthru.updateScript = writeScript "update-lilypond" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts curl + version="$(curl -s 'https://gitlab.com/lilypond/lilypond/-/raw/master/VERSION' | grep 'VERSION_STABLE=' | cut -d= -f2)" + update-source-version lilypond "$version" + ''; # documentation makefile uses "out" for different purposes, hence we explicitly set it to an empty string makeFlags = [ "out=" ]; @@ -147,4 +150,4 @@ stdenv.mkDerivation rec { FONTCONFIG_FILE = lib.optional stdenv.hostPlatform.isDarwin (makeFontsConf { fontDirectories = [ freefont_ttf ]; }); -} +}) diff --git a/pkgs/misc/lilypond/unstable.nix b/pkgs/misc/lilypond/unstable.nix deleted file mode 100644 index 2e81140eb681..000000000000 --- a/pkgs/misc/lilypond/unstable.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - lib, - fetchzip, - lilypond, -}: - -lilypond.overrideAttrs (oldAttrs: rec { - version = "2.25.32"; - src = fetchzip { - url = "https://lilypond.org/download/sources/v${lib.versions.majorMinor version}/lilypond-${version}.tar.gz"; - hash = "sha256-j7Avb9WSy27yQCak3KV7OB24M+T76b/tLcLoINLSEbo="; - }; - - passthru.updateScript = { - command = [ - ./update.sh - "unstable" - ]; - supportedFeatures = [ "commit" ]; - }; -}) diff --git a/pkgs/misc/lilypond/update.sh b/pkgs/misc/lilypond/update.sh deleted file mode 100755 index 5d5f855dbd7c..000000000000 --- a/pkgs/misc/lilypond/update.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -I nixpkgs=./. -i bash -p curl gnused nix - -set -euo pipefail - -if [ $# -gt 0 ] && [ "$1" = "unstable" ]; then - ATTR="lilypond-unstable" - FILE="$(dirname "${BASH_SOURCE[@]}")/unstable.nix" - QUERY="VERSION_DEVEL=" -else - ATTR="lilypond" - FILE="$(dirname "${BASH_SOURCE[@]}")/default.nix" - QUERY="VERSION_STABLE=" -fi - -# update version -PREV=$(nix eval --raw -f default.nix $ATTR.version) -NEXT=$(curl -s 'https://gitlab.com/lilypond/lilypond/-/raw/master/VERSION' | grep "$QUERY" | cut -d= -f2) -sed -i "s|$PREV|$NEXT|" "$FILE" -echo "[{\"commitMessage\":\"$ATTR: $PREV -> $NEXT\"}]" - -# update hash -PREV=$(nix eval --raw -f default.nix $ATTR.src.outputHash) -NEXT=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --type sha256 --unpack $(nix eval --raw -f default.nix $ATTR.src.url))) -sed -i "s|$PREV|$NEXT|" "$FILE" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fbc504abb334..da5e22a493d4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12416,19 +12416,10 @@ with pkgs; ; kops = kops_1_33; - lilypond = callPackage ../misc/lilypond { }; - - lilypond-unstable = callPackage ../misc/lilypond/unstable.nix { }; - - lilypond-unstable-with-fonts = callPackage ../misc/lilypond/with-fonts.nix { + lilypond-unstable-with-fonts = lilypond-with-fonts.override { lilypond = lilypond-unstable; - openlilylib-fonts = openlilylib-fonts.override { - lilypond = lilypond-unstable; - }; }; - lilypond-with-fonts = callPackage ../misc/lilypond/with-fonts.nix { }; - openlilylib-fonts = recurseIntoAttrs (callPackage ../misc/lilypond/fonts.nix { }); nixDependencies = recurseIntoAttrs (