From 498da2c35b34a92caa223342be59cc18983d692d Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Glondu?= Date: Sat, 19 Aug 2023 03:16:21 +0200 Subject: [PATCH] Reorganize binary packages --- debian/control | 111 +++++++++++++----- debian/dispatch.ml | 27 +++-- ...mpiler-libs-ocaml-dev.lintian-overrides.in | 1 + debian/ocaml.lintian-overrides.in | 1 - debian/ocamlinit.mk | 2 +- debian/rules | 22 ++-- 6 files changed, 107 insertions(+), 57 deletions(-) create mode 100644 debian/libcompiler-libs-ocaml-dev.lintian-overrides.in diff --git a/debian/control b/debian/control index 54f0e6bb..c6d03b1f 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Build-Depends: libiberty-dev, libncurses-dev, zlib1g-dev, - dh-ocaml (>= 1.3) + dh-ocaml Standards-Version: 4.6.2 Rules-Requires-Root: no Vcs-Git: https://salsa.debian.org/ocaml-team/ocaml.git @@ -26,14 +26,12 @@ Homepage: https://ocaml.org/ Package: ocaml-base Architecture: any Depends: + libstdlib-ocaml (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends} Provides: - libseq-ocaml, - libuchar-ocaml, - libstdlib-shims-ocaml, - ${ocaml:Provides} + ocaml-base-${F:OCamlABI} Breaks: ocaml-base-nox (<< 4.13) Replaces: ocaml-base-nox (<< 4.13) Description: Runtime system for OCaml bytecode executables @@ -56,10 +54,7 @@ Depends: ${misc:Depends}, ${ocaml:Depends} Provides: - libseq-ocaml-dev, - libuchar-ocaml-dev, - libstdlib-shims-ocaml-dev, - ${ocaml:Provides}, + ocaml-${F:OCamlABI}, ocaml-best-compilers (= ${binary:Version}), ${F:NativeProvides} Suggests: @@ -92,6 +87,65 @@ Description: ML language implementation with a class-based object system . This package contains everything needed to develop OCaml applications. +Package: libstdlib-ocaml-dev +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + ${ocaml:Depends} +Provides: + libseq-ocaml-dev, + libuchar-ocaml-dev, + libstdlib-shims-ocaml-dev, + ${ocaml:Provides} +Recommends: + ocaml-man +Breaks: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~) +Replaces: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~) +Description: OCaml standard library (development files) + OCaml is an implementation of the ML language, based on the Caml + Light dialect extended with a complete class-based object system and + a powerful module system in the style of Standard ML. + . + This package contains the development files of the standard library. + +Package: libstdlib-ocaml +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + ${ocaml:Depends} +Provides: + libseq-ocaml, + libuchar-ocaml, + libstdlib-shims-ocaml, + ${ocaml:Provides} +Breaks: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~) +Replaces: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~) +Description: OCaml standard library (runtime files) + OCaml is an implementation of the ML language, based on the Caml + Light dialect extended with a complete class-based object system and + a powerful module system in the style of Standard ML. + . + This package contains the runtime files of the standard library. + +Package: libcompiler-libs-ocaml-dev +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + ${ocaml:Depends} +Provides: + ${ocaml:Provides} +Breaks: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~) +Replaces: ocaml (<< 4.13.1-5~), ocaml-base (<< 4.13.1-5~), ocaml-compiler-libs (<< 4.13.1-5~) +Description: OCaml compiler library (development files) + OCaml is an implementation of the ML language, based on the Caml + Light dialect extended with a complete class-based object system and + a powerful module system in the style of Standard ML. + . + This package contains the development files of the compiler library. + Package: ocaml-source Architecture: all Depends: ${misc:Depends} @@ -108,7 +162,8 @@ Description: Sources for Objective Caml Package: ocaml-interp Architecture: any Depends: - ocaml-compiler-libs (= ${binary:Version}), + ocaml-base (= ${binary:Version}), + libcompiler-libs-ocaml-dev (= ${binary:Version}), ${ocaml:Depends}, ${misc:Depends} Provides: @@ -122,27 +177,6 @@ Description: OCaml interactive interpreter and standard libraries This package contains the files required to run an OCaml shell from the command line. -Package: ocaml-compiler-libs -Architecture: any -Depends: - ${shlibs:Depends}, - ${misc:Depends}, - ${ocaml:Depends} -Provides: - ${ocaml:Provides} -Recommends: - ocaml-man -Replaces: ocaml-base-nox (<< 4) -Breaks: ocaml-base-nox (<< 4) -Description: OCaml interpreter and standard libraries - Objective (OCaml) is an implementation of the ML language, based on - the Caml Light dialect extended with a complete class-based object system - and a powerful module system in the style of Standard ML. - . - This package contains several modules used internally by the OCaml - compilers. They are not needed for normal OCaml development, but may - be helpful in the development of certain applications. - Package: ocaml-man Architecture: all Depends: @@ -192,3 +226,18 @@ Description: transitional package for ocaml and a powerful module system in the style of Standard ML. . This is a transitional package and can be safely removed. + +Package: ocaml-compiler-libs +Section: oldlibs +Architecture: all +Depends: + libcompiler-libs-ocaml-dev, + ${misc:Depends} +Replaces: ocaml-base-nox (<< 4) +Breaks: ocaml-base-nox (<< 4) +Description: transitional package for libcompiler-libs-ocaml-dev + Objective (OCaml) is an implementation of the ML language, based on + the Caml Light dialect extended with a complete class-based object system + and a powerful module system in the style of Standard ML. + . + This is a transitional package and can be safely removed. diff --git a/debian/dispatch.ml b/debian/dispatch.ml index 3bb432a8..c9a31e1b 100644 --- a/debian/dispatch.ml +++ b/debian/dispatch.ml @@ -47,12 +47,15 @@ let get_base str = module SMap = Map.Make (String) module SSet = Set.Make (String) +let dev_stdlib = ref [] +let run_stdlib = ref [] +let dev_compiler_libs = ref [] + let ocaml_base = ref [ "debian/ld.conf usr/lib/ocaml" ] let ocaml = ref [ "debian/native-archs usr/lib/ocaml"; ] -let ocaml_compiler_libs = ref [] let ocaml_interp = ref [ "debian/ocaml.desktop usr/share/applications"; @@ -61,9 +64,11 @@ let ocaml_interp = let ocaml_man = ref [] let pkgs = [ + run_stdlib, "libstdlib-ocaml"; + dev_stdlib, "libstdlib-ocaml-dev"; + dev_compiler_libs, "libcompiler-libs-ocaml-dev"; ocaml_base, "ocaml-base"; ocaml, "ocaml"; - ocaml_compiler_libs, "ocaml-compiler-libs"; ocaml_interp, "ocaml-interp"; ocaml_man, "ocaml-man"; ] @@ -202,22 +207,22 @@ let process_file x = match find_base base with | true -> if List.exists (fun y -> endswith y x) exts_dev then ( - push ocaml x + push dev_stdlib x ) else if List.exists (fun y -> endswith y x) exts_run then ( - push ocaml_base x + push run_stdlib x ) else Some x | false -> Some x let remaining = installed_files |> move_all_to ocaml (startswith "usr/lib/ocaml/caml/") - |> move_all_to ocaml (startswith "usr/lib/ocaml/ocamldoc/") - |> move_all_to ocaml (startswith "usr/lib/ocaml/vmthreads/") - |> move_all_to ocaml (startswith "usr/lib/ocaml/threads/") - |> move_all_to ocaml (startswith "usr/lib/ocaml/std_exit.") - |> move_all_to ocaml (startswith "usr/lib/ocaml/stdlib.") - |> move_all_to ocaml (startswith "usr/lib/ocaml/dynlink") - |> move_all_to ocaml_compiler_libs (startswith "usr/lib/ocaml/compiler-libs/") + |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/threads/") + |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/std_exit.") + |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/stdlib.") + |> move_all_to dev_stdlib (startswith "usr/lib/ocaml/dynlink") + |> move_all_to dev_compiler_libs (startswith "usr/lib/ocaml/topdirs.") + |> move_all_to dev_compiler_libs (startswith "usr/lib/ocaml/compiler-libs/") + |> move_all_to dev_compiler_libs (startswith "usr/lib/ocaml/ocamldoc/") |> move_all_to ocaml_man (endswith ".3o") |> rev_filter_map process_static |> rev_filter_map process_file diff --git a/debian/libcompiler-libs-ocaml-dev.lintian-overrides.in b/debian/libcompiler-libs-ocaml-dev.lintian-overrides.in new file mode 100644 index 00000000..f5b56cc2 --- /dev/null +++ b/debian/libcompiler-libs-ocaml-dev.lintian-overrides.in @@ -0,0 +1 @@ +libcompiler-libs-ocaml-dev: ocaml-dangling-cmx [.@OCamlStdlibDir@/ocamldoc/odoc*.cmx] diff --git a/debian/ocaml.lintian-overrides.in b/debian/ocaml.lintian-overrides.in index 83eaced4..b55e2419 100644 --- a/debian/ocaml.lintian-overrides.in +++ b/debian/ocaml.lintian-overrides.in @@ -5,4 +5,3 @@ ocaml: unusual-interpreter /usr/bin/ocamlrund [.@OCamlStdlibDir@/camlheaderd] ocaml: unusual-interpreter /usr/bin/ocamlruni [.@OCamlStdlibDir@/camlheaderi] ocaml: no-manual-page [usr/bin/ocaml*.byte] ocaml: no-manual-page [usr/bin/ocaml*.opt] -ocaml: ocaml-dangling-cmx [.@OCamlStdlibDir@/ocamldoc/odoc*.cmx] diff --git a/debian/ocamlinit.mk b/debian/ocamlinit.mk index 22b7d69b..022cd729 100644 --- a/debian/ocamlinit.mk +++ b/debian/ocamlinit.mk @@ -75,7 +75,7 @@ ocamlinit-stamp: Makefile.config for t in $(OCAML_IN_FILES); do \ sed $(OCAMLINIT_SED) $$t.in > $$t; \ done - sed -i 's@\./@@' debian/ocaml.lintian-overrides + sed -i 's@\./@@' debian/*.lintian-overrides touch $@ ocamlinit-clean: diff --git a/debian/rules b/debian/rules index 2ace08df..f3974c74 100755 --- a/debian/rules +++ b/debian/rules @@ -197,14 +197,14 @@ install-stamp-arch: install-stamp fi \ done # Install the seq compatibility package (OCaml >= 4.07) - mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/seq - cp debian/META.seq debian/ocaml-base$(OCAML_STDLIB_DIR)/seq/META + mkdir -p debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/seq + cp debian/META.seq debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/seq/META # Install the uchar compatibility package (OCaml >= 4.03) - mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/uchar - cp debian/META.uchar debian/ocaml-base$(OCAML_STDLIB_DIR)/uchar/META + mkdir -p debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/uchar + cp debian/META.uchar debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/uchar/META # Install the stdlib-shims compatibility package (OCaml >= 4.07) - mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/stdlib-shims - cp debian/META.stdlib-shims debian/ocaml-base$(OCAML_STDLIB_DIR)/stdlib-shims/META + mkdir -p debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/stdlib-shims + cp debian/META.stdlib-shims debian/libstdlib-ocaml-dev$(OCAML_STDLIB_DIR)/stdlib-shims/META # Remaining stuff touch $@ @@ -235,7 +235,7 @@ endif .PHONY: override_dh_gencontrol override_dh_gencontrol: - set -e; for u in ocaml-source ocaml-interp ocaml-compiler-libs; do \ + set -e; for u in ocaml-source ocaml-interp ocaml-base ocaml; do \ echo 'F:OCamlABI=$(OCAML_ABI)' >> debian/$$u.substvars; \ done ifeq (,$(OCAML_OPT_ARCH)) @@ -243,12 +243,8 @@ ifeq (,$(OCAML_OPT_ARCH)) else echo 'F:NativeProvides=ocaml-native-compilers (= $${binary:Version})' >> debian/ocaml.substvars endif -# Create .md5sums files and compute dependencies. Use $(OCAML_ABI) -# because we know that OCaml ABI represents best dependencies for -# OCaml package. - dh_ocaml \ - --nodefined-map ocaml:Topdirs \ - --runtime-map ocaml:ocaml-base:$(OCAML_ABI),ocaml-compiler-libs +# Create .md5sums files and compute dependencies. + dh_ocaml dh_gencontrol # Check that OCAML_ABI is correct if [ "$(OCAML_ABI)" != "$(shell boot/ocamlrun ./ocamlc -version | { read a && echo $${a%%_*}; })" ]; then \ -- 2.30.2