Skip to content

Commit

Permalink
Fixed nix build packages
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Jul 17, 2024
1 parent 9558da4 commit 6dff63b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
15 changes: 9 additions & 6 deletions crates/hc-pilot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@
++ (inputs.hc-infra.outputs.lib.holochainAppDeps.nativeBuildInputs {
inherit pkgs lib;
});

# TODO: remove this if possible
postPatch = ''
mkdir -p "$TMPDIR/nix-vendor"
cp -Lr "$cargoVendorDir" -T "$TMPDIR/nix-vendor"
sed -i "s|$cargoVendorDir|$TMPDIR/nix-vendor/|g" "$TMPDIR/nix-vendor/config.toml"
chmod -R +w "$TMPDIR/nix-vendor"
cargoVendorDir="$TMPDIR/nix-vendor"
'';
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
cargoArtifacts = (self.lib.tauriHappCargoArtifacts { inherit pkgs lib; });
version = "workspace";
pname = "workspace";
});
in craneLib.buildPackage (commonArgs // {
pname = crate;
version = cargoToml.package.version;
inherit cargoArtifacts;
});
};
}
17 changes: 10 additions & 7 deletions crates/scaffold-holochain-runtime/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
crate = cargoToml.package.name;

commonArgs = {
src = (self.lib.cleanTauriSource { inherit lib; }) (craneLib.path ../../.);
src =
(self.lib.cleanTauriSource { inherit lib; }) (craneLib.path ../../.);
doCheck = false;
buildInputs = inputs.hc-infra.outputs.lib.holochainAppDeps.buildInputs {
inherit pkgs lib;
Expand All @@ -23,16 +24,18 @@
++ (inputs.hc-infra.outputs.lib.holochainAppDeps.nativeBuildInputs {
inherit pkgs lib;
});
# TODO: remove this if possible
postPatch = ''
mkdir -p "$TMPDIR/nix-vendor"
cp -Lr "$cargoVendorDir" -T "$TMPDIR/nix-vendor"
sed -i "s|$cargoVendorDir|$TMPDIR/nix-vendor/|g" "$TMPDIR/nix-vendor/config.toml"
chmod -R +w "$TMPDIR/nix-vendor"
cargoVendorDir="$TMPDIR/nix-vendor"
'';
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
cargoArtifacts = (self.lib.tauriHappCargoArtifacts { inherit pkgs lib; });
version = "workspace";
pname = "workspace";
});
in craneLib.buildPackage (commonArgs // {
pname = crate;
version = cargoToml.package.version;
inherit cargoArtifacts;
});

};
Expand Down
17 changes: 10 additions & 7 deletions crates/scaffold-tauri-happ/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
crate = cargoToml.package.name;

commonArgs = {
src = (self.lib.cleanTauriSource { inherit lib; }) (craneLib.path ../../.);
src =
(self.lib.cleanTauriSource { inherit lib; }) (craneLib.path ../../.);
doCheck = false;
buildInputs = inputs.hc-infra.outputs.lib.holochainAppDeps.buildInputs {
inherit pkgs lib;
Expand All @@ -22,16 +23,18 @@
++ (inputs.hc-infra.outputs.lib.holochainAppDeps.nativeBuildInputs {
inherit pkgs lib;
});
# TODO: remove this if possible
postPatch = ''
mkdir -p "$TMPDIR/nix-vendor"
cp -Lr "$cargoVendorDir" -T "$TMPDIR/nix-vendor"
sed -i "s|$cargoVendorDir|$TMPDIR/nix-vendor/|g" "$TMPDIR/nix-vendor/config.toml"
chmod -R +w "$TMPDIR/nix-vendor"
cargoVendorDir="$TMPDIR/nix-vendor"
'';
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
cargoArtifacts = (self.lib.tauriHappCargoArtifacts { inherit pkgs lib; });
version = "workspace";
pname = "workspace";
});
in craneLib.buildPackage (commonArgs // {
pname = crate;
version = cargoToml.package.version;
inherit cargoArtifacts;
});
};
}

0 comments on commit 6dff63b

Please sign in to comment.