diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 69df1784..03a3f456 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -73,6 +73,16 @@ jobs: if: matrix.platform != 'amd64' uses: docker/setup-qemu-action@v3 + - name: Set docker arch + run: | + platform=${{ matrix.platform }} + if [[ $platform == arm64v8 ]]; then + platform=arm64 + elif [[ $platform == arm32v7 ]]; then + platform=arm + fi + echo "DOCKER_PLATFORM=$platform" >> $GITHUB_ENV + - uses: actions/download-artifact@v3 with: name: patchelf @@ -100,7 +110,7 @@ jobs: else ENTRYPOINT= fi - docker run -e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh" + docker run --platform "$DOCKER_PLATFORM" -e CXXFLAGS -v $(pwd):/gha ${{ matrix.platform }}/alpine:edge ${ENTRYPOINT} sh -ec "cd /gha && sh ./build.sh" - name: Check binaries run: | cat < check.sh @@ -109,7 +119,7 @@ jobs: tar -xf ./dist/patchelf-*-*.tar.gz ./bin/patchelf --version EOF - docker run -v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh" + docker run --platform "$DOCKER_PLATFORM" -v $(pwd):/gha ${{ matrix.platform }}/debian:unstable-slim sh -ec "cd /gha && sh ./check.sh" - uses: actions/upload-artifact@v3 with: name: patchelf diff --git a/flake.lock b/flake.lock index 1e068201..eda6a5f7 100644 --- a/flake.lock +++ b/flake.lock @@ -2,17 +2,18 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1672057183, - "narHash": "sha256-GN7/10DNNvs1FPj9tlZA2qgNdFuYKKuS3qlHTqAxasQ=", + "lastModified": 1731763621, + "narHash": "sha256-ddcX4lQL0X05AYkrkV2LMFgGdRvgap7Ho8kgon3iWZk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b139e44d78c36c69bcbb825b20dbfa51e7738347", + "rev": "c69a9bffbecde46b4b939465422ddc59493d3e4d", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "NixOS", "ref": "nixpkgs-unstable", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "root": { diff --git a/flake.nix b/flake.nix index 471a31b9..84c6f6db 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "A tool for modifying ELF executables and libraries"; - inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; outputs = { self, nixpkgs }: @@ -36,6 +36,11 @@ versionSuffix = ""; # obsolete src = self; preAutoconf = "echo ${version} > version"; + + # portable configure shouldn't have a shebang pointing to the nix store + postConfigure = '' + sed -i '1s|^.*$|#!/bin/sh|' ./configure + ''; postDist = '' cp README.md $out/ echo "doc readme $out/README.md" >> $out/nix-support/hydra-build-products