summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2021-12-23 05:36:39 +0000
committerGitHub <noreply@github.com>2021-12-23 05:36:39 +0000
commitbdb09e90f75406068b061a69a3bde3878e5287fa (patch)
treef055bda1ad39b2d1785858bbea85aa48bc589a71
parent3d0a58ba10f925a7af7d348b270be378e5167c69 (diff)
parent15a12d81f08c05cfd0e98dc82445a28a52cce010 (diff)
downloadpatchelf-bdb09e90f75406068b061a69a3bde3878e5287fa.tar.gz
Merge pull request #362 from fzakaria/faridzakaria/musl-flake
Add support to build with musl
-rw-r--r--README.md8
-rw-r--r--flake.nix23
2 files changed, 27 insertions, 4 deletions
diff --git a/README.md b/README.md
index 18a72ee..9db921a 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,7 @@ libraries. In particular, it can do the following:
## Compiling and Testing
+### Via Autotools
```console
./bootstrap.sh
./configure
@@ -77,6 +78,13 @@ make
make check
sudo make install
```
+### Via Nix
+
+You can build with Nix in several ways.
+
+1. Building via `nix build` will produce the result in `./result/bin/patchelf`. If you would like to build _patchelf_ with _musl_ try `nix build .#patchelf-musl`
+
+2. You can launch a development environment with `nix develop` and folllow the autotools steps above. If you would like to develop with _musl_ try `nix develop .#musl`
## Author
diff --git a/flake.nix b/flake.nix
index 045b6d7..8c3988c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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;
@@ -85,12 +89,23 @@
build = self.hydraJobs.build.${system};
});
+ devShell = forAllSystems (system: self.devShells.${system}.glibc);
+
+ devShells = forAllSystems (system:
+ {
+ glibc = self.packages.${system}.patchelf;
+ musl = self.packages.${system}.patchelf-musl;
+ });
+
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;
+ });
+
};
}