libopenmpt: 0.5.11 -> 0.6.2, refactor

- Post-rename cleanup to better match its library status:
- Moved files to library directory
- Changed outputs
- Some formatting improvements
- Added update script

OPNA2608 4d3b9839 12769bc7

+98 -43
-42
pkgs/applications/audio/libopenmpt/default.nix
··· 1 - { config, lib, stdenv, fetchurl, fetchpatch, zlib, pkg-config, mpg123, libogg, libvorbis, portaudio, libsndfile, flac 2 - , usePulseAudio ? config.pulseaudio or stdenv.isLinux, libpulseaudio }: 3 - 4 - stdenv.mkDerivation rec { 5 - pname = "libopenmpt"; 6 - version = "0.5.11"; 7 - 8 - outputs = [ "out" "lib" "dev" ]; 9 - 10 - src = fetchurl { 11 - url = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${version}+release.autotools.tar.gz"; 12 - sha256 = "1c54lldr2imjzhlhq5lvwhj7d5794xm97cby9pznr5wdjjay0sa4"; 13 - }; 14 - 15 - patches = [ 16 - # Fix pending upstream inclusion for gcc-12 include headers: 17 - # https://github.com/OpenMPT/openmpt/pull/8 18 - (fetchpatch { 19 - name = "gcc-12.patch"; 20 - url = "https://github.com/OpenMPT/openmpt/commit/6e7a43190ef2f9ba0b3efc19b9527261b69ec8f7.patch"; 21 - sha256 = "081m1rf09bbrlg52aihaajmld5dcnwbp6y7zpyik92mm332r330h"; 22 - }) 23 - ]; 24 - 25 - enableParallelBuilding = true; 26 - 27 - nativeBuildInputs = [ pkg-config ]; 28 - buildInputs = [ zlib mpg123 libogg libvorbis portaudio libsndfile flac ] 29 - ++ lib.optional usePulseAudio libpulseaudio; 30 - 31 - configureFlags = lib.optional (!usePulseAudio) "--without-pulseaudio"; 32 - 33 - doCheck = true; 34 - 35 - meta = with lib; { 36 - description = "A cross-platform command-line based module file player"; 37 - homepage = "https://lib.openmpt.org/libopenmpt/"; 38 - license = licenses.bsd3; 39 - maintainers = with maintainers; [ OPNA2608 ]; 40 - platforms = platforms.unix; 41 - }; 42 - }
+66
pkgs/development/libraries/audio/libopenmpt/default.nix
··· 1 + { config 2 + , lib 3 + , stdenv 4 + , fetchurl 5 + , zlib 6 + , pkg-config 7 + , mpg123 8 + , libogg 9 + , libvorbis 10 + , portaudio 11 + , libsndfile 12 + , flac 13 + , usePulseAudio ? config.pulseaudio or stdenv.isLinux 14 + , libpulseaudio 15 + }: 16 + 17 + stdenv.mkDerivation rec { 18 + pname = "libopenmpt"; 19 + version = "0.6.2"; 20 + 21 + outputs = [ "out" "dev" "bin" ]; 22 + 23 + src = fetchurl { 24 + url = "https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${version}+release.autotools.tar.gz"; 25 + sha256 = "1dp645gg6d3pzjh82srq1d7qvyxi5h22k7yfdjiyzbyry8pxdh2h"; 26 + }; 27 + 28 + enableParallelBuilding = true; 29 + 30 + nativeBuildInputs = [ 31 + pkg-config 32 + ]; 33 + 34 + buildInputs = [ 35 + zlib 36 + mpg123 37 + libogg 38 + libvorbis 39 + portaudio 40 + libsndfile 41 + flac 42 + ] ++ lib.optional usePulseAudio libpulseaudio; 43 + 44 + configureFlags = lib.optional (!usePulseAudio) "--without-pulseaudio"; 45 + 46 + doCheck = true; 47 + 48 + postFixup = '' 49 + moveToOutput share/doc $dev 50 + ''; 51 + 52 + passthru.updateScript = ./update.sh; 53 + 54 + meta = with lib; { 55 + description = "Cross-platform C++ and C library to decode tracked music files into a raw PCM audio stream"; 56 + longDescription = '' 57 + libopenmpt is a cross-platform C++ and C library to decode tracked music files (modules) into a raw PCM audio stream. 58 + openmpt123 is a cross-platform command-line or terminal based module file player. 59 + libopenmpt is based on the player code of the OpenMPT project. 60 + ''; 61 + homepage = "https://lib.openmpt.org/libopenmpt/"; 62 + license = licenses.bsd3; 63 + maintainers = with maintainers; [ OPNA2608 ]; 64 + platforms = platforms.unix; 65 + }; 66 + }
+31
pkgs/development/libraries/audio/libopenmpt/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p common-updater-scripts curl xmlstarlet 3 + 4 + attr=libopenmpt 5 + 6 + set -eu -o pipefail 7 + 8 + # Get update notifications, remove updates for libopenmpt-modplug, find latest eligible & extract versions 9 + versions="$( 10 + curl -s 'https://lib.openmpt.org/libopenmpt/feed.xml' | 11 + xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m /atom:feed/atom:entry -v atom:title -n | 12 + grep -v 'libopenmpt-modplug' | head -n1 | 13 + grep -Eo '([0-9][^,\s]+)' | tr '\n' ' ' 14 + )" 15 + echo "Latest $attr versions: $versions" 16 + 17 + # Find a version that is > current version and not a rc 18 + # rc's have different download path and a full release will usually follow shortly 19 + currentVersion="$(nix-instantiate --eval -E "with import ./. {}; $attr.version" | tr -d '"')" 20 + echo "Current $attr version: $currentVersion" 21 + for version in $versions; do 22 + (echo "$version" | grep -q 'rc') && continue 23 + [ "$version" = "$(printf '%s\n%s' "$version" "$currentVersion" | sort -V | head -n1)" ] && continue 24 + 25 + echo "Updating to $version. Please check if other versions qualify for backport to stable!" 26 + update-source-version "$attr" "$version" 27 + exit 0 28 + done 29 + 30 + echo "No version eligible for bump." 31 + exit 0
+1 -1
pkgs/top-level/all-packages.nix
··· 28138 28138 28139 28139 vivaldi-widevine = callPackage ../applications/networking/browsers/vivaldi/widevine.nix { }; 28140 28140 28141 - libopenmpt = callPackage ../applications/audio/libopenmpt { }; 28141 + libopenmpt = callPackage ../development/libraries/audio/libopenmpt { }; 28142 28142 28143 28143 openrazer-daemon = with python3Packages; toPythonApplication openrazer-daemon; 28144 28144