diff --git a/pkgs/by-name/fm/fmtoy/package.nix b/pkgs/by-name/fm/fmtoy/package.nix new file mode 100644 index 0000000000000..a3fe819ae759e --- /dev/null +++ b/pkgs/by-name/fm/fmtoy/package.nix @@ -0,0 +1,70 @@ +{ stdenv +, lib +, fetchFromGitHub +, unstableGitUpdater +, alsa-lib +, libfmvoice +, libjack2 +, pkg-config +, zlib +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "fmtoy"; + version = "0.0.0-unstable-2023-05-21"; + + src = fetchFromGitHub { + owner = "vampirefrog"; + repo = "fmtoy"; + rev = "2b54180d8edd0de90e2af01bf9ff303bc916e893"; + hash = "sha256-qoMw4P+QEw4Q/wKBvFPh+WxkmOW6qH9FuFFkO2ZRrMc="; + }; + + postPatch = '' + rmdir libfmvoice + cp --no-preserve=all -r ${libfmvoice.src} libfmvoice + + substituteInPlace Makefile \ + --replace 'pkg-config' "$PKG_CONFIG" + ''; + + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + alsa-lib + libjack2 + zlib + ]; + + enableParallelBuilding = true; + + buildFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "CXX=${stdenv.cc.targetPrefix}c++" + ]; + + installPhase = '' + runHook preInstall + + install -Dm755 fmtoy_jack $out/bin/fmtoy_jack + + runHook postInstall + ''; + + passthru = { + updateScript = unstableGitUpdater { }; + }; + + meta = with lib; { + description = "FM synthesiser based on emulated Yamaha YM chips (OPL, OPM and OPN series)"; + homepage = "https://github.com/vampirefrog/fmtoy"; + license = licenses.gpl3Only; + mainProgram = "fmtoy_jack"; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.linux; + }; +}) diff --git a/pkgs/by-name/li/libfmvoice/package.nix b/pkgs/by-name/li/libfmvoice/package.nix new file mode 100644 index 0000000000000..06284bfd5eafb --- /dev/null +++ b/pkgs/by-name/li/libfmvoice/package.nix @@ -0,0 +1,52 @@ +{ stdenv +, lib +, fetchFromGitHub +, unstableGitUpdater +, zlib +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "libfmvoice"; + version = "0.0.0-unstable-2023-12-05"; + + src = fetchFromGitHub { + owner = "vampirefrog"; + repo = "libfmvoice"; + rev = "38b1a0c627ef66fcd9c672c215d2b9849163df12"; + hash = "sha256-kXthY9TynIXNX9wmgn13vs4Mrrv/dmEr7zlWiKstjGk="; + }; + + strictDeps = true; + + enableParallelBuilding = true; + + buildInputs = [ + zlib + ]; + + buildFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + ]; + + installPhase = '' + runHook preInstall + + for prog in $(grep 'PROGS=' Makefile | cut -d'=' -f2); do + install -Dm755 $prog $out/bin/$prog + done + + runHook postInstall + ''; + + passthru = { + updateScript = unstableGitUpdater { }; + }; + + meta = with lib; { + description = "C library for loading, saving and converting FM sound chip voice files in various formats"; + homepage = "https://github.com/vampirefrog/libfmvoice"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.all; + }; +}) diff --git a/pkgs/by-name/vg/vgm2x/package.nix b/pkgs/by-name/vg/vgm2x/package.nix new file mode 100644 index 0000000000000..ff2fa28e7be79 --- /dev/null +++ b/pkgs/by-name/vg/vgm2x/package.nix @@ -0,0 +1,57 @@ +{ stdenv +, lib +, fetchFromGitHub +, unstableGitUpdater +, libfmvoice +, zlib +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "vgm2x"; + version = "0.0.0-unstable-2023-08-27"; + + src = fetchFromGitHub { + owner = "vampirefrog"; + repo = "vgm2x"; + rev = "5128055ab2b356e173b53e2afd31202a59505a39"; + hash = "sha256-DwDcSUdfOsDlajYtzg5xM5P9QPOqLp8b0sEpE18kfzA="; + }; + + postPatch = '' + rmdir libfmvoice + cp --no-preserve=all -r ${libfmvoice.src} libfmvoice + ''; + + strictDeps = true; + + enableParallelBuilding = true; + + buildInputs = [ + zlib + ]; + + buildFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + ]; + + installPhase = '' + runHook preInstall + + install -Dm755 vgm2opm $out/bin/vgm2opm + + runHook postInstall + ''; + + passthru = { + updateScript = unstableGitUpdater { }; + }; + + meta = with lib; { + description = "VGM file extraction tools"; + homepage = "https://github.com/vampirefrog/vgm2x"; + license = licenses.gpl3Only; + mainProgram = "vgm2opm"; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.all; + }; +}) diff --git a/pkgs/tools/audio/fmtoy/default.nix b/pkgs/tools/audio/fmtoy/default.nix deleted file mode 100644 index 69a0f570d3bc0..0000000000000 --- a/pkgs/tools/audio/fmtoy/default.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ stdenv -, lib -, fetchFromGitHub -, unstableGitUpdater -, dos2unix -, pkg-config -, zlib -, alsa-lib -, libjack2 -}: - -stdenv.mkDerivation rec { - pname = "fmtoy"; - version = "unstable-2022-12-23"; - - src = fetchFromGitHub { - owner = "vampirefrog"; - repo = "fmtoy"; - rev = "78b61b5e9bc0c6874962dc4040456581c9999b36"; - sha256 = "r5zbr6TCxzDiQvDsLQu/QwNfem1K4Ahaji0yIz/2yl0="; - }; - - postPatch = '' - dos2unix Makefile - # Don't hardcode compilers - sed -i -e '/CC=/d' -e '/CXX=/d' Makefile - '' + lib.optionalString stdenv.hostPlatform.isDarwin '' - # Remove Linux-only program & its dependencies - sed -i -e '/PROGS/ s/fmtoy_jack//' Makefile - substituteInPlace Makefile \ - --replace '$(shell pkg-config alsa jack --cflags)' "" - ''; - - nativeBuildInputs = [ - dos2unix - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - pkg-config - ]; - - buildInputs = [ - zlib - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib - libjack2 - ]; - - enableParallelBuilding = true; - - installPhase = '' - runHook preInstall - - for prog in $(grep 'PROGS=' Makefile | cut -d= -f2-); do - install -Dm755 $prog $out/bin/$prog - done - - runHook postInstall - ''; - - passthru.updateScript = unstableGitUpdater { - url = "https://github.com/vampirefrog/fmtoy.git"; - }; - - meta = with lib; { - homepage = "https://github.com/vampirefrog/fmtoy"; - description = "Tools for FM voices for Yamaha YM chips (OPL, OPM and OPN series)"; - # Unclear if gpl3Only or gpl3Plus - # https://github.com/vampirefrog/fmtoy/issues/1 - license = licenses.gpl3; - maintainers = with maintainers; [ OPNA2608 ]; - platforms = platforms.all; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 35602fac3d7ec..9b98849a3b173 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31959,8 +31959,6 @@ with pkgs; firefox_decrypt = python3Packages.callPackage ../tools/security/firefox_decrypt { }; - fmtoy = callPackage ../tools/audio/fmtoy { }; - flac = callPackage ../applications/audio/flac { }; redoflacs = callPackage ../applications/audio/redoflacs { };