summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2022-07-22 16:09:01 +0200
committerGitHub <noreply@github.com>2022-07-22 16:09:01 +0200
commit6809190e95a22aba00afe24b8ce2f6ab2eb75ec1 (patch)
treebd36ba1e2963f58c9ec0a15342e0dd79111847ea /pkgs
parent0f469c8fc72ea5b7edd2483dff9ca61adc2105ab (diff)
parentca9bddbb8c9b8d63968b091781ede80b7d4f40aa (diff)
downloadnixpkgs-6809190e95a22aba00afe24b8ce2f6ab2eb75ec1.tar
nixpkgs-6809190e95a22aba00afe24b8ce2f6ab2eb75ec1.tar.gz
nixpkgs-6809190e95a22aba00afe24b8ce2f6ab2eb75ec1.tar.bz2
nixpkgs-6809190e95a22aba00afe24b8ce2f6ab2eb75ec1.tar.lz
nixpkgs-6809190e95a22aba00afe24b8ce2f6ab2eb75ec1.tar.xz
nixpkgs-6809190e95a22aba00afe24b8ce2f6ab2eb75ec1.tar.zst
nixpkgs-6809190e95a22aba00afe24b8ce2f6ab2eb75ec1.zip
Merge pull request #182453 from onny/surge
surge: Fix build
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/surge/default.nix67
1 files changed, 59 insertions, 8 deletions
diff --git a/pkgs/applications/audio/surge/default.nix b/pkgs/applications/audio/surge/default.nix
index 849b07d67e1..f1d8600ed01 100644
--- a/pkgs/applications/audio/surge/default.nix
+++ b/pkgs/applications/audio/surge/default.nix
@@ -1,6 +1,22 @@
-{ stdenv, lib, fetchurl, fetchFromGitHub, cmake, git, pkg-config, python3
-, cairo, libsndfile, libxcb, libxkbcommon, xcbutil, xcbutilcursor, xcbutilkeysyms, zenity
-, curl, rsync
+{ stdenv
+, lib
+, fetchurl
+, fetchpatch
+, fetchFromGitHub
+, cmake
+, git
+, pkg-config
+, python3
+, cairo
+, libsndfile
+, libxcb
+, libxkbcommon
+, xcbutil
+, xcbutilcursor
+, xcbutilkeysyms
+, zenity
+, curl
+, rsync
 }:
 
 stdenv.mkDerivation rec {
@@ -21,12 +37,43 @@ stdenv.mkDerivation rec {
     rev = "afc591cc06d9adc3dc8dc515a55c66873fa10296";
     sha256 = "1wqv86l70nwlrb10n47rib80f47a96j9qqg8w5dv46ys1sq2nz7z";
   };
-  nativeBuildInputs = [ cmake git pkg-config python3 ];
-  buildInputs = [ cairo libsndfile libxcb libxkbcommon xcbutil xcbutilcursor xcbutilkeysyms zenity curl rsync ];
+
+  patches = [
+    # Fix build error due to newer glibc version by upgrading lib "catch 2"
+    # Issue: https://github.com/surge-synthesizer/surge/pull/4843
+    # Patch: https://github.com/surge-synthesizer/surge/pull/4845
+    (fetchpatch {
+      url = "https://github.com/surge-synthesizer/surge/commit/7a552038bab4b000d188ae425aa97963dc91db17.patch";
+      sha256 = "sha256-5Flf0uJqEK6e+sadB+vr6phdvvdZYXcFFfm4ywhAeW0=";
+      name = "glibc_build_fix.patch";
+    })
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    git
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    cairo
+    libsndfile
+    libxcb
+    libxkbcommon
+    xcbutil
+    xcbutilcursor
+    xcbutilkeysyms
+    zenity
+    curl
+    rsync
+  ];
 
   postPatch = ''
-    substituteInPlace src/common/SurgeStorage.cpp --replace "/usr/share/Surge" "$out/share/surge"
-    substituteInPlace src/linux/UserInteractionsLinux.cpp --replace '"zenity' '"${zenity}/bin/zenity'
+    substituteInPlace src/common/SurgeStorage.cpp \
+      --replace "/usr/share/Surge" "$out/share/surge"
+    substituteInPlace src/linux/UserInteractionsLinux.cpp \
+      --replace '"zenity' '"${zenity}/bin/zenity'
     patchShebangs scripts/linux/
     cp -r $extraContent/Skins/ resources/data/skins
   '';
@@ -38,6 +85,7 @@ stdenv.mkDerivation rec {
   '';
 
   doInstallCheck = true;
+
   installCheckPhase = ''
     export HOME=$(mktemp -d)
     export SURGE_DISABLE_NETWORK_TESTS=TRUE
@@ -45,7 +93,10 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    description = "LV2 & VST3 synthesizer plug-in (previously released as Vember Audio Surge)";
+    description = ''
+      LV2 & VST3 synthesizer plug-in (previously released as Vember Audio
+      Surge)
+    '';
     homepage = "https://surge-synthesizer.github.io";
     license = licenses.gpl3;
     platforms = [ "x86_64-linux" ];