Unverified Commit 39b8ab38 authored by Emily's avatar Emily Committed by GitHub
Browse files

sonic-pi: 4.5.1 -> 4.6.0 (#446171)

parents a3449429 35d26256
Loading
Loading
Loading
Loading
+83 −75
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  stdenv,
  fetchFromGitHub,
  wrapQtAppsHook,
  autoPatchelfHook,
  makeDesktopItem,
  copyDesktopItems,
  cmake,
  pkg-config,
  catch2_3,
  qtbase,
  qtsvg,
  qttools,
  qtwayland,
  qwt,
  qscintilla,
  kdePackages,
  kissfftFloat,
  crossguid,
  reproc,
@@ -31,7 +26,6 @@
  parallel,

  withTauWidget ? false,
  qtwebengine,

  withImGui ? false,
  gl3w,
@@ -44,29 +38,30 @@ let
  ruby = ruby_3_2;
in

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "sonic-pi";
  version = "4.5.1";
  version = "4.6.0";

  src = fetchFromGitHub {
    owner = "sonic-pi-net";
    repo = "sonic-pi";
    rev = "v${version}";
    hash = "sha256-JMextQY0jLShWmqRQoVAbqIzDhA1mOzI7vfsG7+jjX0=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-sF/ksVhUzSV5P3Oe/T8hAiFMFiuOMEPmuBlUZtPSvtk=";
  };

  mixFodDeps = beamPackages.fetchMixDeps {
    inherit version;
    inherit (finalAttrs) version;
    pname = "mix-deps-sonic-pi";
    mixEnv = "test";
    src = "${src}/app/server/beam/tau";
    hash = "sha256-7wqFI3f0CRVrXK2IUguqHNANwKMmTak/Xh9nr624TXc=";
    src = "${finalAttrs.src}/app/server/beam/tau";
    hash = "sha256-UoETv6X/Q/RmKb0uCsu59DH7OF0H+A9e7+4uRM/B1Wk=";
  };

  strictDeps = true;

  nativeBuildInputs = [
    wrapQtAppsHook
    autoPatchelfHook
    kdePackages.wrapQtAppsHook
    copyDesktopItems
    cmake
    pkg-config
@@ -77,12 +72,12 @@ stdenv.mkDerivation rec {
  ];

  buildInputs = [
    qtbase
    qtsvg
    qttools
    qtwayland
    qwt
    qscintilla
    kdePackages.qtbase
    kdePackages.qtsvg
    kdePackages.qttools
    kdePackages.qtwayland
    kdePackages.qwt
    kdePackages.qscintilla
    kissfftFloat
    catch2_3
    crossguid
@@ -95,7 +90,7 @@ stdenv.mkDerivation rec {
    aubio
  ]
  ++ lib.optionals withTauWidget [
    qtwebengine
    kdePackages.qtwebengine
  ]
  ++ lib.optionals withImGui [
    gl3w
@@ -118,13 +113,14 @@ stdenv.mkDerivation rec {

  doCheck = true;

  postPatch = ''
  # Fix shebangs on files in app and bin scripts
  postPatch = ''
    patchShebangs app bin
  '';

  preConfigure = ''
  preConfigure =
    # Set build environment
    ''
      export SONIC_PI_HOME="$TMPDIR/spi"

      export HEX_HOME="$TEMPDIR/hex"
@@ -135,39 +131,44 @@ stdenv.mkDerivation rec {
      export MIX_HOME="$TEMPDIR/mix"
      export MIX_DEPS_PATH="$TEMPDIR/deps"
      export MIX_ENV=prod

    ''
    # Copy Mix dependency sources
    echo 'Copying ${mixFodDeps} to Mix deps'
    cp --no-preserve=mode -R '${mixFodDeps}' "$MIX_DEPS_PATH"

    + ''
      echo 'Copying ${finalAttrs.mixFodDeps} to Mix deps'
      cp --no-preserve=mode -R '${finalAttrs.mixFodDeps}' "$MIX_DEPS_PATH"
    ''
    # Change to project base directory
    + ''
      cd app

    ''
    # Prebuild Ruby vendored dependencies and Qt docs
    + ''
      ./linux-prebuild.sh -o
    '';

  postBuild = ''
  # Build BEAM server
  postBuild = ''
    ../linux-post-tau-prod-release.sh -o
  '';

  checkPhase = ''
    runHook preCheck

  ''
  # BEAM tests
  + ''
    pushd ../server/beam/tau
    MIX_ENV=test TAU_ENV=test mix test
    popd

  ''
  # Ruby tests
  + ''
    pushd ../server/ruby
    rake test
    popd

    # API tests
  ''
  # API tests, run JACK parallel to tests and quit both when one exits
  + ''
    pushd api-tests
      # run JACK parallel to tests and quit both when one exits
    SONIC_PI_ENV=test parallel --no-notice -j2 --halt now,done=1 ::: 'jackd -rd dummy' 'ctest --verbose'
    popd

@@ -176,16 +177,19 @@ stdenv.mkDerivation rec {

  installPhase = ''
    runHook preInstall

  ''
  # Run Linux release script
  + ''
    ../linux-release.sh

  ''
  # Copy dist directory to output
  + ''
    mkdir $out
    cp -r linux_dist/* $out/

  ''
  # Copy icon
    install -Dm644 ../gui/qt/images/icon-smaller.png $out/share/icons/hicolor/256x256/apps/sonic-pi.png
  + ''
    install -D --mode=0644 ../gui/images/icon-smaller.png $out/share/icons/hicolor/256x256/apps/sonic-pi.png

    runHook postInstall
  '';
@@ -193,7 +197,10 @@ stdenv.mkDerivation rec {
  # $out/bin/sonic-pi is a shell script, and wrapQtAppsHook doesn't wrap them.
  dontWrapQtApps = true;
  preFixup = ''
    patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" $out/app/build/gui/sonic-pi
  ''
  # Wrap Qt GUI (distributed binary)
  + ''
    wrapQtApp $out/bin/sonic-pi \
      --prefix PATH : ${
        lib.makeBinPath [
@@ -204,10 +211,10 @@ stdenv.mkDerivation rec {
          pipewire.jack
        ]
      }

    # If ImGui was built
  ''
  # If ImGui was built, Wrap ImGui into bin
  + ''
    if [ -e $out/app/build/gui/imgui/sonic-pi-imgui ]; then
      # Wrap ImGui into bin
      makeWrapper $out/app/build/gui/imgui/sonic-pi-imgui $out/bin/sonic-pi-imgui \
        --inherit-argv0 \
        --prefix PATH : ${
@@ -220,10 +227,11 @@ stdenv.mkDerivation rec {
          ]
        }
    fi

  ''
  # Remove runtime Erlang references
  + ''
    for file in $(grep -FrIl '${beamPackages.erlang}/lib/erlang' $out/app/server/beam/tau); do
      substituteInPlace "$file" --replace '${beamPackages.erlang}/lib/erlang' $out/app/server/beam/tau/_build/prod/rel/tau
      substituteInPlace "$file" --replace-fail '${beamPackages.erlang}/lib/erlang' $out/app/server/beam/tau/_build/prod/rel/tau
    done
  '';

@@ -238,7 +246,7 @@ stdenv.mkDerivation rec {
      exec = "sonic-pi";
      icon = "sonic-pi";
      desktopName = "Sonic Pi";
      comment = meta.description;
      comment = finalAttrs.meta.description;
      categories = [
        "Audio"
        "AudioVideo"
@@ -249,16 +257,16 @@ stdenv.mkDerivation rec {

  passthru.updateScript = ./update.sh;

  meta = with lib; {
  meta = {
    homepage = "https://sonic-pi.net/";
    description = "Free live coding synth for everyone originally designed to support computing and music lessons within schools";
    license = licenses.mit;
    maintainers = with maintainers; [
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      Phlogistique
      kamilchm
      c0deaddict
      sohalt
    ];
    platforms = platforms.linux;
    platforms = lib.platforms.linux;
  };
}
})
+0 −2
Original line number Diff line number Diff line
@@ -12445,8 +12445,6 @@ with pkgs;

  spotify-qt = qt6Packages.callPackage ../applications/audio/spotify-qt { };

  sonic-pi = libsForQt5.callPackage ../applications/audio/sonic-pi { };

  stag = callPackage ../applications/misc/stag {
    curses = ncurses;
  };