Re: [PATCH 3/8] cmake: installation support for git
- From
Sibi Siddharthan <sibisiddharthan.github@gmail.com>
- Date
- Apr 24, 2020, 21:24 UTC
- Message-ID
- <CAKiG+9XWjASSJBx-=HWJ7-8_7fdJbEth2ZdMeSZLkviyUza1hQ@mail.gmail.com>
- In-Reply-To
- <20200424172312.GJ1949@danh.dev>
On Fri, Apr 24, 2020 at 10:53 PM Danh Doan <congdanhqx@gmail.com> wrote:
Show 50 quoted lines
>
> On 2020-04-24 04:01:32+0000, Sibi Siddharthan via GitGitGadget <gitgitgadget@gmail.com> wrote:
> > From: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
> >
> > This patch provides the facility to install the built binaries and
> > scripts.
> >
> > This is very similar to `make install`.
> > By default the destination directory(DESTDIR) is /usr/local/ on Linux
> > To set a custom installation path do this:
> > cmake `relative-path-to-srcdir`
> > -DCMAKE_INSTALL_PREFIX=`preferred-install-path`
> >
> > Then run `make install`
> >
> > Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
> > ---
> > CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 49 insertions(+)
> >
> > diff --git a/CMakeLists.txt b/CMakeLists.txt
> > index 788b53be873..25de5b5bc35 100644
> > --- a/CMakeLists.txt
> > +++ b/CMakeLists.txt
> > @@ -13,6 +13,8 @@ project(git
> > VERSION ${git_version}
> > LANGUAGES C)
> >
> > +#TODO gitk git-gui gitweb
> > +#TODO Add pcre support
> >
> > include(CheckTypeSize)
> > include(CheckCSourceRuns)
> > @@ -631,3 +633,50 @@ if(MSGFMT_EXE)
> > endforeach()
> > add_custom_target(po-gen ALL DEPENDS ${po_gen})
> > endif()
> > +
> > +
> > +#to help with the install
> > +list(TRANSFORM git_shell_scripts PREPEND "${CMAKE_BINARY_DIR}/")
> > +list(TRANSFORM git_perl_scripts PREPEND "${CMAKE_BINARY_DIR}/")
> > +
> > +#install
> > +install(TARGETS git git-shell
> > + RUNTIME DESTINATION bin)
> > +install(PROGRAMS ${CMAKE_BINARY_DIR}/git-cvsserver #${CMAKE_SOURCE_DIR}/gitk-git/gitk check
>
> check? What does it mean?
>It is part of a TODO for gitk, will remove it. Sorry
Show 8 quoted lines
> > + DESTINATION bin)
> > +
> > +list(REMOVE_ITEM PROGRAMS_BUILT git git-shell)
> > +install(TARGETS ${PROGRAMS_BUILT}
> > + RUNTIME DESTINATION libexec/git-core)
>
> Ubuntu install exec file to /usr/lib/git-core?
>Yes it does, but when I do `make install` the programs go to libexec/git-core
Show 30 quoted lines
> > +
> > +set(bin_links
> > + git-receive-pack git-upload-archive git-upload-pack)
> > +
> > +foreach(b ${bin_links})
> > +install(CODE "file(CREATE_LINK ${CMAKE_INSTALL_PREFIX}/bin/git ${CMAKE_INSTALL_PREFIX}/bin/${b})")
> > +endforeach()
> > +
> > +install(CODE "file(CREATE_LINK ${CMAKE_INSTALL_PREFIX}/bin/git ${CMAKE_INSTALL_PREFIX}/libexec/git-core/git)")
> > +install(CODE "file(CREATE_LINK ${CMAKE_INSTALL_PREFIX}/bin/git-shell ${CMAKE_INSTALL_PREFIX}/libexec/git-core/git-shell)")
> > +
> > +foreach(b ${git_links})
> > + string(REPLACE "${CMAKE_BINARY_DIR}" "" b ${b})
> > + install(CODE "file(CREATE_LINK ${CMAKE_INSTALL_PREFIX}/bin/git ${CMAKE_INSTALL_PREFIX}/libexec/git-core/${b})")
> > +endforeach()
> > +
> > +foreach(b ${git_http_links})
> > + string(REPLACE "${CMAKE_BINARY_DIR}" "" b ${b})
> > + install(CODE "file(CREATE_LINK ${CMAKE_INSTALL_PREFIX}/libexec/git-core/git-remote-http ${CMAKE_INSTALL_PREFIX}/libexec/git-core/${b})")
> > +endforeach()
> > +
> > +install(PROGRAMS ${git_shell_scripts} ${git_perl_scripts} ${CMAKE_BINARY_DIR}/git-p4
> > + DESTINATION libexec/git-core)
> > +
> > +install(DIRECTORY mergetools DESTINATION libexec/git-core)
> > +install(DIRECTORY ${CMAKE_BINARY_DIR}/perl/build/lib/ DESTINATION share/perl5
> > + FILES_MATCHING PATTERN "*.pm")
>
> I think distro gonna complans about this pattern!
>What are you trying to say? Can you explain a bit more.
Show 10 quoted lines
> > +install(DIRECTORY ${CMAKE_BINARY_DIR}/templates/blt/ DESTINATION share/git-core/templates)
> > +
> > +if(MSGFMT_EXE)
> > + install(DIRECTORY ${CMAKE_BINARY_DIR}/po/build/locale DESTINATION share)
> > +endif()
>
> I thought we want to check for NO_GETTEXT?
>
> --
> DanhThank You, Sibi Siddharthan