Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ jobs:
with:
skip_adding_nixpkgs_channel: true
- run: nix-build release.nix
tests-musl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v9
with:
skip_adding_nixpkgs_channel: true
- run: nix-build release.nix --arg isMusl true --arg systems '[ "x86_64-linux" ]'
25 changes: 17 additions & 8 deletions release.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{ patchelfSrc ? { outPath = ./.; revCount = 1234; shortRev = "abcdef"; }
, nixpkgs ? builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz
, nixpkgs ? builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz
, officialRelease ? false
, isMusl ? false
, systems ? [ "x86_64-linux" "i686-linux" "aarch64-linux" ]
}:

let

pkgs = import nixpkgs { system = builtins.currentSystem or "x86_64-linux"; };

loadPkgs = system:
let
pkgsInit = import nixpkgs { inherit system; };
in if isMusl
then pkgsInit.pkgsMusl
else pkgsInit;

pkgs = loadPkgs (builtins.currentSystem or "x86_64-linux");

jobs = rec {


Expand All @@ -24,6 +32,7 @@ let
versionSuffix = ""; # obsolete
src = patchelfSrc;
preAutoconf = "echo ${version} > version";
preFinal = "set -xe";
postDist = ''
cp README.md $out/
echo "doc readme $out/README.md" >> $out/nix-support/hydra-build-products
Expand All @@ -39,9 +48,9 @@ let
};


build = pkgs.lib.genAttrs [ "x86_64-linux" "i686-linux" "aarch64-linux" /* "x86_64-freebsd" "i686-freebsd" "x86_64-darwin" "i686-solaris" "i686-cygwin" */ ] (system:
build = pkgs.lib.genAttrs systems (system:

with import nixpkgs { inherit system; };
with (loadPkgs system);

releaseTools.nixBuild {
name = "patchelf";
Expand All @@ -67,7 +76,7 @@ let
constituents =
[ tarball
build.x86_64-linux
build.i686-linux
(build.i686-linux or null)
/*
rpm_fedora27x86_64
deb_debian9i386
Expand All @@ -88,7 +97,7 @@ let
makeRPM =
system: diskImageFun:

with import nixpkgs { inherit system; };
with (loadPkgs system);

releaseTools.rpmBuild rec {
name = "patchelf-rpm";
Expand All @@ -104,7 +113,7 @@ let
makeDeb =
system: diskImageFun:

with import nixpkgs { inherit system; };
with (loadPkgs system);

releaseTools.debBuild {
name = "patchelf-deb";
Expand Down