|
25 | 25 | static-openssl = (final.openssl.override { static = true; }); |
26 | 26 | static-zlib = final.zlib.override { shared = false; }; |
27 | 27 | static-pcre = final.pcre.override { shared = false; }; |
| 28 | + static-snappy = final.snappy.override { static = true; }; |
28 | 29 | static-libblst = final.libblst.overrideDerivation (old: { |
29 | 30 | configureFlags = old.configureFlags ++ [ "--enable-static" "--disable-shared" ]; |
30 | 31 | buildPhase = '' |
|
41 | 42 | sed 's/^ILIBS\>.*/ILIBS = liblmdb.a/' -i Makefile |
42 | 43 | ''; |
43 | 44 | }); |
| 45 | + # liburing always builds both static and dynamic libraries, so we remove the .so |
| 46 | + # target the same way nixpkgs does for isStatic platforms. |
| 47 | + static-liburing = final.liburing.overrideAttrs (old: { |
| 48 | + dontdisableStatic = true; |
| 49 | + # There are several files in man/ that have the same filename but with |
| 50 | + # different case. When building on macOS, Nix renames these files with a |
| 51 | + # "~nix~case~hack~" suffix, and then the Makefile won't be able to find them |
| 52 | + # during the installPhase. Copy these back over the original. This should not |
| 53 | + # cause any case conflicts, because it will be built in a Linux VM. |
| 54 | + preInstall = '' |
| 55 | + # Rename any case-hacked files back to their original names |
| 56 | + for f in man/*~nix~case~hack~*; do |
| 57 | + if [ -f "$f" ]; then |
| 58 | + mv "$f" "''${f%~nix~case~hack~*}" |
| 59 | + fi |
| 60 | + done |
| 61 | + ''; |
| 62 | + |
| 63 | + postInstall = '' |
| 64 | + # Always builds both static and dynamic libraries, so we need to remove the |
| 65 | + # dynamic libraries. |
| 66 | + rm $out/lib/liburing*.so* |
| 67 | +
|
| 68 | + # Copy the examples into $bin. Most reverse dependency of |
| 69 | + # this package should reference only the $out output |
| 70 | + for file in $(find ./examples -executable -type f); do |
| 71 | + install -Dm555 -t "$bin/bin" "$file" |
| 72 | + done |
| 73 | + ''; |
| 74 | + }); |
44 | 75 | }); |
45 | 76 |
|
46 | 77 | # nixpkgs defines happy = justStaticExecutables haskellPackages.happy |
|
0 commit comments