diff --git a/.github/workflows/build-file.yml b/.github/workflows/build-file.yml new file mode 100644 index 0000000..999daf5 --- /dev/null +++ b/.github/workflows/build-file.yml @@ -0,0 +1,32 @@ +on: + workflow_call: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: file4win + PR_NUMBER: ${{ github.event.number }} + +jobs: + build-file: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Docker Tag Metadata + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=pr + - name: Docker Build + run: docker build -f Dockerfiles/file/Dockerfile.file --build-arg MINGW_VERSION=pr-${{ env.PR_NUMBER }} -t ${{ steps.meta.outputs.tags }} --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:main --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:pr-${{ env.PR_NUMBER }} . + - name: Docker Push + run: docker push ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-gpg.yml b/.github/workflows/build-gpg.yml new file mode 100644 index 0000000..7dbf786 --- /dev/null +++ b/.github/workflows/build-gpg.yml @@ -0,0 +1,32 @@ +on: + workflow_call: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: gpg4win + PR_NUMBER: ${{ github.event.number }} + +jobs: + build-gpg: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Docker Tag Metadata + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=pr + - name: Docker Build + run: docker build -f Dockerfiles/gpg/Dockerfile.gpg --build-arg MINGW_VERSION=pr-${{ env.PR_NUMBER }} -t ${{ steps.meta.outputs.tags }} --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:main --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:pr-${{ env.PR_NUMBER }} . + - name: Docker Push + run: docker push ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/build-mingw.yml b/.github/workflows/build-mingw.yml new file mode 100644 index 0000000..2ca08c2 --- /dev/null +++ b/.github/workflows/build-mingw.yml @@ -0,0 +1,32 @@ +on: + workflow_call: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: mingw-w64 + PR_NUMBER: ${{ github.event.number }} + +jobs: + build-mingw-w64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Docker Tag Metadata + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=pr + - name: Docker Build + run: docker build -f Dockerfiles/mingw-w64/Dockerfile.mingw-w64 -t ${{ steps.meta.outputs.tags }} --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:main --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:pr-${{ env.PR_NUMBER }} . + - name: Docker Push + run: docker push ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/test-resources.yml b/.github/workflows/test-resources.yml new file mode 100644 index 0000000..9fed63d --- /dev/null +++ b/.github/workflows/test-resources.yml @@ -0,0 +1,54 @@ +name: "Test Build Resources" + +on: + pull_request: + branches: + - main + +concurrency: + group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}} + cancel-in-progress: true + +jobs: + changed: + name: "Build and Upload Resources" + runs-on: ubuntu-latest + outputs: + mingw: ${{ steps.changes.outputs.mingw }} + file: ${{ steps.changes.outputs.file }} + gpg: ${{ steps.changes.outputs.gpg }} + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: changes + with: + filters: | + mingw: + - 'Dockerfiles/mingw-w64/**' + file: + - 'Dockerfiles/file/**' + gpg: + - 'Dockerfiles/gpg/**' + build-mingw: + name: "Mingw-w64 build" + if: ${{ needs.changed.outputs.mingw }} + needs: [changed] + uses: ./.github/workflows/build-mingw.yml + + build-gpg: + name: "Gpg x-build for Windows" + if: | + always() && + needs.changed.outputs.gpg && + (needs.build-mingw.result == 'success' || needs.build-mingw.result == 'skipped') + needs: [build-mingw, changed] + uses: ./.github/workflows/build-gpg.yml + + build-file: + name: "File x-build for Windows" + if: | + always() && + needs.changed.outputs.file && + (needs.build-mingw.result == 'success' || needs.build-mingw.result == 'skipped') + needs: [build-mingw, changed] + uses: ./.github/workflows/build-file.yml diff --git a/.github/workflows/update-file.yml b/.github/workflows/update-file.yml new file mode 100644 index 0000000..c455edb --- /dev/null +++ b/.github/workflows/update-file.yml @@ -0,0 +1,65 @@ +on: + workflow_call: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: file + +jobs: + build-file: + permissions: + contents: read + packages: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=refs,event=push + type=sha + flavor: | + latest=true + - name: Docker Build + run: docker build -f Dockerfiles/file/Dockerfile.file -t ${{ steps.meta.outputs.tags }} --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:main . + - name: Docker Push + run: docker push ${{ steps.meta.outputs.tags }} + push-file: + runs-on: ubuntu-latest + needs: [build-file] + steps: + - uses: actions/checkout@v4 + with: + fetch_depth: 0 + - name: Extract file binary tree + archive + run: | + mkdir -p tmp/resources/file + export CONTAINER_ID=$(docker create ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest) + docker cp $CONTAINER_ID:/opt/file tmp/resources/file/file + docker cp $CONTAINER_ID:/opt/mingw64-w64/x86_64-w64-mingw32/bin/libgnurx-0.dll tmp/resource/file/file/bin + cd tmp/resources/file + tar -cz file > file.tar.gz + - name: Checkout pages + run: | + git fetch --all + git checkout -f -B pages --track origin/pages + - name: Config git user + run: | + git config --local user.email "action@github.com" + git config --local user.name "Github Actions from commit ${{ github.sha }}" + - name: Upload + run: | + rm -rf resources/file/* + mv tmp/resources/file/file.tar.gz resources/file/file.tar.gz + git add resources/file/file.tar.gz && git commit -m"Update file binary" && git push -f diff --git a/.github/workflows/update-gpg.yml b/.github/workflows/update-gpg.yml new file mode 100644 index 0000000..dc85092 --- /dev/null +++ b/.github/workflows/update-gpg.yml @@ -0,0 +1,63 @@ +on: + workflow_call: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: gpg + +jobs: + build-gpg: + permissions: + contents: read + packages: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=refs,event=push + type=sha + flavor: | + latest=true + - name: Docker Build + run: docker build -f Dockerfiles/gpg/Dockerfile.gpg -t ${{ steps.meta.outputs.tags }} --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:main . + - name: Docker Push + run: docker push ${{ steps.meta.outputs.tags }} + push-gpg: + runs-on: ubuntu-latest + needs: [build-gpg] + steps: + - uses: actions/checkout@v4 + with: + fetch_depth: 0 + - name: Extract gpg binary tree + archive + run: | + mkdir -p tmp/resources/gpg + docker cp $(docker create ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest):/opt/gpg tmp/resources/gpg/gpg + cd tmp/resources/gpg + tar -cz gpg > gpg.tar.gz + - name: Checkout pages + run: | + git fetch --all + git checkout -f -B pages --track origin/pages + - name: Config git user + run: | + git config --local user.email "action@github.com" + git config --local user.name "Github Actions from commit ${{ github.sha }}" + - name: Upload + run: | + rm -rf resources/gpg/* + mv tmp/resources/gpg/gpg.tar.gz resources/gpg/gpg.tar.gz + git add resources/gpg/gpg.tar.gz && git commit -m"Update gpg binary" && git push -f diff --git a/.github/workflows/update-mingw.yml b/.github/workflows/update-mingw.yml new file mode 100644 index 0000000..2e830aa --- /dev/null +++ b/.github/workflows/update-mingw.yml @@ -0,0 +1,64 @@ +on: + workflow_call: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: mingw-w64 + +jobs: + build-mingw-w64: + permissions: + contents: read + packages: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + tags: | + type=refs,event=push + type=sha + flavor: | + latest=true + - name: Docker Build + run: docker build -f Dockerfiles/mingw-w64/Dockerfile.mingw-w64 -t ${{ steps.meta.outputs.tags }} --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest --cache-from type=registry,ref=${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:main . + - name: Docker Push + run: docker push ${{ steps.meta.outputs.tags }} + + push-mingw-w64: + runs-on: ubuntu-latest + needs: [build-mingw-w64] + steps: + - uses: actions/checkout@v4 + with: + fetch_depth: 0 + - name: Extract mingw-w64 binary tree + archive + run: | + mkdir -p tmp/resources/mingw_w64 + docker cp $(docker create ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest):/opt/mingw64-w64 tmp/resources/mingw_w64/mingw_w64 + cd tmp/resources/mingw_w64 + tar -cz mingw_w64 > mingw_w64.tar.gz + - name: Checkout pages + run: | + git fetch --all + git checkout -f -B pages --track origin/pages + - name: Config git user + run: | + git config --local user.email "action@github.com" + git config --local user.name "Github Actions from commit ${{ github.sha }}" + - name: Upload + run: | + rm -rf resources/mingw_w64/* + mv tmp/resources/mingw_w64/mingw_w64.tar.gz resources/mingw_w64/mingw_w64.tar.gz + git add resources/mingw_w64/mingw_w64.tar.gz && git commit -m"Update mingw_w64 binary" && git push -f diff --git a/.github/workflows/update-resources.yml b/.github/workflows/update-resources.yml new file mode 100644 index 0000000..cab86e8 --- /dev/null +++ b/.github/workflows/update-resources.yml @@ -0,0 +1,52 @@ +name: "Update resources" + +on: + push: + branches: + - main + +concurrency: + group: ci-${{github.ref}}-${{ github.run_number }} + cancel-in-progress: true + +jobs: + changed: + name: "Build and Upload Resources" + runs-on: ubuntu-latest + outputs: + mingw: ${{ steps.changes.outputs.mingw }} + file: ${{ steps.changes.outputs.file }} + gpg: ${{ steps.changes.outputs.gpg }} + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: changes + with: + filters: | + mingw: + - 'Dockerfiles/mingw-w64/**' + file: + - 'Dockerfiles/file/**' + gpg: + - 'Dockerfiles/gpg/**' + build-upload-mingw: + name: "Mingw-w64 build and Upload" + if: ${{ needs.changed.outputs.mingw }} + needs: [changed] + uses: ./.github/workflows/update-mingw.yml + build-upload-gpg: + name: "Gpg x-build and upload for Windows" + if: | + always() && + needs.changed.outputs.gpg && + (needs.build-upload-mingw.result == 'success' || needs.build-upload-mingw.result == 'skipped') + needs: [build-upload-mingw, changed] + uses: ./.github/workflows/update-gpg.yml + build-upload-file: + name: "File x-build and upload for Windows" + if: | + always() && + needs.changed.outputs.file && + (needs.build-upload-mingw.result == 'success' || needs.build-upload-mingw.result == 'skipped') + needs: [build-upload-mingw, changed] + uses: ./.github/workflows/update-file.yml diff --git a/Dockerfiles/file/Dockerfile.file b/Dockerfiles/file/Dockerfile.file index 7def314..ee23e86 100644 --- a/Dockerfiles/file/Dockerfile.file +++ b/Dockerfiles/file/Dockerfile.file @@ -1,19 +1,29 @@ -FROM mingw-w64 +ARG MINGW_REPO=ghcr.io/spack/ +ARG MINGW_VERSION=latest +FROM ${MINGW_REPO}mingw-w64:${MINGW_VERSION} RUN mkdir -p /opt/file/src /opt/file/bin WORKDIR /opt/file/src -RUN curl -o file.tar.gz https://github.com/file/file/archive/refs/tags/FILE5_45.tar.gz &&\ +RUN curl -Lo file.tar.gz https://github.com/file/file/archive/refs/tags/FILE5_45.tar.gz &&\ tar -oxf file.tar.gz -WORKDIR /opt/file/src/file +WORKDIR /opt/file/src/file-FILE5_45 # Build file -RUN $BUILD_ROOT/src/mingw-w64/mingw-w64-headers/configure \\ - --prefix=/opt/file \\ - --host=x86_64-w64-mingw32 \\ - --target=x86_64-w64-mingw32 \\ - --disable-multilib \\ - --enable-languages=c,c++ &&\ - make -j4 &&\ +RUN autoreconf -f -i && \ + mkdir build && \ + pushd build && \ + ../configure \ + --disable-bzlib \ + --disable-libseccomp \ + --disable-xzlib \ + --disable-zlib && \ + make && \ + popd && \ + ./configure \ + --prefix=/opt/file \ + --host=x86_64-w64-mingw32 \ + --build=$(./config.guess) && \ + make FILE_COMPILE=$(pwd)/build/src/file -j4 && \ make install diff --git a/Dockerfiles/gpg4win/Dockerfile.gpg4win b/Dockerfiles/gpg/Dockerfile.gpg similarity index 50% rename from Dockerfiles/gpg4win/Dockerfile.gpg4win rename to Dockerfiles/gpg/Dockerfile.gpg index 53a7594..2b9b049 100644 --- a/Dockerfiles/gpg4win/Dockerfile.gpg4win +++ b/Dockerfiles/gpg/Dockerfile.gpg @@ -1,34 +1,47 @@ -FROM mingw64-w64:latest +ARG MINGW_REPO=ghcr.io/spack/ +ARG MINGW_VERSION=latest +FROM ${MINGW_REPO}mingw-w64:${MINGW_VERSION} + +ARG GNUPG_VERSION=2.4.5 +ARG ICONV_VERSION=1.16 +ARG LIBASSUAN_VERSION=2.5.5 +ARG LIBGCRYPT_VERSION=1.10.2 +ARG LIBGPGERROR_VERSION=1.47 +ARG LIBKSBA_VERSION=1.6.3 +ARG NPTH_VERSION=1.6 +ARG PINENTRY_VERSION=1.2.1 RUN mkdir -p /sources/tarballs /opt/deps /opt/gpg ENV DEP_PREFIX=/opt/deps +ENV PREFIX=/opt/gpg WORKDIR /sources/tarballs # Fetch sources RUN curl -L --remote-name-all\ - https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.4.3.tar.bz2 \ - https://gnupg.org/ftp/gcrypt/npth/npth-1.6.tar.bz2 \ - https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.47.tar.bz2 \ - https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.10.2.tar.bz2 \ - https://gnupg.org/ftp/gcrypt/libksba/libksba-1.6.3.tar.bz2 \ - https://gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.5.tar.bz2 \ - https://gnupg.org/ftp/gcrypt/pinentry/pinentry-1.2.1.tar.bz2 \ - https://ftp.gnu.org/gnu/libiconv/pinentry-1.2.1.tar.bz2 + https://gnupg.org/ftp/gcrypt/gnupg/gnupg-$GNUPG_VERSION.tar.bz2 \ + https://gnupg.org/ftp/gcrypt/npth/npth-$NPTH_VERSION.tar.bz2 \ + https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$LIBGPGERROR_VERSION.tar.bz2 \ + https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-$LIBGCRYPT_VERSION.tar.bz2 \ + https://gnupg.org/ftp/gcrypt/libksba/libksba-$LIBKSBA_VERSION.tar.bz2 \ + https://gnupg.org/ftp/gcrypt/libassuan/libassuan-$LIBASSUAN_VERSION.tar.bz2 \ + https://gnupg.org/ftp/gcrypt/pinentry/pinentry-$PINENTRY_VERSION.tar.bz2 \ + https://ftp.gnu.org/gnu/libiconv/libiconv-$ICONV_VERSION.tar.gz WORKDIR /sources/source # Extract sources -RUN tar -oxf /sources/tarballs/gnupg-2.4.3.tar.bz2 -RUN tar -oxf /sources/tarballs/npth-1.6.tar.bz2 -RUN tar -oxf /sources/tarballs/libgcrypt-1.10.2.tar.bz2 -RUN tar -oxf /sources/tarballs/libksba-1.6.3.tar.bz2 -RUN tar -oxf /sources/tarballs/libassuan-2.5.5.tar.bz2 -RUN tar -oxf /sources/tarballs/pinentry-1.2.1.tar.bz2 -RUN tar -oxf /sources/tarballs/pinentry-1.2.1.tar.bz2 +RUN tar -oxf /sources/tarballs/gnupg-$GNUPG_VERSION.tar.bz2 +RUN tar -oxf /sources/tarballs/npth-$NPTH_VERSION.tar.bz2 +RUN tar -oxf /sources/tarballs/libgcrypt-$LIBGCRYPT_VERSION.tar.bz2 +RUN tar -oxf /sources/tarballs/libksba-$LIBKSBA_VERSION.tar.bz2 +RUN tar -oxf /sources/tarballs/libassuan-$LIBASSUAN_VERSION.tar.bz2 +RUN tar -oxf /sources/tarballs/pinentry-$PINENTRY_VERSION.tar.bz2 +RUN tar -oxf /sources/tarballs/libiconv-$ICONV_VERSION.tar.gz +RUN tar -oxf /sources/tarballs/libgpg-error-$LIBGPGERROR_VERSION.tar.bz2 WORKDIR /sources/source # install npth -RUN cd npth && \ - /npth-1.6/configure && \ +RUN cd npth-$NPTH_VERSION && \ + ./configure \ --host=x86_64-w64-mingw32 \ --prefix="${DEP_PREFIX}" \ --enable-shared=no \ @@ -38,10 +51,10 @@ RUN cd npth && \ make install # install libgpg-error -RUN cd libgpg-erro && \ - libgpg-error/configure \ +RUN cd libgpg-error-$LIBGPGERROR_VERSION && \ + ./configure \ --host=x86_64-w64-mingw32 \ - --prefix="/deps" \ + --prefix="${DEP_PREFIX}" \ --enable-shared=no \ --enable-static=yes \ --disable-nls \ @@ -50,51 +63,51 @@ RUN cd libgpg-erro && \ CFLAGS="-Os" \ && make -j$(nproc) \ && make install \ - && cp src/gpg-error-config /deps/bin/ + && cp src/gpg-error-config /opt/deps/bin/ # install libassuan -RUN cd libassuan && \ - libassuan-2.5.5/configure \ +RUN cd libassuan-$LIBASSUAN_VERSION && \ + ./configure \ --host=x86_64-w64-mingw32 \ - --prefix="/deps" \ + --prefix="${DEP_PREFIX}" \ --enable-shared=no \ --enable-static=yes \ - --with-libgpg-error-prefix="/deps" \ + --with-libgpg-error-prefix="${DEP_PREFIX}" \ CFLAGS="-Os" \ && make -j$(nproc) \ && make install -WORKDIR /libgcrypt -RUN /libgcrypt-$LIBGCRYPT_VERSION/configure \ +RUN cd libgcrypt-$LIBGCRYPT_VERSION &&\ + ./configure \ --host=x86_64-w64-mingw32 \ - --prefix="/deps" \ + --prefix="${DEP_PREFIX}" \ --enable-shared=no \ --enable-static=yes \ --disable-doc \ - --with-libgpg-error-prefix="/deps" \ + --with-libgpg-error-prefix="${DEP_PREFIX}" \ CFLAGS="-Os" \ && make -j$(nproc) \ && make install -WORKDIR /libksba -RUN /libksba-$LIBKSBA_VERSION/configure \ +RUN cd libksba-$LIBKSBA_VERSION && \ + ./configure \ --host=x86_64-w64-mingw32 \ - --prefix="/deps" \ + --prefix="${DEP_PREFIX}" \ --enable-shared=no \ --enable-static=yes \ - --with-libgpg-error-prefix="/deps" \ + --with-libgpg-error-prefix="${DEP_PREFIX}" \ && make -j$(nproc) \ && make install -WORKDIR /gnupg -RUN /gnupg-$GNUPG_VERSION/configure \ +RUN cd gnupg-$GNUPG_VERSION && \ + ./configure \ --host=x86_64-w64-mingw32 \ - --prefix="$PREFIX" \ - --with-npth-prefix="/deps" \ - --with-libgpg-error-prefix="/deps" \ - --with-libgcrypt-prefix="/deps" \ - --with-libassuan-prefix="/deps" \ - --with-ksba-prefix="/deps" \ + --prefix="${PREFIX}" \ + --with-npth-prefix="${DEP_PREFIX}" \ + --with-libgpg-error-prefix="${DEP_PREFIX}" \ + --with-libgcrypt-prefix="${DEP_PREFIX}" \ + --with-libassuan-prefix="${DEP_PREFIX}" \ + --with-ksba-prefix="${DEP_PREFIX}" \ --disable-bzip2 \ --disable-card-support \ --disable-ccid-driver \ @@ -123,10 +136,10 @@ RUN /gnupg-$GNUPG_VERSION/configure \ && make -j$(nproc) \ && make install -WORKDIR /iconv -RUN /libiconv-$ICONV_VERSION/configure \ +RUN cd libiconv-$ICONV_VERSION && \ + ./configure \ --host=x86_64-w64-mingw32 \ - --prefix="/deps" \ + --prefix="${DEP_PREFIX}" \ --enable-shared=no \ --enable-static=yes \ --disable-nls \ @@ -135,13 +148,13 @@ RUN /libiconv-$ICONV_VERSION/configure \ && make -j$(nproc) \ && make install -WORKDIR /pinentry -RUN /pinentry-$PINENTRY_VERSION/configure \ +RUN cd pinentry-$PINENTRY_VERSION &&\ + ./configure \ --host=x86_64-w64-mingw32 \ - --prefix="$PREFIX" \ - --with-libgpg-error-prefix="/deps" \ - --with-libassuan-prefix="/deps" \ - --with-libiconv-prefix="/deps" \ + --prefix="${PREFIX}" \ + --with-libgpg-error-prefix="${DEP_PREFIX}" \ + --with-libassuan-prefix="${DEP_PREFIX}" \ + --with-libiconv-prefix="${DEP_PREFIX}" \ --disable-ncurses \ --disable-libsecret \ --disable-pinentry-tty \ diff --git a/Dockerfiles/mingw-w64/Dockerfile.mingw-w64 b/Dockerfiles/mingw-w64/Dockerfile.mingw-w64 index ea9249d..62f4e79 100644 --- a/Dockerfiles/mingw-w64/Dockerfile.mingw-w64 +++ b/Dockerfiles/mingw-w64/Dockerfile.mingw-w64 @@ -22,9 +22,9 @@ ENV PATH=/opt/mingw64-w64:/opt/mingw64-w64/bin:$PATH RUN mkdir -p /opt/mingw-builds && \ cd /opt/mingw-builds || exit && \ # Create source residence directories - mkdir -p src/binutils src/mingw-w64 src/gcc && \ + mkdir -p src/binutils src/mingw-w64 src/gcc src/regex && \ # Create build directories - mkdir -p build/cross/binutils build/cross/gcc build/cross/mingw-w64-headers build/cross/mingw-w64 + mkdir -p build/cross/binutils build/cross/gcc build/cross/mingw-w64-headers build/cross/mingw-w64 build/cross/regex # fetch sources RUN echo -e """#!/bin/bash\n \ @@ -50,6 +50,8 @@ fetch_extract_sources https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz\n\ fetch_extract_sources https://ftp.gnu.org/gnu/gcc/gcc-11.4.0/gcc-11.4.0.tar.gz 2\n\ # acquire mingw-w64\n\ fetch_extract_sources https://downloads.sourceforge.net/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v11.0.1.tar.bz2 3\n\ +# acquire mingw-w64-libgnurx\n\ +fetch_extract_sources http://download.sourceforge.net/mingw/Other/UserContributed/regex/mingw-regex-2.5.1/mingw-libgnurx-2.5.1-src.tar.gz 2\ """ > /opt/scripts/acquire-sources.sh && chmod +x /opt/scripts/acquire-sources.sh RUN /opt/scripts/acquire-sources.sh @@ -84,5 +86,10 @@ RUN cd "$BUILD_ROOT"/build/cross/gcc || exit && \ make -j2 && \ make install +RUN cd "$BUILD_ROOT"/build/cross/regex || exit && \ + ../../../src/regex/configure --host=x86_64-w64-mingw32 --prefix="$INSTALL_DIR"/x86_64-w64-mingw32 && \ + make -j2 && \ + make install + ENTRYPOINT ["/bin/bash"] \ No newline at end of file