From cb171c5233e87c12b28af729d47fcdeb23867b12 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 1 Nov 2024 15:33:24 +0100 Subject: [PATCH] uade: Modernise --- pkgs/by-name/ua/uade/package.nix | 56 +++++++++++++++++--------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/pkgs/by-name/ua/uade/package.nix b/pkgs/by-name/ua/uade/package.nix index f74102e2038f..e8b8b23d3884 100644 --- a/pkgs/by-name/ua/uade/package.nix +++ b/pkgs/by-name/ua/uade/package.nix @@ -2,62 +2,63 @@ lib, stdenv, fetchFromGitLab, + bencodetools, + flac, + lame, + libao, + makeWrapper, python3, pkg-config, - which, - makeWrapper, - libao, - bencodetools, sox, - lame, - flac, vorbis-tools, + which, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "uade"; version = "3.02"; src = fetchFromGitLab { owner = "uade-music-player"; repo = "uade"; - rev = "uade-${version}"; + rev = "uade-${finalAttrs.version}"; hash = "sha256-skPEXBQwyr326zCmZ2jwGxcBoTt3Y/h2hagDeeqbMpw="; }; postPatch = '' patchShebangs configure - substituteInPlace configure \ - --replace 'PYTHON_SETUP_ARGS=""' 'PYTHON_SETUP_ARGS="--prefix=$out"' + substituteInPlace src/frontends/mod2ogg/mod2ogg2.sh.in \ - --replace '-e stat' '-n stat' \ - --replace '/usr/local' "$out" + --replace-fail '-e stat' '-n stat' \ + --replace-fail '/usr/local' "$out" + substituteInPlace python/uade/generate_oscilloscope_view.py \ - --replace "default='uade123'" "default='$out/bin/uade123'" + --replace-fail "default='uade123'" "default='$out/bin/uade123'" + # https://gitlab.com/uade-music-player/uade/-/issues/37 substituteInPlace write_audio/Makefile.in \ - --replace 'g++' '${stdenv.cc.targetPrefix}c++' + --replace-fail 'g++' '${stdenv.cc.targetPrefix}c++' ''; nativeBuildInputs = [ + makeWrapper pkg-config which - makeWrapper ]; buildInputs = [ - libao bencodetools - sox - lame flac + lame + libao + sox vorbis-tools ]; configureFlags = [ "--bencode-tools-prefix=${bencodetools}" - "--with-text-scope" - "--without-write-audio" + (lib.strings.withFeature true "text-scope") + (lib.strings.withFeature false "write-audio") ]; enableParallelBuilding = true; @@ -68,26 +69,27 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/mod2ogg2.sh \ --prefix PATH : $out/bin:${ lib.makeBinPath [ - sox - lame flac + lame + sox vorbis-tools ] } + # This is an old script, don't break expectations by renaming it ln -s $out/bin/mod2ogg2{.sh,} ''; - meta = with lib; { + meta = { description = "Plays old Amiga tunes through UAE emulation and cloned m68k-assembler Eagleplayer API"; homepage = "https://zakalwe.fi/uade/"; # It's a mix of licenses. "GPL", Public Domain, "LGPL", GPL2+, BSD, LGPL21+ and source code with unknown licenses. E.g. # - hippel-coso player is "[not] under any Open Source certified license" # - infogrames player is disassembled from Andi Silvas player, unknown license # Let's make it easy and flag the whole package as unfree. - license = licenses.unfree; - maintainers = with maintainers; [ OPNA2608 ]; + license = lib.licenses.unfree; + maintainers = with lib.maintainers; [ OPNA2608 ]; mainProgram = "uade123"; - platforms = platforms.unix; + platforms = lib.platforms.unix; }; -} +})