From 300f294b3f1cbd09b5167649f10466f44f8e4ad7 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 11 Oct 2026 17:01:49 -0400 Subject: [PATCH 1/5] Build rpms in the manylinux container Each package's staging moves into a /stage target that both /debian and a new /rpm package. The rpm jobs run in quay.io/pypa/manylinux_2_28_x86_64, where the python packages build their wheels, and the release attaches the rpms beside the debs. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- .github/workflows/build.yaml | 178 ++++++++++++++++++++++++++++++----- Makefile | 130 +++++++++++++++++++------ README.md | 22 ++--- 3 files changed, 267 insertions(+), 63 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ad3d56f..26e1db5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -143,13 +143,6 @@ jobs: name: artifact-deb path: ./*.deb - # - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - # with: - # name: artifact-rpm - # path: | - # ./*.rpm - # !./*-debuginfo-*.rpm - build-linux-packages-verible: needs: - initialize @@ -199,13 +192,6 @@ jobs: name: artifact-deb-verible path: ./*.deb - # - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - # with: - # name: artifact-rpm - # path: | - # ./*.rpm - # !./*-debuginfo-*.rpm - build-linux-packages-surfer: needs: - initialize @@ -253,12 +239,145 @@ jobs: name: artifact-deb-surfer path: ./*.deb - # - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - # with: - # name: artifact-rpm - # path: | - # ./*.rpm - # !./*-debuginfo-*.rpm + # rpms build in the manylinux container the python packages build their + # wheels in (AlmaLinux 8, glibc 2.28), so they install on RHEL 8 and newer. + # The container runs as root and its sudo drops /usr/local/bin from PATH, + # so every make call passes SUDO= instead. + build-linux-rpms: + needs: + - initialize + + runs-on: ubuntu-24.04 + container: quay.io/pypa/manylinux_2_28_x86_64 + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Global Dependencies + run: dnf install -y bison ccache flex flex-devel help2man hidapi-devel java-17-openjdk-headless libffi-devel libftdi-devel libusb1-devel readline-devel rpm-build systemd-devel tcl-devel wget zlib-devel + + # the image's /usr/bin/python3 has no pip; its own interpreters do + - name: Install python dependencies + run: | + echo /opt/python/cp312-cp312/bin >> $GITHUB_PATH + /opt/python/cp312-cp312/bin/python -m pip install orderedmultidict + + - name: Configure CCache + run: echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV + + - name: Use ccache + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: .ccache + key: rpm-ccache-${{ github.sha }} + restore-keys: rpm-ccache- + + - name: Build - googletest + run: make googletest/install SUDO= + + - name: Build - openFPGALoader + run: make openfpgaloader/rpm SUDO= + + - name: Build - capnproto + run: | + make capnproto/install SUDO= + make capnproto/rpm SUDO= + + - name: Build - json + run: | + make json/install SUDO= + make json/rpm SUDO= + + - name: Build - antlr + run: | + make antlr/install SUDO= + make antlr/rpm SUDO= + + - name: Build - uhdm + run: | + make uhdm/install SUDO= + make uhdm/rpm SUDO= + + - name: Build - surelog + run: | + make surelog/install SUDO= + make surelog/rpm SUDO= + + - name: Build - yosys + run: | + make yosys/install SUDO= + make yosys/rpm SUDO= + + - name: Build - yosys-slang + run: make yosys-slang/rpm SUDO= + + - name: Build - verilator + run: make verilator/rpm SUDO= + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: artifact-rpm + path: ./*.rpm + + build-linux-rpms-verible: + needs: + - initialize + + runs-on: ubuntu-24.04 + container: quay.io/pypa/manylinux_2_28_x86_64 + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Global Dependencies + run: dnf install -y rpm-build + + - name: Install Bazel + uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3.0.0 + + - name: Mount bazel cache + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: "~/.cache/bazel" + key: bazel-rpm + + - name: Build - verible + run: make verible/rpm SUDO= + env: + USE_BAZEL_VERSION: 6.4.0 + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: artifact-rpm-verible + path: ./*.rpm + + build-linux-rpms-surfer: + needs: + - initialize + + runs-on: ubuntu-24.04 + container: quay.io/pypa/manylinux_2_28_x86_64 + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Global Dependencies + run: dnf install -y rpm-build + + - name: Setup Rust + uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + with: + profile: minimal + toolchain: stable + override: true + + - name: Build - surfer + run: make surfer/rpm SUDO= + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: artifact-rpm-surfer + path: ./*.rpm create-release: needs: @@ -266,6 +385,9 @@ jobs: - build-linux-packages - build-linux-packages-verible - build-linux-packages-surfer + - build-linux-rpms + - build-linux-rpms-verible + - build-linux-rpms-surfer strategy: matrix: @@ -289,9 +411,23 @@ jobs: with: name: artifact-deb-surfer + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: artifact-rpm + + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: artifact-rpm-verible + + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: artifact-rpm-surfer + - name: Release uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: fail_on_unmatched_files: true prerelease: true - files: './*.deb' + files: | + ./*.deb + ./*.rpm diff --git a/Makefile b/Makefile index dc8950a..edbc3bd 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,16 @@ endif SUDO:=sudo +# Package the tree a /stage target staged under /debian/usr as a +# binary rpm in the current directory: $(call rpm,,,). +# rpm versions cannot hold a hyphen, so one becomes a dot. +define rpm + mkdir -p $(1)/rpm/SPECS + printf 'Name: $(1)\nVersion: $(subst -,.,$(2))\nRelease: 1\nSummary: $(1)\nLicense: $(3)\nPackager: timkpaine \n\n%%description\n$(1)\n\n%%install\ncp -a $(CURDIR)/$(1)/debian/usr %%{buildroot}/\n\n%%files\n%%defattr(-,root,root,-)\n/usr/local/*\n' > $(1)/rpm/SPECS/$(1).spec + rpmbuild -bb --define '_topdir $(CURDIR)/$(1)/rpm' --define 'debug_package %{nil}' --define '__os_install_post %{nil}' --define '_build_id_links none' $(1)/rpm/SPECS/$(1).spec + cp $(1)/rpm/RPMS/*/$(1)-$(subst -,.,$(2))-1.*.rpm . +endef + ##################################################################################################################################################################################################################################################################################### # __ ________ _____ _____ _____ ____ _ _ _____ @@ -154,7 +164,7 @@ googletest/install: googletest/build_shared googletest/build_static ## build an # # https://github.com/capnproto/capnproto # -.PHONY: capnproto/build_shared capnproto/build_static capnproto capnproto/install capnproto/debian +.PHONY: capnproto/build_shared capnproto/build_static capnproto capnproto/install capnproto/debian capnproto/stage capnproto/rpm capnproto/.git: git clone --depth 1 --branch v$(CAPNPROTO_VERSION) https://github.com/capnproto/capnproto.git @@ -173,16 +183,21 @@ capnproto/install: capnproto/build_shared capnproto/build_static ## build and i cd capnproto && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_SHARED) cd capnproto && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) -capnproto/debian: ## build debian package for capnproto +capnproto/stage: ## stage capnproto under capnproto/debian/usr/local for packaging $(SUDO) rm -rf capnproto/build_static/install_manifest.txt $(SUDO) rm -rf capnproto/build_shared/install_manifest.txt $(MAKE) capnproto/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) capnproto/build_shared INSTALL_PREFIX=./debian/usr/local $(MAKE) capnproto/install INSTALL_PREFIX=./debian/usr/local SUDO= + +capnproto/debian: capnproto/stage ## build debian package for capnproto mkdir -p capnproto/debian/DEBIAN printf "Package: capnproto\nVersion: $(CAPNPROTO_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: capnproto\n" > capnproto/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build capnproto/debian capnproto_$(CAPNPROTO_VERSION)_amd64.deb +capnproto/rpm: capnproto/stage ## build rpm package for capnproto + $(call rpm,capnproto,$(CAPNPROTO_VERSION),MIT) + ##################################################################################################################################################################################################################################################################################### # _ _____ ____ _ _ # | |/ ____|/ __ \| \ | | @@ -193,7 +208,7 @@ capnproto/debian: ## build debian package for capnproto # # https://github.com/nlohmann/json # -.PHONY: json/build_shared json/build_static json json/install json/debian +.PHONY: json/build_shared json/build_static json json/install json/debian json/stage json/rpm JSON_CMAKE_ARGS:=-DJSON_BuildTests=OFF @@ -214,16 +229,21 @@ json/install: json/build_shared json/build_static ## build and install json cd json && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_SHARED) cd json && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) -json/debian: ## build debian package for json +json/stage: ## stage json under json/debian/usr/local for packaging $(SUDO) rm -rf json/build_static/install_manifest.txt $(SUDO) rm -rf json/build_shared/install_manifest.txt $(MAKE) json/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) json/build_shared INSTALL_PREFIX=./debian/usr/local $(MAKE) json/install INSTALL_PREFIX=./debian/usr/local SUDO= + +json/debian: json/stage ## build debian package for json mkdir -p json/debian/DEBIAN printf "Package: json\nVersion: $(JSON_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: json\n" > json/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build json/debian json_$(JSON_VERSION)_amd64.deb +json/rpm: json/stage ## build rpm package for json + $(call rpm,json,$(JSON_VERSION),MIT) + ##################################################################################################################################################################################################################################################################################### # _ _ _______ _ _____ @@ -235,7 +255,7 @@ json/debian: ## build debian package for json # # https://www.antlr.org/ # -.PHONY: antlr/build_shared antlr/build_static antlr antlr/install antlr/debian +.PHONY: antlr/build_shared antlr/build_static antlr antlr/install antlr/debian antlr/stage antlr/rpm antlr/antlr-$(ANTLR_VERSION)-complete.jar: mkdir -p antlr @@ -259,16 +279,21 @@ antlr/install: antlr/build_shared antlr/build_static ## build and install antlr cd antlr && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_SHARED) cd antlr && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) -antlr/debian: ## build debian package for antlr +antlr/stage: ## stage antlr under antlr/debian/usr/local for packaging $(SUDO) rm -rf antlr/build_static/install_manifest.txt $(SUDO) rm -rf antlr/build_shared/install_manifest.txt $(MAKE) antlr/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) antlr/build_shared INSTALL_PREFIX=./debian/usr/local $(MAKE) antlr/install INSTALL_PREFIX=./debian/usr/local SUDO= + +antlr/debian: antlr/stage ## build debian package for antlr mkdir -p antlr/debian/DEBIAN printf "Package: antlr\nVersion: $(ANTLR_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: antlr\n" > antlr/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build antlr/debian antlr_$(ANTLR_VERSION)_amd64.deb +antlr/rpm: antlr/stage ## build rpm package for antlr + $(call rpm,antlr,$(ANTLR_VERSION),BSD-3-Clause) + ##################################################################################################################################################################################################################################################################################### # _ _ _ _ _____ __ __ @@ -280,7 +305,7 @@ antlr/debian: ## build debian package for antlr # # https://github.com/chipsalliance/UHDM # -.PHONY: uhdm/build_shared uhdm/build_static uhdm uhdm/install uhdm/debian uhdm/rpm +.PHONY: uhdm/build_shared uhdm/build_static uhdm uhdm/install uhdm/debian uhdm/rpm uhdm/stage UHDM_CMAKE_ARGS := -DUHDM_USE_HOST_GTEST=ON -DUHDM_USE_HOST_CAPNP=ON -DUHDM_BUILD_TESTS=OFF @@ -301,20 +326,20 @@ uhdm/install: uhdm/build_shared uhdm/build_static ## build and install uhdm cd uhdm && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_SHARED) cd uhdm && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) -uhdm/debian: ## build debian package for uhdm +uhdm/stage: ## stage uhdm under uhdm/debian/usr/local for packaging $(SUDO) rm -rf uhdm/build_static/install_manifest.txt $(SUDO) rm -rf uhdm/build_shared/install_manifest.txt $(MAKE) uhdm/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) uhdm/build_shared INSTALL_PREFIX=./debian/usr/local $(MAKE) uhdm/install INSTALL_PREFIX=./debian/usr/local SUDO= + +uhdm/debian: uhdm/stage ## build debian package for uhdm mkdir -p uhdm/debian/DEBIAN printf "Package: uhdm\nVersion: $(UHDM_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: UHDM\n" > uhdm/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build uhdm/debian uhdm_$(UHDM_VERSION)_amd64.deb -uhdm/rpm: ## build rpm package for uhdm - mkdir -p uhdm/rpm - printf "Name: uhdm\nVersion: $(UHDM_VERSION)\nLicense: Apache-2\nRelease: 1%%{?dist}\nSummary: UHDM\nPackager: timkpaine \nBuildArch: x86_64\n\n%%description\nUHDM\n\n%%setup\n\n%%build\n\n%%install\n\n%%clean\n\n%%post\n\n%%files\n%%{_bindir}/%%name\n\n%%changelog\n" > uhdm/rpm/uhdm.spec - +uhdm/rpm: uhdm/stage ## build rpm package for uhdm + $(call rpm,uhdm,$(UHDM_VERSION),Apache-2.0) ##################################################################################################################################################################################################################################################################################### # _____ _ @@ -329,7 +354,7 @@ uhdm/rpm: ## build rpm package for uhdm # https://github.com/chipsalliance/Surelog # -.PHONY: surelog/build_shared surelog/build_static surelog surelog/install surelog/debian +.PHONY: surelog/build_shared surelog/build_static surelog surelog/install surelog/debian surelog/stage surelog/rpm SURELOG_CMAKE_ARGS := -DSURELOG_USE_HOST_ALL=ON -DSURELOG_WITH_TCMALLOC=OFF -DSURELOG_WITH_ZLIB=ON -DANTLR_JAR_LOCATION=${JAVA_INSTALL_DIR}/java/antlr-$(ANTLR_VERSION)-complete.jar surelog/.git: @@ -349,16 +374,21 @@ surelog/install: surelog/build_shared surelog/build_static ## build and install cd surelog && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_SHARED) cd surelog && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) -surelog/debian: ## build debian package for surelog +surelog/stage: ## stage surelog under surelog/debian/usr/local for packaging $(SUDO) rm -rf surelog/build_static/install_manifest.txt $(SUDO) rm -rf surelog/build_shared/install_manifest.txt $(MAKE) surelog/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) surelog/build_shared INSTALL_PREFIX=./debian/usr/local $(MAKE) surelog/install INSTALL_PREFIX=./debian/usr/local SUDO= + +surelog/debian: surelog/stage ## build debian package for surelog mkdir -p surelog/debian/DEBIAN printf "Package: surelog\nVersion: $(SURELOG_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: surelog\n" > surelog/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build surelog/debian surelog_$(SURELOG_VERSION)_amd64.deb +surelog/rpm: surelog/stage ## build rpm package for surelog + $(call rpm,surelog,$(SURELOG_VERSION),Apache-2.0) + ##################################################################################################################################################################################################################################################################################### # __ __ _ _ _ @@ -370,7 +400,7 @@ surelog/debian: ## build debian package for surelog # # https://github.com/chipsalliance/verible # -.PHONY: verible/libs verible verible/install verible/debian +.PHONY: verible/libs verible verible/install verible/debian verible/stage verible/rpm verible/.git: git clone --depth 1 --branch $(VERIBLE_TAG) https://github.com/chipsalliance/verible.git @@ -384,13 +414,18 @@ verible/install: verible/libs ## build and install verible mkdir -p $(BIN_DIR) cd verible && $(SUDO) .github/bin/simple-install.sh $(BIN_DIR) -verible/debian: ## build debian package for verible +verible/stage: ## stage verible under verible/debian/usr/local for packaging $(MAKE) verible/libs $(MAKE) verible/install INSTALL_PREFIX=$(shell pwd)/verible/debian/usr/local SUDO= + +verible/debian: verible/stage ## build debian package for verible mkdir -p verible/debian/DEBIAN printf "Package: verible\nVersion: $(VERIBLE_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: verible\n" > verible/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build verible/debian verible_$(VERIBLE_VERSION)_amd64.deb +verible/rpm: verible/stage ## build rpm package for verible + $(call rpm,verible,$(VERIBLE_VERSION),Apache-2.0) + ##################################################################################################################################################################################################################################################################################### # _ _ ___ ___ _ _ ___ @@ -402,7 +437,7 @@ verible/debian: ## build debian package for verible # # https://github.com/YosysHQ/yosys # -.PHONY: yosys/libs yosys yosys/install yosys/debian +.PHONY: yosys/libs yosys yosys/install yosys/debian yosys/stage yosys/rpm ifeq ($(UNAME), Linux) YOSYS_ARGS := CONFIG=gcc @@ -422,13 +457,18 @@ yosys: yosys/libs ## build yosys yosys/install: yosys/libs ## build and install yosys cd yosys && $(SUDO) make $(YOSYS_ARGS) PREFIX=$(ROOT_PREFIX) install -yosys/debian: ## build debian package for yosys +yosys/stage: ## stage yosys under yosys/debian/usr/local for packaging $(MAKE) yosys/libs $(MAKE) yosys/install INSTALL_PREFIX=./debian/usr/local SUDO= + +yosys/debian: yosys/stage ## build debian package for yosys mkdir -p yosys/debian/DEBIAN printf "Package: yosys\nVersion: $(YOSYS_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: yosys\n" > yosys/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build yosys/debian yosys_$(YOSYS_VERSION)_amd64.deb +yosys/rpm: yosys/stage ## build rpm package for yosys + $(call rpm,yosys,$(YOSYS_VERSION),ISC) + ##################################################################################################################################################################################################################################################################################### # ______ _____ _____ _ _ # | ____| __ \ / ____| /\ | | | | @@ -441,7 +481,7 @@ yosys/debian: ## build debian package for yosys # # https://github.com/trabucayre/openFPGALoader # -.PHONY: openfpgaloader/libs openfpgaloader openfpgaloader/install openfpgaloader/debian +.PHONY: openfpgaloader/libs openfpgaloader openfpgaloader/install openfpgaloader/debian openfpgaloader/stage openfpgaloader/rpm openfpgaloader/.git: git clone --depth 1 --branch v$(OPENFPGALOADER_VERSION) https://github.com/trabucayre/openFPGALoader.git openfpgaloader @@ -460,22 +500,27 @@ openfpgaloader/install: openfpgaloader/build_shared openfpgaloader/build_static cd openfpgaloader && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_SHARED) cd openfpgaloader && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) -openfpgaloader/debian: ## build debian package for openfpgaloader +openfpgaloader/stage: ## stage openfpgaloader under openfpgaloader/debian/usr/local for packaging $(SUDO) rm -rf openfpgaloader/build_static/install_manifest.txt $(SUDO) rm -rf openfpgaloader/build_shared/install_manifest.txt $(MAKE) openfpgaloader/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) openfpgaloader/build_shared INSTALL_PREFIX=./debian/usr/local $(MAKE) openfpgaloader/install INSTALL_PREFIX=./debian/usr/local SUDO= + +openfpgaloader/debian: openfpgaloader/stage ## build debian package for openfpgaloader mkdir -p openfpgaloader/debian/DEBIAN printf "Package: openfpgaloader\nVersion: $(OPENFPGALOADER_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: openfpgaloader\n" > openfpgaloader/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build openfpgaloader/debian openfpgaloader_$(OPENFPGALOADER_VERSION)_amd64.deb +openfpgaloader/rpm: openfpgaloader/stage ## build rpm package for openfpgaloader + $(call rpm,openfpgaloader,$(OPENFPGALOADER_VERSION),Apache-2.0) + ##################################################################################################################################################################################################################################################################################### # yosys-slang # # https://github.com/povik/yosys-slang # -.PHONY: yosys-slang/build yosys-slang yosys-slang/install yosys-slang/debian +.PHONY: yosys-slang/build yosys-slang yosys-slang/install yosys-slang/debian yosys-slang/stage yosys-slang/rpm yosys-slang/.git: git clone --recursive https://github.com/povik/yosys-slang.git @@ -490,13 +535,18 @@ yosys-slang: yosys-slang/build ## build yosys-slang yosys-slang/install: yosys-slang/build ## build and install yosys-slang cd yosys-slang && $(SUDO) cmake --install build -yosys-slang/debian: ## build debian package for yosys-slang +yosys-slang/stage: ## stage yosys-slang under yosys-slang/debian/usr/local for packaging $(MAKE) yosys-slang/build - mkdir -p yosys-slang/debian/DEBIAN cd yosys-slang && DESTDIR=$(CURDIR)/yosys-slang/debian cmake --install build + +yosys-slang/debian: yosys-slang/stage ## build debian package for yosys-slang + mkdir -p yosys-slang/debian/DEBIAN printf "Package: yosys-slang\nVersion: $(SLANG_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: yosys-slang\n" > yosys-slang/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build yosys-slang/debian yosys-slang_$(SLANG_VERSION)_amd64.deb +yosys-slang/rpm: yosys-slang/stage ## build rpm package for yosys-slang + $(call rpm,yosys-slang,$(SLANG_VERSION),ISC) + ##################################################################################################################################################################################################################################################################################### @@ -510,7 +560,7 @@ yosys-slang/debian: ## build debian package for yosys-slang # # https://github.com/verilator/verilator # -.PHONY: verilator/build_static verilator verilator/install verilator/debian +.PHONY: verilator/build_static verilator verilator/install verilator/debian verilator/stage verilator/rpm verilator/.git: git clone --depth 1 --branch v$(VERILATOR_VERSION) https://github.com/verilator/verilator.git @@ -536,15 +586,20 @@ verilator: verilator/build_static ## build verilator verilator/install: verilator/build_static ## build and install verilator cd verilator && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) -verilator/debian: ## build debian package for verilator +verilator/stage: ## stage verilator under verilator/debian/usr/local for packaging $(SUDO) rm -rf verilator/debian $(MAKE) verilator/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) verilator/install INSTALL_PREFIX=./debian/usr/local SUDO= + cd verilator/debian/usr/local && rm -rf share/verilator && mkdir -p share/verilator && mv include share/verilator && mv examples share/verilator && mv *.cmake share/verilator/ && sed -i 's|$$verilator_pkgdatadir_relpath = ".."|$$verilator_pkgdatadir_relpath = "../share/verilator"|g' bin/verilator && cp -r bin share/verilator + +verilator/debian: verilator/stage ## build debian package for verilator mkdir -p verilator/debian/DEBIAN printf "Package: verilator\nVersion: $(VERILATOR_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: verilator\n" > verilator/debian/DEBIAN/control - cd verilator/debian/usr/local && rm -rf share/verilator && mkdir -p share/verilator && mv include share/verilator && mv examples share/verilator && mv *.cmake share/verilator/ && sed -i 's|$$verilator_pkgdatadir_relpath = ".."|$$verilator_pkgdatadir_relpath = "../share/verilator"|g' bin/verilator && cp -r bin share/verilator dpkg-deb -Z"gzip" --root-owner-group --build verilator/debian verilator_$(VERILATOR_VERSION)_amd64.deb +verilator/rpm: verilator/stage ## build rpm package for verilator + $(call rpm,verilator,$(VERILATOR_VERSION),LGPL-3.0-only OR Artistic-2.0) + @@ -558,7 +613,7 @@ verilator/debian: ## build debian package for verilator # # https://github.com/pieter3d/simview # -.PHONY: simview/build_static simview simview/install simview/debian +.PHONY: simview/build_static simview simview/install simview/debian simview/stage simview/rpm simview/.git: git clone --depth 1 --branch tkp/mac_and_sharedlibs https://github.com/timkpaine/simview.git @@ -573,14 +628,19 @@ simview/install: simview/build_static ## build and install simview cd simview && $(SUDO) cmake $(CMAKE_INSTALL_ARGS_STATIC) cd simview && $(SUDO) mkdir -p $(BIN_DIR) && $(SUDO) cp build_static/simview $(BIN_DIR) -simview/debian: ## build debian package for simview +simview/stage: ## stage simview under simview/debian/usr/local for packaging $(SUDO) rm -rf simview/build_static/install_manifest.txt $(MAKE) simview/build_static INSTALL_PREFIX=./debian/usr/local $(MAKE) simview/install INSTALL_PREFIX=./debian/usr/local SUDO= + +simview/debian: simview/stage ## build debian package for simview mkdir -p simview/debian/DEBIAN printf "Package: simview\nVersion: $(SIMVIEW_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: simview\n" > simview/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build simview/debian simview_$(SIMVIEW_VERSION)_amd64.deb +simview/rpm: simview/stage ## build rpm package for simview + $(call rpm,simview,$(SIMVIEW_VERSION),MIT) + ##################################################################################################################################################################################################################################################################################### # _____ __ @@ -592,7 +652,7 @@ simview/debian: ## build debian package for simview # # https://gitlab.com/surfer-project/surfer # -.PHONY: surfer/build surfer surfer/install surfer/debian +.PHONY: surfer/build surfer surfer/install surfer/debian surfer/stage surfer/rpm surfer/.git: git clone --depth 1 --branch main https://gitlab.com/surfer-project/surfer.git @@ -606,13 +666,18 @@ surfer: surfer/build ## build surfer surfer/install: surfer/build ## build and install surfer cd surfer && $(SUDO) mkdir -p $(BIN_DIR) && $(SUDO) cp target/release/surfer $(BIN_DIR) -surfer/debian: ## build debian package for surfer +surfer/stage: ## stage surfer under surfer/debian/usr/local for packaging $(MAKE) surfer/build INSTALL_PREFIX=./debian/usr/local $(MAKE) surfer/install INSTALL_PREFIX=./debian/usr/local SUDO= + +surfer/debian: surfer/stage ## build debian package for surfer mkdir -p surfer/debian/DEBIAN printf "Package: surfer\nVersion: $(SURFER_VERSION)\nSection: utils\nPriority: optional\nArchitecture: amd64\nMaintainer: timkpaine \nDescription: surfer\n" > surfer/debian/DEBIAN/control dpkg-deb -Z"gzip" --root-owner-group --build surfer/debian surfer_$(SURFER_VERSION)_amd64.deb +surfer/rpm: surfer/stage ## build rpm package for surfer + $(call rpm,surfer,$(SURFER_VERSION),EUPL-1.2) + @@ -629,14 +694,17 @@ clean: ## Delete all built repos rm -rf googletest rm -rf capnproto rm -rf json - rm -rf antlr4 + rm -rf antlr rm -rf uhdm rm -rf surelog rm -rf yosys-slang rm -rf verible rm -rf yosys rm -rf openfpgaloader + rm -rf verilator + rm -rf simview rm -rf surfer + rm -f ./*.deb ./*.rpm .DEFAULT_GOAL := help diff --git a/README.md b/README.md index 0d53e32..f33e581 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,16 @@ Software Tools | Package | Source | Version | Arch | Platform | | :------------- | :------------------------------------------------------------------------ | :----------------- | :---- | :------- | -| ANTLR | [antlr.org](https://www.antlr.org/) | 4.12.0 | amd64 | deb | -| capnproto | [capnproto/capnproto](https://github.com/capnproto/capnproto) | 1.0.0 | amd64 | deb | -| JSON | [nlohmann/json](https://github.com/nlohmann/json) | 3.11.2 | amd64 | deb | -| openFPGALoader | [trabucayre/openFPGALoader](https://github.com/trabucayre/openFPGALoader) | 0.13.1 | amd64 | deb | -| Surelog | [chipsalliance/surelog](https://github.com/chipsalliance/surelog) | 1.80 | amd64 | deb | -| surfer | [surfer-project/surfer](https://gitlab.com/surfer-project/surfer) | N/A | amd64 | deb | -| UHDM | [chipsalliance/uhdm](https://github.com/chipsalliance/uhdm) | 1.80 | amd64 | deb | -| Verible | [chipsalliance/verible](https://github.com/chipsalliance/verible) | 0.0-3430-g060bde0f | amd64 | deb | -| verilator | [verilator/verilator](https://github.com/verilator/verilator) | 5.044 | | | -| yosys | [YosysHQ/yosys](https://github.com/YosysHQ/yosys) | 0.62 | amd64 | deb | -| yosys-slang | [povik/yosys-slang](https://github.com/povik/yosys-slang) | 0.0-gd5e8d8558e | amd64 | deb | +| ANTLR | [antlr.org](https://www.antlr.org/) | 4.12.0 | amd64 | deb, rpm | +| capnproto | [capnproto/capnproto](https://github.com/capnproto/capnproto) | 1.0.0 | amd64 | deb, rpm | +| JSON | [nlohmann/json](https://github.com/nlohmann/json) | 3.11.2 | amd64 | deb, rpm | +| openFPGALoader | [trabucayre/openFPGALoader](https://github.com/trabucayre/openFPGALoader) | 0.13.1 | amd64 | deb, rpm | +| Surelog | [chipsalliance/surelog](https://github.com/chipsalliance/surelog) | 1.80 | amd64 | deb, rpm | +| surfer | [surfer-project/surfer](https://gitlab.com/surfer-project/surfer) | N/A | amd64 | deb, rpm | +| UHDM | [chipsalliance/uhdm](https://github.com/chipsalliance/uhdm) | 1.80 | amd64 | deb, rpm | +| Verible | [chipsalliance/verible](https://github.com/chipsalliance/verible) | 0.0-3430-g060bde0f | amd64 | deb, rpm | +| verilator | [verilator/verilator](https://github.com/verilator/verilator) | 5.044 | amd64 | deb, rpm | +| yosys | [YosysHQ/yosys](https://github.com/YosysHQ/yosys) | 0.62 | amd64 | deb, rpm | +| yosys-slang | [povik/yosys-slang](https://github.com/povik/yosys-slang) | 0.0-gd5e8d8558e | amd64 | deb, rpm | From 95059ea602501d76155bf1f0a7847af51c3d20fb Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 11 Oct 2026 19:36:23 -0400 Subject: [PATCH 2/5] Build the rpms under CMake 4 and install libraries into lib Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- .github/workflows/build.yaml | 4 ++++ Makefile | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 26e1db5..e14be8a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -250,6 +250,10 @@ jobs: runs-on: ubuntu-24.04 container: quay.io/pypa/manylinux_2_28_x86_64 + # the image's CMake 4 refuses projects that declare a minimum below 3.5 + env: + CMAKE_POLICY_VERSION_MINIMUM: "3.5" + steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/Makefile b/Makefile index edbc3bd..4bb9007 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,9 @@ endif # Common CMake setup args INSTALL_PREFIX := -CMAKE_COMMON_ARGS := -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON +# EL's GNUInstallDirs picks lib64, which surelog's FindANTLR does not search; +# Debian and macOS already use lib under /usr/local +CMAKE_COMMON_ARGS := -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_LIBDIR=lib ifdef INSTALL_PREFIX CMAKE_COMMON_ARGS := $(CMAKE_COMMON_ARGS) -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) endif From b67be5022475f873f8ee43f969625fcf4bd2af28 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:05:06 -0400 Subject: [PATCH 3/5] Build bison 3.8 for yosys in the rpm job Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- .github/workflows/build.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e14be8a..94a940b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -258,7 +258,13 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Global Dependencies - run: dnf install -y bison ccache flex flex-devel help2man hidapi-devel java-17-openjdk-headless libffi-devel libftdi-devel libusb1-devel readline-devel rpm-build systemd-devel tcl-devel wget zlib-devel + run: dnf install -y ccache flex flex-devel help2man hidapi-devel java-17-openjdk-headless libffi-devel libftdi-devel libusb1-devel m4 readline-devel rpm-build systemd-devel tcl-devel wget zlib-devel + + # yosys needs bison 3.6 or newer and EL8 ships 3.0.4 + - name: Install bison + run: | + curl -sL https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.xz | tar xJ -C /tmp + cd /tmp/bison-3.8.2 && ./configure --prefix=/usr/local && make -j $(nproc) && make install # the image's /usr/bin/python3 has no pip; its own interpreters do - name: Install python dependencies From 44dc5b533e490746397991ac9a12a239f18f0ea6 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sun, 11 Oct 2026 23:17:34 -0400 Subject: [PATCH 4/5] List only files in the rpms so they install beside EL's filesystem package Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4bb9007..ca1b40d 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,11 @@ SUDO:=sudo # Package the tree a /stage target staged under /debian/usr as a # binary rpm in the current directory: $(call rpm,,,). # rpm versions cannot hold a hyphen, so one becomes a dot. +# It lists files and symlinks only: EL's filesystem package owns /usr/local +# and its standard subdirectories. define rpm mkdir -p $(1)/rpm/SPECS - printf 'Name: $(1)\nVersion: $(subst -,.,$(2))\nRelease: 1\nSummary: $(1)\nLicense: $(3)\nPackager: timkpaine \n\n%%description\n$(1)\n\n%%install\ncp -a $(CURDIR)/$(1)/debian/usr %%{buildroot}/\n\n%%files\n%%defattr(-,root,root,-)\n/usr/local/*\n' > $(1)/rpm/SPECS/$(1).spec + printf 'Name: $(1)\nVersion: $(subst -,.,$(2))\nRelease: 1\nSummary: $(1)\nLicense: $(3)\nPackager: timkpaine \n\n%%description\n$(1)\n\n%%install\ncp -a $(CURDIR)/$(1)/debian/usr %%{buildroot}/\ncd %%{buildroot} && find usr -type f -o -type l | sed s,^,/, > %%{_builddir}/$(1).files\n\n%%files -f %%{_builddir}/$(1).files\n%%defattr(-,root,root,-)\n' > $(1)/rpm/SPECS/$(1).spec rpmbuild -bb --define '_topdir $(CURDIR)/$(1)/rpm' --define 'debug_package %{nil}' --define '__os_install_post %{nil}' --define '_build_id_links none' $(1)/rpm/SPECS/$(1).spec cp $(1)/rpm/RPMS/*/$(1)-$(subst -,.,$(2))-1.*.rpm . endef From 7baaeb6d04e0b5f696204da27f8097b6106081da Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Tue, 13 Oct 2026 10:52:54 -0400 Subject: [PATCH 5/5] Put /usr/local/lib on the loader path and make verilator require perl Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ca1b40d..0bc75fc 100644 --- a/Makefile +++ b/Makefile @@ -66,13 +66,15 @@ endif SUDO:=sudo # Package the tree a /stage target staged under /debian/usr as a -# binary rpm in the current directory: $(call rpm,,,). -# rpm versions cannot hold a hyphen, so one becomes a dot. -# It lists files and symlinks only: EL's filesystem package owns /usr/local -# and its standard subdirectories. +# binary rpm in the current directory: +# $(call rpm,,,[,]) +# rpm versions cannot hold a hyphen, so one becomes a dot. The spec lists files +# and symlinks only, because EL's filesystem package owns /usr/local and its +# standard subdirectories. EL does not search /usr/local/lib for shared +# libraries, so a package that installs some there adds it to ld.so.conf.d. define rpm mkdir -p $(1)/rpm/SPECS - printf 'Name: $(1)\nVersion: $(subst -,.,$(2))\nRelease: 1\nSummary: $(1)\nLicense: $(3)\nPackager: timkpaine \n\n%%description\n$(1)\n\n%%install\ncp -a $(CURDIR)/$(1)/debian/usr %%{buildroot}/\ncd %%{buildroot} && find usr -type f -o -type l | sed s,^,/, > %%{_builddir}/$(1).files\n\n%%files -f %%{_builddir}/$(1).files\n%%defattr(-,root,root,-)\n' > $(1)/rpm/SPECS/$(1).spec + printf 'Name: $(1)\nVersion: $(subst -,.,$(2))\nRelease: 1\nSummary: $(1)\nLicense: $(3)\n$(if $(4),Requires: $(4)\n)Packager: timkpaine \n\n%%description\n$(1)\n\n%%install\ncp -a $(CURDIR)/$(1)/debian/usr %%{buildroot}/\ncd %%{buildroot}\nif ls usr/local/lib/*.so* >/dev/null 2>&1; then mkdir -p etc/ld.so.conf.d && echo /usr/local/lib > etc/ld.so.conf.d/$(1).conf; fi\nfind * -type f -o -type l | sed s,^,/, > %%{_builddir}/$(1).files\n\n%%post -p /sbin/ldconfig\n\n%%postun -p /sbin/ldconfig\n\n%%files -f %%{_builddir}/$(1).files\n%%defattr(-,root,root,-)\n' > $(1)/rpm/SPECS/$(1).spec rpmbuild -bb --define '_topdir $(CURDIR)/$(1)/rpm' --define 'debug_package %{nil}' --define '__os_install_post %{nil}' --define '_build_id_links none' $(1)/rpm/SPECS/$(1).spec cp $(1)/rpm/RPMS/*/$(1)-$(subst -,.,$(2))-1.*.rpm . endef @@ -602,7 +604,7 @@ verilator/debian: verilator/stage ## build debian package for verilator dpkg-deb -Z"gzip" --root-owner-group --build verilator/debian verilator_$(VERILATOR_VERSION)_amd64.deb verilator/rpm: verilator/stage ## build rpm package for verilator - $(call rpm,verilator,$(VERILATOR_VERSION),LGPL-3.0-only OR Artistic-2.0) + $(call rpm,verilator,$(VERILATOR_VERSION),LGPL-3.0-only OR Artistic-2.0,perl)