Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Devtools
git
Commits
c1c8ebfb
Commit
c1c8ebfb
authored
2 years ago
by
MADELA Patrick
Browse files
Options
Downloads
Patches
Plain Diff
Update for Conan 2.x
parent
a804851b
No related branches found
No related tags found
No related merge requests found
Pipeline
#2056
passed
2 years ago
Stage: build
Stage: test
Stage: package
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+5
-4
5 additions, 4 deletions
.gitlab-ci.yml
conanfile.py
+22
-37
22 additions, 37 deletions
conanfile.py
with
27 additions
and
41 deletions
.gitlab-ci.yml
+
5
−
4
View file @
c1c8ebfb
...
...
@@ -23,12 +23,13 @@ workflow:
-
rm python.zip
-
export PATH=$(readlink -e .)/python-${PYTHON_VERSION}-${PLATFORM}/bin:${PATH}
-
python --version | grep ${PYTHON_VERSION}
-
sudo
python -m pip install --upgrade pip
-
sudo
python -m pip install --upgrade conan
-
python -m pip install --upgrade pip
-
python -m pip install --upgrade conan
# Build git with conan
-
conan profile detect --force
-
conan create . --name git --version ${GIT_VERSION} --user soleil --channel stable -s compiler.libcxx=libstdc++11 --build="*" -c tools.system.package_manager:mode=install -c tools.system.package_manager:tool=yum -c tools.system.package_manager:sudo=True
-
conan install --name git --version ${GIT_VERSION} --user soleil --channel stable -s compiler.libcxx=libstdc++11 --install-folder ${CI_PROJECT_DIR}/${NAME}
-
conan create . --version ${GIT_VERSION} -s compiler.libcxx=libstdc++11 --build="*"
-
conan install --requires git/${GIT_VERSION} -s compiler.libcxx=libstdc++11 --deploy direct_deploy
-
mv git ${CI_PROJECT_DIR}/${NAME}
artifacts
:
name
:
${NAME}
paths
:
...
...
This diff is collapsed.
Click to expand it.
conanfile.py
+
22
−
37
View file @
c1c8ebfb
from
conan
import
ConanFile
from
conan.tools.system
import
package_manager
from
conan.tools.gnu
import
AutotoolsDeps
from
conan.tools.gnu
import
AutotoolsToolchain
from
conan.tools.gnu
import
Autotools
from
conan.tools.files
import
replace_in_file
from
conan.errors
import
ConanInvalidConfiguration
from
conans
import
AutoToolsBuildEnvironment
,
RunEnvironment
,
tools
import
os
class
GitConan
(
ConanFile
):
class
GitRecipe
(
ConanFile
):
name
=
"
git
"
version
=
"
2.40.0
"
settings
=
"
os
"
,
"
compiler
"
,
"
build_type
"
,
"
arch
"
requires
=
\
"
libcurl/7.86.0
"
,
\
"
zlib/1.2.13
"
requires
=
"
libcurl/7.86.0
"
,
"
zlib/1.2.13
"
_autotools
=
None
build_requires
=
"
libcurl/7.86.0
"
_autotools_args
=
[
"
NO_TCLTK=YesPlease
"
,
...
...
@@ -32,43 +31,29 @@ class GitConan(ConanFile):
raise
ConanInvalidConfiguration
(
"
This recipe supports only Linux
"
)
def
source
(
self
):
self
.
run
(
"
curl -s -L -O https://github.com/git/git/archive/refs/tags/v%s.tar.gz
"
%
self
.
version
)
self
.
run
(
"
curl -s -L -O https://github.com/git/git/archive/refs/tags/v%s.tar.gz
"
%
self
.
version
)
self
.
run
(
"
tar -xzf v%s.tar.gz --strip 1
"
%
self
.
version
)
def
_build_configure
(
self
):
if
self
.
_autotools
:
return
self
.
_autotools
self
.
_autotools
=
AutoToolsBuildEnvironment
(
self
)
args
=
[
"
--enable-pthreads=-pthread
"
,
"
--with-tcltk=NO
"
,
]
# Append run environment to autotools environment to have curl-config in path
env_build_vars
=
self
.
_autotools
.
vars
run_environment
=
RunEnvironment
(
self
)
env_build_vars
=
env_build_vars
|
run_environment
.
vars
def
generate
(
self
):
td
=
AutotoolsDeps
(
self
)
td
.
generate
()
tc
=
AutotoolsToolchain
(
self
)
tc
.
configure_args
.
append
(
"
--enable-pthreads=-pthread
"
)
tc
.
configure_args
.
append
(
"
--with-tcltk=NO
"
)
tc
.
generate
()
def
build
(
self
):
# Build configure
self
.
run
(
"
make configure
"
)
self
.
_autotools
.
configure
(
args
=
args
,
vars
=
env_build_vars
)
return
self
.
_autotools
def
build
(
self
):
env_build
=
self
.
_build_configure
()
tools
.
replace_in_file
(
"
Makefile
"
,
"
EXTLIBS += -lrt
"
,
"
EXTLIBS += -lrt -ldl
"
)
env_build
.
make
(
args
=
self
.
_autotools_args
)
autotools
=
Autotools
(
self
)
autotools
.
configure
()
replace_in_file
(
self
,
"
Makefile
"
,
"
EXTLIBS += -lrt
"
,
"
EXTLIBS += -lrt -ldl
"
)
autotools
.
make
(
args
=
self
.
_autotools_args
)
def
package
(
self
):
env_build
=
self
.
_build_configure
(
)
env_build
.
install
(
args
=
self
.
_autotools_args
)
autotools
=
Autotools
(
self
)
autotools
.
install
(
args
=
self
.
_autotools_args
)
def
package_info
(
self
):
self
.
env_info
.
PATH
.
append
(
os
.
path
.
join
(
self
.
package_folder
,
"
bin
"
))
def
deploy
(
self
):
self
.
copy
(
"
*
"
,
symlinks
=
True
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment