Make *-nox packages transitional
authorStephane Glondu <steph@glondu.net>
Tue, 21 Dec 2021 14:15:07 +0000 (15:15 +0100)
committerStéphane Glondu <glondu@debian.org>
Tue, 21 Dec 2021 15:08:48 +0000 (16:08 +0100)
There is no point in providing these packages, since graphics is now
a separate package.

debian/control
debian/dispatch.ml
debian/rules

index e46baef665aafa8e210ee4fae1749bb42b440103..d4a117528e0c3a4cc8679e25cf900c3ef7addd41 100644 (file)
@@ -13,7 +13,6 @@ Build-Depends:
  binutils-dev,
  libiberty-dev,
  libncurses5-dev,
- libx11-dev,
  zlib1g-dev,
  dh-ocaml
 Standards-Version: 4.6.0
@@ -24,36 +23,19 @@ Homepage: https://ocaml.org/
 
 # This needs to stay at the top - we symlink docs to the copy in this package,
 # and dh_installdocs installs README.Debian etc into the first package listed.
-Package: ocaml-base-nox
-Architecture: any
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
-Provides:
- libseq-ocaml,
- libuchar-ocaml,
- libstdlib-shims-ocaml,
- ${ocaml:Provides}
-Replaces: ocaml-base (<< 4.08), ocaml-nox (<< 4.08)
-Breaks: ocaml-base (<< 4.08), ocaml-nox (<< 4.08)
-Description: Runtime system for OCaml bytecode executables (no X)
- Objective Caml (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 only the runtime system needed to run bytecode
- executables that do not use the graphics library. The 'ocaml' package
- contains the full development suite of Objective Caml.
-
 Package: ocaml-base
 Architecture: any
 Depends:
- ocaml-base-nox,
  ${shlibs:Depends},
  ${misc:Depends},
  ${ocaml:Depends}
 Provides:
+ libseq-ocaml,
+ libuchar-ocaml,
+ libstdlib-shims-ocaml,
  ${ocaml:Provides}
+Breaks: ocaml-base-nox (<< 4.13)
+Replaces: ocaml-base-nox (<< 4.13)
 Description: Runtime system for OCaml bytecode executables
  Objective Caml (OCaml) is an implementation of the ML language, based on
  the Caml Light dialect extended with a complete class-based object system
@@ -61,20 +43,18 @@ Description: Runtime system for OCaml bytecode executables
  .
  This package contains only the runtime system needed to run bytecode
  executables. The 'ocaml' package contains the full development suite of
- Objective Caml.  You may wish to install the 'ocaml-base-nox' package if
- you do not require any graphical capabilities for your runtime.
+ Objective Caml.
 
-Package: ocaml-nox
+Package: ocaml
 Architecture: any
 Depends:
- ocaml-base-nox,
- ${shlibs:Depends},
- ${misc:Depends},
- ${ocaml:Depends},
- libncurses5-dev,
  ocaml-interp (= ${binary:Version}),
+ libncurses5-dev,
  gcc,
- binutils
+ binutils,
+ ${shlibs:Depends},
+ ${misc:Depends},
+ ${ocaml:Depends}
 Provides:
  libseq-ocaml-dev,
  libuchar-ocaml-dev,
@@ -88,41 +68,8 @@ Suggests:
 Recommends:
  ocaml-man,
  file
-Replaces: ocaml-base-nox (<< 4.08), ocaml-compiler-libs (<< 4.08)
-Breaks: ocaml-base-nox (<< 4.08), ocaml-compiler-libs (<< 4.08)
-Description: ML implementation with a class-based object system (no X)
- Objective Caml (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.
- .
- OCaml comprises two compilers. One generates bytecode
- which is then interpreted by a C program. This compiler runs quickly,
- generates compact code with moderate memory requirements, and is
- portable to essentially any 32 or 64 bit Unix platform. Performance of
- generated programs is quite good for a bytecoded implementation:
- almost twice as fast as Caml Light 0.7. This compiler can be used
- either as a standalone, batch-oriented compiler that produces
- standalone programs, or as an interactive, toplevel-based system.
- .
- The other compiler generates high-performance native code for a number
- of processors. Compilation takes longer and generates bigger code, but
- the generated programs deliver excellent performance, while retaining
- the moderate memory requirements of the bytecode compiler. It is not
- available on all arches though.
- .
- This package contains everything needed to develop OCaml applications
- that do not require the graphics library.
-
-Package: ocaml
-Architecture: any
-Depends:
- ocaml-base-nox,
- ocaml-nox,
- ${misc:Depends},
- ${ocaml:Depends},
- libx11-dev
-Provides:
- ${ocaml:Provides}
+Breaks: ocaml-nox (<< 4.13)
+Replaces: ocaml-nox (<< 4.13)
 Description: ML language implementation with a class-based object system
  Objective Caml (OCaml) is an implementation of the ML language, based on
  the Caml Light dialect extended with a complete class-based object system
@@ -143,8 +90,7 @@ Description: ML language implementation with a class-based object system
  the moderate memory requirements of the bytecode compiler. It is not
  available on all arches though.
  .
- This package contains everything needed to develop OCaml applications,
- including the graphics libraries.
+ This package contains everything needed to develop OCaml applications.
 
 Package: ocaml-source
 Architecture: all
@@ -180,7 +126,7 @@ Package: ocaml-compiler-libs
 Architecture: any
 Depends:
  ${misc:Depends},
- ocaml-nox-${F:OCamlABI}
+ ocaml-${F:OCamlABI}
 Provides:
  ocaml-compiler-libs-${F:OCamlABI}
 Recommends:
@@ -215,3 +161,31 @@ Description: OCaml interpreter and standard libraries (lib manpages)
  .
  This package contains ocamldoc-generated documentation about libraries
  provided by OCaml.
+
+Package: ocaml-base-nox
+Architecture: all
+Depends:
+ ocaml-base,
+ ${misc:Depends}
+Replaces: ocaml-base (<< 4.08), ocaml-nox (<< 4.08)
+Breaks: ocaml-base (<< 4.08), ocaml-nox (<< 4.08)
+Description: transitional package for ocaml-base
+ Objective Caml (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.
+
+Package: ocaml-nox
+Architecture: all
+Depends:
+ ocaml,
+ ${misc:Depends}
+Replaces: ocaml-base-nox (<< 4.08), ocaml-compiler-libs (<< 4.08)
+Breaks: ocaml-base-nox (<< 4.08), ocaml-compiler-libs (<< 4.08)
+Description: transitional package for ocaml
+ Objective Caml (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.
index 3ee36d45f6079ad3db485d5a2b1aa166fbcd2917..3bb432a8c9fb6752f506d3df581658187ae4478f 100644 (file)
@@ -1,6 +1,6 @@
 (*
   Description: called from debian/rules, generates debhelper's .install files
-  Copyright © 2019 Stéphane Glondu <glondu@debian.org>
+  Copyright © 2019-2021 Stéphane Glondu <glondu@debian.org>
 *)
 
 let rev_filter_map f xs =
@@ -45,14 +45,13 @@ let get_base str =
   |> try_prefix "stdlib__"
 
 module SMap = Map.Make (String)
+module SSet = Set.Make (String)
 
-let ocaml_base_nox = ref [ "debian/ld.conf usr/lib/ocaml" ]
-let ocaml_base = ref []
-let ocaml_nox =
+let ocaml_base = ref [ "debian/ld.conf usr/lib/ocaml" ]
+let ocaml =
   ref [
       "debian/native-archs usr/lib/ocaml";
     ]
-let ocaml = ref []
 let ocaml_compiler_libs = ref []
 let ocaml_interp =
   ref [
@@ -62,18 +61,13 @@ let ocaml_interp =
 let ocaml_man = ref []
 
 let pkgs = [
-    ocaml_base_nox, "ocaml-base-nox";
     ocaml_base, "ocaml-base";
-    ocaml_nox, "ocaml-nox";
     ocaml, "ocaml";
     ocaml_compiler_libs, "ocaml-compiler-libs";
     ocaml_interp, "ocaml-interp";
     ocaml_man, "ocaml-man";
   ]
 
-let set_nox = ocaml_base_nox, ocaml_nox
-let set_x = ocaml_base, ocaml
-
 let installed_files = rev_read_lines "debian/installed-files"
 
 let move_all_to pkg pred xs =
@@ -93,87 +87,87 @@ let static_map = ref SMap.empty
 let () =
   List.iter (fun (file, pkg) -> static_map := SMap.add file pkg !static_map)
     [
-      "usr/bin/ocamllex", ocaml_nox;
-      "usr/bin/ocamlopt", ocaml_nox;
-      "usr/bin/ocamloptp", ocaml_nox;
-      "usr/bin/ocamlcp", ocaml_nox;
-      "usr/bin/ocamlc", ocaml_nox;
-      "usr/bin/ocamldep", ocaml_nox;
-      "usr/bin/ocamlobjinfo", ocaml_nox;
-      "usr/bin/ocamlmklib", ocaml_nox;
-      "usr/bin/ocamlprof", ocaml_nox;
-      "usr/bin/ocamlmktop", ocaml_nox;
-      "usr/lib/ocaml/camlheader", ocaml_nox;
-      "usr/lib/ocaml/camlheaderd", ocaml_nox;
-      "usr/lib/ocaml/camlheaderi", ocaml_nox;
-      "usr/lib/ocaml/eventlog_metadata", ocaml_nox;
-      "usr/lib/ocaml/Makefile.config", ocaml_nox;
-      "usr/lib/ocaml/extract_crc", ocaml_nox;
-      "usr/lib/ocaml/camlheader_ur", ocaml_nox;
-      "usr/lib/ocaml/expunge", ocaml_nox;
-      "usr/lib/ocaml/VERSION", ocaml_base_nox;
-      "usr/lib/ocaml/target_camlheaderd", ocaml_nox;
-      "usr/lib/ocaml/objinfo_helper", ocaml_nox;
-      "usr/lib/ocaml/target_camlheaderi", ocaml_nox;
-      "usr/bin/ocamlmklib.opt", ocaml_nox;
-      "usr/bin/ocamllex.byte", ocaml_nox;
-      "usr/bin/ocamldebug", ocaml_nox;
-      "usr/bin/ocamlobjinfo.byte", ocaml_nox;
-      "usr/bin/ocamlprof.byte", ocaml_nox;
-      "usr/bin/ocamloptp.opt", ocaml_nox;
-      "usr/bin/ocamlmklib.byte", ocaml_nox;
-      "usr/bin/ocamlrund", ocaml_base_nox;
-      "usr/bin/ocamlcp.byte", ocaml_nox;
-      "usr/bin/ocamldep.opt", ocaml_nox;
-      "usr/bin/ocamldoc.opt", ocaml_nox;
-      "usr/bin/ocamlobjinfo.opt", ocaml_nox;
-      "usr/bin/ocamlyacc", ocaml_nox;
-      "usr/bin/ocaml-instr-graph", ocaml_nox;
-      "usr/bin/ocamlcmt", ocaml_nox;
-      "usr/bin/ocamlmktop.byte", ocaml_nox;
-      "usr/bin/ocamldoc", ocaml_nox;
+      "usr/bin/ocamllex", ocaml;
+      "usr/bin/ocamlopt", ocaml;
+      "usr/bin/ocamloptp", ocaml;
+      "usr/bin/ocamlcp", ocaml;
+      "usr/bin/ocamlc", ocaml;
+      "usr/bin/ocamldep", ocaml;
+      "usr/bin/ocamlobjinfo", ocaml;
+      "usr/bin/ocamlmklib", ocaml;
+      "usr/bin/ocamlprof", ocaml;
+      "usr/bin/ocamlmktop", ocaml;
+      "usr/lib/ocaml/camlheader", ocaml;
+      "usr/lib/ocaml/camlheaderd", ocaml;
+      "usr/lib/ocaml/camlheaderi", ocaml;
+      "usr/lib/ocaml/eventlog_metadata", ocaml;
+      "usr/lib/ocaml/Makefile.config", ocaml;
+      "usr/lib/ocaml/extract_crc", ocaml;
+      "usr/lib/ocaml/camlheader_ur", ocaml;
+      "usr/lib/ocaml/expunge", ocaml;
+      "usr/lib/ocaml/VERSION", ocaml_base;
+      "usr/lib/ocaml/target_camlheaderd", ocaml;
+      "usr/lib/ocaml/objinfo_helper", ocaml;
+      "usr/lib/ocaml/target_camlheaderi", ocaml;
+      "usr/bin/ocamlmklib.opt", ocaml;
+      "usr/bin/ocamllex.byte", ocaml;
+      "usr/bin/ocamldebug", ocaml;
+      "usr/bin/ocamlobjinfo.byte", ocaml;
+      "usr/bin/ocamlprof.byte", ocaml;
+      "usr/bin/ocamloptp.opt", ocaml;
+      "usr/bin/ocamlmklib.byte", ocaml;
+      "usr/bin/ocamlrund", ocaml_base;
+      "usr/bin/ocamlcp.byte", ocaml;
+      "usr/bin/ocamldep.opt", ocaml;
+      "usr/bin/ocamldoc.opt", ocaml;
+      "usr/bin/ocamlobjinfo.opt", ocaml;
+      "usr/bin/ocamlyacc", ocaml;
+      "usr/bin/ocaml-instr-graph", ocaml;
+      "usr/bin/ocamlcmt", ocaml;
+      "usr/bin/ocamlmktop.byte", ocaml;
+      "usr/bin/ocamldoc", ocaml;
       "usr/bin/ocaml", ocaml_interp;
-      "usr/bin/ocamlcp.opt", ocaml_nox;
-      "usr/bin/ocaml-instr-report", ocaml_nox;
-      "usr/bin/ocamldep.byte", ocaml_nox;
-      "usr/bin/ocamloptp.byte", ocaml_nox;
-      "usr/bin/ocamlprof.opt", ocaml_nox;
-      "usr/bin/ocamlc.byte", ocaml_nox;
-      "usr/bin/ocamlruni", ocaml_base_nox;
-      "usr/bin/ocamllex.opt", ocaml_nox;
-      "usr/bin/ocamlopt.opt", ocaml_nox;
-      "usr/bin/ocamlmktop.opt", ocaml_nox;
-      "usr/bin/ocamlopt.byte", ocaml_nox;
-      "usr/bin/ocamlrun", ocaml_base_nox;
-      "usr/bin/ocamlc.opt", ocaml_nox;
+      "usr/bin/ocamlcp.opt", ocaml;
+      "usr/bin/ocaml-instr-report", ocaml;
+      "usr/bin/ocamldep.byte", ocaml;
+      "usr/bin/ocamloptp.byte", ocaml;
+      "usr/bin/ocamlprof.opt", ocaml;
+      "usr/bin/ocamlc.byte", ocaml;
+      "usr/bin/ocamlruni", ocaml_base;
+      "usr/bin/ocamllex.opt", ocaml;
+      "usr/bin/ocamlopt.opt", ocaml;
+      "usr/bin/ocamlmktop.opt", ocaml;
+      "usr/bin/ocamlopt.byte", ocaml;
+      "usr/bin/ocamlrun", ocaml_base;
+      "usr/bin/ocamlc.opt", ocaml;
       "usr/share/man/man1/ocaml.1", ocaml_interp;
-      "usr/share/man/man1/ocamllex.1", ocaml_nox;
-      "usr/share/man/man1/ocamlyacc.1", ocaml_nox;
-      "usr/share/man/man1/ocamlrun.1", ocaml_base_nox;
-      "usr/share/man/man1/ocamldoc.1", ocaml_nox;
-      "usr/share/man/man1/ocamlcp.1", ocaml_nox;
-      "usr/share/man/man1/ocamloptp.1", ocaml_nox;
-      "usr/share/man/man1/ocamlc.1", ocaml_nox;
-      "usr/share/man/man1/ocamldep.1", ocaml_nox;
-      "usr/share/man/man1/ocamlmktop.1", ocaml_nox;
-      "usr/share/man/man1/ocamlopt.1", ocaml_nox;
-      "usr/share/man/man1/ocamlprof.1", ocaml_nox;
-      "usr/share/man/man1/ocamldebug.1", ocaml_nox;
+      "usr/share/man/man1/ocamllex.1", ocaml;
+      "usr/share/man/man1/ocamlyacc.1", ocaml;
+      "usr/share/man/man1/ocamlrun.1", ocaml_base;
+      "usr/share/man/man1/ocamldoc.1", ocaml;
+      "usr/share/man/man1/ocamlcp.1", ocaml;
+      "usr/share/man/man1/ocamloptp.1", ocaml;
+      "usr/share/man/man1/ocamlc.1", ocaml;
+      "usr/share/man/man1/ocamldep.1", ocaml;
+      "usr/share/man/man1/ocamlmktop.1", ocaml;
+      "usr/share/man/man1/ocamlopt.1", ocaml;
+      "usr/share/man/man1/ocamlprof.1", ocaml;
+      "usr/share/man/man1/ocamldebug.1", ocaml;
     ]
 
-let base_map = ref SMap.empty
+let base_set = ref SSet.empty
 
 let () =
   List.iter (fun x ->
       try
         let x = chop_prefix "usr/lib/ocaml/stdlib__" x in
         let i = String.index x '.' in
-        base_map := SMap.add (String.sub x 0 i) set_nox !base_map
+        base_set := SSet.add (String.sub x 0 i) !base_set
       with _ -> ()
     ) installed_files
 
 let () =
-  List.iter (fun x -> base_map := SMap.add x set_nox !base_map)
+  List.iter (fun x -> base_set := SSet.add x !base_set)
     [
       "camlinternalOO"; "camlinternalMod"; "camlinternalLazy";
       "camlinternalFormatBasics"; "camlinternalFormat";
@@ -188,11 +182,6 @@ let () =
       "raw_spacetime_lib";
     ]
 
-let () =
-  List.iter (fun x -> base_map := SMap.add x set_x !base_map)
-    [ "graphics"; "graphicsX11" ]
-
-
 let exts_dev = [ ".ml"; ".mli"; ".cmi"; ".cmt"; ".cmti"; ".cmx"; ".cmxa"; ".a"; ".cmo"; ".o" ]
 let exts_run = [ ".cma"; ".cmxs"; ".so" ]
 
@@ -204,30 +193,30 @@ let process_static x =
   | None -> Some x
 
 let find_base base =
-  match SMap.find_opt base !base_map with
-  | Some x -> Some x
-  | None -> SMap.find_opt (String.capitalize_ascii base) !base_map
+  match SSet.mem base !base_set with
+  | true -> true
+  | false -> SSet.mem (String.capitalize_ascii base) !base_set
 
 let process_file x =
   let base = get_base x in
   match find_base base with
-  | Some set ->
+  | true ->
      if List.exists (fun y -> endswith y x) exts_dev then (
-       push (snd set) x
+       push ocaml x
      ) else if List.exists (fun y -> endswith y x) exts_run then (
-       push (fst set) x
+       push ocaml_base x
      ) else Some x
-  | None -> Some x
+  | false -> Some x
 
 let remaining =
   installed_files
-  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/caml/")
-  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/ocamldoc/")
-  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/vmthreads/")
-  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/threads/")
-  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/std_exit.")
-  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/stdlib.")
-  |> move_all_to ocaml_nox (startswith "usr/lib/ocaml/dynlink")
+  |> 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 ocaml_man (endswith ".3o")
   |> rev_filter_map process_static
index 94c0290afbbf56baf4907abe11f239aec8eef9f3..76533a82e1dcdedef8939c29dacbd89598bf5bf3 100755 (executable)
@@ -187,18 +187,18 @@ install-stamp-arch: install-stamp
 # Beware: dh_install does not handle renamings, please pay attention
        set -e; for u in dumpobj; do \
          if [ -f tools/$$u ]; then \
-           cp tools/$$u debian/ocaml-nox/usr/bin/ocaml$$u; \
+           cp tools/$$u debian/ocaml/usr/bin/ocaml$$u; \
          fi \
        done
 # Install the seq compatibility package (OCaml >= 4.07)
-       mkdir -p debian/ocaml-base-nox$(OCAML_STDLIB_DIR)/seq
-       cp debian/META.seq debian/ocaml-base-nox$(OCAML_STDLIB_DIR)/seq/META
+       mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/seq
+       cp debian/META.seq debian/ocaml-base$(OCAML_STDLIB_DIR)/seq/META
 # Install the uchar compatibility package (OCaml >= 4.03)
-       mkdir -p debian/ocaml-base-nox$(OCAML_STDLIB_DIR)/uchar
-       cp debian/META.uchar debian/ocaml-base-nox$(OCAML_STDLIB_DIR)/uchar/META
+       mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/uchar
+       cp debian/META.uchar debian/ocaml-base$(OCAML_STDLIB_DIR)/uchar/META
 # Install the stdlib-shims compatibility package (OCaml >= 4.07)
-       mkdir -p debian/ocaml-base-nox$(OCAML_STDLIB_DIR)/stdlib-shims
-       cp debian/META.stdlib-shims debian/ocaml-base-nox$(OCAML_STDLIB_DIR)/stdlib-shims/META
+       mkdir -p debian/ocaml-base$(OCAML_STDLIB_DIR)/stdlib-shims
+       cp debian/META.stdlib-shims debian/ocaml-base$(OCAML_STDLIB_DIR)/stdlib-shims/META
 # Remaining stuff
        touch $@
 
@@ -233,15 +233,15 @@ override_dh_gencontrol:
          echo 'F:OCamlABI=$(OCAML_ABI)' >> debian/$$u.substvars; \
        done
 ifeq (,$(OCAML_OPT_ARCH))
-       echo 'F:NativeProvides=' >> debian/ocaml-nox.substvars
+       echo 'F:NativeProvides=' >> debian/ocaml.substvars
 else
-       echo 'F:NativeProvides=ocaml-native-compilers (= $${binary:Version})' >> debian/ocaml-nox.substvars
+       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 -Xcompiler-libs \
-        --runtime-map ocaml-nox:ocaml-base-nox,ocaml:ocaml-base \
+        --runtime-map ocaml:ocaml-base \
         --checksum $(OCAML_ABI)
        dh_gencontrol
 # Check that OCAML_ABI is correct
@@ -292,7 +292,7 @@ endif
 
 .PHONY: override_dh_installdocs
 override_dh_installdocs:
-       dh_installdocs --package=ocaml-base-nox --doc-main-package=ocaml
+       dh_installdocs --package=ocaml-base --doc-main-package=ocaml
        dh_installdocs --remaining-packages
 
 override_dh_autoreconf: