about summary refs log tree commit diff
path: root/machines/rpi3-amadeus/mpdecimal.nix
diff options
context:
space:
mode:
Diffstat (limited to 'machines/rpi3-amadeus/mpdecimal.nix')
-rw-r--r--machines/rpi3-amadeus/mpdecimal.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/machines/rpi3-amadeus/mpdecimal.nix b/machines/rpi3-amadeus/mpdecimal.nix
new file mode 100644
index 0000000..fee59ee
--- /dev/null
+++ b/machines/rpi3-amadeus/mpdecimal.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, gcc, binutils }:
+
+let
+  pname = "mpdecimal";
+  version = "2.5.0";
+in
+stdenv.mkDerivation {
+  inherit pname version;
+
+  src = fetchurl {
+    url = "https://www.bytereef.org/software/${pname}/releases/${pname}-${version}.tar.gz";
+    sha256 = "1jm0vzlcsapx9ilrvns4iyws6n5i48zpxykmklfpv98jivf7wh8m";
+  };
+
+  buildPhase = ''
+    ./configure
+
+    sed -i 's/-Wl,//' libmpdec/Makefile
+    make
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp libmpdec/*.so* $out/lib
+  '';
+
+}