about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorjacereda2019-02-24 01:51:04 +0100
committerxeji2019-02-24 01:51:04 +0100
commit36e0ed236eb9a8a6a4668bd83bac17d045f7639e (patch)
treef6c6b90cffa7c3171e824af34536f5009974e4aa /pkgs/development
parente23580caf869ddab80c0fe99cffe399790cf3203 (diff)
xavs: build on darwin (#56070)
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/xavs/default.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/development/libraries/xavs/default.nix b/pkgs/development/libraries/xavs/default.nix
index adace96afad8..31c31164e010 100644
--- a/pkgs/development/libraries/xavs/default.nix
+++ b/pkgs/development/libraries/xavs/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
     sha256 = "0drw16wm95dqszpl7j33y4gckz0w0107lnz6wkzb66f0dlbv48cf";
   };
 
+  enableParallelBuilding = true;
+
   patchPhase = ''
     patchShebangs configure
     patchShebangs config.sub
@@ -18,7 +20,16 @@ stdenv.mkDerivation rec {
     patchShebangs tools/patcheck
     patchShebangs tools/regression-test.pl
     patchShebangs tools/xavs-format
-  '';
+    '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace config.guess --replace 'uname -p' 'uname -m'
+    substituteInPlace configure \
+      --replace '-O4' '-O3' \
+      --replace ' -s ' ' ' \
+      --replace 'LDFLAGS -s' 'LDFLAGS' \
+      --replace '-dynamiclib' ' ' \
+      --replace '-falign-loops=16' ' '
+    substituteInPlace Makefile --replace '-Wl,-soname,' ' '
+    '';
 
   configureFlags = [
     "--enable-pic"
@@ -31,7 +42,7 @@ stdenv.mkDerivation rec {
     description = "AVS encoder and decoder";
     homepage    = http://xavs.sourceforge.net/;
     license     = licenses.lgpl2;
-    platforms   = platforms.linux;
+    platforms   = platforms.linux ++ platforms.darwin;
     maintainers = with maintainers; [ codyopel ];
   };
 }