about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/dart/package-source-builders/media_kit_libs_linux/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/dart/package-source-builders/media_kit_libs_linux/default.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/dart/package-source-builders/media_kit_libs_linux/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/dart/package-source-builders/media_kit_libs_linux/default.nix b/nixpkgs/pkgs/development/compilers/dart/package-source-builders/media_kit_libs_linux/default.nix
new file mode 100644
index 000000000000..92bfc7e7fa60
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/dart/package-source-builders/media_kit_libs_linux/default.nix
@@ -0,0 +1,33 @@
+{ stdenv
+}:
+
+# Implementation notes
+
+# The patch exploits the fact that the download part is enclosed with "# ---"
+# To use this module you will need to pass the CMake variable MIMALLOC_LIB
+# example: -DMIMALLOC_LIB=${pkgs.mimalloc}/lib/mimalloc.o
+
+# Direct link for the original CMakeLists.txt: https://raw.githubusercontent.com/media-kit/media-kit/main/libs/linux/media_kit_libs_linux/linux/CMakeLists.txt
+
+{version, src, ...}:
+
+stdenv.mkDerivation {
+  pname = "media_kit_libs_linux";
+  inherit version src;
+  inherit (src) passthru;
+
+  doBuild = false;
+
+  postPatch = ''
+    awk -i inplace 'BEGIN {opened = 0}; /# --*[^$]*/ { print (opened ? "]===]" : "#[===["); opened = !opened }; {print $0}' linux/CMakeLists.txt
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$out"
+    cp -r ./* "$out"
+
+    runHook postInstall
+  '';
+}