Skip to content

Commit

Permalink
Add support to build with musl
Browse files Browse the repository at this point in the history
Add support to the flake.nix to build with musl
```
nix build .#patchelf-musl
```
  • Loading branch information
fzakaria committed Dec 22, 2021
1 parent c172ce6 commit 50d4335
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ Makefile
.direnv/
.vscode/
.idea/
result
19 changes: 15 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

{
overlay = final: prev: {
patchelf-new-musl = final.pkgsMusl.callPackage ./patchelf.nix {
inherit version;
src = self;
};
patchelf-new = final.callPackage ./patchelf.nix {
inherit version;
src = self;
Expand Down Expand Up @@ -85,12 +89,19 @@
build = self.hydraJobs.build.${system};
});

devShell = forAllSystems (system: pkgs.mkShell {
buildInputs = [ self.defaultPackage.${system}.inputDerivation];
});

defaultPackage = forAllSystems (system:
(import nixpkgs {
inherit system;
overlays = [ self.overlay ];
}).patchelf-new
self.packages.${system}.patchelf
);

packages = forAllSystems (system:
{
patchelf = nixpkgsFor.${system}.patchelf-new;
patchelf-musl = nixpkgsFor.${system}.patchelf-new-musl;
});

};
}

0 comments on commit 50d4335

Please sign in to comment.