Skip to content

Commit 442bc5b

Browse files
authored
Merge pull request #19 from aboutcode-org/build-src
Build src
2 parents d62b372 + b44971d commit 442bc5b

23 files changed

+514
-940
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
v0.5.0 (2024-11-05)
5+
-------------------
6+
7+
- Build GoReSym from source instead of vendoring the binary.
8+
- Support building go-inspector for Linux aarch64/arm64 platform.
9+
- Update GoReSym to v3.0.1
410

511
v0.4.0 (2024-10-31)
612
-------------------

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ PYTHON_EXE?=python3
1313
VENV=venv
1414
ACTIVATE?=. ${VENV}/bin/activate;
1515

16+
ARCH := $(shell uname -m)
17+
ifeq ($(ARCH),aarch64)
18+
PLAT_NAME := "manylinux2014_aarch64"
19+
GOARCH := "arm64"
20+
else
21+
PLAT_NAME := "manylinux1_x86_64"
22+
GOARCH := "amd64"
23+
endif
24+
1625
dev:
1726
@echo "-> Configure the development envt."
1827
./configure --dev
@@ -35,7 +44,7 @@ check:
3544
@echo "-> Run pycodestyle (PEP8) validation"
3645
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
3746
@echo "-> Run isort imports ordering validation"
38-
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
47+
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
3948
@echo "-> Run black validation"
4049
@${ACTIVATE} black --check --check -l 100 src tests setup.py
4150

@@ -51,4 +60,9 @@ docs:
5160
rm -rf docs/_build/
5261
@${ACTIVATE} sphinx-build docs/ docs/_build/
5362

63+
build:
64+
rm -f src/go_inspector/bin/GoReSym_lin
65+
python setup.py clean --all sdist
66+
GOOS=linux GOARCH=$(GOARCH) python setup.py clean --all bdist_wheel --python-tag py3 --plat-name $(PLAT_NAME)
67+
5468
.PHONY: conf dev check valid black isort clean test docs

README.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ To install and use:
1111

1212
The JSON output will contain various dependencies and symbols found in Go binaries if any.
1313

14+
A Go compiler is required to build go-inspector. Install Go from
15+
https://go.dev/doc/install or from a package manager.
1416

1517
- License: Apache-2.0 AND MIT AND BSD-3-Clause WITH LicenRef-scancode-google-patent-license-golang
1618
- Copyright (c) nexB Inc., AboutCode, Mandiant, The Go Authors, Elliot Chance and others.
1719
- Homepage: https://github.com/aboutcode-org/go-inspector
1820

19-
See the src/go_inspector/bin for detailed license and credits for bundled third-party packages.
21+
See the libsrc/ directory for detailed license and credits for bundled third-party packages.
2022

2123

2224
Development
@@ -31,6 +33,9 @@ Testing:
3133
- To regen test fixtures: ``SCANCODE_REGEN_TEST_FIXTURES=yes pytest -vvs``
3234
- To update the bundled GoReSym, see src/bin/update.sh
3335

36+
Building:
37+
38+
- Ensure ``make dev`` has been run, then run ``make build``
3439

3540
How to re-generate test binaries
3641
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -50,27 +55,27 @@ This project is funded, supported and sponsored by:
5055

5156
- Generous support and contributions from users like you!
5257
- the European Commission NGI programme
53-
- the NLnet Foundation
58+
- the NLnet Foundation
5459
- the Swiss State Secretariat for Education, Research and Innovation (SERI)
5560
- Google, including the Google Summer of Code and the Google Seasons of Doc programmes
5661
- Mercedes-Benz Group
5762
- Microsoft and Microsoft Azure
5863
- AboutCode ASBL
59-
- nexB Inc.
64+
- nexB Inc.
6065

6166

6267

63-
|europa| |dgconnect|
68+
|europa| |dgconnect|
6469

65-
|ngi| |nlnet|
70+
|ngi| |nlnet|
6671

6772
|aboutcode| |nexb|
6873

6974

7075

7176
This project was funded through the NGI0 Entrust Fund, a fund established by NLnet with financial
7277
support from the European Commission's Next Generation Internet programme, under the aegis of DG
73-
Communications Networks, Content and Technology under grant agreement No 101069594.
78+
Communications Networks, Content and Technology under grant agreement No 101069594.
7479

7580
|ngizeroentrust| https://nlnet.nl/project/Back2source/
7681

@@ -84,7 +89,7 @@ Communications Networks, Content and Technology under grant agreement No 1010929
8489

8590
This project was funded through the NGI0 Entrust Fund, a fund established by NLnet with financial
8691
support from the European Commission's Next Generation Internet programme, under the aegis of DG
87-
Communications Networks, Content and Technology under grant agreement No 101069594.
92+
Communications Networks, Content and Technology under grant agreement No 101069594.
8893

8994
|ngizeroentrust| https://nlnet.nl/project/purl2all/
9095

build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) nexB Inc. http://www.nexb.com/ - All rights reserved.
4+
#
5+
6+
set -e
7+
8+
base_name=GoReSym-3.0.1
9+
GOOS=linux
10+
11+
if [ $(uname -m) == 'aarch64' ]; then
12+
GOARCH="arm64"
13+
else
14+
GOARCH="amd64"
15+
fi
16+
17+
cd lib-src/
18+
19+
rm -rf $base_name
20+
tar -xf $base_name.tar.gz
21+
22+
cd $base_name/
23+
24+
echo Build GoReSym
25+
go build && mv GoReSym GoReSym_lin
26+
strip GoReSym_lin
27+
cp GoReSym_lin ../../src/go_inspector/bin/
28+
cd ..
29+
echo Done building GoReSym
30+
31+
rm -rf $base_name/

lib-src/GoReSym-3.0.1.tar.gz

48.6 MB
Binary file not shown.

lib-src/GoReSym-3.0.1.tar.gz.ABOUT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
about_resource: GoReSym-3.0.1.tar.gz
2+
name: GoReSym
3+
version: 3.0.1
4+
download_url: https://github.com/mandiant/GoReSym/archive/refs/tags/v3.0.1.tar.gz
5+
package_url: pkg:github/mandiant/[email protected]
6+
copyright: Copyright (c) 2022 MANDIANT
7+
license_expression: mit
8+
license_text_file: GoReSym_lin.LICENSE

lib-src/GoReSym-3.0.1.tar.gz.LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 MANDIANT
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
File renamed without changes.

0 commit comments

Comments
 (0)