From efc46ca1bf7ee9dd3e95b5515a0171f8ebe0dbff Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Thu, 31 May 2018 11:49:48 +0200 Subject: [PATCH] Add documentation to C++ and Python Package For C++ doc: /usr/share/doc/ortools ref: https://www.debian.org/doc/manuals/debian-reference/debian-reference.en.txt For Python doc: ref: https://www.python.org/dev/peps/pep-0427/#the-data-directory ref: https://www.python.org/dev/peps/pep-0491/#install-paths /!\ Please not bdist_wheel command ignore MANIFEST.in and there is no 'doc_dir' option in class Distribution cf. https://github.com/pypa/setuptools/blob/master/setuptools/dist.py --- makefiles/Makefile.cpp.mk | 15 ++++++++++++--- makefiles/Makefile.python.mk | 3 ++- tools/setup.py | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/makefiles/Makefile.cpp.mk b/makefiles/Makefile.cpp.mk index b9903ac780..d4b5c33af5 100755 --- a/makefiles/Makefile.cpp.mk +++ b/makefiles/Makefile.cpp.mk @@ -840,8 +840,9 @@ rcc: $(BIN_DIR)/$(basename $(notdir $(EX)))$E # ref: https://www.gnu.org/prep/standards/html_node/DESTDIR.html install_dirs: -$(MKDIR) "$(DESTDIR)$(prefix)" - -$(MKDIR) "$(DESTDIR)$(prefix)$Slib" -$(MKDIR) "$(DESTDIR)$(prefix)$Sinclude" + -$(MKDIR) "$(DESTDIR)$(prefix)$Slib" + -$(MKDIR) "$(DESTDIR)$(prefix)$Sbin" -$(DELREC) "$(DESTDIR)$(prefix)$Sinclude$Sortools" $(MKDIR) "$(DESTDIR)$(prefix)$Sinclude$Sortools" $(MKDIR) "$(DESTDIR)$(prefix)$Sinclude$Sortools$Salgorithms" @@ -856,7 +857,7 @@ install_dirs: $(MKDIR) "$(DESTDIR)$(prefix)$Sinclude$Sortools$Sutil" .PHONY: install_cc # Install C++ OR-Tools to $(DESTDIR)$(prefix) -install_cc: install_libortools install_third_party +install_cc: install_libortools install_third_party install_doc install_libortools: ortoolslibs install_dirs $(COPY) LICENSE-2.0.txt "$(DESTDIR)$(prefix)" @@ -878,7 +879,7 @@ install_libortools: ortoolslibs install_dirs $(COPY) ortools$Sutil$S*.h "$(DESTDIR)$(prefix)$Sinclude$Sortools$Sutil" $(COPY) $(LIB_DIR)$S$(LIB_PREFIX)ortools.$L "$(DESTDIR)$(prefix)$Slib" -install_third_party: +install_third_party: install_dirs ifeq ($(UNIX_GFLAGS_DIR),$(OR_TOOLS_TOP)/dependencies/install) $(COPYREC) dependencies$Sinstall$Sinclude$Sgflags "$(DESTDIR)$(prefix)$Sinclude" $(COPYREC) dependencies$Sinstall$Slib$Slibgflags* "$(DESTDIR)$(prefix)$Slib" @@ -904,6 +905,14 @@ ifeq ($(UNIX_CBC_DIR),$(OR_TOOLS_TOP)/dependencies/install) $(COPYREC) dependencies$Sinstall$Sbin$Sclp "$(DESTDIR)$(prefix)$Sbin" endif +install_doc: + -$(DELREC) "$(DESTDIR)$(prefix)$Sshare$Sdoc$Sortools" + -$(MKDIR_P) "$(DESTDIR)$(prefix)$Sshare$Sdoc$Sortools" + -$(MKDIR) "$(DESTDIR)$(prefix)$Sshare$Sdoc$Sortools$Ssat" + -$(MKDIR) "$(DESTDIR)$(prefix)$Sshare$Sdoc$Sortools$Ssat$Sdoc" +#$(COPY) ortools$Ssat$S*.md "$(DESTDIR)$(prefix)$Sshare$Sdoc$Sortools$Ssat" + $(COPY) ortools$Ssat$Sdoc$S*.md "$(DESTDIR)$(prefix)$Sshare$Sdoc$Sortools$Ssat$Sdoc" + .PHONY: detect_cc # Show variables used to build C++ OR-Tools. detect_cc: @echo Relevant info for the C++ build: diff --git a/makefiles/Makefile.python.mk b/makefiles/Makefile.python.mk index 2bc52a2176..87dceab64a 100755 --- a/makefiles/Makefile.python.mk +++ b/makefiles/Makefile.python.mk @@ -524,7 +524,7 @@ MISSING_PYPI_FILES = \ $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/linear_solver \ $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/sat \ $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/data \ - $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util \ + $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util $(PYPI_ARCHIVE_TEMP_DIR): $(MKDIR) $(PYPI_ARCHIVE_TEMP_DIR) @@ -653,6 +653,7 @@ $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/sat: $(PYSAT_LIBS) | $(PYPI_ARCHIVE_TEM -$(DELREC) $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Sortools$Ssat $(MKDIR) $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Sortools$Ssat $(TOUCH) $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Sortools$Ssat$S__init__.py + $(COPY) ortools$Ssat$Sdoc$S*.md $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Sortools$Ssat $(COPY) ortools$Ssat$S*.py $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Sortools$Ssat $(COPY) $(GEN_DIR)$Sortools$Ssat$S*.py $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Sortools$Ssat $(COPY) $(GEN_DIR)$Sortools$Ssat$S_pywrapsat.* $(PYPI_ARCHIVE_TEMP_DIR)$Sortools$Sortools$Ssat diff --git a/tools/setup.py b/tools/setup.py index 1eaf4ac7f8..6c292a7662 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -55,7 +55,7 @@ setup( 'ortools.linear_solver' : ['_pywraplp.dll'], 'ortools.graph' : ['_pywrapgraph.dll'], 'ortools.algorithms' : ['_pywrapknapsack_solver.dll'], - 'ortools.sat' : ['_pywrapsat.dll'], + 'ortools.sat' : ['_pywrapsat.dll', '*.md'], DELETEWIN 'ortools' : ['libortools.DLL' DDDD] }, include_package_data=True,