Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
pub
frama-c
Commits
62d13640
Commit
62d13640
authored
2 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[distrib] improves make-distrib
parent
bbedd4bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+7
-4
7 additions, 4 deletions
.gitlab-ci.yml
devel_tools/make-distrib.sh
+96
-10
96 additions, 10 deletions
devel_tools/make-distrib.sh
with
103 additions
and
14 deletions
.gitlab-ci.yml
+
7
−
4
View file @
62d13640
...
...
@@ -25,6 +25,10 @@ variables:
build-distrib-tarball
:
stage
:
build
variables
:
OPEN_SOURCE
:
"
yes"
CI_LINK
:
"
yes"
HDRCK
:
"
frama-c-hdrck"
script
:
-
nix-shell nix/pkgs.nix -A ocaml-ng.ocamlPackages_$OCAML.frama-c-checkers-shell
--run 'autoconf && ./devel_tools/make-distrib.sh'
...
...
@@ -32,7 +36,7 @@ build-distrib-tarball:
-
nix
artifacts
:
paths
:
-
frama-c
.tar.gz
-
./*
.tar.gz
expire_in
:
1 week
check-no-old-frama-c
:
...
...
@@ -240,12 +244,11 @@ manuals:
# OCAML: "4_13"
# <<: *ocaml
src-distrib-tests
:
stage
:
distrib_and_compatibility
script
:
-
mkdir extracted && tar -xzf frama-c.tar.gz -C ./extracted
-
nix-build extracted/
frama-c/
nix/pkgs.nix -A ocaml-ng.ocamlPackages_$OCAML.src-distrib-tests
-
mkdir extracted && tar -xzf frama-c.tar.gz
--strip-components 1
-C ./extracted
-
nix-build extracted/nix/pkgs.nix -A ocaml-ng.ocamlPackages_$OCAML.src-distrib-tests
tags
:
-
nix
...
...
This diff is collapsed.
Click to expand it.
devel_tools/make-distrib.sh
+
96
−
10
View file @
62d13640
...
...
@@ -28,21 +28,107 @@ if [ ! -f configure ] ; then
exit
2
fi
EXTERNAL_PLUGINS
=
$(
find src/plugins
-type
d
-name
".git"
|
sed
"s/.git//"
)
################################################################################
# Configuration
FRAMAC
=
"frama-c.tar"
git archive HEAD
-o
$FRAMAC
--prefix
"frama-c/"
if
[
-z
${
OPEN_SOURCE
+x
}
]
;
then
echo
"OPEN_SOURCE variable not set, defaults to 'no'"
OPEN_SOURCE
=
"no"
fi
if
[
-z
${
HDRCK
+x
}
]
;
then
HDRCK
=
"dune exec -- frama-c-hdrck"
fi
if
[
-z
${
VERSION
+x
}
]
;
then
VERSION
=
$(
cat
VERSION |
sed
"s,~,-,"
)
fi
if
[
-z
${
VERSION_CODENAME
+x
}
]
;
then
VERSION_CODENAME
=
$(
cat
VERSION_CODENAME
)
fi
if
[
-z
${
CI_LINK
+x
}
]
;
then
CI_LINK
=
"no"
fi
ACC
=
$FRAMAC
FRAMAC
=
"frama-c-
$VERSION
-
$VERSION_CODENAME
"
FRAMAC_TAR
=
"
$FRAMAC
.tar"
################################################################################
# Prepare archive
git archive HEAD
-o
$FRAMAC_TAR
--prefix
"
$FRAMAC
/"
TAR_ACC
=
$FRAMAC_TAR
EXTERNAL_PLUGINS
=
$(
find src/plugins
-type
d
-name
".git"
|
sed
"s/
\/
.git//"
)
for
plugin
in
$EXTERNAL_PLUGINS
;
do
TAR
=
"
$(
basename
$plugin
)
.tar"
git
-C
$plugin
archive HEAD
-o
$TAR
--prefix
"frama-c/
$plugin
/"
ACC
=
"
$ACC
$plugin$TAR
"
git
-C
$plugin
archive HEAD
-o
$TAR
--prefix
"
$FRAMAC
/
$plugin
/"
TAR_ACC
=
"
$TAR_ACC
$plugin
/
$TAR
"
done
tar
--concatenate
--file
=
$TAR_ACC
tar
rf
$FRAMAC_TAR
configure
--transform
"s,^,
$FRAMAC
/,"
################################################################################
# Prepare header options
if
[[
"
$OPEN_SOURCE
"
==
"yes"
]]
;
then
HEADER_KIND
=
"open-source"
HEADER_OPT
=
else
HEADER_KIND
=
"close-source"
HEADER_OPT
=
"-update"
fi
################################################################################
# Prepare header spec
HEADER_SPEC
=
"header-spec.txt"
git ls-files
-z
| git check-attr
--stdin
-z
header_spec
>
$HEADER_SPEC
HEADER_DIRS
=
"-header-dirs headers/
$HEADER_KIND
"
for
plugin
in
$EXTERNAL_PLUGINS
;
do
git
-C
$plugin
ls-files
-z
|
\
git
-C
$plugin
check-attr
--stdin
-z
header_spec |
\
xargs
--null
-n3
printf
"
$plugin
/%s
\n
%s
\n
%s
\n
"
|
\
tr
'\n'
'\0'
>>
$HEADER_SPEC
done
tar
--concatenate
--file
=
$ACC
tar
rf
$FRAMAC
configure
--transform
's,^,frama-c/,'
gzip
-9
<
$FRAMAC
>
$FRAMAC
.gz
PLUGINS
=
$(
find src/plugins
-type
d
-mindepth
1
-maxdepth
1
)
for
plugin
in
$PLUGINS
;
do
HEADER_DIRS
=
"
$HEADER_DIRS
-header-dirs
$plugin
/headers/
$HEADER_KIND
"
done
################################################################################
# Headers
TMP_DIR
=
$(
mktemp
-d
)
echo
$TMP_DIR
tar
xf
$FRAMAC_TAR
-C
$TMP_DIR
$HDRCK
$HEADER_OPT
$HEADER_DIRS
-spec-format
=
"3-zeros"
-C
"
$TMP_DIR
/
$FRAMAC
"
$HEADER_SPEC
echo
$VERSION
>
$TMP_DIR
/
$FRAMAC
/VERSION
echo
$VERSION_CODENAME
>
$TMP_DIR
/
$FRAMAC
/VERSION_CODENAME
################################################################################
# Finalize archive
tar
czf
$FRAMAC_TAR
.gz
-C
$TMP_DIR
$FRAMAC
if
[[
"
$CI_LINK
"
==
"yes"
]]
;
then
ln
$FRAMAC_TAR
.gz
"frama-c.tar.gz"
fi
################################################################################
# Cleaning
rm
-f
$ACC
rm
-rf
$HEADER_SPEC
rm
-rf
$TAR_ACC
rm
-rf
$TMP_DIR
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