diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2018-09-07 15:08:06 +0200 |
---|---|---|
committer | Andreas Rammhold <andreas@rammhold.de> | 2018-09-13 20:28:39 +0200 |
commit | 137181506065ebb0cfd218d696b13a1ea7642b41 (patch) | |
tree | 6495c9f5da90f4fd56f9fa42df74c7b7a6ce64c5 /pkgs/build-support/rust/build-rust-crate/install-crate.nix | |
parent | 0c50140da5bcc55c588ac64bfcedac4699a43711 (diff) | |
download | nixpkgs-137181506065ebb0cfd218d696b13a1ea7642b41.tar nixpkgs-137181506065ebb0cfd218d696b13a1ea7642b41.tar.gz nixpkgs-137181506065ebb0cfd218d696b13a1ea7642b41.tar.bz2 nixpkgs-137181506065ebb0cfd218d696b13a1ea7642b41.tar.lz nixpkgs-137181506065ebb0cfd218d696b13a1ea7642b41.tar.xz nixpkgs-137181506065ebb0cfd218d696b13a1ea7642b41.tar.zst nixpkgs-137181506065ebb0cfd218d696b13a1ea7642b41.zip |
buildRustCrate: extracted builder scripts into dedicated files
The build expression got quiet large over time and to make it a bit easier to grasp the different scripts involved in the build are now separated from the nix file.
Diffstat (limited to 'pkgs/build-support/rust/build-rust-crate/install-crate.nix')
-rw-r--r-- | pkgs/build-support/rust/build-rust-crate/install-crate.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/build-support/rust/build-rust-crate/install-crate.nix b/pkgs/build-support/rust/build-rust-crate/install-crate.nix new file mode 100644 index 00000000000..c41df34ca39 --- /dev/null +++ b/pkgs/build-support/rust/build-rust-crate/install-crate.nix @@ -0,0 +1,28 @@ +crateName: metadata: +'' + runHook preInstall + mkdir -p $out + if [[ -s target/env ]]; then + cp target/env $out/env + fi + if [[ -s target/link.final ]]; then + mkdir -p $out/lib + cp target/link.final $out/lib/link + fi + if [[ "$(ls -A target/lib)" ]]; then + mkdir -p $out/lib + cp target/lib/* $out/lib #*/ + for lib in $out/lib/*.so $out/lib/*.dylib; do #*/ + ln -s $lib $(echo $lib | sed -e "s/-${metadata}//") + done + fi + if [[ "$(ls -A target/build)" ]]; then # */ + mkdir -p $out/lib + cp -r target/build/* $out/lib # */ + fi + if [[ "$(ls -A target/bin)" ]]; then + mkdir -p $out/bin + cp -P target/bin/* $out/bin # */ + fi + runHook postInstall +'' |