about summary refs log tree commit diff
path: root/pkgs/applications/audio
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-11-29 19:36:25 -0600
committerGitHub <noreply@github.com>2018-11-29 19:36:25 -0600
commit76c7a8bac083522ea10ba43f699421ca64007708 (patch)
treecc017b17548488b04a0506c1f3c00801839abb75 /pkgs/applications/audio
parentf435272ce351ed192e9ff9c643331a4cc063930e (diff)
parentc0a804c747c6909c036da76472393b2fbd6413b9 (diff)
downloadnixlib-76c7a8bac083522ea10ba43f699421ca64007708.tar
nixlib-76c7a8bac083522ea10ba43f699421ca64007708.tar.gz
nixlib-76c7a8bac083522ea10ba43f699421ca64007708.tar.bz2
nixlib-76c7a8bac083522ea10ba43f699421ca64007708.tar.lz
nixlib-76c7a8bac083522ea10ba43f699421ca64007708.tar.xz
nixlib-76c7a8bac083522ea10ba43f699421ca64007708.tar.zst
nixlib-76c7a8bac083522ea10ba43f699421ca64007708.zip
Merge pull request #51205 from matthewbauer/more-setup-hooks
Add premake & imake setup hook
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r--pkgs/applications/audio/distrho/default.nix37
1 files changed, 21 insertions, 16 deletions
diff --git a/pkgs/applications/audio/distrho/default.nix b/pkgs/applications/audio/distrho/default.nix
index bf79b68bc7db..1c41451b08f3 100644
--- a/pkgs/applications/audio/distrho/default.nix
+++ b/pkgs/applications/audio/distrho/default.nix
@@ -1,7 +1,13 @@
 { stdenv, fetchFromGitHub, alsaLib, fftwSinglePrec, freetype, libjack2
-, pkgconfig, premake3, xorg, ladspa-sdk }:
+, pkgconfig, ladspa-sdk, premake3
+, libX11, libXcomposite, libXcursor, libXext, libXinerama, libXrender
+}:
 
-stdenv.mkDerivation rec {
+let
+  premakeos = if stdenv.hostPlatform.isDarwin then "osx"
+              else if stdenv.hostPlatform.isWindows then "mingw"
+              else "linux";
+in stdenv.mkDerivation rec {
   name = "distrho-ports-${version}";
   version = "2018-04-16";
 
@@ -12,27 +18,26 @@ stdenv.mkDerivation rec {
     sha256 = "0l4zwl4mli8jzch32a1fh7c88r9q17xnkxsdw17ds5hadnxlk12v";
   };
 
+  configurePhase = ''
+    runHook preConfigure
+
+    sh ./scripts/premake-update.sh ${premakeos}
+
+    runHook postConfigure
+  '';
+
   patchPhase = ''
     sed -e "s#@./scripts#sh scripts#" -i Makefile
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig premake3 ];
   buildInputs = [
-    alsaLib fftwSinglePrec freetype libjack2 premake3
-    xorg.libX11 xorg.libXcomposite xorg.libXcursor xorg.libXext
-    xorg.libXinerama xorg.libXrender ladspa-sdk
+    alsaLib fftwSinglePrec freetype libjack2
+    libX11 libXcomposite libXcursor libXext
+    libXinerama libXrender ladspa-sdk
   ];
 
-  buildPhase = ''
-    sh ./scripts/premake-update.sh linux
-    make lv2
-  '';
-
-  installPhase = ''
-    mkdir -p $out/bin
-    mkdir -p $out/lib/lv2
-    cp -a bin/lv2/* $out/lib/lv2/
-  '';
+  makeFlags = "PREFIX=$(out)";
 
   meta = with stdenv.lib; {
     homepage = http://distrho.sourceforge.net;