From 9948053812edca8e9c78afb03408a8fed0e1d8ad Mon Sep 17 00:00:00 2001 From: "Yang, Bo" Date: Thu, 14 Jul 2022 23:38:10 +0000 Subject: [PATCH] Set up version number for deb and rpm See https://github.com/hhvm/packaging/issues/311 for version schema --- flake.nix | 5 ++++- hhvm.nix | 6 ++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 5bfd3e8e1726c..95c8c5ffd2295 100644 --- a/flake.nix +++ b/flake.nix @@ -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) + } \ --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))} \ diff --git a/hhvm.nix b/hhvm.nix index e678421260df2..71fc04579599d 100644 --- a/hhvm.nix +++ b/hhvm.nix @@ -80,10 +80,8 @@ 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"; @@ -91,7 +89,7 @@ let }; in stdenv.mkDerivation rec { - pname = builtins.foldl' lib.trivial.id makePName versionParts; + pname = "hhvm"; version = builtins.foldl' lib.trivial.id makeVersion versionParts; src = ./.; nativeBuildInputs =