From a47f07a48aaa452e300291ffe2dcc004533344bc Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 15 Oct 2024 15:59:37 -0300 Subject: [PATCH 1/3] audacity: move to by-name --- .../default.nix => by-name/au/audacity/package.nix} | 7 +++---- pkgs/top-level/all-packages.nix | 4 ---- 2 files changed, 3 insertions(+), 8 deletions(-) rename pkgs/{applications/audio/audacity/default.nix => by-name/au/audacity/package.nix} (97%) diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/by-name/au/audacity/package.nix similarity index 97% rename from pkgs/applications/audio/audacity/default.nix rename to pkgs/by-name/au/audacity/package.nix index 0099e03f1bed..629bad6526a1 100644 --- a/pkgs/applications/audio/audacity/default.nix +++ b/pkgs/by-name/au/audacity/package.nix @@ -53,8 +53,7 @@ , gtk3 , libpng , libjpeg -, AppKit -, CoreAudioKit +, darwin }: # TODO @@ -139,8 +138,8 @@ stdenv.mkDerivation rec { libuuid util-linux ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - AppKit - CoreAudioKit # for portaudio + darwin.apple_sdk.frameworks.AppKit + darwin.apple_sdk.frameworks.CoreAudioKit # for portaudio libpng libjpeg ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cc28af8ce0c5..c2a33a10c862 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28122,10 +28122,6 @@ with pkgs; audacious = audacious.override { audacious-plugins = null; }; }; - audacity = callPackage ../applications/audio/audacity { - inherit (darwin.apple_sdk.frameworks) AppKit CoreAudioKit; - }; - audio-recorder = callPackage ../applications/audio/audio-recorder { }; auto-multiple-choice = callPackage ../applications/misc/auto-multiple-choice { }; From 0ee4e13f4b85192681d451610a7b474884b9ca71 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 15 Oct 2024 16:00:27 -0300 Subject: [PATCH 2/3] audacity: format with nixfmt-rfc-style --- pkgs/by-name/au/audacity/package.nix | 295 ++++++++++++++------------- 1 file changed, 156 insertions(+), 139 deletions(-) diff --git a/pkgs/by-name/au/audacity/package.nix b/pkgs/by-name/au/audacity/package.nix index 629bad6526a1..69570bfd7bf2 100644 --- a/pkgs/by-name/au/audacity/package.nix +++ b/pkgs/by-name/au/audacity/package.nix @@ -1,59 +1,60 @@ -{ stdenv -, lib -, fetchFromGitHub -, cmake -, makeWrapper -, wrapGAppsHook3 -, pkg-config -, python3 -, gettext -, file -, libvorbis -, libmad -, libjack2 -, lv2 -, lilv -, mpg123 -, opusfile -, rapidjson -, serd -, sord -, sqlite -, sratom -, suil -, libsndfile -, soxr -, flac -, lame -, twolame -, expat -, libid3tag -, libopus -, libuuid -, ffmpeg -, soundtouch -, pcre -, portaudio # given up fighting their portaudio.patch? -, portmidi -, linuxHeaders -, alsa-lib -, at-spi2-core -, dbus -, libepoxy -, libXdmcp -, libXtst -, libpthreadstubs -, libsbsms_2_3_0 -, libselinux -, libsepol -, libxkbcommon -, util-linux -, wavpack -, wxGTK32 -, gtk3 -, libpng -, libjpeg -, darwin +{ + stdenv, + lib, + fetchFromGitHub, + cmake, + makeWrapper, + wrapGAppsHook3, + pkg-config, + python3, + gettext, + file, + libvorbis, + libmad, + libjack2, + lv2, + lilv, + mpg123, + opusfile, + rapidjson, + serd, + sord, + sqlite, + sratom, + suil, + libsndfile, + soxr, + flac, + lame, + twolame, + expat, + libid3tag, + libopus, + libuuid, + ffmpeg, + soundtouch, + pcre, + portaudio, # given up fighting their portaudio.patch? + portmidi, + linuxHeaders, + alsa-lib, + at-spi2-core, + dbus, + libepoxy, + libXdmcp, + libXtst, + libpthreadstubs, + libsbsms_2_3_0, + libselinux, + libsepol, + libxkbcommon, + util-linux, + wavpack, + wxGTK32, + gtk3, + libpng, + libjpeg, + darwin, }: # TODO @@ -70,79 +71,90 @@ stdenv.mkDerivation rec { hash = "sha256-72k79UFxhk8JUCnMzbU9lZ0Ua3Ui41EkhPGSnGkf9mE="; }; - postPatch = '' - mkdir src/private - substituteInPlace scripts/build/macOS/fix_bundle.py \ - --replace "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')" - '' + lib.optionalString stdenv.hostPlatform.isLinux '' - substituteInPlace libraries/lib-files/FileNames.cpp \ - --replace /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h - '' + lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") '' - sed -z -i "s/NSAppearanceName.*systemAppearance//" src/AudacityApp.mm - ''; + postPatch = + '' + mkdir src/private + substituteInPlace scripts/build/macOS/fix_bundle.py \ + --replace "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')" + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + substituteInPlace libraries/lib-files/FileNames.cpp \ + --replace /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h + '' + + + lib.optionalString + (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") + '' + sed -z -i "s/NSAppearanceName.*systemAppearance//" src/AudacityApp.mm + ''; - nativeBuildInputs = [ - cmake - gettext - pkg-config - python3 - makeWrapper - wrapGAppsHook3 - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - linuxHeaders - ]; + nativeBuildInputs = + [ + cmake + gettext + pkg-config + python3 + makeWrapper + wrapGAppsHook3 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + linuxHeaders + ]; - buildInputs = [ - expat - ffmpeg - file - flac - gtk3 - lame - libid3tag - libjack2 - libmad - libopus - libsbsms_2_3_0 - libsndfile - libvorbis - lilv - lv2 - mpg123 - opusfile - pcre - portmidi - rapidjson - serd - sord - soundtouch - soxr - sqlite - sratom - suil - twolame - portaudio - wavpack - wxGTK32 - ] ++ lib.optionals stdenv.hostPlatform.isLinux [ - alsa-lib # for portaudio - at-spi2-core - dbus - libepoxy - libXdmcp - libXtst - libpthreadstubs - libxkbcommon - libselinux - libsepol - libuuid - util-linux - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk.frameworks.AppKit - darwin.apple_sdk.frameworks.CoreAudioKit # for portaudio - libpng - libjpeg - ]; + buildInputs = + [ + expat + ffmpeg + file + flac + gtk3 + lame + libid3tag + libjack2 + libmad + libopus + libsbsms_2_3_0 + libsndfile + libvorbis + lilv + lv2 + mpg123 + opusfile + pcre + portmidi + rapidjson + serd + sord + soundtouch + soxr + sqlite + sratom + suil + twolame + portaudio + wavpack + wxGTK32 + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib # for portaudio + at-spi2-core + dbus + libepoxy + libXdmcp + libXtst + libpthreadstubs + libxkbcommon + libselinux + libsepol + libuuid + util-linux + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.apple_sdk.frameworks.AppKit + darwin.apple_sdk.frameworks.CoreAudioKit # for portaudio + libpng + libjpeg + ]; cmakeFlags = [ "-DAUDACITY_BUILD_LEVEL=2" @@ -175,17 +187,19 @@ stdenv.mkDerivation rec { # Replace audacity's wrapper, to: # - put it in the right place, it shouldn't be in "$out/audacity" # - Add the ffmpeg dynamic dependency - postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' - wrapProgram "$out/bin/audacity" \ - "''${gappsWrapperArgs[@]}" \ - --prefix LD_LIBRARY_PATH : "$out/lib/audacity":${lib.makeLibraryPath [ ffmpeg ]} \ - --suffix AUDACITY_MODULES_PATH : "$out/lib/audacity/modules" \ - --suffix AUDACITY_PATH : "$out/share/audacity" - '' + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/{Applications,bin} - mv $out/Audacity.app $out/Applications/ - makeWrapper $out/Applications/Audacity.app/Contents/MacOS/Audacity $out/bin/audacity - ''; + postFixup = + lib.optionalString stdenv.hostPlatform.isLinux '' + wrapProgram "$out/bin/audacity" \ + "''${gappsWrapperArgs[@]}" \ + --prefix LD_LIBRARY_PATH : "$out/lib/audacity":${lib.makeLibraryPath [ ffmpeg ]} \ + --suffix AUDACITY_MODULES_PATH : "$out/lib/audacity/modules" \ + --suffix AUDACITY_PATH : "$out/share/audacity" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/{Applications,bin} + mv $out/Audacity.app $out/Applications/ + makeWrapper $out/Applications/Audacity.app/Contents/MacOS/Audacity $out/bin/audacity + ''; meta = with lib; { description = "Sound editor with graphical UI"; @@ -201,7 +215,10 @@ stdenv.mkDerivation rec { # Documentation. cc-by-30 ]; - maintainers = with maintainers; [ veprbl wegank ]; + maintainers = with maintainers; [ + veprbl + wegank + ]; platforms = platforms.unix; }; } From 0c8d09f2746cb8d4b5f6ce2a2f15ad5927ecd29c Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 15 Oct 2024 16:07:22 -0300 Subject: [PATCH 3/3] audacity: remove `with lib` from meta and `rec` --- pkgs/by-name/au/audacity/package.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/au/audacity/package.nix b/pkgs/by-name/au/audacity/package.nix index 69570bfd7bf2..cbd16b123405 100644 --- a/pkgs/by-name/au/audacity/package.nix +++ b/pkgs/by-name/au/audacity/package.nix @@ -60,14 +60,14 @@ # TODO # 1. detach sbsms -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "audacity"; version = "3.6.4"; src = fetchFromGitHub { owner = "audacity"; repo = "audacity"; - rev = "Audacity-${version}"; + rev = "Audacity-${finalAttrs.version}"; hash = "sha256-72k79UFxhk8JUCnMzbU9lZ0Ua3Ui41EkhPGSnGkf9mE="; }; @@ -201,12 +201,12 @@ stdenv.mkDerivation rec { makeWrapper $out/Applications/Audacity.app/Contents/MacOS/Audacity $out/bin/audacity ''; - meta = with lib; { + meta = { description = "Sound editor with graphical UI"; mainProgram = "audacity"; homepage = "https://www.audacityteam.org"; changelog = "https://github.com/audacity/audacity/releases"; - license = with licenses; [ + license = with lib.licenses; [ gpl2Plus # Must be GPL3 when building with "technologies that require it, # such as the VST3 audio plugin interface". @@ -215,10 +215,10 @@ stdenv.mkDerivation rec { # Documentation. cc-by-30 ]; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ veprbl wegank ]; - platforms = platforms.unix; + platforms = lib.platforms.unix; }; -} +})