mirror of
https://github.com/NixOS/nix
synced 2025-06-25 02:21:16 +02:00
Write just ./.version on all components
This way it's easier to get right. See previous commit.
This commit is contained in:
parent
bba4e6b061
commit
3556f6bf4c
23 changed files with 16 additions and 178 deletions
|
@ -42,6 +42,18 @@ let
|
||||||
mkPackageBuilder =
|
mkPackageBuilder =
|
||||||
exts: userFn: stdenv.mkDerivation (lib.extends (lib.composeManyExtensions exts) userFn);
|
exts: userFn: stdenv.mkDerivation (lib.extends (lib.composeManyExtensions exts) userFn);
|
||||||
|
|
||||||
|
setVersionLayer = finalAttrs: prevAttrs: {
|
||||||
|
preConfigure =
|
||||||
|
prevAttrs.prevAttrs or ""
|
||||||
|
+
|
||||||
|
# Update the repo-global .version file.
|
||||||
|
# Symlink ./.version points there, but by default only workDir is writable.
|
||||||
|
''
|
||||||
|
chmod u+w ./.version
|
||||||
|
echo ${finalAttrs.version} > ./.version
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
localSourceLayer =
|
localSourceLayer =
|
||||||
finalAttrs: prevAttrs:
|
finalAttrs: prevAttrs:
|
||||||
let
|
let
|
||||||
|
@ -180,12 +192,14 @@ scope:
|
||||||
mkMesonDerivation = mkPackageBuilder [
|
mkMesonDerivation = mkPackageBuilder [
|
||||||
miscGoodPractice
|
miscGoodPractice
|
||||||
localSourceLayer
|
localSourceLayer
|
||||||
|
setVersionLayer
|
||||||
mesonLayer
|
mesonLayer
|
||||||
];
|
];
|
||||||
mkMesonExecutable = mkPackageBuilder [
|
mkMesonExecutable = mkPackageBuilder [
|
||||||
miscGoodPractice
|
miscGoodPractice
|
||||||
bsdNoLinkAsNeeded
|
bsdNoLinkAsNeeded
|
||||||
localSourceLayer
|
localSourceLayer
|
||||||
|
setVersionLayer
|
||||||
mesonLayer
|
mesonLayer
|
||||||
mesonBuildLayer
|
mesonBuildLayer
|
||||||
];
|
];
|
||||||
|
@ -194,6 +208,7 @@ scope:
|
||||||
bsdNoLinkAsNeeded
|
bsdNoLinkAsNeeded
|
||||||
localSourceLayer
|
localSourceLayer
|
||||||
mesonLayer
|
mesonLayer
|
||||||
|
setVersionLayer
|
||||||
mesonBuildLayer
|
mesonBuildLayer
|
||||||
mesonLibraryLayer
|
mesonLibraryLayer
|
||||||
];
|
];
|
||||||
|
|
|
@ -64,14 +64,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
(lib.mesonEnable "markdown" enableMarkdown)
|
(lib.mesonEnable "markdown" enableMarkdown)
|
||||||
(lib.mesonOption "readline-flavor" readlineFlavor)
|
(lib.mesonOption "readline-flavor" readlineFlavor)
|
||||||
|
|
|
@ -36,14 +36,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nix-expr
|
nix-expr
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -40,14 +40,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
rapidcheck
|
rapidcheck
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -46,14 +46,6 @@ mkMesonExecutable (finalAttrs: {
|
||||||
gtest
|
gtest
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -77,14 +77,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
] ++ lib.optional enableGC boehmgc;
|
] ++ lib.optional enableGC boehmgc;
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
(lib.mesonEnable "gc" enableGC)
|
(lib.mesonEnable "gc" enableGC)
|
||||||
];
|
];
|
||||||
|
|
|
@ -44,14 +44,6 @@ mkMesonExecutable (finalAttrs: {
|
||||||
gtest
|
gtest
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -41,14 +41,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
platforms = lib.platforms.unix ++ lib.platforms.windows;
|
platforms = lib.platforms.unix ++ lib.platforms.windows;
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,14 +38,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nix-flake
|
nix-flake
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -46,14 +46,6 @@ mkMesonExecutable (finalAttrs: {
|
||||||
gtest
|
gtest
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -40,14 +40,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
platforms = lib.platforms.unix ++ lib.platforms.windows;
|
platforms = lib.platforms.unix ++ lib.platforms.windows;
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,14 +40,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nix-main
|
nix-main
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -37,14 +37,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
openssl
|
openssl
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
platforms = lib.platforms.unix ++ lib.platforms.windows;
|
platforms = lib.platforms.unix ++ lib.platforms.windows;
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,14 +36,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nix-store
|
nix-store
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -40,14 +40,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
rapidcheck
|
rapidcheck
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -52,14 +52,6 @@ mkMesonExecutable (finalAttrs: {
|
||||||
nix-store-test-support
|
nix-store-test-support
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -69,14 +69,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags =
|
mesonFlags =
|
||||||
[
|
[
|
||||||
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
|
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
|
||||||
|
|
|
@ -34,14 +34,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nix-util
|
nix-util
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -38,14 +38,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
rapidcheck
|
rapidcheck
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -45,14 +45,6 @@ mkMesonExecutable (finalAttrs: {
|
||||||
gtest
|
gtest
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -54,17 +54,6 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
#
|
|
||||||
# TODO: change release process to add `pre` in `.version`, remove it
|
|
||||||
# before tagging, and restore after.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
(lib.mesonEnable "cpuid" stdenv.hostPlatform.isx86_64)
|
(lib.mesonEnable "cpuid" stdenv.hostPlatform.isx86_64)
|
||||||
];
|
];
|
||||||
|
|
|
@ -91,14 +91,6 @@ mkMesonExecutable (finalAttrs: {
|
||||||
nix-cmd
|
nix-cmd
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
|
||||||
# Update the repo-global .version file.
|
|
||||||
# Symlink ./.version points there, but by default only workDir is writable.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ./.version
|
|
||||||
'';
|
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -75,16 +75,10 @@ mkMesonDerivation (
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure =
|
preConfigure =
|
||||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
|
||||||
# Do the meson utils, without modification.
|
|
||||||
''
|
|
||||||
chmod u+w ./.version
|
|
||||||
echo ${version} > ../../../.version
|
|
||||||
''
|
|
||||||
# TEMP hack for Meson before make is gone, where
|
# TEMP hack for Meson before make is gone, where
|
||||||
# `src/nix-functional-tests` is during the transition a symlink and
|
# `src/nix-functional-tests` is during the transition a symlink and
|
||||||
# not the actual directory directory.
|
# not the actual directory directory.
|
||||||
+ ''
|
''
|
||||||
cd $(readlink -e $PWD)
|
cd $(readlink -e $PWD)
|
||||||
echo $PWD | grep tests/functional
|
echo $PWD | grep tests/functional
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue