nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 38 lines 980 B view raw
1{ 2 lib, 3 stdenv, 4 mimalloc, 5}: 6 7{ version, src, ... }: 8 9stdenv.mkDerivation { 10 pname = "media_kit_libs_linux"; 11 inherit version src; 12 inherit (src) passthru; 13 14 dontBuild = true; 15 16 # Remove mimalloc download 17 # 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 18 postPatch = '' 19 pushd ${src.passthru.packageRoot} 20 '' 21 + lib.optionalString (lib.versionAtLeast version "1.2.1") '' 22 sed -i '/if(MIMALLOC_USE_STATIC_LIBS)/,/unset(MIMALLOC_USE_STATIC_LIBS CACHE)/c\set(MIMALLOC_LIB "${lib.getLib mimalloc}/lib/mimalloc.o" CACHE INTERNAL "")' linux/CMakeLists.txt 23 '' 24 + lib.optionalString (lib.versionOlder version "1.2.1") '' 25 sed -i '/# --\+/,/# --\+/c\set(MIMALLOC_LIB "${lib.getLib mimalloc}/lib/mimalloc.o")' linux/CMakeLists.txt 26 '' 27 + '' 28 popd 29 ''; 30 31 installPhase = '' 32 runHook preInstall 33 34 cp -r . $out 35 36 runHook postInstall 37 ''; 38}