Fix how revision is embedded so that AppImage isn't always recompiled
This commit is contained in:
parent
e66f67da4a
commit
2876b56afb
@ -4,7 +4,7 @@
|
||||
hostSystem ? buildSystem,
|
||||
pkgsNix ? (import ./nix/pkgs.nix),
|
||||
|
||||
revision ? "",
|
||||
revision ? "dev",
|
||||
releaseName ? "dev",
|
||||
|
||||
bootstrap ? null,
|
||||
@ -28,7 +28,6 @@ in rec {
|
||||
name = "isle-version";
|
||||
|
||||
inherit buildSystem hostSystem revision releaseName;
|
||||
repoSrc = ./.;
|
||||
|
||||
nativeBuildInputs = [ pkgsNative.git ];
|
||||
|
||||
@ -41,11 +40,6 @@ in rec {
|
||||
|
||||
versionFile=version
|
||||
|
||||
if [ "$revision" = "" ]; then
|
||||
cp -r "$repoSrc" repoSrcCp
|
||||
revision="$(cd repoSrcCp && git rev-parse HEAD)"
|
||||
fi
|
||||
|
||||
echo "Release: $releaseName" >> "$versionFile"
|
||||
echo "Platform: $hostSystem" >> "$versionFile"
|
||||
echo "Git Revision: $revision" >> "$versionFile"
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
releaseName,
|
||||
revision,
|
||||
|
||||
buildSystem ? builtins.currentSystem,
|
||||
pkgsNix ? (import ./nix/pkgs.nix),
|
||||
@ -12,7 +13,7 @@
|
||||
mkRelease = hostSystem: let
|
||||
|
||||
appImage = ((import ./default.nix) {
|
||||
inherit buildSystem hostSystem releaseName;
|
||||
inherit buildSystem hostSystem releaseName revision;
|
||||
}).appImage;
|
||||
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
|
@ -19,7 +19,10 @@ if [ -e "$out" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
revision=$(git rev-parse HEAD)
|
||||
|
||||
result=$(nix-build \
|
||||
--argstr revision "$revision" \
|
||||
--argstr releaseName "$releaseName" \
|
||||
--no-out-link \
|
||||
release.nix \
|
||||
|
Loading…
Reference in New Issue
Block a user