Skip to content

Commit

Permalink
Set up version number for deb and rpm
Browse files Browse the repository at this point in the history
See hhvm/packaging#311 for version schema
  • Loading branch information
Atry committed Jul 14, 2022
1 parent 9ebe9e4 commit 8101a0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
--input-type dir \
--output-type ${outputType} \
--name ${pkgs.lib.strings.escapeShellArg pkg.pname} \
--version ${pkgs.lib.strings.escapeShellArg pkg.version} \
--version ${
pkgs.lib.strings.escapeShellArg
(builtins.replaceStrings ["-"] ["~"] pkg.version)sudo
} \
--description ${pkgs.lib.strings.escapeShellArg pkg.meta.description} \
--url ${pkgs.lib.strings.escapeShellArg pkg.meta.homepage} \
--maintainer ${pkgs.lib.strings.escapeShellArg (pkgs.lib.strings.concatStringsSep ", " (map ({name, email, ...}: "\"${name}\" <${email}>") pkg.meta.maintainers))} \
Expand Down
6 changes: 2 additions & 4 deletions hhvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,16 @@ let
.*
''
(builtins.readFile ./hphp/runtime/version.h);
makePName = major: minor: patch: suffix:
if suffix == "-dev" then "hhvm_nightly" else "hhvm";
makeVersion = major: minor: patch: suffix:
if suffix == "-dev" then "${major}.${minor}.${patch}-${lastModifiedDate}" else "${major}.${minor}.${patch}";
if suffix == "-dev" then "${major}.${minor}.${patch}-dev${lastModifiedDate}" else "${major}.${minor}.${patch}";
rustNightly = rustChannelOf {
sha256 = "TpJKRroEs7V2BTo2GFPJlEScYVArFY2MnGpYTxbnSo8=";
date = "2022-02-24";
channel = "nightly";
};
in
stdenv.mkDerivation rec {
pname = builtins.foldl' lib.trivial.id makePName versionParts;
pname = "hhvm";
version = builtins.foldl' lib.trivial.id makeVersion versionParts;
src = ./.;
nativeBuildInputs =
Expand Down

0 comments on commit 8101a0e

Please sign in to comment.