Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in / Register
Toggle navigation
L
libffi-tarballs
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
libffi-tarballs
Commits
eb329453
Commit
eb329453
authored
Sep 30, 2017
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mk-snapshot script
parent
139e77eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
mk-snapshot.sh
mk-snapshot.sh
+48
-0
No files found.
mk-snapshot.sh
0 → 100755
View file @
eb329453
#!/bin/bash -e
# Create a snapshot of the libffi repository from github, as a workaround for
# the lack of recent releases of libffi (see https://github.com/libffi/libffi/issues/296)
GVERS
=
3.99999
# see configure.ac / AC_INIT
# make a temporary directory and perform operations in there.
TMPD
=
$(
mktemp
-d
)
TDIR
=
$(
pwd
)
# clone the repository (shallow is sufficient)
git
-C
${
TMPD
}
clone
--depth
1 https://github.com/libffi/libffi.git
REPO
=
"
${
TMPD
}
/libffi"
# record the revision and create a copy of only the files
# contained in the repository at libffi-<revision>
GHASH
=
$(
git
-C
${
REPO
}
rev-parse
--short
HEAD
)
GDATE
=
$(
git
-C
${
REPO
}
log
-1
--pretty
=
format:%cd
--date
=
format:%Y%m%d
)
SUFFIX
=
"
${
GVERS
}
+git
${
GDATE
}
+
${
GHASH
}
"
git
-C
${
REPO
}
archive
--format
=
tar
--prefix
=
"libffi-
${
SUFFIX
}
/"
HEAD |
tar
-C
${
TMPD
}
-x
# run and remove autogen, so we don't have to run it on the CI or elsewhere
# and as such incure additional dependencies like libtool.
(
cd
"
${
TMPD
}
/libffi-
${
SUFFIX
}
"
&&
./autogen.sh
&&
rm
autogen.sh
)
# package it up
LIB
=
"libffi-
${
SUFFIX
}
.tar.gz"
(
cd
"
${
TMPD
}
"
&&
tar
-czf
"
${
LIB
}
"
"libffi-
${
SUFFIX
}
"
)
mv
"
$TMPD
/
$LIB
"
./
$LIB
# create orphan branch
git checkout
--orphan
"libffi-
${
SUFFIX
}
"
git add
$LIB
cat
>
README.md
<<
EOF
# libffi snapshot tarball for GHC
This source snapshot was produced from
[libffi](https://github.com/libffi/libffi) commit
[
${
GHASH
}
](https://github.com/libffi/libffi/commit/
${
GHASH
}
) for GHC. See the
\`
master
\`
branch of this repository for more information about the rationale
and tools for producing these snapshots.
EOF
git add README.md
git
rm
--cached
mk-snapshot.sh
git commit
-m
"Snapshot of libffi
${
GHASH
}
"
echo
"Created branch libffi-
${
SUFFIX
}
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment