41 customPython = python3.withPackages (
50 runtimePaths = lib.makeLibraryPath [
61 rustPlatform.buildRustPackage {
63 version = "0-unstable-2024-09-09";
65 src = fetchFromGitHub {
68 rev = "938fd8c12fc2489303e12538d3e3585bd771141f";
69 hash = "sha256-CrpEBFYd8Qd0rxSnT81IvtxxEuYG0jWGJeHISvxalyY=";
72 # need to use a `Cargo.lock` as there are git dependencies
74 lockFile = ./Cargo.lock;
76 "derive_common-0.0.1" = "sha256-z0I2fQQlbUqaFU1EX45eYDy5IbZJ4SIget7WHzq4St0=";
77 "fontsan-0.5.2" = "sha256-4id66xxQ8iu0+OvJKH77WYPUE0eoVa9oUHmr6lRFPa8=";
78 "gilrs-0.10.6" = "sha256-RIfowFShWTPqgVWliK8Fc4cJw0YKITLvmexmTC0SwQk=";
79 "mozjs-0.14.1" = "sha256-RMM28Rd0r58VLfNEJzjWw3Ze6oKEi5lC1Edv03tJbfY=";
80 "peek-poke-0.3.0" = "sha256-WCZYX68vZrPhaAZwpx9/lUp3bVsLMwtmlJSW8wNb2ks=";
81 "servo-media-0.1.0" = "sha256-+J/6ZJPM9eus6YHJA6ENJD63CBiJTtKZdfORq9n6Nf8=";
82 "signpost-0.1.0" = "sha256-xRVXwW3Gynace9Yk5r1q7xA60yy6xhC5wLAyMJ6rPRs=";
83 "webxr-0.0.1" = "sha256-HZ8oWm5BaBLBXo4dS2CbWjpExry7dzeB2ddRLh7+98w=";
84 "naga-22.0.0" = "sha256-Xi2lWZCv4V2mUbQmwV1aw3pcvIIcyltKvv/C+LVqqDI=";
85 "raqote-0.8.5" = "sha256-WLsz5q08VNmYBxUhQ0hOn0K0RVFnnjaWF/MuQGkO/Rg=";
89 # Remap absolute path between modules to include SEMVER
90 # set `HOME` to a temp dir for write access
91 # Fix invalid option errors during linking (https://github.com/mozilla/nixpkgs-mozilla/commit/c72ff151a3e25f14182569679ed4cd22ef352328)
93 sed -i -e 's/\/style\//\/style-0.0.1\//g' ../cargo-vendor-dir/servo_atoms-0.0.1/build.rs
107 llvmPackages.libstdcxxClang
123 gst_all_1.gst-plugins-base
124 gst_all_1.gst-plugins-good
125 gst_all_1.gst-plugins-bad
126 gst_all_1.gst-plugins-ugly
133 ] ++ (lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.AppKit ]);
135 # copy resources into `$out` to be used during runtime
136 # link runtime libraries
138 mkdir -p $out/resources
139 cp -r ./resources $out/
141 wrapProgram $out/bin/servo \
142 --prefix LD_LIBRARY_PATH : ${runtimePaths}
145 LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib";
148 description = "The embeddable, independent, memory-safe, modular, parallel web rendering engine";
149 homepage = "https://servo.org";
150 license = lib.licenses.mpl20;
151 maintainers = with lib.maintainers; [ supinie ];
152 mainProgram = "servo";
153 platforms = lib.platforms.linux ++ lib.platforms.darwin;