Skip to content

Commit 7249414

Browse files
committed
add libraries
1 parent 943bb8d commit 7249414

File tree

405 files changed

+502943
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

405 files changed

+502943
-0
lines changed

deps/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Dependencies
2+
The `deps/` folder contains the dependencies used to build and link statically `picotool` and `elf2uf2`: the libraries `libusb` and `libudev`.
3+
The `deps/` folder contains also a bash script used by the docker container to successfully build them with different toolchains and with different targets.
4+
This way they are already compiled and usable by the CI during the building/linking phase!
5+
6+
They come respectively from [here](https://github.com/arduino/OpenOCD-build-script/tree/static/libusb-1.0.20)
7+
and from [here](https://github.com/gentoo/eudev)
8+
9+
## `build_libs.sh`
10+
`build_libs.sh` is used by the [Dockerfile](../Dockerfile#L49-L55):
11+
Basically during the docker build phase the libraries are compiled with every toolchain available in the Docker container. Other libraries can be added, the `build_libs.sh` script needs to be adapted, but the Dockerfile should be ok.
12+
13+
## libusbudev
14+
libusbudev is the result of merging the two `.a` files with a command line tool called `ar`. This is done to ease the linking phase done by the [CI](.github/workflows/release.yml#L87) passing a single static library. See `LIBUSBUDEV` env variable [here](.github/workflows/release.yml#L67) and [here](.github/workflows/release.yml#L71).
15+
For macos is not required to merge the two libraries because libudev is not a requirement, so macos uses `libusb.a` only: thus the distinction between the two platforms. Infact libusb for mac is the last one built in the Dockerfile.
16+
17+
`libusbudev.a` is created by the `build_libs.sh` the directory structure created is the following:
18+
19+
```
20+
/opt/lib/
21+
|-- aarch64-linux-gnu
22+
| |-- libudev
23+
| |-- libusb
24+
| `-- libusbudev.a
25+
|-- arm-linux-gnueabihf
26+
| |-- libudev
27+
| |-- libusb
28+
| `-- libusbudev.a
29+
|-- build_libs.sh
30+
|-- eudev-3.2.10
31+
|-- i686-ubuntu16.04-linux-gnu
32+
| |-- libudev
33+
| |-- libusb
34+
| `-- libusbudev.a
35+
|-- i686-w64-mingw32
36+
| |-- libudev
37+
| |-- libusb
38+
| `-- libusbudev.a
39+
|-- libusb-1.0.20
40+
`-- x86_64-ubuntu16.04-linux-gnu
41+
|-- libudev
42+
|-- libusb
43+
`-- libusbudev.a
44+
```
45+
46+
The original `libusb.a` is in `/opt/lib/libusb-1.0.20/libusb/.libs/libusb-1.0.a`
47+
and `libudev.a` is in `/opt/lib/eudev-3.2.10/src/libudev/.libs/libudev.a`

deps/build_libs.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
if [ x$CROSS_COMPILER == x ]; then
4+
CROSS_COMPILER=${CROSS_COMPILE}-gcc
5+
else
6+
export CC=$CROSS_COMPILER
7+
fi
8+
# udev lib not required for macos
9+
if [[ ${CROSS_COMPILE} != *apple* ]]; then
10+
cd /opt/lib/eudev-3.2.10
11+
export UDEV_DIR=`pwd`
12+
./autogen.sh
13+
./configure --enable-static --disable-shared --disable-blkid --disable-kmod --disable-manpages --host=${CROSS_COMPILE}
14+
make clean
15+
make -j4
16+
cd ..
17+
export CFLAGS="-I$UDEV_DIR/src/libudev/"
18+
export LDFLAGS="-L$UDEV_DIR/src/libudev/.libs/"
19+
export LIBS="-ludev"
20+
fi
21+
cd /opt/lib/libusb-1.0.20
22+
export LIBUSB_DIR=`pwd`
23+
./configure --enable-static --disable-shared --host=${CROSS_COMPILE}
24+
make clean
25+
make
26+
cd ..
27+
# libusbudev.a merged not required for macos
28+
if [[ ${CROSS_COMPILE} != *apple* ]]; then
29+
mkdir -p ${CROSS_COMPILE}/libusb
30+
mkdir -p ${CROSS_COMPILE}/libudev
31+
cd ${CROSS_COMPILE}/libusb/
32+
ar -x ../../libusb-1.0.20/libusb/.libs/libusb-1.0.a
33+
cd ../libudev/
34+
ar -x ../../eudev-3.2.10/src/libudev/.libs/libudev.a
35+
cd ..
36+
ar -qc libusbudev.a libudev/* libusb/*
37+
fi

deps/eudev-3.2.10/.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
src/udev/udevadm
2+
src/udev/udevd
3+
4+
*.[oa]
5+
*.l[oa]
6+
.libs
7+
.deps
8+
Makefile
9+
Makefile.in
10+
11+
aclocal.m4
12+
autom4te.cache
13+
compile
14+
config.*
15+
configure
16+
libtool
17+
stamp-h1
18+
19+
depcomp
20+
install-sh
21+
ltmain.sh
22+
missing
23+
24+
*.pc
25+
26+
m4/libtool.m4
27+
m4/ltoptions.m4
28+
m4/ltsugar.m4
29+
m4/ltversion.m4
30+
m4/lt~obsolete.m4
31+
32+
rule_generator/write_net_rules
33+
34+
rules/64-btrfs.rules
35+
36+
src/ata_id/ata_id
37+
src/cdrom_id/cdrom_id
38+
src/collect/collect
39+
src/mtd_probe/mtd_probe
40+
src/scsi_id/scsi_id
41+
src/v4l_id/v4l_id
42+
43+
src/udev/keyboard-keys-from-name.gperf
44+
src/udev/keyboard-keys-from-name.h
45+
src/udev/keyboard-keys-to-name.h
46+
src/udev/keyboard-keys.txt
47+
48+
test/test-libudev
49+
test/test-udev
50+
test/test
51+
test-driver
52+
53+
test/rules-test.sh.log
54+
test/rules-test.sh.trs
55+
test/test-suite.log
56+
test/udev-test.pl.log
57+
test/udev-test.pl.trs
58+
59+
eudev-*.tar.gz

deps/eudev-3.2.10/.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: c
2+
compiler:
3+
- gcc
4+
- clang
5+
before_install:
6+
- sudo apt-get update -qq
7+
- sudo apt-get install autotools-dev automake autoconf libtool gperf xsltproc docbook-xsl
8+
script: ./autogen.sh && ./configure && make V=1 distcheck
9+
notifications:
10+
irc:
11+
channels:
12+
- "irc.freenode.org#gentoo-udev"
13+
on_success: change
14+
on_failure: always

deps/eudev-3.2.10/CONTRIBUTING

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
2+
CONTRIBUTING.
3+
4+
Please read the following guidelines before contributing.
5+
6+
1. The basic unit of contribution is a "git commit". This will be merged into
7+
master by one of the team members who will review it and sign-off/commit or
8+
reject it. If the commit is in another branch, it will added to HEAD/master
9+
using
10+
11+
git cherry-pick -s <tree-ish>
12+
13+
Or if the commit is submitted as a stand alone file produce by
14+
15+
git format-patch <tree-ish>
16+
17+
Then it will be committed by
18+
19+
git am -s 0001-foo-bar.patch
20+
21+
Or if the commit is submitted as a github merge request, then the github web
22+
interface can be used.
23+
24+
25+
26+
2. Work in a branch immediately off of master, do not work directly in master,
27+
and do not be afraid of creating a local branch for every experimental thing you
28+
want to try:
29+
30+
git checkout master # make sure your on master
31+
git branch idea1 # I've got an idea, let me work on it
32+
git checkout idea1
33+
<hack ... hack ... hack>
34+
git commit -m "step1" # I like what I've done so far, but I'm not finished
35+
<hack ... hack ... hack>
36+
git commit -m "step2"
37+
<hack ... hack ... hack>
38+
git commit -m "step3"
39+
<hack ... hack ... hack>
40+
git revert <tree-ish for step2> # Wow step 2 was dumb
41+
<hack ... hack ... hack>
42+
git commit -m "step4" # Its good now, but those
43+
# commits are messy
44+
45+
git rebase -i <tree-ish step1>^ # start a rebase on the parent of step1
46+
(drop into editor and squash commits) # note the ^ at the end!
47+
(exit editor and fix commit message)
48+
49+
Alternatively, you can cherry-pick those commits into another prestine branch:
50+
51+
... its good to go! ....
52+
53+
git checkout master
54+
git branch idea1-clean
55+
git checkout idea1-clean
56+
git cherry-pick <sha1-of-good-commit1>
57+
git cherry-pick <sha1-of-good-commit2>
58+
(pick them in any order that stacks)
59+
(you can skip commits, but do them in the correct order to avoid conflits)
60+
git rebase -i <tree-ish of sha1-of-good-commit1>^ # squash many commits into one
61+
# note the ^ at the end!
62+
63+
Once you are done with a local branch you can delete it using
64+
65+
git branch -D idea1
66+
67+
You can delete a remote branch by doing
68+
69+
git push origin :idea1
70+
71+
72+
73+
3. Your commit message should conform to the following standard:
74+
75+
file/changed: Concice and complete statement of the purpose
76+
77+
This is the body of the commit message. The line above is the
78+
summary. The summary should be no more than 72 chars long. The
79+
body can be more freely formatted, but make it look nice. Make
80+
sure to reference any bug reports and other contributors. Make
81+
sure the correct authorship appears. Reference any early commits
82+
by their full shaw:
83+
84+
b52c6402b5b42620571c36c74a12dcb45ec1e0d6
85+
86+
which you can put on its own line and indent.
87+
88+
X-Gentoo-Bug: 400837
89+
X-Gentoo-Bug-URL: https://bugs.gentoo.org/400837
90+
91+
Reported-by: Snoopy Coderdog <[email protected]>
92+
Signed-off-by: Anthony G. Basile <[email protected]>
93+
94+
If you commit using
95+
96+
git commit -s
97+
98+
your sign-off will be automatically added. If the authorship is wrong
99+
fix it by
100+
101+
git commit -s --author="Richard Feynmann <[email protected]>"
102+
103+
If the message doesn't look right after you commit locally, you can fix it by
104+
doing
105+
106+
git commit --amend.
107+
108+
Then push it to your public repo.
109+
110+
111+
4.a Open an issue at (using GitHub)
112+
113+
https://github.com/gentoo/eudev/issues?state=open
114+
115+
And request a pull of your clean commit. A team member will review it,
116+
discuss it and commit it to master or reject it.
117+
118+
119+
4.b Send to mailing list (using git format-patch)
120+
Make sure you are subscribe on the mailing list. If you do not, send an email to
121+
122+
and follow instructions.
123+
124+
When sending patches to mailing list, use
125+
git send-email --to [email protected] 0001-foo-bar.patch
126+
127+
5. eudev is a peer-reviewed project. So even team members must ask another
128+
team member to sign-off and commit your work. The only exception are trivial
129+
commits
130+
131+
132+
6. HEAD/master must always build and must always be considered stable.
133+
134+
135+
7. Releases should be tagged and signed using
136+
137+
git tag -s -u <gpg name> -m "Release X"
138+
139+
where X is the full release number. Make sure that before you release,
140+
you change the value in AC_INIT of configure.ac to match the release
141+
number.
142+
143+
144+
8. Tarball releases should be made from HEAD/master at signed tagged points
145+
by doing
146+
147+
autogen.sh
148+
./configure
149+
make
150+
make dist
151+
152+
153+
9. TODO: coding style for C, python, perl and autotool stuff.

0 commit comments

Comments
 (0)