3 flake-utils.url = "github:numtide/flake-utils";
4 flake-compat.url = "github:edolstra/flake-compat";
5 flake-compat.flake = false;
6 nixpkgs-mozilla.url = "github:mozilla/nixpkgs-mozilla";
9 { self, nixpkgs, flake-utils, flake-compat, nixpkgs-mozilla }:
10 flake-utils.lib.eachSystem [
17 pkgs = import nixpkgs {
20 nixpkgs-mozilla.overlays.rust
22 config.permittedInsecurePackages = [
23 # It's OK to depend on libdwarf 20210528, because we did not call
24 # the particular vulnerable function in libdwarf
28 devShellForPackage = hhvm:
30 { stdenv = hhvm.stdenv; }
46 packages.hhvm = pkgs.callPackage ./hhvm.nix {
47 lastModifiedDate = self.lastModifiedDate;
49 packages.hhvm_clang = packages.hhvm.override {
50 stdenv = pkgs.llvmPackages_14.stdenv;
52 packages.default = packages.hhvm;
54 devShells.clang = devShellForPackage packages.hhvm_clang;
55 devShells.default = devShellForPackage packages.hhvm;
57 ${if pkgs.hostPlatform.isLinux then "bundlers" else null} =
62 # Copy to a temporary directory as a workaround to https://github.com/jordansissel/fpm/issues/807
65 mkdir -p "$(dirname "./$LINE")"
66 cp -r "/$LINE" "./$LINE"
67 chmod --recursive u+w "./$LINE"
68 FPM_INPUTS+=("./$LINE")
69 done < ${pkgs.lib.strings.escapeShellArg (pkgs.referencesByPopularity pkg)}
71 ${pkgs.lib.strings.escapeShellArg pkgs.fpm}/bin/fpm \
75 --output-type ${outputType} \
76 --name ${pkgs.lib.strings.escapeShellArg pkg.pname} \
78 pkgs.lib.strings.escapeShellArg
79 (builtins.replaceStrings ["-"] ["~"] pkg.version)
81 --description ${pkgs.lib.strings.escapeShellArg pkg.meta.description} \
82 --url ${pkgs.lib.strings.escapeShellArg pkg.meta.homepage} \
83 --maintainer ${pkgs.lib.strings.escapeShellArg (pkgs.lib.strings.concatStringsSep ", " (map ({name, email, ...}: "\"${name}\" <${email}>") pkg.meta.maintainers))} \
84 --license ${pkgs.lib.strings.escapeShellArg (pkgs.lib.strings.concatStringsSep " AND " (map ({spdxId, ...}: spdxId) (pkgs.lib.lists.toList pkg.meta.license)))} \
86 pkgs.writeScript "after-install.sh" ''
87 for EXECUTABLE in ${pkgs.lib.strings.escapeShellArg pkg}/bin/*
89 NAME=$(basename "$EXECUTABLE")
90 update-alternatives --install "/usr/bin/$NAME" "$NAME" "$EXECUTABLE" 1
95 pkgs.writeScript "before-remove.sh" ''
96 for EXECUTABLE in ${pkgs.lib.strings.escapeShellArg pkg}/bin/*
98 NAME=$(basename "$EXECUTABLE")
99 update-alternatives --remove "$NAME" "$EXECUTABLE"
108 rpm = pkg: pkgs.runCommand
110 { nativeBuildInputs = [ pkgs.rpm ]; }
111 (fpmScript "rpm" pkg);
112 deb = pkg: pkgs.runCommand
114 { nativeBuildInputs = [ pkg.stdenv.cc ]; }
115 (fpmScript "deb" pkg);