diff --git a/anda/langs/haskell/ghc-libriscv/anda.hcl b/anda/langs/haskell/ghc-libriscv/anda.hcl new file mode 100644 index 0000000000..9bda3866d7 --- /dev/null +++ b/anda/langs/haskell/ghc-libriscv/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "ghc-libriscv.spec" + } +} diff --git a/anda/langs/haskell/ghc-libriscv/bytestring-ver-fix.patch b/anda/langs/haskell/ghc-libriscv/bytestring-ver-fix.patch new file mode 100644 index 0000000000..31dc9cbd69 --- /dev/null +++ b/anda/langs/haskell/ghc-libriscv/bytestring-ver-fix.patch @@ -0,0 +1,13 @@ +diff --git a/libriscv.cabal b/libriscv.cabal +index 25e48fa..22e204a 100644 +--- a/libriscv.cabal ++++ b/libriscv.cabal +@@ -91,7 +91,7 @@ library + , base >= 4.15.0.0 && <4.20.0.0 + , array ^>= 0.5.4.0 + , filepath ^>= 1.4.2.1 +- , bytestring >= 0.10.10 && <0.12 ++ , bytestring >= 0.10.10 + , exceptions ^>= 0.10.4 + , melf ^>= 1.3.0 + , freer-simple ^>= 1.2.1.2 diff --git a/anda/langs/haskell/ghc-libriscv/ghc-libriscv.spec b/anda/langs/haskell/ghc-libriscv/ghc-libriscv.spec new file mode 100644 index 0000000000..f88e6904a7 --- /dev/null +++ b/anda/langs/haskell/ghc-libriscv/ghc-libriscv.spec @@ -0,0 +1,166 @@ +# generated by cabal-rpm-2.3.2 +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Haskell/ + +%global pkg_name libriscv +%global pkgver %{pkg_name}-%{version} +%{?haskell_setup} + +# testsuite missing deps: bv tasty tasty-hunit + +Name: ghc-%{pkg_name} +Version: 0.1.0.0 +Release: 1%{?dist} +Summary: A versatile, flexible and executable formal model for the RISC-V architecture + +License: MIT +URL: https://hackage.haskell.org/package/libriscv +# Begin cabal-rpm sources: +Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz +# End cabal-rpm sources +Patch0: bytestring-ver-fix.patch +# Begin cabal-rpm deps: +BuildRequires: ghc-rpm-macros +BuildRequires: ghc-Cabal-devel +BuildRequires: ghc-array-devel +BuildRequires: ghc-base-devel +BuildRequires: ghc-bv-devel +BuildRequires: ghc-bytestring-devel +BuildRequires: ghc-containers-devel +BuildRequires: ghc-exceptions-devel +BuildRequires: ghc-extra-devel +BuildRequires: ghc-file-embed-devel +BuildRequires: ghc-filepath-devel +BuildRequires: ghc-freer-simple-devel +BuildRequires: ghc-melf-devel +BuildRequires: ghc-optparse-applicative-devel +BuildRequires: ghc-parameterized-utils-devel +BuildRequires: ghc-template-haskell-devel +BuildRequires: ghc-transformers-devel +BuildRequires: ghc-yaml-devel +%if %{with ghc_prof} +BuildRequires: ghc-array-prof +BuildRequires: ghc-base-prof +BuildRequires: ghc-bv-prof +BuildRequires: ghc-bytestring-prof +BuildRequires: ghc-containers-prof +BuildRequires: ghc-exceptions-prof +BuildRequires: ghc-extra-prof +BuildRequires: ghc-file-embed-prof +BuildRequires: ghc-filepath-prof +BuildRequires: ghc-freer-simple-prof +BuildRequires: ghc-melf-prof +BuildRequires: ghc-optparse-applicative-prof +BuildRequires: ghc-parameterized-utils-prof +BuildRequires: ghc-template-haskell-prof +BuildRequires: ghc-transformers-prof +BuildRequires: ghc-yaml-prof +%endif +# End cabal-rpm deps + +Packager: Owen Zimmerman + +%description +A formal model for the /Instruction Set +Architecture/ (ISA). Contrary to other Haskell RISC-V ISA models, like + or +, LibRISCV is +specifically tailored to the creation of custom ISA interpreters. To this end, +it is designed for flexibility, allowing a versatile representation of +instruction operands. For example, instruction operands can be + expressions +for of binary +code. + +LibRISCV abstractly describes instruction semantics using an /Embedded Domain +Specific Language/ (EDSL) with . This Haskell library is intended to build custom interpreters for this +free monad. The entry point for this purpose is the +'LibRISCV.Semantics.buildAST' function which obtains the free monad AST based +on an entry address. The entry address can be obtained from a provided ELF +loader implementation, this "Loader" module is also responsible for loading +binary instructions into a provided memory implementation. Refer to provided +example interpreters in the for practical usage instruction. More detailed information on +LibRISCV and its concepts is also available in a +. + + +%package devel +Summary: Haskell %{pkg_name} library development files +Provides: %{name}-static = %{version}-%{release} +Provides: %{name}-static%{?_isa} = %{version}-%{release} +%if %{defined ghc_version} +Requires: ghc-compiler = %{ghc_version} +%endif +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package provides the Haskell %{pkg_name} library development files. + + +%if %{with haddock} +%package doc +Summary: Haskell %{pkg_name} library documentation +BuildArch: noarch +Requires: ghc-filesystem + +%description doc +This package provides the Haskell %{pkg_name} library documentation. +%endif + + +%if %{with ghc_prof} +%package prof +Summary: Haskell %{pkg_name} profiling library +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Supplements: (%{name}-devel and ghc-prof) + +%description prof +This package provides the Haskell %{pkg_name} profiling library. +%endif + + +%prep +# Begin cabal-rpm setup: +%setup -q -n %{pkgver} +%patch -P0 -p1 +# End cabal-rpm setup + + +%build +# Begin cabal-rpm build: +%ghc_lib_build +# End cabal-rpm build + + +%install +# Begin cabal-rpm install +%ghc_lib_install +# End cabal-rpm install + + +%files -f %{name}.files +# Begin cabal-rpm files: +%license LICENSE.txt +%{_datadir}/%{pkgver} +# End cabal-rpm files + + +%files devel -f %{name}-devel.files +%{_bindir}/riscv-tiny + + +%if %{with haddock} +%files doc -f %{name}-doc.files +%license LICENSE.txt +%endif + + +%if %{with ghc_prof} +%files prof -f %{name}-prof.files +%endif + + +%changelog +* Tue Apr 28 2026 Owen Zimmerman - 0.1.0.0-1 +- Initial commit diff --git a/anda/langs/haskell/ghc-libriscv/update.rhai b/anda/langs/haskell/ghc-libriscv/update.rhai new file mode 100644 index 0000000000..9c9aa8a431 --- /dev/null +++ b/anda/langs/haskell/ghc-libriscv/update.rhai @@ -0,0 +1 @@ +rpm.version(hackage("libriscv"));