2018-01-30 07:34:12 +01:00
|
|
|
#
|
|
|
|
# spec file for package ocaml-dune
|
|
|
|
#
|
2023-01-02 15:47:56 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2018-01-30 07:34:12 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-05-16 07:50:28 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-01-30 07:34:12 +01:00
|
|
|
#
|
|
|
|
|
2022-04-04 17:19:29 +02:00
|
|
|
%define build_flavor @BUILD_FLAVOR@%nil
|
|
|
|
%if "%build_flavor" == ""
|
|
|
|
%define nsuffix %nil
|
2021-01-24 23:08:15 +01:00
|
|
|
%else
|
2022-04-04 17:19:29 +02:00
|
|
|
%define nsuffix -%build_flavor
|
2021-01-24 23:08:15 +01:00
|
|
|
%endif
|
2018-01-30 07:34:12 +01:00
|
|
|
|
2021-01-27 22:19:28 +01:00
|
|
|
%define pkg ocaml-dune
|
2022-04-04 17:20:58 +02:00
|
|
|
%global _buildshell /bin/bash
|
2022-04-04 17:19:29 +02:00
|
|
|
Name: %pkg%nsuffix
|
2023-07-08 09:44:04 +02:00
|
|
|
Version: 3.9.1
|
2018-01-30 07:34:12 +01:00
|
|
|
Release: 0
|
|
|
|
%{?ocaml_preserve_bytecode}
|
2019-02-05 08:09:16 +01:00
|
|
|
License: MIT
|
2018-01-30 07:34:12 +01:00
|
|
|
Group: Development/Languages/OCaml
|
2021-04-13 15:37:16 +02:00
|
|
|
BuildRoot: %_tmppath/%name-%version-build
|
2020-08-21 19:19:34 +02:00
|
|
|
URL: https://opam.ocaml.org/packages/dune
|
2022-04-04 17:19:29 +02:00
|
|
|
Source0: %pkg-%version.tar.xz
|
2019-11-25 15:43:53 +01:00
|
|
|
Requires: ocamlfind(compiler-libs)
|
2023-01-02 21:20:39 +01:00
|
|
|
BuildRequires: ocaml-rpm-macros >= 20230101
|
2020-08-21 19:19:34 +02:00
|
|
|
BuildRequires: ocaml(ocaml_base_version) >= 4.08
|
2022-04-04 17:19:29 +02:00
|
|
|
%if "%build_flavor" == ""
|
2022-04-09 21:49:56 +02:00
|
|
|
Provides: %name-bootstrap = %version-%release
|
|
|
|
Provides: %name-bootstrap-devel = %version-%release
|
|
|
|
Obsoletes: %name-bootstrap < %version-%release
|
|
|
|
Obsoletes: %name-bootstrap-devel < %version-%release
|
|
|
|
Summary: A composable build system for OCaml
|
|
|
|
%description
|
|
|
|
This package provides the dune binary and the documentation.
|
|
|
|
%endif
|
|
|
|
%if "%build_flavor" == "devel"
|
|
|
|
Summary: Various libraries
|
|
|
|
Group: Development/Languages/OCaml
|
|
|
|
BuildRequires: ocaml-dune = %version
|
2022-04-04 17:20:58 +02:00
|
|
|
BuildRequires: ocamlfind(csexp)
|
|
|
|
BuildRequires: ocamlfind(pp)
|
|
|
|
BuildRequires: ocamlfind(result)
|
|
|
|
Provides: ocaml-dune-configurator == %version-%release
|
|
|
|
Obsoletes: ocaml-dune-configurator < %version-%release
|
|
|
|
Provides: ocaml-dune-configurator-devel == %version-%release
|
|
|
|
Obsoletes: ocaml-dune-configurator-devel < %version-%release
|
2019-09-25 14:19:06 +02:00
|
|
|
|
2022-04-09 21:49:56 +02:00
|
|
|
%description
|
|
|
|
This package provides various libraries:
|
2022-06-14 11:51:19 +02:00
|
|
|
chrome-trace
|
2022-04-09 21:49:56 +02:00
|
|
|
dune-action-plugin
|
|
|
|
dune-build-info
|
|
|
|
dune-configurator
|
|
|
|
dune-glob
|
|
|
|
dune-private-libs
|
|
|
|
dune-rpc
|
|
|
|
dune-site
|
|
|
|
dyn
|
2022-04-20 07:05:37 +02:00
|
|
|
ocamlc-loc
|
2022-04-09 21:49:56 +02:00
|
|
|
ordering
|
|
|
|
stdune
|
|
|
|
xdg
|
|
|
|
%endif
|
2019-09-25 14:19:06 +02:00
|
|
|
|
2018-01-30 07:34:12 +01:00
|
|
|
%prep
|
2022-04-04 17:19:29 +02:00
|
|
|
%setup -q -n %pkg-%version
|
2018-01-30 07:34:12 +01:00
|
|
|
|
|
|
|
%build
|
2021-01-24 23:08:15 +01:00
|
|
|
mv -vb src/dune_rules/setup.defaults.ml src/dune_rules/setup.ml
|
2023-01-06 22:57:19 +01:00
|
|
|
bash configure \
|
2022-06-14 11:51:19 +02:00
|
|
|
'--bindir=%_bindir' \
|
|
|
|
'--datadir=%_datadir' \
|
2022-04-04 17:20:58 +02:00
|
|
|
'--etcdir=%_sysconfdir' \
|
|
|
|
'--libdir=%ocaml_standard_library' \
|
2022-06-14 11:51:19 +02:00
|
|
|
'--libexecdir=%_libexecdir' \
|
2022-04-04 17:20:58 +02:00
|
|
|
'--mandir=%_mandir' \
|
2022-06-14 11:51:19 +02:00
|
|
|
'--sbindir=%_sbindir' \
|
2022-04-04 17:20:58 +02:00
|
|
|
%nil
|
2021-01-24 23:08:15 +01:00
|
|
|
#
|
2022-04-09 21:49:56 +02:00
|
|
|
%if "%build_flavor" == ""
|
|
|
|
dune_release_pkgs='dune'
|
|
|
|
%ocaml_dune_setup
|
2022-04-04 17:20:58 +02:00
|
|
|
jobs="-j `/usr/bin/getconf _NPROCESSORS_ONLN`"
|
2023-01-06 22:57:19 +01:00
|
|
|
ocaml boot/bootstrap.ml --verbose ${jobs}
|
|
|
|
./_boot/dune.exe build \
|
2022-04-04 17:20:58 +02:00
|
|
|
dune.install \
|
|
|
|
--release \
|
|
|
|
--profile dune-bootstrap \
|
|
|
|
--verbose \
|
|
|
|
${jobs} \
|
|
|
|
%nil
|
2022-04-09 21:49:56 +02:00
|
|
|
mkdir .bin
|
2023-01-06 22:57:19 +01:00
|
|
|
ln -sv ../_boot/dune.exe .bin/dune
|
2021-01-24 23:08:15 +01:00
|
|
|
%endif
|
|
|
|
#
|
2022-04-09 21:49:56 +02:00
|
|
|
%if "%build_flavor" == "devel"
|
2022-04-04 17:20:58 +02:00
|
|
|
pkgs=(
|
2022-06-14 11:51:19 +02:00
|
|
|
chrome-trace
|
2022-04-04 17:20:58 +02:00
|
|
|
dune-action-plugin
|
|
|
|
dune-build-info
|
|
|
|
dune-configurator
|
|
|
|
dune-glob
|
|
|
|
dune-private-libs
|
|
|
|
dune-rpc
|
|
|
|
dune-site
|
|
|
|
dyn
|
2022-04-20 07:05:37 +02:00
|
|
|
ocamlc-loc
|
2022-04-04 17:20:58 +02:00
|
|
|
ordering
|
|
|
|
stdune
|
|
|
|
xdg
|
|
|
|
)
|
|
|
|
dune_release_pkgs="${pkgs[*]}"
|
|
|
|
dune_release_pkgs="${dune_release_pkgs// /,}"
|
|
|
|
#
|
2020-03-06 20:03:57 +01:00
|
|
|
%ocaml_dune_setup
|
|
|
|
%ocaml_dune_build
|
2022-04-04 17:20:58 +02:00
|
|
|
%endif
|
2018-01-30 07:34:12 +01:00
|
|
|
|
|
|
|
%install
|
2022-04-09 21:49:56 +02:00
|
|
|
# use the just built dune
|
|
|
|
PATH="$PWD/.bin:$PATH"
|
|
|
|
%ocaml_dune_install
|
|
|
|
%if "%build_flavor" == "devel"
|
|
|
|
# the META file removed below belongs to this package, to provide dune.configurator
|
|
|
|
mkdir -vp %buildroot%ocaml_standard_library/dune
|
|
|
|
tee %buildroot%ocaml_standard_library/dune/META <<_EOM_
|
|
|
|
package "configurator" (
|
|
|
|
directory = "configurator"
|
|
|
|
version = "%version"
|
|
|
|
requires = "dune-configurator"
|
|
|
|
)
|
|
|
|
_EOM_
|
2022-04-04 17:20:58 +02:00
|
|
|
%endif
|
|
|
|
%if "%build_flavor" == ""
|
2022-04-09 21:49:56 +02:00
|
|
|
# the installed META file provides and requires 'dune-configurator'
|
|
|
|
rm -rfv %buildroot%ocaml_standard_library
|
|
|
|
%endif
|
|
|
|
#
|
2019-09-30 18:29:31 +02:00
|
|
|
%ocaml_create_file_list
|
2022-04-09 21:49:56 +02:00
|
|
|
#
|
|
|
|
%if "%build_flavor" == "devel"
|
|
|
|
# package everything, including the cmxs files
|
|
|
|
tee -a %name.files < %name.files.devel
|
2022-04-04 17:20:58 +02:00
|
|
|
%endif
|
2018-01-30 07:34:12 +01:00
|
|
|
|
2022-04-04 17:19:29 +02:00
|
|
|
%files -f %name.files
|
2021-04-13 15:37:16 +02:00
|
|
|
%defattr(-,root,root,-)
|
2022-04-04 17:19:29 +02:00
|
|
|
%if "%build_flavor" == ""
|
2019-02-05 08:09:16 +01:00
|
|
|
%doc CHANGES.md README.md
|
2019-10-15 20:16:35 +02:00
|
|
|
%doc doc/*.rst
|
2022-04-04 17:19:29 +02:00
|
|
|
%_bindir/*
|
|
|
|
%_mandir/*/*
|
|
|
|
%_datadir/emacs
|
2021-01-24 23:08:15 +01:00
|
|
|
%endif
|
2019-09-25 14:19:06 +02:00
|
|
|
|
2018-01-30 07:34:12 +01:00
|
|
|
|
|
|
|
%changelog
|